/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source visit the plugins github repository
*/

/*
License obsidian-tasks:
MIT License

Copyright (c) 2021 Clare Macrae, Ilyas Landikov and Martin Schenck

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

/*
License rrule (included library):
rrule.js: Library for working with recurrence rules for calendar dates.
=======================================================================

Copyright 2010, Jakub Roztocil <jakub@roztocil.name> and Lars Schöning

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

    1. Redistributions of source code must retain the above copyright notice,
       this list of conditions and the following disclaimer.

    2. Redistributions in binary form must reproduce the above copyright
       notice, this list of conditions and the following disclaimer in the
       documentation and/or other materials provided with the distribution.

    3. Neither the name of The author nor the names of its contributors may
       be used to endorse or promote products derived from this software
       without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR AND CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.



./rrule.js and ./test/tests.js is based on python-dateutil. LICENCE:

python-dateutil - Extensions to the standard Python datetime module.
====================================================================

Copyright (c) 2003-2011 - Gustavo Niemeyer <gustavo@niemeyer.net>
Copyright (c) 2012 - Tomi Pieviläinen <tomi.pievilainen@iki.fi>

All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright notice,
      this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
    * Neither the name of the copyright holder nor the names of its
      contributors may be used to endorse or promote products derived from
      this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

/*
License chrono-node (included library):
The MIT License

Copyright (c) 2014, Wanasit Tanakitrungruang

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

/*
License flatpickr (included library):
The MIT License (MIT)

Copyright (c) 2017 Gregory Petrosyan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

"use strict";var TE=Object.create;var fa=Object.defineProperty,bE=Object.defineProperties,_E=Object.getOwnPropertyDescriptor,vE=Object.getOwnPropertyDescriptors,wE=Object.getOwnPropertyNames,Qo=Object.getOwnPropertySymbols,kE=Object.getPrototypeOf,Pc=Object.prototype.hasOwnProperty,ag=Object.prototype.propertyIsEnumerable;var sg=(r,e,t)=>e in r?fa(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,K=(r,e)=>{for(var t in e||(e={}))Pc.call(e,t)&&sg(r,t,e[t]);if(Qo)for(var t of Qo(e))ag.call(e,t)&&sg(r,t,e[t]);return r},ce=(r,e)=>bE(r,vE(e));var Xo=(r,e)=>{var t={};for(var n in r)Pc.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&&ag.call(r,n)&&(t[n]=r[n]);return t};var E=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),EE=(r,e)=>{for(var t in e)fa(r,t,{get:e[t],enumerable:!0})},og=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of wE(e))!Pc.call(r,i)&&i!==t&&fa(r,i,{get:()=>e[i],enumerable:!(n=_E(e,i))||n.enumerable});return r};var pa=(r,e,t)=>(t=r!=null?TE(kE(r)):{},og(e||!r||!r.__esModule?fa(t,"default",{value:r,enumerable:!0}):t,r)),SE=r=>og(fa({},"__esModule",{value:!0}),r);var P=(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=E($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.matchAnyPattern=$n.extractTerms=$n.repeatedTimeunitPattern=void 0;function RE(r,e){let t=e.replace(/\((?!\?)/g,"(?:");return`${r}${t}\\s{0,5}(?:,?\\s{0,5}${t}){0,10}`}$n.repeatedTimeunitPattern=RE;function ug(r){let e;return r instanceof Array?e=[...r]:r instanceof Map?e=Array.from(r.keys()):e=Object.keys(r),e}$n.extractTerms=ug;function ME(r){return`(?:${ug(r).sort((t,n)=>n.length-t.length).join("|").replace(/\./g,"\\.")})`}$n.matchAnyPattern=ME});var we=E((Ic,Fc)=>{(function(r,e){typeof Ic=="object"&&typeof Fc!="undefined"?Fc.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis!="undefined"?globalThis:r||self).dayjs=e()})(Ic,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",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|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,k={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("_")},_=function(j,$,D){var Y=String(j);return!Y||Y.length>=$?j:""+Array($+1-Y.length).join(D)+j},R={s:_,z:function(j){var $=-j.utcOffset(),D=Math.abs($),Y=Math.floor(D/60),I=D%60;return($<=0?"+":"-")+_(Y,2,"0")+":"+_(I,2,"0")},m:function j($,D){if($.date()<D.date())return-j(D,$);var Y=12*(D.year()-$.year())+(D.month()-$.month()),I=$.clone().add(Y,l),Z=D-I<0,f=$.clone().add(Y+(Z?-1:1),l);return+(-(Y+(D-I)/(Z?I-f:f-I))||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:p,h:a,m:s,s:i,ms:n,Q:c}[j]||String(j||"").toLowerCase().replace(/s$/,"")},u:function(j){return j===void 0}},S="en",F={};F[S]=k;var q=function(j){return j instanceof he},ne=function(j,$,D){var Y;if(!j)return S;if(typeof j=="string")F[j]&&(Y=j),$&&(F[j]=$,Y=j);else{var I=j.name;F[I]=j,Y=I}return!D&&Y&&(S=Y),Y||!D&&S},G=function(j,$){if(q(j))return j.clone();var D=typeof $=="object"?$:{};return D.date=j,D.args=arguments,new he(D)},B=R;B.l=ne,B.i=q,B.w=function(j,$){return G(j,{locale:$.$L,utc:$.$u,x:$.$x,$offset:$.$offset})};var he=function(){function j(D){this.$L=ne(D.locale,null,!0),this.parse(D)}var $=j.prototype;return $.parse=function(D){this.$d=function(Y){var I=Y.date,Z=Y.utc;if(I===null)return new Date(NaN);if(B.u(I))return new Date;if(I instanceof Date)return new Date(I);if(typeof I=="string"&&!/Z$/i.test(I)){var f=I.match(y);if(f){var h=f[2]-1||0,g=(f[7]||"0").substring(0,3);return Z?new Date(Date.UTC(f[1],h,f[3]||1,f[4]||0,f[5]||0,f[6]||0,g)):new Date(f[1],h,f[3]||1,f[4]||0,f[5]||0,f[6]||0,g)}}return new Date(I)}(D),this.$x=D.x||{},this.init()},$.init=function(){var D=this.$d;this.$y=D.getFullYear(),this.$M=D.getMonth(),this.$D=D.getDate(),this.$W=D.getDay(),this.$H=D.getHours(),this.$m=D.getMinutes(),this.$s=D.getSeconds(),this.$ms=D.getMilliseconds()},$.$utils=function(){return B},$.isValid=function(){return this.$d.toString()!==m},$.isSame=function(D,Y){var I=G(D);return this.startOf(Y)<=I&&I<=this.endOf(Y)},$.isAfter=function(D,Y){return G(D)<this.startOf(Y)},$.isBefore=function(D,Y){return this.endOf(Y)<G(D)},$.$g=function(D,Y,I){return B.u(D)?this[Y]:this.set(I,D)},$.unix=function(){return Math.floor(this.valueOf()/1e3)},$.valueOf=function(){return this.$d.getTime()},$.startOf=function(D,Y){var I=this,Z=!!B.u(Y)||Y,f=B.p(D),h=function(x,N){var ie=B.w(I.$u?Date.UTC(I.$y,N,x):new Date(I.$y,N,x),I);return Z?ie:ie.endOf(o)},g=function(x,N){return B.w(I.toDate()[x].apply(I.toDate("s"),(Z?[0,0,0,0]:[23,59,59,999]).slice(N)),I)},T=this.$W,w=this.$M,O=this.$D,M="set"+(this.$u?"UTC":"");switch(f){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=(T<A?T+7:T)-A;return h(Z?O-v:O+(6-v),w);case o:case p:return g(M+"Hours",0);case a:return g(M+"Minutes",1);case s:return g(M+"Seconds",2);case i:return g(M+"Milliseconds",3);default:return this.clone()}},$.endOf=function(D){return this.startOf(D,!1)},$.$set=function(D,Y){var I,Z=B.p(D),f="set"+(this.$u?"UTC":""),h=(I={},I[o]=f+"Date",I[p]=f+"Date",I[l]=f+"Month",I[d]=f+"FullYear",I[a]=f+"Hours",I[s]=f+"Minutes",I[i]=f+"Seconds",I[n]=f+"Milliseconds",I)[Z],g=Z===o?this.$D+(Y-this.$W):Y;if(Z===l||Z===d){var T=this.clone().set(p,1);T.$d[h](g),T.init(),this.$d=T.set(p,Math.min(this.$D,T.daysInMonth())).$d}else h&&this.$d[h](g);return this.init(),this},$.set=function(D,Y){return this.clone().$set(D,Y)},$.get=function(D){return this[B.p(D)]()},$.add=function(D,Y){var I,Z=this;D=Number(D);var f=B.p(Y),h=function(w){var O=G(Z);return B.w(O.date(O.date()+Math.round(w*D)),Z)};if(f===l)return this.set(l,this.$M+D);if(f===d)return this.set(d,this.$y+D);if(f===o)return h(1);if(f===u)return h(7);var g=(I={},I[s]=e,I[a]=t,I[i]=r,I)[f]||1,T=this.$d.getTime()+D*g;return B.w(T,this)},$.subtract=function(D,Y){return this.add(-1*D,Y)},$.format=function(D){var Y=this,I=this.$locale();if(!this.isValid())return I.invalidDate||m;var Z=D||"YYYY-MM-DDTHH:mm:ssZ",f=B.z(this),h=this.$H,g=this.$m,T=this.$M,w=I.weekdays,O=I.months,M=function(N,ie,le,pe){return N&&(N[ie]||N(Y,Z))||le[ie].substr(0,pe)},A=function(N){return B.s(h%12||12,N,"0")},v=I.meridiem||function(N,ie,le){var pe=N<12?"AM":"PM";return le?pe.toLowerCase():pe},x={YY:String(this.$y).slice(-2),YYYY:this.$y,M:T+1,MM:B.s(T+1,2,"0"),MMM:M(I.monthsShort,T,O,3),MMMM:M(O,T),D:this.$D,DD:B.s(this.$D,2,"0"),d:String(this.$W),dd:M(I.weekdaysMin,this.$W,w,2),ddd:M(I.weekdaysShort,this.$W,w,3),dddd:w[this.$W],H:String(h),HH:B.s(h,2,"0"),h:A(1),hh:A(2),a:v(h,g,!0),A:v(h,g,!1),m:String(g),mm:B.s(g,2,"0"),s:String(this.$s),ss:B.s(this.$s,2,"0"),SSS:B.s(this.$ms,3,"0"),Z:f};return Z.replace(b,function(N,ie){return ie||x[N]||f.replace(":","")})},$.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},$.diff=function(D,Y,I){var Z,f=B.p(Y),h=G(D),g=(h.utcOffset()-this.utcOffset())*e,T=this-h,w=B.m(this,h);return w=(Z={},Z[d]=w/12,Z[l]=w,Z[c]=w/3,Z[u]=(T-g)/6048e5,Z[o]=(T-g)/864e5,Z[a]=T/t,Z[s]=T/e,Z[i]=T/r,Z)[f]||T,I?w:B.a(w)},$.daysInMonth=function(){return this.endOf(l).$D},$.$locale=function(){return F[this.$L]},$.locale=function(D,Y){if(!D)return this.$L;var I=this.clone(),Z=ne(D,Y,!0);return Z&&(I.$L=Z),I},$.clone=function(){return B.w(this.$d,this)},$.toDate=function(){return new Date(this.valueOf())},$.toJSON=function(){return this.isValid()?this.toISOString():null},$.toISOString=function(){return this.$d.toISOString()},$.toString=function(){return this.$d.toUTCString()},j}(),Pe=he.prototype;return G.prototype=Pe,[["$ms",n],["$s",i],["$m",s],["$H",a],["$W",o],["$M",l],["$y",d],["$D",p]].forEach(function(j){Pe[j[1]]=function($){return this.$g($,j[0],j[1])}}),G.extend=function(j,$){return j.$i||(j($,he,G),j.$i=!0),G},G.locale=ne,G.isDayjs=q,G.unix=function(j){return G(1e3*j)},G.en=F[S],G.Ls=F,G.p={},G})});var ut=E(jn=>{"use strict";var CE=jn&&jn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(jn,"__esModule",{value:!0});jn.findYearClosestToRef=jn.findMostLikelyADYear=void 0;var AE=CE(we());function PE(r){return r<100&&(r>50?r=r+1900:r=r+2e3),r}jn.findMostLikelyADYear=PE;function NE(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()}jn.findYearClosestToRef=NE});var lt=E(de=>{"use strict";Object.defineProperty(de,"__esModule",{value:!0});de.parseTimeUnits=de.TIME_UNITS_PATTERN=de.parseYear=de.YEAR_PATTERN=de.parseOrdinalNumberPattern=de.ORDINAL_NUMBER_PATTERN=de.parseNumberPattern=de.NUMBER_PATTERN=de.TIME_UNIT_DICTIONARY=de.ORDINAL_WORD_DICTIONARY=de.INTEGER_WORD_DICTIONARY=de.MONTH_DICTIONARY=de.FULL_MONTH_NAME_DICTIONARY=de.WEEKDAY_DICTIONARY=void 0;var eu=Re(),IE=ut();de.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};de.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};de.MONTH_DICTIONARY=Object.assign(Object.assign({},de.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});de.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};de.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};de.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"};de.NUMBER_PATTERN=`(?:${eu.matchAnyPattern(de.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 cg(r){let e=r.toLowerCase();return de.INTEGER_WORD_DICTIONARY[e]!==void 0?de.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)}de.parseNumberPattern=cg;de.ORDINAL_NUMBER_PATTERN=`(?:${eu.matchAnyPattern(de.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:st|nd|rd|th)?)`;function FE(r){let e=r.toLowerCase();return de.ORDINAL_WORD_DICTIONARY[e]!==void 0?de.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:st|nd|rd|th)$/i,""),parseInt(e))}de.parseOrdinalNumberPattern=FE;de.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 LE(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 IE.findMostLikelyADYear(e)}de.parseYear=LE;var dg=`(${de.NUMBER_PATTERN})\\s{0,3}(${eu.matchAnyPattern(de.TIME_UNIT_DICTIONARY)})`,lg=new RegExp(dg,"i");de.TIME_UNITS_PATTERN=eu.repeatedTimeunitPattern("(?:(?:about|around)\\s{0,3})?",dg);function UE(r){let e={},t=r,n=lg.exec(t);for(;n;)WE(e,n),t=t.substring(n[0].length).trim(),n=lg.exec(t);return e}de.parseTimeUnits=UE;function WE(r,e){let t=cg(e[1]),n=de.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var fg=E((Lc,Uc)=>{(function(r,e){typeof Lc=="object"&&typeof Uc!="undefined"?Uc.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis!="undefined"?globalThis:r||self).dayjs_plugin_quarterOfYear=e()})(Lc,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 ir=E(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.implySimilarTime=Vr.assignSimilarTime=Vr.assignSimilarDate=Vr.assignTheNextDay=void 0;var pg=Ke();function qE(r,e){e=e.add(1,"day"),mg(r,e),hg(r,e)}Vr.assignTheNextDay=qE;function mg(r,e){r.assign("day",e.date()),r.assign("month",e.month()+1),r.assign("year",e.year())}Vr.assignSimilarDate=mg;function $E(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",pg.Meridiem.AM):r.assign("meridiem",pg.Meridiem.PM)}Vr.assignSimilarTime=$E;function hg(r,e){r.imply("hour",e.hour()),r.imply("minute",e.minute()),r.imply("second",e.second()),r.imply("millisecond",e.millisecond())}Vr.implySimilarTime=hg});var gg=E(fi=>{"use strict";Object.defineProperty(fi,"__esModule",{value:!0});fi.toTimezoneOffset=fi.TIMEZONE_ABBR_MAP=void 0;fi.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 jE(r){var e;return r==null?null:typeof r=="number"?r:(e=fi.TIMEZONE_ABBR_MAP[r])!==null&&e!==void 0?e:null}fi.toTimezoneOffset=jE});var We=E(zr=>{"use strict";var yg=zr&&zr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(zr,"__esModule",{value:!0});zr.ParsingResult=zr.ParsingComponents=zr.ReferenceWithTimezone=void 0;var GE=yg(fg()),tu=yg(we()),Wc=ir(),YE=gg();tu.default.extend(GE.default);var qc=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=YE.toTimezoneOffset(e.timezone))}};zr.ReferenceWithTimezone=qc;var pi=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=tu.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 pi(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 tu.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=tu.default(e.instant);for(let s in t)n=n.add(t[s],s);let i=new pi(e);return t.hour||t.minute||t.second?(Wc.assignSimilarTime(i,n),Wc.assignSimilarDate(i,n),e.timezoneOffset!==null&&i.assign("timezoneOffset",-e.instant.getTimezoneOffset())):(Wc.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}};zr.ParsingComponents=pi;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 pi(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}', ...}]`}};zr.ParsingResult=ma});var H=E(ru=>{"use strict";Object.defineProperty(ru,"__esModule",{value:!0});ru.AbstractParserWithWordBoundaryChecking=void 0;var $c=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)}};ru.AbstractParserWithWordBoundaryChecking=$c});var Tg=E(Yc=>{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});var Gc=lt(),BE=We(),HE=H(),VE=new RegExp(`(?:within|in|for)\\s*(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${Gc.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),zE=new RegExp(`(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${Gc.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),jc=class extends HE.AbstractParserWithWordBoundaryChecking{innerPattern(e){return e.option.forwardDate?zE:VE}innerExtract(e,t){let n=Gc.parseTimeUnits(t[1]);return BE.ParsingComponents.createRelativeFromReference(e.reference,n)}};Yc.default=jc});var Eg=E(Hc=>{"use strict";Object.defineProperty(Hc,"__esModule",{value:!0});var KE=ut(),wg=lt(),kg=lt(),nu=lt(),QE=Re(),XE=H(),ZE=new RegExp(`(?:on\\s{0,3})?(${nu.ORDINAL_NUMBER_PATTERN})(?:\\s{0,3}(?:to|\\-|\\\u2013|until|through|till)?\\s{0,3}(${nu.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s{0,3}(?:of)?\\s{0,3})(${QE.matchAnyPattern(wg.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s{0,3})(${kg.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),bg=1,_g=2,JE=3,vg=4,Bc=class extends XE.AbstractParserWithWordBoundaryChecking{innerPattern(){return ZE}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=wg.MONTH_DICTIONARY[t[JE].toLowerCase()],s=nu.parseOrdinalNumberPattern(t[bg]);if(s>31)return t.index=t.index+t[bg].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[vg]){let a=kg.parseYear(t[vg]);n.start.assign("year",a)}else{let a=KE.findYearClosestToRef(e.refDate,s,i);n.start.imply("year",a)}if(t[_g]){let a=nu.parseOrdinalNumberPattern(t[_g]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};Hc.default=Bc});var Rg=E(zc=>{"use strict";Object.defineProperty(zc,"__esModule",{value:!0});var eS=ut(),Dg=lt(),iu=lt(),xg=lt(),tS=Re(),rS=H(),nS=new RegExp(`(${tS.matchAnyPattern(Dg.MONTH_DICTIONARY)})(?:-|/|\\s*,?\\s*)(${iu.ORDINAL_NUMBER_PATTERN})(?!\\s*(?:am|pm))\\s*(?:(?:to|\\-)\\s*(${iu.ORDINAL_NUMBER_PATTERN})\\s*)?(?:(?:-|/|\\s*,?\\s*)(${xg.YEAR_PATTERN}))?(?=\\W|$)(?!\\:\\d)`,"i"),iS=1,sS=2,Sg=3,Og=4,Vc=class extends rS.AbstractParserWithWordBoundaryChecking{innerPattern(){return nS}innerExtract(e,t){let n=Dg.MONTH_DICTIONARY[t[iS].toLowerCase()],i=iu.parseOrdinalNumberPattern(t[sS]);if(i>31)return null;let s=e.createParsingComponents({day:i,month:n});if(t[Og]){let u=xg.parseYear(t[Og]);s.assign("year",u)}else{let u=eS.findYearClosestToRef(e.refDate,i,n);s.imply("year",u)}if(!t[Sg])return s;let a=iu.parseOrdinalNumberPattern(t[Sg]),o=e.createParsingResult(t.index,t[0]);return o.start=s,o.end=s.clone(),o.end.assign("day",a),o}};zc.default=Vc});var Ag=E(Xc=>{"use strict";Object.defineProperty(Xc,"__esModule",{value:!0});var Kc=lt(),aS=ut(),oS=Re(),Cg=lt(),uS=H(),lS=new RegExp(`((?:in)\\s*)?(${oS.matchAnyPattern(Kc.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${Cg.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),cS=1,dS=2,Mg=3,Qc=class extends uS.AbstractParserWithWordBoundaryChecking{innerPattern(){return lS}innerExtract(e,t){let n=t[dS].toLowerCase();if(t[0].length<=3&&!Kc.FULL_MONTH_NAME_DICTIONARY[n])return null;let i=e.createParsingResult(t.index+(t[cS]||"").length,t.index+t[0].length);i.start.imply("day",1);let s=Kc.MONTH_DICTIONARY[n];if(i.start.assign("month",s),t[Mg]){let a=Cg.parseYear(t[Mg]);i.start.assign("year",a)}else{let a=aS.findYearClosestToRef(e.refDate,1,s);i.start.imply("year",a)}return i}};Xc.default=Qc});var Ig=E(Jc=>{"use strict";Object.defineProperty(Jc,"__esModule",{value:!0});var Ng=lt(),fS=Re(),pS=H(),mS=new RegExp(`([0-9]{4})[\\.\\/\\s](?:(${fS.matchAnyPattern(Ng.MONTH_DICTIONARY)})|([0-9]{1,2}))[\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),hS=1,gS=2,Pg=3,yS=4,Zc=class extends pS.AbstractParserWithWordBoundaryChecking{innerPattern(){return mS}innerExtract(e,t){let n=t[Pg]?parseInt(t[Pg]):Ng.MONTH_DICTIONARY[t[gS].toLowerCase()];if(n<1||n>12)return null;let i=parseInt(t[hS]);return{day:parseInt(t[yS]),month:n,year:i}}};Jc.default=Zc});var Fg=E(td=>{"use strict";Object.defineProperty(td,"__esModule",{value:!0});var TS=H(),bS=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),_S=1,vS=2,ed=class extends TS.AbstractParserWithWordBoundaryChecking{innerPattern(){return bS}innerExtract(e,t){let n=parseInt(t[vS]),i=parseInt(t[_S]);return e.createParsingComponents().imply("day",1).assign("month",i).assign("year",n)}};td.default=ed});var mi=E(ou=>{"use strict";Object.defineProperty(ou,"__esModule",{value:!0});ou.AbstractTimeExpressionParser=void 0;var Ot=Ke();function wS(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 kS(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 Lg=2,Zi=3,su=4,au=5,ha=6,rd=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[Lg]);if(o>100){if(this.strictMode||t[Zi]!=null)return null;s=o%100,o=Math.floor(o/100)}if(o>24)return null;if(t[Zi]!=null){if(t[Zi].length==1&&!t[ha])return null;s=parseInt(t[Zi])}if(s>=60)return null;if(o>12&&(a=Ot.Meridiem.PM),t[ha]!=null){if(o>12)return null;let u=t[ha][0].toLowerCase();u=="a"&&(a=Ot.Meridiem.AM,o==12&&(o=0)),u=="p"&&(a=Ot.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",Ot.Meridiem.AM):i.imply("meridiem",Ot.Meridiem.PM),t[au]!=null){let u=parseInt(t[au].substring(0,3));if(u>=1e3)return null;i.assign("millisecond",u)}if(t[su]!=null){let u=parseInt(t[su]);if(u>=60)return null;i.assign("second",u)}return i}extractFollowingTimeComponents(e,t,n){let i=e.createParsingComponents();if(t[au]!=null){let u=parseInt(t[au].substring(0,3));if(u>=1e3)return null;i.assign("millisecond",u)}if(t[su]!=null){let u=parseInt(t[su]);if(u>=60)return null;i.assign("second",u)}let s=parseInt(t[Lg]),a=0,o=-1;if(t[Zi]!=null?a=parseInt(t[Zi]):s>100&&(a=s%100,s=Math.floor(s/100)),a>=60||s>24)return null;if(s>=12&&(o=Ot.Meridiem.PM),t[ha]!=null){if(s>12)return null;let u=t[ha][0].toLowerCase();u=="a"&&(o=Ot.Meridiem.AM,s==12&&(s=0,i.isCertain("day")||i.imply("day",i.get("day")+1))),u=="p"&&(o=Ot.Meridiem.PM,s!=12&&(s+=12)),n.start.isCertain("meridiem")||(o==Ot.Meridiem.AM?(n.start.imply("meridiem",Ot.Meridiem.AM),n.start.get("hour")==12&&n.start.assign("hour",0)):(n.start.imply("meridiem",Ot.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",Ot.Meridiem.AM):s<=12&&(i.assign("hour",s+12),i.assign("meridiem",Ot.Meridiem.PM)):s>12?i.imply("meridiem",Ot.Meridiem.PM):s<=12&&i.imply("meridiem",Ot.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=wS(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=kS(e,t),this.cachedFollowingPhase=e,this.cachedFollowingSuffix=t,this.cachedFollowingTimePatten)}};ou.AbstractTimeExpressionParser=rd});var Ug=E(id=>{"use strict";Object.defineProperty(id,"__esModule",{value:!0});var uu=Ke(),ES=mi(),nd=class extends ES.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",uu.Meridiem.PM)):i<6&&n.assign("meridiem",uu.Meridiem.AM)}if(t[0].endsWith("afternoon")){n.assign("meridiem",uu.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",uu.Meridiem.AM),n.get("hour")<12&&n.assign("hour",n.get("hour")))}return n}};id.default=nd});var sr=E(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.addImpliedTimeUnits=Ji.reverseTimeUnits=void 0;function SS(r){let e={};for(let t in r)e[t]=-r[t];return e}Ji.reverseTimeUnits=SS;function OS(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}Ji.addImpliedTimeUnits=OS});var Wg=E(od=>{"use strict";Object.defineProperty(od,"__esModule",{value:!0});var ad=lt(),DS=We(),xS=H(),RS=sr(),MS=new RegExp(`(${ad.TIME_UNITS_PATTERN})\\s{0,5}(?:ago|before|earlier)(?=(?:\\W|$))`,"i"),CS=new RegExp(`(${ad.TIME_UNITS_PATTERN})\\s{0,5}ago(?=(?:\\W|$))`,"i"),sd=class extends xS.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?CS:MS}innerExtract(e,t){let n=ad.parseTimeUnits(t[1]),i=RS.reverseTimeUnits(n);return DS.ParsingComponents.createRelativeFromReference(e.reference,i)}};od.default=sd});var qg=E(cd=>{"use strict";Object.defineProperty(cd,"__esModule",{value:!0});var ld=lt(),AS=We(),PS=H(),NS=new RegExp(`(${ld.TIME_UNITS_PATTERN})\\s{0,5}(?:later|after|from now|henceforth|forward|out)(?=(?:\\W|$))`,"i"),IS=new RegExp("("+ld.TIME_UNITS_PATTERN+")(later|from now)(?=(?:\\W|$))","i"),FS=1,ud=class extends PS.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?IS:NS}innerExtract(e,t){let n=ld.parseTimeUnits(t[FS]);return AS.ParsingComponents.createRelativeFromReference(e.reference,n)}};cd.default=ud});var ts=E(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.MergingRefiner=es.Filter=void 0;var dd=class{refine(e,t){return t.filter(n=>this.isValid(e,n))}};es.Filter=dd;var fd=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}};es.MergingRefiner=fd});var Kr=E(md=>{"use strict";Object.defineProperty(md,"__esModule",{value:!0});var LS=ts(),pd=class extends LS.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}};md.default=pd});var $g=E(ga=>{"use strict";var US=ga&&ga.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ga,"__esModule",{value:!0});var WS=US(Kr()),hd=class extends WS.default{patternBetween(){return/^\s*(to|-)\s*$/i}};ga.default=hd});var jg=E(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.mergeDateTimeComponent=rs.mergeDateTimeResult=void 0;var qS=Ke();function $S(r,e){let t=r.clone(),n=r.start,i=e.start;if(t.start=gd(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=gd(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}rs.mergeDateTimeResult=$S;function gd(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")==qS.Meridiem.PM&&t.get("hour")<12&&(e.isCertain("hour")?t.assign("hour",t.get("hour")+12):t.imply("hour",t.get("hour")+12)),t}rs.mergeDateTimeComponent=gd});var pn=E(Td=>{"use strict";Object.defineProperty(Td,"__esModule",{value:!0});var jS=ts(),Gg=jg(),yd=class extends jS.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()?Gg.mergeDateTimeResult(t,n):Gg.mergeDateTimeResult(n,t);return i.index=t.index,i.text=t.text+e+n.text,i}};Td.default=yd});var Yg=E(ya=>{"use strict";var GS=ya&&ya.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ya,"__esModule",{value:!0});var YS=GS(pn()),bd=class extends YS.default{patternBetween(){return new RegExp("^\\s*(T|at|after|before|on|of|,|-)?\\s*$")}};ya.default=bd});var Bg=E(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});var BS=new RegExp("^\\s*,?\\s*\\(?([A-Z]{2,4})\\)?(?=\\W|$)","i"),HS={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},_d=class{constructor(e){this.timezone=Object.assign(Object.assign({},HS),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=BS.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}};vd.default=_d});var lu=E(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});var VS=new RegExp("^\\s*(?:\\(?(?:GMT|UTC)\\s?)?([+-])(\\d{1,2})(?::?(\\d{2}))?\\)?","i"),zS=1,KS=2,QS=3,wd=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[QS]||"0"),u=a*60+o;u>14*60||(s[zS]==="-"&&(u=-u),n.end!=null&&n.end.assign("timezoneOffset",u),n.start.assign("timezoneOffset",u),n.text+=s[0])}),t}};kd.default=wd});var Hg=E(Sd=>{"use strict";Object.defineProperty(Sd,"__esModule",{value:!0});var Ed=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}};Sd.default=Ed});var Vg=E(Ta=>{"use strict";var XS=Ta&&Ta.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ta,"__esModule",{value:!0});var ZS=XS(we()),Od=class{refine(e,t){return e.option.forwardDate&&t.forEach(function(n){let i=ZS.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}};Ta.default=Od});var zg=E(xd=>{"use strict";Object.defineProperty(xd,"__esModule",{value:!0});var JS=ts(),Dd=class extends JS.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}};xd.default=Dd});var Cd=E(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});var eO=H(),tO=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"),rO=1,nO=2,iO=3,Kg=4,sO=5,Qg=6,Xg=7,Zg=8,Jg=9,Rd=class extends eO.AbstractParserWithWordBoundaryChecking{innerPattern(){return tO}innerExtract(e,t){let n={};if(n.year=parseInt(t[rO]),n.month=parseInt(t[nO]),n.day=parseInt(t[iO]),t[Kg]!=null)if(n.hour=parseInt(t[Kg]),n.minute=parseInt(t[sO]),t[Qg]!=null&&(n.second=parseInt(t[Qg])),t[Xg]!=null&&(n.millisecond=parseInt(t[Xg])),t[Zg]==null)n.timezoneOffset=0;else{let i=parseInt(t[Zg]),s=0;t[Jg]!=null&&(s=parseInt(t[Jg]));let a=i*60;a<0?a-=s:a+=s,n.timezoneOffset=a}return n}};Md.default=Rd});var ey=E(Pd=>{"use strict";Object.defineProperty(Pd,"__esModule",{value:!0});var aO=ts(),Ad=class extends aO.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}};Pd.default=Ad});var mn=E(ns=>{"use strict";var hi=ns&&ns.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ns,"__esModule",{value:!0});ns.includeCommonConfiguration=void 0;var oO=hi(Bg()),uO=hi(lu()),ty=hi(Hg()),lO=hi(Vg()),cO=hi(zg()),dO=hi(Cd()),fO=hi(ey());function pO(r,e=!1){return r.parsers.unshift(new dO.default),r.refiners.unshift(new fO.default),r.refiners.unshift(new oO.default),r.refiners.unshift(new uO.default),r.refiners.unshift(new ty.default),r.refiners.push(new ty.default),r.refiners.push(new lO.default),r.refiners.push(new cO.default(e)),r}ns.includeCommonConfiguration=pO});var gn=E(Oe=>{"use strict";var mO=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 Qr=We(),is=mO(we()),hn=ir(),ba=Ke();function hO(r){let e=is.default(r.instant),t=new Qr.ParsingComponents(r,{});return hn.assignSimilarDate(t,e),hn.assignSimilarTime(t,e),r.timezoneOffset!==null&&t.assign("timezoneOffset",e.utcOffset()),t}Oe.now=hO;function gO(r){let e=is.default(r.instant),t=new Qr.ParsingComponents(r,{});return hn.assignSimilarDate(t,e),hn.implySimilarTime(t,e),t}Oe.today=gO;function yO(r){return ry(r,1)}Oe.yesterday=yO;function ry(r,e){return Nd(r,-e)}Oe.theDayBefore=ry;function TO(r){return Nd(r,1)}Oe.tomorrow=TO;function Nd(r,e){let t=is.default(r.instant),n=new Qr.ParsingComponents(r,{});return t=t.add(e,"day"),hn.assignSimilarDate(n,t),hn.implySimilarTime(n,t),n}Oe.theDayAfter=Nd;function bO(r,e=22){let t=is.default(r.instant),n=new Qr.ParsingComponents(r,{});return n.imply("hour",e),n.imply("meridiem",ba.Meridiem.PM),hn.assignSimilarDate(n,t),n}Oe.tonight=bO;function _O(r,e=0){let t=is.default(r.instant),n=new Qr.ParsingComponents(r,{});return t.hour()<6&&(t=t.add(-1,"day")),hn.assignSimilarDate(n,t),n.imply("hour",e),n}Oe.lastNight=_O;function vO(r,e=20){let t=new Qr.ParsingComponents(r,{});return t.imply("meridiem",ba.Meridiem.PM),t.imply("hour",e),t}Oe.evening=vO;function wO(r,e=20){let t=is.default(r.instant),n=new Qr.ParsingComponents(r,{});return t=t.add(-1,"day"),hn.assignSimilarDate(n,t),n.imply("hour",e),n.imply("meridiem",ba.Meridiem.PM),n}Oe.yesterdayEvening=wO;function kO(r){let e=new Qr.ParsingComponents(r,{});return e.imply("hour",0),e.imply("minute",0),e.imply("second",0),e}Oe.midnight=kO;function EO(r,e=6){let t=new Qr.ParsingComponents(r,{});return t.imply("meridiem",ba.Meridiem.AM),t.imply("hour",e),t}Oe.morning=EO;function SO(r){let e=new Qr.ParsingComponents(r,{});return e.imply("meridiem",ba.Meridiem.AM),e.imply("hour",12),e}Oe.noon=SO});var ny=E(Or=>{"use strict";var OO=Or&&Or.__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]}),DO=Or&&Or.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),xO=Or&&Or.__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)&&OO(e,r,t);return DO(e,r),e},RO=Or&&Or.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Or,"__esModule",{value:!0});var MO=RO(we()),CO=H(),AO=ir(),_a=xO(gn()),PO=/(now|today|tonight|tomorrow|tmr|tmrw|yesterday|last\s*night)(?=\W|$)/i,Id=class extends CO.AbstractParserWithWordBoundaryChecking{innerPattern(e){return PO}innerExtract(e,t){let n=MO.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}};Or.default=Id});var iy=E(va=>{"use strict";var NO=va&&va.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(va,"__esModule",{value:!0});var cu=Ke(),IO=H(),FO=NO(we()),LO=ir(),UO=/(?:this)?\s{0,3}(morning|afternoon|evening|night|midnight|noon)(?=\W|$)/i,Fd=class extends IO.AbstractParserWithWordBoundaryChecking{innerPattern(){return UO}innerExtract(e,t){let n=FO.default(e.refDate),i=e.createParsingComponents();switch(t[1].toLowerCase()){case"afternoon":i.imply("meridiem",cu.Meridiem.PM),i.imply("hour",15);break;case"evening":case"night":i.imply("meridiem",cu.Meridiem.PM),i.imply("hour",20);break;case"midnight":LO.assignTheNextDay(i,n),i.imply("hour",0),i.imply("minute",0),i.imply("second",0);break;case"morning":i.imply("meridiem",cu.Meridiem.AM),i.imply("hour",6);break;case"noon":i.imply("meridiem",cu.Meridiem.AM),i.imply("hour",12);break}return i}};va.default=Fd});var gi=E(Gn=>{"use strict";var WO=Gn&&Gn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Gn,"__esModule",{value:!0});Gn.toDayJSClosestWeekday=Gn.toDayJSWeekday=void 0;var sy=WO(we());function qO(r,e,t){if(!t)return ay(r,e);let n=sy.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}Gn.toDayJSWeekday=qO;function ay(r,e){let t=sy.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}Gn.toDayJSClosestWeekday=ay});var uy=E(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0});var oy=lt(),$O=Re(),jO=H(),GO=gi(),YO=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:on\\s*?)?(?:(this|last|past|next)\\s*)?(${$O.matchAnyPattern(oy.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(this|last|past|next)\\s*week)?(?=\\W|$)`,"i"),BO=1,HO=2,VO=3,Ld=class extends jO.AbstractParserWithWordBoundaryChecking{innerPattern(){return YO}innerExtract(e,t){let n=t[HO].toLowerCase(),i=oy.WEEKDAY_DICTIONARY[n],s=t[BO],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=GO.toDayJSWeekday(e.refDate,i,u);return e.createParsingComponents().assign("weekday",i).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};Ud.default=Ld});var dy=E(wa=>{"use strict";var zO=wa&&wa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(wa,"__esModule",{value:!0});var cy=lt(),ly=We(),KO=zO(we()),QO=H(),XO=Re(),ZO=new RegExp(`(this|last|past|next|after\\s*this)\\s*(${XO.matchAnyPattern(cy.TIME_UNIT_DICTIONARY)})(?=\\s*)(?=\\W|$)`,"i"),JO=1,eD=2,Wd=class extends QO.AbstractParserWithWordBoundaryChecking{innerPattern(){return ZO}innerExtract(e,t){let n=t[JO].toLowerCase(),i=t[eD].toLowerCase(),s=cy.TIME_UNIT_DICTIONARY[i];if(n=="next"||n.startsWith("after")){let u={};return u[s]=1,ly.ParsingComponents.createRelativeFromReference(e.reference,u)}if(n=="last"||n=="past"){let u={};return u[s]=-1,ly.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=Wd});var Dr=E(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});os.ParsingContext=os.Chrono=void 0;var ss=We(),tD=qd(),as=class{constructor(e){e=e||tD.createCasualConfiguration(),this.parsers=[...e.parsers],this.refiners=[...e.refiners]}clone(){return new as({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 du(e,t,n),s=[];return this.parsers.forEach(a=>{let o=as.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 ss.ParsingResult?c=l:l instanceof ss.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}};os.Chrono=as;var du=class{constructor(e,t,n){this.text=e,this.reference=new ss.ReferenceWithTimezone(t),this.option=n!=null?n:{},this.refDate=this.reference.instant}createParsingComponents(e){return e instanceof ss.ParsingComponents?e:new ss.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 ss.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))}};os.ParsingContext=du});var yi=E(Gd=>{"use strict";Object.defineProperty(Gd,"__esModule",{value:!0});var fy=ut(),rD=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"),fu=1,py=5,my=2,hy=3,$d=4,jd=class{constructor(e){this.groupNumberMonth=e?hy:my,this.groupNumberDay=e?my:hy}pattern(){return rD}extract(e,t){if(t[fu]=="/"||t[py]=="/"){t.index+=t[0].length;return}let n=t.index+t[fu].length,i=t[0].substr(t[fu].length,t[0].length-t[fu].length-t[py].length);if(i.match(/^\d\.\d$/)||i.match(/^\d\.\d{1,2}\.\d{1,2}\s*$/)||!t[$d]&&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[$d]){let u=parseInt(t[$d]),l=fy.findMostLikelyADYear(u);s.start.assign("year",l)}else{let u=fy.findYearClosestToRef(e.refDate,o,a);s.start.imply("year",u)}return s}};Gd.default=jd});var yy=E(Bd=>{"use strict";Object.defineProperty(Bd,"__esModule",{value:!0});var gy=lt(),nD=We(),iD=H(),sD=sr(),aD=new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${gy.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),Yd=class extends iD.AbstractParserWithWordBoundaryChecking{innerPattern(){return aD}innerExtract(e,t){let n=t[1].toLowerCase(),i=gy.parseTimeUnits(t[2]);switch(n){case"last":case"past":case"-":i=sD.reverseTimeUnits(i);break}return nD.ParsingComponents.createRelativeFromReference(e.reference,i)}};Bd.default=Yd});var by=E(zd=>{"use strict";Object.defineProperty(zd,"__esModule",{value:!0});var oD=ts(),Hd=We(),uD=lt(),lD=sr();function Ty(r){return r.text.match(/\s+(before|from)$/i)!=null}function cD(r){return r.text.match(/\s+(after|since)$/i)!=null}var Vd=class extends oD.MergingRefiner{patternBetween(){return/^\s*$/i}shouldMergeResults(e,t,n){return!e.match(this.patternBetween())||!Ty(t)&&!cD(t)?!1:!!n.start.get("day")&&!!n.start.get("month")&&!!n.start.get("year")}mergeResults(e,t,n){let i=uD.parseTimeUnits(t.text);Ty(t)&&(i=lD.reverseTimeUnits(i));let s=Hd.ParsingComponents.createRelativeFromReference(new Hd.ReferenceWithTimezone(n.start.date()),i);return new Hd.ParsingResult(n.reference,t.index,`${t.text}${e}${n.text}`,s)}};zd.default=Vd});var qd=E(Ye=>{"use strict";var Xe=Ye&&Ye.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.createConfiguration=Ye.createCasualConfiguration=Ye.parseDate=Ye.parse=Ye.GB=Ye.strict=Ye.casual=void 0;var dD=Xe(Tg()),fD=Xe(Eg()),pD=Xe(Rg()),mD=Xe(Ag()),hD=Xe(Ig()),gD=Xe(Fg()),yD=Xe(Ug()),TD=Xe(Wg()),bD=Xe(qg()),_D=Xe($g()),vD=Xe(Yg()),wD=mn(),kD=Xe(ny()),ED=Xe(iy()),SD=Xe(uy()),OD=Xe(dy()),Kd=Dr(),DD=Xe(yi()),xD=Xe(yy()),RD=Xe(by());Ye.casual=new Kd.Chrono(_y(!1));Ye.strict=new Kd.Chrono(pu(!0,!1));Ye.GB=new Kd.Chrono(pu(!1,!0));function MD(r,e,t){return Ye.casual.parse(r,e,t)}Ye.parse=MD;function CD(r,e,t){return Ye.casual.parseDate(r,e,t)}Ye.parseDate=CD;function _y(r=!1){let e=pu(!1,r);return e.parsers.unshift(new kD.default),e.parsers.unshift(new ED.default),e.parsers.unshift(new mD.default),e.parsers.unshift(new OD.default),e.parsers.unshift(new xD.default),e}Ye.createCasualConfiguration=_y;function pu(r=!0,e=!1){return wD.includeCommonConfiguration({parsers:[new DD.default(e),new dD.default,new fD.default,new pD.default,new SD.default,new hD.default,new gD.default,new yD.default(r),new TD.default(r),new bD.default(r)],refiners:[new RD.default,new vD.default,new _D.default]},r)}Ye.createConfiguration=pu});var vy=E(Xd=>{"use strict";Object.defineProperty(Xd,"__esModule",{value:!0});var AD=mi(),Qd=class extends AD.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)}};Xd.default=Qd});var ka=E(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 Zd=Re(),PD=ut();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=`(?:${Zd.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 ky(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=ky;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 ND(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 PD.findMostLikelyADYear(e)}Ae.parseYear=ND;var Ey=`(${Ae.NUMBER_PATTERN})\\s{0,5}(${Zd.matchAnyPattern(Ae.TIME_UNIT_DICTIONARY)})\\s{0,5}`,wy=new RegExp(Ey,"i");Ae.TIME_UNITS_PATTERN=Zd.repeatedTimeunitPattern("",Ey);function ID(r){let e={},t=r,n=wy.exec(t);for(;n;)FD(e,n),t=t.substring(n[0].length),n=wy.exec(t);return e}Ae.parseTimeUnits=ID;function FD(r,e){let t=ky(e[1]),n=Ae.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var Oy=E(ef=>{"use strict";Object.defineProperty(ef,"__esModule",{value:!0});var Sy=ka(),LD=Re(),UD=H(),WD=gi(),qD=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:a[mn]\\s*?)?(?:(diese[mn]|letzte[mn]|n(?:\xE4|ae)chste[mn])\\s*)?(${LD.matchAnyPattern(Sy.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(diese|letzte|n(?:\xE4|ae)chste)\\s*woche)?(?=\\W|$)`,"i"),$D=1,jD=3,GD=2,Jd=class extends UD.AbstractParserWithWordBoundaryChecking{innerPattern(){return qD}innerExtract(e,t){let n=t[GD].toLowerCase(),i=Sy.WEEKDAY_DICTIONARY[n],s=t[$D],a=t[jD],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=WD.toDayJSWeekday(e.refDate,i,u);return e.createParsingComponents().assign("weekday",i).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};ef.default=Jd});var My=E(tf=>{"use strict";Object.defineProperty(tf,"__esModule",{value:!0});var Yn=Ke(),YD=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"),BD=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"),HD=2,Dy=3,xy=4,Ry=5,us=class{pattern(e){return YD}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=us.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=BD.exec(i);return s&&(n.end=us.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[HD]),t[Dy]!=null&&(i=parseInt(t[Dy])),i>=60||n>24)return null;if(n>=12&&(s=Yn.Meridiem.PM),t[Ry]!=null){if(n>12)return null;let a=t[Ry].toLowerCase();a.match(/morgen|vormittag/)&&(s=Yn.Meridiem.AM,n==12&&(n=0)),a.match(/nachmittag|abend/)&&(s=Yn.Meridiem.PM,n!=12&&(n+=12)),a.match(/nacht/)&&(n==12?(s=Yn.Meridiem.AM,n=0):n<6?s=Yn.Meridiem.AM:(s=Yn.Meridiem.PM,n+=12))}if(e.assign("hour",n),e.assign("minute",i),s!==null?e.assign("meridiem",s):n<12?e.imply("meridiem",Yn.Meridiem.AM):e.imply("meridiem",Yn.Meridiem.PM),t[xy]!=null){let a=parseInt(t[xy]);if(a>=60)return null;e.assign("second",a)}return e}};tf.default=us});var Cy=E(Ea=>{"use strict";var VD=Ea&&Ea.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ea,"__esModule",{value:!0});var zD=VD(Kr()),rf=class extends zD.default{patternBetween(){return/^\s*(bis(?:\s*(?:am|zum))?|-)\s*$/i}};Ea.default=rf});var Ay=E(Sa=>{"use strict";var KD=Sa&&Sa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Sa,"__esModule",{value:!0});var QD=KD(pn()),nf=class extends QD.default{patternBetween(){return new RegExp("^\\s*(T|um|am|,|-)?\\s*$")}};Sa.default=nf});var sf=E(Da=>{"use strict";var XD=Da&&Da.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Da,"__esModule",{value:!0});var ZD=XD(we()),Ti=Ke(),JD=H(),e0=ir(),t0=sr(),Oa=class extends JD.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(diesen)?\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht)(?=\W|$)/i}innerExtract(e,t){let n=ZD.default(e.refDate),i=t[2].toLowerCase(),s=e.createParsingComponents();return e0.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",Ti.Meridiem.AM);break;case"vormittag":e.imply("hour",9),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",Ti.Meridiem.AM);break;case"mittag":case"mittags":e.imply("hour",12),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",Ti.Meridiem.AM);break;case"nachmittag":e.imply("hour",15),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",Ti.Meridiem.PM);break;case"abend":e.imply("hour",18),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",Ti.Meridiem.PM);break;case"nacht":e.imply("hour",22),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",Ti.Meridiem.PM);break;case"mitternacht":e.get("hour")>1&&(e=t0.addImpliedTimeUnits(e,{day:1})),e.imply("hour",0),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",Ti.Meridiem.AM);break}return e}};Da.default=Oa});var Iy=E(xr=>{"use strict";var r0=xr&&xr.__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]}),n0=xr&&xr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),i0=xr&&xr.__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)&&r0(e,r,t);return n0(e,r),e},Ny=xr&&xr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(xr,"__esModule",{value:!0});var s0=Ny(we()),a0=H(),bi=ir(),o0=Ny(sf()),Py=i0(gn()),u0=new RegExp("(jetzt|heute|morgen|\xFCbermorgen|uebermorgen|gestern|vorgestern|letzte\\s*nacht)(?:\\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht))?(?=\\W|$)","i"),l0=1,c0=2,af=class extends a0.AbstractParserWithWordBoundaryChecking{innerPattern(e){return u0}innerExtract(e,t){let n=s0.default(e.refDate),i=(t[l0]||"").toLowerCase(),s=(t[c0]||"").toLowerCase(),a=e.createParsingComponents();switch(i){case"jetzt":a=Py.now(e.reference);break;case"heute":a=Py.today(e.reference);break;case"morgen":bi.assignTheNextDay(a,n);break;case"\xFCbermorgen":case"uebermorgen":n=n.add(1,"day"),bi.assignTheNextDay(a,n);break;case"gestern":n=n.add(-1,"day"),bi.assignSimilarDate(a,n),bi.implySimilarTime(a,n);break;case"vorgestern":n=n.add(-2,"day"),bi.assignSimilarDate(a,n),bi.implySimilarTime(a,n);break;default:i.match(/letzte\s*nacht/)&&(n.hour()>6&&(n=n.add(-1,"day")),bi.assignSimilarDate(a,n),a.imply("hour",0));break}return s&&(a=o0.default.extractTimeComponents(a,s)),a}};xr.default=af});var $y=E(uf=>{"use strict";Object.defineProperty(uf,"__esModule",{value:!0});var d0=ut(),Wy=ka(),qy=ka(),f0=Re(),p0=H(),m0=new RegExp(`(?:am\\s*?)?(?:den\\s*?)?([0-9]{1,2})\\.(?:\\s*(?:bis(?:\\s*(?:am|zum))?|\\-|\\\u2013|\\s)\\s*([0-9]{1,2})\\.?)?\\s*(${f0.matchAnyPattern(Wy.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s*)(${qy.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),Fy=1,Ly=2,h0=3,Uy=4,of=class extends p0.AbstractParserWithWordBoundaryChecking{innerPattern(){return m0}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=Wy.MONTH_DICTIONARY[t[h0].toLowerCase()],s=parseInt(t[Fy]);if(s>31)return t.index=t.index+t[Fy].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[Uy]){let a=qy.parseYear(t[Uy]);n.start.assign("year",a)}else{let a=d0.findYearClosestToRef(e.refDate,s,i);n.start.imply("year",a)}if(t[Ly]){let a=parseInt(t[Ly]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};uf.default=of});var jy=E(cf=>{"use strict";Object.defineProperty(cf,"__esModule",{value:!0});var mu=ka(),g0=We(),y0=H(),T0=sr(),b0=Re(),lf=class extends y0.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*)?(${mu.NUMBER_PATTERN})?(?:\\s*(n\xE4chste|kommende|folgende|letzte|vergangene|vorige|vor(?:her|an)gegangene)(?:s|n|m|r)?)?\\s*(${b0.matchAnyPattern(mu.TIME_UNIT_DICTIONARY)})`,"i")}innerExtract(e,t){let n=t[2]?mu.parseNumberPattern(t[2]):1,i=mu.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=T0.reverseTimeUnits(s)),g0.ParsingComponents.createRelativeFromReference(e.reference,s)}};cf.default=lf});var By=E(Ze=>{"use strict";var Rr=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=void 0;var _0=mn(),Gy=Dr(),v0=Rr(yi()),w0=Rr(Cd()),k0=Rr(vy()),E0=Rr(Oy()),S0=Rr(My()),O0=Rr(Cy()),D0=Rr(Ay()),x0=Rr(Iy()),R0=Rr(sf()),M0=Rr($y()),C0=Rr(jy());Ze.casual=new Gy.Chrono(Yy());Ze.strict=new Gy.Chrono(df(!0));function A0(r,e,t){return Ze.casual.parse(r,e,t)}Ze.parse=A0;function P0(r,e,t){return Ze.casual.parseDate(r,e,t)}Ze.parseDate=P0;function Yy(r=!0){let e=df(!1,r);return e.parsers.unshift(new R0.default),e.parsers.unshift(new x0.default),e.parsers.unshift(new C0.default),e}Ze.createCasualConfiguration=Yy;function df(r=!0,e=!0){return _0.includeCommonConfiguration({parsers:[new w0.default,new v0.default(e),new k0.default,new S0.default,new M0.default,new E0.default],refiners:[new O0.default,new D0.default]},r)}Ze.createConfiguration=df});var Vy=E(Mr=>{"use strict";var N0=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]}),I0=Mr&&Mr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),F0=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)&&N0(e,r,t);return I0(e,r),e},L0=Mr&&Mr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Mr,"__esModule",{value:!0});var U0=L0(we()),W0=Ke(),q0=H(),Hy=ir(),hu=F0(gn()),ff=class extends q0.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(maintenant|aujourd'hui|demain|hier|cette\s*nuit|la\s*veille)(?=\W|$)/i}innerExtract(e,t){let n=U0.default(e.refDate),i=t[0].toLowerCase(),s=e.createParsingComponents();switch(i){case"maintenant":return hu.now(e.reference);case"aujourd'hui":return hu.today(e.reference);case"hier":return hu.yesterday(e.reference);case"demain":return hu.tomorrow(e.reference);default:i.match(/cette\s*nuit/)?(Hy.assignSimilarDate(s,n),s.imply("hour",22),s.imply("meridiem",W0.Meridiem.PM)):i.match(/la\s*veille/)&&(n=n.add(-1,"day"),Hy.assignSimilarDate(s,n),s.imply("hour",0))}return s}};Mr.default=ff});var zy=E(mf=>{"use strict";Object.defineProperty(mf,"__esModule",{value:!0});var xa=Ke(),$0=H(),pf=class extends $0.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}};mf.default=pf});var Ky=E(gf=>{"use strict";Object.defineProperty(gf,"__esModule",{value:!0});var j0=mi(),hf=class extends j0.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)}};gf.default=hf});var Qy=E(Ra=>{"use strict";var G0=Ra&&Ra.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ra,"__esModule",{value:!0});var Y0=G0(pn()),yf=class extends Y0.default{patternBetween(){return new RegExp("^\\s*(T|\xE0|a|vers|de|,|-)?\\s*$")}};Ra.default=yf});var Xy=E(Ma=>{"use strict";var B0=Ma&&Ma.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ma,"__esModule",{value:!0});var H0=B0(Kr()),Tf=class extends H0.default{patternBetween(){return/^\s*(à|a|-)\s*$/i}};Ma.default=Tf});var Bn=E(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.parseTimeUnits=ke.TIME_UNITS_PATTERN=ke.parseYear=ke.YEAR_PATTERN=ke.parseOrdinalNumberPattern=ke.ORDINAL_NUMBER_PATTERN=ke.parseNumberPattern=ke.NUMBER_PATTERN=ke.TIME_UNIT_DICTIONARY=ke.INTEGER_WORD_DICTIONARY=ke.MONTH_DICTIONARY=ke.WEEKDAY_DICTIONARY=void 0;var bf=Re();ke.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};ke.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};ke.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};ke.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"};ke.NUMBER_PATTERN=`(?:${bf.matchAnyPattern(ke.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|une?\\b|quelques?|demi-?)`;function Jy(r){let e=r.toLowerCase();return ke.INTEGER_WORD_DICTIONARY[e]!==void 0?ke.INTEGER_WORD_DICTIONARY[e]:e==="une"||e==="un"?1:e.match(/quelques?/)?3:e.match(/demi-?/)?.5:parseFloat(e)}ke.parseNumberPattern=Jy;ke.ORDINAL_NUMBER_PATTERN="(?:[0-9]{1,2}(?:er)?)";function V0(r){let e=r.toLowerCase();return e=e.replace(/(?:er)$/i,""),parseInt(e)}ke.parseOrdinalNumberPattern=V0;ke.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 z0(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}ke.parseYear=z0;var eT=`(${ke.NUMBER_PATTERN})\\s{0,5}(${bf.matchAnyPattern(ke.TIME_UNIT_DICTIONARY)})\\s{0,5}`,Zy=new RegExp(eT,"i");ke.TIME_UNITS_PATTERN=bf.repeatedTimeunitPattern("",eT);function K0(r){let e={},t=r,n=Zy.exec(t);for(;n;)Q0(e,n),t=t.substring(n[0].length),n=Zy.exec(t);return e}ke.parseTimeUnits=K0;function Q0(r,e){let t=Jy(e[1]),n=ke.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var rT=E(vf=>{"use strict";Object.defineProperty(vf,"__esModule",{value:!0});var tT=Bn(),X0=Re(),Z0=H(),J0=gi(),e1=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:(?:ce)\\s*)?(${X0.matchAnyPattern(tT.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(dernier|prochain)\\s*)?(?=\\W|\\d|$)`,"i"),t1=1,r1=2,_f=class extends Z0.AbstractParserWithWordBoundaryChecking{innerPattern(){return e1}innerExtract(e,t){let n=t[t1].toLowerCase(),i=tT.WEEKDAY_DICTIONARY[n];if(i===void 0)return null;let s=t[r1];s=s||"",s=s.toLowerCase();let a=null;s=="dernier"?a="last":s=="prochain"&&(a="next");let o=J0.toDayJSWeekday(e.refDate,i,a);return e.createParsingComponents().assign("weekday",i).imply("day",o.date()).imply("month",o.month()+1).imply("year",o.year())}};vf.default=_f});var aT=E(wf=>{"use strict";Object.defineProperty(wf,"__esModule",{value:!0});var Ca=Ke(),n1=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"),i1=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"),s1=2,nT=3,iT=4,sT=5,ls=class{pattern(e){return n1}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=ls.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=i1.exec(i);return s&&(n.end=ls.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[s1]),t[nT]!=null&&(i=parseInt(t[nT])),i>=60||n>24)return null;if(n>=12&&(s=Ca.Meridiem.PM),t[sT]!=null){if(n>12)return null;let a=t[sT][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[iT]!=null){let a=parseInt(t[iT]);if(a>=60)return null;e.assign("second",a)}return e}};wf.default=ls});var fT=E(Ef=>{"use strict";Object.defineProperty(Ef,"__esModule",{value:!0});var a1=ut(),cT=Bn(),dT=Bn(),gu=Bn(),o1=Re(),u1=H(),l1=new RegExp(`(?:on\\s*?)?(${gu.ORDINAL_NUMBER_PATTERN})(?:\\s*(?:au|\\-|\\\u2013|jusqu'au?|\\s)\\s*(${gu.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s*(?:de)?\\s*)(${o1.matchAnyPattern(cT.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s*)(${dT.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),oT=1,uT=2,c1=3,lT=4,kf=class extends u1.AbstractParserWithWordBoundaryChecking{innerPattern(){return l1}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=cT.MONTH_DICTIONARY[t[c1].toLowerCase()],s=gu.parseOrdinalNumberPattern(t[oT]);if(s>31)return t.index=t.index+t[oT].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[lT]){let a=dT.parseYear(t[lT]);n.start.assign("year",a)}else{let a=a1.findYearClosestToRef(e.refDate,s,i);n.start.imply("year",a)}if(t[uT]){let a=gu.parseOrdinalNumberPattern(t[uT]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};Ef.default=kf});var mT=E(Of=>{"use strict";Object.defineProperty(Of,"__esModule",{value:!0});var pT=Bn(),d1=We(),f1=H(),p1=sr(),Sf=class extends f1.AbstractParserWithWordBoundaryChecking{constructor(){super()}innerPattern(){return new RegExp(`il y a\\s*(${pT.TIME_UNITS_PATTERN})(?=(?:\\W|$))`,"i")}innerExtract(e,t){let n=pT.parseTimeUnits(t[1]),i=p1.reverseTimeUnits(n);return d1.ParsingComponents.createRelativeFromReference(e.reference,i)}};Of.default=Sf});var gT=E(xf=>{"use strict";Object.defineProperty(xf,"__esModule",{value:!0});var hT=Bn(),m1=We(),h1=H(),Df=class extends h1.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp(`(?:dans|en|pour|pendant|de)\\s*(${hT.TIME_UNITS_PATTERN})(?=\\W|$)`,"i")}innerExtract(e,t){let n=hT.parseTimeUnits(t[1]);return m1.ParsingComponents.createRelativeFromReference(e.reference,n)}};xf.default=Df});var yT=E(Mf=>{"use strict";Object.defineProperty(Mf,"__esModule",{value:!0});var yu=Bn(),g1=We(),y1=H(),T1=sr(),b1=Re(),Rf=class extends y1.AbstractParserWithWordBoundaryChecking{constructor(){super()}innerPattern(){return new RegExp(`(?:les?|la|l'|du|des?)\\s*(${yu.NUMBER_PATTERN})?(?:\\s*(prochaine?s?|derni[e\xE8]re?s?|pass[\xE9e]e?s?|pr[\xE9e]c[\xE9e]dents?|suivante?s?))?\\s*(${b1.matchAnyPattern(yu.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]?yu.parseNumberPattern(t[1]):1,i=yu.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=T1.reverseTimeUnits(s)),g1.ParsingComponents.createRelativeFromReference(e.reference,s)}};Mf.default=Rf});var _T=E(Je=>{"use strict";var ar=Je&&Je.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Je,"__esModule",{value:!0});Je.createConfiguration=Je.createCasualConfiguration=Je.parseDate=Je.parse=Je.strict=Je.casual=void 0;var _1=mn(),TT=Dr(),v1=ar(Vy()),w1=ar(zy()),k1=ar(yi()),E1=ar(Ky()),S1=ar(Qy()),O1=ar(Xy()),D1=ar(rT()),x1=ar(aT()),R1=ar(fT()),M1=ar(mT()),C1=ar(gT()),A1=ar(yT());Je.casual=new TT.Chrono(bT());Je.strict=new TT.Chrono(Cf(!0));function P1(r,e,t){return Je.casual.parse(r,e,t)}Je.parse=P1;function N1(r,e,t){return Je.casual.parseDate(r,e,t)}Je.parseDate=N1;function bT(r=!0){let e=Cf(!1,r);return e.parsers.unshift(new v1.default),e.parsers.unshift(new w1.default),e.parsers.unshift(new A1.default),e}Je.createCasualConfiguration=bT;function Cf(r=!0,e=!0){return _1.includeCommonConfiguration({parsers:[new k1.default(e),new R1.default,new E1.default,new x1.default,new M1.default,new C1.default,new D1.default],refiners:[new S1.default,new O1.default]},r)}Je.createConfiguration=Cf});var vT=E(Tu=>{"use strict";Object.defineProperty(Tu,"__esModule",{value:!0});Tu.toHankaku=void 0;function I1(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,F1)}Tu.toHankaku=I1;function F1(r){return String.fromCharCode(r.charCodeAt(0)-65248)}});var kT=E(Aa=>{"use strict";var L1=Aa&&Aa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Aa,"__esModule",{value:!0});var Af=vT(),U1=ut(),W1=L1(we()),q1=/(?:(?:([同今本])|((昭和|平成|令和)?([0-9０-９]{1,4}|元)))年\s*)?([0-9０-９]{1,2})月\s*([0-9０-９]{1,2})日/i,wT=1,$1=2,Pf=3,j1=4,G1=5,Y1=6,Nf=class{pattern(){return q1}extract(e,t){let n=parseInt(Af.toHankaku(t[G1])),i=parseInt(Af.toHankaku(t[Y1])),s=e.createParsingComponents({day:i,month:n});if(t[wT]&&t[wT].match("\u540C|\u4ECA|\u672C")){let a=W1.default(e.refDate);s.assign("year",a.year())}if(t[$1]){let a=t[j1],o=a=="\u5143"?1:parseInt(Af.toHankaku(a));t[Pf]=="\u4EE4\u548C"?o+=2018:t[Pf]=="\u5E73\u6210"?o+=1988:t[Pf]=="\u662D\u548C"&&(o+=1925),s.assign("year",o)}else{let a=U1.findYearClosestToRef(e.refDate,i,n);s.imply("year",a)}return s}};Aa.default=Nf});var ET=E(Pa=>{"use strict";var B1=Pa&&Pa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Pa,"__esModule",{value:!0});var H1=B1(Kr()),If=class extends H1.default{patternBetween(){return/^\s*(から|ー|-)\s*$/i}};Pa.default=If});var OT=E(Cr=>{"use strict";var V1=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]}),z1=Cr&&Cr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),K1=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)&&V1(e,r,t);return z1(e,r),e},Q1=Cr&&Cr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Cr,"__esModule",{value:!0});var X1=Q1(we()),ST=Ke(),Ff=K1(gn()),Z1=/今日|当日|昨日|明日|今夜|今夕|今晩|今朝/i,Lf=class{pattern(){return Z1}extract(e,t){let n=t[0],i=X1.default(e.refDate),s=e.createParsingComponents();switch(n){case"\u6628\u65E5":return Ff.yesterday(e.reference);case"\u660E\u65E5":return Ff.tomorrow(e.reference);case"\u4ECA\u65E5":case"\u5F53\u65E5":return Ff.today(e.reference)}return n=="\u4ECA\u591C"||n=="\u4ECA\u5915"||n=="\u4ECA\u6669"?(s.imply("hour",22),s.assign("meridiem",ST.Meridiem.PM)):n.match("\u4ECA\u671D")&&(s.imply("hour",6),s.assign("meridiem",ST.Meridiem.AM)),s.assign("day",i.date()),s.assign("month",i.month()+1),s.assign("year",i.year()),s}};Cr.default=Lf});var RT=E(et=>{"use strict";var Uf=et&&et.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(et,"__esModule",{value:!0});et.createConfiguration=et.createCasualConfiguration=et.parseDate=et.parse=et.strict=et.casual=void 0;var J1=Uf(kT()),ex=Uf(ET()),tx=Uf(OT()),DT=Dr();et.casual=new DT.Chrono(xT());et.strict=new DT.Chrono(Wf());function rx(r,e,t){return et.casual.parse(r,e,t)}et.parse=rx;function nx(r,e,t){return et.casual.parseDate(r,e,t)}et.parseDate=nx;function xT(){let r=Wf();return r.parsers.unshift(new tx.default),r}et.createCasualConfiguration=xT;function Wf(){return{parsers:[new J1.default],refiners:[new ex.default]}}et.createConfiguration=Wf});var bu=E(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.parseYear=Xr.YEAR_PATTERN=Xr.MONTH_DICTIONARY=Xr.WEEKDAY_DICTIONARY=void 0;Xr.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};Xr.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};Xr.YEAR_PATTERN="[0-9]{1,4}(?![^\\s]\\d)(?:\\s*[a|d]\\.?\\s*c\\.?|\\s*a\\.?\\s*d\\.?)?";function ix(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)}Xr.parseYear=ix});var CT=E($f=>{"use strict";Object.defineProperty($f,"__esModule",{value:!0});var MT=bu(),sx=Re(),ax=H(),ox=gi(),ux=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:(este|esta|passado|pr[o\xF3]ximo)\\s*)?(${sx.matchAnyPattern(MT.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(este|esta|passado|pr[\xF3o]ximo)\\s*semana)?(?=\\W|\\d|$)`,"i"),lx=1,cx=2,dx=3,qf=class extends ax.AbstractParserWithWordBoundaryChecking{innerPattern(){return ux}innerExtract(e,t){let n=t[cx].toLowerCase(),i=MT.WEEKDAY_DICTIONARY[n];if(i===void 0)return null;let s=t[lx],a=t[dx],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=ox.toDayJSWeekday(e.refDate,i,u);return e.createParsingComponents().assign("weekday",i).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};$f.default=qf});var AT=E(Gf=>{"use strict";Object.defineProperty(Gf,"__esModule",{value:!0});var fx=mi(),jf=class extends fx.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:ao?|\xE0s?|das|da|de|do)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|a(?:o)?|\\?)\\s*"}};Gf.default=jf});var PT=E(Na=>{"use strict";var px=Na&&Na.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Na,"__esModule",{value:!0});var mx=px(pn()),Yf=class extends mx.default{patternBetween(){return new RegExp("^\\s*(?:,|\xE0)?\\s*$")}};Na.default=Yf});var NT=E(Ia=>{"use strict";var hx=Ia&&Ia.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ia,"__esModule",{value:!0});var gx=hx(Kr()),Bf=class extends gx.default{patternBetween(){return/^\s*(?:-)\s*$/i}};Ia.default=Bf});var qT=E(Vf=>{"use strict";Object.defineProperty(Vf,"__esModule",{value:!0});var yx=ut(),UT=bu(),WT=bu(),Tx=Re(),bx=H(),_x=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*)(${Tx.matchAnyPattern(UT.MONTH_DICTIONARY)})(?:\\s*(?:de|,)?\\s*(${WT.YEAR_PATTERN}))?(?=\\W|$)`,"i"),IT=1,FT=2,vx=3,LT=4,Hf=class extends bx.AbstractParserWithWordBoundaryChecking{innerPattern(){return _x}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=UT.MONTH_DICTIONARY[t[vx].toLowerCase()],s=parseInt(t[IT]);if(s>31)return t.index=t.index+t[IT].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[LT]){let a=WT.parseYear(t[LT]);n.start.assign("year",a)}else{let a=yx.findYearClosestToRef(e.refDate,s,i);n.start.imply("year",a)}if(t[FT]){let a=parseInt(t[FT]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};Vf.default=Hf});var $T=E(yn=>{"use strict";var wx=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]}),kx=yn&&yn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Ex=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)&&wx(e,r,t);return kx(e,r),e};Object.defineProperty(yn,"__esModule",{value:!0});var Sx=H(),_u=Ex(gn()),zf=class extends Sx.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 _u.now(e.reference);case"hoje":return _u.today(e.reference);case"amanha":case"amanh\xE3":return _u.tomorrow(e.reference);case"ontem":return _u.yesterday(e.reference)}return i}};yn.default=zf});var jT=E(Fa=>{"use strict";var Ox=Fa&&Fa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Fa,"__esModule",{value:!0});var vu=Ke(),Dx=H(),xx=ir(),Rx=Ox(we()),Kf=class extends Dx.AbstractParserWithWordBoundaryChecking{innerPattern(){return/(?:esta\s*)?(manha|manhã|tarde|meia-noite|meio-dia|noite)(?=\W|$)/i}innerExtract(e,t){let n=Rx.default(e.refDate),i=e.createParsingComponents();switch(t[1].toLowerCase()){case"tarde":i.imply("meridiem",vu.Meridiem.PM),i.imply("hour",15);break;case"noite":i.imply("meridiem",vu.Meridiem.PM),i.imply("hour",22);break;case"manha":case"manh\xE3":i.imply("meridiem",vu.Meridiem.AM),i.imply("hour",6);break;case"meia-noite":xx.assignTheNextDay(i,n),i.imply("hour",0),i.imply("minute",0),i.imply("second",0);break;case"meio-dia":i.imply("meridiem",vu.Meridiem.AM),i.imply("hour",12);break}return i}};Fa.default=Kf});var BT=E(tt=>{"use strict";var Hn=tt&&tt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(tt,"__esModule",{value:!0});tt.createConfiguration=tt.createCasualConfiguration=tt.parseDate=tt.parse=tt.strict=tt.casual=void 0;var Mx=mn(),GT=Dr(),Cx=Hn(yi()),Ax=Hn(CT()),Px=Hn(AT()),Nx=Hn(PT()),Ix=Hn(NT()),Fx=Hn(qT()),Lx=Hn($T()),Ux=Hn(jT());tt.casual=new GT.Chrono(YT());tt.strict=new GT.Chrono(Qf(!0));function Wx(r,e,t){return tt.casual.parse(r,e,t)}tt.parse=Wx;function qx(r,e,t){return tt.casual.parseDate(r,e,t)}tt.parseDate=qx;function YT(r=!0){let e=Qf(!1,r);return e.parsers.push(new Lx.default),e.parsers.push(new Ux.default),e}tt.createCasualConfiguration=YT;function Qf(r=!0,e=!0){return Mx.includeCommonConfiguration({parsers:[new Cx.default(e),new Ax.default,new Px.default,new Fx.default],refiners:[new Nx.default,new Ix.default]},r)}tt.createConfiguration=Qf});var HT=E(La=>{"use strict";var $x=La&&La.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(La,"__esModule",{value:!0});var jx=$x(Kr()),Xf=class extends jx.default{patternBetween(){return/^\s*(tot|-)\s*$/i}};La.default=Xf});var VT=E(Ua=>{"use strict";var Gx=Ua&&Ua.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ua,"__esModule",{value:!0});var Yx=Gx(pn()),Zf=class extends Yx.default{patternBetween(){return new RegExp("^\\s*(om|na|voor|in de|,|-)?\\s*$")}};Ua.default=Zf});var zT=E(Tn=>{"use strict";var Bx=Tn&&Tn.__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]}),Hx=Tn&&Tn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Vx=Tn&&Tn.__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)&&Bx(e,r,t);return Hx(e,r),e};Object.defineProperty(Tn,"__esModule",{value:!0});var zx=H(),wu=Vx(gn()),Jf=class extends zx.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 wu.now(e.reference);case"vandaag":return wu.today(e.reference);case"morgen":case"morgend":return wu.tomorrow(e.reference);case"gisteren":return wu.yesterday(e.reference)}return i}};Tn.default=Jf});var KT=E(Wa=>{"use strict";var Kx=Wa&&Wa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Wa,"__esModule",{value:!0});var ku=Ke(),Qx=H(),Xx=Kx(we()),Zx=ir(),Jx=1,eR=2,ep=class extends Qx.AbstractParserWithWordBoundaryChecking{innerPattern(){return/(deze)?\s*(namiddag|avond|middernacht|ochtend|middag|'s middags|'s avonds|'s ochtends)(?=\W|$)/i}innerExtract(e,t){let n=Xx.default(e.refDate),i=e.createParsingComponents();switch(t[Jx]==="deze"&&(i.assign("day",e.refDate.getDate()),i.assign("month",e.refDate.getMonth()+1),i.assign("year",e.refDate.getFullYear())),t[eR].toLowerCase()){case"namiddag":case"'s namiddags":i.imply("meridiem",ku.Meridiem.PM),i.imply("hour",15);break;case"avond":case"'s avonds'":i.imply("meridiem",ku.Meridiem.PM),i.imply("hour",20);break;case"middernacht":Zx.assignTheNextDay(i,n),i.imply("hour",0),i.imply("minute",0),i.imply("second",0);break;case"ochtend":case"'s ochtends":i.imply("meridiem",ku.Meridiem.AM),i.imply("hour",6);break;case"middag":case"'s middags":i.imply("meridiem",ku.Meridiem.AM),i.imply("hour",12);break}return i}};Wa.default=ep});var Gt=E(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.parseTimeUnits=ye.TIME_UNITS_PATTERN=ye.parseYear=ye.YEAR_PATTERN=ye.parseOrdinalNumberPattern=ye.ORDINAL_NUMBER_PATTERN=ye.parseNumberPattern=ye.NUMBER_PATTERN=ye.TIME_UNIT_DICTIONARY=ye.ORDINAL_WORD_DICTIONARY=ye.INTEGER_WORD_DICTIONARY=ye.MONTH_DICTIONARY=ye.WEEKDAY_DICTIONARY=void 0;var Eu=Re(),tR=ut();ye.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};ye.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};ye.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};ye.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};ye.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"};ye.NUMBER_PATTERN=`(?:${Eu.matchAnyPattern(ye.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+[\\.,][0-9]+|halve?|half|paar)`;function XT(r){let e=r.toLowerCase();return ye.INTEGER_WORD_DICTIONARY[e]!==void 0?ye.INTEGER_WORD_DICTIONARY[e]:e==="paar"?2:e==="half"||e.match(/halve?/)?.5:parseFloat(e.replace(",","."))}ye.parseNumberPattern=XT;ye.ORDINAL_NUMBER_PATTERN=`(?:${Eu.matchAnyPattern(ye.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:ste|de)?)`;function rR(r){let e=r.toLowerCase();return ye.ORDINAL_WORD_DICTIONARY[e]!==void 0?ye.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:ste|de)$/i,""),parseInt(e))}ye.parseOrdinalNumberPattern=rR;ye.YEAR_PATTERN="(?:[1-9][0-9]{0,3}\\s*(?:voor Christus|na Christus)|[1-2][0-9]{3}|[5-9][0-9])";function nR(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 tR.findMostLikelyADYear(e)}ye.parseYear=nR;var ZT=`(${ye.NUMBER_PATTERN})\\s{0,5}(${Eu.matchAnyPattern(ye.TIME_UNIT_DICTIONARY)})\\s{0,5}`,QT=new RegExp(ZT,"i");ye.TIME_UNITS_PATTERN=Eu.repeatedTimeunitPattern("(?:(?:binnen|in)\\s*)?",ZT);function iR(r){let e={},t=r,n=QT.exec(t);for(;n;)sR(e,n),t=t.substring(n[0].length),n=QT.exec(t);return e}ye.parseTimeUnits=iR;function sR(r,e){let t=XT(e[1]),n=ye.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var eb=E(rp=>{"use strict";Object.defineProperty(rp,"__esModule",{value:!0});var JT=Gt(),aR=We(),oR=H(),tp=class extends oR.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(?:binnen|in|binnen de|voor)\\s*("+JT.TIME_UNITS_PATTERN+")(?=\\W|$)","i")}innerExtract(e,t){let n=JT.parseTimeUnits(t[1]);return aR.ParsingComponents.createRelativeFromReference(e.reference,n)}};rp.default=tp});var rb=E(ip=>{"use strict";Object.defineProperty(ip,"__esModule",{value:!0});var tb=Gt(),uR=Re(),lR=H(),cR=gi(),dR=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:op\\s*?)?(?:(deze|vorige|volgende)\\s*(?:week\\s*)?)?(${uR.matchAnyPattern(tb.WEEKDAY_DICTIONARY)})(?=\\W|$)`,"i"),fR=1,pR=2,mR=3,np=class extends lR.AbstractParserWithWordBoundaryChecking{innerPattern(){return dR}innerExtract(e,t){let n=t[pR].toLowerCase(),i=tb.WEEKDAY_DICTIONARY[n],s=t[fR],a=t[mR],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=cR.toDayJSWeekday(e.refDate,i,u);return e.createParsingComponents().assign("weekday",i).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};ip.default=np});var ub=E(ap=>{"use strict";Object.defineProperty(ap,"__esModule",{value:!0});var hR=ut(),ab=Gt(),Su=Gt(),ob=Gt(),gR=Re(),yR=H(),TR=new RegExp(`(?:on\\s*?)?(${Su.ORDINAL_NUMBER_PATTERN})(?:\\s*(?:tot|\\-|\\\u2013|until|through|till|\\s)\\s*(${Su.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s*(?:of)?\\s*)(`+gR.matchAnyPattern(ab.MONTH_DICTIONARY)+`)(?:(?:-|/|,?\\s*)(${ob.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),bR=3,nb=1,ib=2,sb=4,sp=class extends yR.AbstractParserWithWordBoundaryChecking{innerPattern(){return TR}innerExtract(e,t){let n=ab.MONTH_DICTIONARY[t[bR].toLowerCase()],i=Su.parseOrdinalNumberPattern(t[nb]);if(i>31)return t.index=t.index+t[nb].length,null;let s=e.createParsingComponents({day:i,month:n});if(t[sb]){let u=ob.parseYear(t[sb]);s.assign("year",u)}else{let u=hR.findYearClosestToRef(e.refDate,i,n);s.imply("year",u)}if(!t[ib])return s;let a=Su.parseOrdinalNumberPattern(t[ib]),o=e.createParsingResult(t.index,t[0]);return o.start=s,o.end=s.clone(),o.end.assign("day",a),o}};ap.default=sp});var fb=E(up=>{"use strict";Object.defineProperty(up,"__esModule",{value:!0});var cb=Gt(),_R=ut(),vR=Re(),db=Gt(),wR=H(),kR=new RegExp(`(${vR.matchAnyPattern(cb.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${db.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),ER=1,lb=2,op=class extends wR.AbstractParserWithWordBoundaryChecking{innerPattern(){return kR}innerExtract(e,t){let n=e.createParsingComponents();n.imply("day",1);let i=t[ER],s=cb.MONTH_DICTIONARY[i.toLowerCase()];if(n.assign("month",s),t[lb]){let a=db.parseYear(t[lb]);n.assign("year",a)}else{let a=_R.findYearClosestToRef(e.refDate,1,s);n.imply("year",a)}return n}};up.default=op});var pb=E(cp=>{"use strict";Object.defineProperty(cp,"__esModule",{value:!0});var SR=H(),OR=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),DR=1,xR=2,lp=class extends SR.AbstractParserWithWordBoundaryChecking{innerPattern(){return OR}innerExtract(e,t){let n=parseInt(t[xR]),i=parseInt(t[DR]);return e.createParsingComponents().imply("day",1).assign("month",i).assign("year",n)}};cp.default=lp});var mb=E(fp=>{"use strict";Object.defineProperty(fp,"__esModule",{value:!0});var RR=mi(),dp=class extends RR.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)}};fp.default=dp});var yb=E(mp=>{"use strict";Object.defineProperty(mp,"__esModule",{value:!0});var gb=Gt(),MR=Re(),CR=H(),AR=new RegExp(`([0-9]{4})[\\.\\/\\s](?:(${MR.matchAnyPattern(gb.MONTH_DICTIONARY)})|([0-9]{1,2}))[\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),PR=1,NR=2,hb=3,IR=4,pp=class extends CR.AbstractParserWithWordBoundaryChecking{innerPattern(){return AR}innerExtract(e,t){let n=t[hb]?parseInt(t[hb]):gb.MONTH_DICTIONARY[t[NR].toLowerCase()];if(n<1||n>12)return null;let i=parseInt(t[PR]);return{day:parseInt(t[IR]),month:n,year:i}}};mp.default=pp});var Tb=E(qa=>{"use strict";var FR=qa&&qa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(qa,"__esModule",{value:!0});var LR=H(),Ou=Ke(),hp=ir(),UR=FR(we()),WR=1,qR=2,gp=class extends LR.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(gisteren|morgen|van)(ochtend|middag|namiddag|avond|nacht)(?=\W|$)/i}innerExtract(e,t){let n=t[WR].toLowerCase(),i=t[qR].toLowerCase(),s=e.createParsingComponents(),a=UR.default(e.refDate);switch(n){case"gisteren":hp.assignSimilarDate(s,a.add(-1,"day"));break;case"van":hp.assignSimilarDate(s,a);break;case"morgen":hp.assignTheNextDay(s,a);break}switch(i){case"ochtend":s.imply("meridiem",Ou.Meridiem.AM),s.imply("hour",6);break;case"middag":s.imply("meridiem",Ou.Meridiem.AM),s.imply("hour",12);break;case"namiddag":s.imply("meridiem",Ou.Meridiem.PM),s.imply("hour",15);break;case"avond":s.imply("meridiem",Ou.Meridiem.PM),s.imply("hour",20);break}return s}};qa.default=gp});var _b=E(Tp=>{"use strict";Object.defineProperty(Tp,"__esModule",{value:!0});var bb=Gt(),$R=We(),jR=H(),GR=sr(),YR=new RegExp(`(deze|vorige|afgelopen|komende|over|\\+|-)\\s*(${bb.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),yp=class extends jR.AbstractParserWithWordBoundaryChecking{innerPattern(){return YR}innerExtract(e,t){let n=t[1].toLowerCase(),i=bb.parseTimeUnits(t[2]);switch(n){case"vorige":case"afgelopen":case"-":i=GR.reverseTimeUnits(i);break}return $R.ParsingComponents.createRelativeFromReference(e.reference,i)}};Tp.default=yp});var kb=E($a=>{"use strict";var BR=$a&&$a.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty($a,"__esModule",{value:!0});var wb=Gt(),vb=We(),HR=BR(we()),VR=H(),zR=Re(),KR=new RegExp(`(dit|deze|komende|volgend|volgende|afgelopen|vorige)\\s*(${zR.matchAnyPattern(wb.TIME_UNIT_DICTIONARY)})(?=\\s*)(?=\\W|$)`,"i"),QR=1,XR=2,bp=class extends VR.AbstractParserWithWordBoundaryChecking{innerPattern(){return KR}innerExtract(e,t){let n=t[QR].toLowerCase(),i=t[XR].toLowerCase(),s=wb.TIME_UNIT_DICTIONARY[i];if(n=="volgend"||n=="volgende"||n=="komende"){let u={};return u[s]=1,vb.ParsingComponents.createRelativeFromReference(e.reference,u)}if(n=="afgelopen"||n=="vorige"){let u={};return u[s]=-1,vb.ParsingComponents.createRelativeFromReference(e.reference,u)}let a=e.createParsingComponents(),o=HR.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=bp});var Eb=E(wp=>{"use strict";Object.defineProperty(wp,"__esModule",{value:!0});var vp=Gt(),ZR=We(),JR=H(),eM=sr(),tM=new RegExp("("+vp.TIME_UNITS_PATTERN+")(?:geleden|voor|eerder)(?=(?:\\W|$))","i"),rM=new RegExp("("+vp.TIME_UNITS_PATTERN+")geleden(?=(?:\\W|$))","i"),_p=class extends JR.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?rM:tM}innerExtract(e,t){let n=vp.parseTimeUnits(t[1]),i=eM.reverseTimeUnits(n);return ZR.ParsingComponents.createRelativeFromReference(e.reference,i)}};wp.default=_p});var Sb=E(Sp=>{"use strict";Object.defineProperty(Sp,"__esModule",{value:!0});var Ep=Gt(),nM=We(),iM=H(),sM=new RegExp("("+Ep.TIME_UNITS_PATTERN+")(later|na|vanaf nu|voortaan|vooruit|uit)(?=(?:\\W|$))","i"),aM=new RegExp("("+Ep.TIME_UNITS_PATTERN+")(later|vanaf nu)(?=(?:\\W|$))","i"),oM=1,kp=class extends iM.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?aM:sM}innerExtract(e,t){let n=Ep.parseTimeUnits(t[oM]);return nM.ParsingComponents.createRelativeFromReference(e.reference,n)}};Sp.default=kp});var Rb=E(rt=>{"use strict";var ct=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 uM=mn(),Ob=Dr(),lM=ct(HT()),cM=ct(VT()),dM=ct(zT()),fM=ct(KT()),pM=ct(yi()),mM=ct(eb()),hM=ct(rb()),gM=ct(ub()),Db=ct(fb()),yM=ct(pb()),TM=ct(mb()),bM=ct(yb()),_M=ct(Tb()),vM=ct(_b()),wM=ct(kb()),kM=ct(Eb()),EM=ct(Sb());rt.casual=new Ob.Chrono(xb());rt.strict=new Ob.Chrono(Op(!0));function SM(r,e,t){return rt.casual.parse(r,e,t)}rt.parse=SM;function OM(r,e,t){return rt.casual.parseDate(r,e,t)}rt.parseDate=OM;function xb(r=!0){let e=Op(!1,r);return e.parsers.unshift(new dM.default),e.parsers.unshift(new fM.default),e.parsers.unshift(new _M.default),e.parsers.unshift(new Db.default),e.parsers.unshift(new wM.default),e.parsers.unshift(new vM.default),e}rt.createCasualConfiguration=xb;function Op(r=!0,e=!0){return uM.includeCommonConfiguration({parsers:[new pM.default(e),new mM.default,new gM.default,new Db.default,new hM.default,new bM.default,new yM.default,new TM.default(r),new kM.default(r),new EM.default(r)],refiners:[new cM.default,new lM.default]},r)}rt.createConfiguration=Op});var Pb=E(ja=>{"use strict";var DM=ja&&ja.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ja,"__esModule",{value:!0});var xM=DM(we()),RM=H(),MM=1,Mb=2,CM=3,Cb=4,Ab=5,AM=6,Dp=class extends RM.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=xM.default(e.refDate),a=s;if(t[MM])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[Mb]){let o=t[Mb],u=t[CM];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[Cb]){let u=t[Cb][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[Ab]){let o=t[Ab];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=Dp});var cs=E(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.zhStringToYear=It.zhStringToNumber=It.WEEKDAY_OFFSET=It.NUMBER=void 0;It.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};It.WEEKDAY_OFFSET={\u5929:0,\u65E5:0,\u4E00:1,\u4E8C:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6};function PM(r){let e=0;for(let t=0;t<r.length;t++){let n=r[t];n==="\u5341"?e=e===0?It.NUMBER[n]:e*It.NUMBER[n]:e+=It.NUMBER[n]}return e}It.zhStringToNumber=PM;function NM(r){let e="";for(let t=0;t<r.length;t++){let n=r[t];e=e+It.NUMBER[n]}return parseInt(e)}It.zhStringToYear=NM});var Ib=E(Ga=>{"use strict";var IM=Ga&&Ga.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ga,"__esModule",{value:!0});var FM=IM(we()),LM=H(),_i=cs(),xp=1,Nb=2,Rp=3,Mp=class extends LM.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(\\d{2,4}|["+Object.keys(_i.NUMBER).join("")+"]{4}|["+Object.keys(_i.NUMBER).join("")+"]{2})?(?:\\s*)(?:\u5E74)?(?:[\\s|,|\uFF0C]*)(\\d{1,2}|["+Object.keys(_i.NUMBER).join("")+"]{1,2})(?:\\s*)(?:\u6708)(?:\\s*)(\\d{1,2}|["+Object.keys(_i.NUMBER).join("")+"]{1,2})?(?:\\s*)(?:\u65E5|\u865F)?")}innerExtract(e,t){let n=FM.default(e.refDate),i=e.createParsingResult(t.index,t[0]),s=parseInt(t[Nb]);if(isNaN(s)&&(s=_i.zhStringToNumber(t[Nb])),i.start.assign("month",s),t[Rp]){let a=parseInt(t[Rp]);isNaN(a)&&(a=_i.zhStringToNumber(t[Rp])),i.start.assign("day",a)}else i.start.imply("day",n.date());if(t[xp]){let a=parseInt(t[xp]);isNaN(a)&&(a=_i.zhStringToYear(t[xp])),i.start.assign("year",a)}else i.start.imply("year",n.year());return i}};Ga.default=Mp});var Lb=E(Ya=>{"use strict";var UM=Ya&&Ya.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ya,"__esModule",{value:!0});var WM=UM(we()),qM=H(),Fb=cs(),$M=new RegExp("(\\d+|["+Object.keys(Fb.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"),Cp=1,jM=2,Ap=class extends qM.AbstractParserWithWordBoundaryChecking{innerPattern(){return $M}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=parseInt(t[Cp]);if(isNaN(i)&&(i=Fb.zhStringToNumber(t[Cp])),isNaN(i)){let u=t[Cp];if(u==="\u5E7E")i=3;else if(u==="\u534A")i=.5;else return null}let s=WM.default(e.refDate),o=t[jM][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=Ap});var Wb=E(Ba=>{"use strict";var GM=Ba&&Ba.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ba,"__esModule",{value:!0});var YM=GM(we()),BM=H(),Ub=cs(),HM=new RegExp("(?<prefix>\u4E0A|\u4ECA|\u4E0B|\u9019|\u5462)(?:\u500B)?(?:\u661F\u671F|\u79AE\u62DC|\u9031)(?<weekday>"+Object.keys(Ub.WEEKDAY_OFFSET).join("|")+")"),Pp=class extends BM.AbstractParserWithWordBoundaryChecking{innerPattern(){return HM}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=t.groups.weekday,s=Ub.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=YM.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=Pp});var qb=E(Ha=>{"use strict";var VM=Ha&&Ha.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ha,"__esModule",{value:!0});var zM=VM(we()),KM=H(),ur=cs(),QM=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(ur.NUMBER).join("")+"]+)(?:\\s*)(?:\u9EDE|\u6642|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(ur.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(ur.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),XM=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(ur.NUMBER).join("")+"]+)(?:\\s*)(?:\u9EDE|\u6642|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(ur.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(ur.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),Du=1,xu=2,Ru=3,Mu=4,Cu=5,Au=6,or=7,ds=8,Pu=9,Np=class extends KM.AbstractParserWithWordBoundaryChecking{innerPattern(){return QM}innerExtract(e,t){if(t.index>0&&e.text[t.index-1].match(/\w/))return null;let n=zM.default(e.refDate),i=e.createParsingResult(t.index,t[0]),s=n.clone();if(t[Du]){var a=t[Du];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[Mu]){var o=t[Mu];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[ds]){var d=parseInt(t[ds]);if(isNaN(d)&&(d=ur.zhStringToNumber(t[ds])),d>=60)return null;i.start.assign("second",d)}if(u=parseInt(t[Au]),isNaN(u)&&(u=ur.zhStringToNumber(t[Au])),t[or]?t[or]=="\u534A"?l=30:t[or]=="\u6B63"||t[or]=="\u6574"?l=0:(l=parseInt(t[or]),isNaN(l)&&(l=ur.zhStringToNumber(t[or]))):u>100&&(l=u%100,u=Math.floor(u/100)),l>=60||u>24)return null;if(u>=12&&(c=1),t[Pu]){if(u>12)return null;var p=t[Pu][0].toLowerCase();p=="a"&&(c=0,u==12&&(u=0)),p=="p"&&(c=1,u!=12&&(u+=12))}else if(t[xu]){var m=t[xu],y=m[0];y=="\u671D"||y=="\u65E9"?(c=0,u==12&&(u=0)):y=="\u665A"&&(c=1,u!=12&&(u+=12))}else if(t[Ru]){var b=t[Ru],k=b[0];k=="\u4E0A"||k=="\u671D"||k=="\u65E9"||k=="\u51CC"?(c=0,u==12&&(u=0)):(k=="\u4E0B"||k=="\u664F"||k=="\u665A")&&(c=1,u!=12&&(u+=12))}else if(t[Cu]){var _=t[Cu],R=_[0];R=="\u4E0A"||R=="\u671D"||R=="\u65E9"||R=="\u51CC"?(c=0,u==12&&(u=0)):(R=="\u4E0B"||R=="\u664F"||R=="\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=XM.exec(e.text.substring(i.index+i.text.length)),!t)return i.text.match(/^\d+$/)?null:i;let S=s.clone();if(i.end=e.createParsingComponents(),t[Du]){var a=t[Du];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.end.assign("day",S.date()),i.end.assign("month",S.month()+1),i.end.assign("year",S.year())}else if(t[Mu]){var o=t[Mu];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.end.assign("day",S.date()),i.end.assign("month",S.month()+1),i.end.assign("year",S.year())}else i.end.imply("day",S.date()),i.end.imply("month",S.month()+1),i.end.imply("year",S.year());if(u=0,l=0,c=-1,t[ds]){var d=parseInt(t[ds]);if(isNaN(d)&&(d=ur.zhStringToNumber(t[ds])),d>=60)return null;i.end.assign("second",d)}if(u=parseInt(t[Au]),isNaN(u)&&(u=ur.zhStringToNumber(t[Au])),t[or]?t[or]=="\u534A"?l=30:t[or]=="\u6B63"||t[or]=="\u6574"?l=0:(l=parseInt(t[or]),isNaN(l)&&(l=ur.zhStringToNumber(t[or]))):u>100&&(l=u%100,u=Math.floor(u/100)),l>=60||u>24)return null;if(u>=12&&(c=1),t[Pu]){if(u>12)return null;var p=t[Pu][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[xu]){var m=t[xu],y=m[0];y=="\u671D"||y=="\u65E9"?(c=0,u==12&&(u=0)):y=="\u665A"&&(c=1,u!=12&&(u+=12))}else if(t[Ru]){var b=t[Ru],k=b[0];k=="\u4E0A"||k=="\u671D"||k=="\u65E9"||k=="\u51CC"?(c=0,u==12&&(u=0)):(k=="\u4E0B"||k=="\u664F"||k=="\u665A")&&(c=1,u!=12&&(u+=12))}else if(t[Cu]){var _=t[Cu],R=_[0];R=="\u4E0A"||R=="\u671D"||R=="\u65E9"||R=="\u51CC"?(c=0,u==12&&(u=0)):(R=="\u4E0B"||R=="\u664F"||R=="\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=Np});var jb=E(Va=>{"use strict";var ZM=Va&&Va.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Va,"__esModule",{value:!0});var JM=ZM(we()),eC=H(),$b=cs(),tC=new RegExp("(?:\u661F\u671F|\u79AE\u62DC|\u9031)(?<weekday>"+Object.keys($b.WEEKDAY_OFFSET).join("|")+")"),Ip=class extends eC.AbstractParserWithWordBoundaryChecking{innerPattern(){return tC}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=t.groups.weekday,s=$b.WEEKDAY_OFFSET[i];if(s===void 0)return null;let a=JM.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=Ip});var Gb=E(za=>{"use strict";var rC=za&&za.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(za,"__esModule",{value:!0});var nC=rC(Kr()),Fp=class extends nC.default{patternBetween(){return/^\s*(至|到|\-|\~|～|－|ー)\s*$/i}};za.default=Fp});var Yb=E(Ka=>{"use strict";var iC=Ka&&Ka.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ka,"__esModule",{value:!0});var sC=iC(pn()),Lp=class extends sC.default{patternBetween(){return/^\s*$/i}};Ka.default=Lp});var Bb=E(Be=>{"use strict";var bn=Be&&Be.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Be,"__esModule",{value:!0});Be.createConfiguration=Be.createCasualConfiguration=Be.parseDate=Be.parse=Be.strict=Be.casual=Be.hant=void 0;var Up=Dr(),aC=bn(lu()),oC=mn(),uC=bn(Pb()),lC=bn(Ib()),cC=bn(Lb()),dC=bn(Wb()),fC=bn(qb()),pC=bn(jb()),mC=bn(Gb()),hC=bn(Yb());Be.hant=new Up.Chrono(Wp());Be.casual=new Up.Chrono(Wp());Be.strict=new Up.Chrono(qp());function gC(r,e,t){return Be.casual.parse(r,e,t)}Be.parse=gC;function yC(r,e,t){return Be.casual.parseDate(r,e,t)}Be.parseDate=yC;function Wp(){let r=qp();return r.parsers.unshift(new uC.default),r}Be.createCasualConfiguration=Wp;function qp(){let r=oC.includeCommonConfiguration({parsers:[new lC.default,new dC.default,new pC.default,new fC.default,new cC.default],refiners:[new mC.default,new hC.default]});return r.refiners=r.refiners.filter(e=>!(e instanceof aC.default)),r}Be.createConfiguration=qp});var Kb=E(Qa=>{"use strict";var TC=Qa&&Qa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Qa,"__esModule",{value:!0});var bC=TC(we()),_C=H(),vC=1,Hb=2,wC=3,Vb=4,zb=5,kC=6,$p=class extends _C.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=bC.default(e.refDate),a=s;if(t[vC])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[Hb]){let o=t[Hb],u=t[wC];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[Vb]){let u=t[Vb][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[zb]){let o=t[zb];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[kC];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=$p});var fs=E(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.zhStringToYear=Ft.zhStringToNumber=Ft.WEEKDAY_OFFSET=Ft.NUMBER=void 0;Ft.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};Ft.WEEKDAY_OFFSET={\u5929:0,\u65E5:0,\u4E00:1,\u4E8C:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6};function EC(r){let e=0;for(let t=0;t<r.length;t++){let n=r[t];n==="\u5341"?e=e===0?Ft.NUMBER[n]:e*Ft.NUMBER[n]:e+=Ft.NUMBER[n]}return e}Ft.zhStringToNumber=EC;function SC(r){let e="";for(let t=0;t<r.length;t++){let n=r[t];e=e+Ft.NUMBER[n]}return parseInt(e)}Ft.zhStringToYear=SC});var Xb=E(Xa=>{"use strict";var OC=Xa&&Xa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Xa,"__esModule",{value:!0});var DC=OC(we()),xC=H(),vi=fs(),jp=1,Qb=2,Gp=3,Yp=class extends xC.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(\\d{2,4}|["+Object.keys(vi.NUMBER).join("")+"]{4}|["+Object.keys(vi.NUMBER).join("")+"]{2})?(?:\\s*)(?:\u5E74)?(?:[\\s|,|\uFF0C]*)(\\d{1,2}|["+Object.keys(vi.NUMBER).join("")+"]{1,3})(?:\\s*)(?:\u6708)(?:\\s*)(\\d{1,2}|["+Object.keys(vi.NUMBER).join("")+"]{1,3})?(?:\\s*)(?:\u65E5|\u53F7)?")}innerExtract(e,t){let n=DC.default(e.refDate),i=e.createParsingResult(t.index,t[0]),s=parseInt(t[Qb]);if(isNaN(s)&&(s=vi.zhStringToNumber(t[Qb])),i.start.assign("month",s),t[Gp]){let a=parseInt(t[Gp]);isNaN(a)&&(a=vi.zhStringToNumber(t[Gp])),i.start.assign("day",a)}else i.start.imply("day",n.date());if(t[jp]){let a=parseInt(t[jp]);isNaN(a)&&(a=vi.zhStringToYear(t[jp])),i.start.assign("year",a)}else i.start.imply("year",n.year());return i}};Xa.default=Yp});var Jb=E(Za=>{"use strict";var RC=Za&&Za.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Za,"__esModule",{value:!0});var MC=RC(we()),CC=H(),Zb=fs(),AC=new RegExp("(\\d+|["+Object.keys(Zb.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"),Bp=1,PC=2,Hp=class extends CC.AbstractParserWithWordBoundaryChecking{innerPattern(){return AC}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=parseInt(t[Bp]);if(isNaN(i)&&(i=Zb.zhStringToNumber(t[Bp])),isNaN(i)){let u=t[Bp];if(u==="\u51E0")i=3;else if(u==="\u534A")i=.5;else return null}let s=MC.default(e.refDate),o=t[PC][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=Hp});var t_=E(Ja=>{"use strict";var NC=Ja&&Ja.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ja,"__esModule",{value:!0});var IC=NC(we()),FC=H(),e_=fs(),LC=new RegExp("(?<prefix>\u4E0A|\u4E0B|\u8FD9)(?:\u4E2A)?(?:\u661F\u671F|\u793C\u62DC|\u5468)(?<weekday>"+Object.keys(e_.WEEKDAY_OFFSET).join("|")+")"),Vp=class extends FC.AbstractParserWithWordBoundaryChecking{innerPattern(){return LC}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=t.groups.weekday,s=e_.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=IC.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=Vp});var r_=E(eo=>{"use strict";var UC=eo&&eo.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(eo,"__esModule",{value:!0});var WC=UC(we()),qC=H(),cr=fs(),$C=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(cr.NUMBER).join("")+"]+)(?:\\s*)(?:\u70B9|\u65F6|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(cr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(cr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),jC=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(cr.NUMBER).join("")+"]+)(?:\\s*)(?:\u70B9|\u65F6|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(cr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(cr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),Nu=1,Iu=2,Fu=3,Lu=4,Uu=5,Wu=6,lr=7,ps=8,qu=9,zp=class extends qC.AbstractParserWithWordBoundaryChecking{innerPattern(){return $C}innerExtract(e,t){if(t.index>0&&e.text[t.index-1].match(/\w/))return null;let n=WC.default(e.refDate),i=e.createParsingResult(t.index,t[0]),s=n.clone();if(t[Nu]){let c=t[Nu];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[Lu]){let c=t[Lu];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[ps]){let c=parseInt(t[ps]);if(isNaN(c)&&(c=cr.zhStringToNumber(t[ps])),c>=60)return null;i.start.assign("second",c)}if(a=parseInt(t[Wu]),isNaN(a)&&(a=cr.zhStringToNumber(t[Wu])),t[lr]?t[lr]=="\u534A"?o=30:t[lr]=="\u6B63"||t[lr]=="\u6574"?o=0:(o=parseInt(t[lr]),isNaN(o)&&(o=cr.zhStringToNumber(t[lr]))):a>100&&(o=a%100,a=Math.floor(a/100)),o>=60||a>24)return null;if(a>=12&&(u=1),t[qu]){if(a>12)return null;let c=t[qu][0].toLowerCase();c=="a"&&(u=0,a==12&&(a=0)),c=="p"&&(u=1,a!=12&&(a+=12))}else if(t[Iu]){let d=t[Iu][0];d=="\u65E9"?(u=0,a==12&&(a=0)):d=="\u665A"&&(u=1,a!=12&&(a+=12))}else if(t[Fu]){let d=t[Fu][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[Uu]){let d=t[Uu][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=jC.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[Nu]){let c=t[Nu];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[Lu]){let c=t[Lu];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[ps]){let c=parseInt(t[ps]);if(isNaN(c)&&(c=cr.zhStringToNumber(t[ps])),c>=60)return null;i.end.assign("second",c)}if(a=parseInt(t[Wu]),isNaN(a)&&(a=cr.zhStringToNumber(t[Wu])),t[lr]?t[lr]=="\u534A"?o=30:t[lr]=="\u6B63"||t[lr]=="\u6574"?o=0:(o=parseInt(t[lr]),isNaN(o)&&(o=cr.zhStringToNumber(t[lr]))):a>100&&(o=a%100,a=Math.floor(a/100)),o>=60||a>24)return null;if(a>=12&&(u=1),t[qu]){if(a>12)return null;let c=t[qu][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[Iu]){let d=t[Iu][0];d=="\u65E9"?(u=0,a==12&&(a=0)):d=="\u665A"&&(u=1,a!=12&&(a+=12))}else if(t[Fu]){let d=t[Fu][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[Uu]){let d=t[Uu][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=zp});var i_=E(to=>{"use strict";var GC=to&&to.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(to,"__esModule",{value:!0});var YC=GC(we()),BC=H(),n_=fs(),HC=new RegExp("(?:\u661F\u671F|\u793C\u62DC|\u5468)(?<weekday>"+Object.keys(n_.WEEKDAY_OFFSET).join("|")+")"),Kp=class extends BC.AbstractParserWithWordBoundaryChecking{innerPattern(){return HC}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=t.groups.weekday,s=n_.WEEKDAY_OFFSET[i];if(s===void 0)return null;let a=YC.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=Kp});var s_=E(ro=>{"use strict";var VC=ro&&ro.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ro,"__esModule",{value:!0});var zC=VC(Kr()),Qp=class extends zC.default{patternBetween(){return/^\s*(至|到|-|~|～|－|ー)\s*$/i}};ro.default=Qp});var a_=E(no=>{"use strict";var KC=no&&no.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(no,"__esModule",{value:!0});var QC=KC(pn()),Xp=class extends QC.default{patternBetween(){return/^\s*$/i}};no.default=Xp});var o_=E(He=>{"use strict";var _n=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.strict=He.casual=He.hans=void 0;var Zp=Dr(),XC=_n(lu()),ZC=mn(),JC=_n(Kb()),eA=_n(Xb()),tA=_n(Jb()),rA=_n(t_()),nA=_n(r_()),iA=_n(i_()),sA=_n(s_()),aA=_n(a_());He.hans=new Zp.Chrono(Jp());He.casual=new Zp.Chrono(Jp());He.strict=new Zp.Chrono(em());function oA(r,e,t){return He.casual.parse(r,e,t)}He.parse=oA;function uA(r,e,t){return He.casual.parseDate(r,e,t)}He.parseDate=uA;function Jp(){let r=em();return r.parsers.unshift(new JC.default),r}He.createCasualConfiguration=Jp;function em(){let r=ZC.includeCommonConfiguration({parsers:[new eA.default,new rA.default,new iA.default,new nA.default,new tA.default],refiners:[new sA.default,new aA.default]});return r.refiners=r.refiners.filter(e=>!(e instanceof XC.default)),r}He.createConfiguration=em});var l_=E(Yt=>{"use strict";var u_=Yt&&Yt.__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]}),lA=Yt&&Yt.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),cA=Yt&&Yt.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&u_(e,r,t)},dA=Yt&&Yt.__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)&&u_(e,r,t);return lA(e,r),e};Object.defineProperty(Yt,"__esModule",{value:!0});Yt.hans=void 0;cA(Bb(),Yt);Yt.hans=dA(o_())});var Lt=E(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.parseTimeUnits=ae.TIME_UNITS_PATTERN=ae.parseYear=ae.YEAR_PATTERN=ae.parseOrdinalNumberPattern=ae.ORDINAL_NUMBER_PATTERN=ae.parseNumberPattern=ae.NUMBER_PATTERN=ae.TIME_UNIT_DICTIONARY=ae.ORDINAL_WORD_DICTIONARY=ae.INTEGER_WORD_DICTIONARY=ae.MONTH_DICTIONARY=ae.FULL_MONTH_NAME_DICTIONARY=ae.WEEKDAY_DICTIONARY=ae.REGEX_PARTS=void 0;var $u=Re(),fA=ut();ae.REGEX_PARTS={leftBoundary:"([^\\p{L}\\p{N}_]|^)",rightBoundary:"(?=[^\\p{L}\\p{N}_]|$)",flags:"iu"};ae.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};ae.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};ae.MONTH_DICTIONARY=Object.assign(Object.assign({},ae.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});ae.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};ae.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};ae.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"};ae.NUMBER_PATTERN=`(?:${$u.matchAnyPattern(ae.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 d_(r){let e=r.toLowerCase();return ae.INTEGER_WORD_DICTIONARY[e]!==void 0?ae.INTEGER_WORD_DICTIONARY[e]:e.match(/несколько/)?3:e.match(/пол/)?.5:e.match(/пар/)?2:e===""?1:parseFloat(e)}ae.parseNumberPattern=d_;ae.ORDINAL_NUMBER_PATTERN=`(?:${$u.matchAnyPattern(ae.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:\u0433\u043E|\u043E\u0433\u043E|\u0435|\u043E\u0435)?)`;function pA(r){let e=r.toLowerCase();return ae.ORDINAL_WORD_DICTIONARY[e]!==void 0?ae.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:st|nd|rd|th)$/i,""),parseInt(e))}ae.parseOrdinalNumberPattern=pA;var tm="(?:\\s+(?:\u0433\u043E\u0434\u0443|\u0433\u043E\u0434\u0430|\u0433\u043E\u0434|\u0433|\u0433.))?";ae.YEAR_PATTERN=`(?:[1-9][0-9]{0,3}${tm}\\s*(?:\u043D.\u044D.|\u0434\u043E \u043D.\u044D.|\u043D. \u044D.|\u0434\u043E \u043D. \u044D.)|[1-2][0-9]{3}${tm}|[5-9][0-9]${tm})`;function mA(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 fA.findMostLikelyADYear(e)}ae.parseYear=mA;var f_=`(${ae.NUMBER_PATTERN})\\s{0,3}(${$u.matchAnyPattern(ae.TIME_UNIT_DICTIONARY)})`,c_=new RegExp(f_,"i");ae.TIME_UNITS_PATTERN=$u.repeatedTimeunitPattern("(?:(?:\u043E\u043A\u043E\u043B\u043E|\u043F\u0440\u0438\u043C\u0435\u0440\u043D\u043E)\\s{0,3})?",f_);function hA(r){let e={},t=r,n=c_.exec(t);for(;n;)gA(e,n),t=t.substring(n[0].length).trim(),n=c_.exec(t);return e}ae.parseTimeUnits=hA;function gA(r,e){let t=d_(e[1]),n=ae.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var m_=E(nm=>{"use strict";Object.defineProperty(nm,"__esModule",{value:!0});var io=Lt(),yA=We(),TA=H(),p_=`(?:(?:\u043E\u043A\u043E\u043B\u043E|\u043F\u0440\u0438\u043C\u0435\u0440\u043D\u043E)\\s*(?:~\\s*)?)?(${io.TIME_UNITS_PATTERN})${io.REGEX_PARTS.rightBoundary}`,bA=new RegExp(`(?:\u0432 \u0442\u0435\u0447\u0435\u043D\u0438\u0435|\u0432 \u0442\u0435\u0447\u0435\u043D\u0438\u0438)\\s*${p_}`,io.REGEX_PARTS.flags),_A=new RegExp(p_,"i"),rm=class extends TA.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return io.REGEX_PARTS.leftBoundary}innerPattern(e){return e.option.forwardDate?_A:bA}innerExtract(e,t){let n=io.parseTimeUnits(t[1]);return yA.ParsingComponents.createRelativeFromReference(e.reference,n)}};nm.default=rm});var b_=E(sm=>{"use strict";Object.defineProperty(sm,"__esModule",{value:!0});var vA=ut(),so=Lt(),T_=Lt(),ju=Lt(),wA=Re(),kA=H(),EA=new RegExp(`(?:\u0441)?\\s*(${ju.ORDINAL_NUMBER_PATTERN})(?:\\s{0,3}(?:\u043F\u043E|-|\u2013|\u0434\u043E)?\\s{0,3}(${ju.ORDINAL_NUMBER_PATTERN}))?(?:-|\\/|\\s{0,3}(?:of)?\\s{0,3})(${wA.matchAnyPattern(so.MONTH_DICTIONARY)})(?:(?:-|\\/|,?\\s{0,3})(${T_.YEAR_PATTERN}(?![^\\s]\\d)))?${so.REGEX_PARTS.rightBoundary}`,so.REGEX_PARTS.flags),h_=1,g_=2,SA=3,y_=4,im=class extends kA.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return so.REGEX_PARTS.leftBoundary}innerPattern(){return EA}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),i=so.MONTH_DICTIONARY[t[SA].toLowerCase()],s=ju.parseOrdinalNumberPattern(t[h_]);if(s>31)return t.index=t.index+t[h_].length,null;if(n.start.assign("month",i),n.start.assign("day",s),t[y_]){let a=T_.parseYear(t[y_]);n.start.assign("year",a)}else{let a=vA.findYearClosestToRef(e.refDate,s,i);n.start.imply("year",a)}if(t[g_]){let a=ju.parseOrdinalNumberPattern(t[g_]);n.end=n.start.clone(),n.end.assign("day",a)}return n}};sm.default=im});var w_=E(om=>{"use strict";Object.defineProperty(om,"__esModule",{value:!0});var ao=Lt(),OA=ut(),DA=Re(),v_=Lt(),xA=H(),RA=new RegExp(`((?:\u0432)\\s*)?(${DA.matchAnyPattern(ao.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${v_.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,ao.REGEX_PARTS.flags),MA=2,__=3,am=class extends xA.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return ao.REGEX_PARTS.leftBoundary}innerPattern(){return RA}innerExtract(e,t){let n=t[MA].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[__]){let a=v_.parseYear(t[__]);i.start.assign("year",a)}else{let a=OA.findYearClosestToRef(e.refDate,1,s);i.start.imply("year",a)}return i}};om.default=am});var E_=E(lm=>{"use strict";Object.defineProperty(lm,"__esModule",{value:!0});var Gu=Ke(),CA=mi(),k_=Lt(),um=class extends CA.AbstractTimeExpressionParser{constructor(e){super(e)}patternFlags(){return k_.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))?(?!\\/)${k_.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",Gu.Meridiem.PM)):i<6&&n.assign("meridiem",Gu.Meridiem.AM)}if(t[0].endsWith("\u043F\u043E\u0441\u043B\u0435 \u043F\u043E\u043B\u0443\u0434\u043D\u044F")){n.assign("meridiem",Gu.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",Gu.Meridiem.AM),n.get("hour")<12&&n.assign("hour",n.get("hour")))}return n}};lm.default=um});var S_=E(dm=>{"use strict";Object.defineProperty(dm,"__esModule",{value:!0});var Yu=Lt(),AA=We(),PA=H(),NA=sr(),IA=new RegExp(`(${Yu.TIME_UNITS_PATTERN})\\s{0,5}\u043D\u0430\u0437\u0430\u0434(?=(?:\\W|$))`,Yu.REGEX_PARTS.flags),cm=class extends PA.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Yu.REGEX_PARTS.leftBoundary}innerPattern(){return IA}innerExtract(e,t){let n=Yu.parseTimeUnits(t[1]),i=NA.reverseTimeUnits(n);return AA.ParsingComponents.createRelativeFromReference(e.reference,i)}};dm.default=cm});var O_=E(oo=>{"use strict";var FA=oo&&oo.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(oo,"__esModule",{value:!0});var LA=FA(Kr()),fm=class extends LA.default{patternBetween(){return/^\s*(и до|и по|до|по|-)\s*$/i}};oo.default=fm});var D_=E(uo=>{"use strict";var UA=uo&&uo.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(uo,"__esModule",{value:!0});var WA=UA(pn()),pm=class extends WA.default{patternBetween(){return new RegExp("^\\s*(T|\u0432|,|-)?\\s*$")}};uo.default=pm});var x_=E(vn=>{"use strict";var qA=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]}),$A=vn&&vn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),jA=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)&&qA(e,r,t);return $A(e,r),e};Object.defineProperty(vn,"__esModule",{value:!0});var GA=H(),lo=jA(gn()),mm=Lt(),YA=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)${mm.REGEX_PARTS.rightBoundary}`,mm.REGEX_PARTS.flags),hm=class extends GA.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return mm.REGEX_PARTS.leftBoundary}innerPattern(e){return YA}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=hm});var R_=E(Ar=>{"use strict";var BA=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]}),HA=Ar&&Ar.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),VA=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)&&BA(e,r,t);return HA(e,r),e},zA=Ar&&Ar.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ar,"__esModule",{value:!0});var KA=H(),wi=VA(gn()),QA=ir(),XA=zA(we()),gm=Lt(),ZA=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)${gm.REGEX_PARTS.rightBoundary}`,gm.REGEX_PARTS.flags),ym=class extends KA.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return gm.REGEX_PARTS.leftBoundary}innerPattern(){return ZA}innerExtract(e,t){let n=XA.default(e.refDate),i=t[0].toLowerCase(),s=e.createParsingComponents();if(i==="\u0441\u0435\u0439\u0447\u0430\u0441")return wi.now(e.reference);if(i==="\u0432\u0435\u0447\u0435\u0440\u043E\u043C"||i==="\u0432\u0435\u0447\u0435\u0440\u0430")return wi.evening(e.reference);if(i.endsWith("\u0443\u0442\u0440\u043E\u043C")||i.endsWith("\u0443\u0442\u0440\u0430"))return wi.morning(e.reference);if(i.match(/в\s*полдень/))return wi.noon(e.reference);if(i.match(/прошлой\s*ночью/))return wi.lastNight(e.reference);if(i.match(/прошлым\s*вечером/))return wi.yesterdayEvening(e.reference);if(i.match(/следующей\s*ночью/)){let a=n.hour()<22?1:2;n=n.add(a,"day"),QA.assignSimilarDate(s,n),s.imply("hour",0)}return i.match(/в\s*полночь/)||i.endsWith("\u043D\u043E\u0447\u044C\u044E")?wi.midnight(e.reference):s}};Ar.default=ym});var M_=E(bm=>{"use strict";Object.defineProperty(bm,"__esModule",{value:!0});var co=Lt(),JA=Re(),eP=H(),tP=gi(),rP=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*)?(${JA.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),nP=1,iP=2,sP=3,Tm=class extends eP.AbstractParserWithWordBoundaryChecking{innerPattern(){return rP}patternLeftBoundary(){return co.REGEX_PARTS.leftBoundary}innerExtract(e,t){let n=t[iP].toLowerCase(),i=co.WEEKDAY_DICTIONARY[n],s=t[nP],a=t[sP],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=tP.toDayJSWeekday(e.refDate,i,u);return e.createParsingComponents().assign("weekday",i).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};bm.default=Tm});var A_=E(po=>{"use strict";var aP=po&&po.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(po,"__esModule",{value:!0});var fo=Lt(),C_=We(),oP=aP(we()),uP=H(),lP=Re(),cP=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*(${lP.matchAnyPattern(fo.TIME_UNIT_DICTIONARY)})(?=\\s*)${fo.REGEX_PARTS.rightBoundary}`,fo.REGEX_PARTS.flags),dP=1,fP=2,_m=class extends uP.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return fo.REGEX_PARTS.leftBoundary}innerPattern(){return cP}innerExtract(e,t){let n=t[dP].toLowerCase(),i=t[fP].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,C_.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,C_.ParsingComponents.createRelativeFromReference(e.reference,u)}let a=e.createParsingComponents(),o=oP.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=_m});var P_=E(wm=>{"use strict";Object.defineProperty(wm,"__esModule",{value:!0});var mo=Lt(),pP=We(),mP=H(),hP=sr(),gP=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),vm=class extends mP.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return mo.REGEX_PARTS.leftBoundary}innerPattern(){return gP}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=hP.reverseTimeUnits(i);break}return pP.ParsingComponents.createRelativeFromReference(e.reference,i)}};wm.default=vm});var F_=E(nt=>{"use strict";var Bt=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 yP=Bt(m_()),TP=Bt(b_()),bP=Bt(w_()),_P=Bt(E_()),vP=Bt(S_()),wP=Bt(O_()),kP=Bt(D_()),EP=mn(),SP=Bt(x_()),OP=Bt(R_()),DP=Bt(M_()),xP=Bt(A_()),N_=Dr(),RP=Bt(yi()),MP=Bt(P_());nt.casual=new N_.Chrono(I_());nt.strict=new N_.Chrono(km(!0));function CP(r,e,t){return nt.casual.parse(r,e,t)}nt.parse=CP;function AP(r,e,t){return nt.casual.parseDate(r,e,t)}nt.parseDate=AP;function I_(){let r=km(!1);return r.parsers.unshift(new SP.default),r.parsers.unshift(new OP.default),r.parsers.unshift(new bP.default),r.parsers.unshift(new xP.default),r.parsers.unshift(new MP.default),r}nt.createCasualConfiguration=I_;function km(r=!0){return EP.includeCommonConfiguration({parsers:[new RP.default(!0),new yP.default,new TP.default,new DP.default,new _P.default(r),new vP.default],refiners:[new kP.default,new wP.default]},r)}nt.createConfiguration=km});var Ke=E(me=>{"use strict";var PP=me&&me.__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]}),NP=me&&me.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Vn=me&&me.__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)&&PP(e,r,t);return NP(e,r),e};Object.defineProperty(me,"__esModule",{value:!0});me.parseDate=me.parse=me.casual=me.strict=me.ru=me.zh=me.nl=me.pt=me.ja=me.fr=me.de=me.Meridiem=me.Chrono=me.en=void 0;var Em=Vn(qd());me.en=Em;var IP=Dr();Object.defineProperty(me,"Chrono",{enumerable:!0,get:function(){return IP.Chrono}});var FP;(function(r){r[r.AM=0]="AM",r[r.PM=1]="PM"})(FP=me.Meridiem||(me.Meridiem={}));var LP=Vn(By());me.de=LP;var UP=Vn(_T());me.fr=UP;var WP=Vn(RT());me.ja=WP;var qP=Vn(BT());me.pt=qP;var $P=Vn(Rb());me.nl=$P;var jP=Vn(l_());me.zh=jP;var GP=Vn(F_());me.ru=GP;me.strict=Em.strict;me.casual=Em.casual;function YP(r,e,t){return me.casual.parse(r,e,t)}me.parse=YP;function BP(r,e,t){return me.casual.parseDate(r,e,t)}me.parseDate=BP});var qv=E((Uv,Wv)=>{(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 g="(node) warning: possible EventEmitter memory leak detected. "+f+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(g+=" Event name: "+h+"."),typeof process!="undefined"&&process.emitWarning){var T=new Error(g);T.name="MaxListenersExceededWarning",T.emitter=this,T.count=f,process.emitWarning(T)}else console.error(g),console.trace&&console.trace()}var m=function(f,h,g){var T=arguments.length;switch(T){case 0:return[];case 1:return[f];case 2:return[f,h];case 3:return[f,h,g];default:for(var w=new Array(T);T--;)w[T]=arguments[T];return w}};function y(f,h){for(var g={},T,w=f.length,O=h?h.length:0,M=0;M<w;M++)T=f[M],g[T]=M<O?h[M]:r;return g}function b(f,h,g){this._emitter=f,this._target=h,this._listeners={},this._listenersCount=0;var T,w;if((g.on||g.off)&&(T=g.on,w=g.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 O=f._observers;O?O.push(this):f._observers=[this]}Object.assign(b.prototype,{subscribe:function(f,h,g){var T=this,w=this._target,O=this._emitter,M=this._listeners,A=function(){var v=m.apply(null,arguments),x={data:v,name:h,original:f};if(g){var N=g.call(w,x);N!==!1&&O.emit.apply(O,[x.name].concat(v));return}O.emit.apply(O,[h].concat(v))};if(M[f])throw Error("Event '"+f+"' is already listening");this._listenersCount++,O._newListener&&O._removeListener&&!T._onNewListener?(this._onNewListener=function(v){v===h&&M[f]===null&&(M[f]=A,T._on.call(w,f,A))},O.on("newListener",this._onNewListener),this._onRemoveListener=function(v){v===h&&!O.hasListeners(v)&&M[f]&&(M[f]=null,T._off.call(w,f,A))},M[f]=null,O.on("removeListener",this._onRemoveListener)):(M[f]=A,T._on.call(w,f,A))},unsubscribe:function(f){var h=this,g=this._listeners,T=this._emitter,w,O,M=this._off,A=this._target,v;if(f&&typeof f!="string")throw TypeError("event must be a string");function x(){h._onNewListener&&(T.off("newListener",h._onNewListener),T.off("removeListener",h._onRemoveListener),h._onNewListener=null,h._onRemoveListener=null);var N=ne.call(T,h);T._observers.splice(N,1)}if(f){if(w=g[f],!w)return;M.call(A,f,w),delete g[f],--this._listenersCount||x()}else{for(O=l(g),v=O.length;v-- >0;)f=O[v],M.call(A,f,g[f]);this._listeners={},this._listenersCount=0,x()}}});function k(f,h,g,T){var w=Object.assign({},h);if(!f)return w;if(typeof f!="object")throw TypeError("options must be an object");var O=Object.keys(f),M=O.length,A,v,x;function N(le){throw Error('Invalid "'+A+'" option value'+(le?". Reason: "+le:""))}for(var ie=0;ie<M;ie++){if(A=O[ie],!T&&!e.call(h,A))throw Error('Unknown "'+A+'" option');v=f[A],v!==r&&(x=g[A],w[A]=x?x(v,N):v)}return w}function _(f,h){return(typeof f!="function"||!f.hasOwnProperty("prototype"))&&h("value must be a constructor"),f}function R(f){var h="value must be type of "+f.join("|"),g=f.length,T=f[0],w=f[1];return g===1?function(O,M){if(typeof O===T)return O;M(h)}:g===2?function(O,M){var A=typeof O;if(A===T||A===w)return O;M(h)}:function(O,M){for(var A=typeof O,v=g;v-- >0;)if(A===f[v])return O;M(h)}}var S=R(["function"]),F=R(["object","function"]);function q(f,h,g){var T,w,O=0,M,A=new f(function(v,x,N){g=k(g,{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}}),T=!g.overload&&typeof f.prototype.cancel=="function"&&typeof N=="function";function ie(){w&&(w=null),O&&(clearTimeout(O),O=0)}var le=function(Ne){ie(),v(Ne)},pe=function(Ne){ie(),x(Ne)};T?h(le,pe,N):(w=[function(Ne){pe(Ne||Error("canceled"))}],h(le,pe,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),g.timeout>0&&(O=setTimeout(function(){var Ne=Error("timeout");Ne.code="ETIMEDOUT",O=0,A.cancel(Ne),x(Ne)},g.timeout))});return T||(A.cancel=function(v){if(!!w){for(var x=w.length,N=1;N<x;N++)w[N](v);w[0](v),w=null}}),A}function ne(f){var h=this._observers;if(!h)return-1;for(var g=h.length,T=0;T<g;T++)if(h[T]._target===f)return T;return-1}function G(f,h,g,T,w){if(!g)return null;if(T===0){var O=typeof h;if(O==="string"){var M,A,v=0,x=0,N=this.delimiter,ie=N.length;if((A=h.indexOf(N))!==-1){M=new Array(5);do M[v++]=h.slice(x,A),x=A+ie;while((A=h.indexOf(N,x))!==-1);M[v++]=h.slice(x),h=M,w=v}else h=[h],w=1}else O==="object"?w=h.length:(h=[h],w=1)}var le=null,pe,Ne,Ce,Nt,dn,Br=h[T],at=h[T+1],Et,Ge;if(T===w)g._listeners&&(typeof g._listeners=="function"?(f&&f.push(g._listeners),le=[g]):(f&&f.push.apply(f,g._listeners),le=[g]));else if(Br==="*"){for(Et=l(g),A=Et.length;A-- >0;)pe=Et[A],pe!=="_listeners"&&(Ge=G(f,h,g[pe],T+1,w),Ge&&(le?le.push.apply(le,Ge):le=Ge));return le}else if(Br==="**"){for(dn=T+1===w||T+2===w&&at==="*",dn&&g._listeners&&(le=G(f,h,g,w,w)),Et=l(g),A=Et.length;A-- >0;)pe=Et[A],pe!=="_listeners"&&(pe==="*"||pe==="**"?(g[pe]._listeners&&!dn&&(Ge=G(f,h,g[pe],w,w),Ge&&(le?le.push.apply(le,Ge):le=Ge)),Ge=G(f,h,g[pe],T,w)):pe===at?Ge=G(f,h,g[pe],T+2,w):Ge=G(f,h,g[pe],T,w),Ge&&(le?le.push.apply(le,Ge):le=Ge));return le}else g[Br]&&(le=G(f,h,g[Br],T+1,w));if(Ne=g["*"],Ne&&G(f,h,Ne,T+1,w),Ce=g["**"],Ce)if(T<w)for(Ce._listeners&&G(f,h,Ce,w,w),Et=l(Ce),A=Et.length;A-- >0;)pe=Et[A],pe!=="_listeners"&&(pe===at?G(f,h,Ce[pe],T+2,w):pe===Br?G(f,h,Ce[pe],T+1,w):(Nt={},Nt[pe]=Ce[pe],G(f,h,{"**":Nt},T+1,w)));else Ce._listeners?G(f,h,Ce,w,w):Ce["*"]&&Ce["*"]._listeners&&G(f,h,Ce["*"],w,w);return le}function B(f,h,g){var T=0,w=0,O,M=this.delimiter,A=M.length,v;if(typeof f=="string")if((O=f.indexOf(M))!==-1){v=new Array(5);do v[T++]=f.slice(w,O),w=O+A;while((O=f.indexOf(M,w))!==-1);v[T++]=f.slice(w)}else v=[f],T=1;else v=f,T=f.length;if(T>1){for(O=0;O+1<T;O++)if(v[O]==="**"&&v[O+1]==="**")return}var x=this.listenerTree,N;for(O=0;O<T;O++)if(N=v[O],x=x[N]||(x[N]={}),O===T-1)return x._listeners?(typeof x._listeners=="function"&&(x._listeners=[x._listeners]),g?x._listeners.unshift(h):x._listeners.push(h),!x._listeners.warned&&this._maxListeners>0&&x._listeners.length>this._maxListeners&&(x._listeners.warned=!0,p.call(this,x._listeners.length,N))):x._listeners=h,!0;return!0}function he(f,h,g,T){for(var w=l(f),O=w.length,M,A,v,x=f._listeners,N;O-- >0;)A=w[O],M=f[A],A==="_listeners"?v=g:v=g?g.concat(A):[A],N=T||typeof A=="symbol",x&&h.push(N?v:v.join(this.delimiter)),typeof M=="object"&&he.call(this,M,h,v,N);return h}function Pe(f){for(var h=l(f),g=h.length,T,w,O;g-- >0;)w=h[g],T=f[w],T&&(O=!0,w!=="_listeners"&&!Pe(T)&&delete f[w]);return O}function j(f,h,g){this.emitter=f,this.event=h,this.listener=g}j.prototype.off=function(){return this.emitter.off(this.event,this.listener),this};function $(f,h,g){if(g===!0)w=!0;else if(g===!1)T=!0;else{if(!g||typeof g!="object")throw TypeError("options should be an object or true");var T=g.async,w=g.promisify,O=g.nextTick,M=g.objectify}if(T||O||w){var A=h,v=h._origin||h;if(O&&!i)throw Error("process.nextTick is not supported");w===r&&(w=h.constructor.name==="AsyncFunction"),h=function(){var x=arguments,N=this,ie=this.event;return w?O?Promise.resolve():new Promise(function(le){u(le)}).then(function(){return N.event=ie,A.apply(N,x)}):(O?process.nextTick:u)(function(){N.event=ie,A.apply(N,x)})},h._async=!0,h._origin=v}return[h,M?new j(this,f,h):this]}function D(f){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,d.call(this,f)}D.EventEmitter2=D,D.prototype.listenTo=function(f,h,g){if(typeof f!="object")throw TypeError("target musts be an object");var T=this;g=k(g,{on:r,off:r,reducers:r},{on:S,off:S,reducers:F});function w(O){if(typeof O!="object")throw TypeError("events must be an object");var M=g.reducers,A=ne.call(T,f),v;A===-1?v=new b(T,f,g):v=T._observers[A];for(var x=l(O),N=x.length,ie,le=typeof M=="function",pe=0;pe<N;pe++)ie=x[pe],v.subscribe(ie,O[ie]||ie,le?M:M&&M[ie])}return t(h)?w(y(h)):w(typeof h=="string"?y(h.split(/\s+/)):h),this},D.prototype.stopListeningTo=function(f,h){var g=this._observers;if(!g)return!1;var T=g.length,w,O=!1;if(f&&typeof f!="object")throw TypeError("target should be an object");for(;T-- >0;)w=g[T],(!f||w._target===f)&&(w.unsubscribe(h),O=!0);return O},D.prototype.delimiter=".",D.prototype.setMaxListeners=function(f){f!==r&&(this._maxListeners=f,this._conf||(this._conf={}),this._conf.maxListeners=f)},D.prototype.getMaxListeners=function(){return this._maxListeners},D.prototype.event="",D.prototype.once=function(f,h,g){return this._once(f,h,!1,g)},D.prototype.prependOnceListener=function(f,h,g){return this._once(f,h,!0,g)},D.prototype._once=function(f,h,g,T){return this._many(f,1,h,g,T)},D.prototype.many=function(f,h,g,T){return this._many(f,h,g,!1,T)},D.prototype.prependMany=function(f,h,g,T){return this._many(f,h,g,!0,T)},D.prototype._many=function(f,h,g,T,w){var O=this;if(typeof g!="function")throw new Error("many only accepts instances of Function");function M(){return--h===0&&O.off(f,M),g.apply(this,arguments)}return M._origin=g,this._on(f,M,T,w)},D.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||c.call(this);var f=arguments[0],h,g=this.wildcard,T,w,O,M,A;if(f==="newListener"&&!this._newListener&&!this._events.newListener)return!1;if(g&&(h=f,f!=="newListener"&&f!=="removeListener"&&typeof f=="object")){if(w=f.length,s){for(O=0;O<w;O++)if(typeof f[O]=="symbol"){A=!0;break}}A||(f=f.join(this.delimiter))}var v=arguments.length,x;if(this._all&&this._all.length)for(x=this._all.slice(),O=0,w=x.length;O<w;O++)switch(this.event=f,v){case 1:x[O].call(this,f);break;case 2:x[O].call(this,f,arguments[1]);break;case 3:x[O].call(this,f,arguments[1],arguments[2]);break;default:x[O].apply(this,arguments)}if(g)x=[],G.call(this,x,h,this.listenerTree,0,w);else if(x=this._events[f],typeof x=="function"){switch(this.event=f,v){case 1:x.call(this);break;case 2:x.call(this,arguments[1]);break;case 3:x.call(this,arguments[1],arguments[2]);break;default:for(T=new Array(v-1),M=1;M<v;M++)T[M-1]=arguments[M];x.apply(this,T)}return!0}else x&&(x=x.slice());if(x&&x.length){if(v>3)for(T=new Array(v-1),M=1;M<v;M++)T[M-1]=arguments[M];for(O=0,w=x.length;O<w;O++)switch(this.event=f,v){case 1:x[O].call(this);break;case 2:x[O].call(this,arguments[1]);break;case 3:x[O].call(this,arguments[1],arguments[2]);break;default:x[O].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},D.prototype.emitAsync=function(){if(!this._events&&!this._all)return!1;this._events||c.call(this);var f=arguments[0],h=this.wildcard,g,T,w,O,M,A;if(f==="newListener"&&!this._newListener&&!this._events.newListener)return Promise.resolve([!1]);if(h&&(g=f,f!=="newListener"&&f!=="removeListener"&&typeof f=="object")){if(O=f.length,s){for(M=0;M<O;M++)if(typeof f[M]=="symbol"){T=!0;break}}T||(f=f.join(this.delimiter))}var v=[],x=arguments.length,N;if(this._all)for(M=0,O=this._all.length;M<O;M++)switch(this.event=f,x){case 1:v.push(this._all[M].call(this,f));break;case 2:v.push(this._all[M].call(this,f,arguments[1]));break;case 3:v.push(this._all[M].call(this,f,arguments[1],arguments[2]));break;default:v.push(this._all[M].apply(this,arguments))}if(h?(N=[],G.call(this,N,g,this.listenerTree,0)):N=this._events[f],typeof N=="function")switch(this.event=f,x){case 1:v.push(N.call(this));break;case 2:v.push(N.call(this,arguments[1]));break;case 3:v.push(N.call(this,arguments[1],arguments[2]));break;default:for(w=new Array(x-1),A=1;A<x;A++)w[A-1]=arguments[A];v.push(N.apply(this,w))}else if(N&&N.length){if(N=N.slice(),x>3)for(w=new Array(x-1),A=1;A<x;A++)w[A-1]=arguments[A];for(M=0,O=N.length;M<O;M++)switch(this.event=f,x){case 1:v.push(N[M].call(this));break;case 2:v.push(N[M].call(this,arguments[1]));break;case 3:v.push(N[M].call(this,arguments[1],arguments[2]));break;default:v.push(N[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(v)},D.prototype.on=function(f,h,g){return this._on(f,h,!1,g)},D.prototype.prependListener=function(f,h,g){return this._on(f,h,!0,g)},D.prototype.onAny=function(f){return this._onAny(f,!1)},D.prototype.prependAny=function(f){return this._onAny(f,!0)},D.prototype.addListener=D.prototype.on,D.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},D.prototype._on=function(f,h,g,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,O;return T!==r&&(O=$.call(this,f,h,T),h=O[0],w=O[1]),this._newListener&&this.emit("newListener",f,h),this.wildcard?(B.call(this,f,h,g),w):(this._events[f]?(typeof this._events[f]=="function"&&(this._events[f]=[this._events[f]]),g?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)},D.prototype.off=function(f,h){if(typeof h!="function")throw new Error("removeListener only takes instances of Function");var g,T=[];if(this.wildcard){var w=typeof f=="string"?f.split(this.delimiter):f.slice();if(T=G.call(this,null,w,this.listenerTree,0),!T)return this}else{if(!this._events[f])return this;g=this._events[f],T.push({_listeners:g})}for(var O=0;O<T.length;O++){var M=T[O];if(g=M._listeners,t(g)){for(var A=-1,v=0,x=g.length;v<x;v++)if(g[v]===h||g[v].listener&&g[v].listener===h||g[v]._origin&&g[v]._origin===h){A=v;break}if(A<0)continue;return this.wildcard?M._listeners.splice(A,1):this._events[f].splice(A,1),g.length===0&&(this.wildcard?delete M._listeners:delete this._events[f]),this._removeListener&&this.emit("removeListener",f,h),this}else(g===h||g.listener&&g.listener===h||g._origin&&g._origin===h)&&(this.wildcard?delete M._listeners:delete this._events[f],this._removeListener&&this.emit("removeListener",f,h))}return this.listenerTree&&Pe(this.listenerTree),this},D.prototype.offAny=function(f){var h=0,g=0,T;if(f&&this._all&&this._all.length>0){for(T=this._all,h=0,g=T.length;h<g;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,g=T.length;h<g;h++)this.emit("removeListenerAny",T[h]);this._all=[]}return this},D.prototype.removeListener=D.prototype.off,D.prototype.removeAllListeners=function(f){if(f===r)return!this._events||c.call(this),this;if(this.wildcard){var h=G.call(this,null,f,this.listenerTree,0),g,T;if(!h)return this;for(T=0;T<h.length;T++)g=h[T],g._listeners=null;this.listenerTree&&Pe(this.listenerTree)}else this._events&&(this._events[f]=null);return this},D.prototype.listeners=function(f){var h=this._events,g,T,w,O,M;if(f===r){if(this.wildcard)throw Error("event name required for wildcard emitter");if(!h)return[];for(g=l(h),O=g.length,w=[];O-- >0;)T=h[g[O]],typeof T=="function"?w.push(T):w.push.apply(w,T);return w}else{if(this.wildcard){if(M=this.listenerTree,!M)return[];var A=[],v=typeof f=="string"?f.split(this.delimiter):f.slice();return G.call(this,A,v,M,0),A}return h?(T=h[f],T?typeof T=="function"?[T]:T:[]):[]}},D.prototype.eventNames=function(f){var h=this._events;return this.wildcard?he.call(this,this.listenerTree,[],null,f):h?l(h):[]},D.prototype.listenerCount=function(f){return this.listeners(f).length},D.prototype.hasListeners=function(f){if(this.wildcard){var h=[],g=typeof f=="string"?f.split(this.delimiter):f.slice();return G.call(this,h,g,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]))},D.prototype.listenersAny=function(){return this._all?this._all:[]},D.prototype.waitFor=function(f,h){var g=this,T=typeof h;return T==="number"?h={timeout:h}:T==="function"&&(h={filter:h}),h=k(h,{timeout:0,filter:r,handleError:!1,Promise,overload:!1},{filter:S,Promise:_}),q(h.Promise,function(w,O,M){function A(){var v=h.filter;if(!(v&&!v.apply(g,arguments)))if(g.off(f,A),h.handleError){var x=arguments[0];x?O(x):w(m.apply(null,arguments).slice(1))}else w(m.apply(null,arguments))}M(function(){g.off(f,A)}),g._on(f,A,!1)},{timeout:h.timeout,overload:h.overload})};function Y(f,h,g){g=k(g,{Promise,timeout:0,overload:!1},{Promise:_});var T=g.Promise;return q(T,function(w,O,M){var A;if(typeof f.addEventListener=="function"){A=function(){w(m.apply(null,arguments))},M(function(){f.removeEventListener(h,A)}),f.addEventListener(h,A,{once:!0});return}var v=function(){x&&f.removeListener("error",x),w(m.apply(null,arguments))},x;h!=="error"&&(x=function(N){f.removeListener(h,v),O(N)},f.once("error",x)),M(function(){x&&f.removeListener("error",x),f.removeListener(h,v)}),f.once(h,v)},{timeout:g.timeout,overload:g.overload})}var I=D.prototype;if(Object.defineProperties(D,{defaultMaxListeners:{get:function(){return I._maxListeners},set:function(f){if(typeof f!="number"||f<0||Number.isNaN(f))throw TypeError("n must be a non-negative number");I._maxListeners=f},enumerable:!0},once:{value:Y,writable:!0,configurable:!0}}),Object.defineProperties(I,{_maxListeners:{value:n,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),typeof define=="function"&&define.amd)define(function(){return D});else if(typeof Uv=="object")Wv.exports=D;else{var Z=new Function("","return this")();Z.EventEmitter2=D}})()});var zw=E(vh=>{"use strict";Object.defineProperty(vh,"__esModule",{value:!0});var Hw=Symbol("MustacheDataPath");function Bw({target:r,propertyName:e}){return[...r[Hw]||[],e]}function Vw(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=Bw({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[Hw]=Bw({target:t,propertyName:n}),Vw(i,e)):i}})}vh.default=Vw});var on=E(qr=>{"use strict";qr.__esModule=!0;qr.Tokens=qr.StructuralCharacters=qr.Operators=void 0;var vF;(function(r){r.AND="AND",r.OR="OR",r.XOR="XOR",r.NOT="NOT"})(vF=qr.Operators||(qr.Operators={}));var wF;(function(r){r.OPEN_PARENTHESIS="(",r.CLOSE_PARENTHESIS=")"})(wF=qr.StructuralCharacters||(qr.StructuralCharacters={}));var kF;(function(r){r.IDENTIFIER="IDENTIFIER",r.OPERATOR="OPERATOR",r.STRUCTURAL_CHARACTER="STRUCTURAL_CHARACTER",r.EOF="EOF",r.COMMENT="COMMENT"})(kF=qr.Tokens||(qr.Tokens={}))});var xh=E(js=>{"use strict";js.__esModule=!0;js.VALID_TOKENS=js.OPERATOR_PRECEDENCE=void 0;var qe=on();js.OPERATOR_PRECEDENCE={NOT:0,XOR:1,AND:2,OR:3};js.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 Rh=E(wt=>{"use strict";wt.__esModule=!0;wt.ESCAPE_CHARACTER=wt.EOL=wt.COMMENT_DELIMITER=wt.QUOTED_IDENTIFIER_DELIMITER=wt.SEPARATORS=wt.OPERATORS=wt.STRUCTURAL_CHARACTERS=void 0;var Gs=on();wt.STRUCTURAL_CHARACTERS={"(":Gs.StructuralCharacters.OPEN_PARENTHESIS,")":Gs.StructuralCharacters.CLOSE_PARENTHESIS};wt.OPERATORS={AND:Gs.Operators.AND,OR:Gs.Operators.OR,XOR:Gs.Operators.XOR,NOT:Gs.Operators.NOT};wt.SEPARATORS=new Set([32,9,10,13].map(function(r){return String.fromCodePoint(r)}));wt.QUOTED_IDENTIFIER_DELIMITER=String.fromCodePoint(34);wt.COMMENT_DELIMITER=String.fromCodePoint(35);wt.EOL=String.fromCodePoint(10);wt.ESCAPE_CHARACTER=String.fromCodePoint(92)});var ek=E(wr=>{"use strict";var Mh=wr&&wr.__assign||function(){return Mh=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},Mh.apply(this,arguments)};wr.__esModule=!0;wr.getQuotedIdentifier=wr.getComment=wr.createResult=void 0;var Jw=on(),Yi=Rh(),EF=function(r,e,t){return{token:Mh({name:r},e!==null?{value:e}:{}),remainingString:t}};wr.createResult=EF;var SF=function(r){for(var e=r.length,t=0;t<r.length;t+=1){var n=r[t];if(n===Yi.EOL){e=t;break}}return(0,wr.createResult)(Jw.Tokens.COMMENT,r.slice(0,e),r.slice(e+1))};wr.getComment=SF;var OF=function(r){for(var e=!1,t="",n=null,i=0;i<r.length;i+=1){var s=r[i];if(n===null)s===Yi.QUOTED_IDENTIFIER_DELIMITER?e?(t=t.slice(0,-1)+Yi.QUOTED_IDENTIFIER_DELIMITER,e=!1):n=i:(s===Yi.ESCAPE_CHARACTER?e=!0:e=!1,t=t+=s);else{if(!Yi.SEPARATORS.has(s)&&!Yi.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(Yi.QUOTED_IDENTIFIER_DELIMITER," character"));return(0,wr.createResult)(Jw.Tokens.IDENTIFIER,t,r.slice(n+1))};wr.getQuotedIdentifier=OF});var tk=E(Wl=>{"use strict";Wl.__esModule=!0;Wl.lex=void 0;var Ys=on(),Jt=Rh(),Bs=ek(),DF=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(!Jt.SEPARATORS.has(s)){var a=Jt.STRUCTURAL_CHARACTERS[s];if(a){var o=r[i+1];if(a===Ys.StructuralCharacters.CLOSE_PARENTHESIS&&o&&!Jt.SEPARATORS.has(o)&&o!==Ys.StructuralCharacters.CLOSE_PARENTHESIS)throw new Error("Unexpected character: ".concat(o,". A closing parenthesis should be followed by another closing parenthesis or whitespace"));return(0,Bs.createResult)(Ys.Tokens.STRUCTURAL_CHARACTER,Jt.STRUCTURAL_CHARACTERS[s],r.slice(i+1))}if(s===Jt.QUOTED_IDENTIFIER_DELIMITER)return(0,Bs.getQuotedIdentifier)(r.slice(i+1));if(s===Jt.COMMENT_DELIMITER)return(0,Bs.getComment)(r.slice(i+1));e=i}}else if(Jt.SEPARATORS.has(s)||Jt.STRUCTURAL_CHARACTERS[s]){t=i,n=s;break}else if(s===Jt.QUOTED_IDENTIFIER_DELIMITER||s===Jt.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(Jt.OPERATORS[u]){if(n&&!Jt.SEPARATORS.has(n))throw new Error("Unexpected character: ".concat(n,". Operators should be separated using whitespace"));return(0,Bs.createResult)(Ys.Tokens.OPERATOR,Jt.OPERATORS[u],l)}else return(0,Bs.createResult)(Ys.Tokens.IDENTIFIER,u,l)}return(0,Bs.createResult)(Ys.Tokens.EOF,null,"")};Wl.lex=DF});var nk=E(er=>{"use strict";var rk=er&&er.__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))};er.__esModule=!0;er.validateToken=er.previousOperatorTakesPrecedent=er.getValue=er.newTokenGenerator=void 0;var xF=tk(),Hs=on(),ql=xh(),RF=function(r){var e=r;return function(t,n){for(n===void 0&&(n=!1);;){var i=(0,xF.lex)(e),s=i.token,a=i.remainingString;if(e=a,s.name!==Hs.Tokens.COMMENT)return(0,er.validateToken)(s,t,n),s}}};er.newTokenGenerator=RF;var MF=function(r,e){var t=r(ql.VALID_TOKENS.identifierOrNot),n=t.value===Hs.Operators.NOT;n&&(t=r(ql.VALID_TOKENS.identifierOnly));var i=t.name===Hs.Tokens.STRUCTURAL_CHARACTER?e(r,!0):[t];return n?rk(rk([],i,!0),[{name:Hs.Tokens.OPERATOR,value:Hs.Operators.NOT}],!1):i};er.getValue=MF;var CF=function(r,e){return ql.OPERATOR_PRECEDENCE[r]<=ql.OPERATOR_PRECEDENCE[e]};er.previousOperatorTakesPrecedent=CF;var AF=function(r,e,t){if(t===void 0&&(t=!1),r.name===Hs.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")};er.validateToken=AF});var Ah=E(Vs=>{"use strict";var un=Vs&&Vs.__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))};Vs.__esModule=!0;Vs.parse=void 0;var ik=on(),sk=xh(),$l=nk(),PF=function(r){if(typeof r!="string")throw new Error("Expected string but received ".concat(typeof r));var e=(0,$l.newTokenGenerator)(r);return Ch(e)};Vs.parse=PF;var Ch=function(r,e){e===void 0&&(e=!1);for(var t=un([],(0,$l.getValue)(r,Ch),!0),n=[];;){var i=e?sk.VALID_TOKENS.binaryOperatorOrClose:sk.VALID_TOKENS.binaryOperator,s=r(i,!e);if(s.name===ik.Tokens.EOF||s.name===ik.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,$l.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,$l.getValue)(r,Ch),!0)}}});var Ph=E(kt=>{"use strict";kt.__esModule=!0;kt.throwInvalidExpression=kt.isOperator=kt.isIdentifier=kt.notUtil=kt.xorUtil=kt.orUtil=kt.andUtil=void 0;var ak=on(),NF=function(r,e){return r&&e};kt.andUtil=NF;var IF=function(r,e){return r||e};kt.orUtil=IF;var FF=function(r,e){return r!==e};kt.xorUtil=FF;var LF=function(r){return!r};kt.notUtil=LF;var UF=function(r){var e=r.name,t=r.value;return e===ak.Tokens.IDENTIFIER&&typeof t=="string"};kt.isIdentifier=UF;var WF=function(r){var e=r.name,t=r.value;return e===ak.Tokens.OPERATOR&&typeof t=="string"};kt.isOperator=WF;var qF=function(r){throw new TypeError("Invalid postfix expression: ".concat(r))};kt.throwInvalidExpression=qF});var ok=E(jl=>{"use strict";var jo;jl.__esModule=!0;jl.OPERATOR_MAP=void 0;var Nh=on(),Ih=Ph();jl.OPERATOR_MAP=(jo={},jo[Nh.Operators.AND]=Ih.andUtil,jo[Nh.Operators.OR]=Ih.orUtil,jo[Nh.Operators.XOR]=Ih.xorUtil,jo)});var lk=E(kr=>{"use strict";var zs=kr&&kr.__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))};kr.__esModule=!0;kr.evaluateExpression=kr.evaluate=kr.getEvaluator=void 0;var $F=Ah(),uk=on(),jF=ok(),Bi=Ph(),GF=function(r){var e=(0,$F.parse)(r);return function(t){return(0,kr.evaluate)(e,t)}};kr.getEvaluator=GF;var YF=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,Bi.isIdentifier)(i)||(0,Bi.isOperator)(i))))throw new Error("Invalid token: ".concat(i,". Found in parsed expression at index ").concat(s));if(i.name===uk.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===uk.Operators.NOT)return o===void 0&&(0,Bi.throwInvalidExpression)("missing identifier"),zs(zs([],n.slice(0,-1),!0),[(0,Bi.notUtil)(o)],!1);(o===void 0||a===void 0)&&(0,Bi.throwInvalidExpression)("missing identifier");var u=jF.OPERATOR_MAP[i.value];return u||(0,Bi.throwInvalidExpression)("unknown operator"),zs(zs([],n.slice(0,-2),!0),[u(a,o)],!1)},[]);return t.length!==1&&(0,Bi.throwInvalidExpression)("too many identifiers after evaluation"),t[0]};kr.evaluate=YF;var BF=function(r,e){return(0,kr.getEvaluator)(r)(e)};kr.evaluateExpression=BF});var dk=E(ln=>{"use strict";var Fh=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 ck=lk();Fh(ln,ck,"getEvaluator");Fh(ln,ck,"evaluate");var HF=Ah();Fh(ln,HF,"parse")});var dL={};EE(dL,{default:()=>_c});module.exports=SE(dL);var nE=require("obsidian");var ws=require("obsidian");var pL=new Error("timeout while waiting for mutex to become available"),mL=new Error("mutex already locked"),OE=new Error("request for lock canceled"),DE=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())})},Nc=class{constructor(e,t=OE){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 DE(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]=[])}},xE=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 Nc(1,e)}acquire(){return xE(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 Jo=require("obsidian"),ot=class{constructor(e,t={}){this._frontmatter={tags:[]};this._tags=[];var i,s;this._path=e,this._cachedMetadata=t;let n=t.frontmatter;if(n!==void 0&&(this._frontmatter=JSON.parse(JSON.stringify(n)),this._frontmatter.tags=(i=(0,Jo.parseFrontMatterTags)(n))!=null?i:[]),Object.keys(t).length!==0){let a=(s=(0,Jo.getAllTags)(this.cachedMetadata))!=null?s:[];this._tags=[...new Set(a)]}}get path(){return this._path}get tags(){return this._tags}get cachedMetadata(){return this._cachedMetadata}get frontmatter(){return this._frontmatter}rawFrontmatterIdenticalTo(e){let t=this.cachedMetadata.frontmatter,n=e.cachedMetadata.frontmatter;return t===n?!0:!t||!n?!1:JSON.stringify(t)===JSON.stringify(n)}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)}hasProperty(e){let t=this.findKeyInFrontmatter(e);if(t===void 0)return!1;let n=this.frontmatter[t];return!(n===null||n===void 0)}property(e){let t=this.findKeyInFrontmatter(e);if(t===void 0)return null;let n=this.frontmatter[t];return n===void 0?null:Array.isArray(n)?n.filter(i=>i!==null):n}findKeyInFrontmatter(e){let t=e.toLowerCase();return Object.keys(this.frontmatter).find(n=>n.toLowerCase()===t)}};var Xi=class{constructor(e,t){this.parent=null;this.children=[];this.originalMarkdown=e,this.parent=t,t!==null&&t.children.push(this)}get root(){return this.parent===null?this:this.parent.root}get isRoot(){return this.parent===null}};var Bu=pa(Ke());var Dt=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 Dt(window.moment().startOf(t).startOf("day"),window.moment().endOf(t).startOf("day"))}static buildInvalid(){return new Dt(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 Ht=class{static parseDate(e,t=!1){return window.moment(Bu.parseDate(e,void 0,{forwardDate:t})).startOf("day")}static parseDateRange(e,t=!1){let n=[Ht.parseRelativeDateRange,Ht.parseNumberedDateRange,Ht.parseAbsoluteDateRange];for(let i of n){let s=i(e,t);if(s.isValid())return s}return Dt.buildInvalid()}static parseAbsoluteDateRange(e,t){let n=Bu.parse(e,void 0,{forwardDate:t});if(n.length===0)return Dt.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 Dt(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=Dt.buildRelative(a);switch(s){case"last":o.moveToPrevious(a);break;case"next":o.moveToNext(a);break}return o}return Dt.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 Dt(window.moment(u,s).startOf(a),window.moment(u,s).endOf(a))}}return Dt.buildInvalid()}};var HP={td:"today",tm:"tomorrow",yd:"yesterday",tw:"this week",nw:"next week",weekend:"sat",we:"sat"};function Hu(r){for(let[e,t]of Object.entries(HP))r=r.replace(RegExp(`\\b${e}\\s`,"i"),t);return r}var Sm=pa(Ke());function dr(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 VP(r,e,t=void 0){if(!e)return`<i>no ${r} date</i>`;let n=Sm.parseDate(e,t,{forwardDate:t!=null});return n!==null?window.moment(n).format("YYYY-MM-DD"):`<i>invalid ${r} date</i>`}function L_(r,e,t){return VP(r,e,t?new Date:void 0)}function ki(r,e){let t=null,n=Sm.parseDate(r,new Date,{forwardDate:e});return n!==null&&(t=window.moment(n)),t}var fr=class{constructor({startDate:e=null,scheduledDate:t=null,dueDate:n=null}){this.startDate=e!=null?e:null,this.scheduledDate=t!=null?t:null,this.dueDate=n!=null?n:null,this.referenceDate=this.getReferenceDate()}getReferenceDate(){return this.dueDate?window.moment(this.dueDate):this.scheduledDate?window.moment(this.scheduledDate):this.startDate?window.moment(this.startDate):null}isIdenticalTo(e){return!(dr(this.startDate,e.startDate)!==0||dr(this.scheduledDate,e.scheduledDate)!==0||dr(this.dueDate,e.dueDate)!==0)}next(e){return this.referenceDate===null?new fr({startDate:null,scheduledDate:null,dueDate:null}):new fr({startDate:this.nextOccurrenceDate(this.startDate,e),scheduledDate:this.nextOccurrenceDate(this.scheduledDate,e),dueDate:this.nextOccurrenceDate(this.dueDate,e)})}nextOccurrenceDate(e,t){if(e===null)return null;let n=window.moment.duration(e.diff(this.referenceDate)),i=window.moment(t);return i.add(Math.round(n.asDays()),"days"),i}};var Vu=["MO","TU","WE","TH","FR","SA","SU"],Ve=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(Vu.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=Vu[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},Vt=function(r){return typeof r=="number"},Om=function(r){return typeof r=="string"&&Vu.includes(r)},dt=Array.isArray,pr=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 Te=function(r,e){var t=0,n=[];if(dt(r))for(;t<e;t++)n[t]=[].concat(r);else for(;t<e;t++)n[t]=r;return n},U_=function(r){return dt(r)?r:[r]};function Ei(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+=Te(t,e/t.length)),t.slice(0,e)+String(n))}var W_=function(r,e,t){var n=r.split(e);return t?n.slice(0,t).concat([n.slice(t).join(e)]):n},yt=function(r,e){var t=r%e;return t*e<0?t+e:t},zu=function(r,e){return{div:Math.floor(r/e),mod:yt(r,e)}},zt=function(r){return!Fe(r)||r.length===0},$e=function(r){return!zt(r)},be=function(r,e){return $e(r)&&r.indexOf(e)!==-1};var Zr=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))},zP=[31,28,31,30,31,30,31,31,30,31,30,31],j_=1e3*60*60*24,Ku=9999,G_=Zr(1970,1,1),KP=[6,0,1,2,3,4,5];var ms=function(r){return r%4===0&&r%100!==0||r%400===0},Dm=function(r){return r instanceof Date},Si=function(r){return Dm(r)&&!isNaN(r.getTime())},q_=function(r){return r.getTimezoneOffset()*60*1e3},QP=function(r,e){var t=r.getTime()-q_(r),n=e.getTime()-q_(e),i=t-n;return Math.round(i/j_)},ho=function(r){return QP(r,G_)},Qu=function(r){return new Date(G_.getTime()+r*j_)},XP=function(r){var e=r.getUTCMonth();return e===1&&ms(r.getUTCFullYear())?29:zP[e]},wn=function(r){return KP[r.getUTCDay()]},xm=function(r,e){var t=Zr(r,e+1,1);return[wn(t),XP(t)]},Xu=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()))},Zu=function(r){var e=new Date(r.getTime());return e},Rm=function(r){for(var e=[],t=0;t<r.length;t++)e.push(Zu(r[t]));return e},kn=function(r){r.sort(function(e,t){return e.getTime()-t.getTime()})},hs=function(r,e){e===void 0&&(e=!0);var t=new Date(r);return[Ei(t.getUTCFullYear().toString(),4,"0"),Ei(t.getUTCMonth()+1,2,"0"),Ei(t.getUTCDate(),2,"0"),"T",Ei(t.getUTCHours(),2,"0"),Ei(t.getUTCMinutes(),2,"0"),Ei(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))},$_=function(r,e){var t=r.toLocaleString("sv-SE",{timeZone:e});return t.replace(" ","T")+"Z"},Y_=function(r,e){var t=Intl.DateTimeFormat().resolvedOptions().timeZone,n=new Date($_(r,t)),i=new Date($_(r,e!=null?e:"UTC")),s=i.getTime()-n.getTime();return new Date(r.getTime()-s)};var ZP=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=ZP;var Mm=function(r,e){return Mm=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])},Mm(r,e)};function gs(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Mm(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var ft=function(){return ft=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},ft.apply(this,arguments)};function L(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 JP=function(r){gs(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),Cm=JP;var eN={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}},Oi=eN;var B_=function(r,e){return r.indexOf(e)!==-1},tN=function(r){return r.toString()},rN=function(r,e,t){return"".concat(e," ").concat(t,", ").concat(r)},nN=function(){function r(e,t,n,i){if(t===void 0&&(t=tN),n===void 0&&(n=Oi),i===void 0&&(i=rN),this.text=[],this.language=n||Oi,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=dt(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(B_(["dtstart","wkst","freq"],n))return!0;if(!B_(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[V.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=Vt(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=","),dt(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}(),Jr=nN;var iN=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=Oi);var t={},n=new iN(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=V.DAILY,n.nextSymbol()&&(a(),d());break;case"weekday(s)":t.freq=V.WEEKLY,t.byweekday=[V.MO,V.TU,V.WE,V.TH,V.FR],n.nextSymbol(),d();break;case"week(s)":t.freq=V.WEEKLY,n.nextSymbol()&&(s(),d());break;case"hour(s)":t.freq=V.HOURLY,n.nextSymbol()&&(s(),d());break;case"minute(s)":t.freq=V.MINUTELY,n.nextSymbol()&&(s(),d());break;case"month(s)":t.freq=V.MONTHLY,n.nextSymbol()&&(s(),d());break;case"year(s)":t.freq=V.YEARLY,n.nextSymbol()&&(s(),d());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":t.freq=V.WEEKLY;var m=n.symbol.substr(0,2).toUpperCase();if(t.byweekday=[V[m]],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var y=u();if(!y)throw new Error("Unexpected symbol "+n.symbol+", expected weekday");t.byweekday.push(V[y]),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=V.YEARLY,t.bymonth=[o()],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var b=o();if(!b)throw new Error("Unexpected symbol "+n.symbol+", expected month");t.bymonth.push(b),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 y=l(),b=u(),k=o();if(y)b?(n.nextSymbol(),t.byweekday||(t.byweekday=[]),t.byweekday.push(V[b].nth(y))):(t.bymonthday||(t.bymonthday=[]),t.bymonthday.push(y),n.accept("day(s)"));else if(b)n.nextSymbol(),t.byweekday||(t.byweekday=[]),t.byweekday.push(V[b]);else if(n.symbol==="weekday(s)")n.nextSymbol(),t.byweekday||(t.byweekday=[V.MO,V.TU,V.WE,V.TH,V.FR]);else if(n.symbol==="week(s)"){n.nextSymbol();var _=n.acceptNumber();if(!_)throw new Error("Unexpected symbol "+n.symbol+", expected week number");for(t.byweekno=[parseInt(_[0],10)];n.accept("comma");){if(_=n.acceptNumber(),!_)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");t.byweekno.push(parseInt(_[0],10))}}else if(k)n.nextSymbol(),t.bymonth||(t.bymonth=[]),t.bymonth.push(k);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 ge;(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"})(ge||(ge={}));function To(r){return r<ge.HOURLY}var H_=function(r,e){return e===void 0&&(e=Oi),new V(yo(r,e)||void 0)},ys=["count","until","interval","byweekday","bymonthday","bymonth"];Jr.IMPLEMENTED=[];Jr.IMPLEMENTED[ge.HOURLY]=ys;Jr.IMPLEMENTED[ge.MINUTELY]=ys;Jr.IMPLEMENTED[ge.DAILY]=["byhour"].concat(ys);Jr.IMPLEMENTED[ge.WEEKLY]=ys;Jr.IMPLEMENTED[ge.MONTHLY]=ys;Jr.IMPLEMENTED[ge.YEARLY]=["byweekno","byyearday"].concat(ys);var V_=function(r,e,t,n){return new Jr(r,e,t,n).toString()},z_=Jr.isFullyConvertible;var Ts=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 K_=function(r){gs(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=yt(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=zu(this.hour,24),a=s.div,o=s.mod;if(a&&(this.hour=o,this.addDaily(a)),zt(i)||be(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=zu(this.minute,60),o=a.div,u=a.mod;if(o&&(this.minute=u,this.addHours(o,!1,i)),(zt(i)||be(i,this.hour))&&(zt(s)||be(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=zu(this.second,60),u=o.div,l=o.mod;if(u&&(this.second=l,this.addMinutes(u,!1,i,s)),(zt(i)||be(i,this.hour))&&(zt(s)||be(s,this.minute))&&(zt(a)||be(a,this.second)))break}},e.prototype.fixDay=function(){if(!(this.day<=28)){var t=xm(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>Ku))return;t=xm(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 ge.YEARLY:return this.addYears(s);case ge.MONTHLY:return this.addMonths(s);case ge.WEEKLY:return this.addWeekly(s,a);case ge.DAILY:return this.addDaily(s);case ge.HOURLY:return this.addHours(s,n,o);case ge.MINUTELY:return this.addMinutes(s,n,o,u);case ge.SECONDLY:return this.addSeconds(s,n,o,u,l)}},e}(Ts);function Am(r){for(var e=[],t=Object.keys(r),n=0,i=t;n<i.length;n++){var s=i[n];be(Z_,s)||e.push(s),Dm(r[s])&&!Si(r[s])&&e.push(s)}if(e.length)throw new Error("Invalid options: "+e.join(", "));return ft({},r)}function Q_(r){var e=ft(ft({},bo),Am(r));if(Fe(e.byeaster)&&(e.freq=V.YEARLY),!(Fe(e.freq)&&V.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)?Vt(e.wkst)||(e.wkst=e.wkst.weekday):e.wkst=V.MO.weekday,Fe(e.bysetpos)){Vt(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)||$e(e.byweekno)||$e(e.byyearday)||Boolean(e.bymonthday)||$e(e.bymonthday)||Fe(e.byweekday)||Fe(e.byeaster)))switch(e.freq){case V.YEARLY:e.bymonth||(e.bymonth=e.dtstart.getUTCMonth()+1),e.bymonthday=e.dtstart.getUTCDate();break;case V.MONTHLY:e.bymonthday=e.dtstart.getUTCDate();break;case V.WEEKLY:e.byweekday=[wn(e.dtstart)];break}if(Fe(e.bymonth)&&!dt(e.bymonth)&&(e.bymonth=[e.bymonth]),Fe(e.byyearday)&&!dt(e.byyearday)&&Vt(e.byyearday)&&(e.byyearday=[e.byyearday]),!Fe(e.bymonthday))e.bymonthday=[],e.bynmonthday=[];else if(dt(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)&&!dt(e.byweekno)&&(e.byweekno=[e.byweekno]),!Fe(e.byweekday))e.bynweekday=null;else if(Vt(e.byweekday))e.byweekday=[e.byweekday],e.bynweekday=null;else if(Om(e.byweekday))e.byweekday=[Ve.fromStr(e.byweekday).weekday],e.bynweekday=null;else if(e.byweekday instanceof Ve)!e.byweekday.n||e.freq>V.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(Vt(u)){a.push(u);continue}else if(Om(u)){a.push(Ve.fromStr(u).weekday);continue}!u.n||e.freq>V.MONTHLY?a.push(u.weekday):o.push([u.weekday,u.n])}e.byweekday=$e(a)?a:null,e.bynweekday=$e(o)?o:null}return Fe(e.byhour)?Vt(e.byhour)&&(e.byhour=[e.byhour]):e.byhour=e.freq<V.HOURLY?[e.dtstart.getUTCHours()]:null,Fe(e.byminute)?Vt(e.byminute)&&(e.byminute=[e.byminute]):e.byminute=e.freq<V.MINUTELY?[e.dtstart.getUTCMinutes()]:null,Fe(e.bysecond)?Vt(e.bysecond)&&(e.bysecond=[e.bysecond]):e.bysecond=e.freq<V.SECONDLY?[e.dtstart.getUTCSeconds()]:null,{parsedOptions:e}}function X_(r){var e=r.dtstart.getTime()%1e3;if(!To(r.freq))return[];var t=[];return r.byhour.forEach(function(n){r.byminute.forEach(function(i){r.bysecond.forEach(function(s){t.push(new Ts(n,i,s,e))})})}),t}function vo(r){var e=r.split(`
`).map(sN).filter(function(t){return t!==null});return ft(ft({},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 sN(r){if(r=r.replace(/^\s+|\s+$/,""),!r.length)return null;var e=/^([A-Z]+?)[:;]/.exec(r.toUpperCase());if(!e)return J_(r);var t=e[1];switch(t.toUpperCase()){case"RRULE":case"EXRULE":return J_(r);case"DTSTART":return _o(r);default:throw new Error("Unsupported RFC prop ".concat(t," in ").concat(r))}}function J_(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=ge[o.toUpperCase()];break;case"WKST":t.wkst=mr[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=aN(o),l=a.toLowerCase();t[l]=u;break;case"BYWEEKDAY":case"BYDAY":t.byweekday=oN(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 aN(r){if(r.indexOf(",")!==-1){var e=r.split(",");return e.map(ev)}return ev(r)}function ev(r){return/^[+-]?\d+$/.test(r)?Number(r):r}function oN(r){var e=r.split(",");return e.map(function(t){if(t.length===2)return mr[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=mr[s].weekday;return new Ve(a,i)})}var Di=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=hs(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:Y_(this.date,this.tzid)},r}();function wo(r){for(var e=[],t="",n=Object.keys(r),i=Object.keys(bo),s=0;s<n.length;s++)if(n[s]!=="tzid"&&!!be(i,n[s])){var a=n[s].toUpperCase(),o=r[n[s]],u="";if(!(!Fe(o)||dt(o)&&!o.length)){switch(a){case"FREQ":u=V.FREQUENCIES[r.freq];break;case"WKST":Vt(o)?u=new Ve(o).toString():u=o.toString();break;case"BYWEEKDAY":a="BYDAY",u=U_(o).map(function(m){return m instanceof Ve?m:dt(m)?new Ve(m[0],m[1]):new Ve(m)}).toString();break;case"DTSTART":t=uN(o,r.tzid);break;case"UNTIL":u=hs(o,!r.tzid);break;default:if(dt(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 y=m[0],b=m[1];return"".concat(y,"=").concat(b.toString())}).join(";"),p="";return d!==""&&(p="RRULE:".concat(d)),[t,p].filter(function(m){return!!m}).join(`
`)}function uN(r,e){return r?"DTSTART"+new Di(new Date(r),e).toString():""}function lN(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 tv=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?Zu(t):Rm(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(!lN(t[p],c[p]))return!0}return!1},a=this[e];if(e==="all")n=this.all;else if(dt(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 dt(n)?Rm(n):n instanceof Date?Zu(n):n},r}();var rv=L(L(L(L(L(L(L(L(L(L(L(L(L([],Te(1,31),!0),Te(2,28),!0),Te(3,31),!0),Te(4,30),!0),Te(5,31),!0),Te(6,30),!0),Te(7,31),!0),Te(8,31),!0),Te(9,30),!0),Te(10,31),!0),Te(11,30),!0),Te(12,31),!0),Te(1,7),!0),nv=L(L(L(L(L(L(L(L(L(L(L(L(L([],Te(1,31),!0),Te(2,29),!0),Te(3,31),!0),Te(4,30),!0),Te(5,31),!0),Te(6,30),!0),Te(7,31),!0),Te(8,31),!0),Te(9,30),!0),Te(10,31),!0),Te(11,30),!0),Te(12,31),!0),Te(1,7),!0),cN=pr(1,29),dN=pr(1,30),zn=pr(1,31),Tt=pr(1,32),iv=L(L(L(L(L(L(L(L(L(L(L(L(L([],Tt,!0),dN,!0),Tt,!0),zn,!0),Tt,!0),zn,!0),Tt,!0),Tt,!0),zn,!0),Tt,!0),zn,!0),Tt,!0),Tt.slice(0,7),!0),sv=L(L(L(L(L(L(L(L(L(L(L(L(L([],Tt,!0),cN,!0),Tt,!0),zn,!0),Tt,!0),zn,!0),Tt,!0),Tt,!0),zn,!0),Tt,!0),zn,!0),Tt,!0),Tt.slice(0,7),!0),fN=pr(-28,0),pN=pr(-29,0),Kn=pr(-30,0),bt=pr(-31,0),av=L(L(L(L(L(L(L(L(L(L(L(L(L([],bt,!0),pN,!0),bt,!0),Kn,!0),bt,!0),Kn,!0),bt,!0),bt,!0),Kn,!0),bt,!0),Kn,!0),bt,!0),bt.slice(0,7),!0),ov=L(L(L(L(L(L(L(L(L(L(L(L(L([],bt,!0),fN,!0),bt,!0),Kn,!0),bt,!0),Kn,!0),bt,!0),bt,!0),Kn,!0),bt,!0),Kn,!0),bt,!0),bt.slice(0,7),!0),uv=[0,31,60,91,121,152,182,213,244,274,305,335,366],lv=[0,31,59,90,120,151,181,212,243,273,304,334,365],Pm=function(){for(var r=[],e=0;e<55;e++)r=r.concat(pr(7));return r}();function cv(r,e){var t=Zr(r,1,1),n=ms(r)?366:365,i=ms(r+1)?366:365,s=ho(t),a=wn(t),o=ft(ft({yearlen:n,nextyearlen:i,yearordinal:s,yearweekday:a},mN(r)),{wnomask:null});if(zt(e.byweekno))return o;o.wnomask=Te(0,n+7);var u,l,c=u=yt(7-a+e.wkst,7);c>=4?(c=0,l=o.yearlen+yt(a-e.wkst,7)):l=n-c;for(var d=Math.floor(l/7),p=yt(l,7),m=Math.floor(d+p/4),y=0;y<e.byweekno.length;y++){var b=e.byweekno[y];if(b<0&&(b+=m+1),b>0&&b<=m){var k=void 0;b>1?(k=c+(b-1)*7,c!==u&&(k-=7-u)):k=c;for(var _=0;_<7&&(o.wnomask[k]=1,k++,o.wdaymask[k]!==e.wkst);_++);}}if(be(e.byweekno,1)){var k=c+m*7;if(c!==u&&(k-=7-u),k<n)for(var y=0;y<7&&(o.wnomask[k]=1,k+=1,o.wdaymask[k]!==e.wkst);y++);}if(c){var R=void 0;if(be(e.byweekno,-1))R=-1;else{var S=wn(Zr(r-1,1,1)),F=yt(7-S.valueOf()+e.wkst,7),q=ms(r-1)?366:365,ne=void 0;F>=4?(F=0,ne=q+yt(S-e.wkst,7)):ne=n-c,R=Math.floor(52+yt(ne,7)/4)}if(be(e.byweekno,R))for(var k=0;k<c;k++)o.wnomask[k]=1}return o}function mN(r){var e=ms(r)?366:365,t=Zr(r,1,1),n=wn(t);return e===365?{mmask:rv,mdaymask:sv,nmdaymask:ov,wdaymask:Pm.slice(n),mrange:lv}:{mmask:nv,mdaymask:iv,nmdaymask:av,wdaymask:Pm.slice(n),mrange:uv}}function dv(r,e,t,n,i,s){var a={lastyear:r,lastmonth:e,nwdaymask:[]},o=[];if(s.freq===V.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===V.MONTHLY&&(o=[n.slice(e-1,e+1)]);if(zt(o))return a;a.nwdaymask=Te(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,y=s.bynweekday[p],b=y[0],k=y[1];k<0?(m=d+(k+1)*7,m-=yt(i[m]-b,7)):(m=c+(k-1)*7,m+=yt(7-i[m]+b,7)),c<=m&&m<=d&&(a.nwdaymask[m]=1)}return a}function fv(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),y=Math.floor((l+p-7*m+114)/31),b=(l+p-7*m+114)%31+1,k=Date.UTC(r,y-1,b+e),_=Date.UTC(r,0,1);return[Math.ceil((k-_)/(1e3*60*60*24))]}var hN=function(){function r(e){this.options=e}return r.prototype.rebuild=function(e,t){var n=this.options;if(e!==this.lastyear&&(this.yearinfo=cv(e,n)),$e(n.bynweekday)&&(t!==this.lastmonth||e!==this.lastyear)){var i=this.yearinfo,s=i.yearlen,a=i.mrange,o=i.wdaymask;this.monthinfo=dv(e,t,s,a,o,n)}Fe(n.byeaster)&&(this.eastermask=fv(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[pr(this.yearlen),0,this.yearlen]},r.prototype.mdayset=function(e,t){for(var n=this.mrange[t-1],i=this.mrange[t],s=Te(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=Te(null,this.yearlen+7),s=ho(Zr(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=Te(null,this.yearlen),s=ho(Zr(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 Ts(e,t,a,i)});return kn(s),s},r.prototype.stimeset=function(e,t,n,i){return[new Ts(e,t,n,i)]},r.prototype.getdayset=function(e){switch(e){case ge.YEARLY:return this.ydayset.bind(this);case ge.MONTHLY:return this.mdayset.bind(this);case ge.WEEKLY:return this.wdayset.bind(this);case ge.DAILY:return this.ddayset.bind(this);default:return this.ddayset.bind(this)}},r.prototype.gettimeset=function(e){switch(e){case ge.HOURLY:return this.htimeset.bind(this);case ge.MINUTELY:return this.mtimeset.bind(this);case ge.SECONDLY:return this.stimeset.bind(this)}},r}(),pv=hN;function mv(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=yt(c,e.length)):(u=Math.floor((c-1)/e.length),l=yt(c-1,e.length));for(var d=[],p=t;p<n;p++){var m=s[p];!Fe(m)||d.push(m)}var y=void 0;u<0?y=d.slice(u)[0]:y=d[u];var b=e[l],k=Qu(i.yearordinal+y),_=Xu(k,b);be(a,_)||a.push(_)}return kn(a),a}function Ju(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=K_.fromDate(t),l=new pv(e);l.rebuild(u.year,u.month);for(var c=TN(l,u,e);;){var d=l.getdayset(n)(u.year,u.month,u.day),p=d[0],m=d[1],y=d[2],b=yN(p,m,y,l,e);if($e(a))for(var k=mv(a,c,m,y,l,p),_=0;_<k.length;_++){var R=k[_];if(s&&R>s)return Sn(r);if(R>=t){var S=hv(R,e);if(!r.accept(S)||o&&(--o,!o))return Sn(r)}}else for(var _=m;_<y;_++){var F=p[_];if(!!Fe(F))for(var q=Qu(l.yearordinal+F),ne=0;ne<c.length;ne++){var G=c[ne],R=Xu(q,G);if(s&&R>s)return Sn(r);if(R>=t){var S=hv(R,e);if(!r.accept(S)||o&&(--o,!o))return Sn(r)}}}if(e.interval===0||(u.add(e,b),u.year>Ku))return Sn(r);To(n)||(c=l.gettimeset(n)(u.hour,u.minute,u.second,0)),l.rebuild(u.year,u.month)}}function gN(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 $e(n)&&!be(n,r.mmask[e])||$e(i)&&!r.wnomask[e]||$e(s)&&!be(s,r.wdaymask[e])||$e(r.nwdaymask)&&!r.nwdaymask[e]||a!==null&&!be(r.eastermask,e)||($e(o)||$e(u))&&!be(o,r.mdaymask[e])&&!be(u,r.nmdaymask[e])||$e(l)&&(e<r.yearlen&&!be(l,e+1)&&!be(l,-r.yearlen+e)||e>=r.yearlen&&!be(l,e+1-r.yearlen)&&!be(l,-r.nextyearlen+e-r.yearlen))}function hv(r,e){return new Di(r,e.tzid).rezonedDate()}function Sn(r){return r.getValue()}function yN(r,e,t,n,i){for(var s=!1,a=e;a<t;a++){var o=r[a];s=gN(n,o,i),s&&(r[o]=null)}return s}function TN(r,e,t){var n=t.freq,i=t.byhour,s=t.byminute,a=t.bysecond;return To(n)?X_(t):n>=V.HOURLY&&$e(i)&&!be(i,e.hour)||n>=V.MINUTELY&&$e(s)&&!be(s,e.minute)||n>=V.SECONDLY&&$e(a)&&!be(a,e.second)?[]:r.gettimeset(n)(e.hour,e.minute,e.second,e.millisecond)}var mr={MO:new Ve(0),TU:new Ve(1),WE:new Ve(2),TH:new Ve(3),FR:new Ve(4),SA:new Ve(5),SU:new Ve(6)},bo={freq:ge.YEARLY,dtstart:null,interval:1,wkst:mr.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},Z_=Object.keys(bo),V=function(){function r(e,t){e===void 0&&(e={}),t===void 0&&(t=!1),this._cache=t?null:new tv,this.origOptions=Am(e);var n=Q_(e).parsedOptions;this.options=n}return r.parseText=function(e,t){return yo(e,t)},r.fromText=function(e,t){return H_(e,t)},r.fromString=function(e){return new r(r.parseString(e)||void 0)},r.prototype._iter=function(e){return Ju(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 Cm("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),!Si(e)||!Si(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 Cm("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),!Si(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),!Si(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 V_(this,e,t,n)},r.prototype.isFullyConvertibleToText=function(){return z_(this)},r.prototype.clone=function(){return new r(this.origOptions)},r.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],r.YEARLY=ge.YEARLY,r.MONTHLY=ge.MONTHLY,r.WEEKLY=ge.WEEKLY,r.DAILY=ge.DAILY,r.HOURLY=ge.HOURLY,r.MINUTELY=ge.MINUTELY,r.SECONDLY=ge.SECONDLY,r.MO=mr.MO,r.TU=mr.TU,r.WE=mr.WE,r.TH=mr.TH,r.FR=mr.FR,r.SA=mr.SA,r.SU=mr.SU,r.parseString=vo,r.optionsToString=wo,r}();function gv(r,e,t,n,i,s){var a={},o=r.accept;function u(p,m){t.forEach(function(y){y.between(p,m,!0).forEach(function(b){a[Number(b)]=!0})})}i.forEach(function(p){var m=new Di(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 Di(n[l],s).rezonedDate();if(!r.accept(new Date(c.getTime())))break}e.forEach(function(p){Ju(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 yv={dtstart:null,cache:!1,unfold:!1,forceset:!1,compatible:!1,tzid:null};function bN(r,e){var t=[],n=[],i=[],s=[],a=_o(r),o=a.dtstart,u=a.tzid,l=EN(r,e.unfold);return l.forEach(function(c){var d;if(!!c){var p=kN(c),m=p.name,y=p.parms,b=p.value;switch(m.toUpperCase()){case"RRULE":if(y.length)throw new Error("unsupported RRULE parm: ".concat(y.join(",")));t.push(vo(c));break;case"RDATE":var k=(d=/RDATE(?:;TZID=([^:=]+))?/i.exec(c))!==null&&d!==void 0?d:[],_=k[1];_&&!u&&(u=_),n=n.concat(Tv(b,y));break;case"EXRULE":if(y.length)throw new Error("unsupported EXRULE parm: ".concat(y.join(",")));i.push(vo(b));break;case"EXDATE":s=s.concat(Tv(b,y));break;case"DTSTART":break;default:throw new Error("unsupported property: "+m)}}}),{dtstart:o,tzid:u,rrulevals:t,rdatevals:n,exrulevals:i,exdatevals:s}}function _N(r,e){var t=bN(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 Im(l);return c.dtstart(o),c.tzid(u||void 0),n.forEach(function(p){c.rrule(new V(Nm(p,o,u),l))}),i.forEach(function(p){c.rdate(p)}),s.forEach(function(p){c.exrule(new V(Nm(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 V(Nm(d,d.dtstart||e.dtstart||o,d.tzid||e.tzid||u),l)}function el(r,e){return e===void 0&&(e={}),_N(r,vN(e))}function Nm(r,e,t){return ft(ft({},r),{dtstart:e,tzid:t})}function vN(r){var e=[],t=Object.keys(r),n=Object.keys(yv);if(t.forEach(function(i){be(n,i)||e.push(i)}),e.length)throw new Error("Invalid options: "+e.join(", "));return ft(ft({},yv),r)}function wN(r){if(r.indexOf(":")===-1)return{name:"RRULE",value:r};var e=W_(r,":",1),t=e[0],n=e[1];return{name:t,value:n}}function kN(r){var e=wN(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 EN(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 SN(r){r.forEach(function(e){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(e))throw new Error("unsupported RDATE/EXDATE parm: "+e)})}function Tv(r,e){return SN(e),r.split(",").map(function(t){return go(t)})}function bv(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 Im=function(r){gs(e,r);function e(t){t===void 0&&(t=!1);var n=r.call(this,{},t)||this;return n.dtstart=bv.apply(n,["dtstart"]),n.tzid=bv.apply(n,["tzid"]),n._rrule=[],n._rdate=[],n._exrule=[],n._exdate=[],n}return e.prototype._iter=function(t){return gv(t,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},e.prototype.rrule=function(t){_v(t,this._rrule)},e.prototype.exrule=function(t){_v(t,this._exrule)},e.prototype.rdate=function(t){vv(t,this._rdate)},e.prototype.exdate=function(t){vv(t,this._exdate)},e.prototype.rrules=function(){return this._rrule.map(function(t){return el(t.toString())})},e.prototype.exrules=function(){return this._exrule.map(function(t){return el(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(wv("RDATE",this._rdate,this.tzid())),this._exdate.length&&t.push(wv("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}(V);function _v(r,e){if(!(r instanceof V))throw new TypeError(String(r)+" is not RRule instance");be(e.map(String),String(r))||e.push(r)}function vv(r,e){if(!(r instanceof Date))throw new TypeError(String(r)+" is not Date instance");be(e.map(Number),Number(r))||(e.push(r),kn(e))}function wv(r,e,t){var n=!t||t.toUpperCase()==="UTC",i=n?"".concat(r,":"):"".concat(r,";TZID=").concat(t,":"),s=e.map(function(a){return hs(a.valueOf(),n)}).join(",");return"".concat(i).concat(s)}var it=class{constructor({rrule:e,baseOnToday:t,occurrence:n}){this.rrule=e,this.baseOnToday=t,this.occurrence=n}static fromText({recurrenceRuleText:e,occurrence:t}){try{let n=e.match(/^([a-zA-Z0-9, !]+?)( when done)?$/i);if(n==null)return null;let i=n[1].trim(),s=n[2]!==void 0,a=V.parseText(i);if(a!==null){let o=t.referenceDate;!s&&o!==null?a.dtstart=window.moment(o).startOf("day").utc(!0).toDate():a.dtstart=window.moment().startOf("day").utc(!0).toDate();let u=new V(a);return new it({rrule:u,baseOnToday:s,occurrence:t})}}catch(n){n instanceof Error&&console.log(n.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);return t===null?null:this.occurrence.next(t)}identicalTo(e){return this.baseOnToday!==e.baseOnToday||!this.occurrence.isIdenticalTo(e.occurrence)?!1:this.toText()===e.toText()}nextReferenceDate(e){return this.baseOnToday?this.nextReferenceDateFromToday(e.clone()).toDate():this.nextReferenceDateFromOriginalReferenceDate().toDate()}nextReferenceDateFromToday(e){let t=new V(ce(K({},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.occurrence.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=it.nextAfterMonths(e,n,t,s[1])));let a=i.match(/every( \d+)? year(s)?(.*)?/);return a!==null&&(n=it.nextAfterYears(e,n,t,a[1])),it.addTimezone(n)}static nextAfterMonths(e,t,n,i){let s=1;for(i!==void 0&&(s=Number.parseInt(i.trim(),10));it.isSkippingTooManyMonths(e,t,s);)t=it.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));it.isSkippingTooManyYears(e,t,s);)t=it.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 V(n),window.moment(t.after(e.toDate()))}static addTimezone(e){return window.moment.utc(e).local(!0).startOf("day")}};var bs=(m=>(m.Description="description",m.Id="id",m.DependsOn="dependsOn",m.Priority="priority",m.RecurrenceRule="recurrenceRule",m.OnCompletion="onCompletion",m.CreatedDate="createdDate",m.StartDate="startDate",m.ScheduledDate="scheduledDate",m.DueDate="dueDate",m.CancelledDate="cancelledDate",m.DoneDate="doneDate",m.BlockLink="blockLink",m))(bs||{}),tl=Object.values(bs),en=class{constructor(){this.visible={};this.tagsVisible=!0;tl.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 tl.filter(e=>this.visible[e])}get hiddenComponents(){return tl.filter(e=>!this.visible[e])}get toggleableComponents(){return tl.filter(e=>e!=="description"&&e!=="blockLink")}toggleVisibilityExceptDescriptionAndBlockLink(){this.toggleableComponents.forEach(e=>{this.visible[e]=!this.visible[e]}),this.setTagsVisibility(!this.areTagsShown())}};var xt=(a=>(a.TODO="TODO",a.DONE="DONE",a.IN_PROGRESS="IN_PROGRESS",a.CANCELLED="CANCELLED",a.NON_TASK="NON_TASK",a.EMPTY="EMPTY",a))(xt||{}),Qe=class{constructor(e,t,n,i,s="TODO"){this.symbol=e,this.name=t,this.nextStatusSymbol=n,this.availableAsCommand=i,this.type=s}};function kv(r){let e=r.trim().toLowerCase();return e==="delete"?"delete":e==="keep"?"keep":""}function ON(r,e){return r.filter(t=>t!==e)}function DN(r,e){let t=r.status,n=e.status,i=n.type===t.type;return n.type!=="DONE"||i}function Ev(r,e){let t=e.length;if(r.onCompletion===""||r.onCompletion==="keep"||t===0)return e;let n=e[t-1];if(DN(r,n))return e;let s=r.onCompletion;return s==="delete"?ON(e,n):(console.log(`OnCompletion action ${s} not yet implemented.`),e)}var Kt=class{},J=Kt;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(Kt.indentationRegex.source+Kt.listMarkerRegex.source+" +"+Kt.checkboxRegex.source+Kt.afterCheckboxRegex.source,"u"),J.nonTaskRegex=new RegExp(Kt.indentationRegex.source+Kt.listMarkerRegex.source+"? *("+Kt.checkboxRegex.source+")?"+Kt.afterCheckboxRegex.source,"u"),J.listItemRegex=new RegExp(Kt.indentationRegex.source+Kt.listMarkerRegex.source),J.blockLinkRegex=/ \^[a-zA-Z0-9-]+$/u,J.hashTags=/(^|\s)#[^ !@#$%^&*(),.?":{}|<>]+/g,J.hashTagsFromEnd=new RegExp(Kt.hashTags.source+"$");var xi=/[a-zA-Z0-9-_]+/,Fm=new RegExp(xi.source+"( *, *"+xi.source+" *)*"),ko={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}",onCompletionSymbol:"\u{1F3C1}",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,onCompletionRegex:/🏁 ?([a-zA-Z]+)$/iu,dependsOnRegex:new RegExp("\u26D4\uFE0F? *("+Fm.source+")$","iu"),idRegex:new RegExp("\u{1F194} *("+xi.source+")$","iu")}};function rl(r,e,t){return t?r?" "+e:` ${e} ${t}`:""}function _s(r,e,t){return t?r?" "+e:` ${e} ${t.format(J.dateFormat)}`:""}function Sv(){let r=[];return Object.values(ko.prioritySymbols).forEach(e=>{e.length>0&&r.push(e)}),Object.values(ko).forEach(e=>{typeof e=="string"&&r.push(e)}),r}var Ri=class{constructor(e){this.symbols=e}serialize(e){let t=new en,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,onCompletionSymbol:d,dueDateSymbol:p,dependsOnSymbol:m,idSymbol:y}=this.symbols;switch(n){case"description":return e.description;case"priority":{let k="";return e.priority==="0"?k=" "+i.Highest:e.priority==="1"?k=" "+i.High:e.priority==="2"?k=" "+i.Medium:e.priority==="4"?k=" "+i.Low:e.priority==="5"&&(k=" "+i.Lowest),k}case"startDate":return _s(t,s,e.startDate);case"createdDate":return _s(t,a,e.createdDate);case"scheduledDate":return e.scheduledDateIsInferred?"":_s(t,o,e.scheduledDate);case"doneDate":return _s(t,u,e.doneDate);case"cancelledDate":return _s(t,l,e.cancelledDate);case"dueDate":return _s(t,p,e.dueDate);case"recurrenceRule":return e.recurrence?rl(t,c,e.recurrence.toText()):"";case"onCompletion":return e.onCompletion===""?"":rl(t,d,e.onCompletion);case"dependsOn":return e.dependsOn.length===0?"":rl(t,m,e.dependsOn.join(","));case"id":return rl(t,y,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="",y="",b=[],k="",_=20,R=0;do{n=!1;let S=e.match(t.priorityRegex);S!==null&&(i=this.parsePriority(S[1]),e=e.replace(t.priorityRegex,"").trim(),n=!0);let F=e.match(t.doneDateRegex);F!==null&&(u=window.moment(F[1],J.dateFormat),e=e.replace(t.doneDateRegex,"").trim(),n=!0);let q=e.match(t.cancelledDateRegex);q!==null&&(l=window.moment(q[1],J.dateFormat),e=e.replace(t.cancelledDateRegex,"").trim(),n=!0);let ne=e.match(t.dueDateRegex);ne!==null&&(o=window.moment(ne[1],J.dateFormat),e=e.replace(t.dueDateRegex,"").trim(),n=!0);let G=e.match(t.scheduledDateRegex);G!==null&&(a=window.moment(G[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 he=e.match(t.createdDateRegex);he!==null&&(c=window.moment(he[1],J.dateFormat),e=e.replace(t.createdDateRegex,"").trim(),n=!0);let Pe=e.match(t.recurrenceRegex);Pe!==null&&(d=Pe[1].trim(),e=e.replace(t.recurrenceRegex,"").trim(),n=!0);let j=e.match(t.onCompletionRegex);if(j!=null){e=e.replace(t.onCompletionRegex,"").trim();let I=j[1];m=kv(I),n=!0}let $=e.match(J.hashTagsFromEnd);if($!=null){e=e.replace(J.hashTagsFromEnd,"").trim(),n=!0;let I=$[0].trim();k=k.length>0?[I,k].join(" "):I}let D=e.match(t.idRegex);D!=null&&(e=e.replace(t.idRegex,"").trim(),y=D[1].trim(),n=!0);let Y=e.match(t.dependsOnRegex);Y!=null&&(e=e.replace(t.dependsOnRegex,"").trim(),b=Y[1].replace(/ /g,"").split(",").filter(I=>I!==""),n=!0),R++}while(n&&R<=_);return d.length>0&&(p=it.fromText({recurrenceRuleText:d,occurrence:new fr({startDate:s,scheduledDate:a,dueDate:o})})),k.length>0&&(e+=" "+k),{description:e,priority:i,startDate:s,createdDate:c,scheduledDate:a,dueDate:o,doneDate:u,cancelledDate:l,recurrence:p,onCompletion:m,id:y,dependsOn:b,tags:te.extractHashtags(e)}}};function So(r){let e="",t=!0;for(;t;)e=Math.random().toString(36).substring(2,6+2),r.includes(e)||(t=!1);return e}function nl(r,e){return r.id!==""?r:new te(ce(K({},r),{id:So(e)}))}function Ov(r,e){let t=r;if(!r.dependsOn.includes(e.id)){let n=[...r.dependsOn,e.id];t=new te(ce(K({},r),{dependsOn:n}))}return t}function Dv(r,e){let t=r;if(r.dependsOn.includes(e.id)){let n=r.dependsOn.filter(i=>i!==e.id);t=new te(ce(K({},r),{dependsOn:n}))}return t}function Qn(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)"+Qn(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()}},_e=Xn;_e.empty="";var Rv=require("obsidian");var RN=20;function Mi(r){return _e.getInstance().removeAsWordFrom(r.description)}function MN(r,e){if(r==="")return e;let t=(0,Rv.prepareSimpleSearch)(r),n=-4;return e.map(a=>{let o=t(Mi(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 il(r,e,t,n,i){let s=MN(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,RN)}var Lm=5,CN=!0;globalThis.SHOW_DEPENDENCY_SUGGESTIONS=CN;function Mv(r){return globalThis.SHOW_DEPENDENCY_SUGGESTIONS&&r}function Um(r,e,t){let n=[r.startDateSymbol,r.scheduledDateSymbol,r.dueDateSymbol].join("|");return(i,s,a,o,u,l)=>{let c=[],{postfix:d,insertSkip:p}=AN(t,i,s),m={line:i,cursorPos:s,settings:a,dataviewMode:t,postfix:d,insertSkip:p};return c=c.concat(UN(n,e,m)),c=c.concat(WN(r.recurrenceSymbol,m)),Mv(u)&&(c=c.concat($N(r.idSymbol,o,m)),c=c.concat(jN(r.dependsOnSymbol,o,m,l))),c=c.concat(qN(r.onCompletionSymbol,e,m)),c=c.concat(PN(r,u,m)),c.length>0&&!c.some(y=>y.suggestionType==="match")&&(t||c.unshift({suggestionType:"empty",displayText:"\u23CE",appendText:`
`})),c=c.slice(0,a.autoSuggestMaxItems),c}}function AN(r,e,t){let n=YN(e.substring(0,t),[["(",")"],["[","]"]])=="("?")":"]",i=r?n+" ":" ",s=r&&e.length>t&&e.charAt(t)===n?1:0;return{postfix:i,insertSkip:s}}function PN(r,e,t){let n=[],i=t.line;Ci(n,i,r.dueDateSymbol,"due date"),Ci(n,i,r.startDateSymbol,"start date"),Ci(n,i,r.scheduledDateSymbol,"scheduled date"),NN(n,r,t),Ci(n,i,r.recurrenceSymbol,"recurring (repeat)"),IN(n,r,t),Mv(e)&&(Ci(n,i,r.idSymbol,"id"),Ci(n,i,r.dependsOnSymbol,"depends on id")),Ci(n,i,r.onCompletionSymbol,"on completion");let s=FN(n,t);return s.length===0&&t.settings.autoSuggestMinMatch===0?n:s}function Ci(r,e,t,n){e.includes(t)||r.push({displayText:`${t} ${n}`,appendText:`${t} `})}function NN(r,e,t){if(!(i=>Object.values(e.prioritySymbols).some(s=>s.length>0&&i.includes(s)))(t.line)){let i=e.prioritySymbols,s=["High","Medium","Low","Highest","Lowest"];for(let a of s){let o=i[a];r.push({displayText:t.dataviewMode?`${o} priority`:`${o} ${a.toLowerCase()} priority`,appendText:`${o}${t.postfix}`,insertSkip:t.dataviewMode?t.insertSkip:void 0})}}}function IN(r,e,t){if(!t.line.includes(e.createdDateSymbol)){let i=Ht.parseDate("today",!0).format(J.dateFormat);r.push({textToMatch:`${e.createdDateSymbol} created`,displayText:`${e.createdDateSymbol} created today (${i})`,appendText:`${e.createdDateSymbol} ${i}`+t.postfix,insertSkip:t.dataviewMode?t.insertSkip:void 0})}}function FN(r,e){let t=vs(/([a-zA-Z'_-]*)/g,e),n=[];if(t&&t.length>0){let i=t[0];if(i.length>=Math.max(1,e.settings.autoSuggestMinMatch)){let s=r.filter(a=>{var u;return((u=a.textToMatch)!=null?u:a.displayText).toLowerCase().includes(i.toLowerCase())});for(let a of s){let o=e.dataviewMode&&(a.displayText.includes("priority")||a.displayText.includes("created"))?i.length+e.insertSkip:i.length;n.push({suggestionType:"match",displayText:a.displayText,appendText:a.appendText,insertAt:t.index,insertSkip:o})}}}return n}function Cv(r,e){let t=`${e}`,n=`${r} ${e}`;return{displayText:t,appendText:n}}function LN(r,e){let n=`${Ht.parseDate(e,!0).format(J.dateFormat)}`,i=`${e} (${n})`,s=`${r} ${n}`;return{displayText:i,appendText:s}}function UN(r,e,t){let n=["today","tomorrow","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","next week","next month","next year"],i=[],s=new RegExp(`(${r})\\s*([0-9a-zA-Z ]*)`,"ug"),a=vs(s,t);if(a&&a.length>=2){let o=a[2];if(o.length<t.settings.autoSuggestMinMatch)return[];let u=o&&o.length>1?Ht.parseDate(Hu(o),!0):null;if(u!=null&&u.isValid()){let c=u.format(J.dateFormat);sl(t,a,[c],Cv,i)}let l=Wm(n,o,e,!0);sl(t,a,l,LN,i)}return i}function WN(r,e){var a;let t=["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"],n=[],i=new RegExp(`(${r})\\s*([0-9a-zA-Z ]*)`,"ug"),s=vs(i,e);if(s&&s.length>=2){let o=s[1],u=s[2];if(u.length<e.settings.autoSuggestMinMatch)return[];if(u.length>0){let p=(a=it.fromText({recurrenceRuleText:u,occurrence:new fr({startDate:null,scheduledDate:null,dueDate:null})}))==null?void 0:a.toText();if(p){let m=`${o} ${p}`+e.postfix;if(n.push({suggestionType:"match",displayText:`\u2705 ${p}`,appendText:m,insertAt:s.index,insertSkip:qm(s[0],e)}),s[0]==m)return[]}}let l=e.settings.autoSuggestMaxItems/2,c=Wm(t,u,l,!1);c.length===0&&u.trim().length===0&&(c=t.slice(0,l)),sl(e,s,c,(p,m)=>{let y=`${m}`,b=`${p} ${m}`;return{displayText:y,appendText:b}},n)}return n}function qN(r,e,t){let n=["delete","keep"],i=[],s=new RegExp(`(${r})\\s*([0-9a-zA-Z ]*)`,"ug"),a=vs(s,t);if(a&&a.length>=2){let o=a[2];if(o.length<t.settings.autoSuggestMinMatch)return[];let u=Wm(n,o,e,!0);sl(t,a,u,Cv,i)}return i}function $N(r,e,t){let n=[],i=new RegExp(`(${r})\\s*(${xi.source})?`,"ug"),s=vs(i,t);if(s&&s[0].trim().length<=r.length){let a=So(e.map(o=>o.id));n.push({suggestionType:"match",displayText:"generate unique id",appendText:`${r} ${a}`+t.postfix,insertAt:s.index,insertSkip:qm(s[0],t)})}return n}function jN(r,e,t,n){let i=[],s=t.dataviewMode?Qn("()[]"):Sv(),a=new RegExp(`(${r})([0-9a-zA-Z-_ ^,]*,)*([^,${s}]*)`,"ug"),o=vs(a,t);if(o&&o.length>=1){let u=o[2]||"",l=o[3],c=[];if(u){let d=u.split(",").map(p=>p.trim());c=e.filter(p=>p.id&&d.includes(p.id))}if(l.length>=t.settings.autoSuggestMinMatch){let d=il(l.trim(),e,n,[],c);for(let p of d)i.push({suggestionType:"match",displayText:`${p.descriptionWithoutTags} - From: ${p.filename}.md`,appendText:`${r}${u}`,insertAt:o.index,insertSkip:r.length+u.length+l.length,taskItDependsOn:p})}}return i}function Wm(r,e,t,n){let s=r.filter(a=>e&&e.length>=1&&a.toLowerCase().includes(e.toLowerCase())).slice(0,t);return n&&s.length===0&&(s=r.slice(0,t)),s}function sl(r,e,t,n,i){let s=e[1];for(let a of t){let{displayText:o,appendText:u}=n(s,a);i.push({suggestionType:"match",displayText:o,appendText:u+r.postfix,insertAt:e.index,insertSkip:qm(e[0],r)})}}function vs(r,e){let t=e.line.matchAll(r),n=e.cursorPos;for(let i of t)if((i==null?void 0:i.index)&&i.index<n&&n<=i.index+i[0].length)return i}function GN(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 YN(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 Av(r,e){return(t,n,i,s,a)=>GN(t.slice(0,n),e)?r(t,n,i,s,a):[]}function Pv(r,e,t){let n=_e.getInstance().includedIn(r),i=BN(t,e,n);return typeof i=="boolean"?i:n&&HN(r,e.ch)}function BN(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 HN(r,e){if(r.length===0)return!1;let t=te.extractTaskComponents(r);if(!t)return!1;let n=t.indentation+t.listMarker+" ["+t.status.symbol+"] ";return e>=n.length}function qm(r,e){return e.dataviewMode?r.length+e.insertSkip:r.length}function Pr(r){let e=["(?:",/(?=[^\]]+\])\[/,"|",/(?=[^)]+\))\(/,")",/ */,r,/ */,/[)\]]/,/(?: *,)?/,/$/].map(t=>t instanceof RegExp?t.source:t).join("");return new RegExp(e,r.flags)}var $m={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::",onCompletionSymbol:"onCompletion::",idSymbol:"id::",dependsOnSymbol:"dependsOn::",TaskFormatRegularExpressions:{priorityRegex:Pr(/priority:: *(highest|high|medium|low|lowest)/),startDateRegex:Pr(/start:: *(\d{4}-\d{2}-\d{2})/),createdDateRegex:Pr(/created:: *(\d{4}-\d{2}-\d{2})/),scheduledDateRegex:Pr(/scheduled:: *(\d{4}-\d{2}-\d{2})/),dueDateRegex:Pr(/due:: *(\d{4}-\d{2}-\d{2})/),doneDateRegex:Pr(/completion:: *(\d{4}-\d{2}-\d{2})/),cancelledDateRegex:Pr(/cancelled:: *(\d{4}-\d{2}-\d{2})/),recurrenceRegex:Pr(/repeat:: *([a-zA-Z0-9, !]+)/),onCompletionRegex:Pr(/onCompletion:: *([a-zA-Z]+)/),dependsOnRegex:Pr(new RegExp("dependsOn:: *("+Fm.source+")")),idRegex:Pr(new RegExp("id:: *("+xi.source+")"))}},al=class extends Ri{constructor(){super($m)}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 hr=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 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 xt[e]||"TODO"}static createUnknownStatus(e){return new hr(new Qe(e,"Unknown","x",!1,"TODO"))}static createFromImportedValue(e){let t=e[0],n=hr.getTypeFromStatusTypeString(e[3]);return new hr(new Qe(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 hr.tasksPluginCanCreateCommandsForStatuses()&&this.availableAsCommand&&(e=" Available as a command."),`- [${this.symbol}] => [${this.nextStatusSymbol}], name: '${this.name}', type: '${this.configuration.type}'.${e}`}static tasksPluginCanCreateCommandsForStatuses(){return!1}},re=hr;re.DONE=new hr(new Qe("x","Done"," ",!0,"DONE")),re.EMPTY=new hr(new Qe("","EMPTY","",!0,"EMPTY")),re.TODO=new hr(new Qe(" ","Todo","x",!0,"TODO")),re.CANCELLED=new hr(new Qe("-","Cancelled"," ",!0,"CANCELLED")),re.IN_PROGRESS=new hr(new Qe("/","In Progress","x",!0,"IN_PROGRESS")),re.NON_TASK=new hr(new Qe("Q","Non-Task","A",!0,"NON_TASK"));var ol=class{constructor(e=!1,t=!1,n=!1){this.ignoreSortInstructions=e,this.showTaskHiddenData=t,this.recordTimings=n}};var Le=class{constructor(){this.coreStatuses=[re.TODO.configuration,re.DONE.configuration],this.customStatuses=[re.IN_PROGRESS.configuration,re.CANCELLED.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 re(e);return t.findIndex(i=>new re(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,re.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 Nv=[{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 Nv.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 Nr={tasksPluginEmoji:{displayName:"Tasks Emoji Format",taskSerializer:new Ri(ko),buildSuggestions:Um(ko,Lm,!1)},dataview:{displayName:"Dataview",taskSerializer:new al,buildSuggestions:Av(Um($m,Lm,!0),[["(",")"],["[","]"]])}},Gm={globalQuery:"",globalFilter:"",removeGlobalFilter:!1,taskFormat:"tasksPluginEmoji",setCreatedDate:!1,setDoneDate:!0,setCancelledDate:!0,autoSuggestInEditor:!0,autoSuggestMinMatch:0,autoSuggestMaxItems:20,provideAccessKeys:!0,useFilenameAsScheduledDate:!1,filenameAsScheduledDateFormat:"",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"}}},Dn=K({},Gm);function jm(r,e){for(let t in r)e[t]===void 0&&(e[t]=r[t])}var X=()=>(jm(On.settingsFlags,Dn.features),jm(Gm.loggingOptions.minLevels,Dn.loggingOptions.minLevels),jm(Gm.debugSettings,Dn.debugSettings),Dn.statusSettings.customStatuses.forEach((r,e,t)=>{var i,s;let n=re.getTypeFromStatusTypeString(r.type);t[e]=new Qe((i=r.symbol)!=null?i:" ",r.name,(s=r.nextStatusSymbol)!=null?s:"x",r.availableAsCommand,n)}),K({},Dn)),ze=r=>(Dn=K(K({},Dn),r),X());var Ai=(r,e)=>(Dn.generalSettings[r]=e,X()),Iv=r=>{var e;return(e=Dn.features[r])!=null?e:!1};function Oo(){return Nr[X().taskFormat]}function ul(r){let t={"<":"&lt;",">":"&gt;","&":"&amp;",'"':"&quot;"}[r];return t!==void 0?t:r}function Fv(r){let e=[...r],t="";return e.forEach(n=>{t+=ul(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!==re.EMPTY.symbol)}static getInstance(){return De.instance||(De.instance=new De),De.instance}add(e){this.hasSymbol(e.symbol)||(e instanceof re?this._registeredStatuses.push(e):this._registeredStatuses.push(new re(e)))}bySymbol(e){return this.hasSymbol(e)?this.getSymbol(e):re.EMPTY}bySymbolOrCreate(e){return this.hasSymbol(e)?this.getSymbol(e):re.createUnknownStatus(e)}byName(e){return this._registeredStatuses.filter(({name:t})=>t===e).length>0?this._registeredStatuses.filter(({name:t})=>t===e)[0]:re.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 re.EMPTY}getNextStatusOrCreate(e){let t=this.getNextStatus(e);return t.type!=="EMPTY"?t:re.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 Qe(e.symbol,t,e.nextStatusSymbol,e.availableAsCommand,e.type);return new re(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(){[re.TODO,re.IN_PROGRESS,re.DONE,re.CANCELLED].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

classDef TODO        stroke:#f33,stroke-width:3px;
classDef DONE        stroke:#0c0,stroke-width:3px;
classDef IN_PROGRESS stroke:#fa0,stroke-width:3px;
classDef CANCELLED   stroke:#ddd,stroke-width:3px;
classDef NON_TASK    stroke:#99e,stroke-width:3px;

${i.join(`
`)}
${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=Fv(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 Lv=require("obsidian");var tn=class{constructor(e,t){this.name=e,this.sortOrder=t}get groupText(){return this.name!==""?`%%${this.sortOrder}%% ${this.name}`:""}};var pt=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 Lv.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 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 zN=require("obsidian"),$v=pa(qv());var Ym=class extends $v.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 Bm(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)}},Rt=new Ym,Bm=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 Hm(r,e){let t=Rt.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 _t=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),{filenameAsScheduledDateFormat:s}=X();if(s!==""){let o=window.moment(i,s,!0);if(o.isValid())return o}let a=/(\d{4})-(\d{2})-(\d{2})/.exec(i);if(a||(a=/(\d{4})(\d{2})(\d{2})/.exec(i)),a){let o=window.moment([parseInt(a[1]),parseInt(a[2])-1,parseInt(a[3])]);if(o.isValid())return o}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 te(ce(K({},e),{taskLocation: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 te(ce(K({},i),{scheduledDateIsInferred:!1}))),i))}};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}},Rn=Ir;Rn.dueCoefficient=12,Rn.scheduledCoefficient=5,Rn.startedCoefficient=-3,Rn.priorityCoefficient=6,Rn.milliSecondsPerDay=1e3*60*60*24;var te=class extends Xi{constructor({status:t,description:n,taskLocation:i,indentation:s,listMarker:a,priority:o,createdDate:u,startDate:l,scheduledDate:c,dueDate:d,doneDate:p,cancelledDate:m,recurrence:y,onCompletion:b,dependsOn:k,id:_,blockLink:R,tags:S,originalMarkdown:F,scheduledDateIsInferred:q,parent:ne=null}){super(F,ne);this._urgency=null;this.status=t,this.description=n,this.indentation=s,this.listMarker=a,this.taskLocation=i,this.tags=S,this.priority=o,this.createdDate=u,this.startDate=l,this.scheduledDate=c,this.dueDate=d,this.doneDate=p,this.cancelledDate=m,this.recurrence=y,this.onCompletion=b,this.dependsOn=k,this.id=_,this.blockLink=R,this.scheduledDateIsInferred=q}static fromLine({line:t,taskLocation:n,fallbackDate:i}){let s=te.extractTaskComponents(t);return s===null||!_e.getInstance().includedIn(s.body)?null:te.parseTaskSignifiers(t,n,i)}static parseTaskSignifiers(t,n,i){let s=te.extractTaskComponents(t);if(s===null)return null;let{taskSerializer:a}=Oo(),o=a.deserialize(s.body),u=!1;return _t.canApplyFallback(o)&&i!==null&&(o.scheduledDate=i,u=!0),o.tags=o.tags.map(l=>l.trim()),o.tags=o.tags.filter(l=>!_e.getInstance().equals(l)),new te(ce(K(K({},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=Rt.getLogger("tasks.Task"),n="toggle()";ll(t,n,this);let i=De.getInstance().getNextStatusOrCreate(this.status),s=this.handleNewStatus(i);return cl(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=new te(ce(K({},this),{status:t,doneDate:s,cancelledDate:o})),l=!t.isCompleted(),c=this.status.isCompleted(),d=this.recurrence===null;if(l||c||d)return[u];let m=this.recurrence.next(n);return m===null?[u]:[this.createNextOccurrence(t,m),u]}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 te(ce(K(K({},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()){Rt.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 n=Ev(this,t),{recurrenceOnNextLine:i}=X();return i?n.reverse():n}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=xn.priorityNameUsingNormal(this.priority);return`%%${this.priority}%%${t} priority`}get descriptionWithoutTags(){return this.description.replace(J.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 pt(this.cancelledDate)}get created(){return new pt(this.createdDate)}get done(){return new pt(this.doneDate)}get due(){return new pt(this.dueDate)}get scheduled(){return new pt(this.scheduledDate)}get start(){return new pt(this.startDate)}get happensDates(){return Array.of(this.startDate,this.scheduledDate,this.dueDate)}get happens(){let t=this.happensDates,n=Array.from(t).sort(dr);for(let i of n)if(i!=null&&i.isValid())return new pt(i);return new pt(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 i,s;let n=["description","path","indentation","listMarker","lineNumber","sectionStart","sectionIndex","precedingHeader","priority","blockLink","scheduledDateIsInferred","id","dependsOn","onCompletion"];for(let a of n)if(((i=this[a])==null?void 0:i.toString())!==((s=t[a])==null?void 0:s.toString()))return!1;if(!this.status.identicalTo(t.status)||this.tags.length!==t.tags.length||!this.tags.every(function(a,o){return a===t.tags[o]}))return!1;n=te.allDateFields();for(let a of n){let o=this[a],u=t[a];if(dr(o,u)!==0)return!1}return this.recurrenceIdenticalTo(t)?this.file.rawFrontmatterIdenticalTo(t.file):!1}recurrenceIdenticalTo(t){let n=this.recurrence,i=t.recurrence;return!(n===null&&i!==null||n!==null&&i===null||n&&i&&!n.identicalTo(i))}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 mt=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 mt(e,0,0,0,null)}fromRenamedFile(e){return new mt(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 KN(r,e,t,n,i,s){var y,b;let a=new ot(r,i),o=[],u=e.split(`
`),l=u.length,c=new Do(()=>_t.fromPath(r)),d=null,p=0,m=new Map;for(let k of t)if(k.task!==void 0){let _=k.position.start.line;if(_>=l)return n.debug(`${r} Obsidian gave us a line number ${_} past the end of the file. ${l}.`),o;if((d===null||d.position.end.line<_)&&(d=ks.getSection(_,i.sections),p=0),d===null)continue;let R=u[_];if(R===void 0){n.debug(`${r}: line ${_} - ignoring 'undefined' line.`);continue}let S;try{if(S=te.fromLine({line:R,taskLocation:new mt(a,_,d.position.start.line,p,ks.getPrecedingHeader(_,i.headings)),fallbackDate:c.value}),S!==null){let F=(y=m.get(k.parent))!=null?y:null;F!==null&&(S=new te(ce(K({},S),{parent:F}))),m.set(_,S)}}catch(F){s(F,r,k,R);continue}S!==null&&(p++,o.push(S))}else{let _=k.position.start.line,R=(b=m.get(k.parent))!=null?b:null;m.set(_,new Xi(u[_],R))}return o}var ks=class{constructor({metadataCache:e,vault:t,workspace:n,events:i}){this.logger=Rt.getLogger("tasks.Cache");this.logger.debug("Creating Cache object"),this.metadataCache=e,this.metadataCacheEventReferences=[],this.vault=t,this.workspace=n,this.vaultEventReferences=[],this.events=i,this.eventsEventReferences=[],this.tasksMutex=new Zo,this.state="Cold",this.logger.debug("Cache.constructor(): state = Cold"),this.tasks=[],this.loadedAfterFirstResolve=!1,this.subscribeToCache(),this.workspace.onLayoutReady(()=>{this.subscribeToVault(),this.loadVault()}),this.subscribeToEvents()}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",()=>P(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 ws.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 ws.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 ws.TFile&&(this.logger.debug(`Cache.subscribeToVault.renamedEventReference() ${s.path}`),this.tasksMutex.runExclusive(()=>{let o=this.metadataCache.getFileCache(s),u=new ot(s.path,o!=null?o:void 0),l=new Do(()=>_t.fromPath(s.path));this.tasks=this.tasks.map(c=>{if(c.path!==a)return c;let d=c.taskLocation.fromRenamedFile(u);return e?_t.updateTaskPath(c,d,l.value):new te(ce(K({},c),{taskLocation:d}))}),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(()=>P(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 P(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)}te.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 KN(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}
Line number: ${n.position.start.line}
Task line: ${i}

Please create a bug report for this message at
https://github.com/obsidian-tasks-group/obsidian-tasks/issues/new/choose
to help us find and fix the underlying issue.

Include:
- either a screenshot of the error popup, or copy the text from the console, if on a desktop machine.
- the output from running the Obsidian command 'Show debug info'

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 ws.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 hh=require("obsidian");var qw=require("obsidian");function Ue(){}function Qm(r){return r()}function jv(){return Object.create(null)}function Ut(r){r.forEach(Qm)}function pl(r){return typeof r=="function"}function rn(r,e){return r!=r?e==e:r!==e||r&&typeof r=="object"||typeof r=="function"}function Gv(r){return Object.keys(r).length===0}var Yv=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global,Ro=class{constructor(e){this.options=e,this._listeners="WeakMap"in Yv?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 Yv?new WeakMap:void 0;var Bv=!1;function QN(){Bv=!0}function XN(){Bv=!1}function U(r,e){r.appendChild(e)}function fe(r,e,t){r.insertBefore(e,t||null)}function oe(r){r.parentNode&&r.parentNode.removeChild(r)}function Ii(r,e){for(let t=0;t<r.length;t+=1)r[t]&&r[t].d(e)}function Q(r){return document.createElement(r)}function ZN(r){return document.createElementNS("http://www.w3.org/2000/svg",r)}function Me(r){return document.createTextNode(r)}function ue(){return Me(" ")}function Hv(){return Me("")}function xe(r,e,t,n){return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}function Vv(r){return function(e){return e.preventDefault(),r.call(this,e)}}function W(r,e,t){t==null?r.removeAttribute(e):r.getAttribute(e)!==t&&r.setAttribute(e,t)}function zv(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 JN(r){return Array.from(r.childNodes)}function Fr(r,e){e=""+e,r.data!==e&&(r.data=e)}function yr(r,e){r.value=e==null?"":e}function Xm(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 Kv(r){let e=r.querySelector(":checked");return e&&e.__value}var dl;function eI(){if(dl===void 0){dl=!1;try{typeof window!="undefined"&&window.parent&&window.parent.document}catch(r){dl=!0}}return dl}function Qv(r,e){getComputedStyle(r).position==="static"&&(r.style.position="relative");let n=Q("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=eI(),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()}),U(r,n),()=>{(i||s&&n.contentWindow)&&s(),oe(n)}}function Mn(r,e,t){r.classList[t?"add":"remove"](e)}var Ds=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=ZN(t.nodeName):this.e=Q(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)fe(this.t,this.n[t],e)}p(e){this.d(),this.h(e),this.i(this.a)}d(){this.n.forEach(oe)}};var Mo;function xo(r){Mo=r}function tI(){if(!Mo)throw new Error("Function called outside component initialization");return Mo}function Zm(r){tI().$$.on_mount.push(r)}var Ss=[];var je=[],Os=[],zm=[],rI=Promise.resolve(),Km=!1;function nI(){Km||(Km=!0,rI.then(Xv))}function Ni(r){Os.push(r)}function Mt(r){zm.push(r)}var Vm=new Set,Es=0;function Xv(){if(Es!==0)return;let r=Mo;do{try{for(;Es<Ss.length;){let e=Ss[Es];Es++,xo(e),iI(e.$$)}}catch(e){throw Ss.length=0,Es=0,e}for(xo(null),Ss.length=0,Es=0;je.length;)je.pop()();for(let e=0;e<Os.length;e+=1){let t=Os[e];Vm.has(t)||(Vm.add(t),t())}Os.length=0}while(Ss.length);for(;zm.length;)zm.pop()();Km=!1,Vm.clear(),xo(r)}function iI(r){if(r.fragment!==null){r.update(),Ut(r.before_update);let e=r.dirty;r.dirty=[-1],r.fragment&&r.fragment.p(r.ctx,e),r.after_update.forEach(Ni)}}function sI(r){let e=[],t=[];Os.forEach(n=>r.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),Os=e}var fl=new Set,Pi;function Zv(){Pi={r:0,c:[],p:Pi}}function Jv(){Pi.r||Ut(Pi.c),Pi=Pi.p}function Wt(r,e){r&&r.i&&(fl.delete(r),r.i(e))}function Qt(r,e,t,n){if(r&&r.o){if(fl.has(r))return;fl.add(r),Pi.c.push(()=>{fl.delete(r),n&&(t&&r.d(1),n())}),r.o(e)}else n&&n()}var aI=["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"],yG=new Set([...aI]);function Ct(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 Tr(r,e,t,n){let{fragment:i,after_update:s}=r.$$;i&&i.m(e,t),n||Ni(()=>{let a=r.$$.on_mount.map(Qm).filter(pl);r.$$.on_destroy?r.$$.on_destroy.push(...a):Ut(a),r.$$.on_mount=[]}),s.forEach(Ni)}function Xt(r,e){let t=r.$$;t.fragment!==null&&(sI(t.after_update),Ut(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function oI(r,e){r.$$.dirty[0]===-1&&(Ss.push(r),nI(),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:jv(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(u?u.$$.context:[])),callbacks:jv(),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 y=m.length?m[0]:p;return l.ctx&&i(l.ctx[d],l.ctx[d]=y)&&(!l.skip_bound&&l.bound[d]&&l.bound[d](y),c&&oI(r,d)),p}):[],l.update(),c=!0,Ut(l.before_update),l.fragment=n?n(l.ctx):!1,e.target){if(e.hydrate){QN();let d=JN(e.target);l.fragment&&l.fragment.l(d),d.forEach(oe)}else l.fragment&&l.fragment.c();e.intro&&Wt(r.$$.fragment),Tr(r,e.target,e.anchor,e.customElement),XN(),Xv()}xo(u)}var uI;typeof HTMLElement=="function"&&(uI=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){let{on_mount:r}=this.$$;this.$$.on_disconnect=r.map(Qm).filter(pl);for(let e in this.$$.slotted)this.appendChild(this.$$.slotted[e])}attributeChangedCallback(r,e,t){this[r]=t}disconnectedCallback(){Ut(this.$$.on_disconnect)}$destroy(){Xt(this,1),this.$destroy=Ue}$on(r,e){if(!pl(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&&!Gv(r)&&(this.$$.skip_bound=!0,this.$$set(r),this.$$.skip_bound=!1)}});var gr=class{$destroy(){Xt(this,1),this.$destroy=Ue}$on(e,t){if(!pl(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&&!Gv(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}};function ew(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 xs(r){return r.charAt(0).toUpperCase()+r.slice(1)}function ht(r,e){if(e===null)return xs(r);let t=r.toLowerCase().indexOf(e.toLowerCase());if(t===-1)return`${xs(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=xs(n),n}function lI(r){let e,t=ht(r[2],r[4])+"",n,i,s,a,o,u,l,c,d;return{c(){e=Q("label"),n=ue(),i=Q("input"),s=ue(),a=Q("code"),o=Me(r[3]),u=ue(),l=new Ds(!1),W(e,"for",r[2]),W(i,"id",r[2]),W(i,"type","text"),W(i,"class","tasks-modal-date-input"),W(i,"placeholder",cI),W(i,"accesskey",r[4]),Mn(i,"tasks-modal-error",!r[1]),l.a=null,W(a,"class","tasks-modal-parsed-date")},m(p,m){fe(p,e,m),e.innerHTML=t,fe(p,n,m),fe(p,i,m),yr(i,r[0]),fe(p,s,m),fe(p,a,m),U(a,o),U(a,u),l.m(r[5],a),c||(d=xe(i,"input",r[7]),c=!0)},p(p,[m]){m&20&&t!==(t=ht(p[2],p[4])+"")&&(e.innerHTML=t),m&4&&W(e,"for",p[2]),m&4&&W(i,"id",p[2]),m&16&&W(i,"accesskey",p[4]),m&1&&i.value!==p[0]&&yr(i,p[0]),m&2&&Mn(i,"tasks-modal-error",!p[1]),m&8&&Fr(o,p[3]),m&32&&l.p(p[5])},i:Ue,o:Ue,d(p){p&&oe(e),p&&oe(n),p&&oe(i),p&&oe(s),p&&oe(a),c=!1,d()}}}var cI="Try 'Mon' or 'tm' then space";function dI(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=Hu(s)),t(5,l=L_(n,s,o)),t(1,a=!l.includes("invalid"))}},[s,a,n,i,u,l,o,c]}var Jm=class extends gr{constructor(e){super(),nn(this,e,dI,lI,rn,{id:2,dateSymbol:3,date:0,isDateValid:1,forwardOnly:6,accesskey:4})}},Fi=Jm;var Li=Math.min,qt=Math.max,Ao=Math.round;var Cn=r=>({x:r,y:r}),fI={left:"right",right:"left",bottom:"top",top:"bottom"},pI={start:"end",end:"start"};function eh(r,e,t){return qt(r,Li(e,t))}function Rs(r,e){return typeof r=="function"?r(e):r}function An(r){return r.split("-")[0]}function Ms(r){return r.split("-")[1]}function th(r){return r==="x"?"y":"x"}function rh(r){return r==="y"?"height":"width"}function Cs(r){return["top","bottom"].includes(An(r))?"y":"x"}function nh(r){return th(Cs(r))}function tw(r,e,t){t===void 0&&(t=!1);let n=Ms(r),i=nh(r),s=rh(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 rw(r){let e=Co(r);return[ml(r),e,ml(e)]}function ml(r){return r.replace(/start|end/g,e=>pI[e])}function mI(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 nw(r,e,t,n){let i=Ms(r),s=mI(An(r),t==="start",n);return i&&(s=s.map(a=>a+"-"+i),e&&(s=s.concat(s.map(ml)))),s}function Co(r){return r.replace(/left|right|bottom|top/g,e=>fI[e])}function hI(r){return K({top:0,right:0,bottom:0,left:0},r)}function iw(r){return typeof r!="number"?hI(r):{top:r,right:r,bottom:r,left:r}}function Ui(r){return ce(K({},r),{top:r.y,left:r.x,right:r.x+r.width,bottom:r.y+r.height})}function sw(r,e,t){let{reference:n,floating:i}=r,s=Cs(e),a=nh(e),o=rh(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(Ms(e)){case"start":m[a]-=p*(t&&l?-1:1);break;case"end":m[a]+=p*(t&&l?-1:1);break}return m}var aw=(r,e,t)=>P(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}=sw(l,n,u),p=n,m={},y=0;for(let b=0;b<o.length;b++){let{name:k,fn:_}=o[b],{x:R,y:S,data:F,reset:q}=yield _({x:c,y:d,initialPlacement:n,placement:p,strategy:i,middlewareData:m,rects:l,platform:a,elements:{reference:r,floating:e}});if(c=R!=null?R:c,d=S!=null?S:d,m=ce(K({},m),{[k]:K(K({},m[k]),F)}),q&&y<=50){y++,typeof q=="object"&&(q.placement&&(p=q.placement),q.rects&&(l=q.rects===!0?yield a.getElementRects({reference:r,floating:e,strategy:i}):q.rects),{x:c,y:d}=sw(l,p,u)),b=-1;continue}}return{x:c,y:d,placement:p,strategy:i,middlewareData:m}});function hl(r,e){return P(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}=Rs(e,r),y=iw(m),k=o[p?d==="floating"?"reference":"floating":d],_=Ui(yield s.getClippingRect({element:(t=yield s.isElement==null?void 0:s.isElement(k))==null||t?k:k.contextElement||(yield s.getDocumentElement==null?void 0:s.getDocumentElement(o.floating)),boundary:l,rootBoundary:c,strategy:u})),R=d==="floating"?ce(K({},a.floating),{x:n,y:i}):a.reference,S=yield s.getOffsetParent==null?void 0:s.getOffsetParent(o.floating),F=(yield s.isElement==null?void 0:s.isElement(S))?(yield s.getScale==null?void 0:s.getScale(S))||{x:1,y:1}:{x:1,y:1},q=Ui(s.convertOffsetParentRelativeRectToViewportRelativeRect?yield s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:R,offsetParent:S,strategy:u}):R);return{top:(_.top-q.top+y.top)/F.y,bottom:(q.bottom-_.bottom+y.bottom)/F.y,left:(_.left-q.left+y.left)/F.x,right:(q.right-_.right+y.right)/F.x}})}var ih=function(r){return r===void 0&&(r={}),{name:"flip",options:r,fn(t){return P(this,null,function*(){var n,i;let{placement:s,middlewareData:a,rects:o,initialPlacement:u,platform:l,elements:c}=t,D=Rs(r,t),{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:k=!0}=D,_=Xo(D,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((n=a.arrow)!=null&&n.alignmentOffset)return{};let R=An(s),S=An(u)===u,F=yield l.isRTL==null?void 0:l.isRTL(c.floating),q=m||(S||!k?[Co(u)]:rw(u));!m&&b!=="none"&&q.push(...nw(u,k,b,F));let ne=[u,...q],G=yield hl(t,_),B=[],he=((i=a.flip)==null?void 0:i.overflows)||[];if(d&&B.push(G[R]),p){let Y=tw(s,o,F);B.push(G[Y[0]],G[Y[1]])}if(he=[...he,{placement:s,overflows:B}],!B.every(Y=>Y<=0)){var Pe,j;let Y=(((Pe=a.flip)==null?void 0:Pe.index)||0)+1,I=ne[Y];if(I)return{data:{index:Y,overflows:he},reset:{placement:I}};let Z=(j=he.filter(f=>f.overflows[0]<=0).sort((f,h)=>f.overflows[1]-h.overflows[1])[0])==null?void 0:j.placement;if(!Z)switch(y){case"bestFit":{var $;let f=($=he.map(h=>[h.placement,h.overflows.filter(g=>g>0).reduce((g,T)=>g+T,0)]).sort((h,g)=>h[1]-g[1])[0])==null?void 0:$[0];f&&(Z=f);break}case"initialPlacement":Z=u;break}if(s!==Z)return{reset:{placement:Z}}}return{}})}}};function gI(r,e){return P(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=Ms(t),u=Cs(t)==="y",l=["left","top"].includes(a)?-1:1,c=s&&u?-1:1,d=Rs(e,r),{mainAxis:p,crossAxis:m,alignmentAxis:y}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:K({mainAxis:0,crossAxis:0,alignmentAxis:null},d);return o&&typeof y=="number"&&(m=o==="end"?y*-1:y),u?{x:m*c,y:p*l}:{x:p*l,y:m*c}})}var gl=function(r){return r===void 0&&(r=0),{name:"offset",options:r,fn(t){return P(this,null,function*(){var n,i;let{x:s,y:a,placement:o,middlewareData:u}=t,l=yield gI(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:ce(K({},l),{placement:o})}})}}},yl=function(r){return r===void 0&&(r={}),{name:"shift",options:r,fn(t){return P(this,null,function*(){let{x:n,y:i,placement:s}=t,_=Rs(r,t),{mainAxis:a=!0,crossAxis:o=!1,limiter:u={fn:R=>{let{x:S,y:F}=R;return{x:S,y:F}}}}=_,l=Xo(_,["mainAxis","crossAxis","limiter"]),c={x:n,y:i},d=yield hl(t,l),p=Cs(An(s)),m=th(p),y=c[m],b=c[p];if(a){let R=m==="y"?"top":"left",S=m==="y"?"bottom":"right",F=y+d[R],q=y-d[S];y=eh(F,y,q)}if(o){let R=p==="y"?"top":"left",S=p==="y"?"bottom":"right",F=b+d[R],q=b-d[S];b=eh(F,b,q)}let k=u.fn(ce(K({},t),{[m]:y,[p]:b}));return ce(K({},k),{data:{x:k.x-n,y:k.y-i}})})}}};var sh=function(r){return r===void 0&&(r={}),{name:"size",options:r,fn(t){return P(this,null,function*(){let{placement:n,rects:i,platform:s,elements:a}=t,G=Rs(r,t),{apply:o=()=>{}}=G,u=Xo(G,["apply"]),l=yield hl(t,u),c=An(n),d=Ms(n),p=Cs(n)==="y",{width:m,height:y}=i.floating,b,k;c==="top"||c==="bottom"?(b=c,k=d===((yield s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(k=c,b=d==="end"?"top":"bottom");let _=y-l[b],R=m-l[k],S=!t.middlewareData.shift,F=_,q=R;if(p){let B=m-l.left-l.right;q=d||S?Li(R,B):B}else{let B=y-l.top-l.bottom;F=d||S?Li(_,B):B}if(S&&!d){let B=qt(l.left,0),he=qt(l.right,0),Pe=qt(l.top,0),j=qt(l.bottom,0);p?q=m-2*(B!==0||he!==0?B+he:qt(l.left,l.right)):F=y-2*(Pe!==0||j!==0?Pe+j:qt(l.top,l.bottom))}yield o(ce(K({},t),{availableWidth:q,availableHeight:F}));let ne=yield s.getDimensions(a.floating);return m!==ne.width||y!==ne.height?{reset:{rects:!0}}:{}})}}};function Pn(r){return uw(r)?(r.nodeName||"").toLowerCase():"#document"}function $t(r){var e;return(r==null||(e=r.ownerDocument)==null?void 0:e.defaultView)||window}function Nn(r){var e;return(e=(uw(r)?r.ownerDocument:r.document)||window.document)==null?void 0:e.documentElement}function uw(r){return r instanceof Node||r instanceof $t(r).Node}function sn(r){return r instanceof Element||r instanceof $t(r).Element}function Ur(r){return r instanceof HTMLElement||r instanceof $t(r).HTMLElement}function ow(r){return typeof ShadowRoot=="undefined"?!1:r instanceof ShadowRoot||r instanceof $t(r).ShadowRoot}function As(r){let{overflow:e,overflowX:t,overflowY:n,display:i}=Zt(r);return/auto|scroll|overlay|hidden|clip/.test(e+n+t)&&!["inline","contents"].includes(i)}function lw(r){return["table","td","th"].includes(Pn(r))}function bl(r){let e=_l(),t=Zt(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 cw(r){let e=Wi(r);for(;Ur(e)&&!Po(e);){if(bl(e))return e;e=Wi(e)}return null}function _l(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Po(r){return["html","body","#document"].includes(Pn(r))}function Zt(r){return $t(r).getComputedStyle(r)}function No(r){return sn(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||ow(r)&&r.host||Nn(r);return ow(e)?e.host:e}function dw(r){let e=Wi(r);return Po(e)?r.ownerDocument?r.ownerDocument.body:r.body:Ur(e)&&As(e)?e:dw(e)}function Tl(r,e,t){var n;e===void 0&&(e=[]),t===void 0&&(t=!0);let i=dw(r),s=i===((n=r.ownerDocument)==null?void 0:n.body),a=$t(i);return s?e.concat(a,a.visualViewport||[],As(i)?i:[],a.frameElement&&t?Tl(a.frameElement):[]):e.concat(i,Tl(i,[],t))}function mw(r){let e=Zt(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 hw(r){return sn(r)?r:r.contextElement}function Ps(r){let e=hw(r);if(!Ur(e))return Cn(1);let t=e.getBoundingClientRect(),{width:n,height:i,$:s}=mw(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 yI=Cn(0);function gw(r){let e=$t(r);return!_l()||!e.visualViewport?yI:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function TI(r,e,t){return e===void 0&&(e=!1),!t||e&&t!==$t(r)?!1:e}function Io(r,e,t,n){e===void 0&&(e=!1),t===void 0&&(t=!1);let i=r.getBoundingClientRect(),s=hw(r),a=Cn(1);e&&(n?sn(n)&&(a=Ps(n)):a=Ps(r));let o=TI(s,t,n)?gw(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=$t(s),m=n&&sn(n)?$t(n):n,y=p.frameElement;for(;y&&n&&m!==p;){let b=Ps(y),k=y.getBoundingClientRect(),_=Zt(y),R=k.left+(y.clientLeft+parseFloat(_.paddingLeft))*b.x,S=k.top+(y.clientTop+parseFloat(_.paddingTop))*b.y;u*=b.x,l*=b.y,c*=b.x,d*=b.y,u+=R,l+=S,y=$t(y).frameElement}}return Ui({width:c,height:d,x:u,y:l})}function bI(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"||As(s))&&(a=No(t)),Ur(t))){let l=Io(t);o=Ps(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 _I(r){return Array.from(r.getClientRects())}function yw(r){return Io(Nn(r)).left+No(r).scrollLeft}function vI(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+yw(r),o=-t.scrollTop;return Zt(n).direction==="rtl"&&(a+=qt(e.clientWidth,n.clientWidth)-i),{width:i,height:s,x:a,y:o}}function wI(r,e){let t=$t(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=_l();(!l||l&&e==="fixed")&&(o=i.offsetLeft,u=i.offsetTop)}return{width:s,height:a,x:o,y:u}}function kI(r,e){let t=Io(r,!0,e==="fixed"),n=t.top+r.clientTop,i=t.left+r.clientLeft,s=Ur(r)?Ps(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 fw(r,e,t){let n;if(e==="viewport")n=wI(r,t);else if(e==="document")n=vI(Nn(r));else if(sn(e))n=kI(e,t);else{let i=gw(r);n=ce(K({},e),{x:e.x-i.x,y:e.y-i.y})}return Ui(n)}function Tw(r,e){let t=Wi(r);return t===e||!sn(t)||Po(t)?!1:Zt(t).position==="fixed"||Tw(t,e)}function EI(r,e){let t=e.get(r);if(t)return t;let n=Tl(r,[],!1).filter(o=>sn(o)&&Pn(o)!=="body"),i=null,s=Zt(r).position==="fixed",a=s?Wi(r):r;for(;sn(a)&&!Po(a);){let o=Zt(a),u=bl(a);!u&&o.position==="fixed"&&(i=null),(s?!u&&!i:!u&&o.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||As(a)&&!u&&Tw(r,a))?n=n.filter(c=>c!==a):i=o,a=Wi(a)}return e.set(r,n),n}function SI(r){let{element:e,boundary:t,rootBoundary:n,strategy:i}=r,a=[...t==="clippingAncestors"?EI(e,this._c):[].concat(t),n],o=a[0],u=a.reduce((l,c)=>{let d=fw(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},fw(e,o,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function OI(r){return mw(r)}function DI(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"||As(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=yw(i));return{x:a.left+o.scrollLeft-u.x,y:a.top+o.scrollTop-u.y,width:a.width,height:a.height}}function pw(r,e){return!Ur(r)||Zt(r).position==="fixed"?null:e?e(r):r.offsetParent}function bw(r,e){let t=$t(r);if(!Ur(r))return t;let n=pw(r,e);for(;n&&lw(n)&&Zt(n).position==="static";)n=pw(n,e);return n&&(Pn(n)==="html"||Pn(n)==="body"&&Zt(n).position==="static"&&!bl(n))?t:n||cw(r)||t}var xI=function(r){return P(this,null,function*(){let{reference:e,floating:t,strategy:n}=r,i=this.getOffsetParent||bw,s=this.getDimensions;return{reference:DI(e,yield i(t),n),floating:K({x:0,y:0},yield s(t))}})};function RI(r){return Zt(r).direction==="rtl"}var MI={convertOffsetParentRelativeRectToViewportRelativeRect:bI,getDocumentElement:Nn,getClippingRect:SI,getOffsetParent:bw,getElementRects:xI,getClientRects:_I,getDimensions:OI,getScale:Ps,isElement:sn,isRTL:RI};var ah=(r,e,t)=>{let n=new Map,i=K({platform:MI},t),s=ce(K({},i.platform),{_c:n});return aw(r,e,ce(K({},i),{platform:s}))};function _w(r,e,t){let n=r.slice();return n[5]=e[t],n}function vw(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 ww(r){let e,t,n,i=r[10],s=[];for(let a=0;a<i.length;a+=1)s[a]=Ew(vw(r,i,a));return{c(){e=Q("ul");for(let a=0;a<s.length;a+=1)s[a].c();W(e,"class","task-dependency-dropdown")},m(a,o){fe(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=vw(a,i,u);s[u]?s[u].p(l,o):(s[u]=Ew(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&&oe(e),Ii(s,a),r[31](null),t=!1,n()}}}function kw(r){let e,t=r[41]+"",n,i,s;function a(...o){return r[28](r[41],...o)}return{c(){e=Q("div"),n=Me(t),W(e,"class","dependency-path")},m(o,u){fe(o,e,u),U(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&&oe(e),i=!1,s()}}}function Ew(r){let e,t,n,i=r[40].status.symbol+"",s,a,o=Mi(r[40])+"",u,l,c,d,p,m;function y(...R){return r[27](r[40],...R)}let b=r[41]&&kw(r);function k(){return r[29](r[40])}function _(){return r[30](r[43])}return{c(){e=Q("li"),t=Q("div"),n=Me("["),s=Me(i),a=Me("] "),u=Me(o),c=ue(),b&&b.c(),d=ue(),W(t,"class",l=r[41]?"dependency-name-shared":"dependency-name"),Mn(e,"selected",r[6]!==null&&r[43]===r[11])},m(R,S){fe(R,e,S),U(e,t),U(t,n),U(t,s),U(t,a),U(t,u),U(e,c),b&&b.m(e,null),U(e,d),p||(m=[xe(t,"mouseenter",y),xe(e,"mousedown",k),xe(e,"mouseenter",_)],p=!0)},p(R,S){r=R,S[0]&1024&&i!==(i=r[40].status.symbol+"")&&Fr(s,i),S[0]&1024&&o!==(o=Mi(r[40])+"")&&Fr(u,o),S[0]&1024&&l!==(l=r[41]?"dependency-name-shared":"dependency-name")&&W(t,"class",l),r[41]?b?b.p(r,S):(b=kw(r),b.c(),b.m(e,d)):b&&(b.d(1),b=null),S[0]&2112&&Mn(e,"selected",r[6]!==null&&r[43]===r[11])},d(R){R&&oe(e),b&&b.d(),p=!1,Ut(m)}}}function Sw(r){let e,t=r[0][r[1]],n=[];for(let i=0;i<t.length;i+=1)n[i]=Ow(_w(r,t,i));return{c(){e=Q("div");for(let i=0;i<n.length;i+=1)n[i].c();W(e,"class","task-dependencies-container results-dependency")},m(i,s){fe(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=_w(i,t,a);n[a]?n[a].p(o,s):(n[a]=Ow(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&&oe(e),Ii(n,i)}}}function Ow(r){let e,t,n,i=r[5].status.symbol+"",s,a,o=Mi(r[5])+"",u,l,c,d,p,m;function y(){return r[33](r[5])}function b(...k){return r[34](r[5],...k)}return{c(){e=Q("div"),t=Q("span"),n=Me("["),s=Me(i),a=Me("] "),u=Me(o),l=ue(),c=Q("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=ue(),W(t,"class","task-dependency-name"),W(c,"type","button"),W(c,"class","task-dependency-delete"),W(e,"class","task-dependency")},m(k,_){fe(k,e,_),U(e,t),U(t,n),U(t,s),U(t,a),U(t,u),U(e,l),U(e,c),U(e,d),p||(m=[xe(c,"click",y),xe(e,"mouseenter",b)],p=!0)},p(k,_){r=k,_[0]&3&&i!==(i=r[5].status.symbol+"")&&Fr(s,i),_[0]&3&&o!==(o=Mi(r[5])+"")&&Fr(u,o)},d(k){k&&oe(e),p=!1,Ut(m)}}}function CI(r){let e,t=ht(r[2],r[3])+"",n,i,s,a,o,u,l,c,d,p=r[10]&&r[10].length!==0&&ww(r),m=r[0][r[1]].length!==0&&Sw(r);return{c(){e=Q("label"),n=ue(),i=Q("span"),s=Q("input"),o=ue(),p&&p.c(),u=ue(),m&&m.c(),l=Hv(),W(e,"for",r[1]),W(s,"accesskey",r[3]),W(s,"id",r[1]),W(s,"class","tasks-modal-dependency-input"),W(s,"type","text"),W(s,"placeholder",r[4]),Ni(()=>r[26].call(i))},m(y,b){fe(y,e,b),e.innerHTML=t,fe(y,n,b),fe(y,i,b),U(i,s),r[22](s),yr(s,r[6]),a=Qv(i,r[26].bind(i)),fe(y,o,b),p&&p.m(y,b),fe(y,u,b),m&&m.m(y,b),fe(y,l,b),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(y,b){b[0]&12&&t!==(t=ht(y[2],y[3])+"")&&(e.innerHTML=t),b[0]&2&&W(e,"for",y[1]),b[0]&8&&W(s,"accesskey",y[3]),b[0]&2&&W(s,"id",y[1]),b[0]&16&&W(s,"placeholder",y[4]),b[0]&64&&s.value!==y[6]&&yr(s,y[6]),y[10]&&y[10].length!==0?p?p.p(y,b):(p=ww(y),p.c(),p.m(u.parentNode,u)):p&&(p.d(1),p=null),y[0][y[1]].length!==0?m?m.p(y,b):(m=Sw(y),m.c(),m.m(l.parentNode,l)):m&&(m.d(1),m=null)},i:Ue,o:Ue,d(y){y&&oe(e),y&&oe(n),y&&oe(i),r[22](null),a(),y&&oe(o),p&&p.d(y),y&&oe(u),m&&m.d(y),y&&oe(l),c=!1,Ut(d)}}}function AI(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="",p=null,m=0,y,b=!1,k=!1,_,R;function S(v){t(0,i[o]=[...i[o],v],i),t(6,d=""),t(7,b=!1)}function F(v){t(0,i[o]=i[o].filter(x=>x!==v),i)}function q(v){var x;if(p!==null){switch(v.key){case"ArrowUp":v.preventDefault(),!!m&&m>0?t(11,m-=1):t(11,m=p.length-1);break;case"ArrowDown":v.preventDefault(),!!m&&m<p.length-1?t(11,m+=1):t(11,m=0);break;case"Enter":m!==null?(v.preventDefault(),S(p[m]),t(11,m=null),t(7,b=!1)):a(v);break;default:t(11,m=0);break}m&&((x=R==null?void 0:R.getElementsByTagName("li")[m])===null||x===void 0||x.scrollIntoView({block:"nearest"}))}}function ne(v){return!v&&!k?[]:(k=!1,il(v,s,n,i.blockedBy,i.blocking))}function G(){t(7,b=!0),k=!0}function B(v,x){!v||!x||ah(v,x,{middleware:[gl(6),yl(),ih(),sh({apply(){x&&Object.assign(x.style,{width:`${y}px`})}})]}).then(({x:N,y:ie})=>{x.style.left=`${N}px`,x.style.top=`${ie}px`})}function he(v){return v===n.taskLocation.path?"":v}function Pe(v){return Mi(v)}function j(v,x){let N=v.createDiv();N.addClasses(["tooltip","pop-up"]),N.innerText=x,ah(v,N,{placement:"top",middleware:[gl(-18),yl()]}).then(({x:ie,y:le})=>{N.style.left=`${ie}px`,N.style.top=`${le}px`}),v.addEventListener("mouseleave",()=>N.remove())}function $(v){je[v?"unshift":"push"](()=>{_=v,t(8,_)})}function D(){d=this.value,t(6,d)}let Y=v=>q(v),I=()=>t(7,b=!1);function Z(){y=this.clientWidth,t(12,y)}let f=(v,x)=>j(x.currentTarget,Pe(v)),h=(v,x)=>j(x.currentTarget,v),g=v=>S(v),T=v=>t(11,m=v);function w(v){je[v?"unshift":"push"](()=>{R=v,t(9,R)})}let O=()=>t(11,m=null),M=v=>F(v),A=(v,x)=>j(x.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:B(_,R)}if(r.$$.dirty[0]&192){e:t(10,p=b?ne(d):null)}},[i,o,u,l,c,n,d,b,_,R,p,m,y,S,F,q,G,he,Pe,j,s,a,$,D,Y,I,Z,f,h,g,T,w,O,M,A]}var oh=class extends gr{constructor(e){super(),nn(this,e,AI,CI,rn,{task:5,editableTask:0,allTasks:20,_onDescriptionKeyDown:21,type:1,labelText:2,accesskey:3,placeholder:4},null,[-1,-1])}},uh=oh;var Lo=require("obsidian");var Fo,lh,ch,PI=["md"];function kl(){return Rt.getLogger("tasks.File")}var Dw=({metadataCache:r,vault:e,workspace:t})=>{Fo=r,lh=e,ch=t},br=t=>P(void 0,[t],function*({originalTask:r,newTasks:e}){if(lh===void 0||Fo===void 0||ch===void 0){vl("Tasks: cannot use File before initializing it.");return}Array.isArray(e)||(e=[e]);let n=kl(),i="replaceTaskWithTasks()";ll(n,i,r),cl(n,i,e),yield Rw({originalTask:r,newTasks:e,vault:lh,metadataCache:Fo,workspace:ch,previousTries:0})});function vl(r){console.error(r),new Lo.Notice(r,15e3)}function xw(r){console.warn(r),new Lo.Notice(r,1e4)}function NI(r){kl().debug(r)}var Zn=class extends Error{},wl=class extends Error{},Rw=a=>P(void 0,[a],function*({originalTask:r,newTasks:e,vault:t,metadataCache:n,workspace:i,previousTries:s}){let o=kl();o.debug(`tryRepetitive after ${s} previous tries`);let u=()=>P(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}

In this markdown file:
"${r.taskLocation.path}"

Note: further clicks on this checkbox will usually now be ignored until the file is opened (or certain, specific edits are made - it's complicated).

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.
`;vl(c);return}let l=Math.min(Math.pow(10,s),100);o.debug(`timeout = ${l}`),setTimeout(()=>P(void 0,null,function*(){yield Rw({originalTask:r,newTasks:e,vault:t,metadataCache:n,workspace:i,previousTries:s+1})}),l)});try{let[l,c,d]=yield Mw(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 Zn){l.message&&xw(l.message),yield u();return}else if(l instanceof wl){yield u();return}else l instanceof Error&&vl(l.message)}});function Mw(r,e){return P(this,null,function*(){if(Fo===void 0)throw new Zn;let t=e.getAbstractFileByPath(r.path);if(!(t instanceof Lo.TFile))throw new Zn(`Tasks: No file found for task ${r.description}. Retrying ...`);if(!PI.includes(t.extension))throw new Error(`Tasks: Does not support files with the ${t.extension} file extension.`);let n=Fo.getFileCache(t);if(n==null||n===null)throw new Zn(`Tasks: No file cache found for file ${t.path}. Retrying ...`);let i=n.listItems;if(i===void 0||i.length===0)throw new Zn(`Tasks: No list items found in file cache of ${t.path}. Retrying ...`);let a=(yield e.read(t)).split(`
`),o=II(r,a,i,NI);if(o===void 0)throw new wl;return[o,t,a]})}function dh(r,e){return P(this,null,function*(){try{let[t,n,i]=yield Mw(r,e);return[t,n]}catch(t){t instanceof Zn?t.message&&xw(t.message):t instanceof Error&&vl(t.message)}})}function Cw(r,e){return r<e.length}function II(r,e,t,n){let i=FI(r,e);return i!==void 0||(i=LI(r,e),i!==void 0)?i:UI(r,e,t,n)}function FI(r,e){let t=r.taskLocation.lineNumber;if(Cw(t,e)&&e[t]===r.originalMarkdown)return kl().debug(`Found original markdown at original line number ${t}`),t}function LI(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 UI(r,e,t,n){let i,s=0;for(let a of t){let o=a.position.start.line;if(!Cw(o,e))return;if(o<r.taskLocation.sectionStart||a.task===void 0)continue;let u=e[o];if(_e.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}var Ns=class{constructor(e){this.addGlobalFilterOnSave=e.addGlobalFilterOnSave,this.originalBlocking=e.originalBlocking,this.description=e.description,this.status=e.status,this.priority=e.priority,this.onCompletion=e.onCompletion,this.recurrenceRule=e.recurrenceRule,this.createdDate=e.createdDate,this.startDate=e.startDate,this.scheduledDate=e.scheduledDate,this.dueDate=e.dueDate,this.doneDate=e.doneDate,this.cancelledDate=e.cancelledDate,this.forwardOnly=e.forwardOnly,this.blockedBy=e.blockedBy,this.blocking=e.blocking}static fromTask(e,t){let n=_e.getInstance().removeAsWordFrom(e.description),i=n!=e.description||!_e.getInstance().includedIn(e.description),s="none";e.priority==="5"?s="lowest":e.priority==="4"?s="low":e.priority==="2"?s="medium":e.priority==="1"?s="high":e.priority==="0"&&(s="highest");let a=[];for(let u of e.dependsOn){let l=t.find(c=>c.id===u);!l||a.push(l)}let o=t.filter(u=>u.dependsOn.includes(e.id));return new Ns({addGlobalFilterOnSave:i,originalBlocking:o,description:n,status:e.status,priority:s,recurrenceRule:e.recurrence?e.recurrence.toText():"",onCompletion:e.onCompletion,createdDate:e.created.formatAsDate(),startDate:e.start.formatAsDate(),scheduledDate:e.scheduled.formatAsDate(),dueDate:e.due.formatAsDate(),doneDate:e.done.formatAsDate(),cancelledDate:e.cancelled.formatAsDate(),forwardOnly:!0,blockedBy:a,blocking:o})}applyEdits(e,t){return P(this,null,function*(){let n=this.description.trim();this.addGlobalFilterOnSave&&(n=_e.getInstance().prependTo(n));let i=ki(this.startDate,this.forwardOnly),s=ki(this.scheduledDate,this.forwardOnly),a=ki(this.dueDate,this.forwardOnly),o=ki(this.cancelledDate,this.forwardOnly),u=ki(this.createdDate,this.forwardOnly),l=ki(this.doneDate,this.forwardOnly),c=null;this.recurrenceRule&&(c=it.fromText({recurrenceRuleText:this.recurrenceRule,occurrence:new fr({startDate:i,scheduledDate:s,dueDate:a})}));let d;switch(this.priority){case"lowest":d="5";break;case"low":d="4";break;case"medium":d="2";break;case"high":d="1";break;case"highest":d="0";break;default:d="3"}let p=this.onCompletion,m=[];for(let S of this.blockedBy){let F=yield WI(S,t);m.push(F)}let y=e.id,b=[],k=[];(this.blocking.toString()!==this.originalBlocking.toString()||this.blocking.length!==0)&&(e.id===""&&(y=So(t.filter(S=>S.id!=="").map(S=>S.id))),b=this.originalBlocking.filter(S=>!this.blocking.includes(S)),k=this.blocking.filter(S=>!this.originalBlocking.includes(S)));let _=new te(ce(K({},e),{description:n,status:e.status,priority:d,onCompletion:p,recurrence:c,startDate:i,scheduledDate:s,dueDate:a,doneDate:l,createdDate:u,cancelledDate:o,dependsOn:m.map(S=>S.id),id:y}));for(let S of b){let F=Dv(S,_);yield br({originalTask:S,newTasks:F})}for(let S of k){let F=Ov(S,_);yield br({originalTask:S,newTasks:F})}let R=this.inferTodaysDate(this.status.type,l,o);return _.handleNewStatusWithRecurrenceInUsersOrder(this.status,R)})}inferTodaysDate(e,t,n){return e==="DONE"&&t!==null?t:e==="CANCELLED"&&n!==null?n:window.moment()}parseAndValidateRecurrence(){var t;if(!this.recurrenceRule)return{parsedRecurrence:"<i>not recurring</>",isRecurrenceValid:!0};let e=(t=it.fromText({recurrenceRuleText:this.recurrenceRule,occurrence:new fr({startDate:null,scheduledDate:null,dueDate:null})}))==null?void 0:t.toText();return e?this.startDate||this.scheduledDate||this.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 WI(r,e){return P(this,null,function*(){if(r.id!=="")return r;let t=e.filter(i=>i.id!==""),n=nl(r,t.map(i=>i.id));return yield br({originalTask:r,newTasks:n}),n})}function qI(r){let e,t=ht("Recurs",r[2])+"",n,i,s,a,o,u,l,c,d;return{c(){e=Q("label"),n=ue(),i=Q("input"),s=ue(),a=Q("code"),o=Me(r[4]),u=ue(),l=new Ds(!1),W(e,"for","recurrence"),W(i,"id","recurrence"),W(i,"type","text"),W(i,"class","tasks-modal-date-input"),W(i,"placeholder","Try 'every day when done'"),W(i,"accesskey",r[2]),Mn(i,"tasks-modal-error",!r[1]),l.a=null,W(a,"class","tasks-modal-parsed-date")},m(p,m){fe(p,e,m),e.innerHTML=t,fe(p,n,m),fe(p,i,m),yr(i,r[0].recurrenceRule),fe(p,s,m),fe(p,a,m),U(a,o),U(a,u),l.m(r[3],a),c||(d=xe(i,"input",r[5]),c=!0)},p(p,[m]){m&4&&t!==(t=ht("Recurs",p[2])+"")&&(e.innerHTML=t),m&4&&W(i,"accesskey",p[2]),m&1&&i.value!==p[0].recurrenceRule&&yr(i,p[0].recurrenceRule),m&2&&Mn(i,"tasks-modal-error",!p[1]),m&8&&l.p(p[3])},i:Ue,o:Ue,d(p){p&&oe(e),p&&oe(n),p&&oe(i),p&&oe(s),p&&oe(a),c=!1,d()}}}function $I(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}=n.parseAndValidateRecurrence(),a,(t(1,i),t(0,n)))}},[n,i,s,a,o,u]}var fh=class extends gr{constructor(e){super(),nn(this,e,$I,qI,rn,{editableTask:0,isRecurrenceValid:1,accesskey:2})}},Aw=fh;function Pw(r,e,t){let n=r.slice();return n[7]=e[t],n}function Nw(r){let e,t=r[7].name+"",n,i,s=r[7].symbol+"",a,o,u;return{c(){e=Q("option"),n=Me(t),i=Me(" ["),a=Me(s),o=Me("]"),e.__value=u=r[7].symbol,e.value=e.__value},m(l,c){fe(l,e,c),U(e,n),U(e,i),U(e,a),U(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&&oe(e)}}}function jI(r){let e,t=ht("Status",r[1])+"",n,i,s,a,o=r[0],u=[];for(let l=0;l<o.length;l+=1)u[l]=Nw(Pw(r,o,l));return{c(){e=Q("label"),n=ue(),i=Q("select");for(let l=0;l<u.length;l+=1)u[l].c();W(e,"for","status"),W(i,"id","status-type"),W(i,"class","status-editor-status-selector"),W(i,"accesskey",r[1]),r[2]===void 0&&Ni(()=>r[6].call(i))},m(l,c){fe(l,e,c),e.innerHTML=t,fe(l,n,c),fe(l,i,c);for(let d=0;d<u.length;d+=1)u[d]&&u[d].m(i,null);Xm(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=ht("Status",l[1])+"")&&(e.innerHTML=t),c&1){o=l[0];let d;for(d=0;d<o.length;d+=1){let p=Pw(l,o,d);u[d]?u[d].p(p,c):(u[d]=Nw(p),u[d].c(),u[d].m(i,null))}for(;d<u.length;d+=1)u[d].d(1);u.length=o.length}c&2&&W(i,"accesskey",l[1]),c&5&&Xm(i,l[2])},i:Ue,o:Ue,d(l){l&&oe(e),l&&oe(n),l&&oe(i),Ii(u,l),s=!1,Ut(a)}}}function Iw(r,e,t){let n=r==="";return e&&n?t.formatAsDate():!e&&!n?"":r}function GI(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(p=>p.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=Iw(i.doneDate,c.isCompleted(),d.done),i),t(4,i.cancelledDate=Iw(i.cancelledDate,c.isCancelled(),d.cancelled),i))};function l(){o=Kv(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 ph=class extends gr{constructor(e){super(),nn(this,e,GI,jI,rn,{task:5,editableTask:4,statusOptions:0,accesskey:1})}},Fw=ph;function Lw(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 YI(r){let e,t=r[53]+"",n;return{c(){e=Q("span"),n=Me(t)},m(i,s){fe(i,e,s),U(e,n)},p:Ue,d(i){i&&oe(e)}}}function BI(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=Q("span"),n=Me(t),i=Q("span"),a=Me(s),o=Q("span"),l=Me(u),W(i,"class","accesskey")},m(c,d){fe(c,e,d),U(e,n),fe(c,i,d),U(i,a),fe(c,o,d),U(o,l)},p:Ue,d(c){c&&oe(e),c&&oe(i),c&&oe(o)}}}function HI(r){let e,t=r[54]+"",n;return{c(){e=Q("span"),n=Me(t)},m(i,s){fe(i,e,s),U(e,n)},p:Ue,d(i){i&&oe(e)}}}function Uw(r){let e,t,n,i,s,a,o,u,l=r[54]&&r[54].charCodeAt(0)>=256,c,d,p,m,y;function b(S,F){return S[11]?BI:YI}let k=b(r,[-1,-1]),_=k(r),R=l&&HI(r);return p=zv(r[35][0]),{c(){e=Q("div"),t=Q("input"),a=ue(),o=Q("label"),_.c(),u=ue(),R&&R.c(),d=ue(),W(t,"type","radio"),W(t,"id",n="priority-"+r[52]),t.__value=i=r[52],t.value=t.__value,W(t,"accesskey",s=r[15](r[55])),W(o,"for",c="priority-"+r[52]),W(e,"class","task-modal-priority-option-container"),p.p(t)},m(S,F){fe(S,e,F),U(e,t),t.checked=t.__value===r[3].priority,U(e,a),U(e,o),_.m(o,null),U(o,u),R&&R.m(o,null),U(e,d),m||(y=xe(t,"change",r[34]),m=!0)},p(S,F){F[0]&32768&&s!==(s=S[15](S[55]))&&W(t,"accesskey",s),F[0]&8&&(t.checked=t.__value===S[3].priority),k===(k=b(S,F))&&_?_.p(S,F):(_.d(1),_=k(S),_&&(_.c(),_.m(o,u))),l&&R.p(S,F)},d(S){S&&oe(e),_.d(),R&&R.d(),p.r(),m=!1,y()}}}function VI(r){let e;return{c(){e=Q("div"),e.innerHTML="<i>Blocking and blocked by fields are disabled when vault tasks is empty</i>"},m(t,n){fe(t,e,n)},p:Ue,i:Ue,o:Ue,d(t){t&&oe(e)}}}function zI(r){let e,t,n,i;return e=new uh({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 uh({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=ue(),Lr(n.$$.fragment)},m(s,a){Tr(e,s,a),fe(s,t,a),Tr(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||(Wt(e.$$.fragment,s),Wt(n.$$.fragment,s),i=!0)},o(s){Qt(e.$$.fragment,s),Qt(n.$$.fragment,s),i=!1},d(s){Xt(e,s),s&&oe(t),Xt(n,s)}}}function KI(r){let e,t,n,i=ht("Description",r[15]("t"))+"",s,a,o,u,l,c,d,p,m,y,b,k,_,R,S,F,q,ne,G,B,he,Pe,j,$,D,Y,I,Z,f,h,g=ht("Only future dates:",r[15]("f"))+"",T,w,O,M,A,v,x,N,ie,le,pe,Ne,Ce,Nt,dn,Br,at,Et,Ge,z,Er,vc,wc,Kh,Sr,kc,Ec,Qh,Ki,di,Xh,Ko,Zh,ia,Hr,Sc,Jh,Qi=r[22],St=[];for(let C=0;C<Qi.length;C+=1)St[C]=Uw(Lw(r,Qi,C));function iE(C){r[36](C)}let eg={editableTask:r[3],accesskey:r[15]("r")};r[10]!==void 0&&(eg.isRecurrenceValid=r[10]),R=new Aw({props:eg}),je.push(()=>Ct(R,"isRecurrenceValid",iE));function sE(C){r[37](C)}function aE(C){r[38](C)}let Oc={id:"due",dateSymbol:r[18],forwardOnly:r[3].forwardOnly,accesskey:r[15]("d")};r[3].dueDate!==void 0&&(Oc.date=r[3].dueDate),r[7]!==void 0&&(Oc.isDateValid=r[7]),q=new Fi({props:Oc}),je.push(()=>Ct(q,"date",sE)),je.push(()=>Ct(q,"isDateValid",aE)),q.$on("open",r[27]),q.$on("close",r[28]);function oE(C){r[39](C)}function uE(C){r[40](C)}let Dc={id:"scheduled",dateSymbol:r[17],forwardOnly:r[3].forwardOnly,accesskey:r[15]("s")};r[3].scheduledDate!==void 0&&(Dc.date=r[3].scheduledDate),r[8]!==void 0&&(Dc.isDateValid=r[8]),he=new Fi({props:Dc}),je.push(()=>Ct(he,"date",oE)),je.push(()=>Ct(he,"isDateValid",uE)),he.$on("open",r[27]),he.$on("close",r[28]);function lE(C){r[41](C)}function cE(C){r[42](C)}let xc={id:"start",dateSymbol:r[16],forwardOnly:r[3].forwardOnly,accesskey:r[15]("a")};r[3].startDate!==void 0&&(xc.date=r[3].startDate),r[9]!==void 0&&(xc.isDateValid=r[9]),D=new Fi({props:xc}),je.push(()=>Ct(D,"date",lE)),je.push(()=>Ct(D,"isDateValid",cE)),D.$on("open",r[27]),D.$on("close",r[28]);let tg=[zI,VI],qn=[];function rg(C,ee){return C[2].length>0&&C[14]?0:1}N=rg(r,[-1,-1]),ie=qn[N]=tg[N](r);function dE(C){r[44](C)}let ng={task:r[0],statusOptions:r[1],accesskey:r[15]("u")};r[3]!==void 0&&(ng.editableTask=r[3]),Nt=new Fw({props:ng}),je.push(()=>Ct(Nt,"editableTask",dE));function fE(C){r[45](C)}function pE(C){r[46](C)}let Rc={id:"created",dateSymbol:r[20],forwardOnly:r[3].forwardOnly,accesskey:r[15]("c")};r[3].createdDate!==void 0&&(Rc.date=r[3].createdDate),r[5]!==void 0&&(Rc.isDateValid=r[5]),at=new Fi({props:Rc}),je.push(()=>Ct(at,"date",fE)),je.push(()=>Ct(at,"isDateValid",pE)),at.$on("open",r[27]),at.$on("close",r[28]);function mE(C){r[47](C)}function hE(C){r[48](C)}let Mc={id:"done",dateSymbol:r[21],forwardOnly:r[3].forwardOnly,accesskey:r[15]("x")};r[3].doneDate!==void 0&&(Mc.date=r[3].doneDate),r[6]!==void 0&&(Mc.isDateValid=r[6]),Er=new Fi({props:Mc}),je.push(()=>Ct(Er,"date",mE)),je.push(()=>Ct(Er,"isDateValid",hE)),Er.$on("open",r[27]),Er.$on("close",r[28]);function gE(C){r[49](C)}function yE(C){r[50](C)}let Cc={id:"cancelled",dateSymbol:r[19],forwardOnly:r[3].forwardOnly,accesskey:r[15]("-")};return r[3].cancelledDate!==void 0&&(Cc.date=r[3].cancelledDate),r[4]!==void 0&&(Cc.isDateValid=r[4]),Sr=new Fi({props:Cc}),je.push(()=>Ct(Sr,"date",gE)),je.push(()=>Ct(Sr,"isDateValid",yE)),Sr.$on("open",r[27]),Sr.$on("close",r[28]),{c(){e=Q("form"),t=Q("section"),n=Q("label"),s=ue(),a=Q("textarea"),u=ue(),l=Q("section"),c=Q("label"),d=Me("Priority"),m=ue();for(let C=0;C<St.length;C+=1)St[C].c();y=ue(),b=Q("hr"),k=ue(),_=Q("section"),Lr(R.$$.fragment),F=ue(),Lr(q.$$.fragment),B=ue(),Lr(he.$$.fragment),$=ue(),Lr(D.$$.fragment),Z=ue(),f=Q("div"),h=Q("label"),T=ue(),w=Q("input"),M=ue(),A=Q("hr"),v=ue(),x=Q("section"),ie.c(),le=ue(),pe=Q("hr"),Ne=ue(),Ce=Q("section"),Lr(Nt.$$.fragment),Br=ue(),Lr(at.$$.fragment),z=ue(),Lr(Er.$$.fragment),Kh=ue(),Lr(Sr.$$.fragment),Qh=ue(),Ki=Q("section"),di=Q("button"),Xh=Me("Apply"),Zh=ue(),ia=Q("button"),ia.textContent="Cancel",W(n,"for","description"),W(a,"id","description"),W(a,"class","tasks-modal-description"),W(a,"placeholder","Take out the trash"),W(a,"accesskey",o=r[15]("t")),W(t,"class","tasks-modal-description-section"),W(c,"for",p="priority-"+r[3].priority),W(l,"class","tasks-modal-priority-section"),W(h,"for","forwardOnly"),W(w,"id","forwardOnly"),W(w,"type","checkbox"),W(w,"class","task-list-item-checkbox tasks-modal-checkbox"),W(w,"accesskey",O=r[15]("f")),W(f,"class","future-dates-only"),W(_,"class","tasks-modal-dates-section"),W(x,"class","tasks-modal-dependencies-section"),W(Ce,"class","tasks-modal-dates-section"),di.disabled=Ko=!r[13],W(di,"type","submit"),W(di,"class","mod-cta"),W(ia,"type","button"),W(Ki,"class","tasks-modal-button-section"),W(e,"class","tasks-modal")},m(C,ee){fe(C,e,ee),U(e,t),U(t,n),n.innerHTML=i,U(t,s),U(t,a),yr(a,r[3].description),r[33](a),U(e,u),U(e,l),U(l,c),U(c,d),U(l,m);for(let fn=0;fn<St.length;fn+=1)St[fn]&&St[fn].m(l,null);U(e,y),U(e,b),U(e,k),U(e,_),Tr(R,_,null),U(_,F),Tr(q,_,null),U(_,B),Tr(he,_,null),U(_,$),Tr(D,_,null),U(_,Z),U(_,f),U(f,h),h.innerHTML=g,U(f,T),U(f,w),w.checked=r[3].forwardOnly,U(e,M),U(e,A),U(e,v),U(e,x),qn[N].m(x,null),U(e,le),U(e,pe),U(e,Ne),U(e,Ce),Tr(Nt,Ce,null),U(Ce,Br),Tr(at,Ce,null),U(Ce,z),Tr(Er,Ce,null),U(Ce,Kh),Tr(Sr,Ce,null),U(e,Qh),U(e,Ki),U(Ki,di),U(di,Xh),U(Ki,Zh),U(Ki,ia),Hr=!0,Sc||(Jh=[xe(a,"input",r[32]),xe(a,"keydown",r[24]),xe(a,"paste",r[25]),xe(a,"drop",r[25]),xe(w,"change",r[43]),xe(ia,"click",r[23]),xe(e,"submit",Vv(r[26]))],Sc=!0)},p(C,ee){if((!Hr||ee[0]&32768)&&i!==(i=ht("Description",C[15]("t"))+"")&&(n.innerHTML=i),(!Hr||ee[0]&32768&&o!==(o=C[15]("t")))&&W(a,"accesskey",o),ee[0]&8&&yr(a,C[3].description),(!Hr||ee[0]&8&&p!==(p="priority-"+C[3].priority))&&W(c,"for",p),ee[0]&4229128){Qi=C[22];let nr;for(nr=0;nr<Qi.length;nr+=1){let ig=Lw(C,Qi,nr);St[nr]?St[nr].p(ig,ee):(St[nr]=Uw(ig),St[nr].c(),St[nr].m(l,null))}for(;nr<St.length;nr+=1)St[nr].d(1);St.length=Qi.length}let fn={};ee[0]&8&&(fn.editableTask=C[3]),ee[0]&32768&&(fn.accesskey=C[15]("r")),!S&&ee[0]&1024&&(S=!0,fn.isRecurrenceValid=C[10],Mt(()=>S=!1)),R.$set(fn);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,Mt(()=>ne=!1)),!G&&ee[0]&128&&(G=!0,sa.isDateValid=C[7],Mt(()=>G=!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,Mt(()=>Pe=!1)),!j&&ee[0]&256&&(j=!0,aa.isDateValid=C[8],Mt(()=>j=!1)),he.$set(aa);let oa={};ee[0]&8&&(oa.forwardOnly=C[3].forwardOnly),ee[0]&32768&&(oa.accesskey=C[15]("a")),!Y&&ee[0]&8&&(Y=!0,oa.date=C[3].startDate,Mt(()=>Y=!1)),!I&&ee[0]&512&&(I=!0,oa.isDateValid=C[9],Mt(()=>I=!1)),D.$set(oa),(!Hr||ee[0]&32768)&&g!==(g=ht("Only future dates:",C[15]("f"))+"")&&(h.innerHTML=g),(!Hr||ee[0]&32768&&O!==(O=C[15]("f")))&&W(w,"accesskey",O),ee[0]&8&&(w.checked=C[3].forwardOnly);let Ac=N;N=rg(C,ee),N===Ac?qn[N].p(C,ee):(Zv(),Qt(qn[Ac],1,1,()=>{qn[Ac]=null}),Jv(),ie=qn[N],ie?ie.p(C,ee):(ie=qn[N]=tg[N](C),ie.c()),Wt(ie,1),ie.m(x,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")),!dn&&ee[0]&8&&(dn=!0,ua.editableTask=C[3],Mt(()=>dn=!1)),Nt.$set(ua);let la={};ee[0]&8&&(la.forwardOnly=C[3].forwardOnly),ee[0]&32768&&(la.accesskey=C[15]("c")),!Et&&ee[0]&8&&(Et=!0,la.date=C[3].createdDate,Mt(()=>Et=!1)),!Ge&&ee[0]&32&&(Ge=!0,la.isDateValid=C[5],Mt(()=>Ge=!1)),at.$set(la);let ca={};ee[0]&8&&(ca.forwardOnly=C[3].forwardOnly),ee[0]&32768&&(ca.accesskey=C[15]("x")),!vc&&ee[0]&8&&(vc=!0,ca.date=C[3].doneDate,Mt(()=>vc=!1)),!wc&&ee[0]&64&&(wc=!0,ca.isDateValid=C[6],Mt(()=>wc=!1)),Er.$set(ca);let da={};ee[0]&8&&(da.forwardOnly=C[3].forwardOnly),ee[0]&32768&&(da.accesskey=C[15]("-")),!kc&&ee[0]&8&&(kc=!0,da.date=C[3].cancelledDate,Mt(()=>kc=!1)),!Ec&&ee[0]&16&&(Ec=!0,da.isDateValid=C[4],Mt(()=>Ec=!1)),Sr.$set(da),(!Hr||ee[0]&8192&&Ko!==(Ko=!C[13]))&&(di.disabled=Ko)},i(C){Hr||(Wt(R.$$.fragment,C),Wt(q.$$.fragment,C),Wt(he.$$.fragment,C),Wt(D.$$.fragment,C),Wt(ie),Wt(Nt.$$.fragment,C),Wt(at.$$.fragment,C),Wt(Er.$$.fragment,C),Wt(Sr.$$.fragment,C),Hr=!0)},o(C){Qt(R.$$.fragment,C),Qt(q.$$.fragment,C),Qt(he.$$.fragment,C),Qt(D.$$.fragment,C),Qt(ie),Qt(Nt.$$.fragment,C),Qt(at.$$.fragment,C),Qt(Er.$$.fragment,C),Qt(Sr.$$.fragment,C),Hr=!1},d(C){C&&oe(e),r[33](null),Ii(St,C),Xt(R),Xt(q),Xt(he),Xt(D),qn[N].d(),Xt(Nt),Xt(at),Xt(Er),Xt(Sr),Sc=!1,Ut(Jh)}}}function QI(r,e,t){let n,{task:i}=e,{onSubmit:s}=e,{statusOptions:a}=e,{allTasks:o}=e,{modal:u=null}=e,{prioritySymbols:l,startDateSymbol:c,scheduledDateSymbol:d,dueDateSymbol:p,cancelledDateSymbol:m,createdDateSymbol:y,doneDateSymbol:b}=Nr.tasksPluginEmoji.taskSerializer.symbols,k,_=Ns.fromTask(i,o),R=!0,S=!0,F=!0,q=!0,ne=!0,G=!0,B=!0,he=!0,Pe=!0,j=!0,$=!1,D=[{value:"lowest",label:"Lowest",symbol:l.Lowest,accessKey:"o",accessKeyIndex:1},{value:"low",label:"Low",symbol:l.Low,accessKey:"l",accessKeyIndex:0},{value:"none",label:"Normal",symbol:l.None,accessKey:"n",accessKeyIndex:0},{value:"medium",label:"Medium",symbol:l.Medium,accessKey:"m",accessKeyIndex:0},{value:"high",label:"High",symbol:l.High,accessKey:"h",accessKeyIndex:0},{value:"highest",label:"Highest",symbol:l.Highest,accessKey:"i",accessKeyIndex:1}];Zm(()=>{let{provideAccessKeys:z}=X();t(11,Pe=z),t(14,$=!0),setTimeout(()=>{k.focus()},10)});let Y=()=>{s([])},I=z=>{z.key==="Enter"&&(z.preventDefault(),j&&f())},Z=()=>{setTimeout(()=>{t(3,_.description=_.description.replace(/[\r\n]+/g," "),_)},0)},f=()=>ew(void 0,void 0,void 0,function*(){let z=yield _.applyEdits(i,o);s(z)});function h(z){u&&u.setActiveFlatpickrInstance(z.detail.instance)}function g(){u&&u.clearActiveFlatpickrInstance()}let T=[[]];function w(){_.description=this.value,t(3,_)}function O(z){je[z?"unshift":"push"](()=>{k=z,t(12,k)})}function M(){_.priority=this.__value,t(3,_)}function A(z){he=z,t(10,he)}function v(z){r.$$.not_equal(_.dueDate,z)&&(_.dueDate=z,t(3,_))}function x(z){ne=z,t(7,ne)}function N(z){r.$$.not_equal(_.scheduledDate,z)&&(_.scheduledDate=z,t(3,_))}function ie(z){G=z,t(8,G)}function le(z){r.$$.not_equal(_.startDate,z)&&(_.startDate=z,t(3,_))}function pe(z){B=z,t(9,B)}function Ne(){_.forwardOnly=this.checked,t(3,_)}function Ce(z){_=z,t(3,_)}function Nt(z){r.$$.not_equal(_.createdDate,z)&&(_.createdDate=z,t(3,_))}function dn(z){F=z,t(5,F)}function Br(z){r.$$.not_equal(_.doneDate,z)&&(_.doneDate=z,t(3,_))}function at(z){q=z,t(6,q)}function Et(z){r.$$.not_equal(_.cancelledDate,z)&&(_.cancelledDate=z,t(3,_))}function Ge(z){S=z,t(4,S)}return r.$$set=z=>{"task"in z&&t(0,i=z.task),"onSubmit"in z&&t(29,s=z.onSubmit),"statusOptions"in z&&t(1,a=z.statusOptions),"allTasks"in z&&t(2,o=z.allTasks),"modal"in z&&t(30,u=z.modal)},r.$$.update=()=>{if(r.$$.dirty[0]&2048){e:t(15,n=z=>Pe?z:null)}if(r.$$.dirty[0]&8){e:t(31,R=_.description.trim()!=="")}if(r.$$.dirty[0]&2032|r.$$.dirty[1]&1){e:t(13,j=ne&&he&&G&&B&&R&&S&&F&&q)}},[i,a,o,_,S,F,q,ne,G,B,he,Pe,k,j,$,n,c,d,p,m,y,b,D,Y,I,Z,f,h,g,s,u,R,w,O,M,T,A,v,x,N,ie,le,pe,Ne,Ce,Nt,dn,Br,at,Et,Ge]}var mh=class extends gr{constructor(e){super(),nn(this,e,QI,KI,rn,{task:0,onSubmit:29,statusOptions:1,allTasks:2,modal:30},null,[-1,-1])}},Ww=mh;var Jn=class extends qw.Modal{constructor({app:t,task:n,onSubmit:i,allTasks:s}){super(t);this.activeFlatpickrInstance=null;this.task=n,this.allTasks=s,this.onSubmit=a=>{this.activeFlatpickrInstance||(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 Ww({target:t,props:{task:this.task,statusOptions:n,onSubmit:this.onSubmit,allTasks:this.allTasks,modal:this}})}getKnownStatusesAndCurrentTaskStatusIfNotKnown(){let t=De.getInstance().registeredStatuses;return De.getInstance().bySymbol(this.task.status.symbol)===re.EMPTY&&t.push(this.task.status),t}onClose(){let{contentEl:t}=this;t.empty()}onEscapeKey(){var t;(t=this.activeFlatpickrInstance)!=null&&t.isOpen?(this.activeFlatpickrInstance.close(),this.activeFlatpickrInstance=null):this.close()}setActiveFlatpickrInstance(t){this.activeFlatpickrInstance=t}clearActiveFlatpickrInstance(){this.activeFlatpickrInstance=null}};function XI(){let{setCreatedDate:r}=X();return r?window.moment():null}function ZI(r){let{setCreatedDate:e}=X();if(!e||r.createdDate!==null)return!1;let t=r.description==="",n=!_e.getInstance().isEmpty(),i=!_e.getInstance().includedIn(r.description);return t||n&&i}var El=({line:r,path:e})=>{var p,m;let t=te.parseTaskSignifiers(r,mt.fromUnknownPosition(new ot(e)),_t.fromPath(e)),n=XI();if(t!==null)return ZI(t)?new te(ce(K({},t),{createdDate:n})):t;let i=r.match(J.nonTaskRegex);if(i===null)return console.error("Tasks: Cannot create task on line:",r),new te({status:re.TODO,description:"",taskLocation:mt.fromUnknownPosition(new ot(e)),indentation:"",listMarker:"-",priority:"3",createdDate:n,startDate:null,scheduledDate:null,dueDate:null,doneDate:null,cancelledDate:null,recurrence:null,onCompletion:"",dependsOn:[],id:"",blockLink:"",tags:[],originalMarkdown:"",scheduledDateIsInferred:!1});let s=i[1],a=(p=i[2])!=null?p:"-",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 te({status:u,description:l,taskLocation:mt.fromUnknownPosition(new ot(e)),indentation:s,listMarker:a,blockLink:d,priority:"3",createdDate:n,startDate:null,scheduledDate:null,dueDate:null,doneDate:null,cancelledDate:null,recurrence:null,onCompletion:"",tags:[],originalMarkdown:"",scheduledDateIsInferred:!1,id:"",dependsOn:[]})};var $w=(r,e,t,n,i)=>{var p;if(r)return t instanceof hh.MarkdownView;if(!(t instanceof hh.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 y=_t.removeInferredStatusIfNeeded(l,m).map(b=>b.toFileLineString()).join(`
`);e.setLine(o,y)};new Jn({app:n,task:l,onSubmit:c,allTasks:i}).open()};var gh=require("obsidian");var jw=(r,e,t)=>{var u;if(r)return t instanceof gh.MarkdownView;if(!(t instanceof gh.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=yh(a,n);e.setLine(s,o.text),e.setCursor(JI(i,o))},yh=(r,e)=>{let t=te.fromLine({line:r,taskLocation:mt.fromUnknownPosition(new ot(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}}}}},JI=(r,e)=>{var s;let t={line:0,ch:r.ch},n=K(K({},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)=>$w(t,n,i,this.app,this.plugin.getTasks())}),e.addCommand({id:"toggle-done",name:"Toggle task done",icon:"check-in-circle",editorCheckCallback:jw})}};var ei=class{constructor(){this.hidePostponeButton=!1;this.hideTaskCount=!1;this.hideBacklinks=!1;this.hideEditButton=!1;this.hideUrgency=!0;this.shortMode=!1;this.explainQuery=!1}};function qi(r,e){let t=`Error: ${r}.
The error message was:
    `,n="";return e instanceof Error?n+=e:n+="Unknown error",`${t}"${n}"`}var eF=Object.prototype.toString,Fs=Array.isArray||function(e){return eF.call(e)==="[object Array]"};function bh(r){return typeof r=="function"}function tF(r){return Fs(r)?"array":typeof r}function Th(r){return r.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Gw(r,e){return r!=null&&typeof r=="object"&&e in r}function rF(r,e){return r!=null&&typeof r!="object"&&r.hasOwnProperty&&r.hasOwnProperty(e)}var nF=RegExp.prototype.test;function iF(r,e){return nF.call(r,e)}var sF=/\S/;function aF(r){return!iF(sF,r)}var oF={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function uF(r){return String(r).replace(/[&<>"'`=\/]/g,function(t){return oF[t]})}var lF=/\s*/,cF=/\s+/,Yw=/\s*=/,dF=/\s*\}/,fF=/#|\^|\/|>|\{|&|=|!/;function pF(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 y(B){if(typeof B=="string"&&(B=B.split(cF,2)),!Fs(B)||B.length!==2)throw new Error("Invalid tags: "+B);d=new RegExp(Th(B[0])+"\\s*"),p=new RegExp("\\s*"+Th(B[1])),m=new RegExp("\\s*"+Th("}"+B[1]))}y(e||_r.tags);for(var b=new Wo(r),k,_,R,S,F,q;!b.eos();){if(k=b.pos,R=b.scanUntil(d),R)for(var ne=0,G=R.length;ne<G;++ne)S=R.charAt(ne),aF(S)?(s.push(i.length),u+=S):(o=!0,t=!0,u+=" "),i.push(["text",S,k,k+1]),k+=1,S===`
`&&(c(),u="",l=0,t=!1);if(!b.scan(d))break;if(a=!0,_=b.scan(fF)||"name",b.scan(lF),_==="="?(R=b.scanUntil(Yw),b.scan(Yw),b.scanUntil(p)):_==="{"?(R=b.scanUntil(m),b.scan(dF),b.scanUntil(p),_="&"):R=b.scanUntil(p),!b.scan(p))throw new Error("Unclosed tag at "+b.pos);if(_==">"?F=[_,R,k,b.pos,u,l,t]:F=[_,R,k,b.pos],l++,i.push(F),_==="#"||_==="^")n.push(F);else if(_==="/"){if(q=n.pop(),!q)throw new Error('Unopened section "'+R+'" at '+k);if(q[1]!==R)throw new Error('Unclosed section "'+q[1]+'" at '+k)}else _==="name"||_==="{"||_==="&"?o=!0:_==="="&&y(R)}if(c(),q=n.pop(),q)throw new Error('Unclosed section "'+q[1]+'" at '+b.pos);return hF(mF(i))}function mF(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 hF(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 Is(r,e){this.view=r,this.cache={".":this.view},this.parent=e}Is.prototype.push=function(e){return new Is(e,this)};Is.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=Gw(s,a[o])||rF(s,a[o])),s=s[a[o++]];else s=i.view[e],u=Gw(i.view,e);if(u){n=s;break}i=i.parent}t[e]=n}return bh(n)&&(n=n.call(this.view)),n};function At(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}At.prototype.clearCache=function(){typeof this.templateCache!="undefined"&&this.templateCache.clear()};At.prototype.parse=function(e,t){var n=this.templateCache,i=e+":"+(t||_r.tags).join(":"),s=typeof n!="undefined",a=s?n.get(i):void 0;return a==null&&(a=pF(e,t),s&&n.set(i,a)),a};At.prototype.render=function(e,t,n,i){var s=this.getConfigTags(i),a=this.parse(e,s),o=t instanceof Is?t:new Is(t,void 0);return this.renderTokens(a,o,n,e,i)};At.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};At.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(Fs(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(bh(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}};At.prototype.renderInverted=function(e,t,n,i,s){var a=t.lookup(e[1]);if(!a||Fs(a)&&a.length===0)return this.renderTokens(e[4],t,n,i,s)};At.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(`
`)};At.prototype.renderPartial=function(e,t,n,i){if(!!n){var s=this.getConfigTags(i),a=bh(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)}}};At.prototype.unescapedValue=function(e,t){var n=t.lookup(e[1]);if(n!=null)return n};At.prototype.escapedValue=function(e,t,n){var i=this.getConfigEscape(n)||_r.escape,s=t.lookup(e[1]);if(s!=null)return typeof s=="number"&&i===_r.escape?String(s):i(s)};At.prototype.rawValue=function(e){return e[1]};At.prototype.getConfigTags=function(e){return Fs(e)?e:e&&typeof e=="object"?e.tags:void 0};At.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!Fs(e))return e.escape};var _r={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 At;_r.clearCache=function(){return Uo.clearCache()};_r.parse=function(e,t){return Uo.parse(e,t)};_r.render=function(e,t,n,i){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+tF(e)+'" was given as the first argument for mustache#render(template, view, partials)');return Uo.render(e,t,n,i)};_r.escape=uF;_r.Scanner=Wo;_r.Context=Is;_r.Writer=At;var _h=_r;var Kw=pa(zw());function Qw(r,e){_h.escape=function(t){return t};try{return _h.render(r,(0,Kw.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 Xw(r){return wh(r,[])}function wh(r,e){return{query:{file:r,allTasks:e}}}var Ls=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.
`):e.filters.map(n=>n.explainFilterIndented(this.indentation)).join(`
`)}explainGroups(e){let t=e.grouping.length;if(t===0)return this.indent(`No grouping instructions supplied.
`);let n="";for(let i=0;i<t;i++)n+=this.indentation+e.grouping[i].instruction+`
`;return n}explainSorters(e){let t=e.sorting.length;if(t===0)return this.indent(`No sorting instructions supplied.
`);let n="";for(let i=0;i<t;i++)n+=this.indentation+e.sorting[i].instruction+`
`;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}=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 Us=class{matchesAnyOf(e){return e.some(t=>this.matches(t))}};var Ws=class extends Us{constructor(t){super();this.stringToFind=t}matches(t){return Ws.stringIncludesCaseInsensitive(t,this.stringToFind)}static stringIncludesCaseInsensitive(t,n){return t.toLocaleLowerCase().includes(n.toLocaleLowerCase())}explanation(t){return new Se(t)}};var ti=class extends Us{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 ti(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/
or this:
    /pattern/flags

Where:
- pattern: The 'regular expression' pattern to search for.
- flags:   Optional characters that modify the search.
           i => make the search case-insensitive
           u => add Unicode support

Examples:  /^Log/
           /^Log/i
           /File Name\.md/
           /waiting|waits|waited/i
           /\d\d:\d\d/

The following characters have special meaning in the pattern:
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=gF(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 gF(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 ri=class{constructor(e,t,n,i){this.instruction=e,this.property=t,this.grouper=n,this.reverse=i}};var Ee=class{canCreateFilterForLine(e){return Ee.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 Qn(this.fieldNameSingular())}supportsSorting(){return!1}createSorterFromLine(e){if(!this.supportsSorting())return null;let t=Ee.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=Ee.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 ri(this.grouperInstruction(e),this.fieldNameSingular(),this.grouper(),e)}createNormalGrouper(){return this.createGrouper(!1)}createReverseGrouper(){return this.createGrouper(!0)}};var In=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}allLinesIdentical(){return this._rawInstruction===this._anyContinuationLinesRemoved&&this._rawInstruction===this._anyPlaceholdersExpanded}};var vt=class{constructor(e,t,n){this._statement=new In(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 se=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 se(an.fromObject(e.instruction,e))}static fromError(e,t){return new se(an.fromError(e,t))}};var Ie=class extends Ee{createFilterOrErrorMessage(e){let t=Ee.getMatch(this.filterRegExp(),e);if(t===null)return se.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 Ws(i);else if(n.includes("regex")){try{s=ti.validateAndConstruct(i)}catch(u){let l=qi("Parsing regular expression",u)+`

${ti.helpMessage()}`;return se.fromError(e,l)}if(s===null)return se.fromError(e,`Invalid instruction: '${e}'

${ti.helpMessage()}`)}if(s===null)return se.fromError(e,`do not understand query filter (${this.fieldName()})`);let a=n.match(/not/)!==null,o=new vt(e,this.getFilter(s,a),s.explanation(e));return se.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 Ie{fieldName(){return"description"}value(e){return _e.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=_e.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.

Possible causes:
- The query is an a template file, and is not intended to be searched.
- A command such as "Replace templates in the active file" needs to be run.
- The core "Daily notes" plugin is in use, and the template contained
  date calculations that it does not support.
- Some sample template text was accidentally pasted in to a tasks query,
  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)?se.fromFilter(new vt(e,this._filter,new Se(e))):se.fromError(e,`do not understand filter: ${e}`)}};var jt=class{constructor(){this._filters=[]}add(e,t){this._filters.push(new Dl(e,t))}canCreateFilterForLine(e){return this._filters.some(t=>t.canCreateFilterForLine(e))}createFilterOrErrorMessage(e){for(let t of this._filters){let n=t.createFilterOrErrorMessage(e);if(n.isValid())return n}return se.fromError(e,`do not understand filter: ${e}`)}};var st=class extends Ee{constructor(t=null){super();t!==null?this.filterInstructions=t:(this.filterInstructions=new jt,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 se.fromError(t,n);let i=this.filterInstructions.createFilterOrErrorMessage(t);if(i.isValid())return i;let s=Ee.getMatch(this.filterRegExp(),t);if(s===null)return se.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=Ht.parseDateRange(u);if(!l.isValid()){let m=Ht.parseDate(a);m.isValid()&&(l=new Dt(m,m))}if(!l.isValid())return se.fromError(t,"do not understand "+this.fieldName()+" date");let c=this.buildFilterFunction(o,l),d=st.buildExplanation(this.fieldNameForExplanation(),o,this.filterResultIfFieldMissing(),l);return se.fromFilter(new vt(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)=>dr(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 st{fieldName(){return"created"}date(e){return e.createdDate}filterResultIfFieldMissing(){return!1}};var Rl=class extends st{fieldName(){return"done"}date(e){return e.doneDate}filterResultIfFieldMissing(){return!1}};var qs=class extends st{fieldName(){return"due"}date(e){return e.dueDate}filterResultIfFieldMissing(){return!1}};var vr=class extends Ee{constructor(){super(...arguments);this._filters=new jt}canCreateFilterForLine(t){return this._filters.canCreateFilterForLine(t)}createFilterOrErrorMessage(t){return this._filters.createFilterOrErrorMessage(t)}filterRegExp(){return null}};var Ml=class extends vr{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 kh(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,qi(`Failed parsing expression "${e}"`,n))}}function Eh(r,e){let t=e.map(([n,i])=>i);return r(...t)}function Sh(r,e,t){try{return Eh(r,e)}catch(n){return qi(`Failed calculating expression "${t}"`,n)}}function Cl(r,e){return[["task",r],["query",e?e.query:null]]}function Zw(r,e,t){let n=Cl(r,t||null),i=kh(n,e);return i.error?i.error:Sh(i.queryComponent,n,e)}var $o=class{constructor(e){this.line=e,this.functionOrError=kh(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 Eh(this.functionOrError.queryComponent,Cl(e,t||null))}evaluateOrCatch(e,t){return this.isValid()?Sh(this.functionOrError.queryComponent,Cl(e,t),this.line):`Error: Cannot evaluate an expression which is not valid: "${this.line}" gave error: "${this.parseError}"`}};function Oh(r){if(r===null)return"null";let e=typeof r;return e==="object"?r.constructor.name:e}var Al=class extends Ee{createFilterOrErrorMessage(e){let t=Ee.getMatch(this.filterRegExp(),e);if(t===null)return se.fromError(e,"Unable to parse line");let n=t[1],i=new $o(n);return i.isValid()?se.fromFilter(new vt(e,yF(i),new Se(e))):se.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=Ee.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)),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=Oh(e),i=Oh(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 dr(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 dr(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=Ee.getMatch(this.grouperRegExp(),e);if(t===null)return null;let n=!!t[1],i=t[2];return new ri(e,"function",bF(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 yF(r){return(e,t)=>{let n=t.queryContext();return TF(r,e,n)}}function TF(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 bF(r){return(e,t)=>{let n=t.queryContext();return _F(e,r,n)}}function _F(r,e,t){try{let n=Zw(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 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 $s=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 Dh=class extends Ee{createFilterOrErrorMessage(e){var n;let t=Ee.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 se.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 se.fromFilter(new vt(e,o,new Se(a)))}else return se.fromError(e,"do not understand query filter (priority)")}fieldName(){return"priority"}filterRegExp(){return Dh.priorityRegexp}supportsSorting(){return!0}comparator(){return(e,t)=>e.priority.localeCompare(t.priority)}supportsGrouping(){return!0}grouper(){return e=>[e.priorityNameGroupText]}},ji=Dh;ji.priorityRegexp=/^priority(\s+is)?(\s+(above|below|not))?(\s+(lowest|low|none|medium|high|highest))$/i;var Nl=class extends st{fieldName(){return"scheduled"}date(e){return e.scheduledDate}filterResultIfFieldMissing(){return!1}};var Il=class extends st{fieldName(){return"start"}fieldNameForFilterInstruction(){return"starts"}date(e){return e.startDate}filterResultIfFieldMissing(){return!0}};var Fl=class extends st{constructor(){let e=new jt;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 vr{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 ni=class extends vr{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=ni.oldStatusName(e),i=ni.oldStatusName(t);return n<i?1:n>i?-1:0}}static oldStatusName(e){return e.isDone?"Done":"Todo"}supportsGrouping(){return!0}grouper(){return e=>[ni.oldStatusName(e)]}};var Ul=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 ri(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 Gi=class extends Ul{constructor(){super();this.filterInstructions=new jt,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=Gi.makeCompareByTagComparator(s);return new Wr(t,this.fieldNameSingular(),a,i)}sorterRegExp(){return/^sort by tag( reverse)?[\s]*(\d+)?/i}comparator(){return Gi.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 fk=pa(dk());function ii(r){return new RegExp("["+Qn(r)+"]").source}var Lh=[["(",")"],["[","]"],["{","}"],['"','"']],Fn=class{constructor(e,t,n){this.openFilterChars=e,this.closeFilterChars=t,this.openAndCloseFilterChars=n,this.openFilter=ii(this.openFilterChars),this.closeFilter=ii(this.closeFilterChars)}static allSupportedDelimiters(){let e="",t="",n="";for(let[i,s]of Lh)e+=i,t+=s,n+=Fn.openAndClosing(i,s);return new Fn(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 Lh)if(o===l&&u===c){let d=this.openAndClosing(l,c);return new Fn(l,c,d)}}let s="All filters in a Boolean instruction must be inside one of these pairs of delimiter characters: "+Lh.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 si=class{static preprocessExpression(e,t){let n=si.splitLine(e,t);return si.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("(^"+ii(t.openFilterChars+" ")+"*)"),u=new RegExp("("+ii(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(!si.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(ii(u),"g");n=n.replace(l,"(");let c=t.closeFilterChars,d=new RegExp(ii(c),"g");n=n.replace(d,")")}return{simplifiedLine:n,filters:s}}static isAFilter(e,t){let n=new RegExp("^"+ii(" "+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 Gl=class extends Ee{constructor(){super();this.supportedOperators=["AND","OR","XOR","NOT"];this.subFields={};let t=Fn.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 se.fromError(t,"empty line");let n;try{n=Fn.fromInstructionLine(t)}catch(o){let u=o instanceof Error?o.message:"unknown error type";return se.fromError(t,this.helpMessageFromSimpleError(t,u))}let i=si.preprocessExpression(t,n),s=i.simplifiedLine,a=i.filters;try{let o=(0,fk.parse)(s);for(let c of o)if(c.name==="IDENTIFIER"&&c.value){let d=c.value.trim(),p=a[d];if(c.value=p,!(p in this.subFields)){let m=Go(p);if(m===null)return this.helpMessage(t,`couldn't parse sub-expression '${p}'`,i);if(m.error)return this.helpMessage(t,`couldn't parse sub-expression '${p}': ${m.error}`,i);m.filter&&(this.subFields[p]=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 se.fromFilter(new vt(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 se.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 Yl=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 Ks=class extends Ee{canCreateFilterForLine(e){return!1}createFilterOrErrorMessage(e){return se.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 Ie{constructor(){super()}fieldName(){return"status.name"}value(e){return e.status.name}supportsSorting(){return!0}supportsGrouping(){return!0}};var cn=class extends Ee{canCreateFilterForLine(e){let t=new RegExp(`^(?:${this.fieldNameSingularEscaped()})`,"i");return Ee.lineMatchesFilter(t,e)}createFilterOrErrorMessage(e){let t=Ee.getMatch(this.filterRegExp(),e);if(t===null)return this.helpMessage(e);let n=t[1].toLowerCase(),i=t[2],s=xt[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 se.fromFilter(new vt(e,a,new Se(e)))}filterRegExp(){return new RegExp(`^(?:${this.fieldNameSingularEscaped()}) (is|is not) ([^ ]+)$`,"i")}helpMessage(e){let t=Object.values(xt).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 se.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 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 Vl=class extends Ie{fieldName(){return"folder"}value(e){return e.file.folder}supportsGrouping(){return!0}grouper(){return e=>[Ie.escapeMarkdownCharacters(this.value(e))]}};var zl=class extends Ie{fieldName(){return"root"}value(e){return e.file.root}supportsGrouping(){return!0}grouper(){return e=>[Ie.escapeMarkdownCharacters(this.value(e))]}};var Kl=class extends Ie{fieldName(){return"backlink"}value(e){let t=e.getLinkText({isFilenameUnique:!0});return t===null?"Unknown Location":t}createFilterOrErrorMessage(e){return se.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 st{fieldName(){return"cancelled"}date(e){return e.cancelledDate}filterResultIfFieldMissing(){return!1}};var Xl=class extends vr{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 Ie{constructor(){super();this.filterInstructions=new jt;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 Ee{constructor(){super();this.filterInstructions=new jt;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:se.fromError(t,"Unknown instruction")}fieldName(){return"blocked by"}filterRegExp(){return null}};var ec=class extends vr{fieldName(){return"random"}supportsSorting(){return!0}comparator(){return(e,t)=>this.sortKey(e)-this.sortKey(t)}sortKey(e){let t=i=>{let s=0,a=9;for(;s<i.length;)a=Math.imul(a^i.charCodeAt(s++),387420489);return a^a>>>9},n=window.moment().format("Y-MM-DD");return t(n+" "+e.description)}};var Uh=[()=>new Bl,()=>new cn,()=>new ni,()=>new Ll,()=>new ji,()=>new Fl,()=>new Ql,()=>new xl,()=>new Il,()=>new Nl,()=>new qs,()=>new Rl,()=>new $s,()=>new Vl,()=>new zl,()=>new Kl,()=>new $i,()=>new Gi,()=>new Pl,()=>new Ml,()=>new Yl,()=>new Ks,()=>new Hl,()=>new Al,()=>new Zl,()=>new Jl,()=>new Xl,()=>new ec,()=>new Gl];function Go(r){for(let e of Uh){let t=e();if(t.canCreateFilterForLine(r))return t.createFilterOrErrorMessage(r)}return null}function pk(r){let e=/^sort by /i;if(r.match(e)===null)return null;for(let t of Uh){let i=t().createSorterFromLine(r);if(i)return i}return null}function mk(r){let e=/^group by /i;if(r.match(e)===null)return null;for(let t of Uh){let i=t().createGrouperFromLine(r);if(i)return i}return null}var tc=class{constructor(e,t,n){this.nestingLevel=e,this.displayName=t,this.property=n}};var rc=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 tc(n,i,this.groupers[n].property));for(let s=n;s<e.length;s++)this.lastHeadingAtLevel[s]="";this.lastHeadingAtLevel[n]=i}}return t}};var nc=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 ic=class extends nc{},sc=class{constructor(e,t,n){this.root=new ic(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 ic([]),a.children.set(l,c),s.push(c)),c.values.push(o)}}n=s}}generateTaskTreeStorage(){return this.root.generateAllPaths()}};var ac=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 Qs=class{constructor(e,t,n){this._groups=new Array;this._totalTaskCount=0;this._totalTaskCount=t.length,this._groupers=e;let s=new sc(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 ac(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 rc(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.tasksFile=e,this.allTasks=[...t]}static fromAllTasks(e){return new ai(void 0,e)}get queryPath(){var e,t;return(t=(e=this.tasksFile)==null?void 0:e.path)!=null?t:void 0}queryContext(){return this.tasksFile?wh(this.tasksFile,this.allTasks):void 0}};function hk(r){return`task${r!==1?"s":""}`}var Hi=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} ${hk(e)}`:`${e} of ${t} ${hk(t)}`}get groups(){return this.taskGroups.groups}static fromError(e){let t=new Hi(new Qs([],[],ai.fromAllTasks([])),0);return t._searchErrorMessage=e,t}};function gk(r){return r.endsWith("\\")}function yk(r){return r.endsWith("\\\\")}function zF(r){return r.replace(/^[ \t]*/,"")}function KF(r){return r.replace(/[ \t]*\\$/,"")}function QF(r,e){let t=r;return e&&(t=zF(r)),yk(t)?t=t.slice(0,-1):gk(r)&&(t=KF(t)),t}function Tk(r){let e=[],t=!1,n="",i="";for(let s of r.split(`
`)){let a=QF(s,t);t?(n+=`
`+s,i+=" "+a):(n=s,i=a),yk(s)?t=!1:t=gk(s),t||(i.trim()!==""&&e.push(new In(n,i)),n="",i="")}return e}var Xs=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(Xs.makeCompositeComparator([...s,...i],n))}static defaultSorters(){return[new cn().createNormalSorter(),new Ks().createNormalSorter(),new qs().createNormalSorter(),new ji().createNormalSorter(),new $s().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 $r=class{constructor(e,t=void 0){this._limit=void 0;this._taskGroupLimit=void 0;this._taskLayoutOptions=new en;this._queryLayoutOptions=new ei;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|on completion)/i;this.shortModeRegexp=/^short/i;this.fullModeRegexp=/^full/i;this.explainQueryRegexp=/^explain/i;this.ignoreGlobalQueryRegexp=/^ignore global query/i;this.logger=Rt.getLogger("tasks.Query");this._queryId="";this.limitRegexp=/^limit (groups )?(to )?(\d+)( tasks?)?/i;this.commentRegexp=/^#.*/;this._queryId=this.generateQueryId(10),this.source=e,this.tasksFile=t,this.debug(`Creating query: ${this.formatQueryForLogging()}`),Tk(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 filePath(){var e,t;return(t=(e=this.tasksFile)==null?void 0:e.path)!=null?t:void 0}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.tasksFile===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=Xw(t);try{i=Qw(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 $r(`${this.source}
${e.source}`,this.tasksFile)}explainQuery(){return new Ls().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=$r.generateErrorMessage(t,e)}static generateErrorMessage(e,t){return e.allLinesIdentical()?`${t}
Problem line: "${e.rawInstruction}"`:`${t}
Problem statement:
${e.explainStatement("    ")}
`}get ignoreGlobalQuery(){return this._ignoreGlobalQuery}applyQueryToTasks(e){this.debug(`Executing query: ${this.formatQueryForLogging()}`);let t=new ai(this.tasksFile,e),n;try{this.filters.forEach(u=>{n=u.statement,e=e.filter(l=>u.filterFunction(l,t))}),n=void 0;let{debugSettings:i}=X(),s=i.ignoreSortInstructions?e:Xs.by(this.sorting,e,t),a=s.slice(0,this.limit),o=new Qs(this.grouping,a,t);return this._taskGroupLimit!==void 0&&o.applyTaskLimit(this._taskGroupLimit),new Hi(o,s.length)}catch(i){let a=qi("Search failed",i);return n&&(a=$r.generateErrorMessage(n,a)),Hi.fromError(a)}}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;case"on completion":this._taskLayoutOptions.setVisibility("onCompletion",!n);break;default:this.setError("do not understand hide/show option",new In(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 In(e,e));return}let n=Number.parseInt(t[3],10);t[1]!==void 0?this._taskGroupLimit=n:this._limit=n}parseSortBy(e){let t=pk(e);return t?(this._sorting.push(t),!0):!1}parseGroupBy(e){let t=mk(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 $r(this._source,e)}hasInstructions(){return this._source.trim()!==oi.empty}},tr=oi;tr.empty="";var oc=class{constructor({obsidianEvents:e}){this.logger=Rt.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 Ik=require("obsidian");var Nk=require("obsidian");var Wh=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 bk(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 Wh(i));return e}var _k=require("obsidian");var qh="---",Zs=class{apply(e){throw new Error("MenuDividerInstruction.apply(): Method not implemented.")}instructionDisplayName(){return qh}isCheckedForTask(e){return!1}};function Ln(r,e){return P(this,null,function*(){yield br({originalTask:r,newTasks:e})})}var ui=class extends _k.Menu{constructor(t){super();this.taskSaver=t}addItemsForInstructions(t,n){for(let i of t)this.addItemForInstruction(n,i)}addItemForInstruction(t,n){n.instructionDisplayName()===qh?this.addSeparator():this.addItem(i=>this.getMenuItemCallback(t,i,n))}getMenuItemCallback(t,n,i){n.setTitle(i.instructionDisplayName()).setChecked(i.isCheckedForTask(t)).onClick(()=>P(this,null,function*(){let s=i.apply(t);(s.length!==1||!Object.is(s[0],t))&&(yield this.taskSaver(t,s))}))}};var uc=class extends ui{constructor(e,t,n=Ln){super(n);let i=bk(e);this.addItemsForInstructions(i,t)}};function vk(r){for(let t of te.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 Js(r){return r.dueDate?"dueDate":r.scheduledDate?"scheduledDate":r.startDate?"startDate":null}function $h(r,e,t,n){let i=r[e];return Ek(i,r,e,t,n)}function wk(r,e,t,n){let i=window.moment();return Ek(i,r,e,t,n)}function kk(r,e,t,n){return Sk(r,e,null)}function Ek(r,e,t,n,i){let s=new pt(r).postpone(n,i);return Sk(e,t,s)}function Sk(r,e,t){let n=_t.removeInferredStatusIfNeeded(r,[new te(ce(K({},r),{[e]:t}))])[0];return{postponedDate:t,postponedTask:n}}function Ok(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 Dk(r,e,t){return`\u2139\uFE0F ${jh(r,e,t)} (right-click for more options)`}function jh(r,e,t){let n=Js(r),i=r[n];return ea(n,i,e,t)}function xk(r,e,t){let n=Js(r),i=window.moment().startOf("day");return ea(n,i,e,t)}function Rk(r,e,t){let n=Js(r);return Gh(n,r)}function Gh(r,e){return r==="scheduledDate"&&e.scheduledDateIsInferred?"Cannot remove inferred scheduled date":`Remove ${lc(r)}`}function XF(r){return xs(r.replace("Date",""))}function lc(r){return r.replace("Date"," date")}function ea(r,e,t,n){let s=new pt(e).postpone(n,t).format("ddd Do MMM"),a=t!=1?t:"a";if(e.isSameOrBefore(window.moment(),"day")){let u=XF(r);return(t>=0?`${u} in ${a} ${n}, on ${s}`:`${u} ${-a} ${n} ago, on ${s}`).replace(" 1 day ago"," yesterday").replace(" in 0 days"," today").replace("in a day","tomorrow")}let o=lc(r);return t>=0?`Postpone ${o} by ${a} ${n}, to ${s}`:`Backdate ${o} by ${-a} ${n}, to ${s}`}function Mk(r){return["startDate","scheduledDate","dueDate"].includes(r)}var Yo=class{constructor(e,t,n){this.newDate=t,this.dateFieldToEdit=e,this.displayName=n!=null?n:`Set Date: ${this.newDate.toDateString()}`}apply(e){return this.isCheckedForTask(e)?[e]:[new te(ce(K({},e),{[this.dateFieldToEdit]:window.moment(this.newDate)}))]}instructionDisplayName(){return this.displayName}isCheckedForTask(e){var t;return((t=e[this.dateFieldToEdit])==null?void 0:t.isSame(window.moment(this.newDate)))||!1}},jr=class extends Yo{constructor(e,t,n,i){var u;let s=(u=t[e])!=null?u:window.moment(),a=ea(e,s,n,i),o=new pt(window.moment(s)).postpone(i,n).toDate();super(e,o,a)}},Yh=class{constructor(e,t){this.dateFieldToEdit=e,this.displayName=Gh(e,t)}apply(e){let t=this.dateFieldToEdit==="scheduledDate"&&e.scheduledDateIsInferred;return e[this.dateFieldToEdit]===null||t?[e]:[new te(ce(K({},e),{[this.dateFieldToEdit]:null}))]}instructionDisplayName(){return this.displayName}isCheckedForTask(e){return!1}};function Ck(r,e){return Pk(e,r,1)}function Ak(r,e){return Pk(e,r,-1)}function Pk(r,e,t){let n=window.moment().startOf("day"),i=n.toDate(),s=new pt(n.clone());return[new Yo(e,i,ea(e,n,0,"days")),new Yo(e,s.postpone("day",t).toDate(),ea(e,n,t,"day")),new Zs,new jr(e,r,t*2,"days"),new jr(e,r,t*3,"days"),new jr(e,r,t*4,"days"),new jr(e,r,t*5,"days"),new jr(e,r,t*6,"days"),new Zs,new jr(e,r,t,"week"),new jr(e,r,t*2,"weeks"),new jr(e,r,t*3,"weeks"),new jr(e,r,t,"month"),new Zs,new Yh(e,r)]}var cc=class extends ui{constructor(e,t,n=Ln){super(n);let i=Mk(e)?Ck(e,t):Ak(e,t);this.addItemsForInstructions(i,t)}};var dc=class{constructor(){this.data=ZF}addDataAttribute(e,t,n){this.data[n].addDataAttribute(e,t,n)}addClassName(e,t){let n=this.data[t].className;e.classList.add(n)}},Bh=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===Bh.noAttributeName)return;let i=this.attributeValueCalculator(n,t);i!==""&&(e.dataset[this.attributeName]=i)}},Gr=Bh;Gr.noAttributeName="",Gr.noAttributeValueCalculator=()=>"",Gr.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 ta(r){return new Gr(r,Gr.noAttributeName,Gr.noAttributeValueCalculator)}function ra(r,e){return new Gr(r,e,Gr.dateAttributeCalculator)}var ZF={createdDate:ra("task-created","taskCreated"),dueDate:ra("task-due","taskDue"),startDate:ra("task-start","taskStart"),scheduledDate:ra("task-scheduled","taskScheduled"),doneDate:ra("task-done","taskDone"),cancelledDate:ra("task-cancelled","taskCancelled"),priority:new Gr("task-priority","taskPriority",(r,e)=>xn.priorityNameUsingNormal(e.priority).toLocaleLowerCase()),description:ta("task-description"),recurrenceRule:ta("task-recurring"),onCompletion:ta("task-onCompletion"),dependsOn:ta("task-dependsOn"),id:ta("task-id"),blockLink:ta("task-block-link")};function gt(r,e){let t=document.createElement(r);return e.appendChild(t),t}var Un=class{static obsidianMarkdownRenderer(e,t,n,i){return P(this,null,function*(){!i||(yield Nk.MarkdownRenderer.renderMarkdown(e,t,n,i))})}constructor({textRenderer:e=Un.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 P(this,null,function*(){let i=gt("li",this.parentUlElement);i.classList.add("task-list-item","plugin-tasks-list-item");let s=gt("span",i);s.classList.add("tasks-list-text"),yield this.taskToHtml(e,s,i);let a=gt("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();br({originalTask:e,newTasks:l})}),a.addEventListener("contextmenu",u=>{new uc(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 P(this,null,function*(){let i=new dc,s=Nr.tasksPluginEmoji.taskSerializer;for(let a of this.taskLayoutOptions.shownComponents){let o=s.componentToString(e,this.queryLayoutOptions.shortMode,a);if(o){let u=gt("span",t),l=gt("span",u);if(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),te.allDateFields().includes(a)){let c=a;u.addEventListener("contextmenu",d=>{d.preventDefault(),d.stopPropagation(),new cc(c,e,Ln).showAtPosition({x:d.clientX,y:d.clientY})}),u.setAttribute("title",`Right-click to edit ${lc(c)}`)}}}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 P(this,null,function*(){if(n==="description"){t=_e.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(b,k,_){k&&b.createDiv().setText(p({signifier:_,date:k}))}function p({signifier:b,date:k}){return`${b} ${k.format(J.dateFormat)} (${k.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 y=e.getLinkText({isFilenameUnique:n});y&&m.createDiv().setText(`\u{1F517} ${y}`),t.addEventListener("mouseleave",()=>{m.remove()})})}};var fc=class{constructor({plugin:e}){this.markdownPostProcessor=this._markdownPostProcessor.bind(this);e.registerMarkdownPostProcessor(this._markdownPostProcessor.bind(this))}_markdownPostProcessor(e,t){return P(this,null,function*(){var d;let n=new Ik.MarkdownRenderChild(e);t.addChild(n);let i=e.findAll(".task-list-item").filter(p=>{var b;let m=(b=p.textContent)==null?void 0:b.split(`
`);if(m===void 0)return!1;let y=null;for(let k=0;k<m.length;k=k+1)if(m[k]!==""){y=m[k];break}return y===null?!1:_e.getInstance().includedIn(y)});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 y=null,b=te.fromLine({line:m,taskLocation:new mt(new ot(s),p,a.lineStart,u,y),fallbackDate:null});b!==null&&(l.push(b),u++)}let c=new Un({obsidianComponent:n,parentUlElement:e,taskLayoutOptions:new en,queryLayoutOptions:new ei});for(let p=0;p<i.length;p++){let m=l[p],y=i[p];if(m===void 0||y===void 0)continue;let b=(d=y.getAttr("data-line"))!=null?d:"0",k=Number.parseInt(b,10),_=yield c.renderTaskLine(m,k),R=y.childNodes;for(let q=0;q<R.length;q=q+1){let ne=R[q],G=ne.nodeName.toLowerCase();G==="div"?_.prepend(ne):(G==="ul"||G==="ol")&&_.append(ne)}let S=y.querySelectorAll("[data-footnote-id]"),F=_.querySelectorAll("[data-footnote-id]");if(S.length===F.length)for(let q=0;q<S.length;q++)F[q].replaceWith(S[q]);y.replaceWith(_)}})}};var Fk=require("@codemirror/view"),Lk=require("obsidian");var Uk=()=>Fk.ViewPlugin.fromClass(Hh),Hh=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 Lk.Notice(p,45e3)}return!1}let{state:i}=this.view,s=this.view.posAtDOM(t),a=i.doc.lineAt(s),o=te.fromLine({line:a.text,taskLocation:mt.fromUnknownPosition(new ot("")),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 yc=require("obsidian"),qk=require("obsidian");function Wk(r,e,t,n=void 0){let i="";e.isEmpty()||(i+=`Only tasks containing the global filter '${e.get()}'.

`);let s=new Ls("  "),a=new $r(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 Bo(r,e,t){let n=new $r(r,t);return n.ignoreGlobalQuery?n:e.query(t).append(n)}function Ho(r,e,t){e&&r.push(JF(t))}function JF(r){return`tasks-layout-hide-${r}`}var pc=class{constructor(e){e?this.queryLayoutOptions=e:this.queryLayoutOptions=new ei}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}};var mc=class{constructor(e){e?this.taskLayoutOptions=e:this.taskLayoutOptions=new en}generateHiddenClasses(){let e=[];return this.taskLayoutOptions.toggleableComponents.forEach(t=>{Ho(e,!this.taskLayoutOptions.isShown(t),t)}),Ho(e,!this.taskLayoutOptions.areTagsShown(),"tags"),e}};var Vo=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.toFixed(2),"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 Vh=require("obsidian");var li=class extends ui{constructor(e,t,n=Ln){super(n);let i=(l,c,d,p,m,y)=>{var R;let b=!1,k=Js(t);if(k){let{postponedDate:S}=y(t,k,d,p);(R=t[k])!=null&&R.isSame(S,"day")&&(b=!0)}let _=m(t,p,d);c.setChecked(b).setTitle(_).onClick(()=>li.postponeOnClickCallback(l,t,p,d,y,n))},s=xk,a=wk;this.addItem(l=>i(e,l,"days",0,s,a)),this.addItem(l=>i(e,l,"day",1,s,a)),this.addSeparator();let o=jh,u=$h;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,Rk,kk))}static postponeOnClickCallback(o,u,l,c){return P(this,arguments,function*(e,t,n,i,s=$h,a=Ln){var y;let d=Js(t);if(d===null){let b="\u26A0\uFE0F Postponement requires a date: due, scheduled or start.";return new Vh.Notice(b,1e4)}let{postponedDate:p,postponedTask:m}=s(t,d,i,n);(y=t[d])!=null&&y.isSame(p,"day")||(yield a(t,m),li.postponeSuccessCallback(e,d,p))})}static postponeSuccessCallback(e,t,n){e.style.pointerEvents="none";let i=Ok(n,t);new Vh.Notice(i,2e3)}};var hc=class{constructor(e,t,n,i,s,a=Un.obsidianMarkdownRenderer){switch(this.source=t,this.tasksFile=n,this.renderMarkdown=i,this.obsidianComponent=s,this.textRenderer=a,e){case"block-language-tasks":this.query=Bo(this.source,tr.getInstance(),this.tasksFile),this.queryType="tasks";break;default:this.query=Bo(this.source,tr.getInstance(),this.tasksFile),this.queryType="tasks";break}}get filePath(){var e,t;return(t=(e=this.tasksFile)==null?void 0:e.path)!=null?t:void 0}render(e,t,n,i){return P(this,null,function*(){e==="Warm"&&this.query.error===void 0?yield this.renderQuerySearchResults(t,e,n,i):this.query.error!==void 0?this.renderErrorMessage(n,this.query.error):this.renderLoadingMessage(n)})}renderQuerySearchResults(e,t,n,i){return P(this,null,function*(){let s=this.explainAndPerformSearch(t,e,n);if(s.searchErrorMessage!==void 0){this.renderErrorMessage(n,s.searchErrorMessage);return}yield this.renderSearchResults(s,n,i)})}explainAndPerformSearch(e,t,n){let i=new Vo(`Search: ${this.query.queryId} - ${this.filePath}`);i.start(),this.query.debug(`[render] Render called: plugin state: ${e}; searching ${t.length} tasks`),this.query.queryLayoutOptions.explainQuery&&this.createExplanation(n);let s=this.query.applyQueryToTasks(t);return i.finish(),s}renderSearchResults(e,t,n){return P(this,null,function*(){let i=new Vo(`Render: ${this.query.queryId} - ${this.filePath}`);i.start(),yield this.addAllTaskGroups(e.taskGroups,t,n);let s=e.totalTasksCount;this.addTaskCount(t,e),this.query.debug(`[render] ${s} tasks displayed`),i.finish()})}renderErrorMessage(e,t){e.createDiv().innerHTML=`<pre>Tasks query: ${t.replace(/\n/g,"<br>")}</pre>`}renderLoadingMessage(e){e.setText("Loading Tasks ...")}createExplanation(e){let t=Wk(this.source,_e.getInstance(),tr.getInstance(),this.tasksFile),n=gt("pre",e);n.classList.add("plugin-tasks-query-explanation"),n.setText(t),e.appendChild(n)}addAllTaskGroups(e,t,n){return P(this,null,function*(){for(let i of e.groups)yield this.addGroupHeadings(t,i.groupHeadings),yield this.createTaskList(i.tasks,t,n)})}createTaskList(e,t,n){return P(this,null,function*(){let i=gt("ul",t);i.classList.add("contains-task-list","plugin-tasks-query-result");let s=new mc(this.query.taskLayoutOptions);i.classList.add(...s.generateHiddenClasses());let a=new pc(this.query.queryLayoutOptions);i.classList.add(...a.getHiddenClasses());let o=this.getGroupingAttribute();o&&o.length>0&&(i.dataset.taskGroupBy=o);let u=new Un({textRenderer:this.textRenderer,obsidianComponent:this.obsidianComponent,parentUlElement:i,taskLayoutOptions:this.query.taskLayoutOptions,queryLayoutOptions:this.query.queryLayoutOptions});for(let[l,c]of e.entries())yield this.addTask(i,u,c,l,n);t.appendChild(i)})}addTask(e,t,n,i,s){return P(this,null,function*(){let a=this.isFilenameUnique({task:n},s.allMarkdownFiles),o=yield t.renderTaskLine(n,i,a);o.querySelectorAll("[data-footnote-id]").forEach(d=>d.remove());let l=gt("span",o);l.classList.add("task-extras"),this.query.queryLayoutOptions.hideUrgency||this.addUrgency(l,n);let c=this.query.queryLayoutOptions.shortMode;this.query.queryLayoutOptions.hideBacklinks||this.addBacklinks(l,n,c,a,s),this.query.queryLayoutOptions.hideEditButton||this.addEditButton(l,n,s),!this.query.queryLayoutOptions.hidePostponeButton&&vk(n)&&this.addPostponeButton(l,n,c),e.appendChild(o)})}addEditButton(e,t,n){let i=gt("a",e);i.classList.add("tasks-edit"),i.title="Edit task",i.href="#",i.addEventListener("click",s=>n.editTaskPencilClickHandler(s,t,n.allTasks))}addUrgency(e,t){let n=new Intl.NumberFormat().format(t.urgency);e.createSpan({text:n,cls:"tasks-urgency"})}addGroupHeadings(e,t){return P(this,null,function*(){for(let n of t)yield this.addGroupHeading(e,n)})}addGroupHeading(e,t){return P(this,null,function*(){let n="h6";t.nestingLevel===0?n="h4":t.nestingLevel===1&&(n="h5");let i=gt(n,e);i.classList.add("tasks-group-heading"),this.obsidianComponent!==null&&(yield this.renderMarkdown(t.displayName,i,this.tasksFile.path,this.obsidianComponent))})}addBacklinks(e,t,n,i,s){var l;let a=gt("span",e);a.classList.add("tasks-backlink"),n||a.append(" (");let o=gt("a",a);o.rel="noopener",o.target="_blank",o.classList.add("internal-link"),n&&o.classList.add("internal-link-short-mode");let u;n?u=" \u{1F517}":u=(l=t.getLinkText({isFilenameUnique:i}))!=null?l:"",o.text=u,o.addEventListener("click",c=>P(this,null,function*(){yield s.backlinksClickHandler(c,t)})),o.addEventListener("mousedown",c=>P(this,null,function*(){yield s.backlinksMousedownHandler(c,t)})),n||a.append(")")}addPostponeButton(e,t,n){let s="day",a=Dk(t,1,s),o=gt("a",e);o.classList.add("tasks-postpone"),n&&o.classList.add("tasks-postpone-short-mode"),o.title=a,o.addEventListener("click",u=>{u.preventDefault(),u.stopPropagation(),li.postponeOnClickCallback(o,t,1,s)}),o.addEventListener("contextmenu",u=>P(this,null,function*(){u.preventDefault(),u.stopPropagation(),new li(o,t).showAtPosition({x:u.clientX,y:u.clientY})}))}addTaskCount(e,t){if(!this.query.queryLayoutOptions.hideTaskCount){let n=gt("div",e);n.classList.add("task-count"),n.textContent=t.totalTasksCountDisplayText()}}isFilenameUnique({task:e},t){let n=e.path.match(/([^/]*)\..+$/i);if(n===null)return;let i=n[1];return t.filter(a=>{if(a.basename===i)return!0}).length<2}getGroupingAttribute(){let e=[];for(let t of this.query.grouping)e.push(t.property);return e.join(",")}};var gc=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 P(this,null,function*(){let i=new zh({app:this.app,plugin:this.plugin,events:this.events,container:t,source:e,tasksFile:new ot(n.sourcePath)});n.addChild(i),i.load()})}},zh=class extends yc.MarkdownRenderChild{constructor({app:t,plugin:n,events:i,container:s,source:a,tasksFile:o}){super(s);this.queryResultsRenderer=new hc(this.containerEl.className,a,o,yc.MarkdownRenderer.renderMarkdown,this),this.app=t,this.plugin=n,this.events=i}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.queryResultsRenderer.query=Bo(this.queryResultsRenderer.source,tr.getInstance(),this.queryResultsRenderer.tasksFile),this.events.triggerRequestCacheUpdate(this.render.bind(this)),this.reloadQueryAtMidnight()},i+1e3)}render(i){return P(this,arguments,function*({tasks:t,state:n}){var a;let s=gt("div",this.containerEl);yield this.queryResultsRenderer.render(n,t,s,{allTasks:this.plugin.getTasks(),allMarkdownFiles:this.app.vault.getMarkdownFiles(),backlinksClickHandler:tL,backlinksMousedownHandler:rL,editTaskPencilClickHandler:eL}),(a=this.containerEl.firstChild)==null||a.replaceWith(s)})}};function eL(r,e,t){r.preventDefault();let n=s=>P(this,null,function*(){yield br({originalTask:e,newTasks:_t.removeInferredStatusIfNeeded(e,s)})});new Jn({app,task:e,onSubmit:n,allTasks:t}).open()}function tL(r,e){return P(this,null,function*(){let t=yield dh(e,app.vault);if(t){let[n,i]=t,s=app.workspace.getLeaf(qk.Keymap.isModEvent(r));r.preventDefault(),yield s.openFile(i,{eState:{line:n}})}})}function rL(r,e){return P(this,null,function*(){if(r.button===1){let t=yield dh(e,app.vault);if(t){let[n,i]=t,s=app.workspace.getLeaf("tab");r.preventDefault(),yield s.openFile(i,{eState:{line:n}})}}})}var ve=require("obsidian");var Tc=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 $k(r,e){return r.findIndex(t=>t.symbol===e)}function Wn(r){return r===""?r:"`"+(r!==" "?r:"space")+"`"}function nL(r,e){let t=re.getTypeForUnknownSymbol(r.symbol);r.type!==t&&(t==="TODO"&&r.symbol!==" "||e.push(`For information, the conventional type for status symbol ${Wn(r.symbol)} is ${Wn(t)}: you may wish to review this type.`))}function iL(r,e,t){let n=$k(r,e.nextStatusSymbol);if(n===-1){t.push(`Next symbol ${Wn(e.nextStatusSymbol)} is unknown: create a status with symbol ${Wn(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 ${Wn(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 sL(r,e,t){let n=[];return e.symbol===re.EMPTY.symbol?(n.push("Empty symbol: this status will be ignored."),n):$k(r,e.symbol)!=t?(n.push(`Duplicate symbol '${Wn(e.symbol)}': this status will be ignored.`),n):(nL(e,n),iL(r,e,n),n)}function jk(r){let e=new Tc(["Status Symbol","Next Status Symbol","Status Name","Status Type","Problems (if any)"]),t=Le.allStatuses(r);return t.forEach((n,i)=>{e.addRow([Wn(n.symbol),Wn(n.nextStatusSymbol),n.name,Wn(n.type),sL(t,n,i).join("<br>")])}),e.markdown}function Gk(r,e,t,n){let s=jk(r),a=e.mermaidDiagram(!0);return`# ${t}

## About this file

This file was created by the Obsidian Tasks plugin (version ${n}) to help visualise the task statuses in this vault.

If you change the Tasks status settings, you can get an updated report by:

- Going to \`Settings\` -> \`Tasks\`.
- Clicking on \`Review and check your Statuses\`.

You can delete this file any time.

## Status Settings

<!--
Switch to Live Preview or Reading Mode to see the table.
If there are any Markdown formatting characters in status names, such as '*' or '_',
Obsidian may only render the table correctly in Reading Mode.
-->

These are the status values in the Core and Custom statuses sections.

${s}
## Loaded Settings

<!-- 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 Hk(){return[[" ","To Do","x","TODO"],["/","In Progress","x","IN_PROGRESS"],["x","Done"," ","DONE"],["-","Cancelled"," ","CANCELLED"],[">","Rescheduled","x","TODO"],["<","Scheduled","x","TODO"],["!","Important","x","TODO"],["?","Question","x","TODO"],["i","Infomation","x","TODO"],["S","Amount","x","TODO"],["*","Star","x","TODO"],["b","Bookmark","x","TODO"],["\u201C","Quote","x","TODO"],["n","Note","x","TODO"],["l","Location","x","TODO"],["I","Idea","x","TODO"],["p","Pro","x","TODO"],["c","Con","x","TODO"],["u","Up","x","TODO"],["d","Down","x","TODO"]]}function Vk(){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 zk(){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 Kk(){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 Qk(){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 Xk(){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 Zk=[{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 Yr=require("obsidian");var Vi=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=re.createFromImportedValue(e).configuration;return a.push(...this.validateSymbolTypeConventions(o)),a.push(...this.validate(o)),a}validateSymbol(e){return Vi.validateOneSymbol(e.symbol,"Task Status Symbol")}validateNextSymbol(e){return Vi.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=xt[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 zi=new Vi,rr=class extends Yr.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 Qe(this.statusSymbol,this.statusName,this.statusNextSymbol,this.statusAvailableAsCommand,this.type)}display(){return P(this,null,function*(){let{contentEl:t}=this;t.empty();let n=t.createDiv(),i;new Yr.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,rr.setValid(l,zi.validateSymbol(this.statusConfiguration()))})}).setDisabled(this.isCoreStatus).then(l=>{rr.setValid(i,zi.validateSymbol(this.statusConfiguration()))});let s;new Yr.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,rr.setValid(l,zi.validateName(this.statusConfiguration()))})}).then(l=>{rr.setValid(s,zi.validateName(this.statusConfiguration()))});let a;new Yr.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,rr.setValid(l,zi.validateNextSymbol(this.statusConfiguration()))})}).then(l=>{rr.setValid(a,zi.validateNextSymbol(this.statusConfiguration()))}),new Yr.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=re.getTypeFromStatusTypeString(d)})}),re.tasksPluginCanCreateCommandsForStatuses()&&new Yr.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=>P(this,null,function*(){this.statusAvailableAsCommand=c}))});let o=t.createDiv(),u=new Yr.Setting(o);u.addButton(l=>(l.setTooltip("Save").setIcon("checkmark").onClick(()=>P(this,null,function*(){let c=zi.validate(this.statusConfiguration());if(c.length>0){let d=c.join(`
`)+`

Fix errors before saving.`;new Yr.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?rr.removeValidationError(t):rr.setValidationError(t)}};var Pt=class extends ve.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 P(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 ve.Setting(t).setName("Task Format").setDesc(Pt.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=>P(this,null,function*(){ze({taskFormat:s}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Global filter Settings"}),new ve.Setting(t).setName("Global task filter").setDesc(Pt.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(_e.getInstance().get()).onChange(s=>P(this,null,function*(){ze({globalFilter:s}),_e.getInstance().set(s),yield this.plugin.saveSettings()}))}),new ve.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=>P(this,null,function*(){ze({removeGlobalFilter:a}),_e.getInstance().setRemoveGlobalFilter(a),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Global Query"}),lL(new ve.Setting(t).setDesc(Pt.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=>P(this,null,function*(){ze({globalQuery:a}),tr.getInstance().set(a),yield this.plugin.saveSettings()}))})),t.createEl("h4",{text:"Task Statuses"});let{headingOpened:n}=X();Zk.forEach(i=>{this.addOneSettingsBlock(t,i,n)}),t.createEl("h4",{text:"Date Settings"}),new ve.Setting(t).setName("Set created date on every added task").setDesc(Pt.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=>P(this,null,function*(){ze({setCreatedDate:a}),yield this.plugin.saveSettings()}))}),new ve.Setting(t).setName("Set done date on every completed task").setDesc(Pt.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=>P(this,null,function*(){ze({setDoneDate:a}),yield this.plugin.saveSettings()}))}),new ve.Setting(t).setName("Set cancelled date on every cancelled task").setDesc(Pt.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=>P(this,null,function*(){ze({setCancelledDate:a}),yield this.plugin.saveSettings()}))}),new ve.Setting(t).setName("Use filename as Scheduled date for undated tasks").setDesc(Pt.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>By default, Tasks plugin will match both <code>YYYY-MM-DD</code> and <code>YYYYMMDD</code> date 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=>P(this,null,function*(){ze({useFilenameAsScheduledDate:a}),yield this.plugin.saveSettings()}))}),new ve.Setting(t).setName("Additional filename date format as Scheduled date for undated tasks").setDesc(Pt.createFragmentWithHTML('An additional date format that Tasks plugin will recogize when using the file name as the Scheduled date for undated tasks.</br><p><a href="https://momentjs.com/docs/#/displaying/format/">Syntax Reference</a></p>')).addText(i=>{let s=X();i.setPlaceholder("example: MMM DD YYYY").setValue(s.filenameAsScheduledDateFormat).onChange(a=>P(this,null,function*(){ze({filenameAsScheduledDateFormat:a}),yield this.plugin.saveSettings()}))}),new ve.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=>P(this,null,function*(){let s=X();yield this.plugin.saveSettings(),i.setValue(Pt.renderFolderArray(s.filenameAsDateFolders)).onChange(a=>P(this,null,function*(){let o=Pt.parseCommaSeparatedFolders(a);ze({filenameAsDateFolders:o}),yield this.plugin.saveSettings()}))})),t.createEl("h4",{text:"Recurring task Settings"}),new ve.Setting(t).setName("Next recurrence appears on the line below").setDesc(Pt.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=>P(this,null,function*(){ze({recurrenceOnNextLine:a}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Auto-suggest Settings"}),new ve.Setting(t).setName("Auto-suggest task content").setDesc(Pt.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=>P(this,null,function*(){ze({autoSuggestInEditor:a}),yield this.plugin.saveSettings()}))}),new ve.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=>P(this,null,function*(){ze({autoSuggestMinMatch:a}),yield this.plugin.saveSettings()}))}),new ve.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,20,1).setValue(s.autoSuggestMaxItems).setDynamicTooltip().onChange(a=>P(this,null,function*(){ze({autoSuggestMaxItems:a}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Dialog Settings"}),new ve.Setting(t).setName("Provide access keys in dialogs").setDesc(Pt.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=>P(this,null,function*(){ze({provideAccessKeys:a}),yield this.plugin.saveSettings()}))})}addOneSettingsBlock(t,n,i){let s=t.createEl("details",{cls:"tasks-nested-settings",attr:K({},n.open||i[n.text]?{open:!0}:{})});s.empty(),s.ontoggle=()=>{i[n.text]=s.open,ze({headingOpened:i}),this.plugin.saveSettings()};let a=s.createEl("summary");if(new ve.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!==""&&!Iv(o.featureFlag))&&(o.type==="checkbox"?new ve.Setting(s).setName(o.name).setDesc(o.description).addToggle(u=>{let l=X();l.generalSettings[o.settingName]||Ai(o.settingName,o.initialValue),u.setValue(l.generalSettings[o.settingName]).onChange(c=>P(this,null,function*(){Ai(o.settingName,c),yield this.plugin.saveSettings()}))}):o.type==="text"?new ve.Setting(s).setName(o.name).setDesc(o.description).addText(u=>{let l=X();l.generalSettings[o.settingName]||Ai(o.settingName,o.initialValue);let c=d=>P(this,null,function*(){Ai(o.settingName,d),yield this.plugin.saveSettings()});u.setPlaceholder(o.placeholder.toString()).setValue(l.generalSettings[o.settingName].toString()).onChange((0,ve.debounce)(c,500,!0))}):o.type==="textarea"?new ve.Setting(s).setName(o.name).setDesc(o.description).addTextArea(u=>{let l=X();l.generalSettings[o.settingName]||Ai(o.settingName,o.initialValue);let c=d=>P(this,null,function*(){Ai(o.settingName,d),yield this.plugin.saveSettings()});u.setPlaceholder(o.placeholder.toString()).setValue(l.generalSettings[o.settingName].toString()).onChange((0,ve.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=>{Jk(t,a,i.coreStatuses,i,n,n.plugin,!0)}),new ve.Setting(t).addButton(a=>{let o="Review and check your Statuses";a.setButtonText(o).setCta().onClick(()=>P(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=De.getInstance(),m=Gk(i,p,o,d),y=yield this.app.vault.create(c,m);yield this.app.workspace.getLeaf(!0).openFile(y)})),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=>{Jk(t,l,i.customStatuses,i,n,n.plugin,!1)}),t.createEl("div"),new ve.Setting(t).addButton(l=>{l.setButtonText("Add New Task Status").setCta().onClick(()=>P(this,null,function*(){Le.addStatus(i.customStatuses,new Qe("","","",!1,"TODO")),yield na(i,n)}))}).infoEl.remove();let a=[["AnuPpuccin Theme",Yk()],["Aura Theme",Bk()],["Border Theme",Hk()],["Ebullientworks Theme",Vk()],["ITS Theme & SlRvb Checkboxes",zk()],["Minimal Theme",Qk()],["Things Theme",Xk()],["LYT Mode Theme (Dark mode only)",Kk()]];for(let[l,c]of a)new ve.Setting(t).addButton(p=>{let m=`${l}: Add ${c.length} supported Statuses`;p.setButtonText(m).onClick(()=>P(this,null,function*(){yield uL(c,i,n)}))}).infoEl.remove();new ve.Setting(t).addButton(l=>{l.setButtonText("Add All Unknown Status Types").setCta().onClick(()=>P(this,null,function*(){let d=this.plugin.getTasks().map(m=>m.status),p=De.getInstance().findUnknownStatuses(d);p.length!==0&&(p.forEach(m=>{Le.addStatus(i.customStatuses,m)}),yield na(i,n))}))}).infoEl.remove(),new ve.Setting(t).addButton(l=>{l.setButtonText("Reset Custom Status Types to Defaults").setWarning().onClick(()=>P(this,null,function*(){Le.resetAllCustomStatuses(i),yield na(i,n)}))}).infoEl.remove()}},zo=Pt;zo.createFragmentWithHTML=t=>createFragment(n=>n.createDiv().innerHTML=t);function Jk(r,e,t,n,i,s,a){let o=r.createEl("pre");o.addClass("row-for-status"),o.textContent=new re(e).previewText();let u=new ve.Setting(r);u.infoEl.replaceWith(o),a||u.addExtraButton(l=>{l.setIcon("cross").setTooltip("Delete").onClick(()=>P(this,null,function*(){Le.deleteStatus(t,e)&&(yield na(n,i))}))}),u.addExtraButton(l=>{l.setIcon("pencil").setTooltip("Edit").onClick(()=>P(this,null,function*(){let c=new rr(s,e,a);c.onClose=()=>P(this,null,function*(){c.saved&&Le.replaceStatus(t,e,c.statusConfiguration())&&(yield na(n,i))}),c.open()}))}),u.infoEl.remove()}function uL(r,e,t){return P(this,null,function*(){Le.bulkAddStatusCollection(e,r).forEach(i=>{new ve.Notice(i)}),yield na(e,t)})}function na(r,e){return P(this,null,function*(){ze({statusSettings:r}),Le.applyToStatusRegistry(r,De.getInstance()),yield e.saveSettings(!0)})}function lL(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 ci=require("obsidian");function cL(r){console.error(r),new ci.Notice(r+`

This message has been written to the console.
`,1e4)}var bc=class extends ci.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 Pv(s,t,n)?{start:{line:t.line,ch:0},end:{line:t.line,ch:s.length},query:s}:null}getSuggestions(t){var c,d,p;let n=t.query,i=t.editor.getCursor(),s=this.plugin.getTasks(),a=s.find(m=>m.taskLocation.path==t.file.path&&m.taskLocation.lineNumber==i.line),o=this.getMarkdownFileInfo(t),u=this.canSaveEdits(o);return((p=(d=(c=Oo()).buildSuggestions)==null?void 0:d.call(c,n,i.ch,this.settings,s,u,a))!=null?p:[]).map(m=>ce(K({},m),{context:t}))}getMarkdownFileInfo(t){return t.editor.cm.state.field(ci.editorInfoField)}canSaveEdits(t){return t instanceof ci.MarkdownView}renderSuggestion(t,n){n.setText(t.displayText)}selectSuggestion(t,n){return P(this,null,function*(){var l,c,d;let i=t.context.editor;if(t.suggestionType==="empty"){this.close();let p=new KeyboardEvent("keydown",{code:"Enter",key:"Enter"});(c=(l=i==null?void 0:i.cm)==null?void 0:l.contentDOM)==null||c.dispatchEvent(p);return}if(t.taskItDependsOn!=null){let p=nl(t.taskItDependsOn,this.plugin.getTasks().map(m=>m.id));if(t.appendText+=` ${p.id}`,t.taskItDependsOn!==p)if(t.context.file.path==p.path){let m=t.taskItDependsOn.originalMarkdown,y={line:t.taskItDependsOn.lineNumber,ch:0},b={line:t.taskItDependsOn.lineNumber,ch:m.length},k=t.context.editor.getRange(y,b);if(k!==m){let _=`Error adding new ID, due to mismatched data in Tasks memory and the editor:
task line in memory: '${t.taskItDependsOn.originalMarkdown}'

task line in editor: '${k}'

file: '${p.path}'
`;cL(_);return}t.context.editor.replaceRange(p.toFileLineString(),y,b)}else br({originalTask:t.taskItDependsOn,newTasks:p})}let s=t.context.editor.getCursor(),a={line:s.line,ch:(d=t.insertAt)!=null?d: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});let u=this.getMarkdownFileInfo(t.context);this.canSaveEdits(u)&&(yield u.save())})}};var eE=(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 tE=(r,e)=>{let t=El({line:"",path:""});return new Jn({app:r,task:t,onSubmit:e,allTasks:[]})};var rE=r=>({createTaskLineModal:()=>eE(r,tE),executeToggleTaskDoneCommand:(e,t)=>yh(e,t).text});var _c=class extends nE.Plugin{get apiV1(){return rE(this.app)}onload(){return P(this,null,function*(){Rt.registerConsoleLogger(),Hm("info",`loading plugin "${this.manifest.name}" v${this.manifest.version}`),yield this.loadSettings();let{loggingOptions:t}=X();Rt.configure(t),this.addSettingTab(new zo({plugin:this})),Dw({metadataCache:this.app.metadataCache,vault:this.app.vault,workspace:this.app.workspace}),yield this.loadTaskStatuses();let n=new oc({obsidianEvents:this.app.workspace});this.cache=new ks({metadataCache:this.app.metadataCache,vault:this.app.vault,workspace:this.app.workspace,events:n}),this.inlineRenderer=new fc({plugin:this}),this.queryRenderer=new gc({plugin:this,events:n}),this.registerEditorExtension(Uk()),this.registerEditorSuggest(new bc(this.app,X(),this)),new Sl({plugin:this})})}loadTaskStatuses(){return P(this,null,function*(){let{statusSettings:t}=X();Le.applyToStatusRegistry(t,De.getInstance())})}onunload(){var t;Hm("info",`unloading plugin "${this.manifest.name}" v${this.manifest.version}`),(t=this.cache)==null||t.unload()}loadSettings(){return P(this,null,function*(){let t=yield this.loadData();ze(t),t=X(),_e.getInstance().set(t.globalFilter),_e.getInstance().setRemoveGlobalFilter(t.removeGlobalFilter),tr.getInstance().set(t.globalQuery),yield this.loadTaskStatuses()})}saveSettings(){return P(this,null,function*(){yield this.saveData(X())})}getTasks(){return this.cache===void 0?[]:this.cache.getTasks()}};
/*!
 * EventEmitter2
 * https://github.com/hij1nx/EventEmitter2
 *
 * Copyright (c) 2013 hij1nx
 * Licensed under the MIT license.
 */
/*!
 * mustache.js - Logic-less {{mustache}} templates with JavaScript
 * http://github.com/janl/mustache.js
 */
