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.

437 lines
601 KiB

3 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
6 months ago
Copyright (c) 2021 Clare Macrae, Ilyas Landikov and Martin Schenck
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
3 days ago
*/
3 years ago
3 days ago
/*
License flatpickr (included library):
The MIT License (MIT)
3 years ago
3 days ago
Copyright (c) 2017 Gregory Petrosyan
*/
3 years ago
3 days ago
/*
License @floating-ui/dom (included library):
MIT License
Copyright (c) 2021 Floating UI contributors
3 years ago
*/
5 months ago
/*
3 days ago
License boon-js (included library):
5 months ago
The MIT License (MIT)
3 days ago
Copyright (c) 2020-present Jake Chorley
*/
5 months ago
3 days ago
/*
License eventemitter2 (included library):
5 months ago
3 days ago
The MIT License (MIT)
5 months ago
3 days ago
Copyright (c) 2016 Paolo Fragomeni <http://www.github.com/0x00a> and Contributors
*/
/*
License i18next (included library):
The MIT License (MIT)
Copyright (c) 2025 i18next
*/
/*
License mustache (included library):
The MIT License
Copyright (c) 2009 Chris Wanstrath (Ruby)
Copyright (c) 2010-2014 Jan Lehnardt (JavaScript)
Copyright (c) 2010-2015 The mustache.js community
5 months ago
*/
3 days ago
/*
License mustache-validator (included library):
MIT License
Copyright (c) 2022 Elias Mangoro
*/
"use strict";var w0=Object.create;var qo=Object.defineProperty,k0=Object.defineProperties,S0=Object.getOwnPropertyDescriptor,E0=Object.getOwnPropertyDescriptors,D0=Object.getOwnPropertyNames,Pu=Object.getOwnPropertySymbols,O0=Object.getPrototypeOf,Af=Object.prototype.hasOwnProperty,vb=Object.prototype.propertyIsEnumerable;var _b=(n,t,e)=>t in n?qo(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,U=(n,t)=>{for(var e in t||(t={}))Af.call(t,e)&&_b(n,e,t[e]);if(Pu)for(var e of Pu(t))vb.call(t,e)&&_b(n,e,t[e]);return n},me=(n,t)=>k0(n,E0(t));var pa=(n,t)=>{var e={};for(var r in n)Af.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&Pu)for(var r of Pu(n))t.indexOf(r)<0&&vb.call(n,r)&&(e[r]=n[r]);return e};var ne=(n,t)=>()=>(n&&(t=n(n=0)),t);var O=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports),wb=(n,t)=>{for(var e in t)qo(n,e,{get:t[e],enumerable:!0})},kb=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of D0(t))!Af.call(n,i)&&i!==e&&qo(n,i,{get:()=>t[i],enumerable:!(r=S0(t,i))||r.enumerable});return n};var Yo=(n,t,e)=>(e=n!=null?w0(O0(n)):{},kb(t||!n||!n.__esModule?qo(e,"default",{value:n,enumerable:!0}):e,n)),Sb=n=>kb(qo({},"__esModule",{value:!0}),n);var L=(n,t,e)=>new Promise((r,i)=>{var s=l=>{try{o(e.next(l))}catch(u){i(u)}},a=l=>{try{o(e.throw(l))}catch(u){i(u)}},o=l=>l.done?r(l.value):Promise.resolve(l.value).then(s,a);o((e=e.apply(n,t)).next())});var Te,Ho,Eb,x0,C0,Db,Ob,Go,xb,M0,Iu,R0,Ib,ma,A0,P0,Nf,N0,I0,F0,If,Fu,L0,ga,Lr,ya,Lu,Fb,Cb,ba,Uu,Mb,Rb,Ff,Ab,Pf,Lf,U0,ha,Uf,j0,jf,Pb,Nb,Nu,W0,hs,yt,Lj,Uj,jj,Wj,$j,qj,Yj,Hj,Gj,Bj,Vj,zj,Kj,Qj,Lb=ne(()=>{Te=n=>typeof n=="string",Ho=()=>{let n,t,e=new Promise((r,i)=>{n=r,t=i});return e.resolve=n,e.reject=t,e},Eb=n=>n==null?"":""+n,x0=(n,t,e)=>{n.forEach(r=>{t[r]&&(e[r]=t[r])})},C0=/###/g,Db=n=>n&&n.indexOf("###")>-1?n.replace(C0,"."):n,Ob=n=>!n||Te(n),Go=(n,t,e)=>{let r=Te(t)?t.split("."):t,i=0;for(;i<r.length-1;){if(Ob(n))return{};let s=Db(r[i]);!n[s]&&e&&(n[s]=new e),Object.prototype.hasOwnProperty.call(n,s)?n=n[s]:n={},++i}return Ob(n)?{}:{obj:n,k:Db(r[i])}},xb=(n,t,e)=>{let{obj:r,k:i}=Go(n,t,Object);if(r!==void 0||t.length===1){r[i]=e;return}let s=t[t.length-1],a=t.slice(0,t.length-1),o=Go(n,a,Object);for(;o.obj===void 0&&a.length;)s=`${a[a.length-1]}.${s}`,a=a.slice(0,a.length-1),o=Go(n,a,Object),(o==null?void 0:o.obj)&&typeof o.obj[`${o.k}.${s}`]!="undefined"&&(o.obj=void 0);o.obj[`${o.k}.${s}`]=e},M0=(n,t,e,r)=>{let{obj:i,k:s}=Go(n,t,Object);i[s]=i[s]||[],i[s].push(e)},Iu=(n,t)=>{let{obj:e,k:r}=Go(n,t);if(!!e&&!!Object.prototype.hasOwnProperty.call(e,r))return e[r]},R0=(n,t,e)=>{let r=Iu(n,e);return r!==void 0?r:Iu(t,e)},Ib=(n,t,e)=>{for(let r in t)r!=="__proto__"&&r!=="constructor"&&(r in n?Te(n[r])||n[r]instanceof String||Te(t[r])||t[r]instanceof String?e&&(n[r]=t[r]):Ib(n[r],t[r],e):n[r]=t[r]);return n},ma=n=>n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),A0={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},P0=n=>Te(n)?n.replace(/[&<>"'\/]/g,t=>A0[t]):n,Nf=class{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){let e=this.regExpMap.get(t);if(e!==void 0)return e;let r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}},N0=[" ",",","?","!",";"],I0=new Nf(20),F0=(n,t,e)=>{t=t||"",e=e||"";let r=N0.filter(a=>t.indexOf(a)<0&&e.indexOf(a)<0);if(r.length===0)return!0;let i=I0.getRegExp(`(${r.map(a=>a==="?"?"\\?":a).join("|")})`),s=!i.test(n);if(!s){let a=n.indexOf(e);a>0&&!i.test(n.substring(0,a))&&(s=!0)}return s},If=function(n,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!n)return;if(n[t])return Object.prototype.hasOwnProperty.call(n,t)?n[t]:void 0;let r=t.split(e),i=n;for(let s=0;s<r.length;){if(!i||typeof i!="object")return;let a,o="";for(let l=s;l<r.length;++l)if(l!==s&&(o+=e),o+=r[l],a=i[o],a!==void 0){if(["string","number","boolean"].indexOf(typeof a)>-1&&l<r.length-1)continue;s+=l-s+1;break}i=a}return i},Fu=n=>n==null?void
path does not include _templates/
limit 300
show urgency`}},recurringTasks:{heading:"Recurring tasks",nextLine:{description:"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.",name:"Next recurrence appears on the line below"}},seeTheDocumentation:"See the documentation",statuses:{collections:{anuppuccinTheme:"AnuPpuccin Theme",auraTheme:"Aura Theme",borderTheme:"Border Theme",buttons:{addCollection:{name:"{{themeName}}: Add {{numberOfStatuses}} supported Statuses"}},ebullientworksTheme:"Ebullientworks Theme",itsThemeAndSlrvbCheckboxes:"ITS Theme & SlRvb Checkboxes",lytModeTheme:"LYT Mode Theme (Dark mode only)",minimalTheme:"Minimal Theme",thingsTheme:"Things Theme"},coreStatuses:{buttons:{checkStatuses:{name:"Review and check your Statuses",tooltip:"Create a new file in the root of the vault, containing a Mermaid diagram of the current status settings."}},description:{line1:"These are the core statuses that Tasks supports natively, with no need for custom CSS styling or theming.",line2:"You can add edit and add your own custom statuses in the section below."},heading:"Core Statuses"},customStatuses:{buttons:{addAllUnknown:{name:"Add All Unknown Status Types"},addNewStatus:{name:"Add New Task Status"},resetCustomStatuses:{name:"Reset Custom Status Types to Defaults"}},description:{line1:"You should first <b>select and install a CSS Snippet or Theme</b> to style custom checkboxes.",line2:"Then, use the buttons below to set up your custom statuses, to match your chosen CSS checkboxes.",line3:"<b>Note</b> Any statuses with the same symbol as any earlier statuses will be ignored. You can confirm the actually loaded statuses by running the 'Create or edit task' command and looking at the Status drop-down.",line4:"See the documentation to get started!"},heading:"Custom Statuses"},heading:"Task Statuses"}}}});var $b,Wb=ne(()=>{$b={main:{loadingPlugin:"\u52A0\u8F7D\u63D2\u4EF6: {{name}} v{{version}}",unloadingPlugin:"\u5378\u8F7D\u63D2\u4EF6: {{name}} v{{version}}"},modals:{customStatusModal:{editAvailableAsCommand:{description:"\u5982\u679C\u542F\u7528\uFF0C\u6B64\u72B6\u6001\u5C06\u4F5C\u4E3A\u547D\u4EE4\u53EF\u7528,\u56E0\u6B64\u60A8\u53EF\u4EE5\u6307\u5B9A\u5FEB\u6377\u952E\u5E76\u4F7F\u7528\u5B83\u5207\u6362\u72B6\u6001\u3002",name:"\u53EF\u7528\u4F5C\u547D\u4EE4"},editNextStatusSymbol:{description:"\u5355\u51FB\u65F6\uFF0C\u8FD9\u662F\u4E0B\u4E00\u6B65\u5E94\u8BE5\u4F7F\u7528\u7684\u7B26\u53F7\u3002",name:"\u4EFB\u52A1\u4E0B\u4E00\u4E2A\u72B6\u6001\u7B26\u53F7"},editStatusName:{description:"\u8FD9\u662F\u4EFB\u52A1\u72B6\u6001\u7684\u53CB\u597D\u540D\u79F0.",name:"\u4EFB\u52A1\u72B6\u6001\u540D\u79F0"},editStatusSymbol:{description:"\u8FD9\u662F\u65B9\u62EC\u53F7\u4E2D\u7684\u5B57\u7B26\u3002\uFF08\u4EC5\u53EF\u7F16\u8F91\u81EA\u5B9A\u4E49\u72B6\u6001,\u4E0D\u53EF\u7F16\u8F91\u6838\u5FC3\u72B6\u6001\u3002\uFF09",name:"\u4EFB\u52A1\u72B6\u6001\u7B26\u53F7"},editStatusType:{description:"\u63A7\u5236\u641C\u7D22\u548C\u5207\u6362\u72B6\u6001\u7684\u884C\u4E3A\u3002",name:"\u4EFB\u52A1\u72B6\u6001\u7C7B\u578B"},fixErrorsBeforeSaving:"\u5728\u4FDD\u5B58\u524D\u4FEE\u590D\u9519\u8BEF\u3002"}},reports:{statusRegistry:{about:{createdBy:"\u6B64\u6587\u4EF6\u7531 Obsidian tasks \u63D2\u4EF6(version {{version}})\u521B\u5EFA,\u4EE5\u5E2E\u52A9\u53EF\u89C6\u5316\u6B64\u4ED3\u5E93\u4E2D\u7684\u4EFB\u52A1\u72B6\u6001.",deleteFileAnyTime:"\u60A8\u53EF\u4EE5\u968F\u65F6\u5220\u9664\u6B64\u6587\u4EF6.",title:"\u5173\u4E8E\u6B64\u6587\u4EF6",updateReport:{line1:"\u5982\u679C\u66F4\u6539 Tasks \u72B6\u6001\u8BBE\u7F6E,\u5219\u53EF\u4EE5\u901A\u8FC7\u4EE5\u4E0B\u65B9\u5F0F\u83B7\u53D6\u66F4\u65B0\u540E\u7684\u62A5\u544A:",line2:"\u524D\u5F80 `\u8BBE\u7F6E` -> `Tasks`\u3002",line3:"\u70B9\u51FB `\u67E5\u770B\u5E76\u68C0\u67E5\u60A8\u7684\u72B6\u6001`\u3002"}},columnHeadings:{nextStatusSymbol:"\u4E0B\u4E00\u4E2A\u72B6\u6001\u7B26\u53F7",problems:"\u95EE\u9898 (\u5982\u679C\u5B58\u5728)",statusName:"\u72B6\u6001\u540D\u79F0",statusSymbol:"\u72B6\u6001\u7B26\u53F7",statusTyp
path does not include _templates/
limit 300
show urgency`}},recurringTasks:{heading:"\u91CD\u590D\u6027\u4EFB\u52A1",nextLine:{description:"\u542F\u7528\u6B64\u529F\u80FD\u540E\uFF0C\u4EFB\u52A1\u7684\u4E0B\u4E00\u6B21\u91CD\u590D\u5C06\u663E\u793A\u5728\u5DF2\u5B8C\u6210\u4EFB\u52A1\u7684\u4E0B\u4E00\u884C\u3002\u82E5\u5173\u95ED\u6B64\u529F\u80FD\uFF0C\u5219\u4E0B\u4E00\u6B21\u91CD\u590D\u5C06\u51FA\u73B0\u5728\u5DF2\u5B8C\u6210\u4EFB\u52A1\u7684\u4E0A\u4E00\u884C\u3002",name:"\u628A\u4EFB\u52A1\u7684\u4E0B\u4E00\u6B21\u91CD\u590D\u653E\u5728\u4E0B\u4E00\u884C"}},seeTheDocumentation:"\u53C2\u9605\u6587\u6863",statuses:{collections:{anuppuccinTheme:"AnuPpuccin \u4E3B\u9898",auraTheme:"Aura \u4E3B\u9898",borderTheme:"Border \u4E3B\u9898",buttons:{addCollection:{name:"{{themeName}}: \u6DFB\u52A0 {{numberOfStatuses}} \u79CD\u652F\u6301\u72B6\u6001"}},ebullientworksTheme:"Ebullientworks \u4E3B\u9898",itsThemeAndSlrvbCheckboxes:"ITS \u4E3B\u9898\u548C SlRvb \u590D\u9009\u6846",lytModeTheme:"LYT Mode \u4E3B\u9898 (\u4EC5\u6DF1\u8272\u6A21\u5F0F)",minimalTheme:"Minimal \u4E3B\u9898",thingsTheme:"Things \u4E3B\u9898"},coreStatuses:{buttons:{checkStatuses:{name:"\u67E5\u770B\u5E76\u68C0\u67E5\u60A8\u7684\u72B6\u6001",tooltip:"\u5728\u5E93\u7684\u6839\u76EE\u5F55\u4E0B\u521B\u5EFA\u4E00\u4E2A\u65B0\u6587\u4EF6,\u5305\u542B\u5F53\u524D\u72B6\u6001\u8BBE\u7F6E\u7684 Mermaid \u56FE\u8868."}},description:{line1:"\u8FD9\u4E9B\u662F Tasks \u539F\u751F\u652F\u6301\u7684\u6838\u5FC3\u72B6\u6001\uFF0C\u4E0D\u9700\u8981\u81EA\u5B9A\u4E49CSS\u6837\u5F0F\u6216\u4E3B\u9898\u3002",line2:"\u60A8\u53EF\u4EE5\u5728\u4E0B\u9762\u7F16\u8F91\u548C\u6DFB\u52A0\u81EA\u5B9A\u4E49\u72B6\u6001\u3002"},heading:"\u6838\u5FC3\u72B6\u6001"},customStatuses:{buttons:{addAllUnknown:{name:"\u6DFB\u52A0\u6240\u6709\u672A\u77E5\u72B6\u6001\u7C7B\u578B"},addNewStatus:{name:"\u6DFB\u52A0\u65B0\u4EFB\u52A1\u72B6\u6001"},resetCustomStatuses:{name:"\u91CD\u7F6E\u81EA\u5B9A\u4E49\u72B6\u6001\u7C7B\u578B\u4E3A\u9ED8\u8BA4\u503C"}},description:{line1:"\u60A8\u5E94\u8BE5\u9996\u5148<b>\u9009\u62E9\u5E76\u5B89\u88C5 CSS\u4EE3\u7801\u6BB5\u6216\u4E3B\u9898<b>\u4EE5\u8BBE\u7F6E\u81EA\u5B9A\u4E49\u590D\u9009\u6846\u7684\u6837\u5F0F",line2:"\u7136\u540E\uFF0C\u4F7F\u7528\u4E0B\u9762\u7684\u6309\u94AE\u8BBE\u7F6E\u60A8\u7684\u81EA\u5B9A\u4E49\u72B6\u6001,\u4EE5\u5339\u914D\u60A8\u9009\u62E9\u7684CSS\u590D\u9009\u6846.",line3:"<b>\u6CE8\u610F</b>\u4EFB\u4F55\u4E0E\u66F4\u65E9\u7684\u72B6\u6001\u5177\u6709\u76F8\u540C\u7B26\u53F7\u7684\u72B6\u6001\u90FD\u5C06\u88AB\u5FFD\u7565.\u60A8\u53EF\u4EE5\u901A\u8FC7\u8FD0\u884C\u201CCreate or edit task\u201D\u547D\u4EE4\u5E76\u67E5\u770B\u201CStatus\u201D\u4E0B\u62C9\u5217\u8868\u6765\u786E\u8BA4\u5B9E\u9645\u52A0\u8F7D\u7684\u72B6\u6001\u3002",line4:"\u53C2\u9605\u6587\u6863\uFF01"},heading:"\u81EA\u5B9A\u4E49\u72B6\u6001"},heading:"\u4EFB\u52A1\u72B6\u6001"}}}});var Wf,Y0,qb,N,gs=ne(()=>{"use strict";Lb();Ub();Wb();Wf=!1,Y0=()=>{let n=localStorage.getItem("language"),t=(n==null?void 0:n.toLowerCase())||"en";return console.log(`Language in Obsidian settings: '${t}'; requesting Tasks in '${t}'.`),t},qb=()=>L(void 0,null,function*(){Wf||(yield yt.init({lng:Y0(),fallbackLng:"en",returnEmptyString:!1,resources:{en:{translation:jb},zh:{translation:$b}},interpolation:{escapeValue:!1}}),Wf=!0)}),N=new Proxy(yt,{get(n,t){if(!Wf&&t==="t")throw new Error("i18n.t() called before initialization. Call initializeI18n() first.");return Reflect.get(n,t)}})});var wn,de,ii=ne(()=>{"use strict";wn=class{},de=wn;de.dateFormat="YYYY-MM-DD",de.dateTimeFormat="YYYY-MM-DD HH:mm",de.indentationRegex=/^([\s\t>]*)/,de.listMarkerRegex=/([-*+]|[0-9]+\.)/,de.checkboxRegex=/\[(.)\]/u,de.afterCheckboxRegex=/ *(.*)/u,de.taskRegex=new RegExp(wn.indentationRegex.source+wn.listMarkerRegex.source+" +"+wn.checkboxRegex.source+wn.afterCheckboxRegex.source,"u"),de.nonTaskRegex=new RegExp(wn.indentationRegex.source+wn.listMarkerRegex.source+"? *("+wn.checkboxRegex.source+")?"+wn.afterCheckboxRegex.source,"u"),de.listItemRegex=new RegExp(wn.indentationRegex.source+wn.listMarkerRegex.source),de.blockLinkRegex=/ \^[a-zA-Z0-
`).map(kL).filter(function(e){return e!==null});return Pt(Pt({},t[0]),t[1])}function Xl(n){var t={},e=/DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(n);if(!e)return t;var r=e[1],i=e[2];return r&&(t.tzid=r),t.dtstart=Vl(i),t}function kL(n){if(n=n.replace(/^\s+|\s+$/,""),!n.length)return null;var t=/^([A-Z]+?)[:;]/.exec(n.toUpperCase());if(!t)return Uk(n);var e=t[1];switch(e.toUpperCase()){case"RRULE":case"EXRULE":return Uk(n);case"DTSTART":return Xl(n);default:throw new Error("Unsupported RFC prop ".concat(e," in ").concat(n))}}function Uk(n){var t=n.replace(/^RRULE:/i,""),e=Xl(t),r=n.replace(/^(?:RRULE|EXRULE):/i,"").split(";");return r.forEach(function(i){var s=i.split("="),a=s[0],o=s[1];switch(a.toUpperCase()){case"FREQ":e.freq=Ae[o.toUpperCase()];break;case"WKST":e.wkst=Zn[o.toUpperCase()];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var l=SL(o),u=a.toLowerCase();e[u]=l;break;case"BYWEEKDAY":case"BYDAY":e.byweekday=EL(o);break;case"DTSTART":case"TZID":var c=Xl(n);e.tzid=c.tzid,e.dtstart=c.dtstart;break;case"UNTIL":e.until=Vl(o);break;case"BYEASTER":e.byeaster=Number(o);break;default:throw new Error("Unknown RRULE property '"+a+"'")}}),e}function SL(n){if(n.indexOf(",")!==-1){var t=n.split(",");return t.map(jk)}return jk(n)}function jk(n){return/^[+-]?\d+$/.test(n)?Number(n):n}function EL(n){var t=n.split(",");return t.map(function(e){if(e.length===2)return Zn[e];var r=e.match(/^([+-]?\d{1,2})([A-Z]{2})$/);if(!r||r.length<3)throw new SyntaxError("Invalid weekday string: ".concat(e));var i=Number(r[1]),s=r[2],a=Zn[s].weekday;return new ct(a,i)})}var Yg=ne(()=>{yi();bi();Ms();qt();Xn()});var Ns,Hc=ne(()=>{qt();Ns=function(){function n(t,e){if(isNaN(t.getTime()))throw new RangeError("Invalid date passed to DateWithZone");this.date=t,this.tzid=e}return Object.defineProperty(n.prototype,"isUTC",{get:function(){return!this.tzid||this.tzid.toUpperCase()==="UTC"},enumerable:!1,configurable:!0}),n.prototype.toString=function(){var t=Fa(this.date.getTime(),this.isUTC);return this.isUTC?":".concat(t):";TZID=".concat(this.tzid,":").concat(t)},n.prototype.getTime=function(){return this.date.getTime()},n.prototype.rezonedDate=function(){return this.isUTC?this.date:Ek(this.date,this.tzid)},n}()});function Jl(n){for(var t=[],e="",r=Object.keys(n),i=Object.keys(Ql),s=0;s<r.length;s++)if(r[s]!=="tzid"&&!!Ie(i,r[s])){var a=r[s].toUpperCase(),o=n[r[s]],l="";if(!(!Je(o)||At(o)&&!o.length)){switch(a){case"FREQ":l=ae.FREQUENCIES[n.freq];break;case"WKST":On(o)?l=new ct(o).toString():l=o.toString();break;case"BYWEEKDAY":a="BYDAY",l=Tk(o).map(function(p){return p instanceof ct?p:At(p)?new ct(p[0],p[1]):new ct(p)}).toString();break;case"DTSTART":e=DL(o,n.tzid);break;case"UNTIL":l=Fa(o,!n.tzid);break;default:if(At(o)){for(var u=[],c=0;c<o.length;c++)u[c]=String(o[c]);l=u.toString()}else l=String(o)}l&&t.push([a,l])}}var d=t.map(function(p){var b=p[0],T=p[1];return"".concat(b,"=").concat(T.toString())}).join(";"),f="";return d!==""&&(f="RRULE:".concat(d)),[e,f].filter(function(p){return!!p}).join(`
`)}function DL(n,t){return n?"DTSTART"+new Ns(new Date(n),t).toString():""}var Hg=ne(()=>{Xn();en();Ms();qt();Hc()});function OL(n,t){return Array.isArray(n)?!Array.isArray(t)||n.length!==t.length?!1:n.every(function(e,r){return e.getTime()===t[r].getTime()}):n instanceof Date?t instanceof Date&&n.getTime()===t.getTime():n===t}var Wk,$k=ne(()=>{$c();qt();en();Wk=function(){function n(){this.all=!1,this.before=[],this.after=[],this.between=[]}return n.prototype._cacheAdd=function(t,e,r){e&&(e=e instanceof Date?Wc(e):Ug(e)),t==="all"?this.all=e:(r._value=e,this[t].push(r))},n.prototype._cacheGet=function(t,e){var r=!1,i=e?Object.keys(e):[],s=function(c){for(var d=0;d<i.length;d++){var f=i[d];if(!OL(e[f],c[f]))return!0}return!1},a=this[t];if(t==="all")r=this.all;else if(At(a))for(var o=0;o<a.length;o++){var l=a[o];if(!(i.length&&s(l))){r=l._value;break}}if(!r&&this.all){for(var u=new gi(t,e),o=0;o<this.all.length&&u.accept(this.all[o]);o++);r=u.getValue(),this._cacheAdd(t,r,e)}return At(r)?Ug(r):r instanceof Date?Wc(r):r},n}()});var qk,Yk,xL,CL,$i,Yt,Hk,Gk,ML,RL,qi,Ht,Bk,Vk,zk,Kk,Gg,Qk=ne(()=>{yi();en();qk=Q(Q(Q(Q(Q(Q(Q(Q(Q(Q(Q(Q(Q([],Ne(1,31),!0),Ne(2,28),!0),Ne(3,31),!0),Ne(4,30),!0),Ne(5,31),!0),Ne(6,30),!0),Ne(7,31),!0),Ne(8,31),!0),Ne(9,30),!0),Ne(10,31),!0),Ne(11,30),!0),Ne(12,31),!0),Ne(1,7),!0),Yk=Q(Q(Q(Q(Q(Q(Q(Q(Q(Q(Q(Q(Q([],Ne(1,31),!0),Ne(2,29),!0),Ne(3,31),!0),Ne(4,30),!0),Ne(5,31),!0),Ne(6,30),!0),Ne(7,31),!0),Ne(8,31),!0),Ne(9,30),!0),Ne(10,31),!0),Ne(11,30),!0),Ne(12,31),!0),Ne(1,7),!0),xL=Qn(1,29),CL=Qn(1,30),$i=Qn(1,31),Yt=Qn(1,32),Hk=Q(Q(Q(Q(Q(Q(Q(Q(Q(Q(Q(Q(Q([],Yt,!0),CL,!0),Yt,!0),$i,!0),Yt,!0),$i,!0),Yt,!0),Yt,!0),$i,!0),Yt,!0),$i,!0),Yt,!0),Yt.slice(0,7),!0),Gk=Q(Q(Q(Q(Q(Q(Q(Q(Q(Q(Q(Q(Q([],Yt,!0),xL,!0),Yt,!0),$i,!0),Yt,!0),$i,!0),Yt,!0),Yt,!0),$i,!0),Yt,!0),$i,!0),Yt,!0),Yt.slice(0,7),!0),ML=Qn(-28,0),RL=Qn(-29,0),qi=Qn(-30,0),Ht=Qn(-31,0),Bk=Q(Q(Q(Q(Q(Q(Q(Q(Q(Q(Q(Q(Q([],Ht,!0),RL,!0),Ht,!0),qi,!0),Ht,!0),qi,!0),Ht,!0),Ht,!0),qi,!0),Ht,!0),qi,!0),Ht,!0),Ht.slice(0,7),!0),Vk=Q(Q(Q(Q(Q(Q(Q(Q(Q(Q(Q(Q(Q([],Ht,!0),ML,!0),Ht,!0),qi,!0),Ht,!0),qi,!0),Ht,!0),Ht,!0),qi,!0),Ht,!0),qi,!0),Ht,!0),Ht.slice(0,7),!0),zk=[0,31,60,91,121,152,182,213,244,274,305,335,366],Kk=[0,31,59,90,120,151,181,212,243,273,304,334,365],Gg=function(){for(var n=[],t=0;t<55;t++)n=n.concat(Qn(7));return n}()});function Xk(n,t){var e=Yr(n,1,1),r=Ia(n)?366:365,i=Ia(n+1)?366:365,s=Bl(e),a=mi(e),o=Pt(Pt({yearlen:r,nextyearlen:i,yearordinal:s,yearweekday:a},AL(n)),{wnomask:null});if(xn(t.byweekno))return o;o.wnomask=Ne(0,r+7);var l,u,c=l=$t(7-a+t.wkst,7);c>=4?(c=0,u=o.yearlen+$t(a-t.wkst,7)):u=r-c;for(var d=Math.floor(u/7),f=$t(u,7),p=Math.floor(d+f/4),b=0;b<t.byweekno.length;b++){var T=t.byweekno[b];if(T<0&&(T+=p+1),T>0&&T<=p){var _=void 0;T>1?(_=c+(T-1)*7,c!==l&&(_-=7-l)):_=c;for(var x=0;x<7&&(o.wnomask[_]=1,_++,o.wdaymask[_]!==t.wkst);x++);}}if(Ie(t.byweekno,1)){var _=c+p*7;if(c!==l&&(_-=7-l),_<r)for(var b=0;b<7&&(o.wnomask[_]=1,_+=1,o.wdaymask[_]!==t.wkst);b++);}if(c){var D=void 0;if(Ie(t.byweekno,-1))D=-1;else{var A=mi(Yr(n-1,1,1)),j=$t(7-A.valueOf()+t.wkst,7),Y=Ia(n-1)?366:365,se=void 0;j>=4?(j=0,se=Y+$t(A-t.wkst,7)):se=r-c,D=Math.floor(52+$t(se,7)/4)}if(Ie(t.byweekno,D))for(var _=0;_<c;_++)o.wnomask[_]=1}return o}function AL(n){var t=Ia(n)?366:365,e=Yr(n,1,1),r=mi(e);return t===365?{mmask:qk,mdaymask:Gk,nmdaymask:Vk,wdaymask:Gg.slice(r),mrange:Kk}:{mmask:Yk,mdaymask:Hk,nmdaymask:Bk,wdaymask:Gg.slice(r),mrange:zk}}var Zk=ne(()=>{yi();qt();en();Qk()});function Jk(n,t,e,r,i,s){var a={lastyear:n,lastmonth:t,nwdaymask:[]},o=[];if(s.freq===ae.YEARLY)if(xn(s.bymonth))o=[[0,e]];else for(var l=0;l<s.bymonth.length;l++)t=s.bymonth[l],o.push(r.slice(t-1,t+1));else s.freq===ae.MONTHLY&&(o=[r.slice(t-1,t+1)]);if(xn(o))return a;a.nwdaymask=Ne(0,e);for(var l=0;l<o.length;l++)for(var u=o[l],c=u[0],d=u[1]-1,f=0;f<s.bynweekday.length;f++){var p=void 0,b=s.bynweekday[f],T=b[0],_=b[1];_<0?(p=d+(_+1)*7,p-=$t(i[p]-T,7)):(p=c+(_-1)*7,p+=$t(7-i[p]+T,7)),c<=p&&p<=d&&(a.nwdaymask[p]=1)}return a}var eS=ne(()=>{Xn();en()});function tS(n,t){t===void 0&&(t=0);var
`),r=0;r<e.length;){var i=e[r]=e[r].replace(/\s+$/g,"");i?r>0&&i[0]===" "?(e[r-1]+=i.slice(1),e.splice(r,1)):r+=1:e.splice(r,1)}return e}function YL(n){n.forEach(function(t){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(t))throw new Error("unsupported RDATE/EXDATE parm: "+t)})}function dS(n,t){return YL(t),n.split(",").map(function(e){return Vl(e)})}var cS,zg=ne(()=>{yi();Xn();Qg();qt();en();Yg();cS={dtstart:null,cache:!1,unfold:!1,forceset:!1,compatible:!1,tzid:null}});function fS(n){var t=this;return function(e){if(e!==void 0&&(t["_".concat(n)]=e),t["_".concat(n)]!==void 0)return t["_".concat(n)];for(var r=0;r<t._rrule.length;r++){var i=t._rrule[r].origOptions[n];if(i)return i}}}function pS(n,t){if(!(n instanceof ae))throw new TypeError(String(n)+" is not RRule instance");Ie(t.map(String),String(n))||t.push(n)}function mS(n,t){if(!(n instanceof Date))throw new TypeError(String(n)+" is not Date instance");Ie(t.map(Number),Number(n))||(t.push(n),hi(t))}function hS(n,t,e){var r=!e||e.toUpperCase()==="UTC",i=r?"".concat(n,":"):"".concat(n,";TZID=").concat(e,":"),s=t.map(function(a){return Fa(a.valueOf(),r)}).join(",");return"".concat(i).concat(s)}var Kg,Qg=ne(()=>{yi();Xn();qt();en();uS();zg();Hg();Kg=function(n){La(t,n);function t(e){e===void 0&&(e=!1);var r=n.call(this,{},e)||this;return r.dtstart=fS.apply(r,["dtstart"]),r.tzid=fS.apply(r,["tzid"]),r._rrule=[],r._rdate=[],r._exrule=[],r._exdate=[],r}return t.prototype._iter=function(e){return lS(e,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},t.prototype.rrule=function(e){pS(e,this._rrule)},t.prototype.exrule=function(e){pS(e,this._exrule)},t.prototype.rdate=function(e){mS(e,this._rdate)},t.prototype.exdate=function(e){mS(e,this._exdate)},t.prototype.rrules=function(){return this._rrule.map(function(e){return Bc(e.toString())})},t.prototype.exrules=function(){return this._exrule.map(function(e){return Bc(e.toString())})},t.prototype.rdates=function(){return this._rdate.map(function(e){return new Date(e.getTime())})},t.prototype.exdates=function(){return this._exdate.map(function(e){return new Date(e.getTime())})},t.prototype.valueOf=function(){var e=[];return!this._rrule.length&&this._dtstart&&(e=e.concat(Jl({dtstart:this._dtstart}))),this._rrule.forEach(function(r){e=e.concat(r.toString().split(`
`))}),this._exrule.forEach(function(r){e=e.concat(r.toString().split(`
`).map(function(i){return i.replace(/^RRULE:/,"EXRULE:")}).filter(function(i){return!/^DTSTART/.test(i)}))}),this._rdate.length&&e.push(hS("RDATE",this._rdate,this.tzid())),this._exdate.length&&e.push(hS("EXDATE",this._exdate,this.tzid())),e},t.prototype.toString=function(){return this.valueOf().join(`
`)},t.prototype.clone=function(){var e=new t(!!this._cache);return this._rrule.forEach(function(r){return e.rrule(r.clone())}),this._exrule.forEach(function(r){return e.exrule(r.clone())}),this._rdate.forEach(function(r){return e.rdate(new Date(r.getTime()))}),this._exdate.forEach(function(r){return e.exdate(new Date(r.getTime()))}),e},t}(ae)});var gS=ne(()=>{Xn();Qg();zg();bi();Ms();qt()});var Et,Vc=ne(()=>{"use strict";gS();Et=class{constructor({rrule:t,baseOnToday:e,occurrence:r}){this.rrule=t,this.baseOnToday=e,this.occurrence=r}static fromText({recurrenceRuleText:t,occurrence:e}){try{let r=t.match(/^([a-zA-Z0-9, !]+?)( when done)?$/i);if(r==null)return null;let i=r[1].trim(),s=r[2]!==void 0,a=ae.parseText(i);if(a!==null){let o=e.referenceDate;!s&&o!==null?a.dtstart=window.moment(o).startOf("day").utc(!0).toDate():a.dtstart=window.moment().startOf("day").utc(!0).toDate();let l=new ae(a);return new Et({rrule:l,baseOnToday:s,occurrence:e})}}catch(r){r instanceof Error&&console.log(r.message)}return null}toText(){let t=this.rrule.toText();return this.baseOnToday&&(t+=" when done"),t}next(t=window.moment()){let e=this.nextReferenceDate(t);return e===null?null:this.occurrence.next(e)}identicalTo(t){return this.baseOnToday!==t.baseOnToday||!this.occurrence.isIdenticalTo(t.occurrence)?!1:this.toText()===t.toText()}nextReferenceDate(t){return this.baseOnToday?this.nextReferenceDateFromToday(t.clone()).toDate():this.nextReferenceDateFromOriginalReferenceDate().toDate()}nextReferenceDateFromToday(t){let e=new ae(me(U({},this.rrule.origOptions),{dtstart:t.startOf("day").utc(!0).toDate()}));return this.nextAfter(t.endOf("day"),e)}nextReferenceDateFromOriginalReferenceDate(){var e;let t=window.moment((e=this.occurrence.referenceDate)!=null?e:void 0).endOf("day");return this.nextAfter(t,this.rrule)}nextAfter(t,e){t.utc(!0);let r=window.moment.utc(e.after(t.toDate())),i=this.toText(),s=i.match(/every( \d+)? month(s)?(.*)?/);s!==null&&(i.includes(" on ")||(r=Et.nextAfterMonths(t,r,e,s[1])));let a=i.match(/every( \d+)? year(s)?(.*)?/);return a!==null&&(r=Et.nextAfterYears(t,r,e,a[1])),Et.addTimezone(r)}static nextAfterMonths(t,e,r,i){let s=1;for(i!==void 0&&(s=Number.parseInt(i.trim(),10));Et.isSkippingTooManyMonths(t,e,s);)e=Et.fromOneDayEarlier(t,r);return e}static isSkippingTooManyMonths(t,e,r){let i=e.month()-t.month();return i+=(e.year()-t.year())*12,i>r}static nextAfterYears(t,e,r,i){let s=1;for(i!==void 0&&(s=Number.parseInt(i.trim(),10));Et.isSkippingTooManyYears(t,e,s);)e=Et.fromOneDayEarlier(t,r);return e}static isSkippingTooManyYears(t,e,r){return e.year()-t.year()>r}static fromOneDayEarlier(t,e){t.subtract(1,"days").endOf("day");let r=e.origOptions;return r.dtstart=t.startOf("day").toDate(),e=new ae(r),window.moment.utc(e.after(t.toDate()))}static addTimezone(t){return window.moment.utc(t).set({hour:12,minute:0,second:0,millisecond:0}).local(!0).startOf("day")}}});function yS(n,t,e){let r=new Map([["cancelled date","cancelledDate"],["created date","createdDate"],["depends on","dependsOn"],["done date","doneDate"],["due date","dueDate"],["id","id"],["on completion","onCompletion"],["priority","priority"],["recurrence rule","recurrenceRule"],["scheduled date","scheduledDate"],["start date","startDate"]]);for(let[i,s]of r.entries())if(t.startsWith(i))return n.setVisibility(s,e),!0;return t.startsWith("tags")?(n.setTagsVisibility(e),!0):!1}var eu,zc,Gr,Is=ne(()=>{"use strict";eu=(p=>(p.Description="description",p.Id="id",p.DependsOn="dependsOn",p.Priority="priority",p.RecurrenceRule="recurrenceRule",p.OnCompletion="onCompletion",p.CreatedDate="createdDate",p.StartDate="startDate",p.ScheduledDate="scheduledDate",p.DueDate="dueDate",p.CancelledDate="cancelledDate",p.DoneDate="doneDate",p.BlockLink="blockLink",p))(eu||{}),zc=Object.values(eu),Gr=class{constructor(){this.visible={};this.tagsVisible=!0;zc.forEach(t=>{this.visible[t]=!0})}isShown(t){return this.visible[t]}areTagsShown(){return this.tagsVisible}hide(t){this.visible[t]=!1}setVisibility(t,e){this.visible[t]=e}setTagsVisibility(t){this.tagsVisible=t}get shownComponent
`})),c=c.slice(0,a.autoSuggestMaxItems),c}}function QL(n,t,e){let r=l2(t.substring(0,e),[["(",")"],["[","]"]])=="("?")":"]",i=n?r+" ":" ",s=n&&t.length>e&&t.charAt(e)===r?1:0;return{postfix:i,insertSkip:s}}function XL(n,t,e){let r=[],i=e.line;js(r,i,n.dueDateSymbol,"due date"),js(r,i,n.startDateSymbol,"start date"),js(r,i,n.scheduledDateSymbol,"scheduled date"),ZL(r,n,e),js(r,i,n.recurrenceSymbol,"recurring (repeat)"),JL(r,n,e),ES(t)&&(js(r,i,n.idSymbol,"id"),js(r,i,n.dependsOnSymbol,"depends on id")),js(r,i,n.onCompletionSymbol,"on completion");let s=e2(r,e);return s.length===0&&e.settings.autoSuggestMinMatch===0?r:s}function js(n,t,e,r){t.includes(e)||n.push({displayText:`${e} ${r}`,appendText:`${e} `})}function ZL(n,t,e){if(!(i=>Object.values(t.prioritySymbols).some(s=>s.length>0&&i.includes(s)))(e.line)){let i=t.prioritySymbols,s=["High","Medium","Low","Highest","Lowest"];for(let a of s){let o=i[a];n.push({displayText:e.dataviewMode?`${o} priority`:`${o} ${a.toLowerCase()} priority`,appendText:`${o}${e.postfix}`,insertSkip:e.dataviewMode?e.insertSkip:void 0})}}}function JL(n,t,e){if(!e.line.includes(t.createdDateSymbol)){let i=Dn.parseDate("today",!0).format(de.dateFormat);n.push({textToMatch:`${t.createdDateSymbol} created`,displayText:`${t.createdDateSymbol} created today (${i})`,appendText:`${t.createdDateSymbol} ${i}`+e.postfix,insertSkip:e.dataviewMode?e.insertSkip:void 0})}}function e2(n,t){let e=Ha(/([a-zA-Z'_-]*)/g,t),r=[];if(e&&e.length>0){let i=e[0];if(i.length>=Math.max(1,t.settings.autoSuggestMinMatch)){let s=n.filter(a=>{var l;return((l=a.textToMatch)!=null?l:a.displayText).toLowerCase().includes(i.toLowerCase())});for(let a of s){let o=t.dataviewMode&&(a.displayText.includes("priority")||a.displayText.includes("created"))?i.length+t.insertSkip:i.length;r.push({suggestionType:"match",displayText:a.displayText,appendText:a.appendText,insertAt:e.index,insertSkip:o})}}}return r}function DS(n,t){let e=`${t}`,r=`${n} ${t}`;return{displayText:e,appendText:r}}function t2(n,t){let r=`${Dn.parseDate(t,!0).format(de.dateFormat)}`,i=`${t} (${r})`,s=`${n} ${r}`;return{displayText:i,appendText:s}}function n2(n,t,e){let r=["today","tomorrow","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","next week","next month","next year"],i=[],s=new RegExp(`(${n})\\s*([0-9a-zA-Z ]*)`,"ug"),a=Ha(s,e);if(a&&a.length>=2){let o=a[2];if(o.length<e.settings.autoSuggestMinMatch)return[];let l=o&&o.length>1?Dn.parseDate(Pc(o),!0):null;if(l!=null&&l.isValid()){let c=l.format(de.dateFormat);td(e,a,[c],DS,i)}let u=ty(r,o,t,!0);td(e,a,u,t2,i)}return i}function r2(n,t){var a;let e=["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"],r=[],i=new RegExp(`(${n})\\s*([0-9a-zA-Z ]*)`,"ug"),s=Ha(i,t);if(s&&s.length>=2){let o=s[1],l=s[2];if(l.length<t.settings.autoSuggestMinMatch)return[];if(l.length>0){let f=(a=Et.fromText({recurrenceRuleText:l,occurrence:new Kn({startDate:null,scheduledDate:null,dueDate:null})}))==null?void 0:a.toText();if(f){let p=`${o} ${f}`+t.postfix;if(r.push({suggestionType:"match",displayText:`\u2705 ${f}`,appendText:p,insertAt:s.index,insertSkip:ny(s[0],t)}),s[0]==p)return[]}}let u=t.settings.autoSuggestMaxItems/2,c=ty(e,l,u,!1);c.length===0&&l.trim().length===0&&(c=e.slice(0,u)),td(t,s,c,(f,p)=>{let b=`${p}`,T=`${f} ${p}`;return{displayText:b,appendText:T}},r)}return r}function i2(n,t,e){let r=["delete","keep"],i=[],s=new RegExp(`(${n})\\s*([0-9a-zA-Z ]*)`,"ug"),a=Ha(s,e);if(a&&a.length>=2){let o=a[2];if(o.length<e.settings.autoSuggestMinMatch)return[];let l=ty(r,o,t,!0);td(e,a,l,DS,i)}return i}function s2(n,t,e){let r=[],i=new RegExp(`(${n})\\s*(${Fs.source})?`,"ug"),s=Ha(i,e);if(s&&s[0].trim().length<=n.length){let a=ru(t.map(o=>o.id));r.push({suggestionType:"match",displayText:"generate unique id",appendText:`${n} ${a}`+e.postfix,insertAt:s.index,insertSkip:ny(s[0],e)})}return r}function a2(n,t,e,r){let
\`\`\`${r}
flowchart LR
1 year ago
classDef TODO stroke:#f33,stroke-width:3px;
classDef DONE stroke:#0c0,stroke-width:3px;
classDef IN_PROGRESS stroke:#fa0,stroke-width:3px;
classDef CANCELLED stroke:#ddd,stroke-width:3px;
classDef NON_TASK stroke:#99e,stroke-width:3px;
1 year ago
${i.join(`
`)}
11 months ago
${s.join(`
`)}
1 year ago
linkStyle default stroke:gray
\`\`\`
3 days ago
`}addEdgeIfNotToInternal(t,e,r,i,s){let a=t.findIndex(u=>u.symbol===e.symbol),o=a!==-1,l=e.type!=="EMPTY";if(o&&l){let u;s?u='-. "\u{1F501}" .-> ':u=" --> ";let c=`${i+1}${u}${a+1}`;r.push(c)}}getMermaidNodeLabel(t,e){let r=IS(t.name),i=t.type;if(e){let s=id(t.symbol),a=id(t.nextStatusSymbol),o=`[${s}] -> [${a}]`,l=`'${r}'`,u=`(${i})`;return`["${l}<br>${o}<br>${u}"]:::${i}`}else return`["${r}"]:::${i}`}}});var Br,LS=ne(()=>{"use strict";Br=class{constructor(t,e){this.name=t,this.sortOrder=e}get groupText(){return this.name!==""?`%%${this.sortOrder}%% ${this.name}`:""}}});var US,It,sd=ne(()=>{"use strict";US=require("obsidian");LS();ii();It=class{constructor(t){this._date=null;this._date=t}get moment(){return this._date}formatAsDate(t=""){return this.format(de.dateFormat,t)}formatAsDateAndTime(t=""){return this.format(de.dateTimeFormat,t)}format(t,e=""){return this._date?this._date.format(t):e}toISOString(t){return this._date?this._date.toISOString(t):""}get category(){let t=window.moment(),e=this.moment;return e?e.isBefore(t,"day")?new Br("Overdue",1):e.isSame(t,"day")?new Br("Today",2):e.isValid()?new Br("Future",3):new Br("Invalid date",0):new Br("Undated",4)}get fromNow(){let t=this.moment;if(!t)return new Br("",0);let e=this.fromNowOrder(t);return new Br(t.fromNow(),e)}fromNowOrder(t){if(!t.isValid())return 0;let e=window.moment(),r=t.isSameOrBefore(e,"day"),i=this.fromNowStartDateOfGroup(t,r,e);return Number((r?1:3)+i.format("YYYYMMDD"))}fromNowStartDateOfGroup(t,e,r){let i=t.fromNow(!0).split(" "),s,a=Number(i[0]);isNaN(a)?s=1:s=a;let o=i[1];return e?r.subtract(s,o):r.add(s,o)}postpone(t="days",e=1){if(!this._date)throw new US.Notice("Cannot postpone a null date");let r=window.moment().startOf("day");return this._date.isSameOrAfter(r,"day")?this._date.clone().add(e,t):r.add(e,t)}}});var $S=O((jS,WS)=>{(function(n){var t=Object.hasOwnProperty,e=Array.isArray?Array.isArray:function(y){return Object.prototype.toString.call(y)==="[object Array]"},r=10,i=typeof process=="object"&&typeof process.nextTick=="function",s=typeof Symbol=="function",a=typeof Reflect=="object",o=typeof setImmediate=="function",l=o?setImmediate:setTimeout,u=s?a&&typeof Reflect.ownKeys=="function"?Reflect.ownKeys:function(m){var y=Object.getOwnPropertyNames(m);return y.push.apply(y,Object.getOwnPropertySymbols(m)),y}:Object.keys;function c(){this._events={},this._conf&&d.call(this,this._conf)}function d(m){m&&(this._conf=m,m.delimiter&&(this.delimiter=m.delimiter),m.maxListeners!==n&&(this._maxListeners=m.maxListeners),m.wildcard&&(this.wildcard=m.wildcard),m.newListener&&(this._newListener=m.newListener),m.removeListener&&(this._removeListener=m.removeListener),m.verboseMemoryLeak&&(this.verboseMemoryLeak=m.verboseMemoryLeak),m.ignoreErrors&&(this.ignoreErrors=m.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function f(m,y){var v="(node) warning: possible EventEmitter memory leak detected. "+m+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(v+=" Event name: "+y+"."),typeof process!="undefined"&&process.emitWarning){var w=new Error(v);w.name="MaxListenersExceededWarning",w.emitter=this,w.count=m,process.emitWarning(w)}else console.error(v),console.trace&&console.trace()}var p=function(m,y,v){var w=arguments.length;switch(w){case 0:return[];case 1:return[m];case 2:return[m,y];case 3:return[m,y,v];default:for(var S=new Array(w);w--;)S[w]=arguments[w];return S}};function b(m,y){for(var v={},w,S=m.length,M=y?y.length:0,I=0;I<S;I++)w=m[I],v[w]=I<M?y[I]:n;return v}function T(m,y,v){this._emitter=m,this._target=y,this._listeners={},this._listenersCount=0;var w,S;if((v.on||v.off)&&(w=v.on,S=v.off),y.addEventListener?(w=y.addEventListener,S=y.removeEventListener):y.addListener?(w=y.addListener,S=y.removeListener):y.on&&(w=y.on,S=y.off),!w&&!S)throw Error("target does not implement any known event API");if(typeof w!="function")throw TypeError("on method must be a function");if(typeof S!="function")throw TypeError("off method must be a function");this._on=w,this._off=S;var M=m._observers;M?M.push(this)
`),this.dateFromFileName=new Ba(()=>Ft.fromPath(this.filePath))}parseFileContent(){if(this.listItems===void 0)return this.tasks;let t=new mt(this.filePath,this.fileCache),e=this.fileLines.length,r=null,i=0;for(let s of this.listItems){let a=s.position.start.line;if(a>=e)return this.logger.debug(`${this.filePath} Obsidian gave us a line number ${a} past the end of the file. ${e}.`),this.tasks;if((r===null||r.position.end.line<a)&&(r=qs.getSection(a,this.fileCache.sections),i=0),r===null)continue;let o=this.fileLines[a];if(o===void 0){this.logger.debug(`${this.filePath}: line ${a} - ignoring 'undefined' line.`);continue}let l=new Lt(t,a,r.position.start.line,i,qs.getPrecedingHeader(a,this.fileCache.headings));i=this.parseLine(s,o,l,a,i)}return this.tasks}parseLine(t,e,r,i,s){var o;if(t.task===void 0)return this.createListItem(t,e,i),s;let a;try{if(a=fe.fromLine({line:e,taskLocation:r,fallbackDate:this.dateFromFileName.value}),a!==null){let l=(o=this.line2ListItem.get(t.parent))!=null?o:null;l!==null&&(a=new fe(me(U({},a),{parent:l}))),this.line2ListItem.set(i,a),a!==null&&(s++,this.tasks.push(a))}else this.createListItem(t,e,i)}catch(l){this.errorReporter(l,this.filePath,t,e)}return s}createListItem(t,e,r){var s;let i=(s=this.line2ListItem.get(t.parent))!=null?s:null;this.line2ListItem.set(r,new Vr(e,i))}};var qs=class{constructor({metadataCache:t,vault:e,workspace:r,events:i}){this.logger=rn.getLogger("tasks.Cache");this.logger.debug("Creating Cache object"),this.metadataCache=t,this.metadataCacheEventReferences=[],this.vault=e,this.workspace=r,this.vaultEventReferences=[],this.events=i,this.eventsEventReferences=[],this.tasksMutex=new ju,this.state="Cold",this.logger.debug("Cache.constructor(): state = Cold"),this.tasks=[],this.loadedAfterFirstResolve=!1,this.subscribeToCache(),this.workspace.onLayoutReady(()=>{this.subscribeToVault(),this.loadVault()}),this.subscribeToEvents()}unload(){this.logger.info("Unloading Cache");for(let t of this.metadataCacheEventReferences)this.metadataCache.offref(t);for(let t of this.vaultEventReferences)this.vault.offref(t);for(let t of this.eventsEventReferences)this.events.off(t)}getTasks(){return this.tasks}getState(){return this.state}notifySubscribers(){this.logger.debug("Cache.notifySubscribers()"),this.events.triggerCacheUpdate({tasks:this.tasks,state:this.state})}subscribeToCache(){this.logger.debug("Cache.subscribeToCache()");let t=this.metadataCache.on("resolved",()=>L(this,null,function*(){this.loadedAfterFirstResolve||(this.loadedAfterFirstResolve=!0,this.loadVault())}));this.metadataCacheEventReferences.push(t);let e=this.metadataCache.on("changed",r=>{this.tasksMutex.runExclusive(()=>{this.indexFile(r)})});this.metadataCacheEventReferences.push(e)}subscribeToVault(){this.logger.debug("Cache.subscribeToVault()");let{useFilenameAsScheduledDate:t}=le(),e=this.vault.on("create",s=>{s instanceof Va.TFile&&(this.logger.debug(`Cache.subscribeToVault.createdEventReference() ${s.path}`),this.tasksMutex.runExclusive(()=>{this.indexFile(s)}))});this.vaultEventReferences.push(e);let r=this.vault.on("delete",s=>{s instanceof Va.TFile&&(this.logger.debug(`Cache.subscribeToVault.deletedEventReference() ${s.path}`),this.tasksMutex.runExclusive(()=>{this.tasks=this.tasks.filter(a=>a.path!==s.path),this.notifySubscribers()}))});this.vaultEventReferences.push(r);let i=this.vault.on("rename",(s,a)=>{s instanceof Va.TFile&&(this.logger.debug(`Cache.subscribeToVault.renamedEventReference() ${s.path}`),this.tasksMutex.runExclusive(()=>{let o=this.metadataCache.getFileCache(s),l=new mt(s.path,o!=null?o:void 0),u=new Ba(()=>Ft.fromPath(s.path));this.tasks=this.tasks.map(c=>{if(c.path!==a)return c;let d=c.taskLocation.fromRenamedFile(l);return t?Ft.updateTaskPath(c,d,u.value):new fe(me(U({},c),{taskLocation:d}))}),this.notifySubscribers()}))});this.vaultEventReferences.push(i)}subscribeToEvents(){this.logger.debug("Cache.subscribeToEvents()");let t=this.events.onRequestCacheUpdate(e=>{e({tasks:this.tasks,state:this.state})});this.eventsEventReferences.push(t)}loadVault(){return this.logger.debug("Cac
The following task has been ignored, to prevent Tasks queries getting stuck with 'Loading Tasks ...'
2 months ago
Error: ${t}
File: ${e}
3 days ago
Line number: ${r.position.start.line}
11 months 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.
3 days ago
`;this.logger.error(s),t instanceof Error&&this.logger.error(t.stack?t.stack:"Cannot determine stack"),this.state==="Initializing"&&new Va.Notice(s,1e4)}static getSection(t,e){if(e===void 0)return null;for(let r of e)if(r.position.start.line<=t&&r.position.end.line>=t)return r;return null}static getPrecedingHeader(t,e){if(e===void 0)return null;let r=null;for(let i of e){if(i.position.start.line>t)return r;r=i.heading}return r}};var Fy=require("obsidian");var zE=require("obsidian");function tt(){}function hy(n){return n()}function GS(){return Object.create(null)}function Gt(n){n.forEach(hy)}function fd(n){return typeof n=="function"}function zr(n,t){return n!=n?t==t:n!==t||n&&typeof n=="object"||typeof n=="function"}function BS(n){return Object.keys(n).length===0}var VS=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global,lu=class{constructor(t){this.options=t,this._listeners="WeakMap"in VS?new WeakMap:void 0}observe(t,e){return this._listeners.set(t,e),this._getObserver().observe(t,this.options),()=>{this._listeners.delete(t),this._observer.unobserve(t)}}_getObserver(){var t;return(t=this._observer)!==null&&t!==void 0?t:this._observer=new ResizeObserver(e=>{var r;for(let i of e)lu.entries.set(i.target,i),(r=this._listeners.get(i.target))===null||r===void 0||r(i)})}};lu.entries="WeakMap"in VS?new WeakMap:void 0;var zS=!1;function m2(){zS=!0}function h2(){zS=!1}function z(n,t){n.appendChild(t)}function Ee(n,t,e){n.insertBefore(t,e||null)}function ve(n){n.parentNode&&n.parentNode.removeChild(n)}function Gs(n,t){for(let e=0;e<n.length;e+=1)n[e]&&n[e].d(t)}function ue(n){return document.createElement(n)}function g2(n){return document.createElementNS("http://www.w3.org/2000/svg",n)}function Ve(n){return document.createTextNode(n)}function De(){return Ve(" ")}function pd(){return Ve("")}function We(n,t,e,r){return n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)}function KS(n){return function(t){return t.preventDefault(),n.call(this,t)}}function B(n,t,e){e==null?n.removeAttribute(t):n.getAttribute(t)!==e&&n.setAttribute(t,e)}function QS(n){let t;return{p(...e){t=e,t.forEach(r=>n.push(r))},r(){t.forEach(e=>n.splice(n.indexOf(e),1))}}}function y2(n){return Array.from(n.childNodes)}function nr(n,t){t=""+t,n.data!==t&&(n.data=t)}function fn(n,t){n.value=t==null?"":t}function gy(n,t,e){for(let r=0;r<n.options.length;r+=1){let i=n.options[r];if(i.__value===t){i.selected=!0;return}}(!e||t!==void 0)&&(n.selectedIndex=-1)}function XS(n){let t=n.querySelector(":checked");return t&&t.__value}var cd;function b2(){if(cd===void 0){cd=!1;try{typeof window!="undefined"&&window.parent&&window.parent.document}catch(n){cd=!0}}return cd}function ZS(n,t){getComputedStyle(n).position==="static"&&(n.style.position="relative");let r=ue("iframe");r.setAttribute("style","display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;"),r.setAttribute("aria-hidden","true"),r.tabIndex=-1;let i=b2(),s;return i?(r.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",s=We(window,"message",a=>{a.source===r.contentWindow&&t()})):(r.src="about:blank",r.onload=()=>{s=We(r.contentWindow,"resize",t),t()}),z(n,r),()=>{(i||s&&r.contentWindow)&&s(),ve(r)}}function Si(n,t,e){n.classList[e?"add":"remove"](t)}var Xa=class{constructor(t=!1){this.is_svg=!1,this.is_svg=t,this.e=this.n=null}c(t){this.h(t)}m(t,e,r=null){this.e||(this.is_svg?this.e=g2(e.nodeName):this.e=ue(e.nodeType===11?"TEMPLATE":e.nodeName),this.t=e.tagName!=="TEMPLATE"?e:e.content,this.c(t)),this.i(r)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(t){for(let e=0;e<this.n.length;e+=1)Ee(this.t,this.n[e],t)}p(t){this.d(),this.h(t),this.i(this.a)}d(){this.n.forEach(ve)}};var uu;function ou(n){uu=n}function T2(){if(!uu)throw new Error("Function called outside component initialization");return uu}function yy(n){T2().$$.on_mount.push(n)}var Ka=[];var at=[],Qa=[],py=[],_2=Promi
12 months ago
The task line not updated is:
3 days ago
${n.originalMarkdown}
12 months ago
In this markdown file:
3 days ago
"${n.taskLocation.path}"
12 months ago
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.
3 days ago
`;vd(c);return}let u=Math.min(Math.pow(10,s),100);o.debug(`timeout = ${u}`),setTimeout(()=>L(void 0,null,function*(){yield LE({originalTask:n,newTasks:t,vault:e,metadataCache:r,workspace:i,previousTries:s+1})}),u)});try{let[u,c,d]=yield UE(n,e),f=[...d.slice(0,u),...t.map(p=>p.toFileLineString()),...d.slice(u+1)];yield e.modify(c,f.join(`
`))}catch(u){if(u instanceof Vi){u.message&&FE(u.message),yield l();return}else if(u instanceof wd){yield l();return}else u instanceof Error&&vd(u.message)}});function UE(n,t){return L(this,null,function*(){if(hu===void 0)throw new Vi;let e=t.getAbstractFileByPath(n.path);if(!(e instanceof gu.TFile))throw new Vi(`Tasks: No file found for task ${n.description}. Retrying ...`);if(!J2.includes(e.extension))throw new Error(`Tasks: Does not support files with the ${e.extension} file extension.`);let r=hu.getFileCache(e);if(r==null||r===null)throw new Vi(`Tasks: No file cache found for file ${e.path}. Retrying ...`);let i=r.listItems;if(i===void 0||i.length===0)throw new Vi(`Tasks: No list items found in file cache of ${e.path}. Retrying ...`);let a=(yield t.read(e)).split(`
`),o=tU(n,a,i,eU);if(o===void 0)throw new wd;return[o,e,a]})}function Ay(n,t){return L(this,null,function*(){try{let[e,r,i]=yield UE(n,t);return[e,r]}catch(e){e instanceof Vi?e.message&&FE(e.message):e instanceof Error&&vd(e.message)}})}function jE(n,t){return n<t.length}function tU(n,t,e,r){let i=nU(n,t);return i!==void 0||(i=rU(n,t),i!==void 0)?i:iU(n,t,e,r)}function nU(n,t){let e=n.taskLocation.lineNumber;if(jE(e,t)&&t[e]===n.originalMarkdown)return kd().debug(`Found original markdown at original line number ${e}`),e}function rU(n,t){let e=[];for(let r=0;r<t.length;r++)t[r]===n.originalMarkdown&&e.push(r);if(e.length===1)return e[0]}function iU(n,t,e,r){let i,s=0;for(let a of e){let o=a.position.start.line;if(!jE(o,t))return;if(o<n.taskLocation.sectionStart||a.task===void 0)continue;let l=t[o];if(Fe.getInstance().includedIn(l)){if(s===n.taskLocation.sectionIndex){if(l===n.originalMarkdown)i=o;else{r(`Tasks: Unable to find task in file ${n.taskLocation.path}.
12 months ago
Expected task:
3 days ago
${n.originalMarkdown}
12 months ago
Found task:
3 days ago
${l}`);return}break}s++}}return i}Nc();Wa();Vc();Nt();Jc();Jn();var ro=class{constructor(t){this.addGlobalFilterOnSave=t.addGlobalFilterOnSave,this.originalBlocking=t.originalBlocking,this.description=t.description,this.status=t.status,this.priority=t.priority,this.onCompletion=t.onCompletion,this.recurrenceRule=t.recurrenceRule,this.createdDate=t.createdDate,this.startDate=t.startDate,this.scheduledDate=t.scheduledDate,this.dueDate=t.dueDate,this.doneDate=t.doneDate,this.cancelledDate=t.cancelledDate,this.forwardOnly=t.forwardOnly,this.blockedBy=t.blockedBy,this.blocking=t.blocking}static fromTask(t,e){let r=Fe.getInstance().removeAsWordFrom(t.description),i=r!=t.description||!Fe.getInstance().includedIn(t.description),s="none";t.priority==="5"?s="lowest":t.priority==="4"?s="low":t.priority==="2"?s="medium":t.priority==="1"?s="high":t.priority==="0"&&(s="highest");let a=[];for(let l of t.dependsOn){let u=e.find(c=>c.id===l);!u||a.push(u)}let o=e.filter(l=>l.dependsOn.includes(t.id));return new ro({addGlobalFilterOnSave:i,originalBlocking:o,description:r,status:t.status,priority:s,recurrenceRule:t.recurrence?t.recurrence.toText():"",onCompletion:t.onCompletion,createdDate:t.created.formatAsDate(),startDate:t.start.formatAsDate(),scheduledDate:t.scheduled.formatAsDate(),dueDate:t.due.formatAsDate(),doneDate:t.done.formatAsDate(),cancelledDate:t.cancelled.formatAsDate(),forwardOnly:!0,blockedBy:a,blocking:o})}applyEdits(t,e){return L(this,null,function*(){let r=this.description.trim();this.addGlobalFilterOnSave&&(r=Fe.getInstance().prependTo(r));let i=xs(this.startDate,this.forwardOnly),s=xs(this.scheduledDate,this.forwardOnly),a=xs(this.dueDate,this.forwardOnly),o=xs(this.cancelledDate,this.forwardOnly),l=xs(this.createdDate,this.forwardOnly),u=xs(this.doneDate,this.forwardOnly),c=null;this.recurrenceRule&&(c=Et.fromText({recurrenceRuleText:this.recurrenceRule,occurrence:new Kn({startDate:i,scheduledDate:s,dueDate:a})}));let d=this.onCompletion,f=[];for(let D of this.blockedBy){let A=yield sU(D,e);f.push(A)}let p=t.id,b=[],T=[];(this.blocking.toString()!==this.originalBlocking.toString()||this.blocking.length!==0)&&(t.id===""&&(p=ru(e.filter(D=>D.id!=="").map(D=>D.id))),b=this.originalBlocking.filter(D=>!this.blocking.includes(D)),T=this.blocking.filter(D=>!this.originalBlocking.includes(D)));let _=new fe(me(U({},t),{description:r,status:t.status,priority:Mn.priorityValue(this.priority),onCompletion:d,recurrence:c,startDate:i,scheduledDate:s,dueDate:a,doneDate:u,createdDate:l,cancelledDate:o,dependsOn:f.map(D=>D.id),id:p}));for(let D of b){let A=wS(D,_);yield ar({originalTask:D,newTasks:A})}for(let D of T){let A=vS(D,_);yield ar({originalTask:D,newTasks:A})}let x=this.inferTodaysDate(this.status.type,u,o);return _.handleNewStatusWithRecurrenceInUsersOrder(this.status,x)})}inferTodaysDate(t,e,r){return t==="DONE"&&e!==null?e:t==="CANCELLED"&&r!==null?r:window.moment()}parseAndValidateRecurrence(){var e;if(!this.recurrenceRule)return{parsedRecurrence:"<i>not recurring</>",isRecurrenceValid:!0};let t=(e=Et.fromText({recurrenceRuleText:this.recurrenceRule,occurrence:new Kn({startDate:null,scheduledDate:null,dueDate:null})}))==null?void 0:e.toText();return t?this.startDate||this.scheduledDate||this.dueDate?{parsedRecurrence:t,isRecurrenceValid:!0}:{parsedRecurrence:"<i>due, scheduled or start date required</i>",isRecurrenceValid:!1}:{parsedRecurrence:"<i>invalid recurrence rule</i>",isRecurrenceValid:!1}}};function sU(n,t){return L(this,null,function*(){if(n.id!=="")return n;let e=t.filter(i=>i.id!==""),r=Zc(n,e.map(i=>i.id));return yield ar({originalTask:n,newTasks:r}),r})}nn();function aU(n){let t,e=Ut("Recurs",n[2])+"",r,i,s,a,o,l,u,c,d;return{c(){t=ue("label"),r=De(),i=ue("input"),s=De(),a=ue("code"),o=Ve(n[4]),l=De(),u=new Xa(!1),B(t,"for","recurrence"),B(i,"id","recurrence"),B(i,"type","text"),B(i,"class","tasks-modal-date-input"),B(i,"placeholder","Try 'every day when done'"),B(i,"accesskey",n[2]),Si(i,"tasks-modal-error",!n[1]),u.a=null,B(a,"class","tasks-modal-parsed-date")},m(f,p){Ee(f,t,p),t.innerHTML=e,Ee(f,r,p),E
`);t.setLine(o,b)};new zi({app:r,task:u,onSubmit:c,allTasks:i}).open()};var Ly=require("obsidian");wi();Nt();ii();var QE=(n,t,e)=>{var l;if(n)return e instanceof Ly.MarkdownView;if(!(e instanceof Ly.MarkdownView))return;let r=(l=e.file)==null?void 0:l.path;if(r===void 0)return;let i=t.getCursor(),s=i.line,a=t.getLine(s),o=Uy(a,r);t.setLine(s,o.text),t.setCursor(TU(i,o))},Uy=(n,t)=>{let e=fe.fromLine({line:n,taskLocation:Lt.fromUnknownPosition(new mt(t)),fallbackDate:null});if(e!==null){let r=e.toggleWithRecurrenceInUsersOrder().map(s=>s.toFileLineString()),i=r.length>0?r.length-1:0;return{text:r.join(`
`),moveTo:{line:i}}}else{let r=n.match(de.taskRegex);if(r!==null){let i=r[3],a=Be.getInstance().bySymbol(i).nextStatusSymbol;return{text:n.replace(de.taskRegex,`$1- [${a}] $4`)}}else if(de.listItemRegex.test(n)){let i=n.replace(de.listItemRegex,"$1$2 [ ]");return{text:i,moveTo:{ch:i.length}}}else{let i=n.replace(de.indentationRegex,"$1- ");return{text:i,moveTo:{ch:i.length}}}}},TU=(n,t)=>{var s;let e={line:0,ch:n.ch},r=U(U({},e),(s=t.moveTo)!=null?s:{}),i=t.text.split(`
`)[r.line].length;return{line:n.line+r.line,ch:Math.min(r.ch,i)}};var sb=require("obsidian");nn();var Ki=class{constructor(){this.hidePostponeButton=!1;this.hideTaskCount=!1;this.hideBacklinks=!1;this.hideEditButton=!1;this.hideUrgency=!0;this.hideTree=!0;this.shortMode=!1;this.explainQuery=!1}};function XE(n,t,e){let r=new Map([["backlink","hideBacklinks"],["edit button","hideEditButton"],["postpone button","hidePostponeButton"],["task count","hideTaskCount"],["tree","hideTree"],["urgency","hideUrgency"]]);for(let[i,s]of r.entries())if(t.startsWith(i))return n[s]=e,!0;return!1}Is();function Xs(n,t){let e=`Error: ${n}.
12 months ago
The error message was:
3 days ago
`,r="";return t instanceof Error?r+=t:r+="Unknown error",`${e}"${r}"`}$s();var _U=Object.prototype.toString,so=Array.isArray||function(t){return _U.call(t)==="[object Array]"};function Wy(n){return typeof n=="function"}function vU(n){return so(n)?"array":typeof n}function jy(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function ZE(n,t){return n!=null&&typeof n=="object"&&t in n}function wU(n,t){return n!=null&&typeof n!="object"&&n.hasOwnProperty&&n.hasOwnProperty(t)}var kU=RegExp.prototype.test;function SU(n,t){return kU.call(n,t)}var EU=/\S/;function DU(n){return!SU(EU,n)}var OU={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function xU(n){return String(n).replace(/[&<>"'`=\/]/g,function(e){return OU[e]})}var CU=/\s*/,MU=/\s+/,JE=/\s*=/,RU=/\s*\}/,AU=/#|\^|\/|>|\{|&|=|!/;function PU(n,t){if(!n)return[];var e=!1,r=[],i=[],s=[],a=!1,o=!1,l="",u=0;function c(){if(a&&!o)for(;s.length;)delete i[s.pop()];else s=[];a=!1,o=!1}var d,f,p;function b(Z){if(typeof Z=="string"&&(Z=Z.split(MU,2)),!so(Z)||Z.length!==2)throw new Error("Invalid tags: "+Z);d=new RegExp(jy(Z[0])+"\\s*"),f=new RegExp("\\s*"+jy(Z[1])),p=new RegExp("\\s*"+jy("}"+Z[1]))}b(t||or.tags);for(var T=new bu(n),_,x,D,A,j,Y;!T.eos();){if(_=T.pos,D=T.scanUntil(d),D)for(var se=0,H=D.length;se<H;++se)A=D.charAt(se),DU(A)?(s.push(i.length),l+=A):(o=!0,e=!0,l+=" "),i.push(["text",A,_,_+1]),_+=1,A===`
`&&(c(),l="",u=0,e=!1);if(!T.scan(d))break;if(a=!0,x=T.scan(AU)||"name",T.scan(CU),x==="="?(D=T.scanUntil(JE),T.scan(JE),T.scanUntil(f)):x==="{"?(D=T.scanUntil(p),T.scan(RU),T.scanUntil(f),x="&"):D=T.scanUntil(f),!T.scan(f))throw new Error("Unclosed tag at "+T.pos);if(x==">"?j=[x,D,_,T.pos,l,u,e]:j=[x,D,_,T.pos],u++,i.push(j),x==="#"||x==="^")r.push(j);else if(x==="/"){if(Y=r.pop(),!Y)throw new Error('Unopened section "'+D+'" at '+_);if(Y[1]!==D)throw new Error('Unclosed section "'+Y[1]+'" at '+_)}else x==="name"||x==="{"||x==="&"?o=!0:x==="="&&b(D)}if(c(),Y=r.pop(),Y)throw new Error('Unclosed section "'+Y[1]+'" at '+T.pos);return IU(NU(i))}function NU(n){for(var t=[],e,r,i=0,s=n.length;i<s;++i)e=n[i],e&&(e[0]==="text"&&r&&r[0]==="text"?(r[1]+=e[1],r[3]=e[3]):(t.push(e),r=e));return t}function IU(n){for(var t=[],e=t,r=[],i,s,a=0,o=n.length;a<o;++a)switch(i=n[a],i[0]){case"#":case"^":e.push(i),r.push(i),e=i[4]=[];break;case"/":s=r.pop(),s[5]=i[2],e=r.length>0?r[r.length-1][4]:t;break;default:e.push(i)}return t}function bu(n){this.string=n,this.tail=n,this.pos=0}bu.prototype.eos=function(){return this.tail===""};bu.prototype.scan=function(t){var e=this.tail.match(t);if(!e||e.index!==0)return"";var r=e[0];return this.tail=this.tail.substring(r.length),this.pos+=r.length,r};bu.prototype.scanUntil=function(t){var e=this.tail.search(t),r;switch(e){case-1:r=this.tail,this.tail="";break;case 0:r="";break;default:r=this.tail.substring(0,e),this.tail=this.tail.substring(e)}return this.pos+=r.length,r};function io(n,t){this.view=n,this.cache={".":this.view},this.parent=t}io.prototype.push=function(t){return new io(t,this)};io.prototype.lookup=function(t){var e=this.cache,r;if(e.hasOwnProperty(t))r=e[t];else{for(var i=this,s,a,o,l=!1;i;){if(t.indexOf(".")>0)for(s=i.view,a=t.split("."),o=0;s!=null&&o<a.length;)o===a.length-1&&(l=ZE(s,a[o])||wU(s,a[o])),s=s[a[o++]];else s=i.view[t],l=ZE(i.view,t);if(l){r=s;break}i=i.parent}e[t]=r}return Wy(r)&&(r=r.call(this.view)),r};function on(){this.templateCache={_cache:{},set:function(t,e){this._cache[t]=e},get:function(t){return this._cache[t]},clear:function(){this._cache={}}}}on.prototype.clearCache=function(){typeof this.templateCache!="undefined"&&this.templateCache.clear()};on.prototype.parse=function(t,e){var r=this.templateCache,i=t+":"+(e||or.tags).join(":"),s=typeof r!="undefined",a=s?r.get(i):void 0;return a==null&&(a=PU(t,e),s&&r.set(i,a)),a};on.prototype.render=function(t,e,r,i){var s=this.getConfigTags(i),a=this.parse(t,s),o=e instanceof io?e:new io(e,void 0);return this.renderTokens(a,o,r,t,i)};on.prototype.renderTokens=function(t,e,r,i,s){for(var a="",o,l,u,c=0,d=t.length;c<d;++c)u=void 0,o=t[c],l=o[0],l==="#"?u=this.renderSection(o,e,r,i,s):l==="^"?u=this.renderInverted(o,e,r,i,s):l===">"?u=this.renderPartial(o,e,r,s):l==="&"?u=this.unescapedValue(o,e):l==="name"?u=this.escapedValue(o,e,s):l==="text"&&(u=this.rawValue(o)),u!==void 0&&(a+=u);return a};on.prototype.renderSection=function(t,e,r,i,s){var a=this,o="",l=e.lookup(t[1]);function u(f){return a.render(f,e,r,s)}if(!!l){if(so(l))for(var c=0,d=l.length;c<d;++c)o+=this.renderTokens(t[4],e.push(l[c]),r,i,s);else if(typeof l=="object"||typeof l=="string"||typeof l=="number")o+=this.renderTokens(t[4],e.push(l),r,i,s);else if(Wy(l)){if(typeof i!="string")throw new Error("Cannot use higher-order sections without the original template");l=l.call(e.view,i.slice(t[3],t[5]),u),l!=null&&(o+=l)}else o+=this.renderTokens(t[4],e,r,i,s);return o}};on.prototype.renderInverted=function(t,e,r,i,s){var a=e.lookup(t[1]);if(!a||so(a)&&a.length===0)return this.renderTokens(t[4],e,r,i,s)};on.prototype.indentPartial=function(t,e,r){for(var i=e.replace(/[^ \t]/g,""),s=t.split(`
`),a=0;a<s.length;a++)s[a].length&&(a>0||!r)&&(s[a]=i+s[a]);return s.join(`
`)};on.prototype.renderPartial=function(t,e,r,i){if(!!r){var s=this.getConfigTags(i),a=Wy(r)?r(t[1]):r[t[1]];if(a!=null){var o=t[6],l=t[5],u=t[4],c=a;l==0&&u&&(c=this.indentPartial(a,u,o));var d=this.parse(c,s);return this.renderTokens(d,e,r,c,i)}}};on.prototype.unescapedValue=function(t,e){var r=e.lookup(t[1]);if(r!=null)return r};on.prototype.escapedValue=function(t,e,r){var i=this.getConfigEscape(r)||or.escape,s=e.lookup(t[1]);if(s!=null)return typeof s=="number"&&i===or.escape?String(s):i(s)};on.prototype.rawValue=function(t){return t[1]};on.prototype.getConfigTags=function(t){return so(t)?t:t&&typeof t=="object"?t.tags:void 0};on.prototype.getConfigEscape=function(t){if(t&&typeof t=="object"&&!so(t))return t.escape};var or={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(n){yu.templateCache=n},get templateCache(){return yu.templateCache}},yu=new on;or.clearCache=function(){return yu.clearCache()};or.parse=function(t,e){return yu.parse(t,e)};or.render=function(t,e,r,i){if(typeof t!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+vU(t)+'" was given as the first argument for mustache#render(template, view, partials)');return yu.render(t,e,r,i)};or.escape=xU;or.Scanner=bu;or.Context=io;or.Writer=on;var $y=or;var iD=Yo(rD());var Xr=class{constructor(t){this.instruction=t}get queryComponent(){return this._queryComponent}set queryComponent(t){this._queryComponent=t}get error(){return this._error}set error(t){this._error=t}isValid(){return this._queryComponent!==void 0}static fromObject(t,e){let r=new Xr(t);return r._queryComponent=e,r}static fromError(t,e){let r=new Xr(t);return r._error=e,r}};var Tu=class extends Xr{};function _u(n,t){try{let e=n.map(([s])=>s),r=t.includes("return")?t:`return ${t}`,i=t&&new Function(...e,r);return i instanceof Function?Tu.fromObject(t,i):Tu.fromError(t,`Problem parsing expression "${t}"`)}catch(e){return Tu.fromError(t,Xs(`Failed parsing expression "${t}"`,e))}}function vu(n,t){let e=t.map(([r,i])=>i);return n(...e)}function Yy(n,t,e){try{return vu(n,t)}catch(r){return Xs(`Failed calculating expression "${e}"`,r)}}function sD(n,t){$y.escape=function(e){return e};try{let e=LU(n,t);return $y.render(e,(0,iD.default)(t))}catch(e){let r="";throw e instanceof Error?r=`There was an error expanding one or more placeholders.
1 year ago
The error message was:
3 days ago
${e.message.replace(/ > /g,".").replace("Missing Mustache data property","Unknown property")}`:r="Unknown error expanding placeholders.",r+=`
1 year ago
The problem is in:
3 days ago
${n}`,Error(r)}}var FU=new RegExp(["\\{\\{","(.*?)","\\}\\}"].join(""),"g");function LU(n,t){return n.replace(FU,(e,r)=>{let i=UU(t),s=_u(i,r);if(s.isValid()){let a=vu(s.queryComponent,i);if(a!==void 0)return a}return e})}function UU(n){return Object.entries(n)}function aD(n){return Hy(n,[])}function Hy(n,t){return{query:{file:n,allTasks:t}}}nn();var ao=class{constructor(t=""){this.indentation=t}explainQuery(t){if(t.error!==void 0)return this.explainError(t);let e=[];return e.push(this.explainFilters(t)),e.push(this.explainGroups(t)),e.push(this.explainSorters(t)),e.push(this.explainQueryLimits(t)),e.push(this.explainDebugSettings()),e.filter(r=>r!=="").join(`
2 months ago
`)}explainError(t){let e="";return e+=`Query has an error:
`,e+=t.error+`
`,e}explainFilters(t){return t.filters.length===0?this.indent(`No filters supplied. All tasks will match the query.
`):t.filters.map(e=>e.explainFilterIndented(this.indentation)).join(`
3 days ago
`)}explainGroups(t){return t.grouping.length===0?"":t.grouping.map(e=>e.statement.explainStatement(this.indentation)).join(`
3 months ago
`)+`
3 days ago
`}explainSorters(t){return t.sorting.length===0?"":t.sorting.map(e=>e.statement.explainStatement(this.indentation)).join(`
3 months ago
`)+`
3 days ago
`}explainQueryLimits(t){function e(i){let s=`At most ${i} task`;return i!==1&&(s+="s"),s}let r=[];if(t.limit!==void 0){let i=e(t.limit)+`.
`;r.push(this.indent(i))}if(t.taskGroupLimit!==void 0){let i=e(t.taskGroupLimit)+` per group (if any "group by" options are supplied).
`;r.push(this.indent(i))}return r.join(`
`)}explainDebugSettings(){let t="",{debugSettings:e}=le();return e.ignoreSortInstructions&&(t+=this.indent(`NOTE: All sort instructions, including default sort order, are disabled, due to 'ignoreSortInstructions' setting.
`)),t}indent(t){return this.indentation+t}};Cn();var Ye=class{constructor(t,e=[],r=""){this.description=t,this.symbol=r,this.children=e}static booleanAnd(t){return this.combineOrCreateExplanation("All of",t,"AND")}static booleanOr(t){return this.combineOrCreateExplanation("At least one of",t,"OR")}static booleanNot(t){return new Ye("None of",t,"NOT")}static booleanXor(t){return new Ye("Exactly one of",t,"XOR")}asString(t=""){if(this.children.length==0)return t+this.description;let e=t;this.symbol===""?e+=this.description:(e+=this.symbol,this.children.length>1&&(e+=` (${this.description})`),e+=":");let r=t+" ";for(let i=0;i<this.children.length;i++)e+=`
${this.children[i].asString(r)}`;return e}static combineOrCreateExplanation(t,e,r){if(e.length===2){let i=e[0],s=e[1];if(i.symbol===r&&s.symbol==="")return i.children.push(s),i}return new Ye(t,e,r)}};var oo=class{matchesAnyOf(t){return t.some(e=>this.matches(e))}};var lo=class extends oo{constructor(e){super();this.stringToFind=e}matches(e){return lo.stringIncludesCaseInsensitive(e,this.stringToFind)}static stringIncludesCaseInsensitive(e,r){return e.toLocaleLowerCase().includes(r.toLocaleLowerCase())}explanation(e){return new Ye(e)}};var Qi=class extends oo{constructor(e){super();this.regex=e}static validateAndConstruct(e){let r=/^\/(.+)\/([^/]*)$/,i=e.match(r);if(i!==null){let s=new RegExp(i[1],i[2]);return new Qi(s)}else return null}matches(e){return e.match(this.regex)!==null}static helpMessage(){return String.raw`See https://publish.obsidian.md/tasks/Queries/Regular+Expressions
2 years ago
Regular expressions must look like this:
/pattern/
or this:
/pattern/flags
Where:
- pattern: The 'regular expression' pattern to search for.
- flags: Optional characters that modify the search.
i => make the search case-insensitive
u => add Unicode support
Examples: /^Log/
/^Log/i
/File Name\.md/
/waiting|waits|waited/i
/\d\d:\d\d/
The following characters have special meaning in the pattern:
to find them literally, you must add a \ before them:
[\^$.|?*+()
CAUTION! Regular expression (or 'regex') searching is a powerful
but advanced feature that requires thorough knowledge in order to
use successfully, and not miss intended search results.
3 days ago
`}explanation(e){let i=jU(e,"using regex: ",this.regexAsString());return new Ye(i)}regexAsString(){let e=`'${this.regex.source}' with `;switch(this.regex.flags.length){case 0:e+="no flags";break;case 1:e+=`flag '${this.regex.flags}'`;break;default:e+=`flags '${this.regex.flags}'`;break}return e}};function jU(n,t,e){var o;let r=n.match(/\//);if(!r)return"Error explaining instruction. Could not find a slash character";let i=2,s=((o=r.index)!=null?o:i)-i;return`${t.padEnd(s)}${e}`}var gn=class{constructor(t,e){this._rawInstruction=t,this._anyContinuationLinesRemoved=e.trim(),this._anyPlaceholdersExpanded=this._anyContinuationLinesRemoved}recordExpandedPlaceholders(t){this._anyPlaceholdersExpanded=t}get rawInstruction(){return this._rawInstruction}get anyContinuationLinesRemoved(){return this._anyContinuationLinesRemoved}get anyPlaceholdersExpanded(){return this._anyPlaceholdersExpanded}explainStatement(t){function e(a,o){o!==a&&(s+=` =>
${t}${o}`)}let r=this._rawInstruction.trim(),i=r.split(`
11 months ago
`).join(`
2 months ago
`+t),s=`${t}${i}`;return this._rawInstruction.includes(`
11 months ago
`)&&(s+=`
3 days ago
`+t),e(r,this._anyContinuationLinesRemoved),e(this._anyContinuationLinesRemoved,this._anyPlaceholdersExpanded),s}allLinesIdentical(){return this._rawInstruction===this._anyContinuationLinesRemoved&&this._rawInstruction===this._anyPlaceholdersExpanded}};var Mr=class{constructor(t,e,r,i){this._statement=new gn(t,t),this.property=e,this.comparator=Mr.maybeReverse(i,r)}setStatement(t){this._statement=t}get statement(){return this._statement}get instruction(){return this._statement.anyPlaceholdersExpanded}static maybeReverse(t,e){return t?Mr.makeReversedComparator(e):e}static makeReversedComparator(t){return(e,r,i)=>t(e,r,i)*-1}};iu();var Xi=class{constructor(t,e,r,i){this._statement=new gn(t,t),this.property=e,this.grouper=r,this.reverse=i}setStatement(t){this._statement=t}get statement(){return this._statement}get instruction(){return this._statement.anyPlaceholdersExpanded}};var $e=class{canCreateFilterForLine(t){return $e.lineMatchesFilter(this.filterRegExp(),t)}static lineMatchesFilter(t,e){return t?t.test(e):!1}static getMatch(t,e){return t?e.match(t):null}fieldNameSingular(){return this.fieldName()}fieldNameSingularEscaped(){return Yi(this.fieldNameSingular())}supportsSorting(){return!1}createSorterFromLine(t){if(!this.supportsSorting())return null;let e=$e.getMatch(this.sorterRegExp(),t);if(e===null)return null;let r=!!e[1];return this.createSorter(r)}sorterRegExp(){if(!this.supportsSorting())throw Error(`sorterRegExp() unimplemented for ${this.fieldNameSingular()}`);return new RegExp(`^sort by ${this.fieldNameSingularEscaped()}( reverse)?`,"i")}sorterInstruction(t){let e=`sort by ${this.fieldNameSingular()}`;return t&&(e+=" reverse"),e}comparator(){throw Error(`comparator() unimplemented for ${this.fieldNameSingular()}`)}createSorter(t){return new Mr(this.sorterInstruction(t),this.fieldNameSingular(),this.comparator(),t)}createNormalSorter(){return this.createSorter(!1)}createReverseSorter(){return this.createSorter(!0)}supportsGrouping(){return!1}createGrouperFromLine(t){if(!this.supportsGrouping())return null;let e=$e.getMatch(this.grouperRegExp(),t);if(e===null)return null;let r=!!e[1];return this.createGrouper(r)}grouperRegExp(){if(!this.supportsGrouping())throw Error(`grouperRegExp() unimplemented for ${this.fieldNameSingular()}`);return new RegExp(`^group by ${this.fieldNameSingularEscaped()}( reverse)?$`,"i")}grouperInstruction(t){let e=`group by ${this.fieldNameSingular()}`;return t&&(e+=" reverse"),e}grouper(){throw Error(`grouper() unimplemented for ${this.fieldNameSingular()}`)}createGrouper(t){return new Xi(this.grouperInstruction(t),this.fieldNameSingular(),this.grouper(),t)}createNormalGrouper(){return this.createGrouper(!1)}createReverseGrouper(){return this.createGrouper(!0)}};var Bt=class{constructor(t,e,r){this._statement=new gn(t,t),this.explanation=r,this.filterFunction=e}get statement(){return this._statement}setStatement(t){this._statement=t}get instruction(){return this._statement.anyPlaceholdersExpanded}explainFilterIndented(t){let e=this._statement.explainStatement(t);return this.onlyNeedsOneLineExplanation()?`${e}
2 months ago
`:`${e} =>
${this.explanation.asString(t+" ")}
3 days ago
`}simulateExplainFilter(){return this.onlyNeedsOneLineExplanation()?this.explanation:new Ye(this.instruction+" =>",[this.explanation])}onlyNeedsOneLineExplanation(){return this.explanation.asString("")===this.instruction}};var ke=class{constructor(t){this.object=t}get instruction(){return this.object.instruction}get filter(){return this.object.queryComponent}isValid(){return this.object.isValid()}get error(){return this.object.error}get filterFunction(){if(this.filter)return this.filter.filterFunction}static fromFilter(t){return new ke(Xr.fromObject(t.instruction,t))}static fromError(t,e){return new ke(Xr.fromError(t,e))}};var Ze=class extends $e{createFilterOrErrorMessage(t){let e=$e.getMatch(this.filterRegExp(),t);if(e===null)return ke.fromError(t,`do not understand query filter (${this.fieldName()})`);let r=e[1].toLowerCase(),i=e[2],s=null;if(r.includes("include"))s=new lo(i);else if(r.includes("regex")){try{s=Qi.validateAndConstruct(i)}catch(l){let u=Xs("Parsing regular expression",l)+`
2 years ago
3 days ago
${Qi.helpMessage()}`;return ke.fromError(t,u)}if(s===null)return ke.fromError(t,`Invalid instruction: '${t}'
12 months ago
3 days ago
${Qi.helpMessage()}`)}if(s===null)return ke.fromError(t,`do not understand query filter (${this.fieldName()})`);let a=r.match(/not/)!==null,o=new Bt(t,this.getFilter(s,a),s.explanation(t));return ke.fromFilter(o)}fieldPattern(){return this.fieldNameSingularEscaped()}filterOperatorPattern(){return"includes|does not include|regex matches|regex does not match"}filterRegExp(){return new RegExp(`^(?:${this.fieldPattern()}) (${this.filterOperatorPattern()}) (.*)`,"i")}getFilter(t,e){return r=>{let i=t.matches(this.value(r));return e?!i:i}}comparator(){return(t,e)=>this.value(t).localeCompare(this.value(e),void 0,{numeric:!0})}grouper(){return t=>[this.value(t)]}static escapeMarkdownCharacters(t){return t.replace(/\\/g,"\\\\").replace(/_/g,"\\_")}};var Zs=class extends Ze{fieldName(){return"description"}value(t){return Fe.getInstance().removeAsSubstringFrom(t.description)}supportsSorting(){return!0}comparator(){return(t,e)=>{let r=Zs.cleanDescription(t.description),i=Zs.cleanDescription(e.description);return r.localeCompare(i,void 0,{numeric:!0})}}static cleanDescription(t){t=Fe.getInstance().removeAsSubstringFrom(t);let e=/^\[\[?([^\]]*)]]?/,r=t.match(e);if(r!==null){let i=r[1];t=i.substring(i.indexOf("|")+1)+t.replace(e,"")}return t=this.replaceFormatting(t,/^\*\*([^*]+)\*\*/),t=this.replaceFormatting(t,/^\*([^*]+)\*/),t=this.replaceFormatting(t,/^==([^=]+)==/),t=this.replaceFormatting(t,/^__([^_]+)__/),t=this.replaceFormatting(t,/^_([^_]+)_/),t}static replaceFormatting(t,e){let r=t.match(e);return r!==null&&(t=r[1]+t.replace(e,"")),t}};Rg();Ag();Cs();var Ed=class{findUnexpandedDateText(t){let e=["<%","YYYY-MM-DD"];for(let r of e)if(t.includes(r))return this.unexpandedDateTextMessage(r);return null}unexpandedDateTextMessage(t){return`Instruction contains unexpanded template text: "${t}" - and cannot be interpreted.
12 months ago
Possible causes:
- The query is an a template file, and is not intended to be searched.
- A command such as "Replace templates in the active file" needs to be run.
- The core "Daily notes" plugin is in use, and the template contained
date calculations that it does not support.
- Some sample template text was accidentally pasted in to a tasks query,
instead of in to a template file.
2 years ago
3 days ago
See: https://publish.obsidian.md/tasks/Advanced/Daily+Agenda#Instruction+contains+unexpanded+template+text
`}};var Dd=class{constructor(t,e){this._instruction=t,this._filter=e}canCreateFilterForLine(t){return t.toLocaleLowerCase()===this._instruction.toLocaleLowerCase()}createFilterOrErrorMessage(t){return this.canCreateFilterForLine(t)?ke.fromFilter(new Bt(t,this._filter,new Ye(t))):ke.fromError(t,`do not understand filter: ${t}`)}};var yn=class{constructor(){this._filters=[]}add(t,e){this._filters.push(new Dd(t,e))}canCreateFilterForLine(t){return this._filters.some(e=>e.canCreateFilterForLine(t))}createFilterOrErrorMessage(t){for(let e of this._filters){let r=e.createFilterOrErrorMessage(t);if(r.isValid())return r}return ke.fromError(t,`do not understand filter: ${t}`)}};var Dt=class extends $e{constructor(e=null){super();e!==null?this.filterInstructions=e:(this.filterInstructions=new yn,this.filterInstructions.add(`has ${this.fieldName()} date`,r=>this.date(r)!==null),this.filterInstructions.add(`no ${this.fieldName()} date`,r=>this.date(r)===null),this.filterInstructions.add(`${this.fieldName()} date is invalid`,r=>{let i=this.date(r);return i!==null&&!i.isValid()}))}canCreateFilterForLine(e){return this.filterInstructions.canCreateFilterForLine(e)?!0:super.canCreateFilterForLine(e)}createFilterOrErrorMessage(e){var f;let r=this.checkForUnexpandedTemplateText(e);if(r)return ke.fromError(e,r);let i=this.filterInstructions.createFilterOrErrorMessage(e);if(i.isValid())return i;let s=$e.getMatch(this.filterRegExp(),e);if(s===null)return ke.fromError(e,"do not understand query filter ("+this.fieldName()+" date)");let a=s[1],o=(f=s[2])==null?void 0:f.toLowerCase(),l=s[3],u=Dn.parseDateRange(l);if(!u.isValid()){let p=Dn.parseDate(a);p.isValid()&&(u=new Jt(p,p))}if(!u.isValid())return ke.fromError(e,"do not understand "+this.fieldName()+" date");let c=this.buildFilterFunction(o,u),d=Dt.buildExplanation(this.fieldNameForExplanation(),o,this.filterResultIfFieldMissing(),u);return ke.fromFilter(new Bt(e,c,d))}buildFilterFunction(e,r){let i;switch(e){case"before":i=s=>s?s.isBefore(r.start):this.filterResultIfFieldMissing();break;case"after":i=s=>s?s.isAfter(r.end):this.filterResultIfFieldMissing();break;case"on or before":case"in or before":i=s=>s?s.isSameOrBefore(r.end):this.filterResultIfFieldMissing();break;case"on or after":case"in or after":i=s=>s?s.isSameOrAfter(r.start):this.filterResultIfFieldMissing();break;default:i=s=>s?s.isSameOrAfter(r.start)&&s.isSameOrBefore(r.end):this.filterResultIfFieldMissing()}return this.getFilter(i)}getFilter(e){return r=>e(this.date(r))}filterRegExp(){return new RegExp(`^${this.fieldNameForFilterInstruction()} (((?:on|in) or before|before|(?:on|in) or after|after|on|in)? ?(.*))`,"i")}fieldNameForFilterInstruction(){return this.fieldName()}static buildExplanation(e,r,i,s){let a=r,o="YYYY-MM-DD (dddd Do MMMM YYYY)",l;switch(r){case"before":case"on or after":l=s.start.format(o);break;case"after":case"on or before":l=s.end.format(o);break;case"in or before":a="on or before",l=s.end.format(o);break;case"in or after":a="on or after",l=s.start.format(o);break;default:if(!s.start.isSame(s.end)){let c=`${e} date is between:`,d=[new Ye(`${s.start.format(o)} and`),new Ye(`${s.end.format(o)} inclusive`)];return i&&d.push(new Ye(`OR no ${e} date`)),new Ye(c,d)}a="on",l=s.start.format(o);break}let u=`${e} date is ${a} ${l}`;return i&&(u+=` OR no ${e} date`),new Ye(u)}fieldNameForExplanation(){return this.fieldName()}supportsSorting(){return!0}comparator(){return(e,r)=>zn(this.date(e),this.date(r))}supportsGrouping(){return!0}grouper(){return e=>{let r=this.date(e);return r===null?["No "+this.fieldName()+" date"]:r.isValid()?[r.format("YYYY-MM-DD dddd")]:["%%0%% Invalid "+this.fieldName()+" date"]}}checkForUnexpandedTemplateText(e){return new Ed().findUnexpandedDateText(e)}};var Od=class extends Dt{fieldName(){return"created"}date(t){return t.createdDate}filterResultIfFieldMissing(){return!1}};var xd=class extends Dt{fieldName(){return"done"}date(t){return t.doneDate}filterResultIfFieldMissing(){return!1}};var uo=class extends Dt{fieldName(){return"due"}date(t){return t.dueDate}filterResultIfFieldMissing(){
10 months ago
The instruction was converted to the following simplified line:
${i.simplifiedLine}
Where the sub-expressions in the simplified line are:
${a}
For help, see:
https://publish.obsidian.md/tasks/Queries/Combining+Filters
3 days ago
`;return ke.fromError(e,l)}stringifySubExpressionsForErrorMessage(e){return Object.entries(e).map(([r,i])=>` '${r}': '${i}'
10 months ago
=> ${this.stringifySubExpressionStatus(i)}`).join(`
3 days ago
`)}stringifySubExpressionStatus(e){let r=Su(e);return r?r.error?`ERROR:
${r.error.split(`
10 months ago
`).map(s=>s.trim()).join(`
`)}`:"OK":`ERROR:
3 days ago
do not understand query`}helpMessageFromSimpleError(e,r){return`Could not interpret the following instruction as a Boolean combination:
2 months ago
${e}
10 months ago
The error message is:
3 days ago
${r}`}};var Yd=class extends Ze{fieldName(){return"filename"}value(t){let e=t.filename;return e===null?"":e+".md"}supportsSorting(){return!0}supportsGrouping(){return!0}grouper(){return t=>{let e=t.filename;return e===null?["Unknown Location"]:["[["+e+"]]"]}}};var To=class extends $e{canCreateFilterForLine(t){return!1}createFilterOrErrorMessage(t){return ke.fromError(t,"Filtering by urgency is not yet supported")}fieldName(){return"urgency"}filterRegExp(){throw Error(`filterRegExp() unimplemented for ${this.fieldName()}`)}supportsSorting(){return!0}comparator(){return(t,e)=>e.urgency-t.urgency}supportsGrouping(){return!0}grouper(){return t=>[`${t.urgency.toFixed(2)}`]}createGrouper(t){return super.createGrouper(!t)}grouperInstruction(t){return super.grouperInstruction(!t)}};var Hd=class extends Ze{constructor(){super()}fieldName(){return"status.name"}value(t){return t.status.name}supportsSorting(){return!0}supportsGrouping(){return!0}};Jn();var ti=class extends $e{canCreateFilterForLine(t){let e=new RegExp(`^(?:${this.fieldNameSingularEscaped()})`,"i");return $e.lineMatchesFilter(e,t)}createFilterOrErrorMessage(t){let e=$e.getMatch(this.filterRegExp(),t);if(e===null)return this.helpMessage(t);let r=e[1].toLowerCase(),i=e[2],s=tn[i.toUpperCase()];if(!s)return this.helpMessage(t);let a;switch(r){case"is":a=o=>o.status.type===s;break;case"is not":a=o=>o.status.type!==s;break;default:return this.helpMessage(t)}return ke.fromFilter(new Bt(t,a,new Ye(t)))}filterRegExp(){return new RegExp(`^(?:${this.fieldNameSingularEscaped()}) (is|is not) ([^ ]+)$`,"i")}helpMessage(t){let e=Object.values(tn).filter(i=>i!=="EMPTY").join(" "),r=`Invalid ${this.fieldNameSingular()} instruction: '${t}'.
12 months ago
Allowed options: 'is' and 'is not' (without quotes).
2 months ago
Allowed values: ${e}
12 months ago
Note: values are case-insensitive,
so 'in_progress' works too, for example.
3 days ago
Example: ${this.fieldNameSingular()} is not NON_TASK`;return ke.fromError(t,r)}fieldName(){return"status.type"}value(t){return t.status.type}supportsSorting(){return!0}comparator(){return(t,e)=>{let r=ti.groupName(t),i=ti.groupName(e);return r.localeCompare(i,void 0,{numeric:!0})}}supportsGrouping(){return!0}grouper(){return t=>[ti.groupName(t)]}static groupName(t){return t.status.typeGroupText}};var Gd=class extends Ze{fieldName(){return"recurrence"}value(t){return t.recurrence!==null?t.recurrence.toText():""}supportsGrouping(){return!0}grouper(){return t=>t.recurrence!==null?[t.recurrence.toText()]:["None"]}};var Bd=class extends Ze{fieldName(){return"folder"}value(t){return t.file.folder}supportsGrouping(){return!0}grouper(){return t=>[Ze.escapeMarkdownCharacters(this.value(t))]}};var Vd=class extends Ze{fieldName(){return"root"}value(t){return t.file.root}supportsGrouping(){return!0}grouper(){return t=>[Ze.escapeMarkdownCharacters(this.value(t))]}};var zd=class extends Ze{fieldName(){return"backlink"}value(t){let e=t.getLinkText({isFilenameUnique:!0});return e===null?"Unknown Location":e}createFilterOrErrorMessage(t){return ke.fromError(t,"backlink field does not support filtering")}canCreateFilterForLine(t){return!1}supportsGrouping(){return!0}grouper(){return t=>{let e=t.filename;if(e===null)return["Unknown Location"];let r=t.precedingHeader;return r===null?["[["+e+"]]"]:[`[[${e}#${r}|${e} > ${r}]]`]}}};var Kd=class extends Dt{fieldName(){return"cancelled"}date(t){return t.cancelledDate}filterResultIfFieldMissing(){return!1}};var Qd=class extends lr{constructor(){super(),this._filters.add("is blocking",(t,e)=>t.isBlocking(e.allTasks)),this._filters.add("is not blocking",(t,e)=>!t.isBlocking(e.allTasks)),this._filters.add("is blocked",(t,e)=>t.isBlocked(e.allTasks)),this._filters.add("is not blocked",(t,e)=>!t.isBlocked(e.allTasks))}fieldName(){return"blocking"}};var Xd=class extends Ze{constructor(){super();this.filterInstructions=new yn;this.filterInstructions.add("has id",e=>e.id.length>0),this.filterInstructions.add("no id",e=>e.id.length===0)}canCreateFilterForLine(e){return this.filterInstructions.canCreateFilterForLine(e)?!0:super.canCreateFilterForLine(e)}createFilterOrErrorMessage(e){let r=this.filterInstructions.createFilterOrErrorMessage(e);return r.isValid()?r:super.createFilterOrErrorMessage(e)}fieldName(){return"id"}value(e){return e.id}supportsSorting(){return!0}supportsGrouping(){return!0}};var Zd=class extends $e{constructor(){super();this.filterInstructions=new yn;this.filterInstructions.add("has depends on",e=>e.dependsOn.length>0),this.filterInstructions.add("no depends on",e=>e.dependsOn.length===0)}canCreateFilterForLine(e){return this.filterInstructions.canCreateFilterForLine(e)?!0:super.canCreateFilterForLine(e)}createFilterOrErrorMessage(e){let r=this.filterInstructions.createFilterOrErrorMessage(e);return r.isValid()?r:ke.fromError(e,"Unknown instruction")}fieldName(){return"blocked by"}filterRegExp(){return null}};var Jd=class extends lr{fieldName(){return"random"}supportsSorting(){return!0}comparator(){return(t,e)=>this.sortKey(t)-this.sortKey(e)}sortKey(t){let e=i=>{let s=0,a=9;for(;s<i.length;)a=Math.imul(a^i.charCodeAt(s++),387420489);return a^a>>>9},r=window.moment().format("Y-MM-DD");return e(r+" "+t.description)}};var rb=[()=>new Hd,()=>new ti,()=>new Zi,()=>new Fd,()=>new Js,()=>new Id,()=>new Kd,()=>new Od,()=>new Nd,()=>new Pd,()=>new uo,()=>new xd,()=>new co,()=>new Bd,()=>new Vd,()=>new zd,()=>new Zs,()=>new ea,()=>new Ad,()=>new Cd,()=>new Yd,()=>new To,()=>new Gd,()=>new Rd,()=>new Xd,()=>new Zd,()=>new Qd,()=>new Jd,()=>new qd];function Su(n){for(let t of rb){let e=t();if(e.canCreateFilterForLine(n))return e.createFilterOrErrorMessage(n)}return null}function wD(n){let t=/^sort by /i;if(n.match(t)===null)return null;for(let e of rb){let i=e().createSorterFromLine(n);if(i)return i}return null}function kD(n){let t=/^group by /i;if(n.match(t)===null)return null;for(let e of rb){let i=e().createGrouperFromLine(n);if(i)return i}return null}var ef=class{constructor(t,e
2 months ago
`;return t}toString(){let t=`
`;t+=`Group names: [${this.groups}]
`;for(let e of this.groupHeadings)t+=`${"#".repeat(4+e.nestingLevel)} [${e.property}] ${e.displayName}
3 days ago
`;return t+=this.tasksAsStringOfLines(),t}};var _o=class{constructor(t,e,r){this._groups=new Array;this._totalTaskCount=0;this._totalTaskCount=e.length,this._groupers=t;let s=new sf(t,e,r).generateTaskTreeStorage();this.addTaskGroups(s),this.sortTaskGroups(),this.setGroupsHeadings(s)}get groupers(){return this._groupers}get groups(){return this._groups}totalTasksCount(){return this._totalTaskCount}toString(){let t="";t+=`Groupers (if any):
`;for(let r of this._groupers){let i=r.reverse?" reverse":"";t+=`- ${r.property}${i}
`}for(let r of this.groups)t+=r.toString(),t+=`
3 years ago
---
2 months ago
`;return t+=`
3 years ago
${this.totalTasksCount()} tasks
3 days ago
`,t}addTaskGroups(t){for(let[e,r]of t){let i=new af(e,r);this.addTaskGroup(i)}}addTaskGroup(t){this._groups.push(t)}sortTaskGroups(){let t=(e,r)=>{let i=e.groups,s=r.groups;for(let a=0;a<i.length;a++){let o=this._groupers[a],l=i[a].localeCompare(s[a],void 0,{numeric:!0});if(l!==0)return o.reverse?-l:l}return 0};this._groups.sort(t)}setGroupsHeadings(t){let e=new tf(t,this._groupers);for(let r of this._groups)r.setGroupHeadings(e.getHeadingsForTaskGroup(r.groups))}applyTaskLimit(t){this._groupers.length!==0&&(this._groups.forEach(e=>{e.applyTaskLimit(t)}),this.recalculateTotalTaskCount())}recalculateTotalTaskCount(){let t=[];this._groups.forEach(r=>{t=[...t,...r.tasks]});let e=[...new Set(t)];this._totalTaskCount=e.length}};var ts=class{constructor(t,e){this.tasksFile=t,this.allTasks=[...e]}static fromAllTasks(t){return new ts(void 0,t)}get queryPath(){var t,e;return(e=(t=this.tasksFile)==null?void 0:t.path)!=null?e:void 0}queryContext(){return this.tasksFile?Hy(this.tasksFile,this.allTasks):void 0}};function SD(n){return`task${n!==1?"s":""}`}var ra=class{constructor(t,e){this.totalTasksCountBeforeLimit=0;this._searchErrorMessage=void 0;this.taskGroups=t,this.totalTasksCountBeforeLimit=e}get searchErrorMessage(){return this._searchErrorMessage}set searchErrorMessage(t){this._searchErrorMessage=t}get totalTasksCount(){return this.taskGroups.totalTasksCount()}totalTasksCountDisplayText(){let t=this.totalTasksCount,e=this.totalTasksCountBeforeLimit;return t===e?`${t} ${SD(t)}`:`${t} of ${e} ${SD(e)}`}get groups(){return this.taskGroups.groups}static fromError(t){let e=new ra(new _o([],[],ts.fromAllTasks([])),0);return e._searchErrorMessage=t,e}};function ED(n){return n.endsWith("\\")}function DD(n){return n.endsWith("\\\\")}function yj(n){return n.replace(/^[ \t]*/,"")}function bj(n){return n.replace(/[ \t]*\\$/,"")}function Tj(n,t){let e=n;return t&&(e=yj(n)),DD(e)?e=e.slice(0,-1):ED(n)&&(e=bj(e)),e}function OD(n){let t=[],e=!1,r="",i="",s=n+`
3 months ago
`;for(let a of s.split(`
3 days ago
`)){let o=Tj(a,e);e?(r+=`
`+a,i+=" "+o):(r=a,i=o),DD(a)?e=!1:e=ED(a),e||(i.trim()!==""&&t.push(new gn(r,i)),r="",i="")}return t}var vo=class{static by(t,e,r){let i=this.defaultSorters().map(a=>a.comparator),s=[];for(let a of t)s.push(a.comparator);return e.sort(vo.makeCompositeComparator([...s,...i],r))}static defaultSorters(){return[new ti().createNormalSorter(),new To().createNormalSorter(),new uo().createNormalSorter(),new Js().createNormalSorter(),new co().createNormalSorter()]}static makeCompositeComparator(t,e){return(r,i)=>{for(let s of t){let a=s(r,i,e);if(a!==0)return a}return 0}}};var xD=0,In=class{constructor(t,e=void 0){this.statements=[];this._limit=void 0;this._taskGroupLimit=void 0;this._taskLayoutOptions=new Gr;this._queryLayoutOptions=new Ki;this._filters=[];this._error=void 0;this._sorting=[];this._grouping=[];this._ignoreGlobalQuery=!1;this.hideOptionsRegexp=/^(hide|show) +(.*)/i;this.shortModeRegexp=/^short/i;this.fullModeRegexp=/^full/i;this.explainQueryRegexp=/^explain/i;this.ignoreGlobalQueryRegexp=/^ignore global query/i;this.logger=rn.getLogger("tasks.Query");this.limitRegexp=/^limit (groups )?(to )?(\d+)( tasks?)?/i;this.commentRegexp=/^#.*/;this._queryId=this.generateQueryId(10),this.source=t,this.tasksFile=e;let r=OD(t);for(let i of r){let s=this.expandPlaceholders(i,e);if(this.error!==void 0)return;this.statements.push(...s)}for(let i of this.statements)try{if(this.parseLine(i),this.error!==void 0)return}catch(s){let a;s instanceof Error?a=s.message:a="Unknown error",this.setError(a,i);return}}get filePath(){var t,e;return(e=(t=this.tasksFile)==null?void 0:t.path)!=null?e:void 0}get queryId(){return this._queryId}parseLine(t){let e=t.anyPlaceholdersExpanded;switch(!0){case this.shortModeRegexp.test(e):this._queryLayoutOptions.shortMode=!0;break;case this.fullModeRegexp.test(e):this._queryLayoutOptions.shortMode=!1;break;case this.explainQueryRegexp.test(e):this._queryLayoutOptions.explainQuery=!0;break;case this.ignoreGlobalQueryRegexp.test(e):this._ignoreGlobalQuery=!0;break;case this.limitRegexp.test(e):this.parseLimit(e);break;case this.parseSortBy(e,t):break;case this.parseGroupBy(e,t):break;case this.hideOptionsRegexp.test(e):this.parseHideOptions(e);break;case this.commentRegexp.test(e):break;case this.parseFilter(e,t):break;default:this.setError("do not understand query",t)}}formatQueryForLogging(){return`
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
${this.source}
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
`}expandPlaceholders(t,e){let r=t.anyContinuationLinesRemoved;if(r.includes("{{")&&r.includes("}}")&&this.tasksFile===void 0)return this._error=`The query looks like it contains a placeholder, with "{{" and "}}"
1 year ago
but no file path has been supplied, so cannot expand placeholder values.
The query is:
3 days ago
${r}`,[t];let i=r;if(e){let s=aD(e);try{i=sD(r,s)}catch(a){return a instanceof Error?this._error=a.message:this._error="Internal error. expandPlaceholders() threw something other than Error.",[t]}}return this.createStatementsFromExpandedPlaceholders(i,t)}createStatementsFromExpandedPlaceholders(t,e){let r=t.split(`
`).map(i=>i.trim()).filter(i=>i.length>0);return r.length===1?(e.recordExpandedPlaceholders(r[0]),[e]):r.map((i,s)=>{let a=`: statement ${s+1} after expansion of placeholder`,o=new gn(e.rawInstruction+a,e.anyContinuationLinesRemoved+a);return o.recordExpandedPlaceholders(i),o})}append(t){return this.source===""?t:t.source===""?this:new In(`${this.source}
${t.source}`,this.tasksFile)}explainQuery(){return new ao().explainQuery(this)}get limit(){return this._limit}get taskGroupLimit(){return this._taskGroupLimit}get taskLayoutOptions(){return this._taskLayoutOptions}get queryLayoutOptions(){return this._queryLayoutOptions}get filters(){return this._filters}addFilter(t){this._filters.push(t)}get sorting(){return this._sorting}get grouping(){return this._grouping}get error(){return this._error}setError(t,e){this._error=In.generateErrorMessage(e,t)}static generateErrorMessage(t,e){return t.allLinesIdentical()?`${e}
2 months ago
Problem line: "${t.rawInstruction}"`:`${e}
10 months ago
Problem statement:
2 months ago
${t.explainStatement(" ")}
3 days ago
`}get ignoreGlobalQuery(){return this._ignoreGlobalQuery}applyQueryToTasks(t){this.debug(`[search] Executing query: ${this.formatQueryForLogging()}`);let e=new ts(this.tasksFile,t),r;try{this.filters.forEach(l=>{r=l.statement,t=t.filter(u=>l.filterFunction(u,e))}),r=void 0;let{debugSettings:i}=le(),s=i.ignoreSortInstructions?t:vo.by(this.sorting,t,e),a=s.slice(0,this.limit),o=new _o(this.grouping,a,e);return this._taskGroupLimit!==void 0&&o.applyTaskLimit(this._taskGroupLimit),new ra(o,s.length)}catch(i){let a=Xs("Search failed",i);return r&&(a=In.generateErrorMessage(r,a)),ra.fromError(a)}}parseHideOptions(t){let e=t.match(this.hideOptionsRegexp);if(e===null)return;let r=e[1].toLowerCase()==="hide",i=e[2].toLowerCase();XE(this._queryLayoutOptions,i,r)||yS(this._taskLayoutOptions,i,!r)||this.setError("do not understand hide/show option",new gn(t,t))}parseFilter(t,e){var i;let r=Su(t);return r!=null?(r.filter?(r.filter.setStatement(e),this._filters.push(r.filter)):this.setError((i=r.error)!=null?i:"Unknown error",e),!0):!1}parseLimit(t){let e=t.match(this.limitRegexp);if(e===null){this.setError("do not understand query limit",new gn(t,t));return}let r=Number.parseInt(e[3],10);e[1]!==void 0?this._taskGroupLimit=r:this._limit=r}parseSortBy(t,e){let r=wD(t);return r?(r.setStatement(e),this._sorting.push(r),!0):!1}parseGroupBy(t,e){let r=kD(t);return r?(r.setStatement(e),this._grouping.push(r),!0):!1}generateQueryId(t){return xD+=1,xD.toString().padStart(t,"0")}debug(t,e){this.logger.debugWithId(this._queryId,`"${this.filePath}": ${t}`,e)}};var ib=[{name:"TQ_explain",type:"checkbox",display:"explain",handler:"instruction",trueValue:"explain",falseValue:""},{name:"TQ_short_mode",type:"checkbox",display:"short mode",handler:"instruction",trueValue:"short mode",falseValue:"full mode"},{name:"TQ_show_tree",type:"checkbox",display:"tree",handler:"showAndHide"},{name:"TQ_show_tags",type:"checkbox",display:"tags",handler:"showAndHide"},{name:"TQ_show_id",type:"checkbox",display:"id",handler:"showAndHide"},{name:"TQ_show_depends_on",type:"checkbox",display:"depends on",handler:"showAndHide"},{name:"TQ_show_priority",type:"checkbox",display:"priority",handler:"showAndHide"},{name:"TQ_show_recurrence_rule",type:"checkbox",display:"recurrence rule",handler:"showAndHide"},{name:"TQ_show_on_completion",type:"checkbox",display:"on completion",handler:"showAndHide"},{name:"TQ_show_created_date",type:"checkbox",display:"created date",handler:"showAndHide"},{name:"TQ_show_start_date",type:"checkbox",display:"start date",handler:"showAndHide"},{name:"TQ_show_scheduled_date",type:"checkbox",display:"scheduled date",handler:"showAndHide"},{name:"TQ_show_due_date",type:"checkbox",display:"due date",handler:"showAndHide"},{name:"TQ_show_cancelled_date",type:"checkbox",display:"cancelled date",handler:"showAndHide"},{name:"TQ_show_done_date",type:"checkbox",display:"done date",handler:"showAndHide"},{name:"TQ_show_urgency",type:"checkbox",display:"urgency",handler:"showAndHide"},{name:"TQ_show_backlink",type:"checkbox",display:"backlink",handler:"showAndHide"},{name:"TQ_show_edit_button",type:"checkbox",display:"edit button",handler:"showAndHide"},{name:"TQ_show_postpone_button",type:"checkbox",display:"postpone button",handler:"showAndHide"},{name:"TQ_show_task_count",type:"checkbox",display:"task count",handler:"showAndHide"},{name:"TQ_extra_instructions",type:"text",handler:"addValue"}],xi=class{source(t){return t?ib.map(r=>this.generateInstruction(t,r)).filter(r=>r!=="").join(`
`):""}generateInstruction(t,e){let r=t.hasProperty(e.name),i=t.property(e.name);switch(e.handler){case"instruction":return r&&(i?e.trueValue:e.falseValue)||"";case"showAndHide":return r&&(i?"show "+e.display:"hide "+e.display)||"";case"addValue":return r&&i||"";default:throw new Error("Unknown handler type: "+e.handler+".")}}query(t){return new In(this.source(t),t)}allPropertyNames(){return ib.map(t=>t.name)}allPropertyNamesSorted(){return this.allPropertyNames().sort((t,e)=>t.localeCompare(e))}propertyType(t){var e,r;return(r=(e=ib.find(i=>i.name===t))==null?void 0:e.type)!=null?r:void 0}metaBindPluginWidgets(){return"\nshort mode: `INPUT[toggle:TQ_short_mode]`\ntree: `INPUT[toggle:TQ_show_tree]`\ntags: `INPUT[toggle:TQ_show_tags]`\nid: `INPUT[toggle:TQ_show_id]` depends on: `INPUT[toggle:TQ_show_depends_on]`\npriority: `INPUT[toggle:TQ_show_priority]`\nrecurrence rule: `INPUT[toggle:TQ_show_recurrence_rule]` on completion: `INPUT[toggle:TQ_show_on_completion]`\nstart date: `INPUT[toggle:TQ_show_start_date]` scheduled date: `INPUT[toggle:TQ_show_scheduled_date]` due date: `INPUT[toggle:TQ_show_due_date]`\ncreated date: `INPUT[toggle:TQ_show_created_date]` cancelled date: `INPUT[toggle:TQ_show_cancelled_date]` done date: `INPUT[toggle:TQ_show_done_date]`\nurgency: `INPUT[toggle:TQ_show_urgency]`\nbacklink: `INPUT[toggle:TQ_show_backlink]`\nedit button: `INPUT[toggle:TQ_show_edit_button]` postpone button: `INPUT[toggle:TQ_show_postpone_button]`\ntask count: `INPUT[toggle:TQ_show_task_count]`\nextra instructions: `INPUT[textArea:TQ_extra_instructions]`\nexplain: `INPUT[toggle:TQ_explain]`\n"}};function CD(n,t){return L(this,null,function*(){yield n.fileManager.processFrontMatter(t,e=>{let r=new xi().allPropertyNamesSorted(),i=!1;r.forEach(s=>{s in e||(e[s]=null,i=!0)}),i?new sb.Notice("Properties updated successfully."):new sb.Notice("All supported properties are already present.")})})}var of=class{get app(){return this.plugin.app}constructor({plugin:t}){this.plugin=t,t.addCommand({id:"edit-task",name:"Create or edit task",icon:"pencil",editorCheckCallback:(e,r,i)=>KE(e,r,i,this.app,this.plugin.getTasks())}),t.addCommand({id:"toggle-done",name:"Toggle task done",icon:"check-in-circle",editorCheckCallback:QE}),t.addCommand({id:"add-query-file-defaults-properties",name:"Add all Query File Defaults properties",icon:"settings",checkCallback:e=>{let r=this.app.workspace.getActiveFile();return!r||r.extension!=="md"?!1:(e||this.ensureQueryFileDefaultsFrontmatter(r).catch(console.error),!0)}})}ensureQueryFileDefaultsFrontmatter(t){return L(this,null,function*(){let{app:e}=this;yield CD(e,t)})}};var ns=class{constructor(t=ns.empty){this._source=t}static getInstance(){return ns.instance||(ns.instance=new ns),ns.instance}set(t){this._source=t}query(t=void 0){return new In(this._source,t)}hasInstructions(){return this._source.trim()!==ns.empty}},dr=ns;dr.empty="";$s();var lf=class{constructor({obsidianEvents:t}){this.logger=rn.getLogger("tasks.Events");this.obsidianEvents=t}onCacheUpdate(t){return this.logger.debug("TasksEvents.onCacheUpdate()"),this.obsidianEvents.on("obsidian-tasks-plugin:cache-update",t)}triggerCacheUpdate(t){this.logger.debug("TasksEvents.triggerCacheUpdate()"),this.obsidianEvents.trigger("obsidian-tasks-plugin:cache-update",t)}onRequestCacheUpdate(t){return this.logger.debug("TasksEvents.onRequestCacheUpdate()"),this.obsidianEvents.on("obsidian-tasks-plugin:request-cache-update",t)}triggerRequestCacheUpdate(t){this.logger.debug("TasksEvents.triggerRequestCacheUpdate()"),this.obsidianEvents.trigger("obsidian-tasks-plugin:request-cache-update",t)}off(t){this.logger.debug("TasksEvents.off()"),this.obsidianEvents.offref(t)}};var e0=require("obsidian");Cn();Is();Nt();var JD=require("obsidian");Cn();nn();Is();wi();Nt();ii();Sr();Ga();var ab=class{constructor(t){this.newStatus=t}apply(t){return this.isCheckedForTask(t)?[t]:t.handleNewStatusWithRecurrenceInUsersOrder(this.newStatus)}instructionDisplayName(){return`Change status to: [${this.newStatus.symbol}] ${this.newStatus.name}`}isCheckedForTask(t){return this.newSta
2 months ago
<span class='flatpickr-weekday'>
`+g.join("</span><span class='flatpickr-weekday'>")+`
</span>
3 days ago
`}}function w(){e.calendarContainer.classList.add("hasWeeks");var h=qe("div","flatpickr-weekwrapper");h.appendChild(qe("span","flatpickr-weekday",e.l10n.weekAbbreviation));var g=qe("div","flatpickr-weeks");return h.appendChild(g),{weekWrapper:h,weekNumbers:g}}function S(h,g){g===void 0&&(g=!0);var k=g?h:h-e.currentMonth;k<0&&e._hidePrevMonthArrow===!0||k>0&&e._hideNextMonthArrow===!0||(e.currentMonth+=k,(e.currentMonth<0||e.currentMonth>11)&&(e.currentYear+=e.currentMonth>11?1:-1,e.currentMonth=(e.currentMonth+12)%12,Xe("onYearChange"),C()),K(),Xe("onMonthChange"),da())}function M(h,g){if(h===void 0&&(h=!0),g===void 0&&(g=!0),e.input.value="",e.altInput!==void 0&&(e.altInput.value=""),e.mobileInput!==void 0&&(e.mobileInput.value=""),e.selectedDates=[],e.latestSelectedDateObj=void 0,g===!0&&(e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth()),e.config.enableTime===!0){var k=gf(e.config),R=k.hours,G=k.minutes,X=k.seconds;p(R,G,X)}e.redraw(),h&&Xe("onChange")}function I(){e.isOpen=!1,e.isMobile||(e.calendarContainer!==void 0&&e.calendarContainer.classList.remove("open"),e._input!==void 0&&e._input.classList.remove("active")),Xe("onClose")}function W(){e.config!==void 0&&Xe("onDestroy");for(var h=e._handlers.length;h--;)e._handlers[h].remove();if(e._handlers=[],e.mobileInput)e.mobileInput.parentNode&&e.mobileInput.parentNode.removeChild(e.mobileInput),e.mobileInput=void 0;else if(e.calendarContainer&&e.calendarContainer.parentNode)if(e.config.static&&e.calendarContainer.parentNode){var g=e.calendarContainer.parentNode;if(g.lastChild&&g.removeChild(g.lastChild),g.parentNode){for(;g.firstChild;)g.parentNode.insertBefore(g.firstChild,g);g.parentNode.removeChild(g)}}else e.calendarContainer.parentNode.removeChild(e.calendarContainer);e.altInput&&(e.input.type="text",e.altInput.parentNode&&e.altInput.parentNode.removeChild(e.altInput),delete e.altInput),e.input&&(e.input.type=e.input._type,e.input.classList.remove("flatpickr-input"),e.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(k){try{delete e[k]}catch(R){}})}function E(h){return e.calendarContainer.contains(h)}function P(h){if(e.isOpen&&!e.config.inline){var g=Tn(h),k=E(g),R=g===e.input||g===e.altInput||e.element.contains(g)||h.path&&h.path.indexOf&&(~h.path.indexOf(e.input)||~h.path.indexOf(e.altInput)),G=!R&&!k&&!E(h.relatedTarget),X=!e.config.ignoredFocusElements.some(function(_e){return _e.contains(g)});G&&X&&(e.config.allowInput&&e.setDate(e._input.value,!1,e.config.altInput?e.config.altFormat:e.config.dateFormat),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0&&e.input.value!==""&&e.input.value!==void 0&&l(),e.close(),e.config&&e.config.mode==="range"&&e.selectedDates.length===1&&e.clear(!1))}}function $(h){if(!(!h||e.config.minDate&&h<e.config.minDate.getFullYear()||e.config.maxDate&&h>e.config.maxDate.getFullYear())){var g=h,k=e.currentYear!==g;e.currentYear=g||e.currentYear,e.config.maxDate&&e.currentYear===e.config.maxDate.getFullYear()?e.currentMonth=Math.min(e.config.maxDate.getMonth(),e.currentMonth):e.config.minDate&&e.currentYear===e.config.minDate.getFullYear()&&(e.currentMonth=Math.max(e.config.minDate.getMonth(),e.currentMonth)),k&&(e.redraw(),Xe("onYearChange"),C())}}function ce(h,g){var k;g===void 0&&(g=!0);var R=e.parseDate(h,void 0,g);if(e.config.minDate&&R&&_n(R,e.config.minDate,g!==void 0?g:!e.minDateHasTime)<0||e.config.maxDate&&R&&_n(R,e.config.maxDate,g!==void 0?g:!e.maxDateHasTime)>0)return!1;if(!e.config.enable&&e.config.disable.length===0)return!0;if(R===void 0)return!1;for(var G=
`);if(p===void 0)return!1;let b=null;for(let _=0;_<p.length;_=_+1)if(p[_]!==""){b=p[_];break}return b===null?!1:Fe.getInstance().includedIn(b)});if(i.length===0)return;let s=e.sourcePath,a=e.getSectionInfo(t);if(a===null)return;let o=a.text.split(`
`),l=0,u=[];for(let f=a.lineStart;f<=a.lineEnd;f++){let p=o[f];if(p===void 0)continue;let b=null,T=fe.fromLine({line:p,taskLocation:new Lt(new mt(s),f,a.lineStart,l,b),fallbackDate:null});T!==null&&(u.push(T),l++)}let c=new Mi({obsidianComponent:r,parentUlElement:t,taskLayoutOptions:new Gr,queryLayoutOptions:new Ki});for(let f=0;f<i.length;f++){let p=u[f],b=i[f];if(p===void 0||b===void 0)continue;let T=(d=b.getAttr("data-line"))!=null?d:"0",_=Number.parseInt(T,10),x=yield c.renderTaskLine(p,_),D=b.childNodes;for(let Y=0;Y<D.length;Y=Y+1){let se=D[Y],H=se.nodeName.toLowerCase();H==="div"?x.prepend(se):(H==="ul"||H==="ol")&&x.append(se)}let A=b.querySelectorAll("[data-footnote-id]"),j=x.querySelectorAll("[data-footnote-id]");if(A.length===j.length)for(let Y=0;Y<A.length;Y++)j[Y].replaceWith(A[Y]);b.replaceWith(x)}})}};var t0=require("@codemirror/view"),n0=require("obsidian");Nt();var r0=()=>t0.ViewPlugin.fromClass(gb),gb=class{constructor(t){this.view=t,this.handleClickEvent=this.handleClickEvent.bind(this),this.view.dom.addEventListener("click",this.handleClickEvent)}destroy(){this.view.dom.removeEventListener("click",this.handleClickEvent)}handleClickEvent(t){let{target:e}=t;if(!e||!(e instanceof HTMLInputElement)||e.type!=="checkbox")return!1;let r=e.closest("ul.plugin-tasks-query-result, div.callout-content");if(r){if(r.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 n0.Notice(f,45e3)}return!1}let{state:i}=this.view,s=this.view.posAtDOM(e),a=i.doc.lineAt(s),o=fe.fromLine({line:a.text,taskLocation:Lt.fromUnknownPosition(new mt("")),fallbackDate:null});if(o===null)return!1;t.preventDefault();let l=o.toggleWithRecurrenceInUsersOrder(),u=l.map(f=>f.toFileLineString()).join(i.lineBreak),c=i.update({changes:{from:a.from,to:a.to,insert:u}});if(this.view.dispatch(c),l.length===1){let f=l[0].status.symbol!==" ";setTimeout(()=>{e.checked=f},1)}return!0}};var ia=require("obsidian"),s0=require("obsidian");function i0(n,t,e,r=void 0){let i="";t.isEmpty()||(i+=`Only tasks containing the global filter '${t.get()}'.
2 years ago
3 days ago
`);let s=new ao(" ");function a(c,d){return`${c}:
2 years ago
3 days ago
${s.explainQuery(d)}`}let o=new In(n,r),l=new xi().query(r);if(!(o.ignoreGlobalQuery||l.ignoreGlobalQuery)&&e.hasInstructions()){let c=e.query(r);i+=a("Explanation of the global query",c)+`
`}return l.source!==""&&(i+=a("Explanation of the Query File Defaults (from properties/frontmatter in the query's file)",l)+`
`),i+=a("Explanation of this Tasks code block query",o),i}function vf(n,t,e){let i=new xi().query(e).append(new In(n,e));return i.ignoreGlobalQuery?i:t.query(e).append(i)}Gi();Cn();function Cu(n,t,e){t&&n.push(Sj(e))}function Sj(n){return`tasks-layout-hide-${n}`}var wf=class{constructor(t){t?this.queryLayoutOptions=t:this.queryLayoutOptions=new Ki}getHiddenClasses(){let t=[],e=[[this.queryLayoutOptions.hideUrgency,"urgency"],[this.queryLayoutOptions.hideBacklinks,"backlinks"],[this.queryLayoutOptions.hideEditButton,"edit-button"],[this.queryLayoutOptions.hidePostponeButton,"postpone-button"]];for(let[r,i]of e)Cu(t,r,i);return this.queryLayoutOptions.shortMode&&t.push("tasks-layout-short-mode"),t}};Is();var kf=class{constructor(t){t?this.taskLayoutOptions=t:this.taskLayoutOptions=new Gr}generateHiddenClasses(){let t=[];return this.taskLayoutOptions.toggleableComponents.forEach(e=>{Cu(t,!this.taskLayoutOptions.isShown(e),e)}),Cu(t,!this.taskLayoutOptions.areTagsShown(),"tags"),t}};nn();var Mu=class{constructor(t){this.label=t,this.start()}start(){!this.recordTimings()||performance.mark(this.labelForStart())}finish(){!this.recordTimings()||(performance.mark(this.labelForEnd()),performance.measure(this.label,this.labelForStart(),this.labelForEnd()),this.printDuration())}printDuration(){let t=performance.getEntriesByName(this.label),e=t[t.length-1];e?console.log(this.label+":",e.duration.toFixed(2),"milliseconds"):console.log(`Measurement for ${this.label} not found`)}labelForStart(){return`${this.label} - start`}labelForEnd(){return`${this.label} - end`}recordTimings(){let{debugSettings:t}=le();return t.recordTimings}};Nt();var yb=require("obsidian");var as=class extends rs{constructor(t,e,r=ni){super(r);let i=(u,c,d,f,p,b)=>{var D;let T=!1,_=Eo(e);if(_){let{postponedDate:A}=b(e,_,d,f);(D=e[_])!=null&&D.isSame(A,"day")&&(T=!0)}let x=p(e,f,d);c.setChecked(T).setTitle(x).onClick(()=>as.postponeOnClickCallback(u,e,f,d,b,r))},s=GD,a=jD;this.addItem(u=>i(t,u,"days",0,s,a)),this.addItem(u=>i(t,u,"day",1,s,a)),this.addSeparator();let o=pb,l=fb;this.addItem(u=>i(t,u,"days",2,o,l)),this.addItem(u=>i(t,u,"days",3,o,l)),this.addItem(u=>i(t,u,"days",4,o,l)),this.addItem(u=>i(t,u,"days",5,o,l)),this.addItem(u=>i(t,u,"days",6,o,l)),this.addSeparator(),this.addItem(u=>i(t,u,"week",1,o,l)),this.addItem(u=>i(t,u,"weeks",2,o,l)),this.addItem(u=>i(t,u,"weeks",3,o,l)),this.addItem(u=>i(t,u,"month",1,o,l)),this.addSeparator(),this.addItem(u=>i(t,u,"days",2,BD,WD))}static postponeOnClickCallback(o,l,u,c){return L(this,arguments,function*(t,e,r,i,s=fb,a=ni){var b;let d=Eo(e);if(d===null){let T="\u26A0\uFE0F Postponement requires a date: due, scheduled or start.";return new yb.Notice(T,1e4)}let{postponedDate:f,postponedTask:p}=s(e,d,i,r);(b=e[d])!=null&&b.isSame(f,"day")||(yield a(e,p),as.postponeSuccessCallback(t,d,f))})}static postponeSuccessCallback(t,e,r){t.style.pointerEvents="none";let i=YD(r,e);new yb.Notice(i,2e3)}};var Sf=class{constructor(t,e,r,i,s,a=Mi.obsidianMarkdownRenderer){switch(this.source=e,this._tasksFile=r,this.renderMarkdown=i,this.obsidianComponent=s,this.textRenderer=a,t){case"block-language-tasks":this.query=this.makeQueryFromSourceAndTasksFile(),this.queryType="tasks";break;default:this.query=this.makeQueryFromSourceAndTasksFile(),this.queryType="tasks";break}}makeQueryFromSourceAndTasksFile(){return vf(this.source,dr.getInstance(),this.tasksFile)}get tasksFile(){return this._tasksFile}setTasksFile(t){this._tasksFile=t,this.query=this.makeQueryFromSourceAndTasksFile()}get filePath(){var t,e;return(e=(t=this.tasksFile)==null?void 0:t.path)!=null?e:void 0}render(t,e,r,i){return L(this,null,function*(){t==="Warm"&&this.query.error===void 0?yield this.renderQuerySearchResults(e,t,r,i):this.query.error!==void 0?this.renderErrorMessage(r,this.query.error):this.renderLoadingMessage(r)})}renderQuerySearchResults(t,e,r,i){return L(this,null,function*(){let s=this.explainAndPerformSearch(e,t,r);if(s.searchErrorMessage!==void 0){this.renderErrorMessage(r,s.searchErrorMessage);return}yield this.renderSearchResults(s,r,i)})}explainAnd
2 months ago
`,this._markdown+=`${e}
`}addRow(t){let e=this.makeRowText(t);this._markdown+=`${e}
`}addRowIfNew(t){let e=this.makeRowText(t);this._markdown.includes(e)||(this._markdown+=`${e}
3 days ago
`)}makeRowText(t){let e="|";return t.forEach(r=>{e+=` ${r} |`}),e}};gs();Jn();Sr();function a0(n,t){return n.findIndex(e=>e.symbol===t)}function os(n){return n===""?n:"`"+(n!==" "?n:"space")+"`"}function xj(n,t){let e=ge.getTypeForUnknownSymbol(n.symbol);if(n.type===e||e==="TODO"&&n.symbol!==" ")return;let r=os(n.symbol),i=os(e);t.push(N.t("reports.statusRegistry.messages.notConventionalType",{symbol:r,type:i}))}function Cj(n,t,e){let r=t.nextStatusSymbol,i=a0(n,r);if(i===-1){let a=os(r);e.push(N.t("reports.statusRegistry.messages.nextSymbolUnknown",{symbol:a}));return}if(t.type!=="DONE")return;let s=n[i];if(s){if(s.type!=="TODO"&&s.type!=="IN_PROGRESS"){let a="https://publish.obsidian.md/tasks/Getting+Started/Statuses/Recurring+Tasks+and+Custom+Statuses",o=os(s.type),l=[N.t("reports.statusRegistry.messages.wrongTypeAfterDone.line1",{nextType:o}),N.t("reports.statusRegistry.messages.wrongTypeAfterDone.line2"),N.t("reports.statusRegistry.messages.wrongTypeAfterDone.line3",{helpURL:a})].join("<br>");e.push(l)}}else e.push(N.t("reports.statusRegistry.messages.cannotFindNextStatus"))}function Mj(n,t,e){let r=[];if(t.symbol===ge.EMPTY.symbol)return r.push(N.t("reports.statusRegistry.messages.emptySymbol")),r;if(a0(n,t.symbol)!=e){let s=os(t.symbol);return r.push(N.t("reports.statusRegistry.messages.duplicateSymbol",{symbol:s})),r}return xj(t,r),Cj(n,t,r),r}function o0(n){let t=new Df([N.t("reports.statusRegistry.columnHeadings.statusSymbol"),N.t("reports.statusRegistry.columnHeadings.nextStatusSymbol"),N.t("reports.statusRegistry.columnHeadings.statusName"),N.t("reports.statusRegistry.columnHeadings.statusType"),N.t("reports.statusRegistry.columnHeadings.problems")]),e=et.allStatuses(n);return e.forEach((r,i)=>{t.addRow([os(r.symbol),os(r.nextStatusSymbol),r.name,os(r.type),Mj(e,r,i).join("<br>")])}),t.markdown}function l0(n,t,e,r){let s=o0(n),a=t.mermaidDiagram(!0);return`# ${e}
1 year ago
3 days ago
## ${N.t("reports.statusRegistry.about.title")}
1 year ago
3 days ago
${N.t("reports.statusRegistry.about.createdBy",{version:r})}
1 year ago
3 days ago
${N.t("reports.statusRegistry.about.updateReport.line1")}
1 year ago
3 days ago
- ${N.t("reports.statusRegistry.about.updateReport.line2")}
- ${N.t("reports.statusRegistry.about.updateReport.line3")}
1 year ago
3 days ago
${N.t("reports.statusRegistry.about.deleteFileAnyTime")}
1 year ago
3 days ago
## ${N.t("reports.statusRegistry.statusSettings.title")}
1 year ago
<!--
3 days ago
${N.t("reports.statusRegistry.statusSettings.comment.line1")}
${N.t("reports.statusRegistry.statusSettings.comment.line2")}
${N.t("reports.statusRegistry.statusSettings.comment.line3")}
1 year ago
-->
3 days ago
${N.t("reports.statusRegistry.statusSettings.theseAreStatusValues")}
1 year ago
11 months ago
${s}
3 days ago
## ${N.t("reports.statusRegistry.loadedSettings.title")}
1 year ago
3 days ago
<!-- ${N.t("reports.statusRegistry.loadedSettings.switchToLivePreview")} -->
1 year ago
3 days ago
${N.t("reports.statusRegistry.loadedSettings.settingsActuallyUsed")}
${a}`}gs();function u0(){return[[" ","Unchecked","x","TODO"],["x","Checked"," ","DONE"],[">","Rescheduled","x","TODO"],["<","Scheduled","x","TODO"],["!","Important","x","TODO"],["-","Cancelled"," ","CANCELLED"],["/","In Progress","x","IN_PROGRESS"],["?","Question","x","TODO"],["*","Star","x","TODO"],["n","Note","x","TODO"],["l","Location","x","TODO"],["i","Information","x","TODO"],["I","Idea","x","TODO"],["S","Amount","x","TODO"],["p","Pro","x","TODO"],["c","Con","x","TODO"],["b","Bookmark","x","TODO"],['"',"Quote","x","TODO"],["0","Speech bubble 0","0","NON_TASK"],["1","Speech bubble 1","1","NON_TASK"],["2","Speech bubble 2","2","NON_TASK"],["3","Speech bubble 3","3","NON_TASK"],["4","Speech bubble 4","4","NON_TASK"],["5","Speech bubble 5","5","NON_TASK"],["6","Speech bubble 6","6","NON_TASK"],["7","Speech bubble 7","7","NON_TASK"],["8","Speech bubble 8","8","NON_TASK"],["9","Speech bubble 9","9","NON_TASK"]]}function c0(){return[[" ","incomplete","x","TODO"],["x","complete / done"," ","DONE"],["-","cancelled"," ","CANCELLED"],[">","deferred","x","TODO"],["/","in progress, or half-done","x","IN_PROGRESS"],["!","Important","x","TODO"],["?","question","x","TODO"],["R","review","x","TODO"],["+","Inbox / task that should be processed later","x","TODO"],["b","bookmark","x","TODO"],["B","brainstorm","x","TODO"],["D","deferred or scheduled","x","TODO"],["I","Info","x","TODO"],["i","idea","x","TODO"],["N","note","x","TODO"],["Q","quote","x","TODO"],["W","win / success / reward","x","TODO"],["P","pro","x","TODO"],["C","con","x","TODO"]]}function d0(){return[[" ","To Do","x","TODO"],["/","In Progress","x","IN_PROGRESS"],["x","Done"," ","DONE"],["-","Cancelled"," ","CANCELLED"],[">","Rescheduled","x","TODO"],["<","Scheduled","x","TODO"],["!","Important","x","TODO"],["?","Question","x","TODO"],["i","Infomation","x","TODO"],["S","Amount","x","TODO"],["*","Star","x","TODO"],["b","Bookmark","x","TODO"],["\u201C","Quote","x","TODO"],["n","Note","x","TODO"],["l","Location","x","TODO"],["I","Idea","x","TODO"],["p","Pro","x","TODO"],["c","Con","x","TODO"],["u","Up","x","TODO"],["d","Down","x","TODO"]]}function f0(){return[[" ","Unchecked","x","TODO"],["x","Checked"," ","DONE"],["-","Cancelled"," ","CANCELLED"],["/","In Progress","x","IN_PROGRESS"],[">","Deferred","x","TODO"],["!","Important","x","TODO"],["?","Question","x","TODO"],["r","Review","x","TODO"]]}function p0(){return[[" ","Unchecked","x","TODO"],["x","Regular"," ","DONE"],["X","Checked"," ","DONE"],["-","Dropped"," ","CANCELLED"],[">","Forward","x","TODO"],["D","Date","x","TODO"],["?","Question","x","TODO"],["/","Half Done","x","IN_PROGRESS"],["+","Add","x","TODO"],["R","Research","x","TODO"],["!","Important","x","TODO"],["i","Idea","x","TODO"],["B","Brainstorm","x","TODO"],["P","Pro","x","TODO"],["C","Con","x","TODO"],["Q","Quote","x","TODO"],["N","Note","x","TODO"],["b","Bookmark","x","TODO"],["I","Information","x","TODO"],["p","Paraphrase","x","TODO"],["L","Location","x","TODO"],["E","Example","x","TODO"],["A","Answer","x","TODO"],["r","Reward","x","TODO"],["c","Choice","x","TODO"],["d","Doing","x","IN_PROGRESS"],["T","Time","x","TODO"],["@","Character / Person","x","TODO"],["t","Talk","x","TODO"],["O","Outline / Plot","x","TODO"],["~","Conflict","x","TODO"],["W","World","x","TODO"],["f","Clue / Find","x","TODO"],["F","Foreshadow","x","TODO"],["H","Favorite / Health","x","TODO"],["&","Symbolism","x","TODO"],["s","Secret","x","TODO"]]}function m0(){return[[" ","Unchecked","x","TODO"],["x","Checked"," ","DONE"],[">","Rescheduled","x","TODO"],["<","Scheduled","x","TODO"],["!","Important","x","TODO"],["-","Cancelled"," ","CANCELLED"],["/","In Progress","x","IN_PROGRESS"],["?","Question","x","TODO"],["*","Star","x","TODO"],["n","Note","x","TODO"],["l","Location","x","TODO"],["i","Information","x","TODO"],["I","Idea","x","TODO"],["S","Amount","x","TODO"],["p","Pro","x","TODO"],["c","Con","x","TODO"],["b","Bookmark","x","TODO"],["f","Fire","x","TODO"],["k","Key","x","TODO"],["w","Win","x","TODO"],["u","Up","x","TODO"],["d","Down","x","TODO"]]}function h0(){return[[" ","to-do","x",
`)+`
3 days ago
`+N.t("modals.customStatusModal.fixErrorsBeforeSaving");new Nr.Notice(d);return}this.saved=!0,this.close()})),u)),l.addExtraButton(u=>(u.setIcon("cross").setTooltip("Cancel").onClick(()=>{this.saved=!1,this.close()}),u))})}onOpen(){this.display()}static setValidationError(e){e.inputEl.addClass("tasks-settings-is-invalid")}static removeValidationError(e){e.inputEl.removeClass("tasks-settings-is-invalid")}static setValid(e,r){r.length===0?Fn.removeValidationError(e):Fn.setValidationError(e)}};var ln=class extends Ce.PluginSettingTab{constructor({plugin:e}){super(e.app,e);this.customFunctions={insertTaskCoreStatusSettings:this.insertTaskCoreStatusSettings.bind(this),insertCustomTaskStatusSettings:this.insertCustomTaskStatusSettings.bind(this)};this.plugin=e}saveSettings(e){return L(this,null,function*(){yield this.plugin.saveSettings(),e&&this.display()})}display(){let{containerEl:e}=this;e.empty(),this.containerEl.addClass("tasks-settings"),e.createEl("p",{cls:"tasks-setting-important",text:N.t("settings.changeRequiresRestart")}),new Ce.Setting(e).setName(N.t("settings.format.name")).setDesc(ln.createFragmentWithHTML(`<p>${N.t("settings.format.description.line1")}</p><p>${N.t("settings.format.description.line2")}</p>`+this.seeTheDocumentation("https://publish.obsidian.md/tasks/Reference/Task+Formats/About+Task+Formats"))).addDropdown(c=>{for(let d of Object.keys(Er))c.addOption(d,Er[d].getDisplayName());c.setValue(le().taskFormat).onChange(d=>L(this,null,function*(){dt({taskFormat:d}),yield this.plugin.saveSettings()}))}),new Ce.Setting(e).setName(N.t("settings.globalFilter.heading")).setHeading();let r=null;new Ce.Setting(e).setName(N.t("settings.globalFilter.filter.name")).setDesc(ln.createFragmentWithHTML(`<p><b>${N.t("settings.globalFilter.filter.description.line1")}</b></p><p>${N.t("settings.globalFilter.filter.description.line2")}<p><p>${N.t("settings.globalFilter.filter.description.line3")}</br>${N.t("settings.globalFilter.filter.description.line4")}</p>`+this.seeTheDocumentation("https://publish.obsidian.md/tasks/Getting+Started/Global+Filter"))).addText(c=>{c.setPlaceholder(N.t("settings.globalFilter.filter.placeholder")).setValue(Fe.getInstance().get()).onChange(d=>L(this,null,function*(){dt({globalFilter:d}),Fe.getInstance().set(d),yield this.plugin.saveSettings(),ri(r,d.length>0)}))}),r=new Ce.Setting(e).setName(N.t("settings.globalFilter.removeFilter.name")).setDesc(N.t("settings.globalFilter.removeFilter.description")).addToggle(c=>{let d=le();c.setValue(d.removeGlobalFilter).onChange(f=>L(this,null,function*(){dt({removeGlobalFilter:f}),Fe.getInstance().setRemoveGlobalFilter(f),yield this.plugin.saveSettings()}))}),ri(r,le().globalFilter.length>0),new Ce.Setting(e).setName(N.t("settings.globalQuery.heading")).setHeading(),Pj(new Ce.Setting(e).setDesc(ln.createFragmentWithHTML(`<p>${N.t("settings.globalQuery.query.description")}</p>`+this.seeTheDocumentation("https://publish.obsidian.md/tasks/Queries/Global+Query"))).addTextArea(c=>{let d=le();c.inputEl.rows=4,c.setPlaceholder("# "+N.t("settings.globalQuery.query.placeholder")).setValue(d.globalQuery).onChange(f=>L(this,null,function*(){dt({globalQuery:f}),dr.getInstance().set(f),yield this.plugin.saveSettings()}))})),new Ce.Setting(e).setName(N.t("settings.statuses.heading")).setHeading();let{headingOpened:i}=le();[{text:N.t("settings.statuses.coreStatuses.heading"),level:"h3",class:"",open:!0,notice:{class:"setting-item-description",text:null,html:"<p>"+N.t("settings.statuses.coreStatuses.description.line1")+"</p><p>"+N.t("settings.statuses.coreStatuses.description.line2")+"</p>"},settings:[{name:"",description:"",type:"function",initialValue:"",placeholder:"",settingName:"insertTaskCoreStatusSettings",featureFlag:"",notice:null}]},{text:N.t("settings.statuses.customStatuses.heading"),level:"h3",class:"",open:!0,notice:{class:"setting-item-description",text:null,html:"<p>"+N.t("settings.statuses.customStatuses.description.line1")+"</p><p>"+N.t("settings.statuses.customStatuses.description.line2")+"</p><p>"+N.t("settings.statuses.customStatuses.description.
8 months ago
This message has been written to the console.
3 days ago
`,1e4)}var Of=class extends ls.EditorSuggest{constructor(e,r,i){super(e);this.settings=r,this.plugin=i,e.scope.register([],"Tab",()=>{var a;let s=(a=this.context)==null?void 0:a.editor;return s?(s.exec("indentMore"),!1):!0})}onTrigger(e,r,i){if(!this.settings.autoSuggestInEditor)return null;let s=r.getLine(e.line);return xS(s,e,r)?{start:{line:e.line,ch:0},end:{line:e.line,ch:s.length},query:s}:null}getSuggestions(e){var c,d,f;let r=e.query,i=e.editor.getCursor(),s=this.plugin.getTasks(),a=s.find(p=>p.taskLocation.path==e.file.path&&p.taskLocation.lineNumber==i.line),o=this.getMarkdownFileInfo(e),l=this.canSaveEdits(o);return((f=(d=(c=au()).buildSuggestions)==null?void 0:d.call(c,r,i.ch,this.settings,s,l,a))!=null?f:[]).map(p=>me(U({},p),{context:e}))}getMarkdownFileInfo(e){return e.editor.cm.state.field(ls.editorInfoField)}canSaveEdits(e){return e instanceof ls.MarkdownView}renderSuggestion(e,r){r.setText(e.displayText)}selectSuggestion(e,r){return L(this,null,function*(){var u,c,d;let i=e.context.editor;if(e.suggestionType==="empty"){this.close();let f=new KeyboardEvent("keydown",{code:"Enter",key:"Enter"});(c=(u=i==null?void 0:i.cm)==null?void 0:u.contentDOM)==null||c.dispatchEvent(f);return}if(e.taskItDependsOn!=null){let f=Zc(e.taskItDependsOn,this.plugin.getTasks().map(p=>p.id));if(e.appendText+=` ${f.id}`,e.taskItDependsOn!==f)if(e.context.file.path==f.path){let p=e.taskItDependsOn.originalMarkdown,b={line:e.taskItDependsOn.lineNumber,ch:0},T={line:e.taskItDependsOn.lineNumber,ch:p.length},_=e.context.editor.getRange(b,T);if(_!==p){let x=`Error adding new ID, due to mismatched data in Tasks memory and the editor:
2 months ago
task line in memory: '${e.taskItDependsOn.originalMarkdown}'
8 months ago
2 months ago
task line in editor: '${_}'
8 months ago
3 months ago
file: '${f.path}'
3 days ago
`;Nj(x);return}e.context.editor.replaceRange(f.toFileLineString(),b,T)}else ar({originalTask:e.taskItDependsOn,newTasks:f})}let s=e.context.editor.getCursor(),a={line:s.line,ch:(d=e.insertAt)!=null?d:s.ch},o=e.insertSkip?{line:s.line,ch:a.ch+e.insertSkip}:void 0;e.context.editor.replaceRange(e.appendText,a,o),e.context.editor.setCursor({line:s.line,ch:a.ch+e.appendText.length});let l=this.getMarkdownFileInfo(e.context);this.canSaveEdits(l)&&(yield l.save())})}};Ga();var b0=(n,t)=>{let e,r=new Promise((a,o)=>{e=a});return t(n,a=>{let o=a.map(l=>l.toFileLineString()).join(`
`);e(o)}).open(),r};var T0=(n,t)=>{let e=Sd({line:"",path:""});return new zi({app:n,task:e,onSubmit:t,allTasks:[]})};var _0=n=>({createTaskLineModal:()=>b0(n,T0),executeToggleTaskDoneCommand:(t,e)=>Uy(t,e).text});Cn();var xf=class extends v0.Plugin{get apiV1(){return _0(this.app)}onload(){return L(this,null,function*(){yield qb(),rn.registerConsoleLogger(),cy("info",N.t("main.loadingPlugin",{name:this.manifest.name,version:this.manifest.version})),yield this.loadSettings();let{loggingOptions:e}=le();rn.configure(e),this.addSettingTab(new Ru({plugin:this})),IE({metadataCache:this.app.metadataCache,vault:this.app.vault,workspace:this.app.workspace}),yield this.loadTaskStatuses();let r=new lf({obsidianEvents:this.app.workspace});this.cache=new qs({metadataCache:this.app.metadataCache,vault:this.app.vault,workspace:this.app.workspace,events:r}),this.inlineRenderer=new _f({plugin:this}),this.queryRenderer=new Ef({plugin:this,events:r}),this.setObsidianPropertiesTypes(),this.registerEditorExtension(r0()),this.registerEditorSuggest(new Of(this.app,le(),this)),new of({plugin:this})})}loadTaskStatuses(){return L(this,null,function*(){let{statusSettings:e}=le();et.applyToStatusRegistry(e,Be.getInstance())})}onunload(){var e;cy("info",N.t("main.unloadingPlugin",{name:this.manifest.name,version:this.manifest.version})),(e=this.cache)==null||e.unload()}loadSettings(){return L(this,null,function*(){let e=yield this.loadData();dt(e),e=le(),Fe.getInstance().set(e.globalFilter),Fe.getInstance().setRemoveGlobalFilter(e.removeGlobalFilter),dr.getInstance().set(e.globalQuery),yield this.loadTaskStatuses()})}saveSettings(){return L(this,null,function*(){yield this.saveData(le())})}getTasks(){return this.cache===void 0?[]:this.cache.getTasks()}setObsidianPropertiesTypes(){var e;try{let r=this.app.metadataTypeManager,i=r.getAllProperties(),s=new xi;for(let a of s.allPropertyNamesSorted()){let o=s.propertyType(a);((e=i[a])==null?void 0:e.type)!==o&&r.setType(a,o)}}catch(r){console.error("setObsidianPropertiesTypes error",r)}}};
2 years ago
/*!
* EventEmitter2
* https://github.com/hij1nx/EventEmitter2
*
* Copyright (c) 2013 hij1nx
* Licensed under the MIT license.
*/
1 year ago
/*!
* mustache.js - Logic-less {{mustache}} templates with JavaScript
* http://github.com/janl/mustache.js
*/
3 months ago
/* nosourcemap */