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

229 lines
385 KiB

2 years ago
/*
3 years ago
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
3 years ago
if you want to view the source visit the plugins github repository
*/
/*
License obsidian-tasks:
MIT License
Copyright (c) 2021 Martin Schenck and Clare Macrae
3 years ago
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.
*/
1 year ago
"use strict";var ab=Object.create;var Ii=Object.defineProperty,ob=Object.defineProperties,ub=Object.getOwnPropertyDescriptor,lb=Object.getOwnPropertyDescriptors,cb=Object.getOwnPropertyNames,up=Object.getOwnPropertySymbols,db=Object.getPrototypeOf,cp=Object.prototype.hasOwnProperty,fb=Object.prototype.propertyIsEnumerable;var lp=(r,e,t)=>e in r?Ii(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ge=(r,e)=>{for(var t in e||(e={}))cp.call(e,t)&&lp(r,t,e[t]);if(up)for(var t of up(e))fb.call(e,t)&&lp(r,t,e[t]);return r},Dt=(r,e)=>ob(r,lb(e));var b=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),pb=(r,e)=>{for(var t in e)Ii(r,t,{get:e[t],enumerable:!0})},dp=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of cb(e))!cp.call(r,i)&&i!==t&&Ii(r,i,{get:()=>e[i],enumerable:!(n=ub(e,i))||n.enumerable});return r};var Fi=(r,e,t)=>(t=r!=null?ab(db(r)):{},dp(e||!r||!r.__esModule?Ii(t,"default",{value:r,enumerable:!0}):t,r)),mb=r=>dp(Ii({},"__esModule",{value:!0}),r);var W=(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 be=b(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.matchAnyPattern=Yr.extractTerms=Yr.repeatedTimeunitPattern=void 0;function _b(r,e){let t=e.replace(/\((?!\?)/g,"(?:");return`${r}${t}\\s{0,5}(?:,?\\s{0,5}${t}){0,10}`}Yr.repeatedTimeunitPattern=_b;function fp(r){let e;return r instanceof Array?e=[...r]:r instanceof Map?e=Array.from(r.keys()):e=Object.keys(r),e}Yr.extractTerms=fp;function Tb(r){return`(?:${fp(r).sort((t,n)=>n.length-t.length).join("|").replace(/\./g,"\\.")})`}Yr.matchAnyPattern=Tb});var me=b((fu,pu)=>{(function(r,e){typeof fu=="object"&&typeof pu!="undefined"?pu.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis!="undefined"?globalThis:r||self).dayjs=e()})(fu,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",f="year",m="date",T="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|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,R={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("_")},L=function(j,A,E){var B=String(j);return!B||B.length>=A?j:""+Array(A+1-B.length).join(E)+j},q={s:L,z:function(j){var A=-j.utcOffset(),E=Math.abs(A),B=Math.floor(E/60),P=E%60;return(A<=0?"+":"-")+L(B,2,"0")+":"+L(P,2,"0")},m:function j(A,E){if(A.date()<E.date())return-j(E,A);var B=12*(E.year()-A.year())+(E.month()-A.month()),P=A.clone().add(B,l),Q=E-P<0,d=A.clone().add(B+(Q?-1:1),l);return+(-(B+(E-P)/(Q?P-d:d-P))||0)},a:function(j){return j<0?Math.ceil(j)||0:Math.floor(j)},p:function(j){return{M:l,y:f,w:u,d:o,D:m,h:a,m:s,s:i,ms:n,Q:c}[j]||String(j||"").toLowerCase().replace(/s$/,"")},u:function(j){return j===void 0}},U="en",ne={};ne[U]=R;var te=function(j){return j instanceof Ce},Te=function(j,A,E){var B;if(!j)return U;if(typeof j=="string")ne[j]&&(B=j),A&&(ne[j]=A,B=j);else{var P=j.name;ne[P]=j,B=P}return!E&&B&&(U=B),B||!E&&U},G=function(j,A){if(te(j))return j.clone();var E=typeof A=="object"?A:{};return E.date=j,E.args=arguments,new Ce(E)},V=q;V.l=Te,V.i=te,V.w=function(j,A){return G(j,{locale:A.$L,utc:A.$u,x:A.$x,$offset:A.$offset})};var Ce=function(){function j(E){this.$L=Te(E.locale,null,!0),this.parse(E)}var A=j.prototype;return A.parse=function(E){this.$d=function(B){var P=B.date,Q=B.utc;if(P===null)return new Date(NaN);if(V.u(P))return new Date;if(P instanceof Date)return new Date(P);if(typeof P=="string"&&!/Z$/i.test(P)){var d=P.match(y);if(d){var p=d[2]-1||0,h=(d[7]||"0").substring(0,3);return Q?new Date(Date.UTC(d[1],p,d[3]||1,d[4]||0,d[5]||0,d[6]||0,h)):new Date(d[1],p,d[3]||1,d[4]||0,d[5]||0,d[6]||0,h)}}return new Date(P)}(E),this.$x=E.x||{},this.init
`).map(jM).filter(function(t){return t!==null});return yt(yt({},e[0]),e[1])}function qs(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=z.untilStringToDate(i),e}function jM(r){if(r=r.replace(/^\s+|\s+$/,""),!r.length)return null;var e=/^([A-Z]+?)[:;]/.exec(r.toUpperCase());if(!e)return b_(r);var t=e[1];switch(t.toUpperCase()){case"RRULE":case"EXRULE":return b_(r);case"DTSTART":return qs(r);default:throw new Error("Unsupported RFC prop ".concat(t," in ").concat(r))}}function b_(r){var e=r.replace(/^RRULE:/i,""),t=qs(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=ae[o.toUpperCase()];break;case"WKST":t.wkst=Bt[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=GM(o),l=a.toLowerCase();t[l]=u;break;case"BYWEEKDAY":case"BYDAY":t.byweekday=BM(o);break;case"DTSTART":case"TZID":var c=qs(r);t.tzid=c.tzid,t.dtstart=c.dtstart;break;case"UNTIL":t.until=z.untilStringToDate(o);break;case"BYEASTER":t.byeaster=Number(o);break;default:throw new Error("Unknown RRULE property '"+a+"'")}}),t}function GM(r){if(r.indexOf(",")!==-1){var e=r.split(",");return e.map(v_)}return v_(r)}function v_(r){return/^[+-]?\d+$/.test(r)?Number(r):r}function BM(r){var e=r.split(",");return e.map(function(t){if(t.length===2)return Bt[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=Bt[s].weekday;return new je(a,i)})}var wn=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=z.timeToUntilString(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(){var e;if(this.isUTC)return this.date;var t=Intl.DateTimeFormat().resolvedOptions().timeZone,n=new Date(this.date.toLocaleString(void 0,{timeZone:t})),i=new Date(this.date.toLocaleString(void 0,{timeZone:(e=this.tzid)!==null&&e!==void 0?e:"UTC"})),s=i.getTime()-n.getTime();return new Date(this.date.getTime()-s)},r}();function $s(r){for(var e=[],t="",n=Object.keys(r),i=Object.keys(Ws),s=0;s<n.length;s++)if(n[s]!=="tzid"&&!!ce(i,n[s])){var a=n[s].toUpperCase(),o=r[n[s]],u="";if(!(!Re(o)||at(o)&&!o.length)){switch(a){case"FREQ":u=Y.FREQUENCIES[r.freq];break;case"WKST":xt(o)?u=new je(o).toString():u=o.toString();break;case"BYWEEKDAY":a="BYDAY",u=Yy(o).map(function(T){return T instanceof je?T:at(T)?new je(T[0],T[1]):new je(T)}).toString();break;case"DTSTART":t=HM(o,r.tzid);break;case"UNTIL":u=z.timeToUntilString(o,!r.tzid);break;default:if(at(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 f=e.map(function(T){var y=T[0],w=T[1];return"".concat(y,"=").concat(w.toString())}).join(";"),m="";return f!==""&&(m="RRULE:".concat(f)),[t,m].filter(function(T){return!!T}).join(`
`)}function HM(r,e){return r?"DTSTART"+new wn(new Date(r),e).toString():""}function zM(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 w_=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?z.clone(t):z.cloneDates(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 f=0;f<i.length;f++){var m=i[f];if(!zM(t[m],c[m]))return!0}return!1},a=this[e];if(e==="all")n=this.all;else if(at(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 Or(e,t),o=0;o<this.all.length&&l.accept(this.all[o]);o++);n=l.getValue(),this._cacheAdd(e,n,t)}return at(n)?z.cloneDates(n):n instanceof Date?z.clone(n):n},r}();var E_=x(x(x(x(x(x(x(x(x(x(x(x(x([],ue(1,31),!0),ue(2,28),!0),ue(3,31),!0),ue(4,30),!0),ue(5,31),!0),ue(6,30),!0),ue(7,31),!0),ue(8,31),!0),ue(9,30),!0),ue(10,31),!0),ue(11,30),!0),ue(12,31),!0),ue(1,7),!0),k_=x(x(x(x(x(x(x(x(x(x(x(x(x([],ue(1,31),!0),ue(2,29),!0),ue(3,31),!0),ue(4,30),!0),ue(5,31),!0),ue(6,30),!0),ue(7,31),!0),ue(8,31),!0),ue(9,30),!0),ue(10,31),!0),ue(11,30),!0),ue(12,31),!0),ue(1,7),!0),KM=Gt(1,29),VM=Gt(1,30),Vr=Gt(1,31),lt=Gt(1,32),D_=x(x(x(x(x(x(x(x(x(x(x(x(x([],lt,!0),VM,!0),lt,!0),Vr,!0),lt,!0),Vr,!0),lt,!0),lt,!0),Vr,!0),lt,!0),Vr,!0),lt,!0),lt.slice(0,7),!0),O_=x(x(x(x(x(x(x(x(x(x(x(x(x([],lt,!0),KM,!0),lt,!0),Vr,!0),lt,!0),Vr,!0),lt,!0),lt,!0),Vr,!0),lt,!0),Vr,!0),lt,!0),lt.slice(0,7),!0),XM=Gt(-28,0),QM=Gt(-29,0),Xr=Gt(-30,0),ct=Gt(-31,0),S_=x(x(x(x(x(x(x(x(x(x(x(x(x([],ct,!0),QM,!0),ct,!0),Xr,!0),ct,!0),Xr,!0),ct,!0),ct,!0),Xr,!0),ct,!0),Xr,!0),ct,!0),ct.slice(0,7),!0),R_=x(x(x(x(x(x(x(x(x(x(x(x(x([],ct,!0),XM,!0),ct,!0),Xr,!0),ct,!0),Xr,!0),ct,!0),ct,!0),Xr,!0),ct,!0),Xr,!0),ct,!0),ct.slice(0,7),!0),M_=[0,31,60,91,121,152,182,213,244,274,305,335,366],x_=[0,31,59,90,120,151,181,212,243,273,304,334,365],af=function(){for(var r=[],e=0;e<55;e++)r=r.concat(Gt(7));return r}();function A_(r,e){var t=new Date(Date.UTC(r,0,1)),n=z.isLeapYear(r)?366:365,i=z.isLeapYear(r+1)?366:365,s=z.toOrdinal(t),a=z.getWeekday(t),o=yt(yt({yearlen:n,nextyearlen:i,yearordinal:s,yearweekday:a},ZM(r)),{wnomask:null});if(At(e.byweekno))return o;o.wnomask=ue(0,n+7);var u,l,c=u=ut(7-a+e.wkst,7);c>=4?(c=0,l=o.yearlen+ut(a-e.wkst,7)):l=n-c;for(var f=Math.floor(l/7),m=ut(l,7),T=Math.floor(f+m/4),y=0;y<e.byweekno.length;y++){var w=e.byweekno[y];if(w<0&&(w+=T+1),w>0&&w<=T){var R=void 0;w>1?(R=c+(w-1)*7,c!==u&&(R-=7-u)):R=c;for(var L=0;L<7&&(o.wnomask[R]=1,R++,o.wdaymask[R]!==e.wkst);L++);}}if(ce(e.byweekno,1)){var R=c+T*7;if(c!==u&&(R-=7-u),R<n)for(var y=0;y<7&&(o.wnomask[R]=1,R+=1,o.wdaymask[R]!==e.wkst);y++);}if(c){var q=void 0;if(ce(e.byweekno,-1))q=-1;else{var U=z.getWeekday(new Date(Date.UTC(r-1,0,1))),ne=ut(7-U.valueOf()+e.wkst,7),te=z.isLeapYear(r-1)?366:365,Te=void 0;ne>=4?(ne=0,Te=te+ut(U-e.wkst,7)):Te=n-c,q=Math.floor(52+ut(Te,7)/4)}if(ce(e.byweekno,q))for(var R=0;R<c;R++)o.wnomask[R]=1}return o}function ZM(r){var e=z.isLeapYear(r)?366:365,t=new Date(Date.UTC(r,0,1)),n=z.getWeekday(t);return e===365?{mmask:E_,mdaymask:O_,nmdaymask:R_,wdaymask:af.slice(n),mrange:x_}:{mmask:k_,mdaymask:D_,nmdaymask:S_,wdaymask:af.slice(n),mrange:M_}}function P_(r,e,t,n,i,s){var a={lastyear:r,lastmonth:e,nwdaymask:[]},o=[];if(s.freq===Y.YEARLY)if(At(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===Y.MONTHLY&&(o=[n.slice(e-1,e+1)]);if(At(o))return a;a.nwdaymask=ue(0,t);for(var u=0;u<o.length;u++)for(var l=o[u],c=l[0],f=l[1]-1,m=0;m<s.bynweekday.length;m++){var T=void 0,y=s.bynweekday[m],w=y[0],R=y[1];R<0?(T=f+(R+1)*7,T-=ut(i[T]-w,7)):(T=c+(R-1)*7,T+=ut(7-i[T]+w,7)),c<=T&&T<=f&&(a.nwdaymask[T]=1)}return a}function C_(r,e){e===void 0&&(e=0);var t=r%19,n=Math.floor(r/100),i=r%100,s=Math.floor(n/
`),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 lx(r){r.forEach(function(e){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(e))throw new Error("unsupported RDATE/EXDATE parm: "+e)})}function W_(r,e){return lx(e),r.split(",").map(function(t){return z.untilStringToDate(t)})}function q_(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 uf=function(r){ai(e,r);function e(t){t===void 0&&(t=!1);var n=r.call(this,{},t)||this;return n.dtstart=q_.apply(n,["dtstart"]),n.tzid=q_.apply(n,["tzid"]),n._rrule=[],n._rdate=[],n._exrule=[],n._exdate=[],n}return e.prototype._iter=function(t){return L_(t,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},e.prototype.rrule=function(t){Y_(t,this._rrule)},e.prototype.exrule=function(t){Y_(t,this._exrule)},e.prototype.rdate=function(t){$_(t,this._rdate)},e.prototype.exdate=function(t){$_(t,this._exdate)},e.prototype.rrules=function(){return this._rrule.map(function(t){return po(t.toString())})},e.prototype.exrules=function(){return this._exrule.map(function(t){return po(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($s({dtstart:this._dtstart}))),this._rrule.forEach(function(n){t=t.concat(n.toString().split(`
2 years ago
`))}),this._exrule.forEach(function(n){t=t.concat(n.toString().split(`
1 year ago
`).map(function(i){return i.replace(/^RRULE:/,"EXRULE:")}).filter(function(i){return!/^DTSTART/.test(i)}))}),this._rdate.length&&t.push(j_("RDATE",this._rdate,this.tzid())),this._exdate.length&&t.push(j_("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}(Y);function Y_(r,e){if(!(r instanceof Y))throw new TypeError(String(r)+" is not RRule instance");ce(e.map(String),String(r))||e.push(r)}function $_(r,e){if(!(r instanceof Date))throw new TypeError(String(r)+" is not Date instance");ce(e.map(Number),Number(r))||(e.push(r),z.sort(e))}function j_(r,e,t){var n=!t||t.toUpperCase()==="UTC",i=n?"".concat(r,":"):"".concat(r,";TZID=").concat(t,":"),s=e.map(function(a){return z.timeToUntilString(a.valueOf(),n)}).join(",");return"".concat(i).concat(s)}function Rr(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()||r.isAfter(e)?1:r.isBefore(e)?-1:0:0}var et=class{constructor({rrule:e,baseOnToday:t,referenceDate:n,startDate:i,scheduledDate:s,dueDate:a}){this.rrule=e,this.baseOnToday=t,this.referenceDate=n,this.startDate=i,this.scheduledDate=s,this.dueDate=a}static fromText({recurrenceRuleText:e,startDate:t,scheduledDate:n,dueDate:i}){try{let s=e.match(/^([a-zA-Z0-9, !]+?)( when done)?$/i);if(s==null)return null;let a=s[1].trim(),o=s[2]!==void 0,u=Y.parseText(a);if(u!==null){let l=null;i?l=window.moment(i):n?l=window.moment(n):t&&(l=window.moment(t)),!o&&l!==null?u.dtstart=window.moment(l).startOf("day").utc(!0).toDate():u.dtstart=window.moment().startOf("day").utc(!0).toDate();let c=new Y(u);return new et({rrule:c,baseOnToday:o,referenceDate:l,startDate:t,scheduledDate:n,dueDate:i})}}catch(s){s instanceof Error&&console.log(s.message)}return null}toText(){let e=this.rrule.toText();return this.baseOnToday&&(e+=" when done"),e}next(){let e=this.nextReferenceDate();if(e!==null){let t=null,n=null,i=null;if(this.referenceDate){if(this.startDate){let s=window.moment.duration(this.startDate.diff(this.referenceDate));t=window.moment(e),t.add(Math.round(s.asDays()),"days")}if(this.scheduledDate){let s=window.moment.duration(this.scheduledDate.diff(this.referenceDate));n=window.moment(e),n.add(Math.round(s.asDays()),"days")}if(this.dueDate){let s=window.moment.duration(this.dueDate.diff(this.referenceDate));i=window.moment(e),i.add(Math.round(s.asDays()),"days")}}return{startDate:t,scheduledDate:n,dueDate:i}}return null}identicalTo(e){return this.baseOnToday!==e.baseOnToday||Rr(this.startDate,e.startDate)!==0||Rr(this.scheduledDate,e.scheduledDate)!==0||Rr(this.dueDate,e.dueDate)!==0?!1:this.toText()===e.toText()}nextReferenceDate(){if(this.baseOnToday){let e=window.moment();return this.nextReferenceDateFromToday(e).toDate()}else return this.nextReferenceDateFromOriginalReferenceDate().toDate()}nextReferenceDateFromToday(e){let t=new Y(Dt(ge({},this.rrule.origOptions),{dtstart:e.startOf("day").utc(!0).toDate()}));return this.nextAfter(e.endOf("day"),t)}nextReferenceDateFromOriginalReferenceDate(){var t;let e=window.moment((t=this.referenceDate)!=null?t:void 0).endOf("day");return this.nextAfter(e,this.rrule)}nextAfter(e,t){e.utc(!0);let n=window.moment(t.after(e.toDate())),i=this.toText(),s=i.match(/every( \d+)? month(s)?(.*)?/);s!==null&&(i.includes(" on ")||(n=et.nextAfterMonths(e,n,t,s[1])));let a=i.match(/every( \d+)? year(s)?(.*)?/);return a!==null&&(n=et.nextAfterYears(e,n,t,a[1])),et.addTimezone(n)}static nextAfterMonths(e,t,n,i){let s=1;for(i!==void 0&&(s=Number.parseInt(i.trim(),10));et.isSkippingTooManyMonths(e,t,s);)t=et.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));et.isSkippingTooManyYears(e,t,s);)t=et.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
`}),a=a.slice(0,s.autoSuggestMaxItems),a}}function cx(r,e,t,n){let i=u=>Object.values(n.prioritySymbols).some(l=>l.length>0&&u.includes(l)),s=[];if(r.includes(n.dueDateSymbol)||s.push({displayText:`${n.dueDateSymbol} due date`,appendText:`${n.dueDateSymbol} `}),r.includes(n.startDateSymbol)||s.push({displayText:`${n.startDateSymbol} start date`,appendText:`${n.startDateSymbol} `}),r.includes(n.scheduledDateSymbol)||s.push({displayText:`${n.scheduledDateSymbol} scheduled date`,appendText:`${n.scheduledDateSymbol} `}),i(r)||(s.push({displayText:`${n.prioritySymbols.High} high priority`,appendText:`${n.prioritySymbols.High} `}),s.push({displayText:`${n.prioritySymbols.Medium} medium priority`,appendText:`${n.prioritySymbols.Medium} `}),s.push({displayText:`${n.prioritySymbols.Low} low priority`,appendText:`${n.prioritySymbols.Low} `}),s.push({displayText:`${n.prioritySymbols.Highest} highest priority`,appendText:`${n.prioritySymbols.Highest} `}),s.push({displayText:`${n.prioritySymbols.Lowest} lowest priority`,appendText:`${n.prioritySymbols.Lowest} `})),r.includes(n.recurrenceSymbol)||s.push({displayText:`${n.recurrenceSymbol} recurring (repeat)`,appendText:`${n.recurrenceSymbol} `}),!r.includes(n.createdDateSymbol)){let l=Mt.parseDate("today",!0).format(H.dateFormat);s.push({textToMatch:`${n.createdDateSymbol} created`,displayText:`${n.createdDateSymbol} created today (${l})`,appendText:`${n.createdDateSymbol} ${l} `})}let a=df(r,/([a-zA-Z'_-]*)/g,e),o=[];if(a&&a.length>0){let u=a[0];if(u.length>=Math.max(1,t.autoSuggestMinMatch)){let l=s.filter(c=>(c.textToMatch||c.displayText).toLowerCase().includes(u.toLowerCase()));for(let c of l)o.push({suggestionType:"match",displayText:c.displayText,appendText:c.appendText,insertAt:a.index,insertSkip:u.length})}}return o.length===0&&t.autoSuggestMinMatch===0?s:o}function dx(r,e,t,n,i){let s=["today","tomorrow","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","next week","next month","next year"],a=[],o=new RegExp(`(${n})\\s*([0-9a-zA-Z ]*)`,"ug"),u=df(r,o,e);if(u&&u.length>=2){let l=u[1],c=u[2];if(c.length<t.autoSuggestMinMatch)return[];let f=c&&c.length>1?Mt.parseDate(ii(c),!0):null;f&&f.isValid()&&a.push({displayText:`${f.format(H.dateFormat)}`,appendText:`${l} ${f.format(H.dateFormat)} `,insertAt:u.index,insertSkip:u[0].length});let m=1,T=s.filter(y=>c&&c.length>=m&&y.toLowerCase().includes(c.toLowerCase())).slice(0,i);T.length===0&&(T=s.slice(0,i));for(let y of T){let R=`${Mt.parseDate(y,!0).format(H.dateFormat)}`;a.push({suggestionType:"match",displayText:`${y} (${R})`,appendText:`${l} ${R} `,insertAt:u.index,insertSkip:u[0].length})}}return a}function fx(r,e,t,n){var u;let i=["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"],s=[],a=new RegExp(`(${n})\\s*([0-9a-zA-Z ]*)`,"ug"),o=df(r,a,e);if(o&&o.length>=2){let l=o[1],c=o[2];if(c.length<t.autoSuggestMinMatch)return[];if(c.length>0){let y=(u=et.fromText({recurrenceRuleText:c,startDate:null,scheduledDate:null,dueDate:null}))==null?void 0:u.toText();if(y){let w=`${l} ${y} `;if(s.push({suggestionType:"match",displayText:`\u2705 ${y}`,appendText:w,insertAt:o.index,insertSkip:o[0].length}),o[0]==w)return[]}}let f=1,m=t.autoSuggestMaxItems/2,T=i.filter(y=>c&&c.length>=f&&y.toLowerCase().includes(c.toLowerCase())).slice(0,m);T.length===0&&c.trim().length===0&&(T=i.slice(0,m));for(let y of T)s.push({suggestionType:"match",displayText:`${y}`,appendText:`${l} ${y} `,insertAt:o.index,insertSkip:o[0].length})}return s}function df(r,e,t){let n=r.matchAll(e);for(let i of n)if((i==null?void 0:i.index)&&i.index<=t&&t<=i.index+i[0].length)return i}var js=class{constructor(){this.hideTaskCount=!1;this.hideBacklinks=!1;this.hidePriority=!1;this.hideCreatedDate=!1;this.hideStartDate=!1;this.hideScheduledDate=!1;this.hideDoneDate=!1;this.hideDueDate=!1;this.hideRecurrenceRule=!1;this.hideEditButton=!1;this.hideUrgency=!0;this.sh
2 years ago
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.
1 year ago
`;_o(l);return}let u=Math.min(Math.pow(10,s),100);Hs.debug(`timeout = ${u}`),setTimeout(()=>{J_({originalTask:r,newTasks:e,vault:t,metadataCache:n,workspace:i,previousTries:s+1})},u)};try{let[u,l,c]=yield eT(r,t),f=[...c.slice(0,u),...e.map(m=>m.toFileLineString()),...c.slice(u+1)];yield t.modify(l,f.join(`
`))}catch(u){if(u instanceof Jr)return u.message&&Z_(u.message),o();if(u instanceof To)return o();u instanceof Error&&_o(u.message)}});function eT(r,e){return W(this,null,function*(){if(Bs===void 0)throw new Jr;let t=e.getAbstractFileByPath(r.path);if(!(t instanceof zs.TFile))throw new Jr(`Tasks: No file found for task ${r.description}. Retrying ...`);if(!gx.includes(t.extension))throw new Error(`Tasks: Does not support files with the ${t.extension} file extension.`);let n=Bs.getFileCache(t);if(n==null||n===null)throw new Jr(`Tasks: No file cache found for file ${t.path}. Retrying ...`);let i=n.listItems;if(i===void 0||i.length===0)throw new Jr(`Tasks: No list items found in file cache of ${t.path}. Retrying ...`);let a=(yield e.read(t)).split(`
`),o=_x(r,a,i,yx);if(o===void 0)throw new To;return[o,t,a]})}function Tf(r,e){return W(this,null,function*(){try{let[t,n,i]=yield eT(r,e);return[t,n]}catch(t){t instanceof Jr?t.message&&Z_(t.message):t instanceof Error&&_o(t.message)}})}function tT(r,e){return r<e.length}function _x(r,e,t,n){let i=Tx(r,e);return i!==void 0||(i=bx(r,e),i!==void 0)?i:vx(r,e,t,n)}function Tx(r,e){let t=r.taskLocation.lineNumber;if(tT(t,e)&&e[t]===r.originalMarkdown)return Hs.debug(`Found original markdown at original line number ${t}`),t}function bx(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 vx(r,e,t,n){let i,s=0;for(let a of t){let o=a.position.start.line;if(!tT(o,e))return;if(o<r.taskLocation.sectionStart||a.task===void 0)continue;let u=e[o];if(ve.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}.
2 years ago
Expected task:
${r.originalMarkdown}
Found task:
1 year ago
${u}`);return}break}s++}}return i}var en={description:"task-description",priority:"task-priority",dueDate:"task-due",startDate:"task-start",createdDate:"task-created",scheduledDate:"task-scheduled",doneDate:"task-done",recurrenceRule:"task-recurring",blockLink:""},wx=7,Ex="far";function kx(r,e,t,n){return W(this,null,function*(){if(!n)throw new Error("Must call the Obsidian renderer with an Obsidian Component object");yield rT.MarkdownRenderer.renderMarkdown(r,e,t,n)})}function nT(r,e,t=null){return W(this,null,function*(){var o;t||(t=kx);let n=document.createElement("li");e.parentUlElement.appendChild(n),n.classList.add("task-list-item","plugin-tasks-list-item");let i=document.createElement("span");n.appendChild(i),i.classList.add("tasks-list-text");let s=yield Dx(r,e,i,t);for(let u in s)n.dataset[u]=s[u];let a=document.createElement("input");return n.appendChild(a),a.classList.add("task-list-item-checkbox"),a.type="checkbox",r.status.symbol!==" "&&(a.checked=!0,n.classList.add("is-checked")),a.addEventListener("click",u=>{u.preventDefault(),u.stopPropagation(),a.disabled=!0;let l=r.toggleWithRecurrenceInUsersOrder();bo({originalTask:r,newTasks:l})}),n.prepend(a),n.setAttribute("data-task",r.status.symbol.trim()),n.setAttribute("data-line",e.listIndex.toString()),n.setAttribute("data-task-status-name",r.status.name),n.setAttribute("data-task-status-type",r.status.type),a.setAttribute("data-line",e.listIndex.toString()),(o=e.layoutOptions)!=null&&o.shortMode&&xx({task:r,element:i,isFilenameUnique:e.isFilenameUnique}),n})}function Dx(r,e,t,n){return W(this,null,function*(){let i={},s=new Qr(e.layoutOptions),a=Mr.tasksPluginEmoji.taskSerializer;for(let o of s.layoutComponents){let u=a.componentToString(r,s,o);if(u){o==="description"&&(u=ve.removeAsWordFromDependingOnSettings(u));let l=document.createElement("span");if(t.appendChild(l),l){let c=document.createElement("span");l.appendChild(c),yield Ox(c,u,o,r,n,e.obsidianComponent);let[f,m]=bf(o,r);Sx(o,c),l.classList.add(...f);for(let T in m)l.dataset[T]=m[T];i=ge(ge({},i),m)}}}for(let o of s.hiddenComponents){let[u,l]=bf(o,r);i=ge(ge({},i),l)}if(i.taskPriority===void 0){let[o,u]=bf("priority",r);i=ge(ge({},i),u)}return i})}function Ox(r,e,t,n,i,s){return W(this,null,function*(){if(t==="description"){let{debugSettings:a}=X();a.showTaskHiddenData&&(e+=`<br>\u{1F41B} <b>${n.lineNumber}</b> . ${n.sectionStart} . ${n.sectionIndex} . '<code>${n.originalMarkdown}</code>'<br>'<code>${n.path}</code>' > '<code>${n.precedingHeader}</code>'<br>`),yield i(e,r,n.path,s);let o=r.querySelector("blockquote"),u=o!=null?o:r,l=u.querySelector("p");if(l!==null){for(;l.firstChild;)u.insertBefore(l.firstChild,l);l.remove()}r.querySelectorAll("p").forEach(c=>{c.hasChildNodes()||c.remove()}),r.querySelectorAll(".footnotes").forEach(c=>{c.remove()})}else r.innerHTML=e})}function bf(r,e){let t=[],n={},i=(s,a)=>{let o=Rx(s);o&&(n[a]=o)};switch(r){case"description":t.push(en.description);break;case"priority":{let s=null;e.priority==="0"?s="highest":e.priority==="1"?s="high":e.priority==="2"?s="medium":e.priority==="4"?s="low":e.priority==="5"?s="lowest":s="normal",n.taskPriority=s,t.push(en.priority);break}case"createdDate":{let s=e.createdDate;s&&(t.push(en.createdDate),i(s,"taskCreated"));break}case"dueDate":{let s=e.dueDate;s&&(t.push(en.dueDate),i(s,"taskDue"));break}case"startDate":{let s=e.startDate;s&&(t.push(en.startDate),i(s,"taskStart"));break}case"scheduledDate":{let s=e.scheduledDate;s&&(t.push(en.scheduledDate),i(s,"taskScheduled"));break}case"doneDate":{let s=e.doneDate;s&&(t.push(en.doneDate),i(s,"taskDone"));break}case"recurrenceRule":{t.push(en.recurrenceRule);break}}return[t,n]}function Sx(r,e){if(r==="description"){let t=e.getElementsByClassName("tag");for(let n=0;n<t.length;n++){let i=t[n].textContent;if(i){let s=Mx(i),a=t[n];s&&(a.dataset.tagName=s)}}}}function Rx(r){let e=window.moment().startOf("day"),t="",n=e.diff(r,"days");return isNaN(n)?null:n===0?"today":(n>0?t+="past-":n<0&&(t+="future-"),Math.abs(n)<=wx?t+=Math.abs(n).toString()+"d":t+=Ex,t)}function Mx(r){let e=/["&\x00
`),o=a.length,u=new Vs(()=>Et.fromPath(i.path)),l=null,c=0;for(let f of t)if(f.task!==void 0){let m=f.position.start.line;if(m>=o)return console.log(`${i.path} Obsidian gave us a line number ${m} past the end of the file. ${o}.`),s;if((l===null||l.position.end.line<m)&&(l=On.getSection(m,n.sections),c=0),l===null)continue;let T=a[m];if(T===void 0){console.log(`${i.path}: line ${m} - ignoring 'undefined' line.`);continue}let y;try{y=Oe.fromLine({line:T,taskLocation:new ot(i.path,m,l.position.start.line,c,On.getPrecedingHeader(m,n.headings)),fallbackDate:u.value})}catch(w){this.reportTaskParsingErrorToUser(w,i,f,T);continue}y!==null&&(c++,s.push(y))}return s}reportTaskParsingErrorToUser(e,t,n,i){let s=`There was an error reading one of the tasks in this vault.
The following task has been ignored, to prevent Tasks queries getting stuck with 'Loading Tasks ...'
Error: ${e}
File: ${t.path}
Line number: ${n.position.start.line}
1 year ago
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.
1 year ago
`;console.error(s),e instanceof Error&&console.error(e.stack),this.state==="Initializing"&&new ci.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 Af=require("obsidian");var wT=require("obsidian");function Pr(){}function Ef(r){return r()}function sT(){return Object.create(null)}function Rn(r){r.forEach(Ef)}function wo(r){return typeof r=="function"}function oT(r,e){return r!=r?e==e:r!==e||r&&typeof r=="object"||typeof r=="function"}function uT(r){return Object.keys(r).length===0}var lT=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global,Qs=class{constructor(e){this.options=e,this._listeners="WeakMap"in lT?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)Qs.entries.set(i.target,i),(n=this._listeners.get(i.target))===null||n===void 0||n(i)})}};Qs.entries="WeakMap"in lT?new WeakMap:void 0;var cT=!1;function Ax(){cT=!0}function Px(){cT=!1}function M(r,e){r.appendChild(e)}function mi(r,e,t){r.insertBefore(e,t||null)}function Mn(r){r.parentNode&&r.parentNode.removeChild(r)}function kf(r,e){for(let t=0;t<r.length;t+=1)r[t]&&r[t].d(e)}function K(r){return document.createElement(r)}function Cx(r){return document.createElementNS("http://www.w3.org/2000/svg",r)}function dt(r){return document.createTextNode(r)}function de(){return dt(" ")}function _t(r,e,t,n){return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}function dT(r){return function(e){return e.preventDefault(),r.call(this,e)}}function N(r,e,t){t==null?r.removeAttribute(e):r.getAttribute(e)!==t&&r.setAttribute(e,t)}function fT(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 Nx(r){return Array.from(r.childNodes)}function Df(r,e){e=""+e,r.data!==e&&(r.data=e)}function rr(r,e){r.value=e==null?"":e}function Of(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 pT(r){let e=r.querySelector(":checked");return e&&e.__value}function nr(r,e,t){r.classList[t?"add":"remove"](e)}var Sn=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=Cx(t.nodeName):this.e=K(t.nodeType===11?"TEMPLATE":t.nodeName),this.t=t.tagName!=="TEMPLATE"?t:t.content,this.c(e)),this.i(n)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(e){for(let t=0;t<this.n.length;t+=1)mi(this.t,this.n[t],e)}p(e){this.d(),this.h(e),this.i(this.a)}d(){this.n.forEach(Mn)}};var Zs;function Xs(r){Zs=r}function Ix(){if(!Zs)throw new Error("Function called outside component initialization");return Zs}function Sf(r){Ix().$$.on_mount.push(r)}var fi=[];var Eo=[],pi=[],aT=[],Fx=Promise.resolve(),wf=!1;function Lx(){wf||(wf=!0,Fx.then(mT))}function Js(r){pi.push(r)}var vf=new Set,di=0;function mT(){if(di!==0)return;let r=Zs;do{try{for(;di<fi.length;){let e=fi[di];di++,Xs(e),Ux(e.$$)}}catch(e){throw fi.length=0,di=0,e}for(Xs(null),fi.length=0,di=0;Eo.length;)Eo.pop()();for(let e=0;e<pi.length;e+=1){let t=pi[e];vf.has(t)||(vf.add(t),t())}pi.length=0}while(fi.length);for(;aT.length;)aT.pop()();wf=!1,vf.clear(),Xs(r)}function Ux(r){if(r.fragment!==null){r.update(),Rn(r.before_update);let e=r.dirty;r.dirty=[-1],r.fragment&&r.fragment.p(r.ctx,e),r.after_update.forEach(Js)}}function Wx(r){let e=[],t=[];pi.forEach(n=>r.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),pi=e}var qx=new Set;function Yx(r,e){r&&r.i&&(qx.delete(r),r.i(e))}var $x=["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","ch
<span class="accesskey-first">future</span> dates:`,Vf=de(),sr=K("input"),Xf=de(),Un=K("div"),aa=K("label"),aa.innerHTML='Stat<span class="accesskey">u</span>s',Qf=de(),Ft=K("select");for(let $=0;$<mt.length;$+=1)mt[$].c();Zf=de(),Wr=K("div"),xi=K("div"),ua=K("label"),ua.textContent="Completed:",Jf=de(),qr=K("input"),ep=de(),Ai=K("div"),uu=K("span"),uu.textContent="Created on:",tp=de(),ca=K("code"),rp=de(),Pi=K("div"),lu=K("span"),lu.textContent="Done on:",np=de(),da=K("code"),ip=de(),Wn=K("div"),un=K("button"),sp=dt("Apply"),ap=de(),Ci=K("button"),Ci.textContent="Cancel",N(i,"for","description"),N(a,"id","description"),N(a,"type","text"),N(a,"class","tasks-modal-description"),N(a,"placeholder","Take out the trash"),N(a,"accesskey",o=r[15]("t")),N(n,"class","tasks-modal-section"),N(c,"for",m="priority-"+r[1].priority),N(l,"class","tasks-modal-section tasks-modal-priorities"),N(R,"for","recurrence"),N(R,"class","accesskey-first"),N(q,"id","recurrence"),N(q,"type","text"),N(q,"placeholder","Try 'every 2 weeks on Thursday'."),N(q,"accesskey",U=r[15]("r")),nr(q,"tasks-modal-error",!r[8]),V.a=null,N(Fe,"for","due"),N(Fe,"class","accesskey-first"),N(A,"id","due"),N(A,"type","text"),N(A,"placeholder",Rf),N(A,"accesskey",E=r[15]("d")),nr(A,"tasks-modal-error",!r[7]),p.a=null,N(g,"for","scheduled"),N(g,"class","accesskey-first"),N(v,"id","scheduled"),N(v,"type","text"),N(v,"placeholder",Rf),N(v,"accesskey",k=r[15]("s")),nr(v,"tasks-modal-error",!r[5]),pe.a=null,N(ee,"for","start"),N(I,"id","start"),N(I,"type","text"),N(I,"placeholder",Rf),N(I,"accesskey",xe=r[15]("a")),nr(I,"tasks-modal-error",!r[3]),Le.a=null,N(ia,"for","forwardOnly"),N(sr,"id","forwardOnly"),N(sr,"type","checkbox"),N(sr,"class","task-list-item-checkbox tasks-modal-checkbox"),N(sr,"accesskey",sa=r[15]("f")),N(w,"class","tasks-modal-section tasks-modal-dates"),N(aa,"for","status"),N(Ft,"id","status-type"),N(Ft,"class","dropdown"),N(Ft,"accesskey",oa=r[15]("u")),r[1].status===void 0&&Js(()=>r[39].call(Ft)),N(Un,"class","tasks-modal-section"),N(ua,"for","status"),N(qr,"id","status"),N(qr,"type","checkbox"),N(qr,"class","task-list-item-checkbox tasks-modal-checkbox"),qr.checked=la=r[1].status.isCompleted(),qr.disabled=!0,N(Wr,"class","tasks-modal-section tasks-modal-status"),un.disabled=fa=!r[14],N(un,"type","submit"),N(un,"class","mod-cta"),N(Ci,"type","button"),N(Wn,"class","tasks-modal-section tasks-modal-buttons"),nr(t,"with-accesskeys",r[9]),N(e,"class","tasks-modal")},m($,fe){mi($,e,fe),M(e,t),M(t,n),M(n,i),M(n,s),M(n,a),rr(a,r[1].description),r[31](a),M(t,u),M(t,l),M(l,c),M(c,f),M(l,T);for(let le=0;le<pt.length;le+=1)pt[le]&&pt[le].m(l,null);M(t,y),M(t,w),M(w,R),M(w,L),M(w,q),rr(q,r[1].recurrenceRule),M(w,ne),M(w,te),M(te,Te),M(te,G),V.m(r[12],te),M(w,Ce),M(w,Fe),M(w,j),M(w,A),rr(A,r[1].dueDate),M(w,B),M(w,P),M(P,Q),M(P,d),p.m(r[6],P),M(w,h),M(w,g),M(w,_),M(w,v),rr(v,r[1].scheduledDate),M(w,S),M(w,D),M(D,O),M(D,C),pe.m(r[4],D),M(w,se),M(w,ee),M(w,De),M(w,I),rr(I,r[1].startDate),M(w,Pe),M(w,rt),M(rt,gr),M(rt,We),Le.m(r[2],rt),M(w,Kf),M(w,Mi),M(Mi,ia),M(Mi,Vf),M(Mi,sr),sr.checked=r[1].forwardOnly,M(t,Xf),M(t,Un),M(Un,aa),M(Un,Qf),M(Un,Ft);for(let le=0;le<mt.length;le+=1)mt[le]&&mt[le].m(Ft,null);Of(Ft,r[1].status,!0),M(t,Zf),M(t,Wr),M(Wr,xi),M(xi,ua),M(xi,Jf),M(xi,qr),M(Wr,ep),M(Wr,Ai),M(Ai,uu),M(Ai,tp),M(Ai,ca),ca.innerHTML=r[11],M(Wr,rp),M(Wr,Pi),M(Pi,lu),M(Pi,np),M(Pi,da),da.innerHTML=r[13],M(t,ip),M(t,Wn),M(Wn,un),M(un,sp),M(Wn,ap),M(Wn,Ci),cu||(op=[_t(a,"input",r[30]),_t(a,"keydown",r[23]),_t(a,"paste",r[24]),_t(a,"drop",r[24]),_t(l,"keyup",r[21]),_t(q,"input",r[34]),_t(A,"input",r[35]),_t(v,"input",r[36]),_t(I,"input",r[37]),_t(sr,"change",r[38]),_t(Ft,"change",r[39]),_t(Ci,"click",r[22]),_t(t,"submit",dT(r[25]))],cu=!0)},p($,fe){if(fe[0]&32768&&o!==(o=$[15]("t"))&&N(a,"accesskey",o),fe[0]&3&&rr(a,$[1].description),fe[0]&3&&m!==(m="priority-"+$[1].priority)&&N(c,"for",m),fe[0]&1081346){qn=$[20];let le;for(le=0;le<qn.length;le+=1){let Ni=_T($,qn,le);pt[le]?pt[le].p(Ni,fe):(pt[le]=TT(Ni),pt[le].c(),pt[le].m(l,null))}for(;le<pt.length;le
`);e.setLine(a,T)};new rn({app:n,task:u,onSubmit:l}).open()};var Pf=require("obsidian");var kT=(r,e,t)=>{var u;if(r)return t instanceof Pf.MarkdownView;if(!(t instanceof Pf.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=Vx(a,n);e.setLine(s,o.text),e.setCursor(Xx(i,o))},Vx=(r,e)=>{let t=Oe.fromLine({line:r,taskLocation:ot.fromUnknownPosition(e),fallbackDate:null});if(t!==null){let n=t.toggleWithRecurrenceInUsersOrder().map(i=>i.toFileLineString());return{text:n.join(`
`),moveTo:{line:n.length-1}}}else{let n=r.match(H.taskRegex);if(n!==null){let i=n[3],a=Se.getInstance().bySymbol(i).nextStatusSymbol;return{text:r.replace(H.taskRegex,`$1- [${a}] $4`)}}else if(H.listItemRegex.test(r)){let i=r.replace(H.listItemRegex,"$1$2 [ ]");return{text:i,moveTo:{ch:i.length}}}else{let i=r.replace(H.indentationRegex,"$1- ");return{text:i,moveTo:{ch:i.length}}}}},Xx=(r,e)=>{var s;let t={line:0,ch:r.ch},n=ge(ge({},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 Oo=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)=>ET(t,n,i,this.app)}),e.addCommand({id:"toggle-done",name:"Toggle task done",icon:"check-in-circle",editorCheckCallback:kT})}};var So=class{constructor({obsidianEvents:e}){this.obsidianEvents=e}onCacheUpdate(e){return this.obsidianEvents.on("obsidian-tasks-plugin:cache-update",e)}triggerCacheUpdate(e){this.obsidianEvents.trigger("obsidian-tasks-plugin:cache-update",e)}onRequestCacheUpdate(e){return this.obsidianEvents.on("obsidian-tasks-plugin:request-cache-update",e)}triggerRequestCacheUpdate(e){this.obsidianEvents.trigger("obsidian-tasks-plugin:request-cache-update",e)}off(e){this.obsidianEvents.offref(e)}};var DT=require("obsidian");var Ro=class{constructor({plugin:e}){this.markdownPostProcessor=this._markdownPostProcessor.bind(this);e.registerMarkdownPostProcessor(this._markdownPostProcessor.bind(this))}_markdownPostProcessor(e,t){return W(this,null,function*(){var c;let n=new DT.MarkdownRenderChild(e);t.addChild(n);let i=e.findAll(".task-list-item").filter(f=>{var y;let m=(y=f.textContent)==null?void 0:y.split(`
`);if(m===void 0)return!1;let T=null;for(let w=0;w<m.length;w=w+1)if(m[w]!==""){T=m[w];break}return T===null?!1:ve.includedIn(T)});if(i.length===0)return;let s=t.sourcePath,a=t.getSectionInfo(e);if(a===null)return;let o=a.text.split(`
`),u=0,l=[];for(let f=a.lineStart;f<=a.lineEnd;f++){let m=o[f];if(m===void 0)continue;let T=null,y=Oe.fromLine({line:m,taskLocation:new ot(s,f,a.lineStart,u,T),fallbackDate:null});y!==null&&(l.push(y),u++)}for(let f=0;f<i.length;f++){let m=l[f],T=i[f];if(m===void 0||T===void 0)continue;let y=(c=T.getAttr("data-line"))!=null?c:"0",w=Number.parseInt(y,10),R=yield m.toLi({parentUlElement:e,listIndex:w,obsidianComponent:n}),L=T.childNodes;for(let ne=0;ne<L.length;ne=ne+1){let te=L[ne];te.nodeName.toLowerCase()==="div"?R.prepend(te):te.nodeName.toLowerCase()==="ul"&&R.append(te)}let q=T.querySelectorAll("[data-footnote-id]"),U=R.querySelectorAll("[data-footnote-id]");if(q.length===U.length)for(let ne=0;ne<q.length;ne++)U[ne].replaceWith(q[ne]);T.replaceWith(R)}})}};var OT=require("@codemirror/view"),ST=require("obsidian");var RT=()=>OT.ViewPlugin.fromClass(Cf),Cf=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 m=`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(m),new ST.Notice(m,45e3)}return!1}let{state:i}=this.view,s=this.view.posAtDOM(t),a=i.doc.lineAt(s),o=Oe.fromLine({line:a.text,taskLocation:ot.fromUnknownPosition(""),fallbackDate:null});if(console.debug(`Live Preview Extension: toggle called. Position: ${s} Line: ${a.text}`),o===null)return!1;e.preventDefault();let l=o.toggleWithRecurrenceInUsersOrder().map(m=>m.toFileLineString()).join(i.lineBreak),c=i.update({changes:{from:a.from,to:a.to,insert:l}});this.view.dispatch(c);let f=t.checked;return setTimeout(()=>{t.checked=f},1),!0}};var Si=require("obsidian");var Cr=class{constructor(e,t,n){this.property=e,this.comparator=Cr.maybeReverse(n,t)}static maybeReverse(e,t){return e?Cr.makeReversedComparator(t):t}static makeReversedComparator(e){return(t,n)=>e(t,n)*-1}};var nn=class{constructor(e,t,n){this.property=e,this.grouper=t,this.reverse=n}};var ke=class{canCreateFilterForLine(e){return ke.lineMatchesFilter(this.filterRegExp(),e)}static lineMatchesFilter(e,t){return e?e.test(t):!1}static getMatch(e,t){return e?t.match(e):null}fieldNameSingular(){return this.fieldName()}fieldNameSingularEscaped(){return go(this.fieldNameSingular())}supportsSorting(){return!1}createSorterFromLine(e){if(!this.supportsSorting())return null;let t=ke.getMatch(this.sorterRegExp(),e);if(t===null)return null;let n=!!t[1];return this.createSorter(n)}sorterRegExp(){if(!this.supportsSorting())throw Error(`sorterRegExp() unimplemented for ${this.fieldNameSingular()}`);return new RegExp(`^sort by ${this.fieldNameSingularEscaped()}( reverse)?`)}comparator(){throw Error(`comparator() unimplemented for ${this.fieldNameSingular()}`)}createSorter(e){return new Cr(this.fieldNameSingular(),this.comparator(),e)}createNormalSorter(){return this.createSorter(!1)}createReverseSorter(){return this.createSorter(!0)}supportsGrouping(){return!1}createGrouperFromLine(e){if(!this.supportsGrouping())return null;let t=ke.getMatch(this.grouperRegExp(),e);if(t===null)return null;let n=!!t[1];return this.createGrouper(n)}grouperRegExp(){if(!this.supportsGrouping())throw Error(`grouperRegExp() unimplemented for ${this.fieldNameSingular()}`);return new RegExp(`^group by ${this.fieldNameSingularEscaped()}( reverse)?$`)}grouper(){throw Error(`grouper() unimplemented for ${this.fieldNameSingular()}`)}createGrouper(e){return new nn(this.fieldNameSingular(),this.grouper(),e)}createNormalGrouper(){return this.createGrouper(!1)}createReverseGrouper(){return this.createGrouper(!0)}};var Ae=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 Ae("None of",e,"NOT")}static booleanXor(e){return new Ae("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 Ae(e,t,n)}};var kt=class{constructor(e,t,n){this.instruction=e,this.explanation=n,this.filterFunction=t}explainFilterIndented(e){let t=this.explanation;return t.asString()===this.instruction?`${e}${this.instruction}
2 years ago
`:`${e}${this.instruction} =>
${t.asString(" ")}
1 year ago
`}},we=class{constructor(e){this.instruction=e}get filter(){return this._filter}set filter(e){this._filter=e}get filterFunction(){if(this._filter)return this._filter.filterFunction}static fromFilter(e){let t=new we(e.instruction);return t.filter=e,t}static fromError(e,t){let n=new we(e);return n.error=t,n}};var Mo=class{constructor(e,t){this._instruction=e,this._filter=t}canCreateFilterForLine(e){return e==this._instruction}createFilterOrErrorMessage(e){let t=new we(e);return e===this._instruction?(t.filter=new kt(e,this._filter,new Ae(e)),t):(t.error=`do not understand filter: ${e}`,t)}};var pr=class{constructor(){this._filters=[]}add(e,t){this._filters.push(new Mo(e,t))}canCreateFilterForLine(e){for(let t of this._filters)if(t.canCreateFilterForLine(e))return!0;return!1}createFilterOrErrorMessage(e){for(let n of this._filters){let i=n.createFilterOrErrorMessage(e);if(i.error===void 0)return i}let t=new we(e);return t.error=`do not understand filter: ${e}`,t}};var sn=class extends ke{constructor(){super(...arguments);this._filters=new pr}canCreateFilterForLine(t){return this._filters.canCreateFilterForLine(t)}createFilterOrErrorMessage(t){return this._filters.createFilterOrErrorMessage(t)}filterRegExp(){return null}};var mr=class extends sn{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=mr.oldStatusName(e),i=mr.oldStatusName(t);return n<i?1:n>i?-1:0}}static oldStatusName(e){return e.status.symbol===" "?"Todo":"Done"}supportsGrouping(){return!0}grouper(){return e=>[mr.oldStatusName(e)]}};var ft=class extends ke{constructor(t=null){super();t!==null?this.filterInstructions=t:(this.filterInstructions=new pr,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){let n=this.filterInstructions.createFilterOrErrorMessage(t);if(n.filter!==void 0)return n;let i=new we(t),s=ke.getMatch(this.filterRegExp(),t);if(s!==null){let a=s[1],o=s[2],u=s[3],l=Mt.parseDateRange(u);if(!l.isValid()){let c=Mt.parseDate(a);c.isValid()&&(l=new gt(c,c))}if(!l.isValid())i.error="do not understand "+this.fieldName()+" date";else{let c=this.buildFilterFunction(o,l),f=ft.buildExplanation(this.fieldNameForExplanation(),o,this.filterResultIfFieldMissing(),l);i.filter=new kt(t,c,f)}}else i.error="do not understand query filter ("+this.fieldName()+" date)";return i}buildFilterFunction(t,n){let i;return t==="before"?i=s=>s?s.isBefore(n.start):this.filterResultIfFieldMissing():t==="after"?i=s=>s?s.isAfter(n.end):this.filterResultIfFieldMissing():i=s=>s?s.isSameOrAfter(n.start)&&s.isSameOrBefore(n.end):this.filterResultIfFieldMissing(),this.getFilter(i)}getFilter(t){return n=>t(this.date(n))}filterRegExp(){return new RegExp(`^${this.fieldNameForFilterInstruction()} ((before|after|on|in)? ?(.*))`)}fieldNameForFilterInstruction(){return this.fieldName()}static buildExplanation(t,n,i,s){let a,o="YYYY-MM-DD (dddd Do MMMM YYYY)",u;switch(n){case"before":a=n,u=s.start.format(o);break;case"after":a=n,u=s.end.format(o);break;default:if(s.start.isSame(s.end))a="on",u=s.start.format(o);else{let c=`${t} date is between:`,f=[new Ae(`${s.start.format(o)} and`),new Ae(`${s.end.format(o)} inclusive`)];return i&&f.push(new Ae(`OR no ${t} date`)),new Ae(c,f)}break}let l=`${t} date is ${a} ${u}`;return i&&(l+=` OR no ${t} date`),new Ae(l)}fieldNameForExplanation(){return this.fieldName()}supportsSorting(){return!0}comparator(){return(t,n)=>Rr(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.format("YYYY-MM-DD dddd")]}}};var hi=class extends ft{fieldName(){return"due"}
3 years ago
`;return e}toString(){let e=`
`;e+=`Group names: [${this.groups}]
2 years ago
`;for(let t of this.groupHeadings)e+=`${"#".repeat(4+t.nestingLevel)} [${t.property}] ${t.displayName}
1 year ago
`;return e+=this.tasksAsStringOfLines(),e}};var Fo=class{constructor(e,t){this._groups=new Array;this._totalTaskCount=0;this._totalTaskCount=t.length,this._groupers=e;let i=new No(e,t).generateTaskTreeStorage();this.addTaskGroups(i),this.sortTaskGroups(),this.setGroupsHeadings(i)}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}
2 years ago
`}for(let n of this.groups)e+=n.toString(),e+=`
3 years ago
---
`;return e+=`
${this.totalTasksCount()} tasks
1 year ago
`,e}addTaskGroups(e){for(let[t,n]of e){let i=new Io(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 Ao(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 An=class extends Me{fieldName(){return"description"}value(e){return ve.removeAsSubstringFrom(e.description)}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=An.cleanDescription(e.description),i=An.cleanDescription(t.description);return n.localeCompare(i,void 0,{numeric:!0})}}static cleanDescription(e){e=ve.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 Lo=class extends ft{fieldName(){return"created"}date(e){return e.createdDate}filterResultIfFieldMissing(){return!1}};var Uo=class extends ft{fieldName(){return"done"}date(e){return e.doneDate}filterResultIfFieldMissing(){return!1}};var Wo=class extends sn{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"}};function MT(r,e){let t=[["task",r]],n=t.map(([a])=>a),i=e&&new Function(...n,`return ${e}`);if(!(i instanceof Function))return"Error parsing group function";let s=t.map(([a,o])=>o);try{return i(...s)}catch(a){let o=`Error: Failed calculating expression "${e}". The error message was: `;return a instanceof Error?o+a.message:o+"Unknown error"}}var qo=class extends ke{createFilterOrErrorMessage(e){return we.fromError(e,"Searching by custom function not yet implemented")}fieldName(){return"function"}filterRegExp(){return null}supportsGrouping(){return!0}createGrouperFromLine(e){let t=ke.getMatch(this.grouperRegExp(),e);if(t===null)return null;let n=!!t[1],i=t[2];return new nn("function",Qx(i),n)}grouperRegExp(){return new RegExp(`^group by ${this.fieldNameSingularEscaped()}( reverse)? (.*)`)}grouper(){throw Error("grouper() function not valid for FunctionField. Use createGrouperFromLine() instead.")}};function Qx(r){return e=>Zx(e,r)}function Zx(r,e){try{let t=MT(r,e);return Array.isArray(t)?t.map(i=>i.toString()):t===null?[]:[t.toString()]}catch(t){let n=`Error: Failed calculating expression "${e}". The error message was: `;return t instanceof Error?[n+t.message]:[n+"Unknown error"]}}var Yo=class extends Me{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 $o=class extends ft{fieldName(){return"scheduled"}date(e){return e.scheduledDate}filterResultIfFieldMissing(){return!1}};var jo=class extends ft{fieldName(){return"start"}fieldNameForFilterInstruction(){return"starts"}date(e){return e.startDate}filterResultIfFieldMissing(){return!0}};var Go=class extends ft{constructor(){let e=new pr;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}earlie
2 years ago
Allowed options: 'is' and 'is not' (without quotes).
Allowed values: ${t}
Note: values are case-insensitive,
so 'in_progress' works too, for example.
1 year ago
Example: ${this.fieldNameSingular()} is not NON_TASK`;return we.fromError(e,n)}fieldName(){return"status.type"}value(e){return e.status.type}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=on.groupName(e),i=on.groupName(t);return n.localeCompare(i,void 0,{numeric:!0})}}supportsGrouping(){return!0}grouper(){return e=>[on.groupName(e)]}static groupName(e){let t;switch(e.status.type){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.status.type}`}};var eu=class extends Me{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 tu=class extends Me{fieldName(){return"folder"}value(e){return e.file.folder}supportsGrouping(){return!0}grouper(){return e=>[Me.escapeMarkdownCharacters(this.value(e))]}};var ru=class extends Me{fieldName(){return"root"}value(e){return e.file.root}supportsGrouping(){return!0}grouper(){return e=>[Me.escapeMarkdownCharacters(this.value(e))]}};var nu=class extends Me{fieldName(){return"backlink"}value(e){let t=e.getLinkText({isFilenameUnique:!0});return t===null?"Unknown Location":t}createFilterOrErrorMessage(e){return we.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=Me.escapeMarkdownCharacters(t);return e.precedingHeader&&e.precedingHeader!==t&&(n+=" > "+e.precedingHeader),[n]}}};var Hf=[()=>new Jo,()=>new on,()=>new mr,()=>new Bo,()=>new xn,()=>new Go,()=>new Lo,()=>new jo,()=>new $o,()=>new hi,()=>new Uo,()=>new Ti,()=>new tu,()=>new ru,()=>new nu,()=>new An,()=>new Pn,()=>new Yo,()=>new Wo,()=>new Zo,()=>new bi,()=>new eu,()=>new qo,()=>new Xo];function Qo(r){for(let e of Hf){let t=e();if(t.canCreateFilterForLine(r))return t.createFilterOrErrorMessage(r)}return null}function jT(r){let e=/^sort by /;if(r.match(e)===null)return null;for(let t of Hf){let i=t().createSorterFromLine(r);if(i)return i}return null}function GT(r){let e=/^group by /;if(r.match(e)===null)return null;for(let t of Hf){let i=t().createGrouperFromLine(r);if(i)return i}return null}var Ur=class{constructor({source:e}){this._limit=void 0;this._taskGroupLimit=void 0;this._layoutOptions=new js;this._filters=[];this._error=void 0;this._sorting=[];this._grouping=[];this.hideOptionsRegexp=/^(hide|show) (task count|backlink|priority|created date|start date|scheduled date|done date|due date|recurrence rule|edit button|urgency)/;this.shortModeRegexp=/^short/;this.explainQueryRegexp=/^explain/;this.limitRegexp=/^limit (groups )?(to )?(\d+)( tasks?)?/;this.commentRegexp=/^#.*/;this.source=e,e.split(`
`).map(t=>t.trim()).forEach(t=>{switch(!0){case t==="":break;case this.shortModeRegexp.test(t):this._layoutOptions.shortMode=!0;break;case this.explainQueryRegexp.test(t):this._layoutOptions.explainQuery=!0;break;case this.limitRegexp.test(t):this.parseLimit({line:t});break;case this.parseSortBy({line:t}):break;case this.parseGroupBy({line:t}):break;case this.hideOptionsRegexp.test(t):this.parseHideOptions({line:t});break;case this.commentRegexp.test(t):break;case this.parseFilter(t):break;default:this._error=`do not understand query: ${t}`}})}append(e){return this.source===""?e:e.source===""?this:new Ur({source:`${this.source}
${e.source}`})}explainQuery(){let e="",t=this.filters.length;if(t===0)e+="No filters supplied. All tasks will match the query.";else for(let i=0;i<t;i++)i>0&&(e+=`
`),e+=this.filters[i].explainFilterIndented("");e+=this.explainQueryLimits();let{debugSettings:n}=X();return n.ignoreSortInstructions&&(e+=`
2 years ago
1 year ago
NOTE: All sort instructions, including default sort order, are disabled, due to 'ignoreSortInstructions' setting.`),e}explainQueryLimits(){let e="";function t(n){let i=`
2 years ago
1 year ago
At most ${n} task`;return n!==1&&(i+="s"),i}return this._limit!==void 0&&(e+=t(this._limit),e+=`.
2 years ago
`),this._taskGroupLimit!==void 0&&(e+=t(this._taskGroupLimit),e+=` per group (if any "group by" options are supplied).
1 year ago
`),e}get limit(){return this._limit}get layoutOptions(){return this._layoutOptions}get filters(){return this._filters}get sorting(){return this._sorting}get grouping(){return this._grouping}get error(){return this._error}applyQueryToTasks(e){this.filters.forEach(a=>{e=e.filter(a.filterFunction)});let{debugSettings:t}=X(),i=(t.ignoreSortInstructions?e:vi.by(this.sorting,e)).slice(0,this.limit),s=new Fo(this.grouping,i);return this._taskGroupLimit!==void 0&&s.applyTaskLimit(this._taskGroupLimit),s}parseHideOptions({line:e}){let t=e.match(this.hideOptionsRegexp);if(t!==null){let n=t[1]==="hide";switch(t[2]){case"task count":this._layoutOptions.hideTaskCount=n;break;case"backlink":this._layoutOptions.hideBacklinks=n;break;case"priority":this._layoutOptions.hidePriority=n;break;case"created date":this._layoutOptions.hideCreatedDate=n;break;case"start date":this._layoutOptions.hideStartDate=n;break;case"scheduled date":this._layoutOptions.hideScheduledDate=n;break;case"due date":this._layoutOptions.hideDueDate=n;break;case"done date":this._layoutOptions.hideDoneDate=n;break;case"recurrence rule":this._layoutOptions.hideRecurrenceRule=n;break;case"edit button":this._layoutOptions.hideEditButton=n;break;case"urgency":this._layoutOptions.hideUrgency=n;break;default:this._error="do not understand hide/show option"}}}parseFilter(e){let t=Qo(e);return t!=null?(t.filter?this._filters.push(t.filter):this._error=t.error,!0):!1}parseLimit({line:e}){let t=e.match(this.limitRegexp);if(t===null){this._error="do not understand query limit";return}let n=Number.parseInt(t[3],10);t[1]!==void 0?this._taskGroupLimit=n:this._limit=n}parseSortBy({line:e}){let t=jT(e);return t?(this._sorting.push(t),!0):!1}parseGroupBy({line:e}){let t=GT(e);return t?(this._grouping.push(t),!0):!1}};function BT(r){let e="";ve.isEmpty()||(e+=`Only tasks containing the global filter '${ve.get()}'.
2 years ago
1 year ago
`);let t=new Ur(mf());return t.source.trim()!==""&&(e+=`Explanation of the global query:
2 years ago
${t.explainQuery()}
`),e+=`Explanation of this Tasks code block query:
2 years ago
1 year ago
${new Ur({source:r}).explainQuery()}`,e}function iu(r){return new Ur(mf()).append(new Ur({source:r}))}var su=class{constructor({plugin:e,events:t}){this.addQueryRenderChild=this._addQueryRenderChild.bind(this);this.app=e.app,this.events=t,e.registerMarkdownCodeBlockProcessor("tasks",this._addQueryRenderChild.bind(this))}_addQueryRenderChild(e,t,n){return W(this,null,function*(){n.addChild(new zf({app:this.app,events:this.events,container:t,source:e,filePath:n.sourcePath}))})}},zf=class extends Si.MarkdownRenderChild{constructor({app:t,events:n,container:i,source:s,filePath:a}){super(i);switch(this.app=t,this.events=n,this.source=s,this.filePath=a,this.containerEl.className){case"block-language-tasks":this.query=iu(this.source),this.queryType="tasks";break;default:this.query=iu(this.source),this.queryType="tasks";break}}onload(){this.events.triggerRequestCacheUpdate(this.render.bind(this)),this.renderEventRef=this.events.onCacheUpdate(this.render.bind(this)),this.reloadQueryAtMidnight()}onunload(){this.renderEventRef!==void 0&&this.events.off(this.renderEventRef),this.queryReloadTimeout!==void 0&&clearTimeout(this.queryReloadTimeout)}reloadQueryAtMidnight(){let t=new Date;t.setHours(24,0,0,0);let n=new Date,i=t.getTime()-n.getTime();this.queryReloadTimeout=setTimeout(()=>{this.query=iu(this.source),this.events.triggerRequestCacheUpdate(this.render.bind(this)),this.reloadQueryAtMidnight()},i+1e3)}render(i){return W(this,arguments,function*({tasks:t,state:n}){var a;let s=this.containerEl.createEl("div");if(n==="Warm"&&this.query.error===void 0){console.debug(`Render ${this.queryType} called for a block in active file "${this.filePath}", to select from ${t.length} tasks: plugin state: ${n}`),this.query.layoutOptions.explainQuery&&this.createExplanation(s);let o=this.query.applyQueryToTasks(t);for(let l of o.groups){this.addGroupHeadings(s,l.groupHeadings);let{taskList:c}=yield this.createTasksList({tasks:l.tasks,content:s});s.appendChild(c)}let u=o.totalTasksCount();console.debug(`${u} of ${t.length} tasks displayed in a block in "${this.filePath}"`),this.addTaskCount(s,u)}else this.query.error!==void 0?s.createDiv().innerHTML=`<pre>Tasks query: ${this.query.error.replace(/\n/g,"<br>")}</pre>`:s.setText("Loading Tasks ...");(a=this.containerEl.firstChild)==null||a.replaceWith(s)})}createExplanation(t){let n=BT(this.source),i=t.createEl("pre");i.addClasses(["plugin-tasks-query-explanation"]),i.setText(n),t.appendChild(i)}createTasksList(i){return W(this,arguments,function*({tasks:t,content:n}){let s=t.length,a=new Qr(this.query.layoutOptions),o=n.createEl("ul");o.addClasses(["contains-task-list","plugin-tasks-query-result"]),o.addClasses(a.specificClasses);let u=this.getGroupingAttribute();u&&u.length>0&&(o.dataset.taskGroupBy=u);for(let l=0;l<s;l++){let c=t[l],f=this.isFilenameUnique({task:c}),m=yield c.toLi({parentUlElement:o,listIndex:l,layoutOptions:this.query.layoutOptions,isFilenameUnique:f,taskLayout:a,obsidianComponent:this});m.querySelectorAll("[data-footnote-id]").forEach(R=>R.remove());let y=this.query.layoutOptions.shortMode,w=m.createSpan("task-extras");this.query.layoutOptions.hideUrgency||this.addUrgency(w,c),this.query.layoutOptions.hideBacklinks||this.addBacklinks(w,c,y,f),this.query.layoutOptions.hideEditButton||this.addEditButton(w,c),o.appendChild(m)}return{taskList:o,tasksCount:s}})}addEditButton(t,n){t.createEl("a",{cls:"tasks-edit"}).onClickEvent(s=>{s.preventDefault();let a=u=>{bo({originalTask:n,newTasks:Et.removeInferredStatusIfNeeded(n,u)})};new rn({app:this.app,task:n,onSubmit:a}).open()})}addUrgency(t,n){let i=new Intl.NumberFormat().format(n.urgency);t.createSpan({text:i,cls:"tasks-urgency"})}addGroupHeadings(t,n){for(let i of n)this.addGroupHeading(t,i)}addGroupHeading(t,n){return W(this,null,function*(){let i="h6";n.nestingLevel===0?i="h4":n.nestingLevel===1&&(i="h5");let s=t.createEl(i,{cls:"tasks-group-heading"});yield Si.MarkdownRenderer.renderMarkdown(n.displayName,s,this.filePath,this)})}addBacklinks(t,n,i,s){var c;let a=t.createSpan({cls:"tasks-backlink"});i||a.append(" (");let o=a.creat
`)+`
1 year ago
Fix errors before saving.`;new ir.Notice(f);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?Nt.removeValidationError(t):Nt.setValidationError(t)}};var It=class extends _e.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 W(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 _e.Setting(t).setName("Task Format").setDesc(It.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(Mr))i.addOption(s,Mr[s].displayName);i.setValue(X().taskFormat).onChange(s=>W(this,null,function*(){Ge({taskFormat:s}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Global filter Settings"}),new _e.Setting(t).setName("Global task filter").setDesc(It.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(ve.get()).onChange(s=>W(this,null,function*(){ve.set(s),yield this.plugin.saveSettings()}))}),new _e.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=>W(this,null,function*(){Ge({removeGlobalFilter:a}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Global Query"}),dA(new _e.Setting(t).setDesc(It.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...
2 years ago
path does not include _templates/
limit 300
1 year ago
show urgency`).setValue(s.globalQuery).onChange(a=>W(this,null,function*(){Ge({globalQuery:a}),yield this.plugin.saveSettings()}))})),t.createEl("h4",{text:"Task Statuses"});let{headingOpened:n}=X();JT.forEach(i=>{this.addOneSettingsBlock(t,i,n)}),t.createEl("h4",{text:"Date Settings"}),new _e.Setting(t).setName("Set created date on every added task").setDesc(It.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=>W(this,null,function*(){Ge({setCreatedDate:a}),yield this.plugin.saveSettings()}))}),new _e.Setting(t).setName("Set done date on every completed task").setDesc(It.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=>W(this,null,function*(){Ge({setDoneDate:a}),yield this.plugin.saveSettings()}))}),new _e.Setting(t).setName("Use filename as Scheduled date for undated tasks").setDesc(It.createFragmentWithHTML('Save time entering Scheduled (\u23F3) dates.</br>If this option is enabled, any undated tasks will be given a default Scheduled date extracted from their file name.</br>The date in the file name must be in one of <code>YYYY-MM-DD</code> or <code>YYYYMMDD</code> formats.</br>Undated tasks have none of Due (\u{1F4C5} ), Scheduled (\u23F3) and Start (\u{1F6EB}) dates.</br><p>See the <a href="https://publish.obsidian.md/tasks/Getting+Started/Use+Filename+as+Default+Date">documentation</a>.</p>')).addToggle(i=>{let s=X();i.setValue(s.useFilenameAsScheduledDate).onChange(a=>W(this,null,function*(){Ge({useFilenameAsScheduledDate:a}),yield this.plugin.saveSettings()}))}),new _e.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=>W(this,null,function*(){let s=X();yield this.plugin.saveSettings(),i.setValue(It.renderFolderArray(s.filenameAsDateFolders)).onChange(a=>W(this,null,function*(){let o=It.parseCommaSeparatedFolders(a);Ge({filenameAsDateFolders:o}),yield this.plugin.saveSettings()}))})),t.createEl("h4",{text:"Recurring task Settings"}),new _e.Setting(t).setName("Next recurrence appears on the line below").setDesc(It.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=>W(this,null,function*(){Ge({recurrenceOnNextLine:a}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Auto-suggest Settings"}),new _e.Setting(t).setName("Auto-suggest task content").setDesc(It.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=>W(this,null,function*(){Ge({autoSuggestInEditor:a}),yield this.plugin.saveSettings()}))}),new _e.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=>W(this,null,function*(){Ge({autoSuggestMinMatch:a}),yield this.plugin.saveSettings()}))}),new _e.Setting(t).setName("Maximum number of auto-suggestio
`);t(o)}).open(),n};var nb=(r,e)=>{let t=Do({line:"",path:""});return new rn({app:r,task:t,onSubmit:e})};var ib=r=>({createTaskLineModal:()=>rb(r,nb)});var ou=class extends sb.Plugin{get apiV1(){return ib(app)}onload(){return W(this,null,function*(){yo.registerConsoleLogger(),console.log('loading plugin "tasks"'),yield this.loadSettings(),this.addSettingTab(new na({plugin:this})),Q_({metadataCache:this.app.metadataCache,vault:this.app.vault,workspace:this.app.workspace}),yield this.loadTaskStatuses();let t=new So({obsidianEvents:this.app.workspace});this.cache=new On({metadataCache:this.app.metadataCache,vault:this.app.vault,events:t}),this.inlineRenderer=new Ro({plugin:this}),this.queryRenderer=new su({plugin:this,events:t}),this.registerEditorExtension(RT()),this.registerEditorSuggest(new au(this.app,X())),new Oo({plugin:this})})}loadTaskStatuses(){return W(this,null,function*(){let{statusSettings:t}=X();He.applyToStatusRegistry(t,Se.getInstance())})}onunload(){var t;console.log('unloading plugin "tasks"'),(t=this.cache)==null||t.unload()}loadSettings(){return W(this,null,function*(){let t=yield this.loadData();Ge(t),yield this.loadTaskStatuses()})}saveSettings(){return W(this,null,function*(){yield this.saveData(X())})}getTasks(){var t;return(t=this.cache)==null?void 0:t.getTasks()}};
2 years ago
/*!
* EventEmitter2
* https://github.com/hij1nx/EventEmitter2
*
* Copyright (c) 2013 hij1nx
* Licensed under the MIT license.
*/