diff options
Diffstat (limited to 'SI/.obsidian/plugins/obsidian-tasks-plugin/main.js')
| -rw-r--r-- | SI/.obsidian/plugins/obsidian-tasks-plugin/main.js | 128 |
1 files changed, 75 insertions, 53 deletions
diff --git a/SI/.obsidian/plugins/obsidian-tasks-plugin/main.js b/SI/.obsidian/plugins/obsidian-tasks-plugin/main.js index f628b5c..67f230b 100644 --- a/SI/.obsidian/plugins/obsidian-tasks-plugin/main.js +++ b/SI/.obsidian/plugins/obsidian-tasks-plugin/main.js @@ -122,14 +122,14 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -"use strict";var Gk=Object.create;var fa=Object.defineProperty,Yk=Object.defineProperties,Bk=Object.getOwnPropertyDescriptor,Hk=Object.getOwnPropertyDescriptors,Vk=Object.getOwnPropertyNames,eu=Object.getOwnPropertySymbols,zk=Object.getPrototypeOf,xc=Object.prototype.hasOwnProperty,Vh=Object.prototype.propertyIsEnumerable;var Hh=(r,e,t)=>e in r?fa(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,X=(r,e)=>{for(var t in e||(e={}))xc.call(e,t)&&Hh(r,t,e[t]);if(eu)for(var t of eu(e))Vh.call(e,t)&&Hh(r,t,e[t]);return r},be=(r,e)=>Yk(r,Hk(e));var tu=(r,e)=>{var t={};for(var n in r)xc.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&eu)for(var n of eu(r))e.indexOf(n)<0&&Vh.call(r,n)&&(t[n]=r[n]);return t};var k=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Kk=(r,e)=>{for(var t in e)fa(r,t,{get:e[t],enumerable:!0})},zh=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Vk(e))!xc.call(r,i)&&i!==t&&fa(r,i,{get:()=>e[i],enumerable:!(n=Bk(e,i))||n.enumerable});return r};var pa=(r,e,t)=>(t=r!=null?Gk(zk(r)):{},zh(e||!r||!r.__esModule?fa(t,"default",{value:r,enumerable:!0}):t,r)),Qk=r=>zh(fa({},"__esModule",{value:!0}),r);var L=(r,e,t)=>new Promise((n,i)=>{var s=u=>{try{o(t.next(u))}catch(l){i(l)}},a=u=>{try{o(t.throw(u))}catch(l){i(l)}},o=u=>u.done?n(u.value):Promise.resolve(u.value).then(s,a);o((t=t.apply(r,e)).next())});var De=k($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.matchAnyPattern=$n.extractTerms=$n.repeatedTimeunitPattern=void 0;function eE(r,e){let t=e.replace(/\((?!\?)/g,"(?:");return`${r}${t}\\s{0,5}(?:,?\\s{0,5}${t}){0,10}`}$n.repeatedTimeunitPattern=eE;function Kh(r){let e;return r instanceof Array?e=[...r]:r instanceof Map?e=Array.from(r.keys()):e=Object.keys(r),e}$n.extractTerms=Kh;function tE(r){return`(?:${Kh(r).sort((t,n)=>n.length-t.length).join("|").replace(/\./g,"\\.")})`}$n.matchAnyPattern=tE});var _e=k((Mc,Cc)=>{(function(r,e){typeof Mc=="object"&&typeof Cc!="undefined"?Cc.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis!="undefined"?globalThis:r||self).dayjs=e()})(Mc,function(){"use strict";var r=1e3,e=6e4,t=36e5,n="millisecond",i="second",s="minute",a="hour",o="day",u="week",l="month",c="quarter",d="year",p="date",m="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,E={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},R=function(G,N,O){var B=String(G);return!B||B.length>=N?G:""+Array(N+1-B.length).join(O)+G},x={s:R,z:function(G){var N=-G.utcOffset(),O=Math.abs(N),B=Math.floor(O/60),U=O%60;return(N<=0?"+":"-")+R(B,2,"0")+":"+R(U,2,"0")},m:function G(N,O){if(N.date()<O.date())return-G(O,N);var B=12*(O.year()-N.year())+(O.month()-N.month()),U=N.clone().add(B,l),Q=O-U<0,f=N.clone().add(B+(Q?-1:1),l);return+(-(B+(O-U)/(Q?U-f:f-U))||0)},a:function(G){return G<0?Math.ceil(G)||0:Math.floor(G)},p:function(G){return{M:l,y:d,w:u,d:o,D:p,h:a,m:s,s:i,ms:n,Q:c}[G]||String(G||"").toLowerCase().replace(/s$/,"")},u:function(G){return G===void 0}},v="en",V={};V[v]=E;var $=function(G){return G instanceof de},ee=function(G,N,O){var B;if(!G)return v;if(typeof G=="string")V[G]&&(B=G),N&&(V[G]=N,B=G);else{var U=G.name;V[U]=G,B=U}return!O&&B&&(v=B),B||!O&&v},Y=function(G,N){if($(G))return G.clone();var O=typeof N=="object"?N:{};return O.date=G,O.args=arguments,new de(O)},q=x;q.l=ee,q.i=$,q.w=function(G,N){return Y(G,{locale:N.$L,utc:N.$u,x:N.$x,$offset:N.$offset})};var de=function(){function G(O){this.$L=ee(O.locale,null,!0),this.parse(O)}var N=G.prototype;return N.parse=function(O){this.$d=function(B){var U=B.date,Q=B.utc;if(U===null)return new Date(NaN);if(q.u(U))return new Date;if(U instanceof Date)return new Date(U);if(typeof U=="string"&&!/Z$/i.test(U)){var f=U.match(b);if(f){var h=f[2]-1||0,y=(f[7]||"0").substring(0,3);return Q?new Date(Date.UTC(f[1],h,f[3]||1,f[4]||0,f[5]||0,f[6]||0,y)):new Date(f[1],h,f[3]||1,f[4]||0,f[5]||0,f[6]||0,y)}}return new Date(U)}(O),this.$x=O.x||{},this.init()},N.init=function(){var O=this.$d;this.$y=O.getFullYear(),this.$M=O.getMonth(),this.$D=O.getDate(),this.$W=O.getDay(),this.$H=O.getHours(),this.$m=O.getMinutes(),this.$s=O.getSeconds(),this.$ms=O.getMilliseconds()},N.$utils=function(){return q},N.isValid=function(){return this.$d.toString()!==m},N.isSame=function(O,B){var U=Y(O);return this.startOf(B)<=U&&U<=this.endOf(B)},N.isAfter=function(O,B){return Y(O)<this.startOf(B)},N.isBefore=function(O,B){return this.endOf(B)<Y(O)},N.$g=function(O,B,U){return q.u(O)?this[B]:this.set(U,O)},N.unix=function(){return Math.floor(this.valueOf()/1e3)},N.valueOf=function(){return this.$d.getTime()},N.startOf=function(O,B){var U=this,Q=!!q.u(B)||B,f=q.p(O),h=function(D,I){var me=q.w(U.$u?Date.UTC(U.$y,I,D):new Date(U.$y,I,D),U);return Q?me:me.endOf(o)},y=function(D,I){return q.w(U.toDate()[D].apply(U.toDate("s"),(Q?[0,0,0,0]:[23,59,59,999]).slice(I)),U)},T=this.$W,w=this.$M,S=this.$D,M="set"+(this.$u?"UTC":"");switch(f){case d:return Q?h(1,0):h(31,11);case l:return Q?h(1,w):h(0,w+1);case u:var P=this.$locale().weekStart||0,_=(T<P?T+7:T)-P;return h(Q?S-_:S+(6-_),w);case o:case p:return y(M+"Hours",0);case a:return y(M+"Minutes",1);case s:return y(M+"Seconds",2);case i:return y(M+"Milliseconds",3);default:return this.clone()}},N.endOf=function(O){return this.startOf(O,!1)},N.$set=function(O,B){var U,Q=q.p(O),f="set"+(this.$u?"UTC":""),h=(U={},U[o]=f+"Date",U[p]=f+"Date",U[l]=f+"Month",U[d]=f+"FullYear",U[a]=f+"Hours",U[s]=f+"Minutes",U[i]=f+"Seconds",U[n]=f+"Milliseconds",U)[Q],y=Q===o?this.$D+(B-this.$W):B;if(Q===l||Q===d){var T=this.clone().set(p,1);T.$d[h](y),T.init(),this.$d=T.set(p,Math.min(this.$D,T.daysInMonth())).$d}else h&&this.$d[h](y);return this.init(),this},N.set=function(O,B){return this.clone().$set(O,B)},N.get=function(O){return this[q.p(O)]()},N.add=function(O,B){var U,Q=this;O=Number(O);var f=q.p(B),h=function(w){var S=Y(Q);return q.w(S.date(S.date()+Math.round(w*O)),Q)};if(f===l)return this.set(l,this.$M+O);if(f===d)return this.set(d,this.$y+O);if(f===o)return h(1);if(f===u)return h(7);var y=(U={},U[s]=e,U[a]=t,U[i]=r,U)[f]||1,T=this.$d.getTime()+O*y;return q.w(T,this)},N.subtract=function(O,B){return this.add(-1*O,B)},N.format=function(O){var B=this,U=this.$locale();if(!this.isValid())return U.invalidDate||m;var Q=O||"YYYY-MM-DDTHH:mm:ssZ",f=q.z(this),h=this.$H,y=this.$m,T=this.$M,w=U.weekdays,S=U.months,M=function(I,me,ae,le){return I&&(I[me]||I(B,Q))||ae[me].substr(0,le)},P=function(I){return q.s(h%12||12,I,"0")},_=U.meridiem||function(I,me,ae){var le=I<12?"AM":"PM";return ae?le.toLowerCase():le},D={YY:String(this.$y).slice(-2),YYYY:this.$y,M:T+1,MM:q.s(T+1,2,"0"),MMM:M(U.monthsShort,T,S,3),MMMM:M(S,T),D:this.$D,DD:q.s(this.$D,2,"0"),d:String(this.$W),dd:M(U.weekdaysMin,this.$W,w,2),ddd:M(U.weekdaysShort,this.$W,w,3),dddd:w[this.$W],H:String(h),HH:q.s(h,2,"0"),h:P(1),hh:P(2),a:_(h,y,!0),A:_(h,y,!1),m:String(y),mm:q.s(y,2,"0"),s:String(this.$s),ss:q.s(this.$s,2,"0"),SSS:q.s(this.$ms,3,"0"),Z:f};return Q.replace(g,function(I,me){return me||D[I]||f.replace(":","")})},N.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},N.diff=function(O,B,U){var Q,f=q.p(B),h=Y(O),y=(h.utcOffset()-this.utcOffset())*e,T=this-h,w=q.m(this,h);return w=(Q={},Q[d]=w/12,Q[l]=w,Q[c]=w/3,Q[u]=(T-y)/6048e5,Q[o]=(T-y)/864e5,Q[a]=T/t,Q[s]=T/e,Q[i]=T/r,Q)[f]||T,U?w:q.a(w)},N.daysInMonth=function(){return this.endOf(l).$D},N.$locale=function(){return V[this.$L]},N.locale=function(O,B){if(!O)return this.$L;var U=this.clone(),Q=ee(O,B,!0);return Q&&(U.$L=Q),U},N.clone=function(){return q.w(this.$d,this)},N.toDate=function(){return new Date(this.valueOf())},N.toJSON=function(){return this.isValid()?this.toISOString():null},N.toISOString=function(){return this.$d.toISOString()},N.toString=function(){return this.$d.toUTCString()},G}(),Te=de.prototype;return Y.prototype=Te,[["$ms",n],["$s",i],["$m",s],["$H",a],["$W",o],["$M",l],["$y",d],["$D",p]].forEach(function(G){Te[G[1]]=function(N){return this.$g(N,G[0],G[1])}}),Y.extend=function(G,N){return G.$i||(G(N,de,Y),G.$i=!0),Y},Y.locale=ee,Y.isDayjs=$,Y.unix=function(G){return Y(1e3*G)},Y.en=V[v],Y.Ls=V,Y.p={},Y})});var ft=k(Gn=>{"use strict";var rE=Gn&&Gn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Gn,"__esModule",{value:!0});Gn.findYearClosestToRef=Gn.findMostLikelyADYear=void 0;var nE=rE(_e());function iE(r){return r<100&&(r>50?r=r+1900:r=r+2e3),r}Gn.findMostLikelyADYear=iE;function sE(r,e,t){let n=nE.default(r),i=n;i=i.month(t-1),i=i.date(e),i=i.year(n.year());let s=i.add(1,"y"),a=i.add(-1,"y");return Math.abs(s.diff(n))<Math.abs(i.diff(n))?i=s:Math.abs(a.diff(n))<Math.abs(i.diff(n))&&(i=a),i.year()}Gn.findYearClosestToRef=sE});var pt=k(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.parseTimeUnits=ue.TIME_UNITS_PATTERN=ue.parseYear=ue.YEAR_PATTERN=ue.parseOrdinalNumberPattern=ue.ORDINAL_NUMBER_PATTERN=ue.parseNumberPattern=ue.NUMBER_PATTERN=ue.TIME_UNIT_DICTIONARY=ue.ORDINAL_WORD_DICTIONARY=ue.INTEGER_WORD_DICTIONARY=ue.MONTH_DICTIONARY=ue.FULL_MONTH_NAME_DICTIONARY=ue.WEEKDAY_DICTIONARY=void 0;var nu=De(),aE=ft();ue.WEEKDAY_DICTIONARY={sunday:0,sun:0,"sun.":0,monday:1,mon:1,"mon.":1,tuesday:2,tue:2,"tue.":2,wednesday:3,wed:3,"wed.":3,thursday:4,thurs:4,"thurs.":4,thur:4,"thur.":4,thu:4,"thu.":4,friday:5,fri:5,"fri.":5,saturday:6,sat:6,"sat.":6};ue.FULL_MONTH_NAME_DICTIONARY={january:1,february:2,march:3,april:4,may:5,june:6,july:7,august:8,september:9,october:10,november:11,december:12};ue.MONTH_DICTIONARY=Object.assign(Object.assign({},ue.FULL_MONTH_NAME_DICTIONARY),{jan:1,"jan.":1,feb:2,"feb.":2,mar:3,"mar.":3,apr:4,"apr.":4,jun:6,"jun.":6,jul:7,"jul.":7,aug:8,"aug.":8,sep:9,"sep.":9,sept:9,"sept.":9,oct:10,"oct.":10,nov:11,"nov.":11,dec:12,"dec.":12});ue.INTEGER_WORD_DICTIONARY={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12};ue.ORDINAL_WORD_DICTIONARY={first:1,second:2,third:3,fourth:4,fifth:5,sixth:6,seventh:7,eighth:8,ninth:9,tenth:10,eleventh:11,twelfth:12,thirteenth:13,fourteenth:14,fifteenth:15,sixteenth:16,seventeenth:17,eighteenth:18,nineteenth:19,twentieth:20,"twenty first":21,"twenty-first":21,"twenty second":22,"twenty-second":22,"twenty third":23,"twenty-third":23,"twenty fourth":24,"twenty-fourth":24,"twenty fifth":25,"twenty-fifth":25,"twenty sixth":26,"twenty-sixth":26,"twenty seventh":27,"twenty-seventh":27,"twenty eighth":28,"twenty-eighth":28,"twenty ninth":29,"twenty-ninth":29,thirtieth:30,"thirty first":31,"thirty-first":31};ue.TIME_UNIT_DICTIONARY={sec:"second",second:"second",seconds:"second",min:"minute",mins:"minute",minute:"minute",minutes:"minute",h:"hour",hr:"hour",hrs:"hour",hour:"hour",hours:"hour",day:"d",days:"d",week:"week",weeks:"week",month:"month",months:"month",qtr:"quarter",quarter:"quarter",quarters:"quarter",y:"year",yr:"year",year:"year",years:"year"};ue.NUMBER_PATTERN=`(?:${nu.matchAnyPattern(ue.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|half(?:\\s{0,2}an?)?|an?\\b(?:\\s{0,2}few)?|few|several|a?\\s{0,2}couple\\s{0,2}(?:of)?)`;function Xh(r){let e=r.toLowerCase();return ue.INTEGER_WORD_DICTIONARY[e]!==void 0?ue.INTEGER_WORD_DICTIONARY[e]:e==="a"||e==="an"?1:e.match(/few/)?3:e.match(/half/)?.5:e.match(/couple/)?2:e.match(/several/)?7:parseFloat(e)}ue.parseNumberPattern=Xh;ue.ORDINAL_NUMBER_PATTERN=`(?:${nu.matchAnyPattern(ue.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:st|nd|rd|th)?)`;function oE(r){let e=r.toLowerCase();return ue.ORDINAL_WORD_DICTIONARY[e]!==void 0?ue.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:st|nd|rd|th)$/i,""),parseInt(e))}ue.parseOrdinalNumberPattern=oE;ue.YEAR_PATTERN="(?:[1-9][0-9]{0,3}\\s{0,2}(?:BE|AD|BC|BCE|CE)|[1-2][0-9]{3}|[5-9][0-9])";function uE(r){if(/BE/i.test(r))return r=r.replace(/BE/i,""),parseInt(r)-543;if(/BCE?/i.test(r))return r=r.replace(/BCE?/i,""),-parseInt(r);if(/(AD|CE)/i.test(r))return r=r.replace(/(AD|CE)/i,""),parseInt(r);let e=parseInt(r);return aE.findMostLikelyADYear(e)}ue.parseYear=uE;var Zh=`(${ue.NUMBER_PATTERN})\\s{0,3}(${nu.matchAnyPattern(ue.TIME_UNIT_DICTIONARY)})`,Qh=new RegExp(Zh,"i");ue.TIME_UNITS_PATTERN=nu.repeatedTimeunitPattern("(?:(?:about|around)\\s{0,3})?",Zh);function lE(r){let e={},t=r,n=Qh.exec(t);for(;n;)cE(e,n),t=t.substring(n[0].length).trim(),n=Qh.exec(t);return e}ue.parseTimeUnits=lE;function cE(r,e){let t=Xh(e[1]),n=ue.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var Jh=k((Ac,Pc)=>{(function(r,e){typeof Ac=="object"&&typeof Pc!="undefined"?Pc.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis!="undefined"?globalThis:r||self).dayjs_plugin_quarterOfYear=e()})(Ac,function(){"use strict";var r="month",e="quarter";return function(t,n){var i=n.prototype;i.quarter=function(o){return this.$utils().u(o)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(o-1))};var s=i.add;i.add=function(o,u){return o=Number(o),this.$utils().p(u)===e?this.add(3*o,r):s.bind(this)(o,u)};var a=i.startOf;i.startOf=function(o,u){var l=this.$utils(),c=!!l.u(u)||u;if(l.p(o)===e){var d=this.quarter()-1;return c?this.month(3*d).startOf(r).startOf("day"):this.month(3*d+2).endOf(r).endOf("day")}return a.bind(this)(o,u)}}})});var lr=k(Br=>{"use strict";Object.defineProperty(Br,"__esModule",{value:!0});Br.implySimilarTime=Br.assignSimilarTime=Br.assignSimilarDate=Br.assignTheNextDay=void 0;var eg=Je();function dE(r,e){e=e.add(1,"day"),tg(r,e),rg(r,e)}Br.assignTheNextDay=dE;function tg(r,e){r.assign("day",e.date()),r.assign("month",e.month()+1),r.assign("year",e.year())}Br.assignSimilarDate=tg;function fE(r,e){r.assign("hour",e.hour()),r.assign("minute",e.minute()),r.assign("second",e.second()),r.assign("millisecond",e.millisecond()),r.get("hour")<12?r.assign("meridiem",eg.Meridiem.AM):r.assign("meridiem",eg.Meridiem.PM)}Br.assignSimilarTime=fE;function rg(r,e){r.imply("hour",e.hour()),r.imply("minute",e.minute()),r.imply("second",e.second()),r.imply("millisecond",e.millisecond())}Br.implySimilarTime=rg});var ng=k(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.toTimezoneOffset=mi.TIMEZONE_ABBR_MAP=void 0;mi.TIMEZONE_ABBR_MAP={ACDT:630,ACST:570,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,ALMT:360,AMST:-180,AMT:-240,ANAST:720,ANAT:720,AQTT:300,ART:-180,AST:-240,AWDT:540,AWST:480,AZOST:0,AZOT:-60,AZST:300,AZT:240,BNT:480,BOT:-240,BRST:-120,BRT:-180,BST:60,BTT:360,CAST:480,CAT:120,CCT:390,CDT:-300,CEST:120,CET:60,CHADT:825,CHAST:765,CKT:-600,CLST:-180,CLT:-240,COT:-300,CST:-360,CVT:-60,CXT:420,ChST:600,DAVT:420,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEST:180,EET:120,EGST:0,EGT:-60,EST:-300,ET:-300,FJST:780,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GMT:0,GST:240,GYT:-240,HAA:-180,HAC:-300,HADT:-540,HAE:-240,HAP:-420,HAR:-360,HAST:-600,HAT:-90,HAY:-480,HKT:480,HLV:-210,HNA:-240,HNC:-360,HNE:-300,HNP:-480,HNR:-420,HNT:-150,HNY:-540,HOVT:420,ICT:420,IDT:180,IOT:360,IRDT:270,IRKST:540,IRKT:540,IRST:210,IST:330,JST:540,KGT:360,KRAST:480,KRAT:480,KST:540,KUYT:240,LHDT:660,LHST:630,LINT:840,MAGST:720,MAGT:720,MART:-510,MAWT:300,MDT:-360,MESZ:120,MEZ:60,MHT:720,MMT:390,MSD:240,MSK:180,MST:-420,MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:690,NOVST:420,NOVT:360,NPT:345,NST:-150,NUT:-660,NZDT:780,NZST:720,OMSST:420,OMST:420,PDT:-420,PET:-300,PETST:720,PETT:720,PGT:600,PHOT:780,PHT:480,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PT:-480,PWT:540,PYST:-180,PYT:-240,RET:240,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SRT:-180,SST:-660,TAHT:-600,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TVT:720,ULAT:480,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-210,VLAST:660,VLAT:660,VUT:660,WAST:120,WAT:60,WEST:60,WESZ:60,WET:0,WEZ:0,WFT:720,WGST:-120,WGT:-180,WIB:420,WIT:540,WITA:480,WST:780,WT:0,YAKST:600,YAKT:600,YAPT:600,YEKST:360,YEKT:360};function pE(r){var e;return r==null?null:typeof r=="number"?r:(e=mi.TIMEZONE_ABBR_MAP[r])!==null&&e!==void 0?e:null}mi.toTimezoneOffset=pE});var qe=k(Hr=>{"use strict";var ig=Hr&&Hr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Hr,"__esModule",{value:!0});Hr.ParsingResult=Hr.ParsingComponents=Hr.ReferenceWithTimezone=void 0;var mE=ig(Jh()),iu=ig(_e()),Nc=lr(),hE=ng();iu.default.extend(mE.default);var Ic=class{constructor(e){var t;e=e!=null?e:new Date,e instanceof Date?this.instant=e:(this.instant=(t=e.instant)!==null&&t!==void 0?t:new Date,this.timezoneOffset=hE.toTimezoneOffset(e.timezone))}};Hr.ReferenceWithTimezone=Ic;var hi=class{constructor(e,t){if(this.reference=e,this.knownValues={},this.impliedValues={},t)for(let i in t)this.knownValues[i]=t[i];let n=iu.default(e.instant);this.imply("day",n.date()),this.imply("month",n.month()+1),this.imply("year",n.year()),this.imply("hour",12),this.imply("minute",0),this.imply("second",0),this.imply("millisecond",0)}get(e){return e in this.knownValues?this.knownValues[e]:e in this.impliedValues?this.impliedValues[e]:null}isCertain(e){return e in this.knownValues}getCertainComponents(){return Object.keys(this.knownValues)}imply(e,t){return e in this.knownValues?this:(this.impliedValues[e]=t,this)}assign(e,t){return this.knownValues[e]=t,delete this.impliedValues[e],this}delete(e){delete this.knownValues[e],delete this.impliedValues[e]}clone(){let e=new hi(this.reference);e.knownValues={},e.impliedValues={};for(let t in this.knownValues)e.knownValues[t]=this.knownValues[t];for(let t in this.impliedValues)e.impliedValues[t]=this.impliedValues[t];return e}isOnlyDate(){return!this.isCertain("hour")&&!this.isCertain("minute")&&!this.isCertain("second")}isOnlyTime(){return!this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")}isOnlyWeekdayComponent(){return this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")}isOnlyDayMonthComponent(){return this.isCertain("day")&&this.isCertain("month")&&!this.isCertain("year")}isValidDate(){let e=this.dateWithoutTimezoneAdjustment();return!(e.getFullYear()!==this.get("year")||e.getMonth()!==this.get("month")-1||e.getDate()!==this.get("day")||this.get("hour")!=null&&e.getHours()!=this.get("hour")||this.get("minute")!=null&&e.getMinutes()!=this.get("minute"))}toString(){return`[ParsingComponents {knownValues: ${JSON.stringify(this.knownValues)}, impliedValues: ${JSON.stringify(this.impliedValues)}}, reference: ${JSON.stringify(this.reference)}]`}dayjs(){return iu.default(this.date())}date(){let e=this.dateWithoutTimezoneAdjustment();return new Date(e.getTime()+this.getSystemTimezoneAdjustmentMinute(e)*6e4)}dateWithoutTimezoneAdjustment(){let e=new Date(this.get("year"),this.get("month")-1,this.get("day"),this.get("hour"),this.get("minute"),this.get("second"),this.get("millisecond"));return e.setFullYear(this.get("year")),e}getSystemTimezoneAdjustmentMinute(e){var t,n;(!e||e.getTime()<0)&&(e=new Date);let i=-e.getTimezoneOffset(),s=(n=(t=this.get("timezoneOffset"))!==null&&t!==void 0?t:this.reference.timezoneOffset)!==null&&n!==void 0?n:i;return i-s}static createRelativeFromReference(e,t){let n=iu.default(e.instant);for(let s in t)n=n.add(t[s],s);let i=new hi(e);return t.hour||t.minute||t.second?(Nc.assignSimilarTime(i,n),Nc.assignSimilarDate(i,n),e.timezoneOffset!==null&&i.assign("timezoneOffset",-e.instant.getTimezoneOffset())):(Nc.implySimilarTime(i,n),e.timezoneOffset!==null&&i.imply("timezoneOffset",-e.instant.getTimezoneOffset()),t.d?(i.assign("day",n.date()),i.assign("month",n.month()+1),i.assign("year",n.year())):(t.week&&i.imply("weekday",n.day()),i.imply("day",n.date()),t.month?(i.assign("month",n.month()+1),i.assign("year",n.year())):(i.imply("month",n.month()+1),t.year?i.assign("year",n.year()):i.imply("year",n.year())))),i}};Hr.ParsingComponents=hi;var ma=class{constructor(e,t,n,i,s){this.reference=e,this.refDate=e.instant,this.index=t,this.text=n,this.start=i||new hi(e),this.end=s}clone(){let e=new ma(this.reference,this.index,this.text);return e.start=this.start?this.start.clone():null,e.end=this.end?this.end.clone():null,e}date(){return this.start.date()}toString(){return`[ParsingResult {index: ${this.index}, text: '${this.text}', ...}]`}};Hr.ParsingResult=ma});var H=k(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});su.AbstractParserWithWordBoundaryChecking=void 0;var Fc=class{constructor(){this.cachedInnerPattern=null,this.cachedPattern=null}patternLeftBoundary(){return"(\\W|^)"}pattern(e){let t=this.innerPattern(e);return t==this.cachedInnerPattern?this.cachedPattern:(this.cachedPattern=new RegExp(`${this.patternLeftBoundary()}${t.source}`,t.flags),this.cachedInnerPattern=t,this.cachedPattern)}extract(e,t){var n;let i=(n=t[1])!==null&&n!==void 0?n:"";t.index=t.index+i.length,t[0]=t[0].substring(i.length);for(let s=2;s<t.length;s++)t[s-1]=t[s];return this.innerExtract(e,t)}};su.AbstractParserWithWordBoundaryChecking=Fc});var sg=k(Wc=>{"use strict";Object.defineProperty(Wc,"__esModule",{value:!0});var Uc=pt(),gE=qe(),yE=H(),bE=new RegExp(`(?:within|in|for)\\s*(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${Uc.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),TE=new RegExp(`(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${Uc.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),Lc=class extends yE.AbstractParserWithWordBoundaryChecking{innerPattern(e){return e.option.forwardDate?TE:bE}innerExtract(e,t){let n=Uc.parseTimeUnits(t[1]);return gE.ParsingComponents.createRelativeFromReference(e.reference,n)}};Wc.default=Lc});var dg=k(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});var _E=ft(),lg=pt(),cg=pt(),au=pt(),vE=De(),wE=H(),kE=new RegExp(`(?:on\\s{0,3})?(${au.ORDINAL_NUMBER_PATTERN})(?:\\s{0,3}(?:to|\\-|\\\u2013|until|through|till)?\\s{0,3}(${au.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s{0,3}(?:of)?\\s{0,3})(${vE.matchAnyPattern(lg.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s{0,3})(${cg.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),ag=1,og=2,EE=3,ug=4,qc=class extends wE.AbstractParserWithWordBoundaryChecking{innerPattern(){return kE}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=lg.MONTH_DICTIONARY[t[EE].toLowerCase()],s=au.parseOrdinalNumberPattern(t[ag]);if(s>31)return t.index=t.index+t[ag].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[ug]){let a=cg.parseYear(t[ug]);n.start.assign("year",a)}else{let a=_E.findYearClosestToRef(e.refDate,s,i);n.start.imply("year",a)}if(t[og]){let a=au.parseOrdinalNumberPattern(t[og]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};jc.default=qc});var gg=k(Gc=>{"use strict";Object.defineProperty(Gc,"__esModule",{value:!0});var SE=ft(),mg=pt(),ou=pt(),hg=pt(),OE=De(),DE=H(),xE=new RegExp(`(${OE.matchAnyPattern(mg.MONTH_DICTIONARY)})(?:-|/|\\s*,?\\s*)(${ou.ORDINAL_NUMBER_PATTERN})(?!\\s*(?:am|pm))\\s*(?:(?:to|\\-)\\s*(${ou.ORDINAL_NUMBER_PATTERN})\\s*)?(?:(?:-|/|\\s*,?\\s*)(${hg.YEAR_PATTERN}))?(?=\\W|$)(?!\\:\\d)`,"i"),RE=1,ME=2,fg=3,pg=4,$c=class extends DE.AbstractParserWithWordBoundaryChecking{innerPattern(){return xE}innerExtract(e,t){let n=mg.MONTH_DICTIONARY[t[RE].toLowerCase()],i=ou.parseOrdinalNumberPattern(t[ME]);if(i>31)return null;let s=e.createParsingComponents({day:i,month:n});if(t[pg]){let u=hg.parseYear(t[pg]);s.assign("year",u)}else{let u=SE.findYearClosestToRef(e.refDate,i,n);s.imply("year",u)}if(!t[fg])return s;let a=ou.parseOrdinalNumberPattern(t[fg]),o=e.createParsingResult(t.index,t[0]);return o.start=s,o.end=s.clone(),o.end.assign("day",a),o}};Gc.default=$c});var Tg=k(Hc=>{"use strict";Object.defineProperty(Hc,"__esModule",{value:!0});var Yc=pt(),CE=ft(),AE=De(),bg=pt(),PE=H(),NE=new RegExp(`((?:in)\\s*)?(${AE.matchAnyPattern(Yc.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${bg.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),IE=1,FE=2,yg=3,Bc=class extends PE.AbstractParserWithWordBoundaryChecking{innerPattern(){return NE}innerExtract(e,t){let n=t[FE].toLowerCase();if(t[0].length<=3&&!Yc.FULL_MONTH_NAME_DICTIONARY[n])return null;let i=e.createParsingResult(t.index+(t[IE]||"").length,t.index+t[0].length);i.start.imply("day",1);let s=Yc.MONTH_DICTIONARY[n];if(i.start.assign("month",s),t[yg]){let a=bg.parseYear(t[yg]);i.start.assign("year",a)}else{let a=CE.findYearClosestToRef(e.refDate,1,s);i.start.imply("year",a)}return i}};Hc.default=Bc});var wg=k(zc=>{"use strict";Object.defineProperty(zc,"__esModule",{value:!0});var vg=pt(),LE=De(),UE=H(),WE=new RegExp(`([0-9]{4})[\\.\\/\\s](?:(${LE.matchAnyPattern(vg.MONTH_DICTIONARY)})|([0-9]{1,2}))[\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),qE=1,jE=2,_g=3,$E=4,Vc=class extends UE.AbstractParserWithWordBoundaryChecking{innerPattern(){return WE}innerExtract(e,t){let n=t[_g]?parseInt(t[_g]):vg.MONTH_DICTIONARY[t[jE].toLowerCase()];if(n<1||n>12)return null;let i=parseInt(t[qE]);return{day:parseInt(t[$E]),month:n,year:i}}};zc.default=Vc});var kg=k(Qc=>{"use strict";Object.defineProperty(Qc,"__esModule",{value:!0});var GE=H(),YE=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),BE=1,HE=2,Kc=class extends GE.AbstractParserWithWordBoundaryChecking{innerPattern(){return YE}innerExtract(e,t){let n=parseInt(t[HE]),i=parseInt(t[BE]);return e.createParsingComponents().imply("day",1).assign("month",i).assign("year",n)}};Qc.default=Kc});var gi=k(cu=>{"use strict";Object.defineProperty(cu,"__esModule",{value:!0});cu.AbstractTimeExpressionParser=void 0;var Mt=Je();function VE(r,e,t,n){return new RegExp(`${r}${e}(\\d{1,4})(?:(?:\\.|:|\uFF1A)(\\d{1,2})(?:(?::|\uFF1A)(\\d{2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${t}`,n)}function zE(r,e){return new RegExp(`^(${r})(\\d{1,4})(?:(?:\\.|\\:|\\\uFF1A)(\\d{1,2})(?:(?:\\.|\\:|\\\uFF1A)(\\d{1,2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${e}`,"i")}var Eg=2,ts=3,uu=4,lu=5,ha=6,Xc=class{constructor(e=!1){this.cachedPrimaryPrefix=null,this.cachedPrimarySuffix=null,this.cachedPrimaryTimePattern=null,this.cachedFollowingPhase=null,this.cachedFollowingSuffix=null,this.cachedFollowingTimePatten=null,this.strictMode=e}patternFlags(){return"i"}primaryPatternLeftBoundary(){return"(^|\\s|T|\\b)"}primarySuffix(){return"(?=\\W|$)"}followingSuffix(){return"(?=\\W|$)"}pattern(e){return this.getPrimaryTimePatternThroughCache()}extract(e,t){let n=this.extractPrimaryTimeComponents(e,t);if(!n)return t.index+=t[0].length,null;let i=t.index+t[1].length,s=t[0].substring(t[1].length),a=e.createParsingResult(i,s,n);t.index+=t[0].length;let o=e.text.substring(t.index),l=this.getFollowingTimePatternThroughCache().exec(o);return s.match(/^\d{3,4}/)&&l&&l[0].match(/^\s*([+-])\s*\d{2,4}$/)?null:!l||l[0].match(/^\s*([+-])\s*\d{3,4}$/)?this.checkAndReturnWithoutFollowingPattern(a):(a.end=this.extractFollowingTimeComponents(e,l,a),a.end&&(a.text+=l[0]),this.checkAndReturnWithFollowingPattern(a))}extractPrimaryTimeComponents(e,t,n=!1){let i=e.createParsingComponents(),s=0,a=null,o=parseInt(t[Eg]);if(o>100){if(this.strictMode||t[ts]!=null)return null;s=o%100,o=Math.floor(o/100)}if(o>24)return null;if(t[ts]!=null){if(t[ts].length==1&&!t[ha])return null;s=parseInt(t[ts])}if(s>=60)return null;if(o>12&&(a=Mt.Meridiem.PM),t[ha]!=null){if(o>12)return null;let u=t[ha][0].toLowerCase();u=="a"&&(a=Mt.Meridiem.AM,o==12&&(o=0)),u=="p"&&(a=Mt.Meridiem.PM,o!=12&&(o+=12))}if(i.assign("hour",o),i.assign("minute",s),a!==null?i.assign("meridiem",a):o<12?i.imply("meridiem",Mt.Meridiem.AM):i.imply("meridiem",Mt.Meridiem.PM),t[lu]!=null){let u=parseInt(t[lu].substring(0,3));if(u>=1e3)return null;i.assign("millisecond",u)}if(t[uu]!=null){let u=parseInt(t[uu]);if(u>=60)return null;i.assign("second",u)}return i}extractFollowingTimeComponents(e,t,n){let i=e.createParsingComponents();if(t[lu]!=null){let u=parseInt(t[lu].substring(0,3));if(u>=1e3)return null;i.assign("millisecond",u)}if(t[uu]!=null){let u=parseInt(t[uu]);if(u>=60)return null;i.assign("second",u)}let s=parseInt(t[Eg]),a=0,o=-1;if(t[ts]!=null?a=parseInt(t[ts]):s>100&&(a=s%100,s=Math.floor(s/100)),a>=60||s>24)return null;if(s>=12&&(o=Mt.Meridiem.PM),t[ha]!=null){if(s>12)return null;let u=t[ha][0].toLowerCase();u=="a"&&(o=Mt.Meridiem.AM,s==12&&(s=0,i.isCertain("day")||i.imply("day",i.get("day")+1))),u=="p"&&(o=Mt.Meridiem.PM,s!=12&&(s+=12)),n.start.isCertain("meridiem")||(o==Mt.Meridiem.AM?(n.start.imply("meridiem",Mt.Meridiem.AM),n.start.get("hour")==12&&n.start.assign("hour",0)):(n.start.imply("meridiem",Mt.Meridiem.PM),n.start.get("hour")!=12&&n.start.assign("hour",n.start.get("hour")+12)))}return i.assign("hour",s),i.assign("minute",a),o>=0?i.assign("meridiem",o):n.start.isCertain("meridiem")&&n.start.get("hour")>12?n.start.get("hour")-12>s?i.imply("meridiem",Mt.Meridiem.AM):s<=12&&(i.assign("hour",s+12),i.assign("meridiem",Mt.Meridiem.PM)):s>12?i.imply("meridiem",Mt.Meridiem.PM):s<=12&&i.imply("meridiem",Mt.Meridiem.AM),i.date().getTime()<n.start.date().getTime()&&i.imply("day",i.get("day")+1),i}checkAndReturnWithoutFollowingPattern(e){if(e.text.match(/^\d$/)||e.text.match(/^\d\d\d+$/)||e.text.match(/\d[apAP]$/))return null;let t=e.text.match(/[^\d:.](\d[\d.]+)$/);if(t){let n=t[1];if(this.strictMode||n.includes(".")&&!n.match(/\d(\.\d{2})+$/)||parseInt(n)>24)return null}return e}checkAndReturnWithFollowingPattern(e){if(e.text.match(/^\d+-\d+$/))return null;let t=e.text.match(/[^\d:.](\d[\d.]+)\s*-\s*(\d[\d.]+)$/);if(t){if(this.strictMode)return null;let n=t[1],i=t[2];if(i.includes(".")&&!i.match(/\d(\.\d{2})+$/))return null;let s=parseInt(i),a=parseInt(n);if(s>24||a>24)return null}return e}getPrimaryTimePatternThroughCache(){let e=this.primaryPrefix(),t=this.primarySuffix();return this.cachedPrimaryPrefix===e&&this.cachedPrimarySuffix===t?this.cachedPrimaryTimePattern:(this.cachedPrimaryTimePattern=VE(this.primaryPatternLeftBoundary(),e,t,this.patternFlags()),this.cachedPrimaryPrefix=e,this.cachedPrimarySuffix=t,this.cachedPrimaryTimePattern)}getFollowingTimePatternThroughCache(){let e=this.followingPhase(),t=this.followingSuffix();return this.cachedFollowingPhase===e&&this.cachedFollowingSuffix===t?this.cachedFollowingTimePatten:(this.cachedFollowingTimePatten=zE(e,t),this.cachedFollowingPhase=e,this.cachedFollowingSuffix=t,this.cachedFollowingTimePatten)}};cu.AbstractTimeExpressionParser=Xc});var Sg=k(Jc=>{"use strict";Object.defineProperty(Jc,"__esModule",{value:!0});var du=Je(),KE=gi(),Zc=class extends KE.AbstractTimeExpressionParser{constructor(e){super(e)}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|to|\\?)\\s*"}primaryPrefix(){return"(?:(?:at|from)\\s*)??"}primarySuffix(){return"(?:\\s*(?:o\\W*clock|at\\s*night|in\\s*the\\s*(?:morning|afternoon)))?(?!/)(?=\\W|$)"}extractPrimaryTimeComponents(e,t){let n=super.extractPrimaryTimeComponents(e,t);if(n){if(t[0].endsWith("night")){let i=n.get("hour");i>=6&&i<12?(n.assign("hour",n.get("hour")+12),n.assign("meridiem",du.Meridiem.PM)):i<6&&n.assign("meridiem",du.Meridiem.AM)}if(t[0].endsWith("afternoon")){n.assign("meridiem",du.Meridiem.PM);let i=n.get("hour");i>=0&&i<=6&&n.assign("hour",n.get("hour")+12)}t[0].endsWith("morning")&&(n.assign("meridiem",du.Meridiem.AM),n.get("hour")<12&&n.assign("hour",n.get("hour")))}return n}};Jc.default=Zc});var cr=k(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.addImpliedTimeUnits=rs.reverseTimeUnits=void 0;function QE(r){let e={};for(let t in r)e[t]=-r[t];return e}rs.reverseTimeUnits=QE;function XE(r,e){let t=r.clone(),n=r.dayjs();for(let i in e)n=n.add(e[i],i);return("day"in e||"d"in e||"week"in e||"month"in e||"year"in e)&&(t.imply("day",n.date()),t.imply("month",n.month()+1),t.imply("year",n.year())),("second"in e||"minute"in e||"hour"in e)&&(t.imply("second",n.second()),t.imply("minute",n.minute()),t.imply("hour",n.hour())),t}rs.addImpliedTimeUnits=XE});var Og=k(rd=>{"use strict";Object.defineProperty(rd,"__esModule",{value:!0});var td=pt(),ZE=qe(),JE=H(),eS=cr(),tS=new RegExp(`(${td.TIME_UNITS_PATTERN})\\s{0,5}(?:ago|before|earlier)(?=(?:\\W|$))`,"i"),rS=new RegExp(`(${td.TIME_UNITS_PATTERN})\\s{0,5}ago(?=(?:\\W|$))`,"i"),ed=class extends JE.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?rS:tS}innerExtract(e,t){let n=td.parseTimeUnits(t[1]),i=eS.reverseTimeUnits(n);return ZE.ParsingComponents.createRelativeFromReference(e.reference,i)}};rd.default=ed});var Dg=k(sd=>{"use strict";Object.defineProperty(sd,"__esModule",{value:!0});var id=pt(),nS=qe(),iS=H(),sS=new RegExp(`(${id.TIME_UNITS_PATTERN})\\s{0,5}(?:later|after|from now|henceforth|forward|out)(?=(?:\\W|$))`,"i"),aS=new RegExp("("+id.TIME_UNITS_PATTERN+")(later|from now)(?=(?:\\W|$))","i"),oS=1,nd=class extends iS.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?aS:sS}innerExtract(e,t){let n=id.parseTimeUnits(t[oS]);return nS.ParsingComponents.createRelativeFromReference(e.reference,n)}};sd.default=nd});var is=k(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.MergingRefiner=ns.Filter=void 0;var ad=class{refine(e,t){return t.filter(n=>this.isValid(e,n))}};ns.Filter=ad;var od=class{refine(e,t){if(t.length<2)return t;let n=[],i=t[0],s=null;for(let a=1;a<t.length;a++){s=t[a];let o=e.text.substring(i.index+i.text.length,s.index);if(!this.shouldMergeResults(o,i,s,e))n.push(i),i=s;else{let u=i,l=s,c=this.mergeResults(o,u,l,e);e.debug(()=>{console.log(`${this.constructor.name} merged ${u} and ${l} into ${c}`)}),i=c}}return i!=null&&n.push(i),n}};ns.MergingRefiner=od});var Vr=k(ld=>{"use strict";Object.defineProperty(ld,"__esModule",{value:!0});var uS=is(),ud=class extends uS.MergingRefiner{shouldMergeResults(e,t,n){return!t.end&&!n.end&&e.match(this.patternBetween())!=null}mergeResults(e,t,n){if(!t.start.isOnlyWeekdayComponent()&&!n.start.isOnlyWeekdayComponent()&&(n.start.getCertainComponents().forEach(s=>{t.start.isCertain(s)||t.start.assign(s,n.start.get(s))}),t.start.getCertainComponents().forEach(s=>{n.start.isCertain(s)||n.start.assign(s,t.start.get(s))})),t.start.date().getTime()>n.start.date().getTime()){let s=t.start.dayjs(),a=n.start.dayjs();t.start.isOnlyWeekdayComponent()&&s.add(-7,"days").isBefore(a)?(s=s.add(-7,"days"),t.start.imply("day",s.date()),t.start.imply("month",s.month()+1),t.start.imply("year",s.year())):n.start.isOnlyWeekdayComponent()&&a.add(7,"days").isAfter(s)?(a=a.add(7,"days"),n.start.imply("day",a.date()),n.start.imply("month",a.month()+1),n.start.imply("year",a.year())):[n,t]=[t,n]}let i=t.clone();return i.start=t.start,i.end=n.start,i.index=Math.min(t.index,n.index),t.index<n.index?i.text=t.text+e+n.text:i.text=n.text+e+t.text,i}};ld.default=ud});var xg=k(ga=>{"use strict";var lS=ga&&ga.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ga,"__esModule",{value:!0});var cS=lS(Vr()),cd=class extends cS.default{patternBetween(){return/^\s*(to|-)\s*$/i}};ga.default=cd});var Rg=k(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.mergeDateTimeComponent=ss.mergeDateTimeResult=void 0;var dS=Je();function fS(r,e){let t=r.clone(),n=r.start,i=e.start;if(t.start=dd(n,i),r.end!=null||e.end!=null){let s=r.end==null?r.start:r.end,a=e.end==null?e.start:e.end,o=dd(s,a);r.end==null&&o.date().getTime()<t.start.date().getTime()&&(o.isCertain("day")?o.assign("day",o.get("day")+1):o.imply("day",o.get("day")+1)),t.end=o}return t}ss.mergeDateTimeResult=fS;function dd(r,e){let t=r.clone();return e.isCertain("hour")?(t.assign("hour",e.get("hour")),t.assign("minute",e.get("minute")),e.isCertain("second")?(t.assign("second",e.get("second")),e.isCertain("millisecond")?t.assign("millisecond",e.get("millisecond")):t.imply("millisecond",e.get("millisecond"))):(t.imply("second",e.get("second")),t.imply("millisecond",e.get("millisecond")))):(t.imply("hour",e.get("hour")),t.imply("minute",e.get("minute")),t.imply("second",e.get("second")),t.imply("millisecond",e.get("millisecond"))),e.isCertain("timezoneOffset")&&t.assign("timezoneOffset",e.get("timezoneOffset")),e.isCertain("meridiem")?t.assign("meridiem",e.get("meridiem")):e.get("meridiem")!=null&&t.get("meridiem")==null&&t.imply("meridiem",e.get("meridiem")),t.get("meridiem")==dS.Meridiem.PM&&t.get("hour")<12&&(e.isCertain("hour")?t.assign("hour",t.get("hour")+12):t.imply("hour",t.get("hour")+12)),t}ss.mergeDateTimeComponent=dd});var pn=k(pd=>{"use strict";Object.defineProperty(pd,"__esModule",{value:!0});var pS=is(),Mg=Rg(),fd=class extends pS.MergingRefiner{shouldMergeResults(e,t,n){return(t.start.isOnlyDate()&&n.start.isOnlyTime()||n.start.isOnlyDate()&&t.start.isOnlyTime())&&e.match(this.patternBetween())!=null}mergeResults(e,t,n){let i=t.start.isOnlyDate()?Mg.mergeDateTimeResult(t,n):Mg.mergeDateTimeResult(n,t);return i.index=t.index,i.text=t.text+e+n.text,i}};pd.default=fd});var Cg=k(ya=>{"use strict";var mS=ya&&ya.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ya,"__esModule",{value:!0});var hS=mS(pn()),md=class extends hS.default{patternBetween(){return new RegExp("^\\s*(T|at|after|before|on|of|,|-)?\\s*$")}};ya.default=md});var Ag=k(gd=>{"use strict";Object.defineProperty(gd,"__esModule",{value:!0});var gS=new RegExp("^\\s*,?\\s*\\(?([A-Z]{2,4})\\)?(?=\\W|$)","i"),yS={ACDT:630,ACST:570,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,ALMT:360,AMST:-180,AMT:-240,ANAST:720,ANAT:720,AQTT:300,ART:-180,AST:-240,AWDT:540,AWST:480,AZOST:0,AZOT:-60,AZST:300,AZT:240,BNT:480,BOT:-240,BRST:-120,BRT:-180,BST:60,BTT:360,CAST:480,CAT:120,CCT:390,CDT:-300,CEST:120,CET:60,CHADT:825,CHAST:765,CKT:-600,CLST:-180,CLT:-240,COT:-300,CST:-360,CVT:-60,CXT:420,ChST:600,DAVT:420,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEST:180,EET:120,EGST:0,EGT:-60,EST:-300,ET:-300,FJST:780,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GMT:0,GST:240,GYT:-240,HAA:-180,HAC:-300,HADT:-540,HAE:-240,HAP:-420,HAR:-360,HAST:-600,HAT:-90,HAY:-480,HKT:480,HLV:-210,HNA:-240,HNC:-360,HNE:-300,HNP:-480,HNR:-420,HNT:-150,HNY:-540,HOVT:420,ICT:420,IDT:180,IOT:360,IRDT:270,IRKST:540,IRKT:540,IRST:210,IST:330,JST:540,KGT:360,KRAST:480,KRAT:480,KST:540,KUYT:240,LHDT:660,LHST:630,LINT:840,MAGST:720,MAGT:720,MART:-510,MAWT:300,MDT:-360,MESZ:120,MEZ:60,MHT:720,MMT:390,MSD:240,MSK:240,MST:-420,MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:690,NOVST:420,NOVT:360,NPT:345,NST:-150,NUT:-660,NZDT:780,NZST:720,OMSST:420,OMST:420,PDT:-420,PET:-300,PETST:720,PETT:720,PGT:600,PHOT:780,PHT:480,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PT:-480,PWT:540,PYST:-180,PYT:-240,RET:240,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SRT:-180,SST:-660,TAHT:-600,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TVT:720,ULAT:480,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-210,VLAST:660,VLAT:660,VUT:660,WAST:120,WAT:60,WEST:60,WESZ:60,WET:0,WEZ:0,WFT:720,WGST:-120,WGT:-180,WIB:420,WIT:540,WITA:480,WST:780,WT:0,YAKST:600,YAKT:600,YAPT:600,YEKST:360,YEKT:360},hd=class{constructor(e){this.timezone=Object.assign(Object.assign({},yS),e)}refine(e,t){var n;let i=(n=e.option.timezones)!==null&&n!==void 0?n:{};return t.forEach(s=>{var a,o;let u=e.text.substring(s.index+s.text.length),l=gS.exec(u);if(!l)return;let c=l[1].toUpperCase(),d=(o=(a=i[c])!==null&&a!==void 0?a:this.timezone[c])!==null&&o!==void 0?o:null;if(d===null)return;e.debug(()=>{console.log(`Extracting timezone: '${c}' into: ${d} for: ${s.start}`)});let p=s.start.get("timezoneOffset");p!==null&&d!=p&&(s.start.isCertain("timezoneOffset")||c!=l[1])||s.start.isOnlyDate()&&c!=l[1]||(s.text+=l[0],s.start.isCertain("timezoneOffset")||s.start.assign("timezoneOffset",d),s.end!=null&&!s.end.isCertain("timezoneOffset")&&s.end.assign("timezoneOffset",d))}),t}};gd.default=hd});var fu=k(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0});var bS=new RegExp("^\\s*(?:\\(?(?:GMT|UTC)\\s?)?([+-])(\\d{1,2})(?::?(\\d{2}))?\\)?","i"),TS=1,_S=2,vS=3,yd=class{refine(e,t){return t.forEach(function(n){if(n.start.isCertain("timezoneOffset"))return;let i=e.text.substring(n.index+n.text.length),s=bS.exec(i);if(!s)return;e.debug(()=>{console.log(`Extracting timezone: '${s[0]}' into : ${n}`)});let a=parseInt(s[_S]),o=parseInt(s[vS]||"0"),u=a*60+o;u>14*60||(s[TS]==="-"&&(u=-u),n.end!=null&&n.end.assign("timezoneOffset",u),n.start.assign("timezoneOffset",u),n.text+=s[0])}),t}};bd.default=yd});var Pg=k(_d=>{"use strict";Object.defineProperty(_d,"__esModule",{value:!0});var Td=class{refine(e,t){if(t.length<2)return t;let n=[],i=t[0];for(let s=1;s<t.length;s++){let a=t[s];a.index<i.index+i.text.length?a.text.length>i.text.length&&(i=a):(n.push(i),i=a)}return i!=null&&n.push(i),n}};_d.default=Td});var Ng=k(ba=>{"use strict";var wS=ba&&ba.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ba,"__esModule",{value:!0});var kS=wS(_e()),vd=class{refine(e,t){return e.option.forwardDate&&t.forEach(function(n){let i=kS.default(e.refDate);if(n.start.isOnlyDayMonthComponent()&&i.isAfter(n.start.dayjs()))for(let s=0;s<3&&i.isAfter(n.start.dayjs());s++)n.start.imply("year",n.start.get("year")+1),e.debug(()=>{console.log(`Forward yearly adjusted for ${n} (${n.start})`)}),n.end&&!n.end.isCertain("year")&&(n.end.imply("year",n.end.get("year")+1),e.debug(()=>{console.log(`Forward yearly adjusted for ${n} (${n.end})`)}));n.start.isOnlyWeekdayComponent()&&i.isAfter(n.start.dayjs())&&(i.day()>=n.start.get("weekday")?i=i.day(n.start.get("weekday")+7):i=i.day(n.start.get("weekday")),n.start.imply("day",i.date()),n.start.imply("month",i.month()+1),n.start.imply("year",i.year()),e.debug(()=>{console.log(`Forward weekly adjusted for ${n} (${n.start})`)}),n.end&&n.end.isOnlyWeekdayComponent()&&(i.day()>n.end.get("weekday")?i=i.day(n.end.get("weekday")+7):i=i.day(n.end.get("weekday")),n.end.imply("day",i.date()),n.end.imply("month",i.month()+1),n.end.imply("year",i.year()),e.debug(()=>{console.log(`Forward weekly adjusted for ${n} (${n.end})`)})))}),t}};ba.default=vd});var Ig=k(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});var ES=is(),wd=class extends ES.Filter{constructor(e){super(),this.strictMode=e}isValid(e,t){return t.text.replace(" ","").match(/^\d*(\.\d*)?$/)?(e.debug(()=>{console.log(`Removing unlikely result '${t.text}'`)}),!1):t.start.isValidDate()?t.end&&!t.end.isValidDate()?(e.debug(()=>{console.log(`Removing invalid result: ${t} (${t.end})`)}),!1):this.strictMode?this.isStrictModeValid(e,t):!0:(e.debug(()=>{console.log(`Removing invalid result: ${t} (${t.start})`)}),!1)}isStrictModeValid(e,t){return t.start.isOnlyWeekdayComponent()?(e.debug(()=>{console.log(`(Strict) Removing weekday only component: ${t} (${t.end})`)}),!1):t.start.isOnlyTime()&&(!t.start.isCertain("hour")||!t.start.isCertain("minute"))?(e.debug(()=>{console.log(`(Strict) Removing uncertain time component: ${t} (${t.end})`)}),!1):!0}};kd.default=wd});var Od=k(Sd=>{"use strict";Object.defineProperty(Sd,"__esModule",{value:!0});var SS=H(),OS=new RegExp("([0-9]{4})\\-([0-9]{1,2})\\-([0-9]{1,2})(?:T([0-9]{1,2}):([0-9]{1,2})(?::([0-9]{1,2})(?:\\.(\\d{1,4}))?)?(?:Z|([+-]\\d{2}):?(\\d{2})?)?)?(?=\\W|$)","i"),DS=1,xS=2,RS=3,Fg=4,MS=5,Lg=6,Ug=7,Wg=8,qg=9,Ed=class extends SS.AbstractParserWithWordBoundaryChecking{innerPattern(){return OS}innerExtract(e,t){let n={};if(n.year=parseInt(t[DS]),n.month=parseInt(t[xS]),n.day=parseInt(t[RS]),t[Fg]!=null)if(n.hour=parseInt(t[Fg]),n.minute=parseInt(t[MS]),t[Lg]!=null&&(n.second=parseInt(t[Lg])),t[Ug]!=null&&(n.millisecond=parseInt(t[Ug])),t[Wg]==null)n.timezoneOffset=0;else{let i=parseInt(t[Wg]),s=0;t[qg]!=null&&(s=parseInt(t[qg]));let a=i*60;a<0?a-=s:a+=s,n.timezoneOffset=a}return n}};Sd.default=Ed});var jg=k(xd=>{"use strict";Object.defineProperty(xd,"__esModule",{value:!0});var CS=is(),Dd=class extends CS.MergingRefiner{mergeResults(e,t,n){let i=n.clone();return i.index=t.index,i.text=t.text+e+i.text,i.start.assign("weekday",t.start.get("weekday")),i.end&&i.end.assign("weekday",t.start.get("weekday")),i}shouldMergeResults(e,t,n){return t.start.isOnlyWeekdayComponent()&&!t.start.isCertain("hour")&&n.start.isCertain("day")&&e.match(/^,?\s*$/)!=null}};xd.default=Dd});var mn=k(as=>{"use strict";var yi=as&&as.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(as,"__esModule",{value:!0});as.includeCommonConfiguration=void 0;var AS=yi(Ag()),PS=yi(fu()),$g=yi(Pg()),NS=yi(Ng()),IS=yi(Ig()),FS=yi(Od()),LS=yi(jg());function US(r,e=!1){return r.parsers.unshift(new FS.default),r.refiners.unshift(new LS.default),r.refiners.unshift(new AS.default),r.refiners.unshift(new PS.default),r.refiners.unshift(new $g.default),r.refiners.push(new $g.default),r.refiners.push(new NS.default),r.refiners.push(new IS.default(e)),r}as.includeCommonConfiguration=US});var gn=k(Se=>{"use strict";var WS=Se&&Se.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Se,"__esModule",{value:!0});Se.noon=Se.morning=Se.midnight=Se.yesterdayEvening=Se.evening=Se.lastNight=Se.tonight=Se.theDayAfter=Se.tomorrow=Se.theDayBefore=Se.yesterday=Se.today=Se.now=void 0;var zr=qe(),os=WS(_e()),hn=lr(),Ta=Je();function qS(r){let e=os.default(r.instant),t=new zr.ParsingComponents(r,{});return hn.assignSimilarDate(t,e),hn.assignSimilarTime(t,e),r.timezoneOffset!==null&&t.assign("timezoneOffset",e.utcOffset()),t}Se.now=qS;function jS(r){let e=os.default(r.instant),t=new zr.ParsingComponents(r,{});return hn.assignSimilarDate(t,e),hn.implySimilarTime(t,e),t}Se.today=jS;function $S(r){return Gg(r,1)}Se.yesterday=$S;function Gg(r,e){return Rd(r,-e)}Se.theDayBefore=Gg;function GS(r){return Rd(r,1)}Se.tomorrow=GS;function Rd(r,e){let t=os.default(r.instant),n=new zr.ParsingComponents(r,{});return t=t.add(e,"day"),hn.assignSimilarDate(n,t),hn.implySimilarTime(n,t),n}Se.theDayAfter=Rd;function YS(r,e=22){let t=os.default(r.instant),n=new zr.ParsingComponents(r,{});return n.imply("hour",e),n.imply("meridiem",Ta.Meridiem.PM),hn.assignSimilarDate(n,t),n}Se.tonight=YS;function BS(r,e=0){let t=os.default(r.instant),n=new zr.ParsingComponents(r,{});return t.hour()<6&&(t=t.add(-1,"day")),hn.assignSimilarDate(n,t),n.imply("hour",e),n}Se.lastNight=BS;function HS(r,e=20){let t=new zr.ParsingComponents(r,{});return t.imply("meridiem",Ta.Meridiem.PM),t.imply("hour",e),t}Se.evening=HS;function VS(r,e=20){let t=os.default(r.instant),n=new zr.ParsingComponents(r,{});return t=t.add(-1,"day"),hn.assignSimilarDate(n,t),n.imply("hour",e),n.imply("meridiem",Ta.Meridiem.PM),n}Se.yesterdayEvening=VS;function zS(r){let e=new zr.ParsingComponents(r,{});return e.imply("hour",0),e.imply("minute",0),e.imply("second",0),e}Se.midnight=zS;function KS(r,e=6){let t=new zr.ParsingComponents(r,{});return t.imply("meridiem",Ta.Meridiem.AM),t.imply("hour",e),t}Se.morning=KS;function QS(r){let e=new zr.ParsingComponents(r,{});return e.imply("meridiem",Ta.Meridiem.AM),e.imply("hour",12),e}Se.noon=QS});var Yg=k(Sr=>{"use strict";var XS=Sr&&Sr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),ZS=Sr&&Sr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),JS=Sr&&Sr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&XS(e,r,t);return ZS(e,r),e},eO=Sr&&Sr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Sr,"__esModule",{value:!0});var tO=eO(_e()),rO=H(),nO=lr(),_a=JS(gn()),iO=/(now|today|tonight|tomorrow|tmr|tmrw|yesterday|last\s*night)(?=\W|$)/i,Md=class extends rO.AbstractParserWithWordBoundaryChecking{innerPattern(e){return iO}innerExtract(e,t){let n=tO.default(e.refDate),i=t[0].toLowerCase(),s=e.createParsingComponents();switch(i){case"now":return _a.now(e.reference);case"today":return _a.today(e.reference);case"yesterday":return _a.yesterday(e.reference);case"tomorrow":case"tmr":case"tmrw":return _a.tomorrow(e.reference);case"tonight":return _a.tonight(e.reference);default:i.match(/last\s*night/)&&(n.hour()>6&&(n=n.add(-1,"day")),nO.assignSimilarDate(s,n),s.imply("hour",0));break}return s}};Sr.default=Md});var Bg=k(va=>{"use strict";var sO=va&&va.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(va,"__esModule",{value:!0});var pu=Je(),aO=H(),oO=sO(_e()),uO=lr(),lO=/(?:this)?\s{0,3}(morning|afternoon|evening|night|midnight|noon)(?=\W|$)/i,Cd=class extends aO.AbstractParserWithWordBoundaryChecking{innerPattern(){return lO}innerExtract(e,t){let n=oO.default(e.refDate),i=e.createParsingComponents();switch(t[1].toLowerCase()){case"afternoon":i.imply("meridiem",pu.Meridiem.PM),i.imply("hour",15);break;case"evening":case"night":i.imply("meridiem",pu.Meridiem.PM),i.imply("hour",20);break;case"midnight":uO.assignTheNextDay(i,n),i.imply("hour",0),i.imply("minute",0),i.imply("second",0);break;case"morning":i.imply("meridiem",pu.Meridiem.AM),i.imply("hour",6);break;case"noon":i.imply("meridiem",pu.Meridiem.AM),i.imply("hour",12);break}return i}};va.default=Cd});var bi=k(Yn=>{"use strict";var cO=Yn&&Yn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.toDayJSClosestWeekday=Yn.toDayJSWeekday=void 0;var Hg=cO(_e());function dO(r,e,t){if(!t)return Vg(r,e);let n=Hg.default(r);switch(t){case"this":n=n.day(e);break;case"next":n=n.day(e+7);break;case"last":n=n.day(e-7);break}return n}Yn.toDayJSWeekday=dO;function Vg(r,e){let t=Hg.default(r),n=t.day();return Math.abs(e-7-n)<Math.abs(e-n)?t=t.day(e-7):Math.abs(e+7-n)<Math.abs(e-n)?t=t.day(e+7):t=t.day(e),t}Yn.toDayJSClosestWeekday=Vg});var Kg=k(Pd=>{"use strict";Object.defineProperty(Pd,"__esModule",{value:!0});var zg=pt(),fO=De(),pO=H(),mO=bi(),hO=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:on\\s*?)?(?:(this|last|past|next)\\s*)?(${fO.matchAnyPattern(zg.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(this|last|past|next)\\s*week)?(?=\\W|$)`,"i"),gO=1,yO=2,bO=3,Ad=class extends pO.AbstractParserWithWordBoundaryChecking{innerPattern(){return hO}innerExtract(e,t){let n=t[yO].toLowerCase(),i=zg.WEEKDAY_DICTIONARY[n],s=t[gO],a=t[bO],o=s||a;o=o||"",o=o.toLowerCase();let u=null;o=="last"||o=="past"?u="last":o=="next"?u="next":o=="this"&&(u="this");let l=mO.toDayJSWeekday(e.refDate,i,u);return e.createParsingComponents().assign("weekday",i).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};Pd.default=Ad});var Zg=k(wa=>{"use strict";var TO=wa&&wa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(wa,"__esModule",{value:!0});var Xg=pt(),Qg=qe(),_O=TO(_e()),vO=H(),wO=De(),kO=new RegExp(`(this|last|past|next|after\\s*this)\\s*(${wO.matchAnyPattern(Xg.TIME_UNIT_DICTIONARY)})(?=\\s*)(?=\\W|$)`,"i"),EO=1,SO=2,Nd=class extends vO.AbstractParserWithWordBoundaryChecking{innerPattern(){return kO}innerExtract(e,t){let n=t[EO].toLowerCase(),i=t[SO].toLowerCase(),s=Xg.TIME_UNIT_DICTIONARY[i];if(n=="next"||n.startsWith("after")){let u={};return u[s]=1,Qg.ParsingComponents.createRelativeFromReference(e.reference,u)}if(n=="last"||n=="past"){let u={};return u[s]=-1,Qg.ParsingComponents.createRelativeFromReference(e.reference,u)}let a=e.createParsingComponents(),o=_O.default(e.reference.instant);return i.match(/week/i)?(o=o.add(-o.get("d"),"d"),a.imply("day",o.date()),a.imply("month",o.month()+1),a.imply("year",o.year())):i.match(/month/i)?(o=o.add(-o.date()+1,"d"),a.imply("day",o.date()),a.assign("year",o.year()),a.assign("month",o.month()+1)):i.match(/year/i)&&(o=o.add(-o.date()+1,"d"),o=o.add(-o.month(),"month"),a.imply("day",o.date()),a.imply("month",o.month()+1),a.assign("year",o.year())),a}};wa.default=Nd});var Or=k(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.ParsingContext=cs.Chrono=void 0;var us=qe(),OO=Id(),ls=class{constructor(e){e=e||OO.createCasualConfiguration(),this.parsers=[...e.parsers],this.refiners=[...e.refiners]}clone(){return new ls({parsers:[...this.parsers],refiners:[...this.refiners]})}parseDate(e,t,n){let i=this.parse(e,t,n);return i.length>0?i[0].start.date():null}parse(e,t,n){let i=new mu(e,t,n),s=[];return this.parsers.forEach(a=>{let o=ls.executeParser(i,a);s=s.concat(o)}),s.sort((a,o)=>a.index-o.index),this.refiners.forEach(function(a){s=a.refine(i,s)}),s}static executeParser(e,t){let n=[],i=t.pattern(e),s=e.text,a=e.text,o=i.exec(a);for(;o;){let u=o.index+s.length-a.length;o.index=u;let l=t.extract(e,o);if(!l){a=s.substring(o.index+1),o=i.exec(a);continue}let c=null;l instanceof us.ParsingResult?c=l:l instanceof us.ParsingComponents?(c=e.createParsingResult(o.index,o[0]),c.start=l):c=e.createParsingResult(o.index,o[0],l),e.debug(()=>console.log(`${t.constructor.name} extracted result ${c}`)),n.push(c),a=s.substring(u+c.text.length),o=i.exec(a)}return n}};cs.Chrono=ls;var mu=class{constructor(e,t,n){this.text=e,this.reference=new us.ReferenceWithTimezone(t),this.option=n!=null?n:{},this.refDate=this.reference.instant}createParsingComponents(e){return e instanceof us.ParsingComponents?e:new us.ParsingComponents(this.reference,e)}createParsingResult(e,t,n,i){let s=typeof t=="string"?t:this.text.substring(e,t),a=n?this.createParsingComponents(n):null,o=i?this.createParsingComponents(i):null;return new us.ParsingResult(this.reference,e,s,a,o)}debug(e){this.option.debug&&(this.option.debug instanceof Function?this.option.debug(e):this.option.debug.debug(e))}};cs.ParsingContext=mu});var Ti=k(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0});var Jg=ft(),DO=new RegExp("([^\\d]|^)([0-3]{0,1}[0-9]{1})[\\/\\.\\-]([0-3]{0,1}[0-9]{1})(?:[\\/\\.\\-]([0-9]{4}|[0-9]{2}))?(\\W|$)","i"),hu=1,ey=5,ty=2,ry=3,Fd=4,Ld=class{constructor(e){this.groupNumberMonth=e?ry:ty,this.groupNumberDay=e?ty:ry}pattern(){return DO}extract(e,t){if(t[hu]=="/"||t[ey]=="/"){t.index+=t[0].length;return}let n=t.index+t[hu].length,i=t[0].substr(t[hu].length,t[0].length-t[hu].length-t[ey].length);if(i.match(/^\d\.\d$/)||i.match(/^\d\.\d{1,2}\.\d{1,2}\s*$/)||!t[Fd]&&t[0].indexOf("/")<0)return;let s=e.createParsingResult(n,i),a=parseInt(t[this.groupNumberMonth]),o=parseInt(t[this.groupNumberDay]);if((a<1||a>12)&&a>12)if(o>=1&&o<=12&&a<=31)[o,a]=[a,o];else return null;if(o<1||o>31)return null;if(s.start.assign("day",o),s.start.assign("month",a),t[Fd]){let u=parseInt(t[Fd]),l=Jg.findMostLikelyADYear(u);s.start.assign("year",l)}else{let u=Jg.findYearClosestToRef(e.refDate,o,a);s.start.imply("year",u)}return s}};Ud.default=Ld});var iy=k(qd=>{"use strict";Object.defineProperty(qd,"__esModule",{value:!0});var ny=pt(),xO=qe(),RO=H(),MO=cr(),CO=new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${ny.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),Wd=class extends RO.AbstractParserWithWordBoundaryChecking{innerPattern(){return CO}innerExtract(e,t){let n=t[1].toLowerCase(),i=ny.parseTimeUnits(t[2]);switch(n){case"last":case"past":case"-":i=MO.reverseTimeUnits(i);break}return xO.ParsingComponents.createRelativeFromReference(e.reference,i)}};qd.default=Wd});var ay=k(Gd=>{"use strict";Object.defineProperty(Gd,"__esModule",{value:!0});var AO=is(),jd=qe(),PO=pt(),NO=cr();function sy(r){return r.text.match(/\s+(before|from)$/i)!=null}function IO(r){return r.text.match(/\s+(after|since)$/i)!=null}var $d=class extends AO.MergingRefiner{patternBetween(){return/^\s*$/i}shouldMergeResults(e,t,n){return!e.match(this.patternBetween())||!sy(t)&&!IO(t)?!1:!!n.start.get("day")&&!!n.start.get("month")&&!!n.start.get("year")}mergeResults(e,t,n){let i=PO.parseTimeUnits(t.text);sy(t)&&(i=NO.reverseTimeUnits(i));let s=jd.ParsingComponents.createRelativeFromReference(new jd.ReferenceWithTimezone(n.start.date()),i);return new jd.ParsingResult(n.reference,t.index,`${t.text}${e}${n.text}`,s)}};Gd.default=$d});var Id=k(He=>{"use strict";var nt=He&&He.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(He,"__esModule",{value:!0});He.createConfiguration=He.createCasualConfiguration=He.parseDate=He.parse=He.GB=He.strict=He.casual=void 0;var FO=nt(sg()),LO=nt(dg()),UO=nt(gg()),WO=nt(Tg()),qO=nt(wg()),jO=nt(kg()),$O=nt(Sg()),GO=nt(Og()),YO=nt(Dg()),BO=nt(xg()),HO=nt(Cg()),VO=mn(),zO=nt(Yg()),KO=nt(Bg()),QO=nt(Kg()),XO=nt(Zg()),Yd=Or(),ZO=nt(Ti()),JO=nt(iy()),e1=nt(ay());He.casual=new Yd.Chrono(oy(!1));He.strict=new Yd.Chrono(gu(!0,!1));He.GB=new Yd.Chrono(gu(!1,!0));function t1(r,e,t){return He.casual.parse(r,e,t)}He.parse=t1;function r1(r,e,t){return He.casual.parseDate(r,e,t)}He.parseDate=r1;function oy(r=!1){let e=gu(!1,r);return e.parsers.unshift(new zO.default),e.parsers.unshift(new KO.default),e.parsers.unshift(new WO.default),e.parsers.unshift(new XO.default),e.parsers.unshift(new JO.default),e}He.createCasualConfiguration=oy;function gu(r=!0,e=!1){return VO.includeCommonConfiguration({parsers:[new ZO.default(e),new FO.default,new LO.default,new UO.default,new QO.default,new qO.default,new jO.default,new $O.default(r),new GO.default(r),new YO.default(r)],refiners:[new e1.default,new HO.default,new BO.default]},r)}He.createConfiguration=gu});var uy=k(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});var n1=gi(),Bd=class extends n1.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:um|von)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|bis)\\s*"}extractPrimaryTimeComponents(e,t){return t[0].match(/^\s*\d{4}\s*$/)?null:super.extractPrimaryTimeComponents(e,t)}};Hd.default=Bd});var ka=k(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.parseTimeUnits=Me.TIME_UNITS_PATTERN=Me.parseYear=Me.YEAR_PATTERN=Me.parseNumberPattern=Me.NUMBER_PATTERN=Me.TIME_UNIT_DICTIONARY=Me.INTEGER_WORD_DICTIONARY=Me.MONTH_DICTIONARY=Me.WEEKDAY_DICTIONARY=void 0;var Vd=De(),i1=ft();Me.WEEKDAY_DICTIONARY={sonntag:0,so:0,montag:1,mo:1,dienstag:2,di:2,mittwoch:3,mi:3,donnerstag:4,do:4,freitag:5,fr:5,samstag:6,sa:6};Me.MONTH_DICTIONARY={januar:1,j\u00E4nner:1,janner:1,jan:1,"jan.":1,februar:2,feber:2,feb:2,"feb.":2,m\u00E4rz:3,maerz:3,m\u00E4r:3,"m\xE4r.":3,mrz:3,"mrz.":3,april:4,apr:4,"apr.":4,mai:5,juni:6,jun:6,"jun.":6,juli:7,jul:7,"jul.":7,august:8,aug:8,"aug.":8,september:9,sep:9,"sep.":9,sept:9,"sept.":9,oktober:10,okt:10,"okt.":10,november:11,nov:11,"nov.":11,dezember:12,dez:12,"dez.":12};Me.INTEGER_WORD_DICTIONARY={eins:1,eine:1,einem:1,einen:1,einer:1,zwei:2,drei:3,vier:4,f\u00FCnf:5,fuenf:5,sechs:6,sieben:7,acht:8,neun:9,zehn:10,elf:11,zw\u00F6lf:12,zwoelf:12};Me.TIME_UNIT_DICTIONARY={sek:"second",sekunde:"second",sekunden:"second",min:"minute",minute:"minute",minuten:"minute",h:"hour",std:"hour",stunde:"hour",stunden:"hour",tag:"d",tage:"d",tagen:"d",woche:"week",wochen:"week",monat:"month",monate:"month",monaten:"month",monats:"month",quartal:"quarter",quartals:"quarter",quartale:"quarter",quartalen:"quarter",a:"year",j:"year",jr:"year",jahr:"year",jahre:"year",jahren:"year",jahres:"year"};Me.NUMBER_PATTERN=`(?:${Vd.matchAnyPattern(Me.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|half(?:\\s*an?)?|an?\\b(?:\\s*few)?|few|several|a?\\s*couple\\s*(?:of)?)`;function cy(r){let e=r.toLowerCase();return Me.INTEGER_WORD_DICTIONARY[e]!==void 0?Me.INTEGER_WORD_DICTIONARY[e]:e==="a"||e==="an"?1:e.match(/few/)?3:e.match(/half/)?.5:e.match(/couple/)?2:e.match(/several/)?7:parseFloat(e)}Me.parseNumberPattern=cy;Me.YEAR_PATTERN="(?:[0-9]{1,4}(?:\\s*[vn]\\.?\\s*(?:C(?:hr)?|(?:u\\.?|d\\.?(?:\\s*g\\.?)?)?\\s*Z)\\.?|\\s*(?:u\\.?|d\\.?(?:\\s*g\\.)?)\\s*Z\\.?)?)";function s1(r){if(/v/i.test(r))return-parseInt(r.replace(/[^0-9]+/gi,""));if(/n/i.test(r))return parseInt(r.replace(/[^0-9]+/gi,""));if(/z/i.test(r))return parseInt(r.replace(/[^0-9]+/gi,""));let e=parseInt(r);return i1.findMostLikelyADYear(e)}Me.parseYear=s1;var dy=`(${Me.NUMBER_PATTERN})\\s{0,5}(${Vd.matchAnyPattern(Me.TIME_UNIT_DICTIONARY)})\\s{0,5}`,ly=new RegExp(dy,"i");Me.TIME_UNITS_PATTERN=Vd.repeatedTimeunitPattern("",dy);function a1(r){let e={},t=r,n=ly.exec(t);for(;n;)o1(e,n),t=t.substring(n[0].length),n=ly.exec(t);return e}Me.parseTimeUnits=a1;function o1(r,e){let t=cy(e[1]),n=Me.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var py=k(Kd=>{"use strict";Object.defineProperty(Kd,"__esModule",{value:!0});var fy=ka(),u1=De(),l1=H(),c1=bi(),d1=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:a[mn]\\s*?)?(?:(diese[mn]|letzte[mn]|n(?:\xE4|ae)chste[mn])\\s*)?(${u1.matchAnyPattern(fy.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(diese|letzte|n(?:\xE4|ae)chste)\\s*woche)?(?=\\W|$)`,"i"),f1=1,p1=3,m1=2,zd=class extends l1.AbstractParserWithWordBoundaryChecking{innerPattern(){return d1}innerExtract(e,t){let n=t[m1].toLowerCase(),i=fy.WEEKDAY_DICTIONARY[n],s=t[f1],a=t[p1],o=s||a;o=o||"",o=o.toLowerCase();let u=null;o.match(/letzte/)?u="last":o.match(/chste/)?u="next":o.match(/diese/)&&(u="this");let l=c1.toDayJSWeekday(e.refDate,i,u);return e.createParsingComponents().assign("weekday",i).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};Kd.default=zd});var yy=k(Qd=>{"use strict";Object.defineProperty(Qd,"__esModule",{value:!0});var Bn=Je(),h1=new RegExp("(^|\\s|T)(?:(?:um|von)\\s*)?(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s)?)?(?:\\s*Uhr)?(?:\\s*(morgens|vormittags|nachmittags|abends|nachts|am\\s+(?:Morgen|Vormittag|Nachmittag|Abend)|in\\s+der\\s+Nacht))?(?=\\W|$)","i"),g1=new RegExp("^\\s*(\\-|\\\u2013|\\~|\\\u301C|bis(?:\\s+um)?|\\?)\\s*(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s)?)?(?:\\s*Uhr)?(?:\\s*(morgens|vormittags|nachmittags|abends|nachts|am\\s+(?:Morgen|Vormittag|Nachmittag|Abend)|in\\s+der\\s+Nacht))?(?=\\W|$)","i"),y1=2,my=3,hy=4,gy=5,ds=class{pattern(e){return h1}extract(e,t){let n=e.createParsingResult(t.index+t[1].length,t[0].substring(t[1].length));if(n.text.match(/^\d{4}$/)||(n.start=ds.extractTimeComponent(n.start.clone(),t),!n.start))return t.index+=t[0].length,null;let i=e.text.substring(t.index+t[0].length),s=g1.exec(i);return s&&(n.end=ds.extractTimeComponent(n.start.clone(),s),n.end&&(n.text+=s[0])),n}static extractTimeComponent(e,t){let n=0,i=0,s=null;if(n=parseInt(t[y1]),t[my]!=null&&(i=parseInt(t[my])),i>=60||n>24)return null;if(n>=12&&(s=Bn.Meridiem.PM),t[gy]!=null){if(n>12)return null;let a=t[gy].toLowerCase();a.match(/morgen|vormittag/)&&(s=Bn.Meridiem.AM,n==12&&(n=0)),a.match(/nachmittag|abend/)&&(s=Bn.Meridiem.PM,n!=12&&(n+=12)),a.match(/nacht/)&&(n==12?(s=Bn.Meridiem.AM,n=0):n<6?s=Bn.Meridiem.AM:(s=Bn.Meridiem.PM,n+=12))}if(e.assign("hour",n),e.assign("minute",i),s!==null?e.assign("meridiem",s):n<12?e.imply("meridiem",Bn.Meridiem.AM):e.imply("meridiem",Bn.Meridiem.PM),t[hy]!=null){let a=parseInt(t[hy]);if(a>=60)return null;e.assign("second",a)}return e}};Qd.default=ds});var by=k(Ea=>{"use strict";var b1=Ea&&Ea.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ea,"__esModule",{value:!0});var T1=b1(Vr()),Xd=class extends T1.default{patternBetween(){return/^\s*(bis(?:\s*(?:am|zum))?|-)\s*$/i}};Ea.default=Xd});var Ty=k(Sa=>{"use strict";var _1=Sa&&Sa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Sa,"__esModule",{value:!0});var v1=_1(pn()),Zd=class extends v1.default{patternBetween(){return new RegExp("^\\s*(T|um|am|,|-)?\\s*$")}};Sa.default=Zd});var Jd=k(Da=>{"use strict";var w1=Da&&Da.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Da,"__esModule",{value:!0});var k1=w1(_e()),_i=Je(),E1=H(),S1=lr(),O1=cr(),Oa=class extends E1.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(diesen)?\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht)(?=\W|$)/i}innerExtract(e,t){let n=k1.default(e.refDate),i=t[2].toLowerCase(),s=e.createParsingComponents();return S1.implySimilarTime(s,n),Oa.extractTimeComponents(s,i)}static extractTimeComponents(e,t){switch(t){case"morgen":e.imply("hour",6),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",_i.Meridiem.AM);break;case"vormittag":e.imply("hour",9),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",_i.Meridiem.AM);break;case"mittag":case"mittags":e.imply("hour",12),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",_i.Meridiem.AM);break;case"nachmittag":e.imply("hour",15),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",_i.Meridiem.PM);break;case"abend":e.imply("hour",18),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",_i.Meridiem.PM);break;case"nacht":e.imply("hour",22),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",_i.Meridiem.PM);break;case"mitternacht":e.get("hour")>1&&(e=O1.addImpliedTimeUnits(e,{day:1})),e.imply("hour",0),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",_i.Meridiem.AM);break}return e}};Da.default=Oa});var wy=k(Dr=>{"use strict";var D1=Dr&&Dr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),x1=Dr&&Dr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),R1=Dr&&Dr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&D1(e,r,t);return x1(e,r),e},vy=Dr&&Dr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Dr,"__esModule",{value:!0});var M1=vy(_e()),C1=H(),vi=lr(),A1=vy(Jd()),_y=R1(gn()),P1=new RegExp("(jetzt|heute|morgen|\xFCbermorgen|uebermorgen|gestern|vorgestern|letzte\\s*nacht)(?:\\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht))?(?=\\W|$)","i"),N1=1,I1=2,ef=class extends C1.AbstractParserWithWordBoundaryChecking{innerPattern(e){return P1}innerExtract(e,t){let n=M1.default(e.refDate),i=(t[N1]||"").toLowerCase(),s=(t[I1]||"").toLowerCase(),a=e.createParsingComponents();switch(i){case"jetzt":a=_y.now(e.reference);break;case"heute":a=_y.today(e.reference);break;case"morgen":vi.assignTheNextDay(a,n);break;case"\xFCbermorgen":case"uebermorgen":n=n.add(1,"day"),vi.assignTheNextDay(a,n);break;case"gestern":n=n.add(-1,"day"),vi.assignSimilarDate(a,n),vi.implySimilarTime(a,n);break;case"vorgestern":n=n.add(-2,"day"),vi.assignSimilarDate(a,n),vi.implySimilarTime(a,n);break;default:i.match(/letzte\s*nacht/)&&(n.hour()>6&&(n=n.add(-1,"day")),vi.assignSimilarDate(a,n),a.imply("hour",0));break}return s&&(a=A1.default.extractTimeComponents(a,s)),a}};Dr.default=ef});var xy=k(rf=>{"use strict";Object.defineProperty(rf,"__esModule",{value:!0});var F1=ft(),Oy=ka(),Dy=ka(),L1=De(),U1=H(),W1=new RegExp(`(?:am\\s*?)?(?:den\\s*?)?([0-9]{1,2})\\.(?:\\s*(?:bis(?:\\s*(?:am|zum))?|\\-|\\\u2013|\\s)\\s*([0-9]{1,2})\\.?)?\\s*(${L1.matchAnyPattern(Oy.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s*)(${Dy.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),ky=1,Ey=2,q1=3,Sy=4,tf=class extends U1.AbstractParserWithWordBoundaryChecking{innerPattern(){return W1}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=Oy.MONTH_DICTIONARY[t[q1].toLowerCase()],s=parseInt(t[ky]);if(s>31)return t.index=t.index+t[ky].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[Sy]){let a=Dy.parseYear(t[Sy]);n.start.assign("year",a)}else{let a=F1.findYearClosestToRef(e.refDate,s,i);n.start.imply("year",a)}if(t[Ey]){let a=parseInt(t[Ey]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};rf.default=tf});var Ry=k(sf=>{"use strict";Object.defineProperty(sf,"__esModule",{value:!0});var yu=ka(),j1=qe(),$1=H(),G1=cr(),Y1=De(),nf=class extends $1.AbstractParserWithWordBoundaryChecking{constructor(){super()}innerPattern(){return new RegExp(`(?:\\s*((?:n\xE4chste|kommende|folgende|letzte|vergangene|vorige|vor(?:her|an)gegangene)(?:s|n|m|r)?|vor|in)\\s*)?(${yu.NUMBER_PATTERN})?(?:\\s*(n\xE4chste|kommende|folgende|letzte|vergangene|vorige|vor(?:her|an)gegangene)(?:s|n|m|r)?)?\\s*(${Y1.matchAnyPattern(yu.TIME_UNIT_DICTIONARY)})`,"i")}innerExtract(e,t){let n=t[2]?yu.parseNumberPattern(t[2]):1,i=yu.TIME_UNIT_DICTIONARY[t[4].toLowerCase()],s={};s[i]=n;let a=t[1]||t[3]||"";if(a=a.toLowerCase(),!!a)return(/vor/.test(a)||/letzte/.test(a)||/vergangen/.test(a))&&(s=G1.reverseTimeUnits(s)),j1.ParsingComponents.createRelativeFromReference(e.reference,s)}};sf.default=nf});var Ay=k(it=>{"use strict";var xr=it&&it.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(it,"__esModule",{value:!0});it.createConfiguration=it.createCasualConfiguration=it.parseDate=it.parse=it.strict=it.casual=void 0;var B1=mn(),My=Or(),H1=xr(Ti()),V1=xr(Od()),z1=xr(uy()),K1=xr(py()),Q1=xr(yy()),X1=xr(by()),Z1=xr(Ty()),J1=xr(wy()),e0=xr(Jd()),t0=xr(xy()),r0=xr(Ry());it.casual=new My.Chrono(Cy());it.strict=new My.Chrono(af(!0));function n0(r,e,t){return it.casual.parse(r,e,t)}it.parse=n0;function i0(r,e,t){return it.casual.parseDate(r,e,t)}it.parseDate=i0;function Cy(r=!0){let e=af(!1,r);return e.parsers.unshift(new e0.default),e.parsers.unshift(new J1.default),e.parsers.unshift(new r0.default),e}it.createCasualConfiguration=Cy;function af(r=!0,e=!0){return B1.includeCommonConfiguration({parsers:[new V1.default,new H1.default(e),new z1.default,new Q1.default,new t0.default,new K1.default],refiners:[new X1.default,new Z1.default]},r)}it.createConfiguration=af});var Ny=k(Rr=>{"use strict";var s0=Rr&&Rr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),a0=Rr&&Rr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),o0=Rr&&Rr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&s0(e,r,t);return a0(e,r),e},u0=Rr&&Rr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Rr,"__esModule",{value:!0});var l0=u0(_e()),c0=Je(),d0=H(),Py=lr(),bu=o0(gn()),of=class extends d0.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(maintenant|aujourd'hui|demain|hier|cette\s*nuit|la\s*veille)(?=\W|$)/i}innerExtract(e,t){let n=l0.default(e.refDate),i=t[0].toLowerCase(),s=e.createParsingComponents();switch(i){case"maintenant":return bu.now(e.reference);case"aujourd'hui":return bu.today(e.reference);case"hier":return bu.yesterday(e.reference);case"demain":return bu.tomorrow(e.reference);default:i.match(/cette\s*nuit/)?(Py.assignSimilarDate(s,n),s.imply("hour",22),s.imply("meridiem",c0.Meridiem.PM)):i.match(/la\s*veille/)&&(n=n.add(-1,"day"),Py.assignSimilarDate(s,n),s.imply("hour",0))}return s}};Rr.default=of});var Iy=k(lf=>{"use strict";Object.defineProperty(lf,"__esModule",{value:!0});var xa=Je(),f0=H(),uf=class extends f0.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(cet?)?\s*(matin|soir|après-midi|aprem|a midi|à minuit)(?=\W|$)/i}innerExtract(e,t){let n=t[2].toLowerCase(),i=e.createParsingComponents();switch(n){case"apr\xE8s-midi":case"aprem":i.imply("hour",14),i.imply("minute",0),i.imply("meridiem",xa.Meridiem.PM);break;case"soir":i.imply("hour",18),i.imply("minute",0),i.imply("meridiem",xa.Meridiem.PM);break;case"matin":i.imply("hour",8),i.imply("minute",0),i.imply("meridiem",xa.Meridiem.AM);break;case"a midi":i.imply("hour",12),i.imply("minute",0),i.imply("meridiem",xa.Meridiem.AM);break;case"\xE0 minuit":i.imply("hour",0),i.imply("meridiem",xa.Meridiem.AM);break}return i}};lf.default=uf});var Fy=k(df=>{"use strict";Object.defineProperty(df,"__esModule",{value:!0});var p0=gi(),cf=class extends p0.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:[\xE0a])\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|[\xE0a]|\\?)\\s*"}extractPrimaryTimeComponents(e,t){return t[0].match(/^\s*\d{4}\s*$/)?null:super.extractPrimaryTimeComponents(e,t)}};df.default=cf});var Ly=k(Ra=>{"use strict";var m0=Ra&&Ra.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ra,"__esModule",{value:!0});var h0=m0(pn()),ff=class extends h0.default{patternBetween(){return new RegExp("^\\s*(T|\xE0|a|vers|de|,|-)?\\s*$")}};Ra.default=ff});var Uy=k(Ma=>{"use strict";var g0=Ma&&Ma.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ma,"__esModule",{value:!0});var y0=g0(Vr()),pf=class extends y0.default{patternBetween(){return/^\s*(à|a|-)\s*$/i}};Ma.default=pf});var Hn=k(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.parseTimeUnits=ve.TIME_UNITS_PATTERN=ve.parseYear=ve.YEAR_PATTERN=ve.parseOrdinalNumberPattern=ve.ORDINAL_NUMBER_PATTERN=ve.parseNumberPattern=ve.NUMBER_PATTERN=ve.TIME_UNIT_DICTIONARY=ve.INTEGER_WORD_DICTIONARY=ve.MONTH_DICTIONARY=ve.WEEKDAY_DICTIONARY=void 0;var mf=De();ve.WEEKDAY_DICTIONARY={dimanche:0,dim:0,lundi:1,lun:1,mardi:2,mar:2,mercredi:3,mer:3,jeudi:4,jeu:4,vendredi:5,ven:5,samedi:6,sam:6};ve.MONTH_DICTIONARY={janvier:1,jan:1,"jan.":1,f\u00E9vrier:2,f\u00E9v:2,"f\xE9v.":2,fevrier:2,fev:2,"fev.":2,mars:3,mar:3,"mar.":3,avril:4,avr:4,"avr.":4,mai:5,juin:6,jun:6,juillet:7,juil:7,jul:7,"jul.":7,ao\u00FBt:8,aout:8,septembre:9,sep:9,"sep.":9,sept:9,"sept.":9,octobre:10,oct:10,"oct.":10,novembre:11,nov:11,"nov.":11,d\u00E9cembre:12,decembre:12,dec:12,"dec.":12};ve.INTEGER_WORD_DICTIONARY={un:1,deux:2,trois:3,quatre:4,cinq:5,six:6,sept:7,huit:8,neuf:9,dix:10,onze:11,douze:12,treize:13};ve.TIME_UNIT_DICTIONARY={sec:"second",seconde:"second",secondes:"second",min:"minute",mins:"minute",minute:"minute",minutes:"minute",h:"hour",hr:"hour",hrs:"hour",heure:"hour",heures:"hour",jour:"d",jours:"d",semaine:"week",semaines:"week",mois:"month",trimestre:"quarter",trimestres:"quarter",ans:"year",ann\u00E9e:"year",ann\u00E9es:"year"};ve.NUMBER_PATTERN=`(?:${mf.matchAnyPattern(ve.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|une?\\b|quelques?|demi-?)`;function qy(r){let e=r.toLowerCase();return ve.INTEGER_WORD_DICTIONARY[e]!==void 0?ve.INTEGER_WORD_DICTIONARY[e]:e==="une"||e==="un"?1:e.match(/quelques?/)?3:e.match(/demi-?/)?.5:parseFloat(e)}ve.parseNumberPattern=qy;ve.ORDINAL_NUMBER_PATTERN="(?:[0-9]{1,2}(?:er)?)";function b0(r){let e=r.toLowerCase();return e=e.replace(/(?:er)$/i,""),parseInt(e)}ve.parseOrdinalNumberPattern=b0;ve.YEAR_PATTERN="(?:[1-9][0-9]{0,3}\\s*(?:AC|AD|p\\.\\s*C(?:hr?)?\\.\\s*n\\.)|[1-2][0-9]{3}|[5-9][0-9])";function T0(r){if(/AC/i.test(r))return r=r.replace(/BC/i,""),-parseInt(r);if(/AD/i.test(r)||/C/i.test(r))return r=r.replace(/[^\d]+/i,""),parseInt(r);let e=parseInt(r);return e<100&&(e>50?e=e+1900:e=e+2e3),e}ve.parseYear=T0;var jy=`(${ve.NUMBER_PATTERN})\\s{0,5}(${mf.matchAnyPattern(ve.TIME_UNIT_DICTIONARY)})\\s{0,5}`,Wy=new RegExp(jy,"i");ve.TIME_UNITS_PATTERN=mf.repeatedTimeunitPattern("",jy);function _0(r){let e={},t=r,n=Wy.exec(t);for(;n;)v0(e,n),t=t.substring(n[0].length),n=Wy.exec(t);return e}ve.parseTimeUnits=_0;function v0(r,e){let t=qy(e[1]),n=ve.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var Gy=k(gf=>{"use strict";Object.defineProperty(gf,"__esModule",{value:!0});var $y=Hn(),w0=De(),k0=H(),E0=bi(),S0=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:(?:ce)\\s*)?(${w0.matchAnyPattern($y.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(dernier|prochain)\\s*)?(?=\\W|\\d|$)`,"i"),O0=1,D0=2,hf=class extends k0.AbstractParserWithWordBoundaryChecking{innerPattern(){return S0}innerExtract(e,t){let n=t[O0].toLowerCase(),i=$y.WEEKDAY_DICTIONARY[n];if(i===void 0)return null;let s=t[D0];s=s||"",s=s.toLowerCase();let a=null;s=="dernier"?a="last":s=="prochain"&&(a="next");let o=E0.toDayJSWeekday(e.refDate,i,a);return e.createParsingComponents().assign("weekday",i).imply("day",o.date()).imply("month",o.month()+1).imply("year",o.year())}};gf.default=hf});var Vy=k(yf=>{"use strict";Object.defineProperty(yf,"__esModule",{value:!0});var Ca=Je(),x0=new RegExp("(^|\\s|T)(?:(?:[\xE0a])\\s*)?(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s|:)?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?(?=\\W|$)","i"),R0=new RegExp("^\\s*(\\-|\\\u2013|\\~|\\\u301C|[\xE0a]|\\?)\\s*(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s|:)?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?(?=\\W|$)","i"),M0=2,Yy=3,By=4,Hy=5,fs=class{pattern(e){return x0}extract(e,t){let n=e.createParsingResult(t.index+t[1].length,t[0].substring(t[1].length));if(n.text.match(/^\d{4}$/)||(n.start=fs.extractTimeComponent(n.start.clone(),t),!n.start))return t.index+=t[0].length,null;let i=e.text.substring(t.index+t[0].length),s=R0.exec(i);return s&&(n.end=fs.extractTimeComponent(n.start.clone(),s),n.end&&(n.text+=s[0])),n}static extractTimeComponent(e,t){let n=0,i=0,s=null;if(n=parseInt(t[M0]),t[Yy]!=null&&(i=parseInt(t[Yy])),i>=60||n>24)return null;if(n>=12&&(s=Ca.Meridiem.PM),t[Hy]!=null){if(n>12)return null;let a=t[Hy][0].toLowerCase();a=="a"&&(s=Ca.Meridiem.AM,n==12&&(n=0)),a=="p"&&(s=Ca.Meridiem.PM,n!=12&&(n+=12))}if(e.assign("hour",n),e.assign("minute",i),s!==null?e.assign("meridiem",s):n<12?e.imply("meridiem",Ca.Meridiem.AM):e.imply("meridiem",Ca.Meridiem.PM),t[By]!=null){let a=parseInt(t[By]);if(a>=60)return null;e.assign("second",a)}return e}};yf.default=fs});var Jy=k(Tf=>{"use strict";Object.defineProperty(Tf,"__esModule",{value:!0});var C0=ft(),Xy=Hn(),Zy=Hn(),Tu=Hn(),A0=De(),P0=H(),N0=new RegExp(`(?:on\\s*?)?(${Tu.ORDINAL_NUMBER_PATTERN})(?:\\s*(?:au|\\-|\\\u2013|jusqu'au?|\\s)\\s*(${Tu.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s*(?:de)?\\s*)(${A0.matchAnyPattern(Xy.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s*)(${Zy.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),zy=1,Ky=2,I0=3,Qy=4,bf=class extends P0.AbstractParserWithWordBoundaryChecking{innerPattern(){return N0}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=Xy.MONTH_DICTIONARY[t[I0].toLowerCase()],s=Tu.parseOrdinalNumberPattern(t[zy]);if(s>31)return t.index=t.index+t[zy].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[Qy]){let a=Zy.parseYear(t[Qy]);n.start.assign("year",a)}else{let a=C0.findYearClosestToRef(e.refDate,s,i);n.start.imply("year",a)}if(t[Ky]){let a=Tu.parseOrdinalNumberPattern(t[Ky]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};Tf.default=bf});var tb=k(vf=>{"use strict";Object.defineProperty(vf,"__esModule",{value:!0});var eb=Hn(),F0=qe(),L0=H(),U0=cr(),_f=class extends L0.AbstractParserWithWordBoundaryChecking{constructor(){super()}innerPattern(){return new RegExp(`il y a\\s*(${eb.TIME_UNITS_PATTERN})(?=(?:\\W|$))`,"i")}innerExtract(e,t){let n=eb.parseTimeUnits(t[1]),i=U0.reverseTimeUnits(n);return F0.ParsingComponents.createRelativeFromReference(e.reference,i)}};vf.default=_f});var nb=k(kf=>{"use strict";Object.defineProperty(kf,"__esModule",{value:!0});var rb=Hn(),W0=qe(),q0=H(),wf=class extends q0.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp(`(?:dans|en|pour|pendant|de)\\s*(${rb.TIME_UNITS_PATTERN})(?=\\W|$)`,"i")}innerExtract(e,t){let n=rb.parseTimeUnits(t[1]);return W0.ParsingComponents.createRelativeFromReference(e.reference,n)}};kf.default=wf});var ib=k(Sf=>{"use strict";Object.defineProperty(Sf,"__esModule",{value:!0});var _u=Hn(),j0=qe(),$0=H(),G0=cr(),Y0=De(),Ef=class extends $0.AbstractParserWithWordBoundaryChecking{constructor(){super()}innerPattern(){return new RegExp(`(?:les?|la|l'|du|des?)\\s*(${_u.NUMBER_PATTERN})?(?:\\s*(prochaine?s?|derni[e\xE8]re?s?|pass[\xE9e]e?s?|pr[\xE9e]c[\xE9e]dents?|suivante?s?))?\\s*(${Y0.matchAnyPattern(_u.TIME_UNIT_DICTIONARY)})(?:\\s*(prochaine?s?|derni[e\xE8]re?s?|pass[\xE9e]e?s?|pr[\xE9e]c[\xE9e]dents?|suivante?s?))?`,"i")}innerExtract(e,t){let n=t[1]?_u.parseNumberPattern(t[1]):1,i=_u.TIME_UNIT_DICTIONARY[t[3].toLowerCase()],s={};s[i]=n;let a=t[2]||t[4]||"";if(a=a.toLowerCase(),!!a)return(/derni[eè]re?s?/.test(a)||/pass[ée]e?s?/.test(a)||/pr[ée]c[ée]dents?/.test(a))&&(s=G0.reverseTimeUnits(s)),j0.ParsingComponents.createRelativeFromReference(e.reference,s)}};Sf.default=Ef});var ob=k(st=>{"use strict";var dr=st&&st.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(st,"__esModule",{value:!0});st.createConfiguration=st.createCasualConfiguration=st.parseDate=st.parse=st.strict=st.casual=void 0;var B0=mn(),sb=Or(),H0=dr(Ny()),V0=dr(Iy()),z0=dr(Ti()),K0=dr(Fy()),Q0=dr(Ly()),X0=dr(Uy()),Z0=dr(Gy()),J0=dr(Vy()),eD=dr(Jy()),tD=dr(tb()),rD=dr(nb()),nD=dr(ib());st.casual=new sb.Chrono(ab());st.strict=new sb.Chrono(Of(!0));function iD(r,e,t){return st.casual.parse(r,e,t)}st.parse=iD;function sD(r,e,t){return st.casual.parseDate(r,e,t)}st.parseDate=sD;function ab(r=!0){let e=Of(!1,r);return e.parsers.unshift(new H0.default),e.parsers.unshift(new V0.default),e.parsers.unshift(new nD.default),e}st.createCasualConfiguration=ab;function Of(r=!0,e=!0){return B0.includeCommonConfiguration({parsers:[new z0.default(e),new eD.default,new K0.default,new J0.default,new tD.default,new rD.default,new Z0.default],refiners:[new Q0.default,new X0.default]},r)}st.createConfiguration=Of});var ub=k(vu=>{"use strict";Object.defineProperty(vu,"__esModule",{value:!0});vu.toHankaku=void 0;function aD(r){return String(r).replace(/\u2019/g,"'").replace(/\u201D/g,'"').replace(/\u3000/g," ").replace(/\uFFE5/g,"\xA5").replace(/[\uFF01\uFF03-\uFF06\uFF08\uFF09\uFF0C-\uFF19\uFF1C-\uFF1F\uFF21-\uFF3B\uFF3D\uFF3F\uFF41-\uFF5B\uFF5D\uFF5E]/g,oD)}vu.toHankaku=aD;function oD(r){return String.fromCharCode(r.charCodeAt(0)-65248)}});var cb=k(Aa=>{"use strict";var uD=Aa&&Aa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Aa,"__esModule",{value:!0});var Df=ub(),lD=ft(),cD=uD(_e()),dD=/(?:(?:([同今本])|((昭和|平成|令和)?([0-90-9]{1,4}|元)))年\s*)?([0-90-9]{1,2})月\s*([0-90-9]{1,2})日/i,lb=1,fD=2,xf=3,pD=4,mD=5,hD=6,Rf=class{pattern(){return dD}extract(e,t){let n=parseInt(Df.toHankaku(t[mD])),i=parseInt(Df.toHankaku(t[hD])),s=e.createParsingComponents({day:i,month:n});if(t[lb]&&t[lb].match("\u540C|\u4ECA|\u672C")){let a=cD.default(e.refDate);s.assign("year",a.year())}if(t[fD]){let a=t[pD],o=a=="\u5143"?1:parseInt(Df.toHankaku(a));t[xf]=="\u4EE4\u548C"?o+=2018:t[xf]=="\u5E73\u6210"?o+=1988:t[xf]=="\u662D\u548C"&&(o+=1925),s.assign("year",o)}else{let a=lD.findYearClosestToRef(e.refDate,i,n);s.imply("year",a)}return s}};Aa.default=Rf});var db=k(Pa=>{"use strict";var gD=Pa&&Pa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Pa,"__esModule",{value:!0});var yD=gD(Vr()),Mf=class extends yD.default{patternBetween(){return/^\s*(から|ー|-)\s*$/i}};Pa.default=Mf});var pb=k(Mr=>{"use strict";var bD=Mr&&Mr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),TD=Mr&&Mr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),_D=Mr&&Mr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&bD(e,r,t);return TD(e,r),e},vD=Mr&&Mr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Mr,"__esModule",{value:!0});var wD=vD(_e()),fb=Je(),Cf=_D(gn()),kD=/今日|当日|昨日|明日|今夜|今夕|今晩|今朝/i,Af=class{pattern(){return kD}extract(e,t){let n=t[0],i=wD.default(e.refDate),s=e.createParsingComponents();switch(n){case"\u6628\u65E5":return Cf.yesterday(e.reference);case"\u660E\u65E5":return Cf.tomorrow(e.reference);case"\u4ECA\u65E5":case"\u5F53\u65E5":return Cf.today(e.reference)}return n=="\u4ECA\u591C"||n=="\u4ECA\u5915"||n=="\u4ECA\u6669"?(s.imply("hour",22),s.assign("meridiem",fb.Meridiem.PM)):n.match("\u4ECA\u671D")&&(s.imply("hour",6),s.assign("meridiem",fb.Meridiem.AM)),s.assign("day",i.date()),s.assign("month",i.month()+1),s.assign("year",i.year()),s}};Mr.default=Af});var gb=k(at=>{"use strict";var Pf=at&&at.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(at,"__esModule",{value:!0});at.createConfiguration=at.createCasualConfiguration=at.parseDate=at.parse=at.strict=at.casual=void 0;var ED=Pf(cb()),SD=Pf(db()),OD=Pf(pb()),mb=Or();at.casual=new mb.Chrono(hb());at.strict=new mb.Chrono(Nf());function DD(r,e,t){return at.casual.parse(r,e,t)}at.parse=DD;function xD(r,e,t){return at.casual.parseDate(r,e,t)}at.parseDate=xD;function hb(){let r=Nf();return r.parsers.unshift(new OD.default),r}at.createCasualConfiguration=hb;function Nf(){return{parsers:[new ED.default],refiners:[new SD.default]}}at.createConfiguration=Nf});var wu=k(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.parseYear=Kr.YEAR_PATTERN=Kr.MONTH_DICTIONARY=Kr.WEEKDAY_DICTIONARY=void 0;Kr.WEEKDAY_DICTIONARY={domingo:0,dom:0,segunda:1,"segunda-feira":1,seg:1,ter\u00E7a:2,"ter\xE7a-feira":2,ter:2,quarta:3,"quarta-feira":3,qua:3,quinta:4,"quinta-feira":4,qui:4,sexta:5,"sexta-feira":5,sex:5,s\u00E1bado:6,sabado:6,sab:6};Kr.MONTH_DICTIONARY={janeiro:1,jan:1,"jan.":1,fevereiro:2,fev:2,"fev.":2,mar\u00E7o:3,mar:3,"mar.":3,abril:4,abr:4,"abr.":4,maio:5,mai:5,"mai.":5,junho:6,jun:6,"jun.":6,julho:7,jul:7,"jul.":7,agosto:8,ago:8,"ago.":8,setembro:9,set:9,"set.":9,outubro:10,out:10,"out.":10,novembro:11,nov:11,"nov.":11,dezembro:12,dez:12,"dez.":12};Kr.YEAR_PATTERN="[0-9]{1,4}(?![^\\s]\\d)(?:\\s*[a|d]\\.?\\s*c\\.?|\\s*a\\.?\\s*d\\.?)?";function RD(r){if(r.match(/^[0-9]{1,4}$/)){let e=parseInt(r);return e<100&&(e>50?e=e+1900:e=e+2e3),e}return r.match(/a\.?\s*c\.?/i)?(r=r.replace(/a\.?\s*c\.?/i,""),-parseInt(r)):parseInt(r)}Kr.parseYear=RD});var bb=k(Ff=>{"use strict";Object.defineProperty(Ff,"__esModule",{value:!0});var yb=wu(),MD=De(),CD=H(),AD=bi(),PD=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:(este|esta|passado|pr[o\xF3]ximo)\\s*)?(${MD.matchAnyPattern(yb.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(este|esta|passado|pr[\xF3o]ximo)\\s*semana)?(?=\\W|\\d|$)`,"i"),ND=1,ID=2,FD=3,If=class extends CD.AbstractParserWithWordBoundaryChecking{innerPattern(){return PD}innerExtract(e,t){let n=t[ID].toLowerCase(),i=yb.WEEKDAY_DICTIONARY[n];if(i===void 0)return null;let s=t[ND],a=t[FD],o=s||a||"";o=o.toLowerCase();let u=null;o=="passado"?u="this":o=="pr\xF3ximo"||o=="proximo"?u="next":o=="este"&&(u="this");let l=AD.toDayJSWeekday(e.refDate,i,u);return e.createParsingComponents().assign("weekday",i).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};Ff.default=If});var Tb=k(Uf=>{"use strict";Object.defineProperty(Uf,"__esModule",{value:!0});var LD=gi(),Lf=class extends LD.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:ao?|\xE0s?|das|da|de|do)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|a(?:o)?|\\?)\\s*"}};Uf.default=Lf});var _b=k(Na=>{"use strict";var UD=Na&&Na.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Na,"__esModule",{value:!0});var WD=UD(pn()),Wf=class extends WD.default{patternBetween(){return new RegExp("^\\s*(?:,|\xE0)?\\s*$")}};Na.default=Wf});var vb=k(Ia=>{"use strict";var qD=Ia&&Ia.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ia,"__esModule",{value:!0});var jD=qD(Vr()),qf=class extends jD.default{patternBetween(){return/^\s*(?:-)\s*$/i}};Ia.default=qf});var Db=k($f=>{"use strict";Object.defineProperty($f,"__esModule",{value:!0});var $D=ft(),Sb=wu(),Ob=wu(),GD=De(),YD=H(),BD=new RegExp(`([0-9]{1,2})(?:\xBA|\xAA|\xB0)?(?:\\s*(?:desde|de|\\-|\\\u2013|ao?|\\s)\\s*([0-9]{1,2})(?:\xBA|\xAA|\xB0)?)?\\s*(?:de)?\\s*(?:-|/|\\s*(?:de|,)?\\s*)(${GD.matchAnyPattern(Sb.MONTH_DICTIONARY)})(?:\\s*(?:de|,)?\\s*(${Ob.YEAR_PATTERN}))?(?=\\W|$)`,"i"),wb=1,kb=2,HD=3,Eb=4,jf=class extends YD.AbstractParserWithWordBoundaryChecking{innerPattern(){return BD}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=Sb.MONTH_DICTIONARY[t[HD].toLowerCase()],s=parseInt(t[wb]);if(s>31)return t.index=t.index+t[wb].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[Eb]){let a=Ob.parseYear(t[Eb]);n.start.assign("year",a)}else{let a=$D.findYearClosestToRef(e.refDate,s,i);n.start.imply("year",a)}if(t[kb]){let a=parseInt(t[kb]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};$f.default=jf});var xb=k(yn=>{"use strict";var VD=yn&&yn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),zD=yn&&yn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),KD=yn&&yn.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&VD(e,r,t);return zD(e,r),e};Object.defineProperty(yn,"__esModule",{value:!0});var QD=H(),ku=KD(gn()),Gf=class extends QD.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(agora|hoje|amanha|amanhã|ontem)(?=\W|$)/i}innerExtract(e,t){let n=t[0].toLowerCase(),i=e.createParsingComponents();switch(n){case"agora":return ku.now(e.reference);case"hoje":return ku.today(e.reference);case"amanha":case"amanh\xE3":return ku.tomorrow(e.reference);case"ontem":return ku.yesterday(e.reference)}return i}};yn.default=Gf});var Rb=k(Fa=>{"use strict";var XD=Fa&&Fa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Fa,"__esModule",{value:!0});var Eu=Je(),ZD=H(),JD=lr(),ex=XD(_e()),Yf=class extends ZD.AbstractParserWithWordBoundaryChecking{innerPattern(){return/(?:esta\s*)?(manha|manhã|tarde|meia-noite|meio-dia|noite)(?=\W|$)/i}innerExtract(e,t){let n=ex.default(e.refDate),i=e.createParsingComponents();switch(t[1].toLowerCase()){case"tarde":i.imply("meridiem",Eu.Meridiem.PM),i.imply("hour",15);break;case"noite":i.imply("meridiem",Eu.Meridiem.PM),i.imply("hour",22);break;case"manha":case"manh\xE3":i.imply("meridiem",Eu.Meridiem.AM),i.imply("hour",6);break;case"meia-noite":JD.assignTheNextDay(i,n),i.imply("hour",0),i.imply("minute",0),i.imply("second",0);break;case"meio-dia":i.imply("meridiem",Eu.Meridiem.AM),i.imply("hour",12);break}return i}};Fa.default=Yf});var Ab=k(ot=>{"use strict";var Vn=ot&&ot.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ot,"__esModule",{value:!0});ot.createConfiguration=ot.createCasualConfiguration=ot.parseDate=ot.parse=ot.strict=ot.casual=void 0;var tx=mn(),Mb=Or(),rx=Vn(Ti()),nx=Vn(bb()),ix=Vn(Tb()),sx=Vn(_b()),ax=Vn(vb()),ox=Vn(Db()),ux=Vn(xb()),lx=Vn(Rb());ot.casual=new Mb.Chrono(Cb());ot.strict=new Mb.Chrono(Bf(!0));function cx(r,e,t){return ot.casual.parse(r,e,t)}ot.parse=cx;function dx(r,e,t){return ot.casual.parseDate(r,e,t)}ot.parseDate=dx;function Cb(r=!0){let e=Bf(!1,r);return e.parsers.push(new ux.default),e.parsers.push(new lx.default),e}ot.createCasualConfiguration=Cb;function Bf(r=!0,e=!0){return tx.includeCommonConfiguration({parsers:[new rx.default(e),new nx.default,new ix.default,new ox.default],refiners:[new sx.default,new ax.default]},r)}ot.createConfiguration=Bf});var Pb=k(La=>{"use strict";var fx=La&&La.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(La,"__esModule",{value:!0});var px=fx(Vr()),Hf=class extends px.default{patternBetween(){return/^\s*(tot|-)\s*$/i}};La.default=Hf});var Nb=k(Ua=>{"use strict";var mx=Ua&&Ua.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ua,"__esModule",{value:!0});var hx=mx(pn()),Vf=class extends hx.default{patternBetween(){return new RegExp("^\\s*(om|na|voor|in de|,|-)?\\s*$")}};Ua.default=Vf});var Ib=k(bn=>{"use strict";var gx=bn&&bn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),yx=bn&&bn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),bx=bn&&bn.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&gx(e,r,t);return yx(e,r),e};Object.defineProperty(bn,"__esModule",{value:!0});var Tx=H(),Su=bx(gn()),zf=class extends Tx.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(nu|vandaag|morgen|morgend|gisteren)(?=\W|$)/i}innerExtract(e,t){let n=t[0].toLowerCase(),i=e.createParsingComponents();switch(n){case"nu":return Su.now(e.reference);case"vandaag":return Su.today(e.reference);case"morgen":case"morgend":return Su.tomorrow(e.reference);case"gisteren":return Su.yesterday(e.reference)}return i}};bn.default=zf});var Fb=k(Wa=>{"use strict";var _x=Wa&&Wa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Wa,"__esModule",{value:!0});var Ou=Je(),vx=H(),wx=_x(_e()),kx=lr(),Ex=1,Sx=2,Kf=class extends vx.AbstractParserWithWordBoundaryChecking{innerPattern(){return/(deze)?\s*(namiddag|avond|middernacht|ochtend|middag|'s middags|'s avonds|'s ochtends)(?=\W|$)/i}innerExtract(e,t){let n=wx.default(e.refDate),i=e.createParsingComponents();switch(t[Ex]==="deze"&&(i.assign("day",e.refDate.getDate()),i.assign("month",e.refDate.getMonth()+1),i.assign("year",e.refDate.getFullYear())),t[Sx].toLowerCase()){case"namiddag":case"'s namiddags":i.imply("meridiem",Ou.Meridiem.PM),i.imply("hour",15);break;case"avond":case"'s avonds'":i.imply("meridiem",Ou.Meridiem.PM),i.imply("hour",20);break;case"middernacht":kx.assignTheNextDay(i,n),i.imply("hour",0),i.imply("minute",0),i.imply("second",0);break;case"ochtend":case"'s ochtends":i.imply("meridiem",Ou.Meridiem.AM),i.imply("hour",6);break;case"middag":case"'s middags":i.imply("meridiem",Ou.Meridiem.AM),i.imply("hour",12);break}return i}};Wa.default=Kf});var Ht=k(pe=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});pe.parseTimeUnits=pe.TIME_UNITS_PATTERN=pe.parseYear=pe.YEAR_PATTERN=pe.parseOrdinalNumberPattern=pe.ORDINAL_NUMBER_PATTERN=pe.parseNumberPattern=pe.NUMBER_PATTERN=pe.TIME_UNIT_DICTIONARY=pe.ORDINAL_WORD_DICTIONARY=pe.INTEGER_WORD_DICTIONARY=pe.MONTH_DICTIONARY=pe.WEEKDAY_DICTIONARY=void 0;var Du=De(),Ox=ft();pe.WEEKDAY_DICTIONARY={zondag:0,zon:0,"zon.":0,zo:0,"zo.":0,maandag:1,ma:1,"ma.":1,dinsdag:2,din:2,"din.":2,di:2,"di.":2,woensdag:3,woe:3,"woe.":3,wo:3,"wo.":3,donderdag:4,dond:4,"dond.":4,do:4,"do.":4,vrijdag:5,vrij:5,"vrij.":5,vr:5,"vr.":5,zaterdag:6,zat:6,"zat.":6,za:6,"za.":6};pe.MONTH_DICTIONARY={januari:1,jan:1,"jan.":1,februari:2,feb:2,"feb.":2,maart:3,mar:3,"mar.":3,april:4,apr:4,"apr.":4,mei:5,juni:6,jun:6,"jun.":6,juli:7,jul:7,"jul.":7,augustus:8,aug:8,"aug.":8,september:9,sep:9,"sep.":9,sept:9,"sept.":9,oktober:10,okt:10,"okt.":10,november:11,nov:11,"nov.":11,december:12,dec:12,"dec.":12};pe.INTEGER_WORD_DICTIONARY={een:1,twee:2,drie:3,vier:4,vijf:5,zes:6,zeven:7,acht:8,negen:9,tien:10,elf:11,twaalf:12};pe.ORDINAL_WORD_DICTIONARY={eerste:1,tweede:2,derde:3,vierde:4,vijfde:5,zesde:6,zevende:7,achtste:8,negende:9,tiende:10,elfde:11,twaalfde:12,dertiende:13,veertiende:14,vijftiende:15,zestiende:16,zeventiende:17,achttiende:18,negentiende:19,twintigste:20,eenentwintigste:21,twee\u00EBntwintigste:22,drieentwintigste:23,vierentwintigste:24,vijfentwintigste:25,zesentwintigste:26,zevenentwintigste:27,achtentwintig:28,negenentwintig:29,dertigste:30,eenendertigste:31};pe.TIME_UNIT_DICTIONARY={sec:"second",second:"second",seconden:"second",min:"minute",mins:"minute",minute:"minute",minuut:"minute",minuten:"minute",minuutje:"minute",h:"hour",hr:"hour",hrs:"hour",uur:"hour",u:"hour",uren:"hour",dag:"d",dagen:"d",week:"week",weken:"week",maand:"month",maanden:"month",jaar:"year",jr:"year",jaren:"year"};pe.NUMBER_PATTERN=`(?:${Du.matchAnyPattern(pe.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+[\\.,][0-9]+|halve?|half|paar)`;function Ub(r){let e=r.toLowerCase();return pe.INTEGER_WORD_DICTIONARY[e]!==void 0?pe.INTEGER_WORD_DICTIONARY[e]:e==="paar"?2:e==="half"||e.match(/halve?/)?.5:parseFloat(e.replace(",","."))}pe.parseNumberPattern=Ub;pe.ORDINAL_NUMBER_PATTERN=`(?:${Du.matchAnyPattern(pe.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:ste|de)?)`;function Dx(r){let e=r.toLowerCase();return pe.ORDINAL_WORD_DICTIONARY[e]!==void 0?pe.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:ste|de)$/i,""),parseInt(e))}pe.parseOrdinalNumberPattern=Dx;pe.YEAR_PATTERN="(?:[1-9][0-9]{0,3}\\s*(?:voor Christus|na Christus)|[1-2][0-9]{3}|[5-9][0-9])";function xx(r){if(/voor Christus/i.test(r))return r=r.replace(/voor Christus/i,""),-parseInt(r);if(/na Christus/i.test(r))return r=r.replace(/na Christus/i,""),parseInt(r);let e=parseInt(r);return Ox.findMostLikelyADYear(e)}pe.parseYear=xx;var Wb=`(${pe.NUMBER_PATTERN})\\s{0,5}(${Du.matchAnyPattern(pe.TIME_UNIT_DICTIONARY)})\\s{0,5}`,Lb=new RegExp(Wb,"i");pe.TIME_UNITS_PATTERN=Du.repeatedTimeunitPattern("(?:(?:binnen|in)\\s*)?",Wb);function Rx(r){let e={},t=r,n=Lb.exec(t);for(;n;)Mx(e,n),t=t.substring(n[0].length),n=Lb.exec(t);return e}pe.parseTimeUnits=Rx;function Mx(r,e){let t=Ub(e[1]),n=pe.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var jb=k(Xf=>{"use strict";Object.defineProperty(Xf,"__esModule",{value:!0});var qb=Ht(),Cx=qe(),Ax=H(),Qf=class extends Ax.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(?:binnen|in|binnen de|voor)\\s*("+qb.TIME_UNITS_PATTERN+")(?=\\W|$)","i")}innerExtract(e,t){let n=qb.parseTimeUnits(t[1]);return Cx.ParsingComponents.createRelativeFromReference(e.reference,n)}};Xf.default=Qf});var Gb=k(Jf=>{"use strict";Object.defineProperty(Jf,"__esModule",{value:!0});var $b=Ht(),Px=De(),Nx=H(),Ix=bi(),Fx=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:op\\s*?)?(?:(deze|vorige|volgende)\\s*(?:week\\s*)?)?(${Px.matchAnyPattern($b.WEEKDAY_DICTIONARY)})(?=\\W|$)`,"i"),Lx=1,Ux=2,Wx=3,Zf=class extends Nx.AbstractParserWithWordBoundaryChecking{innerPattern(){return Fx}innerExtract(e,t){let n=t[Ux].toLowerCase(),i=$b.WEEKDAY_DICTIONARY[n],s=t[Lx],a=t[Wx],o=s||a;o=o||"",o=o.toLowerCase();let u=null;o=="vorige"?u="last":o=="volgende"?u="next":o=="deze"&&(u="this");let l=Ix.toDayJSWeekday(e.refDate,i,u);return e.createParsingComponents().assign("weekday",i).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};Jf.default=Zf});var Kb=k(tp=>{"use strict";Object.defineProperty(tp,"__esModule",{value:!0});var qx=ft(),Vb=Ht(),xu=Ht(),zb=Ht(),jx=De(),$x=H(),Gx=new RegExp(`(?:on\\s*?)?(${xu.ORDINAL_NUMBER_PATTERN})(?:\\s*(?:tot|\\-|\\\u2013|until|through|till|\\s)\\s*(${xu.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s*(?:of)?\\s*)(`+jx.matchAnyPattern(Vb.MONTH_DICTIONARY)+`)(?:(?:-|/|,?\\s*)(${zb.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),Yx=3,Yb=1,Bb=2,Hb=4,ep=class extends $x.AbstractParserWithWordBoundaryChecking{innerPattern(){return Gx}innerExtract(e,t){let n=Vb.MONTH_DICTIONARY[t[Yx].toLowerCase()],i=xu.parseOrdinalNumberPattern(t[Yb]);if(i>31)return t.index=t.index+t[Yb].length,null;let s=e.createParsingComponents({day:i,month:n});if(t[Hb]){let u=zb.parseYear(t[Hb]);s.assign("year",u)}else{let u=qx.findYearClosestToRef(e.refDate,i,n);s.imply("year",u)}if(!t[Bb])return s;let a=xu.parseOrdinalNumberPattern(t[Bb]),o=e.createParsingResult(t.index,t[0]);return o.start=s,o.end=s.clone(),o.end.assign("day",a),o}};tp.default=ep});var Jb=k(np=>{"use strict";Object.defineProperty(np,"__esModule",{value:!0});var Xb=Ht(),Bx=ft(),Hx=De(),Zb=Ht(),Vx=H(),zx=new RegExp(`(${Hx.matchAnyPattern(Xb.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${Zb.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),Kx=1,Qb=2,rp=class extends Vx.AbstractParserWithWordBoundaryChecking{innerPattern(){return zx}innerExtract(e,t){let n=e.createParsingComponents();n.imply("day",1);let i=t[Kx],s=Xb.MONTH_DICTIONARY[i.toLowerCase()];if(n.assign("month",s),t[Qb]){let a=Zb.parseYear(t[Qb]);n.assign("year",a)}else{let a=Bx.findYearClosestToRef(e.refDate,1,s);n.imply("year",a)}return n}};np.default=rp});var eT=k(sp=>{"use strict";Object.defineProperty(sp,"__esModule",{value:!0});var Qx=H(),Xx=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),Zx=1,Jx=2,ip=class extends Qx.AbstractParserWithWordBoundaryChecking{innerPattern(){return Xx}innerExtract(e,t){let n=parseInt(t[Jx]),i=parseInt(t[Zx]);return e.createParsingComponents().imply("day",1).assign("month",i).assign("year",n)}};sp.default=ip});var tT=k(op=>{"use strict";Object.defineProperty(op,"__esModule",{value:!0});var eR=gi(),ap=class extends eR.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:om)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|om|\\?)\\s*"}primarySuffix(){return"(?:\\s*(?:uur))?(?!/)(?=\\W|$)"}extractPrimaryTimeComponents(e,t){return t[0].match(/^\s*\d{4}\s*$/)?null:super.extractPrimaryTimeComponents(e,t)}};op.default=ap});var iT=k(lp=>{"use strict";Object.defineProperty(lp,"__esModule",{value:!0});var nT=Ht(),tR=De(),rR=H(),nR=new RegExp(`([0-9]{4})[\\.\\/\\s](?:(${tR.matchAnyPattern(nT.MONTH_DICTIONARY)})|([0-9]{1,2}))[\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),iR=1,sR=2,rT=3,aR=4,up=class extends rR.AbstractParserWithWordBoundaryChecking{innerPattern(){return nR}innerExtract(e,t){let n=t[rT]?parseInt(t[rT]):nT.MONTH_DICTIONARY[t[sR].toLowerCase()];if(n<1||n>12)return null;let i=parseInt(t[iR]);return{day:parseInt(t[aR]),month:n,year:i}}};lp.default=up});var sT=k(qa=>{"use strict";var oR=qa&&qa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(qa,"__esModule",{value:!0});var uR=H(),Ru=Je(),cp=lr(),lR=oR(_e()),cR=1,dR=2,dp=class extends uR.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(gisteren|morgen|van)(ochtend|middag|namiddag|avond|nacht)(?=\W|$)/i}innerExtract(e,t){let n=t[cR].toLowerCase(),i=t[dR].toLowerCase(),s=e.createParsingComponents(),a=lR.default(e.refDate);switch(n){case"gisteren":cp.assignSimilarDate(s,a.add(-1,"day"));break;case"van":cp.assignSimilarDate(s,a);break;case"morgen":cp.assignTheNextDay(s,a);break}switch(i){case"ochtend":s.imply("meridiem",Ru.Meridiem.AM),s.imply("hour",6);break;case"middag":s.imply("meridiem",Ru.Meridiem.AM),s.imply("hour",12);break;case"namiddag":s.imply("meridiem",Ru.Meridiem.PM),s.imply("hour",15);break;case"avond":s.imply("meridiem",Ru.Meridiem.PM),s.imply("hour",20);break}return s}};qa.default=dp});var oT=k(pp=>{"use strict";Object.defineProperty(pp,"__esModule",{value:!0});var aT=Ht(),fR=qe(),pR=H(),mR=cr(),hR=new RegExp(`(deze|vorige|afgelopen|komende|over|\\+|-)\\s*(${aT.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),fp=class extends pR.AbstractParserWithWordBoundaryChecking{innerPattern(){return hR}innerExtract(e,t){let n=t[1].toLowerCase(),i=aT.parseTimeUnits(t[2]);switch(n){case"vorige":case"afgelopen":case"-":i=mR.reverseTimeUnits(i);break}return fR.ParsingComponents.createRelativeFromReference(e.reference,i)}};pp.default=fp});var cT=k(ja=>{"use strict";var gR=ja&&ja.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ja,"__esModule",{value:!0});var lT=Ht(),uT=qe(),yR=gR(_e()),bR=H(),TR=De(),_R=new RegExp(`(dit|deze|komende|volgend|volgende|afgelopen|vorige)\\s*(${TR.matchAnyPattern(lT.TIME_UNIT_DICTIONARY)})(?=\\s*)(?=\\W|$)`,"i"),vR=1,wR=2,mp=class extends bR.AbstractParserWithWordBoundaryChecking{innerPattern(){return _R}innerExtract(e,t){let n=t[vR].toLowerCase(),i=t[wR].toLowerCase(),s=lT.TIME_UNIT_DICTIONARY[i];if(n=="volgend"||n=="volgende"||n=="komende"){let u={};return u[s]=1,uT.ParsingComponents.createRelativeFromReference(e.reference,u)}if(n=="afgelopen"||n=="vorige"){let u={};return u[s]=-1,uT.ParsingComponents.createRelativeFromReference(e.reference,u)}let a=e.createParsingComponents(),o=yR.default(e.reference.instant);return i.match(/week/i)?(o=o.add(-o.get("d"),"d"),a.imply("day",o.date()),a.imply("month",o.month()+1),a.imply("year",o.year())):i.match(/maand/i)?(o=o.add(-o.date()+1,"d"),a.imply("day",o.date()),a.assign("year",o.year()),a.assign("month",o.month()+1)):i.match(/jaar/i)&&(o=o.add(-o.date()+1,"d"),o=o.add(-o.month(),"month"),a.imply("day",o.date()),a.imply("month",o.month()+1),a.assign("year",o.year())),a}};ja.default=mp});var dT=k(yp=>{"use strict";Object.defineProperty(yp,"__esModule",{value:!0});var gp=Ht(),kR=qe(),ER=H(),SR=cr(),OR=new RegExp("("+gp.TIME_UNITS_PATTERN+")(?:geleden|voor|eerder)(?=(?:\\W|$))","i"),DR=new RegExp("("+gp.TIME_UNITS_PATTERN+")geleden(?=(?:\\W|$))","i"),hp=class extends ER.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?DR:OR}innerExtract(e,t){let n=gp.parseTimeUnits(t[1]),i=SR.reverseTimeUnits(n);return kR.ParsingComponents.createRelativeFromReference(e.reference,i)}};yp.default=hp});var fT=k(_p=>{"use strict";Object.defineProperty(_p,"__esModule",{value:!0});var Tp=Ht(),xR=qe(),RR=H(),MR=new RegExp("("+Tp.TIME_UNITS_PATTERN+")(later|na|vanaf nu|voortaan|vooruit|uit)(?=(?:\\W|$))","i"),CR=new RegExp("("+Tp.TIME_UNITS_PATTERN+")(later|vanaf nu)(?=(?:\\W|$))","i"),AR=1,bp=class extends RR.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?CR:MR}innerExtract(e,t){let n=Tp.parseTimeUnits(t[AR]);return xR.ParsingComponents.createRelativeFromReference(e.reference,n)}};_p.default=bp});var gT=k(ut=>{"use strict";var mt=ut&&ut.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ut,"__esModule",{value:!0});ut.createConfiguration=ut.createCasualConfiguration=ut.parseDate=ut.parse=ut.strict=ut.casual=void 0;var PR=mn(),pT=Or(),NR=mt(Pb()),IR=mt(Nb()),FR=mt(Ib()),LR=mt(Fb()),UR=mt(Ti()),WR=mt(jb()),qR=mt(Gb()),jR=mt(Kb()),mT=mt(Jb()),$R=mt(eT()),GR=mt(tT()),YR=mt(iT()),BR=mt(sT()),HR=mt(oT()),VR=mt(cT()),zR=mt(dT()),KR=mt(fT());ut.casual=new pT.Chrono(hT());ut.strict=new pT.Chrono(vp(!0));function QR(r,e,t){return ut.casual.parse(r,e,t)}ut.parse=QR;function XR(r,e,t){return ut.casual.parseDate(r,e,t)}ut.parseDate=XR;function hT(r=!0){let e=vp(!1,r);return e.parsers.unshift(new FR.default),e.parsers.unshift(new LR.default),e.parsers.unshift(new BR.default),e.parsers.unshift(new mT.default),e.parsers.unshift(new VR.default),e.parsers.unshift(new HR.default),e}ut.createCasualConfiguration=hT;function vp(r=!0,e=!0){return PR.includeCommonConfiguration({parsers:[new UR.default(e),new WR.default,new jR.default,new mT.default,new qR.default,new YR.default,new $R.default,new GR.default(r),new zR.default(r),new KR.default(r)],refiners:[new IR.default,new NR.default]},r)}ut.createConfiguration=vp});var _T=k($a=>{"use strict";var ZR=$a&&$a.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty($a,"__esModule",{value:!0});var JR=ZR(_e()),eM=H(),tM=1,yT=2,rM=3,bT=4,TT=5,nM=6,wp=class extends eM.AbstractParserWithWordBoundaryChecking{innerPattern(e){return new RegExp("(\u800C\u5BB6|\u7ACB(?:\u523B|\u5373)|\u5373\u523B)|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(?:\u65E5|\u5929)(?:[\\s|,|\uFF0C]*)(?:(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?","i")}innerExtract(e,t){let n=t.index,i=e.createParsingResult(n,t[0]),s=JR.default(e.refDate),a=s;if(t[tM])i.start.imply("hour",s.hour()),i.start.imply("minute",s.minute()),i.start.imply("second",s.second()),i.start.imply("millisecond",s.millisecond());else if(t[yT]){let o=t[yT],u=t[rM];o=="\u660E"||o=="\u807D"?s.hour()>1&&(a=a.add(1,"day")):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?a=a.add(-1,"day"):o=="\u524D"?a=a.add(-2,"day"):o=="\u5927\u524D"?a=a.add(-3,"day"):o=="\u5F8C"?a=a.add(2,"day"):o=="\u5927\u5F8C"&&(a=a.add(3,"day")),u=="\u65E9"||u=="\u671D"?i.start.imply("hour",6):u=="\u665A"&&(i.start.imply("hour",22),i.start.imply("meridiem",1))}else if(t[bT]){let u=t[bT][0];u=="\u65E9"||u=="\u671D"||u=="\u4E0A"?i.start.imply("hour",6):u=="\u4E0B"||u=="\u664F"?(i.start.imply("hour",15),i.start.imply("meridiem",1)):u=="\u4E2D"?(i.start.imply("hour",12),i.start.imply("meridiem",1)):u=="\u591C"||u=="\u665A"?(i.start.imply("hour",22),i.start.imply("meridiem",1)):u=="\u51CC"&&i.start.imply("hour",0)}else if(t[TT]){let o=t[TT];o=="\u660E"||o=="\u807D"?s.hour()>1&&(a=a.add(1,"day")):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?a=a.add(-1,"day"):o=="\u524D"?a=a.add(-2,"day"):o=="\u5927\u524D"?a=a.add(-3,"day"):o=="\u5F8C"?a=a.add(2,"day"):o=="\u5927\u5F8C"&&(a=a.add(3,"day"));let u=t[nM];if(u){let l=u[0];l=="\u65E9"||l=="\u671D"||l=="\u4E0A"?i.start.imply("hour",6):l=="\u4E0B"||l=="\u664F"?(i.start.imply("hour",15),i.start.imply("meridiem",1)):l=="\u4E2D"?(i.start.imply("hour",12),i.start.imply("meridiem",1)):l=="\u591C"||l=="\u665A"?(i.start.imply("hour",22),i.start.imply("meridiem",1)):l=="\u51CC"&&i.start.imply("hour",0)}}return i.start.assign("day",a.date()),i.start.assign("month",a.month()+1),i.start.assign("year",a.year()),i}};$a.default=wp});var ps=k(Lt=>{"use strict";Object.defineProperty(Lt,"__esModule",{value:!0});Lt.zhStringToYear=Lt.zhStringToNumber=Lt.WEEKDAY_OFFSET=Lt.NUMBER=void 0;Lt.NUMBER={\u96F6:0,\u4E00:1,\u4E8C:2,\u5169:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6,\u4E03:7,\u516B:8,\u4E5D:9,\u5341:10,\u5EFF:20,\u5345:30};Lt.WEEKDAY_OFFSET={\u5929:0,\u65E5:0,\u4E00:1,\u4E8C:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6};function iM(r){let e=0;for(let t=0;t<r.length;t++){let n=r[t];n==="\u5341"?e=e===0?Lt.NUMBER[n]:e*Lt.NUMBER[n]:e+=Lt.NUMBER[n]}return e}Lt.zhStringToNumber=iM;function sM(r){let e="";for(let t=0;t<r.length;t++){let n=r[t];e=e+Lt.NUMBER[n]}return parseInt(e)}Lt.zhStringToYear=sM});var wT=k(Ga=>{"use strict";var aM=Ga&&Ga.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ga,"__esModule",{value:!0});var oM=aM(_e()),uM=H(),wi=ps(),kp=1,vT=2,Ep=3,Sp=class extends uM.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(\\d{2,4}|["+Object.keys(wi.NUMBER).join("")+"]{4}|["+Object.keys(wi.NUMBER).join("")+"]{2})?(?:\\s*)(?:\u5E74)?(?:[\\s|,|\uFF0C]*)(\\d{1,2}|["+Object.keys(wi.NUMBER).join("")+"]{1,2})(?:\\s*)(?:\u6708)(?:\\s*)(\\d{1,2}|["+Object.keys(wi.NUMBER).join("")+"]{1,2})?(?:\\s*)(?:\u65E5|\u865F)?")}innerExtract(e,t){let n=oM.default(e.refDate),i=e.createParsingResult(t.index,t[0]),s=parseInt(t[vT]);if(isNaN(s)&&(s=wi.zhStringToNumber(t[vT])),i.start.assign("month",s),t[Ep]){let a=parseInt(t[Ep]);isNaN(a)&&(a=wi.zhStringToNumber(t[Ep])),i.start.assign("day",a)}else i.start.imply("day",n.date());if(t[kp]){let a=parseInt(t[kp]);isNaN(a)&&(a=wi.zhStringToYear(t[kp])),i.start.assign("year",a)}else i.start.imply("year",n.year());return i}};Ga.default=Sp});var ET=k(Ya=>{"use strict";var lM=Ya&&Ya.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ya,"__esModule",{value:!0});var cM=lM(_e()),dM=H(),kT=ps(),fM=new RegExp("(\\d+|["+Object.keys(kT.NUMBER).join("")+"]+|\u534A|\u5E7E)(?:\\s*)(?:\u500B)?(\u79D2(?:\u9418)?|\u5206\u9418|\u5C0F\u6642|\u9418|\u65E5|\u5929|\u661F\u671F|\u79AE\u62DC|\u6708|\u5E74)(?:(?:\u4E4B|\u904E)?\u5F8C|(?:\u4E4B)?\u5167)","i"),Op=1,pM=2,Dp=class extends dM.AbstractParserWithWordBoundaryChecking{innerPattern(){return fM}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=parseInt(t[Op]);if(isNaN(i)&&(i=kT.zhStringToNumber(t[Op])),isNaN(i)){let u=t[Op];if(u==="\u5E7E")i=3;else if(u==="\u534A")i=.5;else return null}let s=cM.default(e.refDate),o=t[pM][0];return o.match(/[日天星禮月年]/)?(o=="\u65E5"||o=="\u5929"?s=s.add(i,"d"):o=="\u661F"||o=="\u79AE"?s=s.add(i*7,"d"):o=="\u6708"?s=s.add(i,"month"):o=="\u5E74"&&(s=s.add(i,"year")),n.start.assign("year",s.year()),n.start.assign("month",s.month()+1),n.start.assign("day",s.date()),n):(o=="\u79D2"?s=s.add(i,"second"):o=="\u5206"?s=s.add(i,"minute"):(o=="\u5C0F"||o=="\u9418")&&(s=s.add(i,"hour")),n.start.imply("year",s.year()),n.start.imply("month",s.month()+1),n.start.imply("day",s.date()),n.start.assign("hour",s.hour()),n.start.assign("minute",s.minute()),n.start.assign("second",s.second()),n)}};Ya.default=Dp});var OT=k(Ba=>{"use strict";var mM=Ba&&Ba.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ba,"__esModule",{value:!0});var hM=mM(_e()),gM=H(),ST=ps(),yM=new RegExp("(?<prefix>\u4E0A|\u4ECA|\u4E0B|\u9019|\u5462)(?:\u500B)?(?:\u661F\u671F|\u79AE\u62DC|\u9031)(?<weekday>"+Object.keys(ST.WEEKDAY_OFFSET).join("|")+")"),xp=class extends gM.AbstractParserWithWordBoundaryChecking{innerPattern(){return yM}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=t.groups.weekday,s=ST.WEEKDAY_OFFSET[i];if(s===void 0)return null;let a=null,o=t.groups.prefix;o=="\u4E0A"?a="last":o=="\u4E0B"?a="next":(o=="\u4ECA"||o=="\u9019"||o=="\u5462")&&(a="this");let u=hM.default(e.refDate),l=!1,c=u.day();return a=="last"||a=="past"?(u=u.day(s-7),l=!0):a=="next"?(u=u.day(s+7),l=!0):a=="this"?u=u.day(s):Math.abs(s-7-c)<Math.abs(s-c)?u=u.day(s-7):Math.abs(s+7-c)<Math.abs(s-c)?u=u.day(s+7):u=u.day(s),n.start.assign("weekday",s),l?(n.start.assign("day",u.date()),n.start.assign("month",u.month()+1),n.start.assign("year",u.year())):(n.start.imply("day",u.date()),n.start.imply("month",u.month()+1),n.start.imply("year",u.year())),n}};Ba.default=xp});var DT=k(Ha=>{"use strict";var bM=Ha&&Ha.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ha,"__esModule",{value:!0});var TM=bM(_e()),_M=H(),pr=ps(),vM=new RegExp("(?:\u7531|\u5F9E|\u81EA)?(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(pr.NUMBER).join("")+"]+)(?:\\s*)(?:\u9EDE|\u6642|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(pr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(pr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),wM=new RegExp("(?:^\\s*(?:\u5230|\u81F3|\\-|\\\u2013|\\~|\\\u301C)\\s*)(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(pr.NUMBER).join("")+"]+)(?:\\s*)(?:\u9EDE|\u6642|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(pr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(pr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),Mu=1,Cu=2,Au=3,Pu=4,Nu=5,Iu=6,fr=7,ms=8,Fu=9,Rp=class extends _M.AbstractParserWithWordBoundaryChecking{innerPattern(){return vM}innerExtract(e,t){if(t.index>0&&e.text[t.index-1].match(/\w/))return null;let n=TM.default(e.refDate),i=e.createParsingResult(t.index,t[0]),s=n.clone();if(t[Mu]){var a=t[Mu];a=="\u660E"||a=="\u807D"?n.hour()>1&&s.add(1,"day"):a=="\u6628"||a=="\u5C0B"||a=="\u7434"?s.add(-1,"day"):a=="\u524D"?s.add(-2,"day"):a=="\u5927\u524D"?s.add(-3,"day"):a=="\u5F8C"?s.add(2,"day"):a=="\u5927\u5F8C"&&s.add(3,"day"),i.start.assign("day",s.date()),i.start.assign("month",s.month()+1),i.start.assign("year",s.year())}else if(t[Pu]){var o=t[Pu];o=="\u660E"||o=="\u807D"?s.add(1,"day"):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?s.add(-1,"day"):o=="\u524D"?s.add(-2,"day"):o=="\u5927\u524D"?s.add(-3,"day"):o=="\u5F8C"?s.add(2,"day"):o=="\u5927\u5F8C"&&s.add(3,"day"),i.start.assign("day",s.date()),i.start.assign("month",s.month()+1),i.start.assign("year",s.year())}else i.start.imply("day",s.date()),i.start.imply("month",s.month()+1),i.start.imply("year",s.year());let u=0,l=0,c=-1;if(t[ms]){var d=parseInt(t[ms]);if(isNaN(d)&&(d=pr.zhStringToNumber(t[ms])),d>=60)return null;i.start.assign("second",d)}if(u=parseInt(t[Iu]),isNaN(u)&&(u=pr.zhStringToNumber(t[Iu])),t[fr]?t[fr]=="\u534A"?l=30:t[fr]=="\u6B63"||t[fr]=="\u6574"?l=0:(l=parseInt(t[fr]),isNaN(l)&&(l=pr.zhStringToNumber(t[fr]))):u>100&&(l=u%100,u=Math.floor(u/100)),l>=60||u>24)return null;if(u>=12&&(c=1),t[Fu]){if(u>12)return null;var p=t[Fu][0].toLowerCase();p=="a"&&(c=0,u==12&&(u=0)),p=="p"&&(c=1,u!=12&&(u+=12))}else if(t[Cu]){var m=t[Cu],b=m[0];b=="\u671D"||b=="\u65E9"?(c=0,u==12&&(u=0)):b=="\u665A"&&(c=1,u!=12&&(u+=12))}else if(t[Au]){var g=t[Au],E=g[0];E=="\u4E0A"||E=="\u671D"||E=="\u65E9"||E=="\u51CC"?(c=0,u==12&&(u=0)):(E=="\u4E0B"||E=="\u664F"||E=="\u665A")&&(c=1,u!=12&&(u+=12))}else if(t[Nu]){var R=t[Nu],x=R[0];x=="\u4E0A"||x=="\u671D"||x=="\u65E9"||x=="\u51CC"?(c=0,u==12&&(u=0)):(x=="\u4E0B"||x=="\u664F"||x=="\u665A")&&(c=1,u!=12&&(u+=12))}if(i.start.assign("hour",u),i.start.assign("minute",l),c>=0?i.start.assign("meridiem",c):u<12?i.start.imply("meridiem",0):i.start.imply("meridiem",1),t=wM.exec(e.text.substring(i.index+i.text.length)),!t)return i.text.match(/^\d+$/)?null:i;let v=s.clone();if(i.end=e.createParsingComponents(),t[Mu]){var a=t[Mu];a=="\u660E"||a=="\u807D"?n.hour()>1&&v.add(1,"day"):a=="\u6628"||a=="\u5C0B"||a=="\u7434"?v.add(-1,"day"):a=="\u524D"?v.add(-2,"day"):a=="\u5927\u524D"?v.add(-3,"day"):a=="\u5F8C"?v.add(2,"day"):a=="\u5927\u5F8C"&&v.add(3,"day"),i.end.assign("day",v.date()),i.end.assign("month",v.month()+1),i.end.assign("year",v.year())}else if(t[Pu]){var o=t[Pu];o=="\u660E"||o=="\u807D"?v.add(1,"day"):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?v.add(-1,"day"):o=="\u524D"?v.add(-2,"day"):o=="\u5927\u524D"?v.add(-3,"day"):o=="\u5F8C"?v.add(2,"day"):o=="\u5927\u5F8C"&&v.add(3,"day"),i.end.assign("day",v.date()),i.end.assign("month",v.month()+1),i.end.assign("year",v.year())}else i.end.imply("day",v.date()),i.end.imply("month",v.month()+1),i.end.imply("year",v.year());if(u=0,l=0,c=-1,t[ms]){var d=parseInt(t[ms]);if(isNaN(d)&&(d=pr.zhStringToNumber(t[ms])),d>=60)return null;i.end.assign("second",d)}if(u=parseInt(t[Iu]),isNaN(u)&&(u=pr.zhStringToNumber(t[Iu])),t[fr]?t[fr]=="\u534A"?l=30:t[fr]=="\u6B63"||t[fr]=="\u6574"?l=0:(l=parseInt(t[fr]),isNaN(l)&&(l=pr.zhStringToNumber(t[fr]))):u>100&&(l=u%100,u=Math.floor(u/100)),l>=60||u>24)return null;if(u>=12&&(c=1),t[Fu]){if(u>12)return null;var p=t[Fu][0].toLowerCase();p=="a"&&(c=0,u==12&&(u=0)),p=="p"&&(c=1,u!=12&&(u+=12)),i.start.isCertain("meridiem")||(c==0?(i.start.imply("meridiem",0),i.start.get("hour")==12&&i.start.assign("hour",0)):(i.start.imply("meridiem",1),i.start.get("hour")!=12&&i.start.assign("hour",i.start.get("hour")+12)))}else if(t[Cu]){var m=t[Cu],b=m[0];b=="\u671D"||b=="\u65E9"?(c=0,u==12&&(u=0)):b=="\u665A"&&(c=1,u!=12&&(u+=12))}else if(t[Au]){var g=t[Au],E=g[0];E=="\u4E0A"||E=="\u671D"||E=="\u65E9"||E=="\u51CC"?(c=0,u==12&&(u=0)):(E=="\u4E0B"||E=="\u664F"||E=="\u665A")&&(c=1,u!=12&&(u+=12))}else if(t[Nu]){var R=t[Nu],x=R[0];x=="\u4E0A"||x=="\u671D"||x=="\u65E9"||x=="\u51CC"?(c=0,u==12&&(u=0)):(x=="\u4E0B"||x=="\u664F"||x=="\u665A")&&(c=1,u!=12&&(u+=12))}return i.text=i.text+t[0],i.end.assign("hour",u),i.end.assign("minute",l),c>=0?i.end.assign("meridiem",c):i.start.isCertain("meridiem")&&i.start.get("meridiem")==1&&i.start.get("hour")>u?i.end.imply("meridiem",0):u>12&&i.end.imply("meridiem",1),i.end.date().getTime()<i.start.date().getTime()&&i.end.imply("day",i.end.get("day")+1),i}};Ha.default=Rp});var RT=k(Va=>{"use strict";var kM=Va&&Va.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Va,"__esModule",{value:!0});var EM=kM(_e()),SM=H(),xT=ps(),OM=new RegExp("(?:\u661F\u671F|\u79AE\u62DC|\u9031)(?<weekday>"+Object.keys(xT.WEEKDAY_OFFSET).join("|")+")"),Mp=class extends SM.AbstractParserWithWordBoundaryChecking{innerPattern(){return OM}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=t.groups.weekday,s=xT.WEEKDAY_OFFSET[i];if(s===void 0)return null;let a=EM.default(e.refDate),o=!1,u=a.day();return Math.abs(s-7-u)<Math.abs(s-u)?a=a.day(s-7):Math.abs(s+7-u)<Math.abs(s-u)?a=a.day(s+7):a=a.day(s),n.start.assign("weekday",s),o?(n.start.assign("day",a.date()),n.start.assign("month",a.month()+1),n.start.assign("year",a.year())):(n.start.imply("day",a.date()),n.start.imply("month",a.month()+1),n.start.imply("year",a.year())),n}};Va.default=Mp});var MT=k(za=>{"use strict";var DM=za&&za.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(za,"__esModule",{value:!0});var xM=DM(Vr()),Cp=class extends xM.default{patternBetween(){return/^\s*(至|到|\-|\~|~|-|ー)\s*$/i}};za.default=Cp});var CT=k(Ka=>{"use strict";var RM=Ka&&Ka.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ka,"__esModule",{value:!0});var MM=RM(pn()),Ap=class extends MM.default{patternBetween(){return/^\s*$/i}};Ka.default=Ap});var AT=k(Ve=>{"use strict";var Tn=Ve&&Ve.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ve,"__esModule",{value:!0});Ve.createConfiguration=Ve.createCasualConfiguration=Ve.parseDate=Ve.parse=Ve.strict=Ve.casual=Ve.hant=void 0;var Pp=Or(),CM=Tn(fu()),AM=mn(),PM=Tn(_T()),NM=Tn(wT()),IM=Tn(ET()),FM=Tn(OT()),LM=Tn(DT()),UM=Tn(RT()),WM=Tn(MT()),qM=Tn(CT());Ve.hant=new Pp.Chrono(Np());Ve.casual=new Pp.Chrono(Np());Ve.strict=new Pp.Chrono(Ip());function jM(r,e,t){return Ve.casual.parse(r,e,t)}Ve.parse=jM;function $M(r,e,t){return Ve.casual.parseDate(r,e,t)}Ve.parseDate=$M;function Np(){let r=Ip();return r.parsers.unshift(new PM.default),r}Ve.createCasualConfiguration=Np;function Ip(){let r=AM.includeCommonConfiguration({parsers:[new NM.default,new FM.default,new UM.default,new LM.default,new IM.default],refiners:[new WM.default,new qM.default]});return r.refiners=r.refiners.filter(e=>!(e instanceof CM.default)),r}Ve.createConfiguration=Ip});var FT=k(Qa=>{"use strict";var GM=Qa&&Qa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Qa,"__esModule",{value:!0});var YM=GM(_e()),BM=H(),HM=1,PT=2,VM=3,NT=4,IT=5,zM=6,Fp=class extends BM.AbstractParserWithWordBoundaryChecking{innerPattern(e){return new RegExp("(\u73B0\u5728|\u7ACB(?:\u523B|\u5373)|\u5373\u523B)|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(\u65E9|\u665A)|(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(?:\u65E5|\u5929)(?:[\\s|,|\uFF0C]*)(?:(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?","i")}innerExtract(e,t){let n=t.index,i=e.createParsingResult(n,t[0]),s=YM.default(e.refDate),a=s;if(t[HM])i.start.imply("hour",s.hour()),i.start.imply("minute",s.minute()),i.start.imply("second",s.second()),i.start.imply("millisecond",s.millisecond());else if(t[PT]){let o=t[PT],u=t[VM];o=="\u660E"?s.hour()>1&&(a=a.add(1,"day")):o=="\u6628"?a=a.add(-1,"day"):o=="\u524D"?a=a.add(-2,"day"):o=="\u5927\u524D"?a=a.add(-3,"day"):o=="\u540E"?a=a.add(2,"day"):o=="\u5927\u540E"&&(a=a.add(3,"day")),u=="\u65E9"?i.start.imply("hour",6):u=="\u665A"&&(i.start.imply("hour",22),i.start.imply("meridiem",1))}else if(t[NT]){let u=t[NT][0];u=="\u65E9"||u=="\u4E0A"?i.start.imply("hour",6):u=="\u4E0B"?(i.start.imply("hour",15),i.start.imply("meridiem",1)):u=="\u4E2D"?(i.start.imply("hour",12),i.start.imply("meridiem",1)):u=="\u591C"||u=="\u665A"?(i.start.imply("hour",22),i.start.imply("meridiem",1)):u=="\u51CC"&&i.start.imply("hour",0)}else if(t[IT]){let o=t[IT];o=="\u660E"?s.hour()>1&&(a=a.add(1,"day")):o=="\u6628"?a=a.add(-1,"day"):o=="\u524D"?a=a.add(-2,"day"):o=="\u5927\u524D"?a=a.add(-3,"day"):o=="\u540E"?a=a.add(2,"day"):o=="\u5927\u540E"&&(a=a.add(3,"day"));let u=t[zM];if(u){let l=u[0];l=="\u65E9"||l=="\u4E0A"?i.start.imply("hour",6):l=="\u4E0B"?(i.start.imply("hour",15),i.start.imply("meridiem",1)):l=="\u4E2D"?(i.start.imply("hour",12),i.start.imply("meridiem",1)):l=="\u591C"||l=="\u665A"?(i.start.imply("hour",22),i.start.imply("meridiem",1)):l=="\u51CC"&&i.start.imply("hour",0)}}return i.start.assign("day",a.date()),i.start.assign("month",a.month()+1),i.start.assign("year",a.year()),i}};Qa.default=Fp});var hs=k(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.zhStringToYear=Ut.zhStringToNumber=Ut.WEEKDAY_OFFSET=Ut.NUMBER=void 0;Ut.NUMBER={\u96F6:0,"\u3007":0,\u4E00:1,\u4E8C:2,\u4E24:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6,\u4E03:7,\u516B:8,\u4E5D:9,\u5341:10};Ut.WEEKDAY_OFFSET={\u5929:0,\u65E5:0,\u4E00:1,\u4E8C:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6};function KM(r){let e=0;for(let t=0;t<r.length;t++){let n=r[t];n==="\u5341"?e=e===0?Ut.NUMBER[n]:e*Ut.NUMBER[n]:e+=Ut.NUMBER[n]}return e}Ut.zhStringToNumber=KM;function QM(r){let e="";for(let t=0;t<r.length;t++){let n=r[t];e=e+Ut.NUMBER[n]}return parseInt(e)}Ut.zhStringToYear=QM});var UT=k(Xa=>{"use strict";var XM=Xa&&Xa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Xa,"__esModule",{value:!0});var ZM=XM(_e()),JM=H(),ki=hs(),Lp=1,LT=2,Up=3,Wp=class extends JM.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(\\d{2,4}|["+Object.keys(ki.NUMBER).join("")+"]{4}|["+Object.keys(ki.NUMBER).join("")+"]{2})?(?:\\s*)(?:\u5E74)?(?:[\\s|,|\uFF0C]*)(\\d{1,2}|["+Object.keys(ki.NUMBER).join("")+"]{1,3})(?:\\s*)(?:\u6708)(?:\\s*)(\\d{1,2}|["+Object.keys(ki.NUMBER).join("")+"]{1,3})?(?:\\s*)(?:\u65E5|\u53F7)?")}innerExtract(e,t){let n=ZM.default(e.refDate),i=e.createParsingResult(t.index,t[0]),s=parseInt(t[LT]);if(isNaN(s)&&(s=ki.zhStringToNumber(t[LT])),i.start.assign("month",s),t[Up]){let a=parseInt(t[Up]);isNaN(a)&&(a=ki.zhStringToNumber(t[Up])),i.start.assign("day",a)}else i.start.imply("day",n.date());if(t[Lp]){let a=parseInt(t[Lp]);isNaN(a)&&(a=ki.zhStringToYear(t[Lp])),i.start.assign("year",a)}else i.start.imply("year",n.year());return i}};Xa.default=Wp});var qT=k(Za=>{"use strict";var eC=Za&&Za.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Za,"__esModule",{value:!0});var tC=eC(_e()),rC=H(),WT=hs(),nC=new RegExp("(\\d+|["+Object.keys(WT.NUMBER).join("")+"]+|\u534A|\u51E0)(?:\\s*)(?:\u4E2A)?(\u79D2(?:\u949F)?|\u5206\u949F|\u5C0F\u65F6|\u949F|\u65E5|\u5929|\u661F\u671F|\u793C\u62DC|\u6708|\u5E74)(?:(?:\u4E4B|\u8FC7)?\u540E|(?:\u4E4B)?\u5185)","i"),qp=1,iC=2,jp=class extends rC.AbstractParserWithWordBoundaryChecking{innerPattern(){return nC}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=parseInt(t[qp]);if(isNaN(i)&&(i=WT.zhStringToNumber(t[qp])),isNaN(i)){let u=t[qp];if(u==="\u51E0")i=3;else if(u==="\u534A")i=.5;else return null}let s=tC.default(e.refDate),o=t[iC][0];return o.match(/[日天星礼月年]/)?(o=="\u65E5"||o=="\u5929"?s=s.add(i,"d"):o=="\u661F"||o=="\u793C"?s=s.add(i*7,"d"):o=="\u6708"?s=s.add(i,"month"):o=="\u5E74"&&(s=s.add(i,"year")),n.start.assign("year",s.year()),n.start.assign("month",s.month()+1),n.start.assign("day",s.date()),n):(o=="\u79D2"?s=s.add(i,"second"):o=="\u5206"?s=s.add(i,"minute"):(o=="\u5C0F"||o=="\u949F")&&(s=s.add(i,"hour")),n.start.imply("year",s.year()),n.start.imply("month",s.month()+1),n.start.imply("day",s.date()),n.start.assign("hour",s.hour()),n.start.assign("minute",s.minute()),n.start.assign("second",s.second()),n)}};Za.default=jp});var $T=k(Ja=>{"use strict";var sC=Ja&&Ja.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ja,"__esModule",{value:!0});var aC=sC(_e()),oC=H(),jT=hs(),uC=new RegExp("(?<prefix>\u4E0A|\u4E0B|\u8FD9)(?:\u4E2A)?(?:\u661F\u671F|\u793C\u62DC|\u5468)(?<weekday>"+Object.keys(jT.WEEKDAY_OFFSET).join("|")+")"),$p=class extends oC.AbstractParserWithWordBoundaryChecking{innerPattern(){return uC}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=t.groups.weekday,s=jT.WEEKDAY_OFFSET[i];if(s===void 0)return null;let a=null,o=t.groups.prefix;o=="\u4E0A"?a="last":o=="\u4E0B"?a="next":o=="\u8FD9"&&(a="this");let u=aC.default(e.refDate),l=!1,c=u.day();return a=="last"||a=="past"?(u=u.day(s-7),l=!0):a=="next"?(u=u.day(s+7),l=!0):a=="this"?u=u.day(s):Math.abs(s-7-c)<Math.abs(s-c)?u=u.day(s-7):Math.abs(s+7-c)<Math.abs(s-c)?u=u.day(s+7):u=u.day(s),n.start.assign("weekday",s),l?(n.start.assign("day",u.date()),n.start.assign("month",u.month()+1),n.start.assign("year",u.year())):(n.start.imply("day",u.date()),n.start.imply("month",u.month()+1),n.start.imply("year",u.year())),n}};Ja.default=$p});var GT=k(eo=>{"use strict";var lC=eo&&eo.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(eo,"__esModule",{value:!0});var cC=lC(_e()),dC=H(),hr=hs(),fC=new RegExp("(?:\u4ECE|\u81EA)?(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(hr.NUMBER).join("")+"]+)(?:\\s*)(?:\u70B9|\u65F6|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(hr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(hr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),pC=new RegExp("(?:^\\s*(?:\u5230|\u81F3|\\-|\\\u2013|\\~|\\\u301C)\\s*)(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(hr.NUMBER).join("")+"]+)(?:\\s*)(?:\u70B9|\u65F6|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(hr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(hr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),Lu=1,Uu=2,Wu=3,qu=4,ju=5,$u=6,mr=7,gs=8,Gu=9,Gp=class extends dC.AbstractParserWithWordBoundaryChecking{innerPattern(){return fC}innerExtract(e,t){if(t.index>0&&e.text[t.index-1].match(/\w/))return null;let n=cC.default(e.refDate),i=e.createParsingResult(t.index,t[0]),s=n.clone();if(t[Lu]){let c=t[Lu];c=="\u660E"?n.hour()>1&&s.add(1,"day"):c=="\u6628"?s.add(-1,"day"):c=="\u524D"?s.add(-2,"day"):c=="\u5927\u524D"?s.add(-3,"day"):c=="\u540E"?s.add(2,"day"):c=="\u5927\u540E"&&s.add(3,"day"),i.start.assign("day",s.date()),i.start.assign("month",s.month()+1),i.start.assign("year",s.year())}else if(t[qu]){let c=t[qu];c=="\u660E"?s.add(1,"day"):c=="\u6628"?s.add(-1,"day"):c=="\u524D"?s.add(-2,"day"):c=="\u5927\u524D"?s.add(-3,"day"):c=="\u540E"?s.add(2,"day"):c=="\u5927\u540E"&&s.add(3,"day"),i.start.assign("day",s.date()),i.start.assign("month",s.month()+1),i.start.assign("year",s.year())}else i.start.imply("day",s.date()),i.start.imply("month",s.month()+1),i.start.imply("year",s.year());let a=0,o=0,u=-1;if(t[gs]){let c=parseInt(t[gs]);if(isNaN(c)&&(c=hr.zhStringToNumber(t[gs])),c>=60)return null;i.start.assign("second",c)}if(a=parseInt(t[$u]),isNaN(a)&&(a=hr.zhStringToNumber(t[$u])),t[mr]?t[mr]=="\u534A"?o=30:t[mr]=="\u6B63"||t[mr]=="\u6574"?o=0:(o=parseInt(t[mr]),isNaN(o)&&(o=hr.zhStringToNumber(t[mr]))):a>100&&(o=a%100,a=Math.floor(a/100)),o>=60||a>24)return null;if(a>=12&&(u=1),t[Gu]){if(a>12)return null;let c=t[Gu][0].toLowerCase();c=="a"&&(u=0,a==12&&(a=0)),c=="p"&&(u=1,a!=12&&(a+=12))}else if(t[Uu]){let d=t[Uu][0];d=="\u65E9"?(u=0,a==12&&(a=0)):d=="\u665A"&&(u=1,a!=12&&(a+=12))}else if(t[Wu]){let d=t[Wu][0];d=="\u4E0A"||d=="\u65E9"||d=="\u51CC"?(u=0,a==12&&(a=0)):(d=="\u4E0B"||d=="\u665A")&&(u=1,a!=12&&(a+=12))}else if(t[ju]){let d=t[ju][0];d=="\u4E0A"||d=="\u65E9"||d=="\u51CC"?(u=0,a==12&&(a=0)):(d=="\u4E0B"||d=="\u665A")&&(u=1,a!=12&&(a+=12))}if(i.start.assign("hour",a),i.start.assign("minute",o),u>=0?i.start.assign("meridiem",u):a<12?i.start.imply("meridiem",0):i.start.imply("meridiem",1),t=pC.exec(e.text.substring(i.index+i.text.length)),!t)return i.text.match(/^\d+$/)?null:i;let l=s.clone();if(i.end=e.createParsingComponents(),t[Lu]){let c=t[Lu];c=="\u660E"?n.hour()>1&&l.add(1,"day"):c=="\u6628"?l.add(-1,"day"):c=="\u524D"?l.add(-2,"day"):c=="\u5927\u524D"?l.add(-3,"day"):c=="\u540E"?l.add(2,"day"):c=="\u5927\u540E"&&l.add(3,"day"),i.end.assign("day",l.date()),i.end.assign("month",l.month()+1),i.end.assign("year",l.year())}else if(t[qu]){let c=t[qu];c=="\u660E"?l.add(1,"day"):c=="\u6628"?l.add(-1,"day"):c=="\u524D"?l.add(-2,"day"):c=="\u5927\u524D"?l.add(-3,"day"):c=="\u540E"?l.add(2,"day"):c=="\u5927\u540E"&&l.add(3,"day"),i.end.assign("day",l.date()),i.end.assign("month",l.month()+1),i.end.assign("year",l.year())}else i.end.imply("day",l.date()),i.end.imply("month",l.month()+1),i.end.imply("year",l.year());if(a=0,o=0,u=-1,t[gs]){let c=parseInt(t[gs]);if(isNaN(c)&&(c=hr.zhStringToNumber(t[gs])),c>=60)return null;i.end.assign("second",c)}if(a=parseInt(t[$u]),isNaN(a)&&(a=hr.zhStringToNumber(t[$u])),t[mr]?t[mr]=="\u534A"?o=30:t[mr]=="\u6B63"||t[mr]=="\u6574"?o=0:(o=parseInt(t[mr]),isNaN(o)&&(o=hr.zhStringToNumber(t[mr]))):a>100&&(o=a%100,a=Math.floor(a/100)),o>=60||a>24)return null;if(a>=12&&(u=1),t[Gu]){if(a>12)return null;let c=t[Gu][0].toLowerCase();c=="a"&&(u=0,a==12&&(a=0)),c=="p"&&(u=1,a!=12&&(a+=12)),i.start.isCertain("meridiem")||(u==0?(i.start.imply("meridiem",0),i.start.get("hour")==12&&i.start.assign("hour",0)):(i.start.imply("meridiem",1),i.start.get("hour")!=12&&i.start.assign("hour",i.start.get("hour")+12)))}else if(t[Uu]){let d=t[Uu][0];d=="\u65E9"?(u=0,a==12&&(a=0)):d=="\u665A"&&(u=1,a!=12&&(a+=12))}else if(t[Wu]){let d=t[Wu][0];d=="\u4E0A"||d=="\u65E9"||d=="\u51CC"?(u=0,a==12&&(a=0)):(d=="\u4E0B"||d=="\u665A")&&(u=1,a!=12&&(a+=12))}else if(t[ju]){let d=t[ju][0];d=="\u4E0A"||d=="\u65E9"||d=="\u51CC"?(u=0,a==12&&(a=0)):(d=="\u4E0B"||d=="\u665A")&&(u=1,a!=12&&(a+=12))}return i.text=i.text+t[0],i.end.assign("hour",a),i.end.assign("minute",o),u>=0?i.end.assign("meridiem",u):i.start.isCertain("meridiem")&&i.start.get("meridiem")==1&&i.start.get("hour")>a?i.end.imply("meridiem",0):a>12&&i.end.imply("meridiem",1),i.end.date().getTime()<i.start.date().getTime()&&i.end.imply("day",i.end.get("day")+1),i}};eo.default=Gp});var BT=k(to=>{"use strict";var mC=to&&to.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(to,"__esModule",{value:!0});var hC=mC(_e()),gC=H(),YT=hs(),yC=new RegExp("(?:\u661F\u671F|\u793C\u62DC|\u5468)(?<weekday>"+Object.keys(YT.WEEKDAY_OFFSET).join("|")+")"),Yp=class extends gC.AbstractParserWithWordBoundaryChecking{innerPattern(){return yC}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=t.groups.weekday,s=YT.WEEKDAY_OFFSET[i];if(s===void 0)return null;let a=hC.default(e.refDate),o=!1,u=a.day();return Math.abs(s-7-u)<Math.abs(s-u)?a=a.day(s-7):Math.abs(s+7-u)<Math.abs(s-u)?a=a.day(s+7):a=a.day(s),n.start.assign("weekday",s),o?(n.start.assign("day",a.date()),n.start.assign("month",a.month()+1),n.start.assign("year",a.year())):(n.start.imply("day",a.date()),n.start.imply("month",a.month()+1),n.start.imply("year",a.year())),n}};to.default=Yp});var HT=k(ro=>{"use strict";var bC=ro&&ro.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ro,"__esModule",{value:!0});var TC=bC(Vr()),Bp=class extends TC.default{patternBetween(){return/^\s*(至|到|-|~|~|-|ー)\s*$/i}};ro.default=Bp});var VT=k(no=>{"use strict";var _C=no&&no.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(no,"__esModule",{value:!0});var vC=_C(pn()),Hp=class extends vC.default{patternBetween(){return/^\s*$/i}};no.default=Hp});var zT=k(ze=>{"use strict";var _n=ze&&ze.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ze,"__esModule",{value:!0});ze.createConfiguration=ze.createCasualConfiguration=ze.parseDate=ze.parse=ze.strict=ze.casual=ze.hans=void 0;var Vp=Or(),wC=_n(fu()),kC=mn(),EC=_n(FT()),SC=_n(UT()),OC=_n(qT()),DC=_n($T()),xC=_n(GT()),RC=_n(BT()),MC=_n(HT()),CC=_n(VT());ze.hans=new Vp.Chrono(zp());ze.casual=new Vp.Chrono(zp());ze.strict=new Vp.Chrono(Kp());function AC(r,e,t){return ze.casual.parse(r,e,t)}ze.parse=AC;function PC(r,e,t){return ze.casual.parseDate(r,e,t)}ze.parseDate=PC;function zp(){let r=Kp();return r.parsers.unshift(new EC.default),r}ze.createCasualConfiguration=zp;function Kp(){let r=kC.includeCommonConfiguration({parsers:[new SC.default,new DC.default,new RC.default,new xC.default,new OC.default],refiners:[new MC.default,new CC.default]});return r.refiners=r.refiners.filter(e=>!(e instanceof wC.default)),r}ze.createConfiguration=Kp});var QT=k(Vt=>{"use strict";var KT=Vt&&Vt.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),NC=Vt&&Vt.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),IC=Vt&&Vt.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&KT(e,r,t)},FC=Vt&&Vt.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&KT(e,r,t);return NC(e,r),e};Object.defineProperty(Vt,"__esModule",{value:!0});Vt.hans=void 0;IC(AT(),Vt);Vt.hans=FC(zT())});var Wt=k(se=>{"use strict";Object.defineProperty(se,"__esModule",{value:!0});se.parseTimeUnits=se.TIME_UNITS_PATTERN=se.parseYear=se.YEAR_PATTERN=se.parseOrdinalNumberPattern=se.ORDINAL_NUMBER_PATTERN=se.parseNumberPattern=se.NUMBER_PATTERN=se.TIME_UNIT_DICTIONARY=se.ORDINAL_WORD_DICTIONARY=se.INTEGER_WORD_DICTIONARY=se.MONTH_DICTIONARY=se.FULL_MONTH_NAME_DICTIONARY=se.WEEKDAY_DICTIONARY=se.REGEX_PARTS=void 0;var Yu=De(),LC=ft();se.REGEX_PARTS={leftBoundary:"([^\\p{L}\\p{N}_]|^)",rightBoundary:"(?=[^\\p{L}\\p{N}_]|$)",flags:"iu"};se.WEEKDAY_DICTIONARY={\u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u0435:0,\u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u044F:0,\u0432\u0441\u043A:0,"\u0432\u0441\u043A.":0,\u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A:1,\u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A\u0430:1,\u043F\u043D:1,"\u043F\u043D.":1,\u0432\u0442\u043E\u0440\u043D\u0438\u043A:2,\u0432\u0442\u043E\u0440\u043D\u0438\u043A\u0430:2,\u0432\u0442:2,"\u0432\u0442.":2,\u0441\u0440\u0435\u0434\u0430:3,\u0441\u0440\u0435\u0434\u044B:3,\u0441\u0440\u0435\u0434\u0443:3,\u0441\u0440:3,"\u0441\u0440.":3,\u0447\u0435\u0442\u0432\u0435\u0440\u0433:4,\u0447\u0435\u0442\u0432\u0435\u0440\u0433\u0430:4,\u0447\u0442:4,"\u0447\u0442.":4,\u043F\u044F\u0442\u043D\u0438\u0446\u0430:5,\u043F\u044F\u0442\u043D\u0438\u0446\u0443:5,\u043F\u044F\u0442\u043D\u0438\u0446\u044B:5,\u043F\u0442:5,"\u043F\u0442.":5,\u0441\u0443\u0431\u0431\u043E\u0442\u0430:6,\u0441\u0443\u0431\u0431\u043E\u0442\u0443:6,\u0441\u0443\u0431\u0431\u043E\u0442\u044B:6,\u0441\u0431:6,"\u0441\u0431.":6};se.FULL_MONTH_NAME_DICTIONARY={\u044F\u043D\u0432\u0430\u0440\u044C:1,\u044F\u043D\u0432\u0430\u0440\u044F:1,\u044F\u043D\u0432\u0430\u0440\u0435:1,\u0444\u0435\u0432\u0440\u044F\u043B\u044C:2,\u0444\u0435\u0432\u0440\u044F\u043B\u044F:2,\u0444\u0435\u0432\u0440\u044F\u043B\u0435:2,\u043C\u0430\u0440\u0442:3,\u043C\u0430\u0440\u0442\u0430:3,\u043C\u0430\u0440\u0442\u0435:3,\u0430\u043F\u0440\u0435\u043B\u044C:4,\u0430\u043F\u0440\u0435\u043B\u044F:4,\u0430\u043F\u0440\u0435\u043B\u0435:4,\u043C\u0430\u0439:5,\u043C\u0430\u044F:5,\u043C\u0430\u0435:5,\u0438\u044E\u043D\u044C:6,\u0438\u044E\u043D\u044F:6,\u0438\u044E\u043D\u0435:6,\u0438\u044E\u043B\u044C:7,\u0438\u044E\u043B\u044F:7,\u0438\u044E\u043B\u0435:7,\u0430\u0432\u0433\u0443\u0441\u0442:8,\u0430\u0432\u0433\u0443\u0441\u0442\u0430:8,\u0430\u0432\u0433\u0443\u0441\u0442\u0435:8,\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u044C:9,\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u044F:9,\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u0435:9,\u043E\u043A\u0442\u044F\u0431\u0440\u044C:10,\u043E\u043A\u0442\u044F\u0431\u0440\u044F:10,\u043E\u043A\u0442\u044F\u0431\u0440\u0435:10,\u043D\u043E\u044F\u0431\u0440\u044C:11,\u043D\u043E\u044F\u0431\u0440\u044F:11,\u043D\u043E\u044F\u0431\u0440\u0435:11,\u0434\u0435\u043A\u0430\u0431\u0440\u044C:12,\u0434\u0435\u043A\u0430\u0431\u0440\u044F:12,\u0434\u0435\u043A\u0430\u0431\u0440\u0435:12};se.MONTH_DICTIONARY=Object.assign(Object.assign({},se.FULL_MONTH_NAME_DICTIONARY),{\u044F\u043D\u0432:1,"\u044F\u043D\u0432.":1,\u0444\u0435\u0432:2,"\u0444\u0435\u0432.":2,\u043C\u0430\u0440:3,"\u043C\u0430\u0440.":3,\u0430\u043F\u0440:4,"\u0430\u043F\u0440.":4,\u0430\u0432\u0433:8,"\u0430\u0432\u0433.":8,\u0441\u0435\u043D:9,"\u0441\u0435\u043D.":9,\u043E\u043A\u0442:10,"\u043E\u043A\u0442.":10,\u043D\u043E\u044F:11,"\u043D\u043E\u044F.":11,\u0434\u0435\u043A:12,"\u0434\u0435\u043A.":12});se.INTEGER_WORD_DICTIONARY={\u043E\u0434\u0438\u043D:1,\u043E\u0434\u043D\u0430:1,\u043E\u0434\u043D\u043E\u0439:1,\u043E\u0434\u043D\u0443:1,\u0434\u0432\u0435:2,\u0434\u0432\u0430:2,\u0434\u0432\u0443\u0445:2,\u0442\u0440\u0438:3,\u0442\u0440\u0435\u0445:3,\u0442\u0440\u0451\u0445:3,\u0447\u0435\u0442\u044B\u0440\u0435:4,\u0447\u0435\u0442\u044B\u0440\u0435\u0445:4,\u0447\u0435\u0442\u044B\u0440\u0451\u0445:4,\u043F\u044F\u0442\u044C:5,\u043F\u044F\u0442\u0438:5,\u0448\u0435\u0441\u0442\u044C:6,\u0448\u0435\u0441\u0442\u0438:6,\u0441\u0435\u043C\u044C:7,\u0441\u0435\u043C\u0438:7,\u0432\u043E\u0441\u0435\u043C\u044C:8,\u0432\u043E\u0441\u0435\u043C\u044C\u043C\u0438:8,\u0434\u0435\u0432\u044F\u0442\u044C:9,\u0434\u0435\u0432\u044F\u0442\u0438:9,\u0434\u0435\u0441\u044F\u0442\u044C:10,\u0434\u0435\u0441\u044F\u0442\u0438:10,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u044C:11,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u0438:11,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u044C:12,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u0438:12};se.ORDINAL_WORD_DICTIONARY={\u043F\u0435\u0440\u0432\u043E\u0435:1,\u043F\u0435\u0440\u0432\u043E\u0433\u043E:1,\u0432\u0442\u043E\u0440\u043E\u0435:2,\u0432\u0442\u043E\u0440\u043E\u0433\u043E:2,\u0442\u0440\u0435\u0442\u044C\u0435:3,\u0442\u0440\u0435\u0442\u044C\u0435\u0433\u043E:3,\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0435:4,\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0433\u043E:4,\u043F\u044F\u0442\u043E\u0435:5,\u043F\u044F\u0442\u043E\u0433\u043E:5,\u0448\u0435\u0441\u0442\u043E\u0435:6,\u0448\u0435\u0441\u0442\u043E\u0433\u043E:6,\u0441\u0435\u0434\u044C\u043C\u043E\u0435:7,\u0441\u0435\u0434\u044C\u043C\u043E\u0433\u043E:7,\u0432\u043E\u0441\u044C\u043C\u043E\u0435:8,\u0432\u043E\u0441\u044C\u043C\u043E\u0433\u043E:8,\u0434\u0435\u0432\u044F\u0442\u043E\u0435:9,\u0434\u0435\u0432\u044F\u0442\u043E\u0433\u043E:9,\u0434\u0435\u0441\u044F\u0442\u043E\u0435:10,\u0434\u0435\u0441\u044F\u0442\u043E\u0433\u043E:10,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:11,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:11,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:12,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:12,\u0442\u0440\u0438\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:13,\u0442\u0440\u0438\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:13,\u0447\u0435\u0442\u044B\u0440\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:14,\u0447\u0435\u0442\u044B\u0440\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:14,\u043F\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:15,\u043F\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:15,\u0448\u0435\u0441\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:16,\u0448\u0435\u0441\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:16,\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:17,\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:17,\u0432\u043E\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:18,\u0432\u043E\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:18,\u0434\u0435\u0432\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:19,\u0434\u0435\u0432\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:19,\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u043E\u0435:20,\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:20,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0435":21,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0433\u043E":21,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u0442\u043E\u0440\u043E\u0435":22,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u0442\u043E\u0440\u043E\u0433\u043E":22,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0442\u0440\u0435\u0442\u044C\u0435":23,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0442\u0440\u0435\u0442\u044C\u0435\u0433\u043E":23,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0435":24,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0433\u043E":24,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u044F\u0442\u043E\u0435":25,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u044F\u0442\u043E\u0433\u043E":25,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0448\u0435\u0441\u0442\u043E\u0435":26,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0448\u0435\u0441\u0442\u043E\u0433\u043E":26,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0441\u0435\u0434\u044C\u043C\u043E\u0435":27,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0441\u0435\u0434\u044C\u043C\u043E\u0433\u043E":27,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u043E\u0441\u044C\u043C\u043E\u0435":28,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u043E\u0441\u044C\u043C\u043E\u0433\u043E":28,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0434\u0435\u0432\u044F\u0442\u043E\u0435":29,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0434\u0435\u0432\u044F\u0442\u043E\u0433\u043E":29,\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u043E\u0435:30,\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u043E\u0433\u043E:30,"\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0435":31,"\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0433\u043E":31};se.TIME_UNIT_DICTIONARY={\u0441\u0435\u043A:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u0430:"second",\u0441\u0435\u043A\u0443\u043D\u0434:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u044B:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u0443:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0430:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0438:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u0435\u043A:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0443:"second",\u043C\u0438\u043D:"minute",\u043C\u0438\u043D\u0443\u0442\u0430:"minute",\u043C\u0438\u043D\u0443\u0442:"minute",\u043C\u0438\u043D\u0443\u0442\u044B:"minute",\u043C\u0438\u043D\u0443\u0442\u0443:"minute",\u043C\u0438\u043D\u0443\u0442\u043E\u043A:"minute",\u043C\u0438\u043D\u0443\u0442\u043A\u0438:"minute",\u043C\u0438\u043D\u0443\u0442\u043A\u0443:"minute",\u0447\u0430\u0441:"hour",\u0447\u0430\u0441\u043E\u0432:"hour",\u0447\u0430\u0441\u0430:"hour",\u0447\u0430\u0441\u0443:"hour",\u0447\u0430\u0441\u0438\u043A\u043E\u0432:"hour",\u0447\u0430\u0441\u0438\u043A\u0430:"hour",\u0447\u0430\u0441\u0438\u043A\u0435:"hour",\u0447\u0430\u0441\u0438\u043A:"hour",\u0434\u0435\u043D\u044C:"d",\u0434\u043D\u044F:"d",\u0434\u043D\u0435\u0439:"d",\u0441\u0443\u0442\u043E\u043A:"d",\u0441\u0443\u0442\u043A\u0438:"d",\u043D\u0435\u0434\u0435\u043B\u044F:"week",\u043D\u0435\u0434\u0435\u043B\u0435:"week",\u043D\u0435\u0434\u0435\u043B\u0438:"week",\u043D\u0435\u0434\u0435\u043B\u044E:"week",\u043D\u0435\u0434\u0435\u043B\u044C:"week",\u043D\u0435\u0434\u0435\u043B\u044C\u043A\u0435:"week",\u043D\u0435\u0434\u0435\u043B\u044C\u043A\u0438:"week",\u043D\u0435\u0434\u0435\u043B\u0435\u043A:"week",\u043C\u0435\u0441\u044F\u0446:"month",\u043C\u0435\u0441\u044F\u0446\u0435:"month",\u043C\u0435\u0441\u044F\u0446\u0435\u0432:"month",\u043C\u0435\u0441\u044F\u0446\u0430:"month",\u043A\u0432\u0430\u0440\u0442\u0430\u043B:"quarter",\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u0435:"quarter",\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u043E\u0432:"quarter",\u0433\u043E\u0434:"year",\u0433\u043E\u0434\u0430:"year",\u0433\u043E\u0434\u0443:"year",\u0433\u043E\u0434\u043E\u0432:"year",\u043B\u0435\u0442:"year",\u0433\u043E\u0434\u0438\u043A:"year",\u0433\u043E\u0434\u0438\u043A\u0430:"year",\u0433\u043E\u0434\u0438\u043A\u043E\u0432:"year"};se.NUMBER_PATTERN=`(?:${Yu.matchAnyPattern(se.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|\u043F\u043E\u043B|\u043D\u0435\u0441\u043A\u043E\u043B\u044C\u043A\u043E|\u043F\u0430\u0440(?:\u044B|\u0443)|\\s{0,3})`;function ZT(r){let e=r.toLowerCase();return se.INTEGER_WORD_DICTIONARY[e]!==void 0?se.INTEGER_WORD_DICTIONARY[e]:e.match(/несколько/)?3:e.match(/пол/)?.5:e.match(/пар/)?2:e===""?1:parseFloat(e)}se.parseNumberPattern=ZT;se.ORDINAL_NUMBER_PATTERN=`(?:${Yu.matchAnyPattern(se.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:\u0433\u043E|\u043E\u0433\u043E|\u0435|\u043E\u0435)?)`;function UC(r){let e=r.toLowerCase();return se.ORDINAL_WORD_DICTIONARY[e]!==void 0?se.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:st|nd|rd|th)$/i,""),parseInt(e))}se.parseOrdinalNumberPattern=UC;var Qp="(?:\\s+(?:\u0433\u043E\u0434\u0443|\u0433\u043E\u0434\u0430|\u0433\u043E\u0434|\u0433|\u0433.))?";se.YEAR_PATTERN=`(?:[1-9][0-9]{0,3}${Qp}\\s*(?:\u043D.\u044D.|\u0434\u043E \u043D.\u044D.|\u043D. \u044D.|\u0434\u043E \u043D. \u044D.)|[1-2][0-9]{3}${Qp}|[5-9][0-9]${Qp})`;function WC(r){if(/(год|года|г|г.)/i.test(r)&&(r=r.replace(/(год|года|г|г.)/i,"")),/(до н.э.|до н. э.)/i.test(r))return r=r.replace(/(до н.э.|до н. э.)/i,""),-parseInt(r);if(/(н. э.|н.э.)/i.test(r))return r=r.replace(/(н. э.|н.э.)/i,""),parseInt(r);let e=parseInt(r);return LC.findMostLikelyADYear(e)}se.parseYear=WC;var JT=`(${se.NUMBER_PATTERN})\\s{0,3}(${Yu.matchAnyPattern(se.TIME_UNIT_DICTIONARY)})`,XT=new RegExp(JT,"i");se.TIME_UNITS_PATTERN=Yu.repeatedTimeunitPattern("(?:(?:\u043E\u043A\u043E\u043B\u043E|\u043F\u0440\u0438\u043C\u0435\u0440\u043D\u043E)\\s{0,3})?",JT);function qC(r){let e={},t=r,n=XT.exec(t);for(;n;)jC(e,n),t=t.substring(n[0].length).trim(),n=XT.exec(t);return e}se.parseTimeUnits=qC;function jC(r,e){let t=ZT(e[1]),n=se.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var t_=k(Zp=>{"use strict";Object.defineProperty(Zp,"__esModule",{value:!0});var io=Wt(),$C=qe(),GC=H(),e_=`(?:(?:\u043E\u043A\u043E\u043B\u043E|\u043F\u0440\u0438\u043C\u0435\u0440\u043D\u043E)\\s*(?:~\\s*)?)?(${io.TIME_UNITS_PATTERN})${io.REGEX_PARTS.rightBoundary}`,YC=new RegExp(`(?:\u0432 \u0442\u0435\u0447\u0435\u043D\u0438\u0435|\u0432 \u0442\u0435\u0447\u0435\u043D\u0438\u0438)\\s*${e_}`,io.REGEX_PARTS.flags),BC=new RegExp(e_,"i"),Xp=class extends GC.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return io.REGEX_PARTS.leftBoundary}innerPattern(e){return e.option.forwardDate?BC:YC}innerExtract(e,t){let n=io.parseTimeUnits(t[1]);return $C.ParsingComponents.createRelativeFromReference(e.reference,n)}};Zp.default=Xp});var a_=k(em=>{"use strict";Object.defineProperty(em,"__esModule",{value:!0});var HC=ft(),so=Wt(),s_=Wt(),Bu=Wt(),VC=De(),zC=H(),KC=new RegExp(`(?:\u0441)?\\s*(${Bu.ORDINAL_NUMBER_PATTERN})(?:\\s{0,3}(?:\u043F\u043E|-|\u2013|\u0434\u043E)?\\s{0,3}(${Bu.ORDINAL_NUMBER_PATTERN}))?(?:-|\\/|\\s{0,3}(?:of)?\\s{0,3})(${VC.matchAnyPattern(so.MONTH_DICTIONARY)})(?:(?:-|\\/|,?\\s{0,3})(${s_.YEAR_PATTERN}(?![^\\s]\\d)))?${so.REGEX_PARTS.rightBoundary}`,so.REGEX_PARTS.flags),r_=1,n_=2,QC=3,i_=4,Jp=class extends zC.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return so.REGEX_PARTS.leftBoundary}innerPattern(){return KC}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=so.MONTH_DICTIONARY[t[QC].toLowerCase()],s=Bu.parseOrdinalNumberPattern(t[r_]);if(s>31)return t.index=t.index+t[r_].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[i_]){let a=s_.parseYear(t[i_]);n.start.assign("year",a)}else{let a=HC.findYearClosestToRef(e.refDate,s,i);n.start.imply("year",a)}if(t[n_]){let a=Bu.parseOrdinalNumberPattern(t[n_]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};em.default=Jp});var l_=k(rm=>{"use strict";Object.defineProperty(rm,"__esModule",{value:!0});var ao=Wt(),XC=ft(),ZC=De(),u_=Wt(),JC=H(),eA=new RegExp(`((?:\u0432)\\s*)?(${ZC.matchAnyPattern(ao.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${u_.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,ao.REGEX_PARTS.flags),tA=2,o_=3,tm=class extends JC.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return ao.REGEX_PARTS.leftBoundary}innerPattern(){return eA}innerExtract(e,t){let n=t[tA].toLowerCase();if(t[0].length<=3&&!ao.FULL_MONTH_NAME_DICTIONARY[n])return null;let i=e.createParsingResult(t.index,t.index+t[0].length);i.start.imply("day",1);let s=ao.MONTH_DICTIONARY[n];if(i.start.assign("month",s),t[o_]){let a=u_.parseYear(t[o_]);i.start.assign("year",a)}else{let a=XC.findYearClosestToRef(e.refDate,1,s);i.start.imply("year",a)}return i}};rm.default=tm});var d_=k(im=>{"use strict";Object.defineProperty(im,"__esModule",{value:!0});var Hu=Je(),rA=gi(),c_=Wt(),nm=class extends rA.AbstractTimeExpressionParser{constructor(e){super(e)}patternFlags(){return c_.REGEX_PARTS.flags}primaryPatternLeftBoundary(){return"(^|\\s|T|(?:[^\\p{L}\\p{N}_]))"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|\u0434\u043E|\u0438|\u043F\u043E|\\?)\\s*"}primaryPrefix(){return"(?:(?:\u0432|\u0441)\\s*)??"}primarySuffix(){return`(?:\\s*(?:\u0443\u0442\u0440\u0430|\u0432\u0435\u0447\u0435\u0440\u0430|\u043F\u043E\u0441\u043B\u0435 \u043F\u043E\u043B\u0443\u0434\u043D\u044F))?(?!\\/)${c_.REGEX_PARTS.rightBoundary}`}extractPrimaryTimeComponents(e,t){let n=super.extractPrimaryTimeComponents(e,t);if(n){if(t[0].endsWith("\u0432\u0435\u0447\u0435\u0440\u0430")){let i=n.get("hour");i>=6&&i<12?(n.assign("hour",n.get("hour")+12),n.assign("meridiem",Hu.Meridiem.PM)):i<6&&n.assign("meridiem",Hu.Meridiem.AM)}if(t[0].endsWith("\u043F\u043E\u0441\u043B\u0435 \u043F\u043E\u043B\u0443\u0434\u043D\u044F")){n.assign("meridiem",Hu.Meridiem.PM);let i=n.get("hour");i>=0&&i<=6&&n.assign("hour",n.get("hour")+12)}t[0].endsWith("\u0443\u0442\u0440\u0430")&&(n.assign("meridiem",Hu.Meridiem.AM),n.get("hour")<12&&n.assign("hour",n.get("hour")))}return n}};im.default=nm});var f_=k(am=>{"use strict";Object.defineProperty(am,"__esModule",{value:!0});var Vu=Wt(),nA=qe(),iA=H(),sA=cr(),aA=new RegExp(`(${Vu.TIME_UNITS_PATTERN})\\s{0,5}\u043D\u0430\u0437\u0430\u0434(?=(?:\\W|$))`,Vu.REGEX_PARTS.flags),sm=class extends iA.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Vu.REGEX_PARTS.leftBoundary}innerPattern(){return aA}innerExtract(e,t){let n=Vu.parseTimeUnits(t[1]),i=sA.reverseTimeUnits(n);return nA.ParsingComponents.createRelativeFromReference(e.reference,i)}};am.default=sm});var p_=k(oo=>{"use strict";var oA=oo&&oo.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(oo,"__esModule",{value:!0});var uA=oA(Vr()),om=class extends uA.default{patternBetween(){return/^\s*(и до|и по|до|по|-)\s*$/i}};oo.default=om});var m_=k(uo=>{"use strict";var lA=uo&&uo.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(uo,"__esModule",{value:!0});var cA=lA(pn()),um=class extends cA.default{patternBetween(){return new RegExp("^\\s*(T|\u0432|,|-)?\\s*$")}};uo.default=um});var h_=k(vn=>{"use strict";var dA=vn&&vn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),fA=vn&&vn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),pA=vn&&vn.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&dA(e,r,t);return fA(e,r),e};Object.defineProperty(vn,"__esModule",{value:!0});var mA=H(),lo=pA(gn()),lm=Wt(),hA=new RegExp(`(?:\u0441|\u0441\u043E)?\\s*(\u0441\u0435\u0433\u043E\u0434\u043D\u044F|\u0432\u0447\u0435\u0440\u0430|\u0437\u0430\u0432\u0442\u0440\u0430|\u043F\u043E\u0441\u043B\u0435\u0437\u0430\u0432\u0442\u0440\u0430|\u043F\u043E\u0437\u0430\u0432\u0447\u0435\u0440\u0430)${lm.REGEX_PARTS.rightBoundary}`,lm.REGEX_PARTS.flags),cm=class extends mA.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return lm.REGEX_PARTS.leftBoundary}innerPattern(e){return hA}innerExtract(e,t){let n=t[1].toLowerCase(),i=e.createParsingComponents();switch(n){case"\u0441\u0435\u0433\u043E\u0434\u043D\u044F":return lo.today(e.reference);case"\u0432\u0447\u0435\u0440\u0430":return lo.yesterday(e.reference);case"\u0437\u0430\u0432\u0442\u0440\u0430":return lo.tomorrow(e.reference);case"\u043F\u043E\u0441\u043B\u0435\u0437\u0430\u0432\u0442\u0440\u0430":return lo.theDayAfter(e.reference,2);case"\u043F\u043E\u0437\u0430\u0432\u0447\u0435\u0440\u0430":return lo.theDayBefore(e.reference,2)}return i}};vn.default=cm});var g_=k(Cr=>{"use strict";var gA=Cr&&Cr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),yA=Cr&&Cr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),bA=Cr&&Cr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&gA(e,r,t);return yA(e,r),e},TA=Cr&&Cr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Cr,"__esModule",{value:!0});var _A=H(),Ei=bA(gn()),vA=lr(),wA=TA(_e()),dm=Wt(),kA=new RegExp(`(\u0441\u0435\u0439\u0447\u0430\u0441|\u043F\u0440\u043E\u0448\u043B\u044B\u043C\\s*\u0432\u0435\u0447\u0435\u0440\u043E\u043C|\u043F\u0440\u043E\u0448\u043B\u043E\u0439\\s*\u043D\u043E\u0447\u044C\u044E|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439\\s*\u043D\u043E\u0447\u044C\u044E|\u0441\u0435\u0433\u043E\u0434\u043D\u044F\\s*\u043D\u043E\u0447\u044C\u044E|\u044D\u0442\u043E\u0439\\s*\u043D\u043E\u0447\u044C\u044E|\u043D\u043E\u0447\u044C\u044E|\u044D\u0442\u0438\u043C \u0443\u0442\u0440\u043E\u043C|\u0443\u0442\u0440\u043E\u043C|\u0443\u0442\u0440\u0430|\u0432\\s*\u043F\u043E\u043B\u0434\u0435\u043D\u044C|\u0432\u0435\u0447\u0435\u0440\u043E\u043C|\u0432\u0435\u0447\u0435\u0440\u0430|\u0432\\s*\u043F\u043E\u043B\u043D\u043E\u0447\u044C)${dm.REGEX_PARTS.rightBoundary}`,dm.REGEX_PARTS.flags),fm=class extends _A.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return dm.REGEX_PARTS.leftBoundary}innerPattern(){return kA}innerExtract(e,t){let n=wA.default(e.refDate),i=t[0].toLowerCase(),s=e.createParsingComponents();if(i==="\u0441\u0435\u0439\u0447\u0430\u0441")return Ei.now(e.reference);if(i==="\u0432\u0435\u0447\u0435\u0440\u043E\u043C"||i==="\u0432\u0435\u0447\u0435\u0440\u0430")return Ei.evening(e.reference);if(i.endsWith("\u0443\u0442\u0440\u043E\u043C")||i.endsWith("\u0443\u0442\u0440\u0430"))return Ei.morning(e.reference);if(i.match(/в\s*полдень/))return Ei.noon(e.reference);if(i.match(/прошлой\s*ночью/))return Ei.lastNight(e.reference);if(i.match(/прошлым\s*вечером/))return Ei.yesterdayEvening(e.reference);if(i.match(/следующей\s*ночью/)){let a=n.hour()<22?1:2;n=n.add(a,"day"),vA.assignSimilarDate(s,n),s.imply("hour",0)}return i.match(/в\s*полночь/)||i.endsWith("\u043D\u043E\u0447\u044C\u044E")?Ei.midnight(e.reference):s}};Cr.default=fm});var y_=k(mm=>{"use strict";Object.defineProperty(mm,"__esModule",{value:!0});var co=Wt(),EA=De(),SA=H(),OA=bi(),DA=new RegExp(`(?:(?:,|\\(|\uFF08)\\s*)?(?:\u0432\\s*?)?(?:(\u044D\u0442\u0443|\u044D\u0442\u043E\u0442|\u043F\u0440\u043E\u0448\u043B\u044B\u0439|\u043F\u0440\u043E\u0448\u043B\u0443\u044E|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0443\u044E|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0433\u043E)\\s*)?(${EA.matchAnyPattern(co.WEEKDAY_DICTIONARY)})(?:\\s*(?:,|\\)|\uFF09))?(?:\\s*\u043D\u0430\\s*(\u044D\u0442\u043E\u0439|\u043F\u0440\u043E\u0448\u043B\u043E\u0439|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439)\\s*\u043D\u0435\u0434\u0435\u043B\u0435)?${co.REGEX_PARTS.rightBoundary}`,co.REGEX_PARTS.flags),xA=1,RA=2,MA=3,pm=class extends SA.AbstractParserWithWordBoundaryChecking{innerPattern(){return DA}patternLeftBoundary(){return co.REGEX_PARTS.leftBoundary}innerExtract(e,t){let n=t[RA].toLowerCase(),i=co.WEEKDAY_DICTIONARY[n],s=t[xA],a=t[MA],o=s||a;o=o||"",o=o.toLowerCase();let u=null;o=="\u043F\u0440\u043E\u0448\u043B\u044B\u0439"||o=="\u043F\u0440\u043E\u0448\u043B\u0443\u044E"||o=="\u043F\u0440\u043E\u0448\u043B\u043E\u0439"?u="last":o=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439"||o=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0443\u044E"||o=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439"||o=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0433\u043E"?u="next":(o=="\u044D\u0442\u043E\u0442"||o=="\u044D\u0442\u0443"||o=="\u044D\u0442\u043E\u0439")&&(u="this");let l=OA.toDayJSWeekday(e.refDate,i,u);return e.createParsingComponents().assign("weekday",i).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};mm.default=pm});var T_=k(po=>{"use strict";var CA=po&&po.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(po,"__esModule",{value:!0});var fo=Wt(),b_=qe(),AA=CA(_e()),PA=H(),NA=De(),IA=new RegExp(`(\u0432 \u043F\u0440\u043E\u0448\u043B\u043E\u043C|\u043D\u0430 \u043F\u0440\u043E\u0448\u043B\u043E\u0439|\u043D\u0430 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439|\u0432 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u043C|\u043D\u0430 \u044D\u0442\u043E\u0439|\u0432 \u044D\u0442\u043E\u043C)\\s*(${NA.matchAnyPattern(fo.TIME_UNIT_DICTIONARY)})(?=\\s*)${fo.REGEX_PARTS.rightBoundary}`,fo.REGEX_PARTS.flags),FA=1,LA=2,hm=class extends PA.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return fo.REGEX_PARTS.leftBoundary}innerPattern(){return IA}innerExtract(e,t){let n=t[FA].toLowerCase(),i=t[LA].toLowerCase(),s=fo.TIME_UNIT_DICTIONARY[i];if(n=="\u043D\u0430 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439"||n=="\u0432 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u043C"){let u={};return u[s]=1,b_.ParsingComponents.createRelativeFromReference(e.reference,u)}if(n=="\u0432 \u043F\u0440\u043E\u0448\u043B\u043E\u043C"||n=="\u043D\u0430 \u043F\u0440\u043E\u0448\u043B\u043E\u0439"){let u={};return u[s]=-1,b_.ParsingComponents.createRelativeFromReference(e.reference,u)}let a=e.createParsingComponents(),o=AA.default(e.reference.instant);return s.match(/week/i)?(o=o.add(-o.get("d"),"d"),a.imply("day",o.date()),a.imply("month",o.month()+1),a.imply("year",o.year())):s.match(/month/i)?(o=o.add(-o.date()+1,"d"),a.imply("day",o.date()),a.assign("year",o.year()),a.assign("month",o.month()+1)):s.match(/year/i)&&(o=o.add(-o.date()+1,"d"),o=o.add(-o.month(),"month"),a.imply("day",o.date()),a.imply("month",o.month()+1),a.assign("year",o.year())),a}};po.default=hm});var __=k(ym=>{"use strict";Object.defineProperty(ym,"__esModule",{value:!0});var mo=Wt(),UA=qe(),WA=H(),qA=cr(),jA=new RegExp(`(\u044D\u0442\u0438|\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435|\u043F\u0440\u043E\u0448\u043B\u044B\u0435|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0435|\u043F\u043E\u0441\u043B\u0435|\u0447\u0435\u0440\u0435\u0437|\\+|-)\\s*(${mo.TIME_UNITS_PATTERN})${mo.REGEX_PARTS.rightBoundary}`,mo.REGEX_PARTS.flags),gm=class extends WA.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return mo.REGEX_PARTS.leftBoundary}innerPattern(){return jA}innerExtract(e,t){let n=t[1].toLowerCase(),i=mo.parseTimeUnits(t[2]);switch(n){case"\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435":case"\u043F\u0440\u043E\u0448\u043B\u044B\u0435":case"-":i=qA.reverseTimeUnits(i);break}return UA.ParsingComponents.createRelativeFromReference(e.reference,i)}};ym.default=gm});var k_=k(lt=>{"use strict";var zt=lt&<.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(lt,"__esModule",{value:!0});lt.createConfiguration=lt.createCasualConfiguration=lt.parseDate=lt.parse=lt.strict=lt.casual=void 0;var $A=zt(t_()),GA=zt(a_()),YA=zt(l_()),BA=zt(d_()),HA=zt(f_()),VA=zt(p_()),zA=zt(m_()),KA=mn(),QA=zt(h_()),XA=zt(g_()),ZA=zt(y_()),JA=zt(T_()),v_=Or(),eP=zt(Ti()),tP=zt(__());lt.casual=new v_.Chrono(w_());lt.strict=new v_.Chrono(bm(!0));function rP(r,e,t){return lt.casual.parse(r,e,t)}lt.parse=rP;function nP(r,e,t){return lt.casual.parseDate(r,e,t)}lt.parseDate=nP;function w_(){let r=bm(!1);return r.parsers.unshift(new QA.default),r.parsers.unshift(new XA.default),r.parsers.unshift(new YA.default),r.parsers.unshift(new JA.default),r.parsers.unshift(new tP.default),r}lt.createCasualConfiguration=w_;function bm(r=!0){return KA.includeCommonConfiguration({parsers:[new eP.default(!0),new $A.default,new GA.default,new ZA.default,new BA.default(r),new HA.default],refiners:[new zA.default,new VA.default]},r)}lt.createConfiguration=bm});var Je=k(ce=>{"use strict";var iP=ce&&ce.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),sP=ce&&ce.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),zn=ce&&ce.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&iP(e,r,t);return sP(e,r),e};Object.defineProperty(ce,"__esModule",{value:!0});ce.parseDate=ce.parse=ce.casual=ce.strict=ce.ru=ce.zh=ce.nl=ce.pt=ce.ja=ce.fr=ce.de=ce.Meridiem=ce.Chrono=ce.en=void 0;var Tm=zn(Id());ce.en=Tm;var aP=Or();Object.defineProperty(ce,"Chrono",{enumerable:!0,get:function(){return aP.Chrono}});var oP;(function(r){r[r.AM=0]="AM",r[r.PM=1]="PM"})(oP=ce.Meridiem||(ce.Meridiem={}));var uP=zn(Ay());ce.de=uP;var lP=zn(ob());ce.fr=lP;var cP=zn(gb());ce.ja=cP;var dP=zn(Ab());ce.pt=dP;var fP=zn(gT());ce.nl=fP;var pP=zn(QT());ce.zh=pP;var mP=zn(k_());ce.ru=mP;ce.strict=Tm.strict;ce.casual=Tm.casual;function hP(r,e,t){return ce.casual.parse(r,e,t)}ce.parse=hP;function gP(r,e,t){return ce.casual.parseDate(r,e,t)}ce.parseDate=gP});var vv=k((Tv,_v)=>{(function(r){var e=Object.hasOwnProperty,t=Array.isArray?Array.isArray:function(h){return Object.prototype.toString.call(h)==="[object Array]"},n=10,i=typeof process=="object"&&typeof process.nextTick=="function",s=typeof Symbol=="function",a=typeof Reflect=="object",o=typeof setImmediate=="function",u=o?setImmediate:setTimeout,l=s?a&&typeof Reflect.ownKeys=="function"?Reflect.ownKeys:function(f){var h=Object.getOwnPropertyNames(f);return h.push.apply(h,Object.getOwnPropertySymbols(f)),h}:Object.keys;function c(){this._events={},this._conf&&d.call(this,this._conf)}function d(f){f&&(this._conf=f,f.delimiter&&(this.delimiter=f.delimiter),f.maxListeners!==r&&(this._maxListeners=f.maxListeners),f.wildcard&&(this.wildcard=f.wildcard),f.newListener&&(this._newListener=f.newListener),f.removeListener&&(this._removeListener=f.removeListener),f.verboseMemoryLeak&&(this.verboseMemoryLeak=f.verboseMemoryLeak),f.ignoreErrors&&(this.ignoreErrors=f.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function p(f,h){var y="(node) warning: possible EventEmitter memory leak detected. "+f+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(y+=" Event name: "+h+"."),typeof process!="undefined"&&process.emitWarning){var T=new Error(y);T.name="MaxListenersExceededWarning",T.emitter=this,T.count=f,process.emitWarning(T)}else console.error(y),console.trace&&console.trace()}var m=function(f,h,y){var T=arguments.length;switch(T){case 0:return[];case 1:return[f];case 2:return[f,h];case 3:return[f,h,y];default:for(var w=new Array(T);T--;)w[T]=arguments[T];return w}};function b(f,h){for(var y={},T,w=f.length,S=h?h.length:0,M=0;M<w;M++)T=f[M],y[T]=M<S?h[M]:r;return y}function g(f,h,y){this._emitter=f,this._target=h,this._listeners={},this._listenersCount=0;var T,w;if((y.on||y.off)&&(T=y.on,w=y.off),h.addEventListener?(T=h.addEventListener,w=h.removeEventListener):h.addListener?(T=h.addListener,w=h.removeListener):h.on&&(T=h.on,w=h.off),!T&&!w)throw Error("target does not implement any known event API");if(typeof T!="function")throw TypeError("on method must be a function");if(typeof w!="function")throw TypeError("off method must be a function");this._on=T,this._off=w;var S=f._observers;S?S.push(this):f._observers=[this]}Object.assign(g.prototype,{subscribe:function(f,h,y){var T=this,w=this._target,S=this._emitter,M=this._listeners,P=function(){var _=m.apply(null,arguments),D={data:_,name:h,original:f};if(y){var I=y.call(w,D);I!==!1&&S.emit.apply(S,[D.name].concat(_));return}S.emit.apply(S,[h].concat(_))};if(M[f])throw Error("Event '"+f+"' is already listening");this._listenersCount++,S._newListener&&S._removeListener&&!T._onNewListener?(this._onNewListener=function(_){_===h&&M[f]===null&&(M[f]=P,T._on.call(w,f,P))},S.on("newListener",this._onNewListener),this._onRemoveListener=function(_){_===h&&!S.hasListeners(_)&&M[f]&&(M[f]=null,T._off.call(w,f,P))},M[f]=null,S.on("removeListener",this._onRemoveListener)):(M[f]=P,T._on.call(w,f,P))},unsubscribe:function(f){var h=this,y=this._listeners,T=this._emitter,w,S,M=this._off,P=this._target,_;if(f&&typeof f!="string")throw TypeError("event must be a string");function D(){h._onNewListener&&(T.off("newListener",h._onNewListener),T.off("removeListener",h._onRemoveListener),h._onNewListener=null,h._onRemoveListener=null);var I=ee.call(T,h);T._observers.splice(I,1)}if(f){if(w=y[f],!w)return;M.call(P,f,w),delete y[f],--this._listenersCount||D()}else{for(S=l(y),_=S.length;_-- >0;)f=S[_],M.call(P,f,y[f]);this._listeners={},this._listenersCount=0,D()}}});function E(f,h,y,T){var w=Object.assign({},h);if(!f)return w;if(typeof f!="object")throw TypeError("options must be an object");var S=Object.keys(f),M=S.length,P,_,D;function I(ae){throw Error('Invalid "'+P+'" option value'+(ae?". Reason: "+ae:""))}for(var me=0;me<M;me++){if(P=S[me],!T&&!e.call(h,P))throw Error('Unknown "'+P+'" option');_=f[P],_!==r&&(D=y[P],w[P]=D?D(_,I):_)}return w}function R(f,h){return(typeof f!="function"||!f.hasOwnProperty("prototype"))&&h("value must be a constructor"),f}function x(f){var h="value must be type of "+f.join("|"),y=f.length,T=f[0],w=f[1];return y===1?function(S,M){if(typeof S===T)return S;M(h)}:y===2?function(S,M){var P=typeof S;if(P===T||P===w)return S;M(h)}:function(S,M){for(var P=typeof S,_=y;_-- >0;)if(P===f[_])return S;M(h)}}var v=x(["function"]),V=x(["object","function"]);function $(f,h,y){var T,w,S=0,M,P=new f(function(_,D,I){y=E(y,{timeout:0,overload:!1},{timeout:function(Ee,We){return Ee*=1,(typeof Ee!="number"||Ee<0||!Number.isFinite(Ee))&&We("timeout must be a positive number"),Ee}}),T=!y.overload&&typeof f.prototype.cancel=="function"&&typeof I=="function";function me(){w&&(w=null),S&&(clearTimeout(S),S=0)}var ae=function(Ee){me(),_(Ee)},le=function(Ee){me(),D(Ee)};T?h(ae,le,I):(w=[function(Ee){le(Ee||Error("canceled"))}],h(ae,le,function(Ee){if(M)throw Error("Unable to subscribe on cancel event asynchronously");if(typeof Ee!="function")throw TypeError("onCancel callback must be a function");w.push(Ee)}),M=!0),y.timeout>0&&(S=setTimeout(function(){var Ee=Error("timeout");Ee.code="ETIMEDOUT",S=0,P.cancel(Ee),D(Ee)},y.timeout))});return T||(P.cancel=function(_){if(!!w){for(var D=w.length,I=1;I<D;I++)w[I](_);w[0](_),w=null}}),P}function ee(f){var h=this._observers;if(!h)return-1;for(var y=h.length,T=0;T<y;T++)if(h[T]._target===f)return T;return-1}function Y(f,h,y,T,w){if(!y)return null;if(T===0){var S=typeof h;if(S==="string"){var M,P,_=0,D=0,I=this.delimiter,me=I.length;if((P=h.indexOf(I))!==-1){M=new Array(5);do M[_++]=h.slice(D,P),D=P+me;while((P=h.indexOf(I,D))!==-1);M[_++]=h.slice(D),h=M,w=_}else h=[h],w=1}else S==="object"?w=h.length:(h=[h],w=1)}var ae=null,le,Ee,We,Un,bt,or=h[T],Wn=h[T+1],It,Qe;if(T===w)y._listeners&&(typeof y._listeners=="function"?(f&&f.push(y._listeners),ae=[y]):(f&&f.push.apply(f,y._listeners),ae=[y]));else if(or==="*"){for(It=l(y),P=It.length;P-- >0;)le=It[P],le!=="_listeners"&&(Qe=Y(f,h,y[le],T+1,w),Qe&&(ae?ae.push.apply(ae,Qe):ae=Qe));return ae}else if(or==="**"){for(bt=T+1===w||T+2===w&&Wn==="*",bt&&y._listeners&&(ae=Y(f,h,y,w,w)),It=l(y),P=It.length;P-- >0;)le=It[P],le!=="_listeners"&&(le==="*"||le==="**"?(y[le]._listeners&&!bt&&(Qe=Y(f,h,y[le],w,w),Qe&&(ae?ae.push.apply(ae,Qe):ae=Qe)),Qe=Y(f,h,y[le],T,w)):le===Wn?Qe=Y(f,h,y[le],T+2,w):Qe=Y(f,h,y[le],T,w),Qe&&(ae?ae.push.apply(ae,Qe):ae=Qe));return ae}else y[or]&&(ae=Y(f,h,y[or],T+1,w));if(Ee=y["*"],Ee&&Y(f,h,Ee,T+1,w),We=y["**"],We)if(T<w)for(We._listeners&&Y(f,h,We,w,w),It=l(We),P=It.length;P-- >0;)le=It[P],le!=="_listeners"&&(le===Wn?Y(f,h,We[le],T+2,w):le===or?Y(f,h,We[le],T+1,w):(Un={},Un[le]=We[le],Y(f,h,{"**":Un},T+1,w)));else We._listeners?Y(f,h,We,w,w):We["*"]&&We["*"]._listeners&&Y(f,h,We["*"],w,w);return ae}function q(f,h,y){var T=0,w=0,S,M=this.delimiter,P=M.length,_;if(typeof f=="string")if((S=f.indexOf(M))!==-1){_=new Array(5);do _[T++]=f.slice(w,S),w=S+P;while((S=f.indexOf(M,w))!==-1);_[T++]=f.slice(w)}else _=[f],T=1;else _=f,T=f.length;if(T>1){for(S=0;S+1<T;S++)if(_[S]==="**"&&_[S+1]==="**")return}var D=this.listenerTree,I;for(S=0;S<T;S++)if(I=_[S],D=D[I]||(D[I]={}),S===T-1)return D._listeners?(typeof D._listeners=="function"&&(D._listeners=[D._listeners]),y?D._listeners.unshift(h):D._listeners.push(h),!D._listeners.warned&&this._maxListeners>0&&D._listeners.length>this._maxListeners&&(D._listeners.warned=!0,p.call(this,D._listeners.length,I))):D._listeners=h,!0;return!0}function de(f,h,y,T){for(var w=l(f),S=w.length,M,P,_,D=f._listeners,I;S-- >0;)P=w[S],M=f[P],P==="_listeners"?_=y:_=y?y.concat(P):[P],I=T||typeof P=="symbol",D&&h.push(I?_:_.join(this.delimiter)),typeof M=="object"&&de.call(this,M,h,_,I);return h}function Te(f){for(var h=l(f),y=h.length,T,w,S;y-- >0;)w=h[y],T=f[w],T&&(S=!0,w!=="_listeners"&&!Te(T)&&delete f[w]);return S}function G(f,h,y){this.emitter=f,this.event=h,this.listener=y}G.prototype.off=function(){return this.emitter.off(this.event,this.listener),this};function N(f,h,y){if(y===!0)w=!0;else if(y===!1)T=!0;else{if(!y||typeof y!="object")throw TypeError("options should be an object or true");var T=y.async,w=y.promisify,S=y.nextTick,M=y.objectify}if(T||S||w){var P=h,_=h._origin||h;if(S&&!i)throw Error("process.nextTick is not supported");w===r&&(w=h.constructor.name==="AsyncFunction"),h=function(){var D=arguments,I=this,me=this.event;return w?S?Promise.resolve():new Promise(function(ae){u(ae)}).then(function(){return I.event=me,P.apply(I,D)}):(S?process.nextTick:u)(function(){I.event=me,P.apply(I,D)})},h._async=!0,h._origin=_}return[h,M?new G(this,f,h):this]}function O(f){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,d.call(this,f)}O.EventEmitter2=O,O.prototype.listenTo=function(f,h,y){if(typeof f!="object")throw TypeError("target musts be an object");var T=this;y=E(y,{on:r,off:r,reducers:r},{on:v,off:v,reducers:V});function w(S){if(typeof S!="object")throw TypeError("events must be an object");var M=y.reducers,P=ee.call(T,f),_;P===-1?_=new g(T,f,y):_=T._observers[P];for(var D=l(S),I=D.length,me,ae=typeof M=="function",le=0;le<I;le++)me=D[le],_.subscribe(me,S[me]||me,ae?M:M&&M[me])}return t(h)?w(b(h)):w(typeof h=="string"?b(h.split(/\s+/)):h),this},O.prototype.stopListeningTo=function(f,h){var y=this._observers;if(!y)return!1;var T=y.length,w,S=!1;if(f&&typeof f!="object")throw TypeError("target should be an object");for(;T-- >0;)w=y[T],(!f||w._target===f)&&(w.unsubscribe(h),S=!0);return S},O.prototype.delimiter=".",O.prototype.setMaxListeners=function(f){f!==r&&(this._maxListeners=f,this._conf||(this._conf={}),this._conf.maxListeners=f)},O.prototype.getMaxListeners=function(){return this._maxListeners},O.prototype.event="",O.prototype.once=function(f,h,y){return this._once(f,h,!1,y)},O.prototype.prependOnceListener=function(f,h,y){return this._once(f,h,!0,y)},O.prototype._once=function(f,h,y,T){return this._many(f,1,h,y,T)},O.prototype.many=function(f,h,y,T){return this._many(f,h,y,!1,T)},O.prototype.prependMany=function(f,h,y,T){return this._many(f,h,y,!0,T)},O.prototype._many=function(f,h,y,T,w){var S=this;if(typeof y!="function")throw new Error("many only accepts instances of Function");function M(){return--h===0&&S.off(f,M),y.apply(this,arguments)}return M._origin=y,this._on(f,M,T,w)},O.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||c.call(this);var f=arguments[0],h,y=this.wildcard,T,w,S,M,P;if(f==="newListener"&&!this._newListener&&!this._events.newListener)return!1;if(y&&(h=f,f!=="newListener"&&f!=="removeListener"&&typeof f=="object")){if(w=f.length,s){for(S=0;S<w;S++)if(typeof f[S]=="symbol"){P=!0;break}}P||(f=f.join(this.delimiter))}var _=arguments.length,D;if(this._all&&this._all.length)for(D=this._all.slice(),S=0,w=D.length;S<w;S++)switch(this.event=f,_){case 1:D[S].call(this,f);break;case 2:D[S].call(this,f,arguments[1]);break;case 3:D[S].call(this,f,arguments[1],arguments[2]);break;default:D[S].apply(this,arguments)}if(y)D=[],Y.call(this,D,h,this.listenerTree,0,w);else if(D=this._events[f],typeof D=="function"){switch(this.event=f,_){case 1:D.call(this);break;case 2:D.call(this,arguments[1]);break;case 3:D.call(this,arguments[1],arguments[2]);break;default:for(T=new Array(_-1),M=1;M<_;M++)T[M-1]=arguments[M];D.apply(this,T)}return!0}else D&&(D=D.slice());if(D&&D.length){if(_>3)for(T=new Array(_-1),M=1;M<_;M++)T[M-1]=arguments[M];for(S=0,w=D.length;S<w;S++)switch(this.event=f,_){case 1:D[S].call(this);break;case 2:D[S].call(this,arguments[1]);break;case 3:D[S].call(this,arguments[1],arguments[2]);break;default:D[S].apply(this,T)}return!0}else if(!this.ignoreErrors&&!this._all&&f==="error")throw arguments[1]instanceof Error?arguments[1]:new Error("Uncaught, unspecified 'error' event.");return!!this._all},O.prototype.emitAsync=function(){if(!this._events&&!this._all)return!1;this._events||c.call(this);var f=arguments[0],h=this.wildcard,y,T,w,S,M,P;if(f==="newListener"&&!this._newListener&&!this._events.newListener)return Promise.resolve([!1]);if(h&&(y=f,f!=="newListener"&&f!=="removeListener"&&typeof f=="object")){if(S=f.length,s){for(M=0;M<S;M++)if(typeof f[M]=="symbol"){T=!0;break}}T||(f=f.join(this.delimiter))}var _=[],D=arguments.length,I;if(this._all)for(M=0,S=this._all.length;M<S;M++)switch(this.event=f,D){case 1:_.push(this._all[M].call(this,f));break;case 2:_.push(this._all[M].call(this,f,arguments[1]));break;case 3:_.push(this._all[M].call(this,f,arguments[1],arguments[2]));break;default:_.push(this._all[M].apply(this,arguments))}if(h?(I=[],Y.call(this,I,y,this.listenerTree,0)):I=this._events[f],typeof I=="function")switch(this.event=f,D){case 1:_.push(I.call(this));break;case 2:_.push(I.call(this,arguments[1]));break;case 3:_.push(I.call(this,arguments[1],arguments[2]));break;default:for(w=new Array(D-1),P=1;P<D;P++)w[P-1]=arguments[P];_.push(I.apply(this,w))}else if(I&&I.length){if(I=I.slice(),D>3)for(w=new Array(D-1),P=1;P<D;P++)w[P-1]=arguments[P];for(M=0,S=I.length;M<S;M++)switch(this.event=f,D){case 1:_.push(I[M].call(this));break;case 2:_.push(I[M].call(this,arguments[1]));break;case 3:_.push(I[M].call(this,arguments[1],arguments[2]));break;default:_.push(I[M].apply(this,w))}}else if(!this.ignoreErrors&&!this._all&&f==="error")return arguments[1]instanceof Error?Promise.reject(arguments[1]):Promise.reject("Uncaught, unspecified 'error' event.");return Promise.all(_)},O.prototype.on=function(f,h,y){return this._on(f,h,!1,y)},O.prototype.prependListener=function(f,h,y){return this._on(f,h,!0,y)},O.prototype.onAny=function(f){return this._onAny(f,!1)},O.prototype.prependAny=function(f){return this._onAny(f,!0)},O.prototype.addListener=O.prototype.on,O.prototype._onAny=function(f,h){if(typeof f!="function")throw new Error("onAny only accepts instances of Function");return this._all||(this._all=[]),h?this._all.unshift(f):this._all.push(f),this},O.prototype._on=function(f,h,y,T){if(typeof f=="function")return this._onAny(f,h),this;if(typeof h!="function")throw new Error("on only accepts instances of Function");this._events||c.call(this);var w=this,S;return T!==r&&(S=N.call(this,f,h,T),h=S[0],w=S[1]),this._newListener&&this.emit("newListener",f,h),this.wildcard?(q.call(this,f,h,y),w):(this._events[f]?(typeof this._events[f]=="function"&&(this._events[f]=[this._events[f]]),y?this._events[f].unshift(h):this._events[f].push(h),!this._events[f].warned&&this._maxListeners>0&&this._events[f].length>this._maxListeners&&(this._events[f].warned=!0,p.call(this,this._events[f].length,f))):this._events[f]=h,w)},O.prototype.off=function(f,h){if(typeof h!="function")throw new Error("removeListener only takes instances of Function");var y,T=[];if(this.wildcard){var w=typeof f=="string"?f.split(this.delimiter):f.slice();if(T=Y.call(this,null,w,this.listenerTree,0),!T)return this}else{if(!this._events[f])return this;y=this._events[f],T.push({_listeners:y})}for(var S=0;S<T.length;S++){var M=T[S];if(y=M._listeners,t(y)){for(var P=-1,_=0,D=y.length;_<D;_++)if(y[_]===h||y[_].listener&&y[_].listener===h||y[_]._origin&&y[_]._origin===h){P=_;break}if(P<0)continue;return this.wildcard?M._listeners.splice(P,1):this._events[f].splice(P,1),y.length===0&&(this.wildcard?delete M._listeners:delete this._events[f]),this._removeListener&&this.emit("removeListener",f,h),this}else(y===h||y.listener&&y.listener===h||y._origin&&y._origin===h)&&(this.wildcard?delete M._listeners:delete this._events[f],this._removeListener&&this.emit("removeListener",f,h))}return this.listenerTree&&Te(this.listenerTree),this},O.prototype.offAny=function(f){var h=0,y=0,T;if(f&&this._all&&this._all.length>0){for(T=this._all,h=0,y=T.length;h<y;h++)if(f===T[h])return T.splice(h,1),this._removeListener&&this.emit("removeListenerAny",f),this}else{if(T=this._all,this._removeListener)for(h=0,y=T.length;h<y;h++)this.emit("removeListenerAny",T[h]);this._all=[]}return this},O.prototype.removeListener=O.prototype.off,O.prototype.removeAllListeners=function(f){if(f===r)return!this._events||c.call(this),this;if(this.wildcard){var h=Y.call(this,null,f,this.listenerTree,0),y,T;if(!h)return this;for(T=0;T<h.length;T++)y=h[T],y._listeners=null;this.listenerTree&&Te(this.listenerTree)}else this._events&&(this._events[f]=null);return this},O.prototype.listeners=function(f){var h=this._events,y,T,w,S,M;if(f===r){if(this.wildcard)throw Error("event name required for wildcard emitter");if(!h)return[];for(y=l(h),S=y.length,w=[];S-- >0;)T=h[y[S]],typeof T=="function"?w.push(T):w.push.apply(w,T);return w}else{if(this.wildcard){if(M=this.listenerTree,!M)return[];var P=[],_=typeof f=="string"?f.split(this.delimiter):f.slice();return Y.call(this,P,_,M,0),P}return h?(T=h[f],T?typeof T=="function"?[T]:T:[]):[]}},O.prototype.eventNames=function(f){var h=this._events;return this.wildcard?de.call(this,this.listenerTree,[],null,f):h?l(h):[]},O.prototype.listenerCount=function(f){return this.listeners(f).length},O.prototype.hasListeners=function(f){if(this.wildcard){var h=[],y=typeof f=="string"?f.split(this.delimiter):f.slice();return Y.call(this,h,y,this.listenerTree,0),h.length>0}var T=this._events,w=this._all;return!!(w&&w.length||T&&(f===r?l(T).length:T[f]))},O.prototype.listenersAny=function(){return this._all?this._all:[]},O.prototype.waitFor=function(f,h){var y=this,T=typeof h;return T==="number"?h={timeout:h}:T==="function"&&(h={filter:h}),h=E(h,{timeout:0,filter:r,handleError:!1,Promise,overload:!1},{filter:v,Promise:R}),$(h.Promise,function(w,S,M){function P(){var _=h.filter;if(!(_&&!_.apply(y,arguments)))if(y.off(f,P),h.handleError){var D=arguments[0];D?S(D):w(m.apply(null,arguments).slice(1))}else w(m.apply(null,arguments))}M(function(){y.off(f,P)}),y._on(f,P,!1)},{timeout:h.timeout,overload:h.overload})};function B(f,h,y){y=E(y,{Promise,timeout:0,overload:!1},{Promise:R});var T=y.Promise;return $(T,function(w,S,M){var P;if(typeof f.addEventListener=="function"){P=function(){w(m.apply(null,arguments))},M(function(){f.removeEventListener(h,P)}),f.addEventListener(h,P,{once:!0});return}var _=function(){D&&f.removeListener("error",D),w(m.apply(null,arguments))},D;h!=="error"&&(D=function(I){f.removeListener(h,_),S(I)},f.once("error",D)),M(function(){D&&f.removeListener("error",D),f.removeListener(h,_)}),f.once(h,_)},{timeout:y.timeout,overload:y.overload})}var U=O.prototype;if(Object.defineProperties(O,{defaultMaxListeners:{get:function(){return U._maxListeners},set:function(f){if(typeof f!="number"||f<0||Number.isNaN(f))throw TypeError("n must be a non-negative number");U._maxListeners=f},enumerable:!0},once:{value:B,writable:!0,configurable:!0}}),Object.defineProperties(U,{_maxListeners:{value:n,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),typeof define=="function"&&define.amd)define(function(){return O});else if(typeof Tv=="object")_v.exports=O;else{var Q=new Function("","return this")();Q.EventEmitter2=O}})()});var xw=k(mh=>{"use strict";Object.defineProperty(mh,"__esModule",{value:!0});var Ow=Symbol("MustacheDataPath");function Sw({target:r,propertyName:e}){return[...r[Ow]||[],e]}function Dw(r,e){return typeof r!="object"?r:new Proxy(r,{get(t,n){let i=t[n];if(i===void 0&&!(n in t)){let s=Sw({target:t,propertyName:n});if(e!=null&&e.handleError)return e.handleError(s),i;throw Error(`Missing Mustache data property: ${s.join(" > ")}`)}return i&&typeof i=="object"?(i[Ow]=Sw({target:t,propertyName:n}),Dw(i,e)):i}})}mh.default=Dw});var on=k(qr=>{"use strict";qr.__esModule=!0;qr.Tokens=qr.StructuralCharacters=qr.Operators=void 0;var OI;(function(r){r.AND="AND",r.OR="OR",r.XOR="XOR",r.NOT="NOT"})(OI=qr.Operators||(qr.Operators={}));var DI;(function(r){r.OPEN_PARENTHESIS="(",r.CLOSE_PARENTHESIS=")"})(DI=qr.StructuralCharacters||(qr.StructuralCharacters={}));var xI;(function(r){r.IDENTIFIER="IDENTIFIER",r.OPERATOR="OPERATOR",r.STRUCTURAL_CHARACTER="STRUCTURAL_CHARACTER",r.EOF="EOF",r.COMMENT="COMMENT"})(xI=qr.Tokens||(qr.Tokens={}))});var vh=k(Hs=>{"use strict";Hs.__esModule=!0;Hs.VALID_TOKENS=Hs.OPERATOR_PRECEDENCE=void 0;var je=on();Hs.OPERATOR_PRECEDENCE={NOT:0,XOR:1,AND:2,OR:3};Hs.VALID_TOKENS={identifierOnly:[{name:je.Tokens.IDENTIFIER},{name:je.Tokens.STRUCTURAL_CHARACTER,value:je.StructuralCharacters.OPEN_PARENTHESIS}],identifierOrNot:[{name:je.Tokens.IDENTIFIER},{name:je.Tokens.STRUCTURAL_CHARACTER,value:je.StructuralCharacters.OPEN_PARENTHESIS},{name:je.Tokens.OPERATOR,value:je.Operators.NOT}],binaryOperator:[{name:je.Tokens.OPERATOR,value:je.Operators.AND},{name:je.Tokens.OPERATOR,value:je.Operators.OR},{name:je.Tokens.OPERATOR,value:je.Operators.XOR}],binaryOperatorOrClose:[{name:je.Tokens.OPERATOR,value:je.Operators.AND},{name:je.Tokens.OPERATOR,value:je.Operators.OR},{name:je.Tokens.OPERATOR,value:je.Operators.XOR},{name:je.Tokens.STRUCTURAL_CHARACTER,value:je.StructuralCharacters.CLOSE_PARENTHESIS}]}});var wh=k(St=>{"use strict";St.__esModule=!0;St.ESCAPE_CHARACTER=St.EOL=St.COMMENT_DELIMITER=St.QUOTED_IDENTIFIER_DELIMITER=St.SEPARATORS=St.OPERATORS=St.STRUCTURAL_CHARACTERS=void 0;var Vs=on();St.STRUCTURAL_CHARACTERS={"(":Vs.StructuralCharacters.OPEN_PARENTHESIS,")":Vs.StructuralCharacters.CLOSE_PARENTHESIS};St.OPERATORS={AND:Vs.Operators.AND,OR:Vs.Operators.OR,XOR:Vs.Operators.XOR,NOT:Vs.Operators.NOT};St.SEPARATORS=new Set([32,9,10,13].map(function(r){return String.fromCodePoint(r)}));St.QUOTED_IDENTIFIER_DELIMITER=String.fromCodePoint(34);St.COMMENT_DELIMITER=String.fromCodePoint(35);St.EOL=String.fromCodePoint(10);St.ESCAPE_CHARACTER=String.fromCodePoint(92)});var Nw=k(wr=>{"use strict";var kh=wr&&wr.__assign||function(){return kh=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},kh.apply(this,arguments)};wr.__esModule=!0;wr.getQuotedIdentifier=wr.getComment=wr.createResult=void 0;var Pw=on(),Bi=wh(),RI=function(r,e,t){return{token:kh({name:r},e!==null?{value:e}:{}),remainingString:t}};wr.createResult=RI;var MI=function(r){for(var e=r.length,t=0;t<r.length;t+=1){var n=r[t];if(n===Bi.EOL){e=t;break}}return(0,wr.createResult)(Pw.Tokens.COMMENT,r.slice(0,e),r.slice(e+1))};wr.getComment=MI;var CI=function(r){for(var e=!1,t="",n=null,i=0;i<r.length;i+=1){var s=r[i];if(n===null)s===Bi.QUOTED_IDENTIFIER_DELIMITER?e?t=t.slice(-1)+Bi.QUOTED_IDENTIFIER_DELIMITER:n=i:(s===Bi.ESCAPE_CHARACTER?e=!0:e=!1,t=t+=s);else{if(!Bi.SEPARATORS.has(s)&&!Bi.STRUCTURAL_CHARACTERS[s])throw new Error("Unexpected character: ".concat(s," Expected ) character or separator"));break}}if(n===null)throw new Error("Unexpected end of expression: expected ".concat(Bi.QUOTED_IDENTIFIER_DELIMITER," character"));return(0,wr.createResult)(Pw.Tokens.IDENTIFIER,t,r.slice(n+1))};wr.getQuotedIdentifier=CI});var Iw=k(Wl=>{"use strict";Wl.__esModule=!0;Wl.lex=void 0;var zs=on(),nr=wh(),Ks=Nw(),AI=function(r){for(var e=null,t=null,n=null,i=0;i<r.length;i+=1){var s=r[i];if(e===null){if(!nr.SEPARATORS.has(s)){var a=nr.STRUCTURAL_CHARACTERS[s];if(a){var o=r[i+1];if(a===zs.StructuralCharacters.CLOSE_PARENTHESIS&&o&&!nr.SEPARATORS.has(o)&&o!==zs.StructuralCharacters.CLOSE_PARENTHESIS)throw new Error("Unexpected character: ".concat(o,". A closing parenthesis should be followed by another closing parenthesis or whitespace"));return(0,Ks.createResult)(zs.Tokens.STRUCTURAL_CHARACTER,nr.STRUCTURAL_CHARACTERS[s],r.slice(i+1))}if(s===nr.QUOTED_IDENTIFIER_DELIMITER)return(0,Ks.getQuotedIdentifier)(r.slice(i+1));if(s===nr.COMMENT_DELIMITER)return(0,Ks.getComment)(r.slice(i+1));e=i}}else if(nr.SEPARATORS.has(s)||nr.STRUCTURAL_CHARACTERS[s]){t=i,n=s;break}else if(s===nr.QUOTED_IDENTIFIER_DELIMITER||s===nr.COMMENT_DELIMITER)throw new Error("Unexpected character: ".concat(s))}if(e!==null){t=t!=null?t:r.length;var u=r.slice(e,t),l=r.slice(t);if(nr.OPERATORS[u]){if(n&&!nr.SEPARATORS.has(n))throw new Error("Unexpected character: ".concat(n,". Operators should be separated using whitespace"));return(0,Ks.createResult)(zs.Tokens.OPERATOR,nr.OPERATORS[u],l)}else return(0,Ks.createResult)(zs.Tokens.IDENTIFIER,u,l)}return(0,Ks.createResult)(zs.Tokens.EOF,null,"")};Wl.lex=AI});var Lw=k(ir=>{"use strict";var Fw=ir&&ir.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,s;n<i;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return r.concat(s||Array.prototype.slice.call(e))};ir.__esModule=!0;ir.validateToken=ir.previousOperatorTakesPrecedent=ir.getValue=ir.newTokenGenerator=void 0;var PI=Iw(),Qs=on(),ql=vh(),NI=function(r){var e=r;return function(t,n){for(n===void 0&&(n=!1);;){var i=(0,PI.lex)(e),s=i.token,a=i.remainingString;if(e=a,s.name!==Qs.Tokens.COMMENT)return(0,ir.validateToken)(s,t,n),s}}};ir.newTokenGenerator=NI;var II=function(r,e){var t=r(ql.VALID_TOKENS.identifierOrNot),n=t.value===Qs.Operators.NOT;n&&(t=r(ql.VALID_TOKENS.identifierOnly));var i=t.name===Qs.Tokens.STRUCTURAL_CHARACTER?e(r,!0):[t];return n?Fw(Fw([],i,!0),[{name:Qs.Tokens.OPERATOR,value:Qs.Operators.NOT}],!1):i};ir.getValue=II;var FI=function(r,e){return ql.OPERATOR_PRECEDENCE[r]<=ql.OPERATOR_PRECEDENCE[e]};ir.previousOperatorTakesPrecedent=FI;var LI=function(r,e,t){if(t===void 0&&(t=!1),r.name===Qs.Tokens.EOF){if(t)return;throw new Error("Unexpected end of expression")}for(var n=0,i=e;n<i.length;n++){var s=i[n];if(s.name===r.name&&(!s.value||s.value===r.value))return}throw new TypeError("Invalid token")};ir.validateToken=LI});var Sh=k(Xs=>{"use strict";var un=Xs&&Xs.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,s;n<i;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return r.concat(s||Array.prototype.slice.call(e))};Xs.__esModule=!0;Xs.parse=void 0;var Uw=on(),Ww=vh(),jl=Lw(),UI=function(r){if(typeof r!="string")throw new Error("Expected string but received ".concat(typeof r));var e=(0,jl.newTokenGenerator)(r);return Eh(e)};Xs.parse=UI;var Eh=function(r,e){e===void 0&&(e=!1);for(var t=un([],(0,jl.getValue)(r,Eh),!0),n=[];;){var i=e?Ww.VALID_TOKENS.binaryOperatorOrClose:Ww.VALID_TOKENS.binaryOperator,s=r(i,!e);if(s.name===Uw.Tokens.EOF||s.name===Uw.Tokens.STRUCTURAL_CHARACTER)return un(un([],t,!0),un([],n,!0).reverse(),!0);for(;n.length;){var a=n[n.length-1]||null;if(a&&(0,jl.previousOperatorTakesPrecedent)(a.value,s.value))t=un(un([],t,!0),[a],!1),n=n.slice(0,-1);else break}n=un(un([],n,!0),[s],!1),t=un(un([],t,!0),(0,jl.getValue)(r,Eh),!0)}}});var Oh=k(Ot=>{"use strict";Ot.__esModule=!0;Ot.throwInvalidExpression=Ot.isOperator=Ot.isIdentifier=Ot.notUtil=Ot.xorUtil=Ot.orUtil=Ot.andUtil=void 0;var qw=on(),WI=function(r,e){return r&&e};Ot.andUtil=WI;var qI=function(r,e){return r||e};Ot.orUtil=qI;var jI=function(r,e){return r!==e};Ot.xorUtil=jI;var $I=function(r){return!r};Ot.notUtil=$I;var GI=function(r){var e=r.name,t=r.value;return e===qw.Tokens.IDENTIFIER&&typeof t=="string"};Ot.isIdentifier=GI;var YI=function(r){var e=r.name,t=r.value;return e===qw.Tokens.OPERATOR&&typeof t=="string"};Ot.isOperator=YI;var BI=function(r){throw new TypeError("Invalid postfix expression: ".concat(r))};Ot.throwInvalidExpression=BI});var jw=k($l=>{"use strict";var qo;$l.__esModule=!0;$l.OPERATOR_MAP=void 0;var Dh=on(),xh=Oh();$l.OPERATOR_MAP=(qo={},qo[Dh.Operators.AND]=xh.andUtil,qo[Dh.Operators.OR]=xh.orUtil,qo[Dh.Operators.XOR]=xh.xorUtil,qo)});var Gw=k(In=>{"use strict";var Zs=In&&In.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,s;n<i;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return r.concat(s||Array.prototype.slice.call(e))};In.__esModule=!0;In.evaluate=In.getEvaluator=void 0;var HI=Sh(),$w=on(),VI=jw(),Hi=Oh(),zI=function(r){var e=(0,HI.parse)(r);return function(t){return(0,In.evaluate)(e,t)}};In.getEvaluator=zI;var KI=function(r,e){if(!Array.isArray(r))throw new Error("".concat(r," should be an array. evaluate takes in a parsed expression. Use in combination with parse or use getEvaluator"));var t=r.reduce(function(n,i,s){if(!(i&&((0,Hi.isIdentifier)(i)||(0,Hi.isOperator)(i))))throw new Error("Invalid token: ".concat(i,". Found in parsed expression at index ").concat(s));if(i.name===$w.Tokens.IDENTIFIER)return Zs(Zs([],n,!0),[Boolean(e[i.value])],!1);var a=n[n.length-2],o=n[n.length-1];if(i.value===$w.Operators.NOT)return o===void 0&&(0,Hi.throwInvalidExpression)("missing identifier"),Zs(Zs([],n.slice(0,-1),!0),[(0,Hi.notUtil)(o)],!1);(o===void 0||a===void 0)&&(0,Hi.throwInvalidExpression)("missing identifier");var u=VI.OPERATOR_MAP[i.value];return u||(0,Hi.throwInvalidExpression)("unknown operator"),Zs(Zs([],n.slice(0,-2),!0),[u(a,o)],!1)},[]);return t.length!==1&&(0,Hi.throwInvalidExpression)("too many identifiers after evaluation"),t[0]};In.evaluate=KI});var Bw=k(ln=>{"use strict";var Rh=ln&&ln.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]});ln.__esModule=!0;ln.parse=ln.evaluate=ln.getEvaluator=void 0;var Yw=Gw();Rh(ln,Yw,"getEvaluator");Rh(ln,Yw,"evaluate");var QI=Sh();Rh(ln,QI,"parse")});var dF={};Kk(dF,{default:()=>yc});module.exports=Qk(dF);var Mk=require("obsidian");var Ss=require("obsidian");var pF=new Error("timeout while waiting for mutex to become available"),mF=new Error("mutex already locked"),Xk=new Error("request for lock canceled"),Zk=function(r,e,t,n){function i(s){return s instanceof t?s:new t(function(a){a(s)})}return new(t||(t=Promise))(function(s,a){function o(c){try{l(n.next(c))}catch(d){a(d)}}function u(c){try{l(n.throw(c))}catch(d){a(d)}}function l(c){c.done?s(c.value):i(c.value).then(o,u)}l((n=n.apply(r,e||[])).next())})},Rc=class{constructor(e,t=Xk){this._value=e,this._cancelError=t,this._weightedQueues=[],this._weightedWaiters=[]}acquire(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise((t,n)=>{this._weightedQueues[e-1]||(this._weightedQueues[e-1]=[]),this._weightedQueues[e-1].push({resolve:t,reject:n}),this._dispatch()})}runExclusive(e,t=1){return Zk(this,void 0,void 0,function*(){let[n,i]=yield this.acquire(t);try{return yield e(n)}finally{i()}})}waitForUnlock(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise(t=>{this._weightedWaiters[e-1]||(this._weightedWaiters[e-1]=[]),this._weightedWaiters[e-1].push(t),this._dispatch()})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(e){this._value=e,this._dispatch()}release(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);this._value+=e,this._dispatch()}cancel(){this._weightedQueues.forEach(e=>e.forEach(t=>t.reject(this._cancelError))),this._weightedQueues=[]}_dispatch(){var e;for(let t=this._value;t>0;t--){let n=(e=this._weightedQueues[t-1])===null||e===void 0?void 0:e.shift();if(!n)continue;let i=this._value,s=t;this._value-=t,t=this._value+1,n.resolve([i,this._newReleaser(s)])}this._drainUnlockWaiters()}_newReleaser(e){let t=!1;return()=>{t||(t=!0,this.release(e))}}_drainUnlockWaiters(){for(let e=this._value;e>0;e--)!this._weightedWaiters[e-1]||(this._weightedWaiters[e-1].forEach(t=>t()),this._weightedWaiters[e-1]=[])}},Jk=function(r,e,t,n){function i(s){return s instanceof t?s:new t(function(a){a(s)})}return new(t||(t=Promise))(function(s,a){function o(c){try{l(n.next(c))}catch(d){a(d)}}function u(c){try{l(n.throw(c))}catch(d){a(d)}}function l(c){c.done?s(c.value):i(c.value).then(o,u)}l((n=n.apply(r,e||[])).next())})},ru=class{constructor(e){this._semaphore=new Rc(1,e)}acquire(){return Jk(this,void 0,void 0,function*(){let[,e]=yield this._semaphore.acquire();return e})}runExclusive(e){return this._semaphore.runExclusive(()=>e())}isLocked(){return this._semaphore.isLocked()}waitForUnlock(){return this._semaphore.waitForUnlock()}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}};var zu=pa(Je());var Ct=class{constructor(e,t){this.start=e,this.end=t,t.isBefore(e)&&(this.start=t,this.end=e),this.start=this.start.startOf("day"),this.end=this.end.startOf("day")}static buildRelative(e){let t=e==="week"?"isoWeek":e;return new Ct(window.moment().startOf(t).startOf("day"),window.moment().endOf(t).startOf("day"))}static buildInvalid(){return new Ct(window.moment.invalid(),window.moment.invalid())}isValid(){return this.start.isValid()&&this.end.isValid()}moveToPrevious(e){let t=window.moment.duration(1,e);this.start.subtract(t),this.end.subtract(t),(e==="month"||e==="quarter")&&(this.end=this.end.endOf(e).startOf("day"))}moveToNext(e){let t=window.moment.duration(1,e);this.start.add(t),this.end.add(t),(e==="month"||e==="quarter")&&(this.end=this.end.endOf(e).startOf("day"))}};var Kt=class{static parseDate(e,t=!1){return window.moment(zu.parseDate(e,void 0,{forwardDate:t})).startOf("day")}static parseDateRange(e,t=!1){let n=[Kt.parseRelativeDateRange,Kt.parseNumberedDateRange,Kt.parseAbsoluteDateRange];for(let i of n){let s=i(e,t);if(s.isValid())return s}return Ct.buildInvalid()}static parseAbsoluteDateRange(e,t){let n=zu.parse(e,void 0,{forwardDate:t});if(n.length===0)return Ct.buildInvalid();let i=n[0].start,s=n[1]&&n[1].start?n[1].start:i,a=window.moment(i.date()),o=window.moment(s.date());return new Ct(a,o)}static parseRelativeDateRange(e,t){let n=/(last|this|next) (week|month|quarter|year)/,i=e.match(n);if(i&&i.length===3){let s=i[1],a=i[2],o=Ct.buildRelative(a);switch(s){case"last":o.moveToPrevious(a);break;case"next":o.moveToNext(a);break}return o}return Ct.buildInvalid()}static parseNumberedDateRange(e,t){let n=[[/^\s*[0-9]{4}\s*$/,"YYYY","year"],[/^\s*[0-9]{4}-Q[1-4]\s*$/,"YYYY-Q","quarter"],[/^\s*[0-9]{4}-[0-9]{2}\s*$/,"YYYY-MM","month"],[/^\s*[0-9]{4}-W[0-9]{2}\s*$/,"YYYY-WW","isoWeek"]];for(let[i,s,a]of n){let o=e.match(i);if(o){let u=o[0].trim();return new Ct(window.moment(u,s).startOf(a),window.moment(u,s).endOf(a))}}return Ct.buildInvalid()}};var yP={td:"today",tm:"tomorrow",yd:"yesterday",tw:"this week",nw:"next week",weekend:"sat",we:"sat"};function Ku(r){for(let[e,t]of Object.entries(yP))r=r.replace(RegExp(`\\b${e}\\s`,"i"),t);return r}var Qu=["MO","TU","WE","TH","FR","SA","SU"],Ke=function(){function r(e,t){if(t===0)throw new Error("Can't create weekday with n == 0");this.weekday=e,this.n=t}return r.fromStr=function(e){return new r(Qu.indexOf(e))},r.prototype.nth=function(e){return this.n===e?this:new r(this.weekday,e)},r.prototype.equals=function(e){return this.weekday===e.weekday&&this.n===e.n},r.prototype.toString=function(){var e=Qu[this.weekday];return this.n&&(e=(this.n>0?"+":"")+String(this.n)+e),e},r.prototype.getJsWeekday=function(){return this.weekday===6?0:this.weekday+1},r}();var Pe=function(r){return r!=null},Qt=function(r){return typeof r=="number"},_m=function(r){return typeof r=="string"&&Qu.includes(r)},ht=Array.isArray,gr=function(r,e){e===void 0&&(e=r),arguments.length===1&&(e=r,r=0);for(var t=[],n=r;n<e;n++)t.push(n);return t};var he=function(r,e){var t=0,n=[];if(ht(r))for(;t<e;t++)n[t]=[].concat(r);else for(;t<e;t++)n[t]=r;return n},E_=function(r){return ht(r)?r:[r]};function Si(r,e,t){t===void 0&&(t=" ");var n=String(r);return e=e>>0,n.length>e?String(n):(e=e-n.length,e>t.length&&(t+=he(t,e/t.length)),t.slice(0,e)+String(n))}var S_=function(r,e,t){var n=r.split(e);return t?n.slice(0,t).concat([n.slice(t).join(e)]):n},Tt=function(r,e){var t=r%e;return t*e<0?t+e:t},Xu=function(r,e){return{div:Math.floor(r/e),mod:Tt(r,e)}},Xt=function(r){return!Pe(r)||r.length===0},Ge=function(r){return!Xt(r)},ge=function(r,e){return Ge(r)&&r.indexOf(e)!==-1};var Qr=function(r,e,t,n,i,s){return n===void 0&&(n=0),i===void 0&&(i=0),s===void 0&&(s=0),new Date(Date.UTC(r,e-1,t,n,i,s))},bP=[31,28,31,30,31,30,31,31,30,31,30,31],x_=1e3*60*60*24,Zu=9999,R_=Qr(1970,1,1),TP=[6,0,1,2,3,4,5];var ys=function(r){return r%4===0&&r%100!==0||r%400===0},vm=function(r){return r instanceof Date},Oi=function(r){return vm(r)&&!isNaN(r.getTime())},O_=function(r){return r.getTimezoneOffset()*60*1e3},_P=function(r,e){var t=r.getTime()-O_(r),n=e.getTime()-O_(e),i=t-n;return Math.round(i/x_)},ho=function(r){return _P(r,R_)},Ju=function(r){return new Date(R_.getTime()+r*x_)},vP=function(r){var e=r.getUTCMonth();return e===1&&ys(r.getUTCFullYear())?29:bP[e]},wn=function(r){return TP[r.getUTCDay()]},wm=function(r,e){var t=Qr(r,e+1,1);return[wn(t),vP(t)]},el=function(r,e){return e=e||r,new Date(Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))},tl=function(r){var e=new Date(r.getTime());return e},km=function(r){for(var e=[],t=0;t<r.length;t++)e.push(tl(r[t]));return e},kn=function(r){r.sort(function(e,t){return e.getTime()-t.getTime()})},bs=function(r,e){e===void 0&&(e=!0);var t=new Date(r);return[Si(t.getUTCFullYear().toString(),4,"0"),Si(t.getUTCMonth()+1,2,"0"),Si(t.getUTCDate(),2,"0"),"T",Si(t.getUTCHours(),2,"0"),Si(t.getUTCMinutes(),2,"0"),Si(t.getUTCSeconds(),2,"0"),e?"Z":""].join("")},go=function(r){var e=/^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z?)?$/,t=e.exec(r);if(!t)throw new Error("Invalid UNTIL value: ".concat(r));return new Date(Date.UTC(parseInt(t[1],10),parseInt(t[2],10)-1,parseInt(t[3],10),parseInt(t[5],10)||0,parseInt(t[6],10)||0,parseInt(t[7],10)||0))},D_=function(r,e){var t=r.toLocaleString("sv-SE",{timeZone:e});return t.replace(" ","T")+"Z"},M_=function(r,e){var t=Intl.DateTimeFormat().resolvedOptions().timeZone,n=new Date(D_(r,t)),i=new Date(D_(r,e!=null?e:"UTC")),s=i.getTime()-n.getTime();return new Date(r.getTime()-s)};var wP=function(){function r(e,t){this.minDate=null,this.maxDate=null,this._result=[],this.total=0,this.method=e,this.args=t,e==="between"?(this.maxDate=t.inc?t.before:new Date(t.before.getTime()-1),this.minDate=t.inc?t.after:new Date(t.after.getTime()+1)):e==="before"?this.maxDate=t.inc?t.dt:new Date(t.dt.getTime()-1):e==="after"&&(this.minDate=t.inc?t.dt:new Date(t.dt.getTime()+1))}return r.prototype.accept=function(e){++this.total;var t=this.minDate&&e<this.minDate,n=this.maxDate&&e>this.maxDate;if(this.method==="between"){if(t)return!0;if(n)return!1}else if(this.method==="before"){if(n)return!1}else if(this.method==="after")return t?!0:(this.add(e),!1);return this.add(e)},r.prototype.add=function(e){return this._result.push(e),!0},r.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}},r.prototype.clone=function(){return new r(this.method,this.args)},r}(),En=wP;var Em=function(r,e){return Em=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},Em(r,e)};function Ts(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Em(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var gt=function(){return gt=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},gt.apply(this,arguments)};function W(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,s;n<i;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return r.concat(s||Array.prototype.slice.call(e))}var kP=function(r){Ts(e,r);function e(t,n,i){var s=r.call(this,t,n)||this;return s.iterator=i,s}return e.prototype.add=function(t){return this.iterator(t,this._result.length)?(this._result.push(t),!0):!1},e}(En),Sm=kP;var EP={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}},Di=EP;var C_=function(r,e){return r.indexOf(e)!==-1},SP=function(r){return r.toString()},OP=function(r,e,t){return"".concat(e," ").concat(t,", ").concat(r)},DP=function(){function r(e,t,n,i){if(t===void 0&&(t=SP),n===void 0&&(n=Di),i===void 0&&(i=OP),this.text=[],this.language=n||Di,this.gettext=t,this.dateFormatter=i,this.rrule=e,this.options=e.options,this.origOptions=e.origOptions,this.origOptions.bymonthday){var s=[].concat(this.options.bymonthday),a=[].concat(this.options.bynmonthday);s.sort(function(c,d){return c-d}),a.sort(function(c,d){return d-c}),this.bymonthday=s.concat(a),this.bymonthday.length||(this.bymonthday=null)}if(Pe(this.origOptions.byweekday)){var o=ht(this.origOptions.byweekday)?this.origOptions.byweekday:[this.origOptions.byweekday],u=String(o);this.byweekday={allWeeks:o.filter(function(c){return!c.n}),someWeeks:o.filter(function(c){return Boolean(c.n)}),isWeekdays:u.indexOf("MO")!==-1&&u.indexOf("TU")!==-1&&u.indexOf("WE")!==-1&&u.indexOf("TH")!==-1&&u.indexOf("FR")!==-1&&u.indexOf("SA")===-1&&u.indexOf("SU")===-1,isEveryDay:u.indexOf("MO")!==-1&&u.indexOf("TU")!==-1&&u.indexOf("WE")!==-1&&u.indexOf("TH")!==-1&&u.indexOf("FR")!==-1&&u.indexOf("SA")!==-1&&u.indexOf("SU")!==-1};var l=function(c,d){return c.weekday-d.weekday};this.byweekday.allWeeks.sort(l),this.byweekday.someWeeks.sort(l),this.byweekday.allWeeks.length||(this.byweekday.allWeeks=null),this.byweekday.someWeeks.length||(this.byweekday.someWeeks=null)}else this.byweekday=null}return r.isFullyConvertible=function(e){var t=!0;if(!(e.options.freq in r.IMPLEMENTED)||e.origOptions.until&&e.origOptions.count)return!1;for(var n in e.origOptions){if(C_(["dtstart","wkst","freq"],n))return!0;if(!C_(r.IMPLEMENTED[e.options.freq],n))return!1}return t},r.prototype.isFullyConvertible=function(){return r.isFullyConvertible(this.rrule)},r.prototype.toString=function(){var e=this.gettext;if(!(this.options.freq in r.IMPLEMENTED))return e("RRule error: Unable to fully convert this rrule to text");if(this.text=[e("every")],this[z.FREQUENCIES[this.options.freq]](),this.options.until){this.add(e("until"));var t=this.options.until;this.add(this.dateFormatter(t.getUTCFullYear(),this.language.monthNames[t.getUTCMonth()],t.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("")},r.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"))},r.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"))},r.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()},r.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())},r.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()},r.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")))},r.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")))},r.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"))))},r.prototype._byhour=function(){var e=this.gettext;this.add(e("at")).add(this.list(this.origOptions.byhour,void 0,e("and")))},r.prototype._bymonth=function(){this.add(this.list(this.options.bymonth,this.monthtext,this.gettext("and")))},r.prototype.nth=function(e){e=parseInt(e.toString(),10);var t,n=this.gettext;if(e===-1)return n("last");var i=Math.abs(e);switch(i){case 1:case 21:case 31:t=i+n("st");break;case 2:case 22:t=i+n("nd");break;case 3:case 23:t=i+n("rd");break;default:t=i+n("th")}return e<0?t+" "+n("last"):t},r.prototype.monthtext=function(e){return this.language.monthNames[e-1]},r.prototype.weekdaytext=function(e){var t=Qt(e)?(e+1)%7:e.getJsWeekday();return(e.n?this.nth(e.n)+" ":"")+this.language.dayNames[t]},r.prototype.plural=function(e){return e%100!==1},r.prototype.add=function(e){return this.text.push(" "),this.text.push(e),this},r.prototype.list=function(e,t,n,i){var s=this;i===void 0&&(i=","),ht(e)||(e=[e]);var a=function(u,l,c){for(var d="",p=0;p<u.length;p++)p!==0&&(p===u.length-1?d+=" "+c+" ":d+=l+" "),d+=u[p];return d};t=t||function(u){return u.toString()};var o=function(u){return t&&t.call(s,u)};return n?a(e.map(o),i,n):e.map(o).join(i+" ")},r}(),Xr=DP;var xP=function(){function r(e){this.done=!0,this.rules=e}return r.prototype.start=function(e){return this.text=e,this.done=!1,this.nextSymbol()},r.prototype.isDone=function(){return this.done&&this.symbol===null},r.prototype.nextSymbol=function(){var e,t;this.symbol=null,this.value=null;do{if(this.done)return!1;var n=void 0;e=null;for(var i in this.rules){n=this.rules[i];var s=n.exec(this.text);s&&(e===null||s[0].length>e[0].length)&&(e=s,t=i)}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(t==="SKIP");return this.symbol=t,this.value=e,!0},r.prototype.accept=function(e){if(this.symbol===e){if(this.value){var t=this.value;return this.nextSymbol(),t}return this.nextSymbol(),!0}return!1},r.prototype.acceptNumber=function(){return this.accept("number")},r.prototype.expect=function(e){if(this.accept(e))return!0;throw new Error("expected "+e+" but found "+this.symbol)},r}();function yo(r,e){e===void 0&&(e=Di);var t={},n=new xP(e.tokens);if(!n.start(r))return null;return i(),t;function i(){n.expect("every");var p=n.acceptNumber();if(p&&(t.interval=parseInt(p[0],10)),n.isDone())throw new Error("Unexpected end");switch(n.symbol){case"day(s)":t.freq=z.DAILY,n.nextSymbol()&&(a(),d());break;case"weekday(s)":t.freq=z.WEEKLY,t.byweekday=[z.MO,z.TU,z.WE,z.TH,z.FR],n.nextSymbol(),d();break;case"week(s)":t.freq=z.WEEKLY,n.nextSymbol()&&(s(),d());break;case"hour(s)":t.freq=z.HOURLY,n.nextSymbol()&&(s(),d());break;case"minute(s)":t.freq=z.MINUTELY,n.nextSymbol()&&(s(),d());break;case"month(s)":t.freq=z.MONTHLY,n.nextSymbol()&&(s(),d());break;case"year(s)":t.freq=z.YEARLY,n.nextSymbol()&&(s(),d());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":t.freq=z.WEEKLY;var m=n.symbol.substr(0,2).toUpperCase();if(t.byweekday=[z[m]],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var b=u();if(!b)throw new Error("Unexpected symbol "+n.symbol+", expected weekday");t.byweekday.push(z[b]),n.nextSymbol()}c(),d();break;case"january":case"february":case"march":case"april":case"may":case"june":case"july":case"august":case"september":case"october":case"november":case"december":if(t.freq=z.YEARLY,t.bymonth=[o()],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var g=o();if(!g)throw new Error("Unexpected symbol "+n.symbol+", expected month");t.bymonth.push(g),n.nextSymbol()}s(),d();break;default:throw new Error("Unknown symbol")}}function s(){var p=n.accept("on"),m=n.accept("the");if(!!(p||m))do{var b=l(),g=u(),E=o();if(b)g?(n.nextSymbol(),t.byweekday||(t.byweekday=[]),t.byweekday.push(z[g].nth(b))):(t.bymonthday||(t.bymonthday=[]),t.bymonthday.push(b),n.accept("day(s)"));else if(g)n.nextSymbol(),t.byweekday||(t.byweekday=[]),t.byweekday.push(z[g]);else if(n.symbol==="weekday(s)")n.nextSymbol(),t.byweekday||(t.byweekday=[z.MO,z.TU,z.WE,z.TH,z.FR]);else if(n.symbol==="week(s)"){n.nextSymbol();var R=n.acceptNumber();if(!R)throw new Error("Unexpected symbol "+n.symbol+", expected week number");for(t.byweekno=[parseInt(R[0],10)];n.accept("comma");){if(R=n.acceptNumber(),!R)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");t.byweekno.push(parseInt(R[0],10))}}else if(E)n.nextSymbol(),t.bymonth||(t.bymonth=[]),t.bymonth.push(E);else return}while(n.accept("comma")||n.accept("the")||n.accept("on"))}function a(){var p=n.accept("at");if(!!p)do{var m=n.acceptNumber();if(!m)throw new Error("Unexpected symbol "+n.symbol+", expected hour");for(t.byhour=[parseInt(m[0],10)];n.accept("comma");){if(m=n.acceptNumber(),!m)throw new Error("Unexpected symbol "+n.symbol+"; expected hour");t.byhour.push(parseInt(m[0],10))}}while(n.accept("comma")||n.accept("at"))}function o(){switch(n.symbol){case"january":return 1;case"february":return 2;case"march":return 3;case"april":return 4;case"may":return 5;case"june":return 6;case"july":return 7;case"august":return 8;case"september":return 9;case"october":return 10;case"november":return 11;case"december":return 12;default:return!1}}function u(){switch(n.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return n.symbol.substr(0,2).toUpperCase();default:return!1}}function l(){switch(n.symbol){case"last":return n.nextSymbol(),-1;case"first":return n.nextSymbol(),1;case"second":return n.nextSymbol(),n.accept("last")?-2:2;case"third":return n.nextSymbol(),n.accept("last")?-3:3;case"nth":var p=parseInt(n.value[1],10);if(p<-366||p>366)throw new Error("Nth out of range: "+p);return n.nextSymbol(),n.accept("last")?-p:p;default:return!1}}function c(){n.accept("on"),n.accept("the");var p=l();if(!!p)for(t.bymonthday=[p],n.nextSymbol();n.accept("comma");){if(p=l(),!p)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");t.bymonthday.push(p),n.nextSymbol()}}function d(){if(n.symbol==="until"){var p=Date.parse(n.text);if(!p)throw new Error("Cannot parse until date:"+n.text);t.until=new Date(p)}else n.accept("for")&&(t.count=parseInt(n.value[0],10),n.expect("number"))}}var fe;(function(r){r[r.YEARLY=0]="YEARLY",r[r.MONTHLY=1]="MONTHLY",r[r.WEEKLY=2]="WEEKLY",r[r.DAILY=3]="DAILY",r[r.HOURLY=4]="HOURLY",r[r.MINUTELY=5]="MINUTELY",r[r.SECONDLY=6]="SECONDLY"})(fe||(fe={}));function bo(r){return r<fe.HOURLY}var A_=function(r,e){return e===void 0&&(e=Di),new z(yo(r,e)||void 0)},_s=["count","until","interval","byweekday","bymonthday","bymonth"];Xr.IMPLEMENTED=[];Xr.IMPLEMENTED[fe.HOURLY]=_s;Xr.IMPLEMENTED[fe.MINUTELY]=_s;Xr.IMPLEMENTED[fe.DAILY]=["byhour"].concat(_s);Xr.IMPLEMENTED[fe.WEEKLY]=_s;Xr.IMPLEMENTED[fe.MONTHLY]=_s;Xr.IMPLEMENTED[fe.YEARLY]=["byweekno","byyearday"].concat(_s);var P_=function(r,e,t,n){return new Xr(r,e,t,n).toString()},N_=Xr.isFullyConvertible;var vs=function(){function r(e,t,n,i){this.hour=e,this.minute=t,this.second=n,this.millisecond=i||0}return r.prototype.getHours=function(){return this.hour},r.prototype.getMinutes=function(){return this.minute},r.prototype.getSeconds=function(){return this.second},r.prototype.getMilliseconds=function(){return this.millisecond},r.prototype.getTime=function(){return(this.hour*60*60+this.minute*60+this.second)*1e3+this.millisecond},r}();var I_=function(r){Ts(e,r);function e(t,n,i,s,a,o,u){var l=r.call(this,s,a,o,u)||this;return l.year=t,l.month=n,l.day=i,l}return e.fromDate=function(t){return new this(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.valueOf()%1e3)},e.prototype.getWeekday=function(){return wn(new Date(this.getTime()))},e.prototype.getTime=function(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond)).getTime()},e.prototype.getDay=function(){return this.day},e.prototype.getMonth=function(){return this.month},e.prototype.getYear=function(){return this.year},e.prototype.addYears=function(t){this.year+=t},e.prototype.addMonths=function(t){if(this.month+=t,this.month>12){var n=Math.floor(this.month/12),i=Tt(this.month,12);this.month=i,this.year+=n,this.month===0&&(this.month=12,--this.year)}},e.prototype.addWeekly=function(t,n){n>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-n))+t*7:this.day+=-(this.getWeekday()-n)+t*7,this.fixDay()},e.prototype.addDaily=function(t){this.day+=t,this.fixDay()},e.prototype.addHours=function(t,n,i){for(n&&(this.hour+=Math.floor((23-this.hour)/t)*t);;){this.hour+=t;var s=Xu(this.hour,24),a=s.div,o=s.mod;if(a&&(this.hour=o,this.addDaily(a)),Xt(i)||ge(i,this.hour))break}},e.prototype.addMinutes=function(t,n,i,s){for(n&&(this.minute+=Math.floor((1439-(this.hour*60+this.minute))/t)*t);;){this.minute+=t;var a=Xu(this.minute,60),o=a.div,u=a.mod;if(o&&(this.minute=u,this.addHours(o,!1,i)),(Xt(i)||ge(i,this.hour))&&(Xt(s)||ge(s,this.minute)))break}},e.prototype.addSeconds=function(t,n,i,s,a){for(n&&(this.second+=Math.floor((86399-(this.hour*3600+this.minute*60+this.second))/t)*t);;){this.second+=t;var o=Xu(this.second,60),u=o.div,l=o.mod;if(u&&(this.second=l,this.addMinutes(u,!1,i,s)),(Xt(i)||ge(i,this.hour))&&(Xt(s)||ge(s,this.minute))&&(Xt(a)||ge(a,this.second)))break}},e.prototype.fixDay=function(){if(!(this.day<=28)){var t=wm(this.year,this.month-1)[1];if(!(this.day<=t))for(;this.day>t;){if(this.day-=t,++this.month,this.month===13&&(this.month=1,++this.year,this.year>Zu))return;t=wm(this.year,this.month-1)[1]}}},e.prototype.add=function(t,n){var i=t.freq,s=t.interval,a=t.wkst,o=t.byhour,u=t.byminute,l=t.bysecond;switch(i){case fe.YEARLY:return this.addYears(s);case fe.MONTHLY:return this.addMonths(s);case fe.WEEKLY:return this.addWeekly(s,a);case fe.DAILY:return this.addDaily(s);case fe.HOURLY:return this.addHours(s,n,o);case fe.MINUTELY:return this.addMinutes(s,n,o,u);case fe.SECONDLY:return this.addSeconds(s,n,o,u,l)}},e}(vs);function Om(r){for(var e=[],t=Object.keys(r),n=0,i=t;n<i.length;n++){var s=i[n];ge(U_,s)||e.push(s),vm(r[s])&&!Oi(r[s])&&e.push(s)}if(e.length)throw new Error("Invalid options: "+e.join(", "));return gt({},r)}function F_(r){var e=gt(gt({},To),Om(r));if(Pe(e.byeaster)&&(e.freq=z.YEARLY),!(Pe(e.freq)&&z.FREQUENCIES[e.freq]))throw new Error("Invalid frequency: ".concat(e.freq," ").concat(r.freq));if(e.dtstart||(e.dtstart=new Date(new Date().setMilliseconds(0))),Pe(e.wkst)?Qt(e.wkst)||(e.wkst=e.wkst.weekday):e.wkst=z.MO.weekday,Pe(e.bysetpos)){Qt(e.bysetpos)&&(e.bysetpos=[e.bysetpos]);for(var t=0;t<e.bysetpos.length;t++){var n=e.bysetpos[t];if(n===0||!(n>=-366&&n<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(Boolean(e.byweekno)||Ge(e.byweekno)||Ge(e.byyearday)||Boolean(e.bymonthday)||Ge(e.bymonthday)||Pe(e.byweekday)||Pe(e.byeaster)))switch(e.freq){case z.YEARLY:e.bymonth||(e.bymonth=e.dtstart.getUTCMonth()+1),e.bymonthday=e.dtstart.getUTCDate();break;case z.MONTHLY:e.bymonthday=e.dtstart.getUTCDate();break;case z.WEEKLY:e.byweekday=[wn(e.dtstart)];break}if(Pe(e.bymonth)&&!ht(e.bymonth)&&(e.bymonth=[e.bymonth]),Pe(e.byyearday)&&!ht(e.byyearday)&&Qt(e.byyearday)&&(e.byyearday=[e.byyearday]),!Pe(e.bymonthday))e.bymonthday=[],e.bynmonthday=[];else if(ht(e.bymonthday)){for(var i=[],s=[],t=0;t<e.bymonthday.length;t++){var n=e.bymonthday[t];n>0?i.push(n):n<0&&s.push(n)}e.bymonthday=i,e.bynmonthday=s}else e.bymonthday<0?(e.bynmonthday=[e.bymonthday],e.bymonthday=[]):(e.bynmonthday=[],e.bymonthday=[e.bymonthday]);if(Pe(e.byweekno)&&!ht(e.byweekno)&&(e.byweekno=[e.byweekno]),!Pe(e.byweekday))e.bynweekday=null;else if(Qt(e.byweekday))e.byweekday=[e.byweekday],e.bynweekday=null;else if(_m(e.byweekday))e.byweekday=[Ke.fromStr(e.byweekday).weekday],e.bynweekday=null;else if(e.byweekday instanceof Ke)!e.byweekday.n||e.freq>z.MONTHLY?(e.byweekday=[e.byweekday.weekday],e.bynweekday=null):(e.bynweekday=[[e.byweekday.weekday,e.byweekday.n]],e.byweekday=null);else{for(var a=[],o=[],t=0;t<e.byweekday.length;t++){var u=e.byweekday[t];if(Qt(u)){a.push(u);continue}else if(_m(u)){a.push(Ke.fromStr(u).weekday);continue}!u.n||e.freq>z.MONTHLY?a.push(u.weekday):o.push([u.weekday,u.n])}e.byweekday=Ge(a)?a:null,e.bynweekday=Ge(o)?o:null}return Pe(e.byhour)?Qt(e.byhour)&&(e.byhour=[e.byhour]):e.byhour=e.freq<z.HOURLY?[e.dtstart.getUTCHours()]:null,Pe(e.byminute)?Qt(e.byminute)&&(e.byminute=[e.byminute]):e.byminute=e.freq<z.MINUTELY?[e.dtstart.getUTCMinutes()]:null,Pe(e.bysecond)?Qt(e.bysecond)&&(e.bysecond=[e.bysecond]):e.bysecond=e.freq<z.SECONDLY?[e.dtstart.getUTCSeconds()]:null,{parsedOptions:e}}function L_(r){var e=r.dtstart.getTime()%1e3;if(!bo(r.freq))return[];var t=[];return r.byhour.forEach(function(n){r.byminute.forEach(function(i){r.bysecond.forEach(function(s){t.push(new vs(n,i,s,e))})})}),t}function vo(r){var e=r.split(` -`).map(RP).filter(function(t){return t!==null});return gt(gt({},e[0]),e[1])}function _o(r){var e={},t=/DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(r);if(!t)return e;var n=t[1],i=t[2];return n&&(e.tzid=n),e.dtstart=go(i),e}function RP(r){if(r=r.replace(/^\s+|\s+$/,""),!r.length)return null;var e=/^([A-Z]+?)[:;]/.exec(r.toUpperCase());if(!e)return W_(r);var t=e[1];switch(t.toUpperCase()){case"RRULE":case"EXRULE":return W_(r);case"DTSTART":return _o(r);default:throw new Error("Unsupported RFC prop ".concat(t," in ").concat(r))}}function W_(r){var e=r.replace(/^RRULE:/i,""),t=_o(e),n=r.replace(/^(?:RRULE|EXRULE):/i,"").split(";");return n.forEach(function(i){var s=i.split("="),a=s[0],o=s[1];switch(a.toUpperCase()){case"FREQ":t.freq=fe[o.toUpperCase()];break;case"WKST":t.wkst=yr[o.toUpperCase()];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var u=MP(o),l=a.toLowerCase();t[l]=u;break;case"BYWEEKDAY":case"BYDAY":t.byweekday=CP(o);break;case"DTSTART":case"TZID":var c=_o(r);t.tzid=c.tzid,t.dtstart=c.dtstart;break;case"UNTIL":t.until=go(o);break;case"BYEASTER":t.byeaster=Number(o);break;default:throw new Error("Unknown RRULE property '"+a+"'")}}),t}function MP(r){if(r.indexOf(",")!==-1){var e=r.split(",");return e.map(q_)}return q_(r)}function q_(r){return/^[+-]?\d+$/.test(r)?Number(r):r}function CP(r){var e=r.split(",");return e.map(function(t){if(t.length===2)return yr[t];var n=t.match(/^([+-]?\d{1,2})([A-Z]{2})$/);if(!n||n.length<3)throw new SyntaxError("Invalid weekday string: ".concat(t));var i=Number(n[1]),s=n[2],a=yr[s].weekday;return new Ke(a,i)})}var xi=function(){function r(e,t){if(isNaN(e.getTime()))throw new RangeError("Invalid date passed to DateWithZone");this.date=e,this.tzid=t}return Object.defineProperty(r.prototype,"isUTC",{get:function(){return!this.tzid||this.tzid.toUpperCase()==="UTC"},enumerable:!1,configurable:!0}),r.prototype.toString=function(){var e=bs(this.date.getTime(),this.isUTC);return this.isUTC?":".concat(e):";TZID=".concat(this.tzid,":").concat(e)},r.prototype.getTime=function(){return this.date.getTime()},r.prototype.rezonedDate=function(){return this.isUTC?this.date:M_(this.date,this.tzid)},r}();function wo(r){for(var e=[],t="",n=Object.keys(r),i=Object.keys(To),s=0;s<n.length;s++)if(n[s]!=="tzid"&&!!ge(i,n[s])){var a=n[s].toUpperCase(),o=r[n[s]],u="";if(!(!Pe(o)||ht(o)&&!o.length)){switch(a){case"FREQ":u=z.FREQUENCIES[r.freq];break;case"WKST":Qt(o)?u=new Ke(o).toString():u=o.toString();break;case"BYWEEKDAY":a="BYDAY",u=E_(o).map(function(m){return m instanceof Ke?m:ht(m)?new Ke(m[0],m[1]):new Ke(m)}).toString();break;case"DTSTART":t=AP(o,r.tzid);break;case"UNTIL":u=bs(o,!r.tzid);break;default:if(ht(o)){for(var l=[],c=0;c<o.length;c++)l[c]=String(o[c]);u=l.toString()}else u=String(o)}u&&e.push([a,u])}}var d=e.map(function(m){var b=m[0],g=m[1];return"".concat(b,"=").concat(g.toString())}).join(";"),p="";return d!==""&&(p="RRULE:".concat(d)),[t,p].filter(function(m){return!!m}).join(` -`)}function AP(r,e){return r?"DTSTART"+new xi(new Date(r),e).toString():""}function PP(r,e){return Array.isArray(r)?!Array.isArray(e)||r.length!==e.length?!1:r.every(function(t,n){return t.getTime()===e[n].getTime()}):r instanceof Date?e instanceof Date&&r.getTime()===e.getTime():r===e}var j_=function(){function r(){this.all=!1,this.before=[],this.after=[],this.between=[]}return r.prototype._cacheAdd=function(e,t,n){t&&(t=t instanceof Date?tl(t):km(t)),e==="all"?this.all=t:(n._value=t,this[e].push(n))},r.prototype._cacheGet=function(e,t){var n=!1,i=t?Object.keys(t):[],s=function(c){for(var d=0;d<i.length;d++){var p=i[d];if(!PP(t[p],c[p]))return!0}return!1},a=this[e];if(e==="all")n=this.all;else if(ht(a))for(var o=0;o<a.length;o++){var u=a[o];if(!(i.length&&s(u))){n=u._value;break}}if(!n&&this.all){for(var l=new En(e,t),o=0;o<this.all.length&&l.accept(this.all[o]);o++);n=l.getValue(),this._cacheAdd(e,n,t)}return ht(n)?km(n):n instanceof Date?tl(n):n},r}();var $_=W(W(W(W(W(W(W(W(W(W(W(W(W([],he(1,31),!0),he(2,28),!0),he(3,31),!0),he(4,30),!0),he(5,31),!0),he(6,30),!0),he(7,31),!0),he(8,31),!0),he(9,30),!0),he(10,31),!0),he(11,30),!0),he(12,31),!0),he(1,7),!0),G_=W(W(W(W(W(W(W(W(W(W(W(W(W([],he(1,31),!0),he(2,29),!0),he(3,31),!0),he(4,30),!0),he(5,31),!0),he(6,30),!0),he(7,31),!0),he(8,31),!0),he(9,30),!0),he(10,31),!0),he(11,30),!0),he(12,31),!0),he(1,7),!0),NP=gr(1,29),IP=gr(1,30),Kn=gr(1,31),_t=gr(1,32),Y_=W(W(W(W(W(W(W(W(W(W(W(W(W([],_t,!0),IP,!0),_t,!0),Kn,!0),_t,!0),Kn,!0),_t,!0),_t,!0),Kn,!0),_t,!0),Kn,!0),_t,!0),_t.slice(0,7),!0),B_=W(W(W(W(W(W(W(W(W(W(W(W(W([],_t,!0),NP,!0),_t,!0),Kn,!0),_t,!0),Kn,!0),_t,!0),_t,!0),Kn,!0),_t,!0),Kn,!0),_t,!0),_t.slice(0,7),!0),FP=gr(-28,0),LP=gr(-29,0),Qn=gr(-30,0),vt=gr(-31,0),H_=W(W(W(W(W(W(W(W(W(W(W(W(W([],vt,!0),LP,!0),vt,!0),Qn,!0),vt,!0),Qn,!0),vt,!0),vt,!0),Qn,!0),vt,!0),Qn,!0),vt,!0),vt.slice(0,7),!0),V_=W(W(W(W(W(W(W(W(W(W(W(W(W([],vt,!0),FP,!0),vt,!0),Qn,!0),vt,!0),Qn,!0),vt,!0),vt,!0),Qn,!0),vt,!0),Qn,!0),vt,!0),vt.slice(0,7),!0),z_=[0,31,60,91,121,152,182,213,244,274,305,335,366],K_=[0,31,59,90,120,151,181,212,243,273,304,334,365],Dm=function(){for(var r=[],e=0;e<55;e++)r=r.concat(gr(7));return r}();function Q_(r,e){var t=Qr(r,1,1),n=ys(r)?366:365,i=ys(r+1)?366:365,s=ho(t),a=wn(t),o=gt(gt({yearlen:n,nextyearlen:i,yearordinal:s,yearweekday:a},UP(r)),{wnomask:null});if(Xt(e.byweekno))return o;o.wnomask=he(0,n+7);var u,l,c=u=Tt(7-a+e.wkst,7);c>=4?(c=0,l=o.yearlen+Tt(a-e.wkst,7)):l=n-c;for(var d=Math.floor(l/7),p=Tt(l,7),m=Math.floor(d+p/4),b=0;b<e.byweekno.length;b++){var g=e.byweekno[b];if(g<0&&(g+=m+1),g>0&&g<=m){var E=void 0;g>1?(E=c+(g-1)*7,c!==u&&(E-=7-u)):E=c;for(var R=0;R<7&&(o.wnomask[E]=1,E++,o.wdaymask[E]!==e.wkst);R++);}}if(ge(e.byweekno,1)){var E=c+m*7;if(c!==u&&(E-=7-u),E<n)for(var b=0;b<7&&(o.wnomask[E]=1,E+=1,o.wdaymask[E]!==e.wkst);b++);}if(c){var x=void 0;if(ge(e.byweekno,-1))x=-1;else{var v=wn(Qr(r-1,1,1)),V=Tt(7-v.valueOf()+e.wkst,7),$=ys(r-1)?366:365,ee=void 0;V>=4?(V=0,ee=$+Tt(v-e.wkst,7)):ee=n-c,x=Math.floor(52+Tt(ee,7)/4)}if(ge(e.byweekno,x))for(var E=0;E<c;E++)o.wnomask[E]=1}return o}function UP(r){var e=ys(r)?366:365,t=Qr(r,1,1),n=wn(t);return e===365?{mmask:$_,mdaymask:B_,nmdaymask:V_,wdaymask:Dm.slice(n),mrange:K_}:{mmask:G_,mdaymask:Y_,nmdaymask:H_,wdaymask:Dm.slice(n),mrange:z_}}function X_(r,e,t,n,i,s){var a={lastyear:r,lastmonth:e,nwdaymask:[]},o=[];if(s.freq===z.YEARLY)if(Xt(s.bymonth))o=[[0,t]];else for(var u=0;u<s.bymonth.length;u++)e=s.bymonth[u],o.push(n.slice(e-1,e+1));else s.freq===z.MONTHLY&&(o=[n.slice(e-1,e+1)]);if(Xt(o))return a;a.nwdaymask=he(0,t);for(var u=0;u<o.length;u++)for(var l=o[u],c=l[0],d=l[1]-1,p=0;p<s.bynweekday.length;p++){var m=void 0,b=s.bynweekday[p],g=b[0],E=b[1];E<0?(m=d+(E+1)*7,m-=Tt(i[m]-g,7)):(m=c+(E-1)*7,m+=Tt(7-i[m]+g,7)),c<=m&&m<=d&&(a.nwdaymask[m]=1)}return a}function Z_(r,e){e===void 0&&(e=0);var t=r%19,n=Math.floor(r/100),i=r%100,s=Math.floor(n/4),a=n%4,o=Math.floor((n+8)/25),u=Math.floor((n-o+1)/3),l=Math.floor(19*t+n-s-u+15)%30,c=Math.floor(i/4),d=i%4,p=Math.floor(32+2*a+2*c-l-d)%7,m=Math.floor((t+11*l+22*p)/451),b=Math.floor((l+p-7*m+114)/31),g=(l+p-7*m+114)%31+1,E=Date.UTC(r,b-1,g+e),R=Date.UTC(r,0,1);return[Math.ceil((E-R)/(1e3*60*60*24))]}var WP=function(){function r(e){this.options=e}return r.prototype.rebuild=function(e,t){var n=this.options;if(e!==this.lastyear&&(this.yearinfo=Q_(e,n)),Ge(n.bynweekday)&&(t!==this.lastmonth||e!==this.lastyear)){var i=this.yearinfo,s=i.yearlen,a=i.mrange,o=i.wdaymask;this.monthinfo=X_(e,t,s,a,o,n)}Pe(n.byeaster)&&(this.eastermask=Z_(e,n.byeaster))},Object.defineProperty(r.prototype,"lastyear",{get:function(){return this.monthinfo?this.monthinfo.lastyear:null},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"lastmonth",{get:function(){return this.monthinfo?this.monthinfo.lastmonth:null},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"yearlen",{get:function(){return this.yearinfo.yearlen},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"yearordinal",{get:function(){return this.yearinfo.yearordinal},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"mrange",{get:function(){return this.yearinfo.mrange},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"wdaymask",{get:function(){return this.yearinfo.wdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"mmask",{get:function(){return this.yearinfo.mmask},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"wnomask",{get:function(){return this.yearinfo.wnomask},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"nwdaymask",{get:function(){return this.monthinfo?this.monthinfo.nwdaymask:[]},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"nextyearlen",{get:function(){return this.yearinfo.nextyearlen},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"mdaymask",{get:function(){return this.yearinfo.mdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"nmdaymask",{get:function(){return this.yearinfo.nmdaymask},enumerable:!1,configurable:!0}),r.prototype.ydayset=function(){return[gr(this.yearlen),0,this.yearlen]},r.prototype.mdayset=function(e,t){for(var n=this.mrange[t-1],i=this.mrange[t],s=he(null,this.yearlen),a=n;a<i;a++)s[a]=a;return[s,n,i]},r.prototype.wdayset=function(e,t,n){for(var i=he(null,this.yearlen+7),s=ho(Qr(e,t,n))-this.yearordinal,a=s,o=0;o<7&&(i[s]=s,++s,this.wdaymask[s]!==this.options.wkst);o++);return[i,a,s]},r.prototype.ddayset=function(e,t,n){var i=he(null,this.yearlen),s=ho(Qr(e,t,n))-this.yearordinal;return i[s]=s,[i,s,s+1]},r.prototype.htimeset=function(e,t,n,i){var s=this,a=[];return this.options.byminute.forEach(function(o){a=a.concat(s.mtimeset(e,o,n,i))}),kn(a),a},r.prototype.mtimeset=function(e,t,n,i){var s=this.options.bysecond.map(function(a){return new vs(e,t,a,i)});return kn(s),s},r.prototype.stimeset=function(e,t,n,i){return[new vs(e,t,n,i)]},r.prototype.getdayset=function(e){switch(e){case fe.YEARLY:return this.ydayset.bind(this);case fe.MONTHLY:return this.mdayset.bind(this);case fe.WEEKLY:return this.wdayset.bind(this);case fe.DAILY:return this.ddayset.bind(this);default:return this.ddayset.bind(this)}},r.prototype.gettimeset=function(e){switch(e){case fe.HOURLY:return this.htimeset.bind(this);case fe.MINUTELY:return this.mtimeset.bind(this);case fe.SECONDLY:return this.stimeset.bind(this)}},r}(),J_=WP;function ev(r,e,t,n,i,s){for(var a=[],o=0;o<r.length;o++){var u=void 0,l=void 0,c=r[o];c<0?(u=Math.floor(c/e.length),l=Tt(c,e.length)):(u=Math.floor((c-1)/e.length),l=Tt(c-1,e.length));for(var d=[],p=t;p<n;p++){var m=s[p];!Pe(m)||d.push(m)}var b=void 0;u<0?b=d.slice(u)[0]:b=d[u];var g=e[l],E=Ju(i.yearordinal+b),R=el(E,g);ge(a,R)||a.push(R)}return kn(a),a}function rl(r,e){var t=e.dtstart,n=e.freq,i=e.interval,s=e.until,a=e.bysetpos,o=e.count;if(o===0||i===0)return Sn(r);var u=I_.fromDate(t),l=new J_(e);l.rebuild(u.year,u.month);for(var c=$P(l,u,e);;){var d=l.getdayset(n)(u.year,u.month,u.day),p=d[0],m=d[1],b=d[2],g=jP(p,m,b,l,e);if(Ge(a))for(var E=ev(a,c,m,b,l,p),R=0;R<E.length;R++){var x=E[R];if(s&&x>s)return Sn(r);if(x>=t){var v=tv(x,e);if(!r.accept(v)||o&&(--o,!o))return Sn(r)}}else for(var R=m;R<b;R++){var V=p[R];if(!!Pe(V))for(var $=Ju(l.yearordinal+V),ee=0;ee<c.length;ee++){var Y=c[ee],x=el($,Y);if(s&&x>s)return Sn(r);if(x>=t){var v=tv(x,e);if(!r.accept(v)||o&&(--o,!o))return Sn(r)}}}if(e.interval===0||(u.add(e,g),u.year>Zu))return Sn(r);bo(n)||(c=l.gettimeset(n)(u.hour,u.minute,u.second,0)),l.rebuild(u.year,u.month)}}function qP(r,e,t){var n=t.bymonth,i=t.byweekno,s=t.byweekday,a=t.byeaster,o=t.bymonthday,u=t.bynmonthday,l=t.byyearday;return Ge(n)&&!ge(n,r.mmask[e])||Ge(i)&&!r.wnomask[e]||Ge(s)&&!ge(s,r.wdaymask[e])||Ge(r.nwdaymask)&&!r.nwdaymask[e]||a!==null&&!ge(r.eastermask,e)||(Ge(o)||Ge(u))&&!ge(o,r.mdaymask[e])&&!ge(u,r.nmdaymask[e])||Ge(l)&&(e<r.yearlen&&!ge(l,e+1)&&!ge(l,-r.yearlen+e)||e>=r.yearlen&&!ge(l,e+1-r.yearlen)&&!ge(l,-r.nextyearlen+e-r.yearlen))}function tv(r,e){return new xi(r,e.tzid).rezonedDate()}function Sn(r){return r.getValue()}function jP(r,e,t,n,i){for(var s=!1,a=e;a<t;a++){var o=r[a];s=qP(n,o,i),s&&(r[o]=null)}return s}function $P(r,e,t){var n=t.freq,i=t.byhour,s=t.byminute,a=t.bysecond;return bo(n)?L_(t):n>=z.HOURLY&&Ge(i)&&!ge(i,e.hour)||n>=z.MINUTELY&&Ge(s)&&!ge(s,e.minute)||n>=z.SECONDLY&&Ge(a)&&!ge(a,e.second)?[]:r.gettimeset(n)(e.hour,e.minute,e.second,e.millisecond)}var yr={MO:new Ke(0),TU:new Ke(1),WE:new Ke(2),TH:new Ke(3),FR:new Ke(4),SA:new Ke(5),SU:new Ke(6)},To={freq:fe.YEARLY,dtstart:null,interval:1,wkst:yr.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},U_=Object.keys(To),z=function(){function r(e,t){e===void 0&&(e={}),t===void 0&&(t=!1),this._cache=t?null:new j_,this.origOptions=Om(e);var n=F_(e).parsedOptions;this.options=n}return r.parseText=function(e,t){return yo(e,t)},r.fromText=function(e,t){return A_(e,t)},r.fromString=function(e){return new r(r.parseString(e)||void 0)},r.prototype._iter=function(e){return rl(e,this.options)},r.prototype._cacheGet=function(e,t){return this._cache?this._cache._cacheGet(e,t):!1},r.prototype._cacheAdd=function(e,t,n){if(!!this._cache)return this._cache._cacheAdd(e,t,n)},r.prototype.all=function(e){if(e)return this._iter(new Sm("all",{},e));var t=this._cacheGet("all");return t===!1&&(t=this._iter(new En("all",{})),this._cacheAdd("all",t)),t},r.prototype.between=function(e,t,n,i){if(n===void 0&&(n=!1),!Oi(e)||!Oi(t))throw new Error("Invalid date passed in to RRule.between");var s={before:t,after:e,inc:n};if(i)return this._iter(new Sm("between",s,i));var a=this._cacheGet("between",s);return a===!1&&(a=this._iter(new En("between",s)),this._cacheAdd("between",a,s)),a},r.prototype.before=function(e,t){if(t===void 0&&(t=!1),!Oi(e))throw new Error("Invalid date passed in to RRule.before");var n={dt:e,inc:t},i=this._cacheGet("before",n);return i===!1&&(i=this._iter(new En("before",n)),this._cacheAdd("before",i,n)),i},r.prototype.after=function(e,t){if(t===void 0&&(t=!1),!Oi(e))throw new Error("Invalid date passed in to RRule.after");var n={dt:e,inc:t},i=this._cacheGet("after",n);return i===!1&&(i=this._iter(new En("after",n)),this._cacheAdd("after",i,n)),i},r.prototype.count=function(){return this.all().length},r.prototype.toString=function(){return wo(this.origOptions)},r.prototype.toText=function(e,t,n){return P_(this,e,t,n)},r.prototype.isFullyConvertibleToText=function(){return N_(this)},r.prototype.clone=function(){return new r(this.origOptions)},r.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],r.YEARLY=fe.YEARLY,r.MONTHLY=fe.MONTHLY,r.WEEKLY=fe.WEEKLY,r.DAILY=fe.DAILY,r.HOURLY=fe.HOURLY,r.MINUTELY=fe.MINUTELY,r.SECONDLY=fe.SECONDLY,r.MO=yr.MO,r.TU=yr.TU,r.WE=yr.WE,r.TH=yr.TH,r.FR=yr.FR,r.SA=yr.SA,r.SU=yr.SU,r.parseString=vo,r.optionsToString=wo,r}();function rv(r,e,t,n,i,s){var a={},o=r.accept;function u(p,m){t.forEach(function(b){b.between(p,m,!0).forEach(function(g){a[Number(g)]=!0})})}i.forEach(function(p){var m=new xi(p,s).rezonedDate();a[Number(m)]=!0}),r.accept=function(p){var m=Number(p);return isNaN(m)?o.call(this,p):!a[m]&&(u(new Date(m-1),new Date(m+1)),!a[m])?(a[m]=!0,o.call(this,p)):!0},r.method==="between"&&(u(r.args.after,r.args.before),r.accept=function(p){var m=Number(p);return a[m]?!0:(a[m]=!0,o.call(this,p))});for(var l=0;l<n.length;l++){var c=new xi(n[l],s).rezonedDate();if(!r.accept(new Date(c.getTime())))break}e.forEach(function(p){rl(r,p.options)});var d=r._result;switch(kn(d),r.method){case"all":case"between":return d;case"before":return d.length&&d[d.length-1]||null;case"after":default:return d.length&&d[0]||null}}var nv={dtstart:null,cache:!1,unfold:!1,forceset:!1,compatible:!1,tzid:null};function GP(r,e){var t=[],n=[],i=[],s=[],a=_o(r),o=a.dtstart,u=a.tzid,l=zP(r,e.unfold);return l.forEach(function(c){var d;if(!!c){var p=VP(c),m=p.name,b=p.parms,g=p.value;switch(m.toUpperCase()){case"RRULE":if(b.length)throw new Error("unsupported RRULE parm: ".concat(b.join(",")));t.push(vo(c));break;case"RDATE":var E=(d=/RDATE(?:;TZID=([^:=]+))?/i.exec(c))!==null&&d!==void 0?d:[],R=E[1];R&&!u&&(u=R),n=n.concat(iv(g,b));break;case"EXRULE":if(b.length)throw new Error("unsupported EXRULE parm: ".concat(b.join(",")));i.push(vo(g));break;case"EXDATE":s=s.concat(iv(g,b));break;case"DTSTART":break;default:throw new Error("unsupported property: "+m)}}}),{dtstart:o,tzid:u,rrulevals:t,rdatevals:n,exrulevals:i,exdatevals:s}}function YP(r,e){var t=GP(r,e),n=t.rrulevals,i=t.rdatevals,s=t.exrulevals,a=t.exdatevals,o=t.dtstart,u=t.tzid,l=e.cache===!1;if(e.compatible&&(e.forceset=!0,e.unfold=!0),e.forceset||n.length>1||i.length||s.length||a.length){var c=new Rm(l);return c.dtstart(o),c.tzid(u||void 0),n.forEach(function(p){c.rrule(new z(xm(p,o,u),l))}),i.forEach(function(p){c.rdate(p)}),s.forEach(function(p){c.exrule(new z(xm(p,o,u),l))}),a.forEach(function(p){c.exdate(p)}),e.compatible&&e.dtstart&&c.rdate(o),c}var d=n[0]||{};return new z(xm(d,d.dtstart||e.dtstart||o,d.tzid||e.tzid||u),l)}function nl(r,e){return e===void 0&&(e={}),YP(r,BP(e))}function xm(r,e,t){return gt(gt({},r),{dtstart:e,tzid:t})}function BP(r){var e=[],t=Object.keys(r),n=Object.keys(nv);if(t.forEach(function(i){ge(n,i)||e.push(i)}),e.length)throw new Error("Invalid options: "+e.join(", "));return gt(gt({},nv),r)}function HP(r){if(r.indexOf(":")===-1)return{name:"RRULE",value:r};var e=S_(r,":",1),t=e[0],n=e[1];return{name:t,value:n}}function VP(r){var e=HP(r),t=e.name,n=e.value,i=t.split(";");if(!i)throw new Error("empty property name");return{name:i[0].toUpperCase(),parms:i.slice(1),value:n}}function zP(r,e){if(e===void 0&&(e=!1),r=r&&r.trim(),!r)throw new Error("Invalid empty string");if(!e)return r.split(/\s/);for(var t=r.split(` -`),n=0;n<t.length;){var i=t[n]=t[n].replace(/\s+$/g,"");i?n>0&&i[0]===" "?(t[n-1]+=i.slice(1),t.splice(n,1)):n+=1:t.splice(n,1)}return t}function KP(r){r.forEach(function(e){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(e))throw new Error("unsupported RDATE/EXDATE parm: "+e)})}function iv(r,e){return KP(e),r.split(",").map(function(t){return go(t)})}function sv(r){var e=this;return function(t){if(t!==void 0&&(e["_".concat(r)]=t),e["_".concat(r)]!==void 0)return e["_".concat(r)];for(var n=0;n<e._rrule.length;n++){var i=e._rrule[n].origOptions[r];if(i)return i}}}var Rm=function(r){Ts(e,r);function e(t){t===void 0&&(t=!1);var n=r.call(this,{},t)||this;return n.dtstart=sv.apply(n,["dtstart"]),n.tzid=sv.apply(n,["tzid"]),n._rrule=[],n._rdate=[],n._exrule=[],n._exdate=[],n}return e.prototype._iter=function(t){return rv(t,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},e.prototype.rrule=function(t){av(t,this._rrule)},e.prototype.exrule=function(t){av(t,this._exrule)},e.prototype.rdate=function(t){ov(t,this._rdate)},e.prototype.exdate=function(t){ov(t,this._exdate)},e.prototype.rrules=function(){return this._rrule.map(function(t){return nl(t.toString())})},e.prototype.exrules=function(){return this._exrule.map(function(t){return nl(t.toString())})},e.prototype.rdates=function(){return this._rdate.map(function(t){return new Date(t.getTime())})},e.prototype.exdates=function(){return this._exdate.map(function(t){return new Date(t.getTime())})},e.prototype.valueOf=function(){var t=[];return!this._rrule.length&&this._dtstart&&(t=t.concat(wo({dtstart:this._dtstart}))),this._rrule.forEach(function(n){t=t.concat(n.toString().split(` +"use strict";var Hk=Object.create;var fa=Object.defineProperty,Vk=Object.defineProperties,zk=Object.getOwnPropertyDescriptor,Kk=Object.getOwnPropertyDescriptors,Qk=Object.getOwnPropertyNames,Qo=Object.getOwnPropertySymbols,Xk=Object.getPrototypeOf,wc=Object.prototype.hasOwnProperty,Gh=Object.prototype.propertyIsEnumerable;var jh=(r,e,t)=>e in r?fa(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Q=(r,e)=>{for(var t in e||(e={}))wc.call(e,t)&&jh(r,t,e[t]);if(Qo)for(var t of Qo(e))Gh.call(e,t)&&jh(r,t,e[t]);return r},_e=(r,e)=>Vk(r,Kk(e));var Xo=(r,e)=>{var t={};for(var n in r)wc.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&Qo)for(var n of Qo(r))e.indexOf(n)<0&&Gh.call(r,n)&&(t[n]=r[n]);return t};var k=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Zk=(r,e)=>{for(var t in e)fa(r,t,{get:e[t],enumerable:!0})},Yh=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Qk(e))!wc.call(r,i)&&i!==t&&fa(r,i,{get:()=>e[i],enumerable:!(n=zk(e,i))||n.enumerable});return r};var pa=(r,e,t)=>(t=r!=null?Hk(Xk(r)):{},Yh(e||!r||!r.__esModule?fa(t,"default",{value:r,enumerable:!0}):t,r)),Jk=r=>Yh(fa({},"__esModule",{value:!0}),r);var N=(r,e,t)=>new Promise((n,i)=>{var s=u=>{try{o(t.next(u))}catch(l){i(l)}},a=u=>{try{o(t.throw(u))}catch(l){i(l)}},o=u=>u.done?n(u.value):Promise.resolve(u.value).then(s,a);o((t=t.apply(r,e)).next())});var Re=k(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.matchAnyPattern=Hn.extractTerms=Hn.repeatedTimeunitPattern=void 0;function nE(r,e){let t=e.replace(/\((?!\?)/g,"(?:");return`${r}${t}\\s{0,5}(?:,?\\s{0,5}${t}){0,10}`}Hn.repeatedTimeunitPattern=nE;function Bh(r){let e;return r instanceof Array?e=[...r]:r instanceof Map?e=Array.from(r.keys()):e=Object.keys(r),e}Hn.extractTerms=Bh;function iE(r){return`(?:${Bh(r).sort((t,n)=>n.length-t.length).join("|").replace(/\./g,"\\.")})`}Hn.matchAnyPattern=iE});var ve=k((Ec,Sc)=>{(function(r,e){typeof Ec=="object"&&typeof Sc!="undefined"?Sc.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis!="undefined"?globalThis:r||self).dayjs=e()})(Ec,function(){"use strict";var r=1e3,e=6e4,t=36e5,n="millisecond",i="second",s="minute",a="hour",o="day",u="week",l="month",c="quarter",d="year",f="date",m="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,T=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},E=function(j,W,O){var H=String(j);return!H||H.length>=W?j:""+Array(W+1-H.length).join(O)+j},x={s:E,z:function(j){var W=-j.utcOffset(),O=Math.abs(W),H=Math.floor(O/60),U=O%60;return(W<=0?"+":"-")+E(H,2,"0")+":"+E(U,2,"0")},m:function j(W,O){if(W.date()<O.date())return-j(O,W);var H=12*(O.year()-W.year())+(O.month()-W.month()),U=W.clone().add(H,l),Z=O-U<0,p=W.clone().add(H+(Z?-1:1),l);return+(-(H+(O-U)/(Z?U-p:p-U))||0)},a:function(j){return j<0?Math.ceil(j)||0:Math.floor(j)},p:function(j){return{M:l,y:d,w:u,d:o,D:f,h:a,m:s,s:i,ms:n,Q:c}[j]||String(j||"").toLowerCase().replace(/s$/,"")},u:function(j){return j===void 0}},R="en",$={};$[R]=y;var q=function(j){return j instanceof Te},ne=function(j,W,O){var H;if(!j)return R;if(typeof j=="string")$[j]&&(H=j),W&&($[j]=W,H=j);else{var U=j.name;$[U]=j,H=U}return!O&&H&&(R=H),H||!O&&R},B=function(j,W){if(q(j))return j.clone();var O=typeof W=="object"?W:{};return O.date=j,O.args=arguments,new Te(O)},G=x;G.l=ne,G.i=q,G.w=function(j,W){return B(j,{locale:W.$L,utc:W.$u,x:W.$x,$offset:W.$offset})};var Te=function(){function j(O){this.$L=ne(O.locale,null,!0),this.parse(O)}var W=j.prototype;return W.parse=function(O){this.$d=function(H){var U=H.date,Z=H.utc;if(U===null)return new Date(NaN);if(G.u(U))return new Date;if(U instanceof Date)return new Date(U);if(typeof U=="string"&&!/Z$/i.test(U)){var p=U.match(g);if(p){var h=p[2]-1||0,b=(p[7]||"0").substring(0,3);return Z?new Date(Date.UTC(p[1],h,p[3]||1,p[4]||0,p[5]||0,p[6]||0,b)):new Date(p[1],h,p[3]||1,p[4]||0,p[5]||0,p[6]||0,b)}}return new Date(U)}(O),this.$x=O.x||{},this.init()},W.init=function(){var O=this.$d;this.$y=O.getFullYear(),this.$M=O.getMonth(),this.$D=O.getDate(),this.$W=O.getDay(),this.$H=O.getHours(),this.$m=O.getMinutes(),this.$s=O.getSeconds(),this.$ms=O.getMilliseconds()},W.$utils=function(){return G},W.isValid=function(){return this.$d.toString()!==m},W.isSame=function(O,H){var U=B(O);return this.startOf(H)<=U&&U<=this.endOf(H)},W.isAfter=function(O,H){return B(O)<this.startOf(H)},W.isBefore=function(O,H){return this.endOf(H)<B(O)},W.$g=function(O,H,U){return G.u(O)?this[H]:this.set(U,O)},W.unix=function(){return Math.floor(this.valueOf()/1e3)},W.valueOf=function(){return this.$d.getTime()},W.startOf=function(O,H){var U=this,Z=!!G.u(H)||H,p=G.p(O),h=function(D,P){var re=G.w(U.$u?Date.UTC(U.$y,P,D):new Date(U.$y,P,D),U);return Z?re:re.endOf(o)},b=function(D,P){return G.w(U.toDate()[D].apply(U.toDate("s"),(Z?[0,0,0,0]:[23,59,59,999]).slice(P)),U)},_=this.$W,w=this.$M,S=this.$D,M="set"+(this.$u?"UTC":"");switch(p){case d:return Z?h(1,0):h(31,11);case l:return Z?h(1,w):h(0,w+1);case u:var A=this.$locale().weekStart||0,v=(_<A?_+7:_)-A;return h(Z?S-v:S+(6-v),w);case o:case f:return b(M+"Hours",0);case a:return b(M+"Minutes",1);case s:return b(M+"Seconds",2);case i:return b(M+"Milliseconds",3);default:return this.clone()}},W.endOf=function(O){return this.startOf(O,!1)},W.$set=function(O,H){var U,Z=G.p(O),p="set"+(this.$u?"UTC":""),h=(U={},U[o]=p+"Date",U[f]=p+"Date",U[l]=p+"Month",U[d]=p+"FullYear",U[a]=p+"Hours",U[s]=p+"Minutes",U[i]=p+"Seconds",U[n]=p+"Milliseconds",U)[Z],b=Z===o?this.$D+(H-this.$W):H;if(Z===l||Z===d){var _=this.clone().set(f,1);_.$d[h](b),_.init(),this.$d=_.set(f,Math.min(this.$D,_.daysInMonth())).$d}else h&&this.$d[h](b);return this.init(),this},W.set=function(O,H){return this.clone().$set(O,H)},W.get=function(O){return this[G.p(O)]()},W.add=function(O,H){var U,Z=this;O=Number(O);var p=G.p(H),h=function(w){var S=B(Z);return G.w(S.date(S.date()+Math.round(w*O)),Z)};if(p===l)return this.set(l,this.$M+O);if(p===d)return this.set(d,this.$y+O);if(p===o)return h(1);if(p===u)return h(7);var b=(U={},U[s]=e,U[a]=t,U[i]=r,U)[p]||1,_=this.$d.getTime()+O*b;return G.w(_,this)},W.subtract=function(O,H){return this.add(-1*O,H)},W.format=function(O){var H=this,U=this.$locale();if(!this.isValid())return U.invalidDate||m;var Z=O||"YYYY-MM-DDTHH:mm:ssZ",p=G.z(this),h=this.$H,b=this.$m,_=this.$M,w=U.weekdays,S=U.months,M=function(P,re,le,fe){return P&&(P[re]||P(H,Z))||le[re].substr(0,fe)},A=function(P){return G.s(h%12||12,P,"0")},v=U.meridiem||function(P,re,le){var fe=P<12?"AM":"PM";return le?fe.toLowerCase():fe},D={YY:String(this.$y).slice(-2),YYYY:this.$y,M:_+1,MM:G.s(_+1,2,"0"),MMM:M(U.monthsShort,_,S,3),MMMM:M(S,_),D:this.$D,DD:G.s(this.$D,2,"0"),d:String(this.$W),dd:M(U.weekdaysMin,this.$W,w,2),ddd:M(U.weekdaysShort,this.$W,w,3),dddd:w[this.$W],H:String(h),HH:G.s(h,2,"0"),h:A(1),hh:A(2),a:v(h,b,!0),A:v(h,b,!1),m:String(b),mm:G.s(b,2,"0"),s:String(this.$s),ss:G.s(this.$s,2,"0"),SSS:G.s(this.$ms,3,"0"),Z:p};return Z.replace(T,function(P,re){return re||D[P]||p.replace(":","")})},W.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},W.diff=function(O,H,U){var Z,p=G.p(H),h=B(O),b=(h.utcOffset()-this.utcOffset())*e,_=this-h,w=G.m(this,h);return w=(Z={},Z[d]=w/12,Z[l]=w,Z[c]=w/3,Z[u]=(_-b)/6048e5,Z[o]=(_-b)/864e5,Z[a]=_/t,Z[s]=_/e,Z[i]=_/r,Z)[p]||_,U?w:G.a(w)},W.daysInMonth=function(){return this.endOf(l).$D},W.$locale=function(){return $[this.$L]},W.locale=function(O,H){if(!O)return this.$L;var U=this.clone(),Z=ne(O,H,!0);return Z&&(U.$L=Z),U},W.clone=function(){return G.w(this.$d,this)},W.toDate=function(){return new Date(this.valueOf())},W.toJSON=function(){return this.isValid()?this.toISOString():null},W.toISOString=function(){return this.$d.toISOString()},W.toString=function(){return this.$d.toUTCString()},j}(),Pe=Te.prototype;return B.prototype=Pe,[["$ms",n],["$s",i],["$m",s],["$H",a],["$W",o],["$M",l],["$y",d],["$D",f]].forEach(function(j){Pe[j[1]]=function(W){return this.$g(W,j[0],j[1])}}),B.extend=function(j,W){return j.$i||(j(W,Te,B),j.$i=!0),B},B.locale=ne,B.isDayjs=q,B.unix=function(j){return B(1e3*j)},B.en=$[R],B.Ls=$,B.p={},B})});var ct=k(Vn=>{"use strict";var sE=Vn&&Vn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Vn,"__esModule",{value:!0});Vn.findYearClosestToRef=Vn.findMostLikelyADYear=void 0;var aE=sE(ve());function oE(r){return r<100&&(r>50?r=r+1900:r=r+2e3),r}Vn.findMostLikelyADYear=oE;function uE(r,e,t){let n=aE.default(r),i=n;i=i.month(t-1),i=i.date(e),i=i.year(n.year());let s=i.add(1,"y"),a=i.add(-1,"y");return Math.abs(s.diff(n))<Math.abs(i.diff(n))?i=s:Math.abs(a.diff(n))<Math.abs(i.diff(n))&&(i=a),i.year()}Vn.findYearClosestToRef=uE});var dt=k(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.parseTimeUnits=ce.TIME_UNITS_PATTERN=ce.parseYear=ce.YEAR_PATTERN=ce.parseOrdinalNumberPattern=ce.ORDINAL_NUMBER_PATTERN=ce.parseNumberPattern=ce.NUMBER_PATTERN=ce.TIME_UNIT_DICTIONARY=ce.ORDINAL_WORD_DICTIONARY=ce.INTEGER_WORD_DICTIONARY=ce.MONTH_DICTIONARY=ce.FULL_MONTH_NAME_DICTIONARY=ce.WEEKDAY_DICTIONARY=void 0;var Jo=Re(),lE=ct();ce.WEEKDAY_DICTIONARY={sunday:0,sun:0,"sun.":0,monday:1,mon:1,"mon.":1,tuesday:2,tue:2,"tue.":2,wednesday:3,wed:3,"wed.":3,thursday:4,thurs:4,"thurs.":4,thur:4,"thur.":4,thu:4,"thu.":4,friday:5,fri:5,"fri.":5,saturday:6,sat:6,"sat.":6};ce.FULL_MONTH_NAME_DICTIONARY={january:1,february:2,march:3,april:4,may:5,june:6,july:7,august:8,september:9,october:10,november:11,december:12};ce.MONTH_DICTIONARY=Object.assign(Object.assign({},ce.FULL_MONTH_NAME_DICTIONARY),{jan:1,"jan.":1,feb:2,"feb.":2,mar:3,"mar.":3,apr:4,"apr.":4,jun:6,"jun.":6,jul:7,"jul.":7,aug:8,"aug.":8,sep:9,"sep.":9,sept:9,"sept.":9,oct:10,"oct.":10,nov:11,"nov.":11,dec:12,"dec.":12});ce.INTEGER_WORD_DICTIONARY={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12};ce.ORDINAL_WORD_DICTIONARY={first:1,second:2,third:3,fourth:4,fifth:5,sixth:6,seventh:7,eighth:8,ninth:9,tenth:10,eleventh:11,twelfth:12,thirteenth:13,fourteenth:14,fifteenth:15,sixteenth:16,seventeenth:17,eighteenth:18,nineteenth:19,twentieth:20,"twenty first":21,"twenty-first":21,"twenty second":22,"twenty-second":22,"twenty third":23,"twenty-third":23,"twenty fourth":24,"twenty-fourth":24,"twenty fifth":25,"twenty-fifth":25,"twenty sixth":26,"twenty-sixth":26,"twenty seventh":27,"twenty-seventh":27,"twenty eighth":28,"twenty-eighth":28,"twenty ninth":29,"twenty-ninth":29,thirtieth:30,"thirty first":31,"thirty-first":31};ce.TIME_UNIT_DICTIONARY={sec:"second",second:"second",seconds:"second",min:"minute",mins:"minute",minute:"minute",minutes:"minute",h:"hour",hr:"hour",hrs:"hour",hour:"hour",hours:"hour",day:"d",days:"d",week:"week",weeks:"week",month:"month",months:"month",qtr:"quarter",quarter:"quarter",quarters:"quarter",y:"year",yr:"year",year:"year",years:"year"};ce.NUMBER_PATTERN=`(?:${Jo.matchAnyPattern(ce.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|half(?:\\s{0,2}an?)?|an?\\b(?:\\s{0,2}few)?|few|several|a?\\s{0,2}couple\\s{0,2}(?:of)?)`;function Vh(r){let e=r.toLowerCase();return ce.INTEGER_WORD_DICTIONARY[e]!==void 0?ce.INTEGER_WORD_DICTIONARY[e]:e==="a"||e==="an"?1:e.match(/few/)?3:e.match(/half/)?.5:e.match(/couple/)?2:e.match(/several/)?7:parseFloat(e)}ce.parseNumberPattern=Vh;ce.ORDINAL_NUMBER_PATTERN=`(?:${Jo.matchAnyPattern(ce.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:st|nd|rd|th)?)`;function cE(r){let e=r.toLowerCase();return ce.ORDINAL_WORD_DICTIONARY[e]!==void 0?ce.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:st|nd|rd|th)$/i,""),parseInt(e))}ce.parseOrdinalNumberPattern=cE;ce.YEAR_PATTERN="(?:[1-9][0-9]{0,3}\\s{0,2}(?:BE|AD|BC|BCE|CE)|[1-2][0-9]{3}|[5-9][0-9])";function dE(r){if(/BE/i.test(r))return r=r.replace(/BE/i,""),parseInt(r)-543;if(/BCE?/i.test(r))return r=r.replace(/BCE?/i,""),-parseInt(r);if(/(AD|CE)/i.test(r))return r=r.replace(/(AD|CE)/i,""),parseInt(r);let e=parseInt(r);return lE.findMostLikelyADYear(e)}ce.parseYear=dE;var zh=`(${ce.NUMBER_PATTERN})\\s{0,3}(${Jo.matchAnyPattern(ce.TIME_UNIT_DICTIONARY)})`,Hh=new RegExp(zh,"i");ce.TIME_UNITS_PATTERN=Jo.repeatedTimeunitPattern("(?:(?:about|around)\\s{0,3})?",zh);function fE(r){let e={},t=r,n=Hh.exec(t);for(;n;)pE(e,n),t=t.substring(n[0].length).trim(),n=Hh.exec(t);return e}ce.parseTimeUnits=fE;function pE(r,e){let t=Vh(e[1]),n=ce.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var Kh=k((Oc,Dc)=>{(function(r,e){typeof Oc=="object"&&typeof Dc!="undefined"?Dc.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis!="undefined"?globalThis:r||self).dayjs_plugin_quarterOfYear=e()})(Oc,function(){"use strict";var r="month",e="quarter";return function(t,n){var i=n.prototype;i.quarter=function(o){return this.$utils().u(o)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(o-1))};var s=i.add;i.add=function(o,u){return o=Number(o),this.$utils().p(u)===e?this.add(3*o,r):s.bind(this)(o,u)};var a=i.startOf;i.startOf=function(o,u){var l=this.$utils(),c=!!l.u(u)||u;if(l.p(o)===e){var d=this.quarter()-1;return c?this.month(3*d).startOf(r).startOf("day"):this.month(3*d+2).endOf(r).endOf("day")}return a.bind(this)(o,u)}}})});var cr=k(Hr=>{"use strict";Object.defineProperty(Hr,"__esModule",{value:!0});Hr.implySimilarTime=Hr.assignSimilarTime=Hr.assignSimilarDate=Hr.assignTheNextDay=void 0;var Qh=Xe();function mE(r,e){e=e.add(1,"day"),Xh(r,e),Zh(r,e)}Hr.assignTheNextDay=mE;function Xh(r,e){r.assign("day",e.date()),r.assign("month",e.month()+1),r.assign("year",e.year())}Hr.assignSimilarDate=Xh;function hE(r,e){r.assign("hour",e.hour()),r.assign("minute",e.minute()),r.assign("second",e.second()),r.assign("millisecond",e.millisecond()),r.get("hour")<12?r.assign("meridiem",Qh.Meridiem.AM):r.assign("meridiem",Qh.Meridiem.PM)}Hr.assignSimilarTime=hE;function Zh(r,e){r.imply("hour",e.hour()),r.imply("minute",e.minute()),r.imply("second",e.second()),r.imply("millisecond",e.millisecond())}Hr.implySimilarTime=Zh});var Jh=k(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.toTimezoneOffset=gi.TIMEZONE_ABBR_MAP=void 0;gi.TIMEZONE_ABBR_MAP={ACDT:630,ACST:570,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,ALMT:360,AMST:-180,AMT:-240,ANAST:720,ANAT:720,AQTT:300,ART:-180,AST:-240,AWDT:540,AWST:480,AZOST:0,AZOT:-60,AZST:300,AZT:240,BNT:480,BOT:-240,BRST:-120,BRT:-180,BST:60,BTT:360,CAST:480,CAT:120,CCT:390,CDT:-300,CEST:120,CET:60,CHADT:825,CHAST:765,CKT:-600,CLST:-180,CLT:-240,COT:-300,CST:-360,CVT:-60,CXT:420,ChST:600,DAVT:420,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEST:180,EET:120,EGST:0,EGT:-60,EST:-300,ET:-300,FJST:780,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GMT:0,GST:240,GYT:-240,HAA:-180,HAC:-300,HADT:-540,HAE:-240,HAP:-420,HAR:-360,HAST:-600,HAT:-90,HAY:-480,HKT:480,HLV:-210,HNA:-240,HNC:-360,HNE:-300,HNP:-480,HNR:-420,HNT:-150,HNY:-540,HOVT:420,ICT:420,IDT:180,IOT:360,IRDT:270,IRKST:540,IRKT:540,IRST:210,IST:330,JST:540,KGT:360,KRAST:480,KRAT:480,KST:540,KUYT:240,LHDT:660,LHST:630,LINT:840,MAGST:720,MAGT:720,MART:-510,MAWT:300,MDT:-360,MESZ:120,MEZ:60,MHT:720,MMT:390,MSD:240,MSK:180,MST:-420,MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:690,NOVST:420,NOVT:360,NPT:345,NST:-150,NUT:-660,NZDT:780,NZST:720,OMSST:420,OMST:420,PDT:-420,PET:-300,PETST:720,PETT:720,PGT:600,PHOT:780,PHT:480,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PT:-480,PWT:540,PYST:-180,PYT:-240,RET:240,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SRT:-180,SST:-660,TAHT:-600,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TVT:720,ULAT:480,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-210,VLAST:660,VLAT:660,VUT:660,WAST:120,WAT:60,WEST:60,WESZ:60,WET:0,WEZ:0,WFT:720,WGST:-120,WGT:-180,WIB:420,WIT:540,WITA:480,WST:780,WT:0,YAKST:600,YAKT:600,YAPT:600,YEKST:360,YEKT:360};function gE(r){var e;return r==null?null:typeof r=="number"?r:(e=gi.TIMEZONE_ABBR_MAP[r])!==null&&e!==void 0?e:null}gi.toTimezoneOffset=gE});var We=k(Vr=>{"use strict";var eg=Vr&&Vr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Vr,"__esModule",{value:!0});Vr.ParsingResult=Vr.ParsingComponents=Vr.ReferenceWithTimezone=void 0;var yE=eg(Kh()),eu=eg(ve()),xc=cr(),bE=Jh();eu.default.extend(yE.default);var Rc=class{constructor(e){var t;e=e!=null?e:new Date,e instanceof Date?this.instant=e:(this.instant=(t=e.instant)!==null&&t!==void 0?t:new Date,this.timezoneOffset=bE.toTimezoneOffset(e.timezone))}};Vr.ReferenceWithTimezone=Rc;var yi=class{constructor(e,t){if(this.reference=e,this.knownValues={},this.impliedValues={},t)for(let i in t)this.knownValues[i]=t[i];let n=eu.default(e.instant);this.imply("day",n.date()),this.imply("month",n.month()+1),this.imply("year",n.year()),this.imply("hour",12),this.imply("minute",0),this.imply("second",0),this.imply("millisecond",0)}get(e){return e in this.knownValues?this.knownValues[e]:e in this.impliedValues?this.impliedValues[e]:null}isCertain(e){return e in this.knownValues}getCertainComponents(){return Object.keys(this.knownValues)}imply(e,t){return e in this.knownValues?this:(this.impliedValues[e]=t,this)}assign(e,t){return this.knownValues[e]=t,delete this.impliedValues[e],this}delete(e){delete this.knownValues[e],delete this.impliedValues[e]}clone(){let e=new yi(this.reference);e.knownValues={},e.impliedValues={};for(let t in this.knownValues)e.knownValues[t]=this.knownValues[t];for(let t in this.impliedValues)e.impliedValues[t]=this.impliedValues[t];return e}isOnlyDate(){return!this.isCertain("hour")&&!this.isCertain("minute")&&!this.isCertain("second")}isOnlyTime(){return!this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")}isOnlyWeekdayComponent(){return this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")}isOnlyDayMonthComponent(){return this.isCertain("day")&&this.isCertain("month")&&!this.isCertain("year")}isValidDate(){let e=this.dateWithoutTimezoneAdjustment();return!(e.getFullYear()!==this.get("year")||e.getMonth()!==this.get("month")-1||e.getDate()!==this.get("day")||this.get("hour")!=null&&e.getHours()!=this.get("hour")||this.get("minute")!=null&&e.getMinutes()!=this.get("minute"))}toString(){return`[ParsingComponents {knownValues: ${JSON.stringify(this.knownValues)}, impliedValues: ${JSON.stringify(this.impliedValues)}}, reference: ${JSON.stringify(this.reference)}]`}dayjs(){return eu.default(this.date())}date(){let e=this.dateWithoutTimezoneAdjustment();return new Date(e.getTime()+this.getSystemTimezoneAdjustmentMinute(e)*6e4)}dateWithoutTimezoneAdjustment(){let e=new Date(this.get("year"),this.get("month")-1,this.get("day"),this.get("hour"),this.get("minute"),this.get("second"),this.get("millisecond"));return e.setFullYear(this.get("year")),e}getSystemTimezoneAdjustmentMinute(e){var t,n;(!e||e.getTime()<0)&&(e=new Date);let i=-e.getTimezoneOffset(),s=(n=(t=this.get("timezoneOffset"))!==null&&t!==void 0?t:this.reference.timezoneOffset)!==null&&n!==void 0?n:i;return i-s}static createRelativeFromReference(e,t){let n=eu.default(e.instant);for(let s in t)n=n.add(t[s],s);let i=new yi(e);return t.hour||t.minute||t.second?(xc.assignSimilarTime(i,n),xc.assignSimilarDate(i,n),e.timezoneOffset!==null&&i.assign("timezoneOffset",-e.instant.getTimezoneOffset())):(xc.implySimilarTime(i,n),e.timezoneOffset!==null&&i.imply("timezoneOffset",-e.instant.getTimezoneOffset()),t.d?(i.assign("day",n.date()),i.assign("month",n.month()+1),i.assign("year",n.year())):(t.week&&i.imply("weekday",n.day()),i.imply("day",n.date()),t.month?(i.assign("month",n.month()+1),i.assign("year",n.year())):(i.imply("month",n.month()+1),t.year?i.assign("year",n.year()):i.imply("year",n.year())))),i}};Vr.ParsingComponents=yi;var ma=class{constructor(e,t,n,i,s){this.reference=e,this.refDate=e.instant,this.index=t,this.text=n,this.start=i||new yi(e),this.end=s}clone(){let e=new ma(this.reference,this.index,this.text);return e.start=this.start?this.start.clone():null,e.end=this.end?this.end.clone():null,e}date(){return this.start.date()}toString(){return`[ParsingResult {index: ${this.index}, text: '${this.text}', ...}]`}};Vr.ParsingResult=ma});var Y=k(tu=>{"use strict";Object.defineProperty(tu,"__esModule",{value:!0});tu.AbstractParserWithWordBoundaryChecking=void 0;var Mc=class{constructor(){this.cachedInnerPattern=null,this.cachedPattern=null}patternLeftBoundary(){return"(\\W|^)"}pattern(e){let t=this.innerPattern(e);return t==this.cachedInnerPattern?this.cachedPattern:(this.cachedPattern=new RegExp(`${this.patternLeftBoundary()}${t.source}`,t.flags),this.cachedInnerPattern=t,this.cachedPattern)}extract(e,t){var n;let i=(n=t[1])!==null&&n!==void 0?n:"";t.index=t.index+i.length,t[0]=t[0].substring(i.length);for(let s=2;s<t.length;s++)t[s-1]=t[s];return this.innerExtract(e,t)}};tu.AbstractParserWithWordBoundaryChecking=Mc});var tg=k(Pc=>{"use strict";Object.defineProperty(Pc,"__esModule",{value:!0});var Ac=dt(),TE=We(),_E=Y(),vE=new RegExp(`(?:within|in|for)\\s*(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${Ac.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),wE=new RegExp(`(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${Ac.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),Cc=class extends _E.AbstractParserWithWordBoundaryChecking{innerPattern(e){return e.option.forwardDate?wE:vE}innerExtract(e,t){let n=Ac.parseTimeUnits(t[1]);return TE.ParsingComponents.createRelativeFromReference(e.reference,n)}};Pc.default=Cc});var og=k(Ic=>{"use strict";Object.defineProperty(Ic,"__esModule",{value:!0});var kE=ct(),sg=dt(),ag=dt(),ru=dt(),EE=Re(),SE=Y(),OE=new RegExp(`(?:on\\s{0,3})?(${ru.ORDINAL_NUMBER_PATTERN})(?:\\s{0,3}(?:to|\\-|\\\u2013|until|through|till)?\\s{0,3}(${ru.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s{0,3}(?:of)?\\s{0,3})(${EE.matchAnyPattern(sg.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s{0,3})(${ag.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),rg=1,ng=2,DE=3,ig=4,Nc=class extends SE.AbstractParserWithWordBoundaryChecking{innerPattern(){return OE}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=sg.MONTH_DICTIONARY[t[DE].toLowerCase()],s=ru.parseOrdinalNumberPattern(t[rg]);if(s>31)return t.index=t.index+t[rg].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[ig]){let a=ag.parseYear(t[ig]);n.start.assign("year",a)}else{let a=kE.findYearClosestToRef(e.refDate,s,i);n.start.imply("year",a)}if(t[ng]){let a=ru.parseOrdinalNumberPattern(t[ng]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};Ic.default=Nc});var fg=k(Lc=>{"use strict";Object.defineProperty(Lc,"__esModule",{value:!0});var xE=ct(),cg=dt(),nu=dt(),dg=dt(),RE=Re(),ME=Y(),CE=new RegExp(`(${RE.matchAnyPattern(cg.MONTH_DICTIONARY)})(?:-|/|\\s*,?\\s*)(${nu.ORDINAL_NUMBER_PATTERN})(?!\\s*(?:am|pm))\\s*(?:(?:to|\\-)\\s*(${nu.ORDINAL_NUMBER_PATTERN})\\s*)?(?:(?:-|/|\\s*,?\\s*)(${dg.YEAR_PATTERN}))?(?=\\W|$)(?!\\:\\d)`,"i"),AE=1,PE=2,ug=3,lg=4,Fc=class extends ME.AbstractParserWithWordBoundaryChecking{innerPattern(){return CE}innerExtract(e,t){let n=cg.MONTH_DICTIONARY[t[AE].toLowerCase()],i=nu.parseOrdinalNumberPattern(t[PE]);if(i>31)return null;let s=e.createParsingComponents({day:i,month:n});if(t[lg]){let u=dg.parseYear(t[lg]);s.assign("year",u)}else{let u=xE.findYearClosestToRef(e.refDate,i,n);s.imply("year",u)}if(!t[ug])return s;let a=nu.parseOrdinalNumberPattern(t[ug]),o=e.createParsingResult(t.index,t[0]);return o.start=s,o.end=s.clone(),o.end.assign("day",a),o}};Lc.default=Fc});var hg=k(qc=>{"use strict";Object.defineProperty(qc,"__esModule",{value:!0});var Uc=dt(),NE=ct(),IE=Re(),mg=dt(),FE=Y(),LE=new RegExp(`((?:in)\\s*)?(${IE.matchAnyPattern(Uc.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${mg.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),UE=1,WE=2,pg=3,Wc=class extends FE.AbstractParserWithWordBoundaryChecking{innerPattern(){return LE}innerExtract(e,t){let n=t[WE].toLowerCase();if(t[0].length<=3&&!Uc.FULL_MONTH_NAME_DICTIONARY[n])return null;let i=e.createParsingResult(t.index+(t[UE]||"").length,t.index+t[0].length);i.start.imply("day",1);let s=Uc.MONTH_DICTIONARY[n];if(i.start.assign("month",s),t[pg]){let a=mg.parseYear(t[pg]);i.start.assign("year",a)}else{let a=NE.findYearClosestToRef(e.refDate,1,s);i.start.imply("year",a)}return i}};qc.default=Wc});var bg=k(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});var yg=dt(),qE=Re(),$E=Y(),jE=new RegExp(`([0-9]{4})[\\.\\/\\s](?:(${qE.matchAnyPattern(yg.MONTH_DICTIONARY)})|([0-9]{1,2}))[\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),GE=1,YE=2,gg=3,BE=4,$c=class extends $E.AbstractParserWithWordBoundaryChecking{innerPattern(){return jE}innerExtract(e,t){let n=t[gg]?parseInt(t[gg]):yg.MONTH_DICTIONARY[t[YE].toLowerCase()];if(n<1||n>12)return null;let i=parseInt(t[GE]);return{day:parseInt(t[BE]),month:n,year:i}}};jc.default=$c});var Tg=k(Yc=>{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});var HE=Y(),VE=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),zE=1,KE=2,Gc=class extends HE.AbstractParserWithWordBoundaryChecking{innerPattern(){return VE}innerExtract(e,t){let n=parseInt(t[KE]),i=parseInt(t[zE]);return e.createParsingComponents().imply("day",1).assign("month",i).assign("year",n)}};Yc.default=Gc});var bi=k(au=>{"use strict";Object.defineProperty(au,"__esModule",{value:!0});au.AbstractTimeExpressionParser=void 0;var xt=Xe();function QE(r,e,t,n){return new RegExp(`${r}${e}(\\d{1,4})(?:(?:\\.|:|\uFF1A)(\\d{1,2})(?:(?::|\uFF1A)(\\d{2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${t}`,n)}function XE(r,e){return new RegExp(`^(${r})(\\d{1,4})(?:(?:\\.|\\:|\\\uFF1A)(\\d{1,2})(?:(?:\\.|\\:|\\\uFF1A)(\\d{1,2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${e}`,"i")}var _g=2,ts=3,iu=4,su=5,ha=6,Bc=class{constructor(e=!1){this.cachedPrimaryPrefix=null,this.cachedPrimarySuffix=null,this.cachedPrimaryTimePattern=null,this.cachedFollowingPhase=null,this.cachedFollowingSuffix=null,this.cachedFollowingTimePatten=null,this.strictMode=e}patternFlags(){return"i"}primaryPatternLeftBoundary(){return"(^|\\s|T|\\b)"}primarySuffix(){return"(?=\\W|$)"}followingSuffix(){return"(?=\\W|$)"}pattern(e){return this.getPrimaryTimePatternThroughCache()}extract(e,t){let n=this.extractPrimaryTimeComponents(e,t);if(!n)return t.index+=t[0].length,null;let i=t.index+t[1].length,s=t[0].substring(t[1].length),a=e.createParsingResult(i,s,n);t.index+=t[0].length;let o=e.text.substring(t.index),l=this.getFollowingTimePatternThroughCache().exec(o);return s.match(/^\d{3,4}/)&&l&&l[0].match(/^\s*([+-])\s*\d{2,4}$/)?null:!l||l[0].match(/^\s*([+-])\s*\d{3,4}$/)?this.checkAndReturnWithoutFollowingPattern(a):(a.end=this.extractFollowingTimeComponents(e,l,a),a.end&&(a.text+=l[0]),this.checkAndReturnWithFollowingPattern(a))}extractPrimaryTimeComponents(e,t,n=!1){let i=e.createParsingComponents(),s=0,a=null,o=parseInt(t[_g]);if(o>100){if(this.strictMode||t[ts]!=null)return null;s=o%100,o=Math.floor(o/100)}if(o>24)return null;if(t[ts]!=null){if(t[ts].length==1&&!t[ha])return null;s=parseInt(t[ts])}if(s>=60)return null;if(o>12&&(a=xt.Meridiem.PM),t[ha]!=null){if(o>12)return null;let u=t[ha][0].toLowerCase();u=="a"&&(a=xt.Meridiem.AM,o==12&&(o=0)),u=="p"&&(a=xt.Meridiem.PM,o!=12&&(o+=12))}if(i.assign("hour",o),i.assign("minute",s),a!==null?i.assign("meridiem",a):o<12?i.imply("meridiem",xt.Meridiem.AM):i.imply("meridiem",xt.Meridiem.PM),t[su]!=null){let u=parseInt(t[su].substring(0,3));if(u>=1e3)return null;i.assign("millisecond",u)}if(t[iu]!=null){let u=parseInt(t[iu]);if(u>=60)return null;i.assign("second",u)}return i}extractFollowingTimeComponents(e,t,n){let i=e.createParsingComponents();if(t[su]!=null){let u=parseInt(t[su].substring(0,3));if(u>=1e3)return null;i.assign("millisecond",u)}if(t[iu]!=null){let u=parseInt(t[iu]);if(u>=60)return null;i.assign("second",u)}let s=parseInt(t[_g]),a=0,o=-1;if(t[ts]!=null?a=parseInt(t[ts]):s>100&&(a=s%100,s=Math.floor(s/100)),a>=60||s>24)return null;if(s>=12&&(o=xt.Meridiem.PM),t[ha]!=null){if(s>12)return null;let u=t[ha][0].toLowerCase();u=="a"&&(o=xt.Meridiem.AM,s==12&&(s=0,i.isCertain("day")||i.imply("day",i.get("day")+1))),u=="p"&&(o=xt.Meridiem.PM,s!=12&&(s+=12)),n.start.isCertain("meridiem")||(o==xt.Meridiem.AM?(n.start.imply("meridiem",xt.Meridiem.AM),n.start.get("hour")==12&&n.start.assign("hour",0)):(n.start.imply("meridiem",xt.Meridiem.PM),n.start.get("hour")!=12&&n.start.assign("hour",n.start.get("hour")+12)))}return i.assign("hour",s),i.assign("minute",a),o>=0?i.assign("meridiem",o):n.start.isCertain("meridiem")&&n.start.get("hour")>12?n.start.get("hour")-12>s?i.imply("meridiem",xt.Meridiem.AM):s<=12&&(i.assign("hour",s+12),i.assign("meridiem",xt.Meridiem.PM)):s>12?i.imply("meridiem",xt.Meridiem.PM):s<=12&&i.imply("meridiem",xt.Meridiem.AM),i.date().getTime()<n.start.date().getTime()&&i.imply("day",i.get("day")+1),i}checkAndReturnWithoutFollowingPattern(e){if(e.text.match(/^\d$/)||e.text.match(/^\d\d\d+$/)||e.text.match(/\d[apAP]$/))return null;let t=e.text.match(/[^\d:.](\d[\d.]+)$/);if(t){let n=t[1];if(this.strictMode||n.includes(".")&&!n.match(/\d(\.\d{2})+$/)||parseInt(n)>24)return null}return e}checkAndReturnWithFollowingPattern(e){if(e.text.match(/^\d+-\d+$/))return null;let t=e.text.match(/[^\d:.](\d[\d.]+)\s*-\s*(\d[\d.]+)$/);if(t){if(this.strictMode)return null;let n=t[1],i=t[2];if(i.includes(".")&&!i.match(/\d(\.\d{2})+$/))return null;let s=parseInt(i),a=parseInt(n);if(s>24||a>24)return null}return e}getPrimaryTimePatternThroughCache(){let e=this.primaryPrefix(),t=this.primarySuffix();return this.cachedPrimaryPrefix===e&&this.cachedPrimarySuffix===t?this.cachedPrimaryTimePattern:(this.cachedPrimaryTimePattern=QE(this.primaryPatternLeftBoundary(),e,t,this.patternFlags()),this.cachedPrimaryPrefix=e,this.cachedPrimarySuffix=t,this.cachedPrimaryTimePattern)}getFollowingTimePatternThroughCache(){let e=this.followingPhase(),t=this.followingSuffix();return this.cachedFollowingPhase===e&&this.cachedFollowingSuffix===t?this.cachedFollowingTimePatten:(this.cachedFollowingTimePatten=XE(e,t),this.cachedFollowingPhase=e,this.cachedFollowingSuffix=t,this.cachedFollowingTimePatten)}};au.AbstractTimeExpressionParser=Bc});var vg=k(Vc=>{"use strict";Object.defineProperty(Vc,"__esModule",{value:!0});var ou=Xe(),ZE=bi(),Hc=class extends ZE.AbstractTimeExpressionParser{constructor(e){super(e)}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|to|\\?)\\s*"}primaryPrefix(){return"(?:(?:at|from)\\s*)??"}primarySuffix(){return"(?:\\s*(?:o\\W*clock|at\\s*night|in\\s*the\\s*(?:morning|afternoon)))?(?!/)(?=\\W|$)"}extractPrimaryTimeComponents(e,t){let n=super.extractPrimaryTimeComponents(e,t);if(n){if(t[0].endsWith("night")){let i=n.get("hour");i>=6&&i<12?(n.assign("hour",n.get("hour")+12),n.assign("meridiem",ou.Meridiem.PM)):i<6&&n.assign("meridiem",ou.Meridiem.AM)}if(t[0].endsWith("afternoon")){n.assign("meridiem",ou.Meridiem.PM);let i=n.get("hour");i>=0&&i<=6&&n.assign("hour",n.get("hour")+12)}t[0].endsWith("morning")&&(n.assign("meridiem",ou.Meridiem.AM),n.get("hour")<12&&n.assign("hour",n.get("hour")))}return n}};Vc.default=Hc});var dr=k(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.addImpliedTimeUnits=rs.reverseTimeUnits=void 0;function JE(r){let e={};for(let t in r)e[t]=-r[t];return e}rs.reverseTimeUnits=JE;function eS(r,e){let t=r.clone(),n=r.dayjs();for(let i in e)n=n.add(e[i],i);return("day"in e||"d"in e||"week"in e||"month"in e||"year"in e)&&(t.imply("day",n.date()),t.imply("month",n.month()+1),t.imply("year",n.year())),("second"in e||"minute"in e||"hour"in e)&&(t.imply("second",n.second()),t.imply("minute",n.minute()),t.imply("hour",n.hour())),t}rs.addImpliedTimeUnits=eS});var wg=k(Qc=>{"use strict";Object.defineProperty(Qc,"__esModule",{value:!0});var Kc=dt(),tS=We(),rS=Y(),nS=dr(),iS=new RegExp(`(${Kc.TIME_UNITS_PATTERN})\\s{0,5}(?:ago|before|earlier)(?=(?:\\W|$))`,"i"),sS=new RegExp(`(${Kc.TIME_UNITS_PATTERN})\\s{0,5}ago(?=(?:\\W|$))`,"i"),zc=class extends rS.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?sS:iS}innerExtract(e,t){let n=Kc.parseTimeUnits(t[1]),i=nS.reverseTimeUnits(n);return tS.ParsingComponents.createRelativeFromReference(e.reference,i)}};Qc.default=zc});var kg=k(Jc=>{"use strict";Object.defineProperty(Jc,"__esModule",{value:!0});var Zc=dt(),aS=We(),oS=Y(),uS=new RegExp(`(${Zc.TIME_UNITS_PATTERN})\\s{0,5}(?:later|after|from now|henceforth|forward|out)(?=(?:\\W|$))`,"i"),lS=new RegExp("("+Zc.TIME_UNITS_PATTERN+")(later|from now)(?=(?:\\W|$))","i"),cS=1,Xc=class extends oS.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?lS:uS}innerExtract(e,t){let n=Zc.parseTimeUnits(t[cS]);return aS.ParsingComponents.createRelativeFromReference(e.reference,n)}};Jc.default=Xc});var is=k(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.MergingRefiner=ns.Filter=void 0;var ed=class{refine(e,t){return t.filter(n=>this.isValid(e,n))}};ns.Filter=ed;var td=class{refine(e,t){if(t.length<2)return t;let n=[],i=t[0],s=null;for(let a=1;a<t.length;a++){s=t[a];let o=e.text.substring(i.index+i.text.length,s.index);if(!this.shouldMergeResults(o,i,s,e))n.push(i),i=s;else{let u=i,l=s,c=this.mergeResults(o,u,l,e);e.debug(()=>{console.log(`${this.constructor.name} merged ${u} and ${l} into ${c}`)}),i=c}}return i!=null&&n.push(i),n}};ns.MergingRefiner=td});var zr=k(nd=>{"use strict";Object.defineProperty(nd,"__esModule",{value:!0});var dS=is(),rd=class extends dS.MergingRefiner{shouldMergeResults(e,t,n){return!t.end&&!n.end&&e.match(this.patternBetween())!=null}mergeResults(e,t,n){if(!t.start.isOnlyWeekdayComponent()&&!n.start.isOnlyWeekdayComponent()&&(n.start.getCertainComponents().forEach(s=>{t.start.isCertain(s)||t.start.assign(s,n.start.get(s))}),t.start.getCertainComponents().forEach(s=>{n.start.isCertain(s)||n.start.assign(s,t.start.get(s))})),t.start.date().getTime()>n.start.date().getTime()){let s=t.start.dayjs(),a=n.start.dayjs();t.start.isOnlyWeekdayComponent()&&s.add(-7,"days").isBefore(a)?(s=s.add(-7,"days"),t.start.imply("day",s.date()),t.start.imply("month",s.month()+1),t.start.imply("year",s.year())):n.start.isOnlyWeekdayComponent()&&a.add(7,"days").isAfter(s)?(a=a.add(7,"days"),n.start.imply("day",a.date()),n.start.imply("month",a.month()+1),n.start.imply("year",a.year())):[n,t]=[t,n]}let i=t.clone();return i.start=t.start,i.end=n.start,i.index=Math.min(t.index,n.index),t.index<n.index?i.text=t.text+e+n.text:i.text=n.text+e+t.text,i}};nd.default=rd});var Eg=k(ga=>{"use strict";var fS=ga&&ga.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ga,"__esModule",{value:!0});var pS=fS(zr()),id=class extends pS.default{patternBetween(){return/^\s*(to|-)\s*$/i}};ga.default=id});var Sg=k(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.mergeDateTimeComponent=ss.mergeDateTimeResult=void 0;var mS=Xe();function hS(r,e){let t=r.clone(),n=r.start,i=e.start;if(t.start=sd(n,i),r.end!=null||e.end!=null){let s=r.end==null?r.start:r.end,a=e.end==null?e.start:e.end,o=sd(s,a);r.end==null&&o.date().getTime()<t.start.date().getTime()&&(o.isCertain("day")?o.assign("day",o.get("day")+1):o.imply("day",o.get("day")+1)),t.end=o}return t}ss.mergeDateTimeResult=hS;function sd(r,e){let t=r.clone();return e.isCertain("hour")?(t.assign("hour",e.get("hour")),t.assign("minute",e.get("minute")),e.isCertain("second")?(t.assign("second",e.get("second")),e.isCertain("millisecond")?t.assign("millisecond",e.get("millisecond")):t.imply("millisecond",e.get("millisecond"))):(t.imply("second",e.get("second")),t.imply("millisecond",e.get("millisecond")))):(t.imply("hour",e.get("hour")),t.imply("minute",e.get("minute")),t.imply("second",e.get("second")),t.imply("millisecond",e.get("millisecond"))),e.isCertain("timezoneOffset")&&t.assign("timezoneOffset",e.get("timezoneOffset")),e.isCertain("meridiem")?t.assign("meridiem",e.get("meridiem")):e.get("meridiem")!=null&&t.get("meridiem")==null&&t.imply("meridiem",e.get("meridiem")),t.get("meridiem")==mS.Meridiem.PM&&t.get("hour")<12&&(e.isCertain("hour")?t.assign("hour",t.get("hour")+12):t.imply("hour",t.get("hour")+12)),t}ss.mergeDateTimeComponent=sd});var gn=k(od=>{"use strict";Object.defineProperty(od,"__esModule",{value:!0});var gS=is(),Og=Sg(),ad=class extends gS.MergingRefiner{shouldMergeResults(e,t,n){return(t.start.isOnlyDate()&&n.start.isOnlyTime()||n.start.isOnlyDate()&&t.start.isOnlyTime())&&e.match(this.patternBetween())!=null}mergeResults(e,t,n){let i=t.start.isOnlyDate()?Og.mergeDateTimeResult(t,n):Og.mergeDateTimeResult(n,t);return i.index=t.index,i.text=t.text+e+n.text,i}};od.default=ad});var Dg=k(ya=>{"use strict";var yS=ya&&ya.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ya,"__esModule",{value:!0});var bS=yS(gn()),ud=class extends bS.default{patternBetween(){return new RegExp("^\\s*(T|at|after|before|on|of|,|-)?\\s*$")}};ya.default=ud});var xg=k(cd=>{"use strict";Object.defineProperty(cd,"__esModule",{value:!0});var TS=new RegExp("^\\s*,?\\s*\\(?([A-Z]{2,4})\\)?(?=\\W|$)","i"),_S={ACDT:630,ACST:570,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,ALMT:360,AMST:-180,AMT:-240,ANAST:720,ANAT:720,AQTT:300,ART:-180,AST:-240,AWDT:540,AWST:480,AZOST:0,AZOT:-60,AZST:300,AZT:240,BNT:480,BOT:-240,BRST:-120,BRT:-180,BST:60,BTT:360,CAST:480,CAT:120,CCT:390,CDT:-300,CEST:120,CET:60,CHADT:825,CHAST:765,CKT:-600,CLST:-180,CLT:-240,COT:-300,CST:-360,CVT:-60,CXT:420,ChST:600,DAVT:420,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEST:180,EET:120,EGST:0,EGT:-60,EST:-300,ET:-300,FJST:780,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GMT:0,GST:240,GYT:-240,HAA:-180,HAC:-300,HADT:-540,HAE:-240,HAP:-420,HAR:-360,HAST:-600,HAT:-90,HAY:-480,HKT:480,HLV:-210,HNA:-240,HNC:-360,HNE:-300,HNP:-480,HNR:-420,HNT:-150,HNY:-540,HOVT:420,ICT:420,IDT:180,IOT:360,IRDT:270,IRKST:540,IRKT:540,IRST:210,IST:330,JST:540,KGT:360,KRAST:480,KRAT:480,KST:540,KUYT:240,LHDT:660,LHST:630,LINT:840,MAGST:720,MAGT:720,MART:-510,MAWT:300,MDT:-360,MESZ:120,MEZ:60,MHT:720,MMT:390,MSD:240,MSK:240,MST:-420,MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:690,NOVST:420,NOVT:360,NPT:345,NST:-150,NUT:-660,NZDT:780,NZST:720,OMSST:420,OMST:420,PDT:-420,PET:-300,PETST:720,PETT:720,PGT:600,PHOT:780,PHT:480,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PT:-480,PWT:540,PYST:-180,PYT:-240,RET:240,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SRT:-180,SST:-660,TAHT:-600,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TVT:720,ULAT:480,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-210,VLAST:660,VLAT:660,VUT:660,WAST:120,WAT:60,WEST:60,WESZ:60,WET:0,WEZ:0,WFT:720,WGST:-120,WGT:-180,WIB:420,WIT:540,WITA:480,WST:780,WT:0,YAKST:600,YAKT:600,YAPT:600,YEKST:360,YEKT:360},ld=class{constructor(e){this.timezone=Object.assign(Object.assign({},_S),e)}refine(e,t){var n;let i=(n=e.option.timezones)!==null&&n!==void 0?n:{};return t.forEach(s=>{var a,o;let u=e.text.substring(s.index+s.text.length),l=TS.exec(u);if(!l)return;let c=l[1].toUpperCase(),d=(o=(a=i[c])!==null&&a!==void 0?a:this.timezone[c])!==null&&o!==void 0?o:null;if(d===null)return;e.debug(()=>{console.log(`Extracting timezone: '${c}' into: ${d} for: ${s.start}`)});let f=s.start.get("timezoneOffset");f!==null&&d!=f&&(s.start.isCertain("timezoneOffset")||c!=l[1])||s.start.isOnlyDate()&&c!=l[1]||(s.text+=l[0],s.start.isCertain("timezoneOffset")||s.start.assign("timezoneOffset",d),s.end!=null&&!s.end.isCertain("timezoneOffset")&&s.end.assign("timezoneOffset",d))}),t}};cd.default=ld});var uu=k(fd=>{"use strict";Object.defineProperty(fd,"__esModule",{value:!0});var vS=new RegExp("^\\s*(?:\\(?(?:GMT|UTC)\\s?)?([+-])(\\d{1,2})(?::?(\\d{2}))?\\)?","i"),wS=1,kS=2,ES=3,dd=class{refine(e,t){return t.forEach(function(n){if(n.start.isCertain("timezoneOffset"))return;let i=e.text.substring(n.index+n.text.length),s=vS.exec(i);if(!s)return;e.debug(()=>{console.log(`Extracting timezone: '${s[0]}' into : ${n}`)});let a=parseInt(s[kS]),o=parseInt(s[ES]||"0"),u=a*60+o;u>14*60||(s[wS]==="-"&&(u=-u),n.end!=null&&n.end.assign("timezoneOffset",u),n.start.assign("timezoneOffset",u),n.text+=s[0])}),t}};fd.default=dd});var Rg=k(md=>{"use strict";Object.defineProperty(md,"__esModule",{value:!0});var pd=class{refine(e,t){if(t.length<2)return t;let n=[],i=t[0];for(let s=1;s<t.length;s++){let a=t[s];a.index<i.index+i.text.length?a.text.length>i.text.length&&(i=a):(n.push(i),i=a)}return i!=null&&n.push(i),n}};md.default=pd});var Mg=k(ba=>{"use strict";var SS=ba&&ba.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ba,"__esModule",{value:!0});var OS=SS(ve()),hd=class{refine(e,t){return e.option.forwardDate&&t.forEach(function(n){let i=OS.default(e.refDate);if(n.start.isOnlyDayMonthComponent()&&i.isAfter(n.start.dayjs()))for(let s=0;s<3&&i.isAfter(n.start.dayjs());s++)n.start.imply("year",n.start.get("year")+1),e.debug(()=>{console.log(`Forward yearly adjusted for ${n} (${n.start})`)}),n.end&&!n.end.isCertain("year")&&(n.end.imply("year",n.end.get("year")+1),e.debug(()=>{console.log(`Forward yearly adjusted for ${n} (${n.end})`)}));n.start.isOnlyWeekdayComponent()&&i.isAfter(n.start.dayjs())&&(i.day()>=n.start.get("weekday")?i=i.day(n.start.get("weekday")+7):i=i.day(n.start.get("weekday")),n.start.imply("day",i.date()),n.start.imply("month",i.month()+1),n.start.imply("year",i.year()),e.debug(()=>{console.log(`Forward weekly adjusted for ${n} (${n.start})`)}),n.end&&n.end.isOnlyWeekdayComponent()&&(i.day()>n.end.get("weekday")?i=i.day(n.end.get("weekday")+7):i=i.day(n.end.get("weekday")),n.end.imply("day",i.date()),n.end.imply("month",i.month()+1),n.end.imply("year",i.year()),e.debug(()=>{console.log(`Forward weekly adjusted for ${n} (${n.end})`)})))}),t}};ba.default=hd});var Cg=k(yd=>{"use strict";Object.defineProperty(yd,"__esModule",{value:!0});var DS=is(),gd=class extends DS.Filter{constructor(e){super(),this.strictMode=e}isValid(e,t){return t.text.replace(" ","").match(/^\d*(\.\d*)?$/)?(e.debug(()=>{console.log(`Removing unlikely result '${t.text}'`)}),!1):t.start.isValidDate()?t.end&&!t.end.isValidDate()?(e.debug(()=>{console.log(`Removing invalid result: ${t} (${t.end})`)}),!1):this.strictMode?this.isStrictModeValid(e,t):!0:(e.debug(()=>{console.log(`Removing invalid result: ${t} (${t.start})`)}),!1)}isStrictModeValid(e,t){return t.start.isOnlyWeekdayComponent()?(e.debug(()=>{console.log(`(Strict) Removing weekday only component: ${t} (${t.end})`)}),!1):t.start.isOnlyTime()&&(!t.start.isCertain("hour")||!t.start.isCertain("minute"))?(e.debug(()=>{console.log(`(Strict) Removing uncertain time component: ${t} (${t.end})`)}),!1):!0}};yd.default=gd});var _d=k(Td=>{"use strict";Object.defineProperty(Td,"__esModule",{value:!0});var xS=Y(),RS=new RegExp("([0-9]{4})\\-([0-9]{1,2})\\-([0-9]{1,2})(?:T([0-9]{1,2}):([0-9]{1,2})(?::([0-9]{1,2})(?:\\.(\\d{1,4}))?)?(?:Z|([+-]\\d{2}):?(\\d{2})?)?)?(?=\\W|$)","i"),MS=1,CS=2,AS=3,Ag=4,PS=5,Pg=6,Ng=7,Ig=8,Fg=9,bd=class extends xS.AbstractParserWithWordBoundaryChecking{innerPattern(){return RS}innerExtract(e,t){let n={};if(n.year=parseInt(t[MS]),n.month=parseInt(t[CS]),n.day=parseInt(t[AS]),t[Ag]!=null)if(n.hour=parseInt(t[Ag]),n.minute=parseInt(t[PS]),t[Pg]!=null&&(n.second=parseInt(t[Pg])),t[Ng]!=null&&(n.millisecond=parseInt(t[Ng])),t[Ig]==null)n.timezoneOffset=0;else{let i=parseInt(t[Ig]),s=0;t[Fg]!=null&&(s=parseInt(t[Fg]));let a=i*60;a<0?a-=s:a+=s,n.timezoneOffset=a}return n}};Td.default=bd});var Lg=k(wd=>{"use strict";Object.defineProperty(wd,"__esModule",{value:!0});var NS=is(),vd=class extends NS.MergingRefiner{mergeResults(e,t,n){let i=n.clone();return i.index=t.index,i.text=t.text+e+i.text,i.start.assign("weekday",t.start.get("weekday")),i.end&&i.end.assign("weekday",t.start.get("weekday")),i}shouldMergeResults(e,t,n){return t.start.isOnlyWeekdayComponent()&&!t.start.isCertain("hour")&&n.start.isCertain("day")&&e.match(/^,?\s*$/)!=null}};wd.default=vd});var yn=k(as=>{"use strict";var Ti=as&&as.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(as,"__esModule",{value:!0});as.includeCommonConfiguration=void 0;var IS=Ti(xg()),FS=Ti(uu()),Ug=Ti(Rg()),LS=Ti(Mg()),US=Ti(Cg()),WS=Ti(_d()),qS=Ti(Lg());function $S(r,e=!1){return r.parsers.unshift(new WS.default),r.refiners.unshift(new qS.default),r.refiners.unshift(new IS.default),r.refiners.unshift(new FS.default),r.refiners.unshift(new Ug.default),r.refiners.push(new Ug.default),r.refiners.push(new LS.default),r.refiners.push(new US.default(e)),r}as.includeCommonConfiguration=$S});var Tn=k(Oe=>{"use strict";var jS=Oe&&Oe.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Oe,"__esModule",{value:!0});Oe.noon=Oe.morning=Oe.midnight=Oe.yesterdayEvening=Oe.evening=Oe.lastNight=Oe.tonight=Oe.theDayAfter=Oe.tomorrow=Oe.theDayBefore=Oe.yesterday=Oe.today=Oe.now=void 0;var Kr=We(),os=jS(ve()),bn=cr(),Ta=Xe();function GS(r){let e=os.default(r.instant),t=new Kr.ParsingComponents(r,{});return bn.assignSimilarDate(t,e),bn.assignSimilarTime(t,e),r.timezoneOffset!==null&&t.assign("timezoneOffset",e.utcOffset()),t}Oe.now=GS;function YS(r){let e=os.default(r.instant),t=new Kr.ParsingComponents(r,{});return bn.assignSimilarDate(t,e),bn.implySimilarTime(t,e),t}Oe.today=YS;function BS(r){return Wg(r,1)}Oe.yesterday=BS;function Wg(r,e){return kd(r,-e)}Oe.theDayBefore=Wg;function HS(r){return kd(r,1)}Oe.tomorrow=HS;function kd(r,e){let t=os.default(r.instant),n=new Kr.ParsingComponents(r,{});return t=t.add(e,"day"),bn.assignSimilarDate(n,t),bn.implySimilarTime(n,t),n}Oe.theDayAfter=kd;function VS(r,e=22){let t=os.default(r.instant),n=new Kr.ParsingComponents(r,{});return n.imply("hour",e),n.imply("meridiem",Ta.Meridiem.PM),bn.assignSimilarDate(n,t),n}Oe.tonight=VS;function zS(r,e=0){let t=os.default(r.instant),n=new Kr.ParsingComponents(r,{});return t.hour()<6&&(t=t.add(-1,"day")),bn.assignSimilarDate(n,t),n.imply("hour",e),n}Oe.lastNight=zS;function KS(r,e=20){let t=new Kr.ParsingComponents(r,{});return t.imply("meridiem",Ta.Meridiem.PM),t.imply("hour",e),t}Oe.evening=KS;function QS(r,e=20){let t=os.default(r.instant),n=new Kr.ParsingComponents(r,{});return t=t.add(-1,"day"),bn.assignSimilarDate(n,t),n.imply("hour",e),n.imply("meridiem",Ta.Meridiem.PM),n}Oe.yesterdayEvening=QS;function XS(r){let e=new Kr.ParsingComponents(r,{});return e.imply("hour",0),e.imply("minute",0),e.imply("second",0),e}Oe.midnight=XS;function ZS(r,e=6){let t=new Kr.ParsingComponents(r,{});return t.imply("meridiem",Ta.Meridiem.AM),t.imply("hour",e),t}Oe.morning=ZS;function JS(r){let e=new Kr.ParsingComponents(r,{});return e.imply("meridiem",Ta.Meridiem.AM),e.imply("hour",12),e}Oe.noon=JS});var qg=k(Dr=>{"use strict";var eO=Dr&&Dr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),tO=Dr&&Dr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),rO=Dr&&Dr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&eO(e,r,t);return tO(e,r),e},nO=Dr&&Dr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Dr,"__esModule",{value:!0});var iO=nO(ve()),sO=Y(),aO=cr(),_a=rO(Tn()),oO=/(now|today|tonight|tomorrow|tmr|tmrw|yesterday|last\s*night)(?=\W|$)/i,Ed=class extends sO.AbstractParserWithWordBoundaryChecking{innerPattern(e){return oO}innerExtract(e,t){let n=iO.default(e.refDate),i=t[0].toLowerCase(),s=e.createParsingComponents();switch(i){case"now":return _a.now(e.reference);case"today":return _a.today(e.reference);case"yesterday":return _a.yesterday(e.reference);case"tomorrow":case"tmr":case"tmrw":return _a.tomorrow(e.reference);case"tonight":return _a.tonight(e.reference);default:i.match(/last\s*night/)&&(n.hour()>6&&(n=n.add(-1,"day")),aO.assignSimilarDate(s,n),s.imply("hour",0));break}return s}};Dr.default=Ed});var $g=k(va=>{"use strict";var uO=va&&va.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(va,"__esModule",{value:!0});var lu=Xe(),lO=Y(),cO=uO(ve()),dO=cr(),fO=/(?:this)?\s{0,3}(morning|afternoon|evening|night|midnight|noon)(?=\W|$)/i,Sd=class extends lO.AbstractParserWithWordBoundaryChecking{innerPattern(){return fO}innerExtract(e,t){let n=cO.default(e.refDate),i=e.createParsingComponents();switch(t[1].toLowerCase()){case"afternoon":i.imply("meridiem",lu.Meridiem.PM),i.imply("hour",15);break;case"evening":case"night":i.imply("meridiem",lu.Meridiem.PM),i.imply("hour",20);break;case"midnight":dO.assignTheNextDay(i,n),i.imply("hour",0),i.imply("minute",0),i.imply("second",0);break;case"morning":i.imply("meridiem",lu.Meridiem.AM),i.imply("hour",6);break;case"noon":i.imply("meridiem",lu.Meridiem.AM),i.imply("hour",12);break}return i}};va.default=Sd});var _i=k(zn=>{"use strict";var pO=zn&&zn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(zn,"__esModule",{value:!0});zn.toDayJSClosestWeekday=zn.toDayJSWeekday=void 0;var jg=pO(ve());function mO(r,e,t){if(!t)return Gg(r,e);let n=jg.default(r);switch(t){case"this":n=n.day(e);break;case"next":n=n.day(e+7);break;case"last":n=n.day(e-7);break}return n}zn.toDayJSWeekday=mO;function Gg(r,e){let t=jg.default(r),n=t.day();return Math.abs(e-7-n)<Math.abs(e-n)?t=t.day(e-7):Math.abs(e+7-n)<Math.abs(e-n)?t=t.day(e+7):t=t.day(e),t}zn.toDayJSClosestWeekday=Gg});var Bg=k(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});var Yg=dt(),hO=Re(),gO=Y(),yO=_i(),bO=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:on\\s*?)?(?:(this|last|past|next)\\s*)?(${hO.matchAnyPattern(Yg.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(this|last|past|next)\\s*week)?(?=\\W|$)`,"i"),TO=1,_O=2,vO=3,Od=class extends gO.AbstractParserWithWordBoundaryChecking{innerPattern(){return bO}innerExtract(e,t){let n=t[_O].toLowerCase(),i=Yg.WEEKDAY_DICTIONARY[n],s=t[TO],a=t[vO],o=s||a;o=o||"",o=o.toLowerCase();let u=null;o=="last"||o=="past"?u="last":o=="next"?u="next":o=="this"&&(u="this");let l=yO.toDayJSWeekday(e.refDate,i,u);return e.createParsingComponents().assign("weekday",i).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};Dd.default=Od});var zg=k(wa=>{"use strict";var wO=wa&&wa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(wa,"__esModule",{value:!0});var Vg=dt(),Hg=We(),kO=wO(ve()),EO=Y(),SO=Re(),OO=new RegExp(`(this|last|past|next|after\\s*this)\\s*(${SO.matchAnyPattern(Vg.TIME_UNIT_DICTIONARY)})(?=\\s*)(?=\\W|$)`,"i"),DO=1,xO=2,xd=class extends EO.AbstractParserWithWordBoundaryChecking{innerPattern(){return OO}innerExtract(e,t){let n=t[DO].toLowerCase(),i=t[xO].toLowerCase(),s=Vg.TIME_UNIT_DICTIONARY[i];if(n=="next"||n.startsWith("after")){let u={};return u[s]=1,Hg.ParsingComponents.createRelativeFromReference(e.reference,u)}if(n=="last"||n=="past"){let u={};return u[s]=-1,Hg.ParsingComponents.createRelativeFromReference(e.reference,u)}let a=e.createParsingComponents(),o=kO.default(e.reference.instant);return i.match(/week/i)?(o=o.add(-o.get("d"),"d"),a.imply("day",o.date()),a.imply("month",o.month()+1),a.imply("year",o.year())):i.match(/month/i)?(o=o.add(-o.date()+1,"d"),a.imply("day",o.date()),a.assign("year",o.year()),a.assign("month",o.month()+1)):i.match(/year/i)&&(o=o.add(-o.date()+1,"d"),o=o.add(-o.month(),"month"),a.imply("day",o.date()),a.imply("month",o.month()+1),a.assign("year",o.year())),a}};wa.default=xd});var xr=k(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.ParsingContext=cs.Chrono=void 0;var us=We(),RO=Rd(),ls=class{constructor(e){e=e||RO.createCasualConfiguration(),this.parsers=[...e.parsers],this.refiners=[...e.refiners]}clone(){return new ls({parsers:[...this.parsers],refiners:[...this.refiners]})}parseDate(e,t,n){let i=this.parse(e,t,n);return i.length>0?i[0].start.date():null}parse(e,t,n){let i=new cu(e,t,n),s=[];return this.parsers.forEach(a=>{let o=ls.executeParser(i,a);s=s.concat(o)}),s.sort((a,o)=>a.index-o.index),this.refiners.forEach(function(a){s=a.refine(i,s)}),s}static executeParser(e,t){let n=[],i=t.pattern(e),s=e.text,a=e.text,o=i.exec(a);for(;o;){let u=o.index+s.length-a.length;o.index=u;let l=t.extract(e,o);if(!l){a=s.substring(o.index+1),o=i.exec(a);continue}let c=null;l instanceof us.ParsingResult?c=l:l instanceof us.ParsingComponents?(c=e.createParsingResult(o.index,o[0]),c.start=l):c=e.createParsingResult(o.index,o[0],l),e.debug(()=>console.log(`${t.constructor.name} extracted result ${c}`)),n.push(c),a=s.substring(u+c.text.length),o=i.exec(a)}return n}};cs.Chrono=ls;var cu=class{constructor(e,t,n){this.text=e,this.reference=new us.ReferenceWithTimezone(t),this.option=n!=null?n:{},this.refDate=this.reference.instant}createParsingComponents(e){return e instanceof us.ParsingComponents?e:new us.ParsingComponents(this.reference,e)}createParsingResult(e,t,n,i){let s=typeof t=="string"?t:this.text.substring(e,t),a=n?this.createParsingComponents(n):null,o=i?this.createParsingComponents(i):null;return new us.ParsingResult(this.reference,e,s,a,o)}debug(e){this.option.debug&&(this.option.debug instanceof Function?this.option.debug(e):this.option.debug.debug(e))}};cs.ParsingContext=cu});var vi=k(Ad=>{"use strict";Object.defineProperty(Ad,"__esModule",{value:!0});var Kg=ct(),MO=new RegExp("([^\\d]|^)([0-3]{0,1}[0-9]{1})[\\/\\.\\-]([0-3]{0,1}[0-9]{1})(?:[\\/\\.\\-]([0-9]{4}|[0-9]{2}))?(\\W|$)","i"),du=1,Qg=5,Xg=2,Zg=3,Md=4,Cd=class{constructor(e){this.groupNumberMonth=e?Zg:Xg,this.groupNumberDay=e?Xg:Zg}pattern(){return MO}extract(e,t){if(t[du]=="/"||t[Qg]=="/"){t.index+=t[0].length;return}let n=t.index+t[du].length,i=t[0].substr(t[du].length,t[0].length-t[du].length-t[Qg].length);if(i.match(/^\d\.\d$/)||i.match(/^\d\.\d{1,2}\.\d{1,2}\s*$/)||!t[Md]&&t[0].indexOf("/")<0)return;let s=e.createParsingResult(n,i),a=parseInt(t[this.groupNumberMonth]),o=parseInt(t[this.groupNumberDay]);if((a<1||a>12)&&a>12)if(o>=1&&o<=12&&a<=31)[o,a]=[a,o];else return null;if(o<1||o>31)return null;if(s.start.assign("day",o),s.start.assign("month",a),t[Md]){let u=parseInt(t[Md]),l=Kg.findMostLikelyADYear(u);s.start.assign("year",l)}else{let u=Kg.findYearClosestToRef(e.refDate,o,a);s.start.imply("year",u)}return s}};Ad.default=Cd});var ey=k(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});var Jg=dt(),CO=We(),AO=Y(),PO=dr(),NO=new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${Jg.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),Pd=class extends AO.AbstractParserWithWordBoundaryChecking{innerPattern(){return NO}innerExtract(e,t){let n=t[1].toLowerCase(),i=Jg.parseTimeUnits(t[2]);switch(n){case"last":case"past":case"-":i=PO.reverseTimeUnits(i);break}return CO.ParsingComponents.createRelativeFromReference(e.reference,i)}};Nd.default=Pd});var ry=k(Ld=>{"use strict";Object.defineProperty(Ld,"__esModule",{value:!0});var IO=is(),Id=We(),FO=dt(),LO=dr();function ty(r){return r.text.match(/\s+(before|from)$/i)!=null}function UO(r){return r.text.match(/\s+(after|since)$/i)!=null}var Fd=class extends IO.MergingRefiner{patternBetween(){return/^\s*$/i}shouldMergeResults(e,t,n){return!e.match(this.patternBetween())||!ty(t)&&!UO(t)?!1:!!n.start.get("day")&&!!n.start.get("month")&&!!n.start.get("year")}mergeResults(e,t,n){let i=FO.parseTimeUnits(t.text);ty(t)&&(i=LO.reverseTimeUnits(i));let s=Id.ParsingComponents.createRelativeFromReference(new Id.ReferenceWithTimezone(n.start.date()),i);return new Id.ParsingResult(n.reference,t.index,`${t.text}${e}${n.text}`,s)}};Ld.default=Fd});var Rd=k(He=>{"use strict";var tt=He&&He.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(He,"__esModule",{value:!0});He.createConfiguration=He.createCasualConfiguration=He.parseDate=He.parse=He.GB=He.strict=He.casual=void 0;var WO=tt(tg()),qO=tt(og()),$O=tt(fg()),jO=tt(hg()),GO=tt(bg()),YO=tt(Tg()),BO=tt(vg()),HO=tt(wg()),VO=tt(kg()),zO=tt(Eg()),KO=tt(Dg()),QO=yn(),XO=tt(qg()),ZO=tt($g()),JO=tt(Bg()),e0=tt(zg()),Ud=xr(),t0=tt(vi()),r0=tt(ey()),n0=tt(ry());He.casual=new Ud.Chrono(ny(!1));He.strict=new Ud.Chrono(fu(!0,!1));He.GB=new Ud.Chrono(fu(!1,!0));function i0(r,e,t){return He.casual.parse(r,e,t)}He.parse=i0;function s0(r,e,t){return He.casual.parseDate(r,e,t)}He.parseDate=s0;function ny(r=!1){let e=fu(!1,r);return e.parsers.unshift(new XO.default),e.parsers.unshift(new ZO.default),e.parsers.unshift(new jO.default),e.parsers.unshift(new e0.default),e.parsers.unshift(new r0.default),e}He.createCasualConfiguration=ny;function fu(r=!0,e=!1){return QO.includeCommonConfiguration({parsers:[new t0.default(e),new WO.default,new qO.default,new $O.default,new JO.default,new GO.default,new YO.default,new BO.default(r),new HO.default(r),new VO.default(r)],refiners:[new n0.default,new KO.default,new zO.default]},r)}He.createConfiguration=fu});var iy=k(qd=>{"use strict";Object.defineProperty(qd,"__esModule",{value:!0});var a0=bi(),Wd=class extends a0.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:um|von)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|bis)\\s*"}extractPrimaryTimeComponents(e,t){return t[0].match(/^\s*\d{4}\s*$/)?null:super.extractPrimaryTimeComponents(e,t)}};qd.default=Wd});var ka=k(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.parseTimeUnits=Ae.TIME_UNITS_PATTERN=Ae.parseYear=Ae.YEAR_PATTERN=Ae.parseNumberPattern=Ae.NUMBER_PATTERN=Ae.TIME_UNIT_DICTIONARY=Ae.INTEGER_WORD_DICTIONARY=Ae.MONTH_DICTIONARY=Ae.WEEKDAY_DICTIONARY=void 0;var $d=Re(),o0=ct();Ae.WEEKDAY_DICTIONARY={sonntag:0,so:0,montag:1,mo:1,dienstag:2,di:2,mittwoch:3,mi:3,donnerstag:4,do:4,freitag:5,fr:5,samstag:6,sa:6};Ae.MONTH_DICTIONARY={januar:1,j\u00E4nner:1,janner:1,jan:1,"jan.":1,februar:2,feber:2,feb:2,"feb.":2,m\u00E4rz:3,maerz:3,m\u00E4r:3,"m\xE4r.":3,mrz:3,"mrz.":3,april:4,apr:4,"apr.":4,mai:5,juni:6,jun:6,"jun.":6,juli:7,jul:7,"jul.":7,august:8,aug:8,"aug.":8,september:9,sep:9,"sep.":9,sept:9,"sept.":9,oktober:10,okt:10,"okt.":10,november:11,nov:11,"nov.":11,dezember:12,dez:12,"dez.":12};Ae.INTEGER_WORD_DICTIONARY={eins:1,eine:1,einem:1,einen:1,einer:1,zwei:2,drei:3,vier:4,f\u00FCnf:5,fuenf:5,sechs:6,sieben:7,acht:8,neun:9,zehn:10,elf:11,zw\u00F6lf:12,zwoelf:12};Ae.TIME_UNIT_DICTIONARY={sek:"second",sekunde:"second",sekunden:"second",min:"minute",minute:"minute",minuten:"minute",h:"hour",std:"hour",stunde:"hour",stunden:"hour",tag:"d",tage:"d",tagen:"d",woche:"week",wochen:"week",monat:"month",monate:"month",monaten:"month",monats:"month",quartal:"quarter",quartals:"quarter",quartale:"quarter",quartalen:"quarter",a:"year",j:"year",jr:"year",jahr:"year",jahre:"year",jahren:"year",jahres:"year"};Ae.NUMBER_PATTERN=`(?:${$d.matchAnyPattern(Ae.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|half(?:\\s*an?)?|an?\\b(?:\\s*few)?|few|several|a?\\s*couple\\s*(?:of)?)`;function ay(r){let e=r.toLowerCase();return Ae.INTEGER_WORD_DICTIONARY[e]!==void 0?Ae.INTEGER_WORD_DICTIONARY[e]:e==="a"||e==="an"?1:e.match(/few/)?3:e.match(/half/)?.5:e.match(/couple/)?2:e.match(/several/)?7:parseFloat(e)}Ae.parseNumberPattern=ay;Ae.YEAR_PATTERN="(?:[0-9]{1,4}(?:\\s*[vn]\\.?\\s*(?:C(?:hr)?|(?:u\\.?|d\\.?(?:\\s*g\\.?)?)?\\s*Z)\\.?|\\s*(?:u\\.?|d\\.?(?:\\s*g\\.)?)\\s*Z\\.?)?)";function u0(r){if(/v/i.test(r))return-parseInt(r.replace(/[^0-9]+/gi,""));if(/n/i.test(r))return parseInt(r.replace(/[^0-9]+/gi,""));if(/z/i.test(r))return parseInt(r.replace(/[^0-9]+/gi,""));let e=parseInt(r);return o0.findMostLikelyADYear(e)}Ae.parseYear=u0;var oy=`(${Ae.NUMBER_PATTERN})\\s{0,5}(${$d.matchAnyPattern(Ae.TIME_UNIT_DICTIONARY)})\\s{0,5}`,sy=new RegExp(oy,"i");Ae.TIME_UNITS_PATTERN=$d.repeatedTimeunitPattern("",oy);function l0(r){let e={},t=r,n=sy.exec(t);for(;n;)c0(e,n),t=t.substring(n[0].length),n=sy.exec(t);return e}Ae.parseTimeUnits=l0;function c0(r,e){let t=ay(e[1]),n=Ae.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var ly=k(Gd=>{"use strict";Object.defineProperty(Gd,"__esModule",{value:!0});var uy=ka(),d0=Re(),f0=Y(),p0=_i(),m0=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:a[mn]\\s*?)?(?:(diese[mn]|letzte[mn]|n(?:\xE4|ae)chste[mn])\\s*)?(${d0.matchAnyPattern(uy.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(diese|letzte|n(?:\xE4|ae)chste)\\s*woche)?(?=\\W|$)`,"i"),h0=1,g0=3,y0=2,jd=class extends f0.AbstractParserWithWordBoundaryChecking{innerPattern(){return m0}innerExtract(e,t){let n=t[y0].toLowerCase(),i=uy.WEEKDAY_DICTIONARY[n],s=t[h0],a=t[g0],o=s||a;o=o||"",o=o.toLowerCase();let u=null;o.match(/letzte/)?u="last":o.match(/chste/)?u="next":o.match(/diese/)&&(u="this");let l=p0.toDayJSWeekday(e.refDate,i,u);return e.createParsingComponents().assign("weekday",i).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};Gd.default=jd});var py=k(Yd=>{"use strict";Object.defineProperty(Yd,"__esModule",{value:!0});var Kn=Xe(),b0=new RegExp("(^|\\s|T)(?:(?:um|von)\\s*)?(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s)?)?(?:\\s*Uhr)?(?:\\s*(morgens|vormittags|nachmittags|abends|nachts|am\\s+(?:Morgen|Vormittag|Nachmittag|Abend)|in\\s+der\\s+Nacht))?(?=\\W|$)","i"),T0=new RegExp("^\\s*(\\-|\\\u2013|\\~|\\\u301C|bis(?:\\s+um)?|\\?)\\s*(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s)?)?(?:\\s*Uhr)?(?:\\s*(morgens|vormittags|nachmittags|abends|nachts|am\\s+(?:Morgen|Vormittag|Nachmittag|Abend)|in\\s+der\\s+Nacht))?(?=\\W|$)","i"),_0=2,cy=3,dy=4,fy=5,ds=class{pattern(e){return b0}extract(e,t){let n=e.createParsingResult(t.index+t[1].length,t[0].substring(t[1].length));if(n.text.match(/^\d{4}$/)||(n.start=ds.extractTimeComponent(n.start.clone(),t),!n.start))return t.index+=t[0].length,null;let i=e.text.substring(t.index+t[0].length),s=T0.exec(i);return s&&(n.end=ds.extractTimeComponent(n.start.clone(),s),n.end&&(n.text+=s[0])),n}static extractTimeComponent(e,t){let n=0,i=0,s=null;if(n=parseInt(t[_0]),t[cy]!=null&&(i=parseInt(t[cy])),i>=60||n>24)return null;if(n>=12&&(s=Kn.Meridiem.PM),t[fy]!=null){if(n>12)return null;let a=t[fy].toLowerCase();a.match(/morgen|vormittag/)&&(s=Kn.Meridiem.AM,n==12&&(n=0)),a.match(/nachmittag|abend/)&&(s=Kn.Meridiem.PM,n!=12&&(n+=12)),a.match(/nacht/)&&(n==12?(s=Kn.Meridiem.AM,n=0):n<6?s=Kn.Meridiem.AM:(s=Kn.Meridiem.PM,n+=12))}if(e.assign("hour",n),e.assign("minute",i),s!==null?e.assign("meridiem",s):n<12?e.imply("meridiem",Kn.Meridiem.AM):e.imply("meridiem",Kn.Meridiem.PM),t[dy]!=null){let a=parseInt(t[dy]);if(a>=60)return null;e.assign("second",a)}return e}};Yd.default=ds});var my=k(Ea=>{"use strict";var v0=Ea&&Ea.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ea,"__esModule",{value:!0});var w0=v0(zr()),Bd=class extends w0.default{patternBetween(){return/^\s*(bis(?:\s*(?:am|zum))?|-)\s*$/i}};Ea.default=Bd});var hy=k(Sa=>{"use strict";var k0=Sa&&Sa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Sa,"__esModule",{value:!0});var E0=k0(gn()),Hd=class extends E0.default{patternBetween(){return new RegExp("^\\s*(T|um|am|,|-)?\\s*$")}};Sa.default=Hd});var Vd=k(Da=>{"use strict";var S0=Da&&Da.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Da,"__esModule",{value:!0});var O0=S0(ve()),wi=Xe(),D0=Y(),x0=cr(),R0=dr(),Oa=class extends D0.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(diesen)?\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht)(?=\W|$)/i}innerExtract(e,t){let n=O0.default(e.refDate),i=t[2].toLowerCase(),s=e.createParsingComponents();return x0.implySimilarTime(s,n),Oa.extractTimeComponents(s,i)}static extractTimeComponents(e,t){switch(t){case"morgen":e.imply("hour",6),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",wi.Meridiem.AM);break;case"vormittag":e.imply("hour",9),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",wi.Meridiem.AM);break;case"mittag":case"mittags":e.imply("hour",12),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",wi.Meridiem.AM);break;case"nachmittag":e.imply("hour",15),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",wi.Meridiem.PM);break;case"abend":e.imply("hour",18),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",wi.Meridiem.PM);break;case"nacht":e.imply("hour",22),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",wi.Meridiem.PM);break;case"mitternacht":e.get("hour")>1&&(e=R0.addImpliedTimeUnits(e,{day:1})),e.imply("hour",0),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",wi.Meridiem.AM);break}return e}};Da.default=Oa});var by=k(Rr=>{"use strict";var M0=Rr&&Rr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),C0=Rr&&Rr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),A0=Rr&&Rr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&M0(e,r,t);return C0(e,r),e},yy=Rr&&Rr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Rr,"__esModule",{value:!0});var P0=yy(ve()),N0=Y(),ki=cr(),I0=yy(Vd()),gy=A0(Tn()),F0=new RegExp("(jetzt|heute|morgen|\xFCbermorgen|uebermorgen|gestern|vorgestern|letzte\\s*nacht)(?:\\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht))?(?=\\W|$)","i"),L0=1,U0=2,zd=class extends N0.AbstractParserWithWordBoundaryChecking{innerPattern(e){return F0}innerExtract(e,t){let n=P0.default(e.refDate),i=(t[L0]||"").toLowerCase(),s=(t[U0]||"").toLowerCase(),a=e.createParsingComponents();switch(i){case"jetzt":a=gy.now(e.reference);break;case"heute":a=gy.today(e.reference);break;case"morgen":ki.assignTheNextDay(a,n);break;case"\xFCbermorgen":case"uebermorgen":n=n.add(1,"day"),ki.assignTheNextDay(a,n);break;case"gestern":n=n.add(-1,"day"),ki.assignSimilarDate(a,n),ki.implySimilarTime(a,n);break;case"vorgestern":n=n.add(-2,"day"),ki.assignSimilarDate(a,n),ki.implySimilarTime(a,n);break;default:i.match(/letzte\s*nacht/)&&(n.hour()>6&&(n=n.add(-1,"day")),ki.assignSimilarDate(a,n),a.imply("hour",0));break}return s&&(a=I0.default.extractTimeComponents(a,s)),a}};Rr.default=zd});var Ey=k(Qd=>{"use strict";Object.defineProperty(Qd,"__esModule",{value:!0});var W0=ct(),wy=ka(),ky=ka(),q0=Re(),$0=Y(),j0=new RegExp(`(?:am\\s*?)?(?:den\\s*?)?([0-9]{1,2})\\.(?:\\s*(?:bis(?:\\s*(?:am|zum))?|\\-|\\\u2013|\\s)\\s*([0-9]{1,2})\\.?)?\\s*(${q0.matchAnyPattern(wy.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s*)(${ky.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),Ty=1,_y=2,G0=3,vy=4,Kd=class extends $0.AbstractParserWithWordBoundaryChecking{innerPattern(){return j0}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=wy.MONTH_DICTIONARY[t[G0].toLowerCase()],s=parseInt(t[Ty]);if(s>31)return t.index=t.index+t[Ty].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[vy]){let a=ky.parseYear(t[vy]);n.start.assign("year",a)}else{let a=W0.findYearClosestToRef(e.refDate,s,i);n.start.imply("year",a)}if(t[_y]){let a=parseInt(t[_y]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};Qd.default=Kd});var Sy=k(Zd=>{"use strict";Object.defineProperty(Zd,"__esModule",{value:!0});var pu=ka(),Y0=We(),B0=Y(),H0=dr(),V0=Re(),Xd=class extends B0.AbstractParserWithWordBoundaryChecking{constructor(){super()}innerPattern(){return new RegExp(`(?:\\s*((?:n\xE4chste|kommende|folgende|letzte|vergangene|vorige|vor(?:her|an)gegangene)(?:s|n|m|r)?|vor|in)\\s*)?(${pu.NUMBER_PATTERN})?(?:\\s*(n\xE4chste|kommende|folgende|letzte|vergangene|vorige|vor(?:her|an)gegangene)(?:s|n|m|r)?)?\\s*(${V0.matchAnyPattern(pu.TIME_UNIT_DICTIONARY)})`,"i")}innerExtract(e,t){let n=t[2]?pu.parseNumberPattern(t[2]):1,i=pu.TIME_UNIT_DICTIONARY[t[4].toLowerCase()],s={};s[i]=n;let a=t[1]||t[3]||"";if(a=a.toLowerCase(),!!a)return(/vor/.test(a)||/letzte/.test(a)||/vergangen/.test(a))&&(s=H0.reverseTimeUnits(s)),Y0.ParsingComponents.createRelativeFromReference(e.reference,s)}};Zd.default=Xd});var xy=k(rt=>{"use strict";var Mr=rt&&rt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(rt,"__esModule",{value:!0});rt.createConfiguration=rt.createCasualConfiguration=rt.parseDate=rt.parse=rt.strict=rt.casual=void 0;var z0=yn(),Oy=xr(),K0=Mr(vi()),Q0=Mr(_d()),X0=Mr(iy()),Z0=Mr(ly()),J0=Mr(py()),e1=Mr(my()),t1=Mr(hy()),r1=Mr(by()),n1=Mr(Vd()),i1=Mr(Ey()),s1=Mr(Sy());rt.casual=new Oy.Chrono(Dy());rt.strict=new Oy.Chrono(Jd(!0));function a1(r,e,t){return rt.casual.parse(r,e,t)}rt.parse=a1;function o1(r,e,t){return rt.casual.parseDate(r,e,t)}rt.parseDate=o1;function Dy(r=!0){let e=Jd(!1,r);return e.parsers.unshift(new n1.default),e.parsers.unshift(new r1.default),e.parsers.unshift(new s1.default),e}rt.createCasualConfiguration=Dy;function Jd(r=!0,e=!0){return z0.includeCommonConfiguration({parsers:[new Q0.default,new K0.default(e),new X0.default,new J0.default,new i1.default,new Z0.default],refiners:[new e1.default,new t1.default]},r)}rt.createConfiguration=Jd});var My=k(Cr=>{"use strict";var u1=Cr&&Cr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),l1=Cr&&Cr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),c1=Cr&&Cr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&u1(e,r,t);return l1(e,r),e},d1=Cr&&Cr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Cr,"__esModule",{value:!0});var f1=d1(ve()),p1=Xe(),m1=Y(),Ry=cr(),mu=c1(Tn()),ef=class extends m1.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(maintenant|aujourd'hui|demain|hier|cette\s*nuit|la\s*veille)(?=\W|$)/i}innerExtract(e,t){let n=f1.default(e.refDate),i=t[0].toLowerCase(),s=e.createParsingComponents();switch(i){case"maintenant":return mu.now(e.reference);case"aujourd'hui":return mu.today(e.reference);case"hier":return mu.yesterday(e.reference);case"demain":return mu.tomorrow(e.reference);default:i.match(/cette\s*nuit/)?(Ry.assignSimilarDate(s,n),s.imply("hour",22),s.imply("meridiem",p1.Meridiem.PM)):i.match(/la\s*veille/)&&(n=n.add(-1,"day"),Ry.assignSimilarDate(s,n),s.imply("hour",0))}return s}};Cr.default=ef});var Cy=k(rf=>{"use strict";Object.defineProperty(rf,"__esModule",{value:!0});var xa=Xe(),h1=Y(),tf=class extends h1.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(cet?)?\s*(matin|soir|après-midi|aprem|a midi|à minuit)(?=\W|$)/i}innerExtract(e,t){let n=t[2].toLowerCase(),i=e.createParsingComponents();switch(n){case"apr\xE8s-midi":case"aprem":i.imply("hour",14),i.imply("minute",0),i.imply("meridiem",xa.Meridiem.PM);break;case"soir":i.imply("hour",18),i.imply("minute",0),i.imply("meridiem",xa.Meridiem.PM);break;case"matin":i.imply("hour",8),i.imply("minute",0),i.imply("meridiem",xa.Meridiem.AM);break;case"a midi":i.imply("hour",12),i.imply("minute",0),i.imply("meridiem",xa.Meridiem.AM);break;case"\xE0 minuit":i.imply("hour",0),i.imply("meridiem",xa.Meridiem.AM);break}return i}};rf.default=tf});var Ay=k(sf=>{"use strict";Object.defineProperty(sf,"__esModule",{value:!0});var g1=bi(),nf=class extends g1.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:[\xE0a])\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|[\xE0a]|\\?)\\s*"}extractPrimaryTimeComponents(e,t){return t[0].match(/^\s*\d{4}\s*$/)?null:super.extractPrimaryTimeComponents(e,t)}};sf.default=nf});var Py=k(Ra=>{"use strict";var y1=Ra&&Ra.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ra,"__esModule",{value:!0});var b1=y1(gn()),af=class extends b1.default{patternBetween(){return new RegExp("^\\s*(T|\xE0|a|vers|de|,|-)?\\s*$")}};Ra.default=af});var Ny=k(Ma=>{"use strict";var T1=Ma&&Ma.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ma,"__esModule",{value:!0});var _1=T1(zr()),of=class extends _1.default{patternBetween(){return/^\s*(à|a|-)\s*$/i}};Ma.default=of});var Qn=k(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.parseTimeUnits=we.TIME_UNITS_PATTERN=we.parseYear=we.YEAR_PATTERN=we.parseOrdinalNumberPattern=we.ORDINAL_NUMBER_PATTERN=we.parseNumberPattern=we.NUMBER_PATTERN=we.TIME_UNIT_DICTIONARY=we.INTEGER_WORD_DICTIONARY=we.MONTH_DICTIONARY=we.WEEKDAY_DICTIONARY=void 0;var uf=Re();we.WEEKDAY_DICTIONARY={dimanche:0,dim:0,lundi:1,lun:1,mardi:2,mar:2,mercredi:3,mer:3,jeudi:4,jeu:4,vendredi:5,ven:5,samedi:6,sam:6};we.MONTH_DICTIONARY={janvier:1,jan:1,"jan.":1,f\u00E9vrier:2,f\u00E9v:2,"f\xE9v.":2,fevrier:2,fev:2,"fev.":2,mars:3,mar:3,"mar.":3,avril:4,avr:4,"avr.":4,mai:5,juin:6,jun:6,juillet:7,juil:7,jul:7,"jul.":7,ao\u00FBt:8,aout:8,septembre:9,sep:9,"sep.":9,sept:9,"sept.":9,octobre:10,oct:10,"oct.":10,novembre:11,nov:11,"nov.":11,d\u00E9cembre:12,decembre:12,dec:12,"dec.":12};we.INTEGER_WORD_DICTIONARY={un:1,deux:2,trois:3,quatre:4,cinq:5,six:6,sept:7,huit:8,neuf:9,dix:10,onze:11,douze:12,treize:13};we.TIME_UNIT_DICTIONARY={sec:"second",seconde:"second",secondes:"second",min:"minute",mins:"minute",minute:"minute",minutes:"minute",h:"hour",hr:"hour",hrs:"hour",heure:"hour",heures:"hour",jour:"d",jours:"d",semaine:"week",semaines:"week",mois:"month",trimestre:"quarter",trimestres:"quarter",ans:"year",ann\u00E9e:"year",ann\u00E9es:"year"};we.NUMBER_PATTERN=`(?:${uf.matchAnyPattern(we.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|une?\\b|quelques?|demi-?)`;function Fy(r){let e=r.toLowerCase();return we.INTEGER_WORD_DICTIONARY[e]!==void 0?we.INTEGER_WORD_DICTIONARY[e]:e==="une"||e==="un"?1:e.match(/quelques?/)?3:e.match(/demi-?/)?.5:parseFloat(e)}we.parseNumberPattern=Fy;we.ORDINAL_NUMBER_PATTERN="(?:[0-9]{1,2}(?:er)?)";function v1(r){let e=r.toLowerCase();return e=e.replace(/(?:er)$/i,""),parseInt(e)}we.parseOrdinalNumberPattern=v1;we.YEAR_PATTERN="(?:[1-9][0-9]{0,3}\\s*(?:AC|AD|p\\.\\s*C(?:hr?)?\\.\\s*n\\.)|[1-2][0-9]{3}|[5-9][0-9])";function w1(r){if(/AC/i.test(r))return r=r.replace(/BC/i,""),-parseInt(r);if(/AD/i.test(r)||/C/i.test(r))return r=r.replace(/[^\d]+/i,""),parseInt(r);let e=parseInt(r);return e<100&&(e>50?e=e+1900:e=e+2e3),e}we.parseYear=w1;var Ly=`(${we.NUMBER_PATTERN})\\s{0,5}(${uf.matchAnyPattern(we.TIME_UNIT_DICTIONARY)})\\s{0,5}`,Iy=new RegExp(Ly,"i");we.TIME_UNITS_PATTERN=uf.repeatedTimeunitPattern("",Ly);function k1(r){let e={},t=r,n=Iy.exec(t);for(;n;)E1(e,n),t=t.substring(n[0].length),n=Iy.exec(t);return e}we.parseTimeUnits=k1;function E1(r,e){let t=Fy(e[1]),n=we.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var Wy=k(cf=>{"use strict";Object.defineProperty(cf,"__esModule",{value:!0});var Uy=Qn(),S1=Re(),O1=Y(),D1=_i(),x1=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:(?:ce)\\s*)?(${S1.matchAnyPattern(Uy.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(dernier|prochain)\\s*)?(?=\\W|\\d|$)`,"i"),R1=1,M1=2,lf=class extends O1.AbstractParserWithWordBoundaryChecking{innerPattern(){return x1}innerExtract(e,t){let n=t[R1].toLowerCase(),i=Uy.WEEKDAY_DICTIONARY[n];if(i===void 0)return null;let s=t[M1];s=s||"",s=s.toLowerCase();let a=null;s=="dernier"?a="last":s=="prochain"&&(a="next");let o=D1.toDayJSWeekday(e.refDate,i,a);return e.createParsingComponents().assign("weekday",i).imply("day",o.date()).imply("month",o.month()+1).imply("year",o.year())}};cf.default=lf});var Gy=k(df=>{"use strict";Object.defineProperty(df,"__esModule",{value:!0});var Ca=Xe(),C1=new RegExp("(^|\\s|T)(?:(?:[\xE0a])\\s*)?(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s|:)?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?(?=\\W|$)","i"),A1=new RegExp("^\\s*(\\-|\\\u2013|\\~|\\\u301C|[\xE0a]|\\?)\\s*(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s|:)?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?(?=\\W|$)","i"),P1=2,qy=3,$y=4,jy=5,fs=class{pattern(e){return C1}extract(e,t){let n=e.createParsingResult(t.index+t[1].length,t[0].substring(t[1].length));if(n.text.match(/^\d{4}$/)||(n.start=fs.extractTimeComponent(n.start.clone(),t),!n.start))return t.index+=t[0].length,null;let i=e.text.substring(t.index+t[0].length),s=A1.exec(i);return s&&(n.end=fs.extractTimeComponent(n.start.clone(),s),n.end&&(n.text+=s[0])),n}static extractTimeComponent(e,t){let n=0,i=0,s=null;if(n=parseInt(t[P1]),t[qy]!=null&&(i=parseInt(t[qy])),i>=60||n>24)return null;if(n>=12&&(s=Ca.Meridiem.PM),t[jy]!=null){if(n>12)return null;let a=t[jy][0].toLowerCase();a=="a"&&(s=Ca.Meridiem.AM,n==12&&(n=0)),a=="p"&&(s=Ca.Meridiem.PM,n!=12&&(n+=12))}if(e.assign("hour",n),e.assign("minute",i),s!==null?e.assign("meridiem",s):n<12?e.imply("meridiem",Ca.Meridiem.AM):e.imply("meridiem",Ca.Meridiem.PM),t[$y]!=null){let a=parseInt(t[$y]);if(a>=60)return null;e.assign("second",a)}return e}};df.default=fs});var Ky=k(pf=>{"use strict";Object.defineProperty(pf,"__esModule",{value:!0});var N1=ct(),Vy=Qn(),zy=Qn(),hu=Qn(),I1=Re(),F1=Y(),L1=new RegExp(`(?:on\\s*?)?(${hu.ORDINAL_NUMBER_PATTERN})(?:\\s*(?:au|\\-|\\\u2013|jusqu'au?|\\s)\\s*(${hu.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s*(?:de)?\\s*)(${I1.matchAnyPattern(Vy.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s*)(${zy.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),Yy=1,By=2,U1=3,Hy=4,ff=class extends F1.AbstractParserWithWordBoundaryChecking{innerPattern(){return L1}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=Vy.MONTH_DICTIONARY[t[U1].toLowerCase()],s=hu.parseOrdinalNumberPattern(t[Yy]);if(s>31)return t.index=t.index+t[Yy].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[Hy]){let a=zy.parseYear(t[Hy]);n.start.assign("year",a)}else{let a=N1.findYearClosestToRef(e.refDate,s,i);n.start.imply("year",a)}if(t[By]){let a=hu.parseOrdinalNumberPattern(t[By]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};pf.default=ff});var Xy=k(hf=>{"use strict";Object.defineProperty(hf,"__esModule",{value:!0});var Qy=Qn(),W1=We(),q1=Y(),$1=dr(),mf=class extends q1.AbstractParserWithWordBoundaryChecking{constructor(){super()}innerPattern(){return new RegExp(`il y a\\s*(${Qy.TIME_UNITS_PATTERN})(?=(?:\\W|$))`,"i")}innerExtract(e,t){let n=Qy.parseTimeUnits(t[1]),i=$1.reverseTimeUnits(n);return W1.ParsingComponents.createRelativeFromReference(e.reference,i)}};hf.default=mf});var Jy=k(yf=>{"use strict";Object.defineProperty(yf,"__esModule",{value:!0});var Zy=Qn(),j1=We(),G1=Y(),gf=class extends G1.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp(`(?:dans|en|pour|pendant|de)\\s*(${Zy.TIME_UNITS_PATTERN})(?=\\W|$)`,"i")}innerExtract(e,t){let n=Zy.parseTimeUnits(t[1]);return j1.ParsingComponents.createRelativeFromReference(e.reference,n)}};yf.default=gf});var eb=k(Tf=>{"use strict";Object.defineProperty(Tf,"__esModule",{value:!0});var gu=Qn(),Y1=We(),B1=Y(),H1=dr(),V1=Re(),bf=class extends B1.AbstractParserWithWordBoundaryChecking{constructor(){super()}innerPattern(){return new RegExp(`(?:les?|la|l'|du|des?)\\s*(${gu.NUMBER_PATTERN})?(?:\\s*(prochaine?s?|derni[e\xE8]re?s?|pass[\xE9e]e?s?|pr[\xE9e]c[\xE9e]dents?|suivante?s?))?\\s*(${V1.matchAnyPattern(gu.TIME_UNIT_DICTIONARY)})(?:\\s*(prochaine?s?|derni[e\xE8]re?s?|pass[\xE9e]e?s?|pr[\xE9e]c[\xE9e]dents?|suivante?s?))?`,"i")}innerExtract(e,t){let n=t[1]?gu.parseNumberPattern(t[1]):1,i=gu.TIME_UNIT_DICTIONARY[t[3].toLowerCase()],s={};s[i]=n;let a=t[2]||t[4]||"";if(a=a.toLowerCase(),!!a)return(/derni[eè]re?s?/.test(a)||/pass[ée]e?s?/.test(a)||/pr[ée]c[ée]dents?/.test(a))&&(s=H1.reverseTimeUnits(s)),Y1.ParsingComponents.createRelativeFromReference(e.reference,s)}};Tf.default=bf});var nb=k(nt=>{"use strict";var fr=nt&&nt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(nt,"__esModule",{value:!0});nt.createConfiguration=nt.createCasualConfiguration=nt.parseDate=nt.parse=nt.strict=nt.casual=void 0;var z1=yn(),tb=xr(),K1=fr(My()),Q1=fr(Cy()),X1=fr(vi()),Z1=fr(Ay()),J1=fr(Py()),eD=fr(Ny()),tD=fr(Wy()),rD=fr(Gy()),nD=fr(Ky()),iD=fr(Xy()),sD=fr(Jy()),aD=fr(eb());nt.casual=new tb.Chrono(rb());nt.strict=new tb.Chrono(_f(!0));function oD(r,e,t){return nt.casual.parse(r,e,t)}nt.parse=oD;function uD(r,e,t){return nt.casual.parseDate(r,e,t)}nt.parseDate=uD;function rb(r=!0){let e=_f(!1,r);return e.parsers.unshift(new K1.default),e.parsers.unshift(new Q1.default),e.parsers.unshift(new aD.default),e}nt.createCasualConfiguration=rb;function _f(r=!0,e=!0){return z1.includeCommonConfiguration({parsers:[new X1.default(e),new nD.default,new Z1.default,new rD.default,new iD.default,new sD.default,new tD.default],refiners:[new J1.default,new eD.default]},r)}nt.createConfiguration=_f});var ib=k(yu=>{"use strict";Object.defineProperty(yu,"__esModule",{value:!0});yu.toHankaku=void 0;function lD(r){return String(r).replace(/\u2019/g,"'").replace(/\u201D/g,'"').replace(/\u3000/g," ").replace(/\uFFE5/g,"\xA5").replace(/[\uFF01\uFF03-\uFF06\uFF08\uFF09\uFF0C-\uFF19\uFF1C-\uFF1F\uFF21-\uFF3B\uFF3D\uFF3F\uFF41-\uFF5B\uFF5D\uFF5E]/g,cD)}yu.toHankaku=lD;function cD(r){return String.fromCharCode(r.charCodeAt(0)-65248)}});var ab=k(Aa=>{"use strict";var dD=Aa&&Aa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Aa,"__esModule",{value:!0});var vf=ib(),fD=ct(),pD=dD(ve()),mD=/(?:(?:([同今本])|((昭和|平成|令和)?([0-90-9]{1,4}|元)))年\s*)?([0-90-9]{1,2})月\s*([0-90-9]{1,2})日/i,sb=1,hD=2,wf=3,gD=4,yD=5,bD=6,kf=class{pattern(){return mD}extract(e,t){let n=parseInt(vf.toHankaku(t[yD])),i=parseInt(vf.toHankaku(t[bD])),s=e.createParsingComponents({day:i,month:n});if(t[sb]&&t[sb].match("\u540C|\u4ECA|\u672C")){let a=pD.default(e.refDate);s.assign("year",a.year())}if(t[hD]){let a=t[gD],o=a=="\u5143"?1:parseInt(vf.toHankaku(a));t[wf]=="\u4EE4\u548C"?o+=2018:t[wf]=="\u5E73\u6210"?o+=1988:t[wf]=="\u662D\u548C"&&(o+=1925),s.assign("year",o)}else{let a=fD.findYearClosestToRef(e.refDate,i,n);s.imply("year",a)}return s}};Aa.default=kf});var ob=k(Pa=>{"use strict";var TD=Pa&&Pa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Pa,"__esModule",{value:!0});var _D=TD(zr()),Ef=class extends _D.default{patternBetween(){return/^\s*(から|ー|-)\s*$/i}};Pa.default=Ef});var lb=k(Ar=>{"use strict";var vD=Ar&&Ar.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),wD=Ar&&Ar.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),kD=Ar&&Ar.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&vD(e,r,t);return wD(e,r),e},ED=Ar&&Ar.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ar,"__esModule",{value:!0});var SD=ED(ve()),ub=Xe(),Sf=kD(Tn()),OD=/今日|当日|昨日|明日|今夜|今夕|今晩|今朝/i,Of=class{pattern(){return OD}extract(e,t){let n=t[0],i=SD.default(e.refDate),s=e.createParsingComponents();switch(n){case"\u6628\u65E5":return Sf.yesterday(e.reference);case"\u660E\u65E5":return Sf.tomorrow(e.reference);case"\u4ECA\u65E5":case"\u5F53\u65E5":return Sf.today(e.reference)}return n=="\u4ECA\u591C"||n=="\u4ECA\u5915"||n=="\u4ECA\u6669"?(s.imply("hour",22),s.assign("meridiem",ub.Meridiem.PM)):n.match("\u4ECA\u671D")&&(s.imply("hour",6),s.assign("meridiem",ub.Meridiem.AM)),s.assign("day",i.date()),s.assign("month",i.month()+1),s.assign("year",i.year()),s}};Ar.default=Of});var fb=k(it=>{"use strict";var Df=it&&it.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(it,"__esModule",{value:!0});it.createConfiguration=it.createCasualConfiguration=it.parseDate=it.parse=it.strict=it.casual=void 0;var DD=Df(ab()),xD=Df(ob()),RD=Df(lb()),cb=xr();it.casual=new cb.Chrono(db());it.strict=new cb.Chrono(xf());function MD(r,e,t){return it.casual.parse(r,e,t)}it.parse=MD;function CD(r,e,t){return it.casual.parseDate(r,e,t)}it.parseDate=CD;function db(){let r=xf();return r.parsers.unshift(new RD.default),r}it.createCasualConfiguration=db;function xf(){return{parsers:[new DD.default],refiners:[new xD.default]}}it.createConfiguration=xf});var bu=k(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.parseYear=Qr.YEAR_PATTERN=Qr.MONTH_DICTIONARY=Qr.WEEKDAY_DICTIONARY=void 0;Qr.WEEKDAY_DICTIONARY={domingo:0,dom:0,segunda:1,"segunda-feira":1,seg:1,ter\u00E7a:2,"ter\xE7a-feira":2,ter:2,quarta:3,"quarta-feira":3,qua:3,quinta:4,"quinta-feira":4,qui:4,sexta:5,"sexta-feira":5,sex:5,s\u00E1bado:6,sabado:6,sab:6};Qr.MONTH_DICTIONARY={janeiro:1,jan:1,"jan.":1,fevereiro:2,fev:2,"fev.":2,mar\u00E7o:3,mar:3,"mar.":3,abril:4,abr:4,"abr.":4,maio:5,mai:5,"mai.":5,junho:6,jun:6,"jun.":6,julho:7,jul:7,"jul.":7,agosto:8,ago:8,"ago.":8,setembro:9,set:9,"set.":9,outubro:10,out:10,"out.":10,novembro:11,nov:11,"nov.":11,dezembro:12,dez:12,"dez.":12};Qr.YEAR_PATTERN="[0-9]{1,4}(?![^\\s]\\d)(?:\\s*[a|d]\\.?\\s*c\\.?|\\s*a\\.?\\s*d\\.?)?";function AD(r){if(r.match(/^[0-9]{1,4}$/)){let e=parseInt(r);return e<100&&(e>50?e=e+1900:e=e+2e3),e}return r.match(/a\.?\s*c\.?/i)?(r=r.replace(/a\.?\s*c\.?/i,""),-parseInt(r)):parseInt(r)}Qr.parseYear=AD});var mb=k(Mf=>{"use strict";Object.defineProperty(Mf,"__esModule",{value:!0});var pb=bu(),PD=Re(),ND=Y(),ID=_i(),FD=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:(este|esta|passado|pr[o\xF3]ximo)\\s*)?(${PD.matchAnyPattern(pb.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(este|esta|passado|pr[\xF3o]ximo)\\s*semana)?(?=\\W|\\d|$)`,"i"),LD=1,UD=2,WD=3,Rf=class extends ND.AbstractParserWithWordBoundaryChecking{innerPattern(){return FD}innerExtract(e,t){let n=t[UD].toLowerCase(),i=pb.WEEKDAY_DICTIONARY[n];if(i===void 0)return null;let s=t[LD],a=t[WD],o=s||a||"";o=o.toLowerCase();let u=null;o=="passado"?u="this":o=="pr\xF3ximo"||o=="proximo"?u="next":o=="este"&&(u="this");let l=ID.toDayJSWeekday(e.refDate,i,u);return e.createParsingComponents().assign("weekday",i).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};Mf.default=Rf});var hb=k(Af=>{"use strict";Object.defineProperty(Af,"__esModule",{value:!0});var qD=bi(),Cf=class extends qD.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:ao?|\xE0s?|das|da|de|do)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|a(?:o)?|\\?)\\s*"}};Af.default=Cf});var gb=k(Na=>{"use strict";var $D=Na&&Na.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Na,"__esModule",{value:!0});var jD=$D(gn()),Pf=class extends jD.default{patternBetween(){return new RegExp("^\\s*(?:,|\xE0)?\\s*$")}};Na.default=Pf});var yb=k(Ia=>{"use strict";var GD=Ia&&Ia.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ia,"__esModule",{value:!0});var YD=GD(zr()),Nf=class extends YD.default{patternBetween(){return/^\s*(?:-)\s*$/i}};Ia.default=Nf});var kb=k(Ff=>{"use strict";Object.defineProperty(Ff,"__esModule",{value:!0});var BD=ct(),vb=bu(),wb=bu(),HD=Re(),VD=Y(),zD=new RegExp(`([0-9]{1,2})(?:\xBA|\xAA|\xB0)?(?:\\s*(?:desde|de|\\-|\\\u2013|ao?|\\s)\\s*([0-9]{1,2})(?:\xBA|\xAA|\xB0)?)?\\s*(?:de)?\\s*(?:-|/|\\s*(?:de|,)?\\s*)(${HD.matchAnyPattern(vb.MONTH_DICTIONARY)})(?:\\s*(?:de|,)?\\s*(${wb.YEAR_PATTERN}))?(?=\\W|$)`,"i"),bb=1,Tb=2,KD=3,_b=4,If=class extends VD.AbstractParserWithWordBoundaryChecking{innerPattern(){return zD}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=vb.MONTH_DICTIONARY[t[KD].toLowerCase()],s=parseInt(t[bb]);if(s>31)return t.index=t.index+t[bb].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[_b]){let a=wb.parseYear(t[_b]);n.start.assign("year",a)}else{let a=BD.findYearClosestToRef(e.refDate,s,i);n.start.imply("year",a)}if(t[Tb]){let a=parseInt(t[Tb]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};Ff.default=If});var Eb=k(_n=>{"use strict";var QD=_n&&_n.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),XD=_n&&_n.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),ZD=_n&&_n.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&QD(e,r,t);return XD(e,r),e};Object.defineProperty(_n,"__esModule",{value:!0});var JD=Y(),Tu=ZD(Tn()),Lf=class extends JD.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(agora|hoje|amanha|amanhã|ontem)(?=\W|$)/i}innerExtract(e,t){let n=t[0].toLowerCase(),i=e.createParsingComponents();switch(n){case"agora":return Tu.now(e.reference);case"hoje":return Tu.today(e.reference);case"amanha":case"amanh\xE3":return Tu.tomorrow(e.reference);case"ontem":return Tu.yesterday(e.reference)}return i}};_n.default=Lf});var Sb=k(Fa=>{"use strict";var ex=Fa&&Fa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Fa,"__esModule",{value:!0});var _u=Xe(),tx=Y(),rx=cr(),nx=ex(ve()),Uf=class extends tx.AbstractParserWithWordBoundaryChecking{innerPattern(){return/(?:esta\s*)?(manha|manhã|tarde|meia-noite|meio-dia|noite)(?=\W|$)/i}innerExtract(e,t){let n=nx.default(e.refDate),i=e.createParsingComponents();switch(t[1].toLowerCase()){case"tarde":i.imply("meridiem",_u.Meridiem.PM),i.imply("hour",15);break;case"noite":i.imply("meridiem",_u.Meridiem.PM),i.imply("hour",22);break;case"manha":case"manh\xE3":i.imply("meridiem",_u.Meridiem.AM),i.imply("hour",6);break;case"meia-noite":rx.assignTheNextDay(i,n),i.imply("hour",0),i.imply("minute",0),i.imply("second",0);break;case"meio-dia":i.imply("meridiem",_u.Meridiem.AM),i.imply("hour",12);break}return i}};Fa.default=Uf});var xb=k(st=>{"use strict";var Xn=st&&st.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(st,"__esModule",{value:!0});st.createConfiguration=st.createCasualConfiguration=st.parseDate=st.parse=st.strict=st.casual=void 0;var ix=yn(),Ob=xr(),sx=Xn(vi()),ax=Xn(mb()),ox=Xn(hb()),ux=Xn(gb()),lx=Xn(yb()),cx=Xn(kb()),dx=Xn(Eb()),fx=Xn(Sb());st.casual=new Ob.Chrono(Db());st.strict=new Ob.Chrono(Wf(!0));function px(r,e,t){return st.casual.parse(r,e,t)}st.parse=px;function mx(r,e,t){return st.casual.parseDate(r,e,t)}st.parseDate=mx;function Db(r=!0){let e=Wf(!1,r);return e.parsers.push(new dx.default),e.parsers.push(new fx.default),e}st.createCasualConfiguration=Db;function Wf(r=!0,e=!0){return ix.includeCommonConfiguration({parsers:[new sx.default(e),new ax.default,new ox.default,new cx.default],refiners:[new ux.default,new lx.default]},r)}st.createConfiguration=Wf});var Rb=k(La=>{"use strict";var hx=La&&La.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(La,"__esModule",{value:!0});var gx=hx(zr()),qf=class extends gx.default{patternBetween(){return/^\s*(tot|-)\s*$/i}};La.default=qf});var Mb=k(Ua=>{"use strict";var yx=Ua&&Ua.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ua,"__esModule",{value:!0});var bx=yx(gn()),$f=class extends bx.default{patternBetween(){return new RegExp("^\\s*(om|na|voor|in de|,|-)?\\s*$")}};Ua.default=$f});var Cb=k(vn=>{"use strict";var Tx=vn&&vn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),_x=vn&&vn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),vx=vn&&vn.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&Tx(e,r,t);return _x(e,r),e};Object.defineProperty(vn,"__esModule",{value:!0});var wx=Y(),vu=vx(Tn()),jf=class extends wx.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(nu|vandaag|morgen|morgend|gisteren)(?=\W|$)/i}innerExtract(e,t){let n=t[0].toLowerCase(),i=e.createParsingComponents();switch(n){case"nu":return vu.now(e.reference);case"vandaag":return vu.today(e.reference);case"morgen":case"morgend":return vu.tomorrow(e.reference);case"gisteren":return vu.yesterday(e.reference)}return i}};vn.default=jf});var Ab=k(Wa=>{"use strict";var kx=Wa&&Wa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Wa,"__esModule",{value:!0});var wu=Xe(),Ex=Y(),Sx=kx(ve()),Ox=cr(),Dx=1,xx=2,Gf=class extends Ex.AbstractParserWithWordBoundaryChecking{innerPattern(){return/(deze)?\s*(namiddag|avond|middernacht|ochtend|middag|'s middags|'s avonds|'s ochtends)(?=\W|$)/i}innerExtract(e,t){let n=Sx.default(e.refDate),i=e.createParsingComponents();switch(t[Dx]==="deze"&&(i.assign("day",e.refDate.getDate()),i.assign("month",e.refDate.getMonth()+1),i.assign("year",e.refDate.getFullYear())),t[xx].toLowerCase()){case"namiddag":case"'s namiddags":i.imply("meridiem",wu.Meridiem.PM),i.imply("hour",15);break;case"avond":case"'s avonds'":i.imply("meridiem",wu.Meridiem.PM),i.imply("hour",20);break;case"middernacht":Ox.assignTheNextDay(i,n),i.imply("hour",0),i.imply("minute",0),i.imply("second",0);break;case"ochtend":case"'s ochtends":i.imply("meridiem",wu.Meridiem.AM),i.imply("hour",6);break;case"middag":case"'s middags":i.imply("meridiem",wu.Meridiem.AM),i.imply("hour",12);break}return i}};Wa.default=Gf});var Vt=k(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.parseTimeUnits=he.TIME_UNITS_PATTERN=he.parseYear=he.YEAR_PATTERN=he.parseOrdinalNumberPattern=he.ORDINAL_NUMBER_PATTERN=he.parseNumberPattern=he.NUMBER_PATTERN=he.TIME_UNIT_DICTIONARY=he.ORDINAL_WORD_DICTIONARY=he.INTEGER_WORD_DICTIONARY=he.MONTH_DICTIONARY=he.WEEKDAY_DICTIONARY=void 0;var ku=Re(),Rx=ct();he.WEEKDAY_DICTIONARY={zondag:0,zon:0,"zon.":0,zo:0,"zo.":0,maandag:1,ma:1,"ma.":1,dinsdag:2,din:2,"din.":2,di:2,"di.":2,woensdag:3,woe:3,"woe.":3,wo:3,"wo.":3,donderdag:4,dond:4,"dond.":4,do:4,"do.":4,vrijdag:5,vrij:5,"vrij.":5,vr:5,"vr.":5,zaterdag:6,zat:6,"zat.":6,za:6,"za.":6};he.MONTH_DICTIONARY={januari:1,jan:1,"jan.":1,februari:2,feb:2,"feb.":2,maart:3,mar:3,"mar.":3,april:4,apr:4,"apr.":4,mei:5,juni:6,jun:6,"jun.":6,juli:7,jul:7,"jul.":7,augustus:8,aug:8,"aug.":8,september:9,sep:9,"sep.":9,sept:9,"sept.":9,oktober:10,okt:10,"okt.":10,november:11,nov:11,"nov.":11,december:12,dec:12,"dec.":12};he.INTEGER_WORD_DICTIONARY={een:1,twee:2,drie:3,vier:4,vijf:5,zes:6,zeven:7,acht:8,negen:9,tien:10,elf:11,twaalf:12};he.ORDINAL_WORD_DICTIONARY={eerste:1,tweede:2,derde:3,vierde:4,vijfde:5,zesde:6,zevende:7,achtste:8,negende:9,tiende:10,elfde:11,twaalfde:12,dertiende:13,veertiende:14,vijftiende:15,zestiende:16,zeventiende:17,achttiende:18,negentiende:19,twintigste:20,eenentwintigste:21,twee\u00EBntwintigste:22,drieentwintigste:23,vierentwintigste:24,vijfentwintigste:25,zesentwintigste:26,zevenentwintigste:27,achtentwintig:28,negenentwintig:29,dertigste:30,eenendertigste:31};he.TIME_UNIT_DICTIONARY={sec:"second",second:"second",seconden:"second",min:"minute",mins:"minute",minute:"minute",minuut:"minute",minuten:"minute",minuutje:"minute",h:"hour",hr:"hour",hrs:"hour",uur:"hour",u:"hour",uren:"hour",dag:"d",dagen:"d",week:"week",weken:"week",maand:"month",maanden:"month",jaar:"year",jr:"year",jaren:"year"};he.NUMBER_PATTERN=`(?:${ku.matchAnyPattern(he.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+[\\.,][0-9]+|halve?|half|paar)`;function Nb(r){let e=r.toLowerCase();return he.INTEGER_WORD_DICTIONARY[e]!==void 0?he.INTEGER_WORD_DICTIONARY[e]:e==="paar"?2:e==="half"||e.match(/halve?/)?.5:parseFloat(e.replace(",","."))}he.parseNumberPattern=Nb;he.ORDINAL_NUMBER_PATTERN=`(?:${ku.matchAnyPattern(he.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:ste|de)?)`;function Mx(r){let e=r.toLowerCase();return he.ORDINAL_WORD_DICTIONARY[e]!==void 0?he.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:ste|de)$/i,""),parseInt(e))}he.parseOrdinalNumberPattern=Mx;he.YEAR_PATTERN="(?:[1-9][0-9]{0,3}\\s*(?:voor Christus|na Christus)|[1-2][0-9]{3}|[5-9][0-9])";function Cx(r){if(/voor Christus/i.test(r))return r=r.replace(/voor Christus/i,""),-parseInt(r);if(/na Christus/i.test(r))return r=r.replace(/na Christus/i,""),parseInt(r);let e=parseInt(r);return Rx.findMostLikelyADYear(e)}he.parseYear=Cx;var Ib=`(${he.NUMBER_PATTERN})\\s{0,5}(${ku.matchAnyPattern(he.TIME_UNIT_DICTIONARY)})\\s{0,5}`,Pb=new RegExp(Ib,"i");he.TIME_UNITS_PATTERN=ku.repeatedTimeunitPattern("(?:(?:binnen|in)\\s*)?",Ib);function Ax(r){let e={},t=r,n=Pb.exec(t);for(;n;)Px(e,n),t=t.substring(n[0].length),n=Pb.exec(t);return e}he.parseTimeUnits=Ax;function Px(r,e){let t=Nb(e[1]),n=he.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var Lb=k(Bf=>{"use strict";Object.defineProperty(Bf,"__esModule",{value:!0});var Fb=Vt(),Nx=We(),Ix=Y(),Yf=class extends Ix.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(?:binnen|in|binnen de|voor)\\s*("+Fb.TIME_UNITS_PATTERN+")(?=\\W|$)","i")}innerExtract(e,t){let n=Fb.parseTimeUnits(t[1]);return Nx.ParsingComponents.createRelativeFromReference(e.reference,n)}};Bf.default=Yf});var Wb=k(Vf=>{"use strict";Object.defineProperty(Vf,"__esModule",{value:!0});var Ub=Vt(),Fx=Re(),Lx=Y(),Ux=_i(),Wx=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:op\\s*?)?(?:(deze|vorige|volgende)\\s*(?:week\\s*)?)?(${Fx.matchAnyPattern(Ub.WEEKDAY_DICTIONARY)})(?=\\W|$)`,"i"),qx=1,$x=2,jx=3,Hf=class extends Lx.AbstractParserWithWordBoundaryChecking{innerPattern(){return Wx}innerExtract(e,t){let n=t[$x].toLowerCase(),i=Ub.WEEKDAY_DICTIONARY[n],s=t[qx],a=t[jx],o=s||a;o=o||"",o=o.toLowerCase();let u=null;o=="vorige"?u="last":o=="volgende"?u="next":o=="deze"&&(u="this");let l=Ux.toDayJSWeekday(e.refDate,i,u);return e.createParsingComponents().assign("weekday",i).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};Vf.default=Hf});var Bb=k(Kf=>{"use strict";Object.defineProperty(Kf,"__esModule",{value:!0});var Gx=ct(),Gb=Vt(),Eu=Vt(),Yb=Vt(),Yx=Re(),Bx=Y(),Hx=new RegExp(`(?:on\\s*?)?(${Eu.ORDINAL_NUMBER_PATTERN})(?:\\s*(?:tot|\\-|\\\u2013|until|through|till|\\s)\\s*(${Eu.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s*(?:of)?\\s*)(`+Yx.matchAnyPattern(Gb.MONTH_DICTIONARY)+`)(?:(?:-|/|,?\\s*)(${Yb.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),Vx=3,qb=1,$b=2,jb=4,zf=class extends Bx.AbstractParserWithWordBoundaryChecking{innerPattern(){return Hx}innerExtract(e,t){let n=Gb.MONTH_DICTIONARY[t[Vx].toLowerCase()],i=Eu.parseOrdinalNumberPattern(t[qb]);if(i>31)return t.index=t.index+t[qb].length,null;let s=e.createParsingComponents({day:i,month:n});if(t[jb]){let u=Yb.parseYear(t[jb]);s.assign("year",u)}else{let u=Gx.findYearClosestToRef(e.refDate,i,n);s.imply("year",u)}if(!t[$b])return s;let a=Eu.parseOrdinalNumberPattern(t[$b]),o=e.createParsingResult(t.index,t[0]);return o.start=s,o.end=s.clone(),o.end.assign("day",a),o}};Kf.default=zf});var Kb=k(Xf=>{"use strict";Object.defineProperty(Xf,"__esModule",{value:!0});var Vb=Vt(),zx=ct(),Kx=Re(),zb=Vt(),Qx=Y(),Xx=new RegExp(`(${Kx.matchAnyPattern(Vb.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${zb.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),Zx=1,Hb=2,Qf=class extends Qx.AbstractParserWithWordBoundaryChecking{innerPattern(){return Xx}innerExtract(e,t){let n=e.createParsingComponents();n.imply("day",1);let i=t[Zx],s=Vb.MONTH_DICTIONARY[i.toLowerCase()];if(n.assign("month",s),t[Hb]){let a=zb.parseYear(t[Hb]);n.assign("year",a)}else{let a=zx.findYearClosestToRef(e.refDate,1,s);n.imply("year",a)}return n}};Xf.default=Qf});var Qb=k(Jf=>{"use strict";Object.defineProperty(Jf,"__esModule",{value:!0});var Jx=Y(),eR=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),tR=1,rR=2,Zf=class extends Jx.AbstractParserWithWordBoundaryChecking{innerPattern(){return eR}innerExtract(e,t){let n=parseInt(t[rR]),i=parseInt(t[tR]);return e.createParsingComponents().imply("day",1).assign("month",i).assign("year",n)}};Jf.default=Zf});var Xb=k(tp=>{"use strict";Object.defineProperty(tp,"__esModule",{value:!0});var nR=bi(),ep=class extends nR.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:om)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|om|\\?)\\s*"}primarySuffix(){return"(?:\\s*(?:uur))?(?!/)(?=\\W|$)"}extractPrimaryTimeComponents(e,t){return t[0].match(/^\s*\d{4}\s*$/)?null:super.extractPrimaryTimeComponents(e,t)}};tp.default=ep});var eT=k(np=>{"use strict";Object.defineProperty(np,"__esModule",{value:!0});var Jb=Vt(),iR=Re(),sR=Y(),aR=new RegExp(`([0-9]{4})[\\.\\/\\s](?:(${iR.matchAnyPattern(Jb.MONTH_DICTIONARY)})|([0-9]{1,2}))[\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),oR=1,uR=2,Zb=3,lR=4,rp=class extends sR.AbstractParserWithWordBoundaryChecking{innerPattern(){return aR}innerExtract(e,t){let n=t[Zb]?parseInt(t[Zb]):Jb.MONTH_DICTIONARY[t[uR].toLowerCase()];if(n<1||n>12)return null;let i=parseInt(t[oR]);return{day:parseInt(t[lR]),month:n,year:i}}};np.default=rp});var tT=k(qa=>{"use strict";var cR=qa&&qa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(qa,"__esModule",{value:!0});var dR=Y(),Su=Xe(),ip=cr(),fR=cR(ve()),pR=1,mR=2,sp=class extends dR.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(gisteren|morgen|van)(ochtend|middag|namiddag|avond|nacht)(?=\W|$)/i}innerExtract(e,t){let n=t[pR].toLowerCase(),i=t[mR].toLowerCase(),s=e.createParsingComponents(),a=fR.default(e.refDate);switch(n){case"gisteren":ip.assignSimilarDate(s,a.add(-1,"day"));break;case"van":ip.assignSimilarDate(s,a);break;case"morgen":ip.assignTheNextDay(s,a);break}switch(i){case"ochtend":s.imply("meridiem",Su.Meridiem.AM),s.imply("hour",6);break;case"middag":s.imply("meridiem",Su.Meridiem.AM),s.imply("hour",12);break;case"namiddag":s.imply("meridiem",Su.Meridiem.PM),s.imply("hour",15);break;case"avond":s.imply("meridiem",Su.Meridiem.PM),s.imply("hour",20);break}return s}};qa.default=sp});var nT=k(op=>{"use strict";Object.defineProperty(op,"__esModule",{value:!0});var rT=Vt(),hR=We(),gR=Y(),yR=dr(),bR=new RegExp(`(deze|vorige|afgelopen|komende|over|\\+|-)\\s*(${rT.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),ap=class extends gR.AbstractParserWithWordBoundaryChecking{innerPattern(){return bR}innerExtract(e,t){let n=t[1].toLowerCase(),i=rT.parseTimeUnits(t[2]);switch(n){case"vorige":case"afgelopen":case"-":i=yR.reverseTimeUnits(i);break}return hR.ParsingComponents.createRelativeFromReference(e.reference,i)}};op.default=ap});var aT=k($a=>{"use strict";var TR=$a&&$a.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty($a,"__esModule",{value:!0});var sT=Vt(),iT=We(),_R=TR(ve()),vR=Y(),wR=Re(),kR=new RegExp(`(dit|deze|komende|volgend|volgende|afgelopen|vorige)\\s*(${wR.matchAnyPattern(sT.TIME_UNIT_DICTIONARY)})(?=\\s*)(?=\\W|$)`,"i"),ER=1,SR=2,up=class extends vR.AbstractParserWithWordBoundaryChecking{innerPattern(){return kR}innerExtract(e,t){let n=t[ER].toLowerCase(),i=t[SR].toLowerCase(),s=sT.TIME_UNIT_DICTIONARY[i];if(n=="volgend"||n=="volgende"||n=="komende"){let u={};return u[s]=1,iT.ParsingComponents.createRelativeFromReference(e.reference,u)}if(n=="afgelopen"||n=="vorige"){let u={};return u[s]=-1,iT.ParsingComponents.createRelativeFromReference(e.reference,u)}let a=e.createParsingComponents(),o=_R.default(e.reference.instant);return i.match(/week/i)?(o=o.add(-o.get("d"),"d"),a.imply("day",o.date()),a.imply("month",o.month()+1),a.imply("year",o.year())):i.match(/maand/i)?(o=o.add(-o.date()+1,"d"),a.imply("day",o.date()),a.assign("year",o.year()),a.assign("month",o.month()+1)):i.match(/jaar/i)&&(o=o.add(-o.date()+1,"d"),o=o.add(-o.month(),"month"),a.imply("day",o.date()),a.imply("month",o.month()+1),a.assign("year",o.year())),a}};$a.default=up});var oT=k(dp=>{"use strict";Object.defineProperty(dp,"__esModule",{value:!0});var cp=Vt(),OR=We(),DR=Y(),xR=dr(),RR=new RegExp("("+cp.TIME_UNITS_PATTERN+")(?:geleden|voor|eerder)(?=(?:\\W|$))","i"),MR=new RegExp("("+cp.TIME_UNITS_PATTERN+")geleden(?=(?:\\W|$))","i"),lp=class extends DR.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?MR:RR}innerExtract(e,t){let n=cp.parseTimeUnits(t[1]),i=xR.reverseTimeUnits(n);return OR.ParsingComponents.createRelativeFromReference(e.reference,i)}};dp.default=lp});var uT=k(mp=>{"use strict";Object.defineProperty(mp,"__esModule",{value:!0});var pp=Vt(),CR=We(),AR=Y(),PR=new RegExp("("+pp.TIME_UNITS_PATTERN+")(later|na|vanaf nu|voortaan|vooruit|uit)(?=(?:\\W|$))","i"),NR=new RegExp("("+pp.TIME_UNITS_PATTERN+")(later|vanaf nu)(?=(?:\\W|$))","i"),IR=1,fp=class extends AR.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?NR:PR}innerExtract(e,t){let n=pp.parseTimeUnits(t[IR]);return CR.ParsingComponents.createRelativeFromReference(e.reference,n)}};mp.default=fp});var fT=k(at=>{"use strict";var ft=at&&at.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(at,"__esModule",{value:!0});at.createConfiguration=at.createCasualConfiguration=at.parseDate=at.parse=at.strict=at.casual=void 0;var FR=yn(),lT=xr(),LR=ft(Rb()),UR=ft(Mb()),WR=ft(Cb()),qR=ft(Ab()),$R=ft(vi()),jR=ft(Lb()),GR=ft(Wb()),YR=ft(Bb()),cT=ft(Kb()),BR=ft(Qb()),HR=ft(Xb()),VR=ft(eT()),zR=ft(tT()),KR=ft(nT()),QR=ft(aT()),XR=ft(oT()),ZR=ft(uT());at.casual=new lT.Chrono(dT());at.strict=new lT.Chrono(hp(!0));function JR(r,e,t){return at.casual.parse(r,e,t)}at.parse=JR;function eM(r,e,t){return at.casual.parseDate(r,e,t)}at.parseDate=eM;function dT(r=!0){let e=hp(!1,r);return e.parsers.unshift(new WR.default),e.parsers.unshift(new qR.default),e.parsers.unshift(new zR.default),e.parsers.unshift(new cT.default),e.parsers.unshift(new QR.default),e.parsers.unshift(new KR.default),e}at.createCasualConfiguration=dT;function hp(r=!0,e=!0){return FR.includeCommonConfiguration({parsers:[new $R.default(e),new jR.default,new YR.default,new cT.default,new GR.default,new VR.default,new BR.default,new HR.default(r),new XR.default(r),new ZR.default(r)],refiners:[new UR.default,new LR.default]},r)}at.createConfiguration=hp});var gT=k(ja=>{"use strict";var tM=ja&&ja.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ja,"__esModule",{value:!0});var rM=tM(ve()),nM=Y(),iM=1,pT=2,sM=3,mT=4,hT=5,aM=6,gp=class extends nM.AbstractParserWithWordBoundaryChecking{innerPattern(e){return new RegExp("(\u800C\u5BB6|\u7ACB(?:\u523B|\u5373)|\u5373\u523B)|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(?:\u65E5|\u5929)(?:[\\s|,|\uFF0C]*)(?:(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?","i")}innerExtract(e,t){let n=t.index,i=e.createParsingResult(n,t[0]),s=rM.default(e.refDate),a=s;if(t[iM])i.start.imply("hour",s.hour()),i.start.imply("minute",s.minute()),i.start.imply("second",s.second()),i.start.imply("millisecond",s.millisecond());else if(t[pT]){let o=t[pT],u=t[sM];o=="\u660E"||o=="\u807D"?s.hour()>1&&(a=a.add(1,"day")):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?a=a.add(-1,"day"):o=="\u524D"?a=a.add(-2,"day"):o=="\u5927\u524D"?a=a.add(-3,"day"):o=="\u5F8C"?a=a.add(2,"day"):o=="\u5927\u5F8C"&&(a=a.add(3,"day")),u=="\u65E9"||u=="\u671D"?i.start.imply("hour",6):u=="\u665A"&&(i.start.imply("hour",22),i.start.imply("meridiem",1))}else if(t[mT]){let u=t[mT][0];u=="\u65E9"||u=="\u671D"||u=="\u4E0A"?i.start.imply("hour",6):u=="\u4E0B"||u=="\u664F"?(i.start.imply("hour",15),i.start.imply("meridiem",1)):u=="\u4E2D"?(i.start.imply("hour",12),i.start.imply("meridiem",1)):u=="\u591C"||u=="\u665A"?(i.start.imply("hour",22),i.start.imply("meridiem",1)):u=="\u51CC"&&i.start.imply("hour",0)}else if(t[hT]){let o=t[hT];o=="\u660E"||o=="\u807D"?s.hour()>1&&(a=a.add(1,"day")):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?a=a.add(-1,"day"):o=="\u524D"?a=a.add(-2,"day"):o=="\u5927\u524D"?a=a.add(-3,"day"):o=="\u5F8C"?a=a.add(2,"day"):o=="\u5927\u5F8C"&&(a=a.add(3,"day"));let u=t[aM];if(u){let l=u[0];l=="\u65E9"||l=="\u671D"||l=="\u4E0A"?i.start.imply("hour",6):l=="\u4E0B"||l=="\u664F"?(i.start.imply("hour",15),i.start.imply("meridiem",1)):l=="\u4E2D"?(i.start.imply("hour",12),i.start.imply("meridiem",1)):l=="\u591C"||l=="\u665A"?(i.start.imply("hour",22),i.start.imply("meridiem",1)):l=="\u51CC"&&i.start.imply("hour",0)}}return i.start.assign("day",a.date()),i.start.assign("month",a.month()+1),i.start.assign("year",a.year()),i}};ja.default=gp});var ps=k(Lt=>{"use strict";Object.defineProperty(Lt,"__esModule",{value:!0});Lt.zhStringToYear=Lt.zhStringToNumber=Lt.WEEKDAY_OFFSET=Lt.NUMBER=void 0;Lt.NUMBER={\u96F6:0,\u4E00:1,\u4E8C:2,\u5169:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6,\u4E03:7,\u516B:8,\u4E5D:9,\u5341:10,\u5EFF:20,\u5345:30};Lt.WEEKDAY_OFFSET={\u5929:0,\u65E5:0,\u4E00:1,\u4E8C:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6};function oM(r){let e=0;for(let t=0;t<r.length;t++){let n=r[t];n==="\u5341"?e=e===0?Lt.NUMBER[n]:e*Lt.NUMBER[n]:e+=Lt.NUMBER[n]}return e}Lt.zhStringToNumber=oM;function uM(r){let e="";for(let t=0;t<r.length;t++){let n=r[t];e=e+Lt.NUMBER[n]}return parseInt(e)}Lt.zhStringToYear=uM});var bT=k(Ga=>{"use strict";var lM=Ga&&Ga.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ga,"__esModule",{value:!0});var cM=lM(ve()),dM=Y(),Ei=ps(),yp=1,yT=2,bp=3,Tp=class extends dM.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(\\d{2,4}|["+Object.keys(Ei.NUMBER).join("")+"]{4}|["+Object.keys(Ei.NUMBER).join("")+"]{2})?(?:\\s*)(?:\u5E74)?(?:[\\s|,|\uFF0C]*)(\\d{1,2}|["+Object.keys(Ei.NUMBER).join("")+"]{1,2})(?:\\s*)(?:\u6708)(?:\\s*)(\\d{1,2}|["+Object.keys(Ei.NUMBER).join("")+"]{1,2})?(?:\\s*)(?:\u65E5|\u865F)?")}innerExtract(e,t){let n=cM.default(e.refDate),i=e.createParsingResult(t.index,t[0]),s=parseInt(t[yT]);if(isNaN(s)&&(s=Ei.zhStringToNumber(t[yT])),i.start.assign("month",s),t[bp]){let a=parseInt(t[bp]);isNaN(a)&&(a=Ei.zhStringToNumber(t[bp])),i.start.assign("day",a)}else i.start.imply("day",n.date());if(t[yp]){let a=parseInt(t[yp]);isNaN(a)&&(a=Ei.zhStringToYear(t[yp])),i.start.assign("year",a)}else i.start.imply("year",n.year());return i}};Ga.default=Tp});var _T=k(Ya=>{"use strict";var fM=Ya&&Ya.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ya,"__esModule",{value:!0});var pM=fM(ve()),mM=Y(),TT=ps(),hM=new RegExp("(\\d+|["+Object.keys(TT.NUMBER).join("")+"]+|\u534A|\u5E7E)(?:\\s*)(?:\u500B)?(\u79D2(?:\u9418)?|\u5206\u9418|\u5C0F\u6642|\u9418|\u65E5|\u5929|\u661F\u671F|\u79AE\u62DC|\u6708|\u5E74)(?:(?:\u4E4B|\u904E)?\u5F8C|(?:\u4E4B)?\u5167)","i"),_p=1,gM=2,vp=class extends mM.AbstractParserWithWordBoundaryChecking{innerPattern(){return hM}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=parseInt(t[_p]);if(isNaN(i)&&(i=TT.zhStringToNumber(t[_p])),isNaN(i)){let u=t[_p];if(u==="\u5E7E")i=3;else if(u==="\u534A")i=.5;else return null}let s=pM.default(e.refDate),o=t[gM][0];return o.match(/[日天星禮月年]/)?(o=="\u65E5"||o=="\u5929"?s=s.add(i,"d"):o=="\u661F"||o=="\u79AE"?s=s.add(i*7,"d"):o=="\u6708"?s=s.add(i,"month"):o=="\u5E74"&&(s=s.add(i,"year")),n.start.assign("year",s.year()),n.start.assign("month",s.month()+1),n.start.assign("day",s.date()),n):(o=="\u79D2"?s=s.add(i,"second"):o=="\u5206"?s=s.add(i,"minute"):(o=="\u5C0F"||o=="\u9418")&&(s=s.add(i,"hour")),n.start.imply("year",s.year()),n.start.imply("month",s.month()+1),n.start.imply("day",s.date()),n.start.assign("hour",s.hour()),n.start.assign("minute",s.minute()),n.start.assign("second",s.second()),n)}};Ya.default=vp});var wT=k(Ba=>{"use strict";var yM=Ba&&Ba.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ba,"__esModule",{value:!0});var bM=yM(ve()),TM=Y(),vT=ps(),_M=new RegExp("(?<prefix>\u4E0A|\u4ECA|\u4E0B|\u9019|\u5462)(?:\u500B)?(?:\u661F\u671F|\u79AE\u62DC|\u9031)(?<weekday>"+Object.keys(vT.WEEKDAY_OFFSET).join("|")+")"),wp=class extends TM.AbstractParserWithWordBoundaryChecking{innerPattern(){return _M}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=t.groups.weekday,s=vT.WEEKDAY_OFFSET[i];if(s===void 0)return null;let a=null,o=t.groups.prefix;o=="\u4E0A"?a="last":o=="\u4E0B"?a="next":(o=="\u4ECA"||o=="\u9019"||o=="\u5462")&&(a="this");let u=bM.default(e.refDate),l=!1,c=u.day();return a=="last"||a=="past"?(u=u.day(s-7),l=!0):a=="next"?(u=u.day(s+7),l=!0):a=="this"?u=u.day(s):Math.abs(s-7-c)<Math.abs(s-c)?u=u.day(s-7):Math.abs(s+7-c)<Math.abs(s-c)?u=u.day(s+7):u=u.day(s),n.start.assign("weekday",s),l?(n.start.assign("day",u.date()),n.start.assign("month",u.month()+1),n.start.assign("year",u.year())):(n.start.imply("day",u.date()),n.start.imply("month",u.month()+1),n.start.imply("year",u.year())),n}};Ba.default=wp});var kT=k(Ha=>{"use strict";var vM=Ha&&Ha.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ha,"__esModule",{value:!0});var wM=vM(ve()),kM=Y(),mr=ps(),EM=new RegExp("(?:\u7531|\u5F9E|\u81EA)?(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(mr.NUMBER).join("")+"]+)(?:\\s*)(?:\u9EDE|\u6642|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(mr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(mr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),SM=new RegExp("(?:^\\s*(?:\u5230|\u81F3|\\-|\\\u2013|\\~|\\\u301C)\\s*)(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(mr.NUMBER).join("")+"]+)(?:\\s*)(?:\u9EDE|\u6642|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(mr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(mr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),Ou=1,Du=2,xu=3,Ru=4,Mu=5,Cu=6,pr=7,ms=8,Au=9,kp=class extends kM.AbstractParserWithWordBoundaryChecking{innerPattern(){return EM}innerExtract(e,t){if(t.index>0&&e.text[t.index-1].match(/\w/))return null;let n=wM.default(e.refDate),i=e.createParsingResult(t.index,t[0]),s=n.clone();if(t[Ou]){var a=t[Ou];a=="\u660E"||a=="\u807D"?n.hour()>1&&s.add(1,"day"):a=="\u6628"||a=="\u5C0B"||a=="\u7434"?s.add(-1,"day"):a=="\u524D"?s.add(-2,"day"):a=="\u5927\u524D"?s.add(-3,"day"):a=="\u5F8C"?s.add(2,"day"):a=="\u5927\u5F8C"&&s.add(3,"day"),i.start.assign("day",s.date()),i.start.assign("month",s.month()+1),i.start.assign("year",s.year())}else if(t[Ru]){var o=t[Ru];o=="\u660E"||o=="\u807D"?s.add(1,"day"):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?s.add(-1,"day"):o=="\u524D"?s.add(-2,"day"):o=="\u5927\u524D"?s.add(-3,"day"):o=="\u5F8C"?s.add(2,"day"):o=="\u5927\u5F8C"&&s.add(3,"day"),i.start.assign("day",s.date()),i.start.assign("month",s.month()+1),i.start.assign("year",s.year())}else i.start.imply("day",s.date()),i.start.imply("month",s.month()+1),i.start.imply("year",s.year());let u=0,l=0,c=-1;if(t[ms]){var d=parseInt(t[ms]);if(isNaN(d)&&(d=mr.zhStringToNumber(t[ms])),d>=60)return null;i.start.assign("second",d)}if(u=parseInt(t[Cu]),isNaN(u)&&(u=mr.zhStringToNumber(t[Cu])),t[pr]?t[pr]=="\u534A"?l=30:t[pr]=="\u6B63"||t[pr]=="\u6574"?l=0:(l=parseInt(t[pr]),isNaN(l)&&(l=mr.zhStringToNumber(t[pr]))):u>100&&(l=u%100,u=Math.floor(u/100)),l>=60||u>24)return null;if(u>=12&&(c=1),t[Au]){if(u>12)return null;var f=t[Au][0].toLowerCase();f=="a"&&(c=0,u==12&&(u=0)),f=="p"&&(c=1,u!=12&&(u+=12))}else if(t[Du]){var m=t[Du],g=m[0];g=="\u671D"||g=="\u65E9"?(c=0,u==12&&(u=0)):g=="\u665A"&&(c=1,u!=12&&(u+=12))}else if(t[xu]){var T=t[xu],y=T[0];y=="\u4E0A"||y=="\u671D"||y=="\u65E9"||y=="\u51CC"?(c=0,u==12&&(u=0)):(y=="\u4E0B"||y=="\u664F"||y=="\u665A")&&(c=1,u!=12&&(u+=12))}else if(t[Mu]){var E=t[Mu],x=E[0];x=="\u4E0A"||x=="\u671D"||x=="\u65E9"||x=="\u51CC"?(c=0,u==12&&(u=0)):(x=="\u4E0B"||x=="\u664F"||x=="\u665A")&&(c=1,u!=12&&(u+=12))}if(i.start.assign("hour",u),i.start.assign("minute",l),c>=0?i.start.assign("meridiem",c):u<12?i.start.imply("meridiem",0):i.start.imply("meridiem",1),t=SM.exec(e.text.substring(i.index+i.text.length)),!t)return i.text.match(/^\d+$/)?null:i;let R=s.clone();if(i.end=e.createParsingComponents(),t[Ou]){var a=t[Ou];a=="\u660E"||a=="\u807D"?n.hour()>1&&R.add(1,"day"):a=="\u6628"||a=="\u5C0B"||a=="\u7434"?R.add(-1,"day"):a=="\u524D"?R.add(-2,"day"):a=="\u5927\u524D"?R.add(-3,"day"):a=="\u5F8C"?R.add(2,"day"):a=="\u5927\u5F8C"&&R.add(3,"day"),i.end.assign("day",R.date()),i.end.assign("month",R.month()+1),i.end.assign("year",R.year())}else if(t[Ru]){var o=t[Ru];o=="\u660E"||o=="\u807D"?R.add(1,"day"):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?R.add(-1,"day"):o=="\u524D"?R.add(-2,"day"):o=="\u5927\u524D"?R.add(-3,"day"):o=="\u5F8C"?R.add(2,"day"):o=="\u5927\u5F8C"&&R.add(3,"day"),i.end.assign("day",R.date()),i.end.assign("month",R.month()+1),i.end.assign("year",R.year())}else i.end.imply("day",R.date()),i.end.imply("month",R.month()+1),i.end.imply("year",R.year());if(u=0,l=0,c=-1,t[ms]){var d=parseInt(t[ms]);if(isNaN(d)&&(d=mr.zhStringToNumber(t[ms])),d>=60)return null;i.end.assign("second",d)}if(u=parseInt(t[Cu]),isNaN(u)&&(u=mr.zhStringToNumber(t[Cu])),t[pr]?t[pr]=="\u534A"?l=30:t[pr]=="\u6B63"||t[pr]=="\u6574"?l=0:(l=parseInt(t[pr]),isNaN(l)&&(l=mr.zhStringToNumber(t[pr]))):u>100&&(l=u%100,u=Math.floor(u/100)),l>=60||u>24)return null;if(u>=12&&(c=1),t[Au]){if(u>12)return null;var f=t[Au][0].toLowerCase();f=="a"&&(c=0,u==12&&(u=0)),f=="p"&&(c=1,u!=12&&(u+=12)),i.start.isCertain("meridiem")||(c==0?(i.start.imply("meridiem",0),i.start.get("hour")==12&&i.start.assign("hour",0)):(i.start.imply("meridiem",1),i.start.get("hour")!=12&&i.start.assign("hour",i.start.get("hour")+12)))}else if(t[Du]){var m=t[Du],g=m[0];g=="\u671D"||g=="\u65E9"?(c=0,u==12&&(u=0)):g=="\u665A"&&(c=1,u!=12&&(u+=12))}else if(t[xu]){var T=t[xu],y=T[0];y=="\u4E0A"||y=="\u671D"||y=="\u65E9"||y=="\u51CC"?(c=0,u==12&&(u=0)):(y=="\u4E0B"||y=="\u664F"||y=="\u665A")&&(c=1,u!=12&&(u+=12))}else if(t[Mu]){var E=t[Mu],x=E[0];x=="\u4E0A"||x=="\u671D"||x=="\u65E9"||x=="\u51CC"?(c=0,u==12&&(u=0)):(x=="\u4E0B"||x=="\u664F"||x=="\u665A")&&(c=1,u!=12&&(u+=12))}return i.text=i.text+t[0],i.end.assign("hour",u),i.end.assign("minute",l),c>=0?i.end.assign("meridiem",c):i.start.isCertain("meridiem")&&i.start.get("meridiem")==1&&i.start.get("hour")>u?i.end.imply("meridiem",0):u>12&&i.end.imply("meridiem",1),i.end.date().getTime()<i.start.date().getTime()&&i.end.imply("day",i.end.get("day")+1),i}};Ha.default=kp});var ST=k(Va=>{"use strict";var OM=Va&&Va.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Va,"__esModule",{value:!0});var DM=OM(ve()),xM=Y(),ET=ps(),RM=new RegExp("(?:\u661F\u671F|\u79AE\u62DC|\u9031)(?<weekday>"+Object.keys(ET.WEEKDAY_OFFSET).join("|")+")"),Ep=class extends xM.AbstractParserWithWordBoundaryChecking{innerPattern(){return RM}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=t.groups.weekday,s=ET.WEEKDAY_OFFSET[i];if(s===void 0)return null;let a=DM.default(e.refDate),o=!1,u=a.day();return Math.abs(s-7-u)<Math.abs(s-u)?a=a.day(s-7):Math.abs(s+7-u)<Math.abs(s-u)?a=a.day(s+7):a=a.day(s),n.start.assign("weekday",s),o?(n.start.assign("day",a.date()),n.start.assign("month",a.month()+1),n.start.assign("year",a.year())):(n.start.imply("day",a.date()),n.start.imply("month",a.month()+1),n.start.imply("year",a.year())),n}};Va.default=Ep});var OT=k(za=>{"use strict";var MM=za&&za.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(za,"__esModule",{value:!0});var CM=MM(zr()),Sp=class extends CM.default{patternBetween(){return/^\s*(至|到|\-|\~|~|-|ー)\s*$/i}};za.default=Sp});var DT=k(Ka=>{"use strict";var AM=Ka&&Ka.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ka,"__esModule",{value:!0});var PM=AM(gn()),Op=class extends PM.default{patternBetween(){return/^\s*$/i}};Ka.default=Op});var xT=k(Ve=>{"use strict";var wn=Ve&&Ve.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ve,"__esModule",{value:!0});Ve.createConfiguration=Ve.createCasualConfiguration=Ve.parseDate=Ve.parse=Ve.strict=Ve.casual=Ve.hant=void 0;var Dp=xr(),NM=wn(uu()),IM=yn(),FM=wn(gT()),LM=wn(bT()),UM=wn(_T()),WM=wn(wT()),qM=wn(kT()),$M=wn(ST()),jM=wn(OT()),GM=wn(DT());Ve.hant=new Dp.Chrono(xp());Ve.casual=new Dp.Chrono(xp());Ve.strict=new Dp.Chrono(Rp());function YM(r,e,t){return Ve.casual.parse(r,e,t)}Ve.parse=YM;function BM(r,e,t){return Ve.casual.parseDate(r,e,t)}Ve.parseDate=BM;function xp(){let r=Rp();return r.parsers.unshift(new FM.default),r}Ve.createCasualConfiguration=xp;function Rp(){let r=IM.includeCommonConfiguration({parsers:[new LM.default,new WM.default,new $M.default,new qM.default,new UM.default],refiners:[new jM.default,new GM.default]});return r.refiners=r.refiners.filter(e=>!(e instanceof NM.default)),r}Ve.createConfiguration=Rp});var AT=k(Qa=>{"use strict";var HM=Qa&&Qa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Qa,"__esModule",{value:!0});var VM=HM(ve()),zM=Y(),KM=1,RT=2,QM=3,MT=4,CT=5,XM=6,Mp=class extends zM.AbstractParserWithWordBoundaryChecking{innerPattern(e){return new RegExp("(\u73B0\u5728|\u7ACB(?:\u523B|\u5373)|\u5373\u523B)|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(\u65E9|\u665A)|(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(?:\u65E5|\u5929)(?:[\\s|,|\uFF0C]*)(?:(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?","i")}innerExtract(e,t){let n=t.index,i=e.createParsingResult(n,t[0]),s=VM.default(e.refDate),a=s;if(t[KM])i.start.imply("hour",s.hour()),i.start.imply("minute",s.minute()),i.start.imply("second",s.second()),i.start.imply("millisecond",s.millisecond());else if(t[RT]){let o=t[RT],u=t[QM];o=="\u660E"?s.hour()>1&&(a=a.add(1,"day")):o=="\u6628"?a=a.add(-1,"day"):o=="\u524D"?a=a.add(-2,"day"):o=="\u5927\u524D"?a=a.add(-3,"day"):o=="\u540E"?a=a.add(2,"day"):o=="\u5927\u540E"&&(a=a.add(3,"day")),u=="\u65E9"?i.start.imply("hour",6):u=="\u665A"&&(i.start.imply("hour",22),i.start.imply("meridiem",1))}else if(t[MT]){let u=t[MT][0];u=="\u65E9"||u=="\u4E0A"?i.start.imply("hour",6):u=="\u4E0B"?(i.start.imply("hour",15),i.start.imply("meridiem",1)):u=="\u4E2D"?(i.start.imply("hour",12),i.start.imply("meridiem",1)):u=="\u591C"||u=="\u665A"?(i.start.imply("hour",22),i.start.imply("meridiem",1)):u=="\u51CC"&&i.start.imply("hour",0)}else if(t[CT]){let o=t[CT];o=="\u660E"?s.hour()>1&&(a=a.add(1,"day")):o=="\u6628"?a=a.add(-1,"day"):o=="\u524D"?a=a.add(-2,"day"):o=="\u5927\u524D"?a=a.add(-3,"day"):o=="\u540E"?a=a.add(2,"day"):o=="\u5927\u540E"&&(a=a.add(3,"day"));let u=t[XM];if(u){let l=u[0];l=="\u65E9"||l=="\u4E0A"?i.start.imply("hour",6):l=="\u4E0B"?(i.start.imply("hour",15),i.start.imply("meridiem",1)):l=="\u4E2D"?(i.start.imply("hour",12),i.start.imply("meridiem",1)):l=="\u591C"||l=="\u665A"?(i.start.imply("hour",22),i.start.imply("meridiem",1)):l=="\u51CC"&&i.start.imply("hour",0)}}return i.start.assign("day",a.date()),i.start.assign("month",a.month()+1),i.start.assign("year",a.year()),i}};Qa.default=Mp});var hs=k(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.zhStringToYear=Ut.zhStringToNumber=Ut.WEEKDAY_OFFSET=Ut.NUMBER=void 0;Ut.NUMBER={\u96F6:0,"\u3007":0,\u4E00:1,\u4E8C:2,\u4E24:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6,\u4E03:7,\u516B:8,\u4E5D:9,\u5341:10};Ut.WEEKDAY_OFFSET={\u5929:0,\u65E5:0,\u4E00:1,\u4E8C:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6};function ZM(r){let e=0;for(let t=0;t<r.length;t++){let n=r[t];n==="\u5341"?e=e===0?Ut.NUMBER[n]:e*Ut.NUMBER[n]:e+=Ut.NUMBER[n]}return e}Ut.zhStringToNumber=ZM;function JM(r){let e="";for(let t=0;t<r.length;t++){let n=r[t];e=e+Ut.NUMBER[n]}return parseInt(e)}Ut.zhStringToYear=JM});var NT=k(Xa=>{"use strict";var eC=Xa&&Xa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Xa,"__esModule",{value:!0});var tC=eC(ve()),rC=Y(),Si=hs(),Cp=1,PT=2,Ap=3,Pp=class extends rC.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(\\d{2,4}|["+Object.keys(Si.NUMBER).join("")+"]{4}|["+Object.keys(Si.NUMBER).join("")+"]{2})?(?:\\s*)(?:\u5E74)?(?:[\\s|,|\uFF0C]*)(\\d{1,2}|["+Object.keys(Si.NUMBER).join("")+"]{1,3})(?:\\s*)(?:\u6708)(?:\\s*)(\\d{1,2}|["+Object.keys(Si.NUMBER).join("")+"]{1,3})?(?:\\s*)(?:\u65E5|\u53F7)?")}innerExtract(e,t){let n=tC.default(e.refDate),i=e.createParsingResult(t.index,t[0]),s=parseInt(t[PT]);if(isNaN(s)&&(s=Si.zhStringToNumber(t[PT])),i.start.assign("month",s),t[Ap]){let a=parseInt(t[Ap]);isNaN(a)&&(a=Si.zhStringToNumber(t[Ap])),i.start.assign("day",a)}else i.start.imply("day",n.date());if(t[Cp]){let a=parseInt(t[Cp]);isNaN(a)&&(a=Si.zhStringToYear(t[Cp])),i.start.assign("year",a)}else i.start.imply("year",n.year());return i}};Xa.default=Pp});var FT=k(Za=>{"use strict";var nC=Za&&Za.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Za,"__esModule",{value:!0});var iC=nC(ve()),sC=Y(),IT=hs(),aC=new RegExp("(\\d+|["+Object.keys(IT.NUMBER).join("")+"]+|\u534A|\u51E0)(?:\\s*)(?:\u4E2A)?(\u79D2(?:\u949F)?|\u5206\u949F|\u5C0F\u65F6|\u949F|\u65E5|\u5929|\u661F\u671F|\u793C\u62DC|\u6708|\u5E74)(?:(?:\u4E4B|\u8FC7)?\u540E|(?:\u4E4B)?\u5185)","i"),Np=1,oC=2,Ip=class extends sC.AbstractParserWithWordBoundaryChecking{innerPattern(){return aC}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=parseInt(t[Np]);if(isNaN(i)&&(i=IT.zhStringToNumber(t[Np])),isNaN(i)){let u=t[Np];if(u==="\u51E0")i=3;else if(u==="\u534A")i=.5;else return null}let s=iC.default(e.refDate),o=t[oC][0];return o.match(/[日天星礼月年]/)?(o=="\u65E5"||o=="\u5929"?s=s.add(i,"d"):o=="\u661F"||o=="\u793C"?s=s.add(i*7,"d"):o=="\u6708"?s=s.add(i,"month"):o=="\u5E74"&&(s=s.add(i,"year")),n.start.assign("year",s.year()),n.start.assign("month",s.month()+1),n.start.assign("day",s.date()),n):(o=="\u79D2"?s=s.add(i,"second"):o=="\u5206"?s=s.add(i,"minute"):(o=="\u5C0F"||o=="\u949F")&&(s=s.add(i,"hour")),n.start.imply("year",s.year()),n.start.imply("month",s.month()+1),n.start.imply("day",s.date()),n.start.assign("hour",s.hour()),n.start.assign("minute",s.minute()),n.start.assign("second",s.second()),n)}};Za.default=Ip});var UT=k(Ja=>{"use strict";var uC=Ja&&Ja.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ja,"__esModule",{value:!0});var lC=uC(ve()),cC=Y(),LT=hs(),dC=new RegExp("(?<prefix>\u4E0A|\u4E0B|\u8FD9)(?:\u4E2A)?(?:\u661F\u671F|\u793C\u62DC|\u5468)(?<weekday>"+Object.keys(LT.WEEKDAY_OFFSET).join("|")+")"),Fp=class extends cC.AbstractParserWithWordBoundaryChecking{innerPattern(){return dC}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=t.groups.weekday,s=LT.WEEKDAY_OFFSET[i];if(s===void 0)return null;let a=null,o=t.groups.prefix;o=="\u4E0A"?a="last":o=="\u4E0B"?a="next":o=="\u8FD9"&&(a="this");let u=lC.default(e.refDate),l=!1,c=u.day();return a=="last"||a=="past"?(u=u.day(s-7),l=!0):a=="next"?(u=u.day(s+7),l=!0):a=="this"?u=u.day(s):Math.abs(s-7-c)<Math.abs(s-c)?u=u.day(s-7):Math.abs(s+7-c)<Math.abs(s-c)?u=u.day(s+7):u=u.day(s),n.start.assign("weekday",s),l?(n.start.assign("day",u.date()),n.start.assign("month",u.month()+1),n.start.assign("year",u.year())):(n.start.imply("day",u.date()),n.start.imply("month",u.month()+1),n.start.imply("year",u.year())),n}};Ja.default=Fp});var WT=k(eo=>{"use strict";var fC=eo&&eo.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(eo,"__esModule",{value:!0});var pC=fC(ve()),mC=Y(),gr=hs(),hC=new RegExp("(?:\u4ECE|\u81EA)?(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(gr.NUMBER).join("")+"]+)(?:\\s*)(?:\u70B9|\u65F6|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(gr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(gr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),gC=new RegExp("(?:^\\s*(?:\u5230|\u81F3|\\-|\\\u2013|\\~|\\\u301C)\\s*)(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(gr.NUMBER).join("")+"]+)(?:\\s*)(?:\u70B9|\u65F6|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(gr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(gr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),Pu=1,Nu=2,Iu=3,Fu=4,Lu=5,Uu=6,hr=7,gs=8,Wu=9,Lp=class extends mC.AbstractParserWithWordBoundaryChecking{innerPattern(){return hC}innerExtract(e,t){if(t.index>0&&e.text[t.index-1].match(/\w/))return null;let n=pC.default(e.refDate),i=e.createParsingResult(t.index,t[0]),s=n.clone();if(t[Pu]){let c=t[Pu];c=="\u660E"?n.hour()>1&&s.add(1,"day"):c=="\u6628"?s.add(-1,"day"):c=="\u524D"?s.add(-2,"day"):c=="\u5927\u524D"?s.add(-3,"day"):c=="\u540E"?s.add(2,"day"):c=="\u5927\u540E"&&s.add(3,"day"),i.start.assign("day",s.date()),i.start.assign("month",s.month()+1),i.start.assign("year",s.year())}else if(t[Fu]){let c=t[Fu];c=="\u660E"?s.add(1,"day"):c=="\u6628"?s.add(-1,"day"):c=="\u524D"?s.add(-2,"day"):c=="\u5927\u524D"?s.add(-3,"day"):c=="\u540E"?s.add(2,"day"):c=="\u5927\u540E"&&s.add(3,"day"),i.start.assign("day",s.date()),i.start.assign("month",s.month()+1),i.start.assign("year",s.year())}else i.start.imply("day",s.date()),i.start.imply("month",s.month()+1),i.start.imply("year",s.year());let a=0,o=0,u=-1;if(t[gs]){let c=parseInt(t[gs]);if(isNaN(c)&&(c=gr.zhStringToNumber(t[gs])),c>=60)return null;i.start.assign("second",c)}if(a=parseInt(t[Uu]),isNaN(a)&&(a=gr.zhStringToNumber(t[Uu])),t[hr]?t[hr]=="\u534A"?o=30:t[hr]=="\u6B63"||t[hr]=="\u6574"?o=0:(o=parseInt(t[hr]),isNaN(o)&&(o=gr.zhStringToNumber(t[hr]))):a>100&&(o=a%100,a=Math.floor(a/100)),o>=60||a>24)return null;if(a>=12&&(u=1),t[Wu]){if(a>12)return null;let c=t[Wu][0].toLowerCase();c=="a"&&(u=0,a==12&&(a=0)),c=="p"&&(u=1,a!=12&&(a+=12))}else if(t[Nu]){let d=t[Nu][0];d=="\u65E9"?(u=0,a==12&&(a=0)):d=="\u665A"&&(u=1,a!=12&&(a+=12))}else if(t[Iu]){let d=t[Iu][0];d=="\u4E0A"||d=="\u65E9"||d=="\u51CC"?(u=0,a==12&&(a=0)):(d=="\u4E0B"||d=="\u665A")&&(u=1,a!=12&&(a+=12))}else if(t[Lu]){let d=t[Lu][0];d=="\u4E0A"||d=="\u65E9"||d=="\u51CC"?(u=0,a==12&&(a=0)):(d=="\u4E0B"||d=="\u665A")&&(u=1,a!=12&&(a+=12))}if(i.start.assign("hour",a),i.start.assign("minute",o),u>=0?i.start.assign("meridiem",u):a<12?i.start.imply("meridiem",0):i.start.imply("meridiem",1),t=gC.exec(e.text.substring(i.index+i.text.length)),!t)return i.text.match(/^\d+$/)?null:i;let l=s.clone();if(i.end=e.createParsingComponents(),t[Pu]){let c=t[Pu];c=="\u660E"?n.hour()>1&&l.add(1,"day"):c=="\u6628"?l.add(-1,"day"):c=="\u524D"?l.add(-2,"day"):c=="\u5927\u524D"?l.add(-3,"day"):c=="\u540E"?l.add(2,"day"):c=="\u5927\u540E"&&l.add(3,"day"),i.end.assign("day",l.date()),i.end.assign("month",l.month()+1),i.end.assign("year",l.year())}else if(t[Fu]){let c=t[Fu];c=="\u660E"?l.add(1,"day"):c=="\u6628"?l.add(-1,"day"):c=="\u524D"?l.add(-2,"day"):c=="\u5927\u524D"?l.add(-3,"day"):c=="\u540E"?l.add(2,"day"):c=="\u5927\u540E"&&l.add(3,"day"),i.end.assign("day",l.date()),i.end.assign("month",l.month()+1),i.end.assign("year",l.year())}else i.end.imply("day",l.date()),i.end.imply("month",l.month()+1),i.end.imply("year",l.year());if(a=0,o=0,u=-1,t[gs]){let c=parseInt(t[gs]);if(isNaN(c)&&(c=gr.zhStringToNumber(t[gs])),c>=60)return null;i.end.assign("second",c)}if(a=parseInt(t[Uu]),isNaN(a)&&(a=gr.zhStringToNumber(t[Uu])),t[hr]?t[hr]=="\u534A"?o=30:t[hr]=="\u6B63"||t[hr]=="\u6574"?o=0:(o=parseInt(t[hr]),isNaN(o)&&(o=gr.zhStringToNumber(t[hr]))):a>100&&(o=a%100,a=Math.floor(a/100)),o>=60||a>24)return null;if(a>=12&&(u=1),t[Wu]){if(a>12)return null;let c=t[Wu][0].toLowerCase();c=="a"&&(u=0,a==12&&(a=0)),c=="p"&&(u=1,a!=12&&(a+=12)),i.start.isCertain("meridiem")||(u==0?(i.start.imply("meridiem",0),i.start.get("hour")==12&&i.start.assign("hour",0)):(i.start.imply("meridiem",1),i.start.get("hour")!=12&&i.start.assign("hour",i.start.get("hour")+12)))}else if(t[Nu]){let d=t[Nu][0];d=="\u65E9"?(u=0,a==12&&(a=0)):d=="\u665A"&&(u=1,a!=12&&(a+=12))}else if(t[Iu]){let d=t[Iu][0];d=="\u4E0A"||d=="\u65E9"||d=="\u51CC"?(u=0,a==12&&(a=0)):(d=="\u4E0B"||d=="\u665A")&&(u=1,a!=12&&(a+=12))}else if(t[Lu]){let d=t[Lu][0];d=="\u4E0A"||d=="\u65E9"||d=="\u51CC"?(u=0,a==12&&(a=0)):(d=="\u4E0B"||d=="\u665A")&&(u=1,a!=12&&(a+=12))}return i.text=i.text+t[0],i.end.assign("hour",a),i.end.assign("minute",o),u>=0?i.end.assign("meridiem",u):i.start.isCertain("meridiem")&&i.start.get("meridiem")==1&&i.start.get("hour")>a?i.end.imply("meridiem",0):a>12&&i.end.imply("meridiem",1),i.end.date().getTime()<i.start.date().getTime()&&i.end.imply("day",i.end.get("day")+1),i}};eo.default=Lp});var $T=k(to=>{"use strict";var yC=to&&to.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(to,"__esModule",{value:!0});var bC=yC(ve()),TC=Y(),qT=hs(),_C=new RegExp("(?:\u661F\u671F|\u793C\u62DC|\u5468)(?<weekday>"+Object.keys(qT.WEEKDAY_OFFSET).join("|")+")"),Up=class extends TC.AbstractParserWithWordBoundaryChecking{innerPattern(){return _C}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=t.groups.weekday,s=qT.WEEKDAY_OFFSET[i];if(s===void 0)return null;let a=bC.default(e.refDate),o=!1,u=a.day();return Math.abs(s-7-u)<Math.abs(s-u)?a=a.day(s-7):Math.abs(s+7-u)<Math.abs(s-u)?a=a.day(s+7):a=a.day(s),n.start.assign("weekday",s),o?(n.start.assign("day",a.date()),n.start.assign("month",a.month()+1),n.start.assign("year",a.year())):(n.start.imply("day",a.date()),n.start.imply("month",a.month()+1),n.start.imply("year",a.year())),n}};to.default=Up});var jT=k(ro=>{"use strict";var vC=ro&&ro.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ro,"__esModule",{value:!0});var wC=vC(zr()),Wp=class extends wC.default{patternBetween(){return/^\s*(至|到|-|~|~|-|ー)\s*$/i}};ro.default=Wp});var GT=k(no=>{"use strict";var kC=no&&no.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(no,"__esModule",{value:!0});var EC=kC(gn()),qp=class extends EC.default{patternBetween(){return/^\s*$/i}};no.default=qp});var YT=k(ze=>{"use strict";var kn=ze&&ze.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ze,"__esModule",{value:!0});ze.createConfiguration=ze.createCasualConfiguration=ze.parseDate=ze.parse=ze.strict=ze.casual=ze.hans=void 0;var $p=xr(),SC=kn(uu()),OC=yn(),DC=kn(AT()),xC=kn(NT()),RC=kn(FT()),MC=kn(UT()),CC=kn(WT()),AC=kn($T()),PC=kn(jT()),NC=kn(GT());ze.hans=new $p.Chrono(jp());ze.casual=new $p.Chrono(jp());ze.strict=new $p.Chrono(Gp());function IC(r,e,t){return ze.casual.parse(r,e,t)}ze.parse=IC;function FC(r,e,t){return ze.casual.parseDate(r,e,t)}ze.parseDate=FC;function jp(){let r=Gp();return r.parsers.unshift(new DC.default),r}ze.createCasualConfiguration=jp;function Gp(){let r=OC.includeCommonConfiguration({parsers:[new xC.default,new MC.default,new AC.default,new CC.default,new RC.default],refiners:[new PC.default,new NC.default]});return r.refiners=r.refiners.filter(e=>!(e instanceof SC.default)),r}ze.createConfiguration=Gp});var HT=k(zt=>{"use strict";var BT=zt&&zt.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),LC=zt&&zt.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),UC=zt&&zt.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&BT(e,r,t)},WC=zt&&zt.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&BT(e,r,t);return LC(e,r),e};Object.defineProperty(zt,"__esModule",{value:!0});zt.hans=void 0;UC(xT(),zt);zt.hans=WC(YT())});var Wt=k(se=>{"use strict";Object.defineProperty(se,"__esModule",{value:!0});se.parseTimeUnits=se.TIME_UNITS_PATTERN=se.parseYear=se.YEAR_PATTERN=se.parseOrdinalNumberPattern=se.ORDINAL_NUMBER_PATTERN=se.parseNumberPattern=se.NUMBER_PATTERN=se.TIME_UNIT_DICTIONARY=se.ORDINAL_WORD_DICTIONARY=se.INTEGER_WORD_DICTIONARY=se.MONTH_DICTIONARY=se.FULL_MONTH_NAME_DICTIONARY=se.WEEKDAY_DICTIONARY=se.REGEX_PARTS=void 0;var qu=Re(),qC=ct();se.REGEX_PARTS={leftBoundary:"([^\\p{L}\\p{N}_]|^)",rightBoundary:"(?=[^\\p{L}\\p{N}_]|$)",flags:"iu"};se.WEEKDAY_DICTIONARY={\u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u0435:0,\u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u044F:0,\u0432\u0441\u043A:0,"\u0432\u0441\u043A.":0,\u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A:1,\u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A\u0430:1,\u043F\u043D:1,"\u043F\u043D.":1,\u0432\u0442\u043E\u0440\u043D\u0438\u043A:2,\u0432\u0442\u043E\u0440\u043D\u0438\u043A\u0430:2,\u0432\u0442:2,"\u0432\u0442.":2,\u0441\u0440\u0435\u0434\u0430:3,\u0441\u0440\u0435\u0434\u044B:3,\u0441\u0440\u0435\u0434\u0443:3,\u0441\u0440:3,"\u0441\u0440.":3,\u0447\u0435\u0442\u0432\u0435\u0440\u0433:4,\u0447\u0435\u0442\u0432\u0435\u0440\u0433\u0430:4,\u0447\u0442:4,"\u0447\u0442.":4,\u043F\u044F\u0442\u043D\u0438\u0446\u0430:5,\u043F\u044F\u0442\u043D\u0438\u0446\u0443:5,\u043F\u044F\u0442\u043D\u0438\u0446\u044B:5,\u043F\u0442:5,"\u043F\u0442.":5,\u0441\u0443\u0431\u0431\u043E\u0442\u0430:6,\u0441\u0443\u0431\u0431\u043E\u0442\u0443:6,\u0441\u0443\u0431\u0431\u043E\u0442\u044B:6,\u0441\u0431:6,"\u0441\u0431.":6};se.FULL_MONTH_NAME_DICTIONARY={\u044F\u043D\u0432\u0430\u0440\u044C:1,\u044F\u043D\u0432\u0430\u0440\u044F:1,\u044F\u043D\u0432\u0430\u0440\u0435:1,\u0444\u0435\u0432\u0440\u044F\u043B\u044C:2,\u0444\u0435\u0432\u0440\u044F\u043B\u044F:2,\u0444\u0435\u0432\u0440\u044F\u043B\u0435:2,\u043C\u0430\u0440\u0442:3,\u043C\u0430\u0440\u0442\u0430:3,\u043C\u0430\u0440\u0442\u0435:3,\u0430\u043F\u0440\u0435\u043B\u044C:4,\u0430\u043F\u0440\u0435\u043B\u044F:4,\u0430\u043F\u0440\u0435\u043B\u0435:4,\u043C\u0430\u0439:5,\u043C\u0430\u044F:5,\u043C\u0430\u0435:5,\u0438\u044E\u043D\u044C:6,\u0438\u044E\u043D\u044F:6,\u0438\u044E\u043D\u0435:6,\u0438\u044E\u043B\u044C:7,\u0438\u044E\u043B\u044F:7,\u0438\u044E\u043B\u0435:7,\u0430\u0432\u0433\u0443\u0441\u0442:8,\u0430\u0432\u0433\u0443\u0441\u0442\u0430:8,\u0430\u0432\u0433\u0443\u0441\u0442\u0435:8,\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u044C:9,\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u044F:9,\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u0435:9,\u043E\u043A\u0442\u044F\u0431\u0440\u044C:10,\u043E\u043A\u0442\u044F\u0431\u0440\u044F:10,\u043E\u043A\u0442\u044F\u0431\u0440\u0435:10,\u043D\u043E\u044F\u0431\u0440\u044C:11,\u043D\u043E\u044F\u0431\u0440\u044F:11,\u043D\u043E\u044F\u0431\u0440\u0435:11,\u0434\u0435\u043A\u0430\u0431\u0440\u044C:12,\u0434\u0435\u043A\u0430\u0431\u0440\u044F:12,\u0434\u0435\u043A\u0430\u0431\u0440\u0435:12};se.MONTH_DICTIONARY=Object.assign(Object.assign({},se.FULL_MONTH_NAME_DICTIONARY),{\u044F\u043D\u0432:1,"\u044F\u043D\u0432.":1,\u0444\u0435\u0432:2,"\u0444\u0435\u0432.":2,\u043C\u0430\u0440:3,"\u043C\u0430\u0440.":3,\u0430\u043F\u0440:4,"\u0430\u043F\u0440.":4,\u0430\u0432\u0433:8,"\u0430\u0432\u0433.":8,\u0441\u0435\u043D:9,"\u0441\u0435\u043D.":9,\u043E\u043A\u0442:10,"\u043E\u043A\u0442.":10,\u043D\u043E\u044F:11,"\u043D\u043E\u044F.":11,\u0434\u0435\u043A:12,"\u0434\u0435\u043A.":12});se.INTEGER_WORD_DICTIONARY={\u043E\u0434\u0438\u043D:1,\u043E\u0434\u043D\u0430:1,\u043E\u0434\u043D\u043E\u0439:1,\u043E\u0434\u043D\u0443:1,\u0434\u0432\u0435:2,\u0434\u0432\u0430:2,\u0434\u0432\u0443\u0445:2,\u0442\u0440\u0438:3,\u0442\u0440\u0435\u0445:3,\u0442\u0440\u0451\u0445:3,\u0447\u0435\u0442\u044B\u0440\u0435:4,\u0447\u0435\u0442\u044B\u0440\u0435\u0445:4,\u0447\u0435\u0442\u044B\u0440\u0451\u0445:4,\u043F\u044F\u0442\u044C:5,\u043F\u044F\u0442\u0438:5,\u0448\u0435\u0441\u0442\u044C:6,\u0448\u0435\u0441\u0442\u0438:6,\u0441\u0435\u043C\u044C:7,\u0441\u0435\u043C\u0438:7,\u0432\u043E\u0441\u0435\u043C\u044C:8,\u0432\u043E\u0441\u0435\u043C\u044C\u043C\u0438:8,\u0434\u0435\u0432\u044F\u0442\u044C:9,\u0434\u0435\u0432\u044F\u0442\u0438:9,\u0434\u0435\u0441\u044F\u0442\u044C:10,\u0434\u0435\u0441\u044F\u0442\u0438:10,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u044C:11,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u0438:11,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u044C:12,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u0438:12};se.ORDINAL_WORD_DICTIONARY={\u043F\u0435\u0440\u0432\u043E\u0435:1,\u043F\u0435\u0440\u0432\u043E\u0433\u043E:1,\u0432\u0442\u043E\u0440\u043E\u0435:2,\u0432\u0442\u043E\u0440\u043E\u0433\u043E:2,\u0442\u0440\u0435\u0442\u044C\u0435:3,\u0442\u0440\u0435\u0442\u044C\u0435\u0433\u043E:3,\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0435:4,\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0433\u043E:4,\u043F\u044F\u0442\u043E\u0435:5,\u043F\u044F\u0442\u043E\u0433\u043E:5,\u0448\u0435\u0441\u0442\u043E\u0435:6,\u0448\u0435\u0441\u0442\u043E\u0433\u043E:6,\u0441\u0435\u0434\u044C\u043C\u043E\u0435:7,\u0441\u0435\u0434\u044C\u043C\u043E\u0433\u043E:7,\u0432\u043E\u0441\u044C\u043C\u043E\u0435:8,\u0432\u043E\u0441\u044C\u043C\u043E\u0433\u043E:8,\u0434\u0435\u0432\u044F\u0442\u043E\u0435:9,\u0434\u0435\u0432\u044F\u0442\u043E\u0433\u043E:9,\u0434\u0435\u0441\u044F\u0442\u043E\u0435:10,\u0434\u0435\u0441\u044F\u0442\u043E\u0433\u043E:10,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:11,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:11,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:12,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:12,\u0442\u0440\u0438\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:13,\u0442\u0440\u0438\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:13,\u0447\u0435\u0442\u044B\u0440\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:14,\u0447\u0435\u0442\u044B\u0440\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:14,\u043F\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:15,\u043F\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:15,\u0448\u0435\u0441\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:16,\u0448\u0435\u0441\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:16,\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:17,\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:17,\u0432\u043E\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:18,\u0432\u043E\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:18,\u0434\u0435\u0432\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:19,\u0434\u0435\u0432\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:19,\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u043E\u0435:20,\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:20,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0435":21,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0433\u043E":21,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u0442\u043E\u0440\u043E\u0435":22,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u0442\u043E\u0440\u043E\u0433\u043E":22,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0442\u0440\u0435\u0442\u044C\u0435":23,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0442\u0440\u0435\u0442\u044C\u0435\u0433\u043E":23,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0435":24,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0433\u043E":24,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u044F\u0442\u043E\u0435":25,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u044F\u0442\u043E\u0433\u043E":25,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0448\u0435\u0441\u0442\u043E\u0435":26,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0448\u0435\u0441\u0442\u043E\u0433\u043E":26,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0441\u0435\u0434\u044C\u043C\u043E\u0435":27,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0441\u0435\u0434\u044C\u043C\u043E\u0433\u043E":27,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u043E\u0441\u044C\u043C\u043E\u0435":28,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u043E\u0441\u044C\u043C\u043E\u0433\u043E":28,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0434\u0435\u0432\u044F\u0442\u043E\u0435":29,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0434\u0435\u0432\u044F\u0442\u043E\u0433\u043E":29,\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u043E\u0435:30,\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u043E\u0433\u043E:30,"\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0435":31,"\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0433\u043E":31};se.TIME_UNIT_DICTIONARY={\u0441\u0435\u043A:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u0430:"second",\u0441\u0435\u043A\u0443\u043D\u0434:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u044B:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u0443:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0430:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0438:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u0435\u043A:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0443:"second",\u043C\u0438\u043D:"minute",\u043C\u0438\u043D\u0443\u0442\u0430:"minute",\u043C\u0438\u043D\u0443\u0442:"minute",\u043C\u0438\u043D\u0443\u0442\u044B:"minute",\u043C\u0438\u043D\u0443\u0442\u0443:"minute",\u043C\u0438\u043D\u0443\u0442\u043E\u043A:"minute",\u043C\u0438\u043D\u0443\u0442\u043A\u0438:"minute",\u043C\u0438\u043D\u0443\u0442\u043A\u0443:"minute",\u0447\u0430\u0441:"hour",\u0447\u0430\u0441\u043E\u0432:"hour",\u0447\u0430\u0441\u0430:"hour",\u0447\u0430\u0441\u0443:"hour",\u0447\u0430\u0441\u0438\u043A\u043E\u0432:"hour",\u0447\u0430\u0441\u0438\u043A\u0430:"hour",\u0447\u0430\u0441\u0438\u043A\u0435:"hour",\u0447\u0430\u0441\u0438\u043A:"hour",\u0434\u0435\u043D\u044C:"d",\u0434\u043D\u044F:"d",\u0434\u043D\u0435\u0439:"d",\u0441\u0443\u0442\u043E\u043A:"d",\u0441\u0443\u0442\u043A\u0438:"d",\u043D\u0435\u0434\u0435\u043B\u044F:"week",\u043D\u0435\u0434\u0435\u043B\u0435:"week",\u043D\u0435\u0434\u0435\u043B\u0438:"week",\u043D\u0435\u0434\u0435\u043B\u044E:"week",\u043D\u0435\u0434\u0435\u043B\u044C:"week",\u043D\u0435\u0434\u0435\u043B\u044C\u043A\u0435:"week",\u043D\u0435\u0434\u0435\u043B\u044C\u043A\u0438:"week",\u043D\u0435\u0434\u0435\u043B\u0435\u043A:"week",\u043C\u0435\u0441\u044F\u0446:"month",\u043C\u0435\u0441\u044F\u0446\u0435:"month",\u043C\u0435\u0441\u044F\u0446\u0435\u0432:"month",\u043C\u0435\u0441\u044F\u0446\u0430:"month",\u043A\u0432\u0430\u0440\u0442\u0430\u043B:"quarter",\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u0435:"quarter",\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u043E\u0432:"quarter",\u0433\u043E\u0434:"year",\u0433\u043E\u0434\u0430:"year",\u0433\u043E\u0434\u0443:"year",\u0433\u043E\u0434\u043E\u0432:"year",\u043B\u0435\u0442:"year",\u0433\u043E\u0434\u0438\u043A:"year",\u0433\u043E\u0434\u0438\u043A\u0430:"year",\u0433\u043E\u0434\u0438\u043A\u043E\u0432:"year"};se.NUMBER_PATTERN=`(?:${qu.matchAnyPattern(se.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|\u043F\u043E\u043B|\u043D\u0435\u0441\u043A\u043E\u043B\u044C\u043A\u043E|\u043F\u0430\u0440(?:\u044B|\u0443)|\\s{0,3})`;function zT(r){let e=r.toLowerCase();return se.INTEGER_WORD_DICTIONARY[e]!==void 0?se.INTEGER_WORD_DICTIONARY[e]:e.match(/несколько/)?3:e.match(/пол/)?.5:e.match(/пар/)?2:e===""?1:parseFloat(e)}se.parseNumberPattern=zT;se.ORDINAL_NUMBER_PATTERN=`(?:${qu.matchAnyPattern(se.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:\u0433\u043E|\u043E\u0433\u043E|\u0435|\u043E\u0435)?)`;function $C(r){let e=r.toLowerCase();return se.ORDINAL_WORD_DICTIONARY[e]!==void 0?se.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:st|nd|rd|th)$/i,""),parseInt(e))}se.parseOrdinalNumberPattern=$C;var Yp="(?:\\s+(?:\u0433\u043E\u0434\u0443|\u0433\u043E\u0434\u0430|\u0433\u043E\u0434|\u0433|\u0433.))?";se.YEAR_PATTERN=`(?:[1-9][0-9]{0,3}${Yp}\\s*(?:\u043D.\u044D.|\u0434\u043E \u043D.\u044D.|\u043D. \u044D.|\u0434\u043E \u043D. \u044D.)|[1-2][0-9]{3}${Yp}|[5-9][0-9]${Yp})`;function jC(r){if(/(год|года|г|г.)/i.test(r)&&(r=r.replace(/(год|года|г|г.)/i,"")),/(до н.э.|до н. э.)/i.test(r))return r=r.replace(/(до н.э.|до н. э.)/i,""),-parseInt(r);if(/(н. э.|н.э.)/i.test(r))return r=r.replace(/(н. э.|н.э.)/i,""),parseInt(r);let e=parseInt(r);return qC.findMostLikelyADYear(e)}se.parseYear=jC;var KT=`(${se.NUMBER_PATTERN})\\s{0,3}(${qu.matchAnyPattern(se.TIME_UNIT_DICTIONARY)})`,VT=new RegExp(KT,"i");se.TIME_UNITS_PATTERN=qu.repeatedTimeunitPattern("(?:(?:\u043E\u043A\u043E\u043B\u043E|\u043F\u0440\u0438\u043C\u0435\u0440\u043D\u043E)\\s{0,3})?",KT);function GC(r){let e={},t=r,n=VT.exec(t);for(;n;)YC(e,n),t=t.substring(n[0].length).trim(),n=VT.exec(t);return e}se.parseTimeUnits=GC;function YC(r,e){let t=zT(e[1]),n=se.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var XT=k(Hp=>{"use strict";Object.defineProperty(Hp,"__esModule",{value:!0});var io=Wt(),BC=We(),HC=Y(),QT=`(?:(?:\u043E\u043A\u043E\u043B\u043E|\u043F\u0440\u0438\u043C\u0435\u0440\u043D\u043E)\\s*(?:~\\s*)?)?(${io.TIME_UNITS_PATTERN})${io.REGEX_PARTS.rightBoundary}`,VC=new RegExp(`(?:\u0432 \u0442\u0435\u0447\u0435\u043D\u0438\u0435|\u0432 \u0442\u0435\u0447\u0435\u043D\u0438\u0438)\\s*${QT}`,io.REGEX_PARTS.flags),zC=new RegExp(QT,"i"),Bp=class extends HC.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return io.REGEX_PARTS.leftBoundary}innerPattern(e){return e.option.forwardDate?zC:VC}innerExtract(e,t){let n=io.parseTimeUnits(t[1]);return BC.ParsingComponents.createRelativeFromReference(e.reference,n)}};Hp.default=Bp});var r_=k(zp=>{"use strict";Object.defineProperty(zp,"__esModule",{value:!0});var KC=ct(),so=Wt(),t_=Wt(),$u=Wt(),QC=Re(),XC=Y(),ZC=new RegExp(`(?:\u0441)?\\s*(${$u.ORDINAL_NUMBER_PATTERN})(?:\\s{0,3}(?:\u043F\u043E|-|\u2013|\u0434\u043E)?\\s{0,3}(${$u.ORDINAL_NUMBER_PATTERN}))?(?:-|\\/|\\s{0,3}(?:of)?\\s{0,3})(${QC.matchAnyPattern(so.MONTH_DICTIONARY)})(?:(?:-|\\/|,?\\s{0,3})(${t_.YEAR_PATTERN}(?![^\\s]\\d)))?${so.REGEX_PARTS.rightBoundary}`,so.REGEX_PARTS.flags),ZT=1,JT=2,JC=3,e_=4,Vp=class extends XC.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return so.REGEX_PARTS.leftBoundary}innerPattern(){return ZC}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=so.MONTH_DICTIONARY[t[JC].toLowerCase()],s=$u.parseOrdinalNumberPattern(t[ZT]);if(s>31)return t.index=t.index+t[ZT].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[e_]){let a=t_.parseYear(t[e_]);n.start.assign("year",a)}else{let a=KC.findYearClosestToRef(e.refDate,s,i);n.start.imply("year",a)}if(t[JT]){let a=$u.parseOrdinalNumberPattern(t[JT]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};zp.default=Vp});var s_=k(Qp=>{"use strict";Object.defineProperty(Qp,"__esModule",{value:!0});var ao=Wt(),eA=ct(),tA=Re(),i_=Wt(),rA=Y(),nA=new RegExp(`((?:\u0432)\\s*)?(${tA.matchAnyPattern(ao.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${i_.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,ao.REGEX_PARTS.flags),iA=2,n_=3,Kp=class extends rA.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return ao.REGEX_PARTS.leftBoundary}innerPattern(){return nA}innerExtract(e,t){let n=t[iA].toLowerCase();if(t[0].length<=3&&!ao.FULL_MONTH_NAME_DICTIONARY[n])return null;let i=e.createParsingResult(t.index,t.index+t[0].length);i.start.imply("day",1);let s=ao.MONTH_DICTIONARY[n];if(i.start.assign("month",s),t[n_]){let a=i_.parseYear(t[n_]);i.start.assign("year",a)}else{let a=eA.findYearClosestToRef(e.refDate,1,s);i.start.imply("year",a)}return i}};Qp.default=Kp});var o_=k(Zp=>{"use strict";Object.defineProperty(Zp,"__esModule",{value:!0});var ju=Xe(),sA=bi(),a_=Wt(),Xp=class extends sA.AbstractTimeExpressionParser{constructor(e){super(e)}patternFlags(){return a_.REGEX_PARTS.flags}primaryPatternLeftBoundary(){return"(^|\\s|T|(?:[^\\p{L}\\p{N}_]))"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|\u0434\u043E|\u0438|\u043F\u043E|\\?)\\s*"}primaryPrefix(){return"(?:(?:\u0432|\u0441)\\s*)??"}primarySuffix(){return`(?:\\s*(?:\u0443\u0442\u0440\u0430|\u0432\u0435\u0447\u0435\u0440\u0430|\u043F\u043E\u0441\u043B\u0435 \u043F\u043E\u043B\u0443\u0434\u043D\u044F))?(?!\\/)${a_.REGEX_PARTS.rightBoundary}`}extractPrimaryTimeComponents(e,t){let n=super.extractPrimaryTimeComponents(e,t);if(n){if(t[0].endsWith("\u0432\u0435\u0447\u0435\u0440\u0430")){let i=n.get("hour");i>=6&&i<12?(n.assign("hour",n.get("hour")+12),n.assign("meridiem",ju.Meridiem.PM)):i<6&&n.assign("meridiem",ju.Meridiem.AM)}if(t[0].endsWith("\u043F\u043E\u0441\u043B\u0435 \u043F\u043E\u043B\u0443\u0434\u043D\u044F")){n.assign("meridiem",ju.Meridiem.PM);let i=n.get("hour");i>=0&&i<=6&&n.assign("hour",n.get("hour")+12)}t[0].endsWith("\u0443\u0442\u0440\u0430")&&(n.assign("meridiem",ju.Meridiem.AM),n.get("hour")<12&&n.assign("hour",n.get("hour")))}return n}};Zp.default=Xp});var u_=k(em=>{"use strict";Object.defineProperty(em,"__esModule",{value:!0});var Gu=Wt(),aA=We(),oA=Y(),uA=dr(),lA=new RegExp(`(${Gu.TIME_UNITS_PATTERN})\\s{0,5}\u043D\u0430\u0437\u0430\u0434(?=(?:\\W|$))`,Gu.REGEX_PARTS.flags),Jp=class extends oA.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Gu.REGEX_PARTS.leftBoundary}innerPattern(){return lA}innerExtract(e,t){let n=Gu.parseTimeUnits(t[1]),i=uA.reverseTimeUnits(n);return aA.ParsingComponents.createRelativeFromReference(e.reference,i)}};em.default=Jp});var l_=k(oo=>{"use strict";var cA=oo&&oo.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(oo,"__esModule",{value:!0});var dA=cA(zr()),tm=class extends dA.default{patternBetween(){return/^\s*(и до|и по|до|по|-)\s*$/i}};oo.default=tm});var c_=k(uo=>{"use strict";var fA=uo&&uo.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(uo,"__esModule",{value:!0});var pA=fA(gn()),rm=class extends pA.default{patternBetween(){return new RegExp("^\\s*(T|\u0432|,|-)?\\s*$")}};uo.default=rm});var d_=k(En=>{"use strict";var mA=En&&En.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),hA=En&&En.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),gA=En&&En.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&mA(e,r,t);return hA(e,r),e};Object.defineProperty(En,"__esModule",{value:!0});var yA=Y(),lo=gA(Tn()),nm=Wt(),bA=new RegExp(`(?:\u0441|\u0441\u043E)?\\s*(\u0441\u0435\u0433\u043E\u0434\u043D\u044F|\u0432\u0447\u0435\u0440\u0430|\u0437\u0430\u0432\u0442\u0440\u0430|\u043F\u043E\u0441\u043B\u0435\u0437\u0430\u0432\u0442\u0440\u0430|\u043F\u043E\u0437\u0430\u0432\u0447\u0435\u0440\u0430)${nm.REGEX_PARTS.rightBoundary}`,nm.REGEX_PARTS.flags),im=class extends yA.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return nm.REGEX_PARTS.leftBoundary}innerPattern(e){return bA}innerExtract(e,t){let n=t[1].toLowerCase(),i=e.createParsingComponents();switch(n){case"\u0441\u0435\u0433\u043E\u0434\u043D\u044F":return lo.today(e.reference);case"\u0432\u0447\u0435\u0440\u0430":return lo.yesterday(e.reference);case"\u0437\u0430\u0432\u0442\u0440\u0430":return lo.tomorrow(e.reference);case"\u043F\u043E\u0441\u043B\u0435\u0437\u0430\u0432\u0442\u0440\u0430":return lo.theDayAfter(e.reference,2);case"\u043F\u043E\u0437\u0430\u0432\u0447\u0435\u0440\u0430":return lo.theDayBefore(e.reference,2)}return i}};En.default=im});var f_=k(Pr=>{"use strict";var TA=Pr&&Pr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),_A=Pr&&Pr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),vA=Pr&&Pr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&TA(e,r,t);return _A(e,r),e},wA=Pr&&Pr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Pr,"__esModule",{value:!0});var kA=Y(),Oi=vA(Tn()),EA=cr(),SA=wA(ve()),sm=Wt(),OA=new RegExp(`(\u0441\u0435\u0439\u0447\u0430\u0441|\u043F\u0440\u043E\u0448\u043B\u044B\u043C\\s*\u0432\u0435\u0447\u0435\u0440\u043E\u043C|\u043F\u0440\u043E\u0448\u043B\u043E\u0439\\s*\u043D\u043E\u0447\u044C\u044E|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439\\s*\u043D\u043E\u0447\u044C\u044E|\u0441\u0435\u0433\u043E\u0434\u043D\u044F\\s*\u043D\u043E\u0447\u044C\u044E|\u044D\u0442\u043E\u0439\\s*\u043D\u043E\u0447\u044C\u044E|\u043D\u043E\u0447\u044C\u044E|\u044D\u0442\u0438\u043C \u0443\u0442\u0440\u043E\u043C|\u0443\u0442\u0440\u043E\u043C|\u0443\u0442\u0440\u0430|\u0432\\s*\u043F\u043E\u043B\u0434\u0435\u043D\u044C|\u0432\u0435\u0447\u0435\u0440\u043E\u043C|\u0432\u0435\u0447\u0435\u0440\u0430|\u0432\\s*\u043F\u043E\u043B\u043D\u043E\u0447\u044C)${sm.REGEX_PARTS.rightBoundary}`,sm.REGEX_PARTS.flags),am=class extends kA.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return sm.REGEX_PARTS.leftBoundary}innerPattern(){return OA}innerExtract(e,t){let n=SA.default(e.refDate),i=t[0].toLowerCase(),s=e.createParsingComponents();if(i==="\u0441\u0435\u0439\u0447\u0430\u0441")return Oi.now(e.reference);if(i==="\u0432\u0435\u0447\u0435\u0440\u043E\u043C"||i==="\u0432\u0435\u0447\u0435\u0440\u0430")return Oi.evening(e.reference);if(i.endsWith("\u0443\u0442\u0440\u043E\u043C")||i.endsWith("\u0443\u0442\u0440\u0430"))return Oi.morning(e.reference);if(i.match(/в\s*полдень/))return Oi.noon(e.reference);if(i.match(/прошлой\s*ночью/))return Oi.lastNight(e.reference);if(i.match(/прошлым\s*вечером/))return Oi.yesterdayEvening(e.reference);if(i.match(/следующей\s*ночью/)){let a=n.hour()<22?1:2;n=n.add(a,"day"),EA.assignSimilarDate(s,n),s.imply("hour",0)}return i.match(/в\s*полночь/)||i.endsWith("\u043D\u043E\u0447\u044C\u044E")?Oi.midnight(e.reference):s}};Pr.default=am});var p_=k(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});var co=Wt(),DA=Re(),xA=Y(),RA=_i(),MA=new RegExp(`(?:(?:,|\\(|\uFF08)\\s*)?(?:\u0432\\s*?)?(?:(\u044D\u0442\u0443|\u044D\u0442\u043E\u0442|\u043F\u0440\u043E\u0448\u043B\u044B\u0439|\u043F\u0440\u043E\u0448\u043B\u0443\u044E|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0443\u044E|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0433\u043E)\\s*)?(${DA.matchAnyPattern(co.WEEKDAY_DICTIONARY)})(?:\\s*(?:,|\\)|\uFF09))?(?:\\s*\u043D\u0430\\s*(\u044D\u0442\u043E\u0439|\u043F\u0440\u043E\u0448\u043B\u043E\u0439|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439)\\s*\u043D\u0435\u0434\u0435\u043B\u0435)?${co.REGEX_PARTS.rightBoundary}`,co.REGEX_PARTS.flags),CA=1,AA=2,PA=3,om=class extends xA.AbstractParserWithWordBoundaryChecking{innerPattern(){return MA}patternLeftBoundary(){return co.REGEX_PARTS.leftBoundary}innerExtract(e,t){let n=t[AA].toLowerCase(),i=co.WEEKDAY_DICTIONARY[n],s=t[CA],a=t[PA],o=s||a;o=o||"",o=o.toLowerCase();let u=null;o=="\u043F\u0440\u043E\u0448\u043B\u044B\u0439"||o=="\u043F\u0440\u043E\u0448\u043B\u0443\u044E"||o=="\u043F\u0440\u043E\u0448\u043B\u043E\u0439"?u="last":o=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439"||o=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0443\u044E"||o=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439"||o=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0433\u043E"?u="next":(o=="\u044D\u0442\u043E\u0442"||o=="\u044D\u0442\u0443"||o=="\u044D\u0442\u043E\u0439")&&(u="this");let l=RA.toDayJSWeekday(e.refDate,i,u);return e.createParsingComponents().assign("weekday",i).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};um.default=om});var h_=k(po=>{"use strict";var NA=po&&po.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(po,"__esModule",{value:!0});var fo=Wt(),m_=We(),IA=NA(ve()),FA=Y(),LA=Re(),UA=new RegExp(`(\u0432 \u043F\u0440\u043E\u0448\u043B\u043E\u043C|\u043D\u0430 \u043F\u0440\u043E\u0448\u043B\u043E\u0439|\u043D\u0430 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439|\u0432 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u043C|\u043D\u0430 \u044D\u0442\u043E\u0439|\u0432 \u044D\u0442\u043E\u043C)\\s*(${LA.matchAnyPattern(fo.TIME_UNIT_DICTIONARY)})(?=\\s*)${fo.REGEX_PARTS.rightBoundary}`,fo.REGEX_PARTS.flags),WA=1,qA=2,lm=class extends FA.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return fo.REGEX_PARTS.leftBoundary}innerPattern(){return UA}innerExtract(e,t){let n=t[WA].toLowerCase(),i=t[qA].toLowerCase(),s=fo.TIME_UNIT_DICTIONARY[i];if(n=="\u043D\u0430 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439"||n=="\u0432 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u043C"){let u={};return u[s]=1,m_.ParsingComponents.createRelativeFromReference(e.reference,u)}if(n=="\u0432 \u043F\u0440\u043E\u0448\u043B\u043E\u043C"||n=="\u043D\u0430 \u043F\u0440\u043E\u0448\u043B\u043E\u0439"){let u={};return u[s]=-1,m_.ParsingComponents.createRelativeFromReference(e.reference,u)}let a=e.createParsingComponents(),o=IA.default(e.reference.instant);return s.match(/week/i)?(o=o.add(-o.get("d"),"d"),a.imply("day",o.date()),a.imply("month",o.month()+1),a.imply("year",o.year())):s.match(/month/i)?(o=o.add(-o.date()+1,"d"),a.imply("day",o.date()),a.assign("year",o.year()),a.assign("month",o.month()+1)):s.match(/year/i)&&(o=o.add(-o.date()+1,"d"),o=o.add(-o.month(),"month"),a.imply("day",o.date()),a.imply("month",o.month()+1),a.assign("year",o.year())),a}};po.default=lm});var g_=k(dm=>{"use strict";Object.defineProperty(dm,"__esModule",{value:!0});var mo=Wt(),$A=We(),jA=Y(),GA=dr(),YA=new RegExp(`(\u044D\u0442\u0438|\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435|\u043F\u0440\u043E\u0448\u043B\u044B\u0435|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0435|\u043F\u043E\u0441\u043B\u0435|\u0447\u0435\u0440\u0435\u0437|\\+|-)\\s*(${mo.TIME_UNITS_PATTERN})${mo.REGEX_PARTS.rightBoundary}`,mo.REGEX_PARTS.flags),cm=class extends jA.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return mo.REGEX_PARTS.leftBoundary}innerPattern(){return YA}innerExtract(e,t){let n=t[1].toLowerCase(),i=mo.parseTimeUnits(t[2]);switch(n){case"\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435":case"\u043F\u0440\u043E\u0448\u043B\u044B\u0435":case"-":i=GA.reverseTimeUnits(i);break}return $A.ParsingComponents.createRelativeFromReference(e.reference,i)}};dm.default=cm});var T_=k(ot=>{"use strict";var Kt=ot&&ot.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ot,"__esModule",{value:!0});ot.createConfiguration=ot.createCasualConfiguration=ot.parseDate=ot.parse=ot.strict=ot.casual=void 0;var BA=Kt(XT()),HA=Kt(r_()),VA=Kt(s_()),zA=Kt(o_()),KA=Kt(u_()),QA=Kt(l_()),XA=Kt(c_()),ZA=yn(),JA=Kt(d_()),eP=Kt(f_()),tP=Kt(p_()),rP=Kt(h_()),y_=xr(),nP=Kt(vi()),iP=Kt(g_());ot.casual=new y_.Chrono(b_());ot.strict=new y_.Chrono(fm(!0));function sP(r,e,t){return ot.casual.parse(r,e,t)}ot.parse=sP;function aP(r,e,t){return ot.casual.parseDate(r,e,t)}ot.parseDate=aP;function b_(){let r=fm(!1);return r.parsers.unshift(new JA.default),r.parsers.unshift(new eP.default),r.parsers.unshift(new VA.default),r.parsers.unshift(new rP.default),r.parsers.unshift(new iP.default),r}ot.createCasualConfiguration=b_;function fm(r=!0){return ZA.includeCommonConfiguration({parsers:[new nP.default(!0),new BA.default,new HA.default,new tP.default,new zA.default(r),new KA.default],refiners:[new XA.default,new QA.default]},r)}ot.createConfiguration=fm});var Xe=k(pe=>{"use strict";var oP=pe&&pe.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),uP=pe&&pe.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Zn=pe&&pe.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&oP(e,r,t);return uP(e,r),e};Object.defineProperty(pe,"__esModule",{value:!0});pe.parseDate=pe.parse=pe.casual=pe.strict=pe.ru=pe.zh=pe.nl=pe.pt=pe.ja=pe.fr=pe.de=pe.Meridiem=pe.Chrono=pe.en=void 0;var pm=Zn(Rd());pe.en=pm;var lP=xr();Object.defineProperty(pe,"Chrono",{enumerable:!0,get:function(){return lP.Chrono}});var cP;(function(r){r[r.AM=0]="AM",r[r.PM=1]="PM"})(cP=pe.Meridiem||(pe.Meridiem={}));var dP=Zn(xy());pe.de=dP;var fP=Zn(nb());pe.fr=fP;var pP=Zn(fb());pe.ja=pP;var mP=Zn(xb());pe.pt=mP;var hP=Zn(fT());pe.nl=hP;var gP=Zn(HT());pe.zh=gP;var yP=Zn(T_());pe.ru=yP;pe.strict=pm.strict;pe.casual=pm.casual;function bP(r,e,t){return pe.casual.parse(r,e,t)}pe.parse=bP;function TP(r,e,t){return pe.casual.parseDate(r,e,t)}pe.parseDate=TP});var bv=k((gv,yv)=>{(function(r){var e=Object.hasOwnProperty,t=Array.isArray?Array.isArray:function(h){return Object.prototype.toString.call(h)==="[object Array]"},n=10,i=typeof process=="object"&&typeof process.nextTick=="function",s=typeof Symbol=="function",a=typeof Reflect=="object",o=typeof setImmediate=="function",u=o?setImmediate:setTimeout,l=s?a&&typeof Reflect.ownKeys=="function"?Reflect.ownKeys:function(p){var h=Object.getOwnPropertyNames(p);return h.push.apply(h,Object.getOwnPropertySymbols(p)),h}:Object.keys;function c(){this._events={},this._conf&&d.call(this,this._conf)}function d(p){p&&(this._conf=p,p.delimiter&&(this.delimiter=p.delimiter),p.maxListeners!==r&&(this._maxListeners=p.maxListeners),p.wildcard&&(this.wildcard=p.wildcard),p.newListener&&(this._newListener=p.newListener),p.removeListener&&(this._removeListener=p.removeListener),p.verboseMemoryLeak&&(this.verboseMemoryLeak=p.verboseMemoryLeak),p.ignoreErrors&&(this.ignoreErrors=p.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function f(p,h){var b="(node) warning: possible EventEmitter memory leak detected. "+p+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(b+=" Event name: "+h+"."),typeof process!="undefined"&&process.emitWarning){var _=new Error(b);_.name="MaxListenersExceededWarning",_.emitter=this,_.count=p,process.emitWarning(_)}else console.error(b),console.trace&&console.trace()}var m=function(p,h,b){var _=arguments.length;switch(_){case 0:return[];case 1:return[p];case 2:return[p,h];case 3:return[p,h,b];default:for(var w=new Array(_);_--;)w[_]=arguments[_];return w}};function g(p,h){for(var b={},_,w=p.length,S=h?h.length:0,M=0;M<w;M++)_=p[M],b[_]=M<S?h[M]:r;return b}function T(p,h,b){this._emitter=p,this._target=h,this._listeners={},this._listenersCount=0;var _,w;if((b.on||b.off)&&(_=b.on,w=b.off),h.addEventListener?(_=h.addEventListener,w=h.removeEventListener):h.addListener?(_=h.addListener,w=h.removeListener):h.on&&(_=h.on,w=h.off),!_&&!w)throw Error("target does not implement any known event API");if(typeof _!="function")throw TypeError("on method must be a function");if(typeof w!="function")throw TypeError("off method must be a function");this._on=_,this._off=w;var S=p._observers;S?S.push(this):p._observers=[this]}Object.assign(T.prototype,{subscribe:function(p,h,b){var _=this,w=this._target,S=this._emitter,M=this._listeners,A=function(){var v=m.apply(null,arguments),D={data:v,name:h,original:p};if(b){var P=b.call(w,D);P!==!1&&S.emit.apply(S,[D.name].concat(v));return}S.emit.apply(S,[h].concat(v))};if(M[p])throw Error("Event '"+p+"' is already listening");this._listenersCount++,S._newListener&&S._removeListener&&!_._onNewListener?(this._onNewListener=function(v){v===h&&M[p]===null&&(M[p]=A,_._on.call(w,p,A))},S.on("newListener",this._onNewListener),this._onRemoveListener=function(v){v===h&&!S.hasListeners(v)&&M[p]&&(M[p]=null,_._off.call(w,p,A))},M[p]=null,S.on("removeListener",this._onRemoveListener)):(M[p]=A,_._on.call(w,p,A))},unsubscribe:function(p){var h=this,b=this._listeners,_=this._emitter,w,S,M=this._off,A=this._target,v;if(p&&typeof p!="string")throw TypeError("event must be a string");function D(){h._onNewListener&&(_.off("newListener",h._onNewListener),_.off("removeListener",h._onRemoveListener),h._onNewListener=null,h._onRemoveListener=null);var P=ne.call(_,h);_._observers.splice(P,1)}if(p){if(w=b[p],!w)return;M.call(A,p,w),delete b[p],--this._listenersCount||D()}else{for(S=l(b),v=S.length;v-- >0;)p=S[v],M.call(A,p,b[p]);this._listeners={},this._listenersCount=0,D()}}});function y(p,h,b,_){var w=Object.assign({},h);if(!p)return w;if(typeof p!="object")throw TypeError("options must be an object");var S=Object.keys(p),M=S.length,A,v,D;function P(le){throw Error('Invalid "'+A+'" option value'+(le?". Reason: "+le:""))}for(var re=0;re<M;re++){if(A=S[re],!_&&!e.call(h,A))throw Error('Unknown "'+A+'" option');v=p[A],v!==r&&(D=b[A],w[A]=D?D(v,P):v)}return w}function E(p,h){return(typeof p!="function"||!p.hasOwnProperty("prototype"))&&h("value must be a constructor"),p}function x(p){var h="value must be type of "+p.join("|"),b=p.length,_=p[0],w=p[1];return b===1?function(S,M){if(typeof S===_)return S;M(h)}:b===2?function(S,M){var A=typeof S;if(A===_||A===w)return S;M(h)}:function(S,M){for(var A=typeof S,v=b;v-- >0;)if(A===p[v])return S;M(h)}}var R=x(["function"]),$=x(["object","function"]);function q(p,h,b){var _,w,S=0,M,A=new p(function(v,D,P){b=y(b,{timeout:0,overload:!1},{timeout:function(Ne,Ce){return Ne*=1,(typeof Ne!="number"||Ne<0||!Number.isFinite(Ne))&&Ce("timeout must be a positive number"),Ne}}),_=!b.overload&&typeof p.prototype.cancel=="function"&&typeof P=="function";function re(){w&&(w=null),S&&(clearTimeout(S),S=0)}var le=function(Ne){re(),v(Ne)},fe=function(Ne){re(),D(Ne)};_?h(le,fe,P):(w=[function(Ne){fe(Ne||Error("canceled"))}],h(le,fe,function(Ne){if(M)throw Error("Unable to subscribe on cancel event asynchronously");if(typeof Ne!="function")throw TypeError("onCancel callback must be a function");w.push(Ne)}),M=!0),b.timeout>0&&(S=setTimeout(function(){var Ne=Error("timeout");Ne.code="ETIMEDOUT",S=0,A.cancel(Ne),D(Ne)},b.timeout))});return _||(A.cancel=function(v){if(!!w){for(var D=w.length,P=1;P<D;P++)w[P](v);w[0](v),w=null}}),A}function ne(p){var h=this._observers;if(!h)return-1;for(var b=h.length,_=0;_<b;_++)if(h[_]._target===p)return _;return-1}function B(p,h,b,_,w){if(!b)return null;if(_===0){var S=typeof h;if(S==="string"){var M,A,v=0,D=0,P=this.delimiter,re=P.length;if((A=h.indexOf(P))!==-1){M=new Array(5);do M[v++]=h.slice(D,A),D=A+re;while((A=h.indexOf(P,D))!==-1);M[v++]=h.slice(D),h=M,w=v}else h=[h],w=1}else S==="object"?w=h.length:(h=[h],w=1)}var le=null,fe,Ne,Ce,It,fn,Gr=h[_],St=h[_+1],Ot,Be;if(_===w)b._listeners&&(typeof b._listeners=="function"?(p&&p.push(b._listeners),le=[b]):(p&&p.push.apply(p,b._listeners),le=[b]));else if(Gr==="*"){for(Ot=l(b),A=Ot.length;A-- >0;)fe=Ot[A],fe!=="_listeners"&&(Be=B(p,h,b[fe],_+1,w),Be&&(le?le.push.apply(le,Be):le=Be));return le}else if(Gr==="**"){for(fn=_+1===w||_+2===w&&St==="*",fn&&b._listeners&&(le=B(p,h,b,w,w)),Ot=l(b),A=Ot.length;A-- >0;)fe=Ot[A],fe!=="_listeners"&&(fe==="*"||fe==="**"?(b[fe]._listeners&&!fn&&(Be=B(p,h,b[fe],w,w),Be&&(le?le.push.apply(le,Be):le=Be)),Be=B(p,h,b[fe],_,w)):fe===St?Be=B(p,h,b[fe],_+2,w):Be=B(p,h,b[fe],_,w),Be&&(le?le.push.apply(le,Be):le=Be));return le}else b[Gr]&&(le=B(p,h,b[Gr],_+1,w));if(Ne=b["*"],Ne&&B(p,h,Ne,_+1,w),Ce=b["**"],Ce)if(_<w)for(Ce._listeners&&B(p,h,Ce,w,w),Ot=l(Ce),A=Ot.length;A-- >0;)fe=Ot[A],fe!=="_listeners"&&(fe===St?B(p,h,Ce[fe],_+2,w):fe===Gr?B(p,h,Ce[fe],_+1,w):(It={},It[fe]=Ce[fe],B(p,h,{"**":It},_+1,w)));else Ce._listeners?B(p,h,Ce,w,w):Ce["*"]&&Ce["*"]._listeners&&B(p,h,Ce["*"],w,w);return le}function G(p,h,b){var _=0,w=0,S,M=this.delimiter,A=M.length,v;if(typeof p=="string")if((S=p.indexOf(M))!==-1){v=new Array(5);do v[_++]=p.slice(w,S),w=S+A;while((S=p.indexOf(M,w))!==-1);v[_++]=p.slice(w)}else v=[p],_=1;else v=p,_=p.length;if(_>1){for(S=0;S+1<_;S++)if(v[S]==="**"&&v[S+1]==="**")return}var D=this.listenerTree,P;for(S=0;S<_;S++)if(P=v[S],D=D[P]||(D[P]={}),S===_-1)return D._listeners?(typeof D._listeners=="function"&&(D._listeners=[D._listeners]),b?D._listeners.unshift(h):D._listeners.push(h),!D._listeners.warned&&this._maxListeners>0&&D._listeners.length>this._maxListeners&&(D._listeners.warned=!0,f.call(this,D._listeners.length,P))):D._listeners=h,!0;return!0}function Te(p,h,b,_){for(var w=l(p),S=w.length,M,A,v,D=p._listeners,P;S-- >0;)A=w[S],M=p[A],A==="_listeners"?v=b:v=b?b.concat(A):[A],P=_||typeof A=="symbol",D&&h.push(P?v:v.join(this.delimiter)),typeof M=="object"&&Te.call(this,M,h,v,P);return h}function Pe(p){for(var h=l(p),b=h.length,_,w,S;b-- >0;)w=h[b],_=p[w],_&&(S=!0,w!=="_listeners"&&!Pe(_)&&delete p[w]);return S}function j(p,h,b){this.emitter=p,this.event=h,this.listener=b}j.prototype.off=function(){return this.emitter.off(this.event,this.listener),this};function W(p,h,b){if(b===!0)w=!0;else if(b===!1)_=!0;else{if(!b||typeof b!="object")throw TypeError("options should be an object or true");var _=b.async,w=b.promisify,S=b.nextTick,M=b.objectify}if(_||S||w){var A=h,v=h._origin||h;if(S&&!i)throw Error("process.nextTick is not supported");w===r&&(w=h.constructor.name==="AsyncFunction"),h=function(){var D=arguments,P=this,re=this.event;return w?S?Promise.resolve():new Promise(function(le){u(le)}).then(function(){return P.event=re,A.apply(P,D)}):(S?process.nextTick:u)(function(){P.event=re,A.apply(P,D)})},h._async=!0,h._origin=v}return[h,M?new j(this,p,h):this]}function O(p){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,d.call(this,p)}O.EventEmitter2=O,O.prototype.listenTo=function(p,h,b){if(typeof p!="object")throw TypeError("target musts be an object");var _=this;b=y(b,{on:r,off:r,reducers:r},{on:R,off:R,reducers:$});function w(S){if(typeof S!="object")throw TypeError("events must be an object");var M=b.reducers,A=ne.call(_,p),v;A===-1?v=new T(_,p,b):v=_._observers[A];for(var D=l(S),P=D.length,re,le=typeof M=="function",fe=0;fe<P;fe++)re=D[fe],v.subscribe(re,S[re]||re,le?M:M&&M[re])}return t(h)?w(g(h)):w(typeof h=="string"?g(h.split(/\s+/)):h),this},O.prototype.stopListeningTo=function(p,h){var b=this._observers;if(!b)return!1;var _=b.length,w,S=!1;if(p&&typeof p!="object")throw TypeError("target should be an object");for(;_-- >0;)w=b[_],(!p||w._target===p)&&(w.unsubscribe(h),S=!0);return S},O.prototype.delimiter=".",O.prototype.setMaxListeners=function(p){p!==r&&(this._maxListeners=p,this._conf||(this._conf={}),this._conf.maxListeners=p)},O.prototype.getMaxListeners=function(){return this._maxListeners},O.prototype.event="",O.prototype.once=function(p,h,b){return this._once(p,h,!1,b)},O.prototype.prependOnceListener=function(p,h,b){return this._once(p,h,!0,b)},O.prototype._once=function(p,h,b,_){return this._many(p,1,h,b,_)},O.prototype.many=function(p,h,b,_){return this._many(p,h,b,!1,_)},O.prototype.prependMany=function(p,h,b,_){return this._many(p,h,b,!0,_)},O.prototype._many=function(p,h,b,_,w){var S=this;if(typeof b!="function")throw new Error("many only accepts instances of Function");function M(){return--h===0&&S.off(p,M),b.apply(this,arguments)}return M._origin=b,this._on(p,M,_,w)},O.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||c.call(this);var p=arguments[0],h,b=this.wildcard,_,w,S,M,A;if(p==="newListener"&&!this._newListener&&!this._events.newListener)return!1;if(b&&(h=p,p!=="newListener"&&p!=="removeListener"&&typeof p=="object")){if(w=p.length,s){for(S=0;S<w;S++)if(typeof p[S]=="symbol"){A=!0;break}}A||(p=p.join(this.delimiter))}var v=arguments.length,D;if(this._all&&this._all.length)for(D=this._all.slice(),S=0,w=D.length;S<w;S++)switch(this.event=p,v){case 1:D[S].call(this,p);break;case 2:D[S].call(this,p,arguments[1]);break;case 3:D[S].call(this,p,arguments[1],arguments[2]);break;default:D[S].apply(this,arguments)}if(b)D=[],B.call(this,D,h,this.listenerTree,0,w);else if(D=this._events[p],typeof D=="function"){switch(this.event=p,v){case 1:D.call(this);break;case 2:D.call(this,arguments[1]);break;case 3:D.call(this,arguments[1],arguments[2]);break;default:for(_=new Array(v-1),M=1;M<v;M++)_[M-1]=arguments[M];D.apply(this,_)}return!0}else D&&(D=D.slice());if(D&&D.length){if(v>3)for(_=new Array(v-1),M=1;M<v;M++)_[M-1]=arguments[M];for(S=0,w=D.length;S<w;S++)switch(this.event=p,v){case 1:D[S].call(this);break;case 2:D[S].call(this,arguments[1]);break;case 3:D[S].call(this,arguments[1],arguments[2]);break;default:D[S].apply(this,_)}return!0}else if(!this.ignoreErrors&&!this._all&&p==="error")throw arguments[1]instanceof Error?arguments[1]:new Error("Uncaught, unspecified 'error' event.");return!!this._all},O.prototype.emitAsync=function(){if(!this._events&&!this._all)return!1;this._events||c.call(this);var p=arguments[0],h=this.wildcard,b,_,w,S,M,A;if(p==="newListener"&&!this._newListener&&!this._events.newListener)return Promise.resolve([!1]);if(h&&(b=p,p!=="newListener"&&p!=="removeListener"&&typeof p=="object")){if(S=p.length,s){for(M=0;M<S;M++)if(typeof p[M]=="symbol"){_=!0;break}}_||(p=p.join(this.delimiter))}var v=[],D=arguments.length,P;if(this._all)for(M=0,S=this._all.length;M<S;M++)switch(this.event=p,D){case 1:v.push(this._all[M].call(this,p));break;case 2:v.push(this._all[M].call(this,p,arguments[1]));break;case 3:v.push(this._all[M].call(this,p,arguments[1],arguments[2]));break;default:v.push(this._all[M].apply(this,arguments))}if(h?(P=[],B.call(this,P,b,this.listenerTree,0)):P=this._events[p],typeof P=="function")switch(this.event=p,D){case 1:v.push(P.call(this));break;case 2:v.push(P.call(this,arguments[1]));break;case 3:v.push(P.call(this,arguments[1],arguments[2]));break;default:for(w=new Array(D-1),A=1;A<D;A++)w[A-1]=arguments[A];v.push(P.apply(this,w))}else if(P&&P.length){if(P=P.slice(),D>3)for(w=new Array(D-1),A=1;A<D;A++)w[A-1]=arguments[A];for(M=0,S=P.length;M<S;M++)switch(this.event=p,D){case 1:v.push(P[M].call(this));break;case 2:v.push(P[M].call(this,arguments[1]));break;case 3:v.push(P[M].call(this,arguments[1],arguments[2]));break;default:v.push(P[M].apply(this,w))}}else if(!this.ignoreErrors&&!this._all&&p==="error")return arguments[1]instanceof Error?Promise.reject(arguments[1]):Promise.reject("Uncaught, unspecified 'error' event.");return Promise.all(v)},O.prototype.on=function(p,h,b){return this._on(p,h,!1,b)},O.prototype.prependListener=function(p,h,b){return this._on(p,h,!0,b)},O.prototype.onAny=function(p){return this._onAny(p,!1)},O.prototype.prependAny=function(p){return this._onAny(p,!0)},O.prototype.addListener=O.prototype.on,O.prototype._onAny=function(p,h){if(typeof p!="function")throw new Error("onAny only accepts instances of Function");return this._all||(this._all=[]),h?this._all.unshift(p):this._all.push(p),this},O.prototype._on=function(p,h,b,_){if(typeof p=="function")return this._onAny(p,h),this;if(typeof h!="function")throw new Error("on only accepts instances of Function");this._events||c.call(this);var w=this,S;return _!==r&&(S=W.call(this,p,h,_),h=S[0],w=S[1]),this._newListener&&this.emit("newListener",p,h),this.wildcard?(G.call(this,p,h,b),w):(this._events[p]?(typeof this._events[p]=="function"&&(this._events[p]=[this._events[p]]),b?this._events[p].unshift(h):this._events[p].push(h),!this._events[p].warned&&this._maxListeners>0&&this._events[p].length>this._maxListeners&&(this._events[p].warned=!0,f.call(this,this._events[p].length,p))):this._events[p]=h,w)},O.prototype.off=function(p,h){if(typeof h!="function")throw new Error("removeListener only takes instances of Function");var b,_=[];if(this.wildcard){var w=typeof p=="string"?p.split(this.delimiter):p.slice();if(_=B.call(this,null,w,this.listenerTree,0),!_)return this}else{if(!this._events[p])return this;b=this._events[p],_.push({_listeners:b})}for(var S=0;S<_.length;S++){var M=_[S];if(b=M._listeners,t(b)){for(var A=-1,v=0,D=b.length;v<D;v++)if(b[v]===h||b[v].listener&&b[v].listener===h||b[v]._origin&&b[v]._origin===h){A=v;break}if(A<0)continue;return this.wildcard?M._listeners.splice(A,1):this._events[p].splice(A,1),b.length===0&&(this.wildcard?delete M._listeners:delete this._events[p]),this._removeListener&&this.emit("removeListener",p,h),this}else(b===h||b.listener&&b.listener===h||b._origin&&b._origin===h)&&(this.wildcard?delete M._listeners:delete this._events[p],this._removeListener&&this.emit("removeListener",p,h))}return this.listenerTree&&Pe(this.listenerTree),this},O.prototype.offAny=function(p){var h=0,b=0,_;if(p&&this._all&&this._all.length>0){for(_=this._all,h=0,b=_.length;h<b;h++)if(p===_[h])return _.splice(h,1),this._removeListener&&this.emit("removeListenerAny",p),this}else{if(_=this._all,this._removeListener)for(h=0,b=_.length;h<b;h++)this.emit("removeListenerAny",_[h]);this._all=[]}return this},O.prototype.removeListener=O.prototype.off,O.prototype.removeAllListeners=function(p){if(p===r)return!this._events||c.call(this),this;if(this.wildcard){var h=B.call(this,null,p,this.listenerTree,0),b,_;if(!h)return this;for(_=0;_<h.length;_++)b=h[_],b._listeners=null;this.listenerTree&&Pe(this.listenerTree)}else this._events&&(this._events[p]=null);return this},O.prototype.listeners=function(p){var h=this._events,b,_,w,S,M;if(p===r){if(this.wildcard)throw Error("event name required for wildcard emitter");if(!h)return[];for(b=l(h),S=b.length,w=[];S-- >0;)_=h[b[S]],typeof _=="function"?w.push(_):w.push.apply(w,_);return w}else{if(this.wildcard){if(M=this.listenerTree,!M)return[];var A=[],v=typeof p=="string"?p.split(this.delimiter):p.slice();return B.call(this,A,v,M,0),A}return h?(_=h[p],_?typeof _=="function"?[_]:_:[]):[]}},O.prototype.eventNames=function(p){var h=this._events;return this.wildcard?Te.call(this,this.listenerTree,[],null,p):h?l(h):[]},O.prototype.listenerCount=function(p){return this.listeners(p).length},O.prototype.hasListeners=function(p){if(this.wildcard){var h=[],b=typeof p=="string"?p.split(this.delimiter):p.slice();return B.call(this,h,b,this.listenerTree,0),h.length>0}var _=this._events,w=this._all;return!!(w&&w.length||_&&(p===r?l(_).length:_[p]))},O.prototype.listenersAny=function(){return this._all?this._all:[]},O.prototype.waitFor=function(p,h){var b=this,_=typeof h;return _==="number"?h={timeout:h}:_==="function"&&(h={filter:h}),h=y(h,{timeout:0,filter:r,handleError:!1,Promise,overload:!1},{filter:R,Promise:E}),q(h.Promise,function(w,S,M){function A(){var v=h.filter;if(!(v&&!v.apply(b,arguments)))if(b.off(p,A),h.handleError){var D=arguments[0];D?S(D):w(m.apply(null,arguments).slice(1))}else w(m.apply(null,arguments))}M(function(){b.off(p,A)}),b._on(p,A,!1)},{timeout:h.timeout,overload:h.overload})};function H(p,h,b){b=y(b,{Promise,timeout:0,overload:!1},{Promise:E});var _=b.Promise;return q(_,function(w,S,M){var A;if(typeof p.addEventListener=="function"){A=function(){w(m.apply(null,arguments))},M(function(){p.removeEventListener(h,A)}),p.addEventListener(h,A,{once:!0});return}var v=function(){D&&p.removeListener("error",D),w(m.apply(null,arguments))},D;h!=="error"&&(D=function(P){p.removeListener(h,v),S(P)},p.once("error",D)),M(function(){D&&p.removeListener("error",D),p.removeListener(h,v)}),p.once(h,v)},{timeout:b.timeout,overload:b.overload})}var U=O.prototype;if(Object.defineProperties(O,{defaultMaxListeners:{get:function(){return U._maxListeners},set:function(p){if(typeof p!="number"||p<0||Number.isNaN(p))throw TypeError("n must be a non-negative number");U._maxListeners=p},enumerable:!0},once:{value:H,writable:!0,configurable:!0}}),Object.defineProperties(U,{_maxListeners:{value:n,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),typeof define=="function"&&define.amd)define(function(){return O});else if(typeof gv=="object")yv.exports=O;else{var Z=new Function("","return this")();Z.EventEmitter2=O}})()});var Sw=k(fh=>{"use strict";Object.defineProperty(fh,"__esModule",{value:!0});var kw=Symbol("MustacheDataPath");function ww({target:r,propertyName:e}){return[...r[kw]||[],e]}function Ew(r,e){return typeof r!="object"?r:new Proxy(r,{get(t,n){let i=t[n];if(i===void 0&&!(n in t)){let s=ww({target:t,propertyName:n});if(e!=null&&e.handleError)return e.handleError(s),i;throw Error(`Missing Mustache data property: ${s.join(" > ")}`)}return i&&typeof i=="object"?(i[kw]=ww({target:t,propertyName:n}),Ew(i,e)):i}})}fh.default=Ew});var un=k(qr=>{"use strict";qr.__esModule=!0;qr.Tokens=qr.StructuralCharacters=qr.Operators=void 0;var WI;(function(r){r.AND="AND",r.OR="OR",r.XOR="XOR",r.NOT="NOT"})(WI=qr.Operators||(qr.Operators={}));var qI;(function(r){r.OPEN_PARENTHESIS="(",r.CLOSE_PARENTHESIS=")"})(qI=qr.StructuralCharacters||(qr.StructuralCharacters={}));var $I;(function(r){r.IDENTIFIER="IDENTIFIER",r.OPERATOR="OPERATOR",r.STRUCTURAL_CHARACTER="STRUCTURAL_CHARACTER",r.EOF="EOF",r.COMMENT="COMMENT"})($I=qr.Tokens||(qr.Tokens={}))});var Th=k(Ys=>{"use strict";Ys.__esModule=!0;Ys.VALID_TOKENS=Ys.OPERATOR_PRECEDENCE=void 0;var qe=un();Ys.OPERATOR_PRECEDENCE={NOT:0,XOR:1,AND:2,OR:3};Ys.VALID_TOKENS={identifierOnly:[{name:qe.Tokens.IDENTIFIER},{name:qe.Tokens.STRUCTURAL_CHARACTER,value:qe.StructuralCharacters.OPEN_PARENTHESIS}],identifierOrNot:[{name:qe.Tokens.IDENTIFIER},{name:qe.Tokens.STRUCTURAL_CHARACTER,value:qe.StructuralCharacters.OPEN_PARENTHESIS},{name:qe.Tokens.OPERATOR,value:qe.Operators.NOT}],binaryOperator:[{name:qe.Tokens.OPERATOR,value:qe.Operators.AND},{name:qe.Tokens.OPERATOR,value:qe.Operators.OR},{name:qe.Tokens.OPERATOR,value:qe.Operators.XOR}],binaryOperatorOrClose:[{name:qe.Tokens.OPERATOR,value:qe.Operators.AND},{name:qe.Tokens.OPERATOR,value:qe.Operators.OR},{name:qe.Tokens.OPERATOR,value:qe.Operators.XOR},{name:qe.Tokens.STRUCTURAL_CHARACTER,value:qe.StructuralCharacters.CLOSE_PARENTHESIS}]}});var _h=k(kt=>{"use strict";kt.__esModule=!0;kt.ESCAPE_CHARACTER=kt.EOL=kt.COMMENT_DELIMITER=kt.QUOTED_IDENTIFIER_DELIMITER=kt.SEPARATORS=kt.OPERATORS=kt.STRUCTURAL_CHARACTERS=void 0;var Bs=un();kt.STRUCTURAL_CHARACTERS={"(":Bs.StructuralCharacters.OPEN_PARENTHESIS,")":Bs.StructuralCharacters.CLOSE_PARENTHESIS};kt.OPERATORS={AND:Bs.Operators.AND,OR:Bs.Operators.OR,XOR:Bs.Operators.XOR,NOT:Bs.Operators.NOT};kt.SEPARATORS=new Set([32,9,10,13].map(function(r){return String.fromCodePoint(r)}));kt.QUOTED_IDENTIFIER_DELIMITER=String.fromCodePoint(34);kt.COMMENT_DELIMITER=String.fromCodePoint(35);kt.EOL=String.fromCodePoint(10);kt.ESCAPE_CHARACTER=String.fromCodePoint(92)});var Cw=k(Sr=>{"use strict";var vh=Sr&&Sr.__assign||function(){return vh=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},vh.apply(this,arguments)};Sr.__esModule=!0;Sr.getQuotedIdentifier=Sr.getComment=Sr.createResult=void 0;var Mw=un(),Vi=_h(),jI=function(r,e,t){return{token:vh({name:r},e!==null?{value:e}:{}),remainingString:t}};Sr.createResult=jI;var GI=function(r){for(var e=r.length,t=0;t<r.length;t+=1){var n=r[t];if(n===Vi.EOL){e=t;break}}return(0,Sr.createResult)(Mw.Tokens.COMMENT,r.slice(0,e),r.slice(e+1))};Sr.getComment=GI;var YI=function(r){for(var e=!1,t="",n=null,i=0;i<r.length;i+=1){var s=r[i];if(n===null)s===Vi.QUOTED_IDENTIFIER_DELIMITER?e?t=t.slice(-1)+Vi.QUOTED_IDENTIFIER_DELIMITER:n=i:(s===Vi.ESCAPE_CHARACTER?e=!0:e=!1,t=t+=s);else{if(!Vi.SEPARATORS.has(s)&&!Vi.STRUCTURAL_CHARACTERS[s])throw new Error("Unexpected character: ".concat(s," Expected ) character or separator"));break}}if(n===null)throw new Error("Unexpected end of expression: expected ".concat(Vi.QUOTED_IDENTIFIER_DELIMITER," character"));return(0,Sr.createResult)(Mw.Tokens.IDENTIFIER,t,r.slice(n+1))};Sr.getQuotedIdentifier=YI});var Aw=k(Ll=>{"use strict";Ll.__esModule=!0;Ll.lex=void 0;var Hs=un(),ir=_h(),Vs=Cw(),BI=function(r){for(var e=null,t=null,n=null,i=0;i<r.length;i+=1){var s=r[i];if(e===null){if(!ir.SEPARATORS.has(s)){var a=ir.STRUCTURAL_CHARACTERS[s];if(a){var o=r[i+1];if(a===Hs.StructuralCharacters.CLOSE_PARENTHESIS&&o&&!ir.SEPARATORS.has(o)&&o!==Hs.StructuralCharacters.CLOSE_PARENTHESIS)throw new Error("Unexpected character: ".concat(o,". A closing parenthesis should be followed by another closing parenthesis or whitespace"));return(0,Vs.createResult)(Hs.Tokens.STRUCTURAL_CHARACTER,ir.STRUCTURAL_CHARACTERS[s],r.slice(i+1))}if(s===ir.QUOTED_IDENTIFIER_DELIMITER)return(0,Vs.getQuotedIdentifier)(r.slice(i+1));if(s===ir.COMMENT_DELIMITER)return(0,Vs.getComment)(r.slice(i+1));e=i}}else if(ir.SEPARATORS.has(s)||ir.STRUCTURAL_CHARACTERS[s]){t=i,n=s;break}else if(s===ir.QUOTED_IDENTIFIER_DELIMITER||s===ir.COMMENT_DELIMITER)throw new Error("Unexpected character: ".concat(s))}if(e!==null){t=t!=null?t:r.length;var u=r.slice(e,t),l=r.slice(t);if(ir.OPERATORS[u]){if(n&&!ir.SEPARATORS.has(n))throw new Error("Unexpected character: ".concat(n,". Operators should be separated using whitespace"));return(0,Vs.createResult)(Hs.Tokens.OPERATOR,ir.OPERATORS[u],l)}else return(0,Vs.createResult)(Hs.Tokens.IDENTIFIER,u,l)}return(0,Vs.createResult)(Hs.Tokens.EOF,null,"")};Ll.lex=BI});var Nw=k(sr=>{"use strict";var Pw=sr&&sr.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,s;n<i;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return r.concat(s||Array.prototype.slice.call(e))};sr.__esModule=!0;sr.validateToken=sr.previousOperatorTakesPrecedent=sr.getValue=sr.newTokenGenerator=void 0;var HI=Aw(),zs=un(),Ul=Th(),VI=function(r){var e=r;return function(t,n){for(n===void 0&&(n=!1);;){var i=(0,HI.lex)(e),s=i.token,a=i.remainingString;if(e=a,s.name!==zs.Tokens.COMMENT)return(0,sr.validateToken)(s,t,n),s}}};sr.newTokenGenerator=VI;var zI=function(r,e){var t=r(Ul.VALID_TOKENS.identifierOrNot),n=t.value===zs.Operators.NOT;n&&(t=r(Ul.VALID_TOKENS.identifierOnly));var i=t.name===zs.Tokens.STRUCTURAL_CHARACTER?e(r,!0):[t];return n?Pw(Pw([],i,!0),[{name:zs.Tokens.OPERATOR,value:zs.Operators.NOT}],!1):i};sr.getValue=zI;var KI=function(r,e){return Ul.OPERATOR_PRECEDENCE[r]<=Ul.OPERATOR_PRECEDENCE[e]};sr.previousOperatorTakesPrecedent=KI;var QI=function(r,e,t){if(t===void 0&&(t=!1),r.name===zs.Tokens.EOF){if(t)return;throw new Error("Unexpected end of expression")}for(var n=0,i=e;n<i.length;n++){var s=i[n];if(s.name===r.name&&(!s.value||s.value===r.value))return}throw new TypeError("Invalid token")};sr.validateToken=QI});var kh=k(Ks=>{"use strict";var ln=Ks&&Ks.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,s;n<i;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return r.concat(s||Array.prototype.slice.call(e))};Ks.__esModule=!0;Ks.parse=void 0;var Iw=un(),Fw=Th(),Wl=Nw(),XI=function(r){if(typeof r!="string")throw new Error("Expected string but received ".concat(typeof r));var e=(0,Wl.newTokenGenerator)(r);return wh(e)};Ks.parse=XI;var wh=function(r,e){e===void 0&&(e=!1);for(var t=ln([],(0,Wl.getValue)(r,wh),!0),n=[];;){var i=e?Fw.VALID_TOKENS.binaryOperatorOrClose:Fw.VALID_TOKENS.binaryOperator,s=r(i,!e);if(s.name===Iw.Tokens.EOF||s.name===Iw.Tokens.STRUCTURAL_CHARACTER)return ln(ln([],t,!0),ln([],n,!0).reverse(),!0);for(;n.length;){var a=n[n.length-1]||null;if(a&&(0,Wl.previousOperatorTakesPrecedent)(a.value,s.value))t=ln(ln([],t,!0),[a],!1),n=n.slice(0,-1);else break}n=ln(ln([],n,!0),[s],!1),t=ln(ln([],t,!0),(0,Wl.getValue)(r,wh),!0)}}});var Eh=k(Et=>{"use strict";Et.__esModule=!0;Et.throwInvalidExpression=Et.isOperator=Et.isIdentifier=Et.notUtil=Et.xorUtil=Et.orUtil=Et.andUtil=void 0;var Lw=un(),ZI=function(r,e){return r&&e};Et.andUtil=ZI;var JI=function(r,e){return r||e};Et.orUtil=JI;var eF=function(r,e){return r!==e};Et.xorUtil=eF;var tF=function(r){return!r};Et.notUtil=tF;var rF=function(r){var e=r.name,t=r.value;return e===Lw.Tokens.IDENTIFIER&&typeof t=="string"};Et.isIdentifier=rF;var nF=function(r){var e=r.name,t=r.value;return e===Lw.Tokens.OPERATOR&&typeof t=="string"};Et.isOperator=nF;var iF=function(r){throw new TypeError("Invalid postfix expression: ".concat(r))};Et.throwInvalidExpression=iF});var Uw=k(ql=>{"use strict";var jo;ql.__esModule=!0;ql.OPERATOR_MAP=void 0;var Sh=un(),Oh=Eh();ql.OPERATOR_MAP=(jo={},jo[Sh.Operators.AND]=Oh.andUtil,jo[Sh.Operators.OR]=Oh.orUtil,jo[Sh.Operators.XOR]=Oh.xorUtil,jo)});var qw=k(Wn=>{"use strict";var Qs=Wn&&Wn.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,s;n<i;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return r.concat(s||Array.prototype.slice.call(e))};Wn.__esModule=!0;Wn.evaluate=Wn.getEvaluator=void 0;var sF=kh(),Ww=un(),aF=Uw(),zi=Eh(),oF=function(r){var e=(0,sF.parse)(r);return function(t){return(0,Wn.evaluate)(e,t)}};Wn.getEvaluator=oF;var uF=function(r,e){if(!Array.isArray(r))throw new Error("".concat(r," should be an array. evaluate takes in a parsed expression. Use in combination with parse or use getEvaluator"));var t=r.reduce(function(n,i,s){if(!(i&&((0,zi.isIdentifier)(i)||(0,zi.isOperator)(i))))throw new Error("Invalid token: ".concat(i,". Found in parsed expression at index ").concat(s));if(i.name===Ww.Tokens.IDENTIFIER)return Qs(Qs([],n,!0),[Boolean(e[i.value])],!1);var a=n[n.length-2],o=n[n.length-1];if(i.value===Ww.Operators.NOT)return o===void 0&&(0,zi.throwInvalidExpression)("missing identifier"),Qs(Qs([],n.slice(0,-1),!0),[(0,zi.notUtil)(o)],!1);(o===void 0||a===void 0)&&(0,zi.throwInvalidExpression)("missing identifier");var u=aF.OPERATOR_MAP[i.value];return u||(0,zi.throwInvalidExpression)("unknown operator"),Qs(Qs([],n.slice(0,-2),!0),[u(a,o)],!1)},[]);return t.length!==1&&(0,zi.throwInvalidExpression)("too many identifiers after evaluation"),t[0]};Wn.evaluate=uF});var jw=k(cn=>{"use strict";var Dh=cn&&cn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]});cn.__esModule=!0;cn.parse=cn.evaluate=cn.getEvaluator=void 0;var $w=qw();Dh(cn,$w,"getEvaluator");Dh(cn,$w,"evaluate");var lF=kh();Dh(cn,lF,"parse")});var EF={};Zk(EF,{default:()=>mc});module.exports=Jk(EF);var Ck=require("obsidian");var Ss=require("obsidian");var OF=new Error("timeout while waiting for mutex to become available"),DF=new Error("mutex already locked"),eE=new Error("request for lock canceled"),tE=function(r,e,t,n){function i(s){return s instanceof t?s:new t(function(a){a(s)})}return new(t||(t=Promise))(function(s,a){function o(c){try{l(n.next(c))}catch(d){a(d)}}function u(c){try{l(n.throw(c))}catch(d){a(d)}}function l(c){c.done?s(c.value):i(c.value).then(o,u)}l((n=n.apply(r,e||[])).next())})},kc=class{constructor(e,t=eE){this._value=e,this._cancelError=t,this._weightedQueues=[],this._weightedWaiters=[]}acquire(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise((t,n)=>{this._weightedQueues[e-1]||(this._weightedQueues[e-1]=[]),this._weightedQueues[e-1].push({resolve:t,reject:n}),this._dispatch()})}runExclusive(e,t=1){return tE(this,void 0,void 0,function*(){let[n,i]=yield this.acquire(t);try{return yield e(n)}finally{i()}})}waitForUnlock(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise(t=>{this._weightedWaiters[e-1]||(this._weightedWaiters[e-1]=[]),this._weightedWaiters[e-1].push(t),this._dispatch()})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(e){this._value=e,this._dispatch()}release(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);this._value+=e,this._dispatch()}cancel(){this._weightedQueues.forEach(e=>e.forEach(t=>t.reject(this._cancelError))),this._weightedQueues=[]}_dispatch(){var e;for(let t=this._value;t>0;t--){let n=(e=this._weightedQueues[t-1])===null||e===void 0?void 0:e.shift();if(!n)continue;let i=this._value,s=t;this._value-=t,t=this._value+1,n.resolve([i,this._newReleaser(s)])}this._drainUnlockWaiters()}_newReleaser(e){let t=!1;return()=>{t||(t=!0,this.release(e))}}_drainUnlockWaiters(){for(let e=this._value;e>0;e--)!this._weightedWaiters[e-1]||(this._weightedWaiters[e-1].forEach(t=>t()),this._weightedWaiters[e-1]=[])}},rE=function(r,e,t,n){function i(s){return s instanceof t?s:new t(function(a){a(s)})}return new(t||(t=Promise))(function(s,a){function o(c){try{l(n.next(c))}catch(d){a(d)}}function u(c){try{l(n.throw(c))}catch(d){a(d)}}function l(c){c.done?s(c.value):i(c.value).then(o,u)}l((n=n.apply(r,e||[])).next())})},Zo=class{constructor(e){this._semaphore=new kc(1,e)}acquire(){return rE(this,void 0,void 0,function*(){let[,e]=yield this._semaphore.acquire();return e})}runExclusive(e){return this._semaphore.runExclusive(()=>e())}isLocked(){return this._semaphore.isLocked()}waitForUnlock(){return this._semaphore.waitForUnlock()}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}};var Qe=class{constructor(e){this._path=e}get path(){return this._path}get pathWithoutExtension(){return this.withoutExtension(this.path)}withoutExtension(e){return e.replace(/\.md$/,"")}get root(){let e=this.path.replace(/\\/g,"/");e.charAt(0)==="/"&&(e=e.substring(1));let t=e.indexOf("/");return t==-1?"/":e.substring(0,t+1)}get folder(){let e=this.path,t=this.filename,n=e.substring(0,e.lastIndexOf(t));return n===""?"/":n}get filename(){let e=this.path.match(/([^/]+)$/);return e!==null?e[1]:""}get filenameWithoutExtension(){return this.withoutExtension(this.filename)}};var Yu=pa(Xe());var Rt=class{constructor(e,t){this.start=e,this.end=t,t.isBefore(e)&&(this.start=t,this.end=e),this.start=this.start.startOf("day"),this.end=this.end.startOf("day")}static buildRelative(e){let t=e==="week"?"isoWeek":e;return new Rt(window.moment().startOf(t).startOf("day"),window.moment().endOf(t).startOf("day"))}static buildInvalid(){return new Rt(window.moment.invalid(),window.moment.invalid())}isValid(){return this.start.isValid()&&this.end.isValid()}moveToPrevious(e){let t=window.moment.duration(1,e);this.start.subtract(t),this.end.subtract(t),(e==="month"||e==="quarter")&&(this.end=this.end.endOf(e).startOf("day"))}moveToNext(e){let t=window.moment.duration(1,e);this.start.add(t),this.end.add(t),(e==="month"||e==="quarter")&&(this.end=this.end.endOf(e).startOf("day"))}};var Qt=class{static parseDate(e,t=!1){return window.moment(Yu.parseDate(e,void 0,{forwardDate:t})).startOf("day")}static parseDateRange(e,t=!1){let n=[Qt.parseRelativeDateRange,Qt.parseNumberedDateRange,Qt.parseAbsoluteDateRange];for(let i of n){let s=i(e,t);if(s.isValid())return s}return Rt.buildInvalid()}static parseAbsoluteDateRange(e,t){let n=Yu.parse(e,void 0,{forwardDate:t});if(n.length===0)return Rt.buildInvalid();let i=n[0].start,s=n[1]&&n[1].start?n[1].start:i,a=window.moment(i.date()),o=window.moment(s.date());return new Rt(a,o)}static parseRelativeDateRange(e,t){let n=/(last|this|next) (week|month|quarter|year)/,i=e.match(n);if(i&&i.length===3){let s=i[1],a=i[2],o=Rt.buildRelative(a);switch(s){case"last":o.moveToPrevious(a);break;case"next":o.moveToNext(a);break}return o}return Rt.buildInvalid()}static parseNumberedDateRange(e,t){let n=[[/^\s*[0-9]{4}\s*$/,"YYYY","year"],[/^\s*[0-9]{4}-Q[1-4]\s*$/,"YYYY-Q","quarter"],[/^\s*[0-9]{4}-[0-9]{2}\s*$/,"YYYY-MM","month"],[/^\s*[0-9]{4}-W[0-9]{2}\s*$/,"YYYY-WW","isoWeek"]];for(let[i,s,a]of n){let o=e.match(i);if(o){let u=o[0].trim();return new Rt(window.moment(u,s).startOf(a),window.moment(u,s).endOf(a))}}return Rt.buildInvalid()}};var _P={td:"today",tm:"tomorrow",yd:"yesterday",tw:"this week",nw:"next week",weekend:"sat",we:"sat"};function Bu(r){for(let[e,t]of Object.entries(_P))r=r.replace(RegExp(`\\b${e}\\s`,"i"),t);return r}var Hu=["MO","TU","WE","TH","FR","SA","SU"],Ke=function(){function r(e,t){if(t===0)throw new Error("Can't create weekday with n == 0");this.weekday=e,this.n=t}return r.fromStr=function(e){return new r(Hu.indexOf(e))},r.prototype.nth=function(e){return this.n===e?this:new r(this.weekday,e)},r.prototype.equals=function(e){return this.weekday===e.weekday&&this.n===e.n},r.prototype.toString=function(){var e=Hu[this.weekday];return this.n&&(e=(this.n>0?"+":"")+String(this.n)+e),e},r.prototype.getJsWeekday=function(){return this.weekday===6?0:this.weekday+1},r}();var Fe=function(r){return r!=null},Xt=function(r){return typeof r=="number"},mm=function(r){return typeof r=="string"&&Hu.includes(r)},pt=Array.isArray,yr=function(r,e){e===void 0&&(e=r),arguments.length===1&&(e=r,r=0);for(var t=[],n=r;n<e;n++)t.push(n);return t};var ge=function(r,e){var t=0,n=[];if(pt(r))for(;t<e;t++)n[t]=[].concat(r);else for(;t<e;t++)n[t]=r;return n},__=function(r){return pt(r)?r:[r]};function Di(r,e,t){t===void 0&&(t=" ");var n=String(r);return e=e>>0,n.length>e?String(n):(e=e-n.length,e>t.length&&(t+=ge(t,e/t.length)),t.slice(0,e)+String(n))}var v_=function(r,e,t){var n=r.split(e);return t?n.slice(0,t).concat([n.slice(t).join(e)]):n},bt=function(r,e){var t=r%e;return t*e<0?t+e:t},Vu=function(r,e){return{div:Math.floor(r/e),mod:bt(r,e)}},Zt=function(r){return!Fe(r)||r.length===0},je=function(r){return!Zt(r)},ye=function(r,e){return je(r)&&r.indexOf(e)!==-1};var Xr=function(r,e,t,n,i,s){return n===void 0&&(n=0),i===void 0&&(i=0),s===void 0&&(s=0),new Date(Date.UTC(r,e-1,t,n,i,s))},vP=[31,28,31,30,31,30,31,31,30,31,30,31],E_=1e3*60*60*24,zu=9999,S_=Xr(1970,1,1),wP=[6,0,1,2,3,4,5];var ys=function(r){return r%4===0&&r%100!==0||r%400===0},hm=function(r){return r instanceof Date},xi=function(r){return hm(r)&&!isNaN(r.getTime())},w_=function(r){return r.getTimezoneOffset()*60*1e3},kP=function(r,e){var t=r.getTime()-w_(r),n=e.getTime()-w_(e),i=t-n;return Math.round(i/E_)},ho=function(r){return kP(r,S_)},Ku=function(r){return new Date(S_.getTime()+r*E_)},EP=function(r){var e=r.getUTCMonth();return e===1&&ys(r.getUTCFullYear())?29:vP[e]},Sn=function(r){return wP[r.getUTCDay()]},gm=function(r,e){var t=Xr(r,e+1,1);return[Sn(t),EP(t)]},Qu=function(r,e){return e=e||r,new Date(Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))},Xu=function(r){var e=new Date(r.getTime());return e},ym=function(r){for(var e=[],t=0;t<r.length;t++)e.push(Xu(r[t]));return e},On=function(r){r.sort(function(e,t){return e.getTime()-t.getTime()})},bs=function(r,e){e===void 0&&(e=!0);var t=new Date(r);return[Di(t.getUTCFullYear().toString(),4,"0"),Di(t.getUTCMonth()+1,2,"0"),Di(t.getUTCDate(),2,"0"),"T",Di(t.getUTCHours(),2,"0"),Di(t.getUTCMinutes(),2,"0"),Di(t.getUTCSeconds(),2,"0"),e?"Z":""].join("")},go=function(r){var e=/^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z?)?$/,t=e.exec(r);if(!t)throw new Error("Invalid UNTIL value: ".concat(r));return new Date(Date.UTC(parseInt(t[1],10),parseInt(t[2],10)-1,parseInt(t[3],10),parseInt(t[5],10)||0,parseInt(t[6],10)||0,parseInt(t[7],10)||0))},k_=function(r,e){var t=r.toLocaleString("sv-SE",{timeZone:e});return t.replace(" ","T")+"Z"},O_=function(r,e){var t=Intl.DateTimeFormat().resolvedOptions().timeZone,n=new Date(k_(r,t)),i=new Date(k_(r,e!=null?e:"UTC")),s=i.getTime()-n.getTime();return new Date(r.getTime()-s)};var SP=function(){function r(e,t){this.minDate=null,this.maxDate=null,this._result=[],this.total=0,this.method=e,this.args=t,e==="between"?(this.maxDate=t.inc?t.before:new Date(t.before.getTime()-1),this.minDate=t.inc?t.after:new Date(t.after.getTime()+1)):e==="before"?this.maxDate=t.inc?t.dt:new Date(t.dt.getTime()-1):e==="after"&&(this.minDate=t.inc?t.dt:new Date(t.dt.getTime()+1))}return r.prototype.accept=function(e){++this.total;var t=this.minDate&&e<this.minDate,n=this.maxDate&&e>this.maxDate;if(this.method==="between"){if(t)return!0;if(n)return!1}else if(this.method==="before"){if(n)return!1}else if(this.method==="after")return t?!0:(this.add(e),!1);return this.add(e)},r.prototype.add=function(e){return this._result.push(e),!0},r.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}},r.prototype.clone=function(){return new r(this.method,this.args)},r}(),Dn=SP;var bm=function(r,e){return bm=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},bm(r,e)};function Ts(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");bm(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var mt=function(){return mt=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},mt.apply(this,arguments)};function I(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,s;n<i;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return r.concat(s||Array.prototype.slice.call(e))}var OP=function(r){Ts(e,r);function e(t,n,i){var s=r.call(this,t,n)||this;return s.iterator=i,s}return e.prototype.add=function(t){return this.iterator(t,this._result.length)?(this._result.push(t),!0):!1},e}(Dn),Tm=OP;var DP={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}},Ri=DP;var D_=function(r,e){return r.indexOf(e)!==-1},xP=function(r){return r.toString()},RP=function(r,e,t){return"".concat(e," ").concat(t,", ").concat(r)},MP=function(){function r(e,t,n,i){if(t===void 0&&(t=xP),n===void 0&&(n=Ri),i===void 0&&(i=RP),this.text=[],this.language=n||Ri,this.gettext=t,this.dateFormatter=i,this.rrule=e,this.options=e.options,this.origOptions=e.origOptions,this.origOptions.bymonthday){var s=[].concat(this.options.bymonthday),a=[].concat(this.options.bynmonthday);s.sort(function(c,d){return c-d}),a.sort(function(c,d){return d-c}),this.bymonthday=s.concat(a),this.bymonthday.length||(this.bymonthday=null)}if(Fe(this.origOptions.byweekday)){var o=pt(this.origOptions.byweekday)?this.origOptions.byweekday:[this.origOptions.byweekday],u=String(o);this.byweekday={allWeeks:o.filter(function(c){return!c.n}),someWeeks:o.filter(function(c){return Boolean(c.n)}),isWeekdays:u.indexOf("MO")!==-1&&u.indexOf("TU")!==-1&&u.indexOf("WE")!==-1&&u.indexOf("TH")!==-1&&u.indexOf("FR")!==-1&&u.indexOf("SA")===-1&&u.indexOf("SU")===-1,isEveryDay:u.indexOf("MO")!==-1&&u.indexOf("TU")!==-1&&u.indexOf("WE")!==-1&&u.indexOf("TH")!==-1&&u.indexOf("FR")!==-1&&u.indexOf("SA")!==-1&&u.indexOf("SU")!==-1};var l=function(c,d){return c.weekday-d.weekday};this.byweekday.allWeeks.sort(l),this.byweekday.someWeeks.sort(l),this.byweekday.allWeeks.length||(this.byweekday.allWeeks=null),this.byweekday.someWeeks.length||(this.byweekday.someWeeks=null)}else this.byweekday=null}return r.isFullyConvertible=function(e){var t=!0;if(!(e.options.freq in r.IMPLEMENTED)||e.origOptions.until&&e.origOptions.count)return!1;for(var n in e.origOptions){if(D_(["dtstart","wkst","freq"],n))return!0;if(!D_(r.IMPLEMENTED[e.options.freq],n))return!1}return t},r.prototype.isFullyConvertible=function(){return r.isFullyConvertible(this.rrule)},r.prototype.toString=function(){var e=this.gettext;if(!(this.options.freq in r.IMPLEMENTED))return e("RRule error: Unable to fully convert this rrule to text");if(this.text=[e("every")],this[z.FREQUENCIES[this.options.freq]](),this.options.until){this.add(e("until"));var t=this.options.until;this.add(this.dateFormatter(t.getUTCFullYear(),this.language.monthNames[t.getUTCMonth()],t.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("")},r.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"))},r.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"))},r.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()},r.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())},r.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()},r.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")))},r.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")))},r.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"))))},r.prototype._byhour=function(){var e=this.gettext;this.add(e("at")).add(this.list(this.origOptions.byhour,void 0,e("and")))},r.prototype._bymonth=function(){this.add(this.list(this.options.bymonth,this.monthtext,this.gettext("and")))},r.prototype.nth=function(e){e=parseInt(e.toString(),10);var t,n=this.gettext;if(e===-1)return n("last");var i=Math.abs(e);switch(i){case 1:case 21:case 31:t=i+n("st");break;case 2:case 22:t=i+n("nd");break;case 3:case 23:t=i+n("rd");break;default:t=i+n("th")}return e<0?t+" "+n("last"):t},r.prototype.monthtext=function(e){return this.language.monthNames[e-1]},r.prototype.weekdaytext=function(e){var t=Xt(e)?(e+1)%7:e.getJsWeekday();return(e.n?this.nth(e.n)+" ":"")+this.language.dayNames[t]},r.prototype.plural=function(e){return e%100!==1},r.prototype.add=function(e){return this.text.push(" "),this.text.push(e),this},r.prototype.list=function(e,t,n,i){var s=this;i===void 0&&(i=","),pt(e)||(e=[e]);var a=function(u,l,c){for(var d="",f=0;f<u.length;f++)f!==0&&(f===u.length-1?d+=" "+c+" ":d+=l+" "),d+=u[f];return d};t=t||function(u){return u.toString()};var o=function(u){return t&&t.call(s,u)};return n?a(e.map(o),i,n):e.map(o).join(i+" ")},r}(),Zr=MP;var CP=function(){function r(e){this.done=!0,this.rules=e}return r.prototype.start=function(e){return this.text=e,this.done=!1,this.nextSymbol()},r.prototype.isDone=function(){return this.done&&this.symbol===null},r.prototype.nextSymbol=function(){var e,t;this.symbol=null,this.value=null;do{if(this.done)return!1;var n=void 0;e=null;for(var i in this.rules){n=this.rules[i];var s=n.exec(this.text);s&&(e===null||s[0].length>e[0].length)&&(e=s,t=i)}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(t==="SKIP");return this.symbol=t,this.value=e,!0},r.prototype.accept=function(e){if(this.symbol===e){if(this.value){var t=this.value;return this.nextSymbol(),t}return this.nextSymbol(),!0}return!1},r.prototype.acceptNumber=function(){return this.accept("number")},r.prototype.expect=function(e){if(this.accept(e))return!0;throw new Error("expected "+e+" but found "+this.symbol)},r}();function yo(r,e){e===void 0&&(e=Ri);var t={},n=new CP(e.tokens);if(!n.start(r))return null;return i(),t;function i(){n.expect("every");var f=n.acceptNumber();if(f&&(t.interval=parseInt(f[0],10)),n.isDone())throw new Error("Unexpected end");switch(n.symbol){case"day(s)":t.freq=z.DAILY,n.nextSymbol()&&(a(),d());break;case"weekday(s)":t.freq=z.WEEKLY,t.byweekday=[z.MO,z.TU,z.WE,z.TH,z.FR],n.nextSymbol(),d();break;case"week(s)":t.freq=z.WEEKLY,n.nextSymbol()&&(s(),d());break;case"hour(s)":t.freq=z.HOURLY,n.nextSymbol()&&(s(),d());break;case"minute(s)":t.freq=z.MINUTELY,n.nextSymbol()&&(s(),d());break;case"month(s)":t.freq=z.MONTHLY,n.nextSymbol()&&(s(),d());break;case"year(s)":t.freq=z.YEARLY,n.nextSymbol()&&(s(),d());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":t.freq=z.WEEKLY;var m=n.symbol.substr(0,2).toUpperCase();if(t.byweekday=[z[m]],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var g=u();if(!g)throw new Error("Unexpected symbol "+n.symbol+", expected weekday");t.byweekday.push(z[g]),n.nextSymbol()}c(),d();break;case"january":case"february":case"march":case"april":case"may":case"june":case"july":case"august":case"september":case"october":case"november":case"december":if(t.freq=z.YEARLY,t.bymonth=[o()],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var T=o();if(!T)throw new Error("Unexpected symbol "+n.symbol+", expected month");t.bymonth.push(T),n.nextSymbol()}s(),d();break;default:throw new Error("Unknown symbol")}}function s(){var f=n.accept("on"),m=n.accept("the");if(!!(f||m))do{var g=l(),T=u(),y=o();if(g)T?(n.nextSymbol(),t.byweekday||(t.byweekday=[]),t.byweekday.push(z[T].nth(g))):(t.bymonthday||(t.bymonthday=[]),t.bymonthday.push(g),n.accept("day(s)"));else if(T)n.nextSymbol(),t.byweekday||(t.byweekday=[]),t.byweekday.push(z[T]);else if(n.symbol==="weekday(s)")n.nextSymbol(),t.byweekday||(t.byweekday=[z.MO,z.TU,z.WE,z.TH,z.FR]);else if(n.symbol==="week(s)"){n.nextSymbol();var E=n.acceptNumber();if(!E)throw new Error("Unexpected symbol "+n.symbol+", expected week number");for(t.byweekno=[parseInt(E[0],10)];n.accept("comma");){if(E=n.acceptNumber(),!E)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");t.byweekno.push(parseInt(E[0],10))}}else if(y)n.nextSymbol(),t.bymonth||(t.bymonth=[]),t.bymonth.push(y);else return}while(n.accept("comma")||n.accept("the")||n.accept("on"))}function a(){var f=n.accept("at");if(!!f)do{var m=n.acceptNumber();if(!m)throw new Error("Unexpected symbol "+n.symbol+", expected hour");for(t.byhour=[parseInt(m[0],10)];n.accept("comma");){if(m=n.acceptNumber(),!m)throw new Error("Unexpected symbol "+n.symbol+"; expected hour");t.byhour.push(parseInt(m[0],10))}}while(n.accept("comma")||n.accept("at"))}function o(){switch(n.symbol){case"january":return 1;case"february":return 2;case"march":return 3;case"april":return 4;case"may":return 5;case"june":return 6;case"july":return 7;case"august":return 8;case"september":return 9;case"october":return 10;case"november":return 11;case"december":return 12;default:return!1}}function u(){switch(n.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return n.symbol.substr(0,2).toUpperCase();default:return!1}}function l(){switch(n.symbol){case"last":return n.nextSymbol(),-1;case"first":return n.nextSymbol(),1;case"second":return n.nextSymbol(),n.accept("last")?-2:2;case"third":return n.nextSymbol(),n.accept("last")?-3:3;case"nth":var f=parseInt(n.value[1],10);if(f<-366||f>366)throw new Error("Nth out of range: "+f);return n.nextSymbol(),n.accept("last")?-f:f;default:return!1}}function c(){n.accept("on"),n.accept("the");var f=l();if(!!f)for(t.bymonthday=[f],n.nextSymbol();n.accept("comma");){if(f=l(),!f)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");t.bymonthday.push(f),n.nextSymbol()}}function d(){if(n.symbol==="until"){var f=Date.parse(n.text);if(!f)throw new Error("Cannot parse until date:"+n.text);t.until=new Date(f)}else n.accept("for")&&(t.count=parseInt(n.value[0],10),n.expect("number"))}}var me;(function(r){r[r.YEARLY=0]="YEARLY",r[r.MONTHLY=1]="MONTHLY",r[r.WEEKLY=2]="WEEKLY",r[r.DAILY=3]="DAILY",r[r.HOURLY=4]="HOURLY",r[r.MINUTELY=5]="MINUTELY",r[r.SECONDLY=6]="SECONDLY"})(me||(me={}));function bo(r){return r<me.HOURLY}var x_=function(r,e){return e===void 0&&(e=Ri),new z(yo(r,e)||void 0)},_s=["count","until","interval","byweekday","bymonthday","bymonth"];Zr.IMPLEMENTED=[];Zr.IMPLEMENTED[me.HOURLY]=_s;Zr.IMPLEMENTED[me.MINUTELY]=_s;Zr.IMPLEMENTED[me.DAILY]=["byhour"].concat(_s);Zr.IMPLEMENTED[me.WEEKLY]=_s;Zr.IMPLEMENTED[me.MONTHLY]=_s;Zr.IMPLEMENTED[me.YEARLY]=["byweekno","byyearday"].concat(_s);var R_=function(r,e,t,n){return new Zr(r,e,t,n).toString()},M_=Zr.isFullyConvertible;var vs=function(){function r(e,t,n,i){this.hour=e,this.minute=t,this.second=n,this.millisecond=i||0}return r.prototype.getHours=function(){return this.hour},r.prototype.getMinutes=function(){return this.minute},r.prototype.getSeconds=function(){return this.second},r.prototype.getMilliseconds=function(){return this.millisecond},r.prototype.getTime=function(){return(this.hour*60*60+this.minute*60+this.second)*1e3+this.millisecond},r}();var C_=function(r){Ts(e,r);function e(t,n,i,s,a,o,u){var l=r.call(this,s,a,o,u)||this;return l.year=t,l.month=n,l.day=i,l}return e.fromDate=function(t){return new this(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.valueOf()%1e3)},e.prototype.getWeekday=function(){return Sn(new Date(this.getTime()))},e.prototype.getTime=function(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond)).getTime()},e.prototype.getDay=function(){return this.day},e.prototype.getMonth=function(){return this.month},e.prototype.getYear=function(){return this.year},e.prototype.addYears=function(t){this.year+=t},e.prototype.addMonths=function(t){if(this.month+=t,this.month>12){var n=Math.floor(this.month/12),i=bt(this.month,12);this.month=i,this.year+=n,this.month===0&&(this.month=12,--this.year)}},e.prototype.addWeekly=function(t,n){n>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-n))+t*7:this.day+=-(this.getWeekday()-n)+t*7,this.fixDay()},e.prototype.addDaily=function(t){this.day+=t,this.fixDay()},e.prototype.addHours=function(t,n,i){for(n&&(this.hour+=Math.floor((23-this.hour)/t)*t);;){this.hour+=t;var s=Vu(this.hour,24),a=s.div,o=s.mod;if(a&&(this.hour=o,this.addDaily(a)),Zt(i)||ye(i,this.hour))break}},e.prototype.addMinutes=function(t,n,i,s){for(n&&(this.minute+=Math.floor((1439-(this.hour*60+this.minute))/t)*t);;){this.minute+=t;var a=Vu(this.minute,60),o=a.div,u=a.mod;if(o&&(this.minute=u,this.addHours(o,!1,i)),(Zt(i)||ye(i,this.hour))&&(Zt(s)||ye(s,this.minute)))break}},e.prototype.addSeconds=function(t,n,i,s,a){for(n&&(this.second+=Math.floor((86399-(this.hour*3600+this.minute*60+this.second))/t)*t);;){this.second+=t;var o=Vu(this.second,60),u=o.div,l=o.mod;if(u&&(this.second=l,this.addMinutes(u,!1,i,s)),(Zt(i)||ye(i,this.hour))&&(Zt(s)||ye(s,this.minute))&&(Zt(a)||ye(a,this.second)))break}},e.prototype.fixDay=function(){if(!(this.day<=28)){var t=gm(this.year,this.month-1)[1];if(!(this.day<=t))for(;this.day>t;){if(this.day-=t,++this.month,this.month===13&&(this.month=1,++this.year,this.year>zu))return;t=gm(this.year,this.month-1)[1]}}},e.prototype.add=function(t,n){var i=t.freq,s=t.interval,a=t.wkst,o=t.byhour,u=t.byminute,l=t.bysecond;switch(i){case me.YEARLY:return this.addYears(s);case me.MONTHLY:return this.addMonths(s);case me.WEEKLY:return this.addWeekly(s,a);case me.DAILY:return this.addDaily(s);case me.HOURLY:return this.addHours(s,n,o);case me.MINUTELY:return this.addMinutes(s,n,o,u);case me.SECONDLY:return this.addSeconds(s,n,o,u,l)}},e}(vs);function _m(r){for(var e=[],t=Object.keys(r),n=0,i=t;n<i.length;n++){var s=i[n];ye(N_,s)||e.push(s),hm(r[s])&&!xi(r[s])&&e.push(s)}if(e.length)throw new Error("Invalid options: "+e.join(", "));return mt({},r)}function A_(r){var e=mt(mt({},To),_m(r));if(Fe(e.byeaster)&&(e.freq=z.YEARLY),!(Fe(e.freq)&&z.FREQUENCIES[e.freq]))throw new Error("Invalid frequency: ".concat(e.freq," ").concat(r.freq));if(e.dtstart||(e.dtstart=new Date(new Date().setMilliseconds(0))),Fe(e.wkst)?Xt(e.wkst)||(e.wkst=e.wkst.weekday):e.wkst=z.MO.weekday,Fe(e.bysetpos)){Xt(e.bysetpos)&&(e.bysetpos=[e.bysetpos]);for(var t=0;t<e.bysetpos.length;t++){var n=e.bysetpos[t];if(n===0||!(n>=-366&&n<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(Boolean(e.byweekno)||je(e.byweekno)||je(e.byyearday)||Boolean(e.bymonthday)||je(e.bymonthday)||Fe(e.byweekday)||Fe(e.byeaster)))switch(e.freq){case z.YEARLY:e.bymonth||(e.bymonth=e.dtstart.getUTCMonth()+1),e.bymonthday=e.dtstart.getUTCDate();break;case z.MONTHLY:e.bymonthday=e.dtstart.getUTCDate();break;case z.WEEKLY:e.byweekday=[Sn(e.dtstart)];break}if(Fe(e.bymonth)&&!pt(e.bymonth)&&(e.bymonth=[e.bymonth]),Fe(e.byyearday)&&!pt(e.byyearday)&&Xt(e.byyearday)&&(e.byyearday=[e.byyearday]),!Fe(e.bymonthday))e.bymonthday=[],e.bynmonthday=[];else if(pt(e.bymonthday)){for(var i=[],s=[],t=0;t<e.bymonthday.length;t++){var n=e.bymonthday[t];n>0?i.push(n):n<0&&s.push(n)}e.bymonthday=i,e.bynmonthday=s}else e.bymonthday<0?(e.bynmonthday=[e.bymonthday],e.bymonthday=[]):(e.bynmonthday=[],e.bymonthday=[e.bymonthday]);if(Fe(e.byweekno)&&!pt(e.byweekno)&&(e.byweekno=[e.byweekno]),!Fe(e.byweekday))e.bynweekday=null;else if(Xt(e.byweekday))e.byweekday=[e.byweekday],e.bynweekday=null;else if(mm(e.byweekday))e.byweekday=[Ke.fromStr(e.byweekday).weekday],e.bynweekday=null;else if(e.byweekday instanceof Ke)!e.byweekday.n||e.freq>z.MONTHLY?(e.byweekday=[e.byweekday.weekday],e.bynweekday=null):(e.bynweekday=[[e.byweekday.weekday,e.byweekday.n]],e.byweekday=null);else{for(var a=[],o=[],t=0;t<e.byweekday.length;t++){var u=e.byweekday[t];if(Xt(u)){a.push(u);continue}else if(mm(u)){a.push(Ke.fromStr(u).weekday);continue}!u.n||e.freq>z.MONTHLY?a.push(u.weekday):o.push([u.weekday,u.n])}e.byweekday=je(a)?a:null,e.bynweekday=je(o)?o:null}return Fe(e.byhour)?Xt(e.byhour)&&(e.byhour=[e.byhour]):e.byhour=e.freq<z.HOURLY?[e.dtstart.getUTCHours()]:null,Fe(e.byminute)?Xt(e.byminute)&&(e.byminute=[e.byminute]):e.byminute=e.freq<z.MINUTELY?[e.dtstart.getUTCMinutes()]:null,Fe(e.bysecond)?Xt(e.bysecond)&&(e.bysecond=[e.bysecond]):e.bysecond=e.freq<z.SECONDLY?[e.dtstart.getUTCSeconds()]:null,{parsedOptions:e}}function P_(r){var e=r.dtstart.getTime()%1e3;if(!bo(r.freq))return[];var t=[];return r.byhour.forEach(function(n){r.byminute.forEach(function(i){r.bysecond.forEach(function(s){t.push(new vs(n,i,s,e))})})}),t}function vo(r){var e=r.split(` +`).map(AP).filter(function(t){return t!==null});return mt(mt({},e[0]),e[1])}function _o(r){var e={},t=/DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(r);if(!t)return e;var n=t[1],i=t[2];return n&&(e.tzid=n),e.dtstart=go(i),e}function AP(r){if(r=r.replace(/^\s+|\s+$/,""),!r.length)return null;var e=/^([A-Z]+?)[:;]/.exec(r.toUpperCase());if(!e)return I_(r);var t=e[1];switch(t.toUpperCase()){case"RRULE":case"EXRULE":return I_(r);case"DTSTART":return _o(r);default:throw new Error("Unsupported RFC prop ".concat(t," in ").concat(r))}}function I_(r){var e=r.replace(/^RRULE:/i,""),t=_o(e),n=r.replace(/^(?:RRULE|EXRULE):/i,"").split(";");return n.forEach(function(i){var s=i.split("="),a=s[0],o=s[1];switch(a.toUpperCase()){case"FREQ":t.freq=me[o.toUpperCase()];break;case"WKST":t.wkst=br[o.toUpperCase()];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var u=PP(o),l=a.toLowerCase();t[l]=u;break;case"BYWEEKDAY":case"BYDAY":t.byweekday=NP(o);break;case"DTSTART":case"TZID":var c=_o(r);t.tzid=c.tzid,t.dtstart=c.dtstart;break;case"UNTIL":t.until=go(o);break;case"BYEASTER":t.byeaster=Number(o);break;default:throw new Error("Unknown RRULE property '"+a+"'")}}),t}function PP(r){if(r.indexOf(",")!==-1){var e=r.split(",");return e.map(F_)}return F_(r)}function F_(r){return/^[+-]?\d+$/.test(r)?Number(r):r}function NP(r){var e=r.split(",");return e.map(function(t){if(t.length===2)return br[t];var n=t.match(/^([+-]?\d{1,2})([A-Z]{2})$/);if(!n||n.length<3)throw new SyntaxError("Invalid weekday string: ".concat(t));var i=Number(n[1]),s=n[2],a=br[s].weekday;return new Ke(a,i)})}var Mi=function(){function r(e,t){if(isNaN(e.getTime()))throw new RangeError("Invalid date passed to DateWithZone");this.date=e,this.tzid=t}return Object.defineProperty(r.prototype,"isUTC",{get:function(){return!this.tzid||this.tzid.toUpperCase()==="UTC"},enumerable:!1,configurable:!0}),r.prototype.toString=function(){var e=bs(this.date.getTime(),this.isUTC);return this.isUTC?":".concat(e):";TZID=".concat(this.tzid,":").concat(e)},r.prototype.getTime=function(){return this.date.getTime()},r.prototype.rezonedDate=function(){return this.isUTC?this.date:O_(this.date,this.tzid)},r}();function wo(r){for(var e=[],t="",n=Object.keys(r),i=Object.keys(To),s=0;s<n.length;s++)if(n[s]!=="tzid"&&!!ye(i,n[s])){var a=n[s].toUpperCase(),o=r[n[s]],u="";if(!(!Fe(o)||pt(o)&&!o.length)){switch(a){case"FREQ":u=z.FREQUENCIES[r.freq];break;case"WKST":Xt(o)?u=new Ke(o).toString():u=o.toString();break;case"BYWEEKDAY":a="BYDAY",u=__(o).map(function(m){return m instanceof Ke?m:pt(m)?new Ke(m[0],m[1]):new Ke(m)}).toString();break;case"DTSTART":t=IP(o,r.tzid);break;case"UNTIL":u=bs(o,!r.tzid);break;default:if(pt(o)){for(var l=[],c=0;c<o.length;c++)l[c]=String(o[c]);u=l.toString()}else u=String(o)}u&&e.push([a,u])}}var d=e.map(function(m){var g=m[0],T=m[1];return"".concat(g,"=").concat(T.toString())}).join(";"),f="";return d!==""&&(f="RRULE:".concat(d)),[t,f].filter(function(m){return!!m}).join(` +`)}function IP(r,e){return r?"DTSTART"+new Mi(new Date(r),e).toString():""}function FP(r,e){return Array.isArray(r)?!Array.isArray(e)||r.length!==e.length?!1:r.every(function(t,n){return t.getTime()===e[n].getTime()}):r instanceof Date?e instanceof Date&&r.getTime()===e.getTime():r===e}var L_=function(){function r(){this.all=!1,this.before=[],this.after=[],this.between=[]}return r.prototype._cacheAdd=function(e,t,n){t&&(t=t instanceof Date?Xu(t):ym(t)),e==="all"?this.all=t:(n._value=t,this[e].push(n))},r.prototype._cacheGet=function(e,t){var n=!1,i=t?Object.keys(t):[],s=function(c){for(var d=0;d<i.length;d++){var f=i[d];if(!FP(t[f],c[f]))return!0}return!1},a=this[e];if(e==="all")n=this.all;else if(pt(a))for(var o=0;o<a.length;o++){var u=a[o];if(!(i.length&&s(u))){n=u._value;break}}if(!n&&this.all){for(var l=new Dn(e,t),o=0;o<this.all.length&&l.accept(this.all[o]);o++);n=l.getValue(),this._cacheAdd(e,n,t)}return pt(n)?ym(n):n instanceof Date?Xu(n):n},r}();var U_=I(I(I(I(I(I(I(I(I(I(I(I(I([],ge(1,31),!0),ge(2,28),!0),ge(3,31),!0),ge(4,30),!0),ge(5,31),!0),ge(6,30),!0),ge(7,31),!0),ge(8,31),!0),ge(9,30),!0),ge(10,31),!0),ge(11,30),!0),ge(12,31),!0),ge(1,7),!0),W_=I(I(I(I(I(I(I(I(I(I(I(I(I([],ge(1,31),!0),ge(2,29),!0),ge(3,31),!0),ge(4,30),!0),ge(5,31),!0),ge(6,30),!0),ge(7,31),!0),ge(8,31),!0),ge(9,30),!0),ge(10,31),!0),ge(11,30),!0),ge(12,31),!0),ge(1,7),!0),LP=yr(1,29),UP=yr(1,30),Jn=yr(1,31),Tt=yr(1,32),q_=I(I(I(I(I(I(I(I(I(I(I(I(I([],Tt,!0),UP,!0),Tt,!0),Jn,!0),Tt,!0),Jn,!0),Tt,!0),Tt,!0),Jn,!0),Tt,!0),Jn,!0),Tt,!0),Tt.slice(0,7),!0),$_=I(I(I(I(I(I(I(I(I(I(I(I(I([],Tt,!0),LP,!0),Tt,!0),Jn,!0),Tt,!0),Jn,!0),Tt,!0),Tt,!0),Jn,!0),Tt,!0),Jn,!0),Tt,!0),Tt.slice(0,7),!0),WP=yr(-28,0),qP=yr(-29,0),ei=yr(-30,0),_t=yr(-31,0),j_=I(I(I(I(I(I(I(I(I(I(I(I(I([],_t,!0),qP,!0),_t,!0),ei,!0),_t,!0),ei,!0),_t,!0),_t,!0),ei,!0),_t,!0),ei,!0),_t,!0),_t.slice(0,7),!0),G_=I(I(I(I(I(I(I(I(I(I(I(I(I([],_t,!0),WP,!0),_t,!0),ei,!0),_t,!0),ei,!0),_t,!0),_t,!0),ei,!0),_t,!0),ei,!0),_t,!0),_t.slice(0,7),!0),Y_=[0,31,60,91,121,152,182,213,244,274,305,335,366],B_=[0,31,59,90,120,151,181,212,243,273,304,334,365],vm=function(){for(var r=[],e=0;e<55;e++)r=r.concat(yr(7));return r}();function H_(r,e){var t=Xr(r,1,1),n=ys(r)?366:365,i=ys(r+1)?366:365,s=ho(t),a=Sn(t),o=mt(mt({yearlen:n,nextyearlen:i,yearordinal:s,yearweekday:a},$P(r)),{wnomask:null});if(Zt(e.byweekno))return o;o.wnomask=ge(0,n+7);var u,l,c=u=bt(7-a+e.wkst,7);c>=4?(c=0,l=o.yearlen+bt(a-e.wkst,7)):l=n-c;for(var d=Math.floor(l/7),f=bt(l,7),m=Math.floor(d+f/4),g=0;g<e.byweekno.length;g++){var T=e.byweekno[g];if(T<0&&(T+=m+1),T>0&&T<=m){var y=void 0;T>1?(y=c+(T-1)*7,c!==u&&(y-=7-u)):y=c;for(var E=0;E<7&&(o.wnomask[y]=1,y++,o.wdaymask[y]!==e.wkst);E++);}}if(ye(e.byweekno,1)){var y=c+m*7;if(c!==u&&(y-=7-u),y<n)for(var g=0;g<7&&(o.wnomask[y]=1,y+=1,o.wdaymask[y]!==e.wkst);g++);}if(c){var x=void 0;if(ye(e.byweekno,-1))x=-1;else{var R=Sn(Xr(r-1,1,1)),$=bt(7-R.valueOf()+e.wkst,7),q=ys(r-1)?366:365,ne=void 0;$>=4?($=0,ne=q+bt(R-e.wkst,7)):ne=n-c,x=Math.floor(52+bt(ne,7)/4)}if(ye(e.byweekno,x))for(var y=0;y<c;y++)o.wnomask[y]=1}return o}function $P(r){var e=ys(r)?366:365,t=Xr(r,1,1),n=Sn(t);return e===365?{mmask:U_,mdaymask:$_,nmdaymask:G_,wdaymask:vm.slice(n),mrange:B_}:{mmask:W_,mdaymask:q_,nmdaymask:j_,wdaymask:vm.slice(n),mrange:Y_}}function V_(r,e,t,n,i,s){var a={lastyear:r,lastmonth:e,nwdaymask:[]},o=[];if(s.freq===z.YEARLY)if(Zt(s.bymonth))o=[[0,t]];else for(var u=0;u<s.bymonth.length;u++)e=s.bymonth[u],o.push(n.slice(e-1,e+1));else s.freq===z.MONTHLY&&(o=[n.slice(e-1,e+1)]);if(Zt(o))return a;a.nwdaymask=ge(0,t);for(var u=0;u<o.length;u++)for(var l=o[u],c=l[0],d=l[1]-1,f=0;f<s.bynweekday.length;f++){var m=void 0,g=s.bynweekday[f],T=g[0],y=g[1];y<0?(m=d+(y+1)*7,m-=bt(i[m]-T,7)):(m=c+(y-1)*7,m+=bt(7-i[m]+T,7)),c<=m&&m<=d&&(a.nwdaymask[m]=1)}return a}function z_(r,e){e===void 0&&(e=0);var t=r%19,n=Math.floor(r/100),i=r%100,s=Math.floor(n/4),a=n%4,o=Math.floor((n+8)/25),u=Math.floor((n-o+1)/3),l=Math.floor(19*t+n-s-u+15)%30,c=Math.floor(i/4),d=i%4,f=Math.floor(32+2*a+2*c-l-d)%7,m=Math.floor((t+11*l+22*f)/451),g=Math.floor((l+f-7*m+114)/31),T=(l+f-7*m+114)%31+1,y=Date.UTC(r,g-1,T+e),E=Date.UTC(r,0,1);return[Math.ceil((y-E)/(1e3*60*60*24))]}var jP=function(){function r(e){this.options=e}return r.prototype.rebuild=function(e,t){var n=this.options;if(e!==this.lastyear&&(this.yearinfo=H_(e,n)),je(n.bynweekday)&&(t!==this.lastmonth||e!==this.lastyear)){var i=this.yearinfo,s=i.yearlen,a=i.mrange,o=i.wdaymask;this.monthinfo=V_(e,t,s,a,o,n)}Fe(n.byeaster)&&(this.eastermask=z_(e,n.byeaster))},Object.defineProperty(r.prototype,"lastyear",{get:function(){return this.monthinfo?this.monthinfo.lastyear:null},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"lastmonth",{get:function(){return this.monthinfo?this.monthinfo.lastmonth:null},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"yearlen",{get:function(){return this.yearinfo.yearlen},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"yearordinal",{get:function(){return this.yearinfo.yearordinal},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"mrange",{get:function(){return this.yearinfo.mrange},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"wdaymask",{get:function(){return this.yearinfo.wdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"mmask",{get:function(){return this.yearinfo.mmask},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"wnomask",{get:function(){return this.yearinfo.wnomask},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"nwdaymask",{get:function(){return this.monthinfo?this.monthinfo.nwdaymask:[]},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"nextyearlen",{get:function(){return this.yearinfo.nextyearlen},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"mdaymask",{get:function(){return this.yearinfo.mdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"nmdaymask",{get:function(){return this.yearinfo.nmdaymask},enumerable:!1,configurable:!0}),r.prototype.ydayset=function(){return[yr(this.yearlen),0,this.yearlen]},r.prototype.mdayset=function(e,t){for(var n=this.mrange[t-1],i=this.mrange[t],s=ge(null,this.yearlen),a=n;a<i;a++)s[a]=a;return[s,n,i]},r.prototype.wdayset=function(e,t,n){for(var i=ge(null,this.yearlen+7),s=ho(Xr(e,t,n))-this.yearordinal,a=s,o=0;o<7&&(i[s]=s,++s,this.wdaymask[s]!==this.options.wkst);o++);return[i,a,s]},r.prototype.ddayset=function(e,t,n){var i=ge(null,this.yearlen),s=ho(Xr(e,t,n))-this.yearordinal;return i[s]=s,[i,s,s+1]},r.prototype.htimeset=function(e,t,n,i){var s=this,a=[];return this.options.byminute.forEach(function(o){a=a.concat(s.mtimeset(e,o,n,i))}),On(a),a},r.prototype.mtimeset=function(e,t,n,i){var s=this.options.bysecond.map(function(a){return new vs(e,t,a,i)});return On(s),s},r.prototype.stimeset=function(e,t,n,i){return[new vs(e,t,n,i)]},r.prototype.getdayset=function(e){switch(e){case me.YEARLY:return this.ydayset.bind(this);case me.MONTHLY:return this.mdayset.bind(this);case me.WEEKLY:return this.wdayset.bind(this);case me.DAILY:return this.ddayset.bind(this);default:return this.ddayset.bind(this)}},r.prototype.gettimeset=function(e){switch(e){case me.HOURLY:return this.htimeset.bind(this);case me.MINUTELY:return this.mtimeset.bind(this);case me.SECONDLY:return this.stimeset.bind(this)}},r}(),K_=jP;function Q_(r,e,t,n,i,s){for(var a=[],o=0;o<r.length;o++){var u=void 0,l=void 0,c=r[o];c<0?(u=Math.floor(c/e.length),l=bt(c,e.length)):(u=Math.floor((c-1)/e.length),l=bt(c-1,e.length));for(var d=[],f=t;f<n;f++){var m=s[f];!Fe(m)||d.push(m)}var g=void 0;u<0?g=d.slice(u)[0]:g=d[u];var T=e[l],y=Ku(i.yearordinal+g),E=Qu(y,T);ye(a,E)||a.push(E)}return On(a),a}function Zu(r,e){var t=e.dtstart,n=e.freq,i=e.interval,s=e.until,a=e.bysetpos,o=e.count;if(o===0||i===0)return xn(r);var u=C_.fromDate(t),l=new K_(e);l.rebuild(u.year,u.month);for(var c=BP(l,u,e);;){var d=l.getdayset(n)(u.year,u.month,u.day),f=d[0],m=d[1],g=d[2],T=YP(f,m,g,l,e);if(je(a))for(var y=Q_(a,c,m,g,l,f),E=0;E<y.length;E++){var x=y[E];if(s&&x>s)return xn(r);if(x>=t){var R=X_(x,e);if(!r.accept(R)||o&&(--o,!o))return xn(r)}}else for(var E=m;E<g;E++){var $=f[E];if(!!Fe($))for(var q=Ku(l.yearordinal+$),ne=0;ne<c.length;ne++){var B=c[ne],x=Qu(q,B);if(s&&x>s)return xn(r);if(x>=t){var R=X_(x,e);if(!r.accept(R)||o&&(--o,!o))return xn(r)}}}if(e.interval===0||(u.add(e,T),u.year>zu))return xn(r);bo(n)||(c=l.gettimeset(n)(u.hour,u.minute,u.second,0)),l.rebuild(u.year,u.month)}}function GP(r,e,t){var n=t.bymonth,i=t.byweekno,s=t.byweekday,a=t.byeaster,o=t.bymonthday,u=t.bynmonthday,l=t.byyearday;return je(n)&&!ye(n,r.mmask[e])||je(i)&&!r.wnomask[e]||je(s)&&!ye(s,r.wdaymask[e])||je(r.nwdaymask)&&!r.nwdaymask[e]||a!==null&&!ye(r.eastermask,e)||(je(o)||je(u))&&!ye(o,r.mdaymask[e])&&!ye(u,r.nmdaymask[e])||je(l)&&(e<r.yearlen&&!ye(l,e+1)&&!ye(l,-r.yearlen+e)||e>=r.yearlen&&!ye(l,e+1-r.yearlen)&&!ye(l,-r.nextyearlen+e-r.yearlen))}function X_(r,e){return new Mi(r,e.tzid).rezonedDate()}function xn(r){return r.getValue()}function YP(r,e,t,n,i){for(var s=!1,a=e;a<t;a++){var o=r[a];s=GP(n,o,i),s&&(r[o]=null)}return s}function BP(r,e,t){var n=t.freq,i=t.byhour,s=t.byminute,a=t.bysecond;return bo(n)?P_(t):n>=z.HOURLY&&je(i)&&!ye(i,e.hour)||n>=z.MINUTELY&&je(s)&&!ye(s,e.minute)||n>=z.SECONDLY&&je(a)&&!ye(a,e.second)?[]:r.gettimeset(n)(e.hour,e.minute,e.second,e.millisecond)}var br={MO:new Ke(0),TU:new Ke(1),WE:new Ke(2),TH:new Ke(3),FR:new Ke(4),SA:new Ke(5),SU:new Ke(6)},To={freq:me.YEARLY,dtstart:null,interval:1,wkst:br.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},N_=Object.keys(To),z=function(){function r(e,t){e===void 0&&(e={}),t===void 0&&(t=!1),this._cache=t?null:new L_,this.origOptions=_m(e);var n=A_(e).parsedOptions;this.options=n}return r.parseText=function(e,t){return yo(e,t)},r.fromText=function(e,t){return x_(e,t)},r.fromString=function(e){return new r(r.parseString(e)||void 0)},r.prototype._iter=function(e){return Zu(e,this.options)},r.prototype._cacheGet=function(e,t){return this._cache?this._cache._cacheGet(e,t):!1},r.prototype._cacheAdd=function(e,t,n){if(!!this._cache)return this._cache._cacheAdd(e,t,n)},r.prototype.all=function(e){if(e)return this._iter(new Tm("all",{},e));var t=this._cacheGet("all");return t===!1&&(t=this._iter(new Dn("all",{})),this._cacheAdd("all",t)),t},r.prototype.between=function(e,t,n,i){if(n===void 0&&(n=!1),!xi(e)||!xi(t))throw new Error("Invalid date passed in to RRule.between");var s={before:t,after:e,inc:n};if(i)return this._iter(new Tm("between",s,i));var a=this._cacheGet("between",s);return a===!1&&(a=this._iter(new Dn("between",s)),this._cacheAdd("between",a,s)),a},r.prototype.before=function(e,t){if(t===void 0&&(t=!1),!xi(e))throw new Error("Invalid date passed in to RRule.before");var n={dt:e,inc:t},i=this._cacheGet("before",n);return i===!1&&(i=this._iter(new Dn("before",n)),this._cacheAdd("before",i,n)),i},r.prototype.after=function(e,t){if(t===void 0&&(t=!1),!xi(e))throw new Error("Invalid date passed in to RRule.after");var n={dt:e,inc:t},i=this._cacheGet("after",n);return i===!1&&(i=this._iter(new Dn("after",n)),this._cacheAdd("after",i,n)),i},r.prototype.count=function(){return this.all().length},r.prototype.toString=function(){return wo(this.origOptions)},r.prototype.toText=function(e,t,n){return R_(this,e,t,n)},r.prototype.isFullyConvertibleToText=function(){return M_(this)},r.prototype.clone=function(){return new r(this.origOptions)},r.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],r.YEARLY=me.YEARLY,r.MONTHLY=me.MONTHLY,r.WEEKLY=me.WEEKLY,r.DAILY=me.DAILY,r.HOURLY=me.HOURLY,r.MINUTELY=me.MINUTELY,r.SECONDLY=me.SECONDLY,r.MO=br.MO,r.TU=br.TU,r.WE=br.WE,r.TH=br.TH,r.FR=br.FR,r.SA=br.SA,r.SU=br.SU,r.parseString=vo,r.optionsToString=wo,r}();function Z_(r,e,t,n,i,s){var a={},o=r.accept;function u(f,m){t.forEach(function(g){g.between(f,m,!0).forEach(function(T){a[Number(T)]=!0})})}i.forEach(function(f){var m=new Mi(f,s).rezonedDate();a[Number(m)]=!0}),r.accept=function(f){var m=Number(f);return isNaN(m)?o.call(this,f):!a[m]&&(u(new Date(m-1),new Date(m+1)),!a[m])?(a[m]=!0,o.call(this,f)):!0},r.method==="between"&&(u(r.args.after,r.args.before),r.accept=function(f){var m=Number(f);return a[m]?!0:(a[m]=!0,o.call(this,f))});for(var l=0;l<n.length;l++){var c=new Mi(n[l],s).rezonedDate();if(!r.accept(new Date(c.getTime())))break}e.forEach(function(f){Zu(r,f.options)});var d=r._result;switch(On(d),r.method){case"all":case"between":return d;case"before":return d.length&&d[d.length-1]||null;case"after":default:return d.length&&d[0]||null}}var J_={dtstart:null,cache:!1,unfold:!1,forceset:!1,compatible:!1,tzid:null};function HP(r,e){var t=[],n=[],i=[],s=[],a=_o(r),o=a.dtstart,u=a.tzid,l=XP(r,e.unfold);return l.forEach(function(c){var d;if(!!c){var f=QP(c),m=f.name,g=f.parms,T=f.value;switch(m.toUpperCase()){case"RRULE":if(g.length)throw new Error("unsupported RRULE parm: ".concat(g.join(",")));t.push(vo(c));break;case"RDATE":var y=(d=/RDATE(?:;TZID=([^:=]+))?/i.exec(c))!==null&&d!==void 0?d:[],E=y[1];E&&!u&&(u=E),n=n.concat(ev(T,g));break;case"EXRULE":if(g.length)throw new Error("unsupported EXRULE parm: ".concat(g.join(",")));i.push(vo(T));break;case"EXDATE":s=s.concat(ev(T,g));break;case"DTSTART":break;default:throw new Error("unsupported property: "+m)}}}),{dtstart:o,tzid:u,rrulevals:t,rdatevals:n,exrulevals:i,exdatevals:s}}function VP(r,e){var t=HP(r,e),n=t.rrulevals,i=t.rdatevals,s=t.exrulevals,a=t.exdatevals,o=t.dtstart,u=t.tzid,l=e.cache===!1;if(e.compatible&&(e.forceset=!0,e.unfold=!0),e.forceset||n.length>1||i.length||s.length||a.length){var c=new km(l);return c.dtstart(o),c.tzid(u||void 0),n.forEach(function(f){c.rrule(new z(wm(f,o,u),l))}),i.forEach(function(f){c.rdate(f)}),s.forEach(function(f){c.exrule(new z(wm(f,o,u),l))}),a.forEach(function(f){c.exdate(f)}),e.compatible&&e.dtstart&&c.rdate(o),c}var d=n[0]||{};return new z(wm(d,d.dtstart||e.dtstart||o,d.tzid||e.tzid||u),l)}function Ju(r,e){return e===void 0&&(e={}),VP(r,zP(e))}function wm(r,e,t){return mt(mt({},r),{dtstart:e,tzid:t})}function zP(r){var e=[],t=Object.keys(r),n=Object.keys(J_);if(t.forEach(function(i){ye(n,i)||e.push(i)}),e.length)throw new Error("Invalid options: "+e.join(", "));return mt(mt({},J_),r)}function KP(r){if(r.indexOf(":")===-1)return{name:"RRULE",value:r};var e=v_(r,":",1),t=e[0],n=e[1];return{name:t,value:n}}function QP(r){var e=KP(r),t=e.name,n=e.value,i=t.split(";");if(!i)throw new Error("empty property name");return{name:i[0].toUpperCase(),parms:i.slice(1),value:n}}function XP(r,e){if(e===void 0&&(e=!1),r=r&&r.trim(),!r)throw new Error("Invalid empty string");if(!e)return r.split(/\s/);for(var t=r.split(` +`),n=0;n<t.length;){var i=t[n]=t[n].replace(/\s+$/g,"");i?n>0&&i[0]===" "?(t[n-1]+=i.slice(1),t.splice(n,1)):n+=1:t.splice(n,1)}return t}function ZP(r){r.forEach(function(e){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(e))throw new Error("unsupported RDATE/EXDATE parm: "+e)})}function ev(r,e){return ZP(e),r.split(",").map(function(t){return go(t)})}function tv(r){var e=this;return function(t){if(t!==void 0&&(e["_".concat(r)]=t),e["_".concat(r)]!==void 0)return e["_".concat(r)];for(var n=0;n<e._rrule.length;n++){var i=e._rrule[n].origOptions[r];if(i)return i}}}var km=function(r){Ts(e,r);function e(t){t===void 0&&(t=!1);var n=r.call(this,{},t)||this;return n.dtstart=tv.apply(n,["dtstart"]),n.tzid=tv.apply(n,["tzid"]),n._rrule=[],n._rdate=[],n._exrule=[],n._exdate=[],n}return e.prototype._iter=function(t){return Z_(t,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},e.prototype.rrule=function(t){rv(t,this._rrule)},e.prototype.exrule=function(t){rv(t,this._exrule)},e.prototype.rdate=function(t){nv(t,this._rdate)},e.prototype.exdate=function(t){nv(t,this._exdate)},e.prototype.rrules=function(){return this._rrule.map(function(t){return Ju(t.toString())})},e.prototype.exrules=function(){return this._exrule.map(function(t){return Ju(t.toString())})},e.prototype.rdates=function(){return this._rdate.map(function(t){return new Date(t.getTime())})},e.prototype.exdates=function(){return this._exdate.map(function(t){return new Date(t.getTime())})},e.prototype.valueOf=function(){var t=[];return!this._rrule.length&&this._dtstart&&(t=t.concat(wo({dtstart:this._dtstart}))),this._rrule.forEach(function(n){t=t.concat(n.toString().split(` `))}),this._exrule.forEach(function(n){t=t.concat(n.toString().split(` -`).map(function(i){return i.replace(/^RRULE:/,"EXRULE:")}).filter(function(i){return!/^DTSTART/.test(i)}))}),this._rdate.length&&t.push(uv("RDATE",this._rdate,this.tzid())),this._exdate.length&&t.push(uv("EXDATE",this._exdate,this.tzid())),t},e.prototype.toString=function(){return this.valueOf().join(` -`)},e.prototype.clone=function(){var t=new e(!!this._cache);return this._rrule.forEach(function(n){return t.rrule(n.clone())}),this._exrule.forEach(function(n){return t.exrule(n.clone())}),this._rdate.forEach(function(n){return t.rdate(new Date(n.getTime()))}),this._exdate.forEach(function(n){return t.exdate(new Date(n.getTime()))}),t},e}(z);function av(r,e){if(!(r instanceof z))throw new TypeError(String(r)+" is not RRule instance");ge(e.map(String),String(r))||e.push(r)}function ov(r,e){if(!(r instanceof Date))throw new TypeError(String(r)+" is not Date instance");ge(e.map(Number),Number(r))||(e.push(r),kn(e))}function uv(r,e,t){var n=!t||t.toUpperCase()==="UTC",i=n?"".concat(r,":"):"".concat(r,";TZID=").concat(t,":"),s=e.map(function(a){return bs(a.valueOf(),n)}).join(",");return"".concat(i).concat(s)}var Mm=pa(Je());function br(r,e){return r!==null&&e===null?-1:r===null&&e!==null?1:r!==null&&e!==null?r.isValid()&&!e.isValid()?1:!r.isValid()&&e.isValid()?-1:r.isAfter(e)?1:r.isBefore(e)?-1:0:0}function QP(r,e,t=void 0){if(!e)return`<i>no ${r} date</i>`;let n=Mm.parseDate(e,t,{forwardDate:t!=null});return n!==null?window.moment(n).format("YYYY-MM-DD"):`<i>invalid ${r} date</i>`}function lv(r,e,t){return QP(r,e,t?new Date:void 0)}function Ri(r,e){let t=null,n=Mm.parseDate(r,new Date,{forwardDate:e});return n!==null&&(t=window.moment(n)),t}var ct=class{constructor({rrule:e,baseOnToday:t,referenceDate:n,startDate:i,scheduledDate:s,dueDate:a}){this.rrule=e,this.baseOnToday=t,this.referenceDate=n,this.startDate=i,this.scheduledDate=s,this.dueDate=a}static fromText({recurrenceRuleText:e,startDate:t,scheduledDate:n,dueDate:i}){try{let s=e.match(/^([a-zA-Z0-9, !]+?)( when done)?$/i);if(s==null)return null;let a=s[1].trim(),o=s[2]!==void 0,u=z.parseText(a);if(u!==null){let l=null;i?l=window.moment(i):n?l=window.moment(n):t&&(l=window.moment(t)),!o&&l!==null?u.dtstart=window.moment(l).startOf("day").utc(!0).toDate():u.dtstart=window.moment().startOf("day").utc(!0).toDate();let c=new z(u);return new ct({rrule:c,baseOnToday:o,referenceDate:l,startDate:t,scheduledDate:n,dueDate:i})}}catch(s){s instanceof Error&&console.log(s.message)}return null}toText(){let e=this.rrule.toText();return this.baseOnToday&&(e+=" when done"),e}next(e=window.moment()){let t=this.nextReferenceDate(e);if(t!==null){let n=null,i=null,s=null;if(this.referenceDate){if(this.startDate){let a=window.moment.duration(this.startDate.diff(this.referenceDate));n=window.moment(t),n.add(Math.round(a.asDays()),"days")}if(this.scheduledDate){let a=window.moment.duration(this.scheduledDate.diff(this.referenceDate));i=window.moment(t),i.add(Math.round(a.asDays()),"days")}if(this.dueDate){let a=window.moment.duration(this.dueDate.diff(this.referenceDate));s=window.moment(t),s.add(Math.round(a.asDays()),"days")}}return{startDate:n,scheduledDate:i,dueDate:s}}return null}identicalTo(e){return this.baseOnToday!==e.baseOnToday||br(this.startDate,e.startDate)!==0||br(this.scheduledDate,e.scheduledDate)!==0||br(this.dueDate,e.dueDate)!==0?!1:this.toText()===e.toText()}nextReferenceDate(e){return this.baseOnToday?this.nextReferenceDateFromToday(e).toDate():this.nextReferenceDateFromOriginalReferenceDate().toDate()}nextReferenceDateFromToday(e){let t=new z(be(X({},this.rrule.origOptions),{dtstart:e.startOf("day").utc(!0).toDate()}));return this.nextAfter(e.endOf("day"),t)}nextReferenceDateFromOriginalReferenceDate(){var t;let e=window.moment((t=this.referenceDate)!=null?t:void 0).endOf("day");return this.nextAfter(e,this.rrule)}nextAfter(e,t){e.utc(!0);let n=window.moment(t.after(e.toDate())),i=this.toText(),s=i.match(/every( \d+)? month(s)?(.*)?/);s!==null&&(i.includes(" on ")||(n=ct.nextAfterMonths(e,n,t,s[1])));let a=i.match(/every( \d+)? year(s)?(.*)?/);return a!==null&&(n=ct.nextAfterYears(e,n,t,a[1])),ct.addTimezone(n)}static nextAfterMonths(e,t,n,i){let s=1;for(i!==void 0&&(s=Number.parseInt(i.trim(),10));ct.isSkippingTooManyMonths(e,t,s);)t=ct.fromOneDayEarlier(e,n);return t}static isSkippingTooManyMonths(e,t,n){let i=t.month()-e.month();return i+=(t.year()-e.year())*12,i>n}static nextAfterYears(e,t,n,i){let s=1;for(i!==void 0&&(s=Number.parseInt(i.trim(),10));ct.isSkippingTooManyYears(e,t,s);)t=ct.fromOneDayEarlier(e,n);return t}static isSkippingTooManyYears(e,t,n){return t.year()-e.year()>n}static fromOneDayEarlier(e,t){e.subtract(1,"days").endOf("day");let n=t.origOptions;return n.dtstart=e.startOf("day").toDate(),t=new z(n),window.moment(t.after(e.toDate()))}static addTimezone(e){return window.moment.utc(e).local(!0).startOf("day")}};function il(r){return r.replace(/([.*+?^${}()|[\]/\\])/g,"\\$1")}var Xn=class{constructor(){this._globalFilter="";this._removeGlobalFilter=!1}static getInstance(){return Xn.instance||(Xn.instance=new Xn),Xn.instance}get(){return this._globalFilter}set(e){this._globalFilter=e}reset(){this.set(Xn.empty)}isEmpty(){return this.get()===Xn.empty}equals(e){return this.get()===e}includedIn(e){let t=this.get();return e.includes(t)}prependTo(e){return this.get()+" "+e}removeAsWordFromDependingOnSettings(e){return this.getRemoveGlobalFilter()?this.removeAsWordFrom(e):e}getRemoveGlobalFilter(){return this._removeGlobalFilter}setRemoveGlobalFilter(e){this._removeGlobalFilter=e}removeAsWordFrom(e){if(this.isEmpty())return e;let t=RegExp("(^|\\s)"+il(this.get())+"($|\\s)","ug");return e.search(t)>-1&&(e=e.replace(t,"$1$2").replace(" "," ").trim()),e}removeAsSubstringFrom(e){let t=this.get();return e.replace(t,"").trim()}},ye=Xn;ye.empty="";var Zt=class{},Z=Zt;Z.dateFormat="YYYY-MM-DD",Z.dateTimeFormat="YYYY-MM-DD HH:mm",Z.indentationRegex=/^([\s\t>]*)/,Z.listMarkerRegex=/([-*+]|[0-9]+\.)/,Z.checkboxRegex=/\[(.)\]/u,Z.afterCheckboxRegex=/ *(.*)/u,Z.taskRegex=new RegExp(Zt.indentationRegex.source+Zt.listMarkerRegex.source+" +"+Zt.checkboxRegex.source+Zt.afterCheckboxRegex.source,"u"),Z.nonTaskRegex=new RegExp(Zt.indentationRegex.source+Zt.listMarkerRegex.source+"? *("+Zt.checkboxRegex.source+")?"+Zt.afterCheckboxRegex.source,"u"),Z.listItemRegex=new RegExp(Zt.indentationRegex.source+Zt.listMarkerRegex.source),Z.blockLinkRegex=/ \^[a-zA-Z0-9-]+$/u,Z.hashTags=/(^|\s)#[^ !@#$%^&*(),.?":{}|<>]+/g,Z.hashTagsFromEnd=new RegExp(Zt.hashTags.source+"$");var Cm=5;function Am(r,e,t){let n=[r.startDateSymbol,r.scheduledDateSymbol,r.dueDateSymbol].join("|");return(i,s,a)=>{let o=[];return o=o.concat(ZP(i,s,a,n,e,t)),o=o.concat(JP(i,s,a,r.recurrenceSymbol,t)),o=o.concat(XP(i,s,a,r,t)),o.length>0&&!o.some(u=>u.suggestionType==="match")&&(t||o.unshift({suggestionType:"empty",displayText:"\u23CE",appendText:` -`})),o=o.slice(0,a.autoSuggestMaxItems),o}}function Pm(r,e,t){let n=tN(e.substring(0,t),[["(",")"],["[","]"]])=="("?")":"]",i=r?n+" ":" ",s=r&&e.length>t&&e.charAt(t)===n?1:0;return{postfix:i,insertSkip:s}}function XP(r,e,t,n,i){let s=d=>Object.values(n.prioritySymbols).some(p=>p.length>0&&d.includes(p)),a=[],{postfix:o,insertSkip:u}=Pm(i,r,e);if(r.includes(n.dueDateSymbol)||a.push({displayText:`${n.dueDateSymbol} due date`,appendText:`${n.dueDateSymbol} `}),r.includes(n.startDateSymbol)||a.push({displayText:`${n.startDateSymbol} start date`,appendText:`${n.startDateSymbol} `}),r.includes(n.scheduledDateSymbol)||a.push({displayText:`${n.scheduledDateSymbol} scheduled date`,appendText:`${n.scheduledDateSymbol} `}),!s(r)){let d=n.prioritySymbols,p=["High","Medium","Low","Highest","Lowest"];for(let m=0;m<p.length;m++){let b=p[m],g=d[b];a.push({displayText:i?`${g} priority`:`${g} ${b.toLowerCase()} priority`,appendText:`${g}${o}`,insertSkip:i?u:void 0})}}if(r.includes(n.recurrenceSymbol)||a.push({displayText:`${n.recurrenceSymbol} recurring (repeat)`,appendText:`${n.recurrenceSymbol} `}),!r.includes(n.createdDateSymbol)){let p=Kt.parseDate("today",!0).format(Z.dateFormat);a.push({textToMatch:`${n.createdDateSymbol} created`,displayText:`${n.createdDateSymbol} created today (${p})`,appendText:`${n.createdDateSymbol} ${p}`+o,insertSkip:i?u:void 0})}let l=Nm(r,/([a-zA-Z'_-]*)/g,e),c=[];if(l&&l.length>0){let d=l[0];if(d.length>=Math.max(1,t.autoSuggestMinMatch)){let p=a.filter(m=>(m.textToMatch||m.displayText).toLowerCase().includes(d.toLowerCase()));for(let m of p){let b=i&&(m.displayText.includes("priority")||m.displayText.includes("created"))?d.length+u:d.length;c.push({suggestionType:"match",displayText:m.displayText,appendText:m.appendText,insertAt:l.index,insertSkip:b})}}}return c.length===0&&t.autoSuggestMinMatch===0?a:c}function ZP(r,e,t,n,i,s){let a=["today","tomorrow","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","next week","next month","next year"],{postfix:o,insertSkip:u}=Pm(s,r,e),l=[],c=new RegExp(`(${n})\\s*([0-9a-zA-Z ]*)`,"ug"),d=Nm(r,c,e);if(d&&d.length>=2){let p=d[1],m=d[2];if(m.length<t.autoSuggestMinMatch)return[];let b=m&&m.length>1?Kt.parseDate(Ku(m),!0):null;b&&b.isValid()&&l.push({displayText:`${b.format(Z.dateFormat)}`,appendText:`${p} ${b.format(Z.dateFormat)} `,insertAt:d.index,insertSkip:d[0].length});let g=1,E=a.filter(R=>m&&m.length>=g&&R.toLowerCase().includes(m.toLowerCase())).slice(0,i);E.length===0&&(E=a.slice(0,i));for(let R of E){let v=`${Kt.parseDate(R,!0).format(Z.dateFormat)}`,V=s?d[0].length+u:d[0].length;l.push({suggestionType:"match",displayText:`${R} (${v})`,appendText:`${p} ${v}`+o,insertAt:d.index,insertSkip:V})}}return l}function JP(r,e,t,n,i){var d;let s=["every","every day","every week","every month","every month on the","every year","every week on Sunday","every week on Monday","every week on Tuesday","every week on Wednesday","every week on Thursday","every week on Friday","every week on Saturday"],{postfix:a,insertSkip:o}=Pm(i,r,e),u=[],l=new RegExp(`(${n})\\s*([0-9a-zA-Z ]*)`,"ug"),c=Nm(r,l,e);if(c&&c.length>=2){let p=c[1],m=c[2];if(m.length<t.autoSuggestMinMatch)return[];if(m.length>0){let R=(d=ct.fromText({recurrenceRuleText:m,startDate:null,scheduledDate:null,dueDate:null}))==null?void 0:d.toText();if(R){let x=`${p} ${R}`+a,v=i?c[0].length+o:c[0].length;if(u.push({suggestionType:"match",displayText:`\u2705 ${R}`,appendText:x,insertAt:c.index,insertSkip:v}),c[0]==x)return[]}}let b=1,g=t.autoSuggestMaxItems/2,E=s.filter(R=>m&&m.length>=b&&R.toLowerCase().includes(m.toLowerCase())).slice(0,g);E.length===0&&m.trim().length===0&&(E=s.slice(0,g));for(let R of E)u.push({suggestionType:"match",displayText:`${R}`,appendText:`${p} ${R} `,insertAt:c.index,insertSkip:c[0].length})}return u}function Nm(r,e,t){let n=r.matchAll(e);for(let i of n)if((i==null?void 0:i.index)&&i.index<=t&&t<=i.index+i[0].length)return i}function eN(r,e){if(e.length===0)return!1;let t=Object.fromEntries(e.map(([i,s])=>[i,0])),n=Object.fromEntries(e.map(([i,s])=>[s,i]));for(let i of r)i in t?t[i]++:i in n&&(t[n[i]]=Math.max(0,t[n[i]]-1));return Object.values(t).some(i=>i>0)}function tN(r,e){if(e.length===0)return null;let t=Object.fromEntries(e.map(([s,a])=>[s,0])),n=Object.fromEntries(e.map(([s,a])=>[a,s])),i=[];for(let s=0;s<r.length;s++){let a=r[s];if(a in t)t[a]++,i.push({bracket:a,idx:s});else if(a in n){if(t[n[a]]>=1){for(let o=i.length-1;o>=0;o--)if(i[o].bracket==n[a]){i.splice(o,1);break}}t[n[a]]=Math.max(0,t[n[a]]-1)}}return i.length>0?i[i.length-1].bracket:null}function dv(r,e){return(t,n,i)=>eN(t.slice(0,n),e)?r(t,n,i):[]}function fv(r,e){return ye.getInstance().includedIn(r)&&rN(r,e)}function rN(r,e){if(r.length===0)return!1;let t=oe.extractTaskComponents(r);if(!t)return!1;let n=t.indentation+t.listMarker+" ["+t.status.symbol+"] ";return e>=n.length}var ws=(p=>(p.Description="description",p.Id="id",p.DependsOn="dependsOn",p.Priority="priority",p.RecurrenceRule="recurrenceRule",p.CreatedDate="createdDate",p.StartDate="startDate",p.ScheduledDate="scheduledDate",p.DueDate="dueDate",p.CancelledDate="cancelledDate",p.DoneDate="doneDate",p.BlockLink="blockLink",p))(ws||{}),sl=Object.values(ws),Zr=class{constructor(){this.visible={};this.tagsVisible=!0;sl.forEach(e=>{this.visible[e]=!0})}isShown(e){return this.visible[e]}areTagsShown(){return this.tagsVisible}hide(e){this.visible[e]=!1}setVisibility(e,t){this.visible[e]=t}setTagsVisibility(e){this.tagsVisible=e}get shownComponents(){return sl.filter(e=>this.visible[e])}get hiddenComponents(){return sl.filter(e=>!this.visible[e])}get toggleableComponents(){return sl.filter(e=>e!=="description"&&e!=="blockLink")}toggleVisibilityExceptDescriptionAndBlockLink(){this.toggleableComponents.forEach(e=>{this.visible[e]=!this.visible[e]}),this.setTagsVisibility(!this.areTagsShown())}};var Mi=/[a-zA-Z0-9-_]+/,Fm={prioritySymbols:{Highest:"\u{1F53A}",High:"\u23EB",Medium:"\u{1F53C}",Low:"\u{1F53D}",Lowest:"\u23EC",None:""},startDateSymbol:"\u{1F6EB}",createdDateSymbol:"\u2795",scheduledDateSymbol:"\u23F3",dueDateSymbol:"\u{1F4C5}",doneDateSymbol:"\u2705",cancelledDateSymbol:"\u274C",recurrenceSymbol:"\u{1F501}",dependsOnSymbol:"\u26D4",idSymbol:"\u{1F194}",TaskFormatRegularExpressions:{priorityRegex:/([🔺⏫🔼🔽⏬])\uFE0F?$/u,startDateRegex:/🛫 *(\d{4}-\d{2}-\d{2})$/u,createdDateRegex:/➕ *(\d{4}-\d{2}-\d{2})$/u,scheduledDateRegex:/[⏳⌛] *(\d{4}-\d{2}-\d{2})$/u,dueDateRegex:/[📅📆🗓] *(\d{4}-\d{2}-\d{2})$/u,doneDateRegex:/✅ *(\d{4}-\d{2}-\d{2})$/u,cancelledDateRegex:/❌ *(\d{4}-\d{2}-\d{2})$/u,recurrenceRegex:/🔁 ?([a-zA-Z0-9, !]+)$/iu,dependsOnRegex:new RegExp("\u26D4\uFE0F? *("+Mi.source+"( *, *"+Mi.source+" *)*)$","iu"),idRegex:new RegExp("\u{1F194} *("+Mi.source+")$","iu")}};function Im(r,e,t){return t?r?" "+e:` ${e} ${t}`:""}function ks(r,e,t){return t?r?" "+e:` ${e} ${t.format(Z.dateFormat)}`:""}var Ci=class{constructor(e){this.symbols=e}serialize(e){let t=new Zr,n="",i=!1;for(let s of t.shownComponents)n+=this.componentToString(e,i,s);return n}componentToString(e,t,n){var b;let{prioritySymbols:i,startDateSymbol:s,createdDateSymbol:a,scheduledDateSymbol:o,doneDateSymbol:u,cancelledDateSymbol:l,recurrenceSymbol:c,dueDateSymbol:d,dependsOnSymbol:p,idSymbol:m}=this.symbols;switch(n){case"description":return e.description;case"priority":{let g="";return e.priority==="0"?g=" "+i.Highest:e.priority==="1"?g=" "+i.High:e.priority==="2"?g=" "+i.Medium:e.priority==="4"?g=" "+i.Low:e.priority==="5"&&(g=" "+i.Lowest),g}case"startDate":return ks(t,s,e.startDate);case"createdDate":return ks(t,a,e.createdDate);case"scheduledDate":return e.scheduledDateIsInferred?"":ks(t,o,e.scheduledDate);case"doneDate":return ks(t,u,e.doneDate);case"cancelledDate":return ks(t,l,e.cancelledDate);case"dueDate":return ks(t,d,e.dueDate);case"recurrenceRule":return e.recurrence?Im(t,c,e.recurrence.toText()):"";case"dependsOn":return e.dependsOn.length===0?"":Im(t,p,e.dependsOn.join(","));case"id":return Im(t,m,e.id);case"blockLink":return(b=e.blockLink)!=null?b:"";default:throw new Error(`Don't know how to render task component of type '${n}'`)}}parsePriority(e){let{prioritySymbols:t}=this.symbols;switch(e){case t.Lowest:return"5";case t.Low:return"4";case t.Medium:return"2";case t.High:return"1";case t.Highest:return"0";default:return"3"}}deserialize(e){let{TaskFormatRegularExpressions:t}=this.symbols,n,i="3",s=null,a=null,o=null,u=null,l=null,c=null,d="",p=null,m="",b=[],g="",E=20,R=0;do{n=!1;let x=e.match(t.priorityRegex);x!==null&&(i=this.parsePriority(x[1]),e=e.replace(t.priorityRegex,"").trim(),n=!0);let v=e.match(t.doneDateRegex);v!==null&&(u=window.moment(v[1],Z.dateFormat),e=e.replace(t.doneDateRegex,"").trim(),n=!0);let V=e.match(t.cancelledDateRegex);V!==null&&(l=window.moment(V[1],Z.dateFormat),e=e.replace(t.cancelledDateRegex,"").trim(),n=!0);let $=e.match(t.dueDateRegex);$!==null&&(o=window.moment($[1],Z.dateFormat),e=e.replace(t.dueDateRegex,"").trim(),n=!0);let ee=e.match(t.scheduledDateRegex);ee!==null&&(a=window.moment(ee[1],Z.dateFormat),e=e.replace(t.scheduledDateRegex,"").trim(),n=!0);let Y=e.match(t.startDateRegex);Y!==null&&(s=window.moment(Y[1],Z.dateFormat),e=e.replace(t.startDateRegex,"").trim(),n=!0);let q=e.match(t.createdDateRegex);q!==null&&(c=window.moment(q[1],Z.dateFormat),e=e.replace(t.createdDateRegex,"").trim(),n=!0);let de=e.match(t.recurrenceRegex);de!==null&&(d=de[1].trim(),e=e.replace(t.recurrenceRegex,"").trim(),n=!0);let Te=e.match(Z.hashTagsFromEnd);if(Te!=null){e=e.replace(Z.hashTagsFromEnd,"").trim(),n=!0;let O=Te[0].trim();g=g.length>0?[O,g].join(" "):O}let G=e.match(t.idRegex);G!=null&&(e=e.replace(t.idRegex,"").trim(),m=G[1].trim(),n=!0);let N=e.match(t.dependsOnRegex);N!=null&&(e=e.replace(t.dependsOnRegex,"").trim(),b=N[1].replace(/ /g,"").split(",").filter(O=>O!==""),n=!0),R++}while(n&&R<=E);return d.length>0&&(p=ct.fromText({recurrenceRuleText:d,startDate:s,scheduledDate:a,dueDate:o})),g.length>0&&(e+=" "+g),{description:e,priority:i,startDate:s,createdDate:c,scheduledDate:a,dueDate:o,doneDate:u,cancelledDate:l,recurrence:p,id:m,dependsOn:b,tags:oe.extractHashtags(e)}}};function Jr(r){let e=["(?:",/(?=[^\]]+\])\[/,"|",/(?=[^)]+\))\(/,")",/ */,r,/ */,/[)\]]/,/(?: *,)?/,/$/].map(t=>t instanceof RegExp?t.source:t).join("");return new RegExp(e,r.flags)}var Lm={prioritySymbols:{Highest:"priority:: highest",High:"priority:: high",Medium:"priority:: medium",Low:"priority:: low",Lowest:"priority:: lowest",None:""},startDateSymbol:"start::",createdDateSymbol:"created::",scheduledDateSymbol:"scheduled::",dueDateSymbol:"due::",doneDateSymbol:"completion::",cancelledDateSymbol:"cancelled::",recurrenceSymbol:"repeat::",idSymbol:"id::",dependsOnSymbol:"dependsOn::",TaskFormatRegularExpressions:{priorityRegex:Jr(/priority:: *(highest|high|medium|low|lowest)/),startDateRegex:Jr(/start:: *(\d{4}-\d{2}-\d{2})/),createdDateRegex:Jr(/created:: *(\d{4}-\d{2}-\d{2})/),scheduledDateRegex:Jr(/scheduled:: *(\d{4}-\d{2}-\d{2})/),dueDateRegex:Jr(/due:: *(\d{4}-\d{2}-\d{2})/),doneDateRegex:Jr(/completion:: *(\d{4}-\d{2}-\d{2})/),cancelledDateRegex:Jr(/cancelled:: *(\d{4}-\d{2}-\d{2})/),recurrenceRegex:Jr(/repeat:: *([a-zA-Z0-9, !]+)/),dependsOnRegex:Jr(new RegExp("dependsOn:: *("+Mi.source+"( *, *"+Mi.source+" *)*)")),idRegex:Jr(new RegExp("id:: *("+Mi.source+")"))}},al=class extends Ci{constructor(){super(Lm)}parsePriority(e){switch(e){case"highest":return"0";case"high":return"1";case"medium":return"2";case"low":return"4";case"lowest":return"5";default:return"3"}}componentToString(e,t,n){let i=super.componentToString(e,t,n),s=["blockLink","description"];return i!==""&&!s.includes(n)?` [${i.trim()}]`:i}};var Jt=(a=>(a.TODO="TODO",a.DONE="DONE",a.IN_PROGRESS="IN_PROGRESS",a.CANCELLED="CANCELLED",a.NON_TASK="NON_TASK",a.EMPTY="EMPTY",a))(Jt||{}),et=class{constructor(e,t,n,i,s="TODO"){this.symbol=e,this.name=t,this.nextStatusSymbol=n,this.availableAsCommand=i,this.type=s}};var At=class{get symbol(){return this.configuration.symbol}get name(){return this.configuration.name}get nextStatusSymbol(){return this.configuration.nextStatusSymbol}get nextSymbol(){return this.configuration.nextStatusSymbol}get availableAsCommand(){return this.configuration.availableAsCommand}get type(){return this.configuration.type}get typeGroupText(){let e=this.type,t;switch(e){case"IN_PROGRESS":t="1";break;case"TODO":t="2";break;case"DONE":t="3";break;case"CANCELLED":t="4";break;case"NON_TASK":t="5";break;case"EMPTY":t="6";break}return`%%${t}%%${e}`}constructor(e){this.configuration=e}static makeDone(){return new At(new et("x","Done"," ",!0,"DONE"))}static makeEmpty(){return new At(new et("","EMPTY","",!0,"EMPTY"))}static makeTodo(){return new At(new et(" ","Todo","x",!0,"TODO"))}static makeCancelled(){return new At(new et("-","Cancelled"," ",!0,"CANCELLED"))}static makeInProgress(){return new At(new et("/","In Progress","x",!0,"IN_PROGRESS"))}static makeNonTask(){return new At(new et("Q","Non-Task","A",!0,"NON_TASK"))}static getTypeForUnknownSymbol(e){switch(e){case"x":case"X":return"DONE";case"/":return"IN_PROGRESS";case"-":return"CANCELLED";case"":return"EMPTY";case" ":default:return"TODO"}}static getTypeFromStatusTypeString(e){return Jt[e]||"TODO"}static createUnknownStatus(e){return new At(new et(e,"Unknown","x",!1,"TODO"))}static createFromImportedValue(e){let t=e[0],n=At.getTypeFromStatusTypeString(e[3]);return new At(new et(t,e[1],e[2],!1,n))}isCompleted(){return this.type==="DONE"}isCancelled(){return this.type==="CANCELLED"}identicalTo(e){let t=["symbol","name","nextStatusSymbol","availableAsCommand","type"];for(let n of t)if(this[n]!==e[n])return!1;return!0}previewText(){let e="";return At.tasksPluginCanCreateCommandsForStatuses()&&this.availableAsCommand&&(e=" Available as a command."),`- [${this.symbol}] => [${this.nextStatusSymbol}], name: '${this.name}', type: '${this.configuration.type}'.${e}`}static tasksPluginCanCreateCommandsForStatuses(){return!1}},ne=At;ne.DONE=At.makeDone(),ne.EMPTY=At.makeEmpty(),ne.TODO=At.makeTodo();var ol=class{constructor(e=!1,t=!1){this.ignoreSortInstructions=e,this.showTaskHiddenData=t}};var Le=class{constructor(){this.coreStatuses=[ne.makeTodo().configuration,ne.makeDone().configuration],this.customStatuses=[ne.makeInProgress().configuration,ne.makeCancelled().configuration]}static addStatus(e,t){e.push(t)}static replaceStatus(e,t,n){let i=this.findStatusIndex(t,e);return i<=-1?!1:(e.splice(i,1,n),!0)}static findStatusIndex(e,t){let n=new ne(e);return t.findIndex(i=>new ne(i).previewText()==n.previewText())}static deleteStatus(e,t){let n=this.findStatusIndex(t,e);return n<=-1?!1:(e.splice(n,1),!0)}static deleteAllCustomStatuses(e){e.customStatuses.splice(0)}static resetAllCustomStatuses(e){Le.deleteAllCustomStatuses(e),new Le().customStatuses.forEach(n=>{Le.addStatus(e.customStatuses,n)})}static bulkAddStatusCollection(e,t){let n=[];return t.forEach(i=>{e.customStatuses.find(a=>a.symbol==i[0]&&a.name==i[1]&&a.nextStatusSymbol==i[2])?n.push(`The status ${i[1]} (${i[0]}) is already added.`):Le.addStatus(e.customStatuses,ne.createFromImportedValue(i))}),n}static allStatuses(e){return e.coreStatuses.concat(e.customStatuses)}static applyToStatusRegistry(e,t){t.clearStatuses(),Le.allStatuses(e).forEach(n=>{t.add(n)})}};var pv=[{index:9999,internalName:"INTERNAL_TESTING_ENABLED_BY_DEFAULT",displayName:"Test Item. Used to validate the Feature Framework.",description:"Description",enabledByDefault:!0,stable:!1}];var On=class{constructor(e,t,n,i,s,a){this.internalName=e;this.index=t;this.description=n;this.displayName=i;this.enabledByDefault=s;this.stable=a}static get values(){let e=[];return pv.forEach(t=>{e=[...e,new On(t.internalName,t.index,t.description,t.displayName,t.enabledByDefault,t.stable)]}),e}static get settingsFlags(){let e={};return On.values.forEach(t=>{e[t.internalName]=t.enabledByDefault}),e}static fromString(e){for(let t of On.values)if(e===t.internalName)return t;throw new RangeError(`Illegal argument passed to fromString(): ${e} does not correspond to any available Feature ${this.prototype.constructor.name}`)}};var Dn={tasksPluginEmoji:{displayName:"Tasks Emoji Format",taskSerializer:new Ci(Fm),buildSuggestions:Am(Fm,Cm,!1)},dataview:{displayName:"Dataview",taskSerializer:new al,buildSuggestions:dv(Am(Lm,Cm,!0),[["(",")"],["[","]"]])}},hv={globalQuery:"",globalFilter:"",removeGlobalFilter:!1,taskFormat:"tasksPluginEmoji",setCreatedDate:!1,setDoneDate:!0,setCancelledDate:!0,autoSuggestInEditor:!0,autoSuggestMinMatch:0,autoSuggestMaxItems:6,provideAccessKeys:!0,useFilenameAsScheduledDate:!1,filenameAsDateFolders:[],recurrenceOnNextLine:!1,statusSettings:new Le,features:On.settingsFlags,generalSettings:{},headingOpened:{},debugSettings:new ol,loggingOptions:{minLevels:{"":"info",tasks:"info","tasks.Cache":"info","tasks.Events":"info","tasks.File":"info","tasks.Query":"info","tasks.Task":"info"}}},Zn=X({},hv);function mv(r,e){for(let t in r)e[t]===void 0&&(e[t]=r[t])}var J=()=>(mv(On.settingsFlags,Zn.features),mv(hv.loggingOptions.minLevels,Zn.loggingOptions.minLevels),Zn.statusSettings.customStatuses.forEach((r,e,t)=>{var i,s;let n=ne.getTypeFromStatusTypeString(r.type);t[e]=new et((i=r.symbol)!=null?i:" ",r.name,(s=r.nextStatusSymbol)!=null?s:"x",r.availableAsCommand,n)}),X({},Zn)),tt=r=>(Zn=X(X({},Zn),r),J());var Ai=(r,e)=>(Zn.generalSettings[r]=e,J()),gv=r=>{var e;return(e=Zn.features[r])!=null?e:!1};function Eo(){return Dn[J().taskFormat]}function ul(r){let t={"<":"<",">":">","&":"&",'"':"""}[r];return t!==void 0?t:r}function yv(r){let e=[...r],t="";return e.forEach(n=>{t+=ul(n)}),t}var Oe=class{constructor(){this._registeredStatuses=[];this.addDefaultStatusTypes()}set(e){this.clearStatuses(),e.forEach(t=>{this.add(t)})}get registeredStatuses(){return this._registeredStatuses.filter(({symbol:e})=>e!==ne.EMPTY.symbol)}static getInstance(){return Oe.instance||(Oe.instance=new Oe),Oe.instance}add(e){this.hasSymbol(e.symbol)||(e instanceof ne?this._registeredStatuses.push(e):this._registeredStatuses.push(new ne(e)))}bySymbol(e){return this.hasSymbol(e)?this.getSymbol(e):ne.EMPTY}bySymbolOrCreate(e){return this.hasSymbol(e)?this.getSymbol(e):ne.createUnknownStatus(e)}byName(e){return this._registeredStatuses.filter(({name:t})=>t===e).length>0?this._registeredStatuses.filter(({name:t})=>t===e)[0]:ne.EMPTY}resetToDefaultStatuses(){this.clearStatuses(),this.addDefaultStatusTypes()}clearStatuses(){this._registeredStatuses=[]}getNextStatus(e){if(e.nextStatusSymbol!==""){let t=this.bySymbol(e.nextStatusSymbol);if(t!==null)return t}return ne.EMPTY}getNextStatusOrCreate(e){let t=this.getNextStatus(e);return t.type!=="EMPTY"?t:ne.createUnknownStatus(e.nextStatusSymbol)}getNextRecurrenceStatusOrCreate(e){let t=this.getNextStatusOrCreate(e),n=this.getNextRecurrenceStatusOfType(t,"TODO");if(n)return n;let i=this.getNextRecurrenceStatusOfType(t,"IN_PROGRESS");return i||this.bySymbolOrCreate(" ")}getNextRecurrenceStatusOfType(e,t){if(e.type===t)return e;let n=e;for(let i=0;i<this.registeredStatuses.length-1;i++)if(n=this.getNextStatusOrCreate(n),n.type===t)return n}findUnknownStatuses(e){let t=e.filter(s=>!this.hasSymbol(s.symbol)),n=new Oe,i=[];return t.forEach(s=>{if(n.hasSymbol(s.symbol))return;let a=Oe.copyStatusWithNewName(s,`Unknown (${s.symbol})`);i.push(a),n.add(a)}),i.sort((s,a)=>s.symbol.localeCompare(a.symbol,void 0,{numeric:!0}))}static copyStatusWithNewName(e,t){let n=new et(e.symbol,t,e.nextStatusSymbol,e.availableAsCommand,e.type);return new ne(n)}getSymbol(e){return this._registeredStatuses.filter(({symbol:t})=>t===e)[0]}hasSymbol(e){return this._registeredStatuses.find(t=>t.symbol===e)!==void 0}addDefaultStatusTypes(){[ne.makeTodo(),ne.makeInProgress(),ne.makeDone(),ne.makeCancelled()].forEach(t=>{this.add(t)})}mermaidDiagram(e=!1){let t=this.registeredStatuses,n="mermaid",i=[],s=[];return t.forEach((a,o)=>{let u=this.getMermaidNodeLabel(a,e);i.push(`${o+1}${u}`);let l=this.getNextStatus(a);if(this.addEdgeIfNotToInternal(t,l,s,o,!1),a.type==="DONE"){let c=this.getNextRecurrenceStatusOrCreate(a);c.symbol!==l.symbol&&this.addEdgeIfNotToInternal(t,c,s,o,!0)}}),` +`).map(function(i){return i.replace(/^RRULE:/,"EXRULE:")}).filter(function(i){return!/^DTSTART/.test(i)}))}),this._rdate.length&&t.push(iv("RDATE",this._rdate,this.tzid())),this._exdate.length&&t.push(iv("EXDATE",this._exdate,this.tzid())),t},e.prototype.toString=function(){return this.valueOf().join(` +`)},e.prototype.clone=function(){var t=new e(!!this._cache);return this._rrule.forEach(function(n){return t.rrule(n.clone())}),this._exrule.forEach(function(n){return t.exrule(n.clone())}),this._rdate.forEach(function(n){return t.rdate(new Date(n.getTime()))}),this._exdate.forEach(function(n){return t.exdate(new Date(n.getTime()))}),t},e}(z);function rv(r,e){if(!(r instanceof z))throw new TypeError(String(r)+" is not RRule instance");ye(e.map(String),String(r))||e.push(r)}function nv(r,e){if(!(r instanceof Date))throw new TypeError(String(r)+" is not Date instance");ye(e.map(Number),Number(r))||(e.push(r),On(e))}function iv(r,e,t){var n=!t||t.toUpperCase()==="UTC",i=n?"".concat(r,":"):"".concat(r,";TZID=").concat(t,":"),s=e.map(function(a){return bs(a.valueOf(),n)}).join(",");return"".concat(i).concat(s)}var Em=pa(Xe());function Tr(r,e){return r!==null&&e===null?-1:r===null&&e!==null?1:r!==null&&e!==null?r.isValid()&&!e.isValid()?1:!r.isValid()&&e.isValid()?-1:r.isAfter(e)?1:r.isBefore(e)?-1:0:0}function JP(r,e,t=void 0){if(!e)return`<i>no ${r} date</i>`;let n=Em.parseDate(e,t,{forwardDate:t!=null});return n!==null?window.moment(n).format("YYYY-MM-DD"):`<i>invalid ${r} date</i>`}function sv(r,e,t){return JP(r,e,t?new Date:void 0)}function Ci(r,e){let t=null,n=Em.parseDate(r,new Date,{forwardDate:e});return n!==null&&(t=window.moment(n)),t}var Ze=class{constructor({rrule:e,baseOnToday:t,referenceDate:n,startDate:i,scheduledDate:s,dueDate:a}){this.rrule=e,this.baseOnToday=t,this.referenceDate=n,this.startDate=i,this.scheduledDate=s,this.dueDate=a}static fromText({recurrenceRuleText:e,startDate:t,scheduledDate:n,dueDate:i}){try{let s=e.match(/^([a-zA-Z0-9, !]+?)( when done)?$/i);if(s==null)return null;let a=s[1].trim(),o=s[2]!==void 0,u=z.parseText(a);if(u!==null){let l=null;i?l=window.moment(i):n?l=window.moment(n):t&&(l=window.moment(t)),!o&&l!==null?u.dtstart=window.moment(l).startOf("day").utc(!0).toDate():u.dtstart=window.moment().startOf("day").utc(!0).toDate();let c=new z(u);return new Ze({rrule:c,baseOnToday:o,referenceDate:l,startDate:t,scheduledDate:n,dueDate:i})}}catch(s){s instanceof Error&&console.log(s.message)}return null}toText(){let e=this.rrule.toText();return this.baseOnToday&&(e+=" when done"),e}next(e=window.moment()){let t=this.nextReferenceDate(e);if(t!==null){let n=null,i=null,s=null;if(this.referenceDate){if(this.startDate){let a=window.moment.duration(this.startDate.diff(this.referenceDate));n=window.moment(t),n.add(Math.round(a.asDays()),"days")}if(this.scheduledDate){let a=window.moment.duration(this.scheduledDate.diff(this.referenceDate));i=window.moment(t),i.add(Math.round(a.asDays()),"days")}if(this.dueDate){let a=window.moment.duration(this.dueDate.diff(this.referenceDate));s=window.moment(t),s.add(Math.round(a.asDays()),"days")}}return{startDate:n,scheduledDate:i,dueDate:s}}return null}identicalTo(e){return this.baseOnToday!==e.baseOnToday||Tr(this.startDate,e.startDate)!==0||Tr(this.scheduledDate,e.scheduledDate)!==0||Tr(this.dueDate,e.dueDate)!==0?!1:this.toText()===e.toText()}nextReferenceDate(e){return this.baseOnToday?this.nextReferenceDateFromToday(e).toDate():this.nextReferenceDateFromOriginalReferenceDate().toDate()}nextReferenceDateFromToday(e){let t=new z(_e(Q({},this.rrule.origOptions),{dtstart:e.startOf("day").utc(!0).toDate()}));return this.nextAfter(e.endOf("day"),t)}nextReferenceDateFromOriginalReferenceDate(){var t;let e=window.moment((t=this.referenceDate)!=null?t:void 0).endOf("day");return this.nextAfter(e,this.rrule)}nextAfter(e,t){e.utc(!0);let n=window.moment(t.after(e.toDate())),i=this.toText(),s=i.match(/every( \d+)? month(s)?(.*)?/);s!==null&&(i.includes(" on ")||(n=Ze.nextAfterMonths(e,n,t,s[1])));let a=i.match(/every( \d+)? year(s)?(.*)?/);return a!==null&&(n=Ze.nextAfterYears(e,n,t,a[1])),Ze.addTimezone(n)}static nextAfterMonths(e,t,n,i){let s=1;for(i!==void 0&&(s=Number.parseInt(i.trim(),10));Ze.isSkippingTooManyMonths(e,t,s);)t=Ze.fromOneDayEarlier(e,n);return t}static isSkippingTooManyMonths(e,t,n){let i=t.month()-e.month();return i+=(t.year()-e.year())*12,i>n}static nextAfterYears(e,t,n,i){let s=1;for(i!==void 0&&(s=Number.parseInt(i.trim(),10));Ze.isSkippingTooManyYears(e,t,s);)t=Ze.fromOneDayEarlier(e,n);return t}static isSkippingTooManyYears(e,t,n){return t.year()-e.year()>n}static fromOneDayEarlier(e,t){e.subtract(1,"days").endOf("day");let n=t.origOptions;return n.dtstart=e.startOf("day").toDate(),t=new z(n),window.moment(t.after(e.toDate()))}static addTimezone(e){return window.moment.utc(e).local(!0).startOf("day")}};var ws=(f=>(f.Description="description",f.Id="id",f.DependsOn="dependsOn",f.Priority="priority",f.RecurrenceRule="recurrenceRule",f.CreatedDate="createdDate",f.StartDate="startDate",f.ScheduledDate="scheduledDate",f.DueDate="dueDate",f.CancelledDate="cancelledDate",f.DoneDate="doneDate",f.BlockLink="blockLink",f))(ws||{}),el=Object.values(ws),Jr=class{constructor(){this.visible={};this.tagsVisible=!0;el.forEach(e=>{this.visible[e]=!0})}isShown(e){return this.visible[e]}areTagsShown(){return this.tagsVisible}hide(e){this.visible[e]=!1}setVisibility(e,t){this.visible[e]=t}setTagsVisibility(e){this.tagsVisible=e}get shownComponents(){return el.filter(e=>this.visible[e])}get hiddenComponents(){return el.filter(e=>!this.visible[e])}get toggleableComponents(){return el.filter(e=>e!=="description"&&e!=="blockLink")}toggleVisibilityExceptDescriptionAndBlockLink(){this.toggleableComponents.forEach(e=>{this.visible[e]=!this.visible[e]}),this.setTagsVisibility(!this.areTagsShown())}};var Jt=class{},J=Jt;J.dateFormat="YYYY-MM-DD",J.dateTimeFormat="YYYY-MM-DD HH:mm",J.indentationRegex=/^([\s\t>]*)/,J.listMarkerRegex=/([-*+]|[0-9]+\.)/,J.checkboxRegex=/\[(.)\]/u,J.afterCheckboxRegex=/ *(.*)/u,J.taskRegex=new RegExp(Jt.indentationRegex.source+Jt.listMarkerRegex.source+" +"+Jt.checkboxRegex.source+Jt.afterCheckboxRegex.source,"u"),J.nonTaskRegex=new RegExp(Jt.indentationRegex.source+Jt.listMarkerRegex.source+"? *("+Jt.checkboxRegex.source+")?"+Jt.afterCheckboxRegex.source,"u"),J.listItemRegex=new RegExp(Jt.indentationRegex.source+Jt.listMarkerRegex.source),J.blockLinkRegex=/ \^[a-zA-Z0-9-]+$/u,J.hashTags=/(^|\s)#[^ !@#$%^&*(),.?":{}|<>]+/g,J.hashTagsFromEnd=new RegExp(Jt.hashTags.source+"$");var Ai=/[a-zA-Z0-9-_]+/,Om=new RegExp(Ai.source+"( *, *"+Ai.source+" *)*"),Dm={prioritySymbols:{Highest:"\u{1F53A}",High:"\u23EB",Medium:"\u{1F53C}",Low:"\u{1F53D}",Lowest:"\u23EC",None:""},startDateSymbol:"\u{1F6EB}",createdDateSymbol:"\u2795",scheduledDateSymbol:"\u23F3",dueDateSymbol:"\u{1F4C5}",doneDateSymbol:"\u2705",cancelledDateSymbol:"\u274C",recurrenceSymbol:"\u{1F501}",dependsOnSymbol:"\u26D4",idSymbol:"\u{1F194}",TaskFormatRegularExpressions:{priorityRegex:/([🔺⏫🔼🔽⏬])\uFE0F?$/u,startDateRegex:/🛫 *(\d{4}-\d{2}-\d{2})$/u,createdDateRegex:/➕ *(\d{4}-\d{2}-\d{2})$/u,scheduledDateRegex:/[⏳⌛] *(\d{4}-\d{2}-\d{2})$/u,dueDateRegex:/[📅📆🗓] *(\d{4}-\d{2}-\d{2})$/u,doneDateRegex:/✅ *(\d{4}-\d{2}-\d{2})$/u,cancelledDateRegex:/❌ *(\d{4}-\d{2}-\d{2})$/u,recurrenceRegex:/🔁 ?([a-zA-Z0-9, !]+)$/iu,dependsOnRegex:new RegExp("\u26D4\uFE0F? *("+Om.source+")$","iu"),idRegex:new RegExp("\u{1F194} *("+Ai.source+")$","iu")}};function Sm(r,e,t){return t?r?" "+e:` ${e} ${t}`:""}function ks(r,e,t){return t?r?" "+e:` ${e} ${t.format(J.dateFormat)}`:""}var Pi=class{constructor(e){this.symbols=e}serialize(e){let t=new Jr,n="",i=!1;for(let s of t.shownComponents)n+=this.componentToString(e,i,s);return n}componentToString(e,t,n){var g;let{prioritySymbols:i,startDateSymbol:s,createdDateSymbol:a,scheduledDateSymbol:o,doneDateSymbol:u,cancelledDateSymbol:l,recurrenceSymbol:c,dueDateSymbol:d,dependsOnSymbol:f,idSymbol:m}=this.symbols;switch(n){case"description":return e.description;case"priority":{let T="";return e.priority==="0"?T=" "+i.Highest:e.priority==="1"?T=" "+i.High:e.priority==="2"?T=" "+i.Medium:e.priority==="4"?T=" "+i.Low:e.priority==="5"&&(T=" "+i.Lowest),T}case"startDate":return ks(t,s,e.startDate);case"createdDate":return ks(t,a,e.createdDate);case"scheduledDate":return e.scheduledDateIsInferred?"":ks(t,o,e.scheduledDate);case"doneDate":return ks(t,u,e.doneDate);case"cancelledDate":return ks(t,l,e.cancelledDate);case"dueDate":return ks(t,d,e.dueDate);case"recurrenceRule":return e.recurrence?Sm(t,c,e.recurrence.toText()):"";case"dependsOn":return e.dependsOn.length===0?"":Sm(t,f,e.dependsOn.join(","));case"id":return Sm(t,m,e.id);case"blockLink":return(g=e.blockLink)!=null?g:"";default:throw new Error(`Don't know how to render task component of type '${n}'`)}}parsePriority(e){let{prioritySymbols:t}=this.symbols;switch(e){case t.Lowest:return"5";case t.Low:return"4";case t.Medium:return"2";case t.High:return"1";case t.Highest:return"0";default:return"3"}}deserialize(e){let{TaskFormatRegularExpressions:t}=this.symbols,n,i="3",s=null,a=null,o=null,u=null,l=null,c=null,d="",f=null,m="",g=[],T="",y=20,E=0;do{n=!1;let x=e.match(t.priorityRegex);x!==null&&(i=this.parsePriority(x[1]),e=e.replace(t.priorityRegex,"").trim(),n=!0);let R=e.match(t.doneDateRegex);R!==null&&(u=window.moment(R[1],J.dateFormat),e=e.replace(t.doneDateRegex,"").trim(),n=!0);let $=e.match(t.cancelledDateRegex);$!==null&&(l=window.moment($[1],J.dateFormat),e=e.replace(t.cancelledDateRegex,"").trim(),n=!0);let q=e.match(t.dueDateRegex);q!==null&&(o=window.moment(q[1],J.dateFormat),e=e.replace(t.dueDateRegex,"").trim(),n=!0);let ne=e.match(t.scheduledDateRegex);ne!==null&&(a=window.moment(ne[1],J.dateFormat),e=e.replace(t.scheduledDateRegex,"").trim(),n=!0);let B=e.match(t.startDateRegex);B!==null&&(s=window.moment(B[1],J.dateFormat),e=e.replace(t.startDateRegex,"").trim(),n=!0);let G=e.match(t.createdDateRegex);G!==null&&(c=window.moment(G[1],J.dateFormat),e=e.replace(t.createdDateRegex,"").trim(),n=!0);let Te=e.match(t.recurrenceRegex);Te!==null&&(d=Te[1].trim(),e=e.replace(t.recurrenceRegex,"").trim(),n=!0);let Pe=e.match(J.hashTagsFromEnd);if(Pe!=null){e=e.replace(J.hashTagsFromEnd,"").trim(),n=!0;let O=Pe[0].trim();T=T.length>0?[O,T].join(" "):O}let j=e.match(t.idRegex);j!=null&&(e=e.replace(t.idRegex,"").trim(),m=j[1].trim(),n=!0);let W=e.match(t.dependsOnRegex);W!=null&&(e=e.replace(t.dependsOnRegex,"").trim(),g=W[1].replace(/ /g,"").split(",").filter(O=>O!==""),n=!0),E++}while(n&&E<=y);return d.length>0&&(f=Ze.fromText({recurrenceRuleText:d,startDate:s,scheduledDate:a,dueDate:o})),T.length>0&&(e+=" "+T),{description:e,priority:i,startDate:s,createdDate:c,scheduledDate:a,dueDate:o,doneDate:u,cancelledDate:l,recurrence:f,id:m,dependsOn:g,tags:ue.extractHashtags(e)}}};function Eo(r){let e="",t=!0;for(;t;)e=Math.random().toString(36).substring(2,6+2),r.includes(e)||(t=!1);return e}function tl(r,e){return r.id!==""?r:new ue(_e(Q({},r),{id:Eo(e)}))}function av(r,e){let t=r;if(!r.dependsOn.includes(e.id)){let n=[...r.dependsOn,e.id];t=new ue(_e(Q({},r),{dependsOn:n}))}return t}function ov(r,e){let t=r;if(r.dependsOn.includes(e.id)){let n=r.dependsOn.filter(i=>i!==e.id);t=new ue(_e(Q({},r),{dependsOn:n}))}return t}function Es(r){return r.replace(/([.*+?^${}()|[\]/\\])/g,"\\$1")}var ti=class{constructor(){this._globalFilter="";this._removeGlobalFilter=!1}static getInstance(){return ti.instance||(ti.instance=new ti),ti.instance}get(){return this._globalFilter}set(e){this._globalFilter=e}reset(){this.set(ti.empty)}isEmpty(){return this.get()===ti.empty}equals(e){return this.get()===e}includedIn(e){let t=this.get();return e.includes(t)}prependTo(e){return this.get()+" "+e}removeAsWordFromDependingOnSettings(e){return this.getRemoveGlobalFilter()?this.removeAsWordFrom(e):e}getRemoveGlobalFilter(){return this._removeGlobalFilter}setRemoveGlobalFilter(e){this._removeGlobalFilter=e}removeAsWordFrom(e){if(this.isEmpty())return e;let t=RegExp("(^|\\s)"+Es(this.get())+"($|\\s)","ug");return e.search(t)>-1&&(e=e.replace(t,"$1$2").replace(" "," ").trim()),e}removeAsSubstringFrom(e){let t=this.get();return e.replace(t,"").trim()}},be=ti;be.empty="";var lv=require("obsidian");var eN=20;function Ni(r){return be.getInstance().removeAsWordFrom(r.description)}function tN(r,e){if(r==="")return e;let t=(0,lv.prepareSimpleSearch)(r),n=-4;return e.map(a=>{let o=t(Ni(a));return o&&o.score>n?{item:a,match:o}:null}).filter(Boolean).sort((a,o)=>o.match.score-a.match.score).map(a=>a.item)}function rl(r,e,t,n,i){let s=tN(r,e);return s=s.filter(a=>!(a.isDone||a.description.includes("<%")&&a.description.includes("%>")||a.description===(t==null?void 0:t.description)&&a.taskLocation.path===(t==null?void 0:t.taskLocation.path)&&a.originalMarkdown===(t==null?void 0:t.originalMarkdown)||(n==null?void 0:n.includes(a))||(i==null?void 0:i.includes(a)))),t&&s.sort((a,o)=>{let u=a.taskLocation.path===t.taskLocation.path,l=o.taskLocation.path===t.taskLocation.path;return u&&l?Math.abs(a.taskLocation.lineNumber-t.taskLocation.lineNumber)-Math.abs(o.taskLocation.lineNumber-t.taskLocation.lineNumber):u?-1:l?1:0}),s.slice(0,eN)}var xm=5,rN=!1;globalThis.SHOW_DEPENDENCY_SUGGESTIONS=rN;function Rm(r,e,t){let n=[r.startDateSymbol,r.scheduledDateSymbol,r.dueDateSymbol].join("|");return(i,s,a,o,u)=>{let l=[];return l=l.concat(iN(i,s,a,n,e,t)),l=l.concat(sN(i,s,a,r.recurrenceSymbol,t)),globalThis.SHOW_DEPENDENCY_SUGGESTIONS&&(l=l.concat(aN(i,s,r.idSymbol,o)),l=l.concat(oN(i,s,a,r.dependsOnSymbol,o,u))),l=l.concat(nN(i,s,a,r,t)),l.length>0&&!l.some(c=>c.suggestionType==="match")&&(t||l.unshift({suggestionType:"empty",displayText:"\u23CE",appendText:` +`})),l=l.slice(0,a.autoSuggestMaxItems),l}}function Mm(r,e,t){let n=lN(e.substring(0,t),[["(",")"],["[","]"]])=="("?")":"]",i=r?n+" ":" ",s=r&&e.length>t&&e.charAt(t)===n?1:0;return{postfix:i,insertSkip:s}}function nN(r,e,t,n,i){let s=d=>Object.values(n.prioritySymbols).some(f=>f.length>0&&d.includes(f)),a=[],{postfix:o,insertSkip:u}=Mm(i,r,e);if(r.includes(n.dueDateSymbol)||a.push({displayText:`${n.dueDateSymbol} due date`,appendText:`${n.dueDateSymbol} `}),r.includes(n.startDateSymbol)||a.push({displayText:`${n.startDateSymbol} start date`,appendText:`${n.startDateSymbol} `}),r.includes(n.scheduledDateSymbol)||a.push({displayText:`${n.scheduledDateSymbol} scheduled date`,appendText:`${n.scheduledDateSymbol} `}),globalThis.SHOW_DEPENDENCY_SUGGESTIONS&&(r.includes(n.idSymbol)||a.push({displayText:`${n.idSymbol} Task ID`,appendText:`${n.idSymbol}`}),r.includes(n.dependsOnSymbol)||a.push({displayText:`${n.dependsOnSymbol} Task depends on ID`,appendText:`${n.dependsOnSymbol}`})),!s(r)){let d=n.prioritySymbols,f=["High","Medium","Low","Highest","Lowest"];for(let m=0;m<f.length;m++){let g=f[m],T=d[g];a.push({displayText:i?`${T} priority`:`${T} ${g.toLowerCase()} priority`,appendText:`${T}${o}`,insertSkip:i?u:void 0})}}if(r.includes(n.recurrenceSymbol)||a.push({displayText:`${n.recurrenceSymbol} recurring (repeat)`,appendText:`${n.recurrenceSymbol} `}),!r.includes(n.createdDateSymbol)){let f=Qt.parseDate("today",!0).format(J.dateFormat);a.push({textToMatch:`${n.createdDateSymbol} created`,displayText:`${n.createdDateSymbol} created today (${f})`,appendText:`${n.createdDateSymbol} ${f}`+o,insertSkip:i?u:void 0})}let l=So(r,/([a-zA-Z'_-]*)/g,e),c=[];if(l&&l.length>0){let d=l[0];if(d.length>=Math.max(1,t.autoSuggestMinMatch)){let f=a.filter(m=>(m.textToMatch||m.displayText).toLowerCase().includes(d.toLowerCase()));for(let m of f){let g=i&&(m.displayText.includes("priority")||m.displayText.includes("created"))?d.length+u:d.length;c.push({suggestionType:"match",displayText:m.displayText,appendText:m.appendText,insertAt:l.index,insertSkip:g})}}}return c.length===0&&t.autoSuggestMinMatch===0?a:c}function iN(r,e,t,n,i,s){let a=["today","tomorrow","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","next week","next month","next year"],{postfix:o,insertSkip:u}=Mm(s,r,e),l=[],c=new RegExp(`(${n})\\s*([0-9a-zA-Z ]*)`,"ug"),d=So(r,c,e);if(d&&d.length>=2){let f=d[1],m=d[2];if(m.length<t.autoSuggestMinMatch)return[];let g=m&&m.length>1?Qt.parseDate(Bu(m),!0):null;g&&g.isValid()&&l.push({displayText:`${g.format(J.dateFormat)}`,appendText:`${f} ${g.format(J.dateFormat)} `,insertAt:d.index,insertSkip:d[0].length});let T=1,y=a.filter(E=>m&&m.length>=T&&E.toLowerCase().includes(m.toLowerCase())).slice(0,i);y.length===0&&(y=a.slice(0,i));for(let E of y){let R=`${Qt.parseDate(E,!0).format(J.dateFormat)}`,$=s?d[0].length+u:d[0].length;l.push({suggestionType:"match",displayText:`${E} (${R})`,appendText:`${f} ${R}`+o,insertAt:d.index,insertSkip:$})}}return l}function sN(r,e,t,n,i){var d;let s=["every","every day","every week","every month","every month on the","every year","every week on Sunday","every week on Monday","every week on Tuesday","every week on Wednesday","every week on Thursday","every week on Friday","every week on Saturday"],{postfix:a,insertSkip:o}=Mm(i,r,e),u=[],l=new RegExp(`(${n})\\s*([0-9a-zA-Z ]*)`,"ug"),c=So(r,l,e);if(c&&c.length>=2){let f=c[1],m=c[2];if(m.length<t.autoSuggestMinMatch)return[];if(m.length>0){let E=(d=Ze.fromText({recurrenceRuleText:m,startDate:null,scheduledDate:null,dueDate:null}))==null?void 0:d.toText();if(E){let x=`${f} ${E}`+a,R=i?c[0].length+o:c[0].length;if(u.push({suggestionType:"match",displayText:`\u2705 ${E}`,appendText:x,insertAt:c.index,insertSkip:R}),c[0]==x)return[]}}let g=1,T=t.autoSuggestMaxItems/2,y=s.filter(E=>m&&m.length>=g&&E.toLowerCase().includes(m.toLowerCase())).slice(0,T);y.length===0&&m.trim().length===0&&(y=s.slice(0,T));for(let E of y)u.push({suggestionType:"match",displayText:`${E}`,appendText:`${f} ${E} `,insertAt:c.index,insertSkip:c[0].length})}return u}function aN(r,e,t,n){let i=[],s=new RegExp(`(${t})\\s*(${Ai.source})?`,"ug"),a=So(r,s,e);if(a&&a[0].trim().length<=t.length){let o=Eo(n.map(u=>u.id));i.push({suggestionType:"match",displayText:"Auto Generate Unique ID",appendText:`${t} ${o}`,insertAt:a.index,insertSkip:t.length})}return i}function oN(r,e,t,n,i,s){let a=[],o=new RegExp(`(${n})([0-9a-zA-Z-_ ^,]*,)*([0-9a-zA-Z ^,]*)`,"ug"),u=So(r,o,e);if(u&&u.length>=1){let l=u[2]||"",c=u[3],d=[];if(l){let f=l.split(",").map(m=>m.trim());d=i.filter(m=>m.id&&f.includes(m.id))}if(c.length>=t.autoSuggestMinMatch){let f=rl(c.trim(),i,s,[],d);for(let m of f)a.push({suggestionType:"match",displayText:`${m.descriptionWithoutTags} - From: ${m.filename}.md`,appendText:`${n}${l}`,insertAt:u.index,insertSkip:n.length+l.length+c.length,taskItDependsOn:m})}}return a}function So(r,e,t){let n=r.matchAll(e);for(let i of n)if((i==null?void 0:i.index)&&i.index<t&&t<=i.index+i[0].length)return i}function uN(r,e){if(e.length===0)return!1;let t=Object.fromEntries(e.map(([i,s])=>[i,0])),n=Object.fromEntries(e.map(([i,s])=>[s,i]));for(let i of r)i in t?t[i]++:i in n&&(t[n[i]]=Math.max(0,t[n[i]]-1));return Object.values(t).some(i=>i>0)}function lN(r,e){if(e.length===0)return null;let t=Object.fromEntries(e.map(([s,a])=>[s,0])),n=Object.fromEntries(e.map(([s,a])=>[a,s])),i=[];for(let s=0;s<r.length;s++){let a=r[s];if(a in t)t[a]++,i.push({bracket:a,idx:s});else if(a in n){if(t[n[a]]>=1){for(let o=i.length-1;o>=0;o--)if(i[o].bracket==n[a]){i.splice(o,1);break}}t[n[a]]=Math.max(0,t[n[a]]-1)}}return i.length>0?i[i.length-1].bracket:null}function cv(r,e){return(t,n,i,s,a)=>uN(t.slice(0,n),e)?r(t,n,i,s,a):[]}function dv(r,e,t){let n=be.getInstance().includedIn(r),i=cN(t,e,n);return typeof i=="boolean"?i:n&&dN(r,e.ch)}function cN(r,e,t){var n,i;return(i=(n=r==null?void 0:r.editorComponent)==null?void 0:n.showTasksPluginAutoSuggest)==null?void 0:i.call(n,e,r,t)}function dN(r,e){if(r.length===0)return!1;let t=ue.extractTaskComponents(r);if(!t)return!1;let n=t.indentation+t.listMarker+" ["+t.status.symbol+"] ";return e>=n.length}function en(r){let e=["(?:",/(?=[^\]]+\])\[/,"|",/(?=[^)]+\))\(/,")",/ */,r,/ */,/[)\]]/,/(?: *,)?/,/$/].map(t=>t instanceof RegExp?t.source:t).join("");return new RegExp(e,r.flags)}var Cm={prioritySymbols:{Highest:"priority:: highest",High:"priority:: high",Medium:"priority:: medium",Low:"priority:: low",Lowest:"priority:: lowest",None:""},startDateSymbol:"start::",createdDateSymbol:"created::",scheduledDateSymbol:"scheduled::",dueDateSymbol:"due::",doneDateSymbol:"completion::",cancelledDateSymbol:"cancelled::",recurrenceSymbol:"repeat::",idSymbol:"id::",dependsOnSymbol:"dependsOn::",TaskFormatRegularExpressions:{priorityRegex:en(/priority:: *(highest|high|medium|low|lowest)/),startDateRegex:en(/start:: *(\d{4}-\d{2}-\d{2})/),createdDateRegex:en(/created:: *(\d{4}-\d{2}-\d{2})/),scheduledDateRegex:en(/scheduled:: *(\d{4}-\d{2}-\d{2})/),dueDateRegex:en(/due:: *(\d{4}-\d{2}-\d{2})/),doneDateRegex:en(/completion:: *(\d{4}-\d{2}-\d{2})/),cancelledDateRegex:en(/cancelled:: *(\d{4}-\d{2}-\d{2})/),recurrenceRegex:en(/repeat:: *([a-zA-Z0-9, !]+)/),dependsOnRegex:en(new RegExp("dependsOn:: *("+Om.source+")")),idRegex:en(new RegExp("id:: *("+Ai.source+")"))}},nl=class extends Pi{constructor(){super(Cm)}parsePriority(e){switch(e){case"highest":return"0";case"high":return"1";case"medium":return"2";case"low":return"4";case"lowest":return"5";default:return"3"}}componentToString(e,t,n){let i=super.componentToString(e,t,n),s=["blockLink","description"];return i!==""&&!s.includes(n)?` [${i.trim()}]`:i}};var er=(a=>(a.TODO="TODO",a.DONE="DONE",a.IN_PROGRESS="IN_PROGRESS",a.CANCELLED="CANCELLED",a.NON_TASK="NON_TASK",a.EMPTY="EMPTY",a))(er||{}),Je=class{constructor(e,t,n,i,s="TODO"){this.symbol=e,this.name=t,this.nextStatusSymbol=n,this.availableAsCommand=i,this.type=s}};var Mt=class{get symbol(){return this.configuration.symbol}get name(){return this.configuration.name}get nextStatusSymbol(){return this.configuration.nextStatusSymbol}get nextSymbol(){return this.configuration.nextStatusSymbol}get availableAsCommand(){return this.configuration.availableAsCommand}get type(){return this.configuration.type}get typeGroupText(){let e=this.type,t;switch(e){case"IN_PROGRESS":t="1";break;case"TODO":t="2";break;case"DONE":t="3";break;case"CANCELLED":t="4";break;case"NON_TASK":t="5";break;case"EMPTY":t="6";break}return`%%${t}%%${e}`}constructor(e){this.configuration=e}static makeDone(){return new Mt(new Je("x","Done"," ",!0,"DONE"))}static makeEmpty(){return new Mt(new Je("","EMPTY","",!0,"EMPTY"))}static makeTodo(){return new Mt(new Je(" ","Todo","x",!0,"TODO"))}static makeCancelled(){return new Mt(new Je("-","Cancelled"," ",!0,"CANCELLED"))}static makeInProgress(){return new Mt(new Je("/","In Progress","x",!0,"IN_PROGRESS"))}static makeNonTask(){return new Mt(new Je("Q","Non-Task","A",!0,"NON_TASK"))}static getTypeForUnknownSymbol(e){switch(e){case"x":case"X":return"DONE";case"/":return"IN_PROGRESS";case"-":return"CANCELLED";case"":return"EMPTY";case" ":default:return"TODO"}}static getTypeFromStatusTypeString(e){return er[e]||"TODO"}static createUnknownStatus(e){return new Mt(new Je(e,"Unknown","x",!1,"TODO"))}static createFromImportedValue(e){let t=e[0],n=Mt.getTypeFromStatusTypeString(e[3]);return new Mt(new Je(t,e[1],e[2],!1,n))}isCompleted(){return this.type==="DONE"}isCancelled(){return this.type==="CANCELLED"}identicalTo(e){let t=["symbol","name","nextStatusSymbol","availableAsCommand","type"];for(let n of t)if(this[n]!==e[n])return!1;return!0}previewText(){let e="";return Mt.tasksPluginCanCreateCommandsForStatuses()&&this.availableAsCommand&&(e=" Available as a command."),`- [${this.symbol}] => [${this.nextStatusSymbol}], name: '${this.name}', type: '${this.configuration.type}'.${e}`}static tasksPluginCanCreateCommandsForStatuses(){return!1}},te=Mt;te.DONE=Mt.makeDone(),te.EMPTY=Mt.makeEmpty(),te.TODO=Mt.makeTodo();var il=class{constructor(e=!1,t=!1,n=!1){this.ignoreSortInstructions=e,this.showTaskHiddenData=t,this.recordTimings=n}};var Le=class{constructor(){this.coreStatuses=[te.makeTodo().configuration,te.makeDone().configuration],this.customStatuses=[te.makeInProgress().configuration,te.makeCancelled().configuration]}static addStatus(e,t){e.push(t)}static replaceStatus(e,t,n){let i=this.findStatusIndex(t,e);return i<=-1?!1:(e.splice(i,1,n),!0)}static findStatusIndex(e,t){let n=new te(e);return t.findIndex(i=>new te(i).previewText()==n.previewText())}static deleteStatus(e,t){let n=this.findStatusIndex(t,e);return n<=-1?!1:(e.splice(n,1),!0)}static deleteAllCustomStatuses(e){e.customStatuses.splice(0)}static resetAllCustomStatuses(e){Le.deleteAllCustomStatuses(e),new Le().customStatuses.forEach(n=>{Le.addStatus(e.customStatuses,n)})}static bulkAddStatusCollection(e,t){let n=[];return t.forEach(i=>{e.customStatuses.find(a=>a.symbol==i[0]&&a.name==i[1]&&a.nextStatusSymbol==i[2])?n.push(`The status ${i[1]} (${i[0]}) is already added.`):Le.addStatus(e.customStatuses,te.createFromImportedValue(i))}),n}static allStatuses(e){return e.coreStatuses.concat(e.customStatuses)}static applyToStatusRegistry(e,t){t.clearStatuses(),Le.allStatuses(e).forEach(n=>{t.add(n)})}};var fv=[{index:9999,internalName:"INTERNAL_TESTING_ENABLED_BY_DEFAULT",displayName:"Test Item. Used to validate the Feature Framework.",description:"Description",enabledByDefault:!0,stable:!1}];var Rn=class{constructor(e,t,n,i,s,a){this.internalName=e;this.index=t;this.description=n;this.displayName=i;this.enabledByDefault=s;this.stable=a}static get values(){let e=[];return fv.forEach(t=>{e=[...e,new Rn(t.internalName,t.index,t.description,t.displayName,t.enabledByDefault,t.stable)]}),e}static get settingsFlags(){let e={};return Rn.values.forEach(t=>{e[t.internalName]=t.enabledByDefault}),e}static fromString(e){for(let t of Rn.values)if(e===t.internalName)return t;throw new RangeError(`Illegal argument passed to fromString(): ${e} does not correspond to any available Feature ${this.prototype.constructor.name}`)}};var Nr={tasksPluginEmoji:{displayName:"Tasks Emoji Format",taskSerializer:new Pi(Dm),buildSuggestions:Rm(Dm,xm,!1)},dataview:{displayName:"Dataview",taskSerializer:new nl,buildSuggestions:cv(Rm(Cm,xm,!0),[["(",")"],["[","]"]])}},Pm={globalQuery:"",globalFilter:"",removeGlobalFilter:!1,taskFormat:"tasksPluginEmoji",setCreatedDate:!1,setDoneDate:!0,setCancelledDate:!0,autoSuggestInEditor:!0,autoSuggestMinMatch:0,autoSuggestMaxItems:6,provideAccessKeys:!0,useFilenameAsScheduledDate:!1,filenameAsDateFolders:[],recurrenceOnNextLine:!1,statusSettings:new Le,features:Rn.settingsFlags,generalSettings:{},headingOpened:{},debugSettings:new il,loggingOptions:{minLevels:{"":"info",tasks:"info","tasks.Cache":"info","tasks.Events":"info","tasks.File":"info","tasks.Query":"info","tasks.Task":"info"}}},Mn=Q({},Pm);function Am(r,e){for(let t in r)e[t]===void 0&&(e[t]=r[t])}var X=()=>(Am(Rn.settingsFlags,Mn.features),Am(Pm.loggingOptions.minLevels,Mn.loggingOptions.minLevels),Am(Pm.debugSettings,Mn.debugSettings),Mn.statusSettings.customStatuses.forEach((r,e,t)=>{var i,s;let n=te.getTypeFromStatusTypeString(r.type);t[e]=new Je((i=r.symbol)!=null?i:" ",r.name,(s=r.nextStatusSymbol)!=null?s:"x",r.availableAsCommand,n)}),Q({},Mn)),et=r=>(Mn=Q(Q({},Mn),r),X());var Ii=(r,e)=>(Mn.generalSettings[r]=e,X()),pv=r=>{var e;return(e=Mn.features[r])!=null?e:!1};function Oo(){return Nr[X().taskFormat]}function sl(r){let t={"<":"<",">":">","&":"&",'"':"""}[r];return t!==void 0?t:r}function mv(r){let e=[...r],t="";return e.forEach(n=>{t+=sl(n)}),t}var De=class{constructor(){this._registeredStatuses=[];this.addDefaultStatusTypes()}set(e){this.clearStatuses(),e.forEach(t=>{this.add(t)})}get registeredStatuses(){return this._registeredStatuses.filter(({symbol:e})=>e!==te.EMPTY.symbol)}static getInstance(){return De.instance||(De.instance=new De),De.instance}add(e){this.hasSymbol(e.symbol)||(e instanceof te?this._registeredStatuses.push(e):this._registeredStatuses.push(new te(e)))}bySymbol(e){return this.hasSymbol(e)?this.getSymbol(e):te.EMPTY}bySymbolOrCreate(e){return this.hasSymbol(e)?this.getSymbol(e):te.createUnknownStatus(e)}byName(e){return this._registeredStatuses.filter(({name:t})=>t===e).length>0?this._registeredStatuses.filter(({name:t})=>t===e)[0]:te.EMPTY}resetToDefaultStatuses(){this.clearStatuses(),this.addDefaultStatusTypes()}clearStatuses(){this._registeredStatuses=[]}getNextStatus(e){if(e.nextStatusSymbol!==""){let t=this.bySymbol(e.nextStatusSymbol);if(t!==null)return t}return te.EMPTY}getNextStatusOrCreate(e){let t=this.getNextStatus(e);return t.type!=="EMPTY"?t:te.createUnknownStatus(e.nextStatusSymbol)}getNextRecurrenceStatusOrCreate(e){let t=this.getNextStatusOrCreate(e),n=this.getNextRecurrenceStatusOfType(t,"TODO");if(n)return n;let i=this.getNextRecurrenceStatusOfType(t,"IN_PROGRESS");return i||this.bySymbolOrCreate(" ")}getNextRecurrenceStatusOfType(e,t){if(e.type===t)return e;let n=e;for(let i=0;i<this.registeredStatuses.length-1;i++)if(n=this.getNextStatusOrCreate(n),n.type===t)return n}findUnknownStatuses(e){let t=e.filter(s=>!this.hasSymbol(s.symbol)),n=new De,i=[];return t.forEach(s=>{if(n.hasSymbol(s.symbol))return;let a=De.copyStatusWithNewName(s,`Unknown (${s.symbol})`);i.push(a),n.add(a)}),i.sort((s,a)=>s.symbol.localeCompare(a.symbol,void 0,{numeric:!0}))}static copyStatusWithNewName(e,t){let n=new Je(e.symbol,t,e.nextStatusSymbol,e.availableAsCommand,e.type);return new te(n)}getSymbol(e){return this._registeredStatuses.filter(({symbol:t})=>t===e)[0]}hasSymbol(e){return this._registeredStatuses.find(t=>t.symbol===e)!==void 0}addDefaultStatusTypes(){[te.makeTodo(),te.makeInProgress(),te.makeDone(),te.makeCancelled()].forEach(t=>{this.add(t)})}mermaidDiagram(e=!1){let t=this.registeredStatuses,n="mermaid",i=[],s=[];return t.forEach((a,o)=>{let u=this.getMermaidNodeLabel(a,e);i.push(`${o+1}${u}`);let l=this.getNextStatus(a);if(this.addEdgeIfNotToInternal(t,l,s,o,!1),a.type==="DONE"){let c=this.getNextRecurrenceStatusOrCreate(a);c.symbol!==l.symbol&&this.addEdgeIfNotToInternal(t,c,s,o,!0)}}),` \`\`\`${n} flowchart LR @@ -146,11 +146,11 @@ ${s.join(` linkStyle default stroke:gray \`\`\` -`}addEdgeIfNotToInternal(e,t,n,i,s){let a=e.findIndex(l=>l.symbol===t.symbol),o=a!==-1,u=t.type!=="EMPTY";if(o&&u){let l;s?l='-. "\u{1F501}" .-> ':l=" --> ";let c=`${i+1}${l}${a+1}`;n.push(c)}}getMermaidNodeLabel(e,t){let n=yv(e.name),i=e.type;if(t){let s=ul(e.symbol),a=ul(e.nextStatusSymbol),o=`[${s}] -> [${a}]`,u=`'${n}'`,l=`(${i})`;return`["${u}<br>${o}<br>${l}"]:::${i}`}else return`["${n}"]:::${i}`}};var bv=require("obsidian");var en=class{constructor(e,t){this.name=e,this.sortOrder=t}get groupText(){return this.name!==""?`%%${this.sortOrder}%% ${this.name}`:""}};var Ye=class{constructor(e){this._date=null;this._date=e}get moment(){return this._date}formatAsDate(e=""){return this.format(Z.dateFormat,e)}formatAsDateAndTime(e=""){return this.format(Z.dateTimeFormat,e)}format(e,t=""){return this._date?this._date.format(e):t}toISOString(e){return this._date?this._date.toISOString(e):""}get category(){let e=window.moment(),t=this.moment;return t?t.isBefore(e,"day")?new en("Overdue",1):t.isSame(e,"day")?new en("Today",2):t.isValid()?new en("Future",3):new en("Invalid date",0):new en("Undated",4)}get fromNow(){let e=this.moment;if(!e)return new en("",0);let t=this.fromNowOrder(e);return new en(e.fromNow(),t)}fromNowOrder(e){if(!e.isValid())return 0;let t=window.moment(),n=e.isSameOrBefore(t,"day"),i=this.fromNowStartDateOfGroup(e,n,t);return Number((n?1:3)+i.format("YYYYMMDD"))}fromNowStartDateOfGroup(e,t,n){let i=e.fromNow(!0).split(" "),s,a=Number(i[0]);isNaN(a)?s=1:s=a;let o=i[1];return t?n.subtract(s,o):n.add(s,o)}postpone(e="days",t=1){if(!this._date)throw new bv.Notice("Cannot postpone a null date");let n=window.moment().startOf("day");return this._date.isSameOrAfter(n,"day")?this._date.clone().add(t,e):n.add(t,e)}};var Es=class{constructor(e){this._path=e}get path(){return this._path}get pathWithoutExtension(){return this.withoutExtension(this.path)}withoutExtension(e){return e.replace(/\.md$/,"")}get root(){let e=this.path.replace(/\\/g,"/");e.charAt(0)==="/"&&(e=e.substring(1));let t=e.indexOf("/");return t==-1?"/":e.substring(0,t+1)}get folder(){let e=this.path,t=this.filename,n=e.substring(0,e.lastIndexOf(t));return n===""?"/":n}get filename(){let e=this.path.match(/([^/]+)$/);return e!==null?e[1]:""}get filenameWithoutExtension(){return this.withoutExtension(this.filename)}};var xn=class{static priorityNameUsingNone(e){let t="ERROR";switch(e){case"1":t="High";break;case"0":t="Highest";break;case"2":t="Medium";break;case"3":t="None";break;case"4":t="Low";break;case"5":t="Lowest";break}return t}static priorityNameUsingNormal(e){return xn.priorityNameUsingNone(e).replace("None","Normal")}};var iN=require("obsidian"),wv=pa(vv());var Um=class extends wv.EventEmitter2{constructor(){super(...arguments);this.options={minLevels:{"":"info",tasks:"info"}};this.consoleLoggerRegistered=!1;this.arrAvg=t=>t.reduce((n,i)=>n+i,0)/t.length}configure(t){return this.options=Object.assign({},this.options,t),this}getLogger(t){let n="none",i="";for(let s in this.options.minLevels)t.startsWith(s)&&s.length>=i.length&&(n=this.options.minLevels[s],i=s);return new Wm(this,t,n)}onLogEntry(t){return this.on("log",t),this}registerConsoleLogger(){return this.consoleLoggerRegistered?this:(this.onLogEntry(t=>{let n=`[${window.moment().format("YYYY-MM-DD-HH:mm:ss.SSS")}][${t.level}][${t.module}]`;switch(t.traceId&&(n+=`[${t.traceId}]`),n+=` ${t.message}`,t.objects===void 0&&(t.objects=""),t.level){case"trace":console.trace(n,t.objects);break;case"debug":console.debug(n,t.objects);break;case"info":console.info(n,t.objects);break;case"warn":console.warn(n,t.objects);break;case"error":console.error(n,t.objects);break;default:console.log(`{${t.level}} ${n}`,t.objects)}}),this.consoleLoggerRegistered=!0,this)}},Pt=new Um,Wm=class{constructor(e,t,n){this.levels={trace:1,debug:2,info:3,warn:4,error:5};this.logManager=e,this.module=t,this.minLevel=this.levelToInt(n)}levelToInt(e){return e.toLowerCase()in this.levels?this.levels[e.toLowerCase()]:99}log(e,t,n){if(this.levelToInt(e)<this.minLevel)return;let s={level:e,module:this.module,message:t,objects:n,traceId:void 0};this.logManager.emit("log",s)}trace(e,t){this.log("trace",e,t)}debug(e,t){this.log("debug",e,t)}info(e,t){this.log("info",e,t)}warn(e,t){this.log("warn",e,t)}error(e,t){this.log("error",e,t)}logWithId(e,t,n,i){if(this.levelToInt(e)<this.minLevel)return;let a={level:e,module:this.module,message:n,objects:i,traceId:t};this.logManager.emit("log",a)}traceWithId(e,t,n){this.logWithId("trace",e,t,n)}debugWithId(e,t,n){this.logWithId("debug",e,t,n)}infoWithId(e,t,n){this.logWithId("info",e,t,n)}warnWithId(e,t,n){this.logWithId("warn",e,t,n)}errorWithId(e,t,n){this.logWithId("error",e,t,n)}};function qm(r,e){let t=Pt.getLogger("tasks");switch(r){case"trace":t.trace(e);break;case"debug":t.debug(e);break;case"info":t.info(e);break;case"warn":t.warn(e);break;case"error":t.error(e);break;default:break}}function ll(r,e,t){r.debug(`${e}: task line number: ${t.taskLocation.lineNumber}. file path: "${t.path}"`),r.debug(`${e} original: ${t.originalMarkdown}`)}function cl(r,e,t){t.map((n,i)=>{r.debug(`${e} ==> ${i+1} : ${n.toFileLineString()}`)})}var wt=class{static fromPath(e){let{useFilenameAsScheduledDate:t,filenameAsDateFolders:n}=J();return!t||!this.matchesAnyFolder(n,e)?null:this.extractDateFromPath(e)}static matchesAnyFolder(e,t){return e.length===0?!0:e.some(n=>t.startsWith(n+"/"))}static extractDateFromPath(e){let t=Math.max(0,e.lastIndexOf("/")+1),n=e.lastIndexOf("."),i=e.substring(t,n),s=/(\d{4})-(\d{2})-(\d{2})/.exec(i);if(s||(s=/(\d{4})(\d{2})(\d{2})/.exec(i)),s){let a=window.moment([parseInt(s[1]),parseInt(s[2])-1,parseInt(s[3])]);if(a.isValid())return a}return null}static canApplyFallback({startDate:e,scheduledDate:t,dueDate:n}){return e===null&&n===null&&t===null}static updateTaskPath(e,t,n){let i=e.scheduledDate,s=e.scheduledDateIsInferred;return n===null?s&&(s=!1,i=null):s?i=n:this.canApplyFallback(e)&&(i=n,s=!0),new oe(be(X({},e),{taskLocation:e.taskLocation.fromRenamedFile(t),scheduledDate:i,scheduledDateIsInferred:s}))}static removeInferredStatusIfNeeded(e,t){let n=e.scheduledDateIsInferred?e.scheduledDate:null;return t.map(i=>(n!==null&&!n.isSame(i.scheduledDate,"day")&&(i=new oe(be(X({},i),{scheduledDateIsInferred:!1}))),i))}};var Ar=class{static calculate(e){var n,i,s;let t=0;if((n=e.dueDate)!=null&&n.isValid()){let a=window.moment().startOf("day"),o=Math.round(a.diff(e.dueDate)/Ar.milliSecondsPerDay),u;o>=7?u=1:o>=-14?u=(o+14)*.8/21+.2:u=.2,t+=u*Ar.dueCoefficient}switch((i=e.scheduledDate)!=null&&i.isValid()&&window.moment().isSameOrAfter(e.scheduledDate)&&(t+=1*Ar.scheduledCoefficient),(s=e.startDate)!=null&&s.isValid()&&window.moment().isBefore(e.startDate)&&(t+=1*Ar.startedCoefficient),e.priority){case"0":t+=1.5*Ar.priorityCoefficient;break;case"1":t+=1*Ar.priorityCoefficient;break;case"2":t+=.65*Ar.priorityCoefficient;break;case"3":t+=.325*Ar.priorityCoefficient;break;case"5":t-=.3*Ar.priorityCoefficient;break}return t}},Rn=Ar;Rn.dueCoefficient=12,Rn.scheduledCoefficient=5,Rn.startedCoefficient=-3,Rn.priorityCoefficient=6,Rn.milliSecondsPerDay=1e3*60*60*24;var oe=class{constructor({status:e,description:t,taskLocation:n,indentation:i,listMarker:s,priority:a,createdDate:o,startDate:u,scheduledDate:l,dueDate:c,doneDate:d,cancelledDate:p,recurrence:m,dependsOn:b,id:g,blockLink:E,tags:R,originalMarkdown:x,scheduledDateIsInferred:v}){this._urgency=null;this.status=e,this.description=t,this.indentation=i,this.listMarker=s,this.taskLocation=n,this.tags=R,this.priority=a,this.createdDate=o,this.startDate=u,this.scheduledDate=l,this.dueDate=c,this.doneDate=d,this.cancelledDate=p,this.recurrence=m,this.dependsOn=b,this.id=g,this.blockLink=E,this.originalMarkdown=x,this.scheduledDateIsInferred=v}static fromLine({line:e,taskLocation:t,fallbackDate:n}){let i=oe.extractTaskComponents(e);return i===null||!ye.getInstance().includedIn(i.body)?null:oe.parseTaskSignifiers(e,t,n)}static parseTaskSignifiers(e,t,n){let i=oe.extractTaskComponents(e);if(i===null)return null;let{taskSerializer:s}=Eo(),a=s.deserialize(i.body),o=!1;return wt.canApplyFallback(a)&&n!==null&&(a.scheduledDate=n,o=!0),a.tags=a.tags.map(u=>u.trim()),a.tags=a.tags.filter(u=>!ye.getInstance().equals(u)),new oe(be(X(X({},i),a),{taskLocation:t,originalMarkdown:e,scheduledDateIsInferred:o}))}static extractTaskComponents(e){let t=e.match(Z.taskRegex);if(t===null)return null;let n=t[1],i=t[2],s=t[3],a=Oe.getInstance().bySymbolOrCreate(s),o=t[4].trim(),u=o.match(Z.blockLinkRegex),l=u!==null?u[0]:"";return l!==""&&(o=o.replace(Z.blockLinkRegex,"").trim()),{indentation:n,listMarker:i,status:a,body:o,blockLink:l}}toString(){return Eo().taskSerializer.serialize(this)}toFileLineString(){return`${this.indentation}${this.listMarker} [${this.status.symbol}] ${this.toString()}`}toggle(){let e=Pt.getLogger("tasks.Task"),t="toggle()";ll(e,t,this);let n=Oe.getInstance().getNextStatusOrCreate(this.status),i=this.handleNewStatus(n);return cl(e,t,i),i}handleNewStatus(e,t=window.moment()){if(e.identicalTo(this.status))return[this];let{setDoneDate:n}=J(),i=this.newDate(e,"DONE",this.doneDate,n,t),{setCancelledDate:s}=J(),a=this.newDate(e,"CANCELLED",this.cancelledDate,s,t),o=null;e.isCompleted()&&!this.status.isCompleted()&&this.recurrence!==null&&(o=this.recurrence.next(t));let u=new oe(be(X({},this),{status:e,doneDate:i,cancelledDate:a})),l=[];if(o!==null){let c=this.createNextOccurrence(e,o);l.push(c)}return l.push(u),l}newDate(e,t,n,i,s){let a=null;return e.type===t&&(this.status.type!==t?i&&(a=s):a=n),a}createNextOccurrence(e,t){let{setCreatedDate:n}=J(),i=null;n&&(i=window.moment());let s=null,a=null,u=Oe.getInstance().getNextRecurrenceStatusOrCreate(e);return new oe(be(X(X({},this),t),{status:u,blockLink:"",id:"",dependsOn:[],createdDate:i,cancelledDate:s,doneDate:a}))}toggleWithRecurrenceInUsersOrder(){let e=this.toggle();return this.putRecurrenceInUsersOrder(e)}handleNewStatusWithRecurrenceInUsersOrder(e,t=window.moment()){Pt.getLogger("tasks.Task").debug(`changed task ${this.taskLocation.path} ${this.taskLocation.lineNumber} ${this.originalMarkdown} status to '${e.symbol}'`);let i=this.handleNewStatus(e,t);return this.putRecurrenceInUsersOrder(i)}putRecurrenceInUsersOrder(e){let{recurrenceOnNextLine:t}=J();return t?e.reverse():e}get isDone(){return this.status.type==="DONE"||this.status.type==="CANCELLED"||this.status.type==="NON_TASK"}isBlocked(e){if(this.dependsOn.length===0||this.isDone)return!1;for(let t of this.dependsOn)if(!!e.find(i=>i.id===t&&!i.isDone))return!0;return!1}isBlocking(e){return this.id===""||this.isDone?!1:e.some(t=>t.isDone?!1:t.dependsOn.includes(this.id))}get priorityNumber(){return Number.parseInt(this.priority)}get priorityNameGroupText(){let e=xn.priorityNameUsingNormal(this.priority);return`%%${this.priority}%%${e} priority`}get descriptionWithoutTags(){return this.description.replace(Z.hashTags,"").trim()}get priorityName(){return xn.priorityNameUsingNormal(this.priority)}get urgency(){return this._urgency===null&&(this._urgency=Rn.calculate(this)),this._urgency}get path(){return this.taskLocation.path}get cancelled(){return new Ye(this.cancelledDate)}get created(){return new Ye(this.createdDate)}get done(){return new Ye(this.doneDate)}get due(){return new Ye(this.dueDate)}get scheduled(){return new Ye(this.scheduledDate)}get start(){return new Ye(this.startDate)}get happensDates(){return Array.of(this.startDate,this.scheduledDate,this.dueDate)}get happens(){let e=this.happensDates,t=Array.from(e).sort(br);for(let n of t)if(n!=null&&n.isValid())return new Ye(n);return new Ye(null)}get isRecurring(){return this.recurrence!==null}get recurrenceRule(){return this.recurrence?this.recurrence.toText():""}get heading(){return this.precedingHeader}get hasHeading(){return this.precedingHeader!==null}get file(){return new Es(this.path)}get filename(){let e=this.path.match(/([^/]+)\.md$/);return e!==null?e[1]:null}get lineNumber(){return this.taskLocation.lineNumber}get sectionStart(){return this.taskLocation.sectionStart}get sectionIndex(){return this.taskLocation.sectionIndex}get precedingHeader(){return this.taskLocation.precedingHeader}getLinkText({isFilenameUnique:e}){let t;return e?t=this.filename:t="/"+this.path,t===null?null:(this.precedingHeader!==null&&this.precedingHeader!==t&&(t=t+" > "+this.precedingHeader),t)}static tasksListsIdentical(e,t){return e.length!==t.length?!1:e.every((n,i)=>n.identicalTo(t[i]))}identicalTo(e){var s,a;let t=["description","path","indentation","listMarker","lineNumber","sectionStart","sectionIndex","precedingHeader","priority","blockLink","scheduledDateIsInferred","id","dependsOn"];for(let o of t)if(((s=this[o])==null?void 0:s.toString())!==((a=e[o])==null?void 0:a.toString()))return!1;if(!this.status.identicalTo(e.status)||this.tags.length!==e.tags.length||!this.tags.every(function(o,u){return o===e.tags[u]}))return!1;t=oe.allDateFields();for(let o of t){let u=this[o],l=e[o];if(br(u,l)!==0)return!1}let n=this.recurrence,i=e.recurrence;return n===null&&i!==null||n!==null&&i===null?!1:!(n&&i&&!n.identicalTo(i))}static allDateFields(){return["createdDate","startDate","scheduledDate","dueDate","doneDate","cancelledDate"]}static extractHashtags(e){var t,n;return(n=(t=e.match(Z.hashTags))==null?void 0:t.map(i=>i.trim()))!=null?n:[]}};var So=class{constructor(e){this.fetch=e;this._value=void 0}get value(){return this._value===void 0&&(this._value=this.fetch()),this._value}};var yt=class{constructor(e,t,n,i,s){this._path=e,this._lineNumber=t,this._sectionStart=n,this._sectionIndex=i,this._precedingHeader=s}static fromUnknownPosition(e){return new yt(e,0,0,0,null)}fromRenamedFile(e){return new yt(e,this.lineNumber,this.sectionStart,this.sectionIndex,this.precedingHeader)}get path(){return this._path}get lineNumber(){return this._lineNumber}get sectionStart(){return this._sectionStart}get sectionIndex(){return this._sectionIndex}get precedingHeader(){return this._precedingHeader}get hasKnownPath(){return this.path!==""}};var Pi=class{constructor({metadataCache:e,vault:t,events:n}){this.logger=Pt.getLogger("tasks.Cache");this.logger.debug("Creating Cache object"),this.metadataCache=e,this.metadataCacheEventReferences=[],this.vault=t,this.vaultEventReferences=[],this.events=n,this.eventsEventReferences=[],this.tasksMutex=new ru,this.state="Cold",this.logger.debug("Cache.constructor(): state = Cold"),this.tasks=[],this.loadedAfterFirstResolve=!1,this.subscribeToCache(),this.subscribeToVault(),this.subscribeToEvents(),this.loadVault()}unload(){this.logger.info("Unloading Cache");for(let e of this.metadataCacheEventReferences)this.metadataCache.offref(e);for(let e of this.vaultEventReferences)this.vault.offref(e);for(let e of this.eventsEventReferences)this.events.off(e)}getTasks(){return this.tasks}getState(){return this.state}notifySubscribers(){this.logger.debug("Cache.notifySubscribers()"),this.events.triggerCacheUpdate({tasks:this.tasks,state:this.state})}subscribeToCache(){this.logger.debug("Cache.subscribeToCache()");let e=this.metadataCache.on("resolved",()=>L(this,null,function*(){this.loadedAfterFirstResolve||(this.loadedAfterFirstResolve=!0,this.loadVault())}));this.metadataCacheEventReferences.push(e);let t=this.metadataCache.on("changed",n=>{this.tasksMutex.runExclusive(()=>{this.indexFile(n)})});this.metadataCacheEventReferences.push(t)}subscribeToVault(){this.logger.debug("Cache.subscribeToVault()");let{useFilenameAsScheduledDate:e}=J(),t=this.vault.on("create",s=>{s instanceof Ss.TFile&&(this.logger.debug(`Cache.subscribeToVault.createdEventReference() ${s.path}`),this.tasksMutex.runExclusive(()=>{this.indexFile(s)}))});this.vaultEventReferences.push(t);let n=this.vault.on("delete",s=>{s instanceof Ss.TFile&&(this.logger.debug(`Cache.subscribeToVault.deletedEventReference() ${s.path}`),this.tasksMutex.runExclusive(()=>{this.tasks=this.tasks.filter(a=>a.path!==s.path),this.notifySubscribers()}))});this.vaultEventReferences.push(n);let i=this.vault.on("rename",(s,a)=>{s instanceof Ss.TFile&&(this.logger.debug(`Cache.subscribeToVault.renamedEventReference() ${s.path}`),this.tasksMutex.runExclusive(()=>{let o=new So(()=>wt.fromPath(s.path));this.tasks=this.tasks.map(u=>u.path===a?e?wt.updateTaskPath(u,s.path,o.value):new oe(be(X({},u),{taskLocation:u.taskLocation.fromRenamedFile(s.path)})):u),this.notifySubscribers()}))});this.vaultEventReferences.push(i)}subscribeToEvents(){this.logger.debug("Cache.subscribeToEvents()");let e=this.events.onRequestCacheUpdate(t=>{t({tasks:this.tasks,state:this.state})});this.eventsEventReferences.push(e)}loadVault(){return this.logger.debug("Cache.loadVault()"),this.tasksMutex.runExclusive(()=>L(this,null,function*(){this.state="Initializing",this.logger.debug("Cache.loadVault(): state = Initializing"),yield Promise.all(this.vault.getMarkdownFiles().map(e=>this.indexFile(e))),this.state="Warm",this.logger.debug("Cache.loadVault(): state = Warm"),this.notifySubscribers()}))}indexFile(e){return L(this,null,function*(){let t=this.metadataCache.getFileCache(e);if(t==null)return;if(!e.path.endsWith(".md")){this.logger.debug("indexFile: skipping non-markdown file: "+e.path);return}this.logger.debug("Cache.indexFile: "+e.path);let n=this.tasks.filter(a=>a.path===e.path),i=t.listItems,s=[];if(i!==void 0){let a=yield this.vault.cachedRead(e);s=this.getTasksFromFileContent(a,i,t,e)}oe.tasksListsIdentical(n,s)||(this.tasks=this.tasks.filter(a=>a.path!==e.path),this.tasks.push(...s),this.logger.debug("Cache.indexFile: "+e.path+`: read ${s.length} task(s)`),this.notifySubscribers())})}getTasksFromFileContent(e,t,n,i){let s=[],a=e.split(` -`),o=a.length,u=new So(()=>wt.fromPath(i.path)),l=null,c=0;for(let d of t)if(d.task!==void 0){let p=d.position.start.line;if(p>=o)return this.logger.debug(`${i.path} Obsidian gave us a line number ${p} past the end of the file. ${o}.`),s;if((l===null||l.position.end.line<p)&&(l=Pi.getSection(p,n.sections),c=0),l===null)continue;let m=a[p];if(m===void 0){this.logger.debug(`${i.path}: line ${p} - ignoring 'undefined' line.`);continue}let b;try{b=oe.fromLine({line:m,taskLocation:new yt(i.path,p,l.position.start.line,c,Pi.getPrecedingHeader(p,n.headings)),fallbackDate:u.value})}catch(g){this.reportTaskParsingErrorToUser(g,i,d,m);continue}b!==null&&(c++,s.push(b))}return s}reportTaskParsingErrorToUser(e,t,n,i){let s=`There was an error reading one of the tasks in this vault. +`}addEdgeIfNotToInternal(e,t,n,i,s){let a=e.findIndex(l=>l.symbol===t.symbol),o=a!==-1,u=t.type!=="EMPTY";if(o&&u){let l;s?l='-. "\u{1F501}" .-> ':l=" --> ";let c=`${i+1}${l}${a+1}`;n.push(c)}}getMermaidNodeLabel(e,t){let n=mv(e.name),i=e.type;if(t){let s=sl(e.symbol),a=sl(e.nextStatusSymbol),o=`[${s}] -> [${a}]`,u=`'${n}'`,l=`(${i})`;return`["${u}<br>${o}<br>${l}"]:::${i}`}else return`["${n}"]:::${i}`}};var hv=require("obsidian");var tn=class{constructor(e,t){this.name=e,this.sortOrder=t}get groupText(){return this.name!==""?`%%${this.sortOrder}%% ${this.name}`:""}};var Ge=class{constructor(e){this._date=null;this._date=e}get moment(){return this._date}formatAsDate(e=""){return this.format(J.dateFormat,e)}formatAsDateAndTime(e=""){return this.format(J.dateTimeFormat,e)}format(e,t=""){return this._date?this._date.format(e):t}toISOString(e){return this._date?this._date.toISOString(e):""}get category(){let e=window.moment(),t=this.moment;return t?t.isBefore(e,"day")?new tn("Overdue",1):t.isSame(e,"day")?new tn("Today",2):t.isValid()?new tn("Future",3):new tn("Invalid date",0):new tn("Undated",4)}get fromNow(){let e=this.moment;if(!e)return new tn("",0);let t=this.fromNowOrder(e);return new tn(e.fromNow(),t)}fromNowOrder(e){if(!e.isValid())return 0;let t=window.moment(),n=e.isSameOrBefore(t,"day"),i=this.fromNowStartDateOfGroup(e,n,t);return Number((n?1:3)+i.format("YYYYMMDD"))}fromNowStartDateOfGroup(e,t,n){let i=e.fromNow(!0).split(" "),s,a=Number(i[0]);isNaN(a)?s=1:s=a;let o=i[1];return t?n.subtract(s,o):n.add(s,o)}postpone(e="days",t=1){if(!this._date)throw new hv.Notice("Cannot postpone a null date");let n=window.moment().startOf("day");return this._date.isSameOrAfter(n,"day")?this._date.clone().add(t,e):n.add(t,e)}};var Cn=class{static priorityNameUsingNone(e){let t="ERROR";switch(e){case"1":t="High";break;case"0":t="Highest";break;case"2":t="Medium";break;case"3":t="None";break;case"4":t="Low";break;case"5":t="Lowest";break}return t}static priorityNameUsingNormal(e){return Cn.priorityNameUsingNone(e).replace("None","Normal")}};var pN=require("obsidian"),Tv=pa(bv());var Nm=class extends Tv.EventEmitter2{constructor(){super(...arguments);this.options={minLevels:{"":"info",tasks:"info"}};this.consoleLoggerRegistered=!1;this.arrAvg=t=>t.reduce((n,i)=>n+i,0)/t.length}configure(t){return this.options=Object.assign({},this.options,t),this}getLogger(t){let n="none",i="";for(let s in this.options.minLevels)t.startsWith(s)&&s.length>=i.length&&(n=this.options.minLevels[s],i=s);return new Im(this,t,n)}onLogEntry(t){return this.on("log",t),this}registerConsoleLogger(){return this.consoleLoggerRegistered?this:(this.onLogEntry(t=>{let n=`[${window.moment().format("YYYY-MM-DD-HH:mm:ss.SSS")}][${t.level}][${t.module}]`;switch(t.traceId&&(n+=`[${t.traceId}]`),n+=` ${t.message}`,t.objects===void 0&&(t.objects=""),t.level){case"trace":console.trace(n,t.objects);break;case"debug":console.debug(n,t.objects);break;case"info":console.info(n,t.objects);break;case"warn":console.warn(n,t.objects);break;case"error":console.error(n,t.objects);break;default:console.log(`{${t.level}} ${n}`,t.objects)}}),this.consoleLoggerRegistered=!0,this)}},Ct=new Nm,Im=class{constructor(e,t,n){this.levels={trace:1,debug:2,info:3,warn:4,error:5};this.logManager=e,this.module=t,this.minLevel=this.levelToInt(n)}levelToInt(e){return e.toLowerCase()in this.levels?this.levels[e.toLowerCase()]:99}log(e,t,n){if(this.levelToInt(e)<this.minLevel)return;let s={level:e,module:this.module,message:t,objects:n,traceId:void 0};this.logManager.emit("log",s)}trace(e,t){this.log("trace",e,t)}debug(e,t){this.log("debug",e,t)}info(e,t){this.log("info",e,t)}warn(e,t){this.log("warn",e,t)}error(e,t){this.log("error",e,t)}logWithId(e,t,n,i){if(this.levelToInt(e)<this.minLevel)return;let a={level:e,module:this.module,message:n,objects:i,traceId:t};this.logManager.emit("log",a)}traceWithId(e,t,n){this.logWithId("trace",e,t,n)}debugWithId(e,t,n){this.logWithId("debug",e,t,n)}infoWithId(e,t,n){this.logWithId("info",e,t,n)}warnWithId(e,t,n){this.logWithId("warn",e,t,n)}errorWithId(e,t,n){this.logWithId("error",e,t,n)}};function Fm(r,e){let t=Ct.getLogger("tasks");switch(r){case"trace":t.trace(e);break;case"debug":t.debug(e);break;case"info":t.info(e);break;case"warn":t.warn(e);break;case"error":t.error(e);break;default:break}}function al(r,e,t){r.debug(`${e}: task line number: ${t.taskLocation.lineNumber}. file path: "${t.path}"`),r.debug(`${e} original: ${t.originalMarkdown}`)}function ol(r,e,t){t.map((n,i)=>{r.debug(`${e} ==> ${i+1} : ${n.toFileLineString()}`)})}var vt=class{static fromPath(e){let{useFilenameAsScheduledDate:t,filenameAsDateFolders:n}=X();return!t||!this.matchesAnyFolder(n,e)?null:this.extractDateFromPath(e)}static matchesAnyFolder(e,t){return e.length===0?!0:e.some(n=>t.startsWith(n+"/"))}static extractDateFromPath(e){let t=Math.max(0,e.lastIndexOf("/")+1),n=e.lastIndexOf("."),i=e.substring(t,n),s=/(\d{4})-(\d{2})-(\d{2})/.exec(i);if(s||(s=/(\d{4})(\d{2})(\d{2})/.exec(i)),s){let a=window.moment([parseInt(s[1]),parseInt(s[2])-1,parseInt(s[3])]);if(a.isValid())return a}return null}static canApplyFallback({startDate:e,scheduledDate:t,dueDate:n}){return e===null&&n===null&&t===null}static updateTaskPath(e,t,n){let i=e.scheduledDate,s=e.scheduledDateIsInferred;return n===null?s&&(s=!1,i=null):s?i=n:this.canApplyFallback(e)&&(i=n,s=!0),new ue(_e(Q({},e),{taskLocation:e.taskLocation.fromRenamedFile(new Qe(t)),scheduledDate:i,scheduledDateIsInferred:s}))}static removeInferredStatusIfNeeded(e,t){let n=e.scheduledDateIsInferred?e.scheduledDate:null;return t.map(i=>(n!==null&&!n.isSame(i.scheduledDate,"day")&&(i=new ue(_e(Q({},i),{scheduledDateIsInferred:!1}))),i))}};var ul=class{constructor(e,t){this.parent=null;this.parent=e,this.children=t}};var Ir=class{static calculate(e){var n,i,s;let t=0;if((n=e.dueDate)!=null&&n.isValid()){let a=window.moment().startOf("day"),o=Math.round(a.diff(e.dueDate)/Ir.milliSecondsPerDay),u;o>=7?u=1:o>=-14?u=(o+14)*.8/21+.2:u=.2,t+=u*Ir.dueCoefficient}switch((i=e.scheduledDate)!=null&&i.isValid()&&window.moment().isSameOrAfter(e.scheduledDate)&&(t+=1*Ir.scheduledCoefficient),(s=e.startDate)!=null&&s.isValid()&&window.moment().isBefore(e.startDate)&&(t+=1*Ir.startedCoefficient),e.priority){case"0":t+=1.5*Ir.priorityCoefficient;break;case"1":t+=1*Ir.priorityCoefficient;break;case"2":t+=.65*Ir.priorityCoefficient;break;case"3":t+=.325*Ir.priorityCoefficient;break;case"5":t-=.3*Ir.priorityCoefficient;break}return t}},An=Ir;An.dueCoefficient=12,An.scheduledCoefficient=5,An.startedCoefficient=-3,An.priorityCoefficient=6,An.milliSecondsPerDay=1e3*60*60*24;var ue=class extends ul{constructor({status:t,description:n,taskLocation:i,indentation:s,listMarker:a,priority:o,createdDate:u,startDate:l,scheduledDate:c,dueDate:d,doneDate:f,cancelledDate:m,recurrence:g,dependsOn:T,id:y,blockLink:E,tags:x,originalMarkdown:R,scheduledDateIsInferred:$}){super(null,[]);this._urgency=null;this.status=t,this.description=n,this.indentation=s,this.listMarker=a,this.taskLocation=i,this.tags=x,this.priority=o,this.createdDate=u,this.startDate=l,this.scheduledDate=c,this.dueDate=d,this.doneDate=f,this.cancelledDate=m,this.recurrence=g,this.dependsOn=T,this.id=y,this.blockLink=E,this.originalMarkdown=R,this.scheduledDateIsInferred=$}static fromLine({line:t,taskLocation:n,fallbackDate:i}){let s=ue.extractTaskComponents(t);return s===null||!be.getInstance().includedIn(s.body)?null:ue.parseTaskSignifiers(t,n,i)}static parseTaskSignifiers(t,n,i){let s=ue.extractTaskComponents(t);if(s===null)return null;let{taskSerializer:a}=Oo(),o=a.deserialize(s.body),u=!1;return vt.canApplyFallback(o)&&i!==null&&(o.scheduledDate=i,u=!0),o.tags=o.tags.map(l=>l.trim()),o.tags=o.tags.filter(l=>!be.getInstance().equals(l)),new ue(_e(Q(Q({},s),o),{taskLocation:n,originalMarkdown:t,scheduledDateIsInferred:u}))}static extractTaskComponents(t){let n=t.match(J.taskRegex);if(n===null)return null;let i=n[1],s=n[2],a=n[3],o=De.getInstance().bySymbolOrCreate(a),u=n[4].trim(),l=u.match(J.blockLinkRegex),c=l!==null?l[0]:"";return c!==""&&(u=u.replace(J.blockLinkRegex,"").trim()),{indentation:i,listMarker:s,status:o,body:u,blockLink:c}}toString(){return Oo().taskSerializer.serialize(this)}toFileLineString(){return`${this.indentation}${this.listMarker} [${this.status.symbol}] ${this.toString()}`}toggle(){let t=Ct.getLogger("tasks.Task"),n="toggle()";al(t,n,this);let i=De.getInstance().getNextStatusOrCreate(this.status),s=this.handleNewStatus(i);return ol(t,n,s),s}handleNewStatus(t,n=window.moment()){if(t.identicalTo(this.status))return[this];let{setDoneDate:i}=X(),s=this.newDate(t,"DONE",this.doneDate,i,n),{setCancelledDate:a}=X(),o=this.newDate(t,"CANCELLED",this.cancelledDate,a,n),u=null;t.isCompleted()&&!this.status.isCompleted()&&this.recurrence!==null&&(u=this.recurrence.next(n));let l=new ue(_e(Q({},this),{status:t,doneDate:s,cancelledDate:o})),c=[];if(u!==null){let d=this.createNextOccurrence(t,u);c.push(d)}return c.push(l),c}newDate(t,n,i,s,a){let o=null;return t.type===n&&(this.status.type!==n?s&&(o=a):o=i),o}createNextOccurrence(t,n){let{setCreatedDate:i}=X(),s=null;i&&(s=window.moment());let a=null,o=null,l=De.getInstance().getNextRecurrenceStatusOrCreate(t);return new ue(_e(Q(Q({},this),n),{status:l,blockLink:"",id:"",dependsOn:[],createdDate:s,cancelledDate:a,doneDate:o}))}toggleWithRecurrenceInUsersOrder(){let t=this.toggle();return this.putRecurrenceInUsersOrder(t)}handleNewStatusWithRecurrenceInUsersOrder(t,n=window.moment()){Ct.getLogger("tasks.Task").debug(`changed task ${this.taskLocation.path} ${this.taskLocation.lineNumber} ${this.originalMarkdown} status to '${t.symbol}'`);let s=this.handleNewStatus(t,n);return this.putRecurrenceInUsersOrder(s)}putRecurrenceInUsersOrder(t){let{recurrenceOnNextLine:n}=X();return n?t.reverse():t}get isDone(){return this.status.type==="DONE"||this.status.type==="CANCELLED"||this.status.type==="NON_TASK"}isBlocked(t){if(this.dependsOn.length===0||this.isDone)return!1;for(let n of this.dependsOn)if(!!t.find(s=>s.id===n&&!s.isDone))return!0;return!1}isBlocking(t){return this.id===""||this.isDone?!1:t.some(n=>n.isDone?!1:n.dependsOn.includes(this.id))}get priorityNumber(){return Number.parseInt(this.priority)}get priorityNameGroupText(){let t=Cn.priorityNameUsingNormal(this.priority);return`%%${this.priority}%%${t} priority`}get descriptionWithoutTags(){return this.description.replace(J.hashTags,"").trim()}get priorityName(){return Cn.priorityNameUsingNormal(this.priority)}get urgency(){return this._urgency===null&&(this._urgency=An.calculate(this)),this._urgency}get path(){return this.taskLocation.path}get cancelled(){return new Ge(this.cancelledDate)}get created(){return new Ge(this.createdDate)}get done(){return new Ge(this.doneDate)}get due(){return new Ge(this.dueDate)}get scheduled(){return new Ge(this.scheduledDate)}get start(){return new Ge(this.startDate)}get happensDates(){return Array.of(this.startDate,this.scheduledDate,this.dueDate)}get happens(){let t=this.happensDates,n=Array.from(t).sort(Tr);for(let i of n)if(i!=null&&i.isValid())return new Ge(i);return new Ge(null)}get isRecurring(){return this.recurrence!==null}get recurrenceRule(){return this.recurrence?this.recurrence.toText():""}get heading(){return this.precedingHeader}get hasHeading(){return this.precedingHeader!==null}get file(){return this.taskLocation.tasksFile}get filename(){let t=this.path.match(/([^/]+)\.md$/);return t!==null?t[1]:null}get lineNumber(){return this.taskLocation.lineNumber}get sectionStart(){return this.taskLocation.sectionStart}get sectionIndex(){return this.taskLocation.sectionIndex}get precedingHeader(){return this.taskLocation.precedingHeader}getLinkText({isFilenameUnique:t}){let n;return t?n=this.filename:n="/"+this.path,n===null?null:(this.precedingHeader!==null&&this.precedingHeader!==n&&(n=n+" > "+this.precedingHeader),n)}static tasksListsIdentical(t,n){return t.length!==n.length?!1:t.every((i,s)=>i.identicalTo(n[s]))}identicalTo(t){var a,o;let n=["description","path","indentation","listMarker","lineNumber","sectionStart","sectionIndex","precedingHeader","priority","blockLink","scheduledDateIsInferred","id","dependsOn"];for(let u of n)if(((a=this[u])==null?void 0:a.toString())!==((o=t[u])==null?void 0:o.toString()))return!1;if(!this.status.identicalTo(t.status)||this.tags.length!==t.tags.length||!this.tags.every(function(u,l){return u===t.tags[l]}))return!1;n=ue.allDateFields();for(let u of n){let l=this[u],c=t[u];if(Tr(l,c)!==0)return!1}let i=this.recurrence,s=t.recurrence;return i===null&&s!==null||i!==null&&s===null?!1:!(i&&s&&!i.identicalTo(s))}static allDateFields(){return["createdDate","startDate","scheduledDate","dueDate","doneDate","cancelledDate"]}static extractHashtags(t){var n,i;return(i=(n=t.match(J.hashTags))==null?void 0:n.map(s=>s.trim()))!=null?i:[]}};var Do=class{constructor(e){this.fetch=e;this._value=void 0}get value(){return this._value===void 0&&(this._value=this.fetch()),this._value}};var ht=class{constructor(e,t,n,i,s){this._tasksFile=e,this._lineNumber=t,this._sectionStart=n,this._sectionIndex=i,this._precedingHeader=s}static fromUnknownPosition(e){return new ht(e,0,0,0,null)}fromRenamedFile(e){return new ht(e,this.lineNumber,this.sectionStart,this.sectionIndex,this.precedingHeader)}get tasksFile(){return this._tasksFile}get path(){return this._tasksFile.path}get lineNumber(){return this._lineNumber}get sectionStart(){return this._sectionStart}get sectionIndex(){return this._sectionIndex}get precedingHeader(){return this._precedingHeader}get hasKnownPath(){return this.path!==""}};function mN(r,e,t,n,i,s){let a=new Qe(r),o=[],u=e.split(` +`),l=u.length,c=new Do(()=>vt.fromPath(r)),d=null,f=0;for(let m of t)if(m.task!==void 0){let g=m.position.start.line;if(g>=l)return n.debug(`${r} Obsidian gave us a line number ${g} past the end of the file. ${l}.`),o;if((d===null||d.position.end.line<g)&&(d=Os.getSection(g,i.sections),f=0),d===null)continue;let T=u[g];if(T===void 0){n.debug(`${r}: line ${g} - ignoring 'undefined' line.`);continue}let y;try{y=ue.fromLine({line:T,taskLocation:new ht(a,g,d.position.start.line,f,Os.getPrecedingHeader(g,i.headings)),fallbackDate:c.value})}catch(E){s(E,r,m,T);continue}y!==null&&(f++,o.push(y))}return o}var Os=class{constructor({metadataCache:e,vault:t,events:n}){this.logger=Ct.getLogger("tasks.Cache");this.logger.debug("Creating Cache object"),this.metadataCache=e,this.metadataCacheEventReferences=[],this.vault=t,this.vaultEventReferences=[],this.events=n,this.eventsEventReferences=[],this.tasksMutex=new Zo,this.state="Cold",this.logger.debug("Cache.constructor(): state = Cold"),this.tasks=[],this.loadedAfterFirstResolve=!1,this.subscribeToCache(),this.subscribeToVault(),this.subscribeToEvents(),this.loadVault()}unload(){this.logger.info("Unloading Cache");for(let e of this.metadataCacheEventReferences)this.metadataCache.offref(e);for(let e of this.vaultEventReferences)this.vault.offref(e);for(let e of this.eventsEventReferences)this.events.off(e)}getTasks(){return this.tasks}getState(){return this.state}notifySubscribers(){this.logger.debug("Cache.notifySubscribers()"),this.events.triggerCacheUpdate({tasks:this.tasks,state:this.state})}subscribeToCache(){this.logger.debug("Cache.subscribeToCache()");let e=this.metadataCache.on("resolved",()=>N(this,null,function*(){this.loadedAfterFirstResolve||(this.loadedAfterFirstResolve=!0,this.loadVault())}));this.metadataCacheEventReferences.push(e);let t=this.metadataCache.on("changed",n=>{this.tasksMutex.runExclusive(()=>{this.indexFile(n)})});this.metadataCacheEventReferences.push(t)}subscribeToVault(){this.logger.debug("Cache.subscribeToVault()");let{useFilenameAsScheduledDate:e}=X(),t=this.vault.on("create",s=>{s instanceof Ss.TFile&&(this.logger.debug(`Cache.subscribeToVault.createdEventReference() ${s.path}`),this.tasksMutex.runExclusive(()=>{this.indexFile(s)}))});this.vaultEventReferences.push(t);let n=this.vault.on("delete",s=>{s instanceof Ss.TFile&&(this.logger.debug(`Cache.subscribeToVault.deletedEventReference() ${s.path}`),this.tasksMutex.runExclusive(()=>{this.tasks=this.tasks.filter(a=>a.path!==s.path),this.notifySubscribers()}))});this.vaultEventReferences.push(n);let i=this.vault.on("rename",(s,a)=>{s instanceof Ss.TFile&&(this.logger.debug(`Cache.subscribeToVault.renamedEventReference() ${s.path}`),this.tasksMutex.runExclusive(()=>{let o=new Qe(s.path),u=new Do(()=>vt.fromPath(s.path));this.tasks=this.tasks.map(l=>l.path===a?e?vt.updateTaskPath(l,s.path,u.value):new ue(_e(Q({},l),{taskLocation:l.taskLocation.fromRenamedFile(o)})):l),this.notifySubscribers()}))});this.vaultEventReferences.push(i)}subscribeToEvents(){this.logger.debug("Cache.subscribeToEvents()");let e=this.events.onRequestCacheUpdate(t=>{t({tasks:this.tasks,state:this.state})});this.eventsEventReferences.push(e)}loadVault(){return this.logger.debug("Cache.loadVault()"),this.tasksMutex.runExclusive(()=>N(this,null,function*(){this.state="Initializing",this.logger.debug("Cache.loadVault(): state = Initializing"),yield Promise.all(this.vault.getMarkdownFiles().map(e=>this.indexFile(e))),this.state="Warm",this.logger.debug("Cache.loadVault(): state = Warm"),this.notifySubscribers()}))}indexFile(e){return N(this,null,function*(){let t=this.metadataCache.getFileCache(e);if(t==null)return;if(!e.path.endsWith(".md")){this.logger.debug("indexFile: skipping non-markdown file: "+e.path);return}this.logger.debug("Cache.indexFile: "+e.path);let n=this.tasks.filter(a=>a.path===e.path),i=t.listItems,s=[];if(i!==void 0){let a=yield this.vault.cachedRead(e);s=this.getTasksFromFileContent(a,i,t,e.path,this.reportTaskParsingErrorToUser,this.logger)}ue.tasksListsIdentical(n,s)||(this.tasks=this.tasks.filter(a=>a.path!==e.path),this.tasks.push(...s),this.logger.debug("Cache.indexFile: "+e.path+`: read ${s.length} task(s)`),this.notifySubscribers())})}getTasksFromFileContent(e,t,n,i,s,a){return mN(i,e,t,a,n,s)}reportTaskParsingErrorToUser(e,t,n,i){let s=`There was an error reading one of the tasks in this vault. The following task has been ignored, to prevent Tasks queries getting stuck with 'Loading Tasks ...' Error: ${e} -File: ${t.path} +File: ${t} Line number: ${n.position.start.line} Task line: ${i} @@ -165,7 +165,7 @@ Include: The error popup will only be shown when Tasks is starting up, but if the error persists, it will be shown in the console every time this file is edited during the Obsidian session. -`;this.logger.error(s),e instanceof Error&&this.logger.error(e.stack?e.stack:"Cannot determine stack"),this.state==="Initializing"&&new Ss.Notice(s,1e4)}static getSection(e,t){if(t===void 0)return null;for(let n of t)if(n.position.start.line<=e&&n.position.end.line>=e)return n;return null}static getPrecedingHeader(e,t){if(t===void 0)return null;let n=null;for(let i of t){if(i.position.start.line>e)return n;n=i.heading}return n}};var lh=require("obsidian");var _w=require("obsidian");function kt(){}function Ym(r){return r()}function kv(){return Object.create(null)}function Tr(r){r.forEach(Ym)}function pl(r){return typeof r=="function"}function Ms(r,e){return r!=r?e==e:r!==e||r&&typeof r=="object"||typeof r=="function"}function Ev(r){return Object.keys(r).length===0}var Sv=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global,Do=class{constructor(e){this.options=e,this._listeners="WeakMap"in Sv?new WeakMap:void 0}observe(e,t){return this._listeners.set(e,t),this._getObserver().observe(e,this.options),()=>{this._listeners.delete(e),this._observer.unobserve(e)}}_getObserver(){var e;return(e=this._observer)!==null&&e!==void 0?e:this._observer=new ResizeObserver(t=>{var n;for(let i of t)Do.entries.set(i.target,i),(n=this._listeners.get(i.target))===null||n===void 0||n(i)})}};Do.entries="WeakMap"in Sv?new WeakMap:void 0;var Ov=!1;function sN(){Ov=!0}function aN(){Ov=!1}function A(r,e){r.appendChild(e)}function Ie(r,e,t){r.insertBefore(e,t||null)}function Ce(r){r.parentNode&&r.parentNode.removeChild(r)}function Cs(r,e){for(let t=0;t<r.length;t+=1)r[t]&&r[t].d(e)}function K(r){return document.createElement(r)}function oN(r){return document.createElementNS("http://www.w3.org/2000/svg",r)}function Fe(r){return document.createTextNode(r)}function te(){return Fe(" ")}function xe(r,e,t,n){return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}function Dv(r){return function(e){return e.preventDefault(),r.call(this,e)}}function F(r,e,t){t==null?r.removeAttribute(e):r.getAttribute(e)!==t&&r.setAttribute(e,t)}function xv(r){let e;return{p(...t){e=t,e.forEach(n=>r.push(n))},r(){e.forEach(t=>r.splice(r.indexOf(t),1))}}}function uN(r){return Array.from(r.childNodes)}function Pr(r,e){e=""+e,r.data!==e&&(r.data=e)}function Nr(r,e){r.value=e==null?"":e}function Bm(r,e,t){for(let n=0;n<r.options.length;n+=1){let i=r.options[n];if(i.__value===e){i.selected=!0;return}}(!t||e!==void 0)&&(r.selectedIndex=-1)}function Rv(r){let e=r.querySelector(":checked");return e&&e.__value}var dl;function lN(){if(dl===void 0){dl=!1;try{typeof window!="undefined"&&window.parent&&window.parent.document}catch(r){dl=!0}}return dl}function Mv(r,e){getComputedStyle(r).position==="static"&&(r.style.position="relative");let n=K("iframe");n.setAttribute("style","display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;"),n.setAttribute("aria-hidden","true"),n.tabIndex=-1;let i=lN(),s;return i?(n.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",s=xe(window,"message",a=>{a.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{s=xe(n.contentWindow,"resize",e),e()}),A(r,n),()=>{(i||s&&n.contentWindow)&&s(),Ce(n)}}function Ir(r,e,t){r.classList[t?"add":"remove"](e)}var Rs=class{constructor(e=!1){this.is_svg=!1,this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,t,n=null){this.e||(this.is_svg?this.e=oN(t.nodeName):this.e=K(t.nodeType===11?"TEMPLATE":t.nodeName),this.t=t.tagName!=="TEMPLATE"?t:t.content,this.c(e)),this.i(n)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(e){for(let t=0;t<this.n.length;t+=1)Ie(this.t,this.n[t],e)}p(e){this.d(),this.h(e),this.i(this.a)}d(){this.n.forEach(Ce)}};var xo;function Oo(r){xo=r}function cN(){if(!xo)throw new Error("Function called outside component initialization");return xo}function Hm(r){cN().$$.on_mount.push(r)}var Ds=[];var rt=[],xs=[],$m=[],dN=Promise.resolve(),Gm=!1;function fN(){Gm||(Gm=!0,dN.then(Cv))}function Ii(r){xs.push(r)}function er(r){$m.push(r)}var jm=new Set,Os=0;function Cv(){if(Os!==0)return;let r=xo;do{try{for(;Os<Ds.length;){let e=Ds[Os];Os++,Oo(e),pN(e.$$)}}catch(e){throw Ds.length=0,Os=0,e}for(Oo(null),Ds.length=0,Os=0;rt.length;)rt.pop()();for(let e=0;e<xs.length;e+=1){let t=xs[e];jm.has(t)||(jm.add(t),t())}xs.length=0}while(Ds.length);for(;$m.length;)$m.pop()();Gm=!1,jm.clear(),Oo(r)}function pN(r){if(r.fragment!==null){r.update(),Tr(r.before_update);let e=r.dirty;r.dirty=[-1],r.fragment&&r.fragment.p(r.ctx,e),r.after_update.forEach(Ii)}}function mN(r){let e=[],t=[];xs.forEach(n=>r.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),xs=e}var fl=new Set,Ni;function Av(){Ni={r:0,c:[],p:Ni}}function Pv(){Ni.r||Tr(Ni.c),Ni=Ni.p}function _r(r,e){r&&r.i&&(fl.delete(r),r.i(e))}function Fr(r,e,t,n){if(r&&r.o){if(fl.has(r))return;fl.add(r),Ni.c.push(()=>{fl.delete(r),n&&(t&&r.d(1),n())}),r.o(e)}else n&&n()}var hN=["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"],Xj=new Set([...hN]);function tr(r,e,t){let n=r.$$.props[e];n!==void 0&&(r.$$.bound[n]=t,t(r.$$.ctx[n]))}function Mn(r){r&&r.c()}function tn(r,e,t,n){let{fragment:i,after_update:s}=r.$$;i&&i.m(e,t),n||Ii(()=>{let a=r.$$.on_mount.map(Ym).filter(pl);r.$$.on_destroy?r.$$.on_destroy.push(...a):Tr(a),r.$$.on_mount=[]}),s.forEach(Ii)}function Lr(r,e){let t=r.$$;t.fragment!==null&&(mN(t.after_update),Tr(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function gN(r,e){r.$$.dirty[0]===-1&&(Ds.push(r),fN(),r.$$.dirty.fill(0)),r.$$.dirty[e/31|0]|=1<<e%31}function As(r,e,t,n,i,s,a,o=[-1]){let u=xo;Oo(r);let l=r.$$={fragment:null,ctx:[],props:s,update:kt,not_equal:i,bound:kv(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(u?u.$$.context:[])),callbacks:kv(),dirty:o,skip_bound:!1,root:e.target||u.$$.root};a&&a(l.root);let c=!1;if(l.ctx=t?t(r,e.props||{},(d,p,...m)=>{let b=m.length?m[0]:p;return l.ctx&&i(l.ctx[d],l.ctx[d]=b)&&(!l.skip_bound&&l.bound[d]&&l.bound[d](b),c&&gN(r,d)),p}):[],l.update(),c=!0,Tr(l.before_update),l.fragment=n?n(l.ctx):!1,e.target){if(e.hydrate){sN();let d=uN(e.target);l.fragment&&l.fragment.l(d),d.forEach(Ce)}else l.fragment&&l.fragment.c();e.intro&&_r(r.$$.fragment),tn(r,e.target,e.anchor,e.customElement),aN(),Cv()}Oo(u)}var yN;typeof HTMLElement=="function"&&(yN=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){let{on_mount:r}=this.$$;this.$$.on_disconnect=r.map(Ym).filter(pl);for(let e in this.$$.slotted)this.appendChild(this.$$.slotted[e])}attributeChangedCallback(r,e,t){this[r]=t}disconnectedCallback(){Tr(this.$$.on_disconnect)}$destroy(){Lr(this,1),this.$destroy=kt}$on(r,e){if(!pl(e))return kt;let t=this.$$.callbacks[r]||(this.$$.callbacks[r]=[]);return t.push(e),()=>{let n=t.indexOf(e);n!==-1&&t.splice(n,1)}}$set(r){this.$$set&&!Ev(r)&&(this.$$.skip_bound=!0,this.$$set(r),this.$$.skip_bound=!1)}});var Jn=class{$destroy(){Lr(this,1),this.$destroy=kt}$on(e,t){if(!pl(t))return kt;let n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{let i=n.indexOf(t);i!==-1&&n.splice(i,1)}}$set(e){this.$$set&&!Ev(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}};function Vm(r,e,t,n){function i(s){return s instanceof t?s:new t(function(a){a(s)})}return new(t||(t=Promise))(function(s,a){function o(c){try{l(n.next(c))}catch(d){a(d)}}function u(c){try{l(n.throw(c))}catch(d){a(d)}}function l(c){c.done?s(c.value):i(c.value).then(o,u)}l((n=n.apply(r,e||[])).next())})}function zm(r){let e="",t=!0;for(;t;)e=Math.random().toString(36).substring(2,6+2),r.includes(e)||(t=!1);return e}function Nv(r,e){return r.id!==""?r:new oe(be(X({},r),{id:zm(e)}))}function Iv(r,e){let t=r;if(!r.dependsOn.includes(e.id)){let n=[...r.dependsOn,e.id];t=new oe(be(X({},r),{dependsOn:n}))}return t}function Fv(r,e){let t=r;if(r.dependsOn.includes(e.id)){let n=r.dependsOn.filter(i=>i!==e.id);t=new oe(be(X({},r),{dependsOn:n}))}return t}var Mo=require("obsidian");var Ro,Km,Qm,bN=["md"];function gl(){return Pt.getLogger("tasks.File")}var Lv=({metadataCache:r,vault:e,workspace:t})=>{Ro=r,Km=e,Qm=t},rn=t=>L(void 0,[t],function*({originalTask:r,newTasks:e}){if(Km===void 0||Ro===void 0||Qm===void 0){ml("Tasks: cannot use File before initializing it.");return}Array.isArray(e)||(e=[e]);let n=gl(),i="replaceTaskWithTasks()";ll(n,i,r),cl(n,i,e),yield Wv({originalTask:r,newTasks:e,vault:Km,metadataCache:Ro,workspace:Qm,previousTries:0})});function ml(r){console.error(r),new Mo.Notice(r,15e3)}function Uv(r){console.warn(r),new Mo.Notice(r,1e4)}function TN(r){gl().debug(r)}var ei=class extends Error{},hl=class extends Error{},Wv=a=>L(void 0,[a],function*({originalTask:r,newTasks:e,vault:t,metadataCache:n,workspace:i,previousTries:s}){let o=gl();o.debug(`tryRepetitive after ${s} previous tries`);let u=()=>L(void 0,null,function*(){if(s>10){let c=`Tasks: Could not find the correct task line to update. +`;this.logger.error(s),e instanceof Error&&this.logger.error(e.stack?e.stack:"Cannot determine stack"),this.state==="Initializing"&&new Ss.Notice(s,1e4)}static getSection(e,t){if(t===void 0)return null;for(let n of t)if(n.position.start.line<=e&&n.position.end.line>=e)return n;return null}static getPrecedingHeader(e,t){if(t===void 0)return null;let n=null;for(let i of t){if(i.position.start.line>e)return n;n=i.heading}return n}};var ah=require("obsidian");var yw=require("obsidian");function Ue(){}function qm(r){return r()}function _v(){return Object.create(null)}function qt(r){r.forEach(qm)}function dl(r){return typeof r=="function"}function rn(r,e){return r!=r?e==e:r!==e||r&&typeof r=="object"||typeof r=="function"}function vv(r){return Object.keys(r).length===0}var wv=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global,Ro=class{constructor(e){this.options=e,this._listeners="WeakMap"in wv?new WeakMap:void 0}observe(e,t){return this._listeners.set(e,t),this._getObserver().observe(e,this.options),()=>{this._listeners.delete(e),this._observer.unobserve(e)}}_getObserver(){var e;return(e=this._observer)!==null&&e!==void 0?e:this._observer=new ResizeObserver(t=>{var n;for(let i of t)Ro.entries.set(i.target,i),(n=this._listeners.get(i.target))===null||n===void 0||n(i)})}};Ro.entries="WeakMap"in wv?new WeakMap:void 0;var kv=!1;function hN(){kv=!0}function gN(){kv=!1}function F(r,e){r.appendChild(e)}function de(r,e,t){r.insertBefore(e,t||null)}function ae(r){r.parentNode&&r.parentNode.removeChild(r)}function Ui(r,e){for(let t=0;t<r.length;t+=1)r[t]&&r[t].d(e)}function K(r){return document.createElement(r)}function yN(r){return document.createElementNS("http://www.w3.org/2000/svg",r)}function Me(r){return document.createTextNode(r)}function oe(){return Me(" ")}function Ev(){return Me("")}function xe(r,e,t,n){return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}function Sv(r){return function(e){return e.preventDefault(),r.call(this,e)}}function L(r,e,t){t==null?r.removeAttribute(e):r.getAttribute(e)!==t&&r.setAttribute(e,t)}function Ov(r){let e;return{p(...t){e=t,e.forEach(n=>r.push(n))},r(){e.forEach(t=>r.splice(r.indexOf(t),1))}}}function bN(r){return Array.from(r.childNodes)}function Fr(r,e){e=""+e,r.data!==e&&(r.data=e)}function vr(r,e){r.value=e==null?"":e}function $m(r,e,t){for(let n=0;n<r.options.length;n+=1){let i=r.options[n];if(i.__value===e){i.selected=!0;return}}(!t||e!==void 0)&&(r.selectedIndex=-1)}function Dv(r){let e=r.querySelector(":checked");return e&&e.__value}var ll;function TN(){if(ll===void 0){ll=!1;try{typeof window!="undefined"&&window.parent&&window.parent.document}catch(r){ll=!0}}return ll}function xv(r,e){getComputedStyle(r).position==="static"&&(r.style.position="relative");let n=K("iframe");n.setAttribute("style","display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;"),n.setAttribute("aria-hidden","true"),n.tabIndex=-1;let i=TN(),s;return i?(n.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",s=xe(window,"message",a=>{a.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{s=xe(n.contentWindow,"resize",e),e()}),F(r,n),()=>{(i||s&&n.contentWindow)&&s(),ae(n)}}function Pn(r,e,t){r.classList[t?"add":"remove"](e)}var Ms=class{constructor(e=!1){this.is_svg=!1,this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,t,n=null){this.e||(this.is_svg?this.e=yN(t.nodeName):this.e=K(t.nodeType===11?"TEMPLATE":t.nodeName),this.t=t.tagName!=="TEMPLATE"?t:t.content,this.c(e)),this.i(n)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(e){for(let t=0;t<this.n.length;t+=1)de(this.t,this.n[t],e)}p(e){this.d(),this.h(e),this.i(this.a)}d(){this.n.forEach(ae)}};var Mo;function xo(r){Mo=r}function _N(){if(!Mo)throw new Error("Function called outside component initialization");return Mo}function jm(r){_N().$$.on_mount.push(r)}var xs=[];var Ye=[],Rs=[],Um=[],vN=Promise.resolve(),Wm=!1;function wN(){Wm||(Wm=!0,vN.then(Rv))}function Li(r){Rs.push(r)}function At(r){Um.push(r)}var Lm=new Set,Ds=0;function Rv(){if(Ds!==0)return;let r=Mo;do{try{for(;Ds<xs.length;){let e=xs[Ds];Ds++,xo(e),kN(e.$$)}}catch(e){throw xs.length=0,Ds=0,e}for(xo(null),xs.length=0,Ds=0;Ye.length;)Ye.pop()();for(let e=0;e<Rs.length;e+=1){let t=Rs[e];Lm.has(t)||(Lm.add(t),t())}Rs.length=0}while(xs.length);for(;Um.length;)Um.pop()();Wm=!1,Lm.clear(),xo(r)}function kN(r){if(r.fragment!==null){r.update(),qt(r.before_update);let e=r.dirty;r.dirty=[-1],r.fragment&&r.fragment.p(r.ctx,e),r.after_update.forEach(Li)}}function EN(r){let e=[],t=[];Rs.forEach(n=>r.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),Rs=e}var cl=new Set,Fi;function Mv(){Fi={r:0,c:[],p:Fi}}function Cv(){Fi.r||qt(Fi.c),Fi=Fi.p}function $t(r,e){r&&r.i&&(cl.delete(r),r.i(e))}function tr(r,e,t,n){if(r&&r.o){if(cl.has(r))return;cl.add(r),Fi.c.push(()=>{cl.delete(r),n&&(t&&r.d(1),n())}),r.o(e)}else n&&n()}var SN=["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"],vj=new Set([...SN]);function Pt(r,e,t){let n=r.$$.props[e];n!==void 0&&(r.$$.bound[n]=t,t(r.$$.ctx[n]))}function Lr(r){r&&r.c()}function wr(r,e,t,n){let{fragment:i,after_update:s}=r.$$;i&&i.m(e,t),n||Li(()=>{let a=r.$$.on_mount.map(qm).filter(dl);r.$$.on_destroy?r.$$.on_destroy.push(...a):qt(a),r.$$.on_mount=[]}),s.forEach(Li)}function rr(r,e){let t=r.$$;t.fragment!==null&&(EN(t.after_update),qt(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function ON(r,e){r.$$.dirty[0]===-1&&(xs.push(r),wN(),r.$$.dirty.fill(0)),r.$$.dirty[e/31|0]|=1<<e%31}function nn(r,e,t,n,i,s,a,o=[-1]){let u=Mo;xo(r);let l=r.$$={fragment:null,ctx:[],props:s,update:Ue,not_equal:i,bound:_v(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(u?u.$$.context:[])),callbacks:_v(),dirty:o,skip_bound:!1,root:e.target||u.$$.root};a&&a(l.root);let c=!1;if(l.ctx=t?t(r,e.props||{},(d,f,...m)=>{let g=m.length?m[0]:f;return l.ctx&&i(l.ctx[d],l.ctx[d]=g)&&(!l.skip_bound&&l.bound[d]&&l.bound[d](g),c&&ON(r,d)),f}):[],l.update(),c=!0,qt(l.before_update),l.fragment=n?n(l.ctx):!1,e.target){if(e.hydrate){hN();let d=bN(e.target);l.fragment&&l.fragment.l(d),d.forEach(ae)}else l.fragment&&l.fragment.c();e.intro&&$t(r.$$.fragment),wr(r,e.target,e.anchor,e.customElement),gN(),Rv()}xo(u)}var DN;typeof HTMLElement=="function"&&(DN=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){let{on_mount:r}=this.$$;this.$$.on_disconnect=r.map(qm).filter(dl);for(let e in this.$$.slotted)this.appendChild(this.$$.slotted[e])}attributeChangedCallback(r,e,t){this[r]=t}disconnectedCallback(){qt(this.$$.on_disconnect)}$destroy(){rr(this,1),this.$destroy=Ue}$on(r,e){if(!dl(e))return Ue;let t=this.$$.callbacks[r]||(this.$$.callbacks[r]=[]);return t.push(e),()=>{let n=t.indexOf(e);n!==-1&&t.splice(n,1)}}$set(r){this.$$set&&!vv(r)&&(this.$$.skip_bound=!0,this.$$set(r),this.$$.skip_bound=!1)}});var _r=class{$destroy(){rr(this,1),this.$destroy=Ue}$on(e,t){if(!dl(t))return Ue;let n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{let i=n.indexOf(t);i!==-1&&n.splice(i,1)}}$set(e){this.$$set&&!vv(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}};function Gm(r,e,t,n){function i(s){return s instanceof t?s:new t(function(a){a(s)})}return new(t||(t=Promise))(function(s,a){function o(c){try{l(n.next(c))}catch(d){a(d)}}function u(c){try{l(n.throw(c))}catch(d){a(d)}}function l(c){c.done?s(c.value):i(c.value).then(o,u)}l((n=n.apply(r,e||[])).next())})}var Ao=require("obsidian");var Co,Ym,Bm,xN=["md"];function ml(){return Ct.getLogger("tasks.File")}var Av=({metadataCache:r,vault:e,workspace:t})=>{Co=r,Ym=e,Bm=t},kr=t=>N(void 0,[t],function*({originalTask:r,newTasks:e}){if(Ym===void 0||Co===void 0||Bm===void 0){fl("Tasks: cannot use File before initializing it.");return}Array.isArray(e)||(e=[e]);let n=ml(),i="replaceTaskWithTasks()";al(n,i,r),ol(n,i,e),yield Nv({originalTask:r,newTasks:e,vault:Ym,metadataCache:Co,workspace:Bm,previousTries:0})});function fl(r){console.error(r),new Ao.Notice(r,15e3)}function Pv(r){console.warn(r),new Ao.Notice(r,1e4)}function RN(r){ml().debug(r)}var ri=class extends Error{},pl=class extends Error{},Nv=a=>N(void 0,[a],function*({originalTask:r,newTasks:e,vault:t,metadataCache:n,workspace:i,previousTries:s}){let o=ml();o.debug(`tryRepetitive after ${s} previous tries`);let u=()=>N(void 0,null,function*(){if(s>10){let c=`Tasks: Could not find the correct task line to update. The task line not updated is: ${r.originalMarkdown} @@ -180,28 +180,27 @@ Recommendations: 1. Close all panes that have the above file open, and then re-open the file. 2. Check for exactly identical copies of the task line, in this file, and see if you can make them different. -`;ml(c);return}let l=Math.min(Math.pow(10,s),100);o.debug(`timeout = ${l}`),setTimeout(()=>L(void 0,null,function*(){yield Wv({originalTask:r,newTasks:e,vault:t,metadataCache:n,workspace:i,previousTries:s+1})}),l)});try{let[l,c,d]=yield qv(r,t),p=[...d.slice(0,l),...e.map(m=>m.toFileLineString()),...d.slice(l+1)];yield t.modify(c,p.join(` -`))}catch(l){if(l instanceof ei){l.message&&Uv(l.message),yield u();return}else if(l instanceof hl){yield u();return}else l instanceof Error&&ml(l.message)}});function qv(r,e){return L(this,null,function*(){if(Ro===void 0)throw new ei;let t=e.getAbstractFileByPath(r.path);if(!(t instanceof Mo.TFile))throw new ei(`Tasks: No file found for task ${r.description}. Retrying ...`);if(!bN.includes(t.extension))throw new Error(`Tasks: Does not support files with the ${t.extension} file extension.`);let n=Ro.getFileCache(t);if(n==null||n===null)throw new ei(`Tasks: No file cache found for file ${t.path}. Retrying ...`);let i=n.listItems;if(i===void 0||i.length===0)throw new ei(`Tasks: No list items found in file cache of ${t.path}. Retrying ...`);let a=(yield e.read(t)).split(` -`),o=_N(r,a,i,TN);if(o===void 0)throw new hl;return[o,t,a]})}function Xm(r,e){return L(this,null,function*(){try{let[t,n,i]=yield qv(r,e);return[t,n]}catch(t){t instanceof ei?t.message&&Uv(t.message):t instanceof Error&&ml(t.message)}})}function jv(r,e){return r<e.length}function _N(r,e,t,n){let i=vN(r,e);return i!==void 0||(i=wN(r,e),i!==void 0)?i:kN(r,e,t,n)}function vN(r,e){let t=r.taskLocation.lineNumber;if(jv(t,e)&&e[t]===r.originalMarkdown)return gl().debug(`Found original markdown at original line number ${t}`),t}function wN(r,e){let t=[];for(let n=0;n<e.length;n++)e[n]===r.originalMarkdown&&t.push(n);if(t.length===1)return t[0]}function kN(r,e,t,n){let i,s=0;for(let a of t){let o=a.position.start.line;if(!jv(o,e))return;if(o<r.taskLocation.sectionStart||a.task===void 0)continue;let u=e[o];if(ye.getInstance().includedIn(u)){if(s===r.taskLocation.sectionIndex){if(u===r.originalMarkdown)i=o;else{n(`Tasks: Unable to find task in file ${r.taskLocation.path}. +`;fl(c);return}let l=Math.min(Math.pow(10,s),100);o.debug(`timeout = ${l}`),setTimeout(()=>N(void 0,null,function*(){yield Nv({originalTask:r,newTasks:e,vault:t,metadataCache:n,workspace:i,previousTries:s+1})}),l)});try{let[l,c,d]=yield Iv(r,t),f=[...d.slice(0,l),...e.map(m=>m.toFileLineString()),...d.slice(l+1)];yield t.modify(c,f.join(` +`))}catch(l){if(l instanceof ri){l.message&&Pv(l.message),yield u();return}else if(l instanceof pl){yield u();return}else l instanceof Error&&fl(l.message)}});function Iv(r,e){return N(this,null,function*(){if(Co===void 0)throw new ri;let t=e.getAbstractFileByPath(r.path);if(!(t instanceof Ao.TFile))throw new ri(`Tasks: No file found for task ${r.description}. Retrying ...`);if(!xN.includes(t.extension))throw new Error(`Tasks: Does not support files with the ${t.extension} file extension.`);let n=Co.getFileCache(t);if(n==null||n===null)throw new ri(`Tasks: No file cache found for file ${t.path}. Retrying ...`);let i=n.listItems;if(i===void 0||i.length===0)throw new ri(`Tasks: No list items found in file cache of ${t.path}. Retrying ...`);let a=(yield e.read(t)).split(` +`),o=MN(r,a,i,RN);if(o===void 0)throw new pl;return[o,t,a]})}function Hm(r,e){return N(this,null,function*(){try{let[t,n,i]=yield Iv(r,e);return[t,n]}catch(t){t instanceof ri?t.message&&Pv(t.message):t instanceof Error&&fl(t.message)}})}function Fv(r,e){return r<e.length}function MN(r,e,t,n){let i=CN(r,e);return i!==void 0||(i=AN(r,e),i!==void 0)?i:PN(r,e,t,n)}function CN(r,e){let t=r.taskLocation.lineNumber;if(Fv(t,e)&&e[t]===r.originalMarkdown)return ml().debug(`Found original markdown at original line number ${t}`),t}function AN(r,e){let t=[];for(let n=0;n<e.length;n++)e[n]===r.originalMarkdown&&t.push(n);if(t.length===1)return t[0]}function PN(r,e,t,n){let i,s=0;for(let a of t){let o=a.position.start.line;if(!Fv(o,e))return;if(o<r.taskLocation.sectionStart||a.task===void 0)continue;let u=e[o];if(be.getInstance().includedIn(u)){if(s===r.taskLocation.sectionIndex){if(u===r.originalMarkdown)i=o;else{n(`Tasks: Unable to find task in file ${r.taskLocation.path}. Expected task: ${r.originalMarkdown} Found task: -${u}`);return}break}s++}}return i}function EN(r){let e,t,n,i,s,a,o,u;return{c(){e=K("input"),t=te(),n=K("code"),i=Fe(r[3]),s=te(),a=new Rs(!1),F(e,"id",r[2]),F(e,"type","text"),F(e,"class","input"),F(e,"placeholder",SN),F(e,"accesskey",r[4]),Ir(e,"tasks-modal-error",!r[1]),a.a=null,F(n,"class","results")},m(l,c){Ie(l,e,c),Nr(e,r[0]),Ie(l,t,c),Ie(l,n,c),A(n,i),A(n,s),a.m(r[5],n),o||(u=xe(e,"input",r[7]),o=!0)},p(l,[c]){c&4&&F(e,"id",l[2]),c&16&&F(e,"accesskey",l[4]),c&1&&e.value!==l[0]&&Nr(e,l[0]),c&2&&Ir(e,"tasks-modal-error",!l[1]),c&8&&Pr(i,l[3]),c&32&&a.p(l[5])},i:kt,o:kt,d(l){l&&Ce(e),l&&Ce(t),l&&Ce(n),o=!1,u()}}}var SN="Try 'Monday' or 'tomorrow', or [td|tm|yd|tw|nw|we] then space.";function ON(r,e,t){let{id:n}=e,{dateSymbol:i}=e,{date:s}=e,{isDateValid:a}=e,{forwardOnly:o}=e,{accesskey:u}=e,l;function c(){s=this.value,t(0,s),t(2,n),t(6,o),t(5,l)}return r.$$set=d=>{"id"in d&&t(2,n=d.id),"dateSymbol"in d&&t(3,i=d.dateSymbol),"date"in d&&t(0,s=d.date),"isDateValid"in d&&t(1,a=d.isDateValid),"forwardOnly"in d&&t(6,o=d.forwardOnly),"accesskey"in d&&t(4,u=d.accesskey)},r.$$.update=()=>{if(r.$$.dirty&101){e:t(0,s=Ku(s)),t(5,l=lv(n,s,o)),t(1,a=!l.includes("invalid"))}},[s,a,n,i,u,l,o,c]}var Zm=class extends Jn{constructor(e){super(),As(this,e,ON,EN,Ms,{id:2,dateSymbol:3,date:0,isDateValid:1,forwardOnly:6,accesskey:4})}},Fi=Zm;var Li=Math.min,qt=Math.max,Ao=Math.round;var Cn=r=>({x:r,y:r}),DN={left:"right",right:"left",bottom:"top",top:"bottom"},xN={start:"end",end:"start"};function Jm(r,e,t){return qt(r,Li(e,t))}function Ps(r,e){return typeof r=="function"?r(e):r}function An(r){return r.split("-")[0]}function Ns(r){return r.split("-")[1]}function eh(r){return r==="x"?"y":"x"}function th(r){return r==="y"?"height":"width"}function Is(r){return["top","bottom"].includes(An(r))?"y":"x"}function rh(r){return eh(Is(r))}function $v(r,e,t){t===void 0&&(t=!1);let n=Ns(r),i=rh(r),s=th(i),a=i==="x"?n===(t?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(a=Co(a)),[a,Co(a)]}function Gv(r){let e=Co(r);return[yl(r),e,yl(e)]}function yl(r){return r.replace(/start|end/g,e=>xN[e])}function RN(r,e,t){let n=["left","right"],i=["right","left"],s=["top","bottom"],a=["bottom","top"];switch(r){case"top":case"bottom":return t?e?i:n:e?n:i;case"left":case"right":return e?s:a;default:return[]}}function Yv(r,e,t,n){let i=Ns(r),s=RN(An(r),t==="start",n);return i&&(s=s.map(a=>a+"-"+i),e&&(s=s.concat(s.map(yl)))),s}function Co(r){return r.replace(/left|right|bottom|top/g,e=>DN[e])}function MN(r){return X({top:0,right:0,bottom:0,left:0},r)}function Bv(r){return typeof r!="number"?MN(r):{top:r,right:r,bottom:r,left:r}}function Ui(r){return be(X({},r),{top:r.y,left:r.x,right:r.x+r.width,bottom:r.y+r.height})}function Hv(r,e,t){let{reference:n,floating:i}=r,s=Is(e),a=rh(e),o=th(a),u=An(e),l=s==="y",c=n.x+n.width/2-i.width/2,d=n.y+n.height/2-i.height/2,p=n[o]/2-i[o]/2,m;switch(u){case"top":m={x:c,y:n.y-i.height};break;case"bottom":m={x:c,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:d};break;case"left":m={x:n.x-i.width,y:d};break;default:m={x:n.x,y:n.y}}switch(Ns(e)){case"start":m[a]-=p*(t&&l?-1:1);break;case"end":m[a]+=p*(t&&l?-1:1);break}return m}var Vv=(r,e,t)=>L(void 0,null,function*(){let{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:a}=t,o=s.filter(Boolean),u=yield a.isRTL==null?void 0:a.isRTL(e),l=yield a.getElementRects({reference:r,floating:e,strategy:i}),{x:c,y:d}=Hv(l,n,u),p=n,m={},b=0;for(let g=0;g<o.length;g++){let{name:E,fn:R}=o[g],{x,y:v,data:V,reset:$}=yield R({x:c,y:d,initialPlacement:n,placement:p,strategy:i,middlewareData:m,rects:l,platform:a,elements:{reference:r,floating:e}});if(c=x!=null?x:c,d=v!=null?v:d,m=be(X({},m),{[E]:X(X({},m[E]),V)}),$&&b<=50){b++,typeof $=="object"&&($.placement&&(p=$.placement),$.rects&&(l=$.rects===!0?yield a.getElementRects({reference:r,floating:e,strategy:i}):$.rects),{x:c,y:d}=Hv(l,p,u)),g=-1;continue}}return{x:c,y:d,placement:p,strategy:i,middlewareData:m}});function bl(r,e){return L(this,null,function*(){var t;e===void 0&&(e={});let{x:n,y:i,platform:s,rects:a,elements:o,strategy:u}=r,{boundary:l="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:p=!1,padding:m=0}=Ps(e,r),b=Bv(m),E=o[p?d==="floating"?"reference":"floating":d],R=Ui(yield s.getClippingRect({element:(t=yield s.isElement==null?void 0:s.isElement(E))==null||t?E:E.contextElement||(yield s.getDocumentElement==null?void 0:s.getDocumentElement(o.floating)),boundary:l,rootBoundary:c,strategy:u})),x=d==="floating"?be(X({},a.floating),{x:n,y:i}):a.reference,v=yield s.getOffsetParent==null?void 0:s.getOffsetParent(o.floating),V=(yield s.isElement==null?void 0:s.isElement(v))?(yield s.getScale==null?void 0:s.getScale(v))||{x:1,y:1}:{x:1,y:1},$=Ui(s.convertOffsetParentRelativeRectToViewportRelativeRect?yield s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:x,offsetParent:v,strategy:u}):x);return{top:(R.top-$.top+b.top)/V.y,bottom:($.bottom-R.bottom+b.bottom)/V.y,left:(R.left-$.left+b.left)/V.x,right:($.right-R.right+b.right)/V.x}})}var nh=function(r){return r===void 0&&(r={}),{name:"flip",options:r,fn(t){return L(this,null,function*(){var n,i;let{placement:s,middlewareData:a,rects:o,initialPlacement:u,platform:l,elements:c}=t,O=Ps(r,t),{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:E=!0}=O,R=tu(O,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((n=a.arrow)!=null&&n.alignmentOffset)return{};let x=An(s),v=An(u)===u,V=yield l.isRTL==null?void 0:l.isRTL(c.floating),$=m||(v||!E?[Co(u)]:Gv(u));!m&&g!=="none"&&$.push(...Yv(u,E,g,V));let ee=[u,...$],Y=yield bl(t,R),q=[],de=((i=a.flip)==null?void 0:i.overflows)||[];if(d&&q.push(Y[x]),p){let B=$v(s,o,V);q.push(Y[B[0]],Y[B[1]])}if(de=[...de,{placement:s,overflows:q}],!q.every(B=>B<=0)){var Te,G;let B=(((Te=a.flip)==null?void 0:Te.index)||0)+1,U=ee[B];if(U)return{data:{index:B,overflows:de},reset:{placement:U}};let Q=(G=de.filter(f=>f.overflows[0]<=0).sort((f,h)=>f.overflows[1]-h.overflows[1])[0])==null?void 0:G.placement;if(!Q)switch(b){case"bestFit":{var N;let f=(N=de.map(h=>[h.placement,h.overflows.filter(y=>y>0).reduce((y,T)=>y+T,0)]).sort((h,y)=>h[1]-y[1])[0])==null?void 0:N[0];f&&(Q=f);break}case"initialPlacement":Q=u;break}if(s!==Q)return{reset:{placement:Q}}}return{}})}}};function CN(r,e){return L(this,null,function*(){let{placement:t,platform:n,elements:i}=r,s=yield n.isRTL==null?void 0:n.isRTL(i.floating),a=An(t),o=Ns(t),u=Is(t)==="y",l=["left","top"].includes(a)?-1:1,c=s&&u?-1:1,d=Ps(e,r),{mainAxis:p,crossAxis:m,alignmentAxis:b}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:X({mainAxis:0,crossAxis:0,alignmentAxis:null},d);return o&&typeof b=="number"&&(m=o==="end"?b*-1:b),u?{x:m*c,y:p*l}:{x:p*l,y:m*c}})}var Tl=function(r){return r===void 0&&(r=0),{name:"offset",options:r,fn(t){return L(this,null,function*(){var n,i;let{x:s,y:a,placement:o,middlewareData:u}=t,l=yield CN(t,r);return o===((n=u.offset)==null?void 0:n.placement)&&(i=u.arrow)!=null&&i.alignmentOffset?{}:{x:s+l.x,y:a+l.y,data:be(X({},l),{placement:o})}})}}},_l=function(r){return r===void 0&&(r={}),{name:"shift",options:r,fn(t){return L(this,null,function*(){let{x:n,y:i,placement:s}=t,R=Ps(r,t),{mainAxis:a=!0,crossAxis:o=!1,limiter:u={fn:x=>{let{x:v,y:V}=x;return{x:v,y:V}}}}=R,l=tu(R,["mainAxis","crossAxis","limiter"]),c={x:n,y:i},d=yield bl(t,l),p=Is(An(s)),m=eh(p),b=c[m],g=c[p];if(a){let x=m==="y"?"top":"left",v=m==="y"?"bottom":"right",V=b+d[x],$=b-d[v];b=Jm(V,b,$)}if(o){let x=p==="y"?"top":"left",v=p==="y"?"bottom":"right",V=g+d[x],$=g-d[v];g=Jm(V,g,$)}let E=u.fn(be(X({},t),{[m]:b,[p]:g}));return be(X({},E),{data:{x:E.x-n,y:E.y-i}})})}}};var ih=function(r){return r===void 0&&(r={}),{name:"size",options:r,fn(t){return L(this,null,function*(){let{placement:n,rects:i,platform:s,elements:a}=t,Y=Ps(r,t),{apply:o=()=>{}}=Y,u=tu(Y,["apply"]),l=yield bl(t,u),c=An(n),d=Ns(n),p=Is(n)==="y",{width:m,height:b}=i.floating,g,E;c==="top"||c==="bottom"?(g=c,E=d===((yield s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(E=c,g=d==="end"?"top":"bottom");let R=b-l[g],x=m-l[E],v=!t.middlewareData.shift,V=R,$=x;if(p){let q=m-l.left-l.right;$=d||v?Li(x,q):q}else{let q=b-l.top-l.bottom;V=d||v?Li(R,q):q}if(v&&!d){let q=qt(l.left,0),de=qt(l.right,0),Te=qt(l.top,0),G=qt(l.bottom,0);p?$=m-2*(q!==0||de!==0?q+de:qt(l.left,l.right)):V=b-2*(Te!==0||G!==0?Te+G:qt(l.top,l.bottom))}yield o(be(X({},t),{availableWidth:$,availableHeight:V}));let ee=yield s.getDimensions(a.floating);return m!==ee.width||b!==ee.height?{reset:{rects:!0}}:{}})}}};function Pn(r){return Kv(r)?(r.nodeName||"").toLowerCase():"#document"}function jt(r){var e;return(r==null||(e=r.ownerDocument)==null?void 0:e.defaultView)||window}function Nn(r){var e;return(e=(Kv(r)?r.ownerDocument:r.document)||window.document)==null?void 0:e.documentElement}function Kv(r){return r instanceof Node||r instanceof jt(r).Node}function nn(r){return r instanceof Element||r instanceof jt(r).Element}function Ur(r){return r instanceof HTMLElement||r instanceof jt(r).HTMLElement}function zv(r){return typeof ShadowRoot=="undefined"?!1:r instanceof ShadowRoot||r instanceof jt(r).ShadowRoot}function Fs(r){let{overflow:e,overflowX:t,overflowY:n,display:i}=rr(r);return/auto|scroll|overlay|hidden|clip/.test(e+n+t)&&!["inline","contents"].includes(i)}function Qv(r){return["table","td","th"].includes(Pn(r))}function wl(r){let e=kl(),t=rr(r);return t.transform!=="none"||t.perspective!=="none"||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(t.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(t.contain||"").includes(n))}function Xv(r){let e=Wi(r);for(;Ur(e)&&!Po(e);){if(wl(e))return e;e=Wi(e)}return null}function kl(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Po(r){return["html","body","#document"].includes(Pn(r))}function rr(r){return jt(r).getComputedStyle(r)}function No(r){return nn(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:{scrollLeft:r.pageXOffset,scrollTop:r.pageYOffset}}function Wi(r){if(Pn(r)==="html")return r;let e=r.assignedSlot||r.parentNode||zv(r)&&r.host||Nn(r);return zv(e)?e.host:e}function Zv(r){let e=Wi(r);return Po(e)?r.ownerDocument?r.ownerDocument.body:r.body:Ur(e)&&Fs(e)?e:Zv(e)}function vl(r,e,t){var n;e===void 0&&(e=[]),t===void 0&&(t=!0);let i=Zv(r),s=i===((n=r.ownerDocument)==null?void 0:n.body),a=jt(i);return s?e.concat(a,a.visualViewport||[],Fs(i)?i:[],a.frameElement&&t?vl(a.frameElement):[]):e.concat(i,vl(i,[],t))}function tw(r){let e=rr(r),t=parseFloat(e.width)||0,n=parseFloat(e.height)||0,i=Ur(r),s=i?r.offsetWidth:t,a=i?r.offsetHeight:n,o=Ao(t)!==s||Ao(n)!==a;return o&&(t=s,n=a),{width:t,height:n,$:o}}function rw(r){return nn(r)?r:r.contextElement}function Ls(r){let e=rw(r);if(!Ur(e))return Cn(1);let t=e.getBoundingClientRect(),{width:n,height:i,$:s}=tw(e),a=(s?Ao(t.width):t.width)/n,o=(s?Ao(t.height):t.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}var AN=Cn(0);function nw(r){let e=jt(r);return!kl()||!e.visualViewport?AN:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function PN(r,e,t){return e===void 0&&(e=!1),!t||e&&t!==jt(r)?!1:e}function Io(r,e,t,n){e===void 0&&(e=!1),t===void 0&&(t=!1);let i=r.getBoundingClientRect(),s=rw(r),a=Cn(1);e&&(n?nn(n)&&(a=Ls(n)):a=Ls(r));let o=PN(s,t,n)?nw(s):Cn(0),u=(i.left+o.x)/a.x,l=(i.top+o.y)/a.y,c=i.width/a.x,d=i.height/a.y;if(s){let p=jt(s),m=n&&nn(n)?jt(n):n,b=p.frameElement;for(;b&&n&&m!==p;){let g=Ls(b),E=b.getBoundingClientRect(),R=rr(b),x=E.left+(b.clientLeft+parseFloat(R.paddingLeft))*g.x,v=E.top+(b.clientTop+parseFloat(R.paddingTop))*g.y;u*=g.x,l*=g.y,c*=g.x,d*=g.y,u+=x,l+=v,b=jt(b).frameElement}}return Ui({width:c,height:d,x:u,y:l})}function NN(r){let{rect:e,offsetParent:t,strategy:n}=r,i=Ur(t),s=Nn(t);if(t===s)return e;let a={scrollLeft:0,scrollTop:0},o=Cn(1),u=Cn(0);if((i||!i&&n!=="fixed")&&((Pn(t)!=="body"||Fs(s))&&(a=No(t)),Ur(t))){let l=Io(t);o=Ls(t),u.x=l.x+t.clientLeft,u.y=l.y+t.clientTop}return{width:e.width*o.x,height:e.height*o.y,x:e.x*o.x-a.scrollLeft*o.x+u.x,y:e.y*o.y-a.scrollTop*o.y+u.y}}function IN(r){return Array.from(r.getClientRects())}function iw(r){return Io(Nn(r)).left+No(r).scrollLeft}function FN(r){let e=Nn(r),t=No(r),n=r.ownerDocument.body,i=qt(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=qt(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+iw(r),o=-t.scrollTop;return rr(n).direction==="rtl"&&(a+=qt(e.clientWidth,n.clientWidth)-i),{width:i,height:s,x:a,y:o}}function LN(r,e){let t=jt(r),n=Nn(r),i=t.visualViewport,s=n.clientWidth,a=n.clientHeight,o=0,u=0;if(i){s=i.width,a=i.height;let l=kl();(!l||l&&e==="fixed")&&(o=i.offsetLeft,u=i.offsetTop)}return{width:s,height:a,x:o,y:u}}function UN(r,e){let t=Io(r,!0,e==="fixed"),n=t.top+r.clientTop,i=t.left+r.clientLeft,s=Ur(r)?Ls(r):Cn(1),a=r.clientWidth*s.x,o=r.clientHeight*s.y,u=i*s.x,l=n*s.y;return{width:a,height:o,x:u,y:l}}function Jv(r,e,t){let n;if(e==="viewport")n=LN(r,t);else if(e==="document")n=FN(Nn(r));else if(nn(e))n=UN(e,t);else{let i=nw(r);n=be(X({},e),{x:e.x-i.x,y:e.y-i.y})}return Ui(n)}function sw(r,e){let t=Wi(r);return t===e||!nn(t)||Po(t)?!1:rr(t).position==="fixed"||sw(t,e)}function WN(r,e){let t=e.get(r);if(t)return t;let n=vl(r,[],!1).filter(o=>nn(o)&&Pn(o)!=="body"),i=null,s=rr(r).position==="fixed",a=s?Wi(r):r;for(;nn(a)&&!Po(a);){let o=rr(a),u=wl(a);!u&&o.position==="fixed"&&(i=null),(s?!u&&!i:!u&&o.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Fs(a)&&!u&&sw(r,a))?n=n.filter(c=>c!==a):i=o,a=Wi(a)}return e.set(r,n),n}function qN(r){let{element:e,boundary:t,rootBoundary:n,strategy:i}=r,a=[...t==="clippingAncestors"?WN(e,this._c):[].concat(t),n],o=a[0],u=a.reduce((l,c)=>{let d=Jv(e,c,i);return l.top=qt(d.top,l.top),l.right=Li(d.right,l.right),l.bottom=Li(d.bottom,l.bottom),l.left=qt(d.left,l.left),l},Jv(e,o,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function jN(r){return tw(r)}function $N(r,e,t){let n=Ur(e),i=Nn(e),s=t==="fixed",a=Io(r,!0,s,e),o={scrollLeft:0,scrollTop:0},u=Cn(0);if(n||!n&&!s)if((Pn(e)!=="body"||Fs(i))&&(o=No(e)),n){let l=Io(e,!0,s,e);u.x=l.x+e.clientLeft,u.y=l.y+e.clientTop}else i&&(u.x=iw(i));return{x:a.left+o.scrollLeft-u.x,y:a.top+o.scrollTop-u.y,width:a.width,height:a.height}}function ew(r,e){return!Ur(r)||rr(r).position==="fixed"?null:e?e(r):r.offsetParent}function aw(r,e){let t=jt(r);if(!Ur(r))return t;let n=ew(r,e);for(;n&&Qv(n)&&rr(n).position==="static";)n=ew(n,e);return n&&(Pn(n)==="html"||Pn(n)==="body"&&rr(n).position==="static"&&!wl(n))?t:n||Xv(r)||t}var GN=function(r){return L(this,null,function*(){let{reference:e,floating:t,strategy:n}=r,i=this.getOffsetParent||aw,s=this.getDimensions;return{reference:$N(e,yield i(t),n),floating:X({x:0,y:0},yield s(t))}})};function YN(r){return rr(r).direction==="rtl"}var BN={convertOffsetParentRelativeRectToViewportRelativeRect:NN,getDocumentElement:Nn,getClippingRect:qN,getOffsetParent:aw,getElementRects:GN,getClientRects:IN,getDimensions:jN,getScale:Ls,isElement:nn,isRTL:YN};var sh=(r,e,t)=>{let n=new Map,i=X({platform:BN},t),s=be(X({},i.platform),{_c:n});return Vv(r,e,be(X({},i),{platform:s}))};var ow=require("obsidian");var HN=20;function qi(r){return ye.getInstance().removeAsWordFrom(r.description)}function VN(r,e){if(r==="")return e;let t=(0,ow.prepareSimpleSearch)(r),n=-4;return e.map(a=>{let o=t(qi(a));return o&&o.score>n?{item:a,match:o}:null}).filter(Boolean).sort((a,o)=>o.match.score-a.match.score).map(a=>a.item)}function uw(r,e,t,n,i){let s=VN(r,e);return s=s.filter(a=>{if(a.isDone||a.description.includes("<%")&&a.description.includes("%>"))return!1;let o=a.description===t.description&&a.taskLocation.path===t.taskLocation.path&&a.originalMarkdown===t.originalMarkdown;return![...n,...i].includes(a)&&!o}),s.sort((a,o)=>{let u=a.taskLocation.path===t.taskLocation.path,l=o.taskLocation.path===t.taskLocation.path;return u&&l?Math.abs(a.taskLocation.lineNumber-t.taskLocation.lineNumber)-Math.abs(o.taskLocation.lineNumber-t.taskLocation.lineNumber):u?-1:l?1:0}),s.slice(0,HN)}function lw(r,e,t){let n=r.slice();return n[5]=e[t],n}function cw(r,e,t){let n=r.slice();n[40]=e[t],n[43]=t;let i=n[17](n[40].taskLocation.path);return n[41]=i,n}function dw(r){let e,t,n,i=r[10],s=[];for(let a=0;a<i.length;a+=1)s[a]=pw(cw(r,i,a));return{c(){e=K("ul");for(let a=0;a<s.length;a+=1)s[a].c();F(e,"class","task-dependency-dropdown")},m(a,o){Ie(a,e,o);for(let u=0;u<s.length;u+=1)s[u]&&s[u].m(e,null);r[31](e),t||(n=xe(e,"mouseleave",r[32]),t=!0)},p(a,o){if(o[0]&928832){i=a[10];let u;for(u=0;u<i.length;u+=1){let l=cw(a,i,u);s[u]?s[u].p(l,o):(s[u]=pw(l),s[u].c(),s[u].m(e,null))}for(;u<s.length;u+=1)s[u].d(1);s.length=i.length}},d(a){a&&Ce(e),Cs(s,a),r[31](null),t=!1,n()}}}function fw(r){let e,t=r[41]+"",n,i,s;function a(...o){return r[28](r[41],...o)}return{c(){e=K("div"),n=Fe(t),F(e,"class","dependency-path")},m(o,u){Ie(o,e,u),A(e,n),i||(s=xe(e,"mouseenter",a),i=!0)},p(o,u){r=o,u[0]&1024&&t!==(t=r[41]+"")&&Pr(n,t)},d(o){o&&Ce(e),i=!1,s()}}}function pw(r){let e,t,n,i=r[40].status.symbol+"",s,a,o=qi(r[40])+"",u,l,c,d,p,m;function b(...x){return r[27](r[40],...x)}let g=r[41]&&fw(r);function E(){return r[29](r[40])}function R(){return r[30](r[43])}return{c(){e=K("li"),t=K("div"),n=Fe("["),s=Fe(i),a=Fe("] "),u=Fe(o),c=te(),g&&g.c(),d=te(),F(t,"class",l=r[41]?"dependency-name-shared":"dependency-name"),Ir(e,"selected",r[6]!==null&&r[43]===r[11])},m(x,v){Ie(x,e,v),A(e,t),A(t,n),A(t,s),A(t,a),A(t,u),A(e,c),g&&g.m(e,null),A(e,d),p||(m=[xe(t,"mouseenter",b),xe(e,"mousedown",E),xe(e,"mouseenter",R)],p=!0)},p(x,v){r=x,v[0]&1024&&i!==(i=r[40].status.symbol+"")&&Pr(s,i),v[0]&1024&&o!==(o=qi(r[40])+"")&&Pr(u,o),v[0]&1024&&l!==(l=r[41]?"dependency-name-shared":"dependency-name")&&F(t,"class",l),r[41]?g?g.p(r,v):(g=fw(r),g.c(),g.m(e,d)):g&&(g.d(1),g=null),v[0]&2112&&Ir(e,"selected",r[6]!==null&&r[43]===r[11])},d(x){x&&Ce(e),g&&g.d(),p=!1,Tr(m)}}}function mw(r){let e,t,n,i=r[5].status.symbol+"",s,a,o=qi(r[5])+"",u,l,c,d,p,m;function b(){return r[33](r[5])}function g(...E){return r[34](r[5],...E)}return{c(){e=K("div"),t=K("span"),n=Fe("["),s=Fe(i),a=Fe("] "),u=Fe(o),l=te(),c=K("button"),c.innerHTML='<svg style="display: block; margin: auto;" xmlns="http://www.w3.org/2000/svg" width="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-x"><path d="M18 6 6 18"></path><path d="m6 6 12 12"></path></svg>',d=te(),F(t,"class","task-dependency-name"),F(c,"type","button"),F(c,"class","task-dependency-delete"),F(e,"class","task-dependency")},m(E,R){Ie(E,e,R),A(e,t),A(t,n),A(t,s),A(t,a),A(t,u),A(e,l),A(e,c),A(e,d),p||(m=[xe(c,"click",b),xe(e,"mouseenter",g)],p=!0)},p(E,R){r=E,R[0]&3&&i!==(i=r[5].status.symbol+"")&&Pr(s,i),R[0]&3&&o!==(o=qi(r[5])+"")&&Pr(u,o)},d(E){E&&Ce(e),p=!1,Tr(m)}}}function zN(r){let e,t,n,i,s,a,o,u,l,c=r[10]&&r[10].length!==0&&dw(r),d=r[0][r[1]],p=[];for(let m=0;m<d.length;m+=1)p[m]=mw(lw(r,d,m));return{c(){e=K("span"),t=K("input"),s=te(),c&&c.c(),a=te(),o=K("div");for(let m=0;m<p.length;m+=1)p[m].c();F(t,"accesskey",n=r[2](r[3])),F(t,"id",r[1]),F(t,"class","input"),F(t,"type","text"),F(t,"placeholder",r[4]),F(e,"class","input"),Ii(()=>r[26].call(e)),F(o,"class","task-dependencies-container results")},m(m,b){Ie(m,e,b),A(e,t),r[22](t),Nr(t,r[6]),i=Mv(e,r[26].bind(e)),Ie(m,s,b),c&&c.m(m,b),Ie(m,a,b),Ie(m,o,b);for(let g=0;g<p.length;g+=1)p[g]&&p[g].m(o,null);u||(l=[xe(t,"input",r[23]),xe(t,"keydown",r[24]),xe(t,"focus",r[16]),xe(t,"blur",r[25])],u=!0)},p(m,b){if(b[0]&12&&n!==(n=m[2](m[3]))&&F(t,"accesskey",n),b[0]&2&&F(t,"id",m[1]),b[0]&16&&F(t,"placeholder",m[4]),b[0]&64&&t.value!==m[6]&&Nr(t,m[6]),m[10]&&m[10].length!==0?c?c.p(m,b):(c=dw(m),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null),b[0]&802819){d=m[0][m[1]];let g;for(g=0;g<d.length;g+=1){let E=lw(m,d,g);p[g]?p[g].p(E,b):(p[g]=mw(E),p[g].c(),p[g].m(o,null))}for(;g<p.length;g+=1)p[g].d(1);p.length=d.length}},i:kt,o:kt,d(m){m&&Ce(e),r[22](null),i(),m&&Ce(s),c&&c.d(m),m&&Ce(a),m&&Ce(o),Cs(p,m),u=!1,Tr(l)}}}function KN(r,e,t){let{task:n}=e,{editableTask:i}=e,{allTasks:s}=e,{_onDescriptionKeyDown:a}=e,{type:o}=e,{accesskey:u}=e,{accesskeyLetter:l=""}=e,{placeholder:c="Type to search..."}=e,d="",p=null,m=0,b,g=!1,E=!1,R,x;function v(_){t(0,i[o]=[...i[o],_],i),t(6,d=""),t(7,g=!1)}function V(_){t(0,i[o]=i[o].filter(D=>D!==_),i)}function $(_){var D;if(p!==null){switch(_.key){case"ArrowUp":_.preventDefault(),!!m&&m>0?t(11,m-=1):t(11,m=p.length-1);break;case"ArrowDown":_.preventDefault(),!!m&&m<p.length-1?t(11,m+=1):t(11,m=0);break;case"Enter":m!==null?(_.preventDefault(),v(p[m]),t(11,m=null),t(7,g=!1)):a(_);break;default:t(11,m=0);break}m&&((D=x==null?void 0:x.getElementsByTagName("li")[m])===null||D===void 0||D.scrollIntoView({block:"nearest"}))}}function ee(_){return!_&&!E?[]:(E=!1,uw(_,s,n,i.blockedBy,i.blocking))}function Y(){t(7,g=!0),E=!0}function q(_,D){!_||!D||sh(_,D,{middleware:[Tl(6),_l(),nh(),ih({apply(){D&&Object.assign(D.style,{width:`${b}px`})}})]}).then(({x:I,y:me})=>{D.style.left=`${I}px`,D.style.top=`${me}px`})}function de(_){return _===n.taskLocation.path?"":_}function Te(_){return qi(_)}function G(_,D){let I=_.createDiv();I.addClasses(["tooltip","pop-up"]),I.innerText=D,sh(_,I,{placement:"top",middleware:[Tl(-18),_l()]}).then(({x:me,y:ae})=>{I.style.left=`${me}px`,I.style.top=`${ae}px`}),_.addEventListener("mouseleave",()=>I.remove())}function N(_){rt[_?"unshift":"push"](()=>{R=_,t(8,R)})}function O(){d=this.value,t(6,d)}let B=_=>$(_),U=()=>t(7,g=!1);function Q(){b=this.clientWidth,t(12,b)}let f=(_,D)=>G(D.currentTarget,Te(_)),h=(_,D)=>G(D.currentTarget,_),y=_=>v(_),T=_=>t(11,m=_);function w(_){rt[_?"unshift":"push"](()=>{x=_,t(9,x)})}let S=()=>t(11,m=null),M=_=>V(_),P=(_,D)=>G(D.currentTarget,Te(_));return r.$$set=_=>{"task"in _&&t(5,n=_.task),"editableTask"in _&&t(0,i=_.editableTask),"allTasks"in _&&t(20,s=_.allTasks),"_onDescriptionKeyDown"in _&&t(21,a=_._onDescriptionKeyDown),"type"in _&&t(1,o=_.type),"accesskey"in _&&t(2,u=_.accesskey),"accesskeyLetter"in _&&t(3,l=_.accesskeyLetter),"placeholder"in _&&t(4,c=_.placeholder)},r.$$.update=()=>{if(r.$$.dirty[0]&768){e:q(R,x)}if(r.$$.dirty[0]&192){e:t(10,p=g?ee(d):null)}},[i,o,u,l,c,n,d,g,R,x,p,m,b,v,V,$,Y,de,Te,G,s,a,N,O,B,U,Q,f,h,y,T,w,S,M,P]}var ah=class extends Jn{constructor(e){super(),As(this,e,KN,zN,Ms,{task:5,editableTask:0,allTasks:20,_onDescriptionKeyDown:21,type:1,accesskey:2,accesskeyLetter:3,placeholder:4},null,[-1,-1])}},oh=ah;function hw(r,e,t){let n=r.slice();return n[58]=e[t],n}function gw(r,e,t){let n=r.slice();return n[61]=e[t].value,n[62]=e[t].label,n[63]=e[t].symbol,n[64]=e[t].accessKey,n[65]=e[t].accessKeyIndex,n}function QN(r){let e,t=r[63]+"",n;return{c(){e=K("span"),n=Fe(t)},m(i,s){Ie(i,e,s),A(e,n)},p:kt,d(i){i&&Ce(e)}}}function yw(r){let e,t,n,i,s,a,o,u,l=r[62].substring(0,r[65])+"",c,d,p=r[62].substring(r[65],r[65]+1)+"",m,b,g=r[62].substring(r[65]+1)+"",E,R,x=r[63]&&r[63].charCodeAt(0)>=256,v,V,$,ee,Y,q=x&&QN(r);return $=xv(r[38][0]),{c(){e=K("span"),t=K("input"),a=te(),o=K("label"),u=K("span"),c=Fe(l),d=K("span"),m=Fe(p),b=K("span"),E=Fe(g),R=te(),q&&q.c(),V=te(),F(t,"type","radio"),F(t,"id",n="priority-"+r[61]),t.__value=i=r[61],t.value=t.__value,F(t,"accesskey",s=r[17](r[64])),F(d,"class","accesskey"),F(o,"for",v="priority-"+r[61]),$.p(t)},m(de,Te){Ie(de,e,Te),A(e,t),t.checked=t.__value===r[3].priority,A(e,a),A(e,o),A(o,u),A(u,c),A(o,d),A(d,m),A(o,b),A(b,E),A(o,R),q&&q.m(o,null),A(e,V),ee||(Y=xe(t,"change",r[37]),ee=!0)},p(de,Te){Te[0]&131072&&s!==(s=de[17](de[64]))&&F(t,"accesskey",s),Te[0]&8&&(t.checked=t.__value===de[3].priority),x&&q.p(de,Te)},d(de){de&&Ce(e),q&&q.d(),$.r(),ee=!1,Y()}}}function XN(r){let e;return{c(){e=K("div"),e.innerHTML="<i>Blocking and blocked by fields are disabled when vault tasks is empty</i>"},m(t,n){Ie(t,e,n)},p:kt,i:kt,o:kt,d(t){t&&Ce(e)}}}function ZN(r){let e,t,n,i,s,a,o,u;return n=new oh({props:{type:"blockedBy",task:r[0],editableTask:r[3],allTasks:r[2],_onDescriptionKeyDown:r[29],accesskey:r[17],accesskeyLetter:"b",placeholder:"Search for tasks that the task being edited depends on..."}}),o=new oh({props:{type:"blocking",task:r[0],editableTask:r[3],allTasks:r[2],_onDescriptionKeyDown:r[29],accesskey:r[17],accesskeyLetter:"e",placeholder:"Search for tasks that depend on this task being done..."}}),{c(){e=K("label"),e.textContent="Before this",t=te(),Mn(n.$$.fragment),i=te(),s=K("label"),s.innerHTML='Aft<span class="accesskey">e</span>r this',a=te(),Mn(o.$$.fragment),F(e,"for","blockedBy"),F(e,"class","accesskey-first"),F(s,"for","blocking")},m(l,c){Ie(l,e,c),Ie(l,t,c),tn(n,l,c),Ie(l,i,c),Ie(l,s,c),Ie(l,a,c),tn(o,l,c),u=!0},p(l,c){let d={};c[0]&1&&(d.task=l[0]),c[0]&8&&(d.editableTask=l[3]),c[0]&4&&(d.allTasks=l[2]),c[0]&131072&&(d.accesskey=l[17]),n.$set(d);let p={};c[0]&1&&(p.task=l[0]),c[0]&8&&(p.editableTask=l[3]),c[0]&4&&(p.allTasks=l[2]),c[0]&131072&&(p.accesskey=l[17]),o.$set(p)},i(l){u||(_r(n.$$.fragment,l),_r(o.$$.fragment,l),u=!0)},o(l){Fr(n.$$.fragment,l),Fr(o.$$.fragment,l),u=!1},d(l){l&&Ce(e),l&&Ce(t),Lr(n,l),l&&Ce(i),l&&Ce(s),l&&Ce(a),Lr(o,l)}}}function bw(r){let e,t=r[58].name+"",n,i,s=r[58].symbol+"",a,o,u;return{c(){e=K("option"),n=Fe(t),i=Fe(" ["),a=Fe(s),o=Fe("]"),e.__value=u=r[58].symbol,e.value=e.__value},m(l,c){Ie(l,e,c),A(e,n),A(e,i),A(e,a),A(e,o)},p(l,c){c[0]&2&&t!==(t=l[58].name+"")&&Pr(n,t),c[0]&2&&s!==(s=l[58].symbol+"")&&Pr(a,s),c[0]&2&&u!==(u=l[58].symbol)&&(e.__value=u,e.value=e.__value)},d(l){l&&Ce(e)}}}function JN(r){let e,t,n,i,s,a,o,u,l,c,d,p,m,b,g,E,R,x,v,V,$,ee,Y,q,de,Te,G,N,O,B,U,Q,f,h,y,T,w,S,M,P,_,D,I,me,ae,le,Ee,We,Un,bt,or,Wn,It,Qe,ci,Ft,Yt,Bo,Ho,Vo,j,Xe,Ze,Ue,Gr,di,Be,fi,Yr,ur,Qi,Xi,oa,qn,zo,Er,$e,dn,Uh,Ko,Wh,fn,bc,Tc,qh,Zi,pi,jh,Qo,$h,ua,Bt,_c,Gh,Ji=r[25],Dt=[];for(let C=0;C<Ji.length;C+=1)Dt[C]=yw(gw(r,Ji,C));function Ck(C){r[40](C)}function Ak(C){r[41](C)}let vc={id:"due",dateSymbol:r[21],forwardOnly:r[3].forwardOnly,accesskey:r[17]("d")};r[3].dueDate!==void 0&&(vc.date=r[3].dueDate),r[7]!==void 0&&(vc.isDateValid=r[7]),U=new Fi({props:vc}),rt.push(()=>tr(U,"date",Ck)),rt.push(()=>tr(U,"isDateValid",Ak));function Pk(C){r[42](C)}function Nk(C){r[43](C)}let wc={id:"scheduled",dateSymbol:r[20],forwardOnly:r[3].forwardOnly,accesskey:r[17]("s")};r[3].scheduledDate!==void 0&&(wc.date=r[3].scheduledDate),r[8]!==void 0&&(wc.isDateValid=r[8]),w=new Fi({props:wc}),rt.push(()=>tr(w,"date",Pk)),rt.push(()=>tr(w,"isDateValid",Nk));function Ik(C){r[44](C)}function Fk(C){r[45](C)}let kc={id:"start",dateSymbol:r[19],forwardOnly:r[3].forwardOnly,accesskey:r[17]("a")};r[3].startDate!==void 0&&(kc.date=r[3].startDate),r[9]!==void 0&&(kc.isDateValid=r[9]),I=new Fi({props:kc}),rt.push(()=>tr(I,"date",Ik)),rt.push(()=>tr(I,"isDateValid",Fk));let Yh=[ZN,XN],jn=[];function Bh(C,ie){return C[2].length>0&&C[16]?0:1}Ft=Bh(r,[-1,-1,-1]),Yt=jn[Ft]=Yh[Ft](r);let es=r[1],xt=[];for(let C=0;C<es.length;C+=1)xt[C]=bw(hw(r,es,C));function Lk(C){r[48](C)}function Uk(C){r[49](C)}let Ec={id:"created",dateSymbol:r[23],forwardOnly:r[3].forwardOnly,accesskey:null};r[3].createdDate!==void 0&&(Ec.date=r[3].createdDate),r[5]!==void 0&&(Ec.isDateValid=r[5]),ur=new Fi({props:Ec}),rt.push(()=>tr(ur,"date",Lk)),rt.push(()=>tr(ur,"isDateValid",Uk));function Wk(C){r[50](C)}function qk(C){r[51](C)}let Sc={id:"done",dateSymbol:r[24],forwardOnly:r[3].forwardOnly,accesskey:null};r[3].doneDate!==void 0&&(Sc.date=r[3].doneDate),r[6]!==void 0&&(Sc.isDateValid=r[6]),Er=new Fi({props:Sc}),rt.push(()=>tr(Er,"date",Wk)),rt.push(()=>tr(Er,"isDateValid",qk));function jk(C){r[52](C)}function $k(C){r[53](C)}let Oc={id:"cancelled",dateSymbol:r[22],forwardOnly:r[3].forwardOnly,accesskey:null};return r[3].cancelledDate!==void 0&&(Oc.date=r[3].cancelledDate),r[4]!==void 0&&(Oc.isDateValid=r[4]),fn=new Fi({props:Oc}),rt.push(()=>tr(fn,"date",jk)),rt.push(()=>tr(fn,"isDateValid",$k)),{c(){e=K("div"),t=K("form"),n=K("div"),i=K("label"),i.innerHTML='Descrip<span class="accesskey">t</span>ion',s=te(),a=K("textarea"),u=te(),l=K("div"),c=K("label"),d=Fe("Priority"),m=te();for(let C=0;C<Dt.length;C+=1)Dt[C].c();b=te(),g=K("div"),E=K("label"),E.textContent="Recurs",R=te(),x=K("input"),V=te(),$=K("code"),ee=Fe(r[18]),Y=te(),q=new Rs(!1),de=te(),Te=K("hr"),G=te(),N=K("div"),O=K("label"),O.textContent="Due",B=te(),Mn(U.$$.fragment),h=te(),y=K("label"),y.textContent="Scheduled",T=te(),Mn(w.$$.fragment),P=te(),_=K("label"),_.innerHTML='St<span class="accesskey">a</span>rt',D=te(),Mn(I.$$.fragment),le=te(),Ee=K("div"),We=K("label"),We.innerHTML=`Only - <span class="accesskey-first">future</span> dates:`,Un=te(),bt=K("input"),Wn=te(),It=K("hr"),Qe=te(),ci=K("div"),Yt.c(),Bo=te(),Ho=K("hr"),Vo=te(),j=K("div"),Xe=K("label"),Xe.innerHTML='Stat<span class="accesskey">u</span>s',Ze=te(),Ue=K("select");for(let C=0;C<xt.length;C+=1)xt[C].c();di=te(),Be=K("div"),fi=K("label"),fi.textContent="Created",Yr=te(),Mn(ur.$$.fragment),oa=te(),qn=K("label"),qn.textContent="Done",zo=te(),Mn(Er.$$.fragment),Uh=te(),Ko=K("label"),Ko.textContent="Cancelled",Wh=te(),Mn(fn.$$.fragment),qh=te(),Zi=K("div"),pi=K("button"),jh=Fe("Apply"),$h=te(),ua=K("button"),ua.textContent="Cancel",F(i,"for","description"),F(a,"id","description"),F(a,"class","tasks-modal-description"),F(a,"placeholder","Take out the trash"),F(a,"accesskey",o=r[17]("t")),F(n,"class","tasks-modal-section"),F(c,"for",p="priority-"+r[3].priority),F(l,"class","tasks-modal-section tasks-modal-priorities"),F(E,"for","recurrence"),F(E,"class","accesskey-first"),F(x,"id","recurrence"),F(x,"type","text"),F(x,"class","input"),F(x,"placeholder","Try 'every 2 weeks on Thursday'."),F(x,"accesskey",v=r[17]("r")),Ir(x,"tasks-modal-error",!r[10]),q.a=null,F($,"class","results"),F(g,"class","tasks-modal-section tasks-modal-dates"),F(O,"for","due"),F(O,"class","accesskey-first"),F(y,"for","scheduled"),F(y,"class","accesskey-first"),F(_,"for","start"),F(We,"for","forwardOnly"),F(bt,"id","forwardOnly"),F(bt,"type","checkbox"),F(bt,"class","input task-list-item-checkbox tasks-modal-checkbox"),F(bt,"accesskey",or=r[17]("f")),F(N,"class","tasks-modal-section tasks-modal-dates"),F(ci,"class","tasks-modal-section tasks-modal-dates"),F(Xe,"for","status"),F(Ue,"id","status-type"),F(Ue,"class","dropdown"),F(Ue,"accesskey",Gr=r[17]("u")),r[12]===void 0&&Ii(()=>r[47].call(Ue)),F(j,"class","tasks-modal-section"),F(fi,"for","created"),F(qn,"for","done"),F(Ko,"for","cancelled"),F(Be,"class","tasks-modal-section tasks-modal-dates"),pi.disabled=Qo=!r[15],F(pi,"type","submit"),F(pi,"class","mod-cta"),F(ua,"type","button"),F(Zi,"class","tasks-modal-section tasks-modal-buttons"),Ir(t,"with-accesskeys",r[11]),F(e,"class","tasks-modal")},m(C,ie){Ie(C,e,ie),A(e,t),A(t,n),A(n,i),A(n,s),A(n,a),Nr(a,r[3].description),r[36](a),A(t,u),A(t,l),A(l,c),A(c,d),A(l,m);for(let Rt=0;Rt<Dt.length;Rt+=1)Dt[Rt]&&Dt[Rt].m(l,null);A(t,b),A(t,g),A(g,E),A(g,R),A(g,x),Nr(x,r[3].recurrenceRule),A(g,V),A(g,$),A($,ee),A($,Y),q.m(r[14],$),A(t,de),A(t,Te),A(t,G),A(t,N),A(N,O),A(N,B),tn(U,N,null),A(N,h),A(N,y),A(N,T),tn(w,N,null),A(N,P),A(N,_),A(N,D),tn(I,N,null),A(N,le),A(N,Ee),A(Ee,We),A(Ee,Un),A(Ee,bt),bt.checked=r[3].forwardOnly,A(t,Wn),A(t,It),A(t,Qe),A(t,ci),jn[Ft].m(ci,null),A(t,Bo),A(t,Ho),A(t,Vo),A(t,j),A(j,Xe),A(j,Ze),A(j,Ue);for(let Rt=0;Rt<xt.length;Rt+=1)xt[Rt]&&xt[Rt].m(Ue,null);Bm(Ue,r[12],!0),A(t,di),A(t,Be),A(Be,fi),A(Be,Yr),tn(ur,Be,null),A(Be,oa),A(Be,qn),A(Be,zo),tn(Er,Be,null),A(Be,Uh),A(Be,Ko),A(Be,Wh),tn(fn,Be,null),A(t,qh),A(t,Zi),A(Zi,pi),A(pi,jh),A(Zi,$h),A(Zi,ua),Bt=!0,_c||(Gh=[xe(a,"input",r[35]),xe(a,"keydown",r[29]),xe(a,"paste",r[30]),xe(a,"drop",r[30]),xe(l,"keyup",r[27]),xe(x,"input",r[39]),xe(bt,"change",r[46]),xe(Ue,"change",r[47]),xe(Ue,"change",r[26]),xe(ua,"click",r[28]),xe(t,"submit",Dv(r[31]))],_c=!0)},p(C,ie){if((!Bt||ie[0]&131072&&o!==(o=C[17]("t")))&&F(a,"accesskey",o),ie[0]&8&&Nr(a,C[3].description),(!Bt||ie[0]&8&&p!==(p="priority-"+C[3].priority))&&F(c,"for",p),ie[0]&33685512){Ji=C[25];let Ne;for(Ne=0;Ne<Ji.length;Ne+=1){let da=gw(C,Ji,Ne);Dt[Ne]?Dt[Ne].p(da,ie):(Dt[Ne]=yw(da),Dt[Ne].c(),Dt[Ne].m(l,null))}for(;Ne<Dt.length;Ne+=1)Dt[Ne].d(1);Dt.length=Ji.length}(!Bt||ie[0]&131072&&v!==(v=C[17]("r")))&&F(x,"accesskey",v),ie[0]&8&&x.value!==C[3].recurrenceRule&&Nr(x,C[3].recurrenceRule),(!Bt||ie[0]&1024)&&Ir(x,"tasks-modal-error",!C[10]),(!Bt||ie[0]&16384)&&q.p(C[14]);let Rt={};ie[0]&8&&(Rt.forwardOnly=C[3].forwardOnly),ie[0]&131072&&(Rt.accesskey=C[17]("d")),!Q&&ie[0]&8&&(Q=!0,Rt.date=C[3].dueDate,er(()=>Q=!1)),!f&&ie[0]&128&&(f=!0,Rt.isDateValid=C[7],er(()=>f=!1)),U.$set(Rt);let la={};ie[0]&8&&(la.forwardOnly=C[3].forwardOnly),ie[0]&131072&&(la.accesskey=C[17]("s")),!S&&ie[0]&8&&(S=!0,la.date=C[3].scheduledDate,er(()=>S=!1)),!M&&ie[0]&256&&(M=!0,la.isDateValid=C[8],er(()=>M=!1)),w.$set(la);let ca={};ie[0]&8&&(ca.forwardOnly=C[3].forwardOnly),ie[0]&131072&&(ca.accesskey=C[17]("a")),!me&&ie[0]&8&&(me=!0,ca.date=C[3].startDate,er(()=>me=!1)),!ae&&ie[0]&512&&(ae=!0,ca.isDateValid=C[9],er(()=>ae=!1)),I.$set(ca),(!Bt||ie[0]&131072&&or!==(or=C[17]("f")))&&F(bt,"accesskey",or),ie[0]&8&&(bt.checked=C[3].forwardOnly);let Dc=Ft;if(Ft=Bh(C,ie),Ft===Dc?jn[Ft].p(C,ie):(Av(),Fr(jn[Dc],1,1,()=>{jn[Dc]=null}),Pv(),Yt=jn[Ft],Yt?Yt.p(C,ie):(Yt=jn[Ft]=Yh[Ft](C),Yt.c()),_r(Yt,1),Yt.m(ci,null)),ie[0]&2){es=C[1];let Ne;for(Ne=0;Ne<es.length;Ne+=1){let da=hw(C,es,Ne);xt[Ne]?xt[Ne].p(da,ie):(xt[Ne]=bw(da),xt[Ne].c(),xt[Ne].m(Ue,null))}for(;Ne<xt.length;Ne+=1)xt[Ne].d(1);xt.length=es.length}(!Bt||ie[0]&131072&&Gr!==(Gr=C[17]("u")))&&F(Ue,"accesskey",Gr),ie[0]&4098&&Bm(Ue,C[12]);let Xo={};ie[0]&8&&(Xo.forwardOnly=C[3].forwardOnly),!Qi&&ie[0]&8&&(Qi=!0,Xo.date=C[3].createdDate,er(()=>Qi=!1)),!Xi&&ie[0]&32&&(Xi=!0,Xo.isDateValid=C[5],er(()=>Xi=!1)),ur.$set(Xo);let Zo={};ie[0]&8&&(Zo.forwardOnly=C[3].forwardOnly),!$e&&ie[0]&8&&($e=!0,Zo.date=C[3].doneDate,er(()=>$e=!1)),!dn&&ie[0]&64&&(dn=!0,Zo.isDateValid=C[6],er(()=>dn=!1)),Er.$set(Zo);let Jo={};ie[0]&8&&(Jo.forwardOnly=C[3].forwardOnly),!bc&&ie[0]&8&&(bc=!0,Jo.date=C[3].cancelledDate,er(()=>bc=!1)),!Tc&&ie[0]&16&&(Tc=!0,Jo.isDateValid=C[4],er(()=>Tc=!1)),fn.$set(Jo),(!Bt||ie[0]&32768&&Qo!==(Qo=!C[15]))&&(pi.disabled=Qo),(!Bt||ie[0]&2048)&&Ir(t,"with-accesskeys",C[11])},i(C){Bt||(_r(U.$$.fragment,C),_r(w.$$.fragment,C),_r(I.$$.fragment,C),_r(Yt),_r(ur.$$.fragment,C),_r(Er.$$.fragment,C),_r(fn.$$.fragment,C),Bt=!0)},o(C){Fr(U.$$.fragment,C),Fr(w.$$.fragment,C),Fr(I.$$.fragment,C),Fr(Yt),Fr(ur.$$.fragment,C),Fr(Er.$$.fragment,C),Fr(fn.$$.fragment,C),Bt=!1},d(C){C&&Ce(e),r[36](null),Cs(Dt,C),Lr(U),Lr(w),Lr(I),jn[Ft].d(),Cs(xt,C),Lr(ur),Lr(Er),Lr(fn),_c=!1,Tr(Gh)}}}function eI(r,e,t){let n;var i;let{task:s}=e,{onSubmit:a}=e,{statusOptions:o}=e,{allTasks:u}=e,l=s.status.symbol,{prioritySymbols:c,recurrenceSymbol:d,startDateSymbol:p,scheduledDateSymbol:m,dueDateSymbol:b,cancelledDateSymbol:g,createdDateSymbol:E,doneDateSymbol:R}=Dn.tasksPluginEmoji.taskSerializer.symbols,x,v={description:"",status:ne.TODO,priority:"none",recurrenceRule:"",createdDate:"",startDate:"",scheduledDate:"",dueDate:"",doneDate:"",cancelledDate:"",forwardOnly:!0,blockedBy:[],blocking:[]},V=!0,$=!0,ee=!0,Y=!0,q=!0,de=!0,Te=!0,G="",N=!0,O=!1,B=!0,U=!0,Q=[],f=!1,h=[{value:"lowest",label:"Lowest",symbol:c.Lowest,accessKey:"o",accessKeyIndex:1},{value:"low",label:"Low",symbol:c.Low,accessKey:"l",accessKeyIndex:0},{value:"none",label:"Normal",symbol:c.None,accessKey:"n",accessKeyIndex:0},{value:"medium",label:"Medium",symbol:c.Medium,accessKey:"m",accessKeyIndex:0},{value:"high",label:"High",symbol:c.High,accessKey:"h",accessKeyIndex:0},{value:"highest",label:"Highest",symbol:c.Highest,accessKey:"i",accessKeyIndex:1}];function y(j){return Vm(this,void 0,void 0,function*(){if(j.id!=="")return j;let Xe=u.filter(Ue=>Ue.id!==""),Ze=Nv(j,Xe.map(Ue=>Ue.id));return yield rn({originalTask:j,newTasks:Ze}),Ze})}let T=()=>{let j=o.find(Ze=>Ze.symbol===l);if(j)t(3,v.status=j,v);else{console.log(`Error in EditTask: cannot find status with symbol ${l}`);return}let Xe=s.handleNewStatus(j).pop();Xe&&(t(3,v.doneDate=Xe.done.formatAsDate(),v),t(3,v.cancelledDate=Xe.cancelled.formatAsDate(),v))};Hm(()=>{let{provideAccessKeys:j}=J();t(11,B=j);let Xe=ye.getInstance().removeAsWordFrom(s.description);(Xe!=s.description||!ye.getInstance().includedIn(s.description))&&(O=!0);let Ze="none";s.priority==="5"?Ze="lowest":s.priority==="4"?Ze="low":s.priority==="2"?Ze="medium":s.priority==="1"?Ze="high":s.priority==="0"&&(Ze="highest");let Ue=[];for(let Gr of s.dependsOn){let di=u.find(Be=>Be.id===Gr);!di||Ue.push(di)}Q=u.filter(Gr=>Gr.dependsOn.includes(s.id)),t(3,v={description:Xe,status:s.status,priority:Ze,recurrenceRule:s.recurrence?s.recurrence.toText():"",createdDate:new Ye(s.createdDate).formatAsDate(),startDate:new Ye(s.startDate).formatAsDate(),scheduledDate:new Ye(s.scheduledDate).formatAsDate(),dueDate:new Ye(s.dueDate).formatAsDate(),doneDate:new Ye(s.doneDate).formatAsDate(),cancelledDate:new Ye(s.cancelledDate).formatAsDate(),forwardOnly:!0,blockedBy:Ue,blocking:Q}),t(16,f=!0),setTimeout(()=>{x.focus()},10)});let w=j=>{if(j.key&&!j.altKey&&!j.ctrlKey){let Xe=h.find(Ze=>Ze.label.charAt(0).toLowerCase()==j.key);Xe&&t(3,v.priority=Xe.value,v)}},S=()=>{a([])},M=j=>{j.key==="Enter"&&(j.preventDefault(),U&&_())},P=()=>{setTimeout(()=>{t(3,v.description=v.description.replace(/[\r\n]+/g," "),v)},0)},_=()=>Vm(void 0,void 0,void 0,function*(){let j=v.description.trim();O&&(j=ye.getInstance().prependTo(j));let Xe=Ri(v.startDate,v.forwardOnly),Ze=Ri(v.scheduledDate,v.forwardOnly),Ue=Ri(v.dueDate,v.forwardOnly),Gr=Ri(v.cancelledDate,v.forwardOnly),di=Ri(v.createdDate,v.forwardOnly),Be=Ri(v.doneDate,v.forwardOnly),fi=null;v.recurrenceRule&&(fi=ct.fromText({recurrenceRuleText:v.recurrenceRule,startDate:Xe,scheduledDate:Ze,dueDate:Ue}));let Yr;switch(v.priority){case"lowest":Yr="5";break;case"low":Yr="4";break;case"medium":Yr="2";break;case"high":Yr="1";break;case"highest":Yr="0";break;default:Yr="3"}let ur=[];for(let $e of v.blockedBy){let dn=yield y($e);ur.push(dn)}let Qi=s.id,Xi=[],oa=[];(v.blocking.toString()!==Q.toString()||v.blocking.length!==0)&&(s.id===""&&(Qi=zm(u.filter($e=>$e.id!=="").map($e=>$e.id))),Xi=Q.filter($e=>!v.blocking.includes($e)),oa=v.blocking.filter($e=>!Q.includes($e)));let qn=new oe(Object.assign(Object.assign({},s),{description:j,status:s.status,priority:Yr,recurrence:fi,startDate:Xe,scheduledDate:Ze,dueDate:Ue,doneDate:Be,createdDate:di,cancelledDate:Gr,dependsOn:ur.map($e=>$e.id),id:Qi}));for(let $e of Xi){let dn=Fv($e,qn);yield rn({originalTask:$e,newTasks:dn})}for(let $e of oa){let dn=Iv($e,qn);yield rn({originalTask:$e,newTasks:dn})}let zo=Be||window.moment(),Er=qn.handleNewStatusWithRecurrenceInUsersOrder(v.status,zo);a(Er)}),D=[[]];function I(){v.description=this.value,t(3,v)}function me(j){rt[j?"unshift":"push"](()=>{x=j,t(13,x)})}function ae(){v.priority=this.__value,t(3,v)}function le(){v.recurrenceRule=this.value,t(3,v)}function Ee(j){r.$$.not_equal(v.dueDate,j)&&(v.dueDate=j,t(3,v))}function We(j){q=j,t(7,q)}function Un(j){r.$$.not_equal(v.scheduledDate,j)&&(v.scheduledDate=j,t(3,v))}function bt(j){de=j,t(8,de)}function or(j){r.$$.not_equal(v.startDate,j)&&(v.startDate=j,t(3,v))}function Wn(j){Te=j,t(9,Te)}function It(){v.forwardOnly=this.checked,t(3,v)}function Qe(){l=Rv(this),t(12,l),t(1,o)}function ci(j){r.$$.not_equal(v.createdDate,j)&&(v.createdDate=j,t(3,v))}function Ft(j){ee=j,t(5,ee)}function Yt(j){r.$$.not_equal(v.doneDate,j)&&(v.doneDate=j,t(3,v))}function Bo(j){Y=j,t(6,Y)}function Ho(j){r.$$.not_equal(v.cancelledDate,j)&&(v.cancelledDate=j,t(3,v))}function Vo(j){$=j,t(4,$)}return r.$$set=j=>{"task"in j&&t(0,s=j.task),"onSubmit"in j&&t(32,a=j.onSubmit),"statusOptions"in j&&t(1,o=j.statusOptions),"allTasks"in j&&t(2,u=j.allTasks)},r.$$.update=()=>{if(r.$$.dirty[0]&2048){e:t(17,n=j=>B?j:null)}if(r.$$.dirty[0]&8|r.$$.dirty[1]&4){e:if(t(10,N=!0),!v.recurrenceRule)t(14,G="<i>not recurring</>");else{let j=t(33,i=ct.fromText({recurrenceRuleText:v.recurrenceRule,startDate:null,scheduledDate:null,dueDate:null}))===null||i===void 0?void 0:i.toText();j?!v.startDate&&!v.scheduledDate&&!v.dueDate?(t(14,G="<i>due, scheduled or start date required</i>"),t(10,N=!1)):t(14,G=j):(t(14,G="<i>invalid recurrence rule</i>"),t(10,N=!1))}}if(r.$$.dirty[0]&8){e:t(34,V=v.description.trim()!=="")}if(r.$$.dirty[0]&2032|r.$$.dirty[1]&8){e:t(15,U=q&&N&&de&&Te&&V&&$&&ee&&Y)}},[s,o,u,v,$,ee,Y,q,de,Te,N,B,l,x,G,U,f,n,d,p,m,b,g,E,R,h,T,w,S,M,P,_,a,i,V,I,me,ae,D,le,Ee,We,Un,bt,or,Wn,It,Qe,ci,Ft,Yt,Bo,Ho,Vo]}var uh=class extends Jn{constructor(e){super(),As(this,e,eI,JN,Ms,{task:0,onSubmit:32,statusOptions:1,allTasks:2},null,[-1,-1,-1])}},Tw=uh;var ti=class extends _w.Modal{constructor({app:t,task:n,onSubmit:i,allTasks:s}){super(t);this.task=n,this.allTasks=s,this.onSubmit=a=>{a.length&&i(a),this.close()}}onOpen(){this.titleEl.setText("Create or edit Task"),this.modalEl.style.paddingBottom="0";let{contentEl:t}=this;this.contentEl.style.paddingBottom="0";let n=this.getKnownStatusesAndCurrentTaskStatusIfNotKnown();new Tw({target:t,props:{task:this.task,statusOptions:n,onSubmit:this.onSubmit,allTasks:this.allTasks}})}getKnownStatusesAndCurrentTaskStatusIfNotKnown(){let t=Oe.getInstance().registeredStatuses;return Oe.getInstance().bySymbol(this.task.status.symbol)===ne.EMPTY&&t.push(this.task.status),t}onClose(){let{contentEl:t}=this;t.empty()}};function tI(){let{setCreatedDate:r}=J();return r?window.moment():null}function rI(r){let{setCreatedDate:e}=J();if(!e||r.createdDate!==null)return!1;let t=r.description==="",n=!ye.getInstance().isEmpty(),i=!ye.getInstance().includedIn(r.description);return t||n&&i}var El=({line:r,path:e})=>{var p,m;let t=oe.parseTaskSignifiers(r,yt.fromUnknownPosition(e),wt.fromPath(e)),n=tI();if(t!==null)return rI(t)?new oe(be(X({},t),{createdDate:n})):t;let i=r.match(Z.nonTaskRegex);if(i===null)return console.error("Tasks: Cannot create task on line:",r),new oe({status:ne.TODO,description:"",taskLocation:yt.fromUnknownPosition(e),indentation:"",listMarker:"-",priority:"3",createdDate:n,startDate:null,scheduledDate:null,dueDate:null,doneDate:null,cancelledDate:null,recurrence:null,dependsOn:[],id:"",blockLink:"",tags:[],originalMarkdown:"",scheduledDateIsInferred:!1});let s=i[1],a=(p=i[2])!=null?p:"-",o=(m=i[4])!=null?m:" ",u=Oe.getInstance().bySymbolOrCreate(o),l=i[5],c=r.match(Z.blockLinkRegex),d=c!==null?c[0]:"";return d!==""&&(l=l.replace(Z.blockLinkRegex,"")),new oe({status:u,description:l,taskLocation:yt.fromUnknownPosition(e),indentation:s,listMarker:a,blockLink:d,priority:"3",createdDate:n,startDate:null,scheduledDate:null,dueDate:null,doneDate:null,cancelledDate:null,recurrence:null,tags:[],originalMarkdown:"",scheduledDateIsInferred:!1,id:"",dependsOn:[]})};var vw=(r,e,t,n,i)=>{var p;if(r)return t instanceof lh.MarkdownView;if(!(t instanceof lh.MarkdownView))return;let s=(p=t.file)==null?void 0:p.path;if(s===void 0)return;let o=e.getCursor().line,u=e.getLine(o),l=El({line:u,path:s}),c=m=>{let b=wt.removeInferredStatusIfNeeded(l,m).map(g=>g.toFileLineString()).join(` -`);e.setLine(o,b)};new ti({app:n,task:l,onSubmit:c,allTasks:i}).open()};var ch=require("obsidian");var ww=(r,e,t)=>{var u;if(r)return t instanceof ch.MarkdownView;if(!(t instanceof ch.MarkdownView))return;let n=(u=t.file)==null?void 0:u.path;if(n===void 0)return;let i=e.getCursor(),s=i.line,a=e.getLine(s),o=nI(a,n);e.setLine(s,o.text),e.setCursor(iI(i,o))},nI=(r,e)=>{let t=oe.fromLine({line:r,taskLocation:yt.fromUnknownPosition(e),fallbackDate:null});if(t!==null){let n=t.toggleWithRecurrenceInUsersOrder().map(i=>i.toFileLineString());return{text:n.join(` -`),moveTo:{line:n.length-1}}}else{let n=r.match(Z.taskRegex);if(n!==null){let i=n[3],a=Oe.getInstance().bySymbol(i).nextStatusSymbol;return{text:r.replace(Z.taskRegex,`$1- [${a}] $4`)}}else if(Z.listItemRegex.test(r)){let i=r.replace(Z.listItemRegex,"$1$2 [ ]");return{text:i,moveTo:{ch:i.length}}}else{let i=r.replace(Z.indentationRegex,"$1- ");return{text:i,moveTo:{ch:i.length}}}}},iI=(r,e)=>{var s;let t={line:0,ch:r.ch},n=X(X({},t),(s=e.moveTo)!=null?s:{}),i=e.text.split(` -`)[n.line].length;return{line:r.line+n.line,ch:Math.min(n.ch,i)}};var Sl=class{get app(){return this.plugin.app}constructor({plugin:e}){this.plugin=e,e.addCommand({id:"edit-task",name:"Create or edit task",icon:"pencil",editorCheckCallback:(t,n,i)=>vw(t,n,i,this.app,this.plugin.getTasks())}),e.addCommand({id:"toggle-done",name:"Toggle task done",icon:"check-in-circle",editorCheckCallback:ww})}};var ri=class{constructor(){this.hidePostponeButton=!1;this.hideTaskCount=!1;this.hideBacklinks=!1;this.hideEditButton=!1;this.hideUrgency=!0;this.shortMode=!1;this.explainQuery=!1}};function ji(r,e){let t=`Error: ${r}. +${u}`);return}break}s++}}return i}function Cs(r){return r.charAt(0).toUpperCase()+r.slice(1)}function gt(r,e){if(e===null)return Cs(r);let t=r.toLowerCase().indexOf(e.toLowerCase());if(t===-1)return`${Cs(r)} (<span class="accesskey">${e.toLowerCase()}</span>)`;let n=r.substring(0,t);return n+='<span class="accesskey">',t===0?n+=r.substring(t,t+1).toUpperCase():n+=r.substring(t,t+1),n+="</span>",n+=r.substring(t+1),n=Cs(n),n}function Lv(r){var t;if(!r.recurrenceRule)return{parsedRecurrence:"<i>not recurring</>",isRecurrenceValid:!0};let e=(t=Ze.fromText({recurrenceRuleText:r.recurrenceRule,startDate:null,scheduledDate:null,dueDate:null}))==null?void 0:t.toText();return e?r.startDate||r.scheduledDate||r.dueDate?{parsedRecurrence:e,isRecurrenceValid:!0}:{parsedRecurrence:"<i>due, scheduled or start date required</i>",isRecurrenceValid:!1}:{parsedRecurrence:"<i>invalid recurrence rule</i>",isRecurrenceValid:!1}}function NN(r){let e,t=gt(r[2],r[4])+"",n,i,s,a,o,u,l,c,d;return{c(){e=K("label"),n=oe(),i=K("input"),s=oe(),a=K("code"),o=Me(r[3]),u=oe(),l=new Ms(!1),L(e,"for",r[2]),L(i,"id",r[2]),L(i,"type","text"),L(i,"class","tasks-modal-date-input"),L(i,"placeholder",IN),L(i,"accesskey",r[4]),Pn(i,"tasks-modal-error",!r[1]),l.a=null,L(a,"class","tasks-modal-parsed-date")},m(f,m){de(f,e,m),e.innerHTML=t,de(f,n,m),de(f,i,m),vr(i,r[0]),de(f,s,m),de(f,a,m),F(a,o),F(a,u),l.m(r[5],a),c||(d=xe(i,"input",r[7]),c=!0)},p(f,[m]){m&20&&t!==(t=gt(f[2],f[4])+"")&&(e.innerHTML=t),m&4&&L(e,"for",f[2]),m&4&&L(i,"id",f[2]),m&16&&L(i,"accesskey",f[4]),m&1&&i.value!==f[0]&&vr(i,f[0]),m&2&&Pn(i,"tasks-modal-error",!f[1]),m&8&&Fr(o,f[3]),m&32&&l.p(f[5])},i:Ue,o:Ue,d(f){f&&ae(e),f&&ae(n),f&&ae(i),f&&ae(s),f&&ae(a),c=!1,d()}}}var IN="Try 'Mon' or 'tm' then space";function FN(r,e,t){let{id:n}=e,{dateSymbol:i}=e,{date:s}=e,{isDateValid:a}=e,{forwardOnly:o}=e,{accesskey:u}=e,l;function c(){s=this.value,t(0,s),t(2,n),t(6,o),t(5,l)}return r.$$set=d=>{"id"in d&&t(2,n=d.id),"dateSymbol"in d&&t(3,i=d.dateSymbol),"date"in d&&t(0,s=d.date),"isDateValid"in d&&t(1,a=d.isDateValid),"forwardOnly"in d&&t(6,o=d.forwardOnly),"accesskey"in d&&t(4,u=d.accesskey)},r.$$.update=()=>{if(r.$$.dirty&101){e:t(0,s=Bu(s)),t(5,l=sv(n,s,o)),t(1,a=!l.includes("invalid"))}},[s,a,n,i,u,l,o,c]}var Vm=class extends _r{constructor(e){super(),nn(this,e,FN,NN,rn,{id:2,dateSymbol:3,date:0,isDateValid:1,forwardOnly:6,accesskey:4})}},Wi=Vm;var qi=Math.min,jt=Math.max,No=Math.round;var Nn=r=>({x:r,y:r}),LN={left:"right",right:"left",bottom:"top",top:"bottom"},UN={start:"end",end:"start"};function zm(r,e,t){return jt(r,qi(e,t))}function As(r,e){return typeof r=="function"?r(e):r}function In(r){return r.split("-")[0]}function Ps(r){return r.split("-")[1]}function Km(r){return r==="x"?"y":"x"}function Qm(r){return r==="y"?"height":"width"}function Ns(r){return["top","bottom"].includes(In(r))?"y":"x"}function Xm(r){return Km(Ns(r))}function Uv(r,e,t){t===void 0&&(t=!1);let n=Ps(r),i=Xm(r),s=Qm(i),a=i==="x"?n===(t?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(a=Po(a)),[a,Po(a)]}function Wv(r){let e=Po(r);return[hl(r),e,hl(e)]}function hl(r){return r.replace(/start|end/g,e=>UN[e])}function WN(r,e,t){let n=["left","right"],i=["right","left"],s=["top","bottom"],a=["bottom","top"];switch(r){case"top":case"bottom":return t?e?i:n:e?n:i;case"left":case"right":return e?s:a;default:return[]}}function qv(r,e,t,n){let i=Ps(r),s=WN(In(r),t==="start",n);return i&&(s=s.map(a=>a+"-"+i),e&&(s=s.concat(s.map(hl)))),s}function Po(r){return r.replace(/left|right|bottom|top/g,e=>LN[e])}function qN(r){return Q({top:0,right:0,bottom:0,left:0},r)}function $v(r){return typeof r!="number"?qN(r):{top:r,right:r,bottom:r,left:r}}function $i(r){return _e(Q({},r),{top:r.y,left:r.x,right:r.x+r.width,bottom:r.y+r.height})}function jv(r,e,t){let{reference:n,floating:i}=r,s=Ns(e),a=Xm(e),o=Qm(a),u=In(e),l=s==="y",c=n.x+n.width/2-i.width/2,d=n.y+n.height/2-i.height/2,f=n[o]/2-i[o]/2,m;switch(u){case"top":m={x:c,y:n.y-i.height};break;case"bottom":m={x:c,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:d};break;case"left":m={x:n.x-i.width,y:d};break;default:m={x:n.x,y:n.y}}switch(Ps(e)){case"start":m[a]-=f*(t&&l?-1:1);break;case"end":m[a]+=f*(t&&l?-1:1);break}return m}var Gv=(r,e,t)=>N(void 0,null,function*(){let{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:a}=t,o=s.filter(Boolean),u=yield a.isRTL==null?void 0:a.isRTL(e),l=yield a.getElementRects({reference:r,floating:e,strategy:i}),{x:c,y:d}=jv(l,n,u),f=n,m={},g=0;for(let T=0;T<o.length;T++){let{name:y,fn:E}=o[T],{x,y:R,data:$,reset:q}=yield E({x:c,y:d,initialPlacement:n,placement:f,strategy:i,middlewareData:m,rects:l,platform:a,elements:{reference:r,floating:e}});if(c=x!=null?x:c,d=R!=null?R:d,m=_e(Q({},m),{[y]:Q(Q({},m[y]),$)}),q&&g<=50){g++,typeof q=="object"&&(q.placement&&(f=q.placement),q.rects&&(l=q.rects===!0?yield a.getElementRects({reference:r,floating:e,strategy:i}):q.rects),{x:c,y:d}=jv(l,f,u)),T=-1;continue}}return{x:c,y:d,placement:f,strategy:i,middlewareData:m}});function gl(r,e){return N(this,null,function*(){var t;e===void 0&&(e={});let{x:n,y:i,platform:s,rects:a,elements:o,strategy:u}=r,{boundary:l="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:m=0}=As(e,r),g=$v(m),y=o[f?d==="floating"?"reference":"floating":d],E=$i(yield s.getClippingRect({element:(t=yield s.isElement==null?void 0:s.isElement(y))==null||t?y:y.contextElement||(yield s.getDocumentElement==null?void 0:s.getDocumentElement(o.floating)),boundary:l,rootBoundary:c,strategy:u})),x=d==="floating"?_e(Q({},a.floating),{x:n,y:i}):a.reference,R=yield s.getOffsetParent==null?void 0:s.getOffsetParent(o.floating),$=(yield s.isElement==null?void 0:s.isElement(R))?(yield s.getScale==null?void 0:s.getScale(R))||{x:1,y:1}:{x:1,y:1},q=$i(s.convertOffsetParentRelativeRectToViewportRelativeRect?yield s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:x,offsetParent:R,strategy:u}):x);return{top:(E.top-q.top+g.top)/$.y,bottom:(q.bottom-E.bottom+g.bottom)/$.y,left:(E.left-q.left+g.left)/$.x,right:(q.right-E.right+g.right)/$.x}})}var Zm=function(r){return r===void 0&&(r={}),{name:"flip",options:r,fn(t){return N(this,null,function*(){var n,i;let{placement:s,middlewareData:a,rects:o,initialPlacement:u,platform:l,elements:c}=t,O=As(r,t),{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:T="none",flipAlignment:y=!0}=O,E=Xo(O,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((n=a.arrow)!=null&&n.alignmentOffset)return{};let x=In(s),R=In(u)===u,$=yield l.isRTL==null?void 0:l.isRTL(c.floating),q=m||(R||!y?[Po(u)]:Wv(u));!m&&T!=="none"&&q.push(...qv(u,y,T,$));let ne=[u,...q],B=yield gl(t,E),G=[],Te=((i=a.flip)==null?void 0:i.overflows)||[];if(d&&G.push(B[x]),f){let H=Uv(s,o,$);G.push(B[H[0]],B[H[1]])}if(Te=[...Te,{placement:s,overflows:G}],!G.every(H=>H<=0)){var Pe,j;let H=(((Pe=a.flip)==null?void 0:Pe.index)||0)+1,U=ne[H];if(U)return{data:{index:H,overflows:Te},reset:{placement:U}};let Z=(j=Te.filter(p=>p.overflows[0]<=0).sort((p,h)=>p.overflows[1]-h.overflows[1])[0])==null?void 0:j.placement;if(!Z)switch(g){case"bestFit":{var W;let p=(W=Te.map(h=>[h.placement,h.overflows.filter(b=>b>0).reduce((b,_)=>b+_,0)]).sort((h,b)=>h[1]-b[1])[0])==null?void 0:W[0];p&&(Z=p);break}case"initialPlacement":Z=u;break}if(s!==Z)return{reset:{placement:Z}}}return{}})}}};function $N(r,e){return N(this,null,function*(){let{placement:t,platform:n,elements:i}=r,s=yield n.isRTL==null?void 0:n.isRTL(i.floating),a=In(t),o=Ps(t),u=Ns(t)==="y",l=["left","top"].includes(a)?-1:1,c=s&&u?-1:1,d=As(e,r),{mainAxis:f,crossAxis:m,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:Q({mainAxis:0,crossAxis:0,alignmentAxis:null},d);return o&&typeof g=="number"&&(m=o==="end"?g*-1:g),u?{x:m*c,y:f*l}:{x:f*l,y:m*c}})}var yl=function(r){return r===void 0&&(r=0),{name:"offset",options:r,fn(t){return N(this,null,function*(){var n,i;let{x:s,y:a,placement:o,middlewareData:u}=t,l=yield $N(t,r);return o===((n=u.offset)==null?void 0:n.placement)&&(i=u.arrow)!=null&&i.alignmentOffset?{}:{x:s+l.x,y:a+l.y,data:_e(Q({},l),{placement:o})}})}}},bl=function(r){return r===void 0&&(r={}),{name:"shift",options:r,fn(t){return N(this,null,function*(){let{x:n,y:i,placement:s}=t,E=As(r,t),{mainAxis:a=!0,crossAxis:o=!1,limiter:u={fn:x=>{let{x:R,y:$}=x;return{x:R,y:$}}}}=E,l=Xo(E,["mainAxis","crossAxis","limiter"]),c={x:n,y:i},d=yield gl(t,l),f=Ns(In(s)),m=Km(f),g=c[m],T=c[f];if(a){let x=m==="y"?"top":"left",R=m==="y"?"bottom":"right",$=g+d[x],q=g-d[R];g=zm($,g,q)}if(o){let x=f==="y"?"top":"left",R=f==="y"?"bottom":"right",$=T+d[x],q=T-d[R];T=zm($,T,q)}let y=u.fn(_e(Q({},t),{[m]:g,[f]:T}));return _e(Q({},y),{data:{x:y.x-n,y:y.y-i}})})}}};var Jm=function(r){return r===void 0&&(r={}),{name:"size",options:r,fn(t){return N(this,null,function*(){let{placement:n,rects:i,platform:s,elements:a}=t,B=As(r,t),{apply:o=()=>{}}=B,u=Xo(B,["apply"]),l=yield gl(t,u),c=In(n),d=Ps(n),f=Ns(n)==="y",{width:m,height:g}=i.floating,T,y;c==="top"||c==="bottom"?(T=c,y=d===((yield s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(y=c,T=d==="end"?"top":"bottom");let E=g-l[T],x=m-l[y],R=!t.middlewareData.shift,$=E,q=x;if(f){let G=m-l.left-l.right;q=d||R?qi(x,G):G}else{let G=g-l.top-l.bottom;$=d||R?qi(E,G):G}if(R&&!d){let G=jt(l.left,0),Te=jt(l.right,0),Pe=jt(l.top,0),j=jt(l.bottom,0);f?q=m-2*(G!==0||Te!==0?G+Te:jt(l.left,l.right)):$=g-2*(Pe!==0||j!==0?Pe+j:jt(l.top,l.bottom))}yield o(_e(Q({},t),{availableWidth:q,availableHeight:$}));let ne=yield s.getDimensions(a.floating);return m!==ne.width||g!==ne.height?{reset:{rects:!0}}:{}})}}};function Fn(r){return Bv(r)?(r.nodeName||"").toLowerCase():"#document"}function Gt(r){var e;return(r==null||(e=r.ownerDocument)==null?void 0:e.defaultView)||window}function Ln(r){var e;return(e=(Bv(r)?r.ownerDocument:r.document)||window.document)==null?void 0:e.documentElement}function Bv(r){return r instanceof Node||r instanceof Gt(r).Node}function sn(r){return r instanceof Element||r instanceof Gt(r).Element}function Ur(r){return r instanceof HTMLElement||r instanceof Gt(r).HTMLElement}function Yv(r){return typeof ShadowRoot=="undefined"?!1:r instanceof ShadowRoot||r instanceof Gt(r).ShadowRoot}function Is(r){let{overflow:e,overflowX:t,overflowY:n,display:i}=nr(r);return/auto|scroll|overlay|hidden|clip/.test(e+n+t)&&!["inline","contents"].includes(i)}function Hv(r){return["table","td","th"].includes(Fn(r))}function _l(r){let e=vl(),t=nr(r);return t.transform!=="none"||t.perspective!=="none"||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(t.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(t.contain||"").includes(n))}function Vv(r){let e=ji(r);for(;Ur(e)&&!Io(e);){if(_l(e))return e;e=ji(e)}return null}function vl(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Io(r){return["html","body","#document"].includes(Fn(r))}function nr(r){return Gt(r).getComputedStyle(r)}function Fo(r){return sn(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:{scrollLeft:r.pageXOffset,scrollTop:r.pageYOffset}}function ji(r){if(Fn(r)==="html")return r;let e=r.assignedSlot||r.parentNode||Yv(r)&&r.host||Ln(r);return Yv(e)?e.host:e}function zv(r){let e=ji(r);return Io(e)?r.ownerDocument?r.ownerDocument.body:r.body:Ur(e)&&Is(e)?e:zv(e)}function Tl(r,e,t){var n;e===void 0&&(e=[]),t===void 0&&(t=!0);let i=zv(r),s=i===((n=r.ownerDocument)==null?void 0:n.body),a=Gt(i);return s?e.concat(a,a.visualViewport||[],Is(i)?i:[],a.frameElement&&t?Tl(a.frameElement):[]):e.concat(i,Tl(i,[],t))}function Xv(r){let e=nr(r),t=parseFloat(e.width)||0,n=parseFloat(e.height)||0,i=Ur(r),s=i?r.offsetWidth:t,a=i?r.offsetHeight:n,o=No(t)!==s||No(n)!==a;return o&&(t=s,n=a),{width:t,height:n,$:o}}function Zv(r){return sn(r)?r:r.contextElement}function Fs(r){let e=Zv(r);if(!Ur(e))return Nn(1);let t=e.getBoundingClientRect(),{width:n,height:i,$:s}=Xv(e),a=(s?No(t.width):t.width)/n,o=(s?No(t.height):t.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}var jN=Nn(0);function Jv(r){let e=Gt(r);return!vl()||!e.visualViewport?jN:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function GN(r,e,t){return e===void 0&&(e=!1),!t||e&&t!==Gt(r)?!1:e}function Lo(r,e,t,n){e===void 0&&(e=!1),t===void 0&&(t=!1);let i=r.getBoundingClientRect(),s=Zv(r),a=Nn(1);e&&(n?sn(n)&&(a=Fs(n)):a=Fs(r));let o=GN(s,t,n)?Jv(s):Nn(0),u=(i.left+o.x)/a.x,l=(i.top+o.y)/a.y,c=i.width/a.x,d=i.height/a.y;if(s){let f=Gt(s),m=n&&sn(n)?Gt(n):n,g=f.frameElement;for(;g&&n&&m!==f;){let T=Fs(g),y=g.getBoundingClientRect(),E=nr(g),x=y.left+(g.clientLeft+parseFloat(E.paddingLeft))*T.x,R=y.top+(g.clientTop+parseFloat(E.paddingTop))*T.y;u*=T.x,l*=T.y,c*=T.x,d*=T.y,u+=x,l+=R,g=Gt(g).frameElement}}return $i({width:c,height:d,x:u,y:l})}function YN(r){let{rect:e,offsetParent:t,strategy:n}=r,i=Ur(t),s=Ln(t);if(t===s)return e;let a={scrollLeft:0,scrollTop:0},o=Nn(1),u=Nn(0);if((i||!i&&n!=="fixed")&&((Fn(t)!=="body"||Is(s))&&(a=Fo(t)),Ur(t))){let l=Lo(t);o=Fs(t),u.x=l.x+t.clientLeft,u.y=l.y+t.clientTop}return{width:e.width*o.x,height:e.height*o.y,x:e.x*o.x-a.scrollLeft*o.x+u.x,y:e.y*o.y-a.scrollTop*o.y+u.y}}function BN(r){return Array.from(r.getClientRects())}function ew(r){return Lo(Ln(r)).left+Fo(r).scrollLeft}function HN(r){let e=Ln(r),t=Fo(r),n=r.ownerDocument.body,i=jt(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=jt(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+ew(r),o=-t.scrollTop;return nr(n).direction==="rtl"&&(a+=jt(e.clientWidth,n.clientWidth)-i),{width:i,height:s,x:a,y:o}}function VN(r,e){let t=Gt(r),n=Ln(r),i=t.visualViewport,s=n.clientWidth,a=n.clientHeight,o=0,u=0;if(i){s=i.width,a=i.height;let l=vl();(!l||l&&e==="fixed")&&(o=i.offsetLeft,u=i.offsetTop)}return{width:s,height:a,x:o,y:u}}function zN(r,e){let t=Lo(r,!0,e==="fixed"),n=t.top+r.clientTop,i=t.left+r.clientLeft,s=Ur(r)?Fs(r):Nn(1),a=r.clientWidth*s.x,o=r.clientHeight*s.y,u=i*s.x,l=n*s.y;return{width:a,height:o,x:u,y:l}}function Kv(r,e,t){let n;if(e==="viewport")n=VN(r,t);else if(e==="document")n=HN(Ln(r));else if(sn(e))n=zN(e,t);else{let i=Jv(r);n=_e(Q({},e),{x:e.x-i.x,y:e.y-i.y})}return $i(n)}function tw(r,e){let t=ji(r);return t===e||!sn(t)||Io(t)?!1:nr(t).position==="fixed"||tw(t,e)}function KN(r,e){let t=e.get(r);if(t)return t;let n=Tl(r,[],!1).filter(o=>sn(o)&&Fn(o)!=="body"),i=null,s=nr(r).position==="fixed",a=s?ji(r):r;for(;sn(a)&&!Io(a);){let o=nr(a),u=_l(a);!u&&o.position==="fixed"&&(i=null),(s?!u&&!i:!u&&o.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Is(a)&&!u&&tw(r,a))?n=n.filter(c=>c!==a):i=o,a=ji(a)}return e.set(r,n),n}function QN(r){let{element:e,boundary:t,rootBoundary:n,strategy:i}=r,a=[...t==="clippingAncestors"?KN(e,this._c):[].concat(t),n],o=a[0],u=a.reduce((l,c)=>{let d=Kv(e,c,i);return l.top=jt(d.top,l.top),l.right=qi(d.right,l.right),l.bottom=qi(d.bottom,l.bottom),l.left=jt(d.left,l.left),l},Kv(e,o,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function XN(r){return Xv(r)}function ZN(r,e,t){let n=Ur(e),i=Ln(e),s=t==="fixed",a=Lo(r,!0,s,e),o={scrollLeft:0,scrollTop:0},u=Nn(0);if(n||!n&&!s)if((Fn(e)!=="body"||Is(i))&&(o=Fo(e)),n){let l=Lo(e,!0,s,e);u.x=l.x+e.clientLeft,u.y=l.y+e.clientTop}else i&&(u.x=ew(i));return{x:a.left+o.scrollLeft-u.x,y:a.top+o.scrollTop-u.y,width:a.width,height:a.height}}function Qv(r,e){return!Ur(r)||nr(r).position==="fixed"?null:e?e(r):r.offsetParent}function rw(r,e){let t=Gt(r);if(!Ur(r))return t;let n=Qv(r,e);for(;n&&Hv(n)&&nr(n).position==="static";)n=Qv(n,e);return n&&(Fn(n)==="html"||Fn(n)==="body"&&nr(n).position==="static"&&!_l(n))?t:n||Vv(r)||t}var JN=function(r){return N(this,null,function*(){let{reference:e,floating:t,strategy:n}=r,i=this.getOffsetParent||rw,s=this.getDimensions;return{reference:ZN(e,yield i(t),n),floating:Q({x:0,y:0},yield s(t))}})};function eI(r){return nr(r).direction==="rtl"}var tI={convertOffsetParentRelativeRectToViewportRelativeRect:YN,getDocumentElement:Ln,getClippingRect:QN,getOffsetParent:rw,getElementRects:JN,getClientRects:BN,getDimensions:XN,getScale:Fs,isElement:sn,isRTL:eI};var eh=(r,e,t)=>{let n=new Map,i=Q({platform:tI},t),s=_e(Q({},i.platform),{_c:n});return Gv(r,e,_e(Q({},i),{platform:s}))};function nw(r,e,t){let n=r.slice();return n[5]=e[t],n}function iw(r,e,t){let n=r.slice();n[40]=e[t],n[43]=t;let i=n[17](n[40].taskLocation.path);return n[41]=i,n}function sw(r){let e,t,n,i=r[10],s=[];for(let a=0;a<i.length;a+=1)s[a]=ow(iw(r,i,a));return{c(){e=K("ul");for(let a=0;a<s.length;a+=1)s[a].c();L(e,"class","task-dependency-dropdown")},m(a,o){de(a,e,o);for(let u=0;u<s.length;u+=1)s[u]&&s[u].m(e,null);r[31](e),t||(n=xe(e,"mouseleave",r[32]),t=!0)},p(a,o){if(o[0]&928832){i=a[10];let u;for(u=0;u<i.length;u+=1){let l=iw(a,i,u);s[u]?s[u].p(l,o):(s[u]=ow(l),s[u].c(),s[u].m(e,null))}for(;u<s.length;u+=1)s[u].d(1);s.length=i.length}},d(a){a&&ae(e),Ui(s,a),r[31](null),t=!1,n()}}}function aw(r){let e,t=r[41]+"",n,i,s;function a(...o){return r[28](r[41],...o)}return{c(){e=K("div"),n=Me(t),L(e,"class","dependency-path")},m(o,u){de(o,e,u),F(e,n),i||(s=xe(e,"mouseenter",a),i=!0)},p(o,u){r=o,u[0]&1024&&t!==(t=r[41]+"")&&Fr(n,t)},d(o){o&&ae(e),i=!1,s()}}}function ow(r){let e,t,n,i=r[40].status.symbol+"",s,a,o=Ni(r[40])+"",u,l,c,d,f,m;function g(...x){return r[27](r[40],...x)}let T=r[41]&&aw(r);function y(){return r[29](r[40])}function E(){return r[30](r[43])}return{c(){e=K("li"),t=K("div"),n=Me("["),s=Me(i),a=Me("] "),u=Me(o),c=oe(),T&&T.c(),d=oe(),L(t,"class",l=r[41]?"dependency-name-shared":"dependency-name"),Pn(e,"selected",r[6]!==null&&r[43]===r[11])},m(x,R){de(x,e,R),F(e,t),F(t,n),F(t,s),F(t,a),F(t,u),F(e,c),T&&T.m(e,null),F(e,d),f||(m=[xe(t,"mouseenter",g),xe(e,"mousedown",y),xe(e,"mouseenter",E)],f=!0)},p(x,R){r=x,R[0]&1024&&i!==(i=r[40].status.symbol+"")&&Fr(s,i),R[0]&1024&&o!==(o=Ni(r[40])+"")&&Fr(u,o),R[0]&1024&&l!==(l=r[41]?"dependency-name-shared":"dependency-name")&&L(t,"class",l),r[41]?T?T.p(r,R):(T=aw(r),T.c(),T.m(e,d)):T&&(T.d(1),T=null),R[0]&2112&&Pn(e,"selected",r[6]!==null&&r[43]===r[11])},d(x){x&&ae(e),T&&T.d(),f=!1,qt(m)}}}function uw(r){let e,t=r[0][r[1]],n=[];for(let i=0;i<t.length;i+=1)n[i]=lw(nw(r,t,i));return{c(){e=K("div");for(let i=0;i<n.length;i+=1)n[i].c();L(e,"class","task-dependencies-container results-dependency")},m(i,s){de(i,e,s);for(let a=0;a<n.length;a+=1)n[a]&&n[a].m(e,null)},p(i,s){if(s[0]&802819){t=i[0][i[1]];let a;for(a=0;a<t.length;a+=1){let o=nw(i,t,a);n[a]?n[a].p(o,s):(n[a]=lw(o),n[a].c(),n[a].m(e,null))}for(;a<n.length;a+=1)n[a].d(1);n.length=t.length}},d(i){i&&ae(e),Ui(n,i)}}}function lw(r){let e,t,n,i=r[5].status.symbol+"",s,a,o=Ni(r[5])+"",u,l,c,d,f,m;function g(){return r[33](r[5])}function T(...y){return r[34](r[5],...y)}return{c(){e=K("div"),t=K("span"),n=Me("["),s=Me(i),a=Me("] "),u=Me(o),l=oe(),c=K("button"),c.innerHTML='<svg style="display: block; margin: auto;" xmlns="http://www.w3.org/2000/svg" width="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-x"><path d="M18 6 6 18"></path><path d="m6 6 12 12"></path></svg>',d=oe(),L(t,"class","task-dependency-name"),L(c,"type","button"),L(c,"class","task-dependency-delete"),L(e,"class","task-dependency")},m(y,E){de(y,e,E),F(e,t),F(t,n),F(t,s),F(t,a),F(t,u),F(e,l),F(e,c),F(e,d),f||(m=[xe(c,"click",g),xe(e,"mouseenter",T)],f=!0)},p(y,E){r=y,E[0]&3&&i!==(i=r[5].status.symbol+"")&&Fr(s,i),E[0]&3&&o!==(o=Ni(r[5])+"")&&Fr(u,o)},d(y){y&&ae(e),f=!1,qt(m)}}}function rI(r){let e,t=gt(r[2],r[3])+"",n,i,s,a,o,u,l,c,d,f=r[10]&&r[10].length!==0&&sw(r),m=r[0][r[1]].length!==0&&uw(r);return{c(){e=K("label"),n=oe(),i=K("span"),s=K("input"),o=oe(),f&&f.c(),u=oe(),m&&m.c(),l=Ev(),L(e,"for",r[1]),L(s,"accesskey",r[3]),L(s,"id",r[1]),L(s,"class","tasks-modal-dependency-input"),L(s,"type","text"),L(s,"placeholder",r[4]),Li(()=>r[26].call(i))},m(g,T){de(g,e,T),e.innerHTML=t,de(g,n,T),de(g,i,T),F(i,s),r[22](s),vr(s,r[6]),a=xv(i,r[26].bind(i)),de(g,o,T),f&&f.m(g,T),de(g,u,T),m&&m.m(g,T),de(g,l,T),c||(d=[xe(s,"input",r[23]),xe(s,"keydown",r[24]),xe(s,"focus",r[16]),xe(s,"blur",r[25])],c=!0)},p(g,T){T[0]&12&&t!==(t=gt(g[2],g[3])+"")&&(e.innerHTML=t),T[0]&2&&L(e,"for",g[1]),T[0]&8&&L(s,"accesskey",g[3]),T[0]&2&&L(s,"id",g[1]),T[0]&16&&L(s,"placeholder",g[4]),T[0]&64&&s.value!==g[6]&&vr(s,g[6]),g[10]&&g[10].length!==0?f?f.p(g,T):(f=sw(g),f.c(),f.m(u.parentNode,u)):f&&(f.d(1),f=null),g[0][g[1]].length!==0?m?m.p(g,T):(m=uw(g),m.c(),m.m(l.parentNode,l)):m&&(m.d(1),m=null)},i:Ue,o:Ue,d(g){g&&ae(e),g&&ae(n),g&&ae(i),r[22](null),a(),g&&ae(o),f&&f.d(g),g&&ae(u),m&&m.d(g),g&&ae(l),c=!1,qt(d)}}}function nI(r,e,t){let{task:n}=e,{editableTask:i}=e,{allTasks:s}=e,{_onDescriptionKeyDown:a}=e,{type:o}=e,{labelText:u}=e,{accesskey:l}=e,{placeholder:c="Type to search..."}=e,d="",f=null,m=0,g,T=!1,y=!1,E,x;function R(v){t(0,i[o]=[...i[o],v],i),t(6,d=""),t(7,T=!1)}function $(v){t(0,i[o]=i[o].filter(D=>D!==v),i)}function q(v){var D;if(f!==null){switch(v.key){case"ArrowUp":v.preventDefault(),!!m&&m>0?t(11,m-=1):t(11,m=f.length-1);break;case"ArrowDown":v.preventDefault(),!!m&&m<f.length-1?t(11,m+=1):t(11,m=0);break;case"Enter":m!==null?(v.preventDefault(),R(f[m]),t(11,m=null),t(7,T=!1)):a(v);break;default:t(11,m=0);break}m&&((D=x==null?void 0:x.getElementsByTagName("li")[m])===null||D===void 0||D.scrollIntoView({block:"nearest"}))}}function ne(v){return!v&&!y?[]:(y=!1,rl(v,s,n,i.blockedBy,i.blocking))}function B(){t(7,T=!0),y=!0}function G(v,D){!v||!D||eh(v,D,{middleware:[yl(6),bl(),Zm(),Jm({apply(){D&&Object.assign(D.style,{width:`${g}px`})}})]}).then(({x:P,y:re})=>{D.style.left=`${P}px`,D.style.top=`${re}px`})}function Te(v){return v===n.taskLocation.path?"":v}function Pe(v){return Ni(v)}function j(v,D){let P=v.createDiv();P.addClasses(["tooltip","pop-up"]),P.innerText=D,eh(v,P,{placement:"top",middleware:[yl(-18),bl()]}).then(({x:re,y:le})=>{P.style.left=`${re}px`,P.style.top=`${le}px`}),v.addEventListener("mouseleave",()=>P.remove())}function W(v){Ye[v?"unshift":"push"](()=>{E=v,t(8,E)})}function O(){d=this.value,t(6,d)}let H=v=>q(v),U=()=>t(7,T=!1);function Z(){g=this.clientWidth,t(12,g)}let p=(v,D)=>j(D.currentTarget,Pe(v)),h=(v,D)=>j(D.currentTarget,v),b=v=>R(v),_=v=>t(11,m=v);function w(v){Ye[v?"unshift":"push"](()=>{x=v,t(9,x)})}let S=()=>t(11,m=null),M=v=>$(v),A=(v,D)=>j(D.currentTarget,Pe(v));return r.$$set=v=>{"task"in v&&t(5,n=v.task),"editableTask"in v&&t(0,i=v.editableTask),"allTasks"in v&&t(20,s=v.allTasks),"_onDescriptionKeyDown"in v&&t(21,a=v._onDescriptionKeyDown),"type"in v&&t(1,o=v.type),"labelText"in v&&t(2,u=v.labelText),"accesskey"in v&&t(3,l=v.accesskey),"placeholder"in v&&t(4,c=v.placeholder)},r.$$.update=()=>{if(r.$$.dirty[0]&768){e:G(E,x)}if(r.$$.dirty[0]&192){e:t(10,f=T?ne(d):null)}},[i,o,u,l,c,n,d,T,E,x,f,m,g,R,$,q,B,Te,Pe,j,s,a,W,O,H,U,Z,p,h,b,_,w,S,M,A]}var th=class extends _r{constructor(e){super(),nn(this,e,nI,rI,rn,{task:5,editableTask:0,allTasks:20,_onDescriptionKeyDown:21,type:1,labelText:2,accesskey:3,placeholder:4},null,[-1,-1])}},rh=th;function iI(r){let e,t=gt("Recurs",r[2])+"",n,i,s,a,o,u,l,c,d;return{c(){e=K("label"),n=oe(),i=K("input"),s=oe(),a=K("code"),o=Me(r[4]),u=oe(),l=new Ms(!1),L(e,"for","recurrence"),L(i,"id","recurrence"),L(i,"type","text"),L(i,"class","tasks-modal-date-input"),L(i,"placeholder","Try 'every day when done'"),L(i,"accesskey",r[2]),Pn(i,"tasks-modal-error",!r[1]),l.a=null,L(a,"class","tasks-modal-parsed-date")},m(f,m){de(f,e,m),e.innerHTML=t,de(f,n,m),de(f,i,m),vr(i,r[0].recurrenceRule),de(f,s,m),de(f,a,m),F(a,o),F(a,u),l.m(r[3],a),c||(d=xe(i,"input",r[5]),c=!0)},p(f,[m]){m&4&&t!==(t=gt("Recurs",f[2])+"")&&(e.innerHTML=t),m&4&&L(i,"accesskey",f[2]),m&1&&i.value!==f[0].recurrenceRule&&vr(i,f[0].recurrenceRule),m&2&&Pn(i,"tasks-modal-error",!f[1]),m&8&&l.p(f[3])},i:Ue,o:Ue,d(f){f&&ae(e),f&&ae(n),f&&ae(i),f&&ae(s),f&&ae(a),c=!1,d()}}}function sI(r,e,t){let{editableTask:n}=e,{isRecurrenceValid:i}=e,{accesskey:s}=e,a,{recurrenceSymbol:o}=Nr.tasksPluginEmoji.taskSerializer.symbols;function u(){n.recurrenceRule=this.value,t(0,n)}return r.$$set=l=>{"editableTask"in l&&t(0,n=l.editableTask),"isRecurrenceValid"in l&&t(1,i=l.isRecurrenceValid),"accesskey"in l&&t(2,s=l.accesskey)},r.$$.update=()=>{if(r.$$.dirty&1){e:t(3,{parsedRecurrence:a,isRecurrenceValid:i}=Lv(n),a,(t(1,i),t(0,n)))}},[n,i,s,a,o,u]}var nh=class extends _r{constructor(e){super(),nn(this,e,sI,iI,rn,{editableTask:0,isRecurrenceValid:1,accesskey:2})}},cw=nh;function dw(r,e,t){let n=r.slice();return n[7]=e[t],n}function fw(r){let e,t=r[7].name+"",n,i,s=r[7].symbol+"",a,o,u;return{c(){e=K("option"),n=Me(t),i=Me(" ["),a=Me(s),o=Me("]"),e.__value=u=r[7].symbol,e.value=e.__value},m(l,c){de(l,e,c),F(e,n),F(e,i),F(e,a),F(e,o)},p(l,c){c&1&&t!==(t=l[7].name+"")&&Fr(n,t),c&1&&s!==(s=l[7].symbol+"")&&Fr(a,s),c&1&&u!==(u=l[7].symbol)&&(e.__value=u,e.value=e.__value)},d(l){l&&ae(e)}}}function aI(r){let e,t=gt("Status",r[1])+"",n,i,s,a,o=r[0],u=[];for(let l=0;l<o.length;l+=1)u[l]=fw(dw(r,o,l));return{c(){e=K("label"),n=oe(),i=K("select");for(let l=0;l<u.length;l+=1)u[l].c();L(e,"for","status"),L(i,"id","status-type"),L(i,"class","status-editor-status-selector"),L(i,"accesskey",r[1]),r[2]===void 0&&Li(()=>r[6].call(i))},m(l,c){de(l,e,c),e.innerHTML=t,de(l,n,c),de(l,i,c);for(let d=0;d<u.length;d+=1)u[d]&&u[d].m(i,null);$m(i,r[2],!0),s||(a=[xe(i,"change",r[6]),xe(i,"change",r[3])],s=!0)},p(l,[c]){if(c&2&&t!==(t=gt("Status",l[1])+"")&&(e.innerHTML=t),c&1){o=l[0];let d;for(d=0;d<o.length;d+=1){let f=dw(l,o,d);u[d]?u[d].p(f,c):(u[d]=fw(f),u[d].c(),u[d].m(i,null))}for(;d<u.length;d+=1)u[d].d(1);u.length=o.length}c&2&&L(i,"accesskey",l[1]),c&5&&$m(i,l[2])},i:Ue,o:Ue,d(l){l&&ae(e),l&&ae(n),l&&ae(i),Ui(u,l),s=!1,qt(a)}}}function oI(r,e,t){let{task:n}=e,{editableTask:i}=e,{statusOptions:s}=e,{accesskey:a}=e,o=n.status.symbol,u=()=>{let c=s.find(f=>f.symbol===o);if(c)t(4,i.status=c,i);else{console.log(`Error in EditTask: cannot find status with symbol ${o}`);return}let d=n.handleNewStatus(c).pop();d&&(t(4,i.doneDate=d.done.formatAsDate(),i),t(4,i.cancelledDate=d.cancelled.formatAsDate(),i))};function l(){o=Dv(this),t(2,o),t(0,s)}return r.$$set=c=>{"task"in c&&t(5,n=c.task),"editableTask"in c&&t(4,i=c.editableTask),"statusOptions"in c&&t(0,s=c.statusOptions),"accesskey"in c&&t(1,a=c.accesskey)},[s,a,o,u,i,n,l]}var ih=class extends _r{constructor(e){super(),nn(this,e,oI,aI,rn,{task:5,editableTask:4,statusOptions:0,accesskey:1})}},pw=ih;function mw(r,e,t){let n=r.slice();return n[52]=e[t].value,n[53]=e[t].label,n[54]=e[t].symbol,n[55]=e[t].accessKey,n[56]=e[t].accessKeyIndex,n}function uI(r){let e,t=r[53]+"",n;return{c(){e=K("span"),n=Me(t)},m(i,s){de(i,e,s),F(e,n)},p:Ue,d(i){i&&ae(e)}}}function lI(r){let e,t=r[53].substring(0,r[56])+"",n,i,s=r[53].substring(r[56],r[56]+1)+"",a,o,u=r[53].substring(r[56]+1)+"",l;return{c(){e=K("span"),n=Me(t),i=K("span"),a=Me(s),o=K("span"),l=Me(u),L(i,"class","accesskey")},m(c,d){de(c,e,d),F(e,n),de(c,i,d),F(i,a),de(c,o,d),F(o,l)},p:Ue,d(c){c&&ae(e),c&&ae(i),c&&ae(o)}}}function cI(r){let e,t=r[54]+"",n;return{c(){e=K("span"),n=Me(t)},m(i,s){de(i,e,s),F(e,n)},p:Ue,d(i){i&&ae(e)}}}function hw(r){let e,t,n,i,s,a,o,u,l=r[54]&&r[54].charCodeAt(0)>=256,c,d,f,m,g;function T(R,$){return R[11]?lI:uI}let y=T(r,[-1,-1]),E=y(r),x=l&&cI(r);return f=Ov(r[32][0]),{c(){e=K("div"),t=K("input"),a=oe(),o=K("label"),E.c(),u=oe(),x&&x.c(),d=oe(),L(t,"type","radio"),L(t,"id",n="priority-"+r[52]),t.__value=i=r[52],t.value=t.__value,L(t,"accesskey",s=r[15](r[55])),L(o,"for",c="priority-"+r[52]),L(e,"class","task-modal-priority-option-container"),f.p(t)},m(R,$){de(R,e,$),F(e,t),t.checked=t.__value===r[3].priority,F(e,a),F(e,o),E.m(o,null),F(o,u),x&&x.m(o,null),F(e,d),m||(g=xe(t,"change",r[31]),m=!0)},p(R,$){$[0]&32768&&s!==(s=R[15](R[55]))&&L(t,"accesskey",s),$[0]&8&&(t.checked=t.__value===R[3].priority),y===(y=T(R,$))&&E?E.p(R,$):(E.d(1),E=y(R),E&&(E.c(),E.m(o,u))),l&&x.p(R,$)},d(R){R&&ae(e),E.d(),x&&x.d(),f.r(),m=!1,g()}}}function dI(r){let e;return{c(){e=K("div"),e.innerHTML="<i>Blocking and blocked by fields are disabled when vault tasks is empty</i>"},m(t,n){de(t,e,n)},p:Ue,i:Ue,o:Ue,d(t){t&&ae(e)}}}function fI(r){let e,t,n,i;return e=new rh({props:{type:"blockedBy",labelText:"Before this",task:r[0],editableTask:r[3],allTasks:r[2],_onDescriptionKeyDown:r[24],accesskey:r[15]("b"),placeholder:"Search for tasks that the task being edited depends on..."}}),n=new rh({props:{type:"blocking",labelText:"After this",task:r[0],editableTask:r[3],allTasks:r[2],_onDescriptionKeyDown:r[24],accesskey:r[15]("e"),placeholder:"Search for tasks that depend on this task being done..."}}),{c(){Lr(e.$$.fragment),t=oe(),Lr(n.$$.fragment)},m(s,a){wr(e,s,a),de(s,t,a),wr(n,s,a),i=!0},p(s,a){let o={};a[0]&1&&(o.task=s[0]),a[0]&8&&(o.editableTask=s[3]),a[0]&4&&(o.allTasks=s[2]),a[0]&32768&&(o.accesskey=s[15]("b")),e.$set(o);let u={};a[0]&1&&(u.task=s[0]),a[0]&8&&(u.editableTask=s[3]),a[0]&4&&(u.allTasks=s[2]),a[0]&32768&&(u.accesskey=s[15]("e")),n.$set(u)},i(s){i||($t(e.$$.fragment,s),$t(n.$$.fragment,s),i=!0)},o(s){tr(e.$$.fragment,s),tr(n.$$.fragment,s),i=!1},d(s){rr(e,s),s&&ae(t),rr(n,s)}}}function pI(r){let e,t,n,i=gt("Description",r[15]("t"))+"",s,a,o,u,l,c,d,f,m,g,T,y,E,x,R,$,q,ne,B,G,Te,Pe,j,W,O,H,U,Z,p,h,b=gt("Only future dates:",r[15]("f"))+"",_,w,S,M,A,v,D,P,re,le,fe,Ne,Ce,It,fn,Gr,St,Ot,Be,V,lt,yt,Ht,Gn,Ft,pn,Zi,Yr,mn,Br,ia,mi,Ji,hi,ur,$e,Yn,es=r[22],Dt=[];for(let C=0;C<es.length;C+=1)Dt[C]=hw(mw(r,es,C));function Ak(C){r[33](C)}let Lh={editableTask:r[3],accesskey:r[15]("r")};r[10]!==void 0&&(Lh.isRecurrenceValid=r[10]),x=new cw({props:Lh}),Ye.push(()=>Pt(x,"isRecurrenceValid",Ak));function Pk(C){r[34](C)}function Nk(C){r[35](C)}let hc={id:"due",dateSymbol:r[18],forwardOnly:r[3].forwardOnly,accesskey:r[15]("d")};r[3].dueDate!==void 0&&(hc.date=r[3].dueDate),r[7]!==void 0&&(hc.isDateValid=r[7]),q=new Wi({props:hc}),Ye.push(()=>Pt(q,"date",Pk)),Ye.push(()=>Pt(q,"isDateValid",Nk));function Ik(C){r[36](C)}function Fk(C){r[37](C)}let gc={id:"scheduled",dateSymbol:r[17],forwardOnly:r[3].forwardOnly,accesskey:r[15]("s")};r[3].scheduledDate!==void 0&&(gc.date=r[3].scheduledDate),r[8]!==void 0&&(gc.isDateValid=r[8]),Te=new Wi({props:gc}),Ye.push(()=>Pt(Te,"date",Ik)),Ye.push(()=>Pt(Te,"isDateValid",Fk));function Lk(C){r[38](C)}function Uk(C){r[39](C)}let yc={id:"start",dateSymbol:r[16],forwardOnly:r[3].forwardOnly,accesskey:r[15]("a")};r[3].startDate!==void 0&&(yc.date=r[3].startDate),r[9]!==void 0&&(yc.isDateValid=r[9]),O=new Wi({props:yc}),Ye.push(()=>Pt(O,"date",Lk)),Ye.push(()=>Pt(O,"isDateValid",Uk));let Uh=[fI,dI],Bn=[];function Wh(C,ee){return C[2].length>0&&C[14]?0:1}P=Wh(r,[-1,-1]),re=Bn[P]=Uh[P](r);function Wk(C){r[41](C)}let qh={task:r[0],statusOptions:r[1],accesskey:r[15]("u")};r[3]!==void 0&&(qh.editableTask=r[3]),It=new pw({props:qh}),Ye.push(()=>Pt(It,"editableTask",Wk));function qk(C){r[42](C)}function $k(C){r[43](C)}let bc={id:"created",dateSymbol:r[20],forwardOnly:r[3].forwardOnly,accesskey:r[15]("c")};r[3].createdDate!==void 0&&(bc.date=r[3].createdDate),r[5]!==void 0&&(bc.isDateValid=r[5]),St=new Wi({props:bc}),Ye.push(()=>Pt(St,"date",qk)),Ye.push(()=>Pt(St,"isDateValid",$k));function jk(C){r[44](C)}function Gk(C){r[45](C)}let Tc={id:"done",dateSymbol:r[21],forwardOnly:r[3].forwardOnly,accesskey:r[15]("x")};r[3].doneDate!==void 0&&(Tc.date=r[3].doneDate),r[6]!==void 0&&(Tc.isDateValid=r[6]),lt=new Wi({props:Tc}),Ye.push(()=>Pt(lt,"date",jk)),Ye.push(()=>Pt(lt,"isDateValid",Gk));function Yk(C){r[46](C)}function Bk(C){r[47](C)}let _c={id:"cancelled",dateSymbol:r[19],forwardOnly:r[3].forwardOnly,accesskey:r[15]("-")};return r[3].cancelledDate!==void 0&&(_c.date=r[3].cancelledDate),r[4]!==void 0&&(_c.isDateValid=r[4]),Ft=new Wi({props:_c}),Ye.push(()=>Pt(Ft,"date",Yk)),Ye.push(()=>Pt(Ft,"isDateValid",Bk)),{c(){e=K("form"),t=K("section"),n=K("label"),s=oe(),a=K("textarea"),u=oe(),l=K("section"),c=K("label"),d=Me("Priority"),m=oe();for(let C=0;C<Dt.length;C+=1)Dt[C].c();g=oe(),T=K("hr"),y=oe(),E=K("section"),Lr(x.$$.fragment),$=oe(),Lr(q.$$.fragment),G=oe(),Lr(Te.$$.fragment),W=oe(),Lr(O.$$.fragment),Z=oe(),p=K("div"),h=K("label"),_=oe(),w=K("input"),M=oe(),A=K("hr"),v=oe(),D=K("section"),re.c(),le=oe(),fe=K("hr"),Ne=oe(),Ce=K("section"),Lr(It.$$.fragment),Gr=oe(),Lr(St.$$.fragment),V=oe(),Lr(lt.$$.fragment),Gn=oe(),Lr(Ft.$$.fragment),Yr=oe(),mn=K("section"),Br=K("button"),ia=Me("Apply"),Ji=oe(),hi=K("button"),hi.textContent="Cancel",L(n,"for","description"),L(a,"id","description"),L(a,"class","tasks-modal-description"),L(a,"placeholder","Take out the trash"),L(a,"accesskey",o=r[15]("t")),L(t,"class","tasks-modal-description-section"),L(c,"for",f="priority-"+r[3].priority),L(l,"class","tasks-modal-priority-section"),L(h,"for","forwardOnly"),L(w,"id","forwardOnly"),L(w,"type","checkbox"),L(w,"class","task-list-item-checkbox tasks-modal-checkbox"),L(w,"accesskey",S=r[15]("f")),L(p,"class","future-dates-only"),L(E,"class","tasks-modal-dates-section"),L(D,"class","tasks-modal-dependencies-section"),L(Ce,"class","tasks-modal-dates-section"),Br.disabled=mi=!r[13],L(Br,"type","submit"),L(Br,"class","mod-cta"),L(hi,"type","button"),L(mn,"class","tasks-modal-button-section"),L(e,"class","tasks-modal")},m(C,ee){de(C,e,ee),F(e,t),F(t,n),n.innerHTML=i,F(t,s),F(t,a),vr(a,r[3].description),r[30](a),F(e,u),F(e,l),F(l,c),F(c,d),F(l,m);for(let hn=0;hn<Dt.length;hn+=1)Dt[hn]&&Dt[hn].m(l,null);F(e,g),F(e,T),F(e,y),F(e,E),wr(x,E,null),F(E,$),wr(q,E,null),F(E,G),wr(Te,E,null),F(E,W),wr(O,E,null),F(E,Z),F(E,p),F(p,h),h.innerHTML=b,F(p,_),F(p,w),w.checked=r[3].forwardOnly,F(e,M),F(e,A),F(e,v),F(e,D),Bn[P].m(D,null),F(e,le),F(e,fe),F(e,Ne),F(e,Ce),wr(It,Ce,null),F(Ce,Gr),wr(St,Ce,null),F(Ce,V),wr(lt,Ce,null),F(Ce,Gn),wr(Ft,Ce,null),F(e,Yr),F(e,mn),F(mn,Br),F(Br,ia),F(mn,Ji),F(mn,hi),ur=!0,$e||(Yn=[xe(a,"input",r[29]),xe(a,"keydown",r[24]),xe(a,"paste",r[25]),xe(a,"drop",r[25]),xe(w,"change",r[40]),xe(hi,"click",r[23]),xe(e,"submit",Sv(r[26]))],$e=!0)},p(C,ee){if((!ur||ee[0]&32768)&&i!==(i=gt("Description",C[15]("t"))+"")&&(n.innerHTML=i),(!ur||ee[0]&32768&&o!==(o=C[15]("t")))&&L(a,"accesskey",o),ee[0]&8&&vr(a,C[3].description),(!ur||ee[0]&8&&f!==(f="priority-"+C[3].priority))&&L(c,"for",f),ee[0]&4229128){es=C[22];let lr;for(lr=0;lr<es.length;lr+=1){let $h=mw(C,es,lr);Dt[lr]?Dt[lr].p($h,ee):(Dt[lr]=hw($h),Dt[lr].c(),Dt[lr].m(l,null))}for(;lr<Dt.length;lr+=1)Dt[lr].d(1);Dt.length=es.length}let hn={};ee[0]&8&&(hn.editableTask=C[3]),ee[0]&32768&&(hn.accesskey=C[15]("r")),!R&&ee[0]&1024&&(R=!0,hn.isRecurrenceValid=C[10],At(()=>R=!1)),x.$set(hn);let sa={};ee[0]&8&&(sa.forwardOnly=C[3].forwardOnly),ee[0]&32768&&(sa.accesskey=C[15]("d")),!ne&&ee[0]&8&&(ne=!0,sa.date=C[3].dueDate,At(()=>ne=!1)),!B&&ee[0]&128&&(B=!0,sa.isDateValid=C[7],At(()=>B=!1)),q.$set(sa);let aa={};ee[0]&8&&(aa.forwardOnly=C[3].forwardOnly),ee[0]&32768&&(aa.accesskey=C[15]("s")),!Pe&&ee[0]&8&&(Pe=!0,aa.date=C[3].scheduledDate,At(()=>Pe=!1)),!j&&ee[0]&256&&(j=!0,aa.isDateValid=C[8],At(()=>j=!1)),Te.$set(aa);let oa={};ee[0]&8&&(oa.forwardOnly=C[3].forwardOnly),ee[0]&32768&&(oa.accesskey=C[15]("a")),!H&&ee[0]&8&&(H=!0,oa.date=C[3].startDate,At(()=>H=!1)),!U&&ee[0]&512&&(U=!0,oa.isDateValid=C[9],At(()=>U=!1)),O.$set(oa),(!ur||ee[0]&32768)&&b!==(b=gt("Only future dates:",C[15]("f"))+"")&&(h.innerHTML=b),(!ur||ee[0]&32768&&S!==(S=C[15]("f")))&&L(w,"accesskey",S),ee[0]&8&&(w.checked=C[3].forwardOnly);let vc=P;P=Wh(C,ee),P===vc?Bn[P].p(C,ee):(Mv(),tr(Bn[vc],1,1,()=>{Bn[vc]=null}),Cv(),re=Bn[P],re?re.p(C,ee):(re=Bn[P]=Uh[P](C),re.c()),$t(re,1),re.m(D,null));let ua={};ee[0]&1&&(ua.task=C[0]),ee[0]&2&&(ua.statusOptions=C[1]),ee[0]&32768&&(ua.accesskey=C[15]("u")),!fn&&ee[0]&8&&(fn=!0,ua.editableTask=C[3],At(()=>fn=!1)),It.$set(ua);let la={};ee[0]&8&&(la.forwardOnly=C[3].forwardOnly),ee[0]&32768&&(la.accesskey=C[15]("c")),!Ot&&ee[0]&8&&(Ot=!0,la.date=C[3].createdDate,At(()=>Ot=!1)),!Be&&ee[0]&32&&(Be=!0,la.isDateValid=C[5],At(()=>Be=!1)),St.$set(la);let ca={};ee[0]&8&&(ca.forwardOnly=C[3].forwardOnly),ee[0]&32768&&(ca.accesskey=C[15]("x")),!yt&&ee[0]&8&&(yt=!0,ca.date=C[3].doneDate,At(()=>yt=!1)),!Ht&&ee[0]&64&&(Ht=!0,ca.isDateValid=C[6],At(()=>Ht=!1)),lt.$set(ca);let da={};ee[0]&8&&(da.forwardOnly=C[3].forwardOnly),ee[0]&32768&&(da.accesskey=C[15]("-")),!pn&&ee[0]&8&&(pn=!0,da.date=C[3].cancelledDate,At(()=>pn=!1)),!Zi&&ee[0]&16&&(Zi=!0,da.isDateValid=C[4],At(()=>Zi=!1)),Ft.$set(da),(!ur||ee[0]&8192&&mi!==(mi=!C[13]))&&(Br.disabled=mi)},i(C){ur||($t(x.$$.fragment,C),$t(q.$$.fragment,C),$t(Te.$$.fragment,C),$t(O.$$.fragment,C),$t(re),$t(It.$$.fragment,C),$t(St.$$.fragment,C),$t(lt.$$.fragment,C),$t(Ft.$$.fragment,C),ur=!0)},o(C){tr(x.$$.fragment,C),tr(q.$$.fragment,C),tr(Te.$$.fragment,C),tr(O.$$.fragment,C),tr(re),tr(It.$$.fragment,C),tr(St.$$.fragment,C),tr(lt.$$.fragment,C),tr(Ft.$$.fragment,C),ur=!1},d(C){C&&ae(e),r[30](null),Ui(Dt,C),rr(x),rr(q),rr(Te),rr(O),Bn[P].d(),rr(It),rr(St),rr(lt),rr(Ft),$e=!1,qt(Yn)}}}function mI(r,e,t){let n,{task:i}=e,{onSubmit:s}=e,{statusOptions:a}=e,{allTasks:o}=e,{prioritySymbols:u,startDateSymbol:l,scheduledDateSymbol:c,dueDateSymbol:d,cancelledDateSymbol:f,createdDateSymbol:m,doneDateSymbol:g}=Nr.tasksPluginEmoji.taskSerializer.symbols,T,y={description:"",status:te.TODO,priority:"none",recurrenceRule:"",createdDate:"",startDate:"",scheduledDate:"",dueDate:"",doneDate:"",cancelledDate:"",forwardOnly:!0,blockedBy:[],blocking:[]},E=!0,x=!0,R=!0,$=!0,q=!0,ne=!0,B=!0,G=!0,Te=!1,Pe=!0,j=!0,W=[],O=!1,H=[{value:"lowest",label:"Lowest",symbol:u.Lowest,accessKey:"o",accessKeyIndex:1},{value:"low",label:"Low",symbol:u.Low,accessKey:"l",accessKeyIndex:0},{value:"none",label:"Normal",symbol:u.None,accessKey:"n",accessKeyIndex:0},{value:"medium",label:"Medium",symbol:u.Medium,accessKey:"m",accessKeyIndex:0},{value:"high",label:"High",symbol:u.High,accessKey:"h",accessKeyIndex:0},{value:"highest",label:"Highest",symbol:u.Highest,accessKey:"i",accessKeyIndex:1}];function U(V){return Gm(this,void 0,void 0,function*(){if(V.id!=="")return V;let lt=o.filter(Ht=>Ht.id!==""),yt=tl(V,lt.map(Ht=>Ht.id));return yield kr({originalTask:V,newTasks:yt}),yt})}jm(()=>{let{provideAccessKeys:V}=X();t(11,Pe=V);let lt=be.getInstance().removeAsWordFrom(i.description);(lt!=i.description||!be.getInstance().includedIn(i.description))&&(Te=!0);let yt="none";i.priority==="5"?yt="lowest":i.priority==="4"?yt="low":i.priority==="2"?yt="medium":i.priority==="1"?yt="high":i.priority==="0"&&(yt="highest");let Ht=[];for(let Gn of i.dependsOn){let Ft=o.find(pn=>pn.id===Gn);!Ft||Ht.push(Ft)}W=o.filter(Gn=>Gn.dependsOn.includes(i.id)),t(3,y={description:lt,status:i.status,priority:yt,recurrenceRule:i.recurrence?i.recurrence.toText():"",createdDate:new Ge(i.createdDate).formatAsDate(),startDate:new Ge(i.startDate).formatAsDate(),scheduledDate:new Ge(i.scheduledDate).formatAsDate(),dueDate:new Ge(i.dueDate).formatAsDate(),doneDate:new Ge(i.doneDate).formatAsDate(),cancelledDate:new Ge(i.cancelledDate).formatAsDate(),forwardOnly:!0,blockedBy:Ht,blocking:W}),t(14,O=!0),setTimeout(()=>{T.focus()},10)});let Z=()=>{s([])},p=V=>{V.key==="Enter"&&(V.preventDefault(),j&&b())},h=()=>{setTimeout(()=>{t(3,y.description=y.description.replace(/[\r\n]+/g," "),y)},0)},b=()=>Gm(void 0,void 0,void 0,function*(){let V=y.description.trim();Te&&(V=be.getInstance().prependTo(V));let lt=Ci(y.startDate,y.forwardOnly),yt=Ci(y.scheduledDate,y.forwardOnly),Ht=Ci(y.dueDate,y.forwardOnly),Gn=Ci(y.cancelledDate,y.forwardOnly),Ft=Ci(y.createdDate,y.forwardOnly),pn=Ci(y.doneDate,y.forwardOnly),Zi=null;y.recurrenceRule&&(Zi=Ze.fromText({recurrenceRuleText:y.recurrenceRule,startDate:lt,scheduledDate:yt,dueDate:Ht}));let Yr;switch(y.priority){case"lowest":Yr="5";break;case"low":Yr="4";break;case"medium":Yr="2";break;case"high":Yr="1";break;case"highest":Yr="0";break;default:Yr="3"}let mn=[];for(let $e of y.blockedBy){let Yn=yield U($e);mn.push(Yn)}let Br=i.id,ia=[],mi=[];(y.blocking.toString()!==W.toString()||y.blocking.length!==0)&&(i.id===""&&(Br=Eo(o.filter($e=>$e.id!=="").map($e=>$e.id))),ia=W.filter($e=>!y.blocking.includes($e)),mi=y.blocking.filter($e=>!W.includes($e)));let Ji=new ue(Object.assign(Object.assign({},i),{description:V,status:i.status,priority:Yr,recurrence:Zi,startDate:lt,scheduledDate:yt,dueDate:Ht,doneDate:pn,createdDate:Ft,cancelledDate:Gn,dependsOn:mn.map($e=>$e.id),id:Br}));for(let $e of ia){let Yn=ov($e,Ji);yield kr({originalTask:$e,newTasks:Yn})}for(let $e of mi){let Yn=av($e,Ji);yield kr({originalTask:$e,newTasks:Yn})}let hi=pn||window.moment(),ur=Ji.handleNewStatusWithRecurrenceInUsersOrder(y.status,hi);s(ur)}),_=[[]];function w(){y.description=this.value,t(3,y)}function S(V){Ye[V?"unshift":"push"](()=>{T=V,t(12,T)})}function M(){y.priority=this.__value,t(3,y)}function A(V){G=V,t(10,G)}function v(V){r.$$.not_equal(y.dueDate,V)&&(y.dueDate=V,t(3,y))}function D(V){q=V,t(7,q)}function P(V){r.$$.not_equal(y.scheduledDate,V)&&(y.scheduledDate=V,t(3,y))}function re(V){ne=V,t(8,ne)}function le(V){r.$$.not_equal(y.startDate,V)&&(y.startDate=V,t(3,y))}function fe(V){B=V,t(9,B)}function Ne(){y.forwardOnly=this.checked,t(3,y)}function Ce(V){y=V,t(3,y)}function It(V){r.$$.not_equal(y.createdDate,V)&&(y.createdDate=V,t(3,y))}function fn(V){R=V,t(5,R)}function Gr(V){r.$$.not_equal(y.doneDate,V)&&(y.doneDate=V,t(3,y))}function St(V){$=V,t(6,$)}function Ot(V){r.$$.not_equal(y.cancelledDate,V)&&(y.cancelledDate=V,t(3,y))}function Be(V){x=V,t(4,x)}return r.$$set=V=>{"task"in V&&t(0,i=V.task),"onSubmit"in V&&t(27,s=V.onSubmit),"statusOptions"in V&&t(1,a=V.statusOptions),"allTasks"in V&&t(2,o=V.allTasks)},r.$$.update=()=>{if(r.$$.dirty[0]&2048){e:t(15,n=V=>Pe?V:null)}if(r.$$.dirty[0]&8){e:t(28,E=y.description.trim()!=="")}if(r.$$.dirty[0]&268437488){e:t(13,j=q&&G&&ne&&B&&E&&x&&R&&$)}},[i,a,o,y,x,R,$,q,ne,B,G,Pe,T,j,O,n,l,c,d,f,m,g,H,Z,p,h,b,s,E,w,S,M,_,A,v,D,P,re,le,fe,Ne,Ce,It,fn,Gr,St,Ot,Be]}var sh=class extends _r{constructor(e){super(),nn(this,e,mI,pI,rn,{task:0,onSubmit:27,statusOptions:1,allTasks:2},null,[-1,-1])}},gw=sh;var ni=class extends yw.Modal{constructor({app:t,task:n,onSubmit:i,allTasks:s}){super(t);this.task=n,this.allTasks=s,this.onSubmit=a=>{a.length&&i(a),this.close()}}onOpen(){this.titleEl.setText("Create or edit Task"),this.modalEl.style.paddingBottom="0";let{contentEl:t}=this;this.contentEl.style.paddingBottom="0";let n=this.getKnownStatusesAndCurrentTaskStatusIfNotKnown();new gw({target:t,props:{task:this.task,statusOptions:n,onSubmit:this.onSubmit,allTasks:this.allTasks}})}getKnownStatusesAndCurrentTaskStatusIfNotKnown(){let t=De.getInstance().registeredStatuses;return De.getInstance().bySymbol(this.task.status.symbol)===te.EMPTY&&t.push(this.task.status),t}onClose(){let{contentEl:t}=this;t.empty()}};function hI(){let{setCreatedDate:r}=X();return r?window.moment():null}function gI(r){let{setCreatedDate:e}=X();if(!e||r.createdDate!==null)return!1;let t=r.description==="",n=!be.getInstance().isEmpty(),i=!be.getInstance().includedIn(r.description);return t||n&&i}var wl=({line:r,path:e})=>{var f,m;let t=ue.parseTaskSignifiers(r,ht.fromUnknownPosition(new Qe(e)),vt.fromPath(e)),n=hI();if(t!==null)return gI(t)?new ue(_e(Q({},t),{createdDate:n})):t;let i=r.match(J.nonTaskRegex);if(i===null)return console.error("Tasks: Cannot create task on line:",r),new ue({status:te.TODO,description:"",taskLocation:ht.fromUnknownPosition(new Qe(e)),indentation:"",listMarker:"-",priority:"3",createdDate:n,startDate:null,scheduledDate:null,dueDate:null,doneDate:null,cancelledDate:null,recurrence:null,dependsOn:[],id:"",blockLink:"",tags:[],originalMarkdown:"",scheduledDateIsInferred:!1});let s=i[1],a=(f=i[2])!=null?f:"-",o=(m=i[4])!=null?m:" ",u=De.getInstance().bySymbolOrCreate(o),l=i[5],c=r.match(J.blockLinkRegex),d=c!==null?c[0]:"";return d!==""&&(l=l.replace(J.blockLinkRegex,"")),new ue({status:u,description:l,taskLocation:ht.fromUnknownPosition(new Qe(e)),indentation:s,listMarker:a,blockLink:d,priority:"3",createdDate:n,startDate:null,scheduledDate:null,dueDate:null,doneDate:null,cancelledDate:null,recurrence:null,tags:[],originalMarkdown:"",scheduledDateIsInferred:!1,id:"",dependsOn:[]})};var bw=(r,e,t,n,i)=>{var f;if(r)return t instanceof ah.MarkdownView;if(!(t instanceof ah.MarkdownView))return;let s=(f=t.file)==null?void 0:f.path;if(s===void 0)return;let o=e.getCursor().line,u=e.getLine(o),l=wl({line:u,path:s}),c=m=>{let g=vt.removeInferredStatusIfNeeded(l,m).map(T=>T.toFileLineString()).join(` +`);e.setLine(o,g)};new ni({app:n,task:l,onSubmit:c,allTasks:i}).open()};var oh=require("obsidian");var Tw=(r,e,t)=>{var u;if(r)return t instanceof oh.MarkdownView;if(!(t instanceof oh.MarkdownView))return;let n=(u=t.file)==null?void 0:u.path;if(n===void 0)return;let i=e.getCursor(),s=i.line,a=e.getLine(s),o=uh(a,n);e.setLine(s,o.text),e.setCursor(yI(i,o))},uh=(r,e)=>{let t=ue.fromLine({line:r,taskLocation:ht.fromUnknownPosition(new Qe(e)),fallbackDate:null});if(t!==null){let n=t.toggleWithRecurrenceInUsersOrder().map(i=>i.toFileLineString());return{text:n.join(` +`),moveTo:{line:n.length-1}}}else{let n=r.match(J.taskRegex);if(n!==null){let i=n[3],a=De.getInstance().bySymbol(i).nextStatusSymbol;return{text:r.replace(J.taskRegex,`$1- [${a}] $4`)}}else if(J.listItemRegex.test(r)){let i=r.replace(J.listItemRegex,"$1$2 [ ]");return{text:i,moveTo:{ch:i.length}}}else{let i=r.replace(J.indentationRegex,"$1- ");return{text:i,moveTo:{ch:i.length}}}}},yI=(r,e)=>{var s;let t={line:0,ch:r.ch},n=Q(Q({},t),(s=e.moveTo)!=null?s:{}),i=e.text.split(` +`)[n.line].length;return{line:r.line+n.line,ch:Math.min(n.ch,i)}};var kl=class{get app(){return this.plugin.app}constructor({plugin:e}){this.plugin=e,e.addCommand({id:"edit-task",name:"Create or edit task",icon:"pencil",editorCheckCallback:(t,n,i)=>bw(t,n,i,this.app,this.plugin.getTasks())}),e.addCommand({id:"toggle-done",name:"Toggle task done",icon:"check-in-circle",editorCheckCallback:Tw})}};var ii=class{constructor(){this.hidePostponeButton=!1;this.hideTaskCount=!1;this.hideBacklinks=!1;this.hideEditButton=!1;this.hideUrgency=!0;this.shortMode=!1;this.explainQuery=!1}};function Gi(r,e){let t=`Error: ${r}. The error message was: - `,n="";return e instanceof Error?n+=e:n+="Unknown error",`${t}"${n}"`}var sI=Object.prototype.toString,Ws=Array.isArray||function(e){return sI.call(e)==="[object Array]"};function fh(r){return typeof r=="function"}function aI(r){return Ws(r)?"array":typeof r}function dh(r){return r.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function kw(r,e){return r!=null&&typeof r=="object"&&e in r}function oI(r,e){return r!=null&&typeof r!="object"&&r.hasOwnProperty&&r.hasOwnProperty(e)}var uI=RegExp.prototype.test;function lI(r,e){return uI.call(r,e)}var cI=/\S/;function dI(r){return!lI(cI,r)}var fI={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function pI(r){return String(r).replace(/[&<>"'`=\/]/g,function(t){return fI[t]})}var mI=/\s*/,hI=/\s+/,Ew=/\s*=/,gI=/\s*\}/,yI=/#|\^|\/|>|\{|&|=|!/;function bI(r,e){if(!r)return[];var t=!1,n=[],i=[],s=[],a=!1,o=!1,u="",l=0;function c(){if(a&&!o)for(;s.length;)delete i[s.pop()];else s=[];a=!1,o=!1}var d,p,m;function b(q){if(typeof q=="string"&&(q=q.split(hI,2)),!Ws(q)||q.length!==2)throw new Error("Invalid tags: "+q);d=new RegExp(dh(q[0])+"\\s*"),p=new RegExp("\\s*"+dh(q[1])),m=new RegExp("\\s*"+dh("}"+q[1]))}b(e||vr.tags);for(var g=new Lo(r),E,R,x,v,V,$;!g.eos();){if(E=g.pos,x=g.scanUntil(d),x)for(var ee=0,Y=x.length;ee<Y;++ee)v=x.charAt(ee),dI(v)?(s.push(i.length),u+=v):(o=!0,t=!0,u+=" "),i.push(["text",v,E,E+1]),E+=1,v===` -`&&(c(),u="",l=0,t=!1);if(!g.scan(d))break;if(a=!0,R=g.scan(yI)||"name",g.scan(mI),R==="="?(x=g.scanUntil(Ew),g.scan(Ew),g.scanUntil(p)):R==="{"?(x=g.scanUntil(m),g.scan(gI),g.scanUntil(p),R="&"):x=g.scanUntil(p),!g.scan(p))throw new Error("Unclosed tag at "+g.pos);if(R==">"?V=[R,x,E,g.pos,u,l,t]:V=[R,x,E,g.pos],l++,i.push(V),R==="#"||R==="^")n.push(V);else if(R==="/"){if($=n.pop(),!$)throw new Error('Unopened section "'+x+'" at '+E);if($[1]!==x)throw new Error('Unclosed section "'+$[1]+'" at '+E)}else R==="name"||R==="{"||R==="&"?o=!0:R==="="&&b(x)}if(c(),$=n.pop(),$)throw new Error('Unclosed section "'+$[1]+'" at '+g.pos);return _I(TI(i))}function TI(r){for(var e=[],t,n,i=0,s=r.length;i<s;++i)t=r[i],t&&(t[0]==="text"&&n&&n[0]==="text"?(n[1]+=t[1],n[3]=t[3]):(e.push(t),n=t));return e}function _I(r){for(var e=[],t=e,n=[],i,s,a=0,o=r.length;a<o;++a)switch(i=r[a],i[0]){case"#":case"^":t.push(i),n.push(i),t=i[4]=[];break;case"/":s=n.pop(),s[5]=i[2],t=n.length>0?n[n.length-1][4]:e;break;default:t.push(i)}return e}function Lo(r){this.string=r,this.tail=r,this.pos=0}Lo.prototype.eos=function(){return this.tail===""};Lo.prototype.scan=function(e){var t=this.tail.match(e);if(!t||t.index!==0)return"";var n=t[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n};Lo.prototype.scanUntil=function(e){var t=this.tail.search(e),n;switch(t){case-1:n=this.tail,this.tail="";break;case 0:n="";break;default:n=this.tail.substring(0,t),this.tail=this.tail.substring(t)}return this.pos+=n.length,n};function Us(r,e){this.view=r,this.cache={".":this.view},this.parent=e}Us.prototype.push=function(e){return new Us(e,this)};Us.prototype.lookup=function(e){var t=this.cache,n;if(t.hasOwnProperty(e))n=t[e];else{for(var i=this,s,a,o,u=!1;i;){if(e.indexOf(".")>0)for(s=i.view,a=e.split("."),o=0;s!=null&&o<a.length;)o===a.length-1&&(u=kw(s,a[o])||oI(s,a[o])),s=s[a[o++]];else s=i.view[e],u=kw(i.view,e);if(u){n=s;break}i=i.parent}t[e]=n}return fh(n)&&(n=n.call(this.view)),n};function Nt(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}Nt.prototype.clearCache=function(){typeof this.templateCache!="undefined"&&this.templateCache.clear()};Nt.prototype.parse=function(e,t){var n=this.templateCache,i=e+":"+(t||vr.tags).join(":"),s=typeof n!="undefined",a=s?n.get(i):void 0;return a==null&&(a=bI(e,t),s&&n.set(i,a)),a};Nt.prototype.render=function(e,t,n,i){var s=this.getConfigTags(i),a=this.parse(e,s),o=t instanceof Us?t:new Us(t,void 0);return this.renderTokens(a,o,n,e,i)};Nt.prototype.renderTokens=function(e,t,n,i,s){for(var a="",o,u,l,c=0,d=e.length;c<d;++c)l=void 0,o=e[c],u=o[0],u==="#"?l=this.renderSection(o,t,n,i,s):u==="^"?l=this.renderInverted(o,t,n,i,s):u===">"?l=this.renderPartial(o,t,n,s):u==="&"?l=this.unescapedValue(o,t):u==="name"?l=this.escapedValue(o,t,s):u==="text"&&(l=this.rawValue(o)),l!==void 0&&(a+=l);return a};Nt.prototype.renderSection=function(e,t,n,i,s){var a=this,o="",u=t.lookup(e[1]);function l(p){return a.render(p,t,n,s)}if(!!u){if(Ws(u))for(var c=0,d=u.length;c<d;++c)o+=this.renderTokens(e[4],t.push(u[c]),n,i,s);else if(typeof u=="object"||typeof u=="string"||typeof u=="number")o+=this.renderTokens(e[4],t.push(u),n,i,s);else if(fh(u)){if(typeof i!="string")throw new Error("Cannot use higher-order sections without the original template");u=u.call(t.view,i.slice(e[3],e[5]),l),u!=null&&(o+=u)}else o+=this.renderTokens(e[4],t,n,i,s);return o}};Nt.prototype.renderInverted=function(e,t,n,i,s){var a=t.lookup(e[1]);if(!a||Ws(a)&&a.length===0)return this.renderTokens(e[4],t,n,i,s)};Nt.prototype.indentPartial=function(e,t,n){for(var i=t.replace(/[^ \t]/g,""),s=e.split(` + `,n="";return e instanceof Error?n+=e:n+="Unknown error",`${t}"${n}"`}var bI=Object.prototype.toString,Us=Array.isArray||function(e){return bI.call(e)==="[object Array]"};function ch(r){return typeof r=="function"}function TI(r){return Us(r)?"array":typeof r}function lh(r){return r.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function _w(r,e){return r!=null&&typeof r=="object"&&e in r}function _I(r,e){return r!=null&&typeof r!="object"&&r.hasOwnProperty&&r.hasOwnProperty(e)}var vI=RegExp.prototype.test;function wI(r,e){return vI.call(r,e)}var kI=/\S/;function EI(r){return!wI(kI,r)}var SI={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function OI(r){return String(r).replace(/[&<>"'`=\/]/g,function(t){return SI[t]})}var DI=/\s*/,xI=/\s+/,vw=/\s*=/,RI=/\s*\}/,MI=/#|\^|\/|>|\{|&|=|!/;function CI(r,e){if(!r)return[];var t=!1,n=[],i=[],s=[],a=!1,o=!1,u="",l=0;function c(){if(a&&!o)for(;s.length;)delete i[s.pop()];else s=[];a=!1,o=!1}var d,f,m;function g(G){if(typeof G=="string"&&(G=G.split(xI,2)),!Us(G)||G.length!==2)throw new Error("Invalid tags: "+G);d=new RegExp(lh(G[0])+"\\s*"),f=new RegExp("\\s*"+lh(G[1])),m=new RegExp("\\s*"+lh("}"+G[1]))}g(e||Er.tags);for(var T=new Wo(r),y,E,x,R,$,q;!T.eos();){if(y=T.pos,x=T.scanUntil(d),x)for(var ne=0,B=x.length;ne<B;++ne)R=x.charAt(ne),EI(R)?(s.push(i.length),u+=R):(o=!0,t=!0,u+=" "),i.push(["text",R,y,y+1]),y+=1,R===` +`&&(c(),u="",l=0,t=!1);if(!T.scan(d))break;if(a=!0,E=T.scan(MI)||"name",T.scan(DI),E==="="?(x=T.scanUntil(vw),T.scan(vw),T.scanUntil(f)):E==="{"?(x=T.scanUntil(m),T.scan(RI),T.scanUntil(f),E="&"):x=T.scanUntil(f),!T.scan(f))throw new Error("Unclosed tag at "+T.pos);if(E==">"?$=[E,x,y,T.pos,u,l,t]:$=[E,x,y,T.pos],l++,i.push($),E==="#"||E==="^")n.push($);else if(E==="/"){if(q=n.pop(),!q)throw new Error('Unopened section "'+x+'" at '+y);if(q[1]!==x)throw new Error('Unclosed section "'+q[1]+'" at '+y)}else E==="name"||E==="{"||E==="&"?o=!0:E==="="&&g(x)}if(c(),q=n.pop(),q)throw new Error('Unclosed section "'+q[1]+'" at '+T.pos);return PI(AI(i))}function AI(r){for(var e=[],t,n,i=0,s=r.length;i<s;++i)t=r[i],t&&(t[0]==="text"&&n&&n[0]==="text"?(n[1]+=t[1],n[3]=t[3]):(e.push(t),n=t));return e}function PI(r){for(var e=[],t=e,n=[],i,s,a=0,o=r.length;a<o;++a)switch(i=r[a],i[0]){case"#":case"^":t.push(i),n.push(i),t=i[4]=[];break;case"/":s=n.pop(),s[5]=i[2],t=n.length>0?n[n.length-1][4]:e;break;default:t.push(i)}return e}function Wo(r){this.string=r,this.tail=r,this.pos=0}Wo.prototype.eos=function(){return this.tail===""};Wo.prototype.scan=function(e){var t=this.tail.match(e);if(!t||t.index!==0)return"";var n=t[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n};Wo.prototype.scanUntil=function(e){var t=this.tail.search(e),n;switch(t){case-1:n=this.tail,this.tail="";break;case 0:n="";break;default:n=this.tail.substring(0,t),this.tail=this.tail.substring(t)}return this.pos+=n.length,n};function Ls(r,e){this.view=r,this.cache={".":this.view},this.parent=e}Ls.prototype.push=function(e){return new Ls(e,this)};Ls.prototype.lookup=function(e){var t=this.cache,n;if(t.hasOwnProperty(e))n=t[e];else{for(var i=this,s,a,o,u=!1;i;){if(e.indexOf(".")>0)for(s=i.view,a=e.split("."),o=0;s!=null&&o<a.length;)o===a.length-1&&(u=_w(s,a[o])||_I(s,a[o])),s=s[a[o++]];else s=i.view[e],u=_w(i.view,e);if(u){n=s;break}i=i.parent}t[e]=n}return ch(n)&&(n=n.call(this.view)),n};function Nt(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}Nt.prototype.clearCache=function(){typeof this.templateCache!="undefined"&&this.templateCache.clear()};Nt.prototype.parse=function(e,t){var n=this.templateCache,i=e+":"+(t||Er.tags).join(":"),s=typeof n!="undefined",a=s?n.get(i):void 0;return a==null&&(a=CI(e,t),s&&n.set(i,a)),a};Nt.prototype.render=function(e,t,n,i){var s=this.getConfigTags(i),a=this.parse(e,s),o=t instanceof Ls?t:new Ls(t,void 0);return this.renderTokens(a,o,n,e,i)};Nt.prototype.renderTokens=function(e,t,n,i,s){for(var a="",o,u,l,c=0,d=e.length;c<d;++c)l=void 0,o=e[c],u=o[0],u==="#"?l=this.renderSection(o,t,n,i,s):u==="^"?l=this.renderInverted(o,t,n,i,s):u===">"?l=this.renderPartial(o,t,n,s):u==="&"?l=this.unescapedValue(o,t):u==="name"?l=this.escapedValue(o,t,s):u==="text"&&(l=this.rawValue(o)),l!==void 0&&(a+=l);return a};Nt.prototype.renderSection=function(e,t,n,i,s){var a=this,o="",u=t.lookup(e[1]);function l(f){return a.render(f,t,n,s)}if(!!u){if(Us(u))for(var c=0,d=u.length;c<d;++c)o+=this.renderTokens(e[4],t.push(u[c]),n,i,s);else if(typeof u=="object"||typeof u=="string"||typeof u=="number")o+=this.renderTokens(e[4],t.push(u),n,i,s);else if(ch(u)){if(typeof i!="string")throw new Error("Cannot use higher-order sections without the original template");u=u.call(t.view,i.slice(e[3],e[5]),l),u!=null&&(o+=u)}else o+=this.renderTokens(e[4],t,n,i,s);return o}};Nt.prototype.renderInverted=function(e,t,n,i,s){var a=t.lookup(e[1]);if(!a||Us(a)&&a.length===0)return this.renderTokens(e[4],t,n,i,s)};Nt.prototype.indentPartial=function(e,t,n){for(var i=t.replace(/[^ \t]/g,""),s=e.split(` `),a=0;a<s.length;a++)s[a].length&&(a>0||!n)&&(s[a]=i+s[a]);return s.join(` -`)};Nt.prototype.renderPartial=function(e,t,n,i){if(!!n){var s=this.getConfigTags(i),a=fh(n)?n(e[1]):n[e[1]];if(a!=null){var o=e[6],u=e[5],l=e[4],c=a;u==0&&l&&(c=this.indentPartial(a,l,o));var d=this.parse(c,s);return this.renderTokens(d,t,n,c,i)}}};Nt.prototype.unescapedValue=function(e,t){var n=t.lookup(e[1]);if(n!=null)return n};Nt.prototype.escapedValue=function(e,t,n){var i=this.getConfigEscape(n)||vr.escape,s=t.lookup(e[1]);if(s!=null)return typeof s=="number"&&i===vr.escape?String(s):i(s)};Nt.prototype.rawValue=function(e){return e[1]};Nt.prototype.getConfigTags=function(e){return Ws(e)?e:e&&typeof e=="object"?e.tags:void 0};Nt.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!Ws(e))return e.escape};var vr={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(r){Fo.templateCache=r},get templateCache(){return Fo.templateCache}},Fo=new Nt;vr.clearCache=function(){return Fo.clearCache()};vr.parse=function(e,t){return Fo.parse(e,t)};vr.render=function(e,t,n,i){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+aI(e)+'" was given as the first argument for mustache#render(template, view, partials)');return Fo.render(e,t,n,i)};vr.escape=pI;vr.Scanner=Lo;vr.Context=Us;vr.Writer=Nt;var ph=vr;var Rw=pa(xw());function Mw(r,e){ph.escape=function(t){return t};try{return ph.render(r,(0,Rw.default)(e))}catch(t){let n="";throw t instanceof Error?n=`There was an error expanding one or more placeholders. +`)};Nt.prototype.renderPartial=function(e,t,n,i){if(!!n){var s=this.getConfigTags(i),a=ch(n)?n(e[1]):n[e[1]];if(a!=null){var o=e[6],u=e[5],l=e[4],c=a;u==0&&l&&(c=this.indentPartial(a,l,o));var d=this.parse(c,s);return this.renderTokens(d,t,n,c,i)}}};Nt.prototype.unescapedValue=function(e,t){var n=t.lookup(e[1]);if(n!=null)return n};Nt.prototype.escapedValue=function(e,t,n){var i=this.getConfigEscape(n)||Er.escape,s=t.lookup(e[1]);if(s!=null)return typeof s=="number"&&i===Er.escape?String(s):i(s)};Nt.prototype.rawValue=function(e){return e[1]};Nt.prototype.getConfigTags=function(e){return Us(e)?e:e&&typeof e=="object"?e.tags:void 0};Nt.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!Us(e))return e.escape};var Er={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(r){Uo.templateCache=r},get templateCache(){return Uo.templateCache}},Uo=new Nt;Er.clearCache=function(){return Uo.clearCache()};Er.parse=function(e,t){return Uo.parse(e,t)};Er.render=function(e,t,n,i){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+TI(e)+'" was given as the first argument for mustache#render(template, view, partials)');return Uo.render(e,t,n,i)};Er.escape=OI;Er.Scanner=Wo;Er.Context=Ls;Er.Writer=Nt;var dh=Er;var Ow=pa(Sw());function Dw(r,e){dh.escape=function(t){return t};try{return dh.render(r,(0,Ow.default)(e))}catch(t){let n="";throw t instanceof Error?n=`There was an error expanding one or more placeholders. The error message was: ${t.message.replace(/ > /g,".").replace("Missing Mustache data property","Unknown property")}`:n="Unknown error expanding placeholders.",n+=` The problem is in: - ${r}`,Error(n)}}function Cw(r){return hh(r,[])}function hh(r,e){return{query:{file:new Es(r),allTasks:e}}}var qs=class{constructor(e=""){this.indentation=e}explainQuery(e){if(e.error!==void 0)return this.explainError(e);let t=[];return t.push(this.explainFilters(e)),t.push(this.explainGroups(e)),t.push(this.explainSorters(e)),t.push(this.explainQueryLimits(e)),t.push(this.explainDebugSettings()),t.filter(n=>n!=="").join(` + ${r}`,Error(n)}}function xw(r){return ph(r,[])}function ph(r,e){return{query:{file:new Qe(r),allTasks:e}}}var Ws=class{constructor(e=""){this.indentation=e}explainQuery(e){if(e.error!==void 0)return this.explainError(e);let t=[];return t.push(this.explainFilters(e)),t.push(this.explainGroups(e)),t.push(this.explainSorters(e)),t.push(this.explainQueryLimits(e)),t.push(this.explainDebugSettings()),t.filter(n=>n!=="").join(` `)}explainError(e){let t="";return t+=`Query has an error: `,t+=e.error+` `,t}explainFilters(e){return e.filters.length===0?this.indent(`No filters supplied. All tasks will match the query. @@ -213,9 +212,9 @@ The problem is in: `;return n}explainQueryLimits(e){function t(i){let s=`At most ${i} task`;return i!==1&&(s+="s"),s}let n=[];if(e.limit!==void 0){let i=t(e.limit)+`. `;n.push(this.indent(i))}if(e.taskGroupLimit!==void 0){let i=t(e.taskGroupLimit)+` per group (if any "group by" options are supplied). `;n.push(this.indent(i))}return n.join(` -`)}explainDebugSettings(){let e="",{debugSettings:t}=J();return t.ignoreSortInstructions&&(e+=this.indent(`NOTE: All sort instructions, including default sort order, are disabled, due to 'ignoreSortInstructions' setting. -`)),e}indent(e){return this.indentation+e}};var Re=class{constructor(e,t=[],n=""){this.description=e,this.symbol=n,this.children=t}static booleanAnd(e){return this.combineOrCreateExplanation("All of",e,"AND")}static booleanOr(e){return this.combineOrCreateExplanation("At least one of",e,"OR")}static booleanNot(e){return new Re("None of",e,"NOT")}static booleanXor(e){return new Re("Exactly one of",e,"XOR")}asString(e=""){if(this.children.length==0)return e+this.description;let t=e;this.symbol===""?t+=this.description:(t+=this.symbol,this.children.length>1&&(t+=` (${this.description})`),t+=":");let n=e+" ";for(let i=0;i<this.children.length;i++)t+=` -${this.children[i].asString(n)}`;return t}static combineOrCreateExplanation(e,t,n){if(t.length===2){let i=t[0],s=t[1];if(i.symbol===n&&s.symbol==="")return i.children.push(s),i}return new Re(e,t,n)}};var js=class{matchesAnyOf(e){return e.some(t=>this.matches(t))}};var $s=class extends js{constructor(t){super();this.stringToFind=t}matches(t){return $s.stringIncludesCaseInsensitive(t,this.stringToFind)}static stringIncludesCaseInsensitive(t,n){return t.toLocaleLowerCase().includes(n.toLocaleLowerCase())}explanation(t){return new Re(t)}};var ni=class extends js{constructor(t){super();this.regex=t}static validateAndConstruct(t){let n=/^\/(.+)\/([^/]*)$/,i=t.match(n);if(i!==null){let s=new RegExp(i[1],i[2]);return new ni(s)}else return null}matches(t){return t.match(this.regex)!==null}static helpMessage(){return String.raw`See https://publish.obsidian.md/tasks/Queries/Regular+Expressions +`)}explainDebugSettings(){let e="",{debugSettings:t}=X();return t.ignoreSortInstructions&&(e+=this.indent(`NOTE: All sort instructions, including default sort order, are disabled, due to 'ignoreSortInstructions' setting. +`)),e}indent(e){return this.indentation+e}};var Se=class{constructor(e,t=[],n=""){this.description=e,this.symbol=n,this.children=t}static booleanAnd(e){return this.combineOrCreateExplanation("All of",e,"AND")}static booleanOr(e){return this.combineOrCreateExplanation("At least one of",e,"OR")}static booleanNot(e){return new Se("None of",e,"NOT")}static booleanXor(e){return new Se("Exactly one of",e,"XOR")}asString(e=""){if(this.children.length==0)return e+this.description;let t=e;this.symbol===""?t+=this.description:(t+=this.symbol,this.children.length>1&&(t+=` (${this.description})`),t+=":");let n=e+" ";for(let i=0;i<this.children.length;i++)t+=` +${this.children[i].asString(n)}`;return t}static combineOrCreateExplanation(e,t,n){if(t.length===2){let i=t[0],s=t[1];if(i.symbol===n&&s.symbol==="")return i.children.push(s),i}return new Se(e,t,n)}};var qs=class{matchesAnyOf(e){return e.some(t=>this.matches(t))}};var $s=class extends qs{constructor(t){super();this.stringToFind=t}matches(t){return $s.stringIncludesCaseInsensitive(t,this.stringToFind)}static stringIncludesCaseInsensitive(t,n){return t.toLocaleLowerCase().includes(n.toLocaleLowerCase())}explanation(t){return new Se(t)}};var si=class extends qs{constructor(t){super();this.regex=t}static validateAndConstruct(t){let n=/^\/(.+)\/([^/]*)$/,i=t.match(n);if(i!==null){let s=new RegExp(i[1],i[2]);return new si(s)}else return null}matches(t){return t.match(this.regex)!==null}static helpMessage(){return String.raw`See https://publish.obsidian.md/tasks/Queries/Regular+Expressions Regular expressions must look like this: /pattern/ @@ -241,19 +240,19 @@ to find them literally, you must add a \ before them: CAUTION! Regular expression (or 'regex') searching is a powerful but advanced feature that requires thorough knowledge in order to use successfully, and not miss intended search results. -`}explanation(t){let i=vI(t,"using regex: ",this.regexAsString());return new Re(i)}regexAsString(){let t=`'${this.regex.source}' with `;switch(this.regex.flags.length){case 0:t+="no flags";break;case 1:t+=`flag '${this.regex.flags}'`;break;default:t+=`flags '${this.regex.flags}'`;break}return t}};function vI(r,e,t){var o;let n=r.match(/\//);if(!n)return"Error explaining instruction. Could not find a slash character";let i=2,s=((o=n.index)!=null?o:i)-i;return`${e.padEnd(s)}${t}`}var Wr=class{constructor(e,t,n,i){this.instruction=e,this.property=t,this.comparator=Wr.maybeReverse(i,n)}static maybeReverse(e,t){return e?Wr.makeReversedComparator(t):t}static makeReversedComparator(e){return(t,n,i)=>e(t,n,i)*-1}};var ii=class{constructor(e,t,n,i){this.instruction=e,this.property=t,this.grouper=n,this.reverse=i}};var we=class{canCreateFilterForLine(e){return we.lineMatchesFilter(this.filterRegExp(),e)}static lineMatchesFilter(e,t){return e?e.test(t):!1}static getMatch(e,t){return e?t.match(e):null}fieldNameSingular(){return this.fieldName()}fieldNameSingularEscaped(){return il(this.fieldNameSingular())}supportsSorting(){return!1}createSorterFromLine(e){if(!this.supportsSorting())return null;let t=we.getMatch(this.sorterRegExp(),e);if(t===null)return null;let n=!!t[1];return this.createSorter(n)}sorterRegExp(){if(!this.supportsSorting())throw Error(`sorterRegExp() unimplemented for ${this.fieldNameSingular()}`);return new RegExp(`^sort by ${this.fieldNameSingularEscaped()}( reverse)?`,"i")}sorterInstruction(e){let t=`sort by ${this.fieldNameSingular()}`;return e&&(t+=" reverse"),t}comparator(){throw Error(`comparator() unimplemented for ${this.fieldNameSingular()}`)}createSorter(e){return new Wr(this.sorterInstruction(e),this.fieldNameSingular(),this.comparator(),e)}createNormalSorter(){return this.createSorter(!1)}createReverseSorter(){return this.createSorter(!0)}supportsGrouping(){return!1}createGrouperFromLine(e){if(!this.supportsGrouping())return null;let t=we.getMatch(this.grouperRegExp(),e);if(t===null)return null;let n=!!t[1];return this.createGrouper(n)}grouperRegExp(){if(!this.supportsGrouping())throw Error(`grouperRegExp() unimplemented for ${this.fieldNameSingular()}`);return new RegExp(`^group by ${this.fieldNameSingularEscaped()}( reverse)?$`,"i")}grouperInstruction(e){let t=`group by ${this.fieldNameSingular()}`;return e&&(t+=" reverse"),t}grouper(){throw Error(`grouper() unimplemented for ${this.fieldNameSingular()}`)}createGrouper(e){return new ii(this.grouperInstruction(e),this.fieldNameSingular(),this.grouper(),e)}createNormalGrouper(){return this.createGrouper(!1)}createReverseGrouper(){return this.createGrouper(!0)}};var Gs=class{constructor(e,t){this._rawInstruction=e,this._anyContinuationLinesRemoved=t.trim(),this._anyPlaceholdersExpanded=this._anyContinuationLinesRemoved}recordExpandedPlaceholders(e){this._anyPlaceholdersExpanded=e}get rawInstruction(){return this._rawInstruction}get anyContinuationLinesRemoved(){return this._anyContinuationLinesRemoved}get anyPlaceholdersExpanded(){return this._anyPlaceholdersExpanded}explainStatement(e){function t(a,o){o!==a&&(s+=` => +`}explanation(t){let i=NI(t,"using regex: ",this.regexAsString());return new Se(i)}regexAsString(){let t=`'${this.regex.source}' with `;switch(this.regex.flags.length){case 0:t+="no flags";break;case 1:t+=`flag '${this.regex.flags}'`;break;default:t+=`flags '${this.regex.flags}'`;break}return t}};function NI(r,e,t){var o;let n=r.match(/\//);if(!n)return"Error explaining instruction. Could not find a slash character";let i=2,s=((o=n.index)!=null?o:i)-i;return`${e.padEnd(s)}${t}`}var Wr=class{constructor(e,t,n,i){this.instruction=e,this.property=t,this.comparator=Wr.maybeReverse(i,n)}static maybeReverse(e,t){return e?Wr.makeReversedComparator(t):t}static makeReversedComparator(e){return(t,n,i)=>e(t,n,i)*-1}};var ai=class{constructor(e,t,n,i){this.instruction=e,this.property=t,this.grouper=n,this.reverse=i}};var ke=class{canCreateFilterForLine(e){return ke.lineMatchesFilter(this.filterRegExp(),e)}static lineMatchesFilter(e,t){return e?e.test(t):!1}static getMatch(e,t){return e?t.match(e):null}fieldNameSingular(){return this.fieldName()}fieldNameSingularEscaped(){return Es(this.fieldNameSingular())}supportsSorting(){return!1}createSorterFromLine(e){if(!this.supportsSorting())return null;let t=ke.getMatch(this.sorterRegExp(),e);if(t===null)return null;let n=!!t[1];return this.createSorter(n)}sorterRegExp(){if(!this.supportsSorting())throw Error(`sorterRegExp() unimplemented for ${this.fieldNameSingular()}`);return new RegExp(`^sort by ${this.fieldNameSingularEscaped()}( reverse)?`,"i")}sorterInstruction(e){let t=`sort by ${this.fieldNameSingular()}`;return e&&(t+=" reverse"),t}comparator(){throw Error(`comparator() unimplemented for ${this.fieldNameSingular()}`)}createSorter(e){return new Wr(this.sorterInstruction(e),this.fieldNameSingular(),this.comparator(),e)}createNormalSorter(){return this.createSorter(!1)}createReverseSorter(){return this.createSorter(!0)}supportsGrouping(){return!1}createGrouperFromLine(e){if(!this.supportsGrouping())return null;let t=ke.getMatch(this.grouperRegExp(),e);if(t===null)return null;let n=!!t[1];return this.createGrouper(n)}grouperRegExp(){if(!this.supportsGrouping())throw Error(`grouperRegExp() unimplemented for ${this.fieldNameSingular()}`);return new RegExp(`^group by ${this.fieldNameSingularEscaped()}( reverse)?$`,"i")}grouperInstruction(e){let t=`group by ${this.fieldNameSingular()}`;return e&&(t+=" reverse"),t}grouper(){throw Error(`grouper() unimplemented for ${this.fieldNameSingular()}`)}createGrouper(e){return new ai(this.grouperInstruction(e),this.fieldNameSingular(),this.grouper(),e)}createNormalGrouper(){return this.createGrouper(!1)}createReverseGrouper(){return this.createGrouper(!0)}};var Un=class{constructor(e,t){this._rawInstruction=e,this._anyContinuationLinesRemoved=t.trim(),this._anyPlaceholdersExpanded=this._anyContinuationLinesRemoved}recordExpandedPlaceholders(e){this._anyPlaceholdersExpanded=e}get rawInstruction(){return this._rawInstruction}get anyContinuationLinesRemoved(){return this._anyContinuationLinesRemoved}get anyPlaceholdersExpanded(){return this._anyPlaceholdersExpanded}explainStatement(e){function t(a,o){o!==a&&(s+=` => ${e}${o}`)}let n=this._rawInstruction.trim(),i=n.split(` `).join(` `+e),s=`${e}${i}`;return this._rawInstruction.includes(` `)&&(s+=` -`+e),t(n,this._anyContinuationLinesRemoved),t(this._anyContinuationLinesRemoved,this._anyPlaceholdersExpanded),s}};var Et=class{constructor(e,t,n){this._statement=new Gs(e,e),this.explanation=n,this.filterFunction=t}get statement(){return this._statement}setStatement(e){this._statement=e}get instruction(){return this._statement.anyPlaceholdersExpanded}explainFilterIndented(e){let t=this.explanation,n=t.asString(),i=this._statement.explainStatement(e);return n===this.instruction?`${i} -`:`${i} => -${t.asString(e+" ")} -`}};var sn=class{constructor(e){this.instruction=e}get queryComponent(){return this._queryComponent}set queryComponent(e){this._queryComponent=e}get error(){return this._error}set error(e){this._error=e}isValid(){return this._queryComponent!==void 0}static fromObject(e,t){let n=new sn(e);return n._queryComponent=t,n}static fromError(e,t){let n=new sn(e);return n._error=t,n}};var re=class{constructor(e){this.object=e}get instruction(){return this.object.instruction}get filter(){return this.object.queryComponent}isValid(){return this.object.isValid()}get error(){return this.object.error}get filterFunction(){if(this.filter)return this.filter.filterFunction}static fromFilter(e){return new re(sn.fromObject(e.instruction,e))}static fromError(e,t){return new re(sn.fromError(e,t))}};var Ae=class extends we{createFilterOrErrorMessage(e){let t=we.getMatch(this.filterRegExp(),e);if(t===null)return re.fromError(e,`do not understand query filter (${this.fieldName()})`);let n=t[1].toLowerCase(),i=t[2],s=null;if(n.includes("include"))s=new $s(i);else if(n.includes("regex")){try{s=ni.validateAndConstruct(i)}catch(u){let l=ji("Parsing regular expression",u)+` +`+e),t(n,this._anyContinuationLinesRemoved),t(this._anyContinuationLinesRemoved,this._anyPlaceholdersExpanded),s}allLinesIdentical(){return this._rawInstruction===this._anyContinuationLinesRemoved&&this._rawInstruction===this._anyPlaceholdersExpanded}};var wt=class{constructor(e,t,n){this._statement=new Un(e,e),this.explanation=n,this.filterFunction=t}get statement(){return this._statement}setStatement(e){this._statement=e}get instruction(){return this._statement.anyPlaceholdersExpanded}explainFilterIndented(e){let t=this._statement.explainStatement(e);return this.onlyNeedsOneLineExplanation()?`${t} +`:`${t} => +${this.explanation.asString(e+" ")} +`}simulateExplainFilter(){return this.onlyNeedsOneLineExplanation()?this.explanation:new Se(this.instruction+" =>",[this.explanation])}onlyNeedsOneLineExplanation(){return this.explanation.asString("")===this.instruction}};var an=class{constructor(e){this.instruction=e}get queryComponent(){return this._queryComponent}set queryComponent(e){this._queryComponent=e}get error(){return this._error}set error(e){this._error=e}isValid(){return this._queryComponent!==void 0}static fromObject(e,t){let n=new an(e);return n._queryComponent=t,n}static fromError(e,t){let n=new an(e);return n._error=t,n}};var ie=class{constructor(e){this.object=e}get instruction(){return this.object.instruction}get filter(){return this.object.queryComponent}isValid(){return this.object.isValid()}get error(){return this.object.error}get filterFunction(){if(this.filter)return this.filter.filterFunction}static fromFilter(e){return new ie(an.fromObject(e.instruction,e))}static fromError(e,t){return new ie(an.fromError(e,t))}};var Ie=class extends ke{createFilterOrErrorMessage(e){let t=ke.getMatch(this.filterRegExp(),e);if(t===null)return ie.fromError(e,`do not understand query filter (${this.fieldName()})`);let n=t[1].toLowerCase(),i=t[2],s=null;if(n.includes("include"))s=new $s(i);else if(n.includes("regex")){try{s=si.validateAndConstruct(i)}catch(u){let l=Gi("Parsing regular expression",u)+` -${ni.helpMessage()}`;return re.fromError(e,l)}if(s===null)return re.fromError(e,`Invalid instruction: '${e}' +${si.helpMessage()}`;return ie.fromError(e,l)}if(s===null)return ie.fromError(e,`Invalid instruction: '${e}' -${ni.helpMessage()}`)}if(s===null)return re.fromError(e,`do not understand query filter (${this.fieldName()})`);let a=n.match(/not/)!==null,o=new Et(e,this.getFilter(s,a),s.explanation(e));return re.fromFilter(o)}fieldPattern(){return this.fieldNameSingularEscaped()}filterOperatorPattern(){return"includes|does not include|regex matches|regex does not match"}filterRegExp(){return new RegExp(`^(?:${this.fieldPattern()}) (${this.filterOperatorPattern()}) (.*)`,"i")}getFilter(e,t){return n=>{let i=e.matches(this.value(n));return t?!i:i}}comparator(){return(e,t)=>this.value(e).localeCompare(this.value(t),void 0,{numeric:!0})}grouper(){return e=>[this.value(e)]}static escapeMarkdownCharacters(e){return e.replace(/\\/g,"\\\\").replace(/_/g,"\\_")}};var $i=class extends Ae{fieldName(){return"description"}value(e){return ye.getInstance().removeAsSubstringFrom(e.description)}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=$i.cleanDescription(e.description),i=$i.cleanDescription(t.description);return n.localeCompare(i,void 0,{numeric:!0})}}static cleanDescription(e){e=ye.getInstance().removeAsSubstringFrom(e);let t=/^\[\[?([^\]]*)]]?/,n=e.match(t);if(n!==null){let i=n[1];e=i.substring(i.indexOf("|")+1)+e.replace(t,"")}return e=this.replaceFormatting(e,/^\*\*([^*]+)\*\*/),e=this.replaceFormatting(e,/^\*([^*]+)\*/),e=this.replaceFormatting(e,/^==([^=]+)==/),e=this.replaceFormatting(e,/^__([^_]+)__/),e=this.replaceFormatting(e,/^_([^_]+)_/),e}static replaceFormatting(e,t){let n=e.match(t);return n!==null&&(e=n[1]+e.replace(t,"")),e}};var Ol=class{findUnexpandedDateText(e){let t=["<%","YYYY-MM-DD"];for(let n of t)if(e.includes(n))return this.unexpandedDateTextMessage(n);return null}unexpandedDateTextMessage(e){return`Instruction contains unexpanded template text: "${e}" - and cannot be interpreted. +${si.helpMessage()}`)}if(s===null)return ie.fromError(e,`do not understand query filter (${this.fieldName()})`);let a=n.match(/not/)!==null,o=new wt(e,this.getFilter(s,a),s.explanation(e));return ie.fromFilter(o)}fieldPattern(){return this.fieldNameSingularEscaped()}filterOperatorPattern(){return"includes|does not include|regex matches|regex does not match"}filterRegExp(){return new RegExp(`^(?:${this.fieldPattern()}) (${this.filterOperatorPattern()}) (.*)`,"i")}getFilter(e,t){return n=>{let i=e.matches(this.value(n));return t?!i:i}}comparator(){return(e,t)=>this.value(e).localeCompare(this.value(t),void 0,{numeric:!0})}grouper(){return e=>[this.value(e)]}static escapeMarkdownCharacters(e){return e.replace(/\\/g,"\\\\").replace(/_/g,"\\_")}};var Yi=class extends Ie{fieldName(){return"description"}value(e){return be.getInstance().removeAsSubstringFrom(e.description)}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=Yi.cleanDescription(e.description),i=Yi.cleanDescription(t.description);return n.localeCompare(i,void 0,{numeric:!0})}}static cleanDescription(e){e=be.getInstance().removeAsSubstringFrom(e);let t=/^\[\[?([^\]]*)]]?/,n=e.match(t);if(n!==null){let i=n[1];e=i.substring(i.indexOf("|")+1)+e.replace(t,"")}return e=this.replaceFormatting(e,/^\*\*([^*]+)\*\*/),e=this.replaceFormatting(e,/^\*([^*]+)\*/),e=this.replaceFormatting(e,/^==([^=]+)==/),e=this.replaceFormatting(e,/^__([^_]+)__/),e=this.replaceFormatting(e,/^_([^_]+)_/),e}static replaceFormatting(e,t){let n=e.match(t);return n!==null&&(e=n[1]+e.replace(t,"")),e}};var El=class{findUnexpandedDateText(e){let t=["<%","YYYY-MM-DD"];for(let n of t)if(e.includes(n))return this.unexpandedDateTextMessage(n);return null}unexpandedDateTextMessage(e){return`Instruction contains unexpanded template text: "${e}" - and cannot be interpreted. Possible causes: - The query is an a template file, and is not intended to be searched. @@ -264,44 +263,67 @@ Possible causes: instead of in to a template file. See: https://publish.obsidian.md/tasks/Advanced/Instruction+contains+unexpanded+template+text -`}};var Dl=class{constructor(e,t){this._instruction=e,this._filter=t}canCreateFilterForLine(e){return e.toLocaleLowerCase()===this._instruction.toLocaleLowerCase()}createFilterOrErrorMessage(e){return this.canCreateFilterForLine(e)?re.fromFilter(new Et(e,this._filter,new Re(e))):re.fromError(e,`do not understand filter: ${e}`)}};var $t=class{constructor(){this._filters=[]}add(e,t){this._filters.push(new Dl(e,t))}canCreateFilterForLine(e){for(let t of this._filters)if(t.canCreateFilterForLine(e))return!0;return!1}createFilterOrErrorMessage(e){for(let t of this._filters){let n=t.createFilterOrErrorMessage(e);if(n.error===void 0)return n}return re.fromError(e,`do not understand filter: ${e}`)}};var dt=class extends we{constructor(t=null){super();t!==null?this.filterInstructions=t:(this.filterInstructions=new $t,this.filterInstructions.add(`has ${this.fieldName()} date`,n=>this.date(n)!==null),this.filterInstructions.add(`no ${this.fieldName()} date`,n=>this.date(n)===null),this.filterInstructions.add(`${this.fieldName()} date is invalid`,n=>{let i=this.date(n);return i!==null&&!i.isValid()}))}canCreateFilterForLine(t){return this.filterInstructions.canCreateFilterForLine(t)?!0:super.canCreateFilterForLine(t)}createFilterOrErrorMessage(t){var p;let n=this.checkForUnexpandedTemplateText(t);if(n)return re.fromError(t,n);let i=this.filterInstructions.createFilterOrErrorMessage(t);if(i.isValid())return i;let s=we.getMatch(this.filterRegExp(),t);if(s===null)return re.fromError(t,"do not understand query filter ("+this.fieldName()+" date)");let a=s[1],o=(p=s[2])==null?void 0:p.toLowerCase(),u=s[3],l=Kt.parseDateRange(u);if(!l.isValid()){let m=Kt.parseDate(a);m.isValid()&&(l=new Ct(m,m))}if(!l.isValid())return re.fromError(t,"do not understand "+this.fieldName()+" date");let c=this.buildFilterFunction(o,l),d=dt.buildExplanation(this.fieldNameForExplanation(),o,this.filterResultIfFieldMissing(),l);return re.fromFilter(new Et(t,c,d))}buildFilterFunction(t,n){let i;switch(t){case"before":i=s=>s?s.isBefore(n.start):this.filterResultIfFieldMissing();break;case"after":i=s=>s?s.isAfter(n.end):this.filterResultIfFieldMissing();break;case"on or before":case"in or before":i=s=>s?s.isSameOrBefore(n.end):this.filterResultIfFieldMissing();break;case"on or after":case"in or after":i=s=>s?s.isSameOrAfter(n.start):this.filterResultIfFieldMissing();break;default:i=s=>s?s.isSameOrAfter(n.start)&&s.isSameOrBefore(n.end):this.filterResultIfFieldMissing()}return this.getFilter(i)}getFilter(t){return n=>t(this.date(n))}filterRegExp(){return new RegExp(`^${this.fieldNameForFilterInstruction()} (((?:on|in) or before|before|(?:on|in) or after|after|on|in)? ?(.*))`,"i")}fieldNameForFilterInstruction(){return this.fieldName()}static buildExplanation(t,n,i,s){let a=n,o="YYYY-MM-DD (dddd Do MMMM YYYY)",u;switch(n){case"before":case"on or after":u=s.start.format(o);break;case"after":case"on or before":u=s.end.format(o);break;case"in or before":a="on or before",u=s.end.format(o);break;case"in or after":a="on or after",u=s.start.format(o);break;default:if(!s.start.isSame(s.end)){let c=`${t} date is between:`,d=[new Re(`${s.start.format(o)} and`),new Re(`${s.end.format(o)} inclusive`)];return i&&d.push(new Re(`OR no ${t} date`)),new Re(c,d)}a="on",u=s.start.format(o);break}let l=`${t} date is ${a} ${u}`;return i&&(l+=` OR no ${t} date`),new Re(l)}fieldNameForExplanation(){return this.fieldName()}supportsSorting(){return!0}comparator(){return(t,n)=>br(this.date(t),this.date(n))}supportsGrouping(){return!0}grouper(){return t=>{let n=this.date(t);return n===null?["No "+this.fieldName()+" date"]:n.isValid()?[n.format("YYYY-MM-DD dddd")]:["%%0%% Invalid "+this.fieldName()+" date"]}}checkForUnexpandedTemplateText(t){return new Ol().findUnexpandedDateText(t)}};var xl=class extends dt{fieldName(){return"created"}date(e){return e.createdDate}filterResultIfFieldMissing(){return!1}};var Rl=class extends dt{fieldName(){return"done"}date(e){return e.doneDate}filterResultIfFieldMissing(){return!1}};var Ys=class extends dt{fieldName(){return"due"}date(e){return e.dueDate}filterResultIfFieldMissing(){return!1}};var an=class extends we{constructor(){super(...arguments);this._filters=new $t}canCreateFilterForLine(t){return this._filters.canCreateFilterForLine(t)}createFilterOrErrorMessage(t){return this._filters.createFilterOrErrorMessage(t)}filterRegExp(){return null}};var Ml=class extends an{constructor(){super(),this._filters.add("exclude sub-items",e=>{if(e.indentation==="")return!0;let t=e.indentation.lastIndexOf(">");return t===-1?!1:/^ ?$/.test(e.indentation.slice(t+1))})}fieldName(){return"exclude"}};var Uo=class extends sn{};function gh(r,e){let t=r.map(([n])=>n);try{let n=e.includes("return")?e:`return ${e}`,i=e&&new Function(...t,n);return i instanceof Function?Uo.fromObject(e,i):Uo.fromError(e,"Error parsing group function")}catch(n){return Uo.fromError(e,ji(`Failed parsing expression "${e}"`,n))}}function yh(r,e){let t=e.map(([n,i])=>i);return r(...t)}function bh(r,e,t){try{return yh(r,e)}catch(n){return ji(`Failed calculating expression "${t}"`,n)}}function Cl(r,e){return[["task",r],["query",e?e.query:null]]}function Aw(r,e,t){let n=Cl(r,t||null),i=gh(n,e);return i.error?i.error:bh(i.queryComponent,n,e)}var Wo=class{constructor(e){this.line=e,this.functionOrError=gh(Cl(null,null),e)}isValid(){return this.functionOrError.isValid()}get parseError(){return this.functionOrError.error}evaluate(e,t){if(!this.isValid())throw Error(`Error: Cannot evaluate an expression which is not valid: "${this.line}" gave error: "${this.parseError}"`);return yh(this.functionOrError.queryComponent,Cl(e,t||null))}evaluateOrCatch(e,t){return this.isValid()?bh(this.functionOrError.queryComponent,Cl(e,t),this.line):`Error: Cannot evaluate an expression which is not valid: "${this.line}" gave error: "${this.parseError}"`}};function Th(r){if(r===null)return"null";let e=typeof r;return e==="object"?r.constructor.name:e}var Al=class extends we{createFilterOrErrorMessage(e){let t=we.getMatch(this.filterRegExp(),e);if(t===null)return re.fromError(e,"Unable to parse line");let n=t[1],i=new Wo(n);return i.isValid()?re.fromFilter(new Et(e,wI(i),new Re(e))):re.fromError(e,i.parseError)}fieldName(){return"function"}filterRegExp(){return new RegExp(`^filter by ${this.fieldNameSingularEscaped()} (.*)`,"i")}supportsSorting(){return!0}sorterRegExp(){return new RegExp(`^sort by ${this.fieldNameSingularEscaped()}( reverse)? (.*)`,"i")}createSorterFromLine(e){let t=we.getMatch(this.sorterRegExp(),e);if(t===null)return null;let n=!!t[1],i=t[2],s=new Wo(i);if(!s.isValid())throw new Error(s.parseError);let a=(o,u,l)=>{try{let c=l.queryContext(),d=this.validateTaskSortKey(s.evaluate(o,c)),p=this.validateTaskSortKey(s.evaluate(u,c));return this.compareTaskSortKeys(d,p)}catch(c){throw c instanceof Error&&(c.message+=`: while evaluating instruction '${e}'`),c}};return new Wr(e,this.fieldNameSingular(),a,n)}validateTaskSortKey(e){function t(n){throw new Error(`"${n}" is not a valid sort key`)}return e===void 0&&t("undefined"),Number.isNaN(e)&&t("NaN (Not a Number)"),Array.isArray(e)&&t("array"),e}compareTaskSortKeys(e,t){let n=Th(e),i=Th(t),s=this.compareTaskSortKeysIfOptionalMoment(e,t,n,i);if(s!==void 0)return s;let a=this.compareTaskSortKeysIfEitherIsNull(e,t);if(a!==void 0)return a;if(n!==i)throw new Error(`Unable to compare two different sort key types '${n}' and '${i}' order`);if(n==="string")return e.localeCompare(t,void 0,{numeric:!0});if(n==="TasksDate")return br(e.moment,t.moment);if(n==="boolean")return Number(t)-Number(e);let o=Number(e)-Number(t);if(isNaN(o))throw new Error(`Unable to determine sort order for sort key types '${n}' and '${i}'`);return o}compareTaskSortKeysIfOptionalMoment(e,t,n,i){let s=n==="Moment",a=i==="Moment";if(s&&a||s&&t===null||a&&e===null)return br(e,t)}compareTaskSortKeysIfEitherIsNull(e,t){if(e===null&&t===null)return 0;if(e===null&&t!==null)return-1;if(e!==null&&t===null)return 1}supportsGrouping(){return!0}createGrouperFromLine(e){let t=we.getMatch(this.grouperRegExp(),e);if(t===null)return null;let n=!!t[1],i=t[2];return new ii(e,"function",EI(i),n)}grouperRegExp(){return new RegExp(`^group by ${this.fieldNameSingularEscaped()}( reverse)? (.*)`,"i")}grouper(){throw Error("grouper() function not valid for FunctionField. Use createGrouperFromLine() instead.")}};function wI(r){return(e,t)=>{let n=t.queryContext();return kI(r,e,n)}}function kI(r,e,t){let n=r.evaluate(e,t);if(typeof n=="boolean")return n;throw Error(`filtering function must return true or false. This returned "${n}".`)}function EI(r){return(e,t)=>{let n=t.queryContext();return SI(e,r,n)}}function SI(r,e,t){try{let n=Aw(r,e,t);return Array.isArray(n)?n.map(s=>s.toString()):n===null?[]:[n.toString()]}catch(n){let i=`Error: Failed calculating expression "${e}". The error message was: `;return n instanceof Error?[i+n.message]:[i+"Unknown error"]}}var Pl=class extends Ae{fieldName(){return"heading"}value(e){return e.precedingHeader?e.precedingHeader:""}supportsSorting(){return!0}supportsGrouping(){return!0}grouper(){return e=>e.precedingHeader===null||e.precedingHeader.length===0?["(No heading)"]:[e.precedingHeader]}};var Bs=class extends Ae{fieldName(){return"path"}value(e){return e.path}supportsSorting(){return!0}supportsGrouping(){return!0}grouper(){return e=>[Ae.escapeMarkdownCharacters(e.path.replace(".md",""))]}};var _h=class extends we{createFilterOrErrorMessage(e){var n;let t=we.getMatch(this.filterRegExp(),e);if(t!==null){let i=t[5],s=null;switch(i.toLowerCase()){case"lowest":s="5";break;case"low":s="4";break;case"none":s="3";break;case"medium":s="2";break;case"high":s="1";break;case"highest":s="0";break}if(s===null)return re.fromError(e,"do not understand priority");let a=e,o;switch((n=t[3])==null?void 0:n.toLowerCase()){case"above":o=u=>u.priority.localeCompare(s)<0;break;case"below":o=u=>u.priority.localeCompare(s)>0;break;case"not":o=u=>u.priority!==s;break;default:o=u=>u.priority===s,a=`${this.fieldName()} is ${i}`}return re.fromFilter(new Et(e,o,new Re(a)))}else return re.fromError(e,"do not understand query filter (priority)")}fieldName(){return"priority"}filterRegExp(){return _h.priorityRegexp}supportsSorting(){return!0}comparator(){return(e,t)=>e.priority.localeCompare(t.priority)}supportsGrouping(){return!0}grouper(){return e=>[e.priorityNameGroupText]}},Gi=_h;Gi.priorityRegexp=/^priority(\s+is)?(\s+(above|below|not))?(\s+(lowest|low|none|medium|high|highest))$/i;var Nl=class extends dt{fieldName(){return"scheduled"}date(e){return e.scheduledDate}filterResultIfFieldMissing(){return!1}};var Il=class extends dt{fieldName(){return"start"}fieldNameForFilterInstruction(){return"starts"}date(e){return e.startDate}filterResultIfFieldMissing(){return!0}};var Fl=class extends dt{constructor(){let e=new $t;e.add("has happens date",t=>this.dates(t).some(n=>n!==null)),e.add("no happens date",t=>!this.dates(t).some(n=>n!==null)),super(e)}fieldName(){return"happens"}fieldNameForExplanation(){return"due, start or scheduled"}date(e){return this.earliestDate(e)}dates(e){return e.happensDates}earliestDate(e){return e.happens.moment}filterResultIfFieldMissing(){return!1}getFilter(e){return t=>this.dates(t).some(n=>e(n))}};var Ll=class extends an{constructor(){super(),this._filters.add("is recurring",e=>e.recurrence!==null),this._filters.add("is not recurring",e=>e.recurrence===null)}fieldName(){return"recurring"}supportsSorting(){return!0}comparator(){return(e,t)=>e.recurrence!==null&&t.recurrence===null?-1:e.recurrence===null&&t.recurrence!==null?1:0}supportsGrouping(){return!0}grouper(){return e=>e.recurrence!==null?["Recurring"]:["Not Recurring"]}};var si=class extends an{constructor(){super(),this._filters.add("done",e=>e.isDone),this._filters.add("not done",e=>!e.isDone)}fieldName(){return"status"}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=si.oldStatusName(e),i=si.oldStatusName(t);return n<i?1:n>i?-1:0}}static oldStatusName(e){return e.status.symbol===" "?"Todo":"Done"}supportsGrouping(){return!0}grouper(){return e=>[si.oldStatusName(e)]}};var Ul=class extends Ae{fieldNamePlural(){return this.fieldNameSingular()+"s"}fieldName(){return`${this.fieldNameSingular()}/${this.fieldNamePlural()}`}fieldPattern(){return`${this.fieldNameSingular()}|${this.fieldNamePlural()}`}filterOperatorPattern(){return`${super.filterOperatorPattern()}|include|do not include`}value(e){return this.values(e).join(", ")}getFilter(e,t){return n=>{let i=e.matchesAnyOf(this.values(n));return t?!i:i}}createGrouper(e){return new ii(this.grouperInstruction(e),this.fieldNamePlural(),this.grouper(),e)}grouperRegExp(){if(!this.supportsGrouping())throw Error(`grouperRegExp() unimplemented for ${this.fieldNameSingular()}`);return new RegExp(`^group by ${this.fieldNamePlural()}( reverse)?$`,"i")}grouperInstruction(e){let t=`group by ${this.fieldNamePlural()}`;return e&&(t+=" reverse"),t}};var Yi=class extends Ul{constructor(){super();this.filterInstructions=new $t,this.filterInstructions.add(`has ${this.fieldNameSingular()}`,t=>this.values(t).length>0),this.filterInstructions.add(`has ${this.fieldNamePlural()}`,t=>this.values(t).length>0),this.filterInstructions.add(`no ${this.fieldNameSingular()}`,t=>this.values(t).length===0),this.filterInstructions.add(`no ${this.fieldNamePlural()}`,t=>this.values(t).length===0)}createFilterOrErrorMessage(t){let n=this.filterInstructions.createFilterOrErrorMessage(t);return n.isValid()?n:super.createFilterOrErrorMessage(t)}canCreateFilterForLine(t){return this.filterInstructions.canCreateFilterForLine(t)?!0:super.canCreateFilterForLine(t)}fieldNameSingular(){return"tag"}values(t){return t.tags}supportsSorting(){return!0}createSorterFromLine(t){let n=t.match(this.sorterRegExp());if(n===null)return null;let i=!!n[1],s=isNaN(+n[2])?1:+n[2],a=Yi.makeCompareByTagComparator(s);return new Wr(t,this.fieldNameSingular(),a,i)}sorterRegExp(){return/^sort by tag( reverse)?[\s]*(\d+)?/i}comparator(){return Yi.makeCompareByTagComparator(1)}static makeCompareByTagComparator(t){return(n,i)=>{if(n.tags.length===0&&i.tags.length===0)return 0;if(n.tags.length===0)return 1;if(i.tags.length===0)return-1;let s=t-1;if(n.tags.length<t&&i.tags.length>=t)return 1;if(i.tags.length<t&&n.tags.length>=t)return-1;if(n.tags.length<t&&i.tags.length<t)return 0;let a=n.tags[s],o=i.tags[s];return a.localeCompare(o,void 0,{numeric:!0})}}supportsGrouping(){return!0}grouper(){return t=>t.tags.length==0?["(No tags)"]:t.tags}};var Hw=pa(Bw());var Js=class extends we{constructor(){super(...arguments);this.basicBooleanRegexp=/(.*(AND|OR|XOR|NOT)\s*[("].*|\(.+\))/g;this.supportedOperators=["AND","OR","XOR","NOT"];this.subFields={}}filterRegExp(){return this.basicBooleanRegexp}createFilterOrErrorMessage(t){return this.parseLine(t)}fieldName(){return"boolean query"}parseLine(t){if(t.length===0)return re.fromError(t,"empty line");let n=Js.preprocessExpression(t);try{let i=(0,Hw.parse)(n);for(let o of i)if(o.name==="IDENTIFIER"&&o.value){let u=o.value.trim();if(!(u in this.subFields)){let l=Gl(u);if(l===null)return re.fromError(t,`couldn't parse sub-expression '${u}'`);if(l.error)return re.fromError(t,`couldn't parse sub-expression '${u}': ${l.error}`);l.filter&&(this.subFields[u]=l.filter)}}else if(o.name==="OPERATOR"){if(o.value==null)return re.fromError(t,"empty operator in boolean query");if(!this.supportedOperators.includes(o.value))return re.fromError(t,`unknown boolean operator '${o.value}'`)}let s=(o,u)=>this.filterTaskWithParsedQuery(o,i,u),a=this.constructExplanation(i);return re.fromFilter(new Et(t,s,a))}catch(i){let s=i instanceof Error?i.message:"unknown error type";return re.fromError(t,`malformed boolean query -- ${s} (check the documentation for guidelines)`)}}static preprocessExpression(t){return t.replace(/\(([^()]+)\)/g,'("$1")')}filterTaskWithParsedQuery(t,n,i){let s=u=>u==="true",a=u=>u?"true":"false",o=[];for(let u of n)if(u.name==="IDENTIFIER"){if(u.value==null)throw Error("null token value");let c=this.subFields[u.value.trim()].filterFunction(t,i);o.push(a(c))}else if(u.name==="OPERATOR")if(u.value==="NOT"){let l=s(o.pop());o.push(a(!l))}else if(u.value==="OR"){let l=s(o.pop()),c=s(o.pop());o.push(a(l||c))}else if(u.value==="AND"){let l=s(o.pop()),c=s(o.pop());o.push(a(l&&c))}else if(u.value==="XOR"){let l=s(o.pop()),c=s(o.pop());o.push(a(l&&!c||!l&&c))}else throw Error("Unsupported operator: "+u.value);else throw Error("Unsupported token type: "+u);return s(o[0])}constructExplanation(t){let n=[];for(let i of t)if(i.name==="IDENTIFIER"){if(i.value==null)throw Error("null token value");let s=this.subFields[i.value.trim()];n.push(s.explanation)}else if(i.name==="OPERATOR")if(i.value==="NOT"){let s=n.pop();n.push(Re.booleanNot([s]))}else if(i.value==="OR"){let s=n.pop(),a=n.pop();n.push(Re.booleanOr([a,s]))}else if(i.value==="AND"){let s=n.pop(),a=n.pop();n.push(Re.booleanAnd([a,s]))}else if(i.value==="XOR"){let s=n.pop(),a=n.pop();n.push(Re.booleanXor([a,s]))}else throw Error("Unsupported operator: "+i.value);else throw Error("Unsupported token type: "+i.name);return n[0]}};var Yl=class extends Ae{fieldName(){return"filename"}value(e){let t=e.filename;return t===null?"":t+".md"}supportsSorting(){return!0}supportsGrouping(){return!0}grouper(){return e=>{let t=e.filename;return t===null?["Unknown Location"]:["[["+t+"]]"]}}};var ea=class extends we{canCreateFilterForLine(e){return!1}createFilterOrErrorMessage(e){return re.fromError(e,"Filtering by urgency is not yet supported")}fieldName(){return"urgency"}filterRegExp(){throw Error(`filterRegExp() unimplemented for ${this.fieldName()}`)}supportsSorting(){return!0}comparator(){return(e,t)=>t.urgency-e.urgency}supportsGrouping(){return!0}grouper(){return e=>[`${e.urgency.toFixed(2)}`]}createGrouper(e){return super.createGrouper(!e)}grouperInstruction(e){return super.grouperInstruction(!e)}};var Bl=class extends Ae{constructor(){super()}fieldName(){return"status.name"}value(e){return e.status.name}supportsSorting(){return!0}supportsGrouping(){return!0}};var cn=class extends we{canCreateFilterForLine(e){let t=new RegExp(`^(?:${this.fieldNameSingularEscaped()})`,"i");return we.lineMatchesFilter(t,e)}createFilterOrErrorMessage(e){let t=we.getMatch(this.filterRegExp(),e);if(t===null)return this.helpMessage(e);let n=t[1].toLowerCase(),i=t[2],s=Jt[i.toUpperCase()];if(!s)return this.helpMessage(e);let a;switch(n){case"is":a=o=>o.status.type===s;break;case"is not":a=o=>o.status.type!==s;break;default:return this.helpMessage(e)}return re.fromFilter(new Et(e,a,new Re(e)))}filterRegExp(){return new RegExp(`^(?:${this.fieldNameSingularEscaped()}) (is|is not) ([^ ]+)$`,"i")}helpMessage(e){let t=Object.values(Jt).filter(i=>i!=="EMPTY").join(" "),n=`Invalid ${this.fieldNameSingular()} instruction: '${e}'. +`}};var Sl=class{constructor(e,t){this._instruction=e,this._filter=t}canCreateFilterForLine(e){return e.toLocaleLowerCase()===this._instruction.toLocaleLowerCase()}createFilterOrErrorMessage(e){return this.canCreateFilterForLine(e)?ie.fromFilter(new wt(e,this._filter,new Se(e))):ie.fromError(e,`do not understand filter: ${e}`)}};var Yt=class{constructor(){this._filters=[]}add(e,t){this._filters.push(new Sl(e,t))}canCreateFilterForLine(e){for(let t of this._filters)if(t.canCreateFilterForLine(e))return!0;return!1}createFilterOrErrorMessage(e){for(let t of this._filters){let n=t.createFilterOrErrorMessage(e);if(n.error===void 0)return n}return ie.fromError(e,`do not understand filter: ${e}`)}};var ut=class extends ke{constructor(t=null){super();t!==null?this.filterInstructions=t:(this.filterInstructions=new Yt,this.filterInstructions.add(`has ${this.fieldName()} date`,n=>this.date(n)!==null),this.filterInstructions.add(`no ${this.fieldName()} date`,n=>this.date(n)===null),this.filterInstructions.add(`${this.fieldName()} date is invalid`,n=>{let i=this.date(n);return i!==null&&!i.isValid()}))}canCreateFilterForLine(t){return this.filterInstructions.canCreateFilterForLine(t)?!0:super.canCreateFilterForLine(t)}createFilterOrErrorMessage(t){var f;let n=this.checkForUnexpandedTemplateText(t);if(n)return ie.fromError(t,n);let i=this.filterInstructions.createFilterOrErrorMessage(t);if(i.isValid())return i;let s=ke.getMatch(this.filterRegExp(),t);if(s===null)return ie.fromError(t,"do not understand query filter ("+this.fieldName()+" date)");let a=s[1],o=(f=s[2])==null?void 0:f.toLowerCase(),u=s[3],l=Qt.parseDateRange(u);if(!l.isValid()){let m=Qt.parseDate(a);m.isValid()&&(l=new Rt(m,m))}if(!l.isValid())return ie.fromError(t,"do not understand "+this.fieldName()+" date");let c=this.buildFilterFunction(o,l),d=ut.buildExplanation(this.fieldNameForExplanation(),o,this.filterResultIfFieldMissing(),l);return ie.fromFilter(new wt(t,c,d))}buildFilterFunction(t,n){let i;switch(t){case"before":i=s=>s?s.isBefore(n.start):this.filterResultIfFieldMissing();break;case"after":i=s=>s?s.isAfter(n.end):this.filterResultIfFieldMissing();break;case"on or before":case"in or before":i=s=>s?s.isSameOrBefore(n.end):this.filterResultIfFieldMissing();break;case"on or after":case"in or after":i=s=>s?s.isSameOrAfter(n.start):this.filterResultIfFieldMissing();break;default:i=s=>s?s.isSameOrAfter(n.start)&&s.isSameOrBefore(n.end):this.filterResultIfFieldMissing()}return this.getFilter(i)}getFilter(t){return n=>t(this.date(n))}filterRegExp(){return new RegExp(`^${this.fieldNameForFilterInstruction()} (((?:on|in) or before|before|(?:on|in) or after|after|on|in)? ?(.*))`,"i")}fieldNameForFilterInstruction(){return this.fieldName()}static buildExplanation(t,n,i,s){let a=n,o="YYYY-MM-DD (dddd Do MMMM YYYY)",u;switch(n){case"before":case"on or after":u=s.start.format(o);break;case"after":case"on or before":u=s.end.format(o);break;case"in or before":a="on or before",u=s.end.format(o);break;case"in or after":a="on or after",u=s.start.format(o);break;default:if(!s.start.isSame(s.end)){let c=`${t} date is between:`,d=[new Se(`${s.start.format(o)} and`),new Se(`${s.end.format(o)} inclusive`)];return i&&d.push(new Se(`OR no ${t} date`)),new Se(c,d)}a="on",u=s.start.format(o);break}let l=`${t} date is ${a} ${u}`;return i&&(l+=` OR no ${t} date`),new Se(l)}fieldNameForExplanation(){return this.fieldName()}supportsSorting(){return!0}comparator(){return(t,n)=>Tr(this.date(t),this.date(n))}supportsGrouping(){return!0}grouper(){return t=>{let n=this.date(t);return n===null?["No "+this.fieldName()+" date"]:n.isValid()?[n.format("YYYY-MM-DD dddd")]:["%%0%% Invalid "+this.fieldName()+" date"]}}checkForUnexpandedTemplateText(t){return new El().findUnexpandedDateText(t)}};var Ol=class extends ut{fieldName(){return"created"}date(e){return e.createdDate}filterResultIfFieldMissing(){return!1}};var Dl=class extends ut{fieldName(){return"done"}date(e){return e.doneDate}filterResultIfFieldMissing(){return!1}};var js=class extends ut{fieldName(){return"due"}date(e){return e.dueDate}filterResultIfFieldMissing(){return!1}};var on=class extends ke{constructor(){super(...arguments);this._filters=new Yt}canCreateFilterForLine(t){return this._filters.canCreateFilterForLine(t)}createFilterOrErrorMessage(t){return this._filters.createFilterOrErrorMessage(t)}filterRegExp(){return null}};var xl=class extends on{constructor(){super(),this._filters.add("exclude sub-items",e=>{if(e.indentation==="")return!0;let t=e.indentation.lastIndexOf(">");return t===-1?!1:/^ ?$/.test(e.indentation.slice(t+1))})}fieldName(){return"exclude"}};var qo=class extends an{};function mh(r,e){let t=r.map(([n])=>n);try{let n=e.includes("return")?e:`return ${e}`,i=e&&new Function(...t,n);return i instanceof Function?qo.fromObject(e,i):qo.fromError(e,"Error parsing group function")}catch(n){return qo.fromError(e,Gi(`Failed parsing expression "${e}"`,n))}}function hh(r,e){let t=e.map(([n,i])=>i);return r(...t)}function gh(r,e,t){try{return hh(r,e)}catch(n){return Gi(`Failed calculating expression "${t}"`,n)}}function Rl(r,e){return[["task",r],["query",e?e.query:null]]}function Rw(r,e,t){let n=Rl(r,t||null),i=mh(n,e);return i.error?i.error:gh(i.queryComponent,n,e)}var $o=class{constructor(e){this.line=e,this.functionOrError=mh(Rl(null,null),e)}isValid(){return this.functionOrError.isValid()}get parseError(){return this.functionOrError.error}evaluate(e,t){if(!this.isValid())throw Error(`Error: Cannot evaluate an expression which is not valid: "${this.line}" gave error: "${this.parseError}"`);return hh(this.functionOrError.queryComponent,Rl(e,t||null))}evaluateOrCatch(e,t){return this.isValid()?gh(this.functionOrError.queryComponent,Rl(e,t),this.line):`Error: Cannot evaluate an expression which is not valid: "${this.line}" gave error: "${this.parseError}"`}};function yh(r){if(r===null)return"null";let e=typeof r;return e==="object"?r.constructor.name:e}var Ml=class extends ke{createFilterOrErrorMessage(e){let t=ke.getMatch(this.filterRegExp(),e);if(t===null)return ie.fromError(e,"Unable to parse line");let n=t[1],i=new $o(n);return i.isValid()?ie.fromFilter(new wt(e,II(i),new Se(e))):ie.fromError(e,i.parseError)}fieldName(){return"function"}filterRegExp(){return new RegExp(`^filter by ${this.fieldNameSingularEscaped()} (.*)`,"i")}supportsSorting(){return!0}sorterRegExp(){return new RegExp(`^sort by ${this.fieldNameSingularEscaped()}( reverse)? (.*)`,"i")}createSorterFromLine(e){let t=ke.getMatch(this.sorterRegExp(),e);if(t===null)return null;let n=!!t[1],i=t[2],s=new $o(i);if(!s.isValid())throw new Error(s.parseError);let a=(o,u,l)=>{try{let c=l.queryContext(),d=this.validateTaskSortKey(s.evaluate(o,c)),f=this.validateTaskSortKey(s.evaluate(u,c));return this.compareTaskSortKeys(d,f)}catch(c){throw c instanceof Error&&(c.message+=`: while evaluating instruction '${e}'`),c}};return new Wr(e,this.fieldNameSingular(),a,n)}validateTaskSortKey(e){function t(n){throw new Error(`"${n}" is not a valid sort key`)}return e===void 0&&t("undefined"),Number.isNaN(e)&&t("NaN (Not a Number)"),Array.isArray(e)&&t("array"),e}compareTaskSortKeys(e,t){let n=yh(e),i=yh(t),s=this.compareTaskSortKeysIfOptionalMoment(e,t,n,i);if(s!==void 0)return s;let a=this.compareTaskSortKeysIfEitherIsNull(e,t);if(a!==void 0)return a;if(n!==i)throw new Error(`Unable to compare two different sort key types '${n}' and '${i}' order`);if(n==="string")return e.localeCompare(t,void 0,{numeric:!0});if(n==="TasksDate")return Tr(e.moment,t.moment);if(n==="boolean")return Number(t)-Number(e);let o=Number(e)-Number(t);if(isNaN(o))throw new Error(`Unable to determine sort order for sort key types '${n}' and '${i}'`);return o}compareTaskSortKeysIfOptionalMoment(e,t,n,i){let s=n==="Moment",a=i==="Moment";if(s&&a||s&&t===null||a&&e===null)return Tr(e,t)}compareTaskSortKeysIfEitherIsNull(e,t){if(e===null&&t===null)return 0;if(e===null&&t!==null)return-1;if(e!==null&&t===null)return 1}supportsGrouping(){return!0}createGrouperFromLine(e){let t=ke.getMatch(this.grouperRegExp(),e);if(t===null)return null;let n=!!t[1],i=t[2];return new ai(e,"function",LI(i),n)}grouperRegExp(){return new RegExp(`^group by ${this.fieldNameSingularEscaped()}( reverse)? (.*)`,"i")}grouper(){throw Error("grouper() function not valid for FunctionField. Use createGrouperFromLine() instead.")}};function II(r){return(e,t)=>{let n=t.queryContext();return FI(r,e,n)}}function FI(r,e,t){let n=r.evaluate(e,t);if(typeof n=="boolean")return n;throw Error(`filtering function must return true or false. This returned "${n}".`)}function LI(r){return(e,t)=>{let n=t.queryContext();return UI(e,r,n)}}function UI(r,e,t){try{let n=Rw(r,e,t);return Array.isArray(n)?n.map(s=>s.toString()):n===null?[]:[n.toString()]}catch(n){let i=`Error: Failed calculating expression "${e}". The error message was: `;return n instanceof Error?[i+n.message]:[i+"Unknown error"]}}var Cl=class extends Ie{fieldName(){return"heading"}value(e){return e.precedingHeader?e.precedingHeader:""}supportsSorting(){return!0}supportsGrouping(){return!0}grouper(){return e=>e.precedingHeader===null||e.precedingHeader.length===0?["(No heading)"]:[e.precedingHeader]}};var Gs=class extends Ie{fieldName(){return"path"}value(e){return e.path}supportsSorting(){return!0}supportsGrouping(){return!0}grouper(){return e=>[Ie.escapeMarkdownCharacters(e.path.replace(".md",""))]}};var bh=class extends ke{createFilterOrErrorMessage(e){var n;let t=ke.getMatch(this.filterRegExp(),e);if(t!==null){let i=t[5],s=null;switch(i.toLowerCase()){case"lowest":s="5";break;case"low":s="4";break;case"none":s="3";break;case"medium":s="2";break;case"high":s="1";break;case"highest":s="0";break}if(s===null)return ie.fromError(e,"do not understand priority");let a=e,o;switch((n=t[3])==null?void 0:n.toLowerCase()){case"above":o=u=>u.priority.localeCompare(s)<0;break;case"below":o=u=>u.priority.localeCompare(s)>0;break;case"not":o=u=>u.priority!==s;break;default:o=u=>u.priority===s,a=`${this.fieldName()} is ${i}`}return ie.fromFilter(new wt(e,o,new Se(a)))}else return ie.fromError(e,"do not understand query filter (priority)")}fieldName(){return"priority"}filterRegExp(){return bh.priorityRegexp}supportsSorting(){return!0}comparator(){return(e,t)=>e.priority.localeCompare(t.priority)}supportsGrouping(){return!0}grouper(){return e=>[e.priorityNameGroupText]}},Bi=bh;Bi.priorityRegexp=/^priority(\s+is)?(\s+(above|below|not))?(\s+(lowest|low|none|medium|high|highest))$/i;var Al=class extends ut{fieldName(){return"scheduled"}date(e){return e.scheduledDate}filterResultIfFieldMissing(){return!1}};var Pl=class extends ut{fieldName(){return"start"}fieldNameForFilterInstruction(){return"starts"}date(e){return e.startDate}filterResultIfFieldMissing(){return!0}};var Nl=class extends ut{constructor(){let e=new Yt;e.add("has happens date",t=>this.dates(t).some(n=>n!==null)),e.add("no happens date",t=>!this.dates(t).some(n=>n!==null)),super(e)}fieldName(){return"happens"}fieldNameForExplanation(){return"due, start or scheduled"}date(e){return this.earliestDate(e)}dates(e){return e.happensDates}earliestDate(e){return e.happens.moment}filterResultIfFieldMissing(){return!1}getFilter(e){return t=>this.dates(t).some(n=>e(n))}};var Il=class extends on{constructor(){super(),this._filters.add("is recurring",e=>e.recurrence!==null),this._filters.add("is not recurring",e=>e.recurrence===null)}fieldName(){return"recurring"}supportsSorting(){return!0}comparator(){return(e,t)=>e.recurrence!==null&&t.recurrence===null?-1:e.recurrence===null&&t.recurrence!==null?1:0}supportsGrouping(){return!0}grouper(){return e=>e.recurrence!==null?["Recurring"]:["Not Recurring"]}};var oi=class extends on{constructor(){super(),this._filters.add("done",e=>e.isDone),this._filters.add("not done",e=>!e.isDone)}fieldName(){return"status"}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=oi.oldStatusName(e),i=oi.oldStatusName(t);return n<i?1:n>i?-1:0}}static oldStatusName(e){return e.status.symbol===" "?"Todo":"Done"}supportsGrouping(){return!0}grouper(){return e=>[oi.oldStatusName(e)]}};var Fl=class extends Ie{fieldNamePlural(){return this.fieldNameSingular()+"s"}fieldName(){return`${this.fieldNameSingular()}/${this.fieldNamePlural()}`}fieldPattern(){return`${this.fieldNameSingular()}|${this.fieldNamePlural()}`}filterOperatorPattern(){return`${super.filterOperatorPattern()}|include|do not include`}value(e){return this.values(e).join(", ")}getFilter(e,t){return n=>{let i=e.matchesAnyOf(this.values(n));return t?!i:i}}createGrouper(e){return new ai(this.grouperInstruction(e),this.fieldNamePlural(),this.grouper(),e)}grouperRegExp(){if(!this.supportsGrouping())throw Error(`grouperRegExp() unimplemented for ${this.fieldNameSingular()}`);return new RegExp(`^group by ${this.fieldNamePlural()}( reverse)?$`,"i")}grouperInstruction(e){let t=`group by ${this.fieldNamePlural()}`;return e&&(t+=" reverse"),t}};var Hi=class extends Fl{constructor(){super();this.filterInstructions=new Yt,this.filterInstructions.add(`has ${this.fieldNameSingular()}`,t=>this.values(t).length>0),this.filterInstructions.add(`has ${this.fieldNamePlural()}`,t=>this.values(t).length>0),this.filterInstructions.add(`no ${this.fieldNameSingular()}`,t=>this.values(t).length===0),this.filterInstructions.add(`no ${this.fieldNamePlural()}`,t=>this.values(t).length===0)}createFilterOrErrorMessage(t){let n=this.filterInstructions.createFilterOrErrorMessage(t);return n.isValid()?n:super.createFilterOrErrorMessage(t)}canCreateFilterForLine(t){return this.filterInstructions.canCreateFilterForLine(t)?!0:super.canCreateFilterForLine(t)}fieldNameSingular(){return"tag"}values(t){return t.tags}supportsSorting(){return!0}createSorterFromLine(t){let n=t.match(this.sorterRegExp());if(n===null)return null;let i=!!n[1],s=isNaN(+n[2])?1:+n[2],a=Hi.makeCompareByTagComparator(s);return new Wr(t,this.fieldNameSingular(),a,i)}sorterRegExp(){return/^sort by tag( reverse)?[\s]*(\d+)?/i}comparator(){return Hi.makeCompareByTagComparator(1)}static makeCompareByTagComparator(t){return(n,i)=>{if(n.tags.length===0&&i.tags.length===0)return 0;if(n.tags.length===0)return 1;if(i.tags.length===0)return-1;let s=t-1;if(n.tags.length<t&&i.tags.length>=t)return 1;if(i.tags.length<t&&n.tags.length>=t)return-1;if(n.tags.length<t&&i.tags.length<t)return 0;let a=n.tags[s],o=i.tags[s];return a.localeCompare(o,void 0,{numeric:!0})}}supportsGrouping(){return!0}grouper(){return t=>t.tags.length==0?["(No tags)"]:t.tags}};var Gw=pa(jw());function ui(r){return new RegExp("["+Es(r)+"]").source}var xh=[["(",")"],["[","]"],["{","}"],['"','"']],qn=class{constructor(e,t,n){this.openFilterChars=e,this.closeFilterChars=t,this.openAndCloseFilterChars=n,this.openFilter=ui(this.openFilterChars),this.closeFilter=ui(this.closeFilterChars)}static allSupportedDelimiters(){let e="",t="",n="";for(let[i,s]of xh)e+=i,t+=s,n+=qn.openAndClosing(i,s);return new qn(e,t,n)}static fromInstructionLine(e){let t=e.trim(),i=/^[A-Z ]*\s*(.*)/.exec(t);if(i){let a=i[1],o=a[0],u=a.slice(-1);for(let[l,c]of xh)if(o===l&&u===c){let d=this.openAndClosing(l,c);return new qn(l,c,d)}}let s="All filters in a Boolean instruction must be inside one of these pairs of delimiter characters: "+xh.map(([a,o])=>a+"..."+o).join(" or ")+". Combinations of those delimiters are no longer supported.";throw new Error(s)}static openAndClosing(e,t){let n=e;return t!=e&&(n+=t),n}};var li=class{static preprocessExpression(e,t){let n=li.splitLine(e,t);return li.getFiltersAndSimplifiedLine(n,t)}static splitLine(e,t){let n=new RegExp("("+t.closeFilter+"\\s*(?:AND|OR|AND +NOT|OR +NOT|XOR)\\s*"+t.openFilter+")"),i=e.split(n),s=new RegExp("(NOT\\s*"+t.openFilter+")"),a=i.flatMap(l=>l.split(s)).filter(l=>l!==""),o=new RegExp("(^"+ui(t.openFilterChars+" ")+"*)"),u=new RegExp("("+ui(t.closeFilterChars+" ")+"*$)");return a.flatMap(l=>l.split(o)).flatMap(l=>l.split(u)).filter(l=>l!=="")}static getFiltersAndSimplifiedLine(e,t){let n="",i=1,s={};e.forEach(l=>{if(!li.isAFilter(l,t))n+=`${l}`;else{let c=`f${i}`;s[c]=l,n+=c,i++}});let a=new RegExp(`(${t.closeFilter})([A-Z])`,"g");n=n.replace(a,"$1 $2");let o=new RegExp(`([A-Z])(${t.openFilter})`,"g");n=n.replace(o,"$1 $2");let u=t.openFilterChars;if(u!='"'&&u!="("){let l=new RegExp(ui(u),"g");n=n.replace(l,"(");let c=t.closeFilterChars,d=new RegExp(ui(c),"g");n=n.replace(d,")")}return{simplifiedLine:n,filters:s}}static isAFilter(e,t){let n=new RegExp("^"+ui(" "+t.openAndCloseFilterChars)+"+$"),i=new RegExp("^ *"+t.closeFilter+" *(AND|OR|XOR) *"+t.openFilter+" *$"),s=new RegExp("^(AND|OR|XOR|NOT) *"+t.openFilter+"$"),a=new RegExp("^"+t.closeFilter+" *(AND|OR|XOR)$");return![n,i,s,a,/^(AND|OR|XOR|NOT)$/].some(u=>RegExp(u).exec(e))}};var $l=class extends ke{constructor(){super();this.supportedOperators=["AND","OR","XOR","NOT"];this.subFields={};let t=qn.allSupportedDelimiters();this.basicBooleanRegexp=new RegExp("(.*(AND|OR|XOR|NOT)\\s*"+t.openFilter+".*|"+t.openFilter+".+"+t.closeFilter+")","g")}filterRegExp(){return this.basicBooleanRegexp}createFilterOrErrorMessage(t){return this.parseLine(t)}fieldName(){return"boolean query"}parseLine(t){if(t.length===0)return ie.fromError(t,"empty line");let n;try{n=qn.fromInstructionLine(t)}catch(o){let u=o instanceof Error?o.message:"unknown error type";return ie.fromError(t,this.helpMessageFromSimpleError(t,u))}let i=li.preprocessExpression(t,n),s=i.simplifiedLine,a=i.filters;try{let o=(0,Gw.parse)(s);for(let c of o)if(c.name==="IDENTIFIER"&&c.value){let d=c.value.trim(),f=a[d];if(c.value=f,!(f in this.subFields)){let m=Go(f);if(m===null)return this.helpMessage(t,`couldn't parse sub-expression '${f}'`,i);if(m.error)return this.helpMessage(t,`couldn't parse sub-expression '${f}': ${m.error}`,i);m.filter&&(this.subFields[f]=m.filter)}}else if(c.name==="OPERATOR"){if(c.value==null)return this.helpMessage(t,"empty operator in boolean query",i);if(!this.supportedOperators.includes(c.value))return this.helpMessage(t,`unknown boolean operator '${c.value}'`,i)}let u=(c,d)=>this.filterTaskWithParsedQuery(c,o,d),l=this.constructExplanation(o);return ie.fromFilter(new wt(t,u,l))}catch(o){let u=o instanceof Error?o.message:"unknown error type";return this.helpMessage(t,`malformed boolean query -- ${u} (check the documentation for guidelines)`,i)}}filterTaskWithParsedQuery(t,n,i){let s=u=>u==="true",a=u=>u?"true":"false",o=[];for(let u of n)if(u.name==="IDENTIFIER"){if(u.value==null)throw Error("null token value");let c=this.subFields[u.value.trim()].filterFunction(t,i);o.push(a(c))}else if(u.name==="OPERATOR")if(u.value==="NOT"){let l=s(o.pop());o.push(a(!l))}else if(u.value==="OR"){let l=s(o.pop()),c=s(o.pop());o.push(a(l||c))}else if(u.value==="AND"){let l=s(o.pop()),c=s(o.pop());o.push(a(l&&c))}else if(u.value==="XOR"){let l=s(o.pop()),c=s(o.pop());o.push(a(l&&!c||!l&&c))}else throw Error("Unsupported operator: "+u.value);else throw Error("Unsupported token type: "+u);return s(o[0])}constructExplanation(t){let n=[];for(let i of t)if(i.name==="IDENTIFIER")this.explainExpression(i,n);else if(i.name==="OPERATOR")this.explainOperator(i,n);else throw Error("Unsupported token type: "+i.name);return n[0]}explainExpression(t,n){if(t.value==null)throw Error("null token value");let i=this.subFields[t.value.trim()],s=this.simulateExplainFilter(i);n.push(s)}simulateExplainFilter(t){return t.simulateExplainFilter()}explainOperator(t,n){if(t.value==="NOT"){let i=n.pop();n.push(Se.booleanNot([i]))}else if(t.value==="OR"){let i=n.pop(),s=n.pop();n.push(Se.booleanOr([s,i]))}else if(t.value==="AND"){let i=n.pop(),s=n.pop();n.push(Se.booleanAnd([s,i]))}else if(t.value==="XOR"){let i=n.pop(),s=n.pop();n.push(Se.booleanXor([s,i]))}else throw Error("Unsupported operator: "+t.value)}helpMessage(t,n,i){let s=i.filters,a=this.stringifySubExpressionsForErrorMessage(s),u=`${this.helpMessageFromSimpleError(t,n)} + +The instruction was converted to the following simplified line: + ${i.simplifiedLine} + +Where the sub-expressions in the simplified line are: +${a} + +For help, see: + https://publish.obsidian.md/tasks/Queries/Combining+Filters +`;return ie.fromError(t,u)}stringifySubExpressionsForErrorMessage(t){return Object.entries(t).map(([n,i])=>` '${n}': '${i}' + => ${this.stringifySubExpressionStatus(i)}`).join(` +`)}stringifySubExpressionStatus(t){let n=Go(t);return n?n.error?`ERROR: + ${n.error.split(` +`).map(s=>s.trim()).join(` + `)}`:"OK":`ERROR: + do not understand query`}helpMessageFromSimpleError(t,n){return`Could not interpret the following instruction as a Boolean combination: + ${t} + +The error message is: + ${n}`}};var jl=class extends Ie{fieldName(){return"filename"}value(e){let t=e.filename;return t===null?"":t+".md"}supportsSorting(){return!0}supportsGrouping(){return!0}grouper(){return e=>{let t=e.filename;return t===null?["Unknown Location"]:["[["+t+"]]"]}}};var Xs=class extends ke{canCreateFilterForLine(e){return!1}createFilterOrErrorMessage(e){return ie.fromError(e,"Filtering by urgency is not yet supported")}fieldName(){return"urgency"}filterRegExp(){throw Error(`filterRegExp() unimplemented for ${this.fieldName()}`)}supportsSorting(){return!0}comparator(){return(e,t)=>t.urgency-e.urgency}supportsGrouping(){return!0}grouper(){return e=>[`${e.urgency.toFixed(2)}`]}createGrouper(e){return super.createGrouper(!e)}grouperInstruction(e){return super.grouperInstruction(!e)}};var Gl=class extends Ie{constructor(){super()}fieldName(){return"status.name"}value(e){return e.status.name}supportsSorting(){return!0}supportsGrouping(){return!0}};var dn=class extends ke{canCreateFilterForLine(e){let t=new RegExp(`^(?:${this.fieldNameSingularEscaped()})`,"i");return ke.lineMatchesFilter(t,e)}createFilterOrErrorMessage(e){let t=ke.getMatch(this.filterRegExp(),e);if(t===null)return this.helpMessage(e);let n=t[1].toLowerCase(),i=t[2],s=er[i.toUpperCase()];if(!s)return this.helpMessage(e);let a;switch(n){case"is":a=o=>o.status.type===s;break;case"is not":a=o=>o.status.type!==s;break;default:return this.helpMessage(e)}return ie.fromFilter(new wt(e,a,new Se(e)))}filterRegExp(){return new RegExp(`^(?:${this.fieldNameSingularEscaped()}) (is|is not) ([^ ]+)$`,"i")}helpMessage(e){let t=Object.values(er).filter(i=>i!=="EMPTY").join(" "),n=`Invalid ${this.fieldNameSingular()} instruction: '${e}'. Allowed options: 'is' and 'is not' (without quotes). Allowed values: ${t} Note: values are case-insensitive, so 'in_progress' works too, for example. - Example: ${this.fieldNameSingular()} is not NON_TASK`;return re.fromError(e,n)}fieldName(){return"status.type"}value(e){return e.status.type}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=cn.groupName(e),i=cn.groupName(t);return n.localeCompare(i,void 0,{numeric:!0})}}supportsGrouping(){return!0}grouper(){return e=>[cn.groupName(e)]}static groupName(e){return e.status.typeGroupText}};var Hl=class extends Ae{fieldName(){return"recurrence"}value(e){return e.recurrence!==null?e.recurrence.toText():""}supportsGrouping(){return!0}grouper(){return e=>e.recurrence!==null?[e.recurrence.toText()]:["None"]}};var Vl=class extends Ae{fieldName(){return"folder"}value(e){return e.file.folder}supportsGrouping(){return!0}grouper(){return e=>[Ae.escapeMarkdownCharacters(this.value(e))]}};var zl=class extends Ae{fieldName(){return"root"}value(e){return e.file.root}supportsGrouping(){return!0}grouper(){return e=>[Ae.escapeMarkdownCharacters(this.value(e))]}};var Kl=class extends Ae{fieldName(){return"backlink"}value(e){let t=e.getLinkText({isFilenameUnique:!0});return t===null?"Unknown Location":t}createFilterOrErrorMessage(e){return re.fromError(e,"backlink field does not support filtering")}canCreateFilterForLine(e){return!1}supportsGrouping(){return!0}grouper(){return e=>{let t=e.filename;if(t===null)return["Unknown Location"];let n=e.precedingHeader;return n===null?["[["+t+"]]"]:[`[[${t}#${n}|${t} > ${n}]]`]}}};var Ql=class extends dt{fieldName(){return"cancelled"}date(e){return e.cancelledDate}filterResultIfFieldMissing(){return!1}};var Xl=class extends an{constructor(){super(),this._filters.add("is blocking",(e,t)=>e.isBlocking(t.allTasks)),this._filters.add("is not blocking",(e,t)=>!e.isBlocking(t.allTasks)),this._filters.add("is blocked",(e,t)=>e.isBlocked(t.allTasks)),this._filters.add("is not blocked",(e,t)=>!e.isBlocked(t.allTasks))}fieldName(){return"blocking"}};var Zl=class extends Ae{constructor(){super();this.filterInstructions=new $t;this.filterInstructions.add("has id",t=>t.id.length>0),this.filterInstructions.add("no id",t=>t.id.length===0)}canCreateFilterForLine(t){return this.filterInstructions.canCreateFilterForLine(t)?!0:super.canCreateFilterForLine(t)}createFilterOrErrorMessage(t){let n=this.filterInstructions.createFilterOrErrorMessage(t);return n.isValid()?n:super.createFilterOrErrorMessage(t)}fieldName(){return"id"}value(t){return t.id}supportsSorting(){return!0}supportsGrouping(){return!0}};var Jl=class extends we{constructor(){super();this.filterInstructions=new $t;this.filterInstructions.add("has depends on",t=>t.dependsOn.length>0),this.filterInstructions.add("no depends on",t=>t.dependsOn.length===0)}canCreateFilterForLine(t){return this.filterInstructions.canCreateFilterForLine(t)?!0:super.canCreateFilterForLine(t)}createFilterOrErrorMessage(t){let n=this.filterInstructions.createFilterOrErrorMessage(t);return n.isValid()?n:re.fromError(t,"Unknown instruction")}fieldName(){return"blocked by"}filterRegExp(){return null}};var Mh=[()=>new Bl,()=>new cn,()=>new si,()=>new Ll,()=>new Gi,()=>new Fl,()=>new Ql,()=>new xl,()=>new Il,()=>new Nl,()=>new Ys,()=>new Rl,()=>new Bs,()=>new Vl,()=>new zl,()=>new Kl,()=>new $i,()=>new Yi,()=>new Pl,()=>new Ml,()=>new Yl,()=>new ea,()=>new Hl,()=>new Al,()=>new Zl,()=>new Jl,()=>new Xl,()=>new Js];function Gl(r){for(let e of Mh){let t=e();if(t.canCreateFilterForLine(r))return t.createFilterOrErrorMessage(r)}return null}function Vw(r){let e=/^sort by /i;if(r.match(e)===null)return null;for(let t of Mh){let i=t().createSorterFromLine(r);if(i)return i}return null}function zw(r){let e=/^group by /i;if(r.match(e)===null)return null;for(let t of Mh){let i=t().createGrouperFromLine(r);if(i)return i}return null}var ec=class{constructor(e,t,n){this.nestingLevel=e,this.displayName=t,this.property=n}};var tc=class{constructor(e,t){this.lastHeadingAtLevel=new Array;this.groupers=t;let i=e.keys().next().value.length;for(let s=0;s<i;s++)this.lastHeadingAtLevel.push("")}getHeadingsForTaskGroup(e){let t=new Array;for(let n=0;n<e.length;n++){let i=e[n];if(i!=this.lastHeadingAtLevel[n]){t.push(new ec(n,i,this.groupers[n].property));for(let s=n;s<e.length;s++)this.lastHeadingAtLevel[s]="";this.lastHeadingAtLevel[n]=i}}return t}};var rc=class{constructor(e){this.children=new Map;this.values=[];this.values=e}generateAllPaths(e=[]){let t=new Map;if(this.children.size==0)return t.set([...e],this.values),t;for(let[n,i]of this.children)e.push(n),i.generateAllPaths(e).forEach((a,o)=>t.set(o,a)),e.pop();return t}};var nc=class extends rc{},ic=class{constructor(e,t,n){this.root=new nc(t),this.buildGroupingTree(e,n)}buildGroupingTree(e,t){let n=[this.root];for(let i of e){let s=[];for(let a of n)for(let o of a.values){let u=i.grouper(o,t);u.length===0&&u.push("");for(let l of u){let c=a.children.get(l);c===void 0&&(c=new nc([]),a.children.set(l,c),s.push(c)),c.values.push(o)}}n=s}}generateTaskTreeStorage(){return this.root.generateAllPaths()}};var sc=class{constructor(e,t){this.groups=e,this.groupHeadings=[],this.tasks=t}setGroupHeadings(e){for(let t of e)this.groupHeadings.push(t)}applyTaskLimit(e){this.tasks=this.tasks.slice(0,e)}tasksAsStringOfLines(){let e="";for(let t of this.tasks)e+=t.toFileLineString()+` + Example: ${this.fieldNameSingular()} is not NON_TASK`;return ie.fromError(e,n)}fieldName(){return"status.type"}value(e){return e.status.type}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=dn.groupName(e),i=dn.groupName(t);return n.localeCompare(i,void 0,{numeric:!0})}}supportsGrouping(){return!0}grouper(){return e=>[dn.groupName(e)]}static groupName(e){return e.status.typeGroupText}};var Yl=class extends Ie{fieldName(){return"recurrence"}value(e){return e.recurrence!==null?e.recurrence.toText():""}supportsGrouping(){return!0}grouper(){return e=>e.recurrence!==null?[e.recurrence.toText()]:["None"]}};var Bl=class extends Ie{fieldName(){return"folder"}value(e){return e.file.folder}supportsGrouping(){return!0}grouper(){return e=>[Ie.escapeMarkdownCharacters(this.value(e))]}};var Hl=class extends Ie{fieldName(){return"root"}value(e){return e.file.root}supportsGrouping(){return!0}grouper(){return e=>[Ie.escapeMarkdownCharacters(this.value(e))]}};var Vl=class extends Ie{fieldName(){return"backlink"}value(e){let t=e.getLinkText({isFilenameUnique:!0});return t===null?"Unknown Location":t}createFilterOrErrorMessage(e){return ie.fromError(e,"backlink field does not support filtering")}canCreateFilterForLine(e){return!1}supportsGrouping(){return!0}grouper(){return e=>{let t=e.filename;if(t===null)return["Unknown Location"];let n=e.precedingHeader;return n===null?["[["+t+"]]"]:[`[[${t}#${n}|${t} > ${n}]]`]}}};var zl=class extends ut{fieldName(){return"cancelled"}date(e){return e.cancelledDate}filterResultIfFieldMissing(){return!1}};var Kl=class extends on{constructor(){super(),this._filters.add("is blocking",(e,t)=>e.isBlocking(t.allTasks)),this._filters.add("is not blocking",(e,t)=>!e.isBlocking(t.allTasks)),this._filters.add("is blocked",(e,t)=>e.isBlocked(t.allTasks)),this._filters.add("is not blocked",(e,t)=>!e.isBlocked(t.allTasks))}fieldName(){return"blocking"}};var Ql=class extends Ie{constructor(){super();this.filterInstructions=new Yt;this.filterInstructions.add("has id",t=>t.id.length>0),this.filterInstructions.add("no id",t=>t.id.length===0)}canCreateFilterForLine(t){return this.filterInstructions.canCreateFilterForLine(t)?!0:super.canCreateFilterForLine(t)}createFilterOrErrorMessage(t){let n=this.filterInstructions.createFilterOrErrorMessage(t);return n.isValid()?n:super.createFilterOrErrorMessage(t)}fieldName(){return"id"}value(t){return t.id}supportsSorting(){return!0}supportsGrouping(){return!0}};var Xl=class extends ke{constructor(){super();this.filterInstructions=new Yt;this.filterInstructions.add("has depends on",t=>t.dependsOn.length>0),this.filterInstructions.add("no depends on",t=>t.dependsOn.length===0)}canCreateFilterForLine(t){return this.filterInstructions.canCreateFilterForLine(t)?!0:super.canCreateFilterForLine(t)}createFilterOrErrorMessage(t){let n=this.filterInstructions.createFilterOrErrorMessage(t);return n.isValid()?n:ie.fromError(t,"Unknown instruction")}fieldName(){return"blocked by"}filterRegExp(){return null}};var Rh=[()=>new Gl,()=>new dn,()=>new oi,()=>new Il,()=>new Bi,()=>new Nl,()=>new zl,()=>new Ol,()=>new Pl,()=>new Al,()=>new js,()=>new Dl,()=>new Gs,()=>new Bl,()=>new Hl,()=>new Vl,()=>new Yi,()=>new Hi,()=>new Cl,()=>new xl,()=>new jl,()=>new Xs,()=>new Yl,()=>new Ml,()=>new Ql,()=>new Xl,()=>new Kl,()=>new $l];function Go(r){for(let e of Rh){let t=e();if(t.canCreateFilterForLine(r))return t.createFilterOrErrorMessage(r)}return null}function Yw(r){let e=/^sort by /i;if(r.match(e)===null)return null;for(let t of Rh){let i=t().createSorterFromLine(r);if(i)return i}return null}function Bw(r){let e=/^group by /i;if(r.match(e)===null)return null;for(let t of Rh){let i=t().createGrouperFromLine(r);if(i)return i}return null}var Zl=class{constructor(e,t,n){this.nestingLevel=e,this.displayName=t,this.property=n}};var Jl=class{constructor(e,t){this.lastHeadingAtLevel=new Array;this.groupers=t;let i=e.keys().next().value.length;for(let s=0;s<i;s++)this.lastHeadingAtLevel.push("")}getHeadingsForTaskGroup(e){let t=new Array;for(let n=0;n<e.length;n++){let i=e[n];if(i!=this.lastHeadingAtLevel[n]){t.push(new Zl(n,i,this.groupers[n].property));for(let s=n;s<e.length;s++)this.lastHeadingAtLevel[s]="";this.lastHeadingAtLevel[n]=i}}return t}};var ec=class{constructor(e){this.children=new Map;this.values=[];this.values=e}generateAllPaths(e=[]){let t=new Map;if(this.children.size==0)return t.set([...e],this.values),t;for(let[n,i]of this.children)e.push(n),i.generateAllPaths(e).forEach((a,o)=>t.set(o,a)),e.pop();return t}};var tc=class extends ec{},rc=class{constructor(e,t,n){this.root=new tc(t),this.buildGroupingTree(e,n)}buildGroupingTree(e,t){let n=[this.root];for(let i of e){let s=[];for(let a of n)for(let o of a.values){let u=i.grouper(o,t);u.length===0&&u.push("");for(let l of u){let c=a.children.get(l);c===void 0&&(c=new tc([]),a.children.set(l,c),s.push(c)),c.values.push(o)}}n=s}}generateTaskTreeStorage(){return this.root.generateAllPaths()}};var nc=class{constructor(e,t){this.groups=e,this.groupHeadings=[],this.tasks=t}setGroupHeadings(e){for(let t of e)this.groupHeadings.push(t)}applyTaskLimit(e){this.tasks=this.tasks.slice(0,e)}tasksAsStringOfLines(){let e="";for(let t of this.tasks)e+=t.toFileLineString()+` `;return e}toString(){let e=` `;e+=`Group names: [${this.groups}] `;for(let t of this.groupHeadings)e+=`${"#".repeat(4+t.nestingLevel)} [${t.property}] ${t.displayName} -`;return e+=this.tasksAsStringOfLines(),e}};var ta=class{constructor(e,t,n){this._groups=new Array;this._totalTaskCount=0;this._totalTaskCount=t.length,this._groupers=e;let s=new ic(e,t,n).generateTaskTreeStorage();this.addTaskGroups(s),this.sortTaskGroups(),this.setGroupsHeadings(s)}get groupers(){return this._groupers}get groups(){return this._groups}totalTasksCount(){return this._totalTaskCount}toString(){let e="";e+=`Groupers (if any): +`;return e+=this.tasksAsStringOfLines(),e}};var Zs=class{constructor(e,t,n){this._groups=new Array;this._totalTaskCount=0;this._totalTaskCount=t.length,this._groupers=e;let s=new rc(e,t,n).generateTaskTreeStorage();this.addTaskGroups(s),this.sortTaskGroups(),this.setGroupsHeadings(s)}get groupers(){return this._groupers}get groups(){return this._groups}totalTasksCount(){return this._totalTaskCount}toString(){let e="";e+=`Groupers (if any): `;for(let n of this._groupers){let i=n.reverse?" reverse":"";e+=`- ${n.property}${i} `}for(let n of this.groups)e+=n.toString(),e+=` --- `;return e+=` ${this.totalTasksCount()} tasks -`,e}addTaskGroups(e){for(let[t,n]of e){let i=new sc(t,n);this.addTaskGroup(i)}}addTaskGroup(e){this._groups.push(e)}sortTaskGroups(){let e=(t,n)=>{let i=t.groups,s=n.groups;for(let a=0;a<i.length;a++){let o=this._groupers[a],u=i[a].localeCompare(s[a],void 0,{numeric:!0});if(u!==0)return o.reverse?-u:u}return 0};this._groups.sort(e)}setGroupsHeadings(e){let t=new tc(e,this._groupers);for(let n of this._groups)n.setGroupHeadings(t.getHeadingsForTaskGroup(n.groups))}applyTaskLimit(e){this._groupers.length!==0&&(this._groups.forEach(t=>{t.applyTaskLimit(e)}),this.recalculateTotalTaskCount())}recalculateTotalTaskCount(){let e=[];this._groups.forEach(n=>{e=[...e,...n.tasks]});let t=[...new Set(e)];this._totalTaskCount=t.length}};var ai=class{constructor(e,t){this.queryPath=e,this.allTasks=[...t]}static fromAllTasks(e){return new ai(void 0,e)}queryContext(){return this.queryPath?hh(this.queryPath,this.allTasks):void 0}};function Kw(r){return`task${r!==1?"s":""}`}var Vi=class{constructor(e,t){this.totalTasksCountBeforeLimit=0;this._searchErrorMessage=void 0;this.taskGroups=e,this.totalTasksCountBeforeLimit=t}get searchErrorMessage(){return this._searchErrorMessage}set searchErrorMessage(e){this._searchErrorMessage=e}get totalTasksCount(){return this.taskGroups.totalTasksCount()}totalTasksCountDisplayText(){let e=this.totalTasksCount,t=this.totalTasksCountBeforeLimit;return e===t?`${e} ${Kw(e)}`:`${e} of ${t} ${Kw(t)}`}get groups(){return this.taskGroups.groups}static fromError(e){let t=new Vi(new ta([],[],ai.fromAllTasks([])),0);return t._searchErrorMessage=e,t}};function Qw(r){return r.endsWith("\\")}function Xw(r){return r.endsWith("\\\\")}function ZI(r){return r.replace(/^[ \t]*/,"")}function JI(r){return r.replace(/[ \t]*\\$/,"")}function eF(r,e){let t=r;return e&&(t=ZI(r)),Xw(t)?t=t.slice(0,-1):Qw(r)&&(t=JI(t)),t}function Zw(r){let e=[],t=!1,n="",i="";for(let s of r.split(` -`)){let a=eF(s,t);t?(n+=` -`+s,i+=" "+a):(n=s,i=a),Xw(s)?t=!1:t=Qw(s),t||(i.trim()!==""&&e.push(new Gs(n,i)),n="",i="")}return e}var ra=class{static by(e,t,n){let i=this.defaultSorters().map(a=>a.comparator),s=[];for(let a of e)s.push(a.comparator);return t.sort(ra.makeCompositeComparator([...s,...i],n))}static defaultSorters(){return[new cn().createNormalSorter(),new ea().createNormalSorter(),new Ys().createNormalSorter(),new Gi().createNormalSorter(),new Bs().createNormalSorter()]}static makeCompositeComparator(e,t){return(n,i)=>{for(let s of e){let a=s(n,i,t);if(a!==0)return a}return 0}}};var Fn=class{constructor(e,t=void 0){this._limit=void 0;this._taskGroupLimit=void 0;this._taskLayoutOptions=new Zr;this._queryLayoutOptions=new ri;this._filters=[];this._error=void 0;this._sorting=[];this._grouping=[];this._ignoreGlobalQuery=!1;this.hideOptionsRegexp=/^(hide|show) (task count|backlink|priority|cancelled date|created date|start date|scheduled date|done date|due date|recurrence rule|edit button|postpone button|urgency|tags|depends on|id)/i;this.shortModeRegexp=/^short/i;this.fullModeRegexp=/^full/i;this.explainQueryRegexp=/^explain/i;this.ignoreGlobalQueryRegexp=/^ignore global query/i;this.logger=Pt.getLogger("tasks.Query");this._queryId="";this.limitRegexp=/^limit (groups )?(to )?(\d+)( tasks?)?/i;this.commentRegexp=/^#.*/;this._queryId=this.generateQueryId(10),this.source=e,this.filePath=t,this.debug(`Creating query: ${this.formatQueryForLogging()}`),Zw(e).forEach(n=>{let i=this.expandPlaceholders(n,t);if(this.error===void 0)try{this.parseLine(i,n)}catch(s){let a;s instanceof Error?a=s.message:a="Unknown error",this.setError(a,i);return}})}parseLine(e,t){switch(!0){case this.shortModeRegexp.test(e):this._queryLayoutOptions.shortMode=!0;break;case this.fullModeRegexp.test(e):this._queryLayoutOptions.shortMode=!1;break;case this.explainQueryRegexp.test(e):this._queryLayoutOptions.explainQuery=!0;break;case this.ignoreGlobalQueryRegexp.test(e):this._ignoreGlobalQuery=!0;break;case this.limitRegexp.test(e):this.parseLimit(e);break;case this.parseSortBy(e):break;case this.parseGroupBy(e):break;case this.hideOptionsRegexp.test(e):this.parseHideOptions(e);break;case this.commentRegexp.test(e):break;case this.parseFilter(e,t):break;default:this.setError("do not understand query",e)}}formatQueryForLogging(){return`[${this.source.split(` +`,e}addTaskGroups(e){for(let[t,n]of e){let i=new nc(t,n);this.addTaskGroup(i)}}addTaskGroup(e){this._groups.push(e)}sortTaskGroups(){let e=(t,n)=>{let i=t.groups,s=n.groups;for(let a=0;a<i.length;a++){let o=this._groupers[a],u=i[a].localeCompare(s[a],void 0,{numeric:!0});if(u!==0)return o.reverse?-u:u}return 0};this._groups.sort(e)}setGroupsHeadings(e){let t=new Jl(e,this._groupers);for(let n of this._groups)n.setGroupHeadings(t.getHeadingsForTaskGroup(n.groups))}applyTaskLimit(e){this._groupers.length!==0&&(this._groups.forEach(t=>{t.applyTaskLimit(e)}),this.recalculateTotalTaskCount())}recalculateTotalTaskCount(){let e=[];this._groups.forEach(n=>{e=[...e,...n.tasks]});let t=[...new Set(e)];this._totalTaskCount=t.length}};var ci=class{constructor(e,t){this.queryPath=e,this.allTasks=[...t]}static fromAllTasks(e){return new ci(void 0,e)}queryContext(){return this.queryPath?ph(this.queryPath,this.allTasks):void 0}};function Hw(r){return`task${r!==1?"s":""}`}var Ki=class{constructor(e,t){this.totalTasksCountBeforeLimit=0;this._searchErrorMessage=void 0;this.taskGroups=e,this.totalTasksCountBeforeLimit=t}get searchErrorMessage(){return this._searchErrorMessage}set searchErrorMessage(e){this._searchErrorMessage=e}get totalTasksCount(){return this.taskGroups.totalTasksCount()}totalTasksCountDisplayText(){let e=this.totalTasksCount,t=this.totalTasksCountBeforeLimit;return e===t?`${e} ${Hw(e)}`:`${e} of ${t} ${Hw(t)}`}get groups(){return this.taskGroups.groups}static fromError(e){let t=new Ki(new Zs([],[],ci.fromAllTasks([])),0);return t._searchErrorMessage=e,t}};function Vw(r){return r.endsWith("\\")}function zw(r){return r.endsWith("\\\\")}function dF(r){return r.replace(/^[ \t]*/,"")}function fF(r){return r.replace(/[ \t]*\\$/,"")}function pF(r,e){let t=r;return e&&(t=dF(r)),zw(t)?t=t.slice(0,-1):Vw(r)&&(t=fF(t)),t}function Kw(r){let e=[],t=!1,n="",i="";for(let s of r.split(` +`)){let a=pF(s,t);t?(n+=` +`+s,i+=" "+a):(n=s,i=a),zw(s)?t=!1:t=Vw(s),t||(i.trim()!==""&&e.push(new Un(n,i)),n="",i="")}return e}var Js=class{static by(e,t,n){let i=this.defaultSorters().map(a=>a.comparator),s=[];for(let a of e)s.push(a.comparator);return t.sort(Js.makeCompositeComparator([...s,...i],n))}static defaultSorters(){return[new dn().createNormalSorter(),new Xs().createNormalSorter(),new js().createNormalSorter(),new Bi().createNormalSorter(),new Gs().createNormalSorter()]}static makeCompositeComparator(e,t){return(n,i)=>{for(let s of e){let a=s(n,i,t);if(a!==0)return a}return 0}}};var $n=class{constructor(e,t=void 0){this._limit=void 0;this._taskGroupLimit=void 0;this._taskLayoutOptions=new Jr;this._queryLayoutOptions=new ii;this._filters=[];this._error=void 0;this._sorting=[];this._grouping=[];this._ignoreGlobalQuery=!1;this.hideOptionsRegexp=/^(hide|show) (task count|backlink|priority|cancelled date|created date|start date|scheduled date|done date|due date|recurrence rule|edit button|postpone button|urgency|tags|depends on|id)/i;this.shortModeRegexp=/^short/i;this.fullModeRegexp=/^full/i;this.explainQueryRegexp=/^explain/i;this.ignoreGlobalQueryRegexp=/^ignore global query/i;this.logger=Ct.getLogger("tasks.Query");this._queryId="";this.limitRegexp=/^limit (groups )?(to )?(\d+)( tasks?)?/i;this.commentRegexp=/^#.*/;this._queryId=this.generateQueryId(10),this.source=e,this.filePath=t,this.debug(`Creating query: ${this.formatQueryForLogging()}`),Kw(e).forEach(n=>{let i=this.expandPlaceholders(n,t);if(this.error===void 0)try{this.parseLine(i,n)}catch(s){let a;s instanceof Error?a=s.message:a="Unknown error",this.setError(a,n);return}})}get queryId(){return this._queryId}parseLine(e,t){switch(!0){case this.shortModeRegexp.test(e):this._queryLayoutOptions.shortMode=!0;break;case this.fullModeRegexp.test(e):this._queryLayoutOptions.shortMode=!1;break;case this.explainQueryRegexp.test(e):this._queryLayoutOptions.explainQuery=!0;break;case this.ignoreGlobalQueryRegexp.test(e):this._ignoreGlobalQuery=!0;break;case this.limitRegexp.test(e):this.parseLimit(e);break;case this.parseSortBy(e):break;case this.parseGroupBy(e):break;case this.hideOptionsRegexp.test(e):this.parseHideOptions(e);break;case this.commentRegexp.test(e):break;case this.parseFilter(e,t):break;default:this.setError("do not understand query",t)}}formatQueryForLogging(){return`[${this.source.split(` `).join(" ; ")}]`}expandPlaceholders(e,t){let n=e.anyContinuationLinesRemoved;if(n.includes("{{")&&n.includes("}}")&&this.filePath===void 0)return this._error=`The query looks like it contains a placeholder, with "{{" and "}}" but no file path has been supplied, so cannot expand placeholder values. The query is: -${n}`,n;let i=n;if(t){let s=Cw(t);try{i=Mw(n,s)}catch(a){return a instanceof Error?this._error=a.message:this._error="Internal error. expandPlaceholders() threw something other than Error.",n}}return e.recordExpandedPlaceholders(i),i}append(e){return this.source===""?e:e.source===""?this:new Fn(`${this.source} -${e.source}`,this.filePath)}explainQuery(){return new qs().explainQuery(this)}get limit(){return this._limit}get taskGroupLimit(){return this._taskGroupLimit}get taskLayoutOptions(){return this._taskLayoutOptions}get queryLayoutOptions(){return this._queryLayoutOptions}get filters(){return this._filters}addFilter(e){this._filters.push(e)}get sorting(){return this._sorting}get grouping(){return this._grouping}get error(){return this._error}setError(e,t){this._error=`${e} -Problem line: "${t}"`}get ignoreGlobalQuery(){return this._ignoreGlobalQuery}applyQueryToTasks(e){this.debug(`Executing query: ${this.formatQueryForLogging()}`);let t=new ai(this.filePath,e);try{this.filters.forEach(o=>{e=e.filter(u=>o.filterFunction(u,t))});let{debugSettings:n}=J(),i=n.ignoreSortInstructions?e:ra.by(this.sorting,e,t),s=i.slice(0,this.limit),a=new ta(this.grouping,s,t);return this._taskGroupLimit!==void 0&&a.applyTaskLimit(this._taskGroupLimit),new Vi(a,i.length)}catch(n){let i="Search failed";return Vi.fromError(ji(i,n))}}parseHideOptions(e){let t=e.match(this.hideOptionsRegexp);if(t!==null){let n=t[1].toLowerCase()==="hide";switch(t[2].toLowerCase()){case"task count":this._queryLayoutOptions.hideTaskCount=n;break;case"backlink":this._queryLayoutOptions.hideBacklinks=n;break;case"postpone button":this._queryLayoutOptions.hidePostponeButton=n;break;case"priority":this._taskLayoutOptions.setVisibility("priority",!n);break;case"cancelled date":this._taskLayoutOptions.setVisibility("cancelledDate",!n);break;case"created date":this._taskLayoutOptions.setVisibility("createdDate",!n);break;case"start date":this._taskLayoutOptions.setVisibility("startDate",!n);break;case"scheduled date":this._taskLayoutOptions.setVisibility("scheduledDate",!n);break;case"due date":this._taskLayoutOptions.setVisibility("dueDate",!n);break;case"done date":this._taskLayoutOptions.setVisibility("doneDate",!n);break;case"recurrence rule":this._taskLayoutOptions.setVisibility("recurrenceRule",!n);break;case"edit button":this._queryLayoutOptions.hideEditButton=n;break;case"urgency":this._queryLayoutOptions.hideUrgency=n;break;case"tags":this._taskLayoutOptions.setTagsVisibility(!n);break;case"id":this._taskLayoutOptions.setVisibility("id",!n);break;case"depends on":this._taskLayoutOptions.setVisibility("dependsOn",!n);break;default:this.setError("do not understand hide/show option",e)}}}parseFilter(e,t){var i;let n=Gl(e);return n!=null?(n.filter?(n.filter.setStatement(t),this._filters.push(n.filter)):this.setError((i=n.error)!=null?i:"Unknown error",e),!0):!1}parseLimit(e){let t=e.match(this.limitRegexp);if(t===null){this.setError("do not understand query limit",e);return}let n=Number.parseInt(t[3],10);t[1]!==void 0?this._taskGroupLimit=n:this._limit=n}parseSortBy(e){let t=Vw(e);return t?(this._sorting.push(t),!0):!1}parseGroupBy(e){let t=zw(e);return t?(this._grouping.push(t),!0):!1}generateQueryId(e){let t="AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz1234567890";return Array.from({length:e},()=>t[Math.floor(Math.random()*t.length)]).join("")}debug(e,t){this.logger.debugWithId(this._queryId,`"${this.filePath}": ${e}`,t)}};var oi=class{constructor(e=oi.empty){this._source=e}static getInstance(){return oi.instance||(oi.instance=new oi),oi.instance}set(e){this._source=e}query(e=void 0){return new Fn(this._source,e)}hasInstructions(){return this._source.trim()!==oi.empty}},kr=oi;kr.empty="";var ac=class{constructor({obsidianEvents:e}){this.logger=Pt.getLogger("tasks.Events");this.obsidianEvents=e}onCacheUpdate(e){return this.logger.debug("TasksEvents.onCacheUpdate()"),this.obsidianEvents.on("obsidian-tasks-plugin:cache-update",e)}triggerCacheUpdate(e){this.logger.debug("TasksEvents.triggerCacheUpdate()"),this.obsidianEvents.trigger("obsidian-tasks-plugin:cache-update",e)}onRequestCacheUpdate(e){return this.logger.debug("TasksEvents.onRequestCacheUpdate()"),this.obsidianEvents.on("obsidian-tasks-plugin:request-cache-update",e)}triggerRequestCacheUpdate(e){this.logger.debug("TasksEvents.triggerRequestCacheUpdate()"),this.obsidianEvents.trigger("obsidian-tasks-plugin:request-cache-update",e)}off(e){this.logger.debug("TasksEvents.off()"),this.obsidianEvents.offref(e)}};var rk=require("obsidian");var tk=require("obsidian");var Ch=class{constructor(e){this.newStatus=e}apply(e){return this.isCheckedForTask(e)?[e]:e.handleNewStatusWithRecurrenceInUsersOrder(this.newStatus)}instructionDisplayName(){return`Change status to: [${this.newStatus.symbol}] ${this.newStatus.name}`}isCheckedForTask(e){return this.newStatus.symbol===e.status.symbol}};function Jw(r){let e=[],t=new Le().coreStatuses.map(n=>n.symbol);for(let n of[!0,!1])for(let i of r.registeredStatuses)t.includes(i.symbol)===n&&e.push(new Ch(i));return e}var ek=require("obsidian");function jo(r,e){return L(this,null,function*(){yield rn({originalTask:r,newTasks:e})})}var na=class extends ek.Menu{constructor(t){super();this.taskSaver=t}addItemsForInstructions(t,n){for(let i of t)this.addItemForInstruction(n,i)}addItemForInstruction(t,n){this.addItem(i=>this.getMenuItemCallback(t,i,n))}getMenuItemCallback(t,n,i){n.setTitle(i.instructionDisplayName()).setChecked(i.isCheckedForTask(t)).onClick(()=>L(this,null,function*(){let s=i.apply(t);(s.length!==1||!Object.is(s[0],t))&&(yield this.taskSaver(t,s))}))}};var oc=class extends na{constructor(e,t,n=jo){super(n);let i=Jw(e);this.addItemsForInstructions(i,t)}};var uc=class{constructor(){this.data=tF}addDataAttribute(e,t,n){this.data[n].addDataAttribute(e,t,n)}addClassName(e,t){let n=this.data[t].className;e.classList.add(n)}},Ah=class{constructor(e,t,n){if(e==="")throw Error("Developer note: CSS class cannot be an empty string, please specify one.");this.className=e,this.attributeName=t,this.attributeValueCalculator=n}addDataAttribute(e,t,n){if(this.attributeName===Ah.noAttributeName)return;let i=this.attributeValueCalculator(n,t);i!==""&&(e.dataset[this.attributeName]=i)}},jr=Ah;jr.noAttributeName="",jr.noAttributeValueCalculator=()=>"",jr.dateAttributeCalculator=(e,t)=>{let i="far";function s(o){let u=window.moment().startOf("day"),l="",c=u.diff(o,"days");return isNaN(c)?null:c===0?"today":(c>0?l+="past-":c<0&&(l+="future-"),Math.abs(c)<=7?l+=Math.abs(c).toString()+"d":l+=i,l)}let a=t[e];if(!Array.isArray(a)&&a instanceof window.moment){let o=s(a);if(o)return o}return""};function $o(r){return new jr(r,jr.noAttributeName,jr.noAttributeValueCalculator)}function ia(r,e){return new jr(r,e,jr.dateAttributeCalculator)}var tF={createdDate:ia("task-created","taskCreated"),dueDate:ia("task-due","taskDue"),startDate:ia("task-start","taskStart"),scheduledDate:ia("task-scheduled","taskScheduled"),doneDate:ia("task-done","taskDone"),cancelledDate:ia("task-cancelled","taskCancelled"),priority:new jr("task-priority","taskPriority",(r,e)=>xn.priorityNameUsingNormal(e.priority).toLocaleLowerCase()),description:$o("task-description"),recurrenceRule:$o("task-recurring"),dependsOn:$o("task-dependsOn"),id:$o("task-id"),blockLink:$o("task-block-link")};function sr(r,e){let t=document.createElement(r);return e.appendChild(t),t}var ui=class{static obsidianMarkdownRenderer(e,t,n,i){return L(this,null,function*(){if(!i)throw new Error("Must call the Obsidian renderer with an Obsidian Component object");yield tk.MarkdownRenderer.renderMarkdown(e,t,n,i)})}constructor({textRenderer:e=ui.obsidianMarkdownRenderer,obsidianComponent:t,parentUlElement:n,taskLayoutOptions:i,queryLayoutOptions:s}){this.textRenderer=e,this.obsidianComponent=t,this.parentUlElement=n,this.taskLayoutOptions=i,this.queryLayoutOptions=s}renderTaskLine(e,t,n){return L(this,null,function*(){let i=sr("li",this.parentUlElement);i.classList.add("task-list-item","plugin-tasks-list-item");let s=sr("span",i);s.classList.add("tasks-list-text"),yield this.taskToHtml(e,s,i);let a=sr("input",i);return a.classList.add("task-list-item-checkbox"),a.type="checkbox",e.status.symbol!==" "&&(a.checked=!0,i.classList.add("is-checked")),e.taskLocation.hasKnownPath&&(a.addEventListener("click",u=>{u.preventDefault(),u.stopPropagation(),a.disabled=!0;let l=e.toggleWithRecurrenceInUsersOrder();rn({originalTask:e,newTasks:l})}),a.addEventListener("contextmenu",u=>{new oc(Oe.getInstance(),e).showAtPosition({x:u.clientX,y:u.clientY})}),a.setAttribute("title","Right-click for options")),i.prepend(a),i.setAttribute("data-task",e.status.symbol.trim()),i.setAttribute("data-line",t.toString()),i.setAttribute("data-task-status-name",e.status.name),i.setAttribute("data-task-status-type",e.status.type),a.setAttribute("data-line",t.toString()),this.queryLayoutOptions.shortMode&&this.addTooltip(e,s,n),i})}taskToHtml(e,t,n){return L(this,null,function*(){let i=new uc,s=Dn.tasksPluginEmoji.taskSerializer;for(let a of this.taskLayoutOptions.shownComponents){let o=s.componentToString(e,this.queryLayoutOptions.shortMode,a);if(o){let u=sr("span",t),l=sr("span",u);yield this.renderComponentText(l,o,a,e),this.addInternalClasses(a,l),i.addClassName(u,a),i.addDataAttribute(u,e,a),i.addDataAttribute(n,e,a)}}for(let a of this.taskLayoutOptions.hiddenComponents)i.addDataAttribute(n,e,a);n.dataset.taskPriority===void 0&&i.addDataAttribute(n,e,"priority")})}renderComponentText(e,t,n,i){return L(this,null,function*(){if(n==="description"){t=ye.getInstance().removeAsWordFromDependingOnSettings(t);let{debugSettings:s}=J();s.showTaskHiddenData&&(t+=`<br>\u{1F41B} <b>${i.lineNumber}</b> . ${i.sectionStart} . ${i.sectionIndex} . '<code>${i.originalMarkdown}</code>'<br>'<code>${i.path}</code>' > '<code>${i.precedingHeader}</code>'<br>`),yield this.textRenderer(t,e,i.path,this.obsidianComponent);let a=e.querySelector("blockquote"),o=a!=null?a:e,u=o.querySelector("p");if(u!==null){for(;u.firstChild;)o.insertBefore(u.firstChild,u);u.remove()}e.querySelectorAll("p").forEach(l=>{l.hasChildNodes()||l.remove()}),e.querySelectorAll(".footnotes").forEach(l=>{l.remove()})}else e.innerHTML=t})}addInternalClasses(e,t){function n(i){let s=/["&\x00\r\n]/g,a=i.replace(s,"-");return a=a.replace(/^[-_]+/,""),a.length>0?a:null}if(e==="description"){let i=t.getElementsByClassName("tag");for(let s=0;s<i.length;s++){let a=i[s].textContent;if(a){let o=n(a),u=i[s];o&&(u.dataset.tagName=o)}}}}addTooltip(e,t,n){let{recurrenceSymbol:i,startDateSymbol:s,createdDateSymbol:a,scheduledDateSymbol:o,dueDateSymbol:u,cancelledDateSymbol:l,doneDateSymbol:c}=Dn.tasksPluginEmoji.taskSerializer.symbols;t.addEventListener("mouseenter",()=>{function d(g,E,R){E&&g.createDiv().setText(p({signifier:R,date:E}))}function p({signifier:g,date:E}){return`${g} ${E.format(Z.dateFormat)} (${E.from(window.moment().startOf("day"))})`}let m=t.createDiv();m.addClasses(["tooltip","pop-up"]),e.recurrence&&m.createDiv().setText(`${i} ${e.recurrence.toText()}`),d(m,e.createdDate,a),d(m,e.startDate,s),d(m,e.scheduledDate,o),d(m,e.dueDate,u),d(m,e.cancelledDate,l),d(m,e.doneDate,c);let b=e.getLinkText({isFilenameUnique:n});b&&m.createDiv().setText(`\u{1F517} ${b}`),t.addEventListener("mouseleave",()=>{m.remove()})})}};var lc=class{constructor({plugin:e}){this.markdownPostProcessor=this._markdownPostProcessor.bind(this);e.registerMarkdownPostProcessor(this._markdownPostProcessor.bind(this))}_markdownPostProcessor(e,t){return L(this,null,function*(){var d;let n=new rk.MarkdownRenderChild(e);t.addChild(n);let i=e.findAll(".task-list-item").filter(p=>{var g;let m=(g=p.textContent)==null?void 0:g.split(` -`);if(m===void 0)return!1;let b=null;for(let E=0;E<m.length;E=E+1)if(m[E]!==""){b=m[E];break}return b===null?!1:ye.getInstance().includedIn(b)});if(i.length===0)return;let s=t.sourcePath,a=t.getSectionInfo(e);if(a===null)return;let o=a.text.split(` -`),u=0,l=[];for(let p=a.lineStart;p<=a.lineEnd;p++){let m=o[p];if(m===void 0)continue;let b=null,g=oe.fromLine({line:m,taskLocation:new yt(s,p,a.lineStart,u,b),fallbackDate:null});g!==null&&(l.push(g),u++)}let c=new ui({obsidianComponent:n,parentUlElement:e,taskLayoutOptions:new Zr,queryLayoutOptions:new ri});for(let p=0;p<i.length;p++){let m=l[p],b=i[p];if(m===void 0||b===void 0)continue;let g=(d=b.getAttr("data-line"))!=null?d:"0",E=Number.parseInt(g,10),R=yield c.renderTaskLine(m,E),x=b.childNodes;for(let $=0;$<x.length;$=$+1){let ee=x[$];ee.nodeName.toLowerCase()==="div"?R.prepend(ee):ee.nodeName.toLowerCase()==="ul"&&R.append(ee)}let v=b.querySelectorAll("[data-footnote-id]"),V=R.querySelectorAll("[data-footnote-id]");if(v.length===V.length)for(let $=0;$<v.length;$++)V[$].replaceWith(v[$]);b.replaceWith(R)}})}};var nk=require("@codemirror/view"),ik=require("obsidian");var sk=()=>nk.ViewPlugin.fromClass(Ph),Ph=class{constructor(e){this.view=e,this.handleClickEvent=this.handleClickEvent.bind(this),this.view.dom.addEventListener("click",this.handleClickEvent)}destroy(){this.view.dom.removeEventListener("click",this.handleClickEvent)}handleClickEvent(e){let{target:t}=e;if(!t||!(t instanceof HTMLInputElement)||t.type!=="checkbox")return!1;let n=t.closest("ul.plugin-tasks-query-result, div.callout-content");if(n){if(n.matches("div.callout-content")){let p=`obsidian-tasks-plugin warning: Tasks cannot add or remove completion dates or make the next copy of a recurring task for tasks written inside a callout when you click their checkboxes in Live Preview. -If you wanted Tasks to do these things, please undo your change, then either click the line of the task and use the "Toggle Task Done" command, or switch to Reading View to click the checkbox.`;console.warn(p),new ik.Notice(p,45e3)}return!1}let{state:i}=this.view,s=this.view.posAtDOM(t),a=i.doc.lineAt(s),o=oe.fromLine({line:a.text,taskLocation:yt.fromUnknownPosition(""),fallbackDate:null});if(o===null)return!1;e.preventDefault();let l=o.toggleWithRecurrenceInUsersOrder().map(p=>p.toFileLineString()).join(i.lineBreak),c=i.update({changes:{from:a.from,to:a.to,insert:l}});this.view.dispatch(c);let d=t.checked;return setTimeout(()=>{t.checked=d},1),!0}};var sa=require("obsidian");function Go(r,e,t){e&&r.push(rF(t))}function rF(r){return`tasks-layout-hide-${r}`}var cc=class{constructor(e){e?this.queryLayoutOptions=e:this.queryLayoutOptions=new ri}getHiddenClasses(){let e=[],t=[[this.queryLayoutOptions.hideUrgency,"urgency"],[this.queryLayoutOptions.hideBacklinks,"backlinks"],[this.queryLayoutOptions.hideEditButton,"edit-button"],[this.queryLayoutOptions.hidePostponeButton,"postpone-button"]];for(let[n,i]of t)Go(e,n,i);return this.queryLayoutOptions.shortMode&&e.push("tasks-layout-short-mode"),e}};function ak(r,e,t,n=void 0){let i="";e.isEmpty()||(i+=`Only tasks containing the global filter '${e.get()}'. - -`);let s=new qs(" "),a=new Fn(r,n);if(!a.ignoreGlobalQuery&&t.hasInstructions()){let o=t.query(n);i+=`Explanation of the global query: +${n}`,n;let i=n;if(t){let s=xw(t);try{i=Dw(n,s)}catch(a){return a instanceof Error?this._error=a.message:this._error="Internal error. expandPlaceholders() threw something other than Error.",n}}return e.recordExpandedPlaceholders(i),i}append(e){return this.source===""?e:e.source===""?this:new $n(`${this.source} +${e.source}`,this.filePath)}explainQuery(){return new Ws().explainQuery(this)}get limit(){return this._limit}get taskGroupLimit(){return this._taskGroupLimit}get taskLayoutOptions(){return this._taskLayoutOptions}get queryLayoutOptions(){return this._queryLayoutOptions}get filters(){return this._filters}addFilter(e){this._filters.push(e)}get sorting(){return this._sorting}get grouping(){return this._grouping}get error(){return this._error}setError(e,t){t.allLinesIdentical()?this._error=`${e} +Problem line: "${t.rawInstruction}"`:this._error=`${e} +Problem statement: +${t.explainStatement(" ")} +`}get ignoreGlobalQuery(){return this._ignoreGlobalQuery}applyQueryToTasks(e){this.debug(`Executing query: ${this.formatQueryForLogging()}`);let t=new ci(this.filePath,e);try{this.filters.forEach(o=>{e=e.filter(u=>o.filterFunction(u,t))});let{debugSettings:n}=X(),i=n.ignoreSortInstructions?e:Js.by(this.sorting,e,t),s=i.slice(0,this.limit),a=new Zs(this.grouping,s,t);return this._taskGroupLimit!==void 0&&a.applyTaskLimit(this._taskGroupLimit),new Ki(a,i.length)}catch(n){let i="Search failed";return Ki.fromError(Gi(i,n))}}parseHideOptions(e){let t=e.match(this.hideOptionsRegexp);if(t!==null){let n=t[1].toLowerCase()==="hide";switch(t[2].toLowerCase()){case"task count":this._queryLayoutOptions.hideTaskCount=n;break;case"backlink":this._queryLayoutOptions.hideBacklinks=n;break;case"postpone button":this._queryLayoutOptions.hidePostponeButton=n;break;case"priority":this._taskLayoutOptions.setVisibility("priority",!n);break;case"cancelled date":this._taskLayoutOptions.setVisibility("cancelledDate",!n);break;case"created date":this._taskLayoutOptions.setVisibility("createdDate",!n);break;case"start date":this._taskLayoutOptions.setVisibility("startDate",!n);break;case"scheduled date":this._taskLayoutOptions.setVisibility("scheduledDate",!n);break;case"due date":this._taskLayoutOptions.setVisibility("dueDate",!n);break;case"done date":this._taskLayoutOptions.setVisibility("doneDate",!n);break;case"recurrence rule":this._taskLayoutOptions.setVisibility("recurrenceRule",!n);break;case"edit button":this._queryLayoutOptions.hideEditButton=n;break;case"urgency":this._queryLayoutOptions.hideUrgency=n;break;case"tags":this._taskLayoutOptions.setTagsVisibility(!n);break;case"id":this._taskLayoutOptions.setVisibility("id",!n);break;case"depends on":this._taskLayoutOptions.setVisibility("dependsOn",!n);break;default:this.setError("do not understand hide/show option",new Un(e,e))}}}parseFilter(e,t){var i;let n=Go(e);return n!=null?(n.filter?(n.filter.setStatement(t),this._filters.push(n.filter)):this.setError((i=n.error)!=null?i:"Unknown error",t),!0):!1}parseLimit(e){let t=e.match(this.limitRegexp);if(t===null){this.setError("do not understand query limit",new Un(e,e));return}let n=Number.parseInt(t[3],10);t[1]!==void 0?this._taskGroupLimit=n:this._limit=n}parseSortBy(e){let t=Yw(e);return t?(this._sorting.push(t),!0):!1}parseGroupBy(e){let t=Bw(e);return t?(this._grouping.push(t),!0):!1}generateQueryId(e){let t="AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz1234567890";return Array.from({length:e},()=>t[Math.floor(Math.random()*t.length)]).join("")}debug(e,t){this.logger.debugWithId(this._queryId,`"${this.filePath}": ${e}`,t)}};var di=class{constructor(e=di.empty){this._source=e}static getInstance(){return di.instance||(di.instance=new di),di.instance}set(e){this._source=e}query(e=void 0){return new $n(this._source,e)}hasInstructions(){return this._source.trim()!==di.empty}},Or=di;Or.empty="";var ic=class{constructor({obsidianEvents:e}){this.logger=Ct.getLogger("tasks.Events");this.obsidianEvents=e}onCacheUpdate(e){return this.logger.debug("TasksEvents.onCacheUpdate()"),this.obsidianEvents.on("obsidian-tasks-plugin:cache-update",e)}triggerCacheUpdate(e){this.logger.debug("TasksEvents.triggerCacheUpdate()"),this.obsidianEvents.trigger("obsidian-tasks-plugin:cache-update",e)}onRequestCacheUpdate(e){return this.logger.debug("TasksEvents.onRequestCacheUpdate()"),this.obsidianEvents.on("obsidian-tasks-plugin:request-cache-update",e)}triggerRequestCacheUpdate(e){this.logger.debug("TasksEvents.triggerRequestCacheUpdate()"),this.obsidianEvents.trigger("obsidian-tasks-plugin:request-cache-update",e)}off(e){this.logger.debug("TasksEvents.off()"),this.obsidianEvents.offref(e)}};var Jw=require("obsidian");var Zw=require("obsidian");var Mh=class{constructor(e){this.newStatus=e}apply(e){return this.isCheckedForTask(e)?[e]:e.handleNewStatusWithRecurrenceInUsersOrder(this.newStatus)}instructionDisplayName(){return`Change status to: [${this.newStatus.symbol}] ${this.newStatus.name}`}isCheckedForTask(e){return this.newStatus.symbol===e.status.symbol}};function Qw(r){let e=[],t=new Le().coreStatuses.map(n=>n.symbol);for(let n of[!0,!1])for(let i of r.registeredStatuses)t.includes(i.symbol)===n&&e.push(new Mh(i));return e}var Xw=require("obsidian");function Yo(r,e){return N(this,null,function*(){yield kr({originalTask:r,newTasks:e})})}var ea=class extends Xw.Menu{constructor(t){super();this.taskSaver=t}addItemsForInstructions(t,n){for(let i of t)this.addItemForInstruction(n,i)}addItemForInstruction(t,n){this.addItem(i=>this.getMenuItemCallback(t,i,n))}getMenuItemCallback(t,n,i){n.setTitle(i.instructionDisplayName()).setChecked(i.isCheckedForTask(t)).onClick(()=>N(this,null,function*(){let s=i.apply(t);(s.length!==1||!Object.is(s[0],t))&&(yield this.taskSaver(t,s))}))}};var sc=class extends ea{constructor(e,t,n=Yo){super(n);let i=Qw(e);this.addItemsForInstructions(i,t)}};var ac=class{constructor(){this.data=mF}addDataAttribute(e,t,n){this.data[n].addDataAttribute(e,t,n)}addClassName(e,t){let n=this.data[t].className;e.classList.add(n)}},Ch=class{constructor(e,t,n){if(e==="")throw Error("Developer note: CSS class cannot be an empty string, please specify one.");this.className=e,this.attributeName=t,this.attributeValueCalculator=n}addDataAttribute(e,t,n){if(this.attributeName===Ch.noAttributeName)return;let i=this.attributeValueCalculator(n,t);i!==""&&(e.dataset[this.attributeName]=i)}},$r=Ch;$r.noAttributeName="",$r.noAttributeValueCalculator=()=>"",$r.dateAttributeCalculator=(e,t)=>{let i="far";function s(o){let l=window.moment().startOf("day").diff(o,"days");if(isNaN(l))return null;if(l===0)return"today";let c="";return l>0?c+="past-":l<0&&(c+="future-"),Math.abs(l)<=7?c+=Math.abs(l).toString()+"d":c+=i,c}let a=t[e];if(!Array.isArray(a)&&a instanceof window.moment){let o=s(a);if(o)return o}return""};function Bo(r){return new $r(r,$r.noAttributeName,$r.noAttributeValueCalculator)}function ta(r,e){return new $r(r,e,$r.dateAttributeCalculator)}var mF={createdDate:ta("task-created","taskCreated"),dueDate:ta("task-due","taskDue"),startDate:ta("task-start","taskStart"),scheduledDate:ta("task-scheduled","taskScheduled"),doneDate:ta("task-done","taskDone"),cancelledDate:ta("task-cancelled","taskCancelled"),priority:new $r("task-priority","taskPriority",(r,e)=>Cn.priorityNameUsingNormal(e.priority).toLocaleLowerCase()),description:Bo("task-description"),recurrenceRule:Bo("task-recurring"),dependsOn:Bo("task-dependsOn"),id:Bo("task-id"),blockLink:Bo("task-block-link")};function ar(r,e){let t=document.createElement(r);return e.appendChild(t),t}var fi=class{static obsidianMarkdownRenderer(e,t,n,i){return N(this,null,function*(){if(!i)throw new Error("Must call the Obsidian renderer with an Obsidian Component object");yield Zw.MarkdownRenderer.renderMarkdown(e,t,n,i)})}constructor({textRenderer:e=fi.obsidianMarkdownRenderer,obsidianComponent:t,parentUlElement:n,taskLayoutOptions:i,queryLayoutOptions:s}){this.textRenderer=e,this.obsidianComponent=t,this.parentUlElement=n,this.taskLayoutOptions=i,this.queryLayoutOptions=s}renderTaskLine(e,t,n){return N(this,null,function*(){let i=ar("li",this.parentUlElement);i.classList.add("task-list-item","plugin-tasks-list-item");let s=ar("span",i);s.classList.add("tasks-list-text"),yield this.taskToHtml(e,s,i);let a=ar("input",i);return a.classList.add("task-list-item-checkbox"),a.type="checkbox",e.status.symbol!==" "&&(a.checked=!0,i.classList.add("is-checked")),e.taskLocation.hasKnownPath&&(a.addEventListener("click",u=>{u.preventDefault(),u.stopPropagation(),a.disabled=!0;let l=e.toggleWithRecurrenceInUsersOrder();kr({originalTask:e,newTasks:l})}),a.addEventListener("contextmenu",u=>{new sc(De.getInstance(),e).showAtPosition({x:u.clientX,y:u.clientY})}),a.setAttribute("title","Right-click for options")),i.prepend(a),i.setAttribute("data-task",e.status.symbol.trim()),i.setAttribute("data-line",t.toString()),i.setAttribute("data-task-status-name",e.status.name),i.setAttribute("data-task-status-type",e.status.type),a.setAttribute("data-line",t.toString()),this.queryLayoutOptions.shortMode&&this.addTooltip(e,s,n),i})}taskToHtml(e,t,n){return N(this,null,function*(){let i=new ac,s=Nr.tasksPluginEmoji.taskSerializer;for(let a of this.taskLayoutOptions.shownComponents){let o=s.componentToString(e,this.queryLayoutOptions.shortMode,a);if(o){let u=ar("span",t),l=ar("span",u);yield this.renderComponentText(l,o,a,e),this.addInternalClasses(a,l),i.addClassName(u,a),i.addDataAttribute(u,e,a),i.addDataAttribute(n,e,a)}}for(let a of this.taskLayoutOptions.hiddenComponents)i.addDataAttribute(n,e,a);n.dataset.taskPriority===void 0&&i.addDataAttribute(n,e,"priority")})}renderComponentText(e,t,n,i){return N(this,null,function*(){if(n==="description"){t=be.getInstance().removeAsWordFromDependingOnSettings(t);let{debugSettings:s}=X();s.showTaskHiddenData&&(t+=`<br>\u{1F41B} <b>${i.lineNumber}</b> . ${i.sectionStart} . ${i.sectionIndex} . '<code>${i.originalMarkdown}</code>'<br>'<code>${i.path}</code>' > '<code>${i.precedingHeader}</code>'<br>`),yield this.textRenderer(t,e,i.path,this.obsidianComponent);let a=e.querySelector("blockquote"),o=a!=null?a:e,u=o.querySelector("p");if(u!==null){for(;u.firstChild;)o.insertBefore(u.firstChild,u);u.remove()}e.querySelectorAll("p").forEach(l=>{l.hasChildNodes()||l.remove()}),e.querySelectorAll(".footnotes").forEach(l=>{l.remove()})}else e.innerHTML=t})}addInternalClasses(e,t){function n(i){let s=/["&\x00\r\n]/g,a=i.replace(s,"-");return a=a.replace(/^[-_]+/,""),a.length>0?a:null}if(e==="description"){let i=t.getElementsByClassName("tag");for(let s=0;s<i.length;s++){let a=i[s].textContent;if(a){let o=n(a),u=i[s];o&&(u.dataset.tagName=o)}}}}addTooltip(e,t,n){let{recurrenceSymbol:i,startDateSymbol:s,createdDateSymbol:a,scheduledDateSymbol:o,dueDateSymbol:u,cancelledDateSymbol:l,doneDateSymbol:c}=Nr.tasksPluginEmoji.taskSerializer.symbols;t.addEventListener("mouseenter",()=>{function d(T,y,E){y&&T.createDiv().setText(f({signifier:E,date:y}))}function f({signifier:T,date:y}){return`${T} ${y.format(J.dateFormat)} (${y.from(window.moment().startOf("day"))})`}let m=t.createDiv();m.addClasses(["tooltip","pop-up"]),e.recurrence&&m.createDiv().setText(`${i} ${e.recurrence.toText()}`),d(m,e.createdDate,a),d(m,e.startDate,s),d(m,e.scheduledDate,o),d(m,e.dueDate,u),d(m,e.cancelledDate,l),d(m,e.doneDate,c);let g=e.getLinkText({isFilenameUnique:n});g&&m.createDiv().setText(`\u{1F517} ${g}`),t.addEventListener("mouseleave",()=>{m.remove()})})}};var oc=class{constructor({plugin:e}){this.markdownPostProcessor=this._markdownPostProcessor.bind(this);e.registerMarkdownPostProcessor(this._markdownPostProcessor.bind(this))}_markdownPostProcessor(e,t){return N(this,null,function*(){var d;let n=new Jw.MarkdownRenderChild(e);t.addChild(n);let i=e.findAll(".task-list-item").filter(f=>{var T;let m=(T=f.textContent)==null?void 0:T.split(` +`);if(m===void 0)return!1;let g=null;for(let y=0;y<m.length;y=y+1)if(m[y]!==""){g=m[y];break}return g===null?!1:be.getInstance().includedIn(g)});if(i.length===0)return;let s=t.sourcePath,a=t.getSectionInfo(e);if(a===null)return;let o=a.text.split(` +`),u=0,l=[];for(let f=a.lineStart;f<=a.lineEnd;f++){let m=o[f];if(m===void 0)continue;let g=null,T=ue.fromLine({line:m,taskLocation:new ht(new Qe(s),f,a.lineStart,u,g),fallbackDate:null});T!==null&&(l.push(T),u++)}let c=new fi({obsidianComponent:n,parentUlElement:e,taskLayoutOptions:new Jr,queryLayoutOptions:new ii});for(let f=0;f<i.length;f++){let m=l[f],g=i[f];if(m===void 0||g===void 0)continue;let T=(d=g.getAttr("data-line"))!=null?d:"0",y=Number.parseInt(T,10),E=yield c.renderTaskLine(m,y),x=g.childNodes;for(let q=0;q<x.length;q=q+1){let ne=x[q];ne.nodeName.toLowerCase()==="div"?E.prepend(ne):ne.nodeName.toLowerCase()==="ul"&&E.append(ne)}let R=g.querySelectorAll("[data-footnote-id]"),$=E.querySelectorAll("[data-footnote-id]");if(R.length===$.length)for(let q=0;q<R.length;q++)$[q].replaceWith(R[q]);g.replaceWith(E)}})}};var ek=require("@codemirror/view"),tk=require("obsidian");var rk=()=>ek.ViewPlugin.fromClass(Ah),Ah=class{constructor(e){this.view=e,this.handleClickEvent=this.handleClickEvent.bind(this),this.view.dom.addEventListener("click",this.handleClickEvent)}destroy(){this.view.dom.removeEventListener("click",this.handleClickEvent)}handleClickEvent(e){let{target:t}=e;if(!t||!(t instanceof HTMLInputElement)||t.type!=="checkbox")return!1;let n=t.closest("ul.plugin-tasks-query-result, div.callout-content");if(n){if(n.matches("div.callout-content")){let f=`obsidian-tasks-plugin warning: Tasks cannot add or remove completion dates or make the next copy of a recurring task for tasks written inside a callout when you click their checkboxes in Live Preview. +If you wanted Tasks to do these things, please undo your change, then either click the line of the task and use the "Toggle Task Done" command, or switch to Reading View to click the checkbox.`;console.warn(f),new tk.Notice(f,45e3)}return!1}let{state:i}=this.view,s=this.view.posAtDOM(t),a=i.doc.lineAt(s),o=ue.fromLine({line:a.text,taskLocation:ht.fromUnknownPosition(new Qe("")),fallbackDate:null});if(o===null)return!1;e.preventDefault();let l=o.toggleWithRecurrenceInUsersOrder().map(f=>f.toFileLineString()).join(i.lineBreak),c=i.update({changes:{from:a.from,to:a.to,insert:l}});this.view.dispatch(c);let d=t.checked;return setTimeout(()=>{t.checked=d},1),!0}};var ra=require("obsidian");function Ho(r,e,t){e&&r.push(hF(t))}function hF(r){return`tasks-layout-hide-${r}`}var uc=class{constructor(e){e?this.queryLayoutOptions=e:this.queryLayoutOptions=new ii}getHiddenClasses(){let e=[],t=[[this.queryLayoutOptions.hideUrgency,"urgency"],[this.queryLayoutOptions.hideBacklinks,"backlinks"],[this.queryLayoutOptions.hideEditButton,"edit-button"],[this.queryLayoutOptions.hidePostponeButton,"postpone-button"]];for(let[n,i]of t)Ho(e,n,i);return this.queryLayoutOptions.shortMode&&e.push("tasks-layout-short-mode"),e}};function nk(r,e,t,n=void 0){let i="";e.isEmpty()||(i+=`Only tasks containing the global filter '${e.get()}'. + +`);let s=new Ws(" "),a=new $n(r,n);if(!a.ignoreGlobalQuery&&t.hasInstructions()){let o=t.query(n);i+=`Explanation of the global query: ${s.explainQuery(o)} `}return i+=`Explanation of this Tasks code block query: -${s.explainQuery(a)}`,i}function dc(r,e,t){let n=new Fn(r,t);return n.ignoreGlobalQuery?n:e.query(t).append(n)}function ok(r){for(let t of oe.allDateFields()){let n=r[t];if(n&&!n.isValid())return!1}let e=r.happensDates.some(t=>!!(t!=null&&t.isValid()));return!r.isDone&&e}function fc(r){return r.dueDate?"dueDate":r.scheduledDate?"scheduledDate":r.startDate?"startDate":null}function Nh(r,e,t,n){let i=r[e];return lk(i,r,e,t,n)}function uk(r,e,t,n){let i=window.moment();return lk(i,r,e,t,n)}function lk(r,e,t,n,i){let s=new Ye(r).postpone(n,i),a=wt.removeInferredStatusIfNeeded(e,[new oe(be(X({},e),{[t]:s}))])[0];return{postponedDate:s,postponedTask:a}}function ck(r,e){let t=r==null?void 0:r.format("DD MMM YYYY");return`Task's ${e} changed to ${t}`}function dk(r,e,t){return`\u2139\uFE0F ${Ih(r,e,t)} (right-click for more options)`}function nF(r){return r.charAt(0).toUpperCase()+r.slice(1)}function Ih(r,e,t){let n=fc(r),i=r[n];return pk(n,i,e,t)}function fk(r,e,t){let n=fc(r),i=window.moment().startOf("day");return pk(n,i,e,t)}function pk(r,e,t,n){let s=new Ye(e).postpone(n,t).format("ddd Do MMM"),a=t!=1?t:"a";return e.isSameOrBefore(window.moment(),"day")?`${nF(r.replace("Date",""))} in ${a} ${n}, on ${s}`.replace(" in 0 days"," today").replace("in a day","tomorrow"):`Postpone ${r.replace("Date"," date")} by ${a} ${n}, to ${s}`}var pc=class{constructor(e){e?this.taskLayoutOptions=e:this.taskLayoutOptions=new Zr}generateHiddenClasses(){let e=[];return this.taskLayoutOptions.toggleableComponents.forEach(t=>{Go(e,!this.taskLayoutOptions.isShown(t),t)}),Go(e,!this.taskLayoutOptions.areTagsShown(),"tags"),e}};var Fh=require("obsidian");var li=class extends na{constructor(e,t,n=jo){super(n);let i=(l,c,d,p,m,b)=>{let g=m(t,p,d);c.setTitle(g).onClick(()=>li.postponeOnClickCallback(l,t,p,d,b,n))},s=fk,a=uk;this.addItem(l=>i(e,l,"days",0,s,a)),this.addItem(l=>i(e,l,"day",1,s,a)),this.addSeparator();let o=Ih,u=Nh;this.addItem(l=>i(e,l,"days",2,o,u)),this.addItem(l=>i(e,l,"days",3,o,u)),this.addItem(l=>i(e,l,"days",4,o,u)),this.addItem(l=>i(e,l,"days",5,o,u)),this.addItem(l=>i(e,l,"days",6,o,u)),this.addSeparator(),this.addItem(l=>i(e,l,"week",1,o,u)),this.addItem(l=>i(e,l,"weeks",2,o,u)),this.addItem(l=>i(e,l,"weeks",3,o,u)),this.addItem(l=>i(e,l,"month",1,o,u))}static postponeOnClickCallback(o,u,l,c){return L(this,arguments,function*(e,t,n,i,s=Nh,a=jo){let d=fc(t);if(d===null){let b="\u26A0\uFE0F Postponement requires a date: due, scheduled or start.";return new Fh.Notice(b,1e4)}let{postponedDate:p,postponedTask:m}=s(t,d,i,n);yield a(t,m),li.postponeSuccessCallback(e,d,p)})}static postponeSuccessCallback(e,t,n){e.style.pointerEvents="none";let i=ck(n,t);new Fh.Notice(i,2e3)}};var mc=class{constructor({plugin:e,events:t}){this.addQueryRenderChild=this._addQueryRenderChild.bind(this);this.app=e.app,this.plugin=e,this.events=t,e.registerMarkdownCodeBlockProcessor("tasks",this._addQueryRenderChild.bind(this))}_addQueryRenderChild(e,t,n){return L(this,null,function*(){n.addChild(new Lh({app:this.app,plugin:this.plugin,events:this.events,container:t,source:e,filePath:n.sourcePath}))})}},Lh=class extends sa.MarkdownRenderChild{constructor({app:t,plugin:n,events:i,container:s,source:a,filePath:o}){super(s);switch(this.app=t,this.plugin=n,this.events=i,this.source=a,this.filePath=o,this.containerEl.className){case"block-language-tasks":this.query=dc(this.source,kr.getInstance(),this.filePath),this.queryType="tasks";break;default:this.query=dc(this.source,kr.getInstance(),this.filePath),this.queryType="tasks";break}}onload(){this.events.triggerRequestCacheUpdate(this.render.bind(this)),this.renderEventRef=this.events.onCacheUpdate(this.render.bind(this)),this.reloadQueryAtMidnight()}onunload(){this.renderEventRef!==void 0&&this.events.off(this.renderEventRef),this.queryReloadTimeout!==void 0&&clearTimeout(this.queryReloadTimeout)}reloadQueryAtMidnight(){let t=new Date;t.setHours(24,0,0,0);let n=new Date,i=t.getTime()-n.getTime();this.queryReloadTimeout=setTimeout(()=>{this.query=dc(this.source,kr.getInstance(),this.filePath),this.events.triggerRequestCacheUpdate(this.render.bind(this)),this.reloadQueryAtMidnight()},i+1e3)}render(i){return L(this,arguments,function*({tasks:t,state:n}){var a;let s=sr("div",this.containerEl);n==="Warm"&&this.query.error===void 0?yield this.renderQuerySearchResults(t,n,s):this.query.error!==void 0?this.renderErrorMessage(s,this.query.error):this.renderLoadingMessage(s),(a=this.containerEl.firstChild)==null||a.replaceWith(s)})}renderQuerySearchResults(t,n,i){return L(this,null,function*(){this.query.debug(`[render] Render called: plugin state: ${n}; searching ${t.length} tasks`),this.query.queryLayoutOptions.explainQuery&&this.createExplanation(i);let s=this.query.applyQueryToTasks(t);if(s.searchErrorMessage!==void 0){this.renderErrorMessage(i,s.searchErrorMessage);return}yield this.addAllTaskGroups(s.taskGroups,i);let a=s.totalTasksCount;this.addTaskCount(i,s),this.query.debug(`[render] ${a} tasks displayed`)})}renderErrorMessage(t,n){t.createDiv().innerHTML=`<pre>Tasks query: ${n.replace(/\n/g,"<br>")}</pre>`}renderLoadingMessage(t){t.setText("Loading Tasks ...")}createExplanation(t){let n=ak(this.source,ye.getInstance(),kr.getInstance(),this.filePath),i=sr("pre",t);i.addClasses(["plugin-tasks-query-explanation"]),i.setText(n),t.appendChild(i)}createTaskList(t,n){return L(this,null,function*(){let i=sr("ul",n);i.addClasses(["contains-task-list","plugin-tasks-query-result"]);let s=new pc(this.query.taskLayoutOptions);i.addClasses(s.generateHiddenClasses());let a=new cc(this.query.queryLayoutOptions);i.addClasses(a.getHiddenClasses());let o=this.getGroupingAttribute();o&&o.length>0&&(i.dataset.taskGroupBy=o);let u=new ui({obsidianComponent:this,parentUlElement:i,taskLayoutOptions:this.query.taskLayoutOptions,queryLayoutOptions:this.query.queryLayoutOptions});for(let[l,c]of t.entries()){let d=this.isFilenameUnique({task:c}),p=yield u.renderTaskLine(c,l,d);p.querySelectorAll("[data-footnote-id]").forEach(E=>E.remove());let b=p.createSpan("task-extras");this.query.queryLayoutOptions.hideUrgency||this.addUrgency(b,c);let g=this.query.queryLayoutOptions.shortMode;this.query.queryLayoutOptions.hideBacklinks||this.addBacklinks(b,c,g,d),this.query.queryLayoutOptions.hideEditButton||this.addEditButton(b,c,this.plugin.getTasks()),!this.query.queryLayoutOptions.hidePostponeButton&&ok(c)&&this.addPostponeButton(b,c,g),i.appendChild(p)}n.appendChild(i)})}addEditButton(t,n,i){let s=sr("a",t);s.addClass("tasks-edit"),s.title="Edit task",s.href="#",s.onClickEvent(a=>{a.preventDefault();let o=l=>L(this,null,function*(){yield rn({originalTask:n,newTasks:wt.removeInferredStatusIfNeeded(n,l)})});new ti({app:this.app,task:n,onSubmit:o,allTasks:i}).open()})}addUrgency(t,n){let i=new Intl.NumberFormat().format(n.urgency);t.createSpan({text:i,cls:"tasks-urgency"})}addAllTaskGroups(t,n){return L(this,null,function*(){for(let i of t.groups)yield this.addGroupHeadings(n,i.groupHeadings),yield this.createTaskList(i.tasks,n)})}addGroupHeadings(t,n){return L(this,null,function*(){for(let i of n)yield this.addGroupHeading(t,i)})}addGroupHeading(t,n){return L(this,null,function*(){let i="h6";n.nestingLevel===0?i="h4":n.nestingLevel===1&&(i="h5");let s=sr(i,t);s.addClass("tasks-group-heading"),yield sa.MarkdownRenderer.renderMarkdown(n.displayName,s,this.filePath,this)})}addBacklinks(t,n,i,s){var c;let a=t.createSpan({cls:"tasks-backlink"});i||a.append(" (");let o=sr("a",a);o.rel="noopener",o.target="_blank",o.addClass("internal-link"),i&&o.addClass("internal-link-short-mode");let u;i?u=" \u{1F517}":u=(c=n.getLinkText({isFilenameUnique:s}))!=null?c:"",o.setText(u);let l=this.app.vault;o.addEventListener("click",d=>L(this,null,function*(){let p=yield Xm(n,l);if(p){let[m,b]=p,g=this.app.workspace.getLeaf(sa.Keymap.isModEvent(d));d.preventDefault(),yield g.openFile(b,{eState:{line:m}})}})),o.addEventListener("mousedown",d=>L(this,null,function*(){if(d.button===1){let p=yield Xm(n,l);if(p){let[m,b]=p,g=this.app.workspace.getLeaf("tab");d.preventDefault(),yield g.openFile(b,{eState:{line:m}})}}})),i||a.append(")")}addPostponeButton(t,n,i){let a="day",o=dk(n,1,a),u=sr("a",t);u.addClass("tasks-postpone"),i&&u.addClass("tasks-postpone-short-mode"),u.title=o,u.addEventListener("click",l=>{l.preventDefault(),l.stopPropagation(),li.postponeOnClickCallback(u,n,1,a)}),u.addEventListener("contextmenu",l=>L(this,null,function*(){l.preventDefault(),l.stopPropagation(),new li(u,n).showAtPosition({x:l.clientX,y:l.clientY})}))}addTaskCount(t,n){this.query.queryLayoutOptions.hideTaskCount||t.createDiv({text:n.totalTasksCountDisplayText(),cls:"tasks-count"})}isFilenameUnique({task:t}){let n=t.path.match(/([^/]*)\..+$/i);if(n===null)return;let i=n[1];return this.app.vault.getMarkdownFiles().filter(a=>{if(a.basename===i)return!0}).length<2}getGroupingAttribute(){let t=[];for(let n of this.query.grouping)t.push(n.property);return t.join(",")}};var ke=require("obsidian");var hc=class{constructor(e){this._markdown="";this.columnNames=e,this.addTitleRow()}get markdown(){return this._markdown}addTitleRow(){let e="|",t="|";this.columnNames.forEach(n=>{e+=` ${n} |`,t+=" ----- |"}),this._markdown+=`${e} +${s.explainQuery(a)}`,i}function lc(r,e,t){let n=new $n(r,t);return n.ignoreGlobalQuery?n:e.query(t).append(n)}function ik(r){for(let t of ue.allDateFields()){let n=r[t];if(n&&!n.isValid())return!1}let e=r.happensDates.some(t=>!!(t!=null&&t.isValid()));return!r.isDone&&e}function Vo(r){return r.dueDate?"dueDate":r.scheduledDate?"scheduledDate":r.startDate?"startDate":null}function Ph(r,e,t,n){let i=r[e];return ok(i,r,e,t,n)}function sk(r,e,t,n){let i=window.moment();return ok(i,r,e,t,n)}function ak(r,e,t,n){return uk(r,e,null)}function ok(r,e,t,n,i){let s=new Ge(r).postpone(n,i);return uk(e,t,s)}function uk(r,e,t){let n=vt.removeInferredStatusIfNeeded(r,[new ue(_e(Q({},r),{[e]:t}))])[0];return{postponedDate:t,postponedTask:n}}function lk(r,e){if(r){let t=r==null?void 0:r.format("DD MMM YYYY");return`Task's ${e} changed to ${t}`}else return`Task's ${e} removed`}function ck(r,e,t){return`\u2139\uFE0F ${Nh(r,e,t)} (right-click for more options)`}function Nh(r,e,t){let n=Vo(r),i=r[n];return mk(n,i,e,t)}function dk(r,e,t){let n=Vo(r),i=window.moment().startOf("day");return mk(n,i,e,t)}function fk(r,e,t){let n=Vo(r);return n==="scheduledDate"&&r.scheduledDateIsInferred?"Cannot remove inferred scheduled date":`Remove ${pk(n)}`}function gF(r){return Cs(r.replace("Date",""))}function pk(r){return r.replace("Date"," date")}function mk(r,e,t,n){let s=new Ge(e).postpone(n,t).format("ddd Do MMM"),a=t!=1?t:"a";return e.isSameOrBefore(window.moment(),"day")?`${gF(r)} in ${a} ${n}, on ${s}`.replace(" in 0 days"," today").replace("in a day","tomorrow"):`Postpone ${pk(r)} by ${a} ${n}, to ${s}`}var cc=class{constructor(e){e?this.taskLayoutOptions=e:this.taskLayoutOptions=new Jr}generateHiddenClasses(){let e=[];return this.taskLayoutOptions.toggleableComponents.forEach(t=>{Ho(e,!this.taskLayoutOptions.isShown(t),t)}),Ho(e,!this.taskLayoutOptions.areTagsShown(),"tags"),e}};var Ih=require("obsidian");var pi=class extends ea{constructor(e,t,n=Yo){super(n);let i=(l,c,d,f,m,g)=>{let T=m(t,f,d);c.setTitle(T).onClick(()=>pi.postponeOnClickCallback(l,t,f,d,g,n))},s=dk,a=sk;this.addItem(l=>i(e,l,"days",0,s,a)),this.addItem(l=>i(e,l,"day",1,s,a)),this.addSeparator();let o=Nh,u=Ph;this.addItem(l=>i(e,l,"days",2,o,u)),this.addItem(l=>i(e,l,"days",3,o,u)),this.addItem(l=>i(e,l,"days",4,o,u)),this.addItem(l=>i(e,l,"days",5,o,u)),this.addItem(l=>i(e,l,"days",6,o,u)),this.addSeparator(),this.addItem(l=>i(e,l,"week",1,o,u)),this.addItem(l=>i(e,l,"weeks",2,o,u)),this.addItem(l=>i(e,l,"weeks",3,o,u)),this.addItem(l=>i(e,l,"month",1,o,u)),this.addSeparator(),this.addItem(l=>i(e,l,"days",2,fk,ak))}static postponeOnClickCallback(o,u,l,c){return N(this,arguments,function*(e,t,n,i,s=Ph,a=Yo){let d=Vo(t);if(d===null){let g="\u26A0\uFE0F Postponement requires a date: due, scheduled or start.";return new Ih.Notice(g,1e4)}let{postponedDate:f,postponedTask:m}=s(t,d,i,n);yield a(t,m),pi.postponeSuccessCallback(e,d,f)})}static postponeSuccessCallback(e,t,n){e.style.pointerEvents="none";let i=lk(n,t);new Ih.Notice(i,2e3)}};var zo=class{constructor(e){this.label=e,this.start()}start(){!this.recordTimings()||performance.mark(this.labelForStart())}finish(){!this.recordTimings()||(performance.mark(this.labelForEnd()),performance.measure(this.label,this.labelForStart(),this.labelForEnd()),this.printDuration())}printDuration(){let e=performance.getEntriesByName(this.label),t=e[e.length-1];t?console.log(this.label+":",t.duration,"milliseconds"):console.log(`Measurement for ${this.label} not found`)}labelForStart(){return`${this.label} - start`}labelForEnd(){return`${this.label} - end`}recordTimings(){let{debugSettings:e}=X();return e.recordTimings}};var dc=class{constructor({plugin:e,events:t}){this.addQueryRenderChild=this._addQueryRenderChild.bind(this);this.app=e.app,this.plugin=e,this.events=t,e.registerMarkdownCodeBlockProcessor("tasks",this._addQueryRenderChild.bind(this))}_addQueryRenderChild(e,t,n){return N(this,null,function*(){n.addChild(new Fh({app:this.app,plugin:this.plugin,events:this.events,container:t,source:e,filePath:n.sourcePath}))})}},Fh=class extends ra.MarkdownRenderChild{constructor({app:t,plugin:n,events:i,container:s,source:a,filePath:o}){super(s);switch(this.app=t,this.plugin=n,this.events=i,this.source=a,this.filePath=o,this.containerEl.className){case"block-language-tasks":this.query=lc(this.source,Or.getInstance(),this.filePath),this.queryType="tasks";break;default:this.query=lc(this.source,Or.getInstance(),this.filePath),this.queryType="tasks";break}}onload(){this.events.triggerRequestCacheUpdate(this.render.bind(this)),this.renderEventRef=this.events.onCacheUpdate(this.render.bind(this)),this.reloadQueryAtMidnight()}onunload(){this.renderEventRef!==void 0&&this.events.off(this.renderEventRef),this.queryReloadTimeout!==void 0&&clearTimeout(this.queryReloadTimeout)}reloadQueryAtMidnight(){let t=new Date;t.setHours(24,0,0,0);let n=new Date,i=t.getTime()-n.getTime();this.queryReloadTimeout=setTimeout(()=>{this.query=lc(this.source,Or.getInstance(),this.filePath),this.events.triggerRequestCacheUpdate(this.render.bind(this)),this.reloadQueryAtMidnight()},i+1e3)}render(i){return N(this,arguments,function*({tasks:t,state:n}){var a;let s=ar("div",this.containerEl);n==="Warm"&&this.query.error===void 0?yield this.renderQuerySearchResults(t,n,s):this.query.error!==void 0?this.renderErrorMessage(s,this.query.error):this.renderLoadingMessage(s),(a=this.containerEl.firstChild)==null||a.replaceWith(s)})}renderQuerySearchResults(t,n,i){return N(this,null,function*(){let s=this.explainAndPerformSearch(n,t,i);if(s.searchErrorMessage!==void 0){this.renderErrorMessage(i,s.searchErrorMessage);return}yield this.renderSearchResults(s,i)})}explainAndPerformSearch(t,n,i){let s=new zo(`Search: ${this.query.queryId} - ${this.filePath}`);s.start(),this.query.debug(`[render] Render called: plugin state: ${t}; searching ${n.length} tasks`),this.query.queryLayoutOptions.explainQuery&&this.createExplanation(i);let a=this.query.applyQueryToTasks(n);return s.finish(),a}renderSearchResults(t,n){return N(this,null,function*(){let i=new zo(`Render: ${this.query.queryId} - ${this.filePath}`);i.start(),yield this.addAllTaskGroups(t.taskGroups,n);let s=t.totalTasksCount;this.addTaskCount(n,t),this.query.debug(`[render] ${s} tasks displayed`),i.finish()})}renderErrorMessage(t,n){t.createDiv().innerHTML=`<pre>Tasks query: ${n.replace(/\n/g,"<br>")}</pre>`}renderLoadingMessage(t){t.setText("Loading Tasks ...")}createExplanation(t){let n=nk(this.source,be.getInstance(),Or.getInstance(),this.filePath),i=ar("pre",t);i.addClasses(["plugin-tasks-query-explanation"]),i.setText(n),t.appendChild(i)}createTaskList(t,n){return N(this,null,function*(){let i=ar("ul",n);i.addClasses(["contains-task-list","plugin-tasks-query-result"]);let s=new cc(this.query.taskLayoutOptions);i.addClasses(s.generateHiddenClasses());let a=new uc(this.query.queryLayoutOptions);i.addClasses(a.getHiddenClasses());let o=this.getGroupingAttribute();o&&o.length>0&&(i.dataset.taskGroupBy=o);let u=new fi({obsidianComponent:this,parentUlElement:i,taskLayoutOptions:this.query.taskLayoutOptions,queryLayoutOptions:this.query.queryLayoutOptions});for(let[l,c]of t.entries())yield this.addTask(i,u,c,l);n.appendChild(i)})}addTask(t,n,i,s){return N(this,null,function*(){let a=this.isFilenameUnique({task:i}),o=yield n.renderTaskLine(i,s,a);o.querySelectorAll("[data-footnote-id]").forEach(d=>d.remove());let l=o.createSpan("task-extras");this.query.queryLayoutOptions.hideUrgency||this.addUrgency(l,i);let c=this.query.queryLayoutOptions.shortMode;this.query.queryLayoutOptions.hideBacklinks||this.addBacklinks(l,i,c,a),this.query.queryLayoutOptions.hideEditButton||this.addEditButton(l,i,this.plugin.getTasks()),!this.query.queryLayoutOptions.hidePostponeButton&&ik(i)&&this.addPostponeButton(l,i,c),t.appendChild(o)})}addEditButton(t,n,i){let s=ar("a",t);s.addClass("tasks-edit"),s.title="Edit task",s.href="#",s.onClickEvent(a=>{a.preventDefault();let o=l=>N(this,null,function*(){yield kr({originalTask:n,newTasks:vt.removeInferredStatusIfNeeded(n,l)})});new ni({app:this.app,task:n,onSubmit:o,allTasks:i}).open()})}addUrgency(t,n){let i=new Intl.NumberFormat().format(n.urgency);t.createSpan({text:i,cls:"tasks-urgency"})}addAllTaskGroups(t,n){return N(this,null,function*(){for(let i of t.groups)yield this.addGroupHeadings(n,i.groupHeadings),yield this.createTaskList(i.tasks,n)})}addGroupHeadings(t,n){return N(this,null,function*(){for(let i of n)yield this.addGroupHeading(t,i)})}addGroupHeading(t,n){return N(this,null,function*(){let i="h6";n.nestingLevel===0?i="h4":n.nestingLevel===1&&(i="h5");let s=ar(i,t);s.addClass("tasks-group-heading"),yield ra.MarkdownRenderer.renderMarkdown(n.displayName,s,this.filePath,this)})}addBacklinks(t,n,i,s){var c;let a=t.createSpan({cls:"tasks-backlink"});i||a.append(" (");let o=ar("a",a);o.rel="noopener",o.target="_blank",o.addClass("internal-link"),i&&o.addClass("internal-link-short-mode");let u;i?u=" \u{1F517}":u=(c=n.getLinkText({isFilenameUnique:s}))!=null?c:"",o.setText(u);let l=this.app.vault;o.addEventListener("click",d=>N(this,null,function*(){let f=yield Hm(n,l);if(f){let[m,g]=f,T=this.app.workspace.getLeaf(ra.Keymap.isModEvent(d));d.preventDefault(),yield T.openFile(g,{eState:{line:m}})}})),o.addEventListener("mousedown",d=>N(this,null,function*(){if(d.button===1){let f=yield Hm(n,l);if(f){let[m,g]=f,T=this.app.workspace.getLeaf("tab");d.preventDefault(),yield T.openFile(g,{eState:{line:m}})}}})),i||a.append(")")}addPostponeButton(t,n,i){let a="day",o=ck(n,1,a),u=ar("a",t);u.addClass("tasks-postpone"),i&&u.addClass("tasks-postpone-short-mode"),u.title=o,u.addEventListener("click",l=>{l.preventDefault(),l.stopPropagation(),pi.postponeOnClickCallback(u,n,1,a)}),u.addEventListener("contextmenu",l=>N(this,null,function*(){l.preventDefault(),l.stopPropagation(),new pi(u,n).showAtPosition({x:l.clientX,y:l.clientY})}))}addTaskCount(t,n){this.query.queryLayoutOptions.hideTaskCount||t.createDiv({text:n.totalTasksCountDisplayText(),cls:"tasks-count"})}isFilenameUnique({task:t}){let n=t.path.match(/([^/]*)\..+$/i);if(n===null)return;let i=n[1];return this.app.vault.getMarkdownFiles().filter(a=>{if(a.basename===i)return!0}).length<2}getGroupingAttribute(){let t=[];for(let n of this.query.grouping)t.push(n.property);return t.join(",")}};var Ee=require("obsidian");var fc=class{constructor(e){this._markdown="";this.columnNames=e,this.addTitleRow()}get markdown(){return this._markdown}addTitleRow(){let e="|",t="|";this.columnNames.forEach(n=>{e+=` ${n} |`,t+=" ----- |"}),this._markdown+=`${e} `,this._markdown+=`${t} `}addRow(e){let t=this.makeRowText(e);this._markdown+=`${t} `}addRowIfNew(e){let t=this.makeRowText(e);this._markdown.includes(t)||(this._markdown+=`${t} -`)}makeRowText(e){let t="|";return e.forEach(n=>{t+=` ${n} |`}),t}};function mk(r,e){return r.findIndex(t=>t.symbol===e)}function Ln(r){return r===""?r:"`"+(r!==" "?r:"space")+"`"}function iF(r,e){let t=ne.getTypeForUnknownSymbol(r.symbol);r.type!==t&&(t==="TODO"&&r.symbol!==" "||e.push(`For information, the conventional type for status symbol ${Ln(r.symbol)} is ${Ln(t)}: you may wish to review this type.`))}function sF(r,e,t){let n=mk(r,e.nextStatusSymbol);if(n===-1){t.push(`Next symbol ${Ln(e.nextStatusSymbol)} is unknown: create a status with symbol ${Ln(e.nextStatusSymbol)}.`);return}if(e.type!=="DONE")return;let i=r[n];if(i){if(i.type!=="TODO"&&i.type!=="IN_PROGRESS"){let s="https://publish.obsidian.md/tasks/Getting+Started/Statuses/Recurring+Tasks+and+Custom+Statuses",a=[`This \`DONE\` status is followed by ${Ln(i.type)}, not \`TODO\` or \`IN_PROGRESS\`.`,"If used to complete a recurring task, it will instead be followed by `TODO` or `IN_PROGRESS`, to ensure the next task matches the `not done` filter.",`See [Recurring Tasks and Custom Statuses](${s}).`].join("<br>");t.push(a)}}else t.push("Unexpected failure to find the next status.")}function aF(r,e,t){let n=[];return e.symbol===ne.EMPTY.symbol?(n.push("Empty symbol: this status will be ignored."),n):mk(r,e.symbol)!=t?(n.push(`Duplicate symbol '${Ln(e.symbol)}': this status will be ignored.`),n):(iF(e,n),sF(r,e,n),n)}function hk(r){let e=new hc(["Status Symbol","Next Status Symbol","Status Name","Status Type","Problems (if any)"]),t=Le.allStatuses(r);return t.forEach((n,i)=>{e.addRow([Ln(n.symbol),Ln(n.nextStatusSymbol),n.name,Ln(n.type),aF(t,n,i).join("<br>")])}),e.markdown}function gk(r,e,t,n){let s=hk(r),a=e.mermaidDiagram(!0);return`# ${t} +`)}makeRowText(e){let t="|";return e.forEach(n=>{t+=` ${n} |`}),t}};function hk(r,e){return r.findIndex(t=>t.symbol===e)}function jn(r){return r===""?r:"`"+(r!==" "?r:"space")+"`"}function yF(r,e){let t=te.getTypeForUnknownSymbol(r.symbol);r.type!==t&&(t==="TODO"&&r.symbol!==" "||e.push(`For information, the conventional type for status symbol ${jn(r.symbol)} is ${jn(t)}: you may wish to review this type.`))}function bF(r,e,t){let n=hk(r,e.nextStatusSymbol);if(n===-1){t.push(`Next symbol ${jn(e.nextStatusSymbol)} is unknown: create a status with symbol ${jn(e.nextStatusSymbol)}.`);return}if(e.type!=="DONE")return;let i=r[n];if(i){if(i.type!=="TODO"&&i.type!=="IN_PROGRESS"){let s="https://publish.obsidian.md/tasks/Getting+Started/Statuses/Recurring+Tasks+and+Custom+Statuses",a=[`This \`DONE\` status is followed by ${jn(i.type)}, not \`TODO\` or \`IN_PROGRESS\`.`,"If used to complete a recurring task, it will instead be followed by `TODO` or `IN_PROGRESS`, to ensure the next task matches the `not done` filter.",`See [Recurring Tasks and Custom Statuses](${s}).`].join("<br>");t.push(a)}}else t.push("Unexpected failure to find the next status.")}function TF(r,e,t){let n=[];return e.symbol===te.EMPTY.symbol?(n.push("Empty symbol: this status will be ignored."),n):hk(r,e.symbol)!=t?(n.push(`Duplicate symbol '${jn(e.symbol)}': this status will be ignored.`),n):(yF(e,n),bF(r,e,n),n)}function gk(r){let e=new fc(["Status Symbol","Next Status Symbol","Status Name","Status Type","Problems (if any)"]),t=Le.allStatuses(r);return t.forEach((n,i)=>{e.addRow([jn(n.symbol),jn(n.nextStatusSymbol),n.name,jn(n.type),TF(t,n,i).join("<br>")])}),e.markdown}function yk(r,e,t,n){let s=gk(r),a=e.mermaidDiagram(!0);return`# ${t} ## About this file @@ -330,14 +352,14 @@ ${s} <!-- Switch to Live Preview or Reading Mode to see the diagram. --> These are the settings actually used by Tasks. -${a}`}function yk(){return[[" ","Unchecked","x","TODO"],["x","Checked"," ","DONE"],[">","Rescheduled","x","TODO"],["<","Scheduled","x","TODO"],["!","Important","x","TODO"],["-","Cancelled"," ","CANCELLED"],["/","In Progress","x","IN_PROGRESS"],["?","Question","x","TODO"],["*","Star","x","TODO"],["n","Note","x","TODO"],["l","Location","x","TODO"],["i","Information","x","TODO"],["I","Idea","x","TODO"],["S","Amount","x","TODO"],["p","Pro","x","TODO"],["c","Con","x","TODO"],["b","Bookmark","x","TODO"],['"',"Quote","x","TODO"],["0","Speech bubble 0","0","NON_TASK"],["1","Speech bubble 1","1","NON_TASK"],["2","Speech bubble 2","2","NON_TASK"],["3","Speech bubble 3","3","NON_TASK"],["4","Speech bubble 4","4","NON_TASK"],["5","Speech bubble 5","5","NON_TASK"],["6","Speech bubble 6","6","NON_TASK"],["7","Speech bubble 7","7","NON_TASK"],["8","Speech bubble 8","8","NON_TASK"],["9","Speech bubble 9","9","NON_TASK"]]}function bk(){return[[" ","incomplete","x","TODO"],["x","complete / done"," ","DONE"],["-","cancelled"," ","CANCELLED"],[">","deferred","x","TODO"],["/","in progress, or half-done","x","IN_PROGRESS"],["!","Important","x","TODO"],["?","question","x","TODO"],["R","review","x","TODO"],["+","Inbox / task that should be processed later","x","TODO"],["b","bookmark","x","TODO"],["B","brainstorm","x","TODO"],["D","deferred or scheduled","x","TODO"],["I","Info","x","TODO"],["i","idea","x","TODO"],["N","note","x","TODO"],["Q","quote","x","TODO"],["W","win / success / reward","x","TODO"],["P","pro","x","TODO"],["C","con","x","TODO"]]}function Tk(){return[[" ","Unchecked","x","TODO"],["x","Checked"," ","DONE"],["-","Cancelled"," ","CANCELLED"],["/","In Progress","x","IN_PROGRESS"],[">","Deferred","x","TODO"],["!","Important","x","TODO"],["?","Question","x","TODO"],["r","Review","x","TODO"]]}function _k(){return[[" ","Unchecked","x","TODO"],["x","Regular"," ","DONE"],["X","Checked"," ","DONE"],["-","Dropped"," ","CANCELLED"],[">","Forward","x","TODO"],["D","Date","x","TODO"],["?","Question","x","TODO"],["/","Half Done","x","IN_PROGRESS"],["+","Add","x","TODO"],["R","Research","x","TODO"],["!","Important","x","TODO"],["i","Idea","x","TODO"],["B","Brainstorm","x","TODO"],["P","Pro","x","TODO"],["C","Con","x","TODO"],["Q","Quote","x","TODO"],["N","Note","x","TODO"],["b","Bookmark","x","TODO"],["I","Information","x","TODO"],["p","Paraphrase","x","TODO"],["L","Location","x","TODO"],["E","Example","x","TODO"],["A","Answer","x","TODO"],["r","Reward","x","TODO"],["c","Choice","x","TODO"],["d","Doing","x","IN_PROGRESS"],["T","Time","x","TODO"],["@","Character / Person","x","TODO"],["t","Talk","x","TODO"],["O","Outline / Plot","x","TODO"],["~","Conflict","x","TODO"],["W","World","x","TODO"],["f","Clue / Find","x","TODO"],["F","Foreshadow","x","TODO"],["H","Favorite / Health","x","TODO"],["&","Symbolism","x","TODO"],["s","Secret","x","TODO"]]}function vk(){return[[" ","Unchecked","x","TODO"],["x","Checked"," ","DONE"],[">","Rescheduled","x","TODO"],["<","Scheduled","x","TODO"],["!","Important","x","TODO"],["-","Cancelled"," ","CANCELLED"],["/","In Progress","x","IN_PROGRESS"],["?","Question","x","TODO"],["*","Star","x","TODO"],["n","Note","x","TODO"],["l","Location","x","TODO"],["i","Information","x","TODO"],["I","Idea","x","TODO"],["S","Amount","x","TODO"],["p","Pro","x","TODO"],["c","Con","x","TODO"],["b","Bookmark","x","TODO"],["f","Fire","x","TODO"],["k","Key","x","TODO"],["w","Win","x","TODO"],["u","Up","x","TODO"],["d","Down","x","TODO"]]}function wk(){return[[" ","to-do","x","TODO"],["/","incomplete","x","IN_PROGRESS"],["x","done"," ","DONE"],["-","canceled"," ","CANCELLED"],[">","forwarded","x","TODO"],["<","scheduling","x","TODO"],["?","question","x","TODO"],["!","important","x","TODO"],["*","star","x","TODO"],['"',"quote","x","TODO"],["l","location","x","TODO"],["b","bookmark","x","TODO"],["i","information","x","TODO"],["S","savings","x","TODO"],["I","idea","x","TODO"],["p","pros","x","TODO"],["c","cons","x","TODO"],["f","fire","x","TODO"],["k","key","x","TODO"],["w","win","x","TODO"],["u","up","x","TODO"],["d","down","x","TODO"]]}function kk(){return[[" ","to-do","x","TODO"],["/","incomplete","x","IN_PROGRESS"],["x","done"," ","DONE"],["-","canceled"," ","CANCELLED"],[">","forwarded","x","TODO"],["<","scheduling","x","TODO"],["?","question","x","TODO"],["!","important","x","TODO"],["*","star","x","TODO"],['"',"quote","x","TODO"],["l","location","x","TODO"],["b","bookmark","x","TODO"],["i","information","x","TODO"],["S","savings","x","TODO"],["I","idea","x","TODO"],["p","pros","x","TODO"],["c","cons","x","TODO"],["f","fire","x","TODO"],["k","key","x","TODO"],["w","win","x","TODO"],["u","up","x","TODO"],["d","down","x","TODO"]]}var Ek=[{text:"Core Statuses",level:"h3",class:"",open:!0,notice:{class:"setting-item-description",text:null,html:"<p>These are the core statuses that Tasks supports natively, with no need for custom CSS styling or theming.</p><p>You can add edit and add your own custom statuses in the section below.</p>"},settings:[{name:"",description:"",type:"function",initialValue:"",placeholder:"",settingName:"insertTaskCoreStatusSettings",featureFlag:"",notice:null}]},{text:"Custom Statuses",level:"h3",class:"",open:!0,notice:{class:"setting-item-description",text:null,html:`<p>You should first <b>select and install a CSS Snippet or Theme</b> to style custom checkboxes.</p><p>Then, use the buttons below to set up your custom statuses, to match your chosen CSS checkboxes.</p><p><b>Note</b> Any statuses with the same symbol as any earlier statuses will be ignored. You can confirm the actually loaded statuses by running the 'Create or edit task' command and looking at the Status drop-down.</p><p></p><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Statuses">documentation</a> to get started!</p>`},settings:[{name:"",description:"",type:"function",initialValue:"",placeholder:"",settingName:"insertCustomTaskStatusSettings",featureFlag:"",notice:null}]}];var $r=require("obsidian");var zi=class{validate(e){let t=[];return t.push(...this.validateSymbol(e)),t.push(...this.validateName(e)),t.push(...this.validateNextSymbol(e)),t}validateStatusCollectionEntry(e){let[t,n,i,s]=e,a=[];if(a.push(...this.validateType(s)),t===i&&s!=="NON_TASK"&&a.push(`Status symbol '${t}' toggles to itself`),a.length>0)return a;let o=ne.createFromImportedValue(e).configuration;return a.push(...this.validateSymbolTypeConventions(o)),a.push(...this.validate(o)),a}validateSymbol(e){return zi.validateOneSymbol(e.symbol,"Task Status Symbol")}validateNextSymbol(e){return zi.validateOneSymbol(e.nextStatusSymbol,"Task Next Status Symbol")}validateName(e){let t=[];return e.name.length===0&&t.push("Task Status Name cannot be empty."),t}validateType(e){let t=Jt[e],n=[];return t||n.push(`Status Type "${e}" is not a valid type`),t=="EMPTY"&&n.push('Status Type "EMPTY" is not permitted in user data'),n}validateSymbolTypeConventions(e){let t=[],n=e.symbol,i=new Oe,s=n==="X"?"x":n,a=i.bySymbol(s);return a.type!=="EMPTY"&&(e.nextStatusSymbol!==a.nextStatusSymbol&&t.push(`Next Status Symbol for symbol '${n}': '${e.nextStatusSymbol}' is inconsistent with convention '${a.nextStatusSymbol}'`),e.type!==a.type&&t.push(`Status Type for symbol '${n}': '${e.type}' is inconsistent with convention '${a.type}'`)),t}static validateOneSymbol(e,t){let n=[];return e.length===0&&n.push(`${t} cannot be empty.`),e.length>1&&n.push(`${t} ("${e}") must be a single character.`),n}};var Ki=new zi,ar=class extends $r.Modal{constructor(t,n,i){super(t.app);this.plugin=t;this.saved=!1;this.error=!1;this.statusSymbol=n.symbol,this.statusName=n.name,this.statusNextSymbol=n.nextStatusSymbol,this.statusAvailableAsCommand=n.availableAsCommand,this.type=n.type,this.isCoreStatus=i}statusConfiguration(){return new et(this.statusSymbol,this.statusName,this.statusNextSymbol,this.statusAvailableAsCommand,this.type)}display(){return L(this,null,function*(){let{contentEl:t}=this;t.empty();let n=t.createDiv(),i;new $r.Setting(n).setName("Task Status Symbol").setDesc("This is the character between the square braces. (It can only be edited for Custom statuses, and not Core statuses.)").addText(l=>{i=l,l.setValue(this.statusSymbol).onChange(c=>{this.statusSymbol=c,ar.setValid(l,Ki.validateSymbol(this.statusConfiguration()))})}).setDisabled(this.isCoreStatus).then(l=>{ar.setValid(i,Ki.validateSymbol(this.statusConfiguration()))});let s;new $r.Setting(n).setName("Task Status Name").setDesc("This is the friendly name of the task status.").addText(l=>{s=l,l.setValue(this.statusName).onChange(c=>{this.statusName=c,ar.setValid(l,Ki.validateName(this.statusConfiguration()))})}).then(l=>{ar.setValid(s,Ki.validateName(this.statusConfiguration()))});let a;new $r.Setting(n).setName("Task Next Status Symbol").setDesc("When clicked on this is the symbol that should be used next.").addText(l=>{a=l,l.setValue(this.statusNextSymbol).onChange(c=>{this.statusNextSymbol=c,ar.setValid(l,Ki.validateNextSymbol(this.statusConfiguration()))})}).then(l=>{ar.setValid(a,Ki.validateNextSymbol(this.statusConfiguration()))}),new $r.Setting(n).setName("Task Status Type").setDesc("Control how the status behaves for searching and toggling.").addDropdown(l=>{["TODO","IN_PROGRESS","DONE","CANCELLED","NON_TASK"].forEach(d=>{l.addOption(d,d)}),l.setValue(this.type).onChange(d=>{this.type=ne.getTypeFromStatusTypeString(d)})}),ne.tasksPluginCanCreateCommandsForStatuses()&&new $r.Setting(n).setName("Available as command").setDesc("If enabled this status will be available as a command so you can assign a hotkey and toggle the status using it.").addToggle(l=>{l.setValue(this.statusAvailableAsCommand).onChange(c=>L(this,null,function*(){this.statusAvailableAsCommand=c}))});let o=t.createDiv(),u=new $r.Setting(o);u.addButton(l=>(l.setTooltip("Save").setIcon("checkmark").onClick(()=>L(this,null,function*(){let c=Ki.validate(this.statusConfiguration());if(c.length>0){let d=c.join(` +${a}`}function bk(){return[[" ","Unchecked","x","TODO"],["x","Checked"," ","DONE"],[">","Rescheduled","x","TODO"],["<","Scheduled","x","TODO"],["!","Important","x","TODO"],["-","Cancelled"," ","CANCELLED"],["/","In Progress","x","IN_PROGRESS"],["?","Question","x","TODO"],["*","Star","x","TODO"],["n","Note","x","TODO"],["l","Location","x","TODO"],["i","Information","x","TODO"],["I","Idea","x","TODO"],["S","Amount","x","TODO"],["p","Pro","x","TODO"],["c","Con","x","TODO"],["b","Bookmark","x","TODO"],['"',"Quote","x","TODO"],["0","Speech bubble 0","0","NON_TASK"],["1","Speech bubble 1","1","NON_TASK"],["2","Speech bubble 2","2","NON_TASK"],["3","Speech bubble 3","3","NON_TASK"],["4","Speech bubble 4","4","NON_TASK"],["5","Speech bubble 5","5","NON_TASK"],["6","Speech bubble 6","6","NON_TASK"],["7","Speech bubble 7","7","NON_TASK"],["8","Speech bubble 8","8","NON_TASK"],["9","Speech bubble 9","9","NON_TASK"]]}function Tk(){return[[" ","incomplete","x","TODO"],["x","complete / done"," ","DONE"],["-","cancelled"," ","CANCELLED"],[">","deferred","x","TODO"],["/","in progress, or half-done","x","IN_PROGRESS"],["!","Important","x","TODO"],["?","question","x","TODO"],["R","review","x","TODO"],["+","Inbox / task that should be processed later","x","TODO"],["b","bookmark","x","TODO"],["B","brainstorm","x","TODO"],["D","deferred or scheduled","x","TODO"],["I","Info","x","TODO"],["i","idea","x","TODO"],["N","note","x","TODO"],["Q","quote","x","TODO"],["W","win / success / reward","x","TODO"],["P","pro","x","TODO"],["C","con","x","TODO"]]}function _k(){return[[" ","Unchecked","x","TODO"],["x","Checked"," ","DONE"],["-","Cancelled"," ","CANCELLED"],["/","In Progress","x","IN_PROGRESS"],[">","Deferred","x","TODO"],["!","Important","x","TODO"],["?","Question","x","TODO"],["r","Review","x","TODO"]]}function vk(){return[[" ","Unchecked","x","TODO"],["x","Regular"," ","DONE"],["X","Checked"," ","DONE"],["-","Dropped"," ","CANCELLED"],[">","Forward","x","TODO"],["D","Date","x","TODO"],["?","Question","x","TODO"],["/","Half Done","x","IN_PROGRESS"],["+","Add","x","TODO"],["R","Research","x","TODO"],["!","Important","x","TODO"],["i","Idea","x","TODO"],["B","Brainstorm","x","TODO"],["P","Pro","x","TODO"],["C","Con","x","TODO"],["Q","Quote","x","TODO"],["N","Note","x","TODO"],["b","Bookmark","x","TODO"],["I","Information","x","TODO"],["p","Paraphrase","x","TODO"],["L","Location","x","TODO"],["E","Example","x","TODO"],["A","Answer","x","TODO"],["r","Reward","x","TODO"],["c","Choice","x","TODO"],["d","Doing","x","IN_PROGRESS"],["T","Time","x","TODO"],["@","Character / Person","x","TODO"],["t","Talk","x","TODO"],["O","Outline / Plot","x","TODO"],["~","Conflict","x","TODO"],["W","World","x","TODO"],["f","Clue / Find","x","TODO"],["F","Foreshadow","x","TODO"],["H","Favorite / Health","x","TODO"],["&","Symbolism","x","TODO"],["s","Secret","x","TODO"]]}function wk(){return[[" ","Unchecked","x","TODO"],["x","Checked"," ","DONE"],[">","Rescheduled","x","TODO"],["<","Scheduled","x","TODO"],["!","Important","x","TODO"],["-","Cancelled"," ","CANCELLED"],["/","In Progress","x","IN_PROGRESS"],["?","Question","x","TODO"],["*","Star","x","TODO"],["n","Note","x","TODO"],["l","Location","x","TODO"],["i","Information","x","TODO"],["I","Idea","x","TODO"],["S","Amount","x","TODO"],["p","Pro","x","TODO"],["c","Con","x","TODO"],["b","Bookmark","x","TODO"],["f","Fire","x","TODO"],["k","Key","x","TODO"],["w","Win","x","TODO"],["u","Up","x","TODO"],["d","Down","x","TODO"]]}function kk(){return[[" ","to-do","x","TODO"],["/","incomplete","x","IN_PROGRESS"],["x","done"," ","DONE"],["-","canceled"," ","CANCELLED"],[">","forwarded","x","TODO"],["<","scheduling","x","TODO"],["?","question","x","TODO"],["!","important","x","TODO"],["*","star","x","TODO"],['"',"quote","x","TODO"],["l","location","x","TODO"],["b","bookmark","x","TODO"],["i","information","x","TODO"],["S","savings","x","TODO"],["I","idea","x","TODO"],["p","pros","x","TODO"],["c","cons","x","TODO"],["f","fire","x","TODO"],["k","key","x","TODO"],["w","win","x","TODO"],["u","up","x","TODO"],["d","down","x","TODO"]]}function Ek(){return[[" ","to-do","x","TODO"],["/","incomplete","x","IN_PROGRESS"],["x","done"," ","DONE"],["-","canceled"," ","CANCELLED"],[">","forwarded","x","TODO"],["<","scheduling","x","TODO"],["?","question","x","TODO"],["!","important","x","TODO"],["*","star","x","TODO"],['"',"quote","x","TODO"],["l","location","x","TODO"],["b","bookmark","x","TODO"],["i","information","x","TODO"],["S","savings","x","TODO"],["I","idea","x","TODO"],["p","pros","x","TODO"],["c","cons","x","TODO"],["f","fire","x","TODO"],["k","key","x","TODO"],["w","win","x","TODO"],["u","up","x","TODO"],["d","down","x","TODO"]]}var Sk=[{text:"Core Statuses",level:"h3",class:"",open:!0,notice:{class:"setting-item-description",text:null,html:"<p>These are the core statuses that Tasks supports natively, with no need for custom CSS styling or theming.</p><p>You can add edit and add your own custom statuses in the section below.</p>"},settings:[{name:"",description:"",type:"function",initialValue:"",placeholder:"",settingName:"insertTaskCoreStatusSettings",featureFlag:"",notice:null}]},{text:"Custom Statuses",level:"h3",class:"",open:!0,notice:{class:"setting-item-description",text:null,html:`<p>You should first <b>select and install a CSS Snippet or Theme</b> to style custom checkboxes.</p><p>Then, use the buttons below to set up your custom statuses, to match your chosen CSS checkboxes.</p><p><b>Note</b> Any statuses with the same symbol as any earlier statuses will be ignored. You can confirm the actually loaded statuses by running the 'Create or edit task' command and looking at the Status drop-down.</p><p></p><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Statuses">documentation</a> to get started!</p>`},settings:[{name:"",description:"",type:"function",initialValue:"",placeholder:"",settingName:"insertCustomTaskStatusSettings",featureFlag:"",notice:null}]}];var jr=require("obsidian");var Qi=class{validate(e){let t=[];return t.push(...this.validateSymbol(e)),t.push(...this.validateName(e)),t.push(...this.validateNextSymbol(e)),t}validateStatusCollectionEntry(e){let[t,n,i,s]=e,a=[];if(a.push(...this.validateType(s)),t===i&&s!=="NON_TASK"&&a.push(`Status symbol '${t}' toggles to itself`),a.length>0)return a;let o=te.createFromImportedValue(e).configuration;return a.push(...this.validateSymbolTypeConventions(o)),a.push(...this.validate(o)),a}validateSymbol(e){return Qi.validateOneSymbol(e.symbol,"Task Status Symbol")}validateNextSymbol(e){return Qi.validateOneSymbol(e.nextStatusSymbol,"Task Next Status Symbol")}validateName(e){let t=[];return e.name.length===0&&t.push("Task Status Name cannot be empty."),t}validateType(e){let t=er[e],n=[];return t||n.push(`Status Type "${e}" is not a valid type`),t=="EMPTY"&&n.push('Status Type "EMPTY" is not permitted in user data'),n}validateSymbolTypeConventions(e){let t=[],n=e.symbol,i=new De,s=n==="X"?"x":n,a=i.bySymbol(s);return a.type!=="EMPTY"&&(e.nextStatusSymbol!==a.nextStatusSymbol&&t.push(`Next Status Symbol for symbol '${n}': '${e.nextStatusSymbol}' is inconsistent with convention '${a.nextStatusSymbol}'`),e.type!==a.type&&t.push(`Status Type for symbol '${n}': '${e.type}' is inconsistent with convention '${a.type}'`)),t}static validateOneSymbol(e,t){let n=[];return e.length===0&&n.push(`${t} cannot be empty.`),e.length>1&&n.push(`${t} ("${e}") must be a single character.`),n}};var Xi=new Qi,or=class extends jr.Modal{constructor(t,n,i){super(t.app);this.plugin=t;this.saved=!1;this.error=!1;this.statusSymbol=n.symbol,this.statusName=n.name,this.statusNextSymbol=n.nextStatusSymbol,this.statusAvailableAsCommand=n.availableAsCommand,this.type=n.type,this.isCoreStatus=i}statusConfiguration(){return new Je(this.statusSymbol,this.statusName,this.statusNextSymbol,this.statusAvailableAsCommand,this.type)}display(){return N(this,null,function*(){let{contentEl:t}=this;t.empty();let n=t.createDiv(),i;new jr.Setting(n).setName("Task Status Symbol").setDesc("This is the character between the square braces. (It can only be edited for Custom statuses, and not Core statuses.)").addText(l=>{i=l,l.setValue(this.statusSymbol).onChange(c=>{this.statusSymbol=c,or.setValid(l,Xi.validateSymbol(this.statusConfiguration()))})}).setDisabled(this.isCoreStatus).then(l=>{or.setValid(i,Xi.validateSymbol(this.statusConfiguration()))});let s;new jr.Setting(n).setName("Task Status Name").setDesc("This is the friendly name of the task status.").addText(l=>{s=l,l.setValue(this.statusName).onChange(c=>{this.statusName=c,or.setValid(l,Xi.validateName(this.statusConfiguration()))})}).then(l=>{or.setValid(s,Xi.validateName(this.statusConfiguration()))});let a;new jr.Setting(n).setName("Task Next Status Symbol").setDesc("When clicked on this is the symbol that should be used next.").addText(l=>{a=l,l.setValue(this.statusNextSymbol).onChange(c=>{this.statusNextSymbol=c,or.setValid(l,Xi.validateNextSymbol(this.statusConfiguration()))})}).then(l=>{or.setValid(a,Xi.validateNextSymbol(this.statusConfiguration()))}),new jr.Setting(n).setName("Task Status Type").setDesc("Control how the status behaves for searching and toggling.").addDropdown(l=>{["TODO","IN_PROGRESS","DONE","CANCELLED","NON_TASK"].forEach(d=>{l.addOption(d,d)}),l.setValue(this.type).onChange(d=>{this.type=te.getTypeFromStatusTypeString(d)})}),te.tasksPluginCanCreateCommandsForStatuses()&&new jr.Setting(n).setName("Available as command").setDesc("If enabled this status will be available as a command so you can assign a hotkey and toggle the status using it.").addToggle(l=>{l.setValue(this.statusAvailableAsCommand).onChange(c=>N(this,null,function*(){this.statusAvailableAsCommand=c}))});let o=t.createDiv(),u=new jr.Setting(o);u.addButton(l=>(l.setTooltip("Save").setIcon("checkmark").onClick(()=>N(this,null,function*(){let c=Xi.validate(this.statusConfiguration());if(c.length>0){let d=c.join(` `)+` -Fix errors before saving.`;new $r.Notice(d);return}this.saved=!0,this.close()})),l)),u.addExtraButton(l=>(l.setIcon("cross").setTooltip("Cancel").onClick(()=>{this.saved=!1,this.close()}),l))})}onOpen(){this.display()}static setValidationError(t){t.inputEl.addClass("tasks-settings-is-invalid")}static removeValidationError(t){t.inputEl.removeClass("tasks-settings-is-invalid")}static setValid(t,n){n.length===0?ar.removeValidationError(t):ar.setValidationError(t)}};var Gt=class extends ke.PluginSettingTab{constructor({plugin:t}){super(t.app,t);this.customFunctions={insertTaskCoreStatusSettings:this.insertTaskCoreStatusSettings.bind(this),insertCustomTaskStatusSettings:this.insertCustomTaskStatusSettings.bind(this)};this.plugin=t}saveSettings(t){return L(this,null,function*(){yield this.plugin.saveSettings(),t&&this.display()})}display(){let{containerEl:t}=this;t.empty(),this.containerEl.addClass("tasks-settings"),t.createEl("h3",{text:"Tasks Settings"}),t.createEl("p",{cls:"tasks-setting-important",text:"Changing any settings requires a restart of obsidian."}),t.createEl("h4",{text:"Task Format Settings"}),new ke.Setting(t).setName("Task Format").setDesc(Gt.createFragmentWithHTML('<p>The format that Tasks uses to read and write tasks.</p><p><b>Important:</b> Tasks currently only supports one format at a time. Selecting Dataview will currently <b>stop Tasks reading its own emoji signifiers</b>.</p><p>See the <a href="https://publish.obsidian.md/tasks/Reference/Task+Formats/About+Task+Formats">documentation</a>.</p>')).addDropdown(i=>{for(let s of Object.keys(Dn))i.addOption(s,Dn[s].displayName);i.setValue(J().taskFormat).onChange(s=>L(this,null,function*(){tt({taskFormat:s}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Global filter Settings"}),new ke.Setting(t).setName("Global task filter").setDesc(Gt.createFragmentWithHTML('<p><b>Recommended: Leave empty if you want all checklist items in your vault to be tasks managed by this plugin.</b></p><p>Use a global filter if you want Tasks to only act on a subset of your "<code>- [ ]</code>" checklist items, so that a checklist item must include the specified string in its description in order to be considered a task.<p><p>For example, if you set the global filter to <code>#task</code>, the Tasks plugin will only handle checklist items tagged with <code>#task</code>.</br>Other checklist items will remain normal checklist items and not appear in queries or get a done date set.</p><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Global+Filter">documentation</a>.</p>')).addText(i=>{i.setPlaceholder("e.g. #task or TODO").setValue(ye.getInstance().get()).onChange(s=>L(this,null,function*(){tt({globalFilter:s}),ye.getInstance().set(s),yield this.plugin.saveSettings()}))}),new ke.Setting(t).setName("Remove global filter from description").setDesc("Enabling this removes the string that you set as global filter from the task description when displaying a task.").addToggle(i=>{let s=J();i.setValue(s.removeGlobalFilter).onChange(a=>L(this,null,function*(){tt({removeGlobalFilter:a}),ye.getInstance().setRemoveGlobalFilter(a),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Global Query"}),cF(new ke.Setting(t).setDesc(Gt.createFragmentWithHTML('<p>A query that is automatically included at the start of every Tasks block in the vault. Useful for adding default filters, or layout options.</p><p>See the <a href="https://publish.obsidian.md/tasks/Queries/Global+Query">documentation</a>.</p>')).addTextArea(i=>{let s=J();i.inputEl.rows=4,i.setPlaceholder(`# For example... +Fix errors before saving.`;new jr.Notice(d);return}this.saved=!0,this.close()})),l)),u.addExtraButton(l=>(l.setIcon("cross").setTooltip("Cancel").onClick(()=>{this.saved=!1,this.close()}),l))})}onOpen(){this.display()}static setValidationError(t){t.inputEl.addClass("tasks-settings-is-invalid")}static removeValidationError(t){t.inputEl.removeClass("tasks-settings-is-invalid")}static setValid(t,n){n.length===0?or.removeValidationError(t):or.setValidationError(t)}};var Bt=class extends Ee.PluginSettingTab{constructor({plugin:t}){super(t.app,t);this.customFunctions={insertTaskCoreStatusSettings:this.insertTaskCoreStatusSettings.bind(this),insertCustomTaskStatusSettings:this.insertCustomTaskStatusSettings.bind(this)};this.plugin=t}saveSettings(t){return N(this,null,function*(){yield this.plugin.saveSettings(),t&&this.display()})}display(){let{containerEl:t}=this;t.empty(),this.containerEl.addClass("tasks-settings"),t.createEl("h3",{text:"Tasks Settings"}),t.createEl("p",{cls:"tasks-setting-important",text:"Changing any settings requires a restart of obsidian."}),t.createEl("h4",{text:"Task Format Settings"}),new Ee.Setting(t).setName("Task Format").setDesc(Bt.createFragmentWithHTML('<p>The format that Tasks uses to read and write tasks.</p><p><b>Important:</b> Tasks currently only supports one format at a time. Selecting Dataview will currently <b>stop Tasks reading its own emoji signifiers</b>.</p><p>See the <a href="https://publish.obsidian.md/tasks/Reference/Task+Formats/About+Task+Formats">documentation</a>.</p>')).addDropdown(i=>{for(let s of Object.keys(Nr))i.addOption(s,Nr[s].displayName);i.setValue(X().taskFormat).onChange(s=>N(this,null,function*(){et({taskFormat:s}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Global filter Settings"}),new Ee.Setting(t).setName("Global task filter").setDesc(Bt.createFragmentWithHTML('<p><b>Recommended: Leave empty if you want all checklist items in your vault to be tasks managed by this plugin.</b></p><p>Use a global filter if you want Tasks to only act on a subset of your "<code>- [ ]</code>" checklist items, so that a checklist item must include the specified string in its description in order to be considered a task.<p><p>For example, if you set the global filter to <code>#task</code>, the Tasks plugin will only handle checklist items tagged with <code>#task</code>.</br>Other checklist items will remain normal checklist items and not appear in queries or get a done date set.</p><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Global+Filter">documentation</a>.</p>')).addText(i=>{i.setPlaceholder("e.g. #task or TODO").setValue(be.getInstance().get()).onChange(s=>N(this,null,function*(){et({globalFilter:s}),be.getInstance().set(s),yield this.plugin.saveSettings()}))}),new Ee.Setting(t).setName("Remove global filter from description").setDesc("Enabling this removes the string that you set as global filter from the task description when displaying a task.").addToggle(i=>{let s=X();i.setValue(s.removeGlobalFilter).onChange(a=>N(this,null,function*(){et({removeGlobalFilter:a}),be.getInstance().setRemoveGlobalFilter(a),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Global Query"}),kF(new Ee.Setting(t).setDesc(Bt.createFragmentWithHTML('<p>A query that is automatically included at the start of every Tasks block in the vault. Useful for adding default filters, or layout options.</p><p>See the <a href="https://publish.obsidian.md/tasks/Queries/Global+Query">documentation</a>.</p>')).addTextArea(i=>{let s=X();i.inputEl.rows=4,i.setPlaceholder(`# For example... path does not include _templates/ limit 300 -show urgency`).setValue(s.globalQuery).onChange(a=>L(this,null,function*(){tt({globalQuery:a}),kr.getInstance().set(a),yield this.plugin.saveSettings()}))})),t.createEl("h4",{text:"Task Statuses"});let{headingOpened:n}=J();Ek.forEach(i=>{this.addOneSettingsBlock(t,i,n)}),t.createEl("h4",{text:"Date Settings"}),new ke.Setting(t).setName("Set created date on every added task").setDesc(Gt.createFragmentWithHTML(`Enabling this will add a timestamp \u2795 YYYY-MM-DD before other date values, when a task is created with 'Create or edit task', or by completing a recurring task.</br><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Dates#Created+date">documentation</a>.</p>`)).addToggle(i=>{let s=J();i.setValue(s.setCreatedDate).onChange(a=>L(this,null,function*(){tt({setCreatedDate:a}),yield this.plugin.saveSettings()}))}),new ke.Setting(t).setName("Set done date on every completed task").setDesc(Gt.createFragmentWithHTML('Enabling this will add a timestamp \u2705 YYYY-MM-DD at the end when a task is toggled to done.</br><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Dates#Done+date">documentation</a>.</p>')).addToggle(i=>{let s=J();i.setValue(s.setDoneDate).onChange(a=>L(this,null,function*(){tt({setDoneDate:a}),yield this.plugin.saveSettings()}))}),new ke.Setting(t).setName("Set cancelled date on every cancelled task").setDesc(Gt.createFragmentWithHTML('Enabling this will add a timestamp \u274C YYYY-MM-DD at the end when a task is toggled to cancelled.</br><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Dates#Cancelled+date">documentation</a>.</p>')).addToggle(i=>{let s=J();i.setValue(s.setCancelledDate).onChange(a=>L(this,null,function*(){tt({setCancelledDate:a}),yield this.plugin.saveSettings()}))}),new ke.Setting(t).setName("Use filename as Scheduled date for undated tasks").setDesc(Gt.createFragmentWithHTML('Save time entering Scheduled (\u23F3) dates.</br>If this option is enabled, any undated tasks will be given a default Scheduled date extracted from their file name.</br>The date in the file name must be in one of <code>YYYY-MM-DD</code> or <code>YYYYMMDD</code> formats.</br>Undated tasks have none of Due (\u{1F4C5} ), Scheduled (\u23F3) and Start (\u{1F6EB}) dates.</br><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Use+Filename+as+Default+Date">documentation</a>.</p>')).addToggle(i=>{let s=J();i.setValue(s.useFilenameAsScheduledDate).onChange(a=>L(this,null,function*(){tt({useFilenameAsScheduledDate:a}),yield this.plugin.saveSettings()}))}),new ke.Setting(t).setName("Folders with default Scheduled dates").setDesc("Leave empty if you want to use default Scheduled dates everywhere, or enter a comma-separated list of folders.").addText(i=>L(this,null,function*(){let s=J();yield this.plugin.saveSettings(),i.setValue(Gt.renderFolderArray(s.filenameAsDateFolders)).onChange(a=>L(this,null,function*(){let o=Gt.parseCommaSeparatedFolders(a);tt({filenameAsDateFolders:o}),yield this.plugin.saveSettings()}))})),t.createEl("h4",{text:"Recurring task Settings"}),new ke.Setting(t).setName("Next recurrence appears on the line below").setDesc(Gt.createFragmentWithHTML('Enabling this will make the next recurrence of a task appear on the line below the completed task. Otherwise the next recurrence will appear before the completed one.</br><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Recurring+Tasks">documentation</a>.</p>')).addToggle(i=>{let{recurrenceOnNextLine:s}=J();i.setValue(s).onChange(a=>L(this,null,function*(){tt({recurrenceOnNextLine:a}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Auto-suggest Settings"}),new ke.Setting(t).setName("Auto-suggest task content").setDesc(Gt.createFragmentWithHTML('Enabling this will open an intelligent suggest menu while typing inside a recognized task line.</br><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Auto-Suggest">documentation</a>.</p>')).addToggle(i=>{let s=J();i.setValue(s.autoSuggestInEditor).onChange(a=>L(this,null,function*(){tt({autoSuggestInEditor:a}),yield this.plugin.saveSettings()}))}),new ke.Setting(t).setName("Minimum match length for auto-suggest").setDesc("If higher than 0, auto-suggest will be triggered only when the beginning of any supported keywords is recognized.").addSlider(i=>{let s=J();i.setLimits(0,3,1).setValue(s.autoSuggestMinMatch).setDynamicTooltip().onChange(a=>L(this,null,function*(){tt({autoSuggestMinMatch:a}),yield this.plugin.saveSettings()}))}),new ke.Setting(t).setName("Maximum number of auto-suggestions to show").setDesc('How many suggestions should be shown when an auto-suggest menu pops up (including the "\u23CE" option).').addSlider(i=>{let s=J();i.setLimits(3,12,1).setValue(s.autoSuggestMaxItems).setDynamicTooltip().onChange(a=>L(this,null,function*(){tt({autoSuggestMaxItems:a}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Dialog Settings"}),new ke.Setting(t).setName("Provide access keys in dialogs").setDesc(Gt.createFragmentWithHTML('If the access keys (keyboard shortcuts) for various controls in dialog boxes conflict with system keyboard shortcuts or assistive technology functionality that is important for you, you may want to deactivate them here.</br><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Create+or+edit+Task#Keyboard+shortcuts">documentation</a>.</p>')).addToggle(i=>{let s=J();i.setValue(s.provideAccessKeys).onChange(a=>L(this,null,function*(){tt({provideAccessKeys:a}),yield this.plugin.saveSettings()}))})}addOneSettingsBlock(t,n,i){let s=t.createEl("details",{cls:"tasks-nested-settings",attr:X({},n.open||i[n.text]?{open:!0}:{})});s.empty(),s.ontoggle=()=>{i[n.text]=s.open,tt({headingOpened:i}),this.plugin.saveSettings()};let a=s.createEl("summary");if(new ke.Setting(a).setHeading().setName(n.text),a.createDiv("collapser").createDiv("handle"),n.notice!==null){let o=s.createEl("div",{cls:n.notice.class,text:n.notice.text});n.notice.html!==null&&o.insertAdjacentHTML("beforeend",n.notice.html)}n.settings.forEach(o=>{if(!(o.featureFlag!==""&&!gv(o.featureFlag))&&(o.type==="checkbox"?new ke.Setting(s).setName(o.name).setDesc(o.description).addToggle(u=>{let l=J();l.generalSettings[o.settingName]||Ai(o.settingName,o.initialValue),u.setValue(l.generalSettings[o.settingName]).onChange(c=>L(this,null,function*(){Ai(o.settingName,c),yield this.plugin.saveSettings()}))}):o.type==="text"?new ke.Setting(s).setName(o.name).setDesc(o.description).addText(u=>{let l=J();l.generalSettings[o.settingName]||Ai(o.settingName,o.initialValue);let c=d=>L(this,null,function*(){Ai(o.settingName,d),yield this.plugin.saveSettings()});u.setPlaceholder(o.placeholder.toString()).setValue(l.generalSettings[o.settingName].toString()).onChange((0,ke.debounce)(c,500,!0))}):o.type==="textarea"?new ke.Setting(s).setName(o.name).setDesc(o.description).addTextArea(u=>{let l=J();l.generalSettings[o.settingName]||Ai(o.settingName,o.initialValue);let c=d=>L(this,null,function*(){Ai(o.settingName,d),yield this.plugin.saveSettings()});u.setPlaceholder(o.placeholder.toString()).setValue(l.generalSettings[o.settingName].toString()).onChange((0,ke.debounce)(c,500,!0)),u.inputEl.rows=8,u.inputEl.cols=40}):o.type==="function"&&this.customFunctions[o.settingName](s,this),o.notice!==null)){let u=s.createEl("p",{cls:o.notice.class,text:o.notice.text});o.notice.html!==null&&u.insertAdjacentHTML("beforeend",o.notice.html)}})}static parseCommaSeparatedFolders(t){return t.split(",").map(n=>n.trim()).map(n=>n.replace(/^\/|\/$/g,"")).filter(n=>n!=="")}static renderFolderArray(t){return t.join(",")}insertTaskCoreStatusSettings(t,n){let{statusSettings:i}=J();i.coreStatuses.forEach(a=>{Sk(t,a,i.coreStatuses,i,n,n.plugin,!0)}),new ke.Setting(t).addButton(a=>{let o="Review and check your Statuses";a.setButtonText(o).setCta().onClick(()=>L(this,null,function*(){let l=window.moment().format("YYYY-MM-DD HH-mm-ss"),c=`Tasks Plugin - ${o} ${l}.md`,d=this.plugin.manifest.version,p=Oe.getInstance(),m=gk(i,p,o,d),b=yield app.vault.create(c,m);yield this.app.workspace.getLeaf(!0).openFile(b)})),a.setTooltip("Create a new file in the root of the vault, containing a Mermaid diagram of the current status settings.")}).infoEl.remove()}insertCustomTaskStatusSettings(t,n){let{statusSettings:i}=J();i.customStatuses.forEach(l=>{Sk(t,l,i.customStatuses,i,n,n.plugin,!1)}),t.createEl("div"),new ke.Setting(t).addButton(l=>{l.setButtonText("Add New Task Status").setCta().onClick(()=>L(this,null,function*(){Le.addStatus(i.customStatuses,new et("","","",!1,"TODO")),yield aa(i,n)}))}).infoEl.remove();let a=[["AnuPpuccin Theme",yk()],["Aura Theme",bk()],["Ebullientworks Theme",Tk()],["ITS Theme & SlRvb Checkboxes",_k()],["Minimal Theme",wk()],["Things Theme",kk()],["LYT Mode Theme (Dark mode only)",vk()]];for(let[l,c]of a)new ke.Setting(t).addButton(p=>{let m=`${l}: Add ${c.length} supported Statuses`;p.setButtonText(m).onClick(()=>L(this,null,function*(){yield lF(c,i,n)}))}).infoEl.remove();new ke.Setting(t).addButton(l=>{l.setButtonText("Add All Unknown Status Types").setCta().onClick(()=>L(this,null,function*(){let d=this.plugin.getTasks().map(m=>m.status),p=Oe.getInstance().findUnknownStatuses(d);p.length!==0&&(p.forEach(m=>{Le.addStatus(i.customStatuses,m)}),yield aa(i,n))}))}).infoEl.remove(),new ke.Setting(t).addButton(l=>{l.setButtonText("Reset Custom Status Types to Defaults").setWarning().onClick(()=>L(this,null,function*(){Le.resetAllCustomStatuses(i),yield aa(i,n)}))}).infoEl.remove()}},Yo=Gt;Yo.createFragmentWithHTML=t=>createFragment(n=>n.createDiv().innerHTML=t);function Sk(r,e,t,n,i,s,a){let o=r.createEl("pre");o.addClass("row-for-status"),o.textContent=new ne(e).previewText();let u=new ke.Setting(r);u.infoEl.replaceWith(o),a||u.addExtraButton(l=>{l.setIcon("cross").setTooltip("Delete").onClick(()=>L(this,null,function*(){Le.deleteStatus(t,e)&&(yield aa(n,i))}))}),u.addExtraButton(l=>{l.setIcon("pencil").setTooltip("Edit").onClick(()=>L(this,null,function*(){let c=new ar(s,e,a);c.onClose=()=>L(this,null,function*(){c.saved&&Le.replaceStatus(t,e,c.statusConfiguration())&&(yield aa(n,i))}),c.open()}))}),u.infoEl.remove()}function lF(r,e,t){return L(this,null,function*(){Le.bulkAddStatusCollection(e,r).forEach(i=>{new ke.Notice(i)}),yield aa(e,t)})}function aa(r,e){return L(this,null,function*(){tt({statusSettings:r}),Le.applyToStatusRegistry(r,Oe.getInstance()),yield e.saveSettings(!0)})}function cF(r){let{settingEl:e,infoEl:t,controlEl:n}=r,i=n.querySelector("textarea");i!==null&&(e.style.display="block",t.style.marginRight="0px",i.style.minWidth="-webkit-fill-available")}var Ok=require("obsidian");var gc=class extends Ok.EditorSuggest{constructor(t,n){super(t);this.settings=n,t.scope.register([],"Tab",()=>{var s;let i=(s=this.context)==null?void 0:s.editor;return i?(i.exec("indentMore"),!1):!0})}onTrigger(t,n,i){if(!this.settings.autoSuggestInEditor)return null;let s=n.getLine(t.line);return fv(s,t.ch)?{start:{line:t.line,ch:0},end:{line:t.line,ch:s.length},query:s}:null}getSuggestions(t){var a,o,u;let n=t.query,i=t.editor.getCursor();return((u=(o=(a=Eo()).buildSuggestions)==null?void 0:o.call(a,n,i.ch,this.settings))!=null?u:[]).map(l=>be(X({},l),{context:t}))}renderSuggestion(t,n){n.setText(t.displayText)}selectSuggestion(t,n){var u,l,c;let i=t.context.editor;if(t.suggestionType==="empty"){this.close();let d=new KeyboardEvent("keydown",{code:"Enter",key:"Enter"});(l=(u=i==null?void 0:i.cm)==null?void 0:u.contentDOM)==null||l.dispatchEvent(d);return}let s=t.context.editor.getCursor(),a={line:s.line,ch:(c=t.insertAt)!=null?c:s.ch},o=t.insertSkip?{line:s.line,ch:a.ch+t.insertSkip}:void 0;t.context.editor.replaceRange(t.appendText,a,o),t.context.editor.setCursor({line:s.line,ch:a.ch+t.appendText.length})}};var Dk=(r,e)=>{let t,n=new Promise((a,o)=>{t=a});return e(r,a=>{let o=a.map(u=>u.toFileLineString()).join(` -`);t(o)}).open(),n};var xk=(r,e)=>{let t=El({line:"",path:""});return new ti({app:r,task:t,onSubmit:e,allTasks:[]})};var Rk=r=>({createTaskLineModal:()=>Dk(r,xk)});var yc=class extends Mk.Plugin{get apiV1(){return Rk(app)}onload(){return L(this,null,function*(){Pt.registerConsoleLogger(),qm("info",`loading plugin "${this.manifest.name}" v${this.manifest.version}`),yield this.loadSettings();let{loggingOptions:t}=J();Pt.configure(t),this.addSettingTab(new Yo({plugin:this})),Lv({metadataCache:this.app.metadataCache,vault:this.app.vault,workspace:this.app.workspace}),yield this.loadTaskStatuses();let n=new ac({obsidianEvents:this.app.workspace});this.cache=new Pi({metadataCache:this.app.metadataCache,vault:this.app.vault,events:n}),this.inlineRenderer=new lc({plugin:this}),this.queryRenderer=new mc({plugin:this,events:n}),this.registerEditorExtension(sk()),this.registerEditorSuggest(new gc(this.app,J())),new Sl({plugin:this})})}loadTaskStatuses(){return L(this,null,function*(){let{statusSettings:t}=J();Le.applyToStatusRegistry(t,Oe.getInstance())})}onunload(){var t;qm("info",`unloading plugin "${this.manifest.name}" v${this.manifest.version}`),(t=this.cache)==null||t.unload()}loadSettings(){return L(this,null,function*(){let t=yield this.loadData();tt(t),t=J(),ye.getInstance().set(t.globalFilter),ye.getInstance().setRemoveGlobalFilter(t.removeGlobalFilter),kr.getInstance().set(t.globalQuery),yield this.loadTaskStatuses()})}saveSettings(){return L(this,null,function*(){yield this.saveData(J())})}getTasks(){var t;return(t=this.cache)==null?void 0:t.getTasks()}}; +show urgency`).setValue(s.globalQuery).onChange(a=>N(this,null,function*(){et({globalQuery:a}),Or.getInstance().set(a),yield this.plugin.saveSettings()}))})),t.createEl("h4",{text:"Task Statuses"});let{headingOpened:n}=X();Sk.forEach(i=>{this.addOneSettingsBlock(t,i,n)}),t.createEl("h4",{text:"Date Settings"}),new Ee.Setting(t).setName("Set created date on every added task").setDesc(Bt.createFragmentWithHTML(`Enabling this will add a timestamp \u2795 YYYY-MM-DD before other date values, when a task is created with 'Create or edit task', or by completing a recurring task.</br><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Dates#Created+date">documentation</a>.</p>`)).addToggle(i=>{let s=X();i.setValue(s.setCreatedDate).onChange(a=>N(this,null,function*(){et({setCreatedDate:a}),yield this.plugin.saveSettings()}))}),new Ee.Setting(t).setName("Set done date on every completed task").setDesc(Bt.createFragmentWithHTML('Enabling this will add a timestamp \u2705 YYYY-MM-DD at the end when a task is toggled to done.</br><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Dates#Done+date">documentation</a>.</p>')).addToggle(i=>{let s=X();i.setValue(s.setDoneDate).onChange(a=>N(this,null,function*(){et({setDoneDate:a}),yield this.plugin.saveSettings()}))}),new Ee.Setting(t).setName("Set cancelled date on every cancelled task").setDesc(Bt.createFragmentWithHTML('Enabling this will add a timestamp \u274C YYYY-MM-DD at the end when a task is toggled to cancelled.</br><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Dates#Cancelled+date">documentation</a>.</p>')).addToggle(i=>{let s=X();i.setValue(s.setCancelledDate).onChange(a=>N(this,null,function*(){et({setCancelledDate:a}),yield this.plugin.saveSettings()}))}),new Ee.Setting(t).setName("Use filename as Scheduled date for undated tasks").setDesc(Bt.createFragmentWithHTML('Save time entering Scheduled (\u23F3) dates.</br>If this option is enabled, any undated tasks will be given a default Scheduled date extracted from their file name.</br>The date in the file name must be in one of <code>YYYY-MM-DD</code> or <code>YYYYMMDD</code> formats.</br>Undated tasks have none of Due (\u{1F4C5} ), Scheduled (\u23F3) and Start (\u{1F6EB}) dates.</br><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Use+Filename+as+Default+Date">documentation</a>.</p>')).addToggle(i=>{let s=X();i.setValue(s.useFilenameAsScheduledDate).onChange(a=>N(this,null,function*(){et({useFilenameAsScheduledDate:a}),yield this.plugin.saveSettings()}))}),new Ee.Setting(t).setName("Folders with default Scheduled dates").setDesc("Leave empty if you want to use default Scheduled dates everywhere, or enter a comma-separated list of folders.").addText(i=>N(this,null,function*(){let s=X();yield this.plugin.saveSettings(),i.setValue(Bt.renderFolderArray(s.filenameAsDateFolders)).onChange(a=>N(this,null,function*(){let o=Bt.parseCommaSeparatedFolders(a);et({filenameAsDateFolders:o}),yield this.plugin.saveSettings()}))})),t.createEl("h4",{text:"Recurring task Settings"}),new Ee.Setting(t).setName("Next recurrence appears on the line below").setDesc(Bt.createFragmentWithHTML('Enabling this will make the next recurrence of a task appear on the line below the completed task. Otherwise the next recurrence will appear before the completed one.</br><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Recurring+Tasks">documentation</a>.</p>')).addToggle(i=>{let{recurrenceOnNextLine:s}=X();i.setValue(s).onChange(a=>N(this,null,function*(){et({recurrenceOnNextLine:a}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Auto-suggest Settings"}),new Ee.Setting(t).setName("Auto-suggest task content").setDesc(Bt.createFragmentWithHTML('Enabling this will open an intelligent suggest menu while typing inside a recognized task line.</br><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Auto-Suggest">documentation</a>.</p>')).addToggle(i=>{let s=X();i.setValue(s.autoSuggestInEditor).onChange(a=>N(this,null,function*(){et({autoSuggestInEditor:a}),yield this.plugin.saveSettings()}))}),new Ee.Setting(t).setName("Minimum match length for auto-suggest").setDesc("If higher than 0, auto-suggest will be triggered only when the beginning of any supported keywords is recognized.").addSlider(i=>{let s=X();i.setLimits(0,3,1).setValue(s.autoSuggestMinMatch).setDynamicTooltip().onChange(a=>N(this,null,function*(){et({autoSuggestMinMatch:a}),yield this.plugin.saveSettings()}))}),new Ee.Setting(t).setName("Maximum number of auto-suggestions to show").setDesc('How many suggestions should be shown when an auto-suggest menu pops up (including the "\u23CE" option).').addSlider(i=>{let s=X();i.setLimits(3,12,1).setValue(s.autoSuggestMaxItems).setDynamicTooltip().onChange(a=>N(this,null,function*(){et({autoSuggestMaxItems:a}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Dialog Settings"}),new Ee.Setting(t).setName("Provide access keys in dialogs").setDesc(Bt.createFragmentWithHTML('If the access keys (keyboard shortcuts) for various controls in dialog boxes conflict with system keyboard shortcuts or assistive technology functionality that is important for you, you may want to deactivate them here.</br><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Create+or+edit+Task#Keyboard+shortcuts">documentation</a>.</p>')).addToggle(i=>{let s=X();i.setValue(s.provideAccessKeys).onChange(a=>N(this,null,function*(){et({provideAccessKeys:a}),yield this.plugin.saveSettings()}))})}addOneSettingsBlock(t,n,i){let s=t.createEl("details",{cls:"tasks-nested-settings",attr:Q({},n.open||i[n.text]?{open:!0}:{})});s.empty(),s.ontoggle=()=>{i[n.text]=s.open,et({headingOpened:i}),this.plugin.saveSettings()};let a=s.createEl("summary");if(new Ee.Setting(a).setHeading().setName(n.text),a.createDiv("collapser").createDiv("handle"),n.notice!==null){let o=s.createEl("div",{cls:n.notice.class,text:n.notice.text});n.notice.html!==null&&o.insertAdjacentHTML("beforeend",n.notice.html)}n.settings.forEach(o=>{if(!(o.featureFlag!==""&&!pv(o.featureFlag))&&(o.type==="checkbox"?new Ee.Setting(s).setName(o.name).setDesc(o.description).addToggle(u=>{let l=X();l.generalSettings[o.settingName]||Ii(o.settingName,o.initialValue),u.setValue(l.generalSettings[o.settingName]).onChange(c=>N(this,null,function*(){Ii(o.settingName,c),yield this.plugin.saveSettings()}))}):o.type==="text"?new Ee.Setting(s).setName(o.name).setDesc(o.description).addText(u=>{let l=X();l.generalSettings[o.settingName]||Ii(o.settingName,o.initialValue);let c=d=>N(this,null,function*(){Ii(o.settingName,d),yield this.plugin.saveSettings()});u.setPlaceholder(o.placeholder.toString()).setValue(l.generalSettings[o.settingName].toString()).onChange((0,Ee.debounce)(c,500,!0))}):o.type==="textarea"?new Ee.Setting(s).setName(o.name).setDesc(o.description).addTextArea(u=>{let l=X();l.generalSettings[o.settingName]||Ii(o.settingName,o.initialValue);let c=d=>N(this,null,function*(){Ii(o.settingName,d),yield this.plugin.saveSettings()});u.setPlaceholder(o.placeholder.toString()).setValue(l.generalSettings[o.settingName].toString()).onChange((0,Ee.debounce)(c,500,!0)),u.inputEl.rows=8,u.inputEl.cols=40}):o.type==="function"&&this.customFunctions[o.settingName](s,this),o.notice!==null)){let u=s.createEl("p",{cls:o.notice.class,text:o.notice.text});o.notice.html!==null&&u.insertAdjacentHTML("beforeend",o.notice.html)}})}static parseCommaSeparatedFolders(t){return t.split(",").map(n=>n.trim()).map(n=>n.replace(/^\/|\/$/g,"")).filter(n=>n!=="")}static renderFolderArray(t){return t.join(",")}insertTaskCoreStatusSettings(t,n){let{statusSettings:i}=X();i.coreStatuses.forEach(a=>{Ok(t,a,i.coreStatuses,i,n,n.plugin,!0)}),new Ee.Setting(t).addButton(a=>{let o="Review and check your Statuses";a.setButtonText(o).setCta().onClick(()=>N(this,null,function*(){let l=window.moment().format("YYYY-MM-DD HH-mm-ss"),c=`Tasks Plugin - ${o} ${l}.md`,d=this.plugin.manifest.version,f=De.getInstance(),m=yk(i,f,o,d),g=yield app.vault.create(c,m);yield this.app.workspace.getLeaf(!0).openFile(g)})),a.setTooltip("Create a new file in the root of the vault, containing a Mermaid diagram of the current status settings.")}).infoEl.remove()}insertCustomTaskStatusSettings(t,n){let{statusSettings:i}=X();i.customStatuses.forEach(l=>{Ok(t,l,i.customStatuses,i,n,n.plugin,!1)}),t.createEl("div"),new Ee.Setting(t).addButton(l=>{l.setButtonText("Add New Task Status").setCta().onClick(()=>N(this,null,function*(){Le.addStatus(i.customStatuses,new Je("","","",!1,"TODO")),yield na(i,n)}))}).infoEl.remove();let a=[["AnuPpuccin Theme",bk()],["Aura Theme",Tk()],["Ebullientworks Theme",_k()],["ITS Theme & SlRvb Checkboxes",vk()],["Minimal Theme",kk()],["Things Theme",Ek()],["LYT Mode Theme (Dark mode only)",wk()]];for(let[l,c]of a)new Ee.Setting(t).addButton(f=>{let m=`${l}: Add ${c.length} supported Statuses`;f.setButtonText(m).onClick(()=>N(this,null,function*(){yield wF(c,i,n)}))}).infoEl.remove();new Ee.Setting(t).addButton(l=>{l.setButtonText("Add All Unknown Status Types").setCta().onClick(()=>N(this,null,function*(){let d=this.plugin.getTasks().map(m=>m.status),f=De.getInstance().findUnknownStatuses(d);f.length!==0&&(f.forEach(m=>{Le.addStatus(i.customStatuses,m)}),yield na(i,n))}))}).infoEl.remove(),new Ee.Setting(t).addButton(l=>{l.setButtonText("Reset Custom Status Types to Defaults").setWarning().onClick(()=>N(this,null,function*(){Le.resetAllCustomStatuses(i),yield na(i,n)}))}).infoEl.remove()}},Ko=Bt;Ko.createFragmentWithHTML=t=>createFragment(n=>n.createDiv().innerHTML=t);function Ok(r,e,t,n,i,s,a){let o=r.createEl("pre");o.addClass("row-for-status"),o.textContent=new te(e).previewText();let u=new Ee.Setting(r);u.infoEl.replaceWith(o),a||u.addExtraButton(l=>{l.setIcon("cross").setTooltip("Delete").onClick(()=>N(this,null,function*(){Le.deleteStatus(t,e)&&(yield na(n,i))}))}),u.addExtraButton(l=>{l.setIcon("pencil").setTooltip("Edit").onClick(()=>N(this,null,function*(){let c=new or(s,e,a);c.onClose=()=>N(this,null,function*(){c.saved&&Le.replaceStatus(t,e,c.statusConfiguration())&&(yield na(n,i))}),c.open()}))}),u.infoEl.remove()}function wF(r,e,t){return N(this,null,function*(){Le.bulkAddStatusCollection(e,r).forEach(i=>{new Ee.Notice(i)}),yield na(e,t)})}function na(r,e){return N(this,null,function*(){et({statusSettings:r}),Le.applyToStatusRegistry(r,De.getInstance()),yield e.saveSettings(!0)})}function kF(r){let{settingEl:e,infoEl:t,controlEl:n}=r,i=n.querySelector("textarea");i!==null&&(e.style.display="block",t.style.marginRight="0px",i.style.minWidth="-webkit-fill-available")}var Dk=require("obsidian");var pc=class extends Dk.EditorSuggest{constructor(t,n,i){super(t);this.settings=n,this.plugin=i,t.scope.register([],"Tab",()=>{var a;let s=(a=this.context)==null?void 0:a.editor;return s?(s.exec("indentMore"),!1):!0})}onTrigger(t,n,i){if(!this.settings.autoSuggestInEditor)return null;let s=n.getLine(t.line);return dv(s,t,n)?{start:{line:t.line,ch:0},end:{line:t.line,ch:s.length},query:s}:null}getSuggestions(t){var u,l,c;let n=t.query,i=t.editor.getCursor(),s=this.plugin.getTasks(),a=s.find(d=>d.taskLocation.path==t.file.path&&d.taskLocation.lineNumber==i.line);return((c=(l=(u=Oo()).buildSuggestions)==null?void 0:l.call(u,n,i.ch,this.settings,s,a))!=null?c:[]).map(d=>_e(Q({},d),{context:t}))}renderSuggestion(t,n){n.setText(t.displayText)}selectSuggestion(t,n){return N(this,null,function*(){var u,l,c;let i=t.context.editor;if(t.suggestionType==="empty"){this.close();let d=new KeyboardEvent("keydown",{code:"Enter",key:"Enter"});(l=(u=i==null?void 0:i.cm)==null?void 0:u.contentDOM)==null||l.dispatchEvent(d);return}if(t.taskItDependsOn!=null){let d=tl(t.taskItDependsOn,this.plugin.getTasks().map(f=>f.id));if(t.appendText+=` ${d.id}`,t.context.file.basename==d.filename){console.log(t.taskItDependsOn.toFileLineString());let f={line:t.taskItDependsOn.lineNumber,ch:0},m={line:t.taskItDependsOn.lineNumber,ch:t.taskItDependsOn.toFileLineString().length};t.context.editor.replaceRange(d.toFileLineString(),f,m)}else kr({originalTask:t.taskItDependsOn,newTasks:d})}let s=t.context.editor.getCursor(),a={line:s.line,ch:(c=t.insertAt)!=null?c:s.ch},o=t.insertSkip?{line:s.line,ch:a.ch+t.insertSkip}:void 0;t.context.editor.replaceRange(t.appendText,a,o),t.context.editor.setCursor({line:s.line,ch:a.ch+t.appendText.length})})}};var xk=(r,e)=>{let t,n=new Promise((a,o)=>{t=a});return e(r,a=>{let o=a.map(u=>u.toFileLineString()).join(` +`);t(o)}).open(),n};var Rk=(r,e)=>{let t=wl({line:"",path:""});return new ni({app:r,task:t,onSubmit:e,allTasks:[]})};var Mk=r=>({createTaskLineModal:()=>xk(r,Rk),executeToggleTaskDoneCommand:(e,t)=>uh(e,t).text});var mc=class extends Ck.Plugin{get apiV1(){return Mk(app)}onload(){return N(this,null,function*(){Ct.registerConsoleLogger(),Fm("info",`loading plugin "${this.manifest.name}" v${this.manifest.version}`),yield this.loadSettings();let{loggingOptions:t}=X();Ct.configure(t),this.addSettingTab(new Ko({plugin:this})),Av({metadataCache:this.app.metadataCache,vault:this.app.vault,workspace:this.app.workspace}),yield this.loadTaskStatuses();let n=new ic({obsidianEvents:this.app.workspace});this.cache=new Os({metadataCache:this.app.metadataCache,vault:this.app.vault,events:n}),this.inlineRenderer=new oc({plugin:this}),this.queryRenderer=new dc({plugin:this,events:n}),this.registerEditorExtension(rk()),this.registerEditorSuggest(new pc(this.app,X(),this)),new kl({plugin:this})})}loadTaskStatuses(){return N(this,null,function*(){let{statusSettings:t}=X();Le.applyToStatusRegistry(t,De.getInstance())})}onunload(){var t;Fm("info",`unloading plugin "${this.manifest.name}" v${this.manifest.version}`),(t=this.cache)==null||t.unload()}loadSettings(){return N(this,null,function*(){let t=yield this.loadData();et(t),t=X(),be.getInstance().set(t.globalFilter),be.getInstance().setRemoveGlobalFilter(t.removeGlobalFilter),Or.getInstance().set(t.globalQuery),yield this.loadTaskStatuses()})}saveSettings(){return N(this,null,function*(){yield this.saveData(X())})}getTasks(){return this.cache===void 0?[]:this.cache.getTasks()}}; /*! * EventEmitter2 * https://github.com/hij1nx/EventEmitter2 |
