/* THIS IS A GENERATED/BUNDLED FILE BY ESBUILD if you want to view the source, please visit the github repository of this plugin */ var ap=Object.create;var Jn=Object.defineProperty;var ka=Object.getOwnPropertyDescriptor;var lp=Object.getOwnPropertyNames;var up=Object.getPrototypeOf,pp=Object.prototype.hasOwnProperty;var Sa=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ta=(e,t)=>{for(var n in t)Jn(e,n,{get:t[n],enumerable:!0})},Oa=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of lp(t))!pp.call(e,r)&&r!==n&&Jn(e,r,{get:()=>t[r],enumerable:!(i=ka(t,r))||i.enumerable});return e};var Yo=(e,t,n)=>(n=e!=null?ap(up(e)):{},Oa(t||!e||!e.__esModule?Jn(n,"default",{value:e,enumerable:!0}):n,e)),cp=e=>Oa(Jn({},"__esModule",{value:!0}),e),A=(e,t,n,i)=>{for(var r=i>1?void 0:i?ka(t,n):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(r=(i?s(t,n,r):s(r))||r);return i&&r&&Jn(t,n,r),r};var Aa=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var Ue=(e,t,n)=>(Aa(e,t,"read from private field"),n?n.call(e):t.get(e)),Tn=(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)},Ca=(e,t,n,i)=>(Aa(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n);var Cl=Sa((a0,Mn)=>{var _=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},Q=-1,ee=1,W=0;_.Diff=function(e,t){return[e,t]};_.prototype.diff_main=function(e,t,n,i){typeof i>"u"&&(this.Diff_Timeout<=0?i=Number.MAX_VALUE:i=new Date().getTime()+this.Diff_Timeout*1e3);var r=i;if(e==null||t==null)throw new Error("Null input. (diff_main)");if(e==t)return e?[new _.Diff(W,e)]:[];typeof n>"u"&&(n=!0);var o=n,s=this.diff_commonPrefix(e,t),a=e.substring(0,s);e=e.substring(s),t=t.substring(s),s=this.diff_commonSuffix(e,t);var l=e.substring(e.length-s);e=e.substring(0,e.length-s),t=t.substring(0,t.length-s);var u=this.diff_compute_(e,t,o,r);return a&&u.unshift(new _.Diff(W,a)),l&&u.push(new _.Diff(W,l)),this.diff_cleanupMerge(u),u};_.prototype.diff_compute_=function(e,t,n,i){var r;if(!e)return[new _.Diff(ee,t)];if(!t)return[new _.Diff(Q,e)];var o=e.length>t.length?e:t,s=e.length>t.length?t:e,a=o.indexOf(s);if(a!=-1)return r=[new _.Diff(ee,o.substring(0,a)),new _.Diff(W,s),new _.Diff(ee,o.substring(a+s.length))],e.length>t.length&&(r[0][0]=r[2][0]=Q),r;if(s.length==1)return[new _.Diff(Q,e),new _.Diff(ee,t)];var l=this.diff_halfMatch_(e,t);if(l){var u=l[0],p=l[1],m=l[2],c=l[3],d=l[4],h=this.diff_main(u,m,n,i),g=this.diff_main(p,c,n,i);return h.concat([new _.Diff(W,d)],g)}return n&&e.length>100&&t.length>100?this.diff_lineMode_(e,t,i):this.diff_bisect_(e,t,i)};_.prototype.diff_lineMode_=function(e,t,n){var i=this.diff_linesToChars_(e,t);e=i.chars1,t=i.chars2;var r=i.lineArray,o=this.diff_main(e,t,!1,n);this.diff_charsToLines_(o,r),this.diff_cleanupSemantic(o),o.push(new _.Diff(W,""));for(var s=0,a=0,l=0,u="",p="";s=1&&l>=1){o.splice(s-a-l,a+l),s=s-a-l;for(var m=this.diff_main(u,p,!1,n),c=m.length-1;c>=0;c--)o.splice(s,0,m[c]);s=s+m.length}l=0,a=0,u="",p="";break}s++}return o.pop(),o};_.prototype.diff_bisect_=function(e,t,n){for(var i=e.length,r=t.length,o=Math.ceil((i+r)/2),s=o,a=2*o,l=new Array(a),u=new Array(a),p=0;pn);y++){for(var E=-y+d;E<=y-h;E+=2){var O=s+E,L;E==-y||E!=y&&l[O-1]i)h+=2;else if(M>r)d+=2;else if(c){var T=s+m-E;if(T>=0&&T=B)return this.diff_bisectSplit_(e,t,L,M,n)}}}for(var I=-y+g;I<=y-w;I+=2){var T=s+I,B;I==-y||I!=y&&u[T-1]i)w+=2;else if(P>r)g+=2;else if(!c){var O=s+m-I;if(O>=0&&O=B)return this.diff_bisectSplit_(e,t,L,M,n)}}}}return[new _.Diff(Q,e),new _.Diff(ee,t)]};_.prototype.diff_bisectSplit_=function(e,t,n,i,r){var o=e.substring(0,n),s=t.substring(0,i),a=e.substring(n),l=t.substring(i),u=this.diff_main(o,s,!1,r),p=this.diff_main(a,l,!1,r);return u.concat(p)};_.prototype.diff_linesToChars_=function(e,t){var n=[],i={};n[0]="";function r(l){for(var u="",p=0,m=-1,c=n.length;mi?e=e.substring(n-i):nt.length?e:t,i=e.length>t.length?t:e;if(n.length<4||i.length*2=h.length?[L,M,T,B,O]:null}var s=o(n,i,Math.ceil(n.length/4)),a=o(n,i,Math.ceil(n.length/2)),l;if(!s&&!a)return null;a?s?l=s[4].length>a[4].length?s:a:l=a:l=s;var u,p,m,c;e.length>t.length?(u=l[0],p=l[1],m=l[2],c=l[3]):(m=l[0],c=l[1],u=l[2],p=l[3]);var d=l[4];return[u,p,m,c,d]};_.prototype.diff_cleanupSemantic=function(e){for(var t=!1,n=[],i=0,r=null,o=0,s=0,a=0,l=0,u=0;o0?n[i-1]:-1,s=0,a=0,l=0,u=0,r=null,t=!0)),o++;for(t&&this.diff_cleanupMerge(e),this.diff_cleanupSemanticLossless(e),o=1;o=d?(c>=p.length/2||c>=m.length/2)&&(e.splice(o,0,new _.Diff(W,m.substring(0,c))),e[o-1][1]=p.substring(0,p.length-c),e[o+1][1]=m.substring(c),o++):(d>=p.length/2||d>=m.length/2)&&(e.splice(o,0,new _.Diff(W,p.substring(0,d))),e[o-1][0]=ee,e[o-1][1]=m.substring(0,m.length-d),e[o+1][0]=Q,e[o+1][1]=p.substring(d),o++),o++}o++}};_.prototype.diff_cleanupSemanticLossless=function(e){function t(d,h){if(!d||!h)return 6;var g=d.charAt(d.length-1),w=h.charAt(0),y=g.match(_.nonAlphaNumericRegex_),E=w.match(_.nonAlphaNumericRegex_),O=y&&g.match(_.whitespaceRegex_),L=E&&w.match(_.whitespaceRegex_),M=O&&g.match(_.linebreakRegex_),T=L&&w.match(_.linebreakRegex_),B=M&&d.match(_.blanklineEndRegex_),I=T&&h.match(_.blanklineStartRegex_);return B||I?5:M||T?4:y&&!O&&L?3:O||L?2:y||E?1:0}for(var n=1;n=m&&(m=c,l=i,u=r,p=o)}e[n-1][1]!=l&&(l?e[n-1][1]=l:(e.splice(n-1,1),n--),e[n][1]=u,p?e[n+1][1]=p:(e.splice(n+1,1),n--))}n++}};_.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/;_.whitespaceRegex_=/\s/;_.linebreakRegex_=/[\r\n]/;_.blanklineEndRegex_=/\n\r?\n$/;_.blanklineStartRegex_=/^\r?\n\r?\n/;_.prototype.diff_cleanupEfficiency=function(e){for(var t=!1,n=[],i=0,r=null,o=0,s=!1,a=!1,l=!1,u=!1;o0?n[i-1]:-1,l=u=!1),t=!0)),o++;t&&this.diff_cleanupMerge(e)};_.prototype.diff_cleanupMerge=function(e){e.push(new _.Diff(W,""));for(var t=0,n=0,i=0,r="",o="",s;t1?(n!==0&&i!==0&&(s=this.diff_commonPrefix(o,r),s!==0&&(t-n-i>0&&e[t-n-i-1][0]==W?e[t-n-i-1][1]+=o.substring(0,s):(e.splice(0,0,new _.Diff(W,o.substring(0,s))),t++),o=o.substring(s),r=r.substring(s)),s=this.diff_commonSuffix(o,r),s!==0&&(e[t][1]=o.substring(o.length-s)+e[t][1],o=o.substring(0,o.length-s),r=r.substring(0,r.length-s))),t-=n+i,e.splice(t,n+i),r.length&&(e.splice(t,0,new _.Diff(Q,r)),t++),o.length&&(e.splice(t,0,new _.Diff(ee,o)),t++),t++):t!==0&&e[t-1][0]==W?(e[t-1][1]+=e[t][1],e.splice(t,1)):t++,i=0,n=0,r="",o="";break}e[e.length-1][1]===""&&e.pop();var a=!1;for(t=1;tt));s++)r=n,o=i;return e.length!=s&&e[s][0]===Q?o:o+(t-r)};_.prototype.diff_prettyHtml=function(e){for(var t=[],n=/&/g,i=//g,o=/\n/g,s=0;s");switch(a){case ee:t[s]=''+u+"";break;case Q:t[s]=''+u+"";break;case W:t[s]=""+u+"";break}}return t.join("")};_.prototype.diff_text1=function(e){for(var t=[],n=0;nthis.Match_MaxBits)throw new Error("Pattern too long for this browser.");var i=this.match_alphabet_(t),r=this;function o(L,M){var T=L/t.length,B=Math.abs(n-M);return r.Match_Distance?T+B/r.Match_Distance:B?1:T}var s=this.Match_Threshold,a=e.indexOf(t,n);a!=-1&&(s=Math.min(o(0,a),s),a=e.lastIndexOf(t,n+t.length),a!=-1&&(s=Math.min(o(0,a),s)));var l=1<=h;y--){var E=i[e.charAt(y-1)];if(d===0?w[y]=(w[y+1]<<1|1)&E:w[y]=(w[y+1]<<1|1)&E|((c[y+1]|c[y])<<1|1)|c[y+1],w[y]&l){var O=o(d,y-1);if(O<=s)if(s=O,a=y-1,a>n)h=Math.max(1,2*n-a);else break}}if(o(d+1,n)>s)break;c=w}return a};_.prototype.match_alphabet_=function(e){for(var t={},n=0;n"u")i=e,r=this.diff_main(i,t,!0),r.length>2&&(this.diff_cleanupSemantic(r),this.diff_cleanupEfficiency(r));else if(e&&typeof e=="object"&&typeof t>"u"&&typeof n>"u")r=e,i=this.diff_text1(r);else if(typeof e=="string"&&t&&typeof t=="object"&&typeof n>"u")i=e,r=t;else if(typeof e=="string"&&typeof t=="string"&&n&&typeof n=="object")i=e,r=n;else throw new Error("Unknown call format to patch_make.");if(r.length===0)return[];for(var o=[],s=new _.patch_obj,a=0,l=0,u=0,p=i,m=i,c=0;c=2*this.Patch_Margin&&a&&(this.patch_addContext_(s,p),o.push(s),s=new _.patch_obj,a=0,p=m,l=u);break}d!==ee&&(l+=h.length),d!==Q&&(u+=h.length)}return a&&(this.patch_addContext_(s,p),o.push(s)),o};_.prototype.patch_deepCopy=function(e){for(var t=[],n=0;nthis.Match_MaxBits?(l=this.match_main(t,a.substring(0,this.Match_MaxBits),s),l!=-1&&(u=this.match_main(t,a.substring(a.length-this.Match_MaxBits),s+a.length-this.Match_MaxBits),(u==-1||l>=u)&&(l=-1))):l=this.match_main(t,a,s),l==-1)r[o]=!1,i-=e[o].length2-e[o].length1;else{r[o]=!0,i=l-s;var p;if(u==-1?p=t.substring(l,l+a.length):p=t.substring(l,u+this.Match_MaxBits),a==p)t=t.substring(0,l)+this.diff_text2(e[o].diffs)+t.substring(l+a.length);else{var m=this.diff_main(a,p,!1);if(a.length>this.Match_MaxBits&&this.diff_levenshtein(m)/a.length>this.Patch_DeleteThreshold)r[o]=!1;else{this.diff_cleanupSemanticLossless(m);for(var c=0,d,h=0;ho[0][1].length){var s=t-o[0][1].length;o[0][1]=n.substring(o[0][1].length)+o[0][1],r.start1-=s,r.start2-=s,r.length1+=s,r.length2+=s}if(r=e[e.length-1],o=r.diffs,o.length==0||o[o.length-1][0]!=W)o.push(new _.Diff(W,n)),r.length1+=t,r.length2+=t;else if(t>o[o.length-1][1].length){var s=t-o[o.length-1][1].length;o[o.length-1][1]+=n.substring(0,s),r.length1+=s,r.length2+=s}return n};_.prototype.patch_splitMax=function(e){for(var t=this.Match_MaxBits,n=0;n2*t?(a.length1+=p.length,r+=p.length,l=!1,a.diffs.push(new _.Diff(u,p)),i.diffs.shift()):(p=p.substring(0,t-a.length1-this.Patch_Margin),a.length1+=p.length,r+=p.length,u===W?(a.length2+=p.length,o+=p.length):l=!1,a.diffs.push(new _.Diff(u,p)),p==i.diffs[0][1]?i.diffs.shift():i.diffs[0][1]=i.diffs[0][1].substring(p.length))}s=this.diff_text2(a.diffs),s=s.substring(s.length-this.Patch_Margin);var m=this.diff_text1(i.diffs).substring(0,this.Patch_Margin);m!==""&&(a.length1+=m.length,a.length2+=m.length,a.diffs.length!==0&&a.diffs[a.diffs.length-1][0]===W?a.diffs[a.diffs.length-1][1]+=m:a.diffs.push(new _.Diff(W,m))),l||e.splice(++n,0,a)}}};_.prototype.patch_toText=function(e){for(var t=[],n=0;n{(function(e,t){"use strict";typeof define=="function"&&define.amd?define(t):typeof jr=="object"&&jr.exports?jr.exports=t():e.log=t()})(El,function(){"use strict";var e=function(){},t="undefined",n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"];function r(h,g){var w=h[g];if(typeof w.bind=="function")return w.bind(h);try{return Function.prototype.bind.call(w,h)}catch{return function(){return Function.prototype.apply.apply(w,[h,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 s(h){return h==="debug"&&(h="log"),typeof console===t?!1:h==="trace"&&n?o:console[h]!==void 0?r(console,h):console.log!==void 0?r(console,"log"):e}function a(h,g){for(var w=0;w=0&&I<=y.levels.SILENT){if(E=I,P!==!1&&L(I),a.call(y,I,h),typeof console===t&&IPo});module.exports=cp(Fg);var oe=require("obsidian");function qa(e){return typeof e>"u"||e===null}function mp(e){return typeof e=="object"&&e!==null}function dp(e){return Array.isArray(e)?e:qa(e)?[]:[e]}function fp(e,t){var n,i,r,o;if(t)for(o=Object.keys(t),n=0,i=o.length;na&&(o=" ... ",t=i-a+o.length),n-i>a&&(s=" ...",n=i+a-s.length),{str:o+e.slice(t,n).replace(/\t/g,"\u2192")+s,pos:i-t+o.length}}function Ko(e,t){return ge.repeat(" ",t-e.length)+e}function Sp(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,i=[0],r=[],o,s=-1;o=n.exec(e.buffer);)r.push(o.index),i.push(o.index+o[0].length),e.position<=o.index&&s<0&&(s=i.length-2);s<0&&(s=i.length-1);var a="",l,u,p=Math.min(e.line+t.linesAfter,r.length).toString().length,m=t.maxLength-(t.indent+p+3);for(l=1;l<=t.linesBefore&&!(s-l<0);l++)u=qo(e.buffer,i[s-l],r[s-l],e.position-(i[s]-i[s-l]),m),a=ge.repeat(" ",t.indent)+Ko((e.line-l+1).toString(),p)+" | "+u.str+` `+a;for(u=qo(e.buffer,i[s],r[s],e.position,m),a+=ge.repeat(" ",t.indent)+Ko((e.line+1).toString(),p)+" | "+u.str+` `,a+=ge.repeat("-",t.indent+p+3+u.pos)+`^ `,l=1;l<=t.linesAfter&&!(s+l>=r.length);l++)u=qo(e.buffer,i[s+l],r[s+l],e.position-(i[s]-i[s+l]),m),a+=ge.repeat(" ",t.indent)+Ko((e.line+l+1).toString(),p)+" | "+u.str+` `;return a.replace(/\n$/,"")}var Tp=Sp,Op=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Ap=["scalar","sequence","mapping"];function Cp(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(i){t[String(i)]=n})}),t}function Ep(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(Op.indexOf(n)===-1)throw new He('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=Cp(t.styleAliases||null),Ap.indexOf(this.kind)===-1)throw new He('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Fe=Ep;function Ea(e,t){var n=[];return e[t].forEach(function(i){var r=n.length;n.forEach(function(o,s){o.tag===i.tag&&o.kind===i.kind&&o.multi===i.multi&&(r=s)}),n[r]=i}),n}function Lp(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,n;function i(r){r.multi?(e.multi[r.kind].push(r),e.multi.fallback.push(r)):e[r.kind][r.tag]=e.fallback[r.tag]=r}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"]}}),Zp=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Qp(e){return!(e===null||!Zp.test(e)||e[e.length-1]==="_")}function Xp(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 Jp=/^[-+]?[0-9]+e/;function ec(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(ge.isNegativeZero(e))return"-0.0";return n=e.toString(10),Jp.test(n)?n.replace("e",".e"):n}function tc(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||ge.isNegativeZero(e))}var nc=new Fe("tag:yaml.org,2002:float",{kind:"scalar",resolve:Qp,construct:Xp,predicate:tc,represent:ec,defaultStyle:"lowercase"}),ic=Fp.extend({implicit:[Pp,Yp,Gp,nc]}),rc=ic,ja=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Va=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 oc(e){return e===null?!1:ja.exec(e)!==null||Va.exec(e)!==null}function sc(e){var t,n,i,r,o,s,a,l=0,u=null,p,m,c;if(t=ja.exec(e),t===null&&(t=Va.exec(e)),t===null)throw new Error("Date resolve error");if(n=+t[1],i=+t[2]-1,r=+t[3],!t[4])return new Date(Date.UTC(n,i,r));if(o=+t[4],s=+t[5],a=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(p=+t[10],m=+(t[11]||0),u=(p*60+m)*6e4,t[9]==="-"&&(u=-u)),c=new Date(Date.UTC(n,i,r,o,s,a,l)),u&&c.setTime(c.getTime()-u),c}function ac(e){return e.toISOString()}var lc=new Fe("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:oc,construct:sc,instanceOf:Date,represent:ac});function uc(e){return e==="<<"||e===null}var pc=new Fe("tag:yaml.org,2002:merge",{kind:"scalar",resolve:uc}),Qo=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= \r`;function cc(e){if(e===null)return!1;var t,n,i=0,r=e.length,o=Qo;for(n=0;n64)){if(t<0)return!1;i+=6}return i%8===0}function mc(e){var t,n,i=e.replace(/[\r\n=]/g,""),r=i.length,o=Qo,s=0,a=[];for(t=0;t>16&255),a.push(s>>8&255),a.push(s&255)),s=s<<6|o.indexOf(i.charAt(t));return n=r%4*6,n===0?(a.push(s>>16&255),a.push(s>>8&255),a.push(s&255)):n===18?(a.push(s>>10&255),a.push(s>>2&255)):n===12&&a.push(s>>4&255),new Uint8Array(a)}function dc(e){var t="",n=0,i,r,o=e.length,s=Qo;for(i=0;i>18&63],t+=s[n>>12&63],t+=s[n>>6&63],t+=s[n&63]),n=(n<<8)+e[i];return r=o%3,r===0?(t+=s[n>>18&63],t+=s[n>>12&63],t+=s[n>>6&63],t+=s[n&63]):r===2?(t+=s[n>>10&63],t+=s[n>>4&63],t+=s[n<<2&63],t+=s[64]):r===1&&(t+=s[n>>2&63],t+=s[n<<4&63],t+=s[64],t+=s[64]),t}function fc(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var hc=new Fe("tag:yaml.org,2002:binary",{kind:"scalar",resolve:cc,construct:mc,predicate:fc,represent:dc}),gc=Object.prototype.hasOwnProperty,yc=Object.prototype.toString;function bc(e){if(e===null)return!0;var t=[],n,i,r,o,s,a=e;for(n=0,i=a.length;n>10)+55296,(e-65536&1023)+56320)}var Xa=new Array(256),Ja=new Array(256);for(qt=0;qt<256;qt++)Xa[qt]=Ba(qt)?1:0,Ja[qt]=Ba(qt);var qt;function $c(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Wa,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 el(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=Tp(n),new He(t,n)}function H(e,t){throw el(e,t)}function Er(e,t){e.onWarning&&e.onWarning.call(null,el(e,t))}var Ia={YAML:function(t,n,i){var r,o,s;t.version!==null&&H(t,"duplication of %YAML directive"),i.length!==1&&H(t,"YAML directive accepts exactly one argument"),r=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),r===null&&H(t,"ill-formed argument of the YAML directive"),o=parseInt(r[1],10),s=parseInt(r[2],10),o!==1&&H(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=s<2,s!==1&&s!==2&&Er(t,"unsupported YAML version of the document")},TAG:function(t,n,i){var r,o;i.length!==2&&H(t,"TAG directive accepts exactly two arguments"),r=i[0],o=i[1],Za.test(r)||H(t,"ill-formed tag handle (first argument) of the TAG directive"),It.call(t.tagMap,r)&&H(t,'there is a previously declared suffix for "'+r+'" tag handle'),Qa.test(o)||H(t,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch{H(t,"tag prefix is malformed: "+o)}t.tagMap[r]=o}};function Bt(e,t,n,i){var r,o,s,a;if(t1&&(e.result+=ge.repeat(` `,t-1))}function Pc(e,t,n){var i,r,o,s,a,l,u,p,m=e.kind,c=e.result,d;if(d=e.input.charCodeAt(e.position),We(d)||An(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96||(d===63||d===45)&&(r=e.input.charCodeAt(e.position+1),We(r)||n&&An(r)))return!1;for(e.kind="scalar",e.result="",o=s=e.position,a=!1;d!==0;){if(d===58){if(r=e.input.charCodeAt(e.position+1),We(r)||n&&An(r))break}else if(d===35){if(i=e.input.charCodeAt(e.position-1),We(i))break}else{if(e.position===e.lineStart&&Br(e)||n&&An(d))break;if(dt(d))if(l=e.line,u=e.lineStart,p=e.lineIndent,fe(e,!1,-1),e.lineIndent>=t){a=!0,d=e.input.charCodeAt(e.position);continue}else{e.position=s,e.line=l,e.lineStart=u,e.lineIndent=p;break}}a&&(Bt(e,o,s,!1),Jo(e,e.line-l),o=s=e.position,a=!1),Kt(d)||(s=e.position+1),d=e.input.charCodeAt(++e.position)}return Bt(e,o,s,!1),e.result?!0:(e.kind=m,e.result=c,!1)}function Nc(e,t){var n,i,r;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,i=r=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(Bt(e,i,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)i=e.position,e.position++,r=e.position;else return!0;else dt(n)?(Bt(e,i,r,!0),Jo(e,fe(e,!1,t)),i=r=e.position):e.position===e.lineStart&&Br(e)?H(e,"unexpected end of the document within a single quoted scalar"):(e.position++,r=e.position);H(e,"unexpected end of the stream within a single quoted scalar")}function Hc(e,t){var n,i,r,o,s,a;if(a=e.input.charCodeAt(e.position),a!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=i=e.position;(a=e.input.charCodeAt(e.position))!==0;){if(a===34)return Bt(e,n,e.position,!0),e.position++,!0;if(a===92){if(Bt(e,n,e.position,!0),a=e.input.charCodeAt(++e.position),dt(a))fe(e,!1,t);else if(a<256&&Xa[a])e.result+=Ja[a],e.position++;else if((s=Fc(a))>0){for(r=s,o=0;r>0;r--)a=e.input.charCodeAt(++e.position),(s=Mc(a))>=0?o=(o<<4)+s:H(e,"expected hexadecimal character");e.result+=Dc(o),e.position++}else H(e,"unknown escape sequence");n=i=e.position}else dt(a)?(Bt(e,n,i,!0),Jo(e,fe(e,!1,t)),n=i=e.position):e.position===e.lineStart&&Br(e)?H(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}H(e,"unexpected end of the stream within a double quoted scalar")}function zc(e,t){var n=!0,i,r,o,s=e.tag,a,l=e.anchor,u,p,m,c,d,h=Object.create(null),g,w,y,E;if(E=e.input.charCodeAt(e.position),E===91)p=93,d=!1,a=[];else if(E===123)p=125,d=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),E=e.input.charCodeAt(++e.position);E!==0;){if(fe(e,!0,t),E=e.input.charCodeAt(e.position),E===p)return e.position++,e.tag=s,e.anchor=l,e.kind=d?"mapping":"sequence",e.result=a,!0;n?E===44&&H(e,"expected the node content, but found ','"):H(e,"missed comma between flow collection entries"),w=g=y=null,m=c=!1,E===63&&(u=e.input.charCodeAt(e.position+1),We(u)&&(m=c=!0,e.position++,fe(e,!0,t))),i=e.line,r=e.lineStart,o=e.position,En(e,t,Ar,!1,!0),w=e.tag,g=e.result,fe(e,!0,t),E=e.input.charCodeAt(e.position),(c||e.line===i)&&E===58&&(m=!0,E=e.input.charCodeAt(++e.position),fe(e,!0,t),En(e,t,Ar,!1,!0),y=e.result),d?Cn(e,a,h,w,g,y,i,r,o):m?a.push(Cn(e,null,h,w,g,y,i,r,o)):a.push(g),fe(e,!0,t),E=e.input.charCodeAt(e.position),E===44?(n=!0,E=e.input.charCodeAt(++e.position)):n=!1}H(e,"unexpected end of the stream within a flow collection")}function Yc(e,t){var n,i,r=jo,o=!1,s=!1,a=t,l=0,u=!1,p,m;if(m=e.input.charCodeAt(e.position),m===124)i=!1;else if(m===62)i=!0;else return!1;for(e.kind="scalar",e.result="";m!==0;)if(m=e.input.charCodeAt(++e.position),m===43||m===45)jo===r?r=m===43?La:Lc:H(e,"repeat of a chomping mode identifier");else if((p=Rc(m))>=0)p===0?H(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?H(e,"repeat of an indentation width identifier"):(a=t+p-1,s=!0);else break;if(Kt(m)){do m=e.input.charCodeAt(++e.position);while(Kt(m));if(m===35)do m=e.input.charCodeAt(++e.position);while(!dt(m)&&m!==0)}for(;m!==0;){for(Xo(e),e.lineIndent=0,m=e.input.charCodeAt(e.position);(!s||e.lineIndenta&&(a=e.lineIndent),dt(m)){l++;continue}if(e.lineIndentt)&&l!==0)H(e,"bad indentation of a sequence entry");else if(e.lineIndentt)&&(w&&(s=e.line,a=e.lineStart,l=e.position),En(e,t,Cr,!0,r)&&(w?h=e.result:g=e.result),w||(Cn(e,m,c,d,h,g,s,a,l),d=h=g=null),fe(e,!0,-1),E=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&E!==0)H(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+'"'),m=0,c=e.implicitTypes.length;m"),e.result!==null&&h.kind!==e.kind&&H(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+h.kind+'", not "'+e.kind+'"'),h.resolve(e.result,e.tag)?(e.result=h.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):H(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||p}function Wc(e){var t=e.position,n,i,r,o=!1,s;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(s=e.input.charCodeAt(e.position))!==0&&(fe(e,!0,-1),s=e.input.charCodeAt(e.position),!(e.lineIndent>0||s!==37));){for(o=!0,s=e.input.charCodeAt(++e.position),n=e.position;s!==0&&!We(s);)s=e.input.charCodeAt(++e.position);for(i=e.input.slice(n,e.position),r=[],i.length<1&&H(e,"directive name must not be less than one character in length");s!==0;){for(;Kt(s);)s=e.input.charCodeAt(++e.position);if(s===35){do s=e.input.charCodeAt(++e.position);while(s!==0&&!dt(s));break}if(dt(s))break;for(n=e.position;s!==0&&!We(s);)s=e.input.charCodeAt(++e.position);r.push(e.input.slice(n,e.position))}s!==0&&Xo(e),It.call(Ia,i)?Ia[i](e,i,r):Er(e,'unknown document directive "'+i+'"')}if(fe(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,fe(e,!0,-1)):o&&H(e,"directives end mark is expected"),En(e,e.lineIndent-1,Cr,!1,!0),fe(e,!0,-1),e.checkLineBreaks&&Bc.test(e.input.slice(t,e.position))&&Er(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Br(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,fe(e,!0,-1));return}if(e.position"u"&&(n=t,t=null);var i=tl(e,n);if(typeof t!="function")return i;for(var r=0,o=i.length;r=55296&&n<=56319&&t+1=56320&&i<=57343)?(n-55296)*1024+i-56320+65536:n}function pl(e){var t=/^\n* /;return t.test(e)}var cl=1,Go=2,ml=3,dl=4,On=5;function Sm(e,t,n,i,r,o,s,a){var l,u=0,p=null,m=!1,c=!1,d=i!==-1,h=-1,g=vm(ei(e,0))&&km(ei(e,e.length-1));if(t||s)for(l=0;l=65536?l+=2:l++){if(u=ei(e,l),!ri(u))return On;g=g&&$a(u,p,a),p=u}else{for(l=0;l=65536?l+=2:l++){if(u=ei(e,l),u===ni)m=!0,d&&(c=c||l-h-1>i&&e[h+1]!==" ",h=l);else if(!ri(u))return On;g=g&&$a(u,p,a),p=u}c=c||d&&l-h-1>i&&e[h+1]!==" "}return!m&&!c?g&&!s&&!r(e)?cl:o===ii?On:Go:n>9&&pl(e)?On:s?o===ii?On:Go:c?dl:ml}function Tm(e,t,n,i,r){e.dump=function(){if(t.length===0)return e.quotingType===ii?'""':"''";if(!e.noCompatMode&&(fm.indexOf(t)!==-1||hm.test(t)))return e.quotingType===ii?'"'+t+'"':"'"+t+"'";var o=e.indent*Math.max(1,n),s=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),a=i||e.flowLevel>-1&&n>=e.flowLevel;function l(u){return xm(e,u)}switch(Sm(t,a,e.indent,s,l,e.quotingType,e.forceQuotes&&!i,r)){case cl:return t;case Go:return"'"+t.replace(/'/g,"''")+"'";case ml:return"|"+Pa(t,e.indent)+Na(Ra(t,o));case dl:return">"+Pa(t,e.indent)+Na(Ra(Om(t,s),o));case On:return'"'+Am(t)+'"';default:throw new He("impossible error: invalid scalar style")}}()}function Pa(e,t){var n=pl(e)?String(t):"",i=e[e.length-1]===` `,r=i&&(e[e.length-2]===` `||e===` `),o=r?"+":i?"":"-";return n+o+` `}function Na(e){return e[e.length-1]===` `?e.slice(0,-1):e}function Om(e,t){for(var n=/(\n+)([^\n]*)/g,i=function(){var u=e.indexOf(` `);return u=u!==-1?u:e.length,n.lastIndex=u,Ha(e.slice(0,u),t)}(),r=e[0]===` `||e[0]===" ",o,s;s=n.exec(e);){var a=s[1],l=s[2];o=l[0]===" ",i+=a+(!r&&!o&&l!==""?` `:"")+Ha(l,t),r=o}return i}function Ha(e,t){if(e===""||e[0]===" ")return e;for(var n=/ [^ ]/g,i,r=0,o,s=0,a=0,l="";i=n.exec(e);)a=i.index,a-r>t&&(o=s>r?s:a,l+=` `+e.slice(r,o),r=o+1),s=a;return l+=` `,e.length-r>t&&s>r?l+=e.slice(r,s)+` `+e.slice(s+1):l+=e.slice(r),l.slice(1)}function Am(e){for(var t="",n=0,i,r=0;r=65536?r+=2:r++)n=ei(e,r),i=Re[n],!i&&ri(n)?(t+=e[r],n>=65536&&(t+=e[r+1])):t+=i||ym(n);return t}function Cm(e,t,n){var i="",r=e.tag,o,s,a;for(o=0,s=n.length;o"u"&&vt(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=r,e.dump="["+i+"]"}function za(e,t,n,i){var r="",o=e.tag,s,a,l;for(s=0,a=n.length;s"u"&&vt(e,t+1,null,!0,!0,!1,!0))&&((!i||r!=="")&&(r+=Uo(e,t)),e.dump&&ni===e.dump.charCodeAt(0)?r+="-":r+="- ",r+=e.dump);e.tag=o,e.dump=r||"[]"}function Em(e,t,n){var i="",r=e.tag,o=Object.keys(n),s,a,l,u,p;for(s=0,a=o.length;s1024&&(p+="? "),p+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),vt(e,t,u,!1,!1)&&(p+=e.dump,i+=p));e.tag=r,e.dump="{"+i+"}"}function Lm(e,t,n,i){var r="",o=e.tag,s=Object.keys(n),a,l,u,p,m,c;if(e.sortKeys===!0)s.sort();else if(typeof e.sortKeys=="function")s.sort(e.sortKeys);else if(e.sortKeys)throw new He("sortKeys must be a boolean or a function");for(a=0,l=s.length;a1024,m&&(e.dump&&ni===e.dump.charCodeAt(0)?c+="?":c+="? "),c+=e.dump,m&&(c+=Uo(e,t)),vt(e,t+1,p,!0,m)&&(e.dump&&ni===e.dump.charCodeAt(0)?c+=":":c+=": ",c+=e.dump,r+=c));e.tag=o,e.dump=r||"{}"}function Ya(e,t,n){var i,r,o,s,a,l;for(r=n?e.explicitTypes:e.implicitTypes,o=0,s=r.length;o tag resolver accepts not "'+l+'" style');e.dump=i}return!0}return!1}function vt(e,t,n,i,r,o,s){e.tag=null,e.dump=n,Ya(e,n,!1)||Ya(e,n,!0);var a=il.call(e.dump),l=i,u;i&&(i=e.flowLevel<0||e.flowLevel>t);var p=a==="[object Object]"||a==="[object Array]",m,c;if(p&&(m=e.duplicates.indexOf(n),c=m!==-1),(e.tag!==null&&e.tag!=="?"||c||e.indent!==2&&t>0)&&(r=!1),c&&e.usedDuplicates[m])e.dump="*ref_"+m;else{if(p&&c&&!e.usedDuplicates[m]&&(e.usedDuplicates[m]=!0),a==="[object Object]")i&&Object.keys(e.dump).length!==0?(Lm(e,t,e.dump,r),c&&(e.dump="&ref_"+m+e.dump)):(Em(e,t,e.dump),c&&(e.dump="&ref_"+m+" "+e.dump));else if(a==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!s&&t>0?za(e,t-1,e.dump,r):za(e,t,e.dump,r),c&&(e.dump="&ref_"+m+e.dump)):(Cm(e,t,e.dump),c&&(e.dump="&ref_"+m+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&Tm(e,e.dump,t,o,l);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new He("unacceptable kind of an object to dump "+a)}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 _m(e,t){var n=[],i=[],r,o;for(Zo(e,n,i),r=0,o=i.length;r0){let l=s.split(` `);o=l[l.length-1]??"",o=o.trimEnd();let u=0;for(;l.length-(2+u)>=0;){let p=l[l.length-(2+u)];if(!Mt(o,p)&&(!i||!Mt("",p,!0)))break;u++}l.splice(l.length-(1+u),u),l.length>1&&(i&&l[l.length-2].match(/^> ?.*$/m)||!i&&!Mt(o,l[l.length-2])?l.splice(l.length-1,0,o):Mt("",l[l.length-2],!0)||l.splice(l.length-1,0,"")),s=l.join(` `)}let a=e.substring(n);if(a.length>0){let l=a.split(` `),u=0;for(;u+11&&(i&&l[1].match(/^> ?.*$/m)||!i&&!Mt(o,l[1])?l.splice(1,0,o):i&&!Mt("",l[1])&&l.splice(1,0,"")),a=l.join(` `)}return s+r+a}function yl(e,t=0){let n=3735928559^t,i=1103547991^t;for(let r=0,o;r>>16,2246822507)^Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),4294967296*(2097151&i)+(n>>>0)}var Wt=/^(\s*)(#+)(\s+)(.*)$/m,wl=`^XXX\\.*? (?:((?:.| )*?) )?XXX(?=\\s|$)$`,ke=/^---\n((?:(((?!---)(?:.|\n)*?)\n)?))---(?=\n|$)/,Fm=wl.replaceAll("X","`"),Rm=wl.replaceAll("X","~"),Dm=`^(( |( {4})).* )+`,jg=new RegExp(`${Fm}|${Rm}|${Dm}`,"gm"),Ir=/(!?)\[{2}([^\][\n|]+)(\|([^\][\n|]+))?\]{2}/g,oi=/(!?)\[([^[]*)\](\(.*\))/g,Ln=/(?:\s|^)#[^\s#;.,>\\s*)*",is=/((((>[ ]?)*)|([ ]{0,3}))\[.*?\][ \t]*\n)?((((>[ ]?)*)|([ ]{0,3}))\S+.*?\|.*?\n([^\n]*?\|[^\n]*?\n)*?)?(((>[ ]?)*)|([ ]{0,3}))[|\-+:.][ \-+|:.]*?\|[ \-+|:.]*(?:\n?[^\n]*?\|([^\n]*?)*(\n)?)+/g,Fr=/(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;function De(e){return e.replace(/\$/g,"$$$$")}function bl(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function vl(e){let t=e.match(Ir);if(t){for(let n of t)if(n.includes("|")){let i=n.indexOf("|"),r=n.substring(0,i+1)+n.substring(i+1,n.length-2).trim()+"]]";e=e.replace(n,r)}}return e}function kl(e){let t=e.match(is);if(t==null)return e;for(let n of t){let i=e.indexOf(n),r=i+n.trimEnd().length;if(n.trim().startsWith(">"))for(;e.charAt(i).trim()===""||e.charAt(i)===">";)i++;e=Vt(e,i,r)}return e}function Rr(e){let t=e.match(Wt);if(t&&t[4]){let n=t[4];return n=n.replaceAll(Ir,(i,r,o,s)=>s??o),n.replaceAll(oi,"$2")}return""}var os="tag",si="tags",ai=[os,si],$m="alias",ss="aliases",li=[$m,ss],ui="linter-yaml-title-alias";function ft(e){return e.match(ke)===null&&(e=`--- --- `+e),e}function Se(e,t){if(!e.match(ke))return e;let n=e.match(ke)[0],i=t(n);return e=e.replace(n,De(i)),e}function as(e){return new RegExp(`^([\\t ]*)${e}:[ \\t]*(\\S.*|(?:(?:\\n *- \\S.*)|((?:\\n *- *))*|(\\n([ \\t]+[^\\n]*))*)*)\\n`,"m")}function Te(e,t,n){let i=`${t}:${n} `,r=!1,o=e.replace(as(t),(s,a)=>(r=!0,a+i));return r||(o=`${e}${i}`),o}function Oe(e,t){let n=e.match(as(t));return n==null?null:n[2]}function Ut(e,t){return e.replace(as(t),"")}function Je(e){if(e==null)return null;let t=fl(e.replace(/\n(\t)+/g,` `));return t??{}}function Ge(e,t){switch(typeof e=="string"&&(e=[e]),t){case"single-line":return e==null||e.length===0?" []":" "+rs(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]:" "+rs(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]:" "+rs(e).replaceAll(", "," ")}}function rs(e){return e==null||e.length===0?"[]":"["+e.join(", ")+"]"}function ht(e){if(e==null||e.length===0)return null;if(e=e.trimEnd(),e.startsWith("["))return e=e.substring(1),e.endsWith("]")&&(e=e.substring(0,e.length-1)),e.length===0?null:e.split(",").map(n=>n.trim()).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 Dr(e){if(e==null)return[];let t=[],n=[];Array.isArray(e)?n=e:e.includes(",")?n=e.split(",").map(i=>i.trim()):n=e.split(" ");for(let i of n)t.push(i.trim());return t}function $r(e){return typeof e=="string"?e.split(", "):e}function ls(e){return e.length>1&&(e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"'))}function kt(e,t,n=!1){if(ls(e))return e;let i=e.includes("'"),r=e.includes('"'),o=e.includes(": ");return!i&&!r&&!o&&!n||i&&r?e:i?`"${e}"`:r?`'${e}'`:`${t}${e}${t}`}var In=require("obsidian");var Sl=require("obsidian");function ze(e,t){Sl.MarkdownRenderer.renderMarkdown(e,t,"",null);let n=t.innerHTML.trim();n.startsWith("

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

")&&(n=n.substring(0,n.length-4)),t.innerHTML=n}var Gt=class{constructor(t,n,i,r){this.name=t,this.description=n,this.defaultValue=i,this.searchInfo={name:t,description:n},r&&(this.ruleName=r)}setOption(t,n){n.ruleConfigs[this.ruleName][this.name]=t}},Bn=class extends Gt{display(n,i,r){let o=new In.Setting(n).addToggle(s=>{s.setValue(i.ruleConfigs[this.ruleName][this.name]),s.onChange(a=>{this.setOption(a,i),r.settings=i,r.saveData(r.settings)})});ze(this.name,o.nameEl),ze(this.description,o.descEl),o.settingEl.style.border="none"}},pi=class extends Gt{display(n,i,r){let o=new In.Setting(n).addText(s=>{s.setValue(i.ruleConfigs[this.ruleName][this.name]),s.onChange(a=>{this.setOption(a,i),r.settings=i,r.saveData(r.settings)})});ze(this.name,o.nameEl),ze(this.description,o.descEl),o.settingEl.style.border="none"}},Pr=class extends Gt{display(n,i,r){let o=new In.Setting(n).addTextArea(s=>{s.setValue(i.ruleConfigs[this.ruleName][this.name]),s.onChange(a=>{this.setOption(a,i),r.settings=i,r.saveData(r.settings)})});ze(this.name,o.nameEl),ze(this.description,o.descEl),o.settingEl.style.border="none"}},Nr=class extends Gt{display(n,i,r){let o=new In.Setting(n).addMomentFormat(s=>{s.setValue(i.ruleConfigs[this.ruleName][this.name]),s.setPlaceholder("dddd, MMMM Do YYYY, h:mm:ss a"),s.onChange(a=>{this.setOption(a,i),r.settings=i,r.saveData(r.settings)})});ze(this.name,o.nameEl),ze(this.description,o.descEl),o.settingEl.style.border="none"}},Hr=class{constructor(t,n){this.value=t,this.description=n}},zr=class extends Gt{constructor(n,i,r,o,s){super(n,i,r,s);this.options=o,this.searchInfo.options=o}display(n,i,r){let o=new In.Setting(n).addDropdown(s=>{for(let a of this.options)s.addOption(a.value,a.value);s.setValue(i.ruleConfigs[this.ruleName][this.name]),s.onChange(a=>{this.setOption(a,i),r.settings=i,r.saveData(r.settings)})});ze(this.name,o.nameEl),ze(this.description,o.descEl),o.settingEl.style.border="none"}};var Ft=class extends Error{constructor(t,n){super(t),this.cause=n??null,this.stack=n.stack??null,Object.setPrototypeOf(this,Ft.prototype)}};var N=(s=>(s.YAML="YAML",s.HEADING="Heading",s.FOOTNOTE="Footnote",s.CONTENT="Content",s.SPACING="Spacing",s.PASTE="Paste",s))(N||{}),Yr=class{constructor(t,n,i,r,o,s=[],a=!1){this.name=t,this.description=n,this.type=i,this.apply=r,this.examples=o,s.unshift(new Bn(this.description,"",!1));for(let l of s)l.ruleName=t;this.options=s,this.hasSpecialExecutionOrder=a}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}},qr=class{constructor(t,n,i,r={}){this.description=t,this.options=r,this.before=n,this.after=i}},Tl=Object.values(N);function Ol(e){let t=e.match(ke);if(!t)return[];let n=t[1],i=Oe(n,"disabled rules");if(i==null)return[];let r=i.includes(` `)?`disabled rules: `:"disabled rules: ";r+=i;let s=Je(r)["disabled rules"];return s?(typeof s=="string"&&(s=[s]),s.includes("all")?gt.map(a=>a.alias()):s):[]}var gt=[],Pm=gt.reduce((e,t)=>(e[t.alias()]=t,e),{});function Al(e){gt.push(e),gt.sort((t,n)=>Tl.indexOf(t.type)-Tl.indexOf(n.type)||t.name.localeCompare(n.name)),Pm[e.alias()]=e}function Kr(e,t){let n;throw e instanceof hl?(n=e.toString(),n=`error in the yaml: ${n.substring(n.indexOf(":")+1)}`):n=`unknown error: ${e.message}`,new Ft(`"${t}" encountered an ${n}`,e)}var Wn=Yo(Cl());function Nm(e){for(var t=[],n=1;ni.example),t.optionBuilders.map(i=>i.option),t.hasSpecialExecutionOrder);Ue(et,Fn).set(this.name,n),Ue(et,mi).set(t.name,t)}return Ue(et,Fn).get(this.name)}static applyIfEnabledBase(t,n,i,r){let o=t.getOptions(i);if(o[t.enabledOptionName()]){let s=Object.assign({},o,r);St(`Running ${t.name}`);try{return[t.apply(n,s),!0]}catch(a){Kr(a,t.name)}}else return[n,!1]}static getBuilderByName(t){return Ue(et,mi).get(t)}static setNoSettingControl(t,n){Ue(et,Rt).has(t)||Ue(et,Rt).set(t,[]),Ue(et,Rt).get(t).push(n)}static hasSettingControl(t,n){return!Ue(et,Rt).has(t)||!Ue(et,Rt).get(t).includes(n)}},st=et;Fn=new WeakMap,mi=new WeakMap,Rt=new WeakMap,Tn(st,Fn,new Map),Tn(st,mi,new Map),Tn(st,Rt,new Map);var k=class extends st{static register(t){let n=t.getRule();Al(n)}safeApply(t,n){return this.apply(t,this.buildRuleOptions(n))}buildRuleOptions(t){t=t??{};let n=new this.OptionsClass,i=Object.assign(n,t);for(let r of this.optionBuilders)r.setRuleOption(i,t);return i}get hasSpecialExecutionOrder(){return!1}static applyIfEnabled(t,n,i,r){let o=this.getRule();return i.includes(o.alias())?(St(o.alias()+" is disabled"),[t,!1]):st.applyIfEnabledBase(o,t,n,r)}static getRuleOptions(t){let n=st.getRule.bind(this)(),i=new this,r=n.getOptions(t);return i.buildRuleOptions(r)}static noSettingControl(){return(t,n)=>{let i=t.constructor.name;st.setNoSettingControl(i,n)}}},ps,v=class{constructor(t){Tn(this,ps,void 0);this.example=new qr(t.description,t.before,t.after,t.options)}};ps=new WeakMap;var Rn,Dt=class{constructor(t){Tn(this,Rn,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 Ue(this,Rn)||Ca(this,Rn,this.buildOption()),Ue(this,Rn)}setRuleOption(t,n){let i=n[this.name];i!==void 0&&(t[this.optionsKey]=i)}};Rn=new WeakMap;var te=class extends Dt{buildOption(){return new Bn(this.name,this.description,this.defaultValue)}},Ur=class extends Dt{buildOption(){return new pi(this.name,this.description,this.defaultValue)}},ye=class extends Dt{constructor(n){super(n);this.records=n.records.map(i=>new Hr(i.value,i.description))}buildOption(){return new zr(this.name,this.description,this.defaultValue,this.records)}},Ae=class extends Dt{constructor(n){super(n);this.separator=n.separator??` `,this.splitter=n.splitter??/\n/}buildOption(){return new Pr(this.name,this.description,this.defaultValue.join(this.separator))}setRuleOption(n,i){if(i[this.name]!==void 0){let r=i[this.name].split(this.splitter).filter(function(o){return o!=""});n[this.optionsKey]=r}}},Zt=class extends Dt{buildOption(){return new pi(this.name,this.description,this.defaultValue)}},Gr=class extends Dt{buildOption(){return new Nr(this.name,this.description,this.defaultValue)}};var Zr=class{};A([k.noSettingControl()],Zr.prototype,"lineContent",2);var Qt=class extends k{get OptionsClass(){return Zr}get name(){return"Add Blockquote Indentation on Paste"}get description(){return"Adds blockquotes to all but the first line, when the cursor is in a blockquote/callout line during pasting"}get type(){return"Paste"}apply(t,n){let i=/^(\s*)((> ?)+) .*/,r=n.lineContent.match(i);if(!r)return t;let o=r[1]??"",s=r[2]??"";return t.trim().replace(/\n/gm,` ${o}${s} `)}get exampleBuilders(){return[new v({description:"Line being pasted into regular text does not get blockquotified with current line being `Part 1 of the sentence`",before:f` was much less likely to succeed, but they tried it anyway. Part 2 was much more interesting. `,after:f` was much less likely to succeed, but they tried it anyway. Part 2 was much more interesting. `,options:{lineContent:"Part 1 of the sentence"}}),new v({description:"Line being pasted into a blockquote gets blockquotified with current line being `> > `",before:f` ${""} This content is being added to a blockquote Note that the second line is indented and the surrounding blank lines were trimmed ${""} `,after:f` This content is being added to a blockquote > > Note that the second line is indented and the surrounding blank lines were trimmed `,options:{lineContent:"> > "}})]}get optionBuilders(){return[]}};Qt=A([k.register],Qt);var cs=function(e){if(e==null)return jm;if(typeof e=="string")return Km(e);if(typeof e=="object")return Array.isArray(e)?Ym(e):qm(e);if(typeof e=="function")return Qr(e);throw new Error("Expected function, string, or object as test")};function Ym(e){let t=[],n=-1;for(;++n":""))+")"})),c;function c(){let d=[],h,g,w;if((!t||r(a,l,u[u.length-1]||null))&&(d=Um(n(a,u)),d[0]===Bl))return d;if(a.children&&d[0]!==Wm)for(g=(i?a.children.length:-1)+o,w=u.concat(a);g>-1&&gr?0:r+t:t=t>r?r:t,n=n>0?n:0,i.length<1e4)s=Array.from(i),s.unshift(t,n),[].splice.apply(e,s);else for(n&&[].splice.apply(e,[t,n]);o0?(Be(e,e.length,0,t),e):t}var Fl=/[!-/:-@[-`{-~\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/;var Ze=$t(/[A-Za-z]/),di=$t(/\d/),Rl=$t(/[\dA-Fa-f]/),qe=$t(/[\dA-Za-z]/),Dl=$t(/[!-/:-@[-`{-~]/),ms=$t(/[#-'*+\--9=?A-Z^-~]/);function fi(e){return e!==null&&(e<32||e===127)}function re(e){return e!==null&&(e<0||e===32)}function D(e){return e!==null&&e<-2}function U(e){return e===-2||e===-1||e===32}var $l=$t(/\s/),Pl=$t(Fl);function $t(e){return t;function t(n){return n!==null&&e.test(String.fromCharCode(n))}}function ds(e){if(e===null||re(e)||$l(e))return 1;if(Pl(e))return 2}function Dn(e,t,n){let i=[],r=-1;for(;++r1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let m=Object.assign({},e[i][1].end),c=Object.assign({},e[n][1].start);Nl(m,-l),Nl(c,l),s={type:l>1?"strongSequence":"emphasisSequence",start:m,end:Object.assign({},e[i][1].end)},a={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:c},o={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[i][1].end),end:Object.assign({},e[n][1].start)},r={type:l>1?"strong":"emphasis",start:Object.assign({},s.start),end:Object.assign({},a.end)},e[i][1].end=Object.assign({},s.start),e[n][1].start=Object.assign({},a.end),u=[],e[i][1].end.offset-e[i][1].start.offset&&(u=Ye(u,[["enter",e[i][1],t],["exit",e[i][1],t]])),u=Ye(u,[["enter",r,t],["enter",s,t],["exit",s,t],["enter",o,t]]),u=Ye(u,Dn(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),u=Ye(u,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",r,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,u=Ye(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Be(e,i-1,n-i+3,u),n=i+u.length-p-2;break}}for(n=-1;++n=4?s(u):n(u)}function s(u){return u===null?l(u):D(u)?e.attempt(od,s,l)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||D(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),a)}function l(u){return e.exit("codeIndented"),t(u)}}function ad(e,t,n){let i=this;return r;function r(s){return i.parser.lazy[i.now().line]?n(s):D(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),r):Y(e,o,"linePrefix",4+1)(s)}function o(s){let a=i.events[i.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):D(s)?r(s):n(s)}}var hs={name:"codeText",tokenize:pd,resolve:ld,previous:ud};function ld(e){let t=e.length-4,n=3,i,r;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i=4?t(s):e.interrupt(i.parser.constructs.flow,n,t)(s)}}function io(e,t,n,i,r,o,s,a,l){let u=l||Number.POSITIVE_INFINITY,p=0;return m;function m(y){return y===60?(e.enter(i),e.enter(r),e.enter(o),e.consume(y),e.exit(o),c):y===null||y===41||fi(y)?n(y):(e.enter(i),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),g(y))}function c(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(r),e.exit(i),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),d(y))}function d(y){return y===62?(e.exit("chunkString"),e.exit(a),c(y)):y===null||y===60||D(y)?n(y):(e.consume(y),y===92?h:d)}function h(y){return y===60||y===62||y===92?(e.consume(y),d):d(y)}function g(y){return y===40?++p>u?n(y):(e.consume(y),g):y===41?p--?(e.consume(y),g):(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(i),t(y)):y===null||re(y)?p?n(y):(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(i),t(y)):fi(y)?n(y):(e.consume(y),y===92?w:g)}function w(y){return y===40||y===41||y===92?(e.consume(y),g):g(y)}}function ro(e,t,n,i,r,o){let s=this,a=0,l;return u;function u(d){return e.enter(i),e.enter(r),e.consume(d),e.exit(r),e.enter(o),p}function p(d){return d===null||d===91||d===93&&!l||d===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs||a>999?n(d):d===93?(e.exit(o),e.enter(r),e.consume(d),e.exit(r),e.exit(i),t):D(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),m(d))}function m(d){return d===null||d===91||d===93||D(d)||a++>999?(e.exit("chunkString"),p(d)):(e.consume(d),l=l||!U(d),d===92?c:m)}function c(d){return d===91||d===92||d===93?(e.consume(d),a++,m):m(d)}}function oo(e,t,n,i,r,o){let s;return a;function a(c){return e.enter(i),e.enter(r),e.consume(c),e.exit(r),s=c===40?41:c,l}function l(c){return c===s?(e.enter(r),e.consume(c),e.exit(r),e.exit(i),t):(e.enter(o),u(c))}function u(c){return c===s?(e.exit(o),l(s)):c===null?n(c):D(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),Y(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(c))}function p(c){return c===s||c===null||D(c)?(e.exit("chunkString"),u(c)):(e.consume(c),c===92?m:p)}function m(c){return c===s||c===92?(e.consume(c),p):p(c)}}function Xt(e,t){let n;return i;function i(r){return D(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),n=!0,i):U(r)?Y(e,i,n?"linePrefix":"lineSuffix")(r):t(r)}}function $e(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var ys={name:"definition",tokenize:yd},gd={tokenize:bd,partial:!0};function yd(e,t,n){let i=this,r;return o;function o(l){return e.enter("definition"),ro.call(i,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(l)}function s(l){return r=$e(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),l===58?(e.enter("definitionMarker"),e.consume(l),e.exit("definitionMarker"),Xt(e,io(e,e.attempt(gd,Y(e,a,"whitespace"),Y(e,a,"whitespace")),n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString"))):n(l)}function a(l){return l===null||D(l)?(e.exit("definition"),i.parser.defined.includes(r)||i.parser.defined.push(r),t(l)):n(l)}}function bd(e,t,n){return i;function i(s){return re(s)?Xt(e,r)(s):n(s)}function r(s){return s===34||s===39||s===40?oo(e,Y(e,o,"whitespace"),n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s):n(s)}function o(s){return s===null||D(s)?t(s):n(s)}}var bs={name:"hardBreakEscape",tokenize:wd};function wd(e,t,n){return i;function i(o){return e.enter("hardBreakEscape"),e.enter("escapeMarker"),e.consume(o),r}function r(o){return D(o)?(e.exit("escapeMarker"),e.exit("hardBreakEscape"),t(o)):n(o)}}var ws={name:"headingAtx",tokenize:vd,resolve:xd};function xd(e,t){let n=e.length-2,i=3,r,o;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(r={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},o={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},Be(e,i,n-i+1,[["enter",r,t],["enter",o,t],["exit",o,t],["exit",r,t]])),e}function vd(e,t,n){let i=this,r=0;return o;function o(p){return e.enter("atxHeading"),e.enter("atxHeadingSequence"),s(p)}function s(p){return p===35&&r++<6?(e.consume(p),s):p===null||re(p)?(e.exit("atxHeadingSequence"),i.interrupt?t(p):a(p)):n(p)}function a(p){return p===35?(e.enter("atxHeadingSequence"),l(p)):p===null||D(p)?(e.exit("atxHeading"),t(p)):U(p)?Y(e,a,"whitespace")(p):(e.enter("atxHeadingText"),u(p))}function l(p){return p===35?(e.consume(p),l):(e.exit("atxHeadingSequence"),a(p))}function u(p){return p===null||p===35||re(p)?(e.exit("atxHeadingText"),a(p)):(e.consume(p),u)}}var zl=["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","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],xs=["pre","script","style","textarea"];var vs={name:"htmlFlow",tokenize:Td,resolveTo:Sd,concrete:!0},kd={tokenize:Od,partial:!0};function Sd(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 Td(e,t,n){let i=this,r,o,s,a,l;return u;function u(b){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(b),p}function p(b){return b===33?(e.consume(b),m):b===47?(e.consume(b),h):b===63?(e.consume(b),r=3,i.interrupt?t:le):Ze(b)?(e.consume(b),s=String.fromCharCode(b),o=!0,g):n(b)}function m(b){return b===45?(e.consume(b),r=2,c):b===91?(e.consume(b),r=5,s="CDATA[",a=0,d):Ze(b)?(e.consume(b),r=4,i.interrupt?t:le):n(b)}function c(b){return b===45?(e.consume(b),i.interrupt?t:le):n(b)}function d(b){return b===s.charCodeAt(a++)?(e.consume(b),a===s.length?i.interrupt?t:z:d):n(b)}function h(b){return Ze(b)?(e.consume(b),s=String.fromCharCode(b),g):n(b)}function g(b){return b===null||b===47||b===62||re(b)?b!==47&&o&&xs.includes(s.toLowerCase())?(r=1,i.interrupt?t(b):z(b)):zl.includes(s.toLowerCase())?(r=6,b===47?(e.consume(b),w):i.interrupt?t(b):z(b)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(b):o?E(b):y(b)):b===45||qe(b)?(e.consume(b),s+=String.fromCharCode(b),g):n(b)}function w(b){return b===62?(e.consume(b),i.interrupt?t:z):n(b)}function y(b){return U(b)?(e.consume(b),y):P(b)}function E(b){return b===47?(e.consume(b),P):b===58||b===95||Ze(b)?(e.consume(b),O):U(b)?(e.consume(b),E):P(b)}function O(b){return b===45||b===46||b===58||b===95||qe(b)?(e.consume(b),O):L(b)}function L(b){return b===61?(e.consume(b),M):U(b)?(e.consume(b),L):E(b)}function M(b){return b===null||b===60||b===61||b===62||b===96?n(b):b===34||b===39?(e.consume(b),l=b,T):U(b)?(e.consume(b),M):(l=null,B(b))}function T(b){return b===null||D(b)?n(b):b===l?(e.consume(b),I):(e.consume(b),T)}function B(b){return b===null||b===34||b===39||b===60||b===61||b===62||b===96||re(b)?L(b):(e.consume(b),B)}function I(b){return b===47||b===62||U(b)?E(b):n(b)}function P(b){return b===62?(e.consume(b),K):n(b)}function K(b){return U(b)?(e.consume(b),K):b===null||D(b)?z(b):n(b)}function z(b){return b===45&&r===2?(e.consume(b),X):b===60&&r===1?(e.consume(b),G):b===62&&r===4?(e.consume(b),ne):b===63&&r===3?(e.consume(b),le):b===93&&r===5?(e.consume(b),ae):D(b)&&(r===6||r===7)?e.check(kd,ne,j)(b):b===null||D(b)?j(b):(e.consume(b),z)}function j(b){return e.exit("htmlFlowData"),F(b)}function F(b){return b===null?x(b):D(b)?e.attempt({tokenize:V,partial:!0},F,x)(b):(e.enter("htmlFlowData"),z(b))}function V(b,ct,je){return Ne;function Ne(Ve){return b.enter("lineEnding"),b.consume(Ve),b.exit("lineEnding"),rt}function rt(Ve){return i.parser.lazy[i.now().line]?je(Ve):ct(Ve)}}function X(b){return b===45?(e.consume(b),le):z(b)}function G(b){return b===47?(e.consume(b),s="",se):z(b)}function se(b){return b===62&&xs.includes(s.toLowerCase())?(e.consume(b),ne):Ze(b)&&s.length<8?(e.consume(b),s+=String.fromCharCode(b),se):z(b)}function ae(b){return b===93?(e.consume(b),le):z(b)}function le(b){return b===62?(e.consume(b),ne):b===45&&r===2?(e.consume(b),le):z(b)}function ne(b){return b===null||D(b)?(e.exit("htmlFlowData"),x(b)):(e.consume(b),ne)}function x(b){return e.exit("htmlFlow"),t(b)}}function Od(e,t,n){return i;function i(r){return e.exit("htmlFlowData"),e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),e.attempt(yt,t,n)}}var ks={name:"htmlText",tokenize:Ad};function Ad(e,t,n){let i=this,r,o,s,a;return l;function l(x){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(x),u}function u(x){return x===33?(e.consume(x),p):x===47?(e.consume(x),B):x===63?(e.consume(x),M):Ze(x)?(e.consume(x),K):n(x)}function p(x){return x===45?(e.consume(x),m):x===91?(e.consume(x),o="CDATA[",s=0,w):Ze(x)?(e.consume(x),L):n(x)}function m(x){return x===45?(e.consume(x),c):n(x)}function c(x){return x===null||x===62?n(x):x===45?(e.consume(x),d):h(x)}function d(x){return x===null||x===62?n(x):h(x)}function h(x){return x===null?n(x):x===45?(e.consume(x),g):D(x)?(a=h,ae(x)):(e.consume(x),h)}function g(x){return x===45?(e.consume(x),ne):h(x)}function w(x){return x===o.charCodeAt(s++)?(e.consume(x),s===o.length?y:w):n(x)}function y(x){return x===null?n(x):x===93?(e.consume(x),E):D(x)?(a=y,ae(x)):(e.consume(x),y)}function E(x){return x===93?(e.consume(x),O):y(x)}function O(x){return x===62?ne(x):x===93?(e.consume(x),O):y(x)}function L(x){return x===null||x===62?ne(x):D(x)?(a=L,ae(x)):(e.consume(x),L)}function M(x){return x===null?n(x):x===63?(e.consume(x),T):D(x)?(a=M,ae(x)):(e.consume(x),M)}function T(x){return x===62?ne(x):M(x)}function B(x){return Ze(x)?(e.consume(x),I):n(x)}function I(x){return x===45||qe(x)?(e.consume(x),I):P(x)}function P(x){return D(x)?(a=P,ae(x)):U(x)?(e.consume(x),P):ne(x)}function K(x){return x===45||qe(x)?(e.consume(x),K):x===47||x===62||re(x)?z(x):n(x)}function z(x){return x===47?(e.consume(x),ne):x===58||x===95||Ze(x)?(e.consume(x),j):D(x)?(a=z,ae(x)):U(x)?(e.consume(x),z):ne(x)}function j(x){return x===45||x===46||x===58||x===95||qe(x)?(e.consume(x),j):F(x)}function F(x){return x===61?(e.consume(x),V):D(x)?(a=F,ae(x)):U(x)?(e.consume(x),F):z(x)}function V(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(e.consume(x),r=x,X):D(x)?(a=V,ae(x)):U(x)?(e.consume(x),V):(e.consume(x),r=void 0,se)}function X(x){return x===r?(e.consume(x),G):x===null?n(x):D(x)?(a=X,ae(x)):(e.consume(x),X)}function G(x){return x===62||x===47||re(x)?z(x):n(x)}function se(x){return x===null||x===34||x===39||x===60||x===61||x===96?n(x):x===62||re(x)?z(x):(e.consume(x),se)}function ae(x){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),Y(e,le,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function le(x){return e.enter("htmlTextData"),a(x)}function ne(x){return x===62?(e.consume(x),e.exit("htmlTextData"),e.exit("htmlText"),t):n(x)}}var Jt={name:"labelEnd",tokenize:Id,resolveTo:Bd,resolveAll:_d},Cd={tokenize:Md},Ed={tokenize:Fd},Ld={tokenize:Rd};function _d(e){let t=-1,n;for(;++t999?n(c):c===93?s?(e.exit("chunkString"),d=e.exit("gfmFootnoteCallString"),r.includes($e(i.sliceSerialize(d)))?m(c):n(c)):n(c):(e.consume(c),re(c)||(s=!0),c===92?p:u)}function p(c){return c===91||c===92||c===93?(e.consume(c),o++,u):u(c)}function m(c){return e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t}}function Jd(e,t,n){let i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]),o,s=0,a;return l;function l(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),p):n(g)}function p(g){let w;return g===null||g===91||s>999?n(g):g===93?a?(w=e.exit("gfmFootnoteDefinitionLabelString"),o=$e(i.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d):n(g):D(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),s++,p):(e.enter("chunkString").contentType="string",m(g))}function m(g){return g===null||D(g)||g===91||g===93||s>999?(e.exit("chunkString"),p(g)):(re(g)||(a=!0),s++,e.consume(g),g===92?c:m)}function c(g){return g===91||g===92||g===93?(e.consume(g),s++,m):m(g)}function d(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),Y(e,h,"gfmFootnoteDefinitionWhitespace")):n(g)}function h(g){return r.includes(o)||r.push(o),t(g)}}function ef(e,t,n){return e.check(yt,t,e.attempt(Gd,t,n))}function tf(e){e.exit("gfmFootnoteDefinition")}function nf(e,t,n){let i=this;return Y(e,r,"gfmFootnoteDefinitionIndent",4+1);function r(o){let s=i.events[i.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}var rf={tokenize:of},As={text:{[91]:rf}};function of(e,t,n){let i=this;return r;function r(a){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(a):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(a),e.exit("taskListCheckMarker"),o)}function o(a){return re(a)?(e.enter("taskListCheckValueUnchecked"),e.consume(a),e.exit("taskListCheckValueUnchecked"),s):a===88||a===120?(e.enter("taskListCheckValueChecked"),e.consume(a),e.exit("taskListCheckValueChecked"),s):n(a)}function s(a){return a===93?(e.enter("taskListCheckMarker"),e.consume(a),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),e.check({tokenize:sf},t,n)):n(a)}}function sf(e,t,n){let i=this;return Y(e,r,"whitespace");function r(o){let s=i.events[i.events.length-1];return(s&&s[1].type==="whitespace"||D(o))&&o!==null?t(o):n(o)}}var Yl={}.hasOwnProperty;function ao(e){let t={},n=-1;for(;++ns))return;let B=t.events.length,I=B,P,K;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){if(P){K=t.events[I][1].end;break}P=!0}for(y(i),T=B;TO;){let M=n[L];t.containerState=M[1],M[0].exit.call(t,e)}n.length=O}function E(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}function gf(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)}var Xl={tokenize:yf};function yf(e){let t=this,n=e.attempt(yt,i,e.attempt(this.parser.constructs.flowInitial,r,Y(e,e.attempt(this.parser.constructs.flow,r,e.attempt(gs,r)),"linePrefix")));return n;function i(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}var Jl={resolveAll:iu()},eu=nu("string"),tu=nu("text");function nu(e){return{tokenize:t,resolveAll:iu(e==="text"?bf:void 0)};function t(n){let i=this,r=this.parser.constructs[e],o=n.attempt(r,s,a);return s;function s(p){return u(p)?o(p):a(p)}function a(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),l}function l(p){return u(p)?(n.exit("data"),o(p)):(n.consume(p),l)}function u(p){if(p===null)return!0;let m=r[p],c=-1;if(m)for(;++c-1&&(s[0]=s[0].slice(i)),o>0&&s.push(e[r].slice(0,o))),s}function xf(e,t){let n=-1,i=[],r;for(;++nEf,contentInitial:()=>kf,disable:()=>Lf,document:()=>vf,flow:()=>Tf,flowInitial:()=>Sf,insideSpan:()=>Cf,string:()=>Of,text:()=>Af});var vf={[42]:Pe,[43]:Pe,[45]:Pe,[48]:Pe,[49]:Pe,[50]:Pe,[51]:Pe,[52]:Pe,[53]:Pe,[54]:Pe,[55]:Pe,[56]:Pe,[57]:Pe,[62]:Xr},kf={[91]:ys},Sf={[-2]:gi,[-1]:gi,[32]:gi},Tf={[35]:ws,[42]:en,[45]:[so,en],[60]:vs,[61]:so,[95]:en,[96]:to,[126]:to},Of={[38]:eo,[92]:Jr},Af={[-5]:yi,[-4]:yi,[-3]:yi,[33]:Ss,[38]:eo,[42]:hi,[60]:[fs,ks],[91]:Ts,[92]:[bs,Jr],[93]:Jt,[95]:hi,[96]:hs},Cf={null:[hi,Jl]},Ef={null:[42,95]},Lf={null:[]};function ou(e={}){let t=ao([Es].concat(e.extensions||[])),n={defined:[],lazy:{},constructs:t,content:i(Gl),document:i(Ql),flow:i(Xl),string:i(eu),text:i(tu)};return n;function i(r){return o;function o(s){return ru(n,r,s)}}}var su=/[\0\t\n\r]/g;function au(){let e=1,t="",n=!0,i;return r;function r(o,s,a){let l=[],u,p,m,c,d;for(o=t+o.toString(s),m=0,t="",n&&(o.charCodeAt(0)===65279&&m++,n=void 0);m13&&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 _f=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function uu(e){return e.replace(_f,Bf)}function Bf(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let r=n.charCodeAt(1),o=r===120||r===88;return lo(n.slice(o?2:1),o?16:10)}return $n(n)||e}function bi(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?pu(e.position):"start"in e||"end"in e?pu(e):"line"in e||"column"in e?Ls(e):""}function Ls(e){return cu(e&&e.line)+":"+cu(e&&e.column)}function pu(e){return Ls(e&&e.start)+"-"+Ls(e&&e.end)}function cu(e){return e&&typeof e=="number"?e:1}var _s={}.hasOwnProperty,Bs=function(e,t,n){return typeof t!="string"&&(n=t,t=void 0),If(n)(lu(ou(n).document().write(au()(e,t,!0))))};function If(e={}){let t=du({transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(Yt),autolinkProtocol:j,autolinkEmail:j,atxHeading:l(Un),blockQuote:l(_t),characterEscape:j,characterReference:j,codeFenced:l(zt),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:l(zt,u),codeText:l(No,u),codeTextData:j,data:j,codeFlowValue:j,definition:l(Ho),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:l(wr),hardBreakEscape:l(xr),hardBreakTrailing:l(xr),htmlFlow:l(vr,u),htmlFlowData:j,htmlText:l(vr,u),htmlTextData:j,image:l(wt),label:u,link:l(Yt),listItem:l(kr),listItemValue:g,listOrdered:l(Gn,h),listUnordered:l(Gn),paragraph:l(Zn),reference:rt,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:l(Un),strong:l(Sr),thematicBreak:l(Or)},exit:{atxHeading:m(),atxHeadingSequence:I,autolink:m(),autolinkEmail:mt,autolinkProtocol:ot,blockQuote:m(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:J,characterReferenceMarkerNumeric:J,characterReferenceValue:bt,codeFenced:m(O),codeFencedFence:E,codeFencedFenceInfo:w,codeFencedFenceMeta:y,codeFlowValue:F,codeIndented:m(L),codeText:m(ae),codeTextData:F,data:F,definition:m(),definitionDestinationString:B,definitionLabelString:M,definitionTitleString:T,emphasis:m(),hardBreakEscape:m(X),hardBreakTrailing:m(X),htmlFlow:m(G),htmlFlowData:F,htmlText:m(se),htmlTextData:F,image:m(ne),label:b,labelText:x,lineEnding:V,link:m(le),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:Ve,resourceDestinationString:ct,resourceTitleString:je,resource:Ne,setextHeading:m(z),setextHeadingLineSequence:K,setextHeadingText:P,strong:m(),thematicBreak:m()}},e.mdastExtensions||[]),n={};return i;function i(C){let R={type:"root",children:[]},q=[R],Z=[],Xe=[],Qn={stack:q,tokenStack:Z,config:t,enter:p,exit:c,buffer:u,resume:d,setData:o,getData:s},ie=-1;for(;++ie0){let Le=Z[Z.length-1];(Le[1]||mu).call(Qn,void 0,Le[0])}for(R.position={start:a(C.length>0?C[0][1].start:{line:1,column:1,offset:0}),end:a(C.length>0?C[C.length-2][1].end:{line:1,column:1,offset:0})},ie=-1;++ie0))throw new TypeError("`maxSize` must be a number greater than 0");if(typeof t.maxAge=="number"&&t.maxAge===0)throw new TypeError("`maxAge` must be a number greater than 0");this.maxSize=t.maxSize,this.maxAge=t.maxAge||Number.POSITIVE_INFINITY,this.onEviction=t.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_emitEvictions(t){if(typeof this.onEviction=="function")for(let[n,i]of t)this.onEviction(n,i.value)}_deleteIfExpired(t,n){return typeof n.expiry=="number"&&n.expiry<=Date.now()?(typeof this.onEviction=="function"&&this.onEviction(t,n.value),this.delete(t)):!1}_getOrDeleteIfExpired(t,n){if(this._deleteIfExpired(t,n)===!1)return n.value}_getItemValue(t,n){return n.expiry?this._getOrDeleteIfExpired(t,n):n.value}_peek(t,n){let i=n.get(t);return this._getItemValue(t,i)}_set(t,n){this.cache.set(t,n),this._size++,this._size>=this.maxSize&&(this._size=0,this._emitEvictions(this.oldCache),this.oldCache=this.cache,this.cache=new Map)}_moveToRecent(t,n){this.oldCache.delete(t),this._set(t,n)}*_entriesAscending(){for(let t of this.oldCache){let[n,i]=t;this.cache.has(n)||this._deleteIfExpired(n,i)===!1&&(yield t)}for(let t of this.cache){let[n,i]=t;this._deleteIfExpired(n,i)===!1&&(yield t)}}get(t){if(this.cache.has(t)){let n=this.cache.get(t);return this._getItemValue(t,n)}if(this.oldCache.has(t)){let n=this.oldCache.get(t);if(this._deleteIfExpired(t,n)===!1)return this._moveToRecent(t,n),n.value}}set(t,n,{maxAge:i=this.maxAge}={}){let r=typeof i=="number"&&i!==Number.POSITIVE_INFINITY?Date.now()+i:void 0;this.cache.has(t)?this.cache.set(t,{value:n,expiry:r}):this._set(t,{value:n,expiry:r})}has(t){return this.cache.has(t)?!this._deleteIfExpired(t,this.cache.get(t)):this.oldCache.has(t)?!this._deleteIfExpired(t,this.oldCache.get(t)):!1}peek(t){if(this.cache.has(t))return this._peek(t,this.cache);if(this.oldCache.has(t))return this._peek(t,this.oldCache)}delete(t){let n=this.cache.delete(t);return n&&this._size--,this.oldCache.delete(t)||n}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}resize(t){if(!(t&&t>0))throw new TypeError("`maxSize` must be a number greater than 0");let n=[...this._entriesAscending()],i=n.length-t;i<0?(this.cache=new Map(n),this.oldCache=new Map,this._size=n.length):(i>0&&this._emitEvictions(n.slice(0,i)),this.oldCache=new Map(n.slice(i)),this.cache=new Map,this._size=0),this.maxSize=t}*keys(){for(let[t]of this)yield t}*values(){for(let[,t]of this)yield t}*[Symbol.iterator](){for(let t of this.cache){let[n,i]=t;this._deleteIfExpired(n,i)===!1&&(yield[n,i.value])}for(let t of this.oldCache){let[n,i]=t;this.cache.has(n)||this._deleteIfExpired(n,i)===!1&&(yield[n,i.value])}}*entriesDescending(){let t=[...this.cache];for(let n=t.length-1;n>=0;--n){let i=t[n],[r,o]=i;this._deleteIfExpired(r,o)===!1&&(yield[r,o.value])}t=[...this.oldCache];for(let n=t.length-1;n>=0;--n){let i=t[n],[r,o]=i;this.cache.has(r)||this._deleteIfExpired(r,o)===!1&&(yield[r,o.value])}}*entriesAscending(){for(let[t,n]of this._entriesAscending())yield[t,n.value]}get size(){if(!this._size)return this.oldCache.size;let t=0;for(let n of this.oldCache.keys())this.cache.has(n)||t++;return Math.min(this._size+t,this.maxSize)}entries(){return this.entriesAscending()}forEach(t,n=this){for(let[i,r]of this.entriesAscending())t.call(n,r,i,this)}get[Symbol.toStringTag](){return JSON.stringify([...this.entriesAscending()])}};var Is=new wi({maxSize:200});function Rf(e){let t=yl(e);if(Is.has(t))return Is.get(t);let n=Bs(e,{extensions:[ao([Os(),As]),Cs()],mdastExtensions:[[fu(),gu],jl()]});return Is.set(t,n),n}function be(e,t){let n=Rf(t),i=[];return Ml(n,e,r=>{i.push(r.position)}),i.sort((r,o)=>o.start.offset-r.start.offset),i}function yu(e){let t=be("footnoteDefinition",e),n=[],i=new Set,r=new Map,o=function(s,a){let l=s.match(/\[\^.*?\]/)[0],u;do u=e.lastIndexOf(l,a),a=u;while(i.has(u)&&u!==-1);if(u===-1)throw new Error(`Footnote '${s}' 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 i.add(u),u};for(let s of t){let a=e.substring(s.start.offset,s.end.offset);n.push(a),s.end.offsetr.get(s)-r.get(a)),n.length>0&&(e=e.trimEnd()+` `);for(let s of n)e+=` `+s;return e}function uo(e,t,n){let i=be(n,e);if(i.length===0)return e;let r="";if(t==="underscore")r="_";else if(t==="asterisk")r="*";else{let o=i[i.length-1];r=e.substring(o.start.offset,o.start.offset+1)}n==="strong"&&(r+=r);for(let o of i){let s=r+e.substring(o.start.offset+r.length,o.end.offset-r.length)+r;e=ve(e,o.start.offset,o.end.offset,s)}return e}function bu(e){let t=be("paragraph",e);if(t.length===0)return e;for(let n of t){let i=e.substring(n.start.offset,n.end.offset).split(` `),r=i.length-1;if(!(r<1)){for(let o=0;o")||s.endsWith("
")||(i[o]=s+" ")}e=ve(e,n.start.offset,n.end.offset,i.join(` `))}}return e}function wu(e){let t=e.endsWith(` `),n=be("paragraph",e);if(n.length===0)return e;for(let i of n){let r=i.start.offset;for(r>0&&r--;r>=0&&e.charAt(r)!=` `;)r--;r++;let o=e.substring(r,i.end.offset).split(` `),s=o[0].trimStart();if(s.startsWith("> ")||s.startsWith("> ")||s.startsWith("- ")||s.startsWith("- ")||s.match(/^[0-9]+\.( |\t)+/))continue;let a=o.length,l=[],u=!1;for(let h=0;h")||g.endsWith("
")||g.endsWith(" ")}for(;r>0&&e.charAt(r-1)==` `;)r--;let p=e.length,m=i.end.offset;for(m?)*(\*|-|\+|- \[( | x)\]|\d+\.) /g,s=r.match(o);if(s){let a=r.split(new RegExp(o.source.replaceAll("(","(?:"))),l="",u=0;for(let p of a)u>0&&(l+=s[u-1]),l+=t(p),u++;r=l}else r=t(r);e=ve(e,i.start.offset+2,i.end.offset,r)}return e}function Tu(e){let t=be("code",e);for(let n of t)!e.substring(n.start.offset,n.end.offset).startsWith("```")||(e=Vt(e,n.start.offset,n.end.offset));return e}function Ou(e,t){let n=be("math",e);for(let i of n)e=Vt(e,i.start.offset,i.end.offset);n=be("inlineMath",e);for(let i of n)!e.substring(i.start.offset,i.end.offset).startsWith("$".repeat(t))||(e=Vt(e,i.start.offset,i.end.offset));return e}function Au(e){let t=be("blockquote",e);for(let n of t)e=Vt(e,n.start.offset,n.end.offset,!0);return e}function Cu(e,t,n){let i=be("list",e);if(!i)return e;for(let r of i){let o=r.start.offset;for(;o>0&&e.charAt(o-1)!==` `;)o--;let s=e.substring(o,r.end.offset),a=function(p){let m=p.lastIndexOf("> ");return m!==-1&&(p=p.substring(m+2)),p=p.replaceAll(" "," "),Math.floor((p.split(" ").length-1)/2)+1},l=new Map,u=-1;s=s.replace(/^(( |\t|> )*)(\d+(\.|\)))([^\n]*)$/gm,(p,m="",c,d,h,g)=>{let w=1,y=a(m);if(l.has(y)?t==="ascending"&&(w=l.get(y)+1,l.set(y,w)):l.set(y,1),u>y){let E=u;for(;E>y;)l.delete(E--)}return u=y,`${m}${w}${n}${g}`}),e=ve(e,o,r.end.offset,s)}return e}function Eu(e,t){let n=be("listItem",e);if(!n)return e;let i=/^((\d+[.)])|(- \[[ x]\]))/m,r=t;if(t=="consistent"){let o=n.length-1;for(;o>=0;){let s=e.substring(n[o].start.offset,n[o].end.offset);if(o--,!s.match(i)){r=s.charAt(0);break}}if(o==-1)return e}for(let o of n){let s=e.substring(o.start.offset,o.end.offset);s.match(i)||(s=r+s.substring(1),e=ve(e,o.start.offset,o.end.offset,s))}return e}function Lu(e,t){let n=be("math",e),i=new RegExp("^(\\${"+t+",})(\\n*)"),r=new RegExp("(\\n*)(\\${"+t+",})([^\\$]*)$");for(let o of n){let s=e.substring(o.start.offset,o.end.offset);s=s.replace(i,`$1 `),s=s.replace(r,` $2$3`),e=ve(e,o.start.offset,o.end.offset,s)}n=be("inlineMath",e);for(let o of n){if(!e.substring(o.start.offset,o.end.offset).startsWith("$".repeat(t)))continue;let s=e.substring(o.start.offset,o.end.offset);s=s.replace(i,`$1 `),s=s.replace(r,` $2$3`),e=ve(e,o.start.offset,o.end.offset,s)}return e}var S={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}"},math:{replaceAction:"math",placeholder:"{MATH_PLACEHOLDER}"},inlineMath:{replaceAction:"inlineMath",placeholder:"{INLINE_MATH_PLACEHOLDER}"},html:{replaceAction:"html",placeholder:"{HTML_PLACEHOLDER}"},yaml:{replaceAction:ke,placeholder:De(`--- ---`)},wikiLink:{replaceAction:Ir,placeholder:"{WIKI_LINK_PLACEHOLDER}"},tag:{replaceAction:Ln,placeholder:"#tag-placeholder"},obsidianMultiLineComments:{replaceAction:xl,placeholder:"{OBSIDIAN_COMMENT_PLACEHOLDER}"},table:{replaceAction:is,placeholder:"{TABLE_PLACEHOLDER}"},link:{replaceAction:Pf,placeholder:"{REGULAR_LINK_PLACEHOLDER}"}};function $(e,t,n){let i=[];for(let r of e){let o;if(typeof r.replaceAction=="string")o=Df(t,r.placeholder,r.replaceAction);else if(r.replaceAction instanceof RegExp)o=$f(t,r.placeholder,r.replaceAction);else if(typeof r.replaceAction=="function"){let s=r.replaceAction;o=s(t,r.placeholder)}t=o.newText,i.push({replacedValues:o.replacedValues,placeholder:r.placeholder})}return t=n(t),i=i.reverse(),i!=null&&i.length>0&&i.forEach(r=>{r.replacedValues.forEach(o=>{t=t.replace(new RegExp(r.placeholder,"i"),De(o))})}),t}function Df(e,t,n){let i=be(n,e),r=[];for(let o of i){let s=e.substring(o.start.offset,o.end.offset);r.push(s),e=ve(e,o.start.offset,o.end.offset,t)}return r.reverse(),{newText:e,replacedValues:r}}function $f(e,t,n){let i=e.match(n),r=[];if(n.flags.includes("g")){if(e=e.replaceAll(n,t),i)for(let o of i)r.push(o)}else e=e.replace(n,t),i&&r.push(i[0]);return{newText:e,replacedValues:r}}function Pf(e,t){let n=be("link",e),i=[];for(let r of n){if(r==null)continue;let o=e.substring(r.start.offset,r.end.offset);!o.match(oi)||(i.push(o),e=ve(e,r.start.offset,r.end.offset,t))}return i.reverse(),{newText:e,replacedValues:i}}var tn=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}},xi=class extends k{get OptionsClass(){return tn}get name(){return"Capitalize Headings"}get description(){return"Headings should be formatted with capitalization"}get type(){return"Heading"}apply(t,n){return $([S.code,S.yaml,S.link,S.wikiLink,S.tag],t,i=>{let r=i.split(` `);for(let o=0;oa.toUpperCase());break}return r.join(` `)})}get exampleBuilders(){return[new v({description:"With `Title Case=true`, `Ignore Cased Words=false`",before:f` # this is a heading 1 ## THIS IS A HEADING 2 ### a heading 3 `,after:f` # This is a Heading 1 ## This is a Heading 2 ### A Heading 3 `,options:{style:"Title Case",ignoreCasedWords:!1}}),new v({description:"With `Title Case=true`, `Ignore Cased Words=true`",before:f` # this is a heading 1 ## THIS IS A HEADING 2 ### a hEaDiNg 3 `,after:f` # This is a Heading 1 ## THIS IS A HEADING 2 ### A hEaDiNg 3 `,options:{style:"Title Case",ignoreCasedWords:!0}}),new v({description:"With `First letter=true`",before:f` # this is a heading 1 ## this is a heading 2 `,after:f` # This is a heading 1 ## This is a heading 2 `,options:{style:"First letter"}}),new v({description:"With `ALL CAPS=true`",before:f` # this is a heading 1 ## this is a heading 2 `,after:f` # THIS IS A HEADING 1 ## THIS IS A HEADING 2 `,options:{style:"ALL CAPS"}})]}get optionBuilders(){return[new ye({OptionsClass:tn,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 te({OptionsClass:tn,name:"Ignore Cased Words",description:"Only apply title case style to words that are all lowercase",optionsKey:"ignoreCasedWords"}),new Ae({OptionsClass:tn,name:"Ignore Words",description:"A comma separated list of words to ignore when capitalizing",optionsKey:"ignoreWords",splitter:ns,separator:", "}),new Ae({OptionsClass:tn,name:"Lowercase Words",description:"A comma separated list of words to keep lowercase",optionsKey:"lowercaseWords",splitter:ns,separator:", "})]}};xi=A([k.register],xi);var po=class{constructor(){this.innerNewLines=!1}},vi=class extends k{get OptionsClass(){return po}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 Se(t,i=>(i=i.replace(/^---\n+/,`--- `),i=i.replace(/\n+---/,` ---`),n.innerNewLines&&(i=i.replaceAll(/\n{2,}/g,` `)),i))}get exampleBuilders(){return[new v({description:"Remove blank lines at the start and end of the YAML",before:f` --- ${""} date: today ${""} title: unchanged without inner new lines turned on ${""} --- `,after:f` --- date: today ${""} title: unchanged without inner new lines turned on --- `}),new v({description:"Remove blank lines anywhere in YAML with inner new lines set to true",before:f` --- ${""} date: today ${""} ${""} title: remove inner new lines ${""} --- ${""} # Header 1 ${""} ${""} Body content here. `,after:f` --- date: today title: remove inner new lines --- ${""} # Header 1 ${""} ${""} Body content here. `,options:{innerNewLines:!0}})]}get optionBuilders(){return[new te({OptionsClass:po,name:"Inner New Lines",description:"Remove new lines that are not at the start or the end of the YAML",optionsKey:"innerNewLines"})]}};vi=A([k.register],vi);var Ms=class{},ki=class extends k{get OptionsClass(){return Ms}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 $([S.code,S.yaml,S.link,S.wikiLink,S.tag],t,i=>i.replace(/\n{2,}/g,` `))}get exampleBuilders(){return[new v({description:"",before:f` Some text ${""} ${""} Some more text `,after:f` Some text ${""} Some more text `})]}get optionBuilders(){return[]}};ki=A([k.register],ki);var Fs=class{},Si=class extends k{get OptionsClass(){return Fs}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 $([S.code,S.yaml,S.link,S.wikiLink,S.tag],t,i=>i.replace(/^([^\S\n]*)([•§])([^\S\n]*)/gm,"$1-$3"))}get exampleBuilders(){return[new v({description:"Converts \u2022",before:f` • item 1 • item 2 `,after:f` - item 1 - item 2 `}),new v({description:"Converts \xA7",before:f` • item 1 § item 2 § item 3 `,after:f` - item 1 - item 2 - item 3 `})]}get optionBuilders(){return[]}};Si=A([k.register],Si);var co=class{constructor(){this.tabsize=4}},Ti=class extends k{get OptionsClass(){return co}get name(){return"Convert Spaces to Tabs"}get description(){return"Converts leading spaces to tabs."}get type(){return"Spacing"}apply(t,n){return $([S.code,S.yaml,S.link,S.wikiLink,S.tag],t,i=>{let r=String(n.tabsize),o=new RegExp("^( *) {"+String(r)+"}","gm");for(;i.match(o)!=null;)i=i.replace(o,"$1 ");return i})}get exampleBuilders(){return[new v({description:"Converting spaces to tabs with `tabsize = 3`",before:f` - text with no indention - text indented with 3 spaces - text with no indention - text indented with 6 spaces `,after:f` - 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 Ur({OptionsClass:co,name:"Tabsize",description:"Number of spaces that will be converted to a tab",optionsKey:"tabsize"})]}};Ti=A([k.register],Ti);var mo=class{constructor(){this.style="consistent"}},Oi=class extends k{get OptionsClass(){return mo}get name(){return"Emphasis Style"}get description(){return"Makes sure the emphasis style is consistent."}get type(){return"Content"}apply(t,n){return $([S.code,S.yaml,S.link,S.wikiLink,S.tag,S.math,S.inlineMath],t,i=>uo(i,n.style,"emphasis"))}get exampleBuilders(){return[new v({description:"Emphasis indicators should use underscores when style is set to 'underscore'",before:f` # 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:f` # 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 v({description:"Emphasis indicators should use asterisks when style is set to 'asterisk'",before:f` # 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:f` # 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 v({description:"Emphasis indicators should use consistent style based on first emphasis indicator in a file when style is set to 'consistent'",before:f` # 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:f` # 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 v({description:"Emphasis indicators should use consistent style based on first emphasis indicator in a file when style is set to 'consistent'",before:f` # 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:f` # 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 ye({OptionsClass:mo,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"}]})]}};Oi=A([k.register],Oi);var Rs=class{},Ai=class extends k{get OptionsClass(){return Rs}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 Au(t)}get exampleBuilders(){return[new v({description:"Blockquotes that start a document do not get an empty line before them.",before:f` > Quote content here > quote content continued # Title here `,after:f` > Quote content here > quote content continued ${""} # Title here `}),new v({description:"Blockquotes that end a document do not get an empty line after them.",before:f` # Heading 1 > Quote content here > quote content continued `,after:f` # Heading 1 ${""} > Quote content here > quote content continued `}),new v({description:"Blockquotes that are nested have the proper empty line added",before:f` # 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:f` # 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[]}};Ai=A([k.register],Ai);var Ds=class{},Ci=class extends k{get OptionsClass(){return Ds}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 Tu(t)}get exampleBuilders(){return[new v({description:"Fenced code blocks that start a document do not get an empty line before them.",before:f` \`\`\` js var temp = 'text'; // this is a code block \`\`\` Text after code block. `,after:f` \`\`\` js var temp = 'text'; // this is a code block \`\`\` ${""} Text after code block. `}),new v({description:"Fenced code blocks that end a document do not get an empty line after them.",before:f` # Heading 1 \`\`\` Here is a code block \`\`\` `,after:f` # Heading 1 ${""} \`\`\` Here is a code block \`\`\` `}),new v({description:"Fenced code blocks that are in a blockquote have the proper empty line added",before:f` # 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:f` # 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 v({description:"Nested fenced code blocks get empty lines added around them",before:f` \`\`\`markdown # Header ${""} \`\`\`\`JavaScript var text = 'some string'; \`\`\`\` \`\`\` `,after:f` \`\`\`markdown # Header ${""} \`\`\`\`JavaScript var text = 'some string'; \`\`\`\` ${""} \`\`\` `})]}get optionBuilders(){return[]}};Ci=A([k.register],Ci);var fo=class{constructor(){this.minimumNumberOfDollarSignsToBeAMathBlock=2}};A([k.noSettingControl()],fo.prototype,"minimumNumberOfDollarSignsToBeAMathBlock",2);var Ei=class extends k{get OptionsClass(){return fo}get name(){return"Empty Line Around Math Blocks"}get description(){return"Ensures that there is an empty line around math blocks using `Number of Dollar Signs to Indicate a Math Block` to determine how many dollar signs indicates a math block for single-line math."}get type(){return"Spacing"}apply(t,n){return $([S.yaml,S.code],t,i=>Ou(i,n.minimumNumberOfDollarSignsToBeAMathBlock))}get exampleBuilders(){return[new v({description:"Math blocks that start a document do not get an empty line before them.",before:f` $$ \\boldsymbol{a}=\\begin{bmatrix}a_x \\\\ a_y\\end{bmatrix} $$ some more text `,after:f` $$ \\boldsymbol{a}=\\begin{bmatrix}a_x \\\\ a_y\\end{bmatrix} $$ ${""} some more text `}),new v({description:"Math blocks that are singe-line are updated based on the value of `Number of Dollar Signs to Indicate a Math Block` (in this case its value is 2)",before:f` $$\\boldsymbol{a}=\\begin{bmatrix}a_x \\\\ a_y\\end{bmatrix}$$ some more text `,after:f` $$\\boldsymbol{a}=\\begin{bmatrix}a_x \\\\ a_y\\end{bmatrix}$$ ${""} some more text `}),new v({description:"Math blocks that end a document do not get an empty line after them.",before:f` Some text $$ \\boldsymbol{a}=\\begin{bmatrix}a_x \\\\ a_y\\end{bmatrix} $$ `,after:f` Some text ${""} $$ \\boldsymbol{a}=\\begin{bmatrix}a_x \\\\ a_y\\end{bmatrix} $$ `}),new v({description:"Math blocks that are not at the start or the end of the document will have an empty line added before and after them",before:f` Some text $$ \\boldsymbol{a}=\\begin{bmatrix}a_x \\\\ a_y\\end{bmatrix} $$ some more text `,after:f` Some text ${""} $$ \\boldsymbol{a}=\\begin{bmatrix}a_x \\\\ a_y\\end{bmatrix} $$ ${""} some more text `}),new v({description:"Math blocks in callouts or blockquotes have the appropriately formatted blank lines added",before:f` > Math block in blockquote > $$ > \\boldsymbol{a}=\\begin{bmatrix}a_x \\\\ a_y\\end{bmatrix} > $$ ${""} More content here ${""} > Math block doubly nested in blockquote > > $$ > > \\boldsymbol{a}=\\begin{bmatrix}a_x \\\\ a_y\\end{bmatrix} > > $$ `,after:f` > Math block in blockquote > > $$ > \\boldsymbol{a}=\\begin{bmatrix}a_x \\\\ a_y\\end{bmatrix} > $$ > ${""} More content here ${""} > Math block doubly nested in blockquote > > > > $$ > > \\boldsymbol{a}=\\begin{bmatrix}a_x \\\\ a_y\\end{bmatrix} > > $$ `})]}get optionBuilders(){return[]}};Ei=A([k.register],Ei);var $s=class{},Li=class extends k{get OptionsClass(){return $s}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 $([S.yaml,S.code],t,i=>kl(i))}get exampleBuilders(){return[new v({description:"Tables that start a document do not get an empty line before them.",before:f` | 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:f` | 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 v({description:"Tables that end a document do not get an empty line after them.",before:f` # Heading 1 | Column 1 | Column 2 | |----------|----------| | foo | bar | | baz | qux | | quux | quuz | `,after:f` # Heading 1 ${""} | Column 1 | Column 2 | |----------|----------| | foo | bar | | baz | qux | | quux | quuz | `}),new v({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:f` # 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:f` # 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 v({description:"Tables in callouts or blockquotes have the appropriately formatted blank lines added",before:f` > 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:f` > 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[]}};Li=A([k.register],Li);var _i=class{constructor(){this.defaultEscapeCharacter='"';this.tryToEscapeSingleLineArrays=!1}};A([k.noSettingControl()],_i.prototype,"defaultEscapeCharacter",2);var nn=class extends k{get OptionsClass(){return _i}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 Se(t,i=>{let r=i.split(` `),o=r.length;if(o<1)return i;for(let s=0;s=a.length,p=a.startsWith("-"),m=p&&a.length<2;if(u&&m)continue;let c=1;if(!p)c+=l;else if(l!==-1&&s+1{if(i.match(/^#\s.*/m))return i;let o=n.fileName,s=i.indexOf(` ---`);return s=s==-1||!i.startsWith(`--- `)?0:s+5,jt(i,s,`# ${o} `)})}get exampleBuilders(){return[new v({description:"Inserts an H1 heading",before:f` This is a line of text `,after:f` # File Name This is a line of text `,options:{fileName:"File Name"}}),new v({description:"Inserts heading after YAML front matter",before:f` --- title: My Title --- This is a line of text `,after:f` --- title: My Title --- # File Name This is a line of text `,options:{fileName:"File Name"}})]}get optionBuilders(){return[]}};Bi=A([k.register],Bi);var Ps=class{},Ii=class extends k{get OptionsClass(){return Ps}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 $([S.code,S.yaml,S.link,S.wikiLink,S.tag],t,i=>i.replace(/(?!^)(\[\^\w+\]) ?([,.;!:?])/gm,"$2$1"))}get exampleBuilders(){return[new v({description:"Placing footnotes after punctuation.",before:f` Lorem[^1]. Ipsum[^2], doletes. `,after:f` Lorem.[^1] Ipsum,[^2] doletes. `})]}get optionBuilders(){return[]}};Ii=A([k.register],Ii);var Mi=class{constructor(){this.defaultEscapeCharacter='"';this.forceYamlEscape=[]}};A([k.noSettingControl()],Mi.prototype,"defaultEscapeCharacter",2);var rn=class extends k{get OptionsClass(){return Mi}get name(){return"Force YAML Escape"}get description(){return"Escapes the values for the specified YAML keys."}get type(){return"YAML"}apply(t,n){return Se(t,i=>{for(let r of n.forceYamlEscape){let o=Oe(i,r);if(o!=null){if(o.includes(` `)||o.startsWith(" [")||ls(o))continue;o=kt(o,n.defaultEscapeCharacter,!0),i=Te(i,r," "+o)}}return i})}get exampleBuilders(){return[new v({description:"YAML without anything to escape",before:f` --- key: value otherKey: [] --- `,after:f` --- key: value otherKey: [] --- `}),new v({description:"Force YAML keys to be escaped with double quotes where not already escaped with `Force Yaml Escape on Keys = 'key'\\n'title'\\n'bool'`",before:f` --- key: 'Already escaped value' title: This is a title bool: false unaffected: value --- ${""} _Note that the force Yaml key option should not be used with arrays._ `,after:f` --- key: 'Already escaped value' title: "This is a title" bool: "false" unaffected: value --- ${""} _Note that the force Yaml key option should not be used with arrays._ `,options:{forceYamlEscape:["key","title","bool"],defaultEscapeCharacter:'"'}})]}get optionBuilders(){return[new Ae({OptionsClass:Mi,name:"Force YAML Escape on Keys",description:"Uses the YAML escape character on the specified YAML keys separated by a new line character if it is not already escaped. Do not use on YAML arrays.",optionsKey:"forceYamlEscape"})]}get hasSpecialExecutionOrder(){return!0}};rn=A([k.register],rn);var Ns=class{},on=class extends k{get OptionsClass(){return Ns}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 Se(t,i=>i.replace(new RegExp(`\\n(${si}|${os}):(.*?)(?=\\n(?:[A-Za-z-]+?:|---))`,"s"),function(r){return r.replaceAll("#","")}))}get exampleBuilders(){return[new v({description:"Format Tags in YAML frontmatter",before:f` --- tags: #one #two #three #nested/four/five --- `,after:f` --- tags: one two three nested/four/five --- `}),new v({description:"Format tags in array",before:f` --- tags: [#one #two #three] --- `,after:f` --- tags: [one two three] --- `}),new v({description:"Format tags in array with `tag` as the tags key",before:f` --- tag: [#one #two #three] --- `,after:f` --- tag: [one two three] --- `}),new v({description:"Format tags in list",before:f` --- tags: - #tag1 - #tag2 --- `,after:f` --- tags: - tag1 - tag2 --- `})]}get optionBuilders(){return[]}get hasSpecialExecutionOrder(){return!0}};on=A([k.register],on);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=[]}};A([k.noSettingControl()],at.prototype,"aliasArrayStyle",2),A([k.noSettingControl()],at.prototype,"tagArrayStyle",2);var Fi=class extends k{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 Se(t,i=>{let r=Je(i.replace(`--- `,"").replace(` ---`,""));if(!r)return i;for(let o of li)if(n.formatAliasKey&&Object.keys(r).includes(o)){i=Te(i,o,Ge($r(ht(Oe(i,o))),n.aliasArrayStyle));break}for(let o of ai)if(n.formatTagKey&&Object.keys(r).includes(o)){i=Te(i,o,Ge(Dr(ht(Oe(i,o))),n.tagArrayStyle));break}if(n.formatArrayKeys){let o=[...li,...ai,...n.forceMultiLineArrayStyle,...n.forceSingleLineArrayStyle];for(let s of Object.keys(r))o.includes(s)||!Array.isArray(r[s])||r[s].length!==0&&typeof r[s][0]=="object"&&r[s][0]!==null||(i=Te(i,s,Ge(ht(Oe(i,s)),n.defaultArrayStyle)))}for(let o of n.forceSingleLineArrayStyle)!Object.keys(r).includes(o)||(i=Te(i,o,Ge(ht(Oe(i,o)),"single-line")));for(let o of n.forceMultiLineArrayStyle)!Object.keys(r).includes(o)||(i=Te(i,o,Ge(ht(Oe(i,o)),"multi-line")));return i})}get exampleBuilders(){return[new v({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:f` --- 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:f` --- 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 v({description:"Format tags as a single string with space delimiters, ignore aliases, and format regular yaml arrays as single-line arrays",before:f` --- aliases: Typescript types: - thought provoking - peer reviewed tags: [computer, science, trajectory] --- `,after:f` --- aliases: Typescript types: [thought provoking, peer reviewed] tags: computer science trajectory --- `,options:{formatAliasKey:!1,tagArrayStyle:"single string space delimited"}}),new v({description:"Arrays with dictionaries in them are ignored",before:f` --- gists: - id: test123 url: 'some_url' filename: file.md isPublic: true --- `,after:f` --- gists: - id: test123 url: 'some_url' filename: file.md isPublic: true --- `,options:{formatArrayKeys:!0,defaultArrayStyle:"single-line"}})]}get optionBuilders(){return[new te({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 te({OptionsClass:at,name:"Format yaml tags section",description:"Turns on formatting for the yaml tags section.",optionsKey:"formatTagKey"}),new ye({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 te({OptionsClass:at,name:"Format yaml array sections",description:"Turns on formatting for regular yaml arrays",optionsKey:"formatArrayKeys"}),new Ae({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 Ae({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"})]}};Fi=A([k.register],Fi);var Hs=class{},Ri=class extends k{get OptionsClass(){return Hs}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 $([S.code,S.yaml,S.link,S.wikiLink,S.tag],t,i=>{let r=i.split(` `),o=0,s=0;for(let a=0;ao+1?(s+=u-(o+1),u=o+1):u(n.bottom?(i=i.replace(/^(#+\s.*)/gm,` $1 `),i=i.replace(/\n+(#+\s.*)/g,` $1`),i=i.replace(/(^#+\s.*)\n+/gm,`$1 `)):(i=i.replace(/(^#+\s.*)\n+/gm,`$1 `),i=i.replace(/\n+(#+\s.*)/g,` $1`)),i=i.replace(/^\n+(#+\s.*)/,"$1"),i=i.replace(/(#+\s.*)\n+$/,"$1"),n.emptyLineAfterYaml||(i=i.replace(new RegExp("("+ke.source+")\\n+(#+\\s.*)"),`$1 $5`)),i))}get exampleBuilders(){return[new v({description:"Headings should be surrounded by blank lines",before:f` # H1 ## H2 ${""} ${""} # H1 line ## H2 ${""} `,after:f` # H1 ${""} ## H2 ${""} # H1 ${""} line ${""} ## H2 `}),new v({description:"With `Bottom=false`",before:f` # H1 line ## H2 # H1 line `,after:f` # H1 line ${""} ## H2 ${""} # H1 line `,options:{bottom:!1,emptyLineAfterYaml:!0}}),new v({description:"Empty line before header and after Yaml is removed with `Empty Line Between Yaml and Header=true`",before:f` --- key: value --- # Header Paragraph here... `,after:f` --- key: value --- # Header Paragraph here... `,options:{bottom:!0,emptyLineAfterYaml:!1}})]}get optionBuilders(){return[new te({OptionsClass:$i,name:"Bottom",description:"Insert a blank line after headings",optionsKey:"bottom"}),new te({OptionsClass:$i,name:"Empty Line Between Yaml and Header",description:"Keep the empty line between the Yaml frontmatter and header",optionsKey:"emptyLineAfterYaml"})]}};Di=A([k.register],Di);var yo=class{constructor(){this.textToInsert=["aliases: ","tags: "]}},Pi=class extends k{get OptionsClass(){return yo}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=ft(t),Se(t,i=>{let r=n.textToInsert.reverse(),o=Je(i.match(ke)[1]);for(let s of r){let a=s.split(":")[0];Object.prototype.hasOwnProperty.call(o,a)||(i=i.replace(/^---\n/,De(`--- ${s} `)))}return i})}get exampleBuilders(){return[new v({description:"Insert static lines into YAML frontmatter. Text to insert: `aliases:\ntags: doc\nanimal: dog`",before:f` --- animal: cat --- `,after:f` --- aliases: tags: doc animal: cat --- `,options:{textToInsert:["aliases:","tags: doc","animal: dog"]}})]}get optionBuilders(){return[new Ae({OptionsClass:yo,name:"Text to insert",description:"Text to insert into the YAML frontmatter",optionsKey:"textToInsert"})]}};Pi=A([k.register],Pi);var zs=class{},Ni=class extends k{get OptionsClass(){return zs}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 v({description:"Appending a line break to the end of the document.",before:f` Lorem ipsum dolor sit amet, consectetur adipiscing elit. `,after:f` Lorem ipsum dolor sit amet, consectetur adipiscing elit. ${""} `}),new v({description:"Removing trailing line breaks to the end of the document, except one.",before:f` Lorem ipsum dolor sit amet, consectetur adipiscing elit. ${""} ${""} ${""} `,after:f` Lorem ipsum dolor sit amet, consectetur adipiscing elit. ${""} `})]}get optionBuilders(){return[]}};Ni=A([k.register],Ni);var Ys=class{},Hi=class extends k{get OptionsClass(){return Ys}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 $([S.code,S.yaml],t,i=>yu(i))}get exampleBuilders(){return[new v({description:"Moving footnotes to the bottom",before:f` 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:f` 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[]}};Hi=A([k.register],Hi);var bo=class{constructor(){this.minimumNumberOfDollarSignsToBeAMathBlock=2}};A([k.noSettingControl()],bo.prototype,"minimumNumberOfDollarSignsToBeAMathBlock",2);var zi=class extends k{get OptionsClass(){return bo}get name(){return"Move Math Block Indicators to Their Own Line"}get description(){return"Move all starting and ending math block indicators to their own lines using `Number of Dollar Signs to Indicate a Math Block` to determine how many dollar signs indicates a math block for single-line math."}get type(){return"Spacing"}apply(t,n){return $([S.code,S.inlineCode],t,i=>Lu(i,n.minimumNumberOfDollarSignsToBeAMathBlock))}get exampleBuilders(){return[new v({description:"Moving math block indicator to its own line when `Number of Dollar Signs to Indicate a Math Block` = 2",before:f` This is left alone: $$ \\boldsymbol{a}=\\begin{bmatrix}a_x \\\\ a_y\\end{bmatrix} $$ The following is updated: $$L = \\frac{1}{2} \\rho v^2 S C_L$$ `,after:f` This is left alone: $$ \\boldsymbol{a}=\\begin{bmatrix}a_x \\\\ a_y\\end{bmatrix} $$ The following is updated: $$ L = \\frac{1}{2} \\rho v^2 S C_L $$ `}),new v({description:"Moving math block indicator to its own line when `Number of Dollar Signs to Indicate a Math Block` = 3 and opening indicator is on the same line as the start of the content",before:f` $$$\\boldsymbol{a}=\\begin{bmatrix}a_x \\\\ a_y\\end{bmatrix} $$$ `,after:f` $$$ \\boldsymbol{a}=\\begin{bmatrix}a_x \\\\ a_y\\end{bmatrix} $$$ `}),new v({description:"Moving math block indicator to its own line when `Number of Dollar Signs to Indicate a Math Block` = 2 and ending indicator is on the same line as the ending line of the content",before:f` $$ \\boldsymbol{a}=\\begin{bmatrix}a_x \\\\ a_y\\end{bmatrix}$$ `,after:f` $$ \\boldsymbol{a}=\\begin{bmatrix}a_x \\\\ a_y\\end{bmatrix} $$ `})]}get optionBuilders(){return[]}};zi=A([k.register],zi);var Pn=class{constructor(){this.tagArrayStyle="single-line";this.howToHandleExistingTags="Nothing";this.tagsToIgnore=[]}};A([k.noSettingControl()],Pn.prototype,"tagArrayStyle",2);var Yi=class extends k{get OptionsClass(){return Pn}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 $([S.code,S.inlineCode,S.math,S.html],t,i=>{let r=i.match(Ln);return r&&(i=ft(i),i=Se(i,o=>{o=o.replace(`--- `,"").replace("---","");let s=[],a=si;for(let p of ai){let m=Oe(o,p);if(m!=null){s=Dr(ht(m)),a=p;break}}let l=new Set;if(typeof s=="string")l.add(s),s=[s];else if(s!=null)for(let p of s)l.add(p);else s=[];for(let p of r){let m=p.trim().substring(1);!l.has(m)&&!n.tagsToIgnore.includes(m)&&(l.add(m),s.push(m))}return`--- ${Te(o,a,Ge(s,n.tagArrayStyle))}---`}),n.howToHandleExistingTags==="Remove hashtag"?i=i.replace(Ln,o=>{let s=o.indexOf("#"),a=o.substring(s+1);return n.tagsToIgnore.includes(a)?o:o.substring(0,s)+a}):n.howToHandleExistingTags==="Remove whole tag"&&(i=i.replace(Ln,""))),i})}get exampleBuilders(){return[new v({description:"Move tags from body to Yaml with `Tags to ignore = 'ignored-tag'`",before:f` 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:f` --- 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 v({description:"Move tags from body to YAML with existing tags retains the already existing ones and only adds new ones",before:f` --- tags: [test, tag2] --- Text has to do with #test and #markdown `,after:f` --- tags: [test, tag2, markdown] --- Text has to do with #test and #markdown `}),new v({description:"Move tags to YAML frontmatter and then remove hashtags in body content tags when `Body tag operation = 'Remove hashtag'` and `Tags to ignore = 'yet-another-ignored-tag'`.",before:f` --- 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:f` --- 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:{howToHandleExistingTags:"Remove hashtag",tagsToIgnore:["yet-another-ignored-tag"]}}),new v({description:"Move tags to YAML frontmatter and then remove body content tags when `Body tag operation = 'Remove whole tag'`.",before:f` --- tags: [test, tag2] --- This document will have #tags removed and spacing around tags is left alone except for the space prior to the hashtag #warning `,after:f` --- tags: [test, tag2, tags, warning] --- This document will have removed and spacing around tags is left alone except for the space prior to the hashtag `,options:{howToHandleExistingTags:"Remove whole tag"}})]}get optionBuilders(){return[new ye({OptionsClass:Pn,name:"Body tag operation",description:"What to do with non-ignored tags in the body of the file once they have been moved to the frontmatter",optionsKey:"howToHandleExistingTags",records:[{value:"Nothing",description:"Leaves tags in the body of the file alone"},{value:"Remove hashtag",description:"Removes `#` from tags in content body after moving them to the YAML frontmatter"},{value:"Remove whole tag",description:"Removes the whole tag in content body after moving them to the YAML frontmatter. _Note that this removes the first space prior to the tag as well_"}]}),new Ae({OptionsClass:Pn,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"})]}};Yi=A([k.register],Yi);var qs=class{},Iu="'\"\u2018\u2019\u201C\u201D`[]",qi=class extends k{get OptionsClass(){return qs}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 $([S.code,S.yaml,S.link,S.wikiLink,S.tag,S.image,S.inlineCode],t,i=>{let r=i.match(Fr);if(!r)return i;let o=0,s=r.length;for(let a=0;a=i.length?void 0:i.charAt(p);if(m!=null&&Iu.includes(m)&&c!=null&&Iu.includes(c)){o=u+l.length;continue}if(m!=null&&m==="<"&&c!=null&&c===">"){let d=u-1;for(;d>0&&i.charAt(d-1)==="<";)d--;let h=p;for(;h";)h++;i=ve(i,d,h+1,"<"+l+">"),o=u+l.length;continue}i=ve(i,u,u+l.length,"<"+l+">"),o=u+l.length+2}return i})}get exampleBuilders(){return[new v({description:"Make sure that links are inside of angle brackets when not in single quotes('), double quotes(\"), or backticks(`)",before:f` 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:f` 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 v({description:`Angle brackets are added if the url is not the only text in the single quotes(') or double quotes(")`,before:f` [https://github.com some text here] backticks around a url should stay the same: \`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:f` [ some text here] backticks around a url should stay the same: \`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: ' 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 v({description:"Multiple angle brackets at the start and or end of a url will be reduced down to 1",before:f` < > <> `,after:f` `})]}get optionBuilders(){return[]}};qi=A([k.register],qi);var ji=class{constructor(){this.numberStyle="ascending";this.listEndStyle="."}},Ki=class extends k{get OptionsClass(){return ji}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 $([S.code,S.yaml,S.tag],t,i=>Cu(i,n.numberStyle,n.listEndStyle))}get exampleBuilders(){return[new v({description:"Ordered lists have list items set to ascending numerical order when Number Style is `ascending`.",before:f` 1. Item 1 2. Item 2 4. Item 3 ${""} Some text here ${""} 1. Item 1 1. Item 2 1. Item 3 `,after:f` 1. Item 1 2. Item 2 3. Item 3 ${""} Some text here ${""} 1. Item 1 2. Item 2 3. Item 3 `}),new v({description:"Nested ordered lists have list items set to ascending numerical order when Number Style is `ascending`.",before:f` 1. Item 1 2. Item 2 1. Subitem 1 5. Subitem 2 2. Subitem 3 4. Item 3 `,after:f` 1. Item 1 2. Item 2 1. Subitem 1 2. Subitem 2 3. Subitem 3 3. Item 3 `}),new v({description:"Ordered list in blockquote has list items set to '1.' when Number Style is `lazy`.",before:f` > 1. Item 1 > 4. Item 2 > > 1. Subitem 1 > > 5. Subitem 2 > > 2. Subitem 3 `,after:f` > 1. Item 1 > 1. Item 2 > > 1. Subitem 1 > > 1. Subitem 2 > > 1. Subitem 3 `,options:{numberStyle:"lazy"}}),new v({description:"Ordered list in blockquote has list items set to ascending numerical order when Number Style is `ascending`.",before:f` > 1. Item 1 > 4. Item 2 > > 1. Subitem 1 > > 5. Subitem 2 > > 2. Subitem 3 `,after:f` > 1. Item 1 > 2. Item 2 > > 1. Subitem 1 > > 2. Subitem 2 > > 3. Subitem 3 `}),new v({description:"Nested ordered list has list items set to '1)' when Number Style is `lazy` and Ordered List Indicator End Style is `)`.",before:f` 1. Item 1 2. Item 2 1. Subitem 1 5. Subitem 2 2. Subitem 3 4. Item 3 `,after:f` 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 ye({OptionsClass:ji,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 ye({OptionsClass:ji,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)`)"}]})]}};Ki=A([k.register],Ki);var Ks=class{},Vi=class extends k{get OptionsClass(){return Ks}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 $([S.obsidianMultiLineComments,S.yaml,S.table],t,wu)}get exampleBuilders(){return[new v({description:"Paragraphs should be surrounded by blank lines",before:f` # H1 Newlines are inserted. A paragraph is a line that starts with a letter. `,after:f` # H1 ${""} Newlines are inserted. ${""} A paragraph is a line that starts with a letter. `})]}get optionBuilders(){return[]}};Vi=A([k.register],Vi);var wo=class{};A([k.noSettingControl()],wo.prototype,"lineContent",2);var sn=class extends k{get OptionsClass(){return wo}get name(){return"Prevent Double Checklist Indicator on Paste"}get description(){return"Removes starting checklist indicator from the text to paste if the line the cursor is on in the file has a checklist indicator"}get type(){return"Paste"}apply(t,n){let i=new RegExp(`^${_n}- \\[[ x]] `),r=/^\s*- \[[ x]] /,o=i.test(n.lineContent),s=r.test(t);return!o||!s?t:t.replace(r,"")}get exampleBuilders(){return[new v({description:"Line being pasted is left alone when current line has no checklist indicator in it: `Regular text here`",before:f` - [ ] Checklist item being pasted `,after:f` - [ ] Checklist item being pasted `,options:{lineContent:"Regular text here"}}),new v({description:"Line being pasted into a blockquote without a checklist indicator is left alone when it lacks a checklist indicator: `> > `",before:f` - [ ] Checklist item contents here More content here `,after:f` - [ ] Checklist item contents here More content here `,options:{lineContent:"> > "}}),new v({description:"Line being pasted into a blockquote with a checklist indicator is has its checklist indicator removed when current line is: `> - [x] `",before:f` - [ ] Checklist item contents here More content here `,after:f` Checklist item contents here More content here `,options:{lineContent:"> - [x] "}}),new v({description:"Line being pasted with a checklist indicator is has its checklist indicator removed when current line is: `- [ ] `",before:f` - [x] Checklist item 1 - [ ] Checklist item 2 `,after:f` Checklist item 1 - [ ] Checklist item 2 `,options:{lineContent:"- [ ] "}})]}get optionBuilders(){return[]}};sn=A([k.register],sn);var xo=class{};A([k.noSettingControl()],xo.prototype,"lineContent",2);var an=class extends k{get OptionsClass(){return xo}get name(){return"Prevent Double List Item Indicator on Paste"}get description(){return"Removes starting list indicator from the text to paste if the line the cursor is on in the file has a list indicator"}get type(){return"Paste"}apply(t,n){let i=new RegExp(`^${_n}[*+-] `),r=/^\s*[*+-] /,o=i.test(n.lineContent),s=r.test(t);return!o||!s?t:t.replace(r,"")}get exampleBuilders(){return[new v({description:"Line being pasted is left alone when current line has no list indicator in it: `Regular text here`",before:f` - List item being pasted `,after:f` - List item being pasted `,options:{lineContent:"Regular text here"}}),new v({description:"Line being pasted into a blockquote without a list indicator is left alone when it lacks a list indicator: `> > `",before:f` * List item contents here More content here `,after:f` * List item contents here More content here `,options:{lineContent:"> > "}}),new v({description:"Line being pasted into a blockquote with a list indicator is has its list indicator removed when current line is: `> * `",before:f` + List item contents here More content here `,after:f` List item contents here More content here `,options:{lineContent:"> * "}}),new v({description:"Line being pasted with a list indicator is has its list indicator removed when current line is: `+ `",before:f` - List item 1 - List item 2 `,after:f` List item 1 - List item 2 `,options:{lineContent:"+ "}})]}get optionBuilders(){return[]}};an=A([k.register],an);var js=class{},ln=class extends k{get OptionsClass(){return js}get name(){return"Proper Ellipsis on Paste"}get description(){return"Replaces three consecutive dots with an ellipsis even if they have a space between them in the text to paste"}get type(){return"Paste"}apply(t,n){return t.replaceAll(Mr,"\u2026")}get exampleBuilders(){return[new v({description:"Replacing three consecutive dots with an ellipsis even if spaces are present",before:f` Lorem (...) Impsum. Lorem (. ..) Impsum. Lorem (. . .) Impsum. `,after:f` Lorem (…) Impsum. Lorem (…) Impsum. Lorem (…) Impsum. `})]}get optionBuilders(){return[]}};ln=A([k.register],ln);var Vs=class{},Wi=class extends k{get OptionsClass(){return Vs}get name(){return"Proper Ellipsis"}get description(){return"Replaces three consecutive dots with an ellipsis."}get type(){return"Content"}apply(t,n){return $([S.code,S.yaml,S.link,S.wikiLink,S.tag],t,i=>i.replaceAll(Mr,"\u2026"))}get exampleBuilders(){return[new v({description:"Replacing three consecutive dots with an ellipsis.",before:f` Lorem (...) Impsum. `,after:f` Lorem (…) Impsum. `})]}get optionBuilders(){return[]}};Wi=A([k.register],Wi);var Ws=class{},Ui=class extends k{get OptionsClass(){return Ws}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 $([S.code,S.yaml,S.link,S.wikiLink,S.tag],t,i=>{let r=0;return i=i.replace(/^\[\^\w+\]: /gm,function(){return r++,"[^"+String(r)+"]: "}),r=0,i=i.replace(/(?!^)\[\^\w+\]/gm,function(){return r++,"[^"+String(r)+"]"}),i})}get exampleBuilders(){return[new v({description:"Re-indexing footnotes after having deleted previous footnotes",before:f` Lorem ipsum at aliquet felis.[^3] Donec dictum turpis quis pellentesque,[^5] et iaculis tortor condimentum. ${""} [^3]: first footnote [^5]: second footnote `,after:f` Lorem ipsum at aliquet felis.[^1] Donec dictum turpis quis pellentesque,[^2] et iaculis tortor condimentum. ${""} [^1]: first footnote [^2]: second footnote `}),new v({description:"Re-indexing footnotes after inserting a footnote between",before:f` 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:f` 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 v({description:"Re-indexing duplicate footnote keys",before:f` Lorem ipsum at aliquet felis.[^1] Donec dictum turpis quis pellentesque,[^1] et iaculis tortor condimentum. ${""} [^1]: first footnote [^1]: second footnote `,after:f` 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[]}};Ui=A([k.register],Ui);var Us=class{},Gi=class extends k{get OptionsClass(){return Us}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 $([S.code,S.yaml,S.link,S.wikiLink,S.tag],t,i=>i.replace(/^([ |\t]*)- - \b/gm,"$1- "))}get exampleBuilders(){return[new v({description:"Removing consecutive list markers.",before:f` - item 1 - - copypasted item A - item 2 - indented item - - copypasted item B `,after:f` - item 1 - copypasted item A - item 2 - indented item - copypasted item B `})]}get optionBuilders(){return[]}};Gi=A([k.register],Gi);var un=class extends k{get OptionsClass(){return un}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 $([S.code,S.yaml,S.link,S.wikiLink,S.tag,S.thematicBreak],t,i=>{let r=function(p,m,c){let d=new RegExp(`^${m} {2,}${m}$`,"gm"),h,g=p;do h=g.match(d),g=g.replaceAll(d,c);while(h);return g};return i=r(i,"(( |\\t)*- \\[( |x)\\]( |\\t)+.+)",`$1 $5`),i=r(i,"(( |\\t)*\\d+\\.( |\\t)+.+)",`$1 $4`),i=r(i,"(( |\\t)*\\+( |\\t)+.+)",`$1 $4`),i=r(i,"(( |\\t)*-(?! \\[( |x)\\])( |\\t)+.+)",`$1 $5`),r(i,"(( |\\t)*\\*( |\\t)+.+)",`$1 $4`)})}get exampleBuilders(){return[new v({description:"",before:f` 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:f` 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[]}};un=A([k.register],un);var Gs=class{},Zi=class extends k{get OptionsClass(){return Gs}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 $([S.code,S.yaml,S.link,S.wikiLink,S.tag],t,i=>{let r=new RegExp(`^${_n}(-|\\*|\\+|\\d+[.)]|- (\\[( |x)\\]))\\s*?$`,"gm");return i=i.replace(new RegExp(r.source+"\\n","gm"),""),i=i.replace(new RegExp("\\n"+r.source,"gm"),""),i.replace(r,"")})}get exampleBuilders(){return[new v({description:"Removes empty list markers.",before:f` - item 1 - - item 2 ${""} * list 2 item 1 * * list 2 item 2 ${""} + list 3 item 1 + + list 3 item 2 `,after:f` - item 1 - item 2 ${""} * list 2 item 1 * list 2 item 2 ${""} + list 3 item 1 + list 3 item 2 `}),new v({description:"Removes empty ordered list markers.",before:f` 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:f` 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 v({description:"Removes empty checklist markers.",before:f` - [ ] item 1 - [x] - [ ] item 2 - [ ] ${""} ${""} _Note that this will affect checked and uncheck checked list items_ `,after:f` - [ ] item 1 - [ ] item 2 ${""} _Note that this will affect checked and uncheck checked list items_ `}),new v({description:"Removes empty list, checklist, and ordered list markers in callouts/blockquotes",before:f` > 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:f` > 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[]}};Zi=A([k.register],Zi);var Zs=class{},Qi=class extends k{get OptionsClass(){return Zs}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 $([S.code,S.yaml,S.link,S.wikiLink,S.tag],t,i=>i.replace(/\b[-‐] \b/g,""))}get exampleBuilders(){return[new v({description:"Removing hyphenated line breaks.",before:f` This text has a linebr‐ eak. `,after:f` This text has a linebreak. `})]}get optionBuilders(){return[]}};Qi=A([k.register],Qi);var Qs=class{},pn=class extends k{get OptionsClass(){return Qs}get name(){return"Remove Hyphens on Paste"}get description(){return"Removes hyphens from the text to paste"}get type(){return"Paste"}apply(t,n){return t.replace(/(\S)[-‐]\s+\n?(?=\w)/g,"$1")}get exampleBuilders(){return[new v({description:"Remove hyphen in content to paste",before:f` Text that was cool but hyper- tension made it uncool. `,after:f` Text that was cool but hypertension made it uncool. `})]}get optionBuilders(){return[]}};pn=A([k.register],pn);var Xs=class{},cn=class extends k{get OptionsClass(){return Xs}get name(){return"Remove Leading or Trailing Whitespace on Paste"}get description(){return"Removes any leading non-tab whitespace and all trailing whitespace for the text to paste"}get type(){return"Paste"}apply(t,n){return t.replace(/^[\n ]+|\s+$/g,"")}get exampleBuilders(){return[new v({description:"Removes leading spaces and newline characters",before:f` ${""} ${""} This text was really indented ${""} `,after:f` This text was really indented `}),new v({description:"Leaves leading tabs alone",before:f` ${""} ${""} \t\tThis text is really indented ${""} `,after:" This text is really indented"})]}get optionBuilders(){return[]}};cn=A([k.register],cn);var Js=class{},mn=class extends k{get OptionsClass(){return Js}get name(){return"Remove Leftover Footnotes from Quote on Paste"}get description(){return"Removes any leftover footnote references for the text to paste"}get type(){return"Paste"}apply(t,n){return t.replace(/(\D)[.,]\d+/g,"$1")}get exampleBuilders(){return[new v({description:"Footnote reference removed",before:f` He was sure that he would get off without doing any time, but the cops had other plans.50 ${""} _Note that the format for footnote references to move is a dot or comma followed by any number of digits_ `,after:f` He was sure that he would get off without doing any time, but the cops had other plans ${""} _Note that the format for footnote references to move is a dot or comma followed by any number of digits_ `})]}get optionBuilders(){return[]}};mn=A([k.register],mn);var ea=class{},Xi=class extends k{get OptionsClass(){return ea}get name(){return"Remove link spacing"}get description(){return"Removes spacing around link text."}get type(){return"Spacing"}apply(t,n){return t=xu(t),vl(t)}get exampleBuilders(){return[new v({description:"Space in regular markdown link text",before:f` [ 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:f` [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 v({description:"Space in wiki link text",before:f` [[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:f` [[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[]}};Xi=A([k.register],Xi);var ta=class{},dn=class extends k{get OptionsClass(){return ta}get name(){return"Remove Multiple Blank Lines on Paste"}get description(){return"Condenses multiple blank lines down into one blank line for the text to paste"}get type(){return"Paste"}apply(t,n){return t.replace(/\n{3,}/g,` `)}get exampleBuilders(){return[new v({description:"Multiple blanks lines condensed down to one",before:f` Here is the first line. ${""} ${""} ${""} ${""} Here is some more text. `,after:f` Here is the first line. ${""} Here is some more text. `}),new v({description:"Text with only one blank line in a row is left alone",before:f` First line. ${""} Last line. `,after:f` First line. ${""} Last line. `})]}get optionBuilders(){return[]}};dn=A([k.register],dn);var na=class{},Ji=class extends k{get OptionsClass(){return na}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 $([S.table,S.code,S.yaml,S.link,S.wikiLink,S.tag],t,i=>i.replace(/(?!^>)([^\s])( ){2,}([^\s])/gm,"$1 $3"))}get exampleBuilders(){return[new v({description:"Removing double and triple space.",before:f` Lorem ipsum dolor sit amet. `,after:f` Lorem ipsum dolor sit amet. `})]}get optionBuilders(){return[]}};Ji=A([k.register],Ji);var ia=class{},er=class extends k{get OptionsClass(){return ia}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 i=/([ \t])+([\u2013\u2014\u2026\u3001\u3002\u300a\u300d-\u300f\u3014\u3015\u3008-\u3011\uff00-\uffff])/g,r=/([\u2013\u2014\u2026\u3001\u3002\u300a\u300d-\u300f\u3014\u3015\u3008-\u3011\uff00-\uffff])([ \t])+/g,o=function(a){return a.replace(i,"$2").replace(r,"$1")},s=$([S.code,S.yaml,S.link,S.wikiLink,S.tag,S.list],t,o);return s=Su(s,o),s}get exampleBuilders(){return[new v({description:"Remove Spaces and Tabs around Fullwidth Characters",before:f` 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:f` 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 v({description:"Fullwidth Characters in List Do not Affect List Markdown Syntax",before:f` # 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:f` # 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[]}};er=A([k.register],er);var vo=class{constructor(){this.yamlKeysToRemove=[]}},tr=class extends k{get OptionsClass(){return vo}get name(){return"Remove YAML Keys"}get description(){return"Removes the YAML keys specified"}get type(){return"YAML"}apply(t,n){let i=n.yamlKeysToRemove,r=t.match(ke);if(!r||i.length===0)return t;let o=r[1];for(let s of i){let a=s.trim();a.endsWith(":")&&(a=a.substring(0,a.length-1)),o=Ut(o,a)}return t.replace(r[1],o)}get exampleBuilders(){return[new v({description:'Removes the values specified in `YAML Keys to Remove` = "status:\nkeywords\ndate"',before:f` --- language: Typescript type: programming tags: computer keywords: - keyword1 - keyword2 status: WIP date: 02/15/2022 --- ${""} # Header Context ${""} Text `,after:f` --- language: Typescript type: programming tags: computer --- ${""} # Header Context ${""} Text `,options:{yamlKeysToRemove:["status:","keywords","date"]}})]}get optionBuilders(){return[new Ae({OptionsClass:vo,name:"YAML Keys to Remove",description:"The yaml keys to remove from the yaml frontmatter with or without colons",optionsKey:"yamlKeysToRemove"})]}};tr=A([k.register],tr);var ra=class{},nr=class extends k{get OptionsClass(){return ra}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 $([S.code,S.yaml,S.link,S.wikiLink,S.tag],t,i=>(i=i.replace(/^(\s*\d+\.|\s*[-+*])[^\S\r\n]+/gm,"$1 "),i.replace(/^(\s*\d+\.|\s*[-+*]\s+\[[ xX]\])[^\S\r\n]+/gm,"$1 ")))}get exampleBuilders(){return[new v({description:"",before:f` 1. Item 1 2. Item 2 ${""} - [ ] Item 1 - [x] Item 2 \t- [ ] Item 3 `,after:f` 1. Item 1 2. Item 2 ${""} - [ ] Item 1 - [x] Item 2 \t- [ ] Item 3 `})]}get optionBuilders(){return[]}};nr=A([k.register],nr);var oa=class{},ir=class extends k{get OptionsClass(){return oa}get name(){return"Space between Chinese Japanese or Korean and English or numbers"}get description(){return"Ensures that Chinese, Japanese, or Korean 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 i=/(\p{sc=Han}|\p{sc=Katakana}|\p{sc=Hiragana}|\p{sc=Hangul})( *)(\[[^[]*\]\(.*\)|`[^`]*`|\w+|[-+'"([{¥$]|\*[^*])/gmu,r=/(\[[^[]*\]\(.*\)|`[^`]*`|\w+|[-+;:'"°%$)\]}]|[^*]\*)( *)(\p{sc=Han}|\p{sc=Katakana}|\p{sc=Hiragana}|\p{sc=Hangul})/gmu,o=function(a){return a.replace(i,"$1 $3").replace(r,"$1 $3")},s=$([S.code,S.inlineCode,S.yaml,S.image,S.link,S.wikiLink,S.tag,S.italics,S.bold,S.math,S.inlineMath],t,o);return s=vu(s,o),s=ku(s,o),s}get exampleBuilders(){return[new v({description:"Space between Chinese and English",before:f` 中文字符串english中文字符串。 `,after:f` 中文字符串 english 中文字符串。 `}),new v({description:"Space between Chinese and link",before:f` 中文字符串[english](http://example.com)中文字符串。 `,after:f` 中文字符串 [english](http://example.com) 中文字符串。 `}),new v({description:"Space between Chinese and inline code block",before:f` 中文字符串\`code\`中文字符串。 `,after:f` 中文字符串 \`code\` 中文字符串。 `}),new v({description:"No space between Chinese and English in tag",before:f` #标签A #标签2标签 `,after:f` #标签A #标签2标签 `}),new v({description:"Make sure that spaces are not added between italics and chinese characters to preserve markdown syntax",before:f` _这是一个数学公式_ *这是一个数学公式english* ${""} # Handling bold and italics nested in each other is not supported at this time ${""} **_这是一_个数学公式** *这是一hello__个数学world公式__* `,after:f` _这是一个数学公式_ *这是一个数学公式 english* ${""} # Handling bold and italics nested in each other is not supported at this time ${""} **_ 这是一 _ 个数学公式** *这是一 hello__ 个数学 world 公式 __* `}),new v({description:"Images and links are ignored",before:f` [[这是一个数学公式english]] ![[这是一个数学公式english.jpg]] [这是一个数学公式english](这是一个数学公式english.md) ![这是一个数学公式english](这是一个数学公式english.jpg) `,after:f` [[这是一个数学公式english]] ![[这是一个数学公式english.jpg]] [这是一个数学公式english](这是一个数学公式english.md) ![这是一个数学公式english](这是一个数学公式english.jpg) `}),new v({description:"Space between CJK and English",before:f` 日本語englishひらがな カタカナenglishカタカナ ハンカクカタカナenglish123全角数字 한글english한글 `,after:f` 日本語 english ひらがな カタカナ english カタカナ ハンカクカタカナ english123全角数字 한글 english 한글 `})]}get optionBuilders(){return[]}};ir=A([k.register],ir);var ko=class{constructor(){this.style="consistent"}},rr=class extends k{get OptionsClass(){return ko}get name(){return"Strong Style"}get description(){return"Makes sure the strong style is consistent."}get type(){return"Content"}apply(t,n){return $([S.code,S.yaml,S.link,S.wikiLink,S.tag,S.math,S.inlineMath],t,i=>uo(i,n.style,"strong"))}get exampleBuilders(){return[new v({description:"Strong indicators should use underscores when style is set to 'underscore'",before:f` # 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:f` # 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 v({description:"Strong indicators should use asterisks when style is set to 'asterisk'",before:f` # 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:f` # 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 v({description:"Strong indicators should use consistent style based on first strong indicator in a file when style is set to 'consistent'",before:f` # 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:f` # 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 v({description:"Strong indicators should use consistent style based on first strong indicator in a file when style is set to 'consistent'",before:f` # 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:f` # 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 ye({OptionsClass:ko,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"}]})]}};rr=A([k.register],rr);var So=class{constructor(){this.twoSpaceLineBreak=!1}},or=class extends k{get OptionsClass(){return So}get name(){return"Trailing spaces"}get description(){return"Removes extra spaces after every line."}get type(){return"Spacing"}apply(t,n){return $([S.code,S.yaml,S.link,S.wikiLink,S.tag],t,i=>n.twoSpaceLineBreak?(i=i.replace(/(\S)[ \t]$/gm,"$1"),i=i.replace(/(\S)[ \t]{3,}$/gm,"$1"),i=i.replace(/(\S)( ?\t\t? ?)$/gm,"$1"),i):i.replace(/[ \t]+$/gm,""))}get exampleBuilders(){return[new v({description:"Removes trailing spaces and tabs.",before:f` # H1 Line with trailing spaces and tabs. ${""} `,after:f` # H1 Line with trailing spaces and tabs. `}),new v({description:"With `Two Space Linebreak = true`",before:f` # H1 Line with trailing spaces and tabs. ${""} `,after:f` # H1 Line with trailing spaces and tabs. ${""} `,options:{twoSpaceLineBreak:!0}})]}get optionBuilders(){return[new te({OptionsClass:So,name:"Two Space Linebreak",description:'Ignore two spaces followed by a line break ("Two Space Rule").',optionsKey:"twoSpaceLineBreak"})]}};or=A([k.register],or);var sa=class{},sr=class extends k{get OptionsClass(){return sa}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 $([S.obsidianMultiLineComments,S.yaml,S.table],t,bu)}get exampleBuilders(){return[new v({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:f` # 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:f` # 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[]}};sr=A([k.register],sr);var To=class{constructor(){this.listStyle="consistent"}},ar=class extends k{get OptionsClass(){return To}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 $([S.code,S.yaml,S.tag],t,i=>Eu(i,n.listStyle))}get exampleBuilders(){return[new v({description:"Unordered lists have their indicator updated to `*` when `List item style = 'consistent'` and `*` is the first unordered list indicator",before:f` 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:f` 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 v({description:"Unordered lists have their indicator updated to `-` when `List item style = '-'`",before:f` - 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:f` - 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 v({description:"Unordered lists have their indicator updated to `*` when `List item style = '*'`",before:f` - 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:f` * 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 v({description:"Unordered list in blockquote has list item indicators set to `+` when `List item style = '-'`",before:f` > - Item 1 > + Item 2 > > * Subitem 1 > > + Subitem 2 > > - Sub sub item 1 > > - Subitem 3 `,after:f` > + Item 1 > + Item 2 > > + Subitem 1 > > + Subitem 2 > > + Sub sub item 1 > > + Subitem 3 `,options:{listStyle:"+"}})]}get optionBuilders(){return[new ye({OptionsClass:To,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"}]})]}};ar=A([k.register],ar);var Tt=class{constructor(){this.priorityKeysAtStartOfYaml=!0;this.yamlKeyPrioritySortOrder=[];this.yamlSortOrderForOtherKeys="None"}};A([k.noSettingControl()],Tt.prototype,"dateModifiedKey",2),A([k.noSettingControl()],Tt.prototype,"currentTimeFormatted",2),A([k.noSettingControl()],Tt.prototype,"yamlTimestampDateModifiedEnabled",2);var fn=class extends k{get OptionsClass(){return Tt}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 i=t.match(ke);if(!i)return t;let r=i[1],o=n.priorityKeysAtStartOfYaml,s=function(O,L){return O==L?L:Te(L,n.dateModifiedKey," "+n.currentTimeFormatted)},a=function(O,L,M){let T=`${L}${O}`;return M&&(T=`${O}${L}`),n.yamlTimestampDateModifiedEnabled&&(T=s(i[1],T)),t.replace(i[1],T)},l=function(O,L){let M="";for(let T of L){let B=Oe(O,T);B!==null&&(B.includes(` `)?M+=`${T}:${B} `:M+=`${T}: ${B} `,O=Ut(O,T))}return{remainingYaml:O,sortedYamlKeyValues:M}},u=n.yamlKeyPrioritySortOrder,p=l(r,u),m=p.sortedYamlKeyValues;r=p.remainingYaml;let c=n.yamlSortOrderForOtherKeys,d=Je(r);if(d==null)return a(m,r,o);let h=function(O,L){return O=O.toLowerCase(),L=L.toLowerCase(),O>L?-1:L>O?1:0},g=function(O,L){return O=O.toLowerCase(),L=L.toLowerCase(),O{let s=` ${n.dateCreatedKey}: [^ ]+ `,a=` ${n.dateCreatedKey}:[ ]* `,l=new RegExp(a),u=new RegExp(s);if(n.dateCreated){let p=(0,Ot.moment)(n.fileCreatedTime);p.locale(n.locale);let m=p.format(n.format),c=` ${n.dateCreatedKey}: ${m}`,d=u.test(o);if(!d&&l.test(o))o=o.replace(l,De(c)+` `),i=!0;else if(d){if(d){let h=(0,Ot.moment)(o.match(u)[0].replace(n.dateCreatedKey+":","").trim(),n.format,n.locale,!0);(h==null||!h.isValid())&&(o=o.replace(u,De(c)+` `),i=!0)}}else{let h=o.indexOf(` ---`);o=jt(o,h,` ${n.dateCreatedKey}: ${m}`),i=!0}}if(n.dateModified){let p=` ${n.dateModifiedKey}: [^ ]+ `,m=` ${n.dateModifiedKey}:[ ]* `,c=new RegExp(m),d=new RegExp(p),h=(0,Ot.moment)(n.fileModifiedTime);h.locale(n.locale);let g=n.currentTime.format(n.format),w=` ${n.dateModifiedKey}: ${g}`,y=d.test(o);if(y){let E=(0,Ot.moment)(o.match(d)[0].replace(n.dateModifiedKey+":","").trim(),n.format,n.locale,!0);(i||E==null||!E.isValid()||Math.abs(E.diff(h,"seconds"))>5)&&(o=o.replace(d,De(w)+` `))}else if(c.test(o))o=o.replace(c,De(w)+` `);else if(!y){let E=o.indexOf(` ---`);o=jt(o,E,w)}}return o})}get exampleBuilders(){return[new v({description:"Adds a header with the date.",before:f` # H1 `,after:f` --- 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,Ot.moment)("Thursday, January 2nd 2020, 12:00:05 am","dddd, MMMM Do YYYY, h:mm:ss a"),alreadyModified:!1}}),new v({description:"dateCreated option is false",before:f` # H1 `,after:f` --- 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,Ot.moment)("Thursday, January 2nd 2020, 12:00:05 am","dddd, MMMM Do YYYY, h:mm:ss a"),alreadyModified:!1}}),new v({description:"Date Created Key is set",before:f` # H1 `,after:f` --- 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,Ot.moment)("Thursday, January 2nd 2020, 12:00:03 am","dddd, MMMM Do YYYY, h:mm:ss a"),alreadyModified:!1}}),new v({description:"Date Modified Key is set",before:f` # H1 `,after:f` --- 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,Ot.moment)("Wednesday, January 1st 2020, 4:00:00 pm","dddd, MMMM Do YYYY, h:mm:ss a"),alreadyModified:!1}})]}get optionBuilders(){return[new te({OptionsClass:Qe,name:"Date Created",description:"Insert the file creation date",optionsKey:"dateCreated"}),new Zt({OptionsClass:Qe,name:"Date Created Key",description:"Which YAML key to use for creation date",optionsKey:"dateCreatedKey"}),new te({OptionsClass:Qe,name:"Date Modified",description:"Insert the date the file was last modified",optionsKey:"dateModified"}),new Zt({OptionsClass:Qe,name:"Date Modified Key",description:"Which YAML key to use for modification date",optionsKey:"dateModifiedKey"}),new Gr({OptionsClass:Qe,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}};Pt=A([k.register],Pt);var At=class{constructor(){this.preserveExistingAliasesSectionStyle=!0;this.keepAliasThatMatchesTheFilename=!1;this.useYamlKeyToKeepTrackOfOldFilenameOrHeading=!0;this.aliasArrayStyle="multi-line";this.defaultEscapeCharacter='"'}};A([k.noSettingControl()],At.prototype,"aliasArrayStyle",2),A([k.noSettingControl()],At.prototype,"fileName",2),A([k.noSettingControl()],At.prototype,"defaultEscapeCharacter",2);var lr=class extends k{get OptionsClass(){return At}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=ft(t);let i=$([S.code,S.yaml,S.tag],t,Rr);i=i||n.fileName;let r=null,o=t.match(ke)[1],s=!n.keepAliasThatMatchesTheFilename&&i===n.fileName;n.useYamlKeyToKeepTrackOfOldFilenameOrHeading&&(r=Je(Oe(o,ui)));let a=o.replace(`--- `,"").replace(` ---`,""),l=Je(o);r=Je(Oe(o,ui)),i=kt(i,n.defaultEscapeCharacter);let u=function(c,d){if(c==null)return d?"":i;if(typeof c=="string")d?c===i&&(c=""):r===c?c=i:c=[i,c];else if(r!==null){let h=c.indexOf(r);h!==-1&&(d?c.splice(h,1):c[h]=i)}else{let h=c.indexOf(i);h!==-1?d&&c.splice(h,1):d||(c=[i,...c])}return c===""||c.length===0?"":c},p=null,m=Object.keys(l);for(let c of li)if(m.includes(c)){p=c;break}if(p!=null){let c=Oe(a,p),d="multi-line",h=c==="",g=!1;c.includes(` `)||(c.match(/^\[.*\]/)===null?(d="single string to single-line",g=!0):d="single-line");let w=$r(ht(c)),y=u(w,s);y===""?a=Ut(a,p):n.preserveExistingAliasesSectionStyle?!h&&(g&&i==y||!g||w==y)?a=Te(a,p,Ge(y,d)):a=Te(a,p,Ge(y,n.aliasArrayStyle)):a=Te(a,p,Ge(y,n.aliasArrayStyle))}else s||(a=Te(a,ss,Ge(i,n.aliasArrayStyle)));return!n.useYamlKeyToKeepTrackOfOldFilenameOrHeading||s?a=Ut(a,ui):a=Te(a,ui,` ${i}`),t=t.replace(`--- ${o}--- `,`--- ${a}--- `),t}get exampleBuilders(){return[new v({description:"Adds a header with the title from heading.",before:f` # Obsidian `,after:f` --- aliases: - Obsidian linter-yaml-title-alias: Obsidian --- # Obsidian `}),new v({description:"Adds a header with the title from heading without YAML key when the use of the YAML key is set to false.",before:f` # Obsidian `,after:f` --- aliases: - Obsidian --- # Obsidian `,options:{useYamlKeyToKeepTrackOfOldFilenameOrHeading:!1}}),new v({description:"Adds a header with the title.",before:f` ${""} `,after:f` --- aliases: - Filename linter-yaml-title-alias: Filename --- ${""} `,options:{fileName:"Filename",keepAliasThatMatchesTheFilename:!0}}),new v({description:"Adds a header with the title without YAML key when the use of the YAML key is set to false.",before:f` ${""} `,after:f` --- aliases: - Filename --- ${""} `,options:{fileName:"Filename",keepAliasThatMatchesTheFilename:!0,useYamlKeyToKeepTrackOfOldFilenameOrHeading:!1}}),new v({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:f` --- aliases: - Old Filename - Alias 2 linter-yaml-title-alias: Old Filename --- ${""} `,after:f` --- aliases: - Filename - Alias 2 linter-yaml-title-alias: Filename --- ${""} `,options:{fileName:"Filename",keepAliasThatMatchesTheFilename:!0}}),new v({description:"Make sure that markdown and wiki links in first H1 get their values converted to text",before:f` # This is a [Heading](markdown.md) `,after:f` --- aliases: - This is a Heading linter-yaml-title-alias: This is a Heading --- # This is a [Heading](markdown.md) `,options:{aliasArrayStyle:"multi-line"}})]}get optionBuilders(){return[new te({OptionsClass:At,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 te({OptionsClass:At,name:"Keep alias that matches the filename",description:"Such aliases are usually redundant",optionsKey:"keepAliasThatMatchesTheFilename"}),new te({OptionsClass:At,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"})]}};lr=A([k.register],lr);var Nn=class{constructor(){this.defaultEscapeCharacter='"';this.titleKey="title"}};A([k.noSettingControl()],Nn.prototype,"fileName",2),A([k.noSettingControl()],Nn.prototype,"defaultEscapeCharacter",2);var ur=class extends k{get OptionsClass(){return Nn}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=ft(t);let i=$([S.code,S.yaml,S.tag],t,Rr);return i=i||n.fileName,i=kt(i,n.defaultEscapeCharacter),Se(t,r=>{let o=` ${n.titleKey}.* `,s=new RegExp(o);if(s.test(r))r=r.replace(s,De(` ${n.titleKey}: ${i} `));else{let a=r.indexOf(` ---`);r=jt(r,a,` ${n.titleKey}: ${i}`)}return r})}get exampleBuilders(){return[new v({description:"Adds a header with the title from heading.",before:f` # Obsidian `,after:f` --- title: Obsidian --- # Obsidian `,options:{fileName:"Filename"}}),new v({description:"Adds a header with the title.",before:f` ${""} `,after:f` --- title: Filename --- ${""} `,options:{fileName:"Filename"}}),new v({description:"Make sure that markdown links in headings are properly copied to the yaml as just the text",before:f` # This is a [Heading](test heading.md) `,after:f` --- title: This is a Heading --- # This is a [Heading](test heading.md) `})]}get optionBuilders(){return[new Zt({OptionsClass:Nn,name:"Title Key",description:"Which YAML key to use for title",optionsKey:"titleKey"})]}};ur=A([k.register],ur);var Ph=` `,Nh=` `,Hh=` `,zh=` `,Yh=` `,qh=` `,Kh=` `,jh=` `,Vh=` `,Wh=` `,Uh=` `,Gh=` `,Ie={folder:{id:"lint-folder",source:Nh},file:{id:"lint-file",source:Ph},vault:{id:"lint-vault",source:Hh},whitespace:{id:"lint-whitespace",source:zh},math:{id:"lint-math",source:Yh},content:{id:"lint-content",source:qh},paste:{id:"lint-paste",source:Kh},custom:{id:"lint-custom",source:jh},heading:{id:"lint-heading",source:Vh},footer:{id:"lint-footer",source:Wh},yaml:{id:"lint-yaml",source:Uh},general:{id:"lint-general",source:Gh}};var Hn=require("obsidian");var Oo=class{constructor(){this.disabledRules=[]}lintText(t){let n=t.oldText;this.disabledRules=Ol(n);let i=this.runBeforeRegularRules(t);for(let r of gt){if(this.disabledRules.includes(r.alias())){St(r.alias()+" is disabled");continue}else if(r.hasSpecialExecutionOrder||r.type==="Paste")continue;[i]=st.applyIfEnabledBase(r,i,t.settings,{fileCreatedTime:t.fileInfo.createdAtFormatted,fileModifiedTime:t.fileInfo.modifiedAtFormatted,fileName:t.fileInfo.name,locale:t.momentLocale,minimumNumberOfDollarSignsToBeAMathBlock:t.settings.commonStyles.minimumNumberOfDollarSignsToBeAMathBlock,aliasArrayStyle:t.settings.commonStyles.aliasArrayStyle,tagArrayStyle:t.settings.commonStyles.tagArrayStyle,defaultEscapeCharacter:t.settings.commonStyles.escapeCharacter})}return i=this.runCustomRegexReplacement(t.settings.customRegexes,i),t.oldText=i,this.runAfterRegularRules(n,t)}runBeforeRegularRules(t){let n=t.oldText;return[n]=on.applyIfEnabled(n,t.settings,this.disabledRules),[n]=nn.applyIfEnabled(n,t.settings,this.disabledRules,{defaultEscapeCharacter:t.settings.commonStyles.escapeCharacter}),n}runAfterRegularRules(t,n){let i=n.oldText;[i]=rn.applyIfEnabled(i,n.settings,this.disabledRules,{defaultEscapeCharacter:n.settings.commonStyles.escapeCharacter});let r=n.getCurrentTime(),o;[i,o]=Pt.applyIfEnabled(i,n.settings,this.disabledRules,{fileCreatedTime:n.fileInfo.createdAtFormatted,fileModifiedTime:n.fileInfo.modifiedAtFormatted,currentTime:r,alreadyModified:t!=i,locale:n.momentLocale});let s=Pt.getRuleOptions(n.settings);return r=n.getCurrentTime(),[i]=fn.applyIfEnabled(i,n.settings,this.disabledRules,{currentTimeFormatted:r.format(s.format),yamlTimestampDateModifiedEnabled:o&&s.dateModified,dateModifiedKey:s.dateModifiedKey}),i}runCustomCommands(t,n){St("Running Custom Lint Commands");let i=new Set;for(let r of t){if(r.id){if(i.has(r.id)){Wr(`You cannot run the same command ("${r.name}") as a custom lint rule twice.`);continue}}else continue;try{i.add(r.id),n.executeCommandById(r.id)}catch(o){Kr(o,`Custom Lint Command ${r.id}`)}}}runCustomRegexReplacement(t,n){St("Running Custom Regex");let i=n;for(let r of t){if(r.find==null||r.replace===void 0||r.replace===null)continue;let o=new RegExp(`${r.find}`,r.flags);i=i.replace(o,r.replace)}return i}runPasteLint(t,n){let i=n.oldText;return[i]=pn.applyIfEnabled(i,n.settings,[]),[i]=dn.applyIfEnabled(i,n.settings,[]),[i]=mn.applyIfEnabled(i,n.settings,[]),[i]=ln.applyIfEnabled(i,n.settings,[]),[i]=cn.applyIfEnabled(i,n.settings,[]),[i]=sn.applyIfEnabled(i,n.settings,[],{lineContent:t}),[i]=an.applyIfEnabled(i,n.settings,[],{lineContent:t}),[i]=Qt.applyIfEnabled(i,n.settings,[],{lineContent:t}),i}};function pr(e,t=null,n,i){let r=t?(0,Hn.moment)(t.stat.ctime):(0,Hn.moment)();r.locale(n);let o=t?(0,Hn.moment)(t.stat.mtime):(0,Hn.moment)();o.locale(n);let s=o.format(),a=r.format();return{oldText:e,fileInfo:{name:t?t.basename:"",createdAtFormatted:a,modifiedAtFormatted:s},settings:i,momentLocale:n,getCurrentTime:()=>{let l=(0,Hn.moment)();return l.locale(n),l}}}var Ao=require("obsidian"),cr=class extends Ao.Modal{constructor(t,n,i,r,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",s=>{s.createEl("button",{text:"Cancel"}).addEventListener("click",()=>this.close());let a=s.createEl("button",{attr:{type:"submit"},cls:"mod-cta",text:i});a.addEventListener("click",async l=>{new Ao.Notice(r),this.close(),await o()}),setTimeout(()=>{a.focus()},50)})}};var de=require("obsidian");var op=require("obsidian");var ip=require("obsidian");var Fu=require("obsidian");var zn=class{constructor(t,n,i,r,o,s,a,l,u){this.containerEl=t;this.name=n;this.description=i;this.warning=r;this.addInputBtnText=o;this.isMobile=s;this.app=a;this.saveSettings=l;this.onAddInput=u}display(){this.containerEl.createEl(this.isMobile?"h4":"h3",{text:this.name}),ze(this.description,this.containerEl),this.warning!=null&&this.containerEl.createEl("p",{text:this.warning,cls:"mod-warning"}),new Fu.Setting(this.containerEl).addButton(t=>{t.setButtonText(this.addInputBtnText).setCta().onClick(()=>this.onAddInput())}),this.inputElDiv=this.containerEl.createDiv(),this.showInputEls()}resetInputEls(){this.inputElDiv.empty(),this.showInputEls()}};var np=require("obsidian");var pe="top",we="bottom",he="right",me="left",Co="auto",Nt=[pe,we,he,me],Ct="start",hn="end",Ru="clippingParents",Eo="viewport",Yn="popper",Du="reference",aa=Nt.reduce(function(e,t){return e.concat([t+"-"+Ct,t+"-"+hn])},[]),Lo=[].concat(Nt,[Co]).reduce(function(e,t){return e.concat([t,t+"-"+Ct,t+"-"+hn])},[]),Zh="beforeRead",Qh="read",Xh="afterRead",Jh="beforeMain",eg="main",tg="afterMain",ng="beforeWrite",ig="write",rg="afterWrite",$u=[Zh,Qh,Xh,Jh,eg,tg,ng,ig,rg];function Ce(e){return e?(e.nodeName||"").toLowerCase():null}function ue(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function tt(e){var t=ue(e).Element;return e instanceof t||e instanceof Element}function xe(e){var t=ue(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function qn(e){if(typeof ShadowRoot>"u")return!1;var t=ue(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function og(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var i=t.styles[n]||{},r=t.attributes[n]||{},o=t.elements[n];!xe(o)||!Ce(o)||(Object.assign(o.style,i),Object.keys(r).forEach(function(s){var a=r[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function sg(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(i){var r=t.elements[i],o=t.attributes[i]||{},s=Object.keys(t.styles.hasOwnProperty(i)?t.styles[i]:n[i]),a=s.reduce(function(l,u){return l[u]="",l},{});!xe(r)||!Ce(r)||(Object.assign(r.style,a),Object.keys(o).forEach(function(l){r.removeAttribute(l)}))})}}var Pu={name:"applyStyles",enabled:!0,phase:"write",fn:og,effect:sg,requires:["computeStyles"]};function Ee(e){return e.split("-")[0]}var lt=Math.max,gn=Math.min,Et=Math.round;function Kn(){var e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function mr(){return!/^((?!chrome|android).)*safari/i.test(Kn())}function nt(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var i=e.getBoundingClientRect(),r=1,o=1;t&&xe(e)&&(r=e.offsetWidth>0&&Et(i.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Et(i.height)/e.offsetHeight||1);var s=tt(e)?ue(e):window,a=s.visualViewport,l=!mr()&&n,u=(i.left+(l&&a?a.offsetLeft:0))/r,p=(i.top+(l&&a?a.offsetTop:0))/o,m=i.width/r,c=i.height/o;return{width:m,height:c,top:p,right:u+m,bottom:p+c,left:u,x:u,y:p}}function yn(e){var t=nt(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function dr(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&qn(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function Ke(e){return ue(e).getComputedStyle(e)}function la(e){return["table","td","th"].indexOf(Ce(e))>=0}function Me(e){return((tt(e)?e.ownerDocument:e.document)||window.document).documentElement}function Lt(e){return Ce(e)==="html"?e:e.assignedSlot||e.parentNode||(qn(e)?e.host:null)||Me(e)}function Nu(e){return!xe(e)||Ke(e).position==="fixed"?null:e.offsetParent}function ag(e){var t=/firefox/i.test(Kn()),n=/Trident/i.test(Kn());if(n&&xe(e)){var i=Ke(e);if(i.position==="fixed")return null}var r=Lt(e);for(qn(r)&&(r=r.host);xe(r)&&["html","body"].indexOf(Ce(r))<0;){var o=Ke(r);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 r;r=r.parentNode}return null}function ut(e){for(var t=ue(e),n=Nu(e);n&&la(n)&&Ke(n).position==="static";)n=Nu(n);return n&&(Ce(n)==="html"||Ce(n)==="body"&&Ke(n).position==="static")?t:n||ag(e)||t}function bn(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function wn(e,t,n){return lt(e,gn(t,n))}function Hu(e,t,n){var i=wn(e,t,n);return i>n?n:i}function fr(){return{top:0,right:0,bottom:0,left:0}}function hr(e){return Object.assign({},fr(),e)}function gr(e,t){return t.reduce(function(n,i){return n[i]=e,n},{})}var lg=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,hr(typeof t!="number"?t:gr(t,Nt))};function ug(e){var t,n=e.state,i=e.name,r=e.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Ee(n.placement),l=bn(a),u=[me,he].indexOf(a)>=0,p=u?"height":"width";if(!(!o||!s)){var m=lg(r.padding,n),c=yn(o),d=l==="y"?pe:me,h=l==="y"?we:he,g=n.rects.reference[p]+n.rects.reference[l]-s[l]-n.rects.popper[p],w=s[l]-n.rects.reference[l],y=ut(o),E=y?l==="y"?y.clientHeight||0:y.clientWidth||0:0,O=g/2-w/2,L=m[d],M=E-c[p]-m[h],T=E/2-c[p]/2+O,B=wn(L,T,M),I=l;n.modifiersData[i]=(t={},t[I]=B,t.centerOffset=B-T,t)}}function pg(e){var t=e.state,n=e.options,i=n.element,r=i===void 0?"[data-popper-arrow]":i;r!=null&&(typeof r=="string"&&(r=t.elements.popper.querySelector(r),!r)||!dr(t.elements.popper,r)||(t.elements.arrow=r))}var zu={name:"arrow",enabled:!0,phase:"main",fn:ug,effect:pg,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function it(e){return e.split("-")[1]}var cg={top:"auto",right:"auto",bottom:"auto",left:"auto"};function mg(e){var t=e.x,n=e.y,i=window,r=i.devicePixelRatio||1;return{x:Et(t*r)/r||0,y:Et(n*r)/r||0}}function Yu(e){var t,n=e.popper,i=e.popperRect,r=e.placement,o=e.variation,s=e.offsets,a=e.position,l=e.gpuAcceleration,u=e.adaptive,p=e.roundOffsets,m=e.isFixed,c=s.x,d=c===void 0?0:c,h=s.y,g=h===void 0?0:h,w=typeof p=="function"?p({x:d,y:g}):{x:d,y:g};d=w.x,g=w.y;var y=s.hasOwnProperty("x"),E=s.hasOwnProperty("y"),O=me,L=pe,M=window;if(u){var T=ut(n),B="clientHeight",I="clientWidth";if(T===ue(n)&&(T=Me(n),Ke(T).position!=="static"&&a==="absolute"&&(B="scrollHeight",I="scrollWidth")),T=T,r===pe||(r===me||r===he)&&o===hn){L=we;var P=m&&T===M&&M.visualViewport?M.visualViewport.height:T[B];g-=P-i.height,g*=l?1:-1}if(r===me||(r===pe||r===we)&&o===hn){O=he;var K=m&&T===M&&M.visualViewport?M.visualViewport.width:T[I];d-=K-i.width,d*=l?1:-1}}var z=Object.assign({position:a},u&&cg),j=p===!0?mg({x:d,y:g}):{x:d,y:g};if(d=j.x,g=j.y,l){var F;return Object.assign({},z,(F={},F[L]=E?"0":"",F[O]=y?"0":"",F.transform=(M.devicePixelRatio||1)<=1?"translate("+d+"px, "+g+"px)":"translate3d("+d+"px, "+g+"px, 0)",F))}return Object.assign({},z,(t={},t[L]=E?g+"px":"",t[O]=y?d+"px":"",t.transform="",t))}function dg(e){var t=e.state,n=e.options,i=n.gpuAcceleration,r=i===void 0?!0:i,o=n.adaptive,s=o===void 0?!0:o,a=n.roundOffsets,l=a===void 0?!0:a;if(!1)var u;var p={placement:Ee(t.placement),variation:it(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Yu(Object.assign({},p,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Yu(Object.assign({},p,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var qu={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:dg,data:{}};var _o={passive:!0};function fg(e){var t=e.state,n=e.instance,i=e.options,r=i.scroll,o=r===void 0?!0:r,s=i.resize,a=s===void 0?!0:s,l=ue(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach(function(p){p.addEventListener("scroll",n.update,_o)}),a&&l.addEventListener("resize",n.update,_o),function(){o&&u.forEach(function(p){p.removeEventListener("scroll",n.update,_o)}),a&&l.removeEventListener("resize",n.update,_o)}}var Ku={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:fg,data:{}};var hg={left:"right",right:"left",bottom:"top",top:"bottom"};function jn(e){return e.replace(/left|right|bottom|top/g,function(t){return hg[t]})}var gg={start:"end",end:"start"};function Bo(e){return e.replace(/start|end/g,function(t){return gg[t]})}function xn(e){var t=ue(e),n=t.pageXOffset,i=t.pageYOffset;return{scrollLeft:n,scrollTop:i}}function vn(e){return nt(Me(e)).left+xn(e).scrollLeft}function ua(e,t){var n=ue(e),i=Me(e),r=n.visualViewport,o=i.clientWidth,s=i.clientHeight,a=0,l=0;if(r){o=r.width,s=r.height;var u=mr();(u||!u&&t==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}return{width:o,height:s,x:a+vn(e),y:l}}function pa(e){var t,n=Me(e),i=xn(e),r=(t=e.ownerDocument)==null?void 0:t.body,o=lt(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=lt(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-i.scrollLeft+vn(e),l=-i.scrollTop;return Ke(r||n).direction==="rtl"&&(a+=lt(n.clientWidth,r?r.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function kn(e){var t=Ke(e),n=t.overflow,i=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+i)}function Io(e){return["html","body","#document"].indexOf(Ce(e))>=0?e.ownerDocument.body:xe(e)&&kn(e)?e:Io(Lt(e))}function Ht(e,t){var n;t===void 0&&(t=[]);var i=Io(e),r=i===((n=e.ownerDocument)==null?void 0:n.body),o=ue(i),s=r?[o].concat(o.visualViewport||[],kn(i)?i:[]):i,a=t.concat(s);return r?a:a.concat(Ht(Lt(s)))}function Vn(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function yg(e,t){var n=nt(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 ju(e,t,n){return t===Eo?Vn(ua(e,n)):tt(t)?yg(t,n):Vn(pa(Me(e)))}function bg(e){var t=Ht(Lt(e)),n=["absolute","fixed"].indexOf(Ke(e).position)>=0,i=n&&xe(e)?ut(e):e;return tt(i)?t.filter(function(r){return tt(r)&&dr(r,i)&&Ce(r)!=="body"}):[]}function ca(e,t,n,i){var r=t==="clippingParents"?bg(e):[].concat(t),o=[].concat(r,[n]),s=o[0],a=o.reduce(function(l,u){var p=ju(e,u,i);return l.top=lt(p.top,l.top),l.right=gn(p.right,l.right),l.bottom=gn(p.bottom,l.bottom),l.left=lt(p.left,l.left),l},ju(e,s,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function yr(e){var t=e.reference,n=e.element,i=e.placement,r=i?Ee(i):null,o=i?it(i):null,s=t.x+t.width/2-n.width/2,a=t.y+t.height/2-n.height/2,l;switch(r){case pe:l={x:s,y:t.y-n.height};break;case we:l={x:s,y:t.y+t.height};break;case he:l={x:t.x+t.width,y:a};break;case me:l={x:t.x-n.width,y:a};break;default:l={x:t.x,y:t.y}}var u=r?bn(r):null;if(u!=null){var p=u==="y"?"height":"width";switch(o){case Ct:l[u]=l[u]-(t[p]/2-n[p]/2);break;case hn:l[u]=l[u]+(t[p]/2-n[p]/2);break;default:}}return l}function pt(e,t){t===void 0&&(t={});var n=t,i=n.placement,r=i===void 0?e.placement:i,o=n.strategy,s=o===void 0?e.strategy:o,a=n.boundary,l=a===void 0?Ru:a,u=n.rootBoundary,p=u===void 0?Eo:u,m=n.elementContext,c=m===void 0?Yn:m,d=n.altBoundary,h=d===void 0?!1:d,g=n.padding,w=g===void 0?0:g,y=hr(typeof w!="number"?w:gr(w,Nt)),E=c===Yn?Du:Yn,O=e.rects.popper,L=e.elements[h?E:c],M=ca(tt(L)?L:L.contextElement||Me(e.elements.popper),l,p,s),T=nt(e.elements.reference),B=yr({reference:T,element:O,strategy:"absolute",placement:r}),I=Vn(Object.assign({},O,B)),P=c===Yn?I:T,K={top:M.top-P.top+y.top,bottom:P.bottom-M.bottom+y.bottom,left:M.left-P.left+y.left,right:P.right-M.right+y.right},z=e.modifiersData.offset;if(c===Yn&&z){var j=z[r];Object.keys(K).forEach(function(F){var V=[he,we].indexOf(F)>=0?1:-1,X=[pe,we].indexOf(F)>=0?"y":"x";K[F]+=j[X]*V})}return K}function ma(e,t){t===void 0&&(t={});var n=t,i=n.placement,r=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?Lo:l,p=it(i),m=p?a?aa:aa.filter(function(h){return it(h)===p}):Nt,c=m.filter(function(h){return u.indexOf(h)>=0});c.length===0&&(c=m);var d=c.reduce(function(h,g){return h[g]=pt(e,{placement:g,boundary:r,rootBoundary:o,padding:s})[Ee(g)],h},{});return Object.keys(d).sort(function(h,g){return d[h]-d[g]})}function wg(e){if(Ee(e)===Co)return[];var t=jn(e);return[Bo(e),t,Bo(t)]}function xg(e){var t=e.state,n=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var r=n.mainAxis,o=r===void 0?!0:r,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,u=n.padding,p=n.boundary,m=n.rootBoundary,c=n.altBoundary,d=n.flipVariations,h=d===void 0?!0:d,g=n.allowedAutoPlacements,w=t.options.placement,y=Ee(w),E=y===w,O=l||(E||!h?[jn(w)]:wg(w)),L=[w].concat(O).reduce(function(je,Ne){return je.concat(Ee(Ne)===Co?ma(t,{placement:Ne,boundary:p,rootBoundary:m,padding:u,flipVariations:h,allowedAutoPlacements:g}):Ne)},[]),M=t.rects.reference,T=t.rects.popper,B=new Map,I=!0,P=L[0],K=0;K=0,X=V?"width":"height",G=pt(t,{placement:z,boundary:p,rootBoundary:m,altBoundary:c,padding:u}),se=V?F?he:me:F?we:pe;M[X]>T[X]&&(se=jn(se));var ae=jn(se),le=[];if(o&&le.push(G[j]<=0),a&&le.push(G[se]<=0,G[ae]<=0),le.every(function(je){return je})){P=z,I=!1;break}B.set(z,le)}if(I)for(var ne=h?3:1,x=function(Ne){var rt=L.find(function(Ve){var J=B.get(Ve);if(J)return J.slice(0,Ne).every(function(bt){return bt})});if(rt)return P=rt,"break"},b=ne;b>0;b--){var ct=x(b);if(ct==="break")break}t.placement!==P&&(t.modifiersData[i]._skip=!0,t.placement=P,t.reset=!0)}}var Vu={name:"flip",enabled:!0,phase:"main",fn:xg,requiresIfExists:["offset"],data:{_skip:!1}};function Wu(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 Uu(e){return[pe,he,we,me].some(function(t){return e[t]>=0})}function vg(e){var t=e.state,n=e.name,i=t.rects.reference,r=t.rects.popper,o=t.modifiersData.preventOverflow,s=pt(t,{elementContext:"reference"}),a=pt(t,{altBoundary:!0}),l=Wu(s,i),u=Wu(a,r,o),p=Uu(l),m=Uu(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:p,hasPopperEscaped:m},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":m})}var Gu={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:vg};function kg(e,t,n){var i=Ee(e),r=[me,pe].indexOf(i)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*r,[me,he].indexOf(i)>=0?{x:a,y:s}:{x:s,y:a}}function Sg(e){var t=e.state,n=e.options,i=e.name,r=n.offset,o=r===void 0?[0,0]:r,s=Lo.reduce(function(p,m){return p[m]=kg(m,t.rects,o),p},{}),a=s[t.placement],l=a.x,u=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[i]=s}var Zu={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Sg};function Tg(e){var t=e.state,n=e.name;t.modifiersData[n]=yr({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}var Qu={name:"popperOffsets",enabled:!0,phase:"read",fn:Tg,data:{}};function da(e){return e==="x"?"y":"x"}function Og(e){var t=e.state,n=e.options,i=e.name,r=n.mainAxis,o=r===void 0?!0:r,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,u=n.rootBoundary,p=n.altBoundary,m=n.padding,c=n.tether,d=c===void 0?!0:c,h=n.tetherOffset,g=h===void 0?0:h,w=pt(t,{boundary:l,rootBoundary:u,padding:m,altBoundary:p}),y=Ee(t.placement),E=it(t.placement),O=!E,L=bn(y),M=da(L),T=t.modifiersData.popperOffsets,B=t.rects.reference,I=t.rects.popper,P=typeof g=="function"?g(Object.assign({},t.rects,{placement:t.placement})):g,K=typeof P=="number"?{mainAxis:P,altAxis:P}:Object.assign({mainAxis:0,altAxis:0},P),z=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,j={x:0,y:0};if(!!T){if(o){var F,V=L==="y"?pe:me,X=L==="y"?we:he,G=L==="y"?"height":"width",se=T[L],ae=se+w[V],le=se-w[X],ne=d?-I[G]/2:0,x=E===Ct?B[G]:I[G],b=E===Ct?-I[G]:-B[G],ct=t.elements.arrow,je=d&&ct?yn(ct):{width:0,height:0},Ne=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:fr(),rt=Ne[V],Ve=Ne[X],J=wn(0,B[G],je[G]),bt=O?B[G]/2-ne-J-rt-K.mainAxis:x-J-rt-K.mainAxis,ot=O?-B[G]/2+ne+J+Ve+K.mainAxis:b+J+Ve+K.mainAxis,mt=t.elements.arrow&&ut(t.elements.arrow),_t=mt?L==="y"?mt.clientTop||0:mt.clientLeft||0:0,zt=(F=z?.[L])!=null?F:0,No=se+bt-zt-_t,Ho=se+ot-zt,wr=wn(d?gn(ae,No):ae,se,d?lt(le,Ho):le);T[L]=wr,j[L]=wr-se}if(a){var Un,xr=L==="x"?pe:me,vr=L==="x"?we:he,wt=T[M],Yt=M==="y"?"height":"width",Gn=wt+w[xr],kr=wt-w[vr],Zn=[pe,me].indexOf(y)!==-1,Sr=(Un=z?.[M])!=null?Un:0,Tr=Zn?Gn:wt-B[Yt]-I[Yt]-Sr+K.altAxis,Or=Zn?wt+B[Yt]+I[Yt]-Sr-K.altAxis:kr,C=d&&Zn?Hu(Tr,wt,Or):wn(d?Tr:Gn,wt,d?Or:kr);T[M]=C,j[M]=C-wt}t.modifiersData[i]=j}}var Xu={name:"preventOverflow",enabled:!0,phase:"main",fn:Og,requiresIfExists:["offset"]};function fa(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function ha(e){return e===ue(e)||!xe(e)?xn(e):fa(e)}function Ag(e){var t=e.getBoundingClientRect(),n=Et(t.width)/e.offsetWidth||1,i=Et(t.height)/e.offsetHeight||1;return n!==1||i!==1}function ga(e,t,n){n===void 0&&(n=!1);var i=xe(t),r=xe(t)&&Ag(t),o=Me(t),s=nt(e,r,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!n)&&((Ce(t)!=="body"||kn(o))&&(a=ha(t)),xe(t)?(l=nt(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):o&&(l.x=vn(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function Cg(e){var t=new Map,n=new Set,i=[];e.forEach(function(o){t.set(o.name,o)});function r(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=t.get(a);l&&r(l)}}),i.push(o)}return e.forEach(function(o){n.has(o.name)||r(o)}),i}function ya(e){var t=Cg(e);return $u.reduce(function(n,i){return n.concat(t.filter(function(r){return r.phase===i}))},[])}function ba(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function wa(e){var t=e.reduce(function(n,i){var r=n[i.name];return n[i.name]=r?Object.assign({},r,i,{options:Object.assign({},r.options,i.options),data:Object.assign({},r.data,i.data)}):i,n},{});return Object.keys(t).map(function(n){return t[n]})}var Ju={placement:"bottom",modifiers:[],strategy:"absolute"};function ep(){for(var e=arguments.length,t=new Array(e),n=0;n(e%t+t)%t,va=class{constructor(t,n,i){this.owner=t,this.containerEl=n,n.on("click",".suggestion-item",this.onSuggestionClick.bind(this)),n.on("mousemove",".suggestion-item",this.onSuggestionMouseover.bind(this)),i.register([],"ArrowUp",r=>{if(!r.isComposing)return this.setSelectedItem(this.selectedItem-1,!0),!1}),i.register([],"ArrowDown",r=>{if(!r.isComposing)return this.setSelectedItem(this.selectedItem+1,!0),!1}),i.register([],"Enter",r=>{if(!r.isComposing)return this.useSelectedItem(r),!1})}onSuggestionClick(t,n){t.preventDefault();let i=this.suggestions.indexOf(n);this.setSelectedItem(i,!1),this.useSelectedItem(t)}onSuggestionMouseover(t,n){let i=this.suggestions.indexOf(n);this.setSelectedItem(i,!1)}setSuggestions(t){this.containerEl.empty();let n=[];t.forEach(i=>{let r=this.containerEl.createDiv("suggestion-item");this.owner.renderSuggestion(i,r),n.push(r)}),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 i=Lg(t,this.suggestions.length),r=this.suggestions[this.selectedItem],o=this.suggestions[i];r?.removeClass("is-selected"),o?.addClass("is-selected"),this.selectedItem=i,n&&o.scrollIntoView(!1)}},Mo=class{constructor(t,n){this.app=t,this.inputEl=n,this.scope=new np.Scope,this.suggestEl=createDiv("suggestion-container");let i=this.suggestEl.createDiv("suggestion");this.suggest=new va(this,i,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",r=>{r.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=xa(n,this.suggestEl,{placement:"bottom-start",modifiers:[{name:"sameWidth",enabled:!0,fn:({state:i,instance:r})=>{let o=`${i.rects.reference.width}px`;i.styles.popper.width!==o&&(i.styles.popper.width=o,r.update())},phase:"beforeWrite",requires:["computeStyles"]}]})}close(){this.app.keymap.popScope(this.scope),this.suggest.setSuggestions([]),this.popper&&this.popper.destroy(),this.suggestEl.detach()}};var br=class extends Mo{constructor(n,i,r=[]){super(n,i);this.app=n;this.inputEl=i;this.valuesToExclude=r}getSuggestions(n){let i=this.app.commands.listCommands();if(!i)return[];let r=i.filter(a=>{for(let l of this.valuesToExclude)if(l.id==a.id&&!(this.inputEl.hasAttribute("commandId")&&this.inputEl.getAttribute("commandId")==a.id))return!1;return!0}),o=[],s=n.toLowerCase();return r.forEach(a=>{(a.id.contains(s)||a.name.toLowerCase().contains(s))&&o.push(a)}),o}renderSuggestion(n,i){i.setText(n.name)}selectSuggestion(n){this.inputEl.value=n.name,this.inputEl.setAttribute("commandId",n.id),this.inputEl.trigger("input"),this.close()}};var Fo=class extends zn{constructor(n,i,r,o,s){super(n,"Custom Commands","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._**","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.","Add new command",r,o,s,()=>{let a={id:"",name:""};this.lintCommands.push(a),this.saveSettings(),this.addCommand(a,this.lintCommands.length-1,!0)});this.lintCommands=i;this.display()}showInputEls(){this.lintCommands.forEach((n,i)=>{this.addCommand(n,i)})}addCommand(n,i,r=!1){new ip.Setting(this.inputElDiv).addSearch(o=>{new br(this.app,o.inputEl,this.lintCommands),o.setPlaceholder("Obsidian command").setValue(n.name).onChange(s=>{let a={id:o.inputEl.getAttribute("commandId"),name:s};a.name&&a.id?(this.lintCommands[i]=a,this.saveSettings()):!a.name&&!a.id&&(this.lintCommands[i]=a,this.saveSettings())}),o.inputEl.setAttr("tabIndex",i),o.inputEl.addClass("linter-custom-command"),r&&o.inputEl.focus()}).addExtraButton(o=>{o.setIcon("up-chevron-glyph").setTooltip("Move up").onClick(()=>{this.arrayMove(i,i-1),this.saveSettings(),this.resetInputEls()})}).addExtraButton(o=>{o.setIcon("down-chevron-glyph").setTooltip("Move down").onClick(()=>{this.arrayMove(i,i+1),this.saveSettings(),this.resetInputEls()})}).addExtraButton(o=>{o.setIcon("cross").setTooltip("Delete").onClick(()=>{this.lintCommands.splice(i,1),this.saveSettings(),this.resetInputEls()})})}arrayMove(n,i){if(i<0||i===this.lintCommands.length)return;let r=this.lintCommands[n];this.lintCommands[n]=this.lintCommands[i],this.lintCommands[i]=r}};var rp=require("obsidian");var _g="gm",Ro=class extends zn{constructor(n,i,r,o,s){super(n,"Custom Regex Replacement","Custom regex replacement can be used to replace anything that matches the find regex with the replacement value. The replace and find values will need to be valid regex values.","Use this with caution if you do not know regex. Also, please make sure that you do not use lookbehinds in your regex on iOS mobile as that will cause linting to fail since that is not supported on that platform.","Add new regex replacement",r,o,s,()=>{let a={find:"",replace:"",flags:_g};this.regexes.push(a),this.saveSettings(),this.addRegex(a,this.regexes.length-1,!0)});this.regexes=i;this.display()}showInputEls(){this.regexes.forEach((n,i)=>{this.addRegex(n,i)})}addRegex(n,i,r=!1){new rp.Setting(this.inputElDiv).addText(o=>{o.setPlaceholder("regex to find").setValue(n.find).onChange(s=>{this.regexes[i].find=s,this.saveSettings()}),o.inputEl.setAttr("inputIndex",i),o.inputEl.addClass("linter-custom-regex-replacement"),r&&o.inputEl.focus()}).addText(o=>{o.setPlaceholder("flags").setValue(n.flags).onChange(s=>{this.regexes[i].flags=s,this.saveSettings()})}).addText(o=>{o.setPlaceholder("regex to replace").setValue(n.replace).onChange(s=>{this.regexes[i].replace=s,this.saveSettings()})}).addExtraButton(o=>{o.setIcon("cross").setTooltip("Delete").onClick(()=>{this.regexes.splice(i,1),this.saveSettings(),this.resetInputEls()})})}};var Bg={General:Ie.general.id,Custom:Ie.custom.id,YAML:Ie.yaml.id,Heading:Ie.heading.id,Footnote:Ie.footer.id,Content:Ie.content.id,Spacing:Ie.whitespace.id,Paste:Ie.paste.id},Do=class extends de.PluginSettingTab{constructor(n,i){super(n,i);this.tabContent=new Map;this.selectedTab="General";this.searchSettingInfo=new Map;this.plugin=i}display(){let{containerEl:n}=this;n.empty(),this.generateSettingsTitle(n,de.Platform.isMobile);let r=n.createEl("nav",{cls:"linter-setting-header"}).createDiv("linter-setting-tab-group"),o=n.createDiv("linter-setting-content");this.createTabAndContent("General",r,o,(l,u)=>this.generateGeneralSettings(u,l));let s="",a="";for(let l of gt)l.type!==s&&(a=l.type,this.createTabAndContent(a,r,o),s=l.type),this.addRuleToTab(a,l);this.createTabAndContent("Custom",r,o,(l,u)=>this.generateCustomSettings(u,l)),this.createSearchZeroState(o)}createTabAndContent(n,i,r,o){let s=this.selectedTab===n,a=i.createDiv("linter-navigation-item"),l="linter-desktop";de.Platform.isMobile&&(l="linter-mobile"),a.addClass(l),(0,de.setIcon)(a.createSpan({cls:"linter-navigation-item-icon"}),Bg[n],20),a.createSpan().setText(n),a.onclick=()=>{if(this.selectedTab==n)return;a.addClass("linter-navigation-item-selected");let m=this.tabContent.get(n);if(this.unhideEl(m.content),this.selectedTab!=""){let c=this.tabContent.get(this.selectedTab);c.navButton.removeClass("linter-navigation-item-selected"),this.hideEl(c.content)}else{this.hideEl(this.searchZeroState);for(let c of this.searchSettingInfo)for(let d of c[1])this.unhideEl(d.containerEl);for(let c of this.tabContent){let d=c[1];this.hideEl(d.heading),n!==c[0]&&this.hideEl(d.content)}}this.selectedTab=n};let u=r.createDiv("linter-tab-settings"),p=u.createEl("h2",{text:n+" Settings"});this.hideEl(p),u.id=n.toLowerCase().replace(" ","-"),s?a.addClass("linter-navigation-item-selected"):this.hideEl(u),o&&o(u,n),this.tabContent.set(n,{content:u,heading:p,navButton:a})}addRuleToTab(n,i){let r=this.tabContent.get(n).content;if(r==null)return;let o=r.createDiv();o.id=i.alias(),o.createEl(de.Platform.isMobile?"h4":"h3",{},a=>{a.innerHTML=`${i.name}`});let s=[];for(let a of i.options)a.display(o,this.plugin.settings,this.plugin),s.push(a.searchInfo);this.addSettingToMasterSettingsList(n,o,i.name.toLowerCase(),i.description.toLowerCase(),s,o.id)}generateCustomSettings(n,i){let r=i.createDiv(),o=new Fo(r,this.plugin.settings.lintCommands,de.Platform.isMobile,this.app,()=>{this.plugin.saveSettings()});this.addSettingToMasterSettingsList(n,r,o.name,o.description.replaceAll(` `," ")+o.warning.replaceAll(` `," "));let s=i.createDiv(),a=new Ro(s,this.plugin.settings.customRegexes,de.Platform.isMobile,this.app,()=>{this.plugin.saveSettings()});this.addSettingToMasterSettingsList(n,s,a.name,a.description.replaceAll(` `," ")+a.warning.replaceAll(` `," "))}generateGeneralSettings(n,i){let r=i.createDiv(),o="Lint on save",s="Lint the file on manual save (when `Ctrl + S` is pressed or when `:w` is executed while using vim keybindings)",a=new de.Setting(r).setName(o).addToggle(c=>{c.setValue(this.plugin.settings.lintOnSave).onChange(async d=>{this.plugin.settings.lintOnSave=d,await this.plugin.saveSettings()})});ze(s,a.descEl),this.addSettingToMasterSettingsList(n,r,o,s),r=i.createDiv(),o="Display message on lint",s="Display the number of characters changed after linting",new de.Setting(r).setName(o).setDesc(s).addToggle(c=>{c.setValue(this.plugin.settings.displayChanged).onChange(async d=>{this.plugin.settings.displayChanged=d,await this.plugin.saveSettings()})}),this.addSettingToMasterSettingsList(n,r,o,s),r=i.createDiv(),o="Folders to ignore",s="Folders to ignore when linting all files or linting on save. Enter folder paths separated by newlines",new de.Setting(r).setName(o).setDesc(s).addTextArea(c=>{c.setValue(this.plugin.settings.foldersToIgnore.join(` `)).onChange(async d=>{this.plugin.settings.foldersToIgnore=d.split(` `),await this.plugin.saveSettings()})}),this.addSettingToMasterSettingsList(n,r,o,s);let l=navigator.language?.toLowerCase();r=i.createDiv(),o="Override locale",s="Set this if you want to use a locale different from the default",new de.Setting(r).setName(o).setDesc(s).addDropdown(c=>{c.addOption("system-default",`Same as system (${l})`),op.moment.locales().forEach(d=>{c.addOption(d,d)}),c.setValue(this.plugin.settings.linterLocale),c.onChange(async d=>{this.plugin.settings.linterLocale=d,await this.plugin.setOrUpdateMomentInstance(),await this.plugin.saveSettings()})}),this.addSettingToMasterSettingsList(n,r,o,s);let u=["multi-line","single-line","single string comma delimited","single string to single-line","single string to multi-line"];r=i.createDiv(),o="YAML aliases section style",s="The style of the YAML aliases section",new de.Setting(r).setName(o).setDesc(s).addDropdown(c=>{u.forEach(d=>{c.addOption(d,d)}),c.setValue(this.plugin.settings.commonStyles.aliasArrayStyle),c.onChange(async d=>{this.plugin.settings.commonStyles.aliasArrayStyle=d,await this.plugin.saveSettings()})}),this.addSettingToMasterSettingsList(n,r,o,s);let p=["multi-line","single-line","single string to single-line","single string to multi-line","single-line space delimited","single string space delimited","single string comma delimited"];r=i.createDiv(),o="YAML tags section style",s="The style of the YAML tags section",new de.Setting(r).setName(o).setDesc(s).addDropdown(c=>{p.forEach(d=>{c.addOption(d,d)}),c.setValue(this.plugin.settings.commonStyles.tagArrayStyle),c.onChange(async d=>{this.plugin.settings.commonStyles.tagArrayStyle=d,await this.plugin.saveSettings()})}),this.addSettingToMasterSettingsList(n,r,o,s);let m=['"',"'"];r=i.createDiv(),o="Default Escape Character",s="The default character to use to escape YAML values when a single quote and double quote are not present.",new de.Setting(r).setName(o).setDesc(s).addDropdown(c=>{m.forEach(d=>{c.addOption(d,d)}),c.setValue(this.plugin.settings.commonStyles.escapeCharacter),c.onChange(async d=>{this.plugin.settings.commonStyles.escapeCharacter=d,await this.plugin.saveSettings()})}),this.addSettingToMasterSettingsList(n,r,o,s),r=i.createDiv(),o="Number of Dollar Signs to Indicate Math Block",s="The amount of dollar signs to consider the math content to be a math block instead of inline math",new de.Setting(r).setName(o).setDesc(s).addText(c=>{c.setValue(this.plugin.settings.commonStyles.minimumNumberOfDollarSignsToBeAMathBlock.toString()).onChange(async d=>{let h=parseInt(d);isNaN(h)&&(h=2),this.plugin.settings.commonStyles.minimumNumberOfDollarSignsToBeAMathBlock=h,await this.plugin.saveSettings()})}),this.addSettingToMasterSettingsList(n,r,o,s)}generateSearchBar(n){let i=new de.Setting(n);i.settingEl.style.border="none",i.addSearch(r=>{this.search=r}),this.search.setPlaceholder("Search all settings"),this.search.inputEl.onfocus=()=>{for(let r of this.tabContent){let o=r[1];o.navButton.removeClass("linter-navigation-item-selected"),this.unhideEl(o.content),this.unhideEl(o.heading);let s=this.search.getValue();this.selectedTab==""&&s.trim()!=""&&this.searchSettings(s.toLowerCase()),this.selectedTab=""}},this.search.onChange(r=>{this.searchSettings(r.toLowerCase())})}generateSettingsTitle(n,i){let r=n.createDiv("linter-setting-title");i?r.addClass("linter-mobile"):r.createEl("h1").setText("Linter"),this.generateSearchBar(r)}searchSettings(n){let i=new Set,r=this,o=function(s,a){r.unhideEl(s),i.has(a)||i.add(a)};for(let s of this.searchSettingInfo){let a=s[0],l=s[1];for(let u of l)if(n.trim()===""||u.alias?.includes(n)||u.description.includes(n)||u.name.includes(n))o(u.containerEl,a);else if(u.options)for(let p of u.options){if(p.description.toLowerCase().includes(n)||p.name.toLowerCase().includes(n)){o(u.containerEl,a);break}else if(p.options){for(let m of p.options)if(m.description.toLowerCase().includes(n)||m.value.toLowerCase().includes(n)){o(u.containerEl,a);break}}this.hideEl(u.containerEl)}else this.hideEl(u.containerEl)}for(let s of this.tabContent)i.has(s[0])?this.unhideEl(s[1].heading):this.hideEl(s[1].heading);i.size===0?this.unhideEl(this.searchZeroState):this.hideEl(this.searchZeroState)}createSearchZeroState(n){this.searchZeroState=n.createDiv(),this.hideEl(this.searchZeroState),this.searchZeroState.createEl(de.Platform.isMobile?"h3":"h2",{text:"No settings match search"}).style.textAlign="center"}addSettingToMasterSettingsList(n,i,r="",o="",s=null,a=null){let l={containerEl:i,name:r.toLowerCase(),description:o.toLowerCase(),options:s,alias:a};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 Ig={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"},Mg={ruleConfigs:{},lintOnSave:!1,displayChanged:!0,foldersToIgnore:[],linterLocale:"system-default",logLevel:sp.default.levels.ERROR,lintCommands:[],customRegexes:[],commonStyles:{aliasArrayStyle:"single-line",tagArrayStyle:"single-line",minimumNumberOfDollarSignsToBeAMathBlock:2,escapeCharacter:'"'}},Po=class extends oe.Plugin{constructor(){super(...arguments);this.eventRefs=[];this.isEnabled=!0;this.rulesRunner=new Oo}async onload(){ci("Loading plugin"),this.isEnabled=!0;for(let n in Ie){let i=Ie[n];(0,oe.addIcon)(i.id,i.source)}await this.loadSettings(),this.addCommands(),this.registerEventsAndSaveCallback(),this.addSettingTab(new Do(this.app,this))}async onunload(){ci("Unloading plugin"),this.isEnabled=!1;for(let n of this.eventRefs)this.app.workspace.offref(n)}async loadSettings(){let n=await this.loadData();this.settings=Object.assign({},Mg,n),_l(this.settings.logLevel),this.setOrUpdateMomentInstance();let i=this.settings.ruleConfigs["Move Tags to Yaml"];if(i){let s=i["Force Yaml Escape on Keys"];s&&(this.settings.ruleConfigs["Force YAML Escape"]||(this.settings.ruleConfigs["Force YAML Escape"]={}),this.settings.ruleConfigs["Force YAML Escape"]["Force YAML Escape on Keys"]=s??this.settings.ruleConfigs["Force YAML Escape"]["Force YAML Escape on Keys"]),delete this.settings.ruleConfigs["Escape YAML Special Characters"]["Force Yaml Escape on Keys"]}let r=this.settings.ruleConfigs["Move Tags to Yaml"];if(r){let s=r["Remove the hashtag from tags in content body"];s!=null&&(this.settings.ruleConfigs["Move Tags to Yaml"]["Body tag operation"]=s?"Remove hashtag":"Nothing",delete this.settings.ruleConfigs["Move Tags to Yaml"]["Remove the hashtag from tags in content body"])}let o=this.settings.ruleConfigs["Space between Chinese and English or numbers"];if(o){let s=o["Ensures that Chinese and English or numbers are separated by a single space. Follows these [guidelines](https://github.com/sparanoid/chinese-copywriting-guidelines)"];this.settings.ruleConfigs["Space between Chinese Japanese or Korean and English or numbers"]={"Ensures that Chinese, Japanese, or Korean and English or numbers are separated by a single space. Follows these [guidelines](https://github.com/sparanoid/chinese-copywriting-guidelines)":s},delete this.settings.ruleConfigs["Space between Chinese and English or numbers"]}this.moveSettingsToCommonSettings();for(let s of gt)this.settings.ruleConfigs[s.name]||(this.settings.ruleConfigs[s.name]=s.getDefaultOptions())}async saveSettings(){await this.saveData(this.settings)}addCommands(){this.addCommand({id:"lint-file",name:"Lint the current file",editorCallback:n=>this.runLinterEditor(n),icon:Ie.file.id,hotkeys:[{modifiers:["Mod","Alt"],key:"L"}]}),this.addCommand({id:"lint-all-files",name:"Lint all files in the vault",icon:Ie.vault.id,callback:()=>{let n="This will edit all of your files and may introduce errors.",i="Lint All",r="Linting all files...";new cr(this.app,n,i,r,()=>this.runLinterAllFiles(this.app)).open()}}),this.addCommand({id:"lint-all-files-in-folder",name:"Lint all files in the current folder",icon:Ie.folder.id,editorCheckCallback:(n,i)=>{if(n)return!this.app.workspace.getActiveFile().parent.isRoot();this.createFolderLintModal(this.app.workspace.getActiveFile().parent)}}),this.addCommand({id:"paste-as-plain-text",name:"Paste as Plain Text & without Modifications",editorCallback:n=>this.pasteAsPlainText(n)})}registerEventsAndSaveCallback(){let n=this.app.workspace.on("editor-paste",s=>{s.defaultPrevented||this.modifyPasteEvent(s)});this.registerEvent(n),this.eventRefs.push(n),n=this.app.workspace.on("file-menu",(s,a,l)=>this.onMenuOpenCallback(s,a,l)),this.registerEvent(n),this.eventRefs.push(n);let i=this.app.commands?.commands?.["editor:save-file"];typeof i?.callback=="function"&&(i.callback=()=>{if(this.settings.lintOnSave&&this.isEnabled){let s=this.getEditor();if(!s)return;let a=this.app.workspace.getActiveFile();this.shouldIgnoreFile(a)||this.runLinterEditor(s)}});let o=this;window.CodeMirrorAdapter.commands.save=()=>{o.app.commands.executeCommandById("editor:save-file")}}onMenuOpenCallback(n,i,r){i instanceof oe.TFile&&i.extension==="md"?n.addItem(o=>{o.setIcon(Ie.file.id).setTitle("Lint file").onClick(async()=>{this.runLinterFile(i)})}):i instanceof oe.TFolder&&n.addItem(o=>{o.setTitle("Lint folder").setIcon(Ie.folder.id).onClick(()=>this.createFolderLintModal(i))})}shouldIgnoreFile(n){for(let i of this.settings.foldersToIgnore)if(i.length>0&&n.path.startsWith(i))return!0;return!1}async runLinterFile(n){let i=gl(await this.app.vault.read(n)),r=this.rulesRunner.lintText(pr(i,n,this.momentLocale,this.settings));await this.app.vault.modify(n,r)}async runLinterAllFiles(n){let i=0;await Promise.all(n.vault.getMarkdownFiles().map(async o=>{if(!this.shouldIgnoreFile(o))try{await this.runLinterFile(o)}catch(s){this.handleLintError(o,s,"Lint All Files Error in File '${file.path}'"),i+=1}}));let r=0;if(i===0)new oe.Notice("Linted all files",r);else{let o=i===1?"was 1 error":"were "+i+" errors";new oe.Notice("Linted all files and there "+o+".",r)}}async runLinterAllFilesInFolder(n){ci("Linting folder "+n.name);let i=0,r=0,o=(0,oe.normalizePath)(n.path)+"/";await Promise.all(this.app.vault.getMarkdownFiles().map(async a=>{if((0,oe.normalizePath)(a.path).startsWith(o)&&!this.shouldIgnoreFile(a)){try{await this.runLinterFile(a)}catch(l){this.handleLintError(a,l,"Lint All Files in Folder Error in File '${file.path}'"),i+=1}r++}}));let s=0;if(i===0)new oe.Notice("Linted all "+r+" files in "+n.name+".",s);else{let a=i===1?"was 1 error":"were "+i+" errors";new oe.Notice("Linted all "+r+" files in "+n.name+" and there "+a+".",s)}}createFolderLintModal(n){let i="This will edit all of your files in "+n.name+" including files in its subfolders which may introduce errors.",r="Lint All Files in "+n.name,o="Linting all files in "+n.name+"...";new cr(this.app,i,r,o,()=>this.runLinterAllFilesInFolder(n)).open()}runLinterEditor(n){ci("Running linter");let i=this.app.workspace.getActiveFile(),r=n.getValue(),o;try{o=this.rulesRunner.lintText(pr(r,i,this.momentLocale,this.settings))}catch(m){this.handleLintError(i,m,"Lint File Error in File '${file.path}'",!1);return}let a=new Wn.default.diff_match_patch().diff_main(r,o),l="";a.forEach(m=>{function c(g){let w=g.split(` `);return{line:w.length-1,ch:w[w.length-1].length}}let[d,h]=m;if(d==Wn.default.DIFF_INSERT)n.replaceRange(h,c(l)),l+=h;else if(d==Wn.default.DIFF_DELETE){let g=c(l),w=l;w+=h;let y=c(w);n.replaceRange("",g,y)}else l+=h});let u=a.map(m=>m[0]==Wn.default.DIFF_INSERT?m[1].length:0).reduce((m,c)=>m+c,0),p=a.map(m=>m[0]==Wn.default.DIFF_DELETE?m[1].length:0).reduce((m,c)=>m+c,0);this.displayChangedMessage(u,p);try{this.rulesRunner.runCustomCommands(this.settings.lintCommands,this.app.commands)}catch(m){this.handleLintError(i,m,"Lint File Error in File '${file.path}'",!1)}}async setOrUpdateMomentInstance(){let n=localStorage.getItem("language")||"en",i=navigator.language?.toLowerCase(),r=Ig[n];this.settings.linterLocale!=="system-default"?r=this.settings.linterLocale:i.startsWith(n)&&(r=i),this.momentLocale=r;let o=$o.moment.locale(),s=$o.moment.locale(r);St(`Trying to switch Moment.js locale to ${r}, got ${s}`),$o.moment.locale(o)}displayChangedMessage(n,i){if(this.settings.displayChanged){let r=f` ${n} characters added ${i} characters removed `;new oe.Notice(r)}}handleLintError(n,i,r,o=!0){let s=r.replace("${file.path}",n.path);i instanceof Ft?o?new oe.Notice(`${s} ${i.message}. See console for more details.`):new oe.Notice(`${i.message}. See console for more details.`):new oe.Notice("An unknown error occurred during linting. See console for details"),Ll(s,i)}async modifyPasteEvent(n){let i=this.getEditor();if(!i)return;let r=n.clipboardData.getData("text/plain");if(!r)return;if(Fr.test(r.trim())){Wr("aborted paste lint as the clipboard content is a link and doing so will avoid conflicts with other plugins that modify pasting.");return}if(n.stopPropagation(),n.preventDefault(),!n.defaultPrevented)return;let o=this.app.vault.getConfig("autoConvertHtml"),s=n.clipboardData.getData("text/html"),a=s&&o?(0,oe.htmlToMarkdown)(s):r,l=i.listSelections();if(l.length===1){let u=l[0];a=this.rulesRunner.runPasteLint(this.getLineContent(i,u),pr(a,null,this.momentLocale,this.settings)),i.replaceSelection(a)}else this.handleMultiCursorPaste(i,l,a)}handleMultiCursorPaste(n,i,r){let o=this.convertContentIntoProperPasteContent(i,r),s=[];i.forEach((a,l)=>{r=this.rulesRunner.runPasteLint(this.getLineContent(n,a),pr(o[l],null,this.momentLocale,this.settings)),s.push({text:r,from:a.anchor,to:a.head})}),n.transaction({changes:s})}convertContentIntoProperPasteContent(n,i){let r=i.split(` `),o=[];if(r.length%n.length!==0)for(let s=0;s