/* THIS IS A GENERATED/BUNDLED FILE BY ESBUILD if you want to view the source, please visit the github repository of this plugin */ var ud=Object.create;var Ir=Object.defineProperty;var yu=Object.getOwnPropertyDescriptor;var cd=Object.getOwnPropertyNames;var pd=Object.getPrototypeOf,md=Object.prototype.hasOwnProperty;var so=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Va=(e,t)=>{for(var n in t)Ir(e,n,{get:t[n],enumerable:!0})},bu=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of cd(t))!md.call(e,i)&&i!==n&&Ir(e,i,{get:()=>t[i],enumerable:!(r=yu(t,i))||r.enumerable});return e};var Xn=(e,t,n)=>(n=e!=null?ud(pd(e)):{},bu(t||!e||!e.__esModule?Ir(n,"default",{value:e,enumerable:!0}):n,e)),fd=e=>bu(Ir({},"__esModule",{value:!0}),e),B=(e,t,n,r)=>{for(var i=r>1?void 0:r?yu(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&Ir(t,n,i),i};var wu=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var pt=(e,t,n)=>(wu(e,t,"read from private field"),n?n.call(e):t.get(e)),Jn=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},xu=(e,t,n,r)=>(wu(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var cs=so((Px,yc)=>{yc.exports=function(t){return t!=null&&t.constructor!=null&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}});var Cc=so((Nx,Tc)=>{"use strict";var vo=Object.prototype.hasOwnProperty,Oc=Object.prototype.toString,bc=Object.defineProperty,wc=Object.getOwnPropertyDescriptor,xc=function(t){return typeof Array.isArray=="function"?Array.isArray(t):Oc.call(t)==="[object Array]"},kc=function(t){if(!t||Oc.call(t)!=="[object Object]")return!1;var n=vo.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&vo.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i=="undefined"||vo.call(t,i)},vc=function(t,n){bc&&n.name==="__proto__"?bc(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Sc=function(t,n){if(n==="__proto__")if(vo.call(t,n)){if(wc)return wc(t,n).value}else return;return t[n]};Tc.exports=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for(typeof s=="boolean"&&(c=s,s=arguments[1]||{},l=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});l{var R=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},ue=-1,pe=1,Z=0;R.Diff=function(e,t){return[e,t]};R.prototype.diff_main=function(e,t,n,r){typeof r=="undefined"&&(this.Diff_Timeout<=0?r=Number.MAX_VALUE:r=new Date().getTime()+this.Diff_Timeout*1e3);var i=r;if(e==null||t==null)throw new Error("Null input. (diff_main)");if(e==t)return e?[new R.Diff(Z,e)]:[];typeof n=="undefined"&&(n=!0);var o=n,a=this.diff_commonPrefix(e,t),s=e.substring(0,a);e=e.substring(a),t=t.substring(a),a=this.diff_commonSuffix(e,t);var l=e.substring(e.length-a);e=e.substring(0,e.length-a),t=t.substring(0,t.length-a);var u=this.diff_compute_(e,t,o,i);return s&&u.unshift(new R.Diff(Z,s)),l&&u.push(new R.Diff(Z,l)),this.diff_cleanupMerge(u),u};R.prototype.diff_compute_=function(e,t,n,r){var i;if(!e)return[new R.Diff(pe,t)];if(!t)return[new R.Diff(ue,e)];var o=e.length>t.length?e:t,a=e.length>t.length?t:e,s=o.indexOf(a);if(s!=-1)return i=[new R.Diff(pe,o.substring(0,s)),new R.Diff(Z,a),new R.Diff(pe,o.substring(s+a.length))],e.length>t.length&&(i[0][0]=i[2][0]=ue),i;if(a.length==1)return[new R.Diff(ue,e),new R.Diff(pe,t)];var l=this.diff_halfMatch_(e,t);if(l){var u=l[0],c=l[1],p=l[2],m=l[3],f=l[4],d=this.diff_main(u,p,n,r),h=this.diff_main(c,m,n,r);return d.concat([new R.Diff(Z,f)],h)}return n&&e.length>100&&t.length>100?this.diff_lineMode_(e,t,r):this.diff_bisect_(e,t,r)};R.prototype.diff_lineMode_=function(e,t,n){var r=this.diff_linesToChars_(e,t);e=r.chars1,t=r.chars2;var i=r.lineArray,o=this.diff_main(e,t,!1,n);this.diff_charsToLines_(o,i),this.diff_cleanupSemantic(o),o.push(new R.Diff(Z,""));for(var a=0,s=0,l=0,u="",c="";a=1&&l>=1){o.splice(a-s-l,s+l),a=a-s-l;for(var p=this.diff_main(u,c,!1,n),m=p.length-1;m>=0;m--)o.splice(a,0,p[m]);a=a+p.length}l=0,s=0,u="",c="";break}a++}return o.pop(),o};R.prototype.diff_bisect_=function(e,t,n){for(var r=e.length,i=t.length,o=Math.ceil((r+i)/2),a=o,s=2*o,l=new Array(s),u=new Array(s),c=0;cn);b++){for(var O=-b+f;O<=b-d;O+=2){var S=a+O,E;O==-b||O!=b&&l[S-1]r)d+=2;else if(I>i)f+=2;else if(m){var k=a+p-O;if(k>=0&&k=_)return this.diff_bisectSplit_(e,t,E,I,n)}}}for(var M=-b+h;M<=b-g;M+=2){var k=a+M,_;M==-b||M!=b&&u[k-1]r)g+=2;else if(z>i)h+=2;else if(!m){var S=a+p-M;if(S>=0&&S=_)return this.diff_bisectSplit_(e,t,E,I,n)}}}}return[new R.Diff(ue,e),new R.Diff(pe,t)]};R.prototype.diff_bisectSplit_=function(e,t,n,r,i){var o=e.substring(0,n),a=t.substring(0,r),s=e.substring(n),l=t.substring(r),u=this.diff_main(o,a,!1,i),c=this.diff_main(s,l,!1,i);return u.concat(c)};R.prototype.diff_linesToChars_=function(e,t){var n=[],r={};n[0]="";function i(l){for(var u="",c=0,p=-1,m=n.length;pr?e=e.substring(n-r):nt.length?e:t,r=e.length>t.length?t:e;if(n.length<4||r.length*2=d.length?[E,I,k,_,S]:null}var a=o(n,r,Math.ceil(n.length/4)),s=o(n,r,Math.ceil(n.length/2)),l;if(!a&&!s)return null;s?a?l=a[4].length>s[4].length?a:s:l=s:l=a;var u,c,p,m;e.length>t.length?(u=l[0],c=l[1],p=l[2],m=l[3]):(p=l[0],m=l[1],u=l[2],c=l[3]);var f=l[4];return[u,c,p,m,f]};R.prototype.diff_cleanupSemantic=function(e){for(var t=!1,n=[],r=0,i=null,o=0,a=0,s=0,l=0,u=0;o0?n[r-1]:-1,a=0,s=0,l=0,u=0,i=null,t=!0)),o++;for(t&&this.diff_cleanupMerge(e),this.diff_cleanupSemanticLossless(e),o=1;o=f?(m>=c.length/2||m>=p.length/2)&&(e.splice(o,0,new R.Diff(Z,p.substring(0,m))),e[o-1][1]=c.substring(0,c.length-m),e[o+1][1]=p.substring(m),o++):(f>=c.length/2||f>=p.length/2)&&(e.splice(o,0,new R.Diff(Z,c.substring(0,f))),e[o-1][0]=pe,e[o-1][1]=p.substring(0,p.length-f),e[o+1][0]=ue,e[o+1][1]=c.substring(f),o++),o++}o++}};R.prototype.diff_cleanupSemanticLossless=function(e){function t(f,d){if(!f||!d)return 6;var h=f.charAt(f.length-1),g=d.charAt(0),b=h.match(R.nonAlphaNumericRegex_),O=g.match(R.nonAlphaNumericRegex_),S=b&&h.match(R.whitespaceRegex_),E=O&&g.match(R.whitespaceRegex_),I=S&&h.match(R.linebreakRegex_),k=E&&g.match(R.linebreakRegex_),_=I&&f.match(R.blanklineEndRegex_),M=k&&d.match(R.blanklineStartRegex_);return _||M?5:I||k?4:b&&!S&&E?3:S||E?2:b||O?1:0}for(var n=1;n=p&&(p=m,l=r,u=i,c=o)}e[n-1][1]!=l&&(l?e[n-1][1]=l:(e.splice(n-1,1),n--),e[n][1]=u,c?e[n+1][1]=c:(e.splice(n+1,1),n--))}n++}};R.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/;R.whitespaceRegex_=/\s/;R.linebreakRegex_=/[\r\n]/;R.blanklineEndRegex_=/\n\r?\n$/;R.blanklineStartRegex_=/^\r?\n\r?\n/;R.prototype.diff_cleanupEfficiency=function(e){for(var t=!1,n=[],r=0,i=null,o=0,a=!1,s=!1,l=!1,u=!1;o0?n[r-1]:-1,l=u=!1),t=!0)),o++;t&&this.diff_cleanupMerge(e)};R.prototype.diff_cleanupMerge=function(e){e.push(new R.Diff(Z,""));for(var t=0,n=0,r=0,i="",o="",a;t1?(n!==0&&r!==0&&(a=this.diff_commonPrefix(o,i),a!==0&&(t-n-r>0&&e[t-n-r-1][0]==Z?e[t-n-r-1][1]+=o.substring(0,a):(e.splice(0,0,new R.Diff(Z,o.substring(0,a))),t++),o=o.substring(a),i=i.substring(a)),a=this.diff_commonSuffix(o,i),a!==0&&(e[t][1]=o.substring(o.length-a)+e[t][1],o=o.substring(0,o.length-a),i=i.substring(0,i.length-a))),t-=n+r,e.splice(t,n+r),i.length&&(e.splice(t,0,new R.Diff(ue,i)),t++),o.length&&(e.splice(t,0,new R.Diff(pe,o)),t++),t++):t!==0&&e[t-1][0]==Z?(e[t-1][1]+=e[t][1],e.splice(t,1)):t++,r=0,n=0,i="",o="";break}e[e.length-1][1]===""&&e.pop();var s=!1;for(t=1;tt));a++)i=n,o=r;return e.length!=a&&e[a][0]===ue?o:o+(t-i)};R.prototype.diff_prettyHtml=function(e){for(var t=[],n=/&/g,r=//g,o=/\n/g,a=0;a");switch(s){case pe:t[a]=''+u+"";break;case ue:t[a]=''+u+"";break;case Z:t[a]=""+u+"";break}}return t.join("")};R.prototype.diff_text1=function(e){for(var t=[],n=0;nthis.Match_MaxBits)throw new Error("Pattern too long for this browser.");var r=this.match_alphabet_(t),i=this;function o(E,I){var k=E/t.length,_=Math.abs(n-I);return i.Match_Distance?k+_/i.Match_Distance:_?1:k}var a=this.Match_Threshold,s=e.indexOf(t,n);s!=-1&&(a=Math.min(o(0,s),a),s=e.lastIndexOf(t,n+t.length),s!=-1&&(a=Math.min(o(0,s),a)));var l=1<=d;b--){var O=r[e.charAt(b-1)];if(f===0?g[b]=(g[b+1]<<1|1)&O:g[b]=(g[b+1]<<1|1)&O|((m[b+1]|m[b])<<1|1)|m[b+1],g[b]&l){var S=o(f,b-1);if(S<=a)if(a=S,s=b-1,s>n)d=Math.max(1,2*n-s);else break}}if(o(f+1,n)>a)break;m=g}return s};R.prototype.match_alphabet_=function(e){for(var t={},n=0;n2&&(this.diff_cleanupSemantic(i),this.diff_cleanupEfficiency(i));else if(e&&typeof e=="object"&&typeof t=="undefined"&&typeof n=="undefined")i=e,r=this.diff_text1(i);else if(typeof e=="string"&&t&&typeof t=="object"&&typeof n=="undefined")r=e,i=t;else if(typeof e=="string"&&typeof t=="string"&&n&&typeof n=="object")r=e,i=n;else throw new Error("Unknown call format to patch_make.");if(i.length===0)return[];for(var o=[],a=new R.patch_obj,s=0,l=0,u=0,c=r,p=r,m=0;m=2*this.Patch_Margin&&s&&(this.patch_addContext_(a,c),o.push(a),a=new R.patch_obj,s=0,c=p,l=u);break}f!==pe&&(l+=d.length),f!==ue&&(u+=d.length)}return s&&(this.patch_addContext_(a,c),o.push(a)),o};R.prototype.patch_deepCopy=function(e){for(var t=[],n=0;nthis.Match_MaxBits?(l=this.match_main(t,s.substring(0,this.Match_MaxBits),a),l!=-1&&(u=this.match_main(t,s.substring(s.length-this.Match_MaxBits),a+s.length-this.Match_MaxBits),(u==-1||l>=u)&&(l=-1))):l=this.match_main(t,s,a),l==-1)i[o]=!1,r-=e[o].length2-e[o].length1;else{i[o]=!0,r=l-a;var c;if(u==-1?c=t.substring(l,l+s.length):c=t.substring(l,u+this.Match_MaxBits),s==c)t=t.substring(0,l)+this.diff_text2(e[o].diffs)+t.substring(l+s.length);else{var p=this.diff_main(s,c,!1);if(s.length>this.Match_MaxBits&&this.diff_levenshtein(p)/s.length>this.Patch_DeleteThreshold)i[o]=!1;else{this.diff_cleanupSemanticLossless(p);for(var m=0,f,d=0;do[0][1].length){var a=t-o[0][1].length;o[0][1]=n.substring(o[0][1].length)+o[0][1],i.start1-=a,i.start2-=a,i.length1+=a,i.length2+=a}if(i=e[e.length-1],o=i.diffs,o.length==0||o[o.length-1][0]!=Z)o.push(new R.Diff(Z,n)),i.length1+=t,i.length2+=t;else if(t>o[o.length-1][1].length){var a=t-o[o.length-1][1].length;o[o.length-1][1]+=n.substring(0,a),i.length1+=a,i.length2+=a}return n};R.prototype.patch_splitMax=function(e){for(var t=this.Match_MaxBits,n=0;n2*t?(s.length1+=c.length,i+=c.length,l=!1,s.diffs.push(new R.Diff(u,c)),r.diffs.shift()):(c=c.substring(0,t-s.length1-this.Patch_Margin),s.length1+=c.length,i+=c.length,u===Z?(s.length2+=c.length,o+=c.length):l=!1,s.diffs.push(new R.Diff(u,c)),c==r.diffs[0][1]?r.diffs.shift():r.diffs[0][1]=r.diffs[0][1].substring(c.length))}a=this.diff_text2(s.diffs),a=a.substring(a.length-this.Patch_Margin);var p=this.diff_text1(r.diffs).substring(0,this.Patch_Margin);p!==""&&(s.length1+=p.length,s.length2+=p.length,s.diffs.length!==0&&s.diffs[s.diffs.length-1][0]===Z?s.diffs[s.diffs.length-1][1]+=p:s.diffs.push(new R.Diff(Z,p))),l||e.splice(++n,0,s)}}};R.prototype.patch_toText=function(e){for(var t=[],n=0;n{(function(e,t){"use strict";typeof define=="function"&&define.amd?define(t):typeof ga=="object"&&ga.exports?ga.exports=t():e.log=t()})(Mf,function(){"use strict";var e=function(){},t="undefined",n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=["trace","debug","info","warn","error"];function i(d,h){var g=d[h];if(typeof g.bind=="function")return g.bind(d);try{return Function.prototype.bind.call(g,d)}catch(b){return function(){return Function.prototype.apply.apply(g,[d,arguments])}}}function o(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function a(d){return d==="debug"&&(d="log"),typeof console===t?!1:d==="trace"&&n?o:console[d]!==void 0?i(console,d):console.log!==void 0?i(console,"log"):e}function s(d,h){for(var g=0;g=0&&M<=b.levels.SILENT){if(O=M,z!==!1&&E(M),s.call(b,M,d),typeof console===t&&MHa});module.exports=fd(yx);var xe=require("obsidian");function Du(e){return typeof e=="undefined"||e===null}function dd(e){return typeof e=="object"&&e!==null}function hd(e){return Array.isArray(e)?e:Du(e)?[]:[e]}function gd(e,t){var n,r,i,o;if(t)for(o=Object.keys(t),n=0,r=o.length;ns&&(o=" ... ",t=r-s+o.length),n-r>s&&(a=" ...",n=r+s-a.length),{str:o+e.slice(t,n).replace(/\t/g,"\u2192")+a,pos:r-t+o.length}}function Wa(e,t){return Ee.repeat(" ",t-e.length)+e}function Td(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var n=/\r?\n|\r|\0/g,r=[0],i=[],o,a=-1;o=n.exec(e.buffer);)i.push(o.index),r.push(o.index+o[0].length),e.position<=o.index&&a<0&&(a=r.length-2);a<0&&(a=r.length-1);var s="",l,u,c=Math.min(e.line+t.linesAfter,i.length).toString().length,p=t.maxLength-(t.indent+c+3);for(l=1;l<=t.linesBefore&&!(a-l<0);l++)u=Ka(e.buffer,r[a-l],i[a-l],e.position-(r[a]-r[a-l]),p),s=Ee.repeat(" ",t.indent)+Wa((e.line-l+1).toString(),c)+" | "+u.str+` `+s;for(u=Ka(e.buffer,r[a],i[a],e.position,p),s+=Ee.repeat(" ",t.indent)+Wa((e.line+1).toString(),c)+" | "+u.str+` `,s+=Ee.repeat("-",t.indent+c+3+u.pos)+`^ `,l=1;l<=t.linesAfter&&!(a+l>=i.length);l++)u=Ka(e.buffer,r[a+l],i[a+l],e.position-(r[a]-r[a+l]),p),s+=Ee.repeat(" ",t.indent)+Wa((e.line+l+1).toString(),c)+" | "+u.str+` `;return s.replace(/\n$/,"")}var Cd=Td,Ad=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Ed=["scalar","sequence","mapping"];function Ld(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(r){t[String(r)]=n})}),t}function _d(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(Ad.indexOf(n)===-1)throw new Je('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(n){return n},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=Ld(t.styleAliases||null),Ed.indexOf(this.kind)===-1)throw new Je('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var He=_d;function ku(e,t){var n=[];return e[t].forEach(function(r){var i=n.length;n.forEach(function(o,a){o.tag===r.tag&&o.kind===r.kind&&o.multi===r.multi&&(i=a)}),n[i]=r}),n}function Id(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,n;function r(i){i.multi?(e.multi[i.kind].push(i),e.multi.fallback.push(i)):e[i.kind][i.tag]=e.fallback[i.tag]=i}for(t=0,n=arguments.length;t=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Xd=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Jd(e){return!(e===null||!Xd.test(e)||e[e.length-1]==="_")}function eh(e){var t,n;return t=e.replace(/_/g,"").toLowerCase(),n=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:n*parseFloat(t,10)}var th=/^[-+]?[0-9]+e/;function nh(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Ee.isNegativeZero(e))return"-0.0";return n=e.toString(10),th.test(n)?n.replace("e",".e"):n}function rh(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Ee.isNegativeZero(e))}var ih=new He("tag:yaml.org,2002:float",{kind:"scalar",resolve:Jd,construct:eh,predicate:rh,represent:nh,defaultStyle:"lowercase"}),oh=Dd.extend({implicit:[$d,qd,Qd,ih]}),ah=oh,Nu=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),zu=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function sh(e){return e===null?!1:Nu.exec(e)!==null||zu.exec(e)!==null}function lh(e){var t,n,r,i,o,a,s,l=0,u=null,c,p,m;if(t=Nu.exec(e),t===null&&(t=zu.exec(e)),t===null)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(o=+t[4],a=+t[5],s=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(c=+t[10],p=+(t[11]||0),u=(c*60+p)*6e4,t[9]==="-"&&(u=-u)),m=new Date(Date.UTC(n,r,i,o,a,s,l)),u&&m.setTime(m.getTime()-u),m}function uh(e){return e.toISOString()}var ch=new He("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:sh,construct:lh,instanceOf:Date,represent:uh});function ph(e){return e==="<<"||e===null}var mh=new He("tag:yaml.org,2002:merge",{kind:"scalar",resolve:ph}),es=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= \r`;function fh(e){if(e===null)return!1;var t,n,r=0,i=e.length,o=es;for(n=0;n64)){if(t<0)return!1;r+=6}return r%8===0}function dh(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,o=es,a=0,s=[];for(t=0;t>16&255),s.push(a>>8&255),s.push(a&255)),a=a<<6|o.indexOf(r.charAt(t));return n=i%4*6,n===0?(s.push(a>>16&255),s.push(a>>8&255),s.push(a&255)):n===18?(s.push(a>>10&255),s.push(a>>2&255)):n===12&&s.push(a>>4&255),new Uint8Array(s)}function hh(e){var t="",n=0,r,i,o=e.length,a=es;for(r=0;r>18&63],t+=a[n>>12&63],t+=a[n>>6&63],t+=a[n&63]),n=(n<<8)+e[r];return i=o%3,i===0?(t+=a[n>>18&63],t+=a[n>>12&63],t+=a[n>>6&63],t+=a[n&63]):i===2?(t+=a[n>>10&63],t+=a[n>>4&63],t+=a[n<<2&63],t+=a[64]):i===1&&(t+=a[n>>2&63],t+=a[n<<4&63],t+=a[64],t+=a[64]),t}function gh(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var yh=new He("tag:yaml.org,2002:binary",{kind:"scalar",resolve:fh,construct:dh,predicate:gh,represent:hh}),bh=Object.prototype.hasOwnProperty,wh=Object.prototype.toString;function xh(e){if(e===null)return!0;var t=[],n,r,i,o,a,s=e;for(n=0,r=s.length;n>10)+55296,(e-65536&1023)+56320)}var Vu=new Array(256),Ku=new Array(256);for(kn=0;kn<256;kn++)Vu[kn]=Ou(kn)?1:0,Ku[kn]=Ou(kn);var kn;function zh(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||$u,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Wu(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=Cd(n),new Je(t,n)}function j(e,t){throw Wu(e,t)}function co(e,t){e.onWarning&&e.onWarning.call(null,Wu(e,t))}var Tu={YAML:function(t,n,r){var i,o,a;t.version!==null&&j(t,"duplication of %YAML directive"),r.length!==1&&j(t,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&j(t,"ill-formed argument of the YAML directive"),o=parseInt(i[1],10),a=parseInt(i[2],10),o!==1&&j(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=a<2,a!==1&&a!==2&&co(t,"unsupported YAML version of the document")},TAG:function(t,n,r){var i,o;r.length!==2&&j(t,"TAG directive accepts exactly two arguments"),i=r[0],o=r[1],ju.test(i)||j(t,"ill-formed tag handle (first argument) of the TAG directive"),tn.call(t.tagMap,i)&&j(t,'there is a previously declared suffix for "'+i+'" tag handle'),qu.test(o)||j(t,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch(a){j(t,"tag prefix is malformed: "+o)}t.tagMap[i]=o}};function en(e,t,n,r){var i,o,a,s;if(t1&&(e.result+=Ee.repeat(` `,t-1))}function $h(e,t,n){var r,i,o,a,s,l,u,c,p=e.kind,m=e.result,f;if(f=e.input.charCodeAt(e.position),st(f)||tr(f)||f===35||f===38||f===42||f===33||f===124||f===62||f===39||f===34||f===37||f===64||f===96||(f===63||f===45)&&(i=e.input.charCodeAt(e.position+1),st(i)||n&&tr(i)))return!1;for(e.kind="scalar",e.result="",o=a=e.position,s=!1;f!==0;){if(f===58){if(i=e.input.charCodeAt(e.position+1),st(i)||n&&tr(i))break}else if(f===35){if(r=e.input.charCodeAt(e.position-1),st(r))break}else{if(e.position===e.lineStart&&fo(e)||n&&tr(f))break;if(Mt(f))if(l=e.line,u=e.lineStart,c=e.lineIndent,Ce(e,!1,-1),e.lineIndent>=t){s=!0,f=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=l,e.lineStart=u,e.lineIndent=c;break}}s&&(en(e,o,a,!1),ns(e,e.line-l),o=a=e.position,s=!1),vn(f)||(a=e.position+1),f=e.input.charCodeAt(++e.position)}return en(e,o,a,!1),e.result?!0:(e.kind=p,e.result=m,!1)}function Hh(e,t){var n,r,i;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(en(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)r=e.position,e.position++,i=e.position;else return!0;else Mt(n)?(en(e,r,i,!0),ns(e,Ce(e,!1,t)),r=i=e.position):e.position===e.lineStart&&fo(e)?j(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);j(e,"unexpected end of the stream within a single quoted scalar")}function Yh(e,t){var n,r,i,o,a,s;if(s=e.input.charCodeAt(e.position),s!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;(s=e.input.charCodeAt(e.position))!==0;){if(s===34)return en(e,n,e.position,!0),e.position++,!0;if(s===92){if(en(e,n,e.position,!0),s=e.input.charCodeAt(++e.position),Mt(s))Ce(e,!1,t);else if(s<256&&Vu[s])e.result+=Ku[s],e.position++;else if((a=Dh(s))>0){for(i=a,o=0;i>0;i--)s=e.input.charCodeAt(++e.position),(a=Rh(s))>=0?o=(o<<4)+a:j(e,"expected hexadecimal character");e.result+=Nh(o),e.position++}else j(e,"unknown escape sequence");n=r=e.position}else Mt(s)?(en(e,n,r,!0),ns(e,Ce(e,!1,t)),n=r=e.position):e.position===e.lineStart&&fo(e)?j(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}j(e,"unexpected end of the stream within a double quoted scalar")}function jh(e,t){var n=!0,r,i,o,a=e.tag,s,l=e.anchor,u,c,p,m,f,d=Object.create(null),h,g,b,O;if(O=e.input.charCodeAt(e.position),O===91)c=93,f=!1,s=[];else if(O===123)c=125,f=!0,s={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),O=e.input.charCodeAt(++e.position);O!==0;){if(Ce(e,!0,t),O=e.input.charCodeAt(e.position),O===c)return e.position++,e.tag=a,e.anchor=l,e.kind=f?"mapping":"sequence",e.result=s,!0;n?O===44&&j(e,"expected the node content, but found ','"):j(e,"missed comma between flow collection entries"),g=h=b=null,p=m=!1,O===63&&(u=e.input.charCodeAt(e.position+1),st(u)&&(p=m=!0,e.position++,Ce(e,!0,t))),r=e.line,i=e.lineStart,o=e.position,rr(e,t,lo,!1,!0),g=e.tag,h=e.result,Ce(e,!0,t),O=e.input.charCodeAt(e.position),(m||e.line===r)&&O===58&&(p=!0,O=e.input.charCodeAt(++e.position),Ce(e,!0,t),rr(e,t,lo,!1,!0),b=e.result),f?nr(e,s,d,g,h,b,r,i,o):p?s.push(nr(e,null,d,g,h,b,r,i,o)):s.push(h),Ce(e,!0,t),O=e.input.charCodeAt(e.position),O===44?(n=!0,O=e.input.charCodeAt(++e.position)):n=!1}j(e,"unexpected end of the stream within a flow collection")}function qh(e,t){var n,r,i=Ua,o=!1,a=!1,s=t,l=0,u=!1,c,p;if(p=e.input.charCodeAt(e.position),p===124)r=!1;else if(p===62)r=!0;else return!1;for(e.kind="scalar",e.result="";p!==0;)if(p=e.input.charCodeAt(++e.position),p===43||p===45)Ua===i?i=p===43?vu:Ih:j(e,"repeat of a chomping mode identifier");else if((c=Ph(p))>=0)c===0?j(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?j(e,"repeat of an indentation width identifier"):(s=t+c-1,a=!0);else break;if(vn(p)){do p=e.input.charCodeAt(++e.position);while(vn(p));if(p===35)do p=e.input.charCodeAt(++e.position);while(!Mt(p)&&p!==0)}for(;p!==0;){for(ts(e),e.lineIndent=0,p=e.input.charCodeAt(e.position);(!a||e.lineIndents&&(s=e.lineIndent),Mt(p)){l++;continue}if(e.lineIndentt)&&l!==0)j(e,"bad indentation of a sequence entry");else if(e.lineIndentt)&&(g&&(a=e.line,s=e.lineStart,l=e.position),rr(e,t,uo,!0,i)&&(g?d=e.result:h=e.result),g||(nr(e,p,m,f,d,h,a,s,l),f=d=h=null),Ce(e,!0,-1),O=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&O!==0)j(e,"bad indentation of a mapping entry");else if(e.lineIndentt?l=1:e.lineIndent===t?l=0:e.lineIndentt?l=1:e.lineIndent===t?l=0:e.lineIndent tag; it should be "scalar", not "'+e.kind+'"'),p=0,m=e.implicitTypes.length;p"),e.result!==null&&d.kind!==e.kind&&j(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+d.kind+'", not "'+e.kind+'"'),d.resolve(e.result,e.tag)?(e.result=d.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):j(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||c}function Gh(e){var t=e.position,n,r,i,o=!1,a;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(a=e.input.charCodeAt(e.position))!==0&&(Ce(e,!0,-1),a=e.input.charCodeAt(e.position),!(e.lineIndent>0||a!==37));){for(o=!0,a=e.input.charCodeAt(++e.position),n=e.position;a!==0&&!st(a);)a=e.input.charCodeAt(++e.position);for(r=e.input.slice(n,e.position),i=[],r.length<1&&j(e,"directive name must not be less than one character in length");a!==0;){for(;vn(a);)a=e.input.charCodeAt(++e.position);if(a===35){do a=e.input.charCodeAt(++e.position);while(a!==0&&!Mt(a));break}if(Mt(a))break;for(n=e.position;a!==0&&!st(a);)a=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}a!==0&&ts(e),tn.call(Tu,r)?Tu[r](e,r,i):co(e,'unknown document directive "'+r+'"')}if(Ce(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,Ce(e,!0,-1)):o&&j(e,"directives end mark is expected"),rr(e,e.lineIndent-1,uo,!1,!0),Ce(e,!0,-1),e.checkLineBreaks&&Bh.test(e.input.slice(t,e.position))&&co(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&fo(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,Ce(e,!0,-1));return}if(e.position=55296&&n<=56319&&t+1=56320&&r<=57343)?(n-55296)*1024+r-56320+65536:n}function rc(e){var t=/^\n* /;return t.test(e)}var ic=1,Xa=2,oc=3,ac=4,er=5;function Tg(e,t,n,r,i,o,a,s){var l,u=0,c=null,p=!1,m=!1,f=r!==-1,d=-1,h=Sg(Mr(e,0))&&Og(Mr(e,e.length-1));if(t||a)for(l=0;l=65536?l+=2:l++){if(u=Mr(e,l),!Dr(u))return er;h=h&&_u(u,c,s),c=u}else{for(l=0;l=65536?l+=2:l++){if(u=Mr(e,l),u===Fr)p=!0,f&&(m=m||l-d-1>r&&e[d+1]!==" ",d=l);else if(!Dr(u))return er;h=h&&_u(u,c,s),c=u}m=m||f&&l-d-1>r&&e[d+1]!==" "}return!p&&!m?h&&!a&&!i(e)?ic:o===Rr?er:Xa:n>9&&rc(e)?er:a?o===Rr?er:Xa:m?ac:oc}function Cg(e,t,n,r,i){e.dump=function(){if(t.length===0)return e.quotingType===Rr?'""':"''";if(!e.noCompatMode&&(gg.indexOf(t)!==-1||yg.test(t)))return e.quotingType===Rr?'"'+t+'"':"'"+t+"'";var o=e.indent*Math.max(1,n),a=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),s=r||e.flowLevel>-1&&n>=e.flowLevel;function l(u){return vg(e,u)}switch(Tg(t,s,e.indent,a,l,e.quotingType,e.forceQuotes&&!r,i)){case ic:return t;case Xa:return"'"+t.replace(/'/g,"''")+"'";case oc:return"|"+Iu(t,e.indent)+Mu(Eu(t,o));case ac:return">"+Iu(t,e.indent)+Mu(Eu(Ag(t,a),o));case er:return'"'+Eg(t)+'"';default:throw new Je("impossible error: invalid scalar style")}}()}function Iu(e,t){var n=rc(e)?String(t):"",r=e[e.length-1]===` `,i=r&&(e[e.length-2]===` `||e===` `),o=i?"+":r?"":"-";return n+o+` `}function Mu(e){return e[e.length-1]===` `?e.slice(0,-1):e}function Ag(e,t){for(var n=/(\n+)([^\n]*)/g,r=function(){var u=e.indexOf(` `);return u=u!==-1?u:e.length,n.lastIndex=u,Bu(e.slice(0,u),t)}(),i=e[0]===` `||e[0]===" ",o,a;a=n.exec(e);){var s=a[1],l=a[2];o=l[0]===" ",r+=s+(!i&&!o&&l!==""?` `:"")+Bu(l,t),i=o}return r}function Bu(e,t){if(e===""||e[0]===" ")return e;for(var n=/ [^ ]/g,r,i=0,o,a=0,s=0,l="";r=n.exec(e);)s=r.index,s-i>t&&(o=a>i?a:s,l+=` `+e.slice(i,o),i=o+1),a=s;return l+=` `,e.length-i>t&&a>i?l+=e.slice(i,a)+` `+e.slice(a+1):l+=e.slice(i),l.slice(1)}function Eg(e){for(var t="",n=0,r,i=0;i=65536?i+=2:i++)n=Mr(e,i),r=Ye[n],!r&&Dr(n)?(t+=e[i],n>=65536&&(t+=e[i+1])):t+=r||wg(n);return t}function Lg(e,t,n){var r="",i=e.tag,o,a,s;for(o=0,a=n.length;o1024&&(c+="? "),c+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Yt(e,t,u,!1,!1)&&(c+=e.dump,r+=c));e.tag=i,e.dump="{"+r+"}"}function Ig(e,t,n,r){var i="",o=e.tag,a=Object.keys(n),s,l,u,c,p,m;if(e.sortKeys===!0)a.sort();else if(typeof e.sortKeys=="function")a.sort(e.sortKeys);else if(e.sortKeys)throw new Je("sortKeys must be a boolean or a function");for(s=0,l=a.length;s1024,p&&(e.dump&&Fr===e.dump.charCodeAt(0)?m+="?":m+="? "),m+=e.dump,p&&(m+=Qa(e,t)),Yt(e,t+1,c,!0,p)&&(e.dump&&Fr===e.dump.charCodeAt(0)?m+=":":m+=": ",m+=e.dump,i+=m));e.tag=o,e.dump=i||"{}"}function Ru(e,t,n){var r,i,o,a,s,l;for(i=n?e.explicitTypes:e.implicitTypes,o=0,a=i.length;o tag resolver accepts not "'+l+'" style');e.dump=r}return!0}return!1}function Yt(e,t,n,r,i,o,a){e.tag=null,e.dump=n,Ru(e,n,!1)||Ru(e,n,!0);var s=Zu.call(e.dump),l=r,u;r&&(r=e.flowLevel<0||e.flowLevel>t);var c=s==="[object Object]"||s==="[object Array]",p,m;if(c&&(p=e.duplicates.indexOf(n),m=p!==-1),(e.tag!==null&&e.tag!=="?"||m||e.indent!==2&&t>0)&&(i=!1),m&&e.usedDuplicates[p])e.dump="*ref_"+p;else{if(c&&m&&!e.usedDuplicates[p]&&(e.usedDuplicates[p]=!0),s==="[object Object]")r&&Object.keys(e.dump).length!==0?(Ig(e,t,e.dump,i),m&&(e.dump="&ref_"+p+e.dump)):(_g(e,t,e.dump),m&&(e.dump="&ref_"+p+" "+e.dump));else if(s==="[object Array]")r&&e.dump.length!==0?(e.noArrayIndent&&!a&&t>0?Fu(e,t-1,e.dump,i):Fu(e,t,e.dump,i),m&&(e.dump="&ref_"+p+e.dump)):(Lg(e,t,e.dump),m&&(e.dump="&ref_"+p+" "+e.dump));else if(s==="[object String]")e.tag!=="?"&&Cg(e,e.dump,t,o,l);else{if(s==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new Je("unacceptable kind of an object to dump "+s)}e.tag!==null&&e.tag!=="?"&&(u=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",e.dump=u+" "+e.dump)}return!0}function Mg(e,t){var n=[],r=[],i,o;for(Ja(e,n,r),i=0,o=r.length;i(i=!0,s+r));return i||(o=`${e}${r}`),o}function Be(e,t){let n=e.match(ls(t));return n==null?null:n[2]}function Sn(e,t){return e.replace(ls(t),"")}function ht(e){if(e==null)return null;let t=sc(e.replace(/\n(\t)+/g,` `));return t==null?{}:t}function ft(e,t){switch(typeof e=="string"&&(e=[e]),t){case"single-line":return e==null||e.length===0?" []":" "+ss(e);case"multi-line":return e==null||e.length===0?` - `:` - `+e.join(` - `);case"single string to single-line":return e==null||e.length===0?" ":e.length===1?" "+e[0]:" "+ss(e);case"single string to multi-line":return e==null||e.length===0?" ":e.length===1?" "+e[0]:` - `+e.join(` - `);case"single string space delimited":return e==null||e.length===0?" ":e.length===1?" "+e[0]:" "+e.join(" ");case"single string comma delimited":return e==null||e.length===0?" ":e.length===1?" "+e[0]:" "+e.join(", ");case"single-line space delimited":return e==null||e.length===0?" []":e.length===1?" "+e[0]:" "+ss(e).replaceAll(", "," ")}}function ss(e){return e==null||e.length===0?"[]":"["+e.join(", ")+"]"}function Ft(e){if(e==null||e.length===0)return null;if(e=e.trimEnd(),e.startsWith("[")){if(e=e.substring(1),e.endsWith("]")&&(e=e.substring(0,e.length-1)),e.length===0)return null;let t=e.split(", ");return t=t.length>1?t:t[0].split(","),t.filter(n=>n!="")}if(e.includes(` `)){let t=e.split(/[ \t]*\n[ \t]*-[ \t]*/);return t.splice(0,1),t=t.filter(n=>n!=""),t==null||t.length===0?null:t}return e}function yo(e){return typeof e=="string"?e.includes(",")?e.split(", "):e.split(" "):e}function bo(e){return typeof e=="string"?e.split(", "):e}var dr=require("obsidian");var jt=function(e){if(e==null)return Yg;if(typeof e=="string")return Hg(e);if(typeof e=="object")return Array.isArray(e)?zg(e):$g(e);if(typeof e=="function")return wo(e);throw new Error("Expected function, string, or object as test")};function zg(e){let t=[],n=-1;for(;++n":""))+")"})),m;function m(){let f=[],d,h,g;if((!t||i(s,l,u[u.length-1]||null))&&(f=jg(n(s,u)),f[0]===zr))return f;if(s.children&&f[0]!==hc)for(h=(r?s.children.length:-1)+o,g=u.concat(s);h>-1&&h0){let c=s.split(` `);o=(u=c[c.length-1])!=null?u:"",a=o.trim()=="",a||(o=o.trimEnd());let p=0;for(;c.length-(2+p)>=0;){let m=c[c.length-(2+p)];if(!on(o,m,a)&&(!r||!on("",m,!0)))break;p++}c.splice(c.length-(1+p),p),c.length>1&&(r&&c[c.length-2].match(/^> ?.*$/m)||!r&&!on(o,c[c.length-2],a)?c.splice(c.length-1,0,o):on("",c[c.length-2],!0)||c.splice(c.length-1,0,"")),s=c.join(` `)}let l=e.substring(n);if(l.length>0){let c=l.split(` `),p=0;for(;p+11&&(r&&c[1].match(/^> ?.*$/m)||!r&&!on(o,c[1],a)?c.splice(1,0,o):r&&!on("",c[1],a)&&c.splice(1,0,"")),l=c.join(` `)}return s+i+l}function us(e){if(e)throw e}var Pc=Xn(cs(),1),bs=Xn(Cc(),1);function $r(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Ac(){let e=[],t={run:n,use:r};return t;function n(...i){let o=-1,a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);s(null,...i);function s(l,...u){let c=e[++o],p=-1;if(l){a(l);return}for(;++pa.length,l;s&&a.push(i);try{l=e(...a)}catch(u){let c=u;if(s&&n)throw c;return i(c)}s||(l instanceof Promise?l.then(o,i):l instanceof Error?i(l):o(l))}function i(a,...s){n||(n=!0,t(a,...s))}function o(a){i(null,a)}}var Bc=Xn(cs(),1);var or={}.hasOwnProperty;function Tn(e){return!e||typeof e!="object"?"":or.call(e,"position")||or.call(e,"type")?Ec(e.position):or.call(e,"start")||or.call(e,"end")?Ec(e):or.call(e,"line")||or.call(e,"column")?ps(e):""}function ps(e){return Lc(e&&e.line)+":"+Lc(e&&e.column)}function Ec(e){return ps(e&&e.start)+"-"+ps(e&&e.end)}function Lc(e){return e&&typeof e=="number"?e:1}var et=class extends Error{constructor(t,n,r){var i=[null,null],o={start:{line:null,column:null},end:{line:null,column:null}},a;super(),typeof n=="string"&&(r=n,n=null),typeof r=="string"&&(a=r.indexOf(":"),a===-1?i[1]=r:(i[0]=r.slice(0,a),i[1]=r.slice(a+1))),n&&("type"in n||"position"in n?n.position&&(o=n.position):"start"in n||"end"in n?o=n:("line"in n||"column"in n)&&(o.start=n)),this.name=Tn(n)||"1:1",this.message=typeof t=="object"?t.message:t,this.stack=typeof t=="object"?t.stack:"",this.reason=this.message,this.line=o.start.line,this.column=o.start.column,this.source=i[0],this.ruleId=i[1],this.position=o,this.file,this.fatal,this.url,this.note}};et.prototype.file="";et.prototype.name="";et.prototype.reason="";et.prototype.message="";et.prototype.stack="";et.prototype.fatal=null;et.prototype.column=null;et.prototype.line=null;et.prototype.source=null;et.prototype.ruleId=null;et.prototype.position=null;var Tt={basename:Vg,dirname:Kg,extname:Wg,join:Ug,sep:"/"};function Vg(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Hr(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.charCodeAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,s=t.length-1;for(;i--;)if(e.charCodeAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),s>-1&&(e.charCodeAt(i)===t.charCodeAt(s--)?s<0&&(r=i):(s=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function Kg(e){if(Hr(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.charCodeAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.charCodeAt(0)===47?"/":".":t===1&&e.charCodeAt(0)===47?"//":e.slice(0,t)}function Wg(e){Hr(e);let t=e.length,n=-1,r=0,i=-1,o=0,a;for(;t--;){let s=e.charCodeAt(t);if(s===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),s===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Ug(...e){let t=-1,n;for(;++t0&&e.charCodeAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Zg(e,t){let n="",r=0,i=-1,o=0,a=-1,s,l;for(;++a<=e.length;){if(a2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=a,o=0;continue}}else if(n.length>0){n="",r=0,i=a,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,o=0}else s===46&&o>-1?o++:o=-1}return n}function Hr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var _c={cwd:Qg};function Qg(){return"/"}function Yr(e){return e!==null&&typeof e=="object"&&e.href&&e.origin}function Ic(e){if(typeof e=="string")e=new URL(e);else if(!Yr(e)){let t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){let t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Xg(e)}function Xg(e){if(e.hostname!==""){let r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}let t=e.pathname,n=-1;for(;++n{if(k||!_||!M)I(k);else{let z=o.stringify(_,M);z==null||(t1(z)?M.value=z:M.result=z),I(k,M)}});function I(k,_){k||!_?S(k):O?O(_):g(null,_)}}}function d(h){let g;o.freeze(),hs("processSync",o.Parser),gs("processSync",o.Compiler);let b=qr(h);return o.process(b,O),Dc("processSync","process",g),b;function O(S){g=!0,us(S)}}}function Fc(e,t){return typeof e=="function"&&e.prototype&&(Jg(e.prototype)||t in e.prototype)}function Jg(e){let t;for(t in e)if(Nc.call(e,t))return!0;return!1}function hs(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `Parser`")}function gs(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `Compiler`")}function ys(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Rc(e){if(!$r(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Dc(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function qr(e){return e1(e)?e:new jr(e)}function e1(e){return Boolean(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function t1(e){return typeof e=="string"||(0,Pc.default)(e)}function ar(e,t){var{includeImageAlt:n=!0}=t||{};return Hc(e,n)}function Hc(e,t){return e&&typeof e=="object"&&(e.value||(t?e.alt:"")||"children"in e&&$c(e.children,t)||Array.isArray(e)&&$c(e,t))||""}function $c(e,t){for(var n=[],r=-1;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),[].splice.apply(e,a);else for(n&&[].splice.apply(e,[t,n]);o0?(ve(e,e.length,0,t),e):t}var Yc={}.hasOwnProperty;function So(e){let t={},n=-1;for(;++na))return;let _=t.events.length,M=_,z,q;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){if(z){q=t.events[M][1].end;break}z=!0}for(b(r),k=_;kS;){let I=n[E];t.containerState=I[1],I[0].exit.call(t,e)}n.length=S}function O(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function a1(e,t,n){return Y(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function sr(e){if(e===null||J(e)||An(e))return 1;if(En(e))return 2}function ln(e,t,n){let r=[],i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let p=Object.assign({},e[r][1].end),m=Object.assign({},e[n][1].start);Gc(p,-l),Gc(m,l),a={type:l>1?"strongSequence":"emphasisSequence",start:p,end:Object.assign({},e[r][1].end)},s={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:m},o={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={type:l>1?"strong":"emphasis",start:Object.assign({},a.start),end:Object.assign({},s.end)},e[r][1].end=Object.assign({},a.start),e[n][1].start=Object.assign({},s.end),u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=tt(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=tt(u,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",o,t]]),u=tt(u,ln(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=tt(u,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=tt(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,ve(e,r-1,n-r+3,u),n=r+u.length-c-2;break}}for(n=-1;++n=4?a(u):n(u)}function a(u){return u===null?l(u):D(u)?e.attempt(b1,a,l)(u):(e.enter("codeFlowValue"),s(u))}function s(u){return u===null||D(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),s)}function l(u){return e.exit("codeIndented"),t(u)}}function x1(e,t,n){let r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):D(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):Y(e,o,"linePrefix",4+1)(a)}function o(a){let s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):D(a)?i(a):n(a)}}var vs={name:"codeText",tokenize:S1,resolve:k1,previous:v1};function k1(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function _o(e,t,n,r,i,o,a,s,l){let u=l||Number.POSITIVE_INFINITY,c=0;return p;function p(b){return b===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(b),e.exit(o),m):b===null||b===41||an(b)?n(b):(e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),h(b))}function m(b){return b===62?(e.enter(o),e.consume(b),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),f(b))}function f(b){return b===62?(e.exit("chunkString"),e.exit(s),m(b)):b===null||b===60||D(b)?n(b):(e.consume(b),b===92?d:f)}function d(b){return b===60||b===62||b===92?(e.consume(b),f):f(b)}function h(b){return b===40?++c>u?n(b):(e.consume(b),h):b===41?c--?(e.consume(b),h):(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(b)):b===null||J(b)?c?n(b):(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(b)):an(b)?n(b):(e.consume(b),b===92?g:h)}function g(b){return b===40||b===41||b===92?(e.consume(b),h):h(b)}}function Io(e,t,n,r,i,o){let a=this,s=0,l;return u;function u(f){return e.enter(r),e.enter(i),e.consume(f),e.exit(i),e.enter(o),c}function c(f){return f===null||f===91||f===93&&!l||f===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs||s>999?n(f):f===93?(e.exit(o),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):D(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),p(f))}function p(f){return f===null||f===91||f===93||D(f)||s++>999?(e.exit("chunkString"),c(f)):(e.consume(f),l=l||!Q(f),f===92?m:p)}function m(f){return f===91||f===92||f===93?(e.consume(f),s++,p):p(f)}}function Mo(e,t,n,r,i,o){let a;return s;function s(m){return e.enter(r),e.enter(i),e.consume(m),e.exit(i),a=m===40?41:m,l}function l(m){return m===a?(e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):(e.enter(o),u(m))}function u(m){return m===a?(e.exit(o),l(a)):m===null?n(m):D(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),Y(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(m))}function c(m){return m===a||m===null||D(m)?(e.exit("chunkString"),u(m)):(e.consume(m),m===92?p:c)}function p(m){return m===a||m===92?(e.consume(m),c):c(m)}}function Ln(e,t){let n;return r;function r(i){return D(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Q(i)?Y(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}function We(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var Os={name:"definition",tokenize:_1},L1={tokenize:I1,partial:!0};function _1(e,t,n){let r=this,i;return o;function o(l){return e.enter("definition"),Io.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(l)}function a(l){return i=We(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),l===58?(e.enter("definitionMarker"),e.consume(l),e.exit("definitionMarker"),Ln(e,_o(e,e.attempt(L1,Y(e,s,"whitespace"),Y(e,s,"whitespace")),n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString"))):n(l)}function s(l){return l===null||D(l)?(e.exit("definition"),r.parser.defined.includes(i)||r.parser.defined.push(i),t(l)):n(l)}}function I1(e,t,n){return r;function r(a){return J(a)?Ln(e,i)(a):n(a)}function i(a){return a===34||a===39||a===40?Mo(e,Y(e,o,"whitespace"),n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a):n(a)}function o(a){return a===null||D(a)?t(a):n(a)}}var Ts={name:"hardBreakEscape",tokenize:M1};function M1(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.enter("escapeMarker"),e.consume(o),i}function i(o){return D(o)?(e.exit("escapeMarker"),e.exit("hardBreakEscape"),t(o)):n(o)}}var Cs={name:"headingAtx",tokenize:F1,resolve:B1};function B1(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ve(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function F1(e,t,n){let r=this,i=0;return o;function o(c){return e.enter("atxHeading"),e.enter("atxHeadingSequence"),a(c)}function a(c){return c===35&&i++<6?(e.consume(c),a):c===null||J(c)?(e.exit("atxHeadingSequence"),r.interrupt?t(c):s(c)):n(c)}function s(c){return c===35?(e.enter("atxHeadingSequence"),l(c)):c===null||D(c)?(e.exit("atxHeading"),t(c)):Q(c)?Y(e,s,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function l(c){return c===35?(e.consume(c),l):(e.exit("atxHeadingSequence"),s(c))}function u(c){return c===null||c===35||J(c)?(e.exit("atxHeadingText"),s(c)):(e.consume(c),u)}}var Zc=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","source","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],As=["pre","script","style","textarea"];var Es={name:"htmlFlow",tokenize:P1,resolveTo:D1,concrete:!0},R1={tokenize:N1,partial:!0};function D1(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function P1(e,t,n){let r=this,i,o,a,s,l;return u;function u(x){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(x),c}function c(x){return x===33?(e.consume(x),p):x===47?(e.consume(x),d):x===63?(e.consume(x),i=3,r.interrupt?t:he):Ke(x)?(e.consume(x),a=String.fromCharCode(x),o=!0,h):n(x)}function p(x){return x===45?(e.consume(x),i=2,m):x===91?(e.consume(x),i=5,a="CDATA[",s=0,f):Ke(x)?(e.consume(x),i=4,r.interrupt?t:he):n(x)}function m(x){return x===45?(e.consume(x),r.interrupt?t:he):n(x)}function f(x){return x===a.charCodeAt(s++)?(e.consume(x),s===a.length?r.interrupt?t:H:f):n(x)}function d(x){return Ke(x)?(e.consume(x),a=String.fromCharCode(x),h):n(x)}function h(x){return x===null||x===47||x===62||J(x)?x!==47&&o&&As.includes(a.toLowerCase())?(i=1,r.interrupt?t(x):H(x)):Zc.includes(a.toLowerCase())?(i=6,x===47?(e.consume(x),g):r.interrupt?t(x):H(x)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(x):o?O(x):b(x)):x===45||Se(x)?(e.consume(x),a+=String.fromCharCode(x),h):n(x)}function g(x){return x===62?(e.consume(x),r.interrupt?t:H):n(x)}function b(x){return Q(x)?(e.consume(x),b):z(x)}function O(x){return x===47?(e.consume(x),z):x===58||x===95||Ke(x)?(e.consume(x),S):Q(x)?(e.consume(x),O):z(x)}function S(x){return x===45||x===46||x===58||x===95||Se(x)?(e.consume(x),S):E(x)}function E(x){return x===61?(e.consume(x),I):Q(x)?(e.consume(x),E):O(x)}function I(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(e.consume(x),l=x,k):Q(x)?(e.consume(x),I):(l=null,_(x))}function k(x){return x===null||D(x)?n(x):x===l?(e.consume(x),M):(e.consume(x),k)}function _(x){return x===null||x===34||x===39||x===60||x===61||x===62||x===96||J(x)?E(x):(e.consume(x),_)}function M(x){return x===47||x===62||Q(x)?O(x):n(x)}function z(x){return x===62?(e.consume(x),q):n(x)}function q(x){return Q(x)?(e.consume(x),q):x===null||D(x)?H(x):n(x)}function H(x){return x===45&&i===2?(e.consume(x),ne):x===60&&i===1?(e.consume(x),C):x===62&&i===4?(e.consume(x),le):x===63&&i===3?(e.consume(x),he):x===93&&i===5?(e.consume(x),te):D(x)&&(i===6||i===7)?e.check(R1,le,U)(x):x===null||D(x)?U(x):(e.consume(x),H)}function U(x){return e.exit("htmlFlowData"),P(x)}function P(x){return x===null?w(x):D(x)?e.attempt({tokenize:V,partial:!0},P,w)(x):(e.enter("htmlFlowData"),H(x))}function V(x,rt,it){return Xe;function Xe(ot){return x.enter("lineEnding"),x.consume(ot),x.exit("lineEnding"),vt}function vt(ot){return r.parser.lazy[r.now().line]?it(ot):rt(ot)}}function ne(x){return x===45?(e.consume(x),he):H(x)}function C(x){return x===47?(e.consume(x),a="",oe):H(x)}function oe(x){return x===62&&As.includes(a.toLowerCase())?(e.consume(x),le):Ke(x)&&a.length<8?(e.consume(x),a+=String.fromCharCode(x),oe):H(x)}function te(x){return x===93?(e.consume(x),he):H(x)}function he(x){return x===62?(e.consume(x),le):H(x)}function le(x){return x===null||D(x)?(e.exit("htmlFlowData"),w(x)):(e.consume(x),le)}function w(x){return e.exit("htmlFlow"),t(x)}}function N1(e,t,n){return r;function r(i){return e.exit("htmlFlowData"),e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),e.attempt(Rt,t,n)}}var Ls={name:"htmlText",tokenize:z1};function z1(e,t,n){let r=this,i,o,a,s;return l;function l(w){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(w),u}function u(w){return w===33?(e.consume(w),c):w===47?(e.consume(w),_):w===63?(e.consume(w),I):Ke(w)?(e.consume(w),q):n(w)}function c(w){return w===45?(e.consume(w),p):w===91?(e.consume(w),o="CDATA[",a=0,g):Ke(w)?(e.consume(w),E):n(w)}function p(w){return w===45?(e.consume(w),m):n(w)}function m(w){return w===null||w===62?n(w):w===45?(e.consume(w),f):d(w)}function f(w){return w===null||w===62?n(w):d(w)}function d(w){return w===null?n(w):w===45?(e.consume(w),h):D(w)?(s=d,te(w)):(e.consume(w),d)}function h(w){return w===45?(e.consume(w),le):d(w)}function g(w){return w===o.charCodeAt(a++)?(e.consume(w),a===o.length?b:g):n(w)}function b(w){return w===null?n(w):w===93?(e.consume(w),O):D(w)?(s=b,te(w)):(e.consume(w),b)}function O(w){return w===93?(e.consume(w),S):b(w)}function S(w){return w===62?le(w):w===93?(e.consume(w),S):b(w)}function E(w){return w===null||w===62?le(w):D(w)?(s=E,te(w)):(e.consume(w),E)}function I(w){return w===null?n(w):w===63?(e.consume(w),k):D(w)?(s=I,te(w)):(e.consume(w),I)}function k(w){return w===62?le(w):I(w)}function _(w){return Ke(w)?(e.consume(w),M):n(w)}function M(w){return w===45||Se(w)?(e.consume(w),M):z(w)}function z(w){return D(w)?(s=z,te(w)):Q(w)?(e.consume(w),z):le(w)}function q(w){return w===45||Se(w)?(e.consume(w),q):w===47||w===62||J(w)?H(w):n(w)}function H(w){return w===47?(e.consume(w),le):w===58||w===95||Ke(w)?(e.consume(w),U):D(w)?(s=H,te(w)):Q(w)?(e.consume(w),H):le(w)}function U(w){return w===45||w===46||w===58||w===95||Se(w)?(e.consume(w),U):P(w)}function P(w){return w===61?(e.consume(w),V):D(w)?(s=P,te(w)):Q(w)?(e.consume(w),P):H(w)}function V(w){return w===null||w===60||w===61||w===62||w===96?n(w):w===34||w===39?(e.consume(w),i=w,ne):D(w)?(s=V,te(w)):Q(w)?(e.consume(w),V):(e.consume(w),i=void 0,oe)}function ne(w){return w===i?(e.consume(w),C):w===null?n(w):D(w)?(s=ne,te(w)):(e.consume(w),ne)}function C(w){return w===62||w===47||J(w)?H(w):n(w)}function oe(w){return w===null||w===34||w===39||w===60||w===61||w===96?n(w):w===62||J(w)?H(w):(e.consume(w),oe)}function te(w){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),Y(e,he,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function he(w){return e.enter("htmlTextData"),s(w)}function le(w){return w===62?(e.consume(w),e.exit("htmlTextData"),e.exit("htmlText"),t):n(w)}}var _n={name:"labelEnd",tokenize:V1,resolveTo:q1,resolveAll:j1},$1={tokenize:K1},H1={tokenize:W1},Y1={tokenize:U1};function j1(e){let t=-1,n;for(;++t-1&&(a[0]=a[0].slice(r)),o>0&&a.push(e[i].slice(0,o))),a}function p0(e,t){let n=-1,r=[],i;for(;++nw0,contentInitial:()=>f0,disable:()=>x0,document:()=>m0,flow:()=>h0,flowInitial:()=>d0,insideSpan:()=>b0,string:()=>g0,text:()=>y0});var m0={[42]:Ue,[43]:Ue,[45]:Ue,[48]:Ue,[49]:Ue,[50]:Ue,[51]:Ue,[52]:Ue,[53]:Ue,[54]:Ue,[55]:Ue,[56]:Ue,[57]:Ue,[62]:Oo},f0={[91]:Os},d0={[-2]:Kr,[-1]:Kr,[32]:Kr},h0={[35]:Cs,[42]:In,[45]:[Bo,In],[60]:Es,[61]:Bo,[95]:In,[96]:Eo,[126]:Eo},g0={[38]:Ao,[92]:To},y0={[-5]:Wr,[-4]:Wr,[-3]:Wr,[33]:_s,[38]:Ao,[42]:Vr,[60]:[ks,Ls],[91]:Is,[92]:[Ts,To],[93]:_n,[95]:Vr,[96]:vs},b0={null:[Vr,Xc]},w0={null:[42,95]},x0={null:[]};function ip(e={}){let t=So([Ms].concat(e.extensions||[])),n={defined:[],lazy:{},constructs:t,content:r(Kc),document:r(Uc),flow:r(Qc),string:r(Jc),text:r(ep)};return n;function r(i){return o;function o(a){return rp(n,i,a)}}}var op=/[\0\t\n\r]/g;function ap(){let e=1,t="",n=!0,r;return i;function i(o,a,s){let l=[],u,c,p,m,f;for(o=t+o.toString(a),p=0,t="",n&&(o.charCodeAt(0)===65279&&p++,n=void 0);p13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"\uFFFD":String.fromCharCode(n)}var k0=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Ro(e){return e.replace(k0,v0)}function v0(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let i=n.charCodeAt(1),o=i===120||i===88;return Fo(n.slice(o?2:1),o?16:10)}return lr(n)||e}var Bs={}.hasOwnProperty,Fs=function(e,t,n){return typeof t!="string"&&(n=t,t=void 0),S0(n)(sp(ip(n).document().write(ap()(e,t,!0))))};function S0(e={}){let t=lp({transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(xn),autolinkProtocol:U,autolinkEmail:U,atxHeading:l(Cr),blockQuote:l(Jt),characterEscape:U,characterReference:U,codeFenced:l(wn),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:l(wn,u),codeText:l(Ya,u),codeTextData:U,data:U,codeFlowValue:U,definition:l(ja),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:l(Ji),hardBreakEscape:l(eo),hardBreakTrailing:l(eo),htmlFlow:l(to,u),htmlFlowData:U,htmlText:l(to,u),htmlTextData:U,image:l($t),label:u,link:l(xn),listItem:l(no),listItemValue:h,listOrdered:l(Ar,d),listUnordered:l(Ar),paragraph:l(Er),reference:vt,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:l(Cr),strong:l(ro),thematicBreak:l(oo)},exit:{atxHeading:p(),atxHeadingSequence:M,autolink:p(),autolinkEmail:It,autolinkProtocol:St,blockQuote:p(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:ce,characterReferenceMarkerNumeric:ce,characterReferenceValue:zt,codeFenced:p(S),codeFencedFence:O,codeFencedFenceInfo:g,codeFencedFenceMeta:b,codeFlowValue:P,codeIndented:p(E),codeText:p(te),codeTextData:P,data:P,definition:p(),definitionDestinationString:_,definitionLabelString:I,definitionTitleString:k,emphasis:p(),hardBreakEscape:p(ne),hardBreakTrailing:p(ne),htmlFlow:p(C),htmlFlowData:P,htmlText:p(oe),htmlTextData:P,image:p(le),label:x,labelText:w,lineEnding:V,link:p(he),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:ot,resourceDestinationString:rt,resourceTitleString:it,resource:Xe,setextHeading:p(H),setextHeadingLineSequence:q,setextHeadingText:z,strong:p(),thematicBreak:p()}},e.mdastExtensions||[]),n={};return r;function r(L){let N={type:"root",children:[]},K=[N],me=[],Ot=[],ao={stack:K,tokenStack:me,config:t,enter:c,exit:m,buffer:u,resume:f,setData:o,getData:a},fe=-1;for(;++fe0)throw new Error("Cannot close document, a token (`"+me[me.length-1].type+"`, "+Tn({start:me[me.length-1].start,end:me[me.length-1].end})+") is still open");for(N.position={start:s(L.length>0?L[0][1].start:{line:1,column:1,offset:0}),end:s(L.length>0?L[L.length-2][1].end:{line:1,column:1,offset:0})},fe=-1;++fe{let r=this.data("settings");return Fs(n,Object.assign({},r,e,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))}})}var up=Rs;var cp={}.hasOwnProperty;function pp(e,t){var n=t||{};function r(i){var o=r.invalid,a=r.handlers;if(i&&cp.call(i,e)&&(o=cp.call(a,i[e])?a[i[e]]:r.unknown),o)return o.apply(this,arguments)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}function Ur(e,t){let n=-1,r;if(t.extensions)for(;++n `}return` `}}var T0=/\r?\n|\r/g;function un(e,t){let n=[],r=0,i=0,o;for(;o=T0.exec(e);)a(e.slice(r,o.index)),n.push(o[0]),r=o.index+o[0].length,i++;return a(e.slice(r)),n.join("");function a(s){n.push(t(s,i,!s))}}function mp(e,t,n,r){let i=n.enter("blockquote"),o=X(r);o.move("> "),o.shift(2);let a=un(Dt(e,n,o.current()),C0);return i(),a}function C0(e,t,n){return">"+(n?"":" ")+e}function Do(e,t){return fp(e,t.inConstruct,!0)&&!fp(e,t.notInConstruct,!1)}function fp(e,t,n){if(!t)return n;typeof t=="string"&&(t=[t]);let r=-1;for(;++ra&&(a=o):o=1,i=r+1,r=n.indexOf(t,i);return a}function Gr(e,t){return Boolean(!t.options.fences&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function dp(e){let t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function No(e){if(!e._compiled){let t=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((t?"("+t+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}function ie(e,t,n){let r=(n.before||"")+(t||"")+(n.after||""),i=[],o=[],a={},s=-1;for(;++s=u||c+1",...l.current()})),u+=l.move(">")):(s=n.enter("destinationRaw"),u+=l.move(ie(n,e.url,{before:u,after:e.title?" ":` `,...l.current()}))),s(),e.title&&(s=n.enter("title"+o),u+=l.move(" "+i),u+=l.move(ie(n,e.title,{before:u,after:i,...l.current()})),u+=l.move(i),s()),a(),u}function bp(e){let t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Fe(e,t,n){let r=t.indexStack,i=e.children||[],o=[],a=-1,s=n.before;r.push(-1);let l=X(n);for(;++a0&&(s==="\r"||s===` `)&&u.type==="html"&&(o[o.length-1]=o[o.length-1].replace(/(\r?\n|\r)$/," "),s=" ",l=X(n),l.move(o.join(""))),o.push(l.move(t.handle(u,e,t,{...l.current(),before:s,after:c}))),s=o[o.length-1].slice(-1)}return r.pop(),o.join("")}Ps.peek=L0;function Ps(e,t,n,r){let i=bp(n),o=n.enter("emphasis"),a=X(r),s=a.move(i);return s+=a.move(Fe(e,n,{before:s,after:i,...a.current()})),s+=a.move(i),o(),s}function L0(e,t,n){return n.options.emphasis||"*"}function zo(e,t){let n=!1;return rn(e,r=>{if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,zr}),Boolean((!e.depth||e.depth<3)&&ar(e)&&(t.options.setext||n))}function wp(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),o=X(r);if(zo(e,n)){let c=n.enter("headingSetext"),p=n.enter("phrasing"),m=Fe(e,n,{...o.current(),before:` `,after:` `});return p(),c(),m+` `+(i===1?"=":"-").repeat(m.length-(Math.max(m.lastIndexOf("\r"),m.lastIndexOf(` `))+1))}let a="#".repeat(i),s=n.enter("headingAtx"),l=n.enter("phrasing");o.move(a+" ");let u=Fe(e,n,{before:"# ",after:` `,...o.current()});return/^[\t ]/.test(u)&&(u="&#x"+u.charCodeAt(0).toString(16).toUpperCase()+";"+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),l(),s(),u}Ns.peek=_0;function Ns(e){return e.value||""}function _0(){return"<"}zs.peek=I0;function zs(e,t,n,r){let i=ur(n),o=i==='"'?"Quote":"Apostrophe",a=n.enter("image"),s=n.enter("label"),l=X(r),u=l.move("![");return u+=l.move(ie(n,e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(ie(n,e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(s=n.enter("destinationRaw"),u+=l.move(ie(n,e.url,{before:u,after:e.title?" ":")",...l.current()}))),s(),e.title&&(s=n.enter("title"+o),u+=l.move(" "+i),u+=l.move(ie(n,e.title,{before:u,after:i,...l.current()})),u+=l.move(i),s()),u+=l.move(")"),a(),u}function I0(){return"!"}$s.peek=M0;function $s(e,t,n,r){let i=e.referenceType,o=n.enter("imageReference"),a=n.enter("label"),s=X(r),l=s.move("!["),u=ie(n,e.alt,{before:l,after:"]",...s.current()});l+=s.move(u+"]["),a();let c=n.stack;n.stack=[],a=n.enter("reference");let p=ie(n,qt(e),{before:l,after:"]",...s.current()});return a(),n.stack=c,o(),i==="full"||!u||u!==p?l+=s.move(p+"]"):i==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function M0(){return"!"}Zr.peek=B0;function Zr(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o\u007F]/.test(e.url))}Ys.peek=F0;function Ys(e,t,n,r){let i=ur(n),o=i==='"'?"Quote":"Apostrophe",a=X(r),s,l;if(Hs(e,n)){let c=n.stack;n.stack=[],s=n.enter("autolink");let p=a.move("<");return p+=a.move(Fe(e,n,{before:p,after:">",...a.current()})),p+=a.move(">"),s(),n.stack=c,p}s=n.enter("link"),l=n.enter("label");let u=a.move("[");return u+=a.move(Fe(e,n,{before:u,after:"](",...a.current()})),u+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(ie(n,e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(l=n.enter("destinationRaw"),u+=a.move(ie(n,e.url,{before:u,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter("title"+o),u+=a.move(" "+i),u+=a.move(ie(n,e.title,{before:u,after:i,...a.current()})),u+=a.move(i),l()),u+=a.move(")"),s(),u}function F0(e,t,n){return Hs(e,n)?"<":"["}js.peek=R0;function js(e,t,n,r){let i=e.referenceType,o=n.enter("linkReference"),a=n.enter("label"),s=X(r),l=s.move("["),u=Fe(e,n,{before:l,after:"]",...s.current()});l+=s.move(u+"]["),a();let c=n.stack;n.stack=[],a=n.enter("reference");let p=ie(n,qt(e),{before:l,after:"]",...s.current()});return a(),n.stack=c,o(),i==="full"||!u||u!==p?l+=s.move(p+"]"):i==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function R0(){return"["}function cr(e){let t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function xp(e){let t=cr(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function $o(e){let t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function kp(e){let t=$o(e),n=e.options.bulletOrderedOther;if(!n)return t==="."?")":".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrderedOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bulletOrdered` (`"+t+"`) and `bulletOrderedOther` (`"+n+"`) to be different");return n}function Ho(e){let t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function vp(e,t,n,r){let i=n.enter("list"),o=n.bulletCurrent,a=e.ordered?$o(n):cr(n),s=e.ordered?kp(n):xp(n),l=n.bulletLastUsed,u=!1;if(t&&(e.ordered?n.options.bulletOrderedOther:n.options.bulletOther)&&l&&a===l&&(u=!0),!e.ordered){let p=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),Ho(n)===a&&p){let m=-1;for(;++m-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let a=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);let s=X(r);s.move(o+" ".repeat(a-o.length)),s.shift(a);let l=n.enter("listItem"),u=un(Dt(e,n,s.current()),c);return l(),u;function c(p,m,f){return m?(f?"":" ".repeat(a))+p:(f?o:o+" ".repeat(a-o.length))+p}}function Op(e,t,n,r){let i=n.enter("paragraph"),o=n.enter("phrasing"),a=Fe(e,n,r);return o(),i(),a}function Tp(e,t,n,r){return Dt(e,n,r)}function Cp(e){let t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}qs.peek=D0;function qs(e,t,n,r){let i=Cp(n),o=n.enter("strong"),a=X(r),s=a.move(i+i);return s+=a.move(Fe(e,n,{before:s,after:i,...a.current()})),s+=a.move(i+i),o(),s}function D0(e,t,n){return n.options.strong||"*"}function Ap(e,t,n,r){return ie(n,e.value,r)}function Ep(e){let t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Lp(e,t,n){let r=(Ho(n)+(n.options.ruleSpaces?" ":"")).repeat(Ep(n));return n.options.ruleSpaces?r.slice(0,-1):r}var _p={blockquote:mp,break:Ds,code:gp,definition:yp,emphasis:Ps,hardBreak:Ds,heading:wp,html:Ns,image:zs,imageReference:$s,inlineCode:Zr,link:Ys,linkReference:js,list:vp,listItem:Yo,paragraph:Op,root:Tp,strong:qs,text:Ap,thematicBreak:Lp};var Ip=[P0];function P0(e,t,n,r){if(t.type==="code"&&Gr(t,r)&&(e.type==="list"||e.type===t.type&&Gr(e,r))||e.type==="list"&&e.type===t.type&&Boolean(e.ordered)===Boolean(t.ordered)&&!(e.ordered?r.options.bulletOrderedOther:r.options.bulletOther))return!1;if("spread"in n&&typeof n.spread=="boolean")return e.type==="paragraph"&&(e.type===t.type||t.type==="definition"||t.type==="heading"&&zo(t,r))?void 0:n.spread?1:0}var Mn=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],Mp=[{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:` `,inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:Mn},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:`(?:[\r ]|$)`},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:Mn},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*"},{character:"*",inConstruct:"phrasing",notInConstruct:Mn},{atBreak:!0,character:"+"},{atBreak:!0,character:"-"},{atBreak:!0,before:"\\d+",character:".",after:`(?:[ \r ]|$)`},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:Mn},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:Mn},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:Mn},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:Mn},{atBreak:!0,character:"~"}];function Vs(e,t={}){let n={enter:i,stack:[],unsafe:[],join:[],handlers:{},options:{},indexStack:[]};Ur(n,{unsafe:Mp,join:Ip,handlers:_p}),Ur(n,t),n.options.tightDefinitions&&Ur(n,{join:[$0]}),n.handle=pp("type",{invalid:N0,unknown:z0,handlers:n.handlers});let r=n.handle(e,null,n,{before:` `,after:` `,now:{line:1,column:1},lineShift:0});return r&&r.charCodeAt(r.length-1)!==10&&r.charCodeAt(r.length-1)!==13&&(r+=` `),r;function i(o){return n.stack.push(o),a;function a(){n.stack.pop()}}}function N0(e){throw new Error("Cannot handle value `"+e+"`, expected node")}function z0(e){throw new Error("Cannot handle unknown node `"+e.type+"`")}function $0(e,t){if(e.type==="definition"&&e.type===t.type)return 0}function Ks(e){Object.assign(this,{Compiler:n=>{let r=this.data("settings");return Vs(n,Object.assign({},r,e,{extensions:this.data("toMarkdownExtensions")||[]}))}})}var Bp=Ks;var Ws=ws().use(up).use(Bp).freeze();var H0={tokenize:V0,partial:!0},Rp={tokenize:K0,partial:!0},Dp={tokenize:W0,partial:!0},pr={tokenize:G0,partial:!0},Pp={tokenize:U0,partial:!0},Np={tokenize:j0,previous:Hp},zp={tokenize:q0,previous:Zs},Vt={tokenize:Y0,previous:Yp},Pt={},Us={text:Pt},Bn=48;for(;Bn<123;)Pt[Bn]=Vt,Bn++,Bn===58?Bn=65:Bn===91&&(Bn=97);Pt[43]=Vt;Pt[45]=Vt;Pt[46]=Vt;Pt[95]=Vt;Pt[72]=[Vt,zp];Pt[104]=[Vt,zp];Pt[87]=[Vt,Np];Pt[119]=[Vt,Np];function Y0(e,t,n){let r=this,i,o;return a;function a(f){return!Fp(f)||!Yp(r.previous)||Qs(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(f))}function s(f){return Fp(f)?(e.consume(f),s):f===64?(e.consume(f),l):n(f)}function l(f){return f===46?e.check(pr,m,u)(f):f===45||f===95?e.check(pr,n,c)(f):Se(f)?(!o&&Cn(f)&&(o=!0),e.consume(f),l):m(f)}function u(f){return e.consume(f),i=!0,o=void 0,l}function c(f){return e.consume(f),p}function p(f){return f===46?e.check(pr,n,u)(f):l(f)}function m(f){return i&&!o?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function j0(e,t,n){let r=this;return i;function i(a){return a!==87&&a!==119||!Hp(r.previous)||Qs(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(H0,e.attempt(Rp,e.attempt(Dp,o),n),n)(a))}function o(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function q0(e,t,n){let r=this;return i;function i(d){return d!==72&&d!==104||!Zs(r.previous)||Qs(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),e.consume(d),o)}function o(d){return d===84||d===116?(e.consume(d),a):n(d)}function a(d){return d===84||d===116?(e.consume(d),s):n(d)}function s(d){return d===80||d===112?(e.consume(d),l):n(d)}function l(d){return d===83||d===115?(e.consume(d),u):u(d)}function u(d){return d===58?(e.consume(d),c):n(d)}function c(d){return d===47?(e.consume(d),p):n(d)}function p(d){return d===47?(e.consume(d),m):n(d)}function m(d){return d===null||an(d)||An(d)||En(d)?n(d):e.attempt(Rp,e.attempt(Dp,f),n)(d)}function f(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function V0(e,t,n){return r;function r(l){return e.consume(l),i}function i(l){return l===87||l===119?(e.consume(l),o):n(l)}function o(l){return l===87||l===119?(e.consume(l),a):n(l)}function a(l){return l===46?(e.consume(l),s):n(l)}function s(l){return l===null||D(l)?n(l):t(l)}}function K0(e,t,n){let r,i;return o;function o(l){return l===38?e.check(Pp,s,a)(l):l===46||l===95?e.check(pr,s,a)(l):l===null||an(l)||An(l)||l!==45&&En(l)?s(l):(e.consume(l),o)}function a(l){return l===46?(i=r,r=void 0,e.consume(l),o):(l===95&&(r=!0),e.consume(l),o)}function s(l){return!i&&!r?t(l):n(l)}}function W0(e,t){let n=0;return r;function r(a){return a===38?e.check(Pp,t,i)(a):(a===40&&n++,a===41?e.check(pr,o,i)(a):Gs(a)?t(a):$p(a)?e.check(pr,t,i)(a):(e.consume(a),r))}function i(a){return e.consume(a),r}function o(a){return n--,n<0?t(a):i(a)}}function U0(e,t,n){return r;function r(a){return e.consume(a),i}function i(a){return Ke(a)?(e.consume(a),i):a===59?(e.consume(a),o):n(a)}function o(a){return Gs(a)?t(a):n(a)}}function G0(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return $p(o)?(e.consume(o),i):Gs(o)?t(o):n(o)}}function $p(e){return e===33||e===34||e===39||e===41||e===42||e===44||e===46||e===58||e===59||e===60||e===63||e===95||e===126}function Gs(e){return e===null||e===60||J(e)}function Fp(e){return e===43||e===45||e===46||e===95||Se(e)}function Hp(e){return e===null||e===40||e===42||e===95||e===126||J(e)}function Zs(e){return e===null||!Ke(e)}function Yp(e){return e!==47&&Zs(e)}function Qs(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function gt(e){let t=[],n=-1,r=0,i=0;for(;++n55295&&o<57344){let s=e.charCodeAt(n+1);o<56320&&s>56319&&s<57344?(a=String.fromCharCode(o,s),i=1):a="\uFFFD"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}var Z0={tokenize:ry,partial:!0};function Xs(){return{document:{[91]:{tokenize:ey,continuation:{tokenize:ty},exit:ny}},text:{[91]:{tokenize:J0},[93]:{add:"after",tokenize:Q0,resolveTo:X0}}}}function Q0(e,t,n){let r=this,i=r.events.length,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a;for(;i--;){let l=r.events[i][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return s;function s(l){if(!a||!a._balanced)return n(l);let u=We(r.sliceSerialize({start:a.end,end:r.now()}));return u.charCodeAt(0)!==94||!o.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function X0(e,t){let n=e.length,r;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){r=e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";let i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;let a={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},l=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",a,t],["enter",s,t],["exit",s,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...l),e}function J0(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o=0,a;return s;function s(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),l}function l(m){return m!==94?n(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(m){let f;return m===null||m===91||o++>999?n(m):m===93?a?(e.exit("chunkString"),f=e.exit("gfmFootnoteCallString"),i.includes(We(r.sliceSerialize(f)))?p(m):n(m)):n(m):(e.consume(m),J(m)||(a=!0),m===92?c:u)}function c(m){return m===91||m===92||m===93?(e.consume(m),o++,u):u(m)}function p(m){return e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t}}function ey(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o,a=0,s;return l;function l(h){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(h){return h===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),c):n(h)}function c(h){let g;return h===null||h===91||a>999?n(h):h===93?s?(g=e.exit("gfmFootnoteDefinitionLabelString"),o=We(r.sliceSerialize(g)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f):n(h):D(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),a++,c):(e.enter("chunkString").contentType="string",p(h))}function p(h){return h===null||D(h)||h===91||h===93||a>999?(e.exit("chunkString"),c(h)):(J(h)||(s=!0),a++,e.consume(h),h===92?m:p)}function m(h){return h===91||h===92||h===93?(e.consume(h),a++,p):p(h)}function f(h){return h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),Y(e,d,"gfmFootnoteDefinitionWhitespace")):n(h)}function d(h){return i.includes(o)||i.push(o),t(h)}}function ty(e,t,n){return e.check(Rt,t,e.attempt(Z0,t,n))}function ny(e){e.exit("gfmFootnoteDefinition")}function ry(e,t,n){let r=this;return Y(e,i,"gfmFootnoteDefinitionIndent",4+1);function i(o){let a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(o):n(o)}}function Js(e={}){let t=e.singleTilde,n={tokenize:i,resolveAll:r};return t==null&&(t=!0),{text:{[126]:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(o,a){let s=-1;for(;++s1?s(f):(o.consume(f),c++,m);if(c<2&&!t)return s(f);let h=o.exit("strikethroughSequenceTemporary"),g=sr(f);return h._open=!g||g===2&&Boolean(d),h._close=!d||d===2&&Boolean(g),a(f)}}}var el={flow:{null:{tokenize:oy,resolve:iy}}},jp={tokenize:ay,partial:!0};function iy(e,t){let n=-1,r,i,o,a,s,l,u;for(;++n=4?te(w):(r._gfmTableDynamicInterruptHack=!0,C.check(r.parser.constructs.flow,function(rt){return r._gfmTableDynamicInterruptHack=!1,te(rt)},function(rt){return r._gfmTableDynamicInterruptHack=!1,oe(rt)})(w))}}}function ay(e,t,n){let r=0;return i;function i(a){return e.enter("check"),e.consume(a),o}function o(a){return a===-1||a===32?(e.consume(a),r++,r===4?t:o):a===null||J(a)?t(a):n(a)}}var sy={tokenize:ly},tl={text:{[91]:sy}};function ly(e,t,n){let r=this;return i;function i(s){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(s):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(s),e.exit("taskListCheckMarker"),o)}function o(s){return J(s)?(e.enter("taskListCheckValueUnchecked"),e.consume(s),e.exit("taskListCheckValueUnchecked"),a):s===88||s===120?(e.enter("taskListCheckValueChecked"),e.consume(s),e.exit("taskListCheckValueChecked"),a):n(s)}function a(s){return s===93?(e.enter("taskListCheckMarker"),e.consume(s),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),e.check({tokenize:uy},t,n)):n(s)}}function uy(e,t,n){let r=this;return Y(e,i,"whitespace");function i(o){let a=r.events[r.events.length-1];return(a&&a[1].type==="whitespace"||D(o))&&o!==null?t(o):n(o)}}function qp(e){return So([Us,Xs(),Js(e),el,tl])}function mr(e,t){let n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function nl(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var cy={}.hasOwnProperty,rl=function(e,t,n,r){let i,o;typeof t=="string"||t instanceof RegExp?(o=[[t,n]],i=r):(o=t,i=n),i||(i={});let a=jt(i.ignore||[]),s=py(o),l=-1;for(;++l0?{type:"text",value:_}:void 0),_!==!1&&(g!==E&&S.push({type:"text",value:p.value.slice(g,E)}),Array.isArray(_)?S.push(..._):_&&S.push(_),g=E+I[0].length,O=!0),!d.global)break;I=d.exec(p.value)}return O?(ge}var il="phrasing",ol=["autolink","link","image","label"],Wp={transforms:[yy],enter:{literalAutolink:my,literalAutolinkEmail:al,literalAutolinkHttp:al,literalAutolinkWww:al},exit:{literalAutolink:gy,literalAutolinkEmail:hy,literalAutolinkHttp:fy,literalAutolinkWww:dy}},Up={unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:il,notInConstruct:ol},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:il,notInConstruct:ol},{character:":",before:"[ps]",after:"\\/",inConstruct:il,notInConstruct:ol}]};function my(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function al(e){this.config.enter.autolinkProtocol.call(this,e)}function fy(e){this.config.exit.autolinkProtocol.call(this,e)}function dy(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.url="http://"+this.sliceSerialize(e)}function hy(e){this.config.exit.autolinkEmail.call(this,e)}function gy(e){this.exit(e)}function yy(e){rl(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,by],[/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g,wy]],{ignore:["link","linkReference"]})}function by(e,t,n,r,i){let o="";if(!Gp(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!xy(n)))return!1;let a=ky(n+r);if(!a[0])return!1;let s={type:"link",title:null,url:o+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[s,{type:"text",value:a[1]}]:s}function wy(e,t,n,r){return!Gp(r,!0)||/[_-\d]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function xy(e){let t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function ky(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e),n,r,i,o;if(t)for(e=e.slice(0,t.index),o=t[0],n=o.indexOf(")"),r=mr(e,"("),i=mr(e,")");n!==-1&&r>i;)e+=o.slice(0,n+1),o=o.slice(n+1),n=o.indexOf(")"),i++;return[e,o]}function Gp(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||An(n)||En(n))&&(!t||n!==47)}function Zp(){return{enter:{gfmFootnoteDefinition:e,gfmFootnoteDefinitionLabelString:t,gfmFootnoteCall:i,gfmFootnoteCallString:o},exit:{gfmFootnoteDefinition:r,gfmFootnoteDefinitionLabelString:n,gfmFootnoteCall:s,gfmFootnoteCallString:a}};function e(l){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},l)}function t(){this.buffer()}function n(l){let u=this.resume(),c=this.stack[this.stack.length-1];c.label=u,c.identifier=We(this.sliceSerialize(l)).toLowerCase()}function r(l){this.exit(l)}function i(l){this.enter({type:"footnoteReference",identifier:"",label:""},l)}function o(){this.buffer()}function a(l){let u=this.resume(),c=this.stack[this.stack.length-1];c.label=u,c.identifier=We(this.sliceSerialize(l)).toLowerCase()}function s(l){this.exit(l)}}function Qp(){return e.peek=t,{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]}],handlers:{footnoteDefinition:n,footnoteReference:e}};function e(r,i,o,a){let s=X(a),l=s.move("[^"),u=o.enter("footnoteReference"),c=o.enter("reference");return l+=s.move(ie(o,qt(r),{...s.current(),before:l,after:"]"})),c(),u(),l+=s.move("]"),l}function t(){return"["}function n(r,i,o,a){let s=X(a),l=s.move("[^"),u=o.enter("footnoteDefinition"),c=o.enter("label");return l+=s.move(ie(o,qt(r),{...s.current(),before:l,after:"]"})),c(),l+=s.move("]:"+(r.children&&r.children.length>0?" ":"")),s.shift(4),l+=s.move(un(Dt(r,o,s.current()),p)),u(),l;function p(m,f,d){return f?(d?"":" ")+m:m}}}var Xp={canContainEols:["delete"],enter:{strikethrough:vy},exit:{strikethrough:Sy}},Jp={unsafe:[{character:"~",inConstruct:"phrasing"}],handlers:{delete:em}};em.peek=Oy;function vy(e){this.enter({type:"delete",children:[]},e)}function Sy(e){this.exit(e)}function em(e,t,n,r){let i=X(r),o=n.enter("emphasis"),a=i.move("~~");return a+=Fe(e,n,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),o(),a}function Oy(){return"~"}function nm(e,t={}){let n=(t.align||[]).concat(),r=t.stringLength||Cy,i=[],o=[],a=[],s=[],l=0,u=-1;for(;++ul&&(l=e[u].length);++gs[g])&&(s[g]=O)}d.push(b)}o[u]=d,a[u]=h}let c=-1;if(typeof n=="object"&&"length"in n)for(;++cs[c]&&(s[c]=b),m[c]=b),p[c]=O}o.splice(1,0,p),a.splice(1,0,m),u=-1;let f=[];for(;++un==="none"?null:n),children:[]},e),this.setData("inTable",!0)}function Ey(e){this.exit(e),this.setData("inTable")}function Ly(e){this.enter({type:"tableRow",children:[]},e)}function sl(e){this.exit(e)}function rm(e){this.enter({type:"tableCell",children:[]},e)}function _y(e){let t=this.resume();this.getData("inTable")&&(t=t.replace(/\\([\\|])/g,Iy));let n=this.stack[this.stack.length-1];n.value=t,this.exit(e)}function Iy(e,t){return t==="|"?t:e}function ul(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{table:a,tableRow:s,tableCell:l,inlineCode:m}};function a(f,d,h,g){return u(c(f,h,g),f.align)}function s(f,d,h,g){let b=p(f,h,g),O=u([b]);return O.slice(0,O.indexOf(` `))}function l(f,d,h,g){let b=h.enter("tableCell"),O=h.enter("phrasing"),S=Fe(f,h,{...g,before:o,after:o});return O(),b(),S}function u(f,d){return nm(f,{align:d,alignDelimiters:r,padding:n,stringLength:i})}function c(f,d,h){let g=f.children,b=-1,O=[],S=d.enter("table");for(;++bG,booleanish:()=>ye,commaOrSpaceSeparated:()=>lt,commaSeparated:()=>cn,number:()=>F,overloadedBoolean:()=>dl,spaceSeparated:()=>ae});var zy=0,G=Fn(),ye=Fn(),dl=Fn(),F=Fn(),ae=Fn(),cn=Fn(),lt=Fn();function Fn(){return 2**++zy}var hl=Object.keys(Xr),Rn=class extends Ge{constructor(t,n,r,i){let o=-1;if(super(t,n),pm(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&Hy.test(t)){if(t.charAt(4)==="-"){let o=t.slice(5).replace(dm,qy);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{let o=t.slice(4);if(!dm.test(o)){let a=o.replace(Yy,jy);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=Rn}return new i(r,t)}function jy(e){return"-"+e.toLowerCase()}function qy(e){return e.charAt(1).toUpperCase()}var hm=fl([yl,gl,bl,wl,mm],"html"),Wo=fl([yl,gl,bl,wl,fm],"svg");var gm=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","isindex","keygen","link","menuitem","meta","nextid","param","source","track","wbr"];var Oe=function(e,t,n,r,i){let o=ym(t);if(n!=null&&(typeof n!="number"||n<0||n===Number.POSITIVE_INFINITY))throw new Error("Expected positive finite index for child node");if(r!=null&&(!r.type||!r.children))throw new Error("Expected parent node");if(!e||!e.type||typeof e.type!="string")return!1;if(r==null!=(n==null))throw new Error("Expected both parent and index");return o.call(i,e,n,r)},ym=function(e){if(e==null)return kl;if(typeof e=="string")return Ky(e);if(typeof e=="object")return Vy(e);if(typeof e=="function")return bm(e);throw new Error("Expected function, string, or array as test")};function Vy(e){let t=[],n=-1;for(;++n0}function cb(e){let t=be(e,-1,!0);return!t||!Dn(t)&&!Go(t)&&!Oe(t,["meta","link","script","style","template"])}function pb(e,t,n){let r=vl(n,t),i=be(e,-1,!0);return Oe(r,"colgroup")&&Jr(r,n.children.indexOf(r),n)?!1:i&&Oe(i,"col")}function mb(e,t,n){let r=vl(n,t),i=be(e,-1);return Oe(r,["thead","tbody"])&&Jr(r,n.children.indexOf(r),n)?!1:i&&Oe(i,"tr")}var Sm={opening:vm,closing:Jr};function Om(e){return e.join(" ").trim()}function Tm(e,t){var n=t||{};return e[e.length-1]===""&&(e=e.concat("")),e.join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Cm(e,t){if(e=e.replace(t.subset?fb(t.subset):/["&'<>`]/g,r),t.subset||t.escapeOnly)return e;return e.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,n).replace(/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,r);function n(i,o,a){return t.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,a.charCodeAt(o+2),t)}function r(i,o,a){return t.format(i.charCodeAt(0),a.charCodeAt(o+1),t)}}function fb(e){let t=[],n=-1;for(;++n",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",circ:"\u02C6",tilde:"\u02DC",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",permil:"\u2030",lsaquo:"\u2039",rsaquo:"\u203A",euro:"\u20AC"};var _m=["cent","copy","divide","gt","lt","not","para","times"];var Im={}.hasOwnProperty,Ol={},Xo;for(Xo in Qo)Im.call(Qo,Xo)&&(Ol[Qo[Xo]]=Xo);function Mm(e,t,n,r){let i=String.fromCharCode(e);if(Im.call(Ol,i)){let o=Ol[i],a="&"+o;return n&&Lm.includes(o)&&!_m.includes(o)&&(!r||t&&t!==61&&/[^\da-z]/i.test(String.fromCharCode(t)))?a:a+";"}return""}function Bm(e,t,n){let r=Am(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=Mm(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let o=Em(e,t,n.omitOptionalSemicolons);o.length`.split(""),` \f\r "&'/=>\``.split("")],[`\0 \f\r "&'/<=>`.split(""),`\0 \f\r "&'/<=>\``.split("")]],unquoted:[[` \f\r &>`.split(""),`\0 \f\r "&'<=>\``.split("")],[`\0 \f\r "&'<=>\``.split(""),`\0 \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function Fm(e,t){return e.bogusComments?""]}))+">":"|--!>|";function n(r){return Wt(r,Object.assign({},e.entities,{subset:["<",">"]}))}}function Rm(e){return""}function Jo(e,t,n,r){return r&&r.type==="element"&&(r.tagName==="script"||r.tagName==="style")?t.value:Wt(t.value,Object.assign({},e.entities,{subset:["<","&"]}))}function Dm(e,t,n,r){return e.dangerous?t.value:Jo(e,t,n,r)}var Pm={comment:Fm,doctype:Rm,element:hb,raw:Dm,root:Nm,text:Jo},db={}.hasOwnProperty;function Tl(e,t,n,r){if(!t||!t.type)throw new Error("Expected node, not `"+t+"`");if(!db.call(Pm,t.type))throw new Error("Cannot compile unknown node `"+t.type+"`");return Pm[t.type](e,t,n,r)}function Nm(e,t){let n=[],r=t&&t.children||[],i=-1;for(;++i")),s.push(c),!a&&(!o||!o.closing(t,n,r))&&s.push(""),s.join("")}function gb(e,t){let n=[],r=-1,i,o,a;for(i in t)t[i]!==void 0&&t[i]!==null&&(o=yb(e,i,t[i]),o&&n.push(o));for(;++rmr(n,e.alternative)&&(i=e.alternative),o=i+Wt(n,Object.assign({},e.entities,{subset:(i==="'"?ei.single:ei.double)[e.schema.space==="html"?e.valid:1][e.safe],attribute:!0}))+i),a+(o&&"="+o))}function Cl(e,t={}){let n=t.quote||'"',r=n==='"'?"'":'"';if(n!=='"'&&n!=="'")throw new Error("Invalid quote `"+n+"`, expected `'` or `\"`");let i={valid:t.allowParseErrors?0:1,safe:t.allowDangerousCharacters?0:1,schema:t.space==="svg"?Wo:hm,omit:t.omitOptionalTags?Sm:void 0,quote:n,alternative:r,smart:t.quoteSmart,unquoted:t.preferUnquoted,tight:t.tightAttributes,upperDoctype:t.upperDoctype,tightDoctype:t.tightDoctype,bogusComments:t.bogusComments,tightLists:t.tightCommaSeparatedLists,tightClose:t.tightSelfClosing,collapseEmpty:t.collapseEmptyAttributes,dangerous:t.allowDangerousHtml,voids:t.voids||gm.concat(),entities:t.entities||{},close:t.closeSelfClosing,closeEmpty:t.closeEmptyElements};return Tl(i,Array.isArray(e)?{type:"root",children:e}:e,null,null)}function ea(e){let t=this.data("settings"),n=Object.assign({},t,e);Object.assign(this,{Compiler:r});function r(i){return Cl(i,n)}}var ee=function(e,t,n){var r={type:String(e)};return n==null&&(typeof t=="string"||Array.isArray(t))?n=t:Object.assign(r,t),Array.isArray(n)?r.children=n:n!=null&&(r.value=String(n)),r};var ta={}.hasOwnProperty;function bb(e,t){let n=t.data||{};return"value"in t&&!(ta.call(n,"hName")||ta.call(n,"hProperties")||ta.call(n,"hChildren"))?e.augment(t,ee("text",t.value)):e(t,"div",re(e,t))}function Al(e,t,n){let r=t&&t.type,i;if(!r)throw new Error("Expected node, got `"+t+"`");return ta.call(e.handlers,r)?i=e.handlers[r]:e.passThrough&&e.passThrough.includes(r)?i=wb:i=e.unknownHandler,(typeof i=="function"?i:bb)(e,t,n)}function wb(e,t){return"children"in t?{...t,children:re(e,t)}:t}function re(e,t){let n=[];if("children"in t){let r=t.children,i=-1;for(;++i-1?r.offset:null}}}function $m(e){return!e||!e.position||!e.position.start||!e.position.start.line||!e.position.start.column||!e.position.end||!e.position.end.line||!e.position.end.column}var Hm={}.hasOwnProperty;function jm(e){let t=Object.create(null);if(!e||!e.type)throw new Error("mdast-util-definitions expected node");return rn(e,"definition",r=>{let i=Ym(r.identifier);i&&!Hm.call(t,i)&&(t[i]=r)}),n;function n(r){let i=Ym(r);return i&&Hm.call(t,i)?t[i]:null}}function Ym(e){return String(e||"").toUpperCase()}function ut(e,t){let n=[],r=-1;for(t&&n.push(ee("text",` `));++r0&&n.push(ee("text",` `)),n}function qm(e){let t=-1,n=[];for(;++t1?"-"+s:""),dataFootnoteBackref:!0,className:["data-footnote-backref"],ariaLabel:e.footnoteBackLabel},children:[{type:"text",value:"\u21A9"}]};s>1&&p.children.push({type:"element",tagName:"sup",children:[{type:"text",value:String(s)}]}),l.length>0&&l.push({type:"text",value:" "}),l.push(p)}let u=i[i.length-1];if(u&&u.type==="element"&&u.tagName==="p"){let p=u.children[u.children.length-1];p&&p.type==="text"?p.value+=" ":u.children.push({type:"text",value:" "}),u.children.push(...l)}else i.push(...l);let c={type:"element",tagName:"li",properties:{id:e.clobberPrefix+"fn-"+a},children:ut(i,!0)};r.position&&(c.position=r.position),n.push(c)}return n.length===0?null:{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:e.footnoteLabelTagName,properties:{...JSON.parse(JSON.stringify(e.footnoteLabelProperties)),id:"footnote-label"},children:[ee("text",e.footnoteLabel)]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:ut(n,!0)},{type:"text",value:` `}]}}function Vm(e,t){return e(t,"blockquote",ut(re(e,t),!0))}function Km(e,t){return[e(t,"br"),ee("text",` `)]}function Wm(e,t){let n=t.value?t.value+` `:"",r=t.lang&&t.lang.match(/^[^ \t]+(?=[ \t]|$)/),i={};r&&(i.className=["language-"+r]);let o=e(t,"code",i,[ee("text",n)]);return t.meta&&(o.data={meta:t.meta}),e(t.position,"pre",[o])}function Um(e,t){return e(t,"del",re(e,t))}function Gm(e,t){return e(t,"em",re(e,t))}function ia(e,t){let n=String(t.identifier),r=gt(n.toLowerCase()),i=e.footnoteOrder.indexOf(n),o;i===-1?(e.footnoteOrder.push(n),e.footnoteCounts[n]=1,o=e.footnoteOrder.length):(e.footnoteCounts[n]++,o=i+1);let a=e.footnoteCounts[n];return e(t,"sup",[e(t.position,"a",{href:"#"+e.clobberPrefix+"fn-"+r,id:e.clobberPrefix+"fnref-"+r+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:"footnote-label"},[ee("text",String(o))])])}function Zm(e,t){let n=e.footnoteById,r=1;for(;r in n;)r++;let i=String(r);return n[i]={type:"footnoteDefinition",identifier:i,children:[{type:"paragraph",children:t.children}],position:t.position},ia(e,{type:"footnoteReference",identifier:i,position:t.position})}function Qm(e,t){return e(t,"h"+t.depth,re(e,t))}function Xm(e,t){return e.dangerous?e.augment(t,ee("raw",t.value)):null}function oa(e,t){let n=t.referenceType,r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return ee("text","!["+t.alt+r);let i=re(e,t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift(ee("text","["));let a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push(ee("text",r)),i}function Jm(e,t){let n=e.definition(t.identifier);if(!n)return oa(e,t);let r={src:gt(n.url||""),alt:t.alt};return n.title!==null&&n.title!==void 0&&(r.title=n.title),e(t,"img",r)}function ef(e,t){let n={src:gt(t.url),alt:t.alt};return t.title!==null&&t.title!==void 0&&(n.title=t.title),e(t,"img",n)}function tf(e,t){return e(t,"code",[ee("text",t.value.replace(/\r?\n|\r/g," "))])}function nf(e,t){let n=e.definition(t.identifier);if(!n)return oa(e,t);let r={href:gt(n.url||"")};return n.title!==null&&n.title!==void 0&&(r.title=n.title),e(t,"a",r,re(e,t))}function rf(e,t){let n={href:gt(t.url)};return t.title!==null&&t.title!==void 0&&(n.title=t.title),e(t,"a",n,re(e,t))}function of(e,t,n){let r=re(e,t),i=n?xb(n):af(t),o={},a=[];if(typeof t.checked=="boolean"){let u;r[0]&&r[0].type==="element"&&r[0].tagName==="p"?u=r[0]:(u=e(null,"p",[]),r.unshift(u)),u.children.length>0&&u.children.unshift(ee("text"," ")),u.children.unshift(e(null,"input",{type:"checkbox",checked:t.checked,disabled:!0})),o.className=["task-list-item"]}let s=-1;for(;++s1:t}function sf(e,t){let n={},r=t.ordered?"ol":"ul",i=re(e,t),o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(mf(t.slice(i),i>0,!1)),o.join("")}function mf(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===9||o===32;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===9||o===32;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function df(e,t){return e.augment(t,ee("text",ff(String(t.value))))}function hf(e,t){return e(t,"hr")}var El={blockquote:Vm,break:Km,code:Wm,delete:Um,emphasis:Gm,footnoteReference:ia,footnote:Zm,heading:Qm,html:Xm,imageReference:Jm,image:ef,inlineCode:tf,linkReference:nf,link:rf,listItem:of,list:sf,paragraph:lf,root:uf,strong:cf,table:pf,text:df,thematicBreak:hf,toml:aa,yaml:aa,definition:aa,footnoteDefinition:aa};function aa(){return null}var kb={}.hasOwnProperty;function vb(e,t){let n=t||{},r=n.allowDangerousHtml||!1,i={};return a.dangerous=r,a.clobberPrefix=n.clobberPrefix===void 0||n.clobberPrefix===null?"user-content-":n.clobberPrefix,a.footnoteLabel=n.footnoteLabel||"Footnotes",a.footnoteLabelTagName=n.footnoteLabelTagName||"h2",a.footnoteLabelProperties=n.footnoteLabelProperties||{className:["sr-only"]},a.footnoteBackLabel=n.footnoteBackLabel||"Back to content",a.definition=jm(e),a.footnoteById=i,a.footnoteOrder=[],a.footnoteCounts={},a.augment=o,a.handlers={...El,...n.handlers},a.unknownHandler=n.unknownHandler,a.passThrough=n.passThrough,rn(e,"footnoteDefinition",s=>{let l=String(s.identifier).toUpperCase();kb.call(i,l)||(i[l]=s)}),a;function o(s,l){if(s&&"data"in s&&s.data){let u=s.data;u.hName&&(l.type!=="element"&&(l={type:"element",tagName:"",properties:{},children:[]}),l.tagName=u.hName),l.type==="element"&&u.hProperties&&(l.properties={...l.properties,...u.hProperties}),"children"in l&&l.children&&u.hChildren&&(l.children=u.hChildren)}if(s){let u="type"in s?s:{position:s};$m(u)||(l.position={start:na(u),end:ra(u)})}return l}function a(s,l,u,c){return Array.isArray(u)&&(c=u,u={}),o(s,{type:"element",tagName:l,properties:u||{},children:c||[]})}}function sa(e,t){let n=vb(e,t),r=Al(n,e,null),i=qm(n);return i&&r.children.push(ee("text",` `),i),Array.isArray(r)?{type:"root",children:r}:r}var Sb=function(e,t){return e&&"run"in e?Ob(e,t):Tb(e||t)},Ll=Sb;function Ob(e,t){return(n,r,i)=>{e.run(sa(n,t),r,o=>{i(o)})}}function Tb(e){return t=>sa(t,e)}function Cb(e){return Ws().use(jo).use(qo).parse(e)}function ct(e){let t=String(Ws().use(jo).use(qo).use(Ll).use(ea).processSync(e)).trim();return t.startsWith("

")&&(t=t.substring(3)),t.endsWith("

")&&(t=t.substring(0,t.length-4)),t}function Ze(e,t){let n=Cb(t),r=[];return rn(n,e,i=>{r.push(i.position)}),r.sort((i,o)=>o.start.offset-i.start.offset),r}function gf(e){let t=Ze("footnoteDefinition",e),n=[],r=new Set,i=new Map,o=function(a,s){let l=a.match(/\[\^.*?\]/)[0],u;do u=e.lastIndexOf(l,s),s=u;while(r.has(u)&&u!==-1);if(u===-1)throw new Error(`Footnote '${a}' has no corresponding footnote reference before the footnote contents and cannot be processed. Please make sure that all footnotes have a corresponding reference before the content of the footnote.`);return r.add(u),u};for(let a of t){let s=e.substring(a.start.offset,a.end.offset);n.push(s),a.end.offseti.get(a)-i.get(s)),n.length>0&&(e=e.trimEnd()+` `);for(let a of n)e+=` `+a;return e}function la(e,t,n){let r=Ze(n,e);if(r.length===0)return e;let i="";if(t==="underscore")i="_";else if(t==="asterisk")i="*";else{let o=r[r.length-1];i=e.substring(o.start.offset,o.start.offset+1)}n==="strong"&&(i+=i);for(let o of r){let a=i+e.substring(o.start.offset+i.length,o.end.offset-i.length)+i;e=Ve(e,o.start.offset,o.end.offset,a)}return e}function yf(e){let t=Ze("paragraph",e);if(t.length===0)return e;for(let n of t){let r=e.substring(n.start.offset,n.end.offset).split(` `),i=r.length-1;if(!(i<1)){for(let o=0;o")||a.endsWith("
")||(r[o]=a+" ")}e=Ve(e,n.start.offset,n.end.offset,r.join(` `))}}return e}function bf(e){let t=e.endsWith(` `),n=Ze("paragraph",e);if(n.length===0)return e;for(let r of n){let i=r.start.offset;for(i>0&&i--;i>=0&&e.charAt(i)!=` `;)i--;i++;let o=e.substring(i,r.end.offset).split(` `),a=o[0].trimStart();if(a.startsWith("> ")||a.startsWith("> ")||a.startsWith("- ")||a.startsWith("- ")||a.match(/^[0-9]+\.( |\t)+/))continue;let s=o.length,l=[],u=!1;for(let d=0;d")||h.endsWith("
")||h.endsWith(" ")}for(;i>0&&e.charAt(i-1)==` `;)i--;let c=e.length,p=r.end.offset;for(p?)*(\*|-|\+|- \[( | x)\]|\d+\.) /g,a=i.match(o);if(a){let s=i.split(new RegExp(o.source.replaceAll("(","(?:"))),l="",u=0;for(let c of s)u>0&&(l+=a[u-1]),l+=t(c),u++;i=l}else i=t(i);e=Ve(e,r.start.offset+2,r.end.offset,i)}return e}function Sf(e){let t=Ze("code",e);for(let n of t)!e.substring(n.start.offset,n.end.offset).startsWith("```")||(e=ko(e,n.start.offset,n.end.offset));return e}function Of(e){let t=Ze("table",e);for(let n of t)e=ko(e,n.start.offset,n.end.offset);return e}function Tf(e){let t=Ze("blockquote",e);for(let n of t)e=ko(e,n.start.offset,n.end.offset,!0);return e}function Cf(e,t,n){let r=Ze("list",e);if(!r)return e;for(let i of r){let o=i.start.offset;for(;o>0&&e.charAt(o-1)!==` `;)o--;let a=e.substring(o,i.end.offset),s=function(c){let p=c.lastIndexOf("> ");return p!==-1&&(c=c.substring(p+2)),c=c.replaceAll(" "," "),Math.floor((c.split(" ").length-1)/2)+1},l=new Map,u=-1;a=a.replace(/^(( |\t|> )*)(\d+(\.|\)))([^\n]*)$/gm,(c,p="",m,f,d,h)=>{let g=1,b=s(p);if(l.has(b)?t==="ascending"&&(g=l.get(b)+1,l.set(b,g)):l.set(b,1),u>b){let O=u;for(;O>b;)l.delete(O--)}return u=b,`${p}${g}${n}${h}`}),e=Ve(e,o,i.end.offset,a)}return e}function Af(e,t){let n=Ze("listItem",e);if(!n)return e;let r=/^((\d+[.)])|(- \[[ x]\]))/m,i=t;if(t=="consistent"){let o=n.length-1;for(;o>=0;){let a=e.substring(n[o].start.offset,n[o].end.offset);if(o--,!a.match(r)){i=a.charAt(0);break}}if(o==-1)return e}for(let o of n){let a=e.substring(o.start.offset,o.end.offset);a.match(r)||(a=i+a.substring(1),e=Ve(e,o.start.offset,o.end.offset,a))}return e}var Pn=class{constructor(t,n,r,i){this.name=t,this.description=n,this.defaultValue=r,this.searchInfo={name:t,description:n},i&&(this.ruleName=i)}setOption(t,n){n.ruleConfigs[this.ruleName][this.name]=t}},fr=class extends Pn{display(n,r,i){let o=new dr.Setting(n).addToggle(a=>{a.setValue(r.ruleConfigs[this.ruleName][this.name]),a.onChange(s=>{this.setOption(s,r),i.settings=r,i.saveData(i.settings)})});o.nameEl.innerHTML=ct(this.name),o.descEl.innerHTML=ct(this.description),o.settingEl.style.border="none"}},ti=class extends Pn{display(n,r,i){let o=new dr.Setting(n).addText(a=>{a.setValue(r.ruleConfigs[this.ruleName][this.name]),a.onChange(s=>{this.setOption(s,r),i.settings=r,i.saveData(i.settings)})});o.nameEl.innerHTML=ct(this.name),o.descEl.innerHTML=ct(this.description),o.settingEl.style.border="none"}},ua=class extends Pn{display(n,r,i){let o=new dr.Setting(n).addTextArea(a=>{a.setValue(r.ruleConfigs[this.ruleName][this.name]),a.onChange(s=>{this.setOption(s,r),i.settings=r,i.saveData(i.settings)})});o.nameEl.innerHTML=ct(this.name),o.descEl.innerHTML=ct(this.description),o.settingEl.style.border="none"}},ca=class extends Pn{display(n,r,i){let o=new dr.Setting(n).addMomentFormat(a=>{a.setValue(r.ruleConfigs[this.ruleName][this.name]),a.setPlaceholder("dddd, MMMM Do YYYY, h:mm:ss a"),a.onChange(s=>{this.setOption(s,r),i.settings=r,i.saveData(i.settings)})});o.nameEl.innerHTML=ct(this.name),o.descEl.innerHTML=ct(this.description),o.settingEl.style.border="none"}},pa=class{constructor(t,n){this.value=t,this.description=n}},ma=class extends Pn{constructor(n,r,i,o,a){super(n,r,i,a);this.options=o,this.searchInfo.options=o}display(n,r,i){let o=new dr.Setting(n).addDropdown(a=>{for(let s of this.options)a.addOption(s.value,s.value);a.setValue(r.ruleConfigs[this.ruleName][this.name]),a.onChange(s=>{this.setOption(s,r),i.settings=r,i.saveData(i.settings)})});o.nameEl.innerHTML=ct(this.name),o.descEl.innerHTML=ct(this.description),o.settingEl.style.border="none"}};var pn=class extends Error{constructor(t,n){var r;super(t),this.cause=n!=null?n:null,this.stack=(r=n.stack)!=null?r:null,Object.setPrototypeOf(this,pn.prototype)}};var W=(o=>(o.YAML="YAML",o.HEADING="Heading",o.FOOTNOTE="Footnote",o.CONTENT="Content",o.SPACING="Spacing",o))(W||{}),fa=class{constructor(t,n,r,i,o,a=[],s=!1){this.name=t,this.description=n,this.type=r,this.apply=i,this.examples=o,a.unshift(new fr(this.description,"",!1));for(let l of a)l.ruleName=t;this.options=a,this.hasSpecialExecutionOrder=s}alias(){return this.name.replace(/ /g,"-").toLowerCase()}getDefaultOptions(){let t={};for(let n of this.options)t[n.name]=n.defaultValue;return t}getOptions(t){return t.ruleConfigs[this.name]}getURL(){return"https://github.com/platers/obsidian-linter/blob/master/docs/rules.md"+"#"+this.alias()}enabledOptionName(){return this.options[0].name}},da=class{constructor(t,n,r,i={}){this.description=t,this.options=i,this.before=n,this.after=r}},Ef=Object.values(W);function Lf(e){let t=e.match(Ie);if(!t)return[];let n=t[1],r=Be(n,"disabled rules");if(r==null)return[];let i=r.includes(` `)?`disabled rules: `:"disabled rules: ";i+=r;let a=ht(i)["disabled rules"];return a?(typeof a=="string"&&(a=[a]),a.includes("all")?Nt.map(s=>s.alias()):a):[]}var Nt=[],Ab=Nt.reduce((e,t)=>(e[t.alias()]=t,e),{});function _f(e){Nt.push(e),Nt.sort((t,n)=>Ef.indexOf(t.type)-Ef.indexOf(n.type)||t.name.localeCompare(n.name)),Ab[e.alias()]=e}function ha(e,t){let n;throw e instanceof uc?(n=e.toString(),n=`error in the yaml: ${n.substring(n.indexOf(":")+1)}`):n=`unknown error: ${e.message}`,new pn(`"${t}" encountered an ${n}`,e)}var Tr=Xn(If());function Eb(e){for(var t=[],n=1;nr.example),t.optionBuilders.map(r=>r.option),t.hasSpecialExecutionOrder);pt(bt,gr).set(this.name,n),pt(bt,ri).set(t.name,t)}return pt(bt,gr).get(this.name)}static applyIfEnabledBase(t,n,r,i){let o=t.getOptions(r);if(o[t.enabledOptionName()]){let a=Object.assign({},o,i);mn(`Running ${t.name}`);try{return[t.apply(n,a),!0]}catch(s){ha(s,t.name)}}else return[n,!1]}static getBuilderByName(t){return pt(bt,ri).get(t)}static setNoSettingControl(t,n){pt(bt,fn).has(t)||pt(bt,fn).set(t,[]),pt(bt,fn).get(t).push(n)}static hasSettingControl(t,n){return!pt(bt,fn).has(t)||!pt(bt,fn).get(t).includes(n)}},Ct=bt;gr=new WeakMap,ri=new WeakMap,fn=new WeakMap,Jn(Ct,gr,new Map),Jn(Ct,ri,new Map),Jn(Ct,fn,new Map);var A=class extends Ct{static register(t){let n=t.getRule();_f(n)}safeApply(t,n){return this.apply(t,this.buildRuleOptions(n))}buildRuleOptions(t){t=t!=null?t:{};let n=new this.OptionsClass,r=Object.assign(n,t);for(let i of this.optionBuilders)i.setRuleOption(r,t);return r}get hasSpecialExecutionOrder(){return!1}static applyIfEnabled(t,n,r,i){let o=this.getRule();return r.includes(o.alias())?(mn(o.alias()+" is disabled"),[t,!1]):Ct.applyIfEnabledBase(o,t,n,i)}static getRuleOptions(t){let n=Ct.getRule.bind(this)(),r=new this,i=n.getOptions(t);return r.buildRuleOptions(i)}static noSettingControl(){return(t,n)=>{let r=t.constructor.name;Ct.setNoSettingControl(r,n)}}},Il,T=class{constructor(t){Jn(this,Il,void 0);this.example=new da(t.description,t.before,t.after,t.options)}};Il=new WeakMap;var yr,dn=class{constructor(t){Jn(this,yr,void 0);this.OptionsClass=t.OptionsClass,this.name=t.name,this.description=t.description,this.optionsKey=t.optionsKey}get defaultValue(){return new this.OptionsClass()[this.optionsKey]}get option(){return pt(this,yr)||xu(this,yr,this.buildOption()),pt(this,yr)}setRuleOption(t,n){let r=n[this.name];r!==void 0&&(t[this.optionsKey]=r)}};yr=new WeakMap;var se=class extends dn{buildOption(){return new fr(this.name,this.description,this.defaultValue)}},ba=class extends dn{buildOption(){return new ti(this.name,this.description,this.defaultValue)}},de=class extends dn{constructor(n){super(n);this.records=n.records.map(r=>new pa(r.value,r.description))}buildOption(){return new ma(this.name,this.description,this.defaultValue,this.records)}},Re=class extends dn{constructor(n){var r,i;super(n);this.separator=(r=n.separator)!=null?r:` `,this.splitter=(i=n.splitter)!=null?i:/\n/}buildOption(){return new ua(this.name,this.description,this.defaultValue.join(this.separator))}setRuleOption(n,r){if(r[this.name]!==void 0){let i=r[this.name].split(this.splitter).filter(function(o){return o!=""});n[this.optionsKey]=i}}},Nn=class extends dn{buildOption(){return new ti(this.name,this.description,this.defaultValue)}},wa=class extends dn{buildOption(){return new ca(this.name,this.description,this.defaultValue)}};var v={code:{replaceAction:"code",placeholder:"{CODE_BLOCK_PLACEHOLDER}"},inlineCode:{replaceAction:"inlineCode",placeholder:"{INLINE_CODE_BLOCK_PLACEHOLDER}"},image:{replaceAction:"image",placeholder:"{IMAGE_PLACEHOLDER}"},thematicBreak:{replaceAction:"thematicBreak",placeholder:"{HORIZONTAL_RULE_PLACEHOLDER}"},italics:{replaceAction:"emphasis",placeholder:"{ITALICS_PLACEHOLDER}"},bold:{replaceAction:"strong",placeholder:"{STRONG_PLACEHOLDER}"},list:{replaceAction:"list",placeholder:"{LIST_PLACEHOLDER}"},blockquote:{replaceAction:"blockquote",placeholder:"{BLOCKQUOTE_PLACEHOLDER}"},table:{replaceAction:"table",placeholder:"{TABLE_PLACEHOLDER}"},math:{replaceAction:"math",placeholder:"{MATH_PLACEHOLDER}"},inlineMath:{replaceAction:"inlineMath",placeholder:"{INLINE_MATH_PLACEHOLDER}"},yaml:{replaceAction:Ie,placeholder:je(`--- ---`)},wikiLink:{replaceAction:os,placeholder:"{WIKI_LINK_PLACEHOLDER}"},tag:{replaceAction:Pr,placeholder:"#tag-placeholder"},obsidianMultiLineComments:{replaceAction:pc,placeholder:"{OBSIDIAN_COMMENT_PLACEHOLDER}"},link:{replaceAction:Mb,placeholder:"{REGULAR_LINK_PLACEHOLDER}"}};function $(e,t,n){let r=[];for(let i of e){let o;if(typeof i.replaceAction=="string")o=_b(t,i.placeholder,i.replaceAction);else if(i.replaceAction instanceof RegExp)o=Ib(t,i.placeholder,i.replaceAction);else if(typeof i.replaceAction=="function"){let a=i.replaceAction;o=a(t,i.placeholder)}t=o.newText,r.push({replacedValues:o.replacedValues,placeholder:i.placeholder})}return t=n(t),r=r.reverse(),r!=null&&r.length>0&&r.forEach(i=>{i.replacedValues.forEach(o=>{t=t.replace(new RegExp(i.placeholder,"i"),je(o))})}),t}function _b(e,t,n){let r=Ze(n,e),i=[];for(let o of r){let a=e.substring(o.start.offset,o.end.offset);i.push(a),e=Ve(e,o.start.offset,o.end.offset,t)}return i.reverse(),{newText:e,replacedValues:i}}function Ib(e,t,n){let r=e.match(n),i=[];if(n.flags.includes("g")){if(e=e.replaceAll(n,t),r)for(let o of r)i.push(o)}else e=e.replace(n,t),r&&i.push(r[0]);return{newText:e,replacedValues:i}}function Mb(e,t){let n=Ze("link",e),r=[];for(let i of n){if(i==null)continue;let o=e.substring(i.start.offset,i.end.offset);!o.match(ho)||(r.push(o),e=Ve(e,i.start.offset,i.end.offset,t))}return r.reverse(),{newText:e,replacedValues:r}}var zn=class{constructor(){this.style="Title Case";this.ignoreWords=["macOS","iOS","iPhone","iPad","JavaScript","TypeScript","AppleScript"];this.lowercaseWords=["via","a","an","the","and","or","but","for","nor","so","yet","at","by","in","of","on","to","up","as","is","if","it","for","to","with","without","into","onto","per"];this.ignoreCasedWords=!0}},ii=class extends A{get OptionsClass(){return zn}get name(){return"Capitalize Headings"}get description(){return"Headings should be formatted with capitalization"}get type(){return"Heading"}apply(t,n){return $([v.code,v.yaml,v.link,v.wikiLink,v.tag],t,r=>{let i=r.split(` `);for(let o=0;os.toUpperCase());break}return i.join(` `)})}get exampleBuilders(){return[new T({description:"With `Title Case=true`, `Ignore Cased Words=false`",before:y` # this is a heading 1 ## THIS IS A HEADING 2 ### a heading 3 `,after:y` # This is a Heading 1 ## This is a Heading 2 ### A Heading 3 `,options:{style:"Title Case",ignoreCasedWords:!1}}),new T({description:"With `Title Case=true`, `Ignore Cased Words=true`",before:y` # this is a heading 1 ## THIS IS A HEADING 2 ### a hEaDiNg 3 `,after:y` # This is a Heading 1 ## THIS IS A HEADING 2 ### A hEaDiNg 3 `,options:{style:"Title Case",ignoreCasedWords:!0}}),new T({description:"With `First letter=true`",before:y` # this is a heading 1 ## this is a heading 2 `,after:y` # This is a heading 1 ## This is a heading 2 `,options:{style:"First letter"}}),new T({description:"With `ALL CAPS=true`",before:y` # this is a heading 1 ## this is a heading 2 `,after:y` # THIS IS A HEADING 1 ## THIS IS A HEADING 2 `,options:{style:"ALL CAPS"}})]}get optionBuilders(){return[new de({OptionsClass:zn,name:"Style",description:"The style of capitalization to use",optionsKey:"style",records:[{value:"Title Case",description:"Capitalize Using Title Case Rules"},{value:"ALL CAPS",description:"CAPITALIZE THE WHOLE TITLE"},{value:"First letter",description:"Only capitalize the first letter"}]}),new se({OptionsClass:zn,name:"Ignore Cased Words",description:"Only apply title case style to words that are all lowercase",optionsKey:"ignoreCasedWords"}),new Re({OptionsClass:zn,name:"Ignore Words",description:"A comma separated list of words to ignore when capitalizing",optionsKey:"ignoreWords",splitter:as,separator:", "}),new Re({OptionsClass:zn,name:"Lowercase Words",description:"A comma separated list of words to keep lowercase",optionsKey:"lowercaseWords",splitter:as,separator:", "})]}};ii=B([A.register],ii);var xa=class{constructor(){this.innerNewLines=!1}},oi=class extends A{get OptionsClass(){return xa}get name(){return"Compact YAML"}get description(){return"Removes leading and trailing blank lines in the YAML front matter."}get type(){return"Spacing"}apply(t,n){return qe(t,r=>(r=r.replace(/^---\n+/,`--- `),r=r.replace(/\n+---/,` ---`),n.innerNewLines&&(r=r.replaceAll(/\n{2,}/g,` `)),r))}get exampleBuilders(){return[new T({description:"Remove blank lines at the start and end of the YAML",before:y` --- ${""} date: today ${""} title: unchanged without inner new lines turned on ${""} --- `,after:y` --- date: today ${""} title: unchanged without inner new lines turned on --- `}),new T({description:"Remove blank lines anywhere in YAML with inner new lines set to true",before:y` --- ${""} date: today ${""} ${""} title: remove inner new lines ${""} --- ${""} # Header 1 ${""} ${""} Body content here. `,after:y` --- date: today title: remove inner new lines --- ${""} # Header 1 ${""} ${""} Body content here. `,options:{innerNewLines:!0}})]}get optionBuilders(){return[new se({OptionsClass:xa,name:"Inner New Lines",description:"Remove new lines that are not at the start or the end of the YAML",optionsKey:"innerNewLines"})]}};oi=B([A.register],oi);var Ml=class{},ai=class extends A{get OptionsClass(){return Ml}get name(){return"Consecutive blank lines"}get description(){return"There should be at most one consecutive blank line."}get type(){return"Spacing"}apply(t,n){return $([v.code,v.yaml,v.link,v.wikiLink,v.tag],t,r=>r.replace(/\n{2,}/g,` `))}get exampleBuilders(){return[new T({description:"",before:y` Some text ${""} ${""} Some more text `,after:y` Some text ${""} Some more text `})]}get optionBuilders(){return[]}};ai=B([A.register],ai);var Bl=class{},si=class extends A{get OptionsClass(){return Bl}get name(){return"Convert Bullet List Markers"}get description(){return"Converts common bullet list marker symbols to markdown list markers."}get type(){return"Content"}apply(t,n){return $([v.code,v.yaml,v.link,v.wikiLink,v.tag],t,r=>r.replace(/^([^\S\n]*)([•§])([^\S\n]*)/gm,"$1-$3"))}get exampleBuilders(){return[new T({description:"Converts \u2022",before:y` • item 1 • item 2 `,after:y` - item 1 - item 2 `}),new T({description:"Converts \xA7",before:y` • item 1 § item 2 § item 3 `,after:y` - item 1 - item 2 - item 3 `})]}get optionBuilders(){return[]}};si=B([A.register],si);var ka=class{constructor(){this.tabsize=4}},li=class extends A{get OptionsClass(){return ka}get name(){return"Convert Spaces to Tabs"}get description(){return"Converts leading spaces to tabs."}get type(){return"Spacing"}apply(t,n){return $([v.code,v.yaml,v.link,v.wikiLink,v.tag],t,r=>{let i=String(n.tabsize),o=new RegExp("^( *) {"+String(i)+"}","gm");for(;r.match(o)!=null;)r=r.replace(o,"$1 ");return r})}get exampleBuilders(){return[new T({description:"Converting spaces to tabs with `tabsize = 3`",before:y` - text with no indention - text indented with 3 spaces - text with no indention - text indented with 6 spaces `,after:y` - text with no indention \t- text indented with 3 spaces - text with no indention \t\t- text indented with 6 spaces `,options:{tabsize:3}})]}get optionBuilders(){return[new ba({OptionsClass:ka,name:"Tabsize",description:"Number of spaces that will be converted to a tab",optionsKey:"tabsize"})]}};li=B([A.register],li);var va=class{constructor(){this.style="consistent"}},ui=class extends A{get OptionsClass(){return va}get name(){return"Emphasis Style"}get description(){return"Makes sure the emphasis style is consistent."}get type(){return"Content"}apply(t,n){return $([v.code,v.yaml,v.link,v.wikiLink,v.tag,v.math,v.inlineMath],t,r=>la(r,n.style,"emphasis"))}get exampleBuilders(){return[new T({description:"Emphasis indicators should use underscores when style is set to 'underscore'",before:y` # Emphasis Cases ${""} *Test emphasis* * Test not emphasized * This is *emphasized* mid sentence This is *emphasized* mid sentence with a second *emphasis* on the same line This is ***bold and emphasized*** This is ***nested bold** and ending emphasized* This is ***nested emphasis* and ending bold** ${""} **Test bold** ${""} * List Item1 with *emphasized text* * List Item2 `,after:y` # Emphasis Cases ${""} _Test emphasis_ * Test not emphasized * This is _emphasized_ mid sentence This is _emphasized_ mid sentence with a second _emphasis_ on the same line This is _**bold and emphasized**_ This is _**nested bold** and ending emphasized_ This is **_nested emphasis_ and ending bold** ${""} **Test bold** ${""} * List Item1 with _emphasized text_ * List Item2 `,options:{style:"underscore"}}),new T({description:"Emphasis indicators should use asterisks when style is set to 'asterisk'",before:y` # Emphasis Cases ${""} _Test emphasis_ _ Test not emphasized _ This is _emphasized_ mid sentence This is _emphasized_ mid sentence with a second _emphasis_ on the same line This is ___bold and emphasized___ This is ___nested bold__ and ending emphasized_ This is ___nested emphasis_ and ending bold__ ${""} __Test bold__ `,after:y` # Emphasis Cases ${""} *Test emphasis* _ Test not emphasized _ This is *emphasized* mid sentence This is *emphasized* mid sentence with a second *emphasis* on the same line This is *__bold and emphasized__* This is *__nested bold__ and ending emphasized* This is __*nested emphasis* and ending bold__ ${""} __Test bold__ `,options:{style:"asterisk"}}),new T({description:"Emphasis indicators should use consistent style based on first emphasis indicator in a file when style is set to 'consistent'",before:y` # Emphasis First Emphasis Is an Asterisk ${""} *First emphasis* This is _emphasized_ mid sentence This is *emphasized* mid sentence with a second _emphasis_ on the same line This is *__bold and emphasized__* This is *__nested bold__ and ending emphasized* This is **_nested emphasis_ and ending bold** ${""} __Test bold__ `,after:y` # Emphasis First Emphasis Is an Asterisk ${""} *First emphasis* This is *emphasized* mid sentence This is *emphasized* mid sentence with a second *emphasis* on the same line This is *__bold and emphasized__* This is *__nested bold__ and ending emphasized* This is ***nested emphasis* and ending bold** ${""} __Test bold__ `,options:{style:"consistent"}}),new T({description:"Emphasis indicators should use consistent style based on first emphasis indicator in a file when style is set to 'consistent'",before:y` # Emphasis First Emphasis Is an Underscore ${""} **_First emphasis_** This is _emphasized_ mid sentence This is *emphasized* mid sentence with a second _emphasis_ on the same line This is *__bold and emphasized__* This is _**nested bold** and ending emphasized_ This is __*nested emphasis* and ending bold__ ${""} __Test bold__ `,after:y` # Emphasis First Emphasis Is an Underscore ${""} **_First emphasis_** This is _emphasized_ mid sentence This is _emphasized_ mid sentence with a second _emphasis_ on the same line This is ___bold and emphasized___ This is _**nested bold** and ending emphasized_ This is ___nested emphasis_ and ending bold__ ${""} __Test bold__ `,options:{style:"consistent"}})]}get optionBuilders(){return[new de({OptionsClass:va,name:"Style",description:"The style used to denote emphasized content",optionsKey:"style",records:[{value:"consistent",description:"Makes sure the first instance of emphasis is the style that will be used throughout the document"},{value:"asterisk",description:"Makes sure * is the emphasis indicator"},{value:"underscore",description:"Makes sure _ is the emphasis indicator"}]})]}};ui=B([A.register],ui);var Fl=class{},ci=class extends A{get OptionsClass(){return Fl}get name(){return"Empty Line Around Blockquotes"}get description(){return"Ensures that there is an empty line around blockquotes unless they start or end a document. **Note that an empty line is either one less level of nesting for blockquotes or a newline character.**"}get type(){return"Spacing"}apply(t,n){return Tf(t)}get exampleBuilders(){return[new T({description:"Blockquotes that start a document do not get an empty line before them.",before:y` > Quote content here > quote content continued # Title here `,after:y` > Quote content here > quote content continued ${""} # Title here `}),new T({description:"Blockquotes that end a document do not get an empty line after them.",before:y` # Heading 1 > Quote content here > quote content continued `,after:y` # Heading 1 ${""} > Quote content here > quote content continued `}),new T({description:"Blockquotes that are nested have the proper empty line added",before:y` # Make sure that nested blockquotes are accounted for correctly > Quote content here > quote content continued > > Nested Blockquote > > content continued ${""} **Note that the empty line is either one less blockquote indicator if followed/proceeded by more blockquote content or it is an empty line** ${""} # Doubly nested code block ${""} > > Quote content here > > quote content continued `,after:y` # Make sure that nested blockquotes are accounted for correctly ${""} > Quote content here > quote content continued > > > Nested Blockquote > > content continued ${""} **Note that the empty line is either one less blockquote indicator if followed/proceeded by more blockquote content or it is an empty line** ${""} # Doubly nested code block ${""} > > Quote content here > > quote content continued `})]}get optionBuilders(){return[]}};ci=B([A.register],ci);var Rl=class{},pi=class extends A{get OptionsClass(){return Rl}get name(){return"Empty Line Around Code Fences"}get description(){return"Ensures that there is an empty line around code fences unless they start or end a document."}get type(){return"Spacing"}apply(t,n){return Sf(t)}get exampleBuilders(){return[new T({description:"Fenced code blocks that start a document do not get an empty line before them.",before:y` \`\`\` js var temp = 'text'; // this is a code block \`\`\` Text after code block. `,after:y` \`\`\` js var temp = 'text'; // this is a code block \`\`\` ${""} Text after code block. `}),new T({description:"Fenced code blocks that end a document do not get an empty line after them.",before:y` # Heading 1 \`\`\` Here is a code block \`\`\` `,after:y` # Heading 1 ${""} \`\`\` Here is a code block \`\`\` `}),new T({description:"Fenced code blocks that are in a blockquote have the proper empty line added",before:y` # Make sure that code blocks in blockquotes are accounted for correctly > \`\`\`js > var text = 'this is some text'; > \`\`\` > > \`\`\`js > var other text = 'this is more text'; > \`\`\` ${""} **Note that the blanks blockquote lines added do not have whitespace after them** ${""} # Doubly nested code block ${""} > > \`\`\`js > > var other text = 'this is more text'; > > \`\`\` `,after:y` # Make sure that code blocks in blockquotes are accounted for correctly > > \`\`\`js > var text = 'this is some text'; > \`\`\` > > \`\`\`js > var other text = 'this is more text'; > \`\`\` > ${""} **Note that the blanks blockquote lines added do not have whitespace after them** ${""} # Doubly nested code block ${""} > > > > \`\`\`js > > var other text = 'this is more text'; > > \`\`\` `}),new T({description:"Nested fenced code blocks get empty lines added around them",before:y` \`\`\`markdown # Header ${""} \`\`\`\`JavaScript var text = 'some string'; \`\`\`\` \`\`\` `,after:y` \`\`\`markdown # Header ${""} \`\`\`\`JavaScript var text = 'some string'; \`\`\`\` ${""} \`\`\` `})]}get optionBuilders(){return[]}};pi=B([A.register],pi);var Dl=class{},mi=class extends A{get OptionsClass(){return Dl}get name(){return"Empty Line Around Tables"}get description(){return"Ensures that there is an empty line around github flavored tables unless they start or end a document."}get type(){return"Spacing"}apply(t,n){return $([v.yaml,v.code],t,r=>Of(r))}get exampleBuilders(){return[new T({description:"Tables that start a document do not get an empty line before them.",before:y` | Column 1 | Column 2 | |----------|----------| | foo | bar | | baz | qux | | quux | quuz | More text. # Heading ${""} **Note that text directly following a table is considered part of a table according to github markdown** `,after:y` | Column 1 | Column 2 | |----------|----------| | foo | bar | | baz | qux | | quux | quuz | More text. ${""} # Heading ${""} **Note that text directly following a table is considered part of a table according to github markdown** `}),new T({description:"Tables that end a document do not get an empty line after them.",before:y` # Heading 1 | Column 1 | Column 2 | |----------|----------| | foo | bar | | baz | qux | | quux | quuz | `,after:y` # Heading 1 ${""} | Column 1 | Column 2 | |----------|----------| | foo | bar | | baz | qux | | quux | quuz | `}),new T({description:"Tables that are not at the start or the end of the document will have an empty line added before and after them",before:y` # Table 1 | Column 1 | Column 2 | Column 3 | |----------|----------|----------| | foo | bar | blob | | baz | qux | trust | | quux | quuz | glob | # Table 2 without Pipe at Start and End | Column 1 | Column 2 | :-: | -----------: bar | baz foo | bar # Header for more content New paragraph. `,after:y` # Table 1 ${""} | Column 1 | Column 2 | Column 3 | |----------|----------|----------| | foo | bar | blob | | baz | qux | trust | | quux | quuz | glob | ${""} # Table 2 without Pipe at Start and End ${""} | Column 1 | Column 2 | :-: | -----------: bar | baz foo | bar ${""} # Header for more content New paragraph. `}),new T({description:"Tables in callouts or blockquotes have the appropriately formatted blank lines added",before:y` > Table in blockquote > | Column 1 | Column 2 | Column 3 | > |----------|----------|----------| > | foo | bar | blob | > | baz | qux | trust | > | quux | quuz | glob | ${""} More content here ${""} > Table doubly nested in blockquote > > | Column 1 | Column 2 | Column 3 | > > |----------|----------|----------| > > | foo | bar | blob | > > | baz | qux | trust | > > | quux | quuz | glob | `,after:y` > Table in blockquote > > | Column 1 | Column 2 | Column 3 | > |----------|----------|----------| > | foo | bar | blob | > | baz | qux | trust | > | quux | quuz | glob | > ${""} More content here ${""} > Table doubly nested in blockquote > > > > | Column 1 | Column 2 | Column 3 | > > |----------|----------|----------| > > | foo | bar | blob | > > | baz | qux | trust | > > | quux | quuz | glob | `})]}get optionBuilders(){return[]}};mi=B([A.register],mi);var br=class{constructor(){this.defaultEscapeCharacter='"';this.tryToEscapeSingleLineArrays=!1;this.forceYamlEscape=[]}},$n=class extends A{get OptionsClass(){return br}get name(){return"Escape YAML Special Characters"}get description(){return`Escapes colons with a space after them (: ), single quotes ('), and double quotes (") in YAML.`}get type(){return"YAML"}apply(t,n){return qe(t,r=>{let i=r.split(` `),o=i.length;if(o<1)return r;let a=function(u){return u.length>1&&(u.startsWith("'")&&u.endsWith("'")||u.startsWith('"')&&u.endsWith('"'))},s=function(u,c){if(a(c))return u;let p=c.includes("'"),m=c.includes('"'),f=c.includes(": ");if(!p&&!m&&!f||p&&m)return u;let d;return p?d=u.replace(c,`"${c}"`):m?d=u.replace(c,`'${c}'`):d=u.replace(c,`${n.defaultEscapeCharacter}${c}${n.defaultEscapeCharacter}`),d};for(let u=0;u=c.length,f=c.startsWith("-"),d=f&&c.length<2;if(m&&d)continue;let h=1;f||(h+=p);let g=c.substring(h).trim();if(g.startsWith("[")){if(n.tryToEscapeSingleLineArrays){if(g.length<3)continue;let b=g.substring(1,g.length-1).split(","),O=b.length;for(let S=0;S{if(r.match(/^#\s.*/m))return r;let o=n.fileName,a=r.indexOf(` ---`);return a=a==-1||!r.startsWith(`--- `)?0:a+5,On(r,a,`# ${o} `)})}get exampleBuilders(){return[new T({description:"Inserts an H1 heading",before:y` This is a line of text `,after:y` # File Name This is a line of text `,options:{fileName:"File Name"}}),new T({description:"Inserts heading after YAML front matter",before:y` --- title: My Title --- This is a line of text `,after:y` --- title: My Title --- # File Name This is a line of text `,options:{fileName:"File Name"}})]}get optionBuilders(){return[]}};fi=B([A.register],fi);var Pl=class{},di=class extends A{get OptionsClass(){return Pl}get name(){return"Footnote after Punctuation"}get description(){return"Ensures that footnote references are placed after punctuation, not before."}get type(){return"Footnote"}apply(t,n){return $([v.code,v.yaml,v.link,v.wikiLink,v.tag],t,r=>r.replace(/(?!^)(\[\^\w+\]) ?([,.;!:?])/gm,"$2$1"))}get exampleBuilders(){return[new T({description:"Placing footnotes after punctuation.",before:y` Lorem[^1]. Ipsum[^2], doletes. `,after:y` Lorem.[^1] Ipsum,[^2] doletes. `})]}get optionBuilders(){return[]}};di=B([A.register],di);var Nl=class{},Hn=class extends A{get OptionsClass(){return Nl}get name(){return"Format Tags in YAML"}get description(){return"Remove Hashtags from tags in the YAML frontmatter, as they make the tags there invalid."}get type(){return"YAML"}apply(t,n){return qe(t,r=>r.replace(/\ntags:(.*?)(?=\n(?:[A-Za-z-]+?:|---))/s,function(i){return i.replaceAll("#","")}))}get exampleBuilders(){return[new T({description:"Format Tags in YAML frontmatter",before:y` --- tags: #one #two #three #nested/four/five --- `,after:y` --- tags: one two three nested/four/five --- `}),new T({description:"Format tags in array",before:y` --- tags: [#one #two #three] --- `,after:y` --- tags: [one two three] --- `}),new T({description:"Format tags in list",before:y` --- tags: - #tag1 - #tag2 --- `,after:y` --- tags: - tag1 - tag2 --- `})]}get optionBuilders(){return[]}get hasSpecialExecutionOrder(){return!0}};Hn=B([A.register],Hn);var At=class{constructor(){this.aliasArrayStyle="single-line";this.formatAliasKey=!0;this.tagArrayStyle="single-line";this.formatTagKey=!0;this.defaultArrayStyle="single-line";this.formatArrayKeys=!0;this.forceSingleLineArrayStyle=[];this.forceMultiLineArrayStyle=[]}},hi=class extends A{get OptionsClass(){return At}get name(){return"Format Yaml Array"}get description(){return"Allows for the formatting of regular yaml arrays as either multi-line or single-line and `tags` and `aliases` are allowed to have some Obsidian specific yaml formats. Note that single string to single-line goes from a single string entry to a single-line array if more than 1 entry is present. The same is true for single string to multi-line except it becomes a multi-line array."}get type(){return"YAML"}apply(t,n){return qe(t,r=>{let i=ht(r.replace(`--- `,"").replace(` ---`,""));if(!i)return r;let o=function(a){return a&&Object.prototype.toString.call(a)==="[object Date]"&&!isNaN(a)};if(n.formatAliasKey&&Object.keys(i).includes(mt)&&(r=Me(r,mt,ft(bo(Ft(Be(r,mt))),n.aliasArrayStyle))),n.formatTagKey&&Object.keys(i).includes(nn)&&(r=Me(r,nn,ft(yo(Ft(Be(r,nn))),n.tagArrayStyle))),n.formatArrayKeys){let a=[mt,nn,...n.forceMultiLineArrayStyle,...n.forceSingleLineArrayStyle];for(let s of Object.keys(i))a.includes(s)||!(typeof i[s]=="object"&&!o(i[s])&&i[s])||(r=Me(r,s,ft(Ft(Be(r,s)),n.defaultArrayStyle)))}for(let a of n.forceSingleLineArrayStyle)!Object.keys(i).includes(a)||(r=Me(r,a,ft(Ft(Be(r,a)),"single-line")));for(let a of n.forceMultiLineArrayStyle)!Object.keys(i).includes(a)||(r=Me(r,a,ft(Ft(Be(r,a)),"multi-line")));return r})}get exampleBuilders(){return[new T({description:"Format tags as a single-line array delimited by spaces and aliases as a multi-line array and format the key `test` to be a single-line array",before:y` --- tags: - computer - research aliases: Title 1, Title2 test: this is a value --- ${""} # Notes: ${""} Nesting yaml arrays may result in unexpected results. ${""} Multi-line arrays will have empty values removed only leaving one if it is completely empty. The same is not true for single-line arrays as that is invalid yaml unless it comes as the last entry in the array. `,after:y` --- tags: [computer, research] aliases: - Title 1 - Title2 test: [this is a value] --- ${""} # Notes: ${""} Nesting yaml arrays may result in unexpected results. ${""} Multi-line arrays will have empty values removed only leaving one if it is completely empty. The same is not true for single-line arrays as that is invalid yaml unless it comes as the last entry in the array. `,options:{aliasArrayStyle:"multi-line",forceSingleLineArrayStyle:["test"]}}),new T({description:"Format tags as a single string with space delimiters, ignore aliases, and format regular yaml arrays as single-line arrays",before:y` --- aliases: Typescript types: - thought provoking - peer reviewed tags: [computer, science, trajectory] --- `,after:y` --- aliases: Typescript types: [thought provoking, peer reviewed] tags: computer science trajectory --- `,options:{formatAliasKey:!1,tagArrayStyle:"single string space delimited"}})]}get optionBuilders(){return[new de({OptionsClass:At,name:"Yaml aliases section style",description:"The style of the yaml aliases section",optionsKey:"aliasArrayStyle",records:[{value:"multi-line",description:"```aliases:\\n - Title```"},{value:"single-line",description:"```aliases: [Title]```"},{value:"single string comma delimited",description:"```aliases: Title, Other Title```"},{value:"single string to single-line",description:"Aliases will be formatted as a string if there is 1 or fewer elements like so ```aliases: Title```. If there is more than 1 element, it will be formatted like a single-line array."},{value:"single string to multi-line",description:"Aliases will be formatted as a string if there is 1 or fewer elements like so ```aliases: Title```. If there is more than 1 element, it will be formatted like a multi-line array."}]}),new se({OptionsClass:At,name:"Format yaml aliases section",description:"Turns on formatting for the yaml aliases section. You should not enable this option alongside the rule `YAML Title Alias` as they may not work well together or they may have different format styles selected causing unexpected results.",optionsKey:"formatAliasKey"}),new de({OptionsClass:At,name:"Yaml tags section style",description:"The style of the yaml tags section",optionsKey:"tagArrayStyle",records:[{value:"multi-line",description:"```tags:\\n - tag1```"},{value:"single-line",description:"```tags: [tag1]```"},{value:"single string to single-line",description:"Tags will be formatted as a string if there is 1 or fewer elements like so ```tags: tag1```. If there is more than 1 element, it will be formatted like a single-line array."},{value:"single string to multi-line",description:"Aliases will be formatted as a string if there is 1 or fewer elements like so ```tags: tag1```. If there is more than 1 element, it will be formatted like a multi-line array."},{value:"single-line space delimited",description:"```tags: [tag1 tag2]```"},{value:"single string space delimited",description:"```tags: tag1 tag2```"},{value:"single string comma delimited",description:"```tags: tag1, tag2```"}]}),new se({OptionsClass:At,name:"Format yaml tags section",description:"Turns on formatting for the yaml tags section.",optionsKey:"formatTagKey"}),new de({OptionsClass:At,name:"Default yaml array section style",description:"The style of other yaml arrays that are not `tags`, `aliases` or in `Force key values to be single-line arrays` and `Force key values to be multi-line arrays`",optionsKey:"defaultArrayStyle",records:[{value:"multi-line",description:"```key:\\n - value```"},{value:"single-line",description:"```key: [value]```"}]}),new se({OptionsClass:At,name:"Format yaml array sections",description:"Turns on formatting for regular yaml arrays",optionsKey:"formatArrayKeys"}),new Re({OptionsClass:At,name:"Force key values to be single-line arrays",description:"Forces the yaml array for the new line separated keys to be in single-line format (leave empty to disable this option)",optionsKey:"forceSingleLineArrayStyle"}),new Re({OptionsClass:At,name:"Force key values to be multi-line arrays",description:"Forces the yaml array for the new line separated keys to be in multi-line format (leave empty to disable this option)",optionsKey:"forceMultiLineArrayStyle"})]}};hi=B([A.register],hi);var zl=class{},gi=class extends A{get OptionsClass(){return zl}get name(){return"Header Increment"}get description(){return"Heading levels should only increment by one level at a time"}get type(){return"Heading"}apply(t,n){return $([v.code,v.yaml,v.link,v.wikiLink,v.tag],t,r=>{let i=r.split(` `),o=0,a=0;for(let s=0;so+1?(a+=u-(o+1),u=o+1):u(n.bottom?(r=r.replace(/^(#+\s.*)/gm,` $1 `),r=r.replace(/\n+(#+\s.*)/g,` $1`),r=r.replace(/(^#+\s.*)\n+/gm,`$1 `)):(r=r.replace(/(^#+\s.*)\n+/gm,`$1 `),r=r.replace(/\n+(#+\s.*)/g,` $1`)),r=r.replace(/^\n+(#+\s.*)/,"$1"),r=r.replace(/(#+\s.*)\n+$/,"$1"),n.emptyLineAfterYaml||(r=r.replace(new RegExp("("+Ie.source+")\\n+(#+\\s.*)"),`$1 $5`)),r))}get exampleBuilders(){return[new T({description:"Headings should be surrounded by blank lines",before:y` # H1 ## H2 ${""} ${""} # H1 line ## H2 ${""} `,after:y` # H1 ${""} ## H2 ${""} # H1 ${""} line ${""} ## H2 `}),new T({description:"With `Bottom=false`",before:y` # H1 line ## H2 # H1 line `,after:y` # H1 line ${""} ## H2 ${""} # H1 line `,options:{bottom:!1,emptyLineAfterYaml:!0}}),new T({description:"Empty line before header and after Yaml is removed with `Empty Line Between Yaml and Header=true`",before:y` --- key: value --- # Header Paragraph here... `,after:y` --- key: value --- # Header Paragraph here... `,options:{bottom:!0,emptyLineAfterYaml:!1}})]}get optionBuilders(){return[new se({OptionsClass:bi,name:"Bottom",description:"Insert a blank line after headings",optionsKey:"bottom"}),new se({OptionsClass:bi,name:"Empty Line Between Yaml and Header",description:"Keep the empty line between the Yaml frontmatter and header",optionsKey:"emptyLineAfterYaml"})]}};yi=B([A.register],yi);var Oa=class{constructor(){this.textToInsert=["aliases: ","tags: "]}},wi=class extends A{get OptionsClass(){return Oa}get name(){return"Insert YAML attributes"}get description(){return"Inserts the given YAML attributes into the YAML frontmatter. Put each attribute on a single line."}get type(){return"YAML"}apply(t,n){return t=Bt(t),qe(t,r=>{let i=n.textToInsert.reverse(),o=ht(r.match(Ie)[1]);for(let a of i){let s=a.split(":")[0];Object.prototype.hasOwnProperty.call(o,s)||(r=r.replace(/^---\n/,je(`--- ${a} `)))}return r})}get exampleBuilders(){return[new T({description:"Insert static lines into YAML frontmatter. Text to insert: `aliases:\ntags: doc\nanimal: dog`",before:y` --- animal: cat --- `,after:y` --- aliases: tags: doc animal: cat --- `,options:{textToInsert:["aliases:","tags: doc","animal: dog"]}})]}get optionBuilders(){return[new Re({OptionsClass:Oa,name:"Text to insert",description:"Text to insert into the YAML frontmatter",optionsKey:"textToInsert"})]}};wi=B([A.register],wi);var $l=class{},xi=class extends A{get OptionsClass(){return $l}get name(){return"Line Break at Document End"}get description(){return"Ensures that there is exactly one line break at the end of a document."}get type(){return"Spacing"}apply(t,n){return t=t.replace(/\n+$/g,""),t+=` `,t}get exampleBuilders(){return[new T({description:"Appending a line break to the end of the document.",before:y` Lorem ipsum dolor sit amet, consectetur adipiscing elit. `,after:y` Lorem ipsum dolor sit amet, consectetur adipiscing elit. ${""} `}),new T({description:"Removing trailing line breaks to the end of the document, except one.",before:y` Lorem ipsum dolor sit amet, consectetur adipiscing elit. ${""} ${""} ${""} `,after:y` Lorem ipsum dolor sit amet, consectetur adipiscing elit. ${""} `})]}get optionBuilders(){return[]}};xi=B([A.register],xi);var Hl=class{},ki=class extends A{get OptionsClass(){return Hl}get name(){return"Move Footnotes to the bottom"}get description(){return"Move all footnotes to the bottom of the document."}get type(){return"Footnote"}apply(t,n){return $([v.code,v.yaml],t,r=>gf(r))}get exampleBuilders(){return[new T({description:"Moving footnotes to the bottom",before:y` Lorem ipsum, consectetur adipiscing elit. [^1] Donec dictum turpis quis ipsum pellentesque. ${""} [^1]: first footnote ${""} Quisque lorem est, fringilla sed enim at, sollicitudin lacinia nisi.[^2] [^2]: second footnote ${""} Maecenas malesuada dignissim purus ac volutpat. `,after:y` Lorem ipsum, consectetur adipiscing elit. [^1] Donec dictum turpis quis ipsum pellentesque. ${""} Quisque lorem est, fringilla sed enim at, sollicitudin lacinia nisi.[^2] Maecenas malesuada dignissim purus ac volutpat. ${""} [^1]: first footnote [^2]: second footnote `})]}get optionBuilders(){return[]}};ki=B([A.register],ki);var wr=class{constructor(){this.tagArrayStyle="single-line";this.removeHashtagsFromTagsInBody=!1;this.tagsToIgnore=[]}},vi=class extends A{get OptionsClass(){return wr}get name(){return"Move Tags to Yaml"}get description(){return"Move all tags to Yaml frontmatter of the document."}get type(){return"YAML"}apply(t,n){return $([v.code,v.inlineCode,v.math],t,r=>{let i=r.match(Pr);return i&&(r=Bt(r),r=qe(r,o=>{o=o.replace(`--- `,"").replace("---","");let a=yo(Ft(Be(o,nn))),s=new Set;if(typeof a=="string")s.add(a),a=[a];else if(a!=null)for(let u of a)s.add(u);else a=[];for(let u of i){let c=u.trim().substring(1);!s.has(c)&&!n.tagsToIgnore.includes(c)&&(s.add(c),a.push(c))}return`--- ${Me(o,nn,ft(a,n.tagArrayStyle))}---`}),n.removeHashtagsFromTagsInBody&&(r=r.replace(Pr,o=>{let a=o.indexOf("#"),s=o.substring(a+1);return n.tagsToIgnore.includes(s)?o:o.substring(0,a)+s}))),r})}get exampleBuilders(){return[new T({description:"Move tags from body to Yaml with `Tags to ignore = 'ignored-tag'`",before:y` Text has to do with #test and #markdown ${""} #test content here \`\`\` #ignored Code block content is ignored \`\`\` ${""} This inline code \`#ignored content\` ${""} #ignored-tag is ignored since it is in the ignored list `,after:y` --- tags: [test, markdown] --- Text has to do with #test and #markdown ${""} #test content here \`\`\` #ignored Code block content is ignored \`\`\` ${""} This inline code \`#ignored content\` ${""} #ignored-tag is ignored since it is in the ignored list `,options:{tagsToIgnore:["ignored-tag"]}}),new T({description:"Move tags from body to Yaml with existing tags retains the already existing ones and only adds new ones",before:y` --- tags: [test, tag2] --- Text has to do with #test and #markdown `,after:y` --- tags: [test, tag2, markdown] --- Text has to do with #test and #markdown `}),new T({description:"Move tags to Yaml frontmatter and then remove hashtags in body content tags `Remove the hashtag from tags in content body = true` with `Tags to ignore = 'yet-another-ignored-tag'`.",before:y` --- tags: [test, tag2] --- Text has to do with #test and #markdown ${""} The tag at the end of this line stays as a tag since it is ignored #yet-another-ignored-tag `,after:y` --- tags: [test, tag2, markdown] --- Text has to do with test and markdown ${""} The tag at the end of this line stays as a tag since it is ignored #yet-another-ignored-tag `,options:{removeHashtagsFromTagsInBody:!0,tagsToIgnore:["yet-another-ignored-tag"]}})]}get optionBuilders(){return[new de({OptionsClass:wr,name:"Yaml tags section style",description:"The style of the Yaml tags section",optionsKey:"tagArrayStyle",records:[{value:"multi-line",description:"```tags:\\n - tag1```"},{value:"single-line",description:"```tags: [tag1]```"},{value:"single string to single-line",description:"Tags will be formatted as a string if there is 1 or fewer elements like so ```tags: tag1```. If there is more than 1 element, it will be formatted like a single-line array."},{value:"single string to multi-line",description:"Aliases will be formatted as a string if there is 1 or fewer elements like so ```tags: tag1```. If there is more than 1 element, it will be formatted like a multi-line array."},{value:"single-line space delimited",description:"```tags: [tag1 tag2]```"},{value:"single string space delimited",description:"```tags: tag1 tag2```"},{value:"single string comma delimited",description:"```tags: tag1, tag2```"}]}),new se({OptionsClass:wr,name:"Remove the hashtag from tags in content body",description:"Removes `#` from tags in content body after moving them to the Yaml frontmatter",optionsKey:"removeHashtagsFromTagsInBody"}),new Re({OptionsClass:wr,name:"Tags to ignore",description:"The tags that will not be moved to the tags array or removed from the body content if `Remove the hashtag from tags in content body` is enabled. Each tag should be on a new line and without the `#`. **Make sure not to include the hashtag in the tag name.**",optionsKey:"tagsToIgnore"})]}};vi=B([A.register],vi);var Yl=class{},Si=class extends A{get OptionsClass(){return Yl}get name(){return"No Bare URLs"}get description(){return"Encloses bare URLs with angle brackets except when enclosed in back ticks, square braces, or single or double quotes."}get type(){return"Content"}apply(t,n){return $([v.code,v.yaml,v.link,v.wikiLink,v.tag,v.image],t,r=>{let i=r.match(/(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s`\]'">]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s`\]'">]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s`\]'">]{2,}|www\.[a-zA-Z0-9]+\.[^\s`\]'">]{2,})/gi);if(!i)return r;let o=0,a=i.length;for(let s=0;s=r.length?void 0:r.charAt(c);if(p!=null&&(p==="`"||p==='"'||p==="'"||p==="[")&&m!=null&&(m==="`"||m==='"'||m==="'"||m==="]")){o=u+l.length;continue}if(p!=null&&p==="<"&&m!=null&&m===">"){let f=u-1;for(;f>0&&r.charAt(f-1)==="<";)f--;let d=c;for(;d";)d++;r=Ve(r,f,d+1,"<"+l+">"),o=u+l.length;continue}r=Ve(r,u,u+l.length,"<"+l+">"),o=u+l.length+2}return r})}get exampleBuilders(){return[new T({description:"Make sure that links are inside of angle brackets when not in single quotes('), double quotes(\"), or backticks(`)",before:y` https://github.com braces around url should stay the same: [https://github.com] backticks around url should stay the same: \`https://github.com\` Links mid-sentence should be updated like https://google.com will be. 'https://github.com' "https://github.com" links should stay the same: [](https://github.com) https://gitlab.com `,after:y` braces around url should stay the same: [https://github.com] backticks around url should stay the same: \`https://github.com\` Links mid-sentence should be updated like will be. 'https://github.com' "https://github.com" links should stay the same: [](https://github.com) `}),new T({description:"Angle brackets are added if the url is not the only text in the single quotes('), double quotes(\"), or backticks(`)",before:y` [https://github.com some text here] backticks around a url should stay the same, but only if the only contents of the backticks: \`https://github.com some text here\` single quotes around a url should stay the same, but only if the contents of the single quotes is the url: 'https://github.com some text here' double quotes around a url should stay the same, but only if the contents of the double quotes is the url: "https://github.com some text here" `,after:y` [ some text here] backticks around a url should stay the same, but only if the only contents of the backticks: \` some text here\` single quotes around a url should stay the same, but only if the contents of the single quotes is the url: ' some text here' double quotes around a url should stay the same, but only if the contents of the double quotes is the url: " some text here" `}),new T({description:"Multiple angle brackets at the start and or end of a url will be reduced down to 1",before:y` < > <> `,after:y` `})]}get optionBuilders(){return[]}};Si=B([A.register],Si);var Ti=class{constructor(){this.numberStyle="ascending";this.listEndStyle="."}},Oi=class extends A{get OptionsClass(){return Ti}get name(){return"Ordered List Style"}get description(){return"Makes sure that ordered lists follow the style specified. Note that 2 spaces or 1 tab is considered to be an indentation level."}get type(){return"Content"}apply(t,n){return $([v.code,v.yaml,v.tag],t,r=>Cf(r,n.numberStyle,n.listEndStyle))}get exampleBuilders(){return[new T({description:"Ordered lists have list items set to ascending numerical order when Number Style is `ascending`.",before:y` 1. Item 1 2. Item 2 4. Item 3 ${""} Some text here ${""} 1. Item 1 1. Item 2 1. Item 3 `,after:y` 1. Item 1 2. Item 2 3. Item 3 ${""} Some text here ${""} 1. Item 1 2. Item 2 3. Item 3 `}),new T({description:"Nested ordered lists have list items set to ascending numerical order when Number Style is `ascending`.",before:y` 1. Item 1 2. Item 2 1. Subitem 1 5. Subitem 2 2. Subitem 3 4. Item 3 `,after:y` 1. Item 1 2. Item 2 1. Subitem 1 2. Subitem 2 3. Subitem 3 3. Item 3 `}),new T({description:"Ordered list in blockquote has list items set to '1.' when Number Style is `lazy`.",before:y` > 1. Item 1 > 4. Item 2 > > 1. Subitem 1 > > 5. Subitem 2 > > 2. Subitem 3 `,after:y` > 1. Item 1 > 1. Item 2 > > 1. Subitem 1 > > 1. Subitem 2 > > 1. Subitem 3 `,options:{numberStyle:"lazy"}}),new T({description:"Ordered list in blockquote has list items set to ascending numerical order when Number Style is `ascending`.",before:y` > 1. Item 1 > 4. Item 2 > > 1. Subitem 1 > > 5. Subitem 2 > > 2. Subitem 3 `,after:y` > 1. Item 1 > 2. Item 2 > > 1. Subitem 1 > > 2. Subitem 2 > > 3. Subitem 3 `}),new T({description:"Nested ordered list has list items set to '1)' when Number Style is `lazy` and Ordered List Indicator End Style is `)`.",before:y` 1. Item 1 2. Item 2 1. Subitem 1 5. Subitem 2 2. Subitem 3 4. Item 3 `,after:y` 1) Item 1 1) Item 2 1) Subitem 1 1) Subitem 2 1) Subitem 3 1) Item 3 `,options:{listEndStyle:")",numberStyle:"lazy"}})]}get optionBuilders(){return[new de({OptionsClass:Ti,name:"Number Style",description:"The number style used in ordered list indicators",optionsKey:"numberStyle",records:[{value:"ascending",description:"Makes sure ordered list items are ascending (i.e. 1, 2, 3, etc.)"},{value:"lazy",description:"Makes sure ordered list item indicators all are the number 1"}]}),new de({OptionsClass:Ti,name:"Ordered List Indicator End Style",description:"The ending character of an ordered list indicator",optionsKey:"listEndStyle",records:[{value:".",description:"Makes sure ordered list items indicators end in '.' (i.e `1.`)"},{value:")",description:"Makes sure ordered list item indicators end in ')' (i.e. `1)`)"}]})]}};Oi=B([A.register],Oi);var jl=class{},Ci=class extends A{get OptionsClass(){return jl}get name(){return"Paragraph blank lines"}get description(){return"All paragraphs should have exactly one blank line both before and after."}get type(){return"Spacing"}apply(t,n){return $([v.obsidianMultiLineComments,v.yaml],t,bf)}get exampleBuilders(){return[new T({description:"Paragraphs should be surrounded by blank lines",before:y` # H1 Newlines are inserted. A paragraph is a line that starts with a letter. `,after:y` # H1 ${""} Newlines are inserted. ${""} A paragraph is a line that starts with a letter. `})]}get optionBuilders(){return[]}};Ci=B([A.register],Ci);var ql=class{},Ai=class extends A{get OptionsClass(){return ql}get name(){return"Proper Ellipsis"}get description(){return"Replaces three consecutive dots with an ellipsis."}get type(){return"Content"}apply(t,n){return $([v.code,v.yaml,v.link,v.wikiLink,v.tag],t,r=>r.replaceAll("...","\u2026"))}get exampleBuilders(){return[new T({description:"Replacing three consecutive dots with an ellipsis.",before:y` Lorem (...) Impsum. `,after:y` Lorem (…) Impsum. `})]}get optionBuilders(){return[]}};Ai=B([A.register],Ai);var Vl=class{},Ei=class extends A{get OptionsClass(){return Vl}get name(){return"Re-Index Footnotes"}get description(){return"Re-indexes footnote keys and footnote, based on the order of occurrence (NOTE: This rule deliberately does *not* preserve the relation between key and footnote, to be able to re-index duplicate keys.)"}get type(){return"Footnote"}apply(t,n){return $([v.code,v.yaml,v.link,v.wikiLink,v.tag],t,r=>{let i=0;return r=r.replace(/^\[\^\w+\]: /gm,function(){return i++,"[^"+String(i)+"]: "}),i=0,r=r.replace(/(?!^)\[\^\w+\]/gm,function(){return i++,"[^"+String(i)+"]"}),r})}get exampleBuilders(){return[new T({description:"Re-indexing footnotes after having deleted previous footnotes",before:y` Lorem ipsum at aliquet felis.[^3] Donec dictum turpis quis pellentesque,[^5] et iaculis tortor condimentum. ${""} [^3]: first footnote [^5]: second footnote `,after:y` Lorem ipsum at aliquet felis.[^1] Donec dictum turpis quis pellentesque,[^2] et iaculis tortor condimentum. ${""} [^1]: first footnote [^2]: second footnote `}),new T({description:"Re-indexing footnotes after inserting a footnote between",before:y` Lorem ipsum dolor sit amet, consectetur adipiscing elit.[^1] Aenean at aliquet felis. Donec dictum turpis quis ipsum pellentesque, et iaculis tortor condimentum.[^1a] Vestibulum nec blandit felis, vulputate finibus purus.[^2] Praesent quis iaculis diam. ${""} [^1]: first footnote [^1a]: third footnote, inserted later [^2]: second footnotes `,after:y` Lorem ipsum dolor sit amet, consectetur adipiscing elit.[^1] Aenean at aliquet felis. Donec dictum turpis quis ipsum pellentesque, et iaculis tortor condimentum.[^2] Vestibulum nec blandit felis, vulputate finibus purus.[^3] Praesent quis iaculis diam. ${""} [^1]: first footnote [^2]: third footnote, inserted later [^3]: second footnotes `}),new T({description:"Re-indexing duplicate footnote keys",before:y` Lorem ipsum at aliquet felis.[^1] Donec dictum turpis quis pellentesque,[^1] et iaculis tortor condimentum. ${""} [^1]: first footnote [^1]: second footnote `,after:y` Lorem ipsum at aliquet felis.[^1] Donec dictum turpis quis pellentesque,[^2] et iaculis tortor condimentum. ${""} [^1]: first footnote [^2]: second footnote `})]}get optionBuilders(){return[]}};Ei=B([A.register],Ei);var Kl=class{},Li=class extends A{get OptionsClass(){return Kl}get name(){return"Remove Consecutive List Markers"}get description(){return"Removes consecutive list markers. Useful when copy-pasting list items."}get type(){return"Content"}apply(t,n){return $([v.code,v.yaml,v.link,v.wikiLink,v.tag],t,r=>r.replace(/^([ |\t]*)- - \b/gm,"$1- "))}get exampleBuilders(){return[new T({description:"Removing consecutive list markers.",before:y` - item 1 - - copypasted item A - item 2 - indented item - - copypasted item B `,after:y` - item 1 - copypasted item A - item 2 - indented item - copypasted item B `})]}get optionBuilders(){return[]}};Li=B([A.register],Li);var Yn=class extends A{get OptionsClass(){return Yn}get name(){return"Remove Empty Lines Between List Markers and Checklists"}get description(){return"There should not be any empty lines between list markers and checklists."}get type(){return"Spacing"}apply(t,n){return $([v.code,v.yaml,v.link,v.wikiLink,v.tag,v.thematicBreak],t,r=>{let i=function(c,p,m){let f=new RegExp(`^${p} {2,}${p}$`,"gm"),d,h=c;do d=h.match(f),h=h.replaceAll(f,m);while(d);return h};return r=i(r,"(( |\\t)*- \\[( |x)\\]( |\\t)+.+)",`$1 $5`),r=i(r,"(( |\\t)*\\d+\\.( |\\t)+.+)",`$1 $4`),r=i(r,"(( |\\t)*\\+( |\\t)+.+)",`$1 $4`),r=i(r,"(( |\\t)*-(?! \\[( |x)\\])( |\\t)+.+)",`$1 $5`),i(r,"(( |\\t)*\\*( |\\t)+.+)",`$1 $4`)})}get exampleBuilders(){return[new T({description:"",before:y` 1. Item 1 ${""} 2. Item 2 ${""} - Item 1 ${""} \t- Subitem 1 ${""} - Item 2 ${""} - [x] Item 1 ${""} \t- [ ] Subitem 1 ${""} - [ ] Item 2 ${""} + Item 1 ${""} \t+ Subitem 1 ${""} + Item 2 ${""} * Item 1 ${""} \t* Subitem 1 ${""} * Item 2 `,after:y` 1. Item 1 2. Item 2 ${""} - Item 1 \t- Subitem 1 - Item 2 ${""} - [x] Item 1 \t- [ ] Subitem 1 - [ ] Item 2 ${""} + Item 1 \t+ Subitem 1 + Item 2 ${""} * Item 1 \t* Subitem 1 * Item 2 `})]}get optionBuilders(){return[]}};Yn=B([A.register],Yn);var Wl=class{},_i=class extends A{get OptionsClass(){return Wl}get name(){return"Remove Empty List Markers"}get description(){return"Removes empty list markers, i.e. list items without content."}get type(){return"Content"}apply(t,n){return $([v.code,v.yaml,v.link,v.wikiLink,v.tag],t,r=>{let i=/^\s*(>\s*)*(-|\*|\+|\d+[.)]|- (\[( |x)\]))\s*?$/gm;return r=r.replace(new RegExp(i.source+"\\n","gm"),""),r=r.replace(new RegExp("\\n"+i.source,"gm"),""),r.replace(i,"")})}get exampleBuilders(){return[new T({description:"Removes empty list markers.",before:y` - item 1 - - item 2 ${""} * list 2 item 1 * * list 2 item 2 ${""} + list 3 item 1 + + list 3 item 2 `,after:y` - item 1 - item 2 ${""} * list 2 item 1 * list 2 item 2 ${""} + list 3 item 1 + list 3 item 2 `}),new T({description:"Removes empty ordered list markers.",before:y` 1. item 1 2. 3. item 2 ${""} 1. list 2 item 1 2. list 2 item 2 3. ${""} ${""} _Note that this rule does not make sure that the ordered list is sequential after removal_ `,after:y` 1. item 1 3. item 2 ${""} 1. list 2 item 1 2. list 2 item 2 ${""} _Note that this rule does not make sure that the ordered list is sequential after removal_ `}),new T({description:"Removes empty checklist markers.",before:y` - [ ] item 1 - [x] - [ ] item 2 - [ ] ${""} ${""} _Note that this will affect checked and uncheck checked list items_ `,after:y` - [ ] item 1 - [ ] item 2 ${""} _Note that this will affect checked and uncheck checked list items_ `}),new T({description:"Removes empty list, checklist, and ordered list markers in callouts/blockquotes",before:y` > Checklist in blockquote > - [ ] item 1 > - [x] > - [ ] item 2 > - [ ] ${""} ${""} > Ordered List in blockquote > > 1. item 1 > > 2. > > 3. item 2 > > 4. ${""} ${""} > Regular lists in blockquote > > - item 1 > - > - item 2 > > List 2 > > * item 1 > * > * list 2 item 2 > > List 3 > > + item 1 > + > + item 2 `,after:y` > Checklist in blockquote > - [ ] item 1 > - [ ] item 2 ${""} > Ordered List in blockquote > > 1. item 1 > > 3. item 2 ${""} > Regular lists in blockquote > > - item 1 > - item 2 > > List 2 > > * item 1 > * list 2 item 2 > > List 3 > > + item 1 > + item 2 `})]}get optionBuilders(){return[]}};_i=B([A.register],_i);var Ul=class{},Ii=class extends A{get OptionsClass(){return Ul}get name(){return"Remove Hyphenated Line Breaks"}get description(){return"Removes hyphenated line breaks. Useful when pasting text from textbooks."}get type(){return"Content"}apply(t,n){return $([v.code,v.yaml,v.link,v.wikiLink,v.tag],t,r=>r.replace(/\b[-‐] \b/g,""))}get exampleBuilders(){return[new T({description:"Removing hyphenated line breaks.",before:y` This text has a linebr‐ eak. `,after:y` This text has a linebreak. `})]}get optionBuilders(){return[]}};Ii=B([A.register],Ii);var Gl=class{},Mi=class extends A{get OptionsClass(){return Gl}get name(){return"Remove link spacing"}get description(){return"Removes spacing around link text."}get type(){return"Spacing"}apply(t,n){return t=wf(t),fc(t)}get exampleBuilders(){return[new T({description:"Space in regular markdown link text",before:y` [ here is link text1 ](link_here) [ here is link text2](link_here) [here is link text3 ](link_here) [here is link text4](link_here) [\there is link text5\t](link_here) [](link_here) **Note that image markdown syntax does not get affected even if it is transclusion:** ![\there is link text6 ](link_here) `,after:y` [here is link text1](link_here) [here is link text2](link_here) [here is link text3](link_here) [here is link text4](link_here) [here is link text5](link_here) [](link_here) **Note that image markdown syntax does not get affected even if it is transclusion:** ![\there is link text6 ](link_here) `}),new T({description:"Space in wiki link text",before:y` [[link_here| here is link text1 ]] [[link_here|here is link text2 ]] [[link_here| here is link text3]] [[link_here|here is link text4]] [[link_here|\there is link text5\t]] ![[link_here|\there is link text6\t]] [[link_here]] `,after:y` [[link_here|here is link text1]] [[link_here|here is link text2]] [[link_here|here is link text3]] [[link_here|here is link text4]] [[link_here|here is link text5]] ![[link_here|here is link text6]] [[link_here]] `})]}get optionBuilders(){return[]}};Mi=B([A.register],Mi);var Zl=class{},Bi=class extends A{get OptionsClass(){return Zl}get name(){return"Remove Multiple Spaces"}get description(){return"Removes two or more consecutive spaces. Ignores spaces at the beginning and ending of the line. "}get type(){return"Content"}apply(t,n){return $([v.table,v.code,v.yaml,v.link,v.wikiLink,v.tag],t,r=>r.replace(/(?!^>)([^\s])( ){2,}([^\s])/gm,"$1 $3"))}get exampleBuilders(){return[new T({description:"Removing double and triple space.",before:y` Lorem ipsum dolor sit amet. `,after:y` Lorem ipsum dolor sit amet. `})]}get optionBuilders(){return[]}};Bi=B([A.register],Bi);var Ql=class{},Fi=class extends A{get OptionsClass(){return Ql}get name(){return"Remove Space around Fullwidth Characters"}get description(){return"Ensures that fullwidth characters are not followed by whitespace (either single spaces or a tab). Note that this may causes issues with markdown format in some cases."}get type(){return"Spacing"}apply(t,n){let r=/([ \t])+([\u2013\u2014\u2026\u3001\u3002\u300a\u300d-\u300f\u3014\u3015\u3008-\u3011\uff00-\uffff])/g,i=/([\u2013\u2014\u2026\u3001\u3002\u300a\u300d-\u300f\u3014\u3015\u3008-\u3011\uff00-\uffff])([ \t])+/g,o=function(s){return s.replace(r,"$2").replace(i,"$1")},a=$([v.code,v.yaml,v.link,v.wikiLink,v.tag,v.list],t,o);return a=vf(a,o),a}get exampleBuilders(){return[new T({description:"Remove Spaces and Tabs around Fullwidth Characters",before:y` Full list of affected characters: 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz,.:;!?"'`^~ ̄_&@#%+-*=<>()[]{}⦅⦆|¦/\¬$£¢₩¥。、「」『』〔〕【】—…–《》〈〉 This is a fullwidth period\t 。 with text after it. This is a fullwidth comma\t, with text after it. This is a fullwidth left parenthesis ( \twith text after it. This is a fullwidth right parenthesis ) with text after it. This is a fullwidth colon : with text after it. This is a fullwidth semicolon ; with text after it. Removes space at start of line `,after:y` Full list of affected characters:0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz,.:;!?"'`^~ ̄_&@#%+-*=<>()[]{}⦅⦆|¦/\¬$£¢₩¥。、「」『』〔〕【】—…–《》〈〉 This is a fullwidth period。with text after it. This is a fullwidth comma,with text after it. This is a fullwidth left parenthesis(with text after it. This is a fullwidth right parenthesis)with text after it. This is a fullwidth colon:with text after it. This is a fullwidth semicolon;with text after it. Removes space at start of line `}),new T({description:"Fullwidth Characters in List Do not Affect List Markdown Syntax",before:y` # List indicators should not have the space after them removed if they are followed by a fullwidth character ${""} - [ contents here] - \t[ more contents here] more text here + \t[ another item here] * [ one last item here] ${""} # Nested in a block quote ${""} > - [ contents here] > - \t[ more contents here] more text here > + \t[ another item here] > * [ one last item here] ${""} # Doubly nested in a block quote ${""} > The following is doubly nested > > - [ contents here] > > - \t[ more contents here] more text here > > + \t[ another item here] > > * [ one last item here] `,after:y` # List indicators should not have the space after them removed if they are followed by a fullwidth character ${""} - [contents here] - [more contents here]more text here + [another item here] * [one last item here] ${""} # Nested in a block quote ${""} > - [contents here] > - [more contents here]more text here > + [another item here] > * [one last item here] ${""} # Doubly nested in a block quote ${""} > The following is doubly nested > > - [contents here] > > - [more contents here]more text here > > + [another item here] > > * [one last item here] `})]}get optionBuilders(){return[]}};Fi=B([A.register],Fi);var Ta=class{constructor(){this.yamlKeysToRemove=[]}},Ri=class extends A{get OptionsClass(){return Ta}get name(){return"Remove YAML Keys"}get description(){return"Removes the YAML keys specified"}get type(){return"YAML"}apply(t,n){let r=n.yamlKeysToRemove,i=t.match(Ie);if(!i||r.length===0)return t;let o=i[1];for(let a of r){let s=a.trim();s.endsWith(":")&&(s=s.substring(0,s.length-1)),o=Sn(o,s)}return t.replace(i[1],o)}get exampleBuilders(){return[new T({description:'Removes the values specified in `YAML Keys to Remove` = "status:\nkeywords\ndate"',before:y` --- language: Typescript type: programming tags: computer keywords: - keyword1 - keyword2 status: WIP date: 02/15/2022 --- ${""} # Header Context ${""} Text `,after:y` --- language: Typescript type: programming tags: computer --- ${""} # Header Context ${""} Text `,options:{yamlKeysToRemove:["status:","keywords","date"]}})]}get optionBuilders(){return[new Re({OptionsClass:Ta,name:"YAML Keys to Remove",description:"The yaml keys to remove from the yaml frontmatter with or without colons",optionsKey:"yamlKeysToRemove"})]}};Ri=B([A.register],Ri);var Xl=class{},Di=class extends A{get OptionsClass(){return Xl}get name(){return"Space after list markers"}get description(){return"There should be a single space after list markers and checkboxes."}get type(){return"Spacing"}apply(t,n){return $([v.code,v.yaml,v.link,v.wikiLink,v.tag],t,r=>(r=r.replace(/^(\s*\d+\.|\s*[-+*])[^\S\r\n]+/gm,"$1 "),r.replace(/^(\s*\d+\.|\s*[-+*]\s+\[[ xX]\])[^\S\r\n]+/gm,"$1 ")))}get exampleBuilders(){return[new T({description:"",before:y` 1. Item 1 2. Item 2 ${""} - [ ] Item 1 - [x] Item 2 \t- [ ] Item 3 `,after:y` 1. Item 1 2. Item 2 ${""} - [ ] Item 1 - [x] Item 2 \t- [ ] Item 3 `})]}get optionBuilders(){return[]}};Di=B([A.register],Di);var Jl=class{},Pi=class extends A{get OptionsClass(){return Jl}get name(){return"Space between Chinese and English or numbers"}get description(){return"Ensures that Chinese and English or numbers are separated by a single space. Follows these [guidelines](https://github.com/sparanoid/chinese-copywriting-guidelines)"}get type(){return"Spacing"}apply(t,n){let r=/([\u4e00-\u9fa5])( *)(\[[^[]*\]\(.*\)|`[^`]*`|\w+|[-+'"([{¥$]|\*[^*])/gm,i=/(\[[^[]*\]\(.*\)|`[^`]*`|\w+|[-+;:'"°%$)\]}]|[^*]\*)( *)([\u4e00-\u9fa5])/gm,o=function(s){return s.replace(r,"$1 $3").replace(i,"$1 $3")},a=$([v.code,v.inlineCode,v.yaml,v.image,v.link,v.wikiLink,v.tag,v.italics,v.bold,v.math,v.inlineMath],t,o);return a=xf(a,o),a=kf(a,o),a}get exampleBuilders(){return[new T({description:"Space between Chinese and English",before:y` 中文字符串english中文字符串。 `,after:y` 中文字符串 english 中文字符串。 `}),new T({description:"Space between Chinese and link",before:y` 中文字符串[english](http://example.com)中文字符串。 `,after:y` 中文字符串 [english](http://example.com) 中文字符串。 `}),new T({description:"Space between Chinese and inline code block",before:y` 中文字符串\`code\`中文字符串。 `,after:y` 中文字符串 \`code\` 中文字符串。 `}),new T({description:"No space between Chinese and English in tag",before:y` #标签A #标签2标签 `,after:y` #标签A #标签2标签 `}),new T({description:"Make sure that spaces are not added between italics and chinese characters to preserve markdown syntax",before:y` _这是一个数学公式_ *这是一个数学公式english* ${""} # Handling bold and italics nested in each other is not supported at this time ${""} **_这是一_个数学公式** *这是一hello__个数学world公式__* `,after:y` _这是一个数学公式_ *这是一个数学公式 english* ${""} # Handling bold and italics nested in each other is not supported at this time ${""} **_ 这是一 _ 个数学公式** *这是一 hello__ 个数学 world 公式 __* `}),new T({description:"Images and links are ignored",before:y` [[这是一个数学公式english]] ![[这是一个数学公式english.jpg]] [这是一个数学公式english](这是一个数学公式english.md) ![这是一个数学公式english](这是一个数学公式english.jpg) `,after:y` [[这是一个数学公式english]] ![[这是一个数学公式english.jpg]] [这是一个数学公式english](这是一个数学公式english.md) ![这是一个数学公式english](这是一个数学公式english.jpg) `})]}get optionBuilders(){return[]}};Pi=B([A.register],Pi);var Ca=class{constructor(){this.style="consistent"}},Ni=class extends A{get OptionsClass(){return Ca}get name(){return"Strong Style"}get description(){return"Makes sure the strong style is consistent."}get type(){return"Content"}apply(t,n){return $([v.code,v.yaml,v.link,v.wikiLink,v.tag,v.math,v.inlineMath],t,r=>la(r,n.style,"strong"))}get exampleBuilders(){return[new T({description:"Strong indicators should use underscores when style is set to 'underscore'",before:y` # Strong/Bold Cases ${""} **Test bold** ** Test not bold ** This is **bold** mid sentence This is **bold** mid sentence with a second **bold** on the same line This is ***bold and emphasized*** This is ***nested bold** and ending emphasized* This is ***nested emphasis* and ending bold** ${""} *Test emphasis* ${""} * List Item1 with **bold text** * List Item2 `,after:y` # Strong/Bold Cases ${""} __Test bold__ ** Test not bold ** This is __bold__ mid sentence This is __bold__ mid sentence with a second __bold__ on the same line This is *__bold and emphasized__* This is *__nested bold__ and ending emphasized* This is __*nested emphasis* and ending bold__ ${""} *Test emphasis* ${""} * List Item1 with __bold text__ * List Item2 `,options:{style:"underscore"}}),new T({description:"Strong indicators should use asterisks when style is set to 'asterisk'",before:y` # Strong/Bold Cases ${""} __Test bold__ __ Test not bold __ This is __bold__ mid sentence This is __bold__ mid sentence with a second __bold__ on the same line This is ___bold and emphasized___ This is ___nested bold__ and ending emphasized_ This is ___nested emphasis_ and ending bold__ ${""} _Test emphasis_ `,after:y` # Strong/Bold Cases ${""} **Test bold** __ Test not bold __ This is **bold** mid sentence This is **bold** mid sentence with a second **bold** on the same line This is _**bold and emphasized**_ This is _**nested bold** and ending emphasized_ This is **_nested emphasis_ and ending bold** ${""} _Test emphasis_ `,options:{style:"asterisk"}}),new T({description:"Strong indicators should use consistent style based on first strong indicator in a file when style is set to 'consistent'",before:y` # Strong First Strong Is an Asterisk ${""} **First bold** This is __bold__ mid sentence This is __bold__ mid sentence with a second **bold** on the same line This is ___bold and emphasized___ This is *__nested bold__ and ending emphasized* This is **_nested emphasis_ and ending bold** ${""} __Test bold__ `,after:y` # Strong First Strong Is an Asterisk ${""} **First bold** This is **bold** mid sentence This is **bold** mid sentence with a second **bold** on the same line This is _**bold and emphasized**_ This is ***nested bold** and ending emphasized* This is **_nested emphasis_ and ending bold** ${""} **Test bold** `,options:{style:"consistent"}}),new T({description:"Strong indicators should use consistent style based on first strong indicator in a file when style is set to 'consistent'",before:y` # Strong First Strong Is an Underscore ${""} __First bold__ This is **bold** mid sentence This is **bold** mid sentence with a second __bold__ on the same line This is **_bold and emphasized_** This is ***nested bold** and ending emphasized* This is ___nested emphasis_ and ending bold__ ${""} **Test bold** `,after:y` # Strong First Strong Is an Underscore ${""} __First bold__ This is __bold__ mid sentence This is __bold__ mid sentence with a second __bold__ on the same line This is ___bold and emphasized___ This is *__nested bold__ and ending emphasized* This is ___nested emphasis_ and ending bold__ ${""} __Test bold__ `,options:{style:"consistent"}})]}get optionBuilders(){return[new de({OptionsClass:Ca,name:"Style",description:"The style used to denote strong/bolded content",optionsKey:"style",records:[{value:"consistent",description:"Makes sure the first instance of strong is the style that will be used throughout the document"},{value:"asterisk",description:"Makes sure ** is the strong indicator"},{value:"underscore",description:"Makes sure __ is the strong indicator"}]})]}};Ni=B([A.register],Ni);var Aa=class{constructor(){this.twoSpaceLineBreak=!1}},zi=class extends A{get OptionsClass(){return Aa}get name(){return"Trailing spaces"}get description(){return"Removes extra spaces after every line."}get type(){return"Spacing"}apply(t,n){return $([v.code,v.yaml,v.link,v.wikiLink,v.tag],t,r=>n.twoSpaceLineBreak?(r=r.replace(/(\S)[ \t]$/gm,"$1"),r=r.replace(/(\S)[ \t]{3,}$/gm,"$1"),r=r.replace(/(\S)( ?\t\t? ?)$/gm,"$1"),r):r.replace(/[ \t]+$/gm,""))}get exampleBuilders(){return[new T({description:"Removes trailing spaces and tabs.",before:y` # H1 Line with trailing spaces and tabs. ${""} `,after:y` # H1 Line with trailing spaces and tabs. `}),new T({description:"With `Two Space Linebreak = true`",before:y` # H1 Line with trailing spaces and tabs. ${""} `,after:y` # H1 Line with trailing spaces and tabs. ${""} `,options:{twoSpaceLineBreak:!0}})]}get optionBuilders(){return[new se({OptionsClass:Aa,name:"Two Space Linebreak",description:'Ignore two spaces followed by a line break ("Two Space Rule").',optionsKey:"twoSpaceLineBreak"})]}};zi=B([A.register],zi);var eu=class{},$i=class extends A{get OptionsClass(){return eu}get name(){return"Two Spaces Between Lines with Content"}get description(){return"Makes sure that two spaces are added to the ends of lines with content continued on the next line for paragraphs, blockquotes, and list items"}get type(){return"Content"}apply(t,n){return $([v.obsidianMultiLineComments,v.yaml],t,yf)}get exampleBuilders(){return[new T({description:"Make sure two spaces are added to the ends of lines that have content on it and the next line for lists, blockquotes, and paragraphs",before:y` # Heading 1 First paragraph stays as the first paragraph ${""} - list item 1 - list item 2 Continuation of list item 2 - list item 3 ${""} 1. Item 1 2. Item 2 Continuation of item 3 3. Item 3 ${""} Paragraph for with link [[other file name]]. Continuation *of* the paragraph has \`inline code block\` __in it__. Even more continuation ${""} Paragraph lines that end in
Or lines that end in
Are left alone Since they mean the same thing ${""} \`\`\` text Code blocks are ignored Even with multiple lines \`\`\` Another paragraph here ${""} > Blockquotes are affected > More content here Content here ${""}
html content should be ignored
Even more content here ${""} `,after:y` # Heading 1 First paragraph stays as the first paragraph ${""} - list item 1 - list item 2 ${""} Continuation of list item 2 - list item 3 ${""} 1. Item 1 2. Item 2 ${""} Continuation of item 3 3. Item 3 ${""} Paragraph for with link [[other file name]]. ${""} Continuation *of* the paragraph has \`inline code block\` __in it__. ${""} Even more continuation ${""} Paragraph lines that end in
Or lines that end in
Are left alone ${""} Since they mean the same thing ${""} \`\`\` text Code blocks are ignored Even with multiple lines \`\`\` Another paragraph here ${""} > Blockquotes are affected ${""} > More content here ${""} Content here ${""}
html content should be ignored
Even more content here ${""} `})]}get optionBuilders(){return[]}};$i=B([A.register],$i);var Ea=class{constructor(){this.listStyle="consistent"}},Hi=class extends A{get OptionsClass(){return Ea}get name(){return"Unordered List Style"}get description(){return"Makes sure that unordered lists follow the style specified."}get type(){return"Content"}apply(t,n){return $([v.code,v.yaml,v.tag],t,r=>Af(r,n.listStyle))}get exampleBuilders(){return[new T({description:"Unordered lists have their indicator updated to `*` when `List item style = 'consistent'` and `*` is the first unordered list indicator",before:y` 1. ordered item 1 2. ordered item 2 ${""} Checklists should be ignored - [ ] Checklist item 1 - [x] completed item ${""} * Item 1 - Sublist 1 item 1 - Sublist 1 item 2 - Item 2 + Sublist 2 item 1 + Sublist 2 item 2 + Item 3 * Sublist 3 item 1 * Sublist 3 item 2 ${""} `,after:y` 1. ordered item 1 2. ordered item 2 ${""} Checklists should be ignored - [ ] Checklist item 1 - [x] completed item ${""} * Item 1 * Sublist 1 item 1 * Sublist 1 item 2 * Item 2 * Sublist 2 item 1 * Sublist 2 item 2 * Item 3 * Sublist 3 item 1 * Sublist 3 item 2 ${""} `}),new T({description:"Unordered lists have their indicator updated to `-` when `List item style = '-'`",before:y` - Item 1 * Sublist 1 item 1 * Sublist 1 item 2 * Item 2 + Sublist 2 item 1 + Sublist 2 item 2 + Item 3 - Sublist 3 item 1 - Sublist 3 item 2 ${""} See that the ordered list is ignored, but its sublist is not ${""} 1. Item 1 - Sub item 1 1. Item 2 * Sub item 2 1. Item 3 + Sub item 3 `,after:y` - Item 1 - Sublist 1 item 1 - Sublist 1 item 2 - Item 2 - Sublist 2 item 1 - Sublist 2 item 2 - Item 3 - Sublist 3 item 1 - Sublist 3 item 2 ${""} See that the ordered list is ignored, but its sublist is not ${""} 1. Item 1 - Sub item 1 1. Item 2 - Sub item 2 1. Item 3 - Sub item 3 `,options:{listStyle:"-"}}),new T({description:"Unordered lists have their indicator updated to `*` when `List item style = '*'`",before:y` - Item 1 * Sublist 1 item 1 * Sublist 1 item 2 * Item 2 + Sublist 2 item 1 + Sublist 2 item 2 + Item 3 - Sublist 3 item 1 - Sublist 3 item 2 ${""} `,after:y` * Item 1 * Sublist 1 item 1 * Sublist 1 item 2 * Item 2 * Sublist 2 item 1 * Sublist 2 item 2 * Item 3 * Sublist 3 item 1 * Sublist 3 item 2 ${""} `,options:{listStyle:"*"}}),new T({description:"Unordered list in blockquote has list item indicators set to `+` when `List item style = '-'`",before:y` > - Item 1 > + Item 2 > > * Subitem 1 > > + Subitem 2 > > - Sub sub item 1 > > - Subitem 3 `,after:y` > + Item 1 > + Item 2 > > + Subitem 1 > > + Subitem 2 > > + Sub sub item 1 > > + Subitem 3 `,options:{listStyle:"+"}})]}get optionBuilders(){return[new de({OptionsClass:Ea,name:"List item style",description:"The list item style to use in unordered lists",optionsKey:"listStyle",records:[{value:"consistent",description:"Makes sure unordered list items use a consistent list item indicator in the file which will be based on the first list item found"},{value:"-",description:"Makes sure unordered list items use `-` as their indicator"},{value:"*",description:"Makes sure unordered list items use `*` as their indicator"},{value:"+",description:"Makes sure unordered list items use `+` as their indicator"}]})]}};Hi=B([A.register],Hi);var Ut=class{constructor(){this.priorityKeysAtStartOfYaml=!0;this.yamlKeyPrioritySortOrder=[];this.yamlSortOrderForOtherKeys="None"}};B([A.noSettingControl()],Ut.prototype,"dateModifiedKey",2),B([A.noSettingControl()],Ut.prototype,"currentTimeFormatted",2),B([A.noSettingControl()],Ut.prototype,"yamlTimestampDateModifiedEnabled",2);var jn=class extends A{get OptionsClass(){return Ut}get name(){return"YAML Key Sort"}get description(){return"Sorts the YAML keys based on the order and priority specified. Note: may remove blank lines as well."}get type(){return"YAML"}apply(t,n){let r=t.match(Ie);if(!r)return t;let i=r[1],o=n.priorityKeysAtStartOfYaml,a=function(S,E){return S==E?E:Me(E,n.dateModifiedKey," "+n.currentTimeFormatted)},s=function(S,E,I){let k=`${E}${S}`;return I&&(k=`${S}${E}`),n.yamlTimestampDateModifiedEnabled&&(k=a(r[1],k)),t.replace(r[1],k)},l=function(S,E){let I="";for(let k of E){let _=Be(S,k);_!==null&&(_.includes(` `)?I+=`${k}:${_} `:I+=`${k}: ${_} `,S=Sn(S,k))}return{remainingYaml:S,sortedYamlKeyValues:I}},u=n.yamlKeyPrioritySortOrder,c=l(i,u),p=c.sortedYamlKeyValues;i=c.remainingYaml;let m=n.yamlSortOrderForOtherKeys,f=ht(i);if(f==null)return s(p,i,o);let d=function(S,E){return S=S.toLowerCase(),E=E.toLowerCase(),S>E?-1:E>S?1:0},h=function(S,E){return S=S.toLowerCase(),E=E.toLowerCase(),S{let a=` ${n.dateCreatedKey}: [^ ]+ `,s=` ${n.dateCreatedKey}:[ ]* `,l=new RegExp(s),u=new RegExp(a);if(n.dateCreated){let c=(0,Gt.moment)(n.fileCreatedTime);c.locale(n.locale);let p=c.format(n.format),m=` ${n.dateCreatedKey}: ${p}`,f=u.test(o);if(!f&&l.test(o))o=o.replace(l,je(m)+` `),r=!0;else if(f){if(f){let d=(0,Gt.moment)(o.match(u)[0].replace(n.dateCreatedKey+":","").trim(),n.format,n.locale,!0);(d==null||!d.isValid())&&(o=o.replace(u,je(m)+` `),r=!0)}}else{let d=o.indexOf(` ---`);o=On(o,d,` ${n.dateCreatedKey}: ${p}`),r=!0}}if(n.dateModified){let c=` ${n.dateModifiedKey}: [^ ]+ `,p=` ${n.dateModifiedKey}:[ ]* `,m=new RegExp(p),f=new RegExp(c),d=(0,Gt.moment)(n.fileModifiedTime);d.locale(n.locale);let h=n.currentTime.format(n.format),g=` ${n.dateModifiedKey}: ${h}`,b=f.test(o);if(b){let O=(0,Gt.moment)(o.match(f)[0].replace(n.dateModifiedKey+":","").trim(),n.format,n.locale,!0);(r||O==null||!O.isValid()||Math.abs(O.diff(d,"seconds"))>5)&&(o=o.replace(f,je(g)+` `))}else if(m.test(o))o=o.replace(m,je(g)+` `);else if(!b){let O=o.indexOf(` ---`);o=On(o,O,g)}}return o})}get exampleBuilders(){return[new T({description:"Adds a header with the date.",before:y` # H1 `,after:y` --- date created: Wednesday, January 1st 2020, 12:00:00 am date modified: Thursday, January 2nd 2020, 12:00:05 am --- # H1 `,options:{fileCreatedTime:"2020-01-01T00:00:00-00:00",fileModifiedTime:"2020-01-02T00:00:00-00:00",currentTime:(0,Gt.moment)("Thursday, January 2nd 2020, 12:00:05 am","dddd, MMMM Do YYYY, h:mm:ss a"),alreadyModified:!1}}),new T({description:"dateCreated option is false",before:y` # H1 `,after:y` --- date modified: Thursday, January 2nd 2020, 12:00:05 am --- # H1 `,options:{dateCreated:!1,fileCreatedTime:"2020-01-01T00:00:00-00:00",fileModifiedTime:"2020-01-01T00:00:00-00:00",currentTime:(0,Gt.moment)("Thursday, January 2nd 2020, 12:00:05 am","dddd, MMMM Do YYYY, h:mm:ss a"),alreadyModified:!1}}),new T({description:"Date Created Key is set",before:y` # H1 `,after:y` --- created: Wednesday, January 1st 2020, 12:00:00 am --- # H1 `,options:{dateCreated:!0,dateModified:!1,dateCreatedKey:"created",fileCreatedTime:"2020-01-01T00:00:00-00:00",currentTime:(0,Gt.moment)("Thursday, January 2nd 2020, 12:00:03 am","dddd, MMMM Do YYYY, h:mm:ss a"),alreadyModified:!1}}),new T({description:"Date Modified Key is set",before:y` # H1 `,after:y` --- modified: Wednesday, January 1st 2020, 4:00:00 pm --- # H1 `,options:{dateCreated:!1,dateModified:!0,dateModifiedKey:"modified",fileModifiedTime:"2020-01-01T00:00:00-00:00",currentTime:(0,Gt.moment)("Wednesday, January 1st 2020, 4:00:00 pm","dddd, MMMM Do YYYY, h:mm:ss a"),alreadyModified:!1}})]}get optionBuilders(){return[new se({OptionsClass:dt,name:"Date Created",description:"Insert the file creation date",optionsKey:"dateCreated"}),new Nn({OptionsClass:dt,name:"Date Created Key",description:"Which YAML key to use for creation date",optionsKey:"dateCreatedKey"}),new se({OptionsClass:dt,name:"Date Modified",description:"Insert the date the file was last modified",optionsKey:"dateModified"}),new Nn({OptionsClass:dt,name:"Date Modified Key",description:"Which YAML key to use for modification date",optionsKey:"dateModifiedKey"}),new wa({OptionsClass:dt,name:"Format",description:"Moment date format to use (see [Moment format options](https://momentjscom.readthedocs.io/en/latest/moment/04-displaying/01-format/))",optionsKey:"format"})]}get hasSpecialExecutionOrder(){return!0}};hn=B([A.register],hn);var gn=class{constructor(){this.yamlAliasesSectionStyle="Multi-line array";this.preserveExistingAliasesSectionStyle=!0;this.keepAliasThatMatchesTheFilename=!1;this.useYamlKeyToKeepTrackOfOldFilenameOrHeading=!0}};B([A.noSettingControl()],gn.prototype,"fileName",2);var Yi=class extends A{get OptionsClass(){return gn}get name(){return"YAML Title Alias"}get description(){return"Inserts the title of the file into the YAML frontmatter's aliases section. Gets the title from the first H1 or filename."}get type(){return"YAML"}apply(t,n){t=Bt(t);let r=$([v.code,v.yaml,v.link,v.wikiLink,v.tag],t,p=>{let m=p.match(/^#\s+(.*)/m);return m?m[1]:""});r=r||n.fileName;let i=null,o=t.match(Ie)[1],a=!n.keepAliasThatMatchesTheFilename&&r===n.fileName;n.useYamlKeyToKeepTrackOfOldFilenameOrHeading&&(i=ht(Be(o,Nr)));let s=o.replace(`--- `,"").replace(` ---`,""),l=ht(o);i=ht(Be(o,Nr));let u="multi-line";switch(n.yamlAliasesSectionStyle){case"Multi-line array":u="multi-line";break;case"Single-line array":u="single-line";break;case"Single string that expands to multi-line array if needed":u="single string to multi-line";break;case"Single string that expands to single-line array if needed":u="single string to single-line";break;default:throw new Error(`Unsupported setting 'YAML aliases section style': ${n.yamlAliasesSectionStyle}`)}let c=function(p,m){if(p==null)return m?"":r;if(typeof p=="string")m?p===r&&(p=""):i===p?p=r:p=[r,p];else if(i!==null){let f=p.indexOf(i);f!==-1&&(m?p.splice(f,1):p[f]=r)}else{let f=p.indexOf(r);f!==-1?m&&p.splice(f,1):m||(p=[r,...p])}return p===""||p.length===0?"":p};if(r=go(r),Object.keys(l).includes(mt)){let p=Be(s,mt),m="multi-line",f=p==="",d=!1;p.includes(` `)||(p.match(/^\[.*\]/)===null?(m="single string to single-line",d=!0):m="single-line");let h=bo(Ft(p)),g=c(h,a);g===""?s=Sn(s,mt):n.preserveExistingAliasesSectionStyle?!f&&(d&&r==g||!d||h==g)?s=Me(s,mt,ft(g,m)):s=Me(s,mt,ft(g,u)):s=Me(s,mt,ft(g,u))}else a||(s=Me(s,mt,ft(r,u)));return!n.useYamlKeyToKeepTrackOfOldFilenameOrHeading||a?s=Sn(s,Nr):s=Me(s,Nr,` ${r}`),t=t.replace(`--- ${o}--- `,`--- ${s}--- `),t}get exampleBuilders(){return[new T({description:"Adds a header with the title from heading.",before:y` # Obsidian `,after:y` --- aliases: - Obsidian linter-yaml-title-alias: Obsidian --- # Obsidian `}),new T({description:"Adds a header with the title from heading without YAML key when the use of the YAML key is set to false.",before:y` # Obsidian `,after:y` --- aliases: - Obsidian --- # Obsidian `,options:{useYamlKeyToKeepTrackOfOldFilenameOrHeading:!1}}),new T({description:"Adds a header with the title.",before:y` ${""} `,after:y` --- aliases: - Filename linter-yaml-title-alias: Filename --- ${""} `,options:{fileName:"Filename",keepAliasThatMatchesTheFilename:!0}}),new T({description:"Adds a header with the title without YAML key when the use of the YAML key is set to false.",before:y` ${""} `,after:y` --- aliases: - Filename --- ${""} `,options:{fileName:"Filename",keepAliasThatMatchesTheFilename:!0,useYamlKeyToKeepTrackOfOldFilenameOrHeading:!1}}),new T({description:"Replaces old filename with new filename when no header is present and filename is different than the old one listed in `linter-yaml-title-alias`.",before:y` --- aliases: - Old Filename - Alias 2 linter-yaml-title-alias: Old Filename --- ${""} `,after:y` --- aliases: - Filename - Alias 2 linter-yaml-title-alias: Filename --- ${""} `,options:{fileName:"Filename",keepAliasThatMatchesTheFilename:!0}})]}get optionBuilders(){return[new de({OptionsClass:gn,name:"YAML aliases section style",description:"The style of the aliases YAML section. It is recommended that the value here matches the aliases format for format YAML arrays if in use.",optionsKey:"yamlAliasesSectionStyle",records:[{value:"Multi-line array",description:"```aliases:\\n - Title```"},{value:"Single-line array",description:"```aliases: [Title]```"},{value:"Single string that expands to multi-line array if needed",description:"```aliases: Title```"},{value:"Single string that expands to single-line array if needed",description:"```aliases: Title```"}]}),new se({OptionsClass:gn,name:"Preserve existing aliases section style",description:"If set, the `YAML aliases section style` setting applies only to the newly created sections",optionsKey:"preserveExistingAliasesSectionStyle"}),new se({OptionsClass:gn,name:"Keep alias that matches the filename",description:"Such aliases are usually redundant",optionsKey:"keepAliasThatMatchesTheFilename"}),new se({OptionsClass:gn,name:"Use the YAML key `linter-yaml-title-alias` to help with filename and heading changes",description:"If set, when the first H1 heading changes or filename if first H1 is not present changes, then the old alias stored in this key will be replaced with the new value instead of just inserting a new entry in the aliases array",optionsKey:"useYamlKeyToKeepTrackOfOldFilenameOrHeading"})]}};Yi=B([A.register],Yi);var qi=class{constructor(){this.titleKey="title"}};B([A.noSettingControl()],qi.prototype,"fileName",2);var ji=class extends A{get OptionsClass(){return qi}get name(){return"YAML Title"}get description(){return"Inserts the title of the file into the YAML frontmatter. Gets the title from the first H1 or filename if there is no H1."}get type(){return"YAML"}apply(t,n){t=Bt(t);let r=$([v.code,v.yaml,v.link,v.wikiLink,v.tag],t,i=>{let o=i.match(/^#\s+(.*)/m);return o?o[1]:""});return r=r||n.fileName,r=go(r),qe(t,i=>{let o=` ${n.titleKey}.* `,a=new RegExp(o);if(a.test(i))i=i.replace(a,je(` ${n.titleKey}: ${r} `));else{let s=i.indexOf(` ---`);i=On(i,s,` ${n.titleKey}: ${r}`)}return i})}get exampleBuilders(){return[new T({description:"Adds a header with the title from heading.",before:y` # Obsidian `,after:y` --- title: Obsidian --- # Obsidian `,options:{fileName:"Filename"}}),new T({description:"Adds a header with the title.",before:y` ${""} `,after:y` --- title: Filename --- ${""} `,options:{fileName:"Filename"}})]}get optionBuilders(){return[new Nn({OptionsClass:qi,name:"Title Key",description:"Which YAML key to use for title",optionsKey:"titleKey"})]}};ji=B([A.register],ji);var Sw=` `,Ow=` `,Tw=` `,Cw=` `,Aw=` `,Ew=` `,Lw=` `,_w=` `,Iw=` `,Mw=` `,Bw=` `,Fw=` `,Qe={folder:{id:"lint-folder",source:Ow},file:{id:"lint-file",source:Sw},vault:{id:"lint-vault",source:Tw},whitespace:{id:"lint-whitespace",source:Cw},math:{id:"lint-math",source:Aw},content:{id:"lint-content",source:Ew},paste:{id:"lint-paste",source:Lw},custom:{id:"lint-custom",source:_w},heading:{id:"lint-heading",source:Iw},footer:{id:"lint-footer",source:Mw},yaml:{id:"lint-yaml",source:Bw},general:{id:"lint-general",source:Fw}};var La=require("obsidian");var _a=class{constructor(){this.disabledRules=[]}lintText(t){let n=t.oldText;this.disabledRules=Lf(n);let r=this.runBeforeRegularRules(t);for(let i of Nt){if(this.disabledRules.includes(i.alias())){mn(i.alias()+" is disabled");continue}else if(i.hasSpecialExecutionOrder)continue;[r]=Ct.applyIfEnabledBase(i,r,t.settings,{fileCreatedTime:t.fileInfo.createdAtFormatted,fileModifiedTime:t.fileInfo.modifiedAtFormatted,fileName:t.fileInfo.name,locale:t.momentLocale})}return t.oldText=r,this.runAfterRegularRules(n,t)}runBeforeRegularRules(t){let n=t.oldText;return[n]=Hn.applyIfEnabled(n,t.settings,this.disabledRules),[n]=$n.applyIfEnabled(n,t.settings,this.disabledRules),n}runAfterRegularRules(t,n){let r=n.oldText,i=n.getCurrentTime(),o;[r,o]=hn.applyIfEnabled(r,n.settings,this.disabledRules,{fileCreatedTime:n.fileInfo.createdAtFormatted,fileModifiedTime:n.fileInfo.modifiedAtFormatted,currentTime:i,alreadyModified:t!=r,locale:n.momentLocale});let a=hn.getRuleOptions(n.settings);return i=n.getCurrentTime(),[r]=jn.applyIfEnabled(r,n.settings,this.disabledRules,{currentTimeFormatted:i.format(a.format),yamlTimestampDateModifiedEnabled:o&&a.dateModified,dateModifiedKey:a.dateModifiedKey}),r}runCustomCommands(t,n){mn("Running Custom Lint Commands");let r=new Set;for(let i of t){if(i.id){if(r.has(i.id)){Ff(`You cannot run the same command ("${i.name}") as a custom lint rule twice.`);continue}}else continue;try{r.add(i.id),n.executeCommandById(i.id)}catch(o){ha(o,`Custom Lint Command ${i.id}`)}}}};function tu(e,t,n,r){let i=(0,La.moment)(t.stat.ctime);i.locale(n);let o=(0,La.moment)(t.stat.mtime);o.locale(n);let a=o.format(),s=i.format();return{oldText:e,fileInfo:{name:t.basename,createdAtFormatted:s,modifiedAtFormatted:a},settings:r,momentLocale:n,getCurrentTime:()=>{let l=(0,La.moment)();return l.locale(n),l}}}var Ia=require("obsidian"),Vi=class extends Ia.Modal{constructor(t,n,r,i,o){super(t),this.modalEl.addClass("confirm-modal"),this.contentEl.createEl("h3",{text:"Warning"}).style.textAlign="center",this.contentEl.createEl("p",{text:n+" Make sure you have backed up your files."}).id="confirm-dialog",this.contentEl.createDiv("modal-button-container",a=>{a.createEl("button",{text:"Cancel"}).addEventListener("click",()=>this.close());let s=a.createEl("button",{attr:{type:"submit"},cls:"mod-cta",text:r});s.addEventListener("click",async l=>{new Ia.Notice(i),this.close(),await o()}),setTimeout(()=>{s.focus()},50)})}};var Ne=require("obsidian");var sd=require("obsidian");var ad=require("obsidian");var we="top",Le="bottom",Ae="right",Te="left",Ma="auto",yn=[we,Le,Ae,Te],Zt="start",qn="end",zf="clippingParents",Ba="viewport",xr="popper",$f="reference",nu=yn.reduce(function(e,t){return e.concat([t+"-"+Zt,t+"-"+qn])},[]),Fa=[].concat(yn,[Ma]).reduce(function(e,t){return e.concat([t,t+"-"+Zt,t+"-"+qn])},[]),Rw="beforeRead",Dw="read",Pw="afterRead",Nw="beforeMain",zw="main",$w="afterMain",Hw="beforeWrite",Yw="write",jw="afterWrite",Hf=[Rw,Dw,Pw,Nw,zw,$w,Hw,Yw,jw];function De(e){return e?(e.nodeName||"").toLowerCase():null}function ge(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function wt(e){var t=ge(e).Element;return e instanceof t||e instanceof Element}function _e(e){var t=ge(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function kr(e){if(typeof ShadowRoot=="undefined")return!1;var t=ge(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function qw(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!_e(o)||!De(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var s=i[a];s===!1?o.removeAttribute(a):o.setAttribute(a,s===!0?"":s)}))})}function Vw(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],o=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),s=a.reduce(function(l,u){return l[u]="",l},{});!_e(i)||!De(i)||(Object.assign(i.style,s),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}var Yf={name:"applyStyles",enabled:!0,phase:"write",fn:qw,effect:Vw,requires:["computeStyles"]};function Pe(e){return e.split("-")[0]}var Et=Math.max,Vn=Math.min,Qt=Math.round;function vr(){var e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Ki(){return!/^((?!chrome|android).)*safari/i.test(vr())}function xt(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&_e(e)&&(i=e.offsetWidth>0&&Qt(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Qt(r.height)/e.offsetHeight||1);var a=wt(e)?ge(e):window,s=a.visualViewport,l=!Ki()&&n,u=(r.left+(l&&s?s.offsetLeft:0))/i,c=(r.top+(l&&s?s.offsetTop:0))/o,p=r.width/i,m=r.height/o;return{width:p,height:m,top:c,right:u+p,bottom:c+m,left:u,x:u,y:c}}function Kn(e){var t=xt(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function Wi(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&kr(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function nt(e){return ge(e).getComputedStyle(e)}function ru(e){return["table","td","th"].indexOf(De(e))>=0}function $e(e){return((wt(e)?e.ownerDocument:e.document)||window.document).documentElement}function Xt(e){return De(e)==="html"?e:e.assignedSlot||e.parentNode||(kr(e)?e.host:null)||$e(e)}function jf(e){return!_e(e)||nt(e).position==="fixed"?null:e.offsetParent}function Kw(e){var t=/firefox/i.test(vr()),n=/Trident/i.test(vr());if(n&&_e(e)){var r=nt(e);if(r.position==="fixed")return null}var i=Xt(e);for(kr(i)&&(i=i.host);_e(i)&&["html","body"].indexOf(De(i))<0;){var o=nt(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function Lt(e){for(var t=ge(e),n=jf(e);n&&ru(n)&&nt(n).position==="static";)n=jf(n);return n&&(De(n)==="html"||De(n)==="body"&&nt(n).position==="static")?t:n||Kw(e)||t}function Wn(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Un(e,t,n){return Et(e,Vn(t,n))}function qf(e,t,n){var r=Un(e,t,n);return r>n?n:r}function Ui(){return{top:0,right:0,bottom:0,left:0}}function Gi(e){return Object.assign({},Ui(),e)}function Zi(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var Ww=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,Gi(typeof t!="number"?t:Zi(t,yn))};function Uw(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Pe(n.placement),l=Wn(s),u=[Te,Ae].indexOf(s)>=0,c=u?"height":"width";if(!(!o||!a)){var p=Ww(i.padding,n),m=Kn(o),f=l==="y"?we:Te,d=l==="y"?Le:Ae,h=n.rects.reference[c]+n.rects.reference[l]-a[l]-n.rects.popper[c],g=a[l]-n.rects.reference[l],b=Lt(o),O=b?l==="y"?b.clientHeight||0:b.clientWidth||0:0,S=h/2-g/2,E=p[f],I=O-m[c]-p[d],k=O/2-m[c]/2+S,_=Un(E,k,I),M=l;n.modifiersData[r]=(t={},t[M]=_,t.centerOffset=_-k,t)}}function Gw(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||!Wi(t.elements.popper,i)||(t.elements.arrow=i))}var Vf={name:"arrow",enabled:!0,phase:"main",fn:Uw,effect:Gw,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function kt(e){return e.split("-")[1]}var Zw={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Qw(e){var t=e.x,n=e.y,r=window,i=r.devicePixelRatio||1;return{x:Qt(t*i)/i||0,y:Qt(n*i)/i||0}}function Kf(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,p=e.isFixed,m=a.x,f=m===void 0?0:m,d=a.y,h=d===void 0?0:d,g=typeof c=="function"?c({x:f,y:h}):{x:f,y:h};f=g.x,h=g.y;var b=a.hasOwnProperty("x"),O=a.hasOwnProperty("y"),S=Te,E=we,I=window;if(u){var k=Lt(n),_="clientHeight",M="clientWidth";if(k===ge(n)&&(k=$e(n),nt(k).position!=="static"&&s==="absolute"&&(_="scrollHeight",M="scrollWidth")),k=k,i===we||(i===Te||i===Ae)&&o===qn){E=Le;var z=p&&k===I&&I.visualViewport?I.visualViewport.height:k[_];h-=z-r.height,h*=l?1:-1}if(i===Te||(i===we||i===Le)&&o===qn){S=Ae;var q=p&&k===I&&I.visualViewport?I.visualViewport.width:k[M];f-=q-r.width,f*=l?1:-1}}var H=Object.assign({position:s},u&&Zw),U=c===!0?Qw({x:f,y:h}):{x:f,y:h};if(f=U.x,h=U.y,l){var P;return Object.assign({},H,(P={},P[E]=O?"0":"",P[S]=b?"0":"",P.transform=(I.devicePixelRatio||1)<=1?"translate("+f+"px, "+h+"px)":"translate3d("+f+"px, "+h+"px, 0)",P))}return Object.assign({},H,(t={},t[E]=O?h+"px":"",t[S]=b?f+"px":"",t.transform="",t))}function Xw(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,s=n.roundOffsets,l=s===void 0?!0:s;if(!1)var u;var c={placement:Pe(t.placement),variation:kt(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Kf(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Kf(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var Wf={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Xw,data:{}};var Ra={passive:!0};function Jw(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,s=a===void 0?!0:a,l=ge(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach(function(c){c.addEventListener("scroll",n.update,Ra)}),s&&l.addEventListener("resize",n.update,Ra),function(){o&&u.forEach(function(c){c.removeEventListener("scroll",n.update,Ra)}),s&&l.removeEventListener("resize",n.update,Ra)}}var Uf={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Jw,data:{}};var ex={left:"right",right:"left",bottom:"top",top:"bottom"};function Sr(e){return e.replace(/left|right|bottom|top/g,function(t){return ex[t]})}var tx={start:"end",end:"start"};function Da(e){return e.replace(/start|end/g,function(t){return tx[t]})}function Gn(e){var t=ge(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Zn(e){return xt($e(e)).left+Gn(e).scrollLeft}function iu(e,t){var n=ge(e),r=$e(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;var u=Ki();(u||!u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s+Zn(e),y:l}}function ou(e){var t,n=$e(e),r=Gn(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=Et(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=Et(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+Zn(e),l=-r.scrollTop;return nt(i||n).direction==="rtl"&&(s+=Et(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function Qn(e){var t=nt(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Pa(e){return["html","body","#document"].indexOf(De(e))>=0?e.ownerDocument.body:_e(e)&&Qn(e)?e:Pa(Xt(e))}function bn(e,t){var n;t===void 0&&(t=[]);var r=Pa(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=ge(r),a=i?[o].concat(o.visualViewport||[],Qn(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(bn(Xt(a)))}function Or(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function nx(e,t){var n=xt(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function Gf(e,t,n){return t===Ba?Or(iu(e,n)):wt(t)?nx(t,n):Or(ou($e(e)))}function rx(e){var t=bn(Xt(e)),n=["absolute","fixed"].indexOf(nt(e).position)>=0,r=n&&_e(e)?Lt(e):e;return wt(r)?t.filter(function(i){return wt(i)&&Wi(i,r)&&De(i)!=="body"}):[]}function au(e,t,n,r){var i=t==="clippingParents"?rx(e):[].concat(t),o=[].concat(i,[n]),a=o[0],s=o.reduce(function(l,u){var c=Gf(e,u,r);return l.top=Et(c.top,l.top),l.right=Vn(c.right,l.right),l.bottom=Vn(c.bottom,l.bottom),l.left=Et(c.left,l.left),l},Gf(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Qi(e){var t=e.reference,n=e.element,r=e.placement,i=r?Pe(r):null,o=r?kt(r):null,a=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,l;switch(i){case we:l={x:a,y:t.y-n.height};break;case Le:l={x:a,y:t.y+t.height};break;case Ae:l={x:t.x+t.width,y:s};break;case Te:l={x:t.x-n.width,y:s};break;default:l={x:t.x,y:t.y}}var u=i?Wn(i):null;if(u!=null){var c=u==="y"?"height":"width";switch(o){case Zt:l[u]=l[u]-(t[c]/2-n[c]/2);break;case qn:l[u]=l[u]+(t[c]/2-n[c]/2);break;default:}}return l}function _t(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,a=o===void 0?e.strategy:o,s=n.boundary,l=s===void 0?zf:s,u=n.rootBoundary,c=u===void 0?Ba:u,p=n.elementContext,m=p===void 0?xr:p,f=n.altBoundary,d=f===void 0?!1:f,h=n.padding,g=h===void 0?0:h,b=Gi(typeof g!="number"?g:Zi(g,yn)),O=m===xr?$f:xr,S=e.rects.popper,E=e.elements[d?O:m],I=au(wt(E)?E:E.contextElement||$e(e.elements.popper),l,c,a),k=xt(e.elements.reference),_=Qi({reference:k,element:S,strategy:"absolute",placement:i}),M=Or(Object.assign({},S,_)),z=m===xr?M:k,q={top:I.top-z.top+b.top,bottom:z.bottom-I.bottom+b.bottom,left:I.left-z.left+b.left,right:z.right-I.right+b.right},H=e.modifiersData.offset;if(m===xr&&H){var U=H[i];Object.keys(q).forEach(function(P){var V=[Ae,Le].indexOf(P)>=0?1:-1,ne=[we,Le].indexOf(P)>=0?"y":"x";q[P]+=U[ne]*V})}return q}function su(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?Fa:l,c=kt(r),p=c?s?nu:nu.filter(function(d){return kt(d)===c}):yn,m=p.filter(function(d){return u.indexOf(d)>=0});m.length===0&&(m=p);var f=m.reduce(function(d,h){return d[h]=_t(e,{placement:h,boundary:i,rootBoundary:o,padding:a})[Pe(h)],d},{});return Object.keys(f).sort(function(d,h){return f[d]-f[h]})}function ix(e){if(Pe(e)===Ma)return[];var t=Sr(e);return[Da(e),t,Da(t)]}function ox(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!0:a,l=n.fallbackPlacements,u=n.padding,c=n.boundary,p=n.rootBoundary,m=n.altBoundary,f=n.flipVariations,d=f===void 0?!0:f,h=n.allowedAutoPlacements,g=t.options.placement,b=Pe(g),O=b===g,S=l||(O||!d?[Sr(g)]:ix(g)),E=[g].concat(S).reduce(function(it,Xe){return it.concat(Pe(Xe)===Ma?su(t,{placement:Xe,boundary:c,rootBoundary:p,padding:u,flipVariations:d,allowedAutoPlacements:h}):Xe)},[]),I=t.rects.reference,k=t.rects.popper,_=new Map,M=!0,z=E[0],q=0;q=0,ne=V?"width":"height",C=_t(t,{placement:H,boundary:c,rootBoundary:p,altBoundary:m,padding:u}),oe=V?P?Ae:Te:P?Le:we;I[ne]>k[ne]&&(oe=Sr(oe));var te=Sr(oe),he=[];if(o&&he.push(C[U]<=0),s&&he.push(C[oe]<=0,C[te]<=0),he.every(function(it){return it})){z=H,M=!1;break}_.set(H,he)}if(M)for(var le=d?3:1,w=function(Xe){var vt=E.find(function(ot){var ce=_.get(ot);if(ce)return ce.slice(0,Xe).every(function(zt){return zt})});if(vt)return z=vt,"break"},x=le;x>0;x--){var rt=w(x);if(rt==="break")break}t.placement!==z&&(t.modifiersData[r]._skip=!0,t.placement=z,t.reset=!0)}}var Zf={name:"flip",enabled:!0,phase:"main",fn:ox,requiresIfExists:["offset"],data:{_skip:!1}};function Qf(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Xf(e){return[we,Ae,Le,Te].some(function(t){return e[t]>=0})}function ax(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=_t(t,{elementContext:"reference"}),s=_t(t,{altBoundary:!0}),l=Qf(a,r),u=Qf(s,i,o),c=Xf(l),p=Xf(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":p})}var Jf={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:ax};function sx(e,t,n){var r=Pe(e),i=[Te,we].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[Te,Ae].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function lx(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,a=Fa.reduce(function(c,p){return c[p]=sx(p,t.rects,o),c},{}),s=a[t.placement],l=s.x,u=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=a}var ed={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:lx};function ux(e){var t=e.state,n=e.name;t.modifiersData[n]=Qi({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}var td={name:"popperOffsets",enabled:!0,phase:"read",fn:ux,data:{}};function lu(e){return e==="x"?"y":"x"}function cx(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!1:a,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,p=n.padding,m=n.tether,f=m===void 0?!0:m,d=n.tetherOffset,h=d===void 0?0:d,g=_t(t,{boundary:l,rootBoundary:u,padding:p,altBoundary:c}),b=Pe(t.placement),O=kt(t.placement),S=!O,E=Wn(b),I=lu(E),k=t.modifiersData.popperOffsets,_=t.rects.reference,M=t.rects.popper,z=typeof h=="function"?h(Object.assign({},t.rects,{placement:t.placement})):h,q=typeof z=="number"?{mainAxis:z,altAxis:z}:Object.assign({mainAxis:0,altAxis:0},z),H=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,U={x:0,y:0};if(!!k){if(o){var P,V=E==="y"?we:Te,ne=E==="y"?Le:Ae,C=E==="y"?"height":"width",oe=k[E],te=oe+g[V],he=oe-g[ne],le=f?-M[C]/2:0,w=O===Zt?_[C]:M[C],x=O===Zt?-M[C]:-_[C],rt=t.elements.arrow,it=f&&rt?Kn(rt):{width:0,height:0},Xe=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Ui(),vt=Xe[V],ot=Xe[ne],ce=Un(0,_[C],it[C]),zt=S?_[C]/2-le-ce-vt-q.mainAxis:w-ce-vt-q.mainAxis,St=S?-_[C]/2+le+ce+ot+q.mainAxis:x+ce+ot+q.mainAxis,It=t.elements.arrow&&Lt(t.elements.arrow),Jt=It?E==="y"?It.clientTop||0:It.clientLeft||0:0,wn=(P=H==null?void 0:H[E])!=null?P:0,Ya=oe+zt-wn-Jt,ja=oe+St-wn,Ji=Un(f?Vn(te,Ya):te,oe,f?Et(he,ja):he);k[E]=Ji,U[E]=Ji-oe}if(s){var Cr,eo=E==="x"?we:Te,to=E==="x"?Le:Ae,$t=k[I],xn=I==="y"?"height":"width",Ar=$t+g[eo],no=$t-g[to],Er=[we,Te].indexOf(b)!==-1,ro=(Cr=H==null?void 0:H[I])!=null?Cr:0,io=Er?Ar:$t-_[xn]-M[xn]-ro+q.altAxis,oo=Er?$t+_[xn]+M[xn]-ro-q.altAxis:no,L=f&&Er?qf(io,$t,oo):Un(f?io:Ar,$t,f?oo:no);k[I]=L,U[I]=L-$t}t.modifiersData[r]=U}}var nd={name:"preventOverflow",enabled:!0,phase:"main",fn:cx,requiresIfExists:["offset"]};function uu(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function cu(e){return e===ge(e)||!_e(e)?Gn(e):uu(e)}function px(e){var t=e.getBoundingClientRect(),n=Qt(t.width)/e.offsetWidth||1,r=Qt(t.height)/e.offsetHeight||1;return n!==1||r!==1}function pu(e,t,n){n===void 0&&(n=!1);var r=_e(t),i=_e(t)&&px(t),o=$e(t),a=xt(e,i,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((De(t)!=="body"||Qn(o))&&(s=cu(t)),_e(t)?(l=xt(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):o&&(l.x=Zn(o))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function mx(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var l=t.get(s);l&&i(l)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function mu(e){var t=mx(e);return Hf.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function fu(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function du(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var rd={placement:"bottom",modifiers:[],strategy:"absolute"};function id(){for(var e=arguments.length,t=new Array(e),n=0;n(e%t+t)%t,gu=class{constructor(t,n,r){this.owner=t,this.containerEl=n,n.on("click",".suggestion-item",this.onSuggestionClick.bind(this)),n.on("mousemove",".suggestion-item",this.onSuggestionMouseover.bind(this)),r.register([],"ArrowUp",i=>{if(!i.isComposing)return this.setSelectedItem(this.selectedItem-1,!0),!1}),r.register([],"ArrowDown",i=>{if(!i.isComposing)return this.setSelectedItem(this.selectedItem+1,!0),!1}),r.register([],"Enter",i=>{if(!i.isComposing)return this.useSelectedItem(i),!1})}onSuggestionClick(t,n){t.preventDefault();let r=this.suggestions.indexOf(n);this.setSelectedItem(r,!1),this.useSelectedItem(t)}onSuggestionMouseover(t,n){let r=this.suggestions.indexOf(n);this.setSelectedItem(r,!1)}setSuggestions(t){this.containerEl.empty();let n=[];t.forEach(r=>{let i=this.containerEl.createDiv("suggestion-item");this.owner.renderSuggestion(r,i),n.push(i)}),this.values=t,this.suggestions=n,this.setSelectedItem(0,!1)}useSelectedItem(t){let n=this.values[this.selectedItem];n&&this.owner.selectSuggestion(n,t)}setSelectedItem(t,n){let r=dx(t,this.suggestions.length),i=this.suggestions[this.selectedItem],o=this.suggestions[r];i==null||i.removeClass("is-selected"),o==null||o.addClass("is-selected"),this.selectedItem=r,n&&o.scrollIntoView(!1)}},Na=class{constructor(t,n){this.app=t,this.inputEl=n,this.scope=new ad.Scope,this.suggestEl=createDiv("suggestion-container");let r=this.suggestEl.createDiv("suggestion");this.suggest=new gu(this,r,this.scope),this.scope.register([],"Escape",this.close.bind(this)),this.inputEl.addEventListener("input",this.onInputChanged.bind(this)),this.inputEl.addEventListener("focus",this.onInputChanged.bind(this)),this.inputEl.addEventListener("blur",this.close.bind(this)),this.suggestEl.on("mousedown",".suggestion-container",i=>{i.preventDefault()})}onInputChanged(){let t=this.inputEl.value,n=this.getSuggestions(t);if(!n){this.close();return}n.length>0?(this.suggest.setSuggestions(n),this.open(this.app.dom.appContainerEl,this.inputEl)):this.close()}open(t,n){this.app.keymap.pushScope(this.scope),t.appendChild(this.suggestEl),this.popper=hu(n,this.suggestEl,{placement:"bottom-start",modifiers:[{name:"sameWidth",enabled:!0,fn:({state:r,instance:i})=>{let o=`${r.rects.reference.width}px`;r.styles.popper.width!==o&&(r.styles.popper.width=o,i.update())},phase:"beforeWrite",requires:["computeStyles"]}]})}close(){this.app.keymap.popScope(this.scope),this.suggest.setSuggestions([]),this.popper&&this.popper.destroy(),this.suggestEl.detach()}};var Xi=class extends Na{constructor(n,r,i=[]){super(n,r);this.app=n;this.inputEl=r;this.valuesToExclude=i}getSuggestions(n){let r=this.app.commands.listCommands();if(!r)return[];let i=r.filter(s=>{for(let l of this.valuesToExclude)if(l.id==s.id&&!(this.inputEl.hasAttribute("commandId")&&this.inputEl.getAttribute("commandId")==s.id))return!1;return!0}),o=[],a=n.toLowerCase();return i.forEach(s=>{(s.id.contains(a)||s.name.toLowerCase().contains(a))&&o.push(s)}),o}renderSuggestion(n,r){r.setText(n.name)}selectSuggestion(n){this.inputEl.value=n.name,this.inputEl.setAttribute("commandId",n.id),this.inputEl.trigger("input"),this.close()}};var hx={General:Qe.general.id,Custom:Qe.custom.id,YAML:Qe.yaml.id,Heading:Qe.heading.id,Footnote:Qe.footer.id,Content:Qe.content.id,Spacing:Qe.whitespace.id},za=class extends Ne.PluginSettingTab{constructor(n,r){super(n,r);this.tabContent=new Map;this.selectedTab="General";this.searchSettingInfo=new Map;this.plugin=r}display(){let{containerEl:n}=this;n.empty(),this.generateSettingsTitle(n,Ne.Platform.isMobile);let i=n.createEl("nav",{cls:"linter-setting-header"}).createDiv("linter-setting-tab-group"),o=n.createDiv("linter-setting-content");this.createTabAndContent("General",i,o,(l,u)=>this.generateGeneralSettings(u,l));let a="",s="";for(let l of Nt)l.type!==a&&(s=l.type,this.createTabAndContent(s,i,o),a=l.type),this.addRuleToTab(s,l);this.createTabAndContent("Custom",i,o,(l,u)=>this.generateCustomCommandSettings(u,l)),this.createSearchZeroState(o)}createTabAndContent(n,r,i,o){let a=this.selectedTab===n,s=r.createDiv("linter-navigation-item"),l="linter-desktop";Ne.Platform.isMobile&&(l="linter-mobile"),s.addClass(l),(0,Ne.setIcon)(s.createSpan({cls:"linter-navigation-item-icon"}),hx[n],20),s.createSpan().setText(n),s.onclick=()=>{if(this.selectedTab==n)return;s.addClass("linter-navigation-item-selected");let p=this.tabContent.get(n);if(this.unhideEl(p.content),this.selectedTab!=""){let m=this.tabContent.get(this.selectedTab);m.navButton.removeClass("linter-navigation-item-selected"),this.hideEl(m.content)}else{this.hideEl(this.searchZeroState);for(let m of this.searchSettingInfo)for(let f of m[1])this.unhideEl(f.containerEl);for(let m of this.tabContent){let f=m[1];this.hideEl(f.heading),n!==m[0]&&this.hideEl(f.content)}}this.selectedTab=n};let u=i.createDiv("linter-tab-settings"),c=u.createEl("h2",{text:n+" Settings"});this.hideEl(c),u.id=n.toLowerCase().replace(" ","-"),a?s.addClass("linter-navigation-item-selected"):this.hideEl(u),o&&o(u,n),this.tabContent.set(n,{content:u,heading:c,navButton:s})}addRuleToTab(n,r){let i=this.tabContent.get(n).content;if(i==null)return;let o=i.createDiv();o.id=r.alias(),o.createEl(Ne.Platform.isMobile?"h4":"h3",{},s=>{s.innerHTML=`${r.name}`});let a=[];for(let s of r.options)s.display(o,this.plugin.settings,this.plugin),a.push(s.searchInfo);this.addSettingToMasterSettingsList(n,o,r.name.toLowerCase(),r.description.toLowerCase(),a,o.id)}generateCustomCommandSettings(n,r){r.createEl(Ne.Platform.isMobile?"h4":"h3",{text:"Custom Commands"});let i=`Custom commands are Obsidian commands that get run after the linter is finished running its regular rules. This means that they do not run before the YAML timestamp logic runs, so they can cause YAML timestamp to be triggered on the next run of the linter. You may only select an Obsidian command once. **_Note that this currently only works on linting the current file._**`,o=`When selecting an option, make sure to select the option either by using the mouse or by hitting the enter key. Other selection methods may not work and only selections of an actual Obsidian command or an empty string will be saved.`;this.addSettingToMasterSettingsList(n,r,n.toLowerCase(),i.replaceAll(` `," ")+o.replaceAll(` `," ")),r.createEl("p").innerHTML=ct(i),r.createEl("p",{text:o}).style.color="#EED202";function a(s,l,u){if(u<0||u===s.length)return;let c=s[l];s[l]=s[u],s[u]=c}new Ne.Setting(r).addButton(s=>{s.setButtonText("Add new command").setCta().onClick(()=>{this.plugin.settings.lintCommands.push({id:"",name:""}),this.plugin.saveSettings(),this.display();let l=document.getElementsByClassName("linter-custom-command");l[l.length-1].focus()})}),this.plugin.settings.lintCommands.forEach((s,l)=>{new Ne.Setting(r).addSearch(u=>{new Xi(this.app,u.inputEl,this.plugin.settings.lintCommands),u.setPlaceholder("Obsidian command").setValue(s.name).onChange(c=>{let p={id:u.inputEl.getAttribute("commandId"),name:c};p.name&&p.id?(this.plugin.settings.lintCommands[l]=p,this.plugin.saveSettings()):!p.name&&!p.id&&(this.plugin.settings.lintCommands[l]=p,this.plugin.saveSettings())}),u.inputEl.setAttr("tabIndex",l),u.inputEl.addClass("linter-custom-command")}).addExtraButton(u=>{u.setIcon("up-chevron-glyph").setTooltip("Move up").onClick(()=>{a(this.plugin.settings.lintCommands,l,l-1),this.plugin.saveSettings(),this.display()})}).addExtraButton(u=>{u.setIcon("down-chevron-glyph").setTooltip("Move down").onClick(()=>{a(this.plugin.settings.lintCommands,l,l+1),this.plugin.saveSettings(),this.display()})}).addExtraButton(u=>{u.setIcon("cross").setTooltip("Delete").onClick(()=>{this.plugin.settings.lintCommands.splice(l,1),this.plugin.saveSettings(),this.display()})})})}generateGeneralSettings(n,r){var u;let i=r.createDiv(),o="Lint on save",a="Lint the file on manual save (when `Ctrl + S` is pressed or when `:w` is executed while using vim keybindings)",s=new Ne.Setting(i).setName(o).addToggle(c=>{c.setValue(this.plugin.settings.lintOnSave).onChange(async p=>{this.plugin.settings.lintOnSave=p,await this.plugin.saveSettings()})});s.descEl.innerHTML=ct(a),this.addSettingToMasterSettingsList(n,i,o,a),i=r.createDiv(),o="Display message on lint",a="Display the number of characters changed after linting",new Ne.Setting(i).setName(o).setDesc(a).addToggle(c=>{c.setValue(this.plugin.settings.displayChanged).onChange(async p=>{this.plugin.settings.displayChanged=p,await this.plugin.saveSettings()})}),this.addSettingToMasterSettingsList(n,i,o,a),i=r.createDiv(),o="Folders to ignore",a="Folders to ignore when linting all files or linting on save. Enter folder paths separated by newlines",new Ne.Setting(i).setName(o).setDesc(a).addTextArea(c=>{c.setValue(this.plugin.settings.foldersToIgnore.join(` `)).onChange(async p=>{this.plugin.settings.foldersToIgnore=p.split(` `),await this.plugin.saveSettings()})}),this.addSettingToMasterSettingsList(n,i,o,a);let l=(u=navigator.language)==null?void 0:u.toLowerCase();i=r.createDiv(),o="Override locale",a="Set this if you want to use a locale different from the default",new Ne.Setting(i).setName(o).setDesc(a).addDropdown(c=>{c.addOption("system-default",`Same as system (${l})`),sd.moment.locales().forEach(p=>{c.addOption(p,p)}),c.setValue(this.plugin.settings.linterLocale),c.onChange(async p=>{this.plugin.settings.linterLocale=p,await this.plugin.setOrUpdateMomentInstance(),await this.plugin.saveSettings()})}),this.addSettingToMasterSettingsList(n,i,o,a)}generateSearchBar(n){let r=new Ne.Setting(n);r.settingEl.style.border="none",r.addSearch(i=>{this.search=i}),this.search.setPlaceholder("Search all settings"),this.search.inputEl.onfocus=()=>{for(let i of this.tabContent){let o=i[1];o.navButton.removeClass("linter-navigation-item-selected"),this.unhideEl(o.content),this.unhideEl(o.heading);let a=this.search.getValue();this.selectedTab==""&&a.trim()!=""&&this.searchSettings(a.toLowerCase()),this.selectedTab=""}},this.search.onChange(i=>{this.searchSettings(i.toLowerCase())})}generateSettingsTitle(n,r){let i=n.createDiv("linter-setting-title");r?i.addClass("linter-mobile"):i.createEl("h1").setText("Linter"),this.generateSearchBar(i)}searchSettings(n){var a;let r=new Set,i=this,o=function(s,l){i.unhideEl(s),r.has(l)||r.add(l)};for(let s of this.searchSettingInfo){let l=s[0],u=s[1];for(let c of u)if(n.trim()===""||((a=c.alias)==null?void 0:a.includes(n))||c.description.includes(n)||c.name.includes(n))o(c.containerEl,l);else if(c.options)for(let p of c.options){if(p.description.toLowerCase().includes(n)||p.name.toLowerCase().includes(n)){o(c.containerEl,l);break}else if(p.options){for(let m of p.options)if(m.description.toLowerCase().includes(n)||m.value.toLowerCase().includes(n)){o(c.containerEl,l);break}}this.hideEl(c.containerEl)}else this.hideEl(c.containerEl)}for(let s of this.tabContent)r.has(s[0])?this.unhideEl(s[1].heading):this.hideEl(s[1].heading);r.size===0?this.unhideEl(this.searchZeroState):this.hideEl(this.searchZeroState)}createSearchZeroState(n){this.searchZeroState=n.createDiv(),this.hideEl(this.searchZeroState),this.searchZeroState.createEl(Ne.Platform.isMobile?"h3":"h2",{text:"No settings match search"}).style.textAlign="center"}addSettingToMasterSettingsList(n,r,i="",o="",a=null,s=null){let l={containerEl:r,name:i.toLowerCase(),description:o.toLowerCase(),options:a,alias:s};this.searchSettingInfo.has(n)?this.searchSettingInfo.get(n).push(l):this.searchSettingInfo.set(n,[l])}hideEl(n){n.addClass("linter-visually-hidden")}unhideEl(n){n.removeClass("linter-visually-hidden")}};var gx={en:"en-gb",zh:"zh-cn","zh-TW":"zh-tw",ru:"ru",ko:"ko",it:"it",id:"id",ro:"ro","pt-BR":"pt-br",cz:"cs",da:"da",de:"de",es:"es",fr:"fr",no:"nn",pl:"pl",pt:"pt",tr:"tr",hi:"hi",nl:"nl",ar:"ar",ja:"ja"},Ha=class extends xe.Plugin{constructor(){super(...arguments);this.isEnabled=!0;this.rulesRunner=new _a}async onload(){var o,a;ni("Loading plugin"),this.isEnabled=!0;for(let s in Qe){let l=Qe[s];(0,xe.addIcon)(l.id,l.source)}await this.loadSettings(),this.addCommand({id:"lint-file",name:"Lint the current file",editorCallback:s=>this.runLinterEditor(s),icon:Qe.file.id,hotkeys:[{modifiers:["Mod","Alt"],key:"l"}]}),this.addCommand({id:"lint-all-files",name:"Lint all files in the vault",icon:Qe.vault.id,callback:()=>{let s="This will edit all of your files and may introduce errors.",l="Lint All",u="Linting all files...";new Vi(this.app,s,l,u,()=>this.runLinterAllFiles(this.app)).open()}}),this.addCommand({id:"lint-all-files-in-folder",name:"Lint all files in the current folder",icon:Qe.folder.id,editorCheckCallback:(s,l)=>{if(s)return!this.app.workspace.getActiveFile().parent.isRoot();this.createFolderLintModal(this.app.workspace.getActiveFile().parent)}}),this.registerEvent(this.app.workspace.on("file-menu",(s,l)=>{l instanceof xe.TFolder&&s.addItem(u=>{u.setTitle("Lint folder").setIcon(Qe.folder.id).onClick(()=>this.createFolderLintModal(l))})})),this.eventRef=this.app.workspace.on("file-menu",(s,l,u)=>this.onMenuOpenCallback(s,l,u)),this.registerEvent(this.eventRef);let n=(a=(o=this.app.commands)==null?void 0:o.commands)==null?void 0:a["editor:save-file"];typeof(n==null?void 0:n.callback)=="function"&&(n.callback=()=>{if(this.settings.lintOnSave&&this.isEnabled){let s=this.app.workspace.getActiveViewOfType(xe.MarkdownView).editor,l=this.app.workspace.getActiveFile();this.shouldIgnoreFile(l)||this.runLinterEditor(s)}});let i=this;window.CodeMirrorAdapter.commands.save=()=>{i.app.commands.executeCommandById("editor:save-file")},this.addSettingTab(new za(this.app,this))}async onunload(){ni("Unloading plugin"),this.isEnabled=!1,this.app.workspace.offref(this.eventRef)}async loadSettings(){this.settings={ruleConfigs:{},lintOnSave:!1,displayChanged:!0,foldersToIgnore:[],linterLocale:"system-default",logLevel:ld.default.levels.ERROR,lintCommands:[]};let r=await this.loadData()||{};for(let i of Nt)if(this.settings.ruleConfigs[i.name]=i.getDefaultOptions(),(r==null?void 0:r.ruleConfigs)&&(r==null?void 0:r.ruleConfigs[i.name])&&(Object.assign(this.settings.ruleConfigs[i.name],r.ruleConfigs[i.name]),r.ruleConfigs[i.name].Enabled!==void 0)){let o=i.enabledOptionName();this.settings.ruleConfigs[i.name][o]=r.ruleConfigs[i.name].Enabled,delete this.settings.ruleConfigs[i.name].Enabled}Object.prototype.hasOwnProperty.call(r,"lintOnSave")&&(this.settings.lintOnSave=r.lintOnSave),Object.prototype.hasOwnProperty.call(r,"displayChanged")&&(this.settings.displayChanged=r.displayChanged),Object.prototype.hasOwnProperty.call(r,"foldersToIgnore")&&(this.settings.foldersToIgnore=r.foldersToIgnore),Object.prototype.hasOwnProperty.call(r,"linterLocale")&&(this.settings.linterLocale=r.linterLocale),Object.prototype.hasOwnProperty.call(r,"logLevel")&&(this.settings.logLevel=r.logLevel),Object.prototype.hasOwnProperty.call(r,"lintCommands")&&(this.settings.lintCommands=r.lintCommands),Rf(this.settings.logLevel),this.setOrUpdateMomentInstance()}async saveSettings(){await this.saveData(this.settings)}onMenuOpenCallback(n,r,i){r instanceof xe.TFile&&r.extension==="md"&&n.addItem(o=>{o.setIcon(Qe.file.id),o.setTitle("Lint file"),o.onClick(async a=>{this.runLinterFile(r)})})}shouldIgnoreFile(n){for(let r of this.settings.foldersToIgnore)if(r.length>0&&n.path.startsWith(r))return!0;return!1}async runLinterFile(n){let r=gc(await this.app.vault.read(n)),i=this.rulesRunner.lintText(tu(r,n,this.momentLocale,this.settings));await this.app.vault.modify(n,i)}async runLinterAllFiles(n){let r=0;await Promise.all(n.vault.getMarkdownFiles().map(async o=>{if(!this.shouldIgnoreFile(o))try{await this.runLinterFile(o)}catch(a){this.handleLintError(o,a,"Lint All Files Error in File '${file.path}'"),r+=1}}));let i=0;if(r===0)new xe.Notice("Linted all files",i);else{let o=r===1?"was 1 error":"were "+r+" errors";new xe.Notice("Linted all files and there "+o+".",i)}}async runLinterAllFilesInFolder(n){ni("Linting folder "+n.name);let r=0,i=0,o=(0,xe.normalizePath)(n.path)+"/";await Promise.all(this.app.vault.getMarkdownFiles().map(async s=>{if((0,xe.normalizePath)(s.path).startsWith(o)&&!this.shouldIgnoreFile(s)){try{await this.runLinterFile(s)}catch(l){this.handleLintError(s,l,"Lint All Files in Folder Error in File '${file.path}'"),r+=1}i++}}));let a=0;if(r===0)new xe.Notice("Linted all "+i+" files in "+n.name+".",a);else{let s=r===1?"was 1 error":"were "+r+" errors";new xe.Notice("Linted all "+i+" files in "+n.name+" and there "+s+".",a)}}createFolderLintModal(n){let r="This will edit all of your files in "+n.name+" including files in its subfolders which may introduce errors.",i="Lint All Files in "+n.name,o="Linting all files in "+n.name+"...";new Vi(this.app,r,i,o,()=>this.runLinterAllFilesInFolder(n)).open()}runLinterEditor(n){ni("Running linter");let r=this.app.workspace.getActiveFile(),i=n.getValue(),o;try{o=this.rulesRunner.lintText(tu(i,r,this.momentLocale,this.settings))}catch(p){this.handleLintError(r,p,"Lint File Error in File '${file.path}'",!1)}let s=new Tr.default.diff_match_patch().diff_main(i,o),l="";s.forEach(p=>{function m(h){let g=h.split(` `);return{line:g.length-1,ch:g[g.length-1].length}}let[f,d]=p;if(f==Tr.default.DIFF_INSERT)n.replaceRange(d,m(l)),l+=d;else if(f==Tr.default.DIFF_DELETE){let h=m(l),g=l;g+=d;let b=m(g);n.replaceRange("",h,b)}else l+=d});let u=s.map(p=>p[0]==Tr.default.DIFF_INSERT?p[1].length:0).reduce((p,m)=>p+m,0),c=s.map(p=>p[0]==Tr.default.DIFF_DELETE?p[1].length:0).reduce((p,m)=>p+m,0);this.displayChangedMessage(u,c);try{this.rulesRunner.runCustomCommands(this.settings.lintCommands,this.app.commands)}catch(p){this.handleLintError(r,p,"Lint File Error in File '${file.path}'",!1)}}async setOrUpdateMomentInstance(){var s;let n=localStorage.getItem("language")||"en",r=(s=navigator.language)==null?void 0:s.toLowerCase(),i=gx[n];this.settings.linterLocale!=="system-default"?i=this.settings.linterLocale:r.startsWith(n)&&(i=r),this.momentLocale=i;let o=$a.moment.locale(),a=$a.moment.locale(i);mn(`Trying to switch Moment.js locale to ${i}, got ${a}`),$a.moment.locale(o)}displayChangedMessage(n,r){if(this.settings.displayChanged){let i=y` ${n} characters added ${r} characters removed `;new xe.Notice(i)}}handleLintError(n,r,i,o=!0){let a=i.replace("${file.path}",n.path);r instanceof pn?o?new xe.Notice(`${a} ${r.message}. See console for more details.`):new xe.Notice(`${r.message}. See console for more details.`):new xe.Notice("An unknown error occurred during linting. See console for details"),Bf(a,r)}}; /*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh * @license MIT */ /*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */