notes/.obsidian/plugins/obsidian-tasks-plugin/main.js

164 lines
315 KiB
JavaScript
Raw Normal View History

2023-01-12 20:12:24 -05:00
/*
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 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.
*/
"use strict";var F_=Object.create;var Zn=Object.defineProperty,U_=Object.defineProperties,q_=Object.getOwnPropertyDescriptor,L_=Object.getOwnPropertyDescriptors,W_=Object.getOwnPropertyNames,af=Object.getOwnPropertySymbols,Y_=Object.getPrototypeOf,uf=Object.prototype.hasOwnProperty,$_=Object.prototype.propertyIsEnumerable;var of=(r,e,t)=>e in r?Zn(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Me=(r,e)=>{for(var t in e||(e={}))uf.call(e,t)&&of(r,t,e[t]);if(af)for(var t of af(e))$_.call(e,t)&&of(r,t,e[t]);return r},dt=(r,e)=>U_(r,L_(e));var p=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),j_=(r,e)=>{for(var t in e)Zn(r,t,{get:e[t],enumerable:!0})},lf=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of W_(e))!uf.call(r,i)&&i!==t&&Zn(r,i,{get:()=>e[i],enumerable:!(n=q_(e,i))||n.enumerable});return r};var Os=(r,e,t)=>(t=r!=null?F_(Y_(r)):{},lf(e||!r||!r.__esModule?Zn(t,"default",{value:r,enumerable:!0}):t,r)),B_=r=>lf(Zn({},"__esModule",{value:!0}),r);var B=(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 Cf=p((Fk,xs)=>{var pf,hf,mf,yf,gf,_f,Tf,bf,vf,Ss,mo,Ef,wf,Rf,ln,Mf,Df,Of,Pf,kf,Af,Sf,Nf,xf,Ns;(function(r){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){r(t(e,t(n)))}):typeof xs=="object"&&typeof xs.exports=="object"?r(t(e,t(xs.exports))):r(t(e));function t(n,i){return n!==e&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(s,a){return n[s]=i?i(s,a):a}}})(function(r){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])};pf=function(n,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");e(n,i);function s(){this.constructor=n}n.prototype=i===null?Object.create(i):(s.prototype=i.prototype,new s)},hf=Object.assign||function(n){for(var i,s=1,a=arguments.length;s<a;s++){i=arguments[s];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])}return n},mf=function(n,i){var s={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&i.indexOf(a)<0&&(s[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,a=Object.getOwnPropertySymbols(n);o<a.length;o++)i.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(n,a[o])&&(s[a[o]]=n[a[o]]);return s},yf=function(n,i,s,a){var o=arguments.length,u=o<3?i:a===null?a=Object.getOwnPropertyDescriptor(i,s):a,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(n,i,s,a);else for(var c=n.length-1;c>=0;c--)(l=n[c])&&(u=(o<3?l(u):o>3?l(i,s,u):l(i,s))||u);return o>3&&u&&Object.defineProperty(i,s,u),u},gf=function(n,i){return function(s,a){i(s,a,n)}},_f=function(n,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,i)},Tf=function(n,i,s,a){function o(u){return u instanceof s?u:new s(function(l){l(u)})}return new(s||(s=Promise))(function(u,l){function c(h){try{f(a.next(h))}catch(_){l(_)}}function d(h){try{f(a.throw(h))}catch(_){l(_)}}function f(h){h.done?u(h.value):o(h.value).then(c,d)}f((a=a.apply(n,i||[])).next())})},bf=function(n,i){var s={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},a,o,u,l;return l={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function c(f){return function(h){return d([f,h])}}function d(f){if(a)throw new TypeError("Generator is already executing.");for(;s;)try{if(a=1,o&&(u=f[0]&2?o.return:f[0]?o.throw||((u=o.return)&&u.call(o),0):o.next)&&!(u=u.call(o,f[1])).done)return u;switch(o=0,u&&(f=[f[0]&2,u.value]),f[0]){case 0:case 1:u=f;break;case 4:return s.label++,{value:f[1],done:!1};case 5:s.label++,o=f[1],
`).map(eT).filter(function(t){return t!==null});return Be(Be({},e[0]),e[1])}function ri(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=C.untilStringToDate(i),e}function eT(r){if(r=r.replace(/^\s+|\s+$/,""),!r.length)return null;var e=/^([A-Z]+?)[:;]/.exec(r.toUpperCase());if(!e)return Bf(r);var t=e[1];switch(t.toUpperCase()){case"RRULE":case"EXRULE":return Bf(r);case"DTSTART":return ri(r);default:throw new Error("Unsupported RFC prop ".concat(t," in ").concat(r))}}function Bf(r){var e=r.replace(/^RRULE:/i,""),t=ri(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=$[o.toUpperCase()];break;case"WKST":t.wkst=pt[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=tT(o),l=a.toLowerCase();t[l]=u;break;case"BYWEEKDAY":case"BYDAY":t.byweekday=rT(o);break;case"DTSTART":case"TZID":var c=ri(r);t.tzid=c.tzid,t.dtstart=c.dtstart;break;case"UNTIL":t.until=C.untilStringToDate(o);break;case"BYEASTER":t.byeaster=Number(o);break;default:throw new Error("Unknown RRULE property '"+a+"'")}}),t}function tT(r){if(r.indexOf(",")!==-1){var e=r.split(",");return e.map(Gf)}return Gf(r)}function Gf(r){return/^[+-]?\d+$/.test(r)?Number(r):r}function rT(r){var e=r.split(",");return e.map(function(t){if(t.length===2)return pt[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=pt[s].weekday;return new Te(a,i)})}var Cr=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=C.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 ii(r){for(var e=[],t="",n=Object.keys(r),i=Object.keys(ti),s=0;s<n.length;s++)if(n[s]!=="tzid"&&!!K(i,n[s])){var a=n[s].toUpperCase(),o=r[n[s]],u="";if(!(!oe(o)||Fe(o)&&!o.length)){switch(a){case"FREQ":u=O.FREQUENCIES[r.freq];break;case"WKST":nt(o)?u=new Te(o).toString():u=o.toString();break;case"BYWEEKDAY":a="BYDAY",u=df(o).map(function(h){return h instanceof Te?h:Fe(h)?new Te(h[0],h[1]):new Te(h)}).toString();break;case"DTSTART":t=nT(o,r.tzid);break;case"UNTIL":u=C.timeToUntilString(o,!r.tzid);break;default:if(Fe(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(h){var _=h[0],m=h[1];return"".concat(_,"=").concat(m.toString())}).join(";"),f="";return d!==""&&(f="RRULE:".concat(d)),[t,f].filter(function(h){return!!h}).join(`
`)}function nT(r,e){return r?"DTSTART"+new Cr(new Date(r),e).toString():""}function iT(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 Hf=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?C.clone(t):C.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 d=0;d<i.length;d++){var f=i[d];if(!iT(t[f],c[f]))return!0}return!1},a=this[e];if(e==="all")n=this.all;else if(Fe(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 Vt(e,t),o=0;o<this.all.length&&l.accept(this.all[o]);o++);n=l.getValue(),this._cacheAdd(e,n,t)}return Fe(n)?C.cloneDates(n):n instanceof Date?C.clone(n):n},r}();var zf=T(T(T(T(T(T(T(T(T(T(T(T(T([],G(1,31),!0),G(2,28),!0),G(3,31),!0),G(4,30),!0),G(5,31),!0),G(6,30),!0),G(7,31),!0),G(8,31),!0),G(9,30),!0),G(10,31),!0),G(11,30),!0),G(12,31),!0),G(1,7),!0),Kf=T(T(T(T(T(T(T(T(T(T(T(T(T([],G(1,31),!0),G(2,29),!0),G(3,31),!0),G(4,30),!0),G(5,31),!0),G(6,30),!0),G(7,31),!0),G(8,31),!0),G(9,30),!0),G(10,31),!0),G(11,30),!0),G(12,31),!0),G(1,7),!0),sT=ft(1,29),aT=ft(1,30),gr=ft(1,31),$e=ft(1,32),Vf=T(T(T(T(T(T(T(T(T(T(T(T(T([],$e,!0),aT,!0),$e,!0),gr,!0),$e,!0),gr,!0),$e,!0),$e,!0),gr,!0),$e,!0),gr,!0),$e,!0),$e.slice(0,7),!0),Xf=T(T(T(T(T(T(T(T(T(T(T(T(T([],$e,!0),sT,!0),$e,!0),gr,!0),$e,!0),gr,!0),$e,!0),$e,!0),gr,!0),$e,!0),gr,!0),$e,!0),$e.slice(0,7),!0),oT=ft(-28,0),uT=ft(-29,0),_r=ft(-30,0),je=ft(-31,0),Zf=T(T(T(T(T(T(T(T(T(T(T(T(T([],je,!0),uT,!0),je,!0),_r,!0),je,!0),_r,!0),je,!0),je,!0),_r,!0),je,!0),_r,!0),je,!0),je.slice(0,7),!0),Qf=T(T(T(T(T(T(T(T(T(T(T(T(T([],je,!0),oT,!0),je,!0),_r,!0),je,!0),_r,!0),je,!0),je,!0),_r,!0),je,!0),_r,!0),je,!0),je.slice(0,7),!0),Jf=[0,31,60,91,121,152,182,213,244,274,305,335,366],ep=[0,31,59,90,120,151,181,212,243,273,304,334,365],_o=function(){for(var r=[],e=0;e<55;e++)r=r.concat(ft(7));return r}();function tp(r,e){var t=new Date(Date.UTC(r,0,1)),n=C.isLeapYear(r)?366:365,i=C.isLeapYear(r+1)?366:365,s=C.toOrdinal(t),a=C.getWeekday(t),o=Be(Be({yearlen:n,nextyearlen:i,yearordinal:s,yearweekday:a},lT(r)),{wnomask:null});if(it(e.byweekno))return o;o.wnomask=G(0,n+7);var u,l,c=u=Ye(7-a+e.wkst,7);c>=4?(c=0,l=o.yearlen+Ye(a-e.wkst,7)):l=n-c;for(var d=Math.floor(l/7),f=Ye(l,7),h=Math.floor(d+f/4),_=0;_<e.byweekno.length;_++){var m=e.byweekno[_];if(m<0&&(m+=h+1),m>0&&m<=h){var g=void 0;m>1?(g=c+(m-1)*7,c!==u&&(g-=7-u)):g=c;for(var R=0;R<7&&(o.wnomask[g]=1,g++,o.wdaymask[g]!==e.wkst);R++);}}if(K(e.byweekno,1)){var g=c+h*7;if(c!==u&&(g-=7-u),g<n)for(var _=0;_<7&&(o.wnomask[g]=1,g+=1,o.wdaymask[g]!==e.wkst);_++);}if(c){var w=void 0;if(K(e.byweekno,-1))w=-1;else{var k=C.getWeekday(new Date(Date.UTC(r-1,0,1))),z=Ye(7-k.valueOf()+e.wkst,7),fe=C.isLeapYear(r-1)?366:365,he=void 0;z>=4?(z=0,he=fe+Ye(k-e.wkst,7)):he=n-c,w=Math.floor(52+Ye(he,7)/4)}if(K(e.byweekno,w))for(var g=0;g<c;g++)o.wnomask[g]=1}return o}function lT(r){var e=C.isLeapYear(r)?366:365,t=new Date(Date.UTC(r,0,1)),n=C.getWeekday(t);return e===365?{mmask:zf,mdaymask:Xf,nmdaymask:Qf,wdaymask:_o.slice(n),mrange:ep}:{mmask:Kf,mdaymask:Vf,nmdaymask:Zf,wdaymask:_o.slice(n),mrange:Jf}}function rp(r,e,t,n,i,s){var a={lastyear:r,lastmonth:e,nwdaymask:[]},o=[];if(s.freq===O.YEARLY)if(it(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===O.MONTHLY&&(o=[n.slice(e-1,e+1)]);if(it(o))return a;a.nwdaymask=G(0,t);for(var u=0;u<o.length;u++)for(var l=o[u],c=l[0],d=l[1]-1,f=0;f<s.bynweekday.length;f++){var h=void 0,_=s.bynweekday[f],m=_[0],g=_[1];g<0?(h=d+(g+1)*7,h-=Ye(i[h]-m,7)):(h=c+(g-1)*7,h+=Ye(7-i[h]+m,7)),c<=h&&h<=d&&(a.nwdaymask[h]=1)}return a}function np(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=
`),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 bT(r){r.forEach(function(e){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(e))throw new Error("unsupported RDATE/EXDATE parm: "+e)})}function lp(r,e){return bT(e),r.split(",").map(function(t){return C.untilStringToDate(t)})}function cp(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 bo=function(r){cn(e,r);function e(t){t===void 0&&(t=!1);var n=r.call(this,{},t)||this;return n.dtstart=cp.apply(n,["dtstart"]),n.tzid=cp.apply(n,["tzid"]),n._rrule=[],n._rdate=[],n._exrule=[],n._exdate=[],n}return e.prototype._iter=function(t){return op(t,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},e.prototype.rrule=function(t){dp(t,this._rrule)},e.prototype.exrule=function(t){dp(t,this._exrule)},e.prototype.rdate=function(t){fp(t,this._rdate)},e.prototype.exdate=function(t){fp(t,this._exdate)},e.prototype.rrules=function(){return this._rrule.map(function(t){return Is(t.toString())})},e.prototype.exrules=function(){return this._exrule.map(function(t){return Is(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(ii({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(pp("RDATE",this._rdate,this.tzid())),this._exdate.length&&t.push(pp("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}(O);function dp(r,e){if(!(r instanceof O))throw new TypeError(String(r)+" is not RRule instance");K(e.map(String),String(r))||e.push(r)}function fp(r,e){if(!(r instanceof Date))throw new TypeError(String(r)+" is not Date instance");K(e.map(Number),Number(r))||(e.push(r),C.sort(e))}function pp(r,e,t){var n=!t||t.toUpperCase()==="UTC",i=n?"".concat(r,":"):"".concat(r,";TZID=").concat(t,":"),s=e.map(function(a){return C.timeToUntilString(a.valueOf(),n)}).join(",");return"".concat(i).concat(s)}var jg=Os(we()),ar=class{static parseDate(e,t=!1){return window.moment(jg.parseDate(e,void 0,{forwardDate:t})).startOf("day")}};var _e=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 _e("None of",e,"NOT")}static booleanXor(e){return new _e("Exactly one of",e,"XOR")}asString(e=""){if(this.children.length==0)return e+this.description;let t=e+`${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 _e(e,t,n)}};var or=class{constructor(e,t,n){this.property=e,this.comparator=or.maybeReverse(n,t)}static maybeReverse(e,t){return e?or.makeReversedComparator(t):t}static makeReversedComparator(e){return(t,n)=>e(t,n)*-1}};var ce=class{canCreateFilterForLine(e){return ce.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()}supportsSorting(){return!1}parseSortLine(e){return!this.supportsSorting()||!this.canCreateSorterForLine(e)?null:this.createSorterFromLine(e)}canCreateSorterForLine(e){return this.supportsSorting()?ce.lineMatchesFilter(this.sorterRegExp(),e):!1}createSorterFromLine(e){if(!this.supportsSorting())return null;let t=ce.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.fieldNameSingular()}( reverse)?`)}comparator(){throw Error(`comparator() unimplemented for ${this.fieldNameSingular()}`)}createSorter(e){return new or(this.fieldNameSingular(),this.comparator(),e)}createNormalSorter(){return this.createSorter(!1)}createReverseSorter(){return this.createSorter(!0)}};var Ze=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}
`:`${e}${this.instruction} =>
${t.asString(" ")}
`}},de=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 de(e.instruction);return t.filter=e,t}static fromError(e,t){let n=new de(e);return n.error=t,n}};var Oa=class{constructor(e,t){this._instruction=e,this._filter=t}canCreateFilterForLine(e){return e==this._instruction}createFilterOrErrorMessage(e){let t=new de(e);return e===this._instruction?(t.filter=new Ze(e,this._filter,new _e(e)),t):(t.error=`do not understand filter: ${e}`,t)}};var Dr=class{constructor(){this._filters=[]}add(e,t){this._filters.push(new Oa(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 de(e);return t.error=`do not understand filter: ${e}`,t}};var pe=class extends ce{constructor(){super();this.filterInstructions=new Dr,this.filterInstructions.add(`has ${this.fieldName()} date`,t=>this.date(t)!==null),this.filterInstructions.add(`no ${this.fieldName()} date`,t=>this.date(t)===null),this.filterInstructions.add(`${this.fieldName()} date is invalid`,t=>{let n=this.date(t);return n!==null&&!n.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 de(t),s=ce.getMatch(this.filterRegExp(),t),a;if(s!==null){let o=ar.parseDate(s[2]);if(!o.isValid())i.error="do not understand "+this.fieldName()+" date";else{let u;s[1]==="before"?(a=c=>{let d=this.date(c);return d?d.isBefore(o):this.filterResultIfFieldMissing()},u=" "+s[1]):s[1]==="after"?(a=c=>{let d=this.date(c);return d?d.isAfter(o):this.filterResultIfFieldMissing()},u=" "+s[1]):(a=c=>{let d=this.date(c);return d?d.isSame(o):this.filterResultIfFieldMissing()},u=" on");let l=pe.getExplanationString(this.fieldName(),u,this.filterResultIfFieldMissing(),o);i.filter=new Ze(t,a,new _e(l))}}else i.error="do not understand query filter ("+this.fieldName()+" date)";return i}static getExplanationString(t,n,i,s){let a=s.format("YYYY-MM-DD (dddd Do MMMM YYYY)"),o=`${t} date is${n} ${a}`;return i&&(o+=` OR no ${t} date`),o}supportsSorting(){return!0}comparator(){return(t,n)=>pe.compareByDate(this.date(t),this.date(n))}static compareByDate(t,n){return t!==null&&n===null?-1:t===null&&n!==null?1:t!==null&&n!==null?t.isValid()&&!n.isValid()?-1:!t.isValid()&&n.isValid()||t.isAfter(n)?1:t.isBefore(n)?-1:0:0}};var xe=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=O.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 O(u);return new xe({rrule:c,baseOnToday:o,referenceDate:l,startDate:t,scheduledDate:n,dueDate:i})}}catch(s){}return null}toText(){let e=this.rrule.toText();return this.baseOnToday&&(e+=" when done"),e}next(){var t;let e;if(this.baseOnToday){let n=window.moment(),i=new O(dt(Me({},this.rrule.origOptions),{dtstart:n.startOf("day").utc(!0).toDate()}));e=this.nextAfter(n.endOf("day"),i)}else{let n=window.moment((t=this.referenceDate)!=null?t:void 0).endOf("day");e=this.nextAfter(n,this.rrule)}if(e!==null){let n=null,i=null,s=null;if(this.referenceDate){if(this.startDate){let a=window.moment.duration(this.startDate.diff(this.referenceDate));n=window.moment(e),n.add(Math.round(a.asDays()),"days")}if(this.scheduledDate){let a=window.moment.durati
`),{globalFilter:f}=H(),h,_=0;for(let g of l){if(g.position.start.line<r.sectionStart||g.task===void 0)continue;if(d[g.position.start.line].includes(f)){if(_===r.sectionIndex){h=g;break}_++}}if(h===void 0){console.error("Tasks: could not find task to toggle in the file.");return}let m=[...d.slice(0,h.position.start.line),...e.map(g=>g.toFileLineString()),...d.slice(h.position.start.line+1)];yield t.modify(o,m.join(`
`))});function WP(r,e,t){return B(this,null,function*(){yield Kg.MarkdownRenderer.renderMarkdown(r,e,t,null)})}function Vg(r,e,t=null){return B(this,null,function*(){var a;t||(t=WP);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"),yield YP(r,e,i,t);let s=document.createElement("input");return n.appendChild(s),s.classList.add("task-list-item-checkbox"),s.type="checkbox",r.status!=="Todo"&&(s.checked=!0,n.classList.add("is-checked")),s.addEventListener("click",o=>{o.preventDefault(),o.stopPropagation(),s.disabled=!0;let u=r.toggle();Pa({originalTask:r,newTasks:u})}),n.prepend(s),n.setAttribute("data-task",r.originalStatusCharacter.trim()),n.setAttribute("data-line",e.listIndex.toString()),s.setAttribute("data-line",e.listIndex.toString()),(a=e.layoutOptions)!=null&&a.shortMode&&jP({task:r,element:i,isFilenameUnique:e.isFilenameUnique}),n})}function YP(r,e,t,n){return B(this,null,function*(){let i="",s=new un(e.layoutOptions);for(let a of s.layoutComponents){let o=r.componentToString(s,a);o&&(a==="description"&&(o=BP(o)),i+=o)}yield $P(t,i,"description",r,n)})}function $P(r,e,t,n,i){return B(this,null,function*(){if(t==="description"){yield i(e,r,n.path);let s=r.querySelector("blockquote"),a=s!=null?s:r,o=a.querySelector("p");if(o!==null){for(;o.firstChild;)a.insertBefore(o.firstChild,o);o.remove()}r.querySelectorAll("p").forEach(u=>{u.hasChildNodes()||u.remove()}),r.querySelectorAll(".footnotes").forEach(u=>{u.remove()})}else r.innerHTML=e})}function jP({task:r,element:e,isFilenameUnique:t}){e.addEventListener("mouseenter",()=>{let n=e.createDiv();n.addClasses(["tooltip","mod-right"]),r.recurrence&&n.createDiv().setText(`${St} ${r.recurrence.toText()}`),r.startDate&&n.createDiv().setText(ka({signifier:Nt,date:r.startDate})),r.scheduledDate&&n.createDiv().setText(ka({signifier:xt,date:r.scheduledDate})),r.dueDate&&n.createDiv().setText(ka({signifier:Ct,date:r.dueDate})),r.doneDate&&n.createDiv().setText(ka({signifier:Aa,date:r.doneDate}));let i=r.getLinkText({isFilenameUnique:t});i&&n.createDiv().setText(`\u{1F517} ${i}`),e.addEventListener("mouseleave",()=>{n.remove()})})}function ka({signifier:r,date:e}){return`${r} ${e.format(D.dateFormat)} (${e.from(window.moment().startOf("day"))})`}function BP(r){let{globalFilter:e,removeGlobalFilter:t}=H();return t?r.replace(e,"").trim():r}var Qe=class{static fromPath(e){let{useFilenameAsScheduledDate:t,filenameAsDateFolders:n}=H();return!t||!this.matchesAnyFolder(n,e)?null:this.extractDateFromPath(e)}static matchesAnyFolder(e,t){return e.length===0?!0:e.some(n=>t.startsWith(n+"/"))}static extractDateFromPath(e){let t=Math.max(0,e.lastIndexOf("/")+1),n=e.lastIndexOf("."),i=e.substring(t,n),s=/(\d{4})-(\d{2})-(\d{2})/.exec(i);if(s||(s=/(\d{4})(\d{2})(\d{2})/.exec(i)),s){let a=window.moment([parseInt(s[1]),parseInt(s[2])-1,parseInt(s[3])]);if(a.isValid())return a}return null}static canApplyFallback({startDate:e,scheduledDate:t,dueDate:n}){return e===null&&n===null&&t===null}static updateTaskPath(e,t,n){let i=e.scheduledDate,s=e.scheduledDateIsInferred;return n===null?s&&(s=!1,i=null):s?i=n:this.canApplyFallback(e)&&(i=n,s=!0),new le(dt(Me({},e),{path: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 le(dt(Me({},i),{scheduledDateIsInferred:!1}))),i))}};var Re={High:"\u23EB",Medium:"\u{1F53C}",Low:"\u{1F53D}",None:""},St="\u{1F501}",Nt="\u{1F6EB}",xt="\u23F3",Ct="\u{1F4C5}",Aa="\u2705",ut=class{},D=ut;D.dateFormat="YYYY-MM-DD",D.indentationRegex=/^([\s\t>]*)/,D.listMarkerRegex=/([-*]|[0-9]+\.)/,D.checkboxRegex=/\[(.)\]/u,D.afterCheckboxRegex=/ *(.*)/u,D.taskRegex=new RegExp(ut.indentationRegex.source+ut.listMarkerRegex.source+" +"+ut.checkboxRegex.source+ut.afterCheckboxRegex.source,"u"),D.nonTaskRegex=new RegExp(ut.indentationRegex.source+ut.listMarkerRegex.source+"
`),o=new as(()=>Qe.fromPath(i.path)),u=null,l=0;for(let c of t)if(c.task!==void 0){if((u===null||u.position.end.line<c.position.start.line)&&(u=Or.getSection(c.position.start.line,n.sections),l=0),u===null)continue;let d=a[c.position.start.line],f=le.fromLine({line:d,path:i.path,sectionStart:u.position.start.line,sectionIndex:l,precedingHeader:Or.getPrecedingHeader(c.position.start.line,n.headings),fallbackDate:o.value});f!==null&&(l++,s.push(f))}return s}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 wd=require("obsidian");var d_=require("obsidian");function zr(){}function gd(r){return r()}function Xg(){return Object.create(null)}function Kr(r){r.forEach(gd)}function Qg(r){return typeof r=="function"}function Jg(r,e){return r!=r?e==e:r!==e||r&&typeof r=="object"||typeof r=="function"}function e_(r){return Object.keys(r).length===0}var t_=!1;function GP(){t_=!0}function HP(){t_=!1}function v(r,e){r.appendChild(e)}function cs(r,e,t){r.insertBefore(e,t||null)}function kn(r){r.parentNode.removeChild(r)}function r_(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 zP(r){return document.createElementNS("http://www.w3.org/2000/svg",r)}function Gt(r){return document.createTextNode(r)}function Q(){return Gt(" ")}function It(r,e,t,n){return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}function n_(r){return function(e){return e.preventDefault(),r.call(this,e)}}function P(r,e,t){t==null?r.removeAttribute(e):r.getAttribute(e)!==t&&r.setAttribute(e,t)}function KP(r){return Array.from(r.childNodes)}function i_(r,e){e=""+e,r.wholeText!==e&&(r.data=e)}function Ft(r,e){r.value=e==null?"":e}function _d(r,e,t){r.classList[t?"add":"remove"](e)}var Hr=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=zP(t.nodeName):this.e=q(t.nodeName),this.t=t,this.c(e)),this.i(n)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.childNodes)}i(e){for(let t=0;t<this.n.length;t+=1)cs(this.t,this.n[t],e)}p(e){this.d(),this.h(e),this.i(this.a)}d(){this.n.forEach(kn)}};var ls;function us(r){ls=r}function VP(){if(!ls)throw new Error("Function called outside component initialization");return ls}function Td(r){VP().$$.on_mount.push(r)}var os=[];var Ca=[],xa=[],Zg=[],XP=Promise.resolve(),md=!1;function ZP(){md||(md=!0,XP.then(s_))}function yd(r){xa.push(r)}var hd=new Set,Na=0;function s_(){let r=ls;do{for(;Na<os.length;){let e=os[Na];Na++,us(e),QP(e.$$)}for(us(null),os.length=0,Na=0;Ca.length;)Ca.pop()();for(let e=0;e<xa.length;e+=1){let t=xa[e];hd.has(t)||(hd.add(t),t())}xa.length=0}while(os.length);for(;Zg.length;)Zg.pop()();md=!1,hd.clear(),us(r)}function QP(r){if(r.fragment!==null){r.update(),Kr(r.before_update);let e=r.dirty;r.dirty=[-1],r.fragment&&r.fragment.p(r.ctx,e),r.after_update.forEach(yd)}}var JP=new Set;function ek(r,e){r&&r.i&&(JP.delete(r),r.i(e))}var zI=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;function tk(r,e,t,n){let{fragment:i,on_mount:s,on_destroy:a,after_update:o}=r.$$;i&&i.m(e,t),n||yd(()=>{let u=s.map(gd).filter(Qg);a?a.push(...u):Kr(u),r.$$.on_mount=[]}),o.forEach(yd)}function a_(r,e){let t=r.$$;t.fragment!==null&&(Kr(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function rk(r,e){r.$$.dirty[0]===-1&&(os.push(r),ZP(),r.$$.dirty.fill(0)),r.$$.dirty[e/31|0]|=1<<e%31}function o_(r,e,t,n,i,s,a,o=[-1]){let u=ls;us(r);let l=r.$$={fragment:null,ctx:null,props:s,update:zr,not_equal:i,bound:Xg(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(u?u.$$.context:[])),callbacks:Xg(),dirty:o,skip_bound:!1,root:e.target||u.$$.root};a&&a(l.root);let c=!1;if(l.ctx=t?t(r,e.props||{},(d,f,...h)=>{let _=h.length?h[0]:f;return l.ctx&&i(l.ctx[d],l.ctx[d]=_)&
<span class="accesskey-first">future</span> dates:`,Vd=Q(),Ut=q("input"),Xd=Q(),sn=q("div"),Sr=q("div"),ws=q("label"),ws.textContent="Status:",Zd=Q(),mr=q("input"),Qd=Q(),uo=q("code"),lo=Gt(Ms),Jd=Q(),Kn=q("div"),co=q("span"),co.textContent="Done on:",ef=Q(),Ds=q("code"),tf=Q(),an=q("div"),Vn=q("button"),Vn.textContent="Apply",rf=Q(),Xn=q("button"),Xn.textContent="Cancel",P(i,"for","description"),P(a,"id","description"),P(a,"type","text"),P(a,"class","tasks-modal-description"),P(a,"placeholder","Take out the trash"),P(a,"accesskey",o=r[8]("t")),P(n,"class","tasks-modal-section"),P(c,"for",f="priority-"+r[0].priority),P(l,"class","tasks-modal-section tasks-modal-priorities"),P(g,"for","recurrence"),P(g,"class","accesskey-first"),P(w,"id","description"),P(w,"type","text"),P(w,"placeholder","Try 'every 2 weeks on Thursday'."),P(w,"accesskey",k=r[8]("r")),Y.a=null,P(et,"for","due"),P(et,"class","accesskey-first"),P(E,"id","due"),P(E,"type","text"),P(E,"placeholder",bd),P(E,"accesskey",b=r[8]("d")),I.a=null,P(V,"for","scheduled"),P(V,"class","accesskey-first"),P(ae,"id","scheduled"),P(ae,"type","text"),P(ae,"placeholder",bd),P(ae,"accesskey",Ce=r[8]("s")),rt.a=null,P(Kt,"for","start"),P(wt,"id","start"),P(wt,"type","text"),P(wt,"placeholder",bd),P(wt,"accesskey",Ts=r[8]("a")),bs.a=null,P(vs,"for","forwardOnly"),P(Ut,"id","forwardOnly"),P(Ut,"type","checkbox"),P(Ut,"class","task-list-item-checkbox tasks-modal-checkbox"),P(Ut,"accesskey",Es=r[8]("f")),P(m,"class","tasks-modal-section tasks-modal-dates"),P(ws,"for","status"),P(mr,"id","status"),P(mr,"type","checkbox"),P(mr,"class","task-list-item-checkbox tasks-modal-checkbox"),mr.checked=Rs=r[0].status==="Done",mr.disabled=!0,P(sn,"class","tasks-modal-section tasks-modal-status"),P(Vn,"type","submit"),P(Vn,"class","mod-cta"),P(Xn,"type","button"),P(an,"class","tasks-modal-section tasks-modal-buttons"),_d(t,"with-accesskeys",r[1]),P(e,"class","tasks-modal")},m(F,ue){cs(F,e,ue),v(e,t),v(t,n),v(n,i),v(n,s),v(n,a),Ft(a,r[0].description),r[18](a),v(t,u),v(t,l),v(l,c),v(c,d),v(l,h);for(let We=0;We<ze.length;We+=1)ze[We].m(l,null);v(t,_),v(t,m),v(m,g),v(m,R),v(m,w),Ft(w,r[0].recurrenceRule),v(m,z),v(m,fe),v(fe,he),v(fe,ne),Y.m(r[6],fe),v(m,ct),v(m,et),v(m,A),v(m,E),Ft(E,r[0].dueDate),v(m,N),v(m,y),v(y,x),v(y,S),I.m(r[5],y),v(m,ee),v(m,V),v(m,se),v(m,ae),Ft(ae,r[0].scheduledDate),v(m,He),v(m,tt),v(tt,zt),v(tt,Ie),rt.m(r[4],tt),v(m,nn),v(m,Kt),v(m,Bd),v(m,wt),Ft(wt,r[0].startDate),v(m,Gd),v(m,Hn),v(Hn,Hd),v(Hn,zd),bs.m(r[3],Hn),v(m,Kd),v(m,zn),v(zn,vs),v(zn,Vd),v(zn,Ut),Ut.checked=r[0].forwardOnly,v(t,Xd),v(t,sn),v(sn,Sr),v(Sr,ws),v(Sr,Zd),v(Sr,mr),v(Sr,Qd),v(Sr,uo),v(uo,lo),v(sn,Jd),v(sn,Kn),v(Kn,co),v(Kn,ef),v(Kn,Ds),Ds.innerHTML=r[7],v(t,tf),v(t,an),v(an,Vn),v(an,rf),v(an,Xn),fo||(nf=[It(a,"input",r[17]),It(l,"keyup",r[10]),It(w,"input",r[21]),It(E,"input",r[22]),It(ae,"input",r[23]),It(wt,"input",r[24]),It(Ut,"change",r[25]),It(Xn,"click",r[11]),It(t,"submit",n_(r[12]))],fo=!0)},p(F,ue){if(ue[0]&256&&o!==(o=F[8]("t"))&&P(a,"accesskey",o),ue[0]&1&&a.value!==F[0].description&&Ft(a,F[0].description),ue[0]&1&&f!==(f="priority-"+F[0].priority)&&P(c,"for",f),ue[0]&769){on=F[9];let We;for(We=0;We<on.length;We+=1){let sf=u_(F,on,We);ze[We]?ze[We].p(sf,ue):(ze[We]=l_(sf),ze[We].c(),ze[We].m(l,null))}for(;We<ze.length;We+=1)ze[We].d(1);ze.length=on.length}ue[0]&256&&k!==(k=F[8]("r"))&&P(w,"accesskey",k),ue[0]&1&&w.value!==F[0].recurrenceRule&&Ft(w,F[0].recurrenceRule),ue[0]&64&&Y.p(F[6]),ue[0]&256&&b!==(b=F[8]("d"))&&P(E,"accesskey",b),ue[0]&1&&E.value!==F[0].dueDate&&Ft(E,F[0].dueDate),ue[0]&32&&I.p(F[5]),ue[0]&256&&Ce!==(Ce=F[8]("s"))&&P(ae,"accesskey",Ce),ue[0]&1&&ae.value!==F[0].scheduledDate&&Ft(ae,F[0].scheduledDate),ue[0]&16&&rt.p(F[4]),ue[0]&256&&Ts!==(Ts=F[8]("a"))&&P(wt,"accesskey",Ts),ue[0]&1&&wt.value!==F[0].startDate&&Ft(wt,F[0].startDate),ue[0]&8&&bs.p(F[3]),ue[0]&256&&Es!==(Es=F[8]("f"))&&P(Ut,"accesskey",Es),ue[0]&1&&(Ut.checked=F[0].forwardOnly),ue[0]&1&&Rs!==(Rs=F[0].status==="Done")&&(mr.checked=Rs),ue[0]&1&&Ms!==(Ms=F[0].status+"")&&i_(lo,Ms),ue[0]&128
`);e.setLine(a,h)};new Sn({app:n,task:u,onSubmit:l}).open()};var Rd=require("obsidian");var h_=(r,e,t)=>{var u;if(r)return t instanceof Rd.MarkdownView;if(!(t instanceof Rd.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=uk(a,n);e.setLine(s,o),e.setCursor({line:i.line,ch:ck(i.ch,a,o)})},uk=(r,e)=>{let t=r,n=le.fromLine({line:r,path:e,sectionStart:0,sectionIndex:0,precedingHeader:null,fallbackDate:null});if(n!==null)t=lk(n);else{let i=r.match(D.taskRegex);if(i!==null){let a=i[3].toLowerCase()===" "?"x":" ";t=r.replace(D.taskRegex,`$1- [${a}] $4`)}else D.listItemRegex.test(r)?t=r.replace(D.listItemRegex,"$1$2 [ ]"):t=r.replace(D.indentationRegex,"$1- ")}return t},lk=r=>r.toggle().map(n=>n.toFileLineString()).join(`
`),ck=(r,e,t)=>{let n=t.length;if(n<=e.length)return r>=t.length?n:r;let i=13;if(t.match(D.doneDateRegex)&&n-e.length>=i&&(n-=i),n>=2*e.length&&t.search(`.+
.+`)!==-1)return r+n-e.length;let s=t.search(/[-*]/);return r<s?r:r+n-e.length};var Fa=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)=>p_(t,n,i,this.app)}),e.addCommand({id:"toggle-done",name:"Toggle task done",icon:"check-in-circle",editorCheckCallback:h_})}};var Ua=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 qa=class{constructor({plugin:e}){this.markdownPostProcessor=this._markdownPostProcessor.bind(this);e.registerMarkdownPostProcessor(this._markdownPostProcessor.bind(this))}_markdownPostProcessor(e,t){return B(this,null,function*(){var c;let{globalFilter:n}=H(),i=e.findAll(".task-list-item").filter(d=>{var _;let f=(_=d.textContent)==null?void 0:_.split(`
`);if(f===void 0)return!1;let h=null;for(let m=0;m<f.length;m=m+1)if(f[m]!==""){h=f[m];break}return h===null?!1:h.includes(n)});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 d=a.lineStart;d<=a.lineEnd;d++){let f=o[d];if(f===void 0)continue;let h=le.fromLine({line:f,path:s,sectionStart:a.lineStart,sectionIndex:u,precedingHeader:null,fallbackDate:null});h!==null&&(l.push(h),u++)}for(let d=0;d<i.length;d++){let f=l[d],h=i[d];if(f===void 0||h===void 0)continue;let _=(c=h.getAttr("data-line"))!=null?c:"0",m=Number.parseInt(_,10),g=yield f.toLi({parentUlElement:e,listIndex:m}),R=h.childNodes;for(let z=0;z<R.length;z=z+1){let fe=R[z];fe.nodeName.toLowerCase()==="div"?g.prepend(fe):fe.nodeName.toLowerCase()==="ul"&&g.append(fe)}let w=h.querySelectorAll("[data-footnote-id]"),k=g.querySelectorAll("[data-footnote-id]");if(w.length===k.length)for(let z=0;z<w.length;z++)k[z].replaceWith(w[z]);h.replaceWith(g)}})}};var m_=require("@codemirror/view"),y_=require("obsidian");var g_=()=>m_.ViewPlugin.fromClass(Md),Md=class{constructor(e){this.view=e,this.handleClickEvent=this.handleClickEvent.bind(this),this.view.dom.addEventListener("click",this.handleClickEvent)}destroy(){this.view.dom.removeEventListener("click",this.handleClickEvent)}handleClickEvent(e){let{target:t}=e;if(!t||!(t instanceof HTMLInputElement)||t.type!=="checkbox")return!1;let n=t.closest("ul.plugin-tasks-query-result, div.callout-content");if(n){if(n.matches("div.callout-content")){let f=`obsidian-tasks-plugin warning: Tasks cannot add or remove completion dates or make the next copy of a recurring task for tasks written inside a callout when you click their checkboxes in Live Preview.
If you wanted Tasks to do these things, please undo your change, then either click the line of the task and use the "Toggle Task Done" command, or switch to Reading View to click the checkbox.`;console.warn(f),new y_.Notice(f,45e3)}return!1}let{state:i}=this.view,s=this.view.posAtDOM(t),a=i.doc.lineAt(s),o=le.fromLine({line:a.text,path:"",sectionStart:0,sectionIndex:0,precedingHeader:null,fallbackDate:null});if(console.debug(`Live Preview Extension: toggle called. Position: ${s} Line: ${a.text}`),o===null)return!1;e.preventDefault();let l=o.toggle().map(f=>f.toFileLineString()).join(i.lineBreak),c=i.update({changes:{from:a.from,to:a.to,insert:l}});this.view.dispatch(c);let d=t.checked;return setTimeout(()=>{t.checked=d},1),!0}};var so=require("obsidian");var Pr=class extends ce{constructor(){super(...arguments);this._filters=new Dr}canCreateFilterForLine(t){return this._filters.canCreateFilterForLine(t)}createFilterOrErrorMessage(t){return this._filters.createFilterOrErrorMessage(t)}filterRegExp(){return null}};var Nn=class extends Pr{constructor(){super(),this._filters.add("done",e=>e.status==="Done"),this._filters.add("not done",e=>e.status!=="Done")}fieldName(){return"status"}supportsSorting(){return!0}comparator(){return(e,t)=>e.status<t.status?1:e.status>t.status?-1:0}};var Dd=class extends pe{filterRegExp(){return Dd.dueRegexp}fieldName(){return"due"}date(e){return e.dueDate}filterResultIfFieldMissing(){return!1}},Vr=Dd;Vr.dueRegexp=/^due (before|after|on)? ?(.*)/;var Od=class extends ce{createFilterOrErrorMessage(e){let t=new de(e),n=ce.getMatch(this.filterRegExp(),e);if(n!==null){let i=n[5],s=null;switch(i){case"low":s="4";break;case"none":s="3";break;case"medium":s="2";break;case"high":s="1";break}if(s===null)return t.error="do not understand priority",t;let a=e,o;switch(n[3]){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}`}t.filter=new Ze(e,o,new _e(a))}else t.error="do not understand query filter (priority)";return t}fieldName(){return"priority"}filterRegExp(){return Od.priorityRegexp}supportsSorting(){return!0}comparator(){return(e,t)=>e.priority.localeCompare(t.priority)}},Xr=Od;Xr.priorityRegexp=/^priority(\s+is)?(\s+(above|below|not))?(\s+(low|none|medium|high))$/;var xn=class{matchesAnyOf(e){return e.some(t=>this.matches(t))}};var Zr=class extends xn{constructor(t){super();this.stringToFind=t}matches(t){return Zr.stringIncludesCaseInsensitive(t,this.stringToFind)}static stringIncludesCaseInsensitive(t,n){return t.toLocaleLowerCase().includes(n.toLocaleLowerCase())}};var Cn=class extends xn{constructor(t){super();this.regex=t}static validateAndConstruct(t){let n=/\/((?![*+?])(?:[^\r\n[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*])+)\/((?:g(?:im?|mi?)?|i(?:gm?|mg?)?|m(?:gi?|ig?)?)?)/,i=t.match(n);if(i!==null){let s=new RegExp(i[1],i[2]);return new Cn(s)}else return null}matches(t){return t.match(this.regex)!==null}};var Je=class extends ce{createFilterOrErrorMessage(e){let t=ce.getMatch(this.filterRegExp(),e);if(t===null)return de.fromError(e,`do not understand query filter (${this.fieldName()})`);let[n,i,s]=t,a=null;if(i.includes("include"))a=new Zr(s);else if(i.includes("regex")&&(a=Cn.validateAndConstruct(s),a===null))return de.fromError(e,`cannot parse regex (${this.fieldName()}); check your leading and trailing slashes for your query`);if(a===null)return de.fromError(e,`do not understand query filter (${this.fieldName()})`);let o=i.match(/not/)!==null,u=new Ze(e,this.getFilter(a,o),new _e(e));return de.fromFilter(u)}static stringIncludesCaseInsensitive(e,t){return Zr.stringIncludesCaseInsensitive(e,t)}fieldPattern(){return this.fieldName()}filterOperatorPattern(){return"includes|does not include|regex matches|regex does not match"}filterRegExp(){return new RegExp(`^(?:${this.fieldPattern()}) (${this.filterOperatorPattern()}) (.*)`)}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.va
`;return e}toString(){let e=`
`;e+=`Group names: [${this.groups}]
`;for(let t of this.groupHeadings)e+=`${"#".repeat(4+t.nestingLevel)} ${t.name}
`;return e+=this.tasksAsStringOfLines(),e}};var no=class{constructor(e,t){this._groups=new Array;this._totalTaskCount=0;this._totalTaskCount=t.length;let n=new to(e,t);this.addTasks(n)}get groups(){return this._groups}totalTasksCount(){return this._totalTaskCount}toString(){let e="";for(let n of this.groups)e+=n.toString(),e+=`
---
`;return e+=`
${this.totalTasksCount()} tasks
`,e}addTasks(e){let t=new Za(e.groups);for(let[n,i]of e.groups){let s=t.getHeadingsForTaskGroup(n),a=new ro(n,s,i);this.add(a)}}add(e){this._groups.push(e)}};var J=class{static by(e,t){return new no(e,t)}static getGroupNamesForTask(e,t){let n=J.groupers[e];return n(t)}static escapeMarkdownCharacters(e){return e.replace(/\\/g,"\\\\").replace(/_/g,"\\_")}static groupByPriority(e){let t="ERROR";switch(e.priority){case"1":t="High";break;case"2":t="Medium";break;case"3":t="None";break;case"4":t="Low";break}return[`Priority ${e.priority}: ${t}`]}static groupByRecurrence(e){return e.recurrence!==null?[e.recurrence.toText()]:["None"]}static groupByRecurring(e){return e.recurrence!==null?["Recurring"]:["Not Recurring"]}static groupByStartDate(e){return[J.stringFromDate(e.startDate,"start")]}static groupByScheduledDate(e){return[J.stringFromDate(e.scheduledDate,"scheduled")]}static groupByDueDate(e){return[J.stringFromDate(e.dueDate,"due")]}static groupByDoneDate(e){return[J.stringFromDate(e.doneDate,"done")]}static groupByHappensDate(e){let t=new cr().earliestDate(e);return[J.stringFromDate(t,"happens")]}static stringFromDate(e,t){return e===null?"No "+t+" date":e.format(J.groupDateFormat)}static groupByPath(e){return[J.escapeMarkdownCharacters(e.path.replace(".md",""))]}static groupByFolder(e){let t=e.path,n=e.filename+".md",i=t.substring(0,t.lastIndexOf(n));return i===""?["/"]:[J.escapeMarkdownCharacters(i)]}static groupByFileName(e){let t=e.filename;return t===null?["Unknown Location"]:["[["+J.escapeMarkdownCharacters(t)+"]]"]}static groupByRoot(e){let t=e.path.replace(/\\/g,"/"),n=t.indexOf("/");return n==-1?["/"]:[J.escapeMarkdownCharacters(t.substring(0,n+1))]}static groupByBacklink(e){if(e.getLinkText({isFilenameUnique:!0})===null)return["Unknown Location"];let n="Unknown Location";if(e.filename!==null&&(n=J.escapeMarkdownCharacters(e.filename)),e.precedingHeader===null||e.precedingHeader.length===0)return[n];let i=J.groupByHeading(e)[0];return n===i?[n]:[`${n} > ${i}`]}static groupByStatus(e){return[e.status]}static groupByHeading(e){return e.precedingHeader===null||e.precedingHeader.length===0?["(No heading)"]:[e.precedingHeader]}static groupByTags(e){return e.tags.length==0?["(No tags)"]:e.tags}},Ar=J;Ar.groupDateFormat="YYYY-MM-DD dddd",Ar.groupers={backlink:J.groupByBacklink,done:J.groupByDoneDate,due:J.groupByDueDate,filename:J.groupByFileName,folder:J.groupByFolder,happens:J.groupByHappensDate,heading:J.groupByHeading,path:J.groupByPath,priority:J.groupByPriority,recurrence:J.groupByRecurrence,recurring:J.groupByRecurring,root:J.groupByRoot,scheduled:J.groupByScheduledDate,start:J.groupByStartDate,status:J.groupByStatus,tags:J.groupByTags};var Bn=class{constructor({source:e}){this._limit=void 0;this._layoutOptions=new Qn;this._filters=[];this._error=void 0;this._sorting=[];this._grouping=[];this.groupByRegexp=/^group by (backlink|done|due|filename|folder|happens|heading|path|priority|recurrence|recurring|root|scheduled|start|status|tags)/;this.hideOptionsRegexp=/^(hide|show) (task count|backlink|priority|start date|scheduled date|done date|due date|recurrence rule|edit button|urgency)/;this.shortModeRegexp=/^short/;this.explainQueryRegexp=/^explain/;this.limitRegexp=/^limit (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.groupByRegexp.test(t):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}`}})}explainQuery(){return`Explanation of this Tasks code block query:
`+this.explainQueryWithoutIntroduction()}explainQueryWithoutIntroduction(){let e="",{globalFilter:t}=H();t.length!==0&&(e+=`Only tasks containing the global filter '${t}'.
`);let n=this.filters.length;if(n===0)e+="No filters supplied. All tasks will match the query.";else for(let i=0;i<n;i++)i>0&&(e+=`
`),e+=this.filters[i].explainFilterIndented("");return this._limit!==void 0&&(e+=`
At most ${this._limit} task`,this._limit!==1&&(e+="s"),e+=`.
`),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(n=>{e=e.filter(n.filterFunction)});let t=Un.by(this.sorting,e).slice(0,this.limit);return Ar.by(this.grouping,t)}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"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=za(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);t!==null?this._limit=Number.parseInt(t[2],10):this._error="do not understand query limit"}parseSortBy({line:e}){let t=N_(e);return t?(this._sorting.push(t),!0):!1}parseGroupBy({line:e}){let t=e.match(this.groupByRegexp);t!==null?this._grouping.push({property:t[1]}):this._error="do not understand query grouping"}};var io=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 B(this,null,function*(){n.addChild(new $d({app:this.app,events:this.events,container:t,source:e,filePath:n.sourcePath}))})}},$d=class extends so.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=new Bn({source:s}),this.queryType="tasks";break;default:this.query=new Bn({source:s}),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=new Bn({source:this.source}),this.events.triggerRequestCacheUpdate(this.render.bind(this)),this.reloadQueryAtMidnight()},i+1e3)}render(i){return B(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.setText(`Tasks query: ${this.query.error}`):s.setText("Loading Tasks ...");(a=this.containerEl.firstChild)==null||a.replaceWith(s)})}createExplanation(t){let n=this.query.explainQuery(),i=t.createEl("pre");i.addClasses(["plugin-tasks-query-explanation"]),i.setText(n),t.appendChild(i)}createTasksList(i){return B(this,arguments,function*({tasks:t,content:n}){let s=t.length,a=n.createEl("ul");a.addClasses(["contains-task-l
`}),n=n.slice(0,t.autoSuggestMaxItems),n}function bk(r){if(Object.values(Re).some(e=>e.length>0&&r.includes(e)))return!0}function vk(r,e){let t=[];return r.includes(Ct)||t.push({displayText:`${Ct} due date`,appendText:`${Ct} `}),r.includes(Nt)||t.push({displayText:`${Nt} start date`,appendText:`${Nt} `}),r.includes(xt)||t.push({displayText:`${xt} scheduled date`,appendText:`${xt} `}),bk(r)||(t.push({displayText:`${Re.High} high priority`,appendText:`${Re.High} `}),t.push({displayText:`${Re.Medium} medium priority`,appendText:`${Re.Medium} `}),t.push({displayText:`${Re.Low} low priority`,appendText:`${Re.Low} `})),r.includes(St)||t.push({displayText:`${St} recurring (repeat)`,appendText:`${St} `}),t}function Ek(r,e,t){let n=["today","tomorrow","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","next week","next month","next year"],i=[],s=new RegExp(`([${Tk}])\\s*([0-9a-zA-Z ]*)`,"ug"),a=jd(r,s,e);if(a&&a.length>=2){let o=a[1],u=a[2];if(u.length<t.autoSuggestMinMatch)return[];let l=u&&u.length>1?ar.parseDate(An(u),!0):null;l&&l.isValid()&&i.push({displayText:`${l.format(D.dateFormat)}`,appendText:`${o} ${l.format(D.dateFormat)} `,insertAt:a.index,insertSkip:a[0].length});let c=1,d=5,f=n.filter(h=>u&&u.length>=c&&h.toLowerCase().includes(u.toLowerCase())).slice(0,d);f.length===0&&(f=n.slice(0,d));for(let h of f){let m=`${ar.parseDate(h,!0).format(D.dateFormat)}`;i.push({suggestionType:"match",displayText:`${h} (${m})`,appendText:`${o} ${m} `,insertAt:a.index,insertSkip:a[0].length})}}return i}function wk(r,e,t){var o;let n=["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"],i=[],s=new RegExp(`(${St})\\s*([0-9a-zA-Z ]*)`,"ug"),a=jd(r,s,e);if(a&&a.length>=2){let u=a[1],l=a[2];if(l.length<t.autoSuggestMinMatch)return[];if(l.length>0){let h=(o=xe.fromText({recurrenceRuleText:l,startDate:null,scheduledDate:null,dueDate:null}))==null?void 0:o.toText();if(h){let _=`${u} ${h} `;if(i.push({suggestionType:"match",displayText:`\u2705 ${h}`,appendText:_,insertAt:a.index,insertSkip:a[0].length}),a[0]==_)return[]}}let c=1,d=t.autoSuggestMaxItems/2,f=n.filter(h=>l&&l.length>=c&&h.toLowerCase().includes(l.toLowerCase())).slice(0,d);f.length===0&&l.trim().length===0&&(f=n.slice(0,d));for(let h of f)i.push({suggestionType:"match",displayText:`${h}`,appendText:`${u} ${h} `,insertAt:a.index,insertSkip:a[0].length})}return i}function jd(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;return[]}var ao=class extends C_.EditorSuggest{constructor(t,n){super(t);this.settings=n}onTrigger(t,n,i){if(!this.settings.autoSuggestInEditor)return null;let s=n.getLine(t.line);return s.contains(this.settings.globalFilter)&&s.match(D.taskRegex)?{start:{line:t.line,ch:0},end:{line:t.line,ch:s.length},query:s}:null}getSuggestions(t){let n=t.query,i=t.editor.getCursor(),s=x_(n,i.ch,this.settings),a=[];for(let o of s)a.push(dt(Me({},o),{context:t}));return a}renderSuggestion(t,n){n.setText(t.displayText)}selectSuggestion(t,n){var u,l,c;let i=t.context.editor;if(t.suggestionType==="empty"){this.close();let d=new KeyboardEvent("keydown",{code:"Enter",key:"Enter"});(l=(u=i==null?void 0:i.cm)==null?void 0:u.contentDOM)==null||l.dispatchEvent(d);return}let s=t.context.editor.getCursor(),a={line:s.line,ch:(c=t.insertAt)!=null?c:s.ch},o=t.insertSkip?{line:s.line,ch:a.ch+t.insertSkip}:void 0;t.context.editor.replaceRange(t.appendText,a,o),t.context.editor.setCursor({line:s.line,ch:a.ch+t.appendText.length})}};var oo=class extends I_.Plugin{onload(){return B(this,null,function*(){console.log('loading plugin "tasks"'),yield this.loadSettings(),this.addSettingTab(new _s({plugin:this})),Hg({metadataCache:this.app.metadataCache,vault:this.app.vault});let t=new Ua({obsidianEvents:this.app.workspace});this.cache=new Or({metadataCache:this.app.metadataCache,vault:this.app.vault,events:t}),this.inlin