varGi=Object.create;varLt=Object.defineProperty;varRi=Object.getOwnPropertyDescriptor;varVi=Object.getOwnPropertyNames;varzi=Object.getPrototypeOf,Ji=Object.prototype.hasOwnProperty;varOr=r=>Lt(r,"__esModule",{value:!0});varWi=(r,e)=>{Or(r);for(vartine)Lt(r,t,{get:e[t],enumerable:!0})},Qi=(r,e,t)=>{if(e&&typeofe=="object"||typeofe=="function")for(letnofVi(e))!Ji.call(r,n)&&n!=="default"&&Lt(r,n,{get:()=>e[n],enumerable:!(t=Ri(e,n))||t.enumerable});returnr},U=r=>Qi(Or(Lt(r!=null?Gi(zi(r)):{},"default",r&&r.__esModule&&"default"inr?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);varqr=(()=>{for(varr=newUint8Array(128),e=0;e<64;e++)r[e<26?e+65:e<52?e+71:e<62?e-4:e*4-205]=e;returnt=>{for(varn=t.length,i=newUint8Array((n-(t[n-1]=="=")-(t[n-2]=="="))*3/4|0),o=0,s=0;o<n;){varl=r[t.charCodeAt(o++)],u=r[t.charCodeAt(o++)],d=r[t.charCodeAt(o++)],h=r[t.charCodeAt(o++)];i[s++]=l<<2|u>>4,i[s++]=u<<4|d>>2,i[s++]=d<<6|h}returni}})();Wi(exports,{default:()=>wr});var_n=U(require("obsidian"));varP=U(require("obsidian"));varLr=U(require("obsidian"));functionz(r){lete=newLr.Notice("",8e3),t=createFragment(n=>{n.createEl("b",{text:"Templater error"}),n.createSpan({text:":"}),n.createEl("br"),n.createSpan({text:r.message}),rinstanceofT&&r.console_msg&&(n.createEl("br"),n.createSpan({text:"Check console for more information"}),console.error("Templater Error:",r.message,`
`,r.console_msg))});e.messageEl.appendChild(t)}var T=class extends Error{constructor(e,t){super(e);this.console_msg=t;this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}};async function se(r,e){try{return await r()}catch(t){return t instanceof T?z(t):z(new T(e,t instanceof Error?t.message:void 0)),null}}function ce(r,e){try{return r()}catch(t){return z(new T(e,t instanceof Error?t.message:void 0)),null}}var J=function(){function r(){}return r.explainIfInvalidTSDocTagName=function(e){if(e[0]!=="@")return'A TSDoc tag name must start with an "@" symbol';if(!r._tsdocTagNameRegExp.test(e))return"A TSDoc tag name must start with a letter and contain only letters and numbers"},r.validateTSDocTagName=function(e){var t=r.explainIfInvalidTSDocTagName(e);if(t)throw new Error(t)},r.explainIfInvalidLinkUrl=function(e){if(e.length===0)return"The URL cannot be empty";if(!r._urlSchemeRegExp.test(e))return'An @link URL must begin with a scheme comprised only of letters and numbers followed by "://". (For general URLs, use an HTML "<a>" tag instead.)';if(!r._urlSchemeAfterRegExp.test(e))return'An @link URL must have at least one character after "://"'},r.explainIfInvalidHtmlName=function(e){if(!r._htmlNameRegExp.test(e))return"An HTML name must be an ASCII letter followed by zero or more letters, digits, or hyphens"},r.validateHtmlName=function(e){var t=r.explainIfInvalidHtmlName(e);if(t)throw new Error(t)},r.explainIfInvalidPackageName=function(e){if(e.length===0)return"The package name cannot be an empty string";if(!r._validPackageNameRegExp.test(e))return"The package name ".concat(JSON.stringify(e)," is not a valid package name")},r.explainIfInvalidImportPath=function(e,t){if(e.length>0){if(e.indexOf("//")>=0)return'An import path must not contain "//"';if(e[e.length-1]==="/")return'An import path must not end with "/"';if(!t&&e[0]==="/")return'An import path must not start with "/" unless prefixed by a package name'}},r.isSystemSelector=function(e){return r._systemSelectors.has(e)},r.explainIfInvalidUnquotedIdentifier=function(e){if(e.length===0)return"The identifier cannot be an empty string";if(r._identifierBadCharRegExp.test(e))return"The identifier cannot non-word characters";if(r._identifierNumberStartRegExp.test(e))return"The identifier must not start with a number"},r.explainIfInvalidUnquotedMemberIdentifier=function(e){var t=r.explainIfInvalidUnquotedIdentifier(e);if(t!==void 0)return t;if(r.isSystemSelector(e))return'The identifier "'.concat(e,'" must be quoted because it is a TSDoc system selector name')},r._tsdocTagNameRegExp=/^@[a-z][a-z0-9]*$/i,r._urlSchemeRegExp=/^[a-z][a-z0-9]*\:\/\//i,r._urlSchemeAfterRegExp=/^[a-z][a-z0-9]*\:\/\/./i,r._htmlNameRegExp=/^[a-z]+[a-z0-9\-]*$/i,r._identifierBadCharRegExp=/[^a-z0-9_$]/i,r._identifierNumberStartRegExp=/^[0-9]/,r._validPackageNameRegExp=/^(?:@[a-z0-9\-_\.]+\/)?[a-z0-9\-_\.]+$/i,r._systemSelectors=new Set(["instance","static","constructor","class","enum","function","interface","namespace","type","variable"]),r}();var Cn=function(){function r(){this._docNodeDefinitionsByKind=new Map,this._docNodeDefinitionsByConstructor=new Map}return r.prototype.registerDocNodes=function(e,t){var n=J.explainIfInvalidPackageName(e);if(n)throw new Error("Invalid NPM package name: "+n);for(var i=0,o=t;i<o.length;i++){var s=o[i];if(!r._nodeKindRegExp.test(s.docNodeKind))throw new Error("The DocNode kind ".concat(JSON.stringify(s.docNodeKind)," is not a valid identifier.")+" It must start with an underscore or letter, and be comprised of letters, numbers, and underscores");var l=this._docNodeDefinitionsByKind.get(s.docNodeKind);if(l!==void 0)throw new Error('The DocNode kind "'.concat(s.docNodeKind,'" was already registered')+" by ".concat(l.packageName));if(l=this._docNodeDefinitionsByConstructor.get(s.constructor),l!==void 0)throw new Error("This DocNode constructor was already registered by ".concat(l.packageName)+" as ".concat(l.docNodeKind));var u={docNodeKind:s.docNodeKind,constructor:s.constructor,packageName:e,allowedChildKinds:new Set};
`:this.range.toString()},r}();var ro=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),x;(function(r){r.Spacing="Spacing",r.BlockTag="BlockTag",r.CodeSpan_OpeningDelimiter="CodeSpan_OpeningDelimiter",r.CodeSpan_Code="CodeSpan_Code",r.CodeSpan_ClosingDelimiter="CodeSpan_ClosingDelimiter",r.DeclarationReference_PackageName="DeclarationReference_PackageName",r.DeclarationReference_ImportPath="DeclarationReference_ImportPath",r.DeclarationReference_ImportHash="DeclarationReference_ImportHash",r.ErrorText="ErrorText",r.NonstandardText="NonstandardText",r.EscapedText="EscapedText",r.FencedCode_OpeningFence="FencedCode_OpeningFence",r.FencedCode_Language="FencedCode_Language",r.FencedCode_Code="FencedCode_Code",r.FencedCode_ClosingFence="FencedCode_ClosingFence",r.HtmlAttribute_Name="HtmlAttribute_Name",r.HtmlAttribute_Equals="HtmlAttribute_Equals",r.HtmlAttribute_Value="HtmlAttribute_Value",r.HtmlEndTag_OpeningDelimiter="HtmlEndTag_OpeningDelimiter",r.HtmlEndTag_Name="HtmlEndTag_Name",r.HtmlEndTag_ClosingDelimiter="HtmlEndTag_ClosingDelimiter",r.HtmlStartTag_OpeningDelimiter="HtmlStartTag_OpeningDelimiter",r.HtmlStartTag_Name="HtmlStartTag_Name",r.HtmlStartTag_ClosingDelimiter="HtmlStartTag_ClosingDelimiter",r.InlineTag_OpeningDelimiter="InlineTag_OpeningDelimiter",r.InlineTag_TagName="InlineTag_TagName",r.InlineTag_TagContent="InlineTag_TagContent",r.InlineTag_ClosingDelimiter="InlineTag_ClosingDelimiter",r.LinkTag_UrlDestination="LinkTag_UrlDestination",r.LinkTag_Pipe="LinkTag_Pipe",r.LinkTag_LinkText="LinkTag_LinkText",r.MemberIdentifier_LeftQuote="MemberIdentifier_LeftQuote",r.MemberIdentifier_Identifier="MemberIdentifier_Identifier",r.MemberIdentifier_RightQuote="MemberIdentifier_RightQuote",r.MemberReference_Dot="MemberReference_Dot",r.MemberReference_LeftParenthesis="MemberReference_LeftParenthesis",r.MemberReference_Colon="MemberReference_Colon",r.MemberReference_RightParenthesis="MemberReference_RightParenthesis",r.MemberSelector="MemberSelector",r.DocMemberSymbol_LeftBracket="DocMemberSymbol_LeftBracket",r.DocMemberSymbol_RightBracket="DocMemberSymbol_RightBracket",r.ParamBlock_ParameterName="ParamBlock_ParameterName",r.ParamBlock_Hyphen="ParamBlock_Hyphen",r.PlainText="PlainText",r.SoftBreak="SoftBreak"})(x||(x={}));var y=function(r){ro(e,r);function e(t){var n=r.call(this,t)||this;if(t.excerptKind===x.Spacing)for(var i=0,o=t.content.tokens;i<o.length;i++){var s=o[i];switch(s.kind){case p.Spacing:case p.Newline:case p.EndOfInput:break;default:throw new Error("The excerptKind=Spacing but the range contains a non-whitespace token")}}return n._excerptKind=t.excerptKind,n._content=t.content,n}return Object.defineProperty(e.prototype,"kind",{get:function(){return g.Excerpt},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"excerptKind",{get:function(){return this._excerptKind},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"content",{get:function(){return this._content},enumerable:!1,configurable:!0}),e}(v);var io=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Ht=function(r){io(e,r);function e(t){var n=r.call(this,t)||this;return J.validateTSDocTagName(t.tagName),n._tagName=t.tagName,n._tagNameWithUpperCase=t.tagName.toUpperCase(),v.isParsedParameters(t)
`?(++t,n=1):++n)}return{line:t,column:n}},r.prototype._validateBounds=function(){if(this.pos<0)throw new Error("TextRange.pos cannot be negative");if(this.end<0)throw new Error("TextRange.end cannot be negative");if(this.end<this.pos)throw new Error("TextRange.end cannot be smaller than TextRange.pos");if(this.pos>this.buffer.length)throw new Error("TextRange.pos cannot exceed the associated text buffer length");if(this.end>this.buffer.length)throw new Error("TextRange.end cannot exceed the associated text buffer length")},r.empty=new r("",0,0),r}();var bt=function(){function r(e){this.messageId=e.messageId,this.unformattedText=e.messageText,this.textRange=e.textRange,this.tokenSequence=e.tokenSequence,this.docNode=e.docNode,this._text=void 0}return r._formatMessageText=function(e,t){if(e||(e="An unknown error occurred"),t.pos!==0||t.end!==0){var n=t.getLocation(t.pos);if(n.line)return"(".concat(n.line,",").concat(n.column,"): ")+e}return e},Object.defineProperty(r.prototype,"text",{get:function(){return this._text===void 0&&(this._text=r._formatMessageText(this.unformattedText,this.textRange)),this._text},enumerable:!1,configurable:!0}),r.prototype.toString=function(){return this.text},r}();var On=function(){function r(){this._messages=[]}return Object.defineProperty(r.prototype,"messages",{get:function(){return this._messages},enumerable:!1,configurable:!0}),r.prototype.addMessage=function(e){this._messages.push(e)},r.prototype.addMessageForTextRange=function(e,t,n){this.addMessage(new bt({messageId:e,messageText:t,textRange:n}))},r.prototype.addMessageForTokenSequence=function(e,t,n,i){this.addMessage(new bt({messageId:e,messageText:t,textRange:n.getContainingTextRange(),tokenSequence:n,docNode:i}))},r.prototype.addMessageForDocErrorText=function(e){var t;e.textExcerpt?t=e.textExcerpt:t=e.errorLocation,this.addMessage(new bt({messageId:e.messageId,messageText:e.errorMessage,textRange:t.getContainingTextRange(),tokenSequence:t,docNode:e}))},r}();var qn=function(){function r(e,t){this.commentRange=ye.empty,this.lines=[],this.tokens=[],this.configuration=e,this.sourceRange=t,this.docComment=new Kt({configuration:this.configuration}),this.log=new On}return r}();var qe=function(){function r(e){this.parserContext=e.parserContext,this._startIndex=e.startIndex,this._endIndex=e.endIndex,this._validateBounds()}return r.createEmpty=function(e){return new r({parserContext:e,startIndex:0,endIndex:0})},Object.defineProperty(r.prototype,"startIndex",{get:function(){return this._startIndex},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"endIndex",{get:function(){return this._endIndex},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"tokens",{get:function(){return this.parserContext.tokens.slice(this._startIndex,this._endIndex)},enumerable:!1,configurable:!0}),r.prototype.getNewSequence=function(e,t){return new r({parserContext:this.parserContext,startIndex:e,endIndex:t})},r.prototype.getContainingTextRange=function(){return this.isEmpty()?ye.empty:this.parserContext.sourceRange.getNewRange(this.parserContext.tokens[this._startIndex].range.pos,this.parserContext.tokens[this._endIndex-1].range.end)},r.prototype.isEmpty=function(){return this._startIndex===this._endIndex},r.prototype.toString=function(){return this.tokens.map(function(e){return e.toString()}).join("")},r.prototype._validateBounds=function(){if(this.startIndex<0)throw new Error("TokenSequence.startIndex cannot be negative");if(this.endIndex<0)throw new Error("TokenSequence.endIndex cannot be negative");if(this.endIndex<this.startIndex)throw new Error("TokenSequence.endIndex cannot be smaller than TokenSequence.startIndex");if(this.startIndex>this.parserContext.tokens.length)throw new Error("TokenSequence.startIndex cannot exceed the associated token array");if(this.endIndex>this.parserContext.tokens.length)throw new Error("TokenSequence.endIndex cannot exceed the associated token array")},r}();var Q;(function(r){r[r.BeginComment1=0]="BeginComment1",r[r.BeginComment2=1]="BeginComment2",r[r.CollectingFirstLine=2]="CollectingFirstLine"
`?(h.push(t.getNewRange(E,E)),s=u):r._whitespaceCharacterRegExp.test(j)||(l=u,d=Q.CollectingLine);break}}return e.commentRange=t.getNewRange(i,o),e.lines=h,!0},r._whitespaceCharacterRegExp=/^\s$/,r}();var Et=function(){function r(){}return r.readTokens=function(e){r._ensureInitialized();for(var t=[],n=void 0,i=0,o=e;i<o.length;i++){var s=o[i];r._pushTokensForLine(t,s),n=s}return n?t.push(new ze(p.EndOfInput,n.getNewRange(n.end,n.end),n)):t.push(new ze(p.EndOfInput,ye.empty,ye.empty)),t},r.isPunctuation=function(e){return r._ensureInitialized(),r._punctuationTokens[e]||!1},r._pushTokensForLine=function(e,t){for(var n=t.buffer,i=t.end,o=t.pos,s=void 0,l=o;o<i;){var u=n.charCodeAt(o),d=r._charCodeMap[u];d===void 0&&(d=p.Other),s!==void 0&&d===s&&r._isMultiCharacterToken(s)||(s!==void 0&&e.push(new ze(s,t.getNewRange(l,o),t)),l=o,s=d),++o}s!==void 0&&e.push(new ze(s,t.getNewRange(l,o),t)),e.push(new ze(p.Newline,t.getNewRange(t.end,t.end),t))},r._isMultiCharacterToken=function(e){switch(e){case p.Spacing:case p.AsciiWord:case p.Other:return!0}return!1},r._ensureInitialized=function(){if(!r._charCodeMap){r._charCodeMap={},r._punctuationTokens={};for(var e=r._commonMarkPunctuationCharacters,t=0;t<e.length;++t){var n=e.charCodeAt(t);r._charCodeMap[n]=p.OtherPunctuation}for(var i={"\\":p.Backslash,"<":p.LessThan,">":p.GreaterThan,"=":p.Equals,"'":p.SingleQuote,'"':p.DoubleQuote,"/":p.Slash,"-":p.Hyphen,"@":p.AtSign,"{":p.LeftCurlyBracket,"}":p.RightCurlyBracket,"`":p.Backtick,".":p.Period,":":p.Colon,",":p.Comma,"[":p.LeftSquareBracket,"]":p.RightSquareBracket,"|":p.Pipe,"(":p.LeftParenthesis,")":p.RightParenthesis,"#":p.PoundSymbol,"+":p.Plus,$:p.DollarSign},o=0,s=Object.getOwnPropertyNames(i);o<s.length;o++){var l=s[o];r._charCodeMap[l.charCodeAt(0)]=i[l],r._punctuationTokens[i[l]]=!0}r._punctuationTokens[p.OtherPunctuation]=!0;for(var u=r._wordCharacters,t=0;t<u.length;++t){var n=u.charCodeAt(t);r._charCodeMap[n]=p.AsciiWord}r._charCodeMap["".charCodeAt(0)]=p.Spacing,r._charCodeMap["".charCodeAt(0)]=p.Spacing}},r._commonMarkPunctuationCharacters="!\"#$%&'()*+,-./:;<=>?@[\\]^`{|}~",r._wordCharacters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_",r}();varLn=function(){functionr(e,t){if(this._parserContext=e,this.tokens=e.tokens,t){if(t.parserContext!==this._parserContext)thrownewError("The embeddedTokenSequence must use the same parser context");this._readerStartIndex=t.startIndex,this._readerEndIndex=t.endIndex}elsethis._readerStartIndex=0,this._readerEndIndex=this.tokens.length;this._currentIndex=this._readerStartIndex,this._accumulatedStartIndex=this._readerStartIndex}returnr.prototype.extractAccumulatedSequence=function(){if(this._accumulatedStartIndex===this._currentIndex)thrownewError("Parser assertion failed: The queue should not be empty when extractAccumulatedSequence() is called");vare=newqe({parserContext:this._parserContext,startIndex:this._accumulatedStartIndex,endIndex:this._currentIndex});returnthis._accumulatedStartIndex=this._currentIndex,e},r.prototype.isAccumulatedSequenceEmpty=function(){returnthis._accumulatedStartIndex===this._currentIndex},r.prototype.tryExtractAccumulatedSequence=function(){if(!this.isAccumulatedSequenceEmpty())returnthis.extractAccumulatedSequence()},r.prototype.assertAccumulatedSequenceIsEmpty=function(){if(!this.isAccumulatedSequenceEmpty()){vare=newqe({parserContext:this._parserContext,startIndex:this._accumulatedStartIndex,endIndex:this._currentIndex}),t=e.tokens.map(function(n){returnn.toString()});thrownewError(`Parser assertion failed: The queue should be empty, but it contains:
`+JSON.stringify(t))}},r.prototype.peekToken=function(){return this.tokens[this._currentIndex]},r.prototype.peekTokenKind=function(){return this._currentIndex>=this._readerEndIndex?p.EndOfInput:this.tokens[this._currentIndex].kind},r.prototype.peekTokenAfterKind=function(){return this._currentIndex+1>=this._readerEndIndex?p.EndOfInput:this.tokens[this._currentIndex+1].kind},r.prototype.peekTokenAfterAfterKind=function(){return this._currentIndex+2>=this._readerEndIndex?p.EndOfInput:this.tokens[this._currentIndex+2].kind},r.prototype.readToken=function(){if(this._currentIndex>=this._readerEndIndex)throw new Error("Cannot read past end of stream");var e=this.tokens[this._currentIndex];if(e.kind===p.EndOfInput)throw new Error("The EndOfInput token cannot be read");return this._currentIndex++,e},r.prototype.peekPreviousTokenKind=function(){return this._currentIndex===0?p.EndOfInput:this.tokens[this._currentIndex-1].kind},r.prototype.createMarker=function(){return this._currentIndex},r.prototype.backtrackToMarker=function(e){if(e>this._currentIndex)throw new Error("The marker has expired");this._currentIndex=e,e<this._accumulatedStartIndex&&(this._accumulatedStartIndex=e)},r}();var an=function(){return an=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},an.apply(this,arguments)};function kt(r){return r!==void 0&&Object.hasOwnProperty.call(r,"failureMessage")}var Rr=function(){function r(e){this._parserContext=e,this._configuration=e.configuration,this._currentSection=e.docComment.summarySection}return r.prototype.parse=function(){for(var e=new Ln(this._parserContext),t=!1;!t;)switch(e.peekTokenKind()){case p.EndOfInput:t=!0;break;case p.Newline:this._pushAccumulatedPlainText(e),e.readToken(),this._pushNode(new Zt({parsed:!0,configuration:this._configuration,softBreakExcerpt:e.extractAccumulatedSequence()}));break;case p.Backslash:this._pushAccumulatedPlainText(e),this._pushNode(this._parseBackslashEscape(e));break;case p.AtSign:this._pushAccumulatedPlainText(e),this._parseAndPushBlock(e);break;case p.LeftCurlyBracket:{this._pushAccumulatedPlainText(e);var n=e.createMarker(),i=this._parseInlineTag(e),o=this._parserContext.docComment;if(i instanceof wt){var s=e.createMarker()-1;o.inheritDocTag===void 0?this._parserContext.docComment.inheritDocTag=i:this._pushNode(this._backtrackAndCreateErrorRange(e,n,s,w.ExtraInheritDocTag,"A doc comment cannot have more than one @inheritDoc tag"))}else this._pushNode(i);break}case p.RightCurlyBracket:this._pushAccumulatedPlainText(e),this._pushNode(this._createError(e,w.EscapeRightBrace,'The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag'));break;case p.LessThan:this._pushAccumulatedPlainText(e),e.peekTokenAfterKind()===p.Slash?this._pushNode(this._parseHtmlEndTag(e)):this._pushNode(this._parseHtmlStartTag(e));break;case p.GreaterThan:this._pushAccumulatedPlainText(e),this._pushNode(this._createError(e,w.EscapeGreaterThan,'The ">" character should be escaped using a backslash to avoid confusion with an HTML tag'));break;case p.Backtick:this._pushAccumulatedPlainText(e),e.peekTokenAfterKind()===p.Backtick&&e.peekTokenAfterAfterKind()===p.Backtick?this._pushNode(this._parseFencedCode(e)):this._pushNode(this._parseCodeSpan(e));break;default:e.readToken();break}this._pushAccumulatedPlainText(e),this._performValidationChecks()},r.prototype._performValidationChecks=function(){var e=this._parserContext.docComment;e.deprecatedBlock&&(on.hasAnyTextContent(e.deprecatedBlock)||this._parserContext.log.addMessageForTokenSequence(w.MissingDeprecationMessage,"The ".concat(e.deprecatedBlock.blockTag.tagName," block must include a deprecation message,")+" e.g. describing the recommended alternative",e.deprecatedBlock.blockTag.getTokenSequence(),e.deprecatedBlock)),e.inheritDocTag&&(e.remarksBlock&&this._parserContext.log.addMessageForTokenSequence(w.InheritDocIncompatibleTag,'A "'.concat(e.remarksBlock.blockTag.tagName,'" block must not be used, beca
`,s+1))!==-1;i++,o=s);o+=1;let l=e.slice(o,t).length;return{line:i,ch:l}}get_cursor_matches_and_positions(e){let t=/<%\s*tp\.file\.cursor\((?<order>[0-9]*)\)\s*%>/g,n=[],i;for(;(i=t.exec(e))!==null;)n.push(i);if(n.length===0)return{};n.sort((h,j)=>Number(h.groups?.order||0)-Number(j.groups?.order||0));let o=n[0][0],s=n.filter(h=>h[0]===o),l=s[0][1]===""?[s[0]]:s,u=[],d=0;for(let h of l){let j=h.index-d;u.push(this.get_editor_position_from_index(e,j)),e=e.slice(0,j)+e.slice(j+h[0].length),d+=h[0].length}return{cursor_matches:l,positions:u}}};var mi=U(require("obsidian"));var Yo={app:{name:"app",description:"This module exposes the app instance. Prefer to use this over the global app instance."},user:{name:"user",description:"This module exposes custom made scripts, written by yourself within the script file folder location"},config:{name:"config",description:`ThismoduleexposesTemplater'srunningconfiguration.
`,functions:{template_file:{name:"template_file",description:"The `TFile` object representing the template file.",definition:"tp.config.template_file"},target_file:{name:"target_file",description:"The `TFile` object representing the target file where the template will be inserted.",definition:"tp.config.target_file"},run_mode:{name:"run_mode",description:"The `RunMode`, representing the way Templater was launched (Create new from template, Append to active file, ...).",definition:"tp.config.run_mode"},active_file:{name:"active_file",description:"The active file (if existing) when launching Templater.",definition:"tp.config.active_file?"}}},date:{name:"date",description:"This module contains every internal function related to dates.",functions:{now:{name:"now",description:"Retrieves the date.",definition:'tp.date.now(format: string = "YYYY-MM-DD", offset?: number | string, reference?: string, reference_format?: string)',args:[{name:"format",description:'The format for the date. Defaults to `"YYYY-MM-DD"`. Refer to the [Momentjs format reference](https://momentjs.com/docs/#/displaying/format/).'},{name:"offset",description:"Duration to offset the date from. If a number is provided, duration will be added to the date in days. You can also specify the offset as a string using the ISO 8601 format."},{name:"reference",description:"The date to use instead of today's date, e.g. set this to the note's title."},{name:"reference_format",description:"The format for the reference date. Refer to the [Momentjs format reference](https://momentjs.com/docs/#/displaying/format/)."}],examples:[{name:"Date now",example:"<% tp.date.now() %>"},{name:"Date now with format",example:'<% tp.date.now("Do MMMM YYYY") %>'},{name:"Last week",example:'<% tp.date.now("YYYY-MM-DD", -7) %>'},{name:"Next week",example:'<% tp.date.now("YYYY-MM-DD", 7) %>'},{name:"Last month",example:'<% tp.date.now("YYYY-MM-DD", "P-1M") %>'},{name:"Next year",example:'<% tp.date.now("YYYY-MM-DD", "P1Y") %>'},{name:"File's title date + 1 day (tomorrow)",example:'<% tp.date.now("YYYY-MM-DD", 1, tp.file.title, "YYYY-MM-DD") %>'},{name:"File's title date - 1 day (yesterday)",example:'<% tp.date.now("YYYY-MM-DD", -1, tp.file.title, "YYYY-MM-DD") %>'}]},tomorrow:{name:"tomorrow",description:"Retrieves tomorrow's date.",definition:'tp.date.tomorrow(format: string = "YYYY-MM-DD")',args:[{name:"format",description:'The format for the date. Defaults to `"YYYY-MM-DD"`. Refer to the [Momentjs format reference](https://momentjs.com/docs/#/displaying/format/).'}],examples:[{name:"Date tomorrow",example:"<% tp.date.tomorrow() %>"},{name:"Date tomorrow with format",example:'<% tp.date.tomorrow("Do MMMM YYYY") %>'}]},yesterday:{name:"yesterday",description:"Retrieves yesterday's date.",definition:'tp.date.yesterday(format: string = "YYYY-MM-DD")',args:[{name:"format",description:'The format for the date. Defaults to `"YYYY-MM-DD"`. Refer to the [Momentjs format reference](https://momentjs.com/docs/#/displaying/format/).'}],examples:[{name:"Date yesterday",example:"<% tp.date.yesterday() %>"},{name:"Date yesterday with format",example:'<% tp.date.yesterday("Do MMMM YYYY") %>'}]},weekday:{name:"weekday",description:"",definition:'tp.date.weekday(format: string = "YYYY-MM-DD", weekday: number, reference?: string, reference_format?: string)',args:[{name:"format",description:'The format for the date. Defaults to `"YYYY-MM-DD"`. Refer to the [Momentjs format reference](https://momentjs.com/docs/#/displaying/format/).'},{name:"weekday",description:"Week day number. If the locale assigns Monday as the first day of the week, `0` will be Monday, `-7` will be last week's day."},{name:"reference",description:"The reference date to use instead of today, e.g. set this to the note's title."},{name:"reference_format",description:"The format for the reference date. Refer to the [Momentjs format reference](https://momentjs.com/docs/#/displaying/format/)."}],examples:[{name:"This week's Monday",example:'<% tp.date.weekday("YYYY-MM-DD", 0) %>'},{name:"Next Monday",example:'<% tp.date.weekday("YYYY-MM-DD", 7)
`}],examples:[{name:"File cursor",example:"<% tp.file.cursor() %>"},{name:"File multi-cursor",example:"<% tp.file.cursor(1) %>Content<% tp.file.cursor(1) %>"}]},cursor_append:{name:"cursor_append",description:"Appends some content after the active cursor in the file.",definition:"tp.file.cursor_append(content: string)",args:[{name:"content",description:"The content to append after the active cursor."}],examples:[{name:"File cursor append",example:'<% tp.file.cursor_append("Some text") %>'}]},exists:{name:"exists",description:"Check to see if a file exists by it's file path. The full path to the file, relative to the Vault and containing the extension, must be provided.",definition:"tp.file.exists(filepath: string)",args:[{name:"filepath",description:"The full file path of the file we want to check existence for."}],examples:[{name:"File existence",example:'<% await tp.file.exists("MyFolder/MyFile.md") %>'},{name:"File existence of current file",example:'<% await tp.file.exists(tp.file.folder(true) + "/" + tp.file.title + ".md") %>'}]},find_tfile:{name:"find_tfile",description:"Search for a file and returns its `TFile` instance.",definition:"tp.file.find_tfile(filename: string)",args:[{name:"filename",description:"The filename we want to search and resolve as a `TFile`."}],examples:[{name:"File find TFile",example:'<% tp.file.find_tfile("MyFile").basename %>'}]},folder:{name:"folder",description:"Retrieves the file's folder name.",definition:"tp.file.folder(absolute: boolean = false)",args:[{name:"absolute",description:"If set to `true`, returns the vault-absolute path of the folder. If `false`, only returns the basename of the folder (the last part). Defaults to `false`."}],examples:[{name:"File folder (Folder)",example:"<% tp.file.folder() %>"},{name:"File folder with vault-absolute path (Path/To/Folder)",example:"<% tp.file.folder(true) %>"}]},include:{name:"include",description:"Includes the file's link content. Templates in the included content will be resolved.",definition:"tp.file.include(include_link: string | TFile)",args:[{name:"include_link",description:'The link to the file to include, e.g. `"[[MyFile]]"`, or a TFile object. Also supports sections or blocks inclusions.'}],examples:[{name:"File include",example:'<% await tp.file.include("[[Template1]]") %>'},{name:"File include TFile",example:'<% await tp.file.include(tp.file.find_tfile("MyFile")) %>'},{name:"File include section",example:'<% await tp.file.include("[[MyFile#Section1]]") %>'},{name:"File include block",example:'<% await tp.file.include("[[MyFile#^block1]]") %>'}]},last_modified_date:{name:"last_modified_date",description:"Retrieves the file's last modification date.",definition:'tp.file.last_modified_date(format: string = "YYYY-MM-DD HH:mm")',args:[{name:"format",description:'The format for the date. Defaults to `"YYYY-MM-DD HH:mm"`. Refer to [format reference](https://momentjs.com/docs/#/displaying/format/).'}],examples:[{name:"File last modified date",example:"<% tp.file.last_modified_date() %>"},{name:"File last modified date with format",example:'<% tp.file.last_modified_date("dddd Do MMMM YYYY HH:mm") %>'}]},move:{name:"move",description:"Moves the file to the desired vault location.",definition:"tp.file.move(new_path: string, file_to_move?: TFile)",args:[{name:"new_path",description:'The new vault relative path of the file, without the file extension. Note: the new path needs to include the folder and the filename, e.g. `"/Notes/MyNote"`.'},{name:"file_to_move",description:"The file to move, defaults to the current file."}],examples:[{name:"File move",example:'<%* await tp.file.move("/A/B/" + tp.file.title) %>'},{name:"File move and rename",example:'<%* await tp.file.move("/A/B/NewTitle") %>'}]},path:{name:"path",description:"Retrieves the file's absolute path on the system.",definition:"tp.file.path(relative: boolean = false)",args:[{name:"relative",description:"If set to `true`, only retrieves the vault's relative path."}],examples:[{name:"File path",example:"<% tp.file.path() %>"},{name:"File relative path (relative to vault root)",exa
letvalue=awaittp.system.prompt("Please enter a value");
%>
#<%value%>
selectedvalue:<%value%>`}]},suggester:{name:"suggester",description:"Spawns a suggester prompt and returns the user's chosen item.",definition:'tp.system.suggester(text_items: string[] | ((item: T) => string), items: T[], throw_on_cancel: boolean = false, placeholder: string = "", limit?: number = undefined, default_value?: T = undefined)',args:[{name:"text_items",description:"Array of strings representing the text that will be displayed for each item in the suggester prompt. This can also be a function that maps an item to its text representation."},{name:"items",description:"Array containing the values of each item in the correct order."},{name:"throw_on_cancel",description:"Throws an error if the prompt is canceled, instead of returning a `null` value."},{name:"placeholder",description:"Placeholder string of the prompt."},{name:"limit",description:"Limit the number of items rendered at once (useful to improve performance when displaying large lists)."},{name:"default_value",description:"Default value to initialize the suggester with."}],examples:[{name:"Suggester",example:'<% await tp.system.suggester(["Happy", "Sad", "Confused"], ["Happy", "Sad", "Confused"]) %>'},{name:"Suggester with mapping function (same as above example)",example:'<% await tp.system.suggester((item) => item, ["Happy", "Sad", "Confused"]) %>'},{name:"Suggester for files",example:"[[<% (await tp.system.suggester((item) => item.basename, tp.app.vault.getMarkdownFiles())).basename %>]]"},{name:"Suggester for tags",example:'<% await tp.system.suggester(item => item, Object.keys(tp.app.metadataCache.getTags()).map(x => x.replace("#", ""))) %>'},{name:"Reuse value from suggester",example:`<%*
selectedvalue:<%selectedValue%>`}]},multi_suggester:{name:"multi_suggester",description:"Spawns a suggester prompt that supports selecting multiple items and returns the user's chosen items.",definition:'tp.system.multi_suggester(text_items: string[] | ((item: T) => string), items: T[], throw_on_cancel: boolean = false, title: string = "", limit?: number = undefined, default_values?: T[] = undefined)',args:[{name:"text_items",description:"Array of strings representing the text that will be displayed for each item in the suggester prompt. This can also be a function that maps an item to its text representation."},{name:"items",description:"Array containing the values of each item in the correct order."},{name:"throw_on_cancel",description:"Throws an error if the prompt is canceled, instead of returning a `null` value."},{name:"title",description:"Text placed at the top of the modal."},{name:"limit",description:"Limit the number of items rendered at once (useful to improve performance when displaying large lists)."},{name:"default_values",description:"Default values to initialize the suggester with."}],examples:[{name:"Multi-suggester",example:'<% await tp.system.multi_suggester(["Happy", "Sad", "Confused"], ["Happy", "Sad", "Confused"]) %>'},{name:"Multi-suggester with mapping function (same as above example)",example:'<% await tp.system.multi_suggester((item) => item, ["Happy", "Sad", "Confused"]) %>'},{name:"Multi-suggester for files",example:"<% (await tp.system.multi_suggester((item) => item.basename, tp.app.vault.getMarkdownFiles())).map(f => `[[${f.basename}]]`) %>"},{name:"Multi-suggester for tags",example:'<% await tp.system.multi_suggester(item => item, Object.keys(tp.app.metadataCache.getTags()).map(x => x.replace("#", ""))) %>'},{name:"Reuse value from multi-suggester",example:`<%*
selectedvalue:<%selectedValue%>`}]}}},web:{name:"web",description:"This modules contains every internal function related to the web (making web requests).",functions:{daily_quote:{name:"daily_quote",description:"Retrieves and parses the daily quote from `https://github.com/Zachatoo/quotes-database` as a callout.",definition:"tp.web.daily_quote()",examples:[{name:"Daily quote",example:"<% await tp.web.daily_quote() %>"}]},random_picture:{name:"random_picture",description:"Gets a random image from `https://unsplash.com/`.",definition:"tp.web.random_picture(size?: string, query?: string, include_size?: boolean)",args:[{name:"size",description:"Image size in the format `<width>x<height>`."},{name:"query",description:"Limits selection to photos matching a search term. Multiple search terms can be passed separated by a comma."},{name:"include_size",description:"Optional argument to include the specified size in the image link markdown. Defaults to false."}],examples:[{name:"Random picture",example:"<% await tp.web.random_picture() %>"},{name:"Random picture with size",example:'<% await tp.web.random_picture("200x200") %>'},{name:"Random picture with size and query",example:'<% await tp.web.random_picture("200x200", "landscape,water") %>'}]},request:{name:"request",description:"Makes a HTTP request to the specified URL. Optionally, you can specify a path to extract specific data from the response.",definition:"tp.web.request(url: string, path?: string)",args:[{name:"url",description:"The URL to which the HTTP request will be made."},{name:"path",description:"A path within the response JSON to extract specific data."}],examples:[{name:"Simple request",example:'<% await tp.web.request("https://jsonplaceholder.typicode.com/todos/1") %>'},{name:"Request with path",example:'<% await tp.web.request("https://jsonplaceholder.typicode.com/todos", "0.title") %>'}]}}}},di={tp:Yo};var Go=["app","config","date","file","frontmatter","hooks","obsidian","system","user","web"],Ro=new Set(Go);function mr(r){return typeof r=="string"&&Ro.has(r)}function gi(r){return!!(r.definition||r.returns||r.args)}var hr=class{constructor(e){this.plugin=e;this.documentation=di}get_all_modules_documentation(){let e=this.documentation.tp,t=Object.values(e);return(!this.plugin.settings||!this.plugin.settings.user_scripts_folder)&&(t=t.filter(n=>n.name!=="user")),t.map(n=>(n.queryKey=n.name,n))}async get_all_functions_documentation(e,t){if(e==="app")return this.get_app_functions_documentation(this.plugin.app,t);if(e==="user"){if(!this.plugin.settings||!this.plugin.settings.user_scripts_folder)return;let n=await se(async()=>{let i=je(this.plugin.app,this.plugin.settings.user_scripts_folder).filter(s=>s.extension=="js");return await Wr(this.plugin.app,i)},"User Scripts folder doesn't exist");return!n||n.length===0?void 0:n.reduce((i,o)=>o.extension!=="js"?i:[...i,{name:o.basename,queryKey:o.basename,definition:"",description:o.description,returns:o.returns,args:o.arguments.reduce((l,u)=>(l[u.name]={name:u.name,description:u.description},l),{}),example:""}],[])}if(!!this.documentation.tp[e].functions)return Object.values(this.documentation.tp[e].functions).map(n=>(n.queryKey=n.name,n))}get_app_functions_documentation(e,t){if(!St(e))return[];let n=t.split(".");if(n.length===0)return[];let i=e;for(let u=0;u<n.length-1;u++){let d=n[u];if(d in i){let h=i[d];if(!St(h))return[];i=h}}let o=["tp","app",...n.slice(0,n.length-1)].join("."),s=n.slice(0,n.length-1).join("."),l=[];for(let u in i){let d=`${o}.${u}`,h=s?`${s}.${u}`:u;l.push({name:u,queryKey:h,definition:typeof i[u]=="function"?`${d}(${Qr(i[u]).join(", ")})`:d,description:"",returns:"",example:""})}return l}get_module_documentation(e){return this.documentation.tp[e]}get_function_documentation(e,t){return this.documentation.tp[e].functions[t]}get_argument_documentation(e,t,n){let i=this.get_function_documentation(e,t);return!i||!i.args?null:i.args[n]}};var Ar=class extends mi.EditorSuggest{constructor(e){super(e.app);this.tp_keyword_regex=/tp\.(?<module>[a-z]*)?(?<fn_trigger>\.(?<fn>[a-zA-Z_.]*)?)?$/;this.module