/* THIS IS A GENERATED/BUNDLED FILE BY ESBUILD if you want to view the source, please visit the github repository of this plugin */ var Zu=Object.create;var Xn=Object.defineProperty;var ha=Object.getOwnPropertyDescriptor;var Qu=Object.getOwnPropertyNames;var Xu=Object.getPrototypeOf,Ju=Object.prototype.hasOwnProperty;var ga=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ya=(e,t)=>{for(var n in t)Xn(e,n,{get:t[n],enumerable:!0})},ba=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Qu(t))!Ju.call(e,r)&&r!==n&&Xn(e,r,{get:()=>t[r],enumerable:!(i=ha(t,r))||i.enumerable});return e};var Ro=(e,t,n)=>(n=e!=null?Zu(Xu(e)):{},ba(t||!e||!e.__esModule?Xn(n,"default",{value:e,enumerable:!0}):n,e)),ep=e=>ba(Xn({},"__esModule",{value:!0}),e),A=(e,t,n,i)=>{for(var r=i>1?void 0:i?ha(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&&Xn(t,n,r),r};var wa=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var Ue=(e,t,n)=>(wa(e,t,"read from private field"),n?n.call(e):t.get(e)),Sn=(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)},xa=(e,t,n,i)=>(wa(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n);var wl=ga((Gg,In)=>{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);b++){for(var C=-b+d;C<=b-h;C+=2){var O=s+C,E;C==-b||C!=b&&l[O-1]i)h+=2;else if(I>r)d+=2;else if(c){var T=s+m-C;if(T>=0&&T=B)return this.diff_bisectSplit_(e,t,E,I,n)}}}for(var M=-b+g;M<=b-x;M+=2){var T=s+M,B;M==-b||M!=b&&u[T-1]i)x+=2;else if(P>r)g+=2;else if(!c){var O=s+m-M;if(O>=0&&O=B)return this.diff_bisectSplit_(e,t,E,I,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?[E,I,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),x=h.charAt(0),b=g.match(_.nonAlphaNumericRegex_),C=x.match(_.nonAlphaNumericRegex_),O=b&&g.match(_.whitespaceRegex_),E=C&&x.match(_.whitespaceRegex_),I=O&&g.match(_.linebreakRegex_),T=E&&x.match(_.linebreakRegex_),B=I&&d.match(_.blanklineEndRegex_),M=T&&h.match(_.blanklineStartRegex_);return B||M?5:I||T?4:b&&!O&&E?3:O||E?2:b||C?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(E,I){var T=E/t.length,B=Math.abs(n-I);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;b--){var C=i[e.charAt(b-1)];if(d===0?x[b]=(x[b+1]<<1|1)&C:x[b]=(x[b+1]<<1|1)&C|((c[b+1]|c[b])<<1|1)|c[b+1],x[b]&l){var O=o(d,b-1);if(O<=s)if(s=O,a=b-1,a>n)h=Math.max(1,2*n-a);else break}}if(o(d+1,n)>s)break;c=x}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 Nr=="object"&&Nr.exports?Nr.exports=t():e.log=t()})(xl,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 x=h[g];if(typeof x.bind=="function")return x.bind(h);try{return Function.prototype.bind.call(x,h)}catch{return function(){return Function.prototype.apply.apply(x,[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 x=0;x=0&&M<=b.levels.SILENT){if(C=M,P!==!1&&E(M),a.call(b,M,h),typeof console===t&&MBo});module.exports=ep(kg);var oe=require("obsidian");function $a(e){return typeof e>"u"||e===null}function tp(e){return typeof e=="object"&&e!==null}function np(e){return Array.isArray(e)?e:$a(e)?[]:[e]}function ip(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 Do(e,t){return ge.repeat(" ",t-e.length)+e}function mp(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=$o(e.buffer,i[s-l],r[s-l],e.position-(i[s]-i[s-l]),m),a=ge.repeat(" ",t.indent)+Do((e.line-l+1).toString(),p)+" | "+u.str+` `+a;for(u=$o(e.buffer,i[s],r[s],e.position,m),a+=ge.repeat(" ",t.indent)+Do((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=$o(e.buffer,i[s+l],r[s+l],e.position-(i[s]-i[s+l]),m),a+=ge.repeat(" ",t.indent)+Do((e.line+l+1).toString(),p)+" | "+u.str+` `;return a.replace(/\n$/,"")}var dp=mp,fp=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],hp=["scalar","sequence","mapping"];function gp(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(i){t[String(i)]=n})}),t}function yp(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(fp.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=gp(t.styleAliases||null),hp.indexOf(this.kind)===-1)throw new He('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Fe=yp;function va(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 bp(){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"]}}),Np=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Hp(e){return!(e===null||!Np.test(e)||e[e.length-1]==="_")}function Yp(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 zp=/^[-+]?[0-9]+e/;function qp(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),zp.test(n)?n.replace("e",".e"):n}function Kp(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||ge.isNegativeZero(e))}var jp=new Fe("tag:yaml.org,2002:float",{kind:"scalar",resolve:Hp,construct:Yp,predicate:Kp,represent:qp,defaultStyle:"lowercase"}),Vp=Sp.extend({implicit:[Lp,Bp,Pp,jp]}),Wp=Vp,Pa=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Na=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 Up(e){return e===null?!1:Pa.exec(e)!==null||Na.exec(e)!==null}function Gp(e){var t,n,i,r,o,s,a,l=0,u=null,p,m,c;if(t=Pa.exec(e),t===null&&(t=Na.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 Zp(e){return e.toISOString()}var Qp=new Fe("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Up,construct:Gp,instanceOf:Date,represent:Zp});function Xp(e){return e==="<<"||e===null}var Jp=new Fe("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Xp}),Ko=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= \r`;function ec(e){if(e===null)return!1;var t,n,i=0,r=e.length,o=Ko;for(n=0;n64)){if(t<0)return!1;i+=6}return i%8===0}function tc(e){var t,n,i=e.replace(/[\r\n=]/g,""),r=i.length,o=Ko,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 nc(e){var t="",n=0,i,r,o=e.length,s=Ko;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 ic(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var rc=new Fe("tag:yaml.org,2002:binary",{kind:"scalar",resolve:ec,construct:tc,predicate:ic,represent:nc}),oc=Object.prototype.hasOwnProperty,sc=Object.prototype.toString;function ac(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 ja=new Array(256),Va=new Array(256);for(qt=0;qt<256;qt++)ja[qt]=Ta(qt)?1:0,Va[qt]=Ta(qt);var qt;function Ac(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Ha,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 Wa(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=dp(n),new He(t,n)}function H(e,t){throw Wa(e,t)}function Tr(e,t){e.onWarning&&e.onWarning.call(null,Wa(e,t))}var Oa={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&&Tr(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],qa.test(r)||H(t,"ill-formed tag handle (first argument) of the TAG directive"),Bt.call(t.tagMap,r)&&H(t,'there is a previously declared suffix for "'+r+'" tag handle'),Ka.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 _t(e,t,n,i){var r,o,s,a;if(t1&&(e.result+=ge.repeat(` `,t-1))}function Lc(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),Ve(d)||On(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),Ve(r)||n&&On(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),Ve(r)||n&&On(r))break}else if(d===35){if(i=e.input.charCodeAt(e.position-1),Ve(i))break}else{if(e.position===e.lineStart&&Lr(e)||n&&On(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&&(_t(e,o,s,!1),Vo(e,e.line-l),o=s=e.position,a=!1),Kt(d)||(s=e.position+1),d=e.input.charCodeAt(++e.position)}return _t(e,o,s,!1),e.result?!0:(e.kind=m,e.result=c,!1)}function Cc(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(_t(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)?(_t(e,i,r,!0),Vo(e,fe(e,!1,t)),i=r=e.position):e.position===e.lineStart&&Lr(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 Ec(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 _t(e,n,e.position,!0),e.position++,!0;if(a===92){if(_t(e,n,e.position,!0),a=e.input.charCodeAt(++e.position),dt(a))fe(e,!1,t);else if(a<256&&ja[a])e.result+=Va[a],e.position++;else if((s=Sc(a))>0){for(r=s,o=0;r>0;r--)a=e.input.charCodeAt(++e.position),(s=kc(a))>=0?o=(o<<4)+s:H(e,"expected hexadecimal character");e.result+=Oc(o),e.position++}else H(e,"unknown escape sequence");n=i=e.position}else dt(a)?(_t(e,n,i,!0),Vo(e,fe(e,!1,t)),n=i=e.position):e.position===e.lineStart&&Lr(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 _c(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,x,b,C;if(C=e.input.charCodeAt(e.position),C===91)p=93,d=!1,a=[];else if(C===123)p=125,d=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),C=e.input.charCodeAt(++e.position);C!==0;){if(fe(e,!0,t),C=e.input.charCodeAt(e.position),C===p)return e.position++,e.tag=s,e.anchor=l,e.kind=d?"mapping":"sequence",e.result=a,!0;n?C===44&&H(e,"expected the node content, but found ','"):H(e,"missed comma between flow collection entries"),x=g=b=null,m=c=!1,C===63&&(u=e.input.charCodeAt(e.position+1),Ve(u)&&(m=c=!0,e.position++,fe(e,!0,t))),i=e.line,r=e.lineStart,o=e.position,Ln(e,t,kr,!1,!0),x=e.tag,g=e.result,fe(e,!0,t),C=e.input.charCodeAt(e.position),(c||e.line===i)&&C===58&&(m=!0,C=e.input.charCodeAt(++e.position),fe(e,!0,t),Ln(e,t,kr,!1,!0),b=e.result),d?An(e,a,h,x,g,b,i,r,o):m?a.push(An(e,null,h,x,g,b,i,r,o)):a.push(g),fe(e,!0,t),C=e.input.charCodeAt(e.position),C===44?(n=!0,C=e.input.charCodeAt(++e.position)):n=!1}H(e,"unexpected end of the stream within a flow collection")}function Bc(e,t){var n,i,r=Po,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)Po===r?r=m===43?ka:bc:H(e,"repeat of a chomping mode identifier");else if((p=Tc(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(jo(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)&&(x&&(s=e.line,a=e.lineStart,l=e.position),Ln(e,t,Sr,!0,r)&&(x?h=e.result:g=e.result),x||(An(e,m,c,d,h,g,s,a,l),d=h=g=null),fe(e,!0,-1),C=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&C!==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 $c(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&&!Ve(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&&!Ve(s);)s=e.input.charCodeAt(++e.position);r.push(e.input.slice(n,e.position))}s!==0&&jo(e),Bt.call(Oa,i)?Oa[i](e,i,r):Tr(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"),Ln(e,e.lineIndent-1,Sr,!1,!0),fe(e,!0,-1),e.checkLineBreaks&&xc.test(e.input.slice(t,e.position))&&Tr(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Lr(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=Ua(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 il(e){var t=/^\n* /;return t.test(e)}var rl=1,zo=2,ol=3,sl=4,Tn=5;function mm(e,t,n,i,r,o,s,a){var l,u=0,p=null,m=!1,c=!1,d=i!==-1,h=-1,g=pm(Jn(e,0))&&cm(Jn(e,e.length-1));if(t||s)for(l=0;l=65536?l+=2:l++){if(u=Jn(e,l),!ii(u))return Tn;g=g&&_a(u,p,a),p=u}else{for(l=0;l=65536?l+=2:l++){if(u=Jn(e,l),u===ti)m=!0,d&&(c=c||l-h-1>i&&e[h+1]!==" ",h=l);else if(!ii(u))return Tn;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)?rl:o===ni?Tn:zo:n>9&&il(e)?Tn:s?o===ni?Tn:zo:c?sl:ol}function dm(e,t,n,i,r){e.dump=function(){if(t.length===0)return e.quotingType===ni?'""':"''";if(!e.noCompatMode&&(im.indexOf(t)!==-1||rm.test(t)))return e.quotingType===ni?'"'+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 um(e,u)}switch(mm(t,a,e.indent,s,l,e.quotingType,e.forceQuotes&&!i,r)){case rl:return t;case zo:return"'"+t.replace(/'/g,"''")+"'";case ol:return"|"+Ba(t,e.indent)+Ma(Ca(t,o));case sl:return">"+Ba(t,e.indent)+Ma(Ca(fm(t,s),o));case Tn:return'"'+hm(t)+'"';default:throw new He("impossible error: invalid scalar style")}}()}function Ba(e,t){var n=il(e)?String(t):"",i=e[e.length-1]===` `,r=i&&(e[e.length-2]===` `||e===` `),o=r?"+":i?"":"-";return n+o+` `}function Ma(e){return e[e.length-1]===` `?e.slice(0,-1):e}function fm(e,t){for(var n=/(\n+)([^\n]*)/g,i=function(){var u=e.indexOf(` `);return u=u!==-1?u:e.length,n.lastIndex=u,Ia(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!==""?` `:"")+Ia(l,t),r=o}return i}function Ia(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 hm(e){for(var t="",n=0,i,r=0;r=65536?r+=2:r++)n=Jn(e,r),i=Re[n],!i&&ii(n)?(t+=e[r],n>=65536&&(t+=e[r+1])):t+=i||sm(n);return t}function gm(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 Fa(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+=Yo(e,t)),e.dump&&ti===e.dump.charCodeAt(0)?r+="-":r+="- ",r+=e.dump);e.tag=o,e.dump=r||"[]"}function ym(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 bm(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&&ti===e.dump.charCodeAt(0)?c+="?":c+="? "),c+=e.dump,m&&(c+=Yo(e,t)),vt(e,t+1,p,!0,m)&&(e.dump&&ti===e.dump.charCodeAt(0)?c+=":":c+=": ",c+=e.dump,r+=c));e.tag=o,e.dump=r||"{}"}function Ra(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,Ra(e,n,!1)||Ra(e,n,!0);var a=Za.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?(bm(e,t,e.dump,r),c&&(e.dump="&ref_"+m+e.dump)):(ym(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?Fa(e,t-1,e.dump,r):Fa(e,t,e.dump,r),c&&(e.dump="&ref_"+m+e.dump)):(gm(e,t,e.dump),c&&(e.dump="&ref_"+m+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&dm(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 wm(e,t){var n=[],i=[],r,o;for(qo(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}var Cn=/^(\s*)(#+)(\s+)(.*)$/,cl=`^XXX\\.*? (?:((?:.| )*?) )?XXX(?=\\s|$)$`,ke=/^---\n((?:(((?!---)(?:.|\n)*?)\n)?))---(?=\n|$)/,Sm=cl.replaceAll("X","`"),Tm=cl.replaceAll("X","~"),Om=`^(( |( {4})).* )+`,Ig=new RegExp(`${Sm}|${Tm}|${Om}`,"gm"),Go=/(!?)(\[{2}[^[\n\]]*\]{2})/g,Cr=/^!?\[.*\](.*)$/,En=/(?:\s|^)#[^\s#;.,>\\s*)*",Qo=/((((>[ ]?)*)|([ ]{0,3}))\[.*?\][ \t]*\n)?((((>[ ]?)*)|([ ]{0,3}))\S+.*?\|.*?\n([^\n]*?\|[^\n]*?\n)*?)?(((>[ ]?)*)|([ ]{0,3}))[|\-+:.][ \-+|:.]*?\|[ \-+|:.]*(?:\n?[^\n]*?\|([^\n]*?)*(\n)?)+/g;function $e(e){return e.replace(/\$/g,"$$$$")}function pl(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function dl(e){let t=e.match(Go);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 fl(e){let t=e.match(Qo);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}var Jo="tag",ri="tags",oi=[Jo,ri],Am="alias",es="aliases",si=[Am,es],ai="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,$e(i)),e}function ts(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(ts(t),(s,a)=>(r=!0,a+i));return r||(o=`${e}${i}`),o}function Oe(e,t){let n=e.match(ts(t));return n==null?null:n[2]}function Wt(e,t){return e.replace(ts(t),"")}function Je(e){if(e==null)return null;let t=al(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?" []":" "+Xo(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]:" "+Xo(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]:" "+Xo(e).replaceAll(", "," ")}}function Xo(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("[")){if(e=e.substring(1),e.endsWith("]")&&(e=e.substring(0,e.length-1)),e.length===0)return null;let t=e.split(", ");return t=t.length>1?t:t[0].split(","),t.filter(n=>n!="")}if(e.includes(` `)){let t=e.split(/[ \t]*\n[ \t]*-[ \t]*/);return t.splice(0,1),t=t.filter(n=>n!=""),t==null||t.length===0?null:t}return e}function _r(e){if(e==null)return[];let t=[],n=[];Array.isArray(e)?n=e:e.includes(",")?n=e.split(", "):n=e.split(" ");for(let i of n)t.push(i.trim());return t}function Br(e){return typeof e=="string"?e.split(", "):e}function ns(e){return e.length>1&&(e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"'))}function kt(e,t,n=!1){if(ns(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 Mn=require("obsidian");var hl=require("obsidian");function We(e,t){hl.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 Ut=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 Ut{display(n,i,r){let o=new Mn.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)})});We(this.name,o.nameEl),We(this.description,o.descEl),o.settingEl.style.border="none"}},li=class extends Ut{display(n,i,r){let o=new Mn.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)})});We(this.name,o.nameEl),We(this.description,o.descEl),o.settingEl.style.border="none"}},Mr=class extends Ut{display(n,i,r){let o=new Mn.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)})});We(this.name,o.nameEl),We(this.description,o.descEl),o.settingEl.style.border="none"}},Ir=class extends Ut{display(n,i,r){let o=new Mn.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)})});We(this.name,o.nameEl),We(this.description,o.descEl),o.settingEl.style.border="none"}},Fr=class{constructor(t,n){this.value=t,this.description=n}},Rr=class extends Ut{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 Mn.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)})});We(this.name,o.nameEl),We(this.description,o.descEl),o.settingEl.style.border="none"}};var It=class extends Error{constructor(t,n){super(t),this.cause=n??null,this.stack=n.stack??null,Object.setPrototypeOf(this,It.prototype)}};var N=(s=>(s.YAML="YAML",s.HEADING="Heading",s.FOOTNOTE="Footnote",s.CONTENT="Content",s.SPACING="Spacing",s.PASTE="Paste",s))(N||{}),$r=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}},Dr=class{constructor(t,n,i,r={}){this.description=t,this.options=r,this.before=n,this.after=i}},gl=Object.values(N);function yl(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=[],Lm=gt.reduce((e,t)=>(e[t.alias()]=t,e),{});function bl(e){gt.push(e),gt.sort((t,n)=>gl.indexOf(t.type)-gl.indexOf(n.type)||t.name.localeCompare(n.name)),Lm[e.alias()]=e}function Pr(e,t){let n;throw e instanceof ll?(n=e.toString(),n=`error in the yaml: ${n.substring(n.indexOf(":")+1)}`):n=`unknown error: ${e.message}`,new It(`"${t}" encountered an ${n}`,e)}var Vn=Ro(wl());function Cm(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,pi).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);Ft(`Running ${t.name}`);try{return[t.apply(n,s),!0]}catch(a){Pr(a,t.name)}}else return[n,!1]}static getBuilderByName(t){return Ue(et,pi).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,pi=new WeakMap,Rt=new WeakMap,Sn(st,Fn,new Map),Sn(st,pi,new Map),Sn(st,Rt,new Map);var k=class extends st{static register(t){let n=t.getRule();bl(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())?(Ft(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)}}},rs,v=class{constructor(t){Sn(this,rs,void 0);this.example=new Dr(t.description,t.before,t.after,t.options)}};rs=new WeakMap;var Rn,$t=class{constructor(t){Sn(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)||xa(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 $t{buildOption(){return new Bn(this.name,this.description,this.defaultValue)}},zr=class extends $t{buildOption(){return new li(this.name,this.description,this.defaultValue)}},ye=class extends $t{constructor(n){super(n);this.records=n.records.map(i=>new Fr(i.value,i.description))}buildOption(){return new Rr(this.name,this.description,this.defaultValue,this.records)}},Ae=class extends $t{constructor(n){super(n);this.separator=n.separator??` `,this.splitter=n.splitter??/\n/}buildOption(){return new Mr(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}}},Gt=class extends $t{buildOption(){return new li(this.name,this.description,this.defaultValue)}},qr=class extends $t{buildOption(){return new Ir(this.name,this.description,this.defaultValue)}};var Kr=class{};A([k.noSettingControl()],Kr.prototype,"lineContent",2);var Zt=class extends k{get OptionsClass(){return Kr}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[]}};Zt=A([k.register],Zt);var os=function(e){if(e==null)return Fm;if(typeof e=="string")return Im(e);if(typeof e=="object")return Array.isArray(e)?Bm(e):Mm(e);if(typeof e=="function")return jr(e);throw new Error("Expected function, string, or object as test")};function Bm(e){let t=[],n=-1;for(;++n":""))+")"})),c;function c(){let d=[],h,g,x;if((!t||r(a,l,u[u.length-1]||null))&&(d=Dm(n(a,u)),d[0]===Sl))return d;if(a.children&&d[0]!==$m)for(g=(i?a.children.length:-1)+o,x=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 Al=/[!-/:-@[-`{-~\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=Dt(/[A-Za-z]/),ci=Dt(/\d/),Ll=Dt(/[\dA-Fa-f]/),ze=Dt(/[\dA-Za-z]/),Cl=Dt(/[!-/:-@[-`{-~]/),ss=Dt(/[#-'*+\--9=?A-Z^-~]/);function mi(e){return e!==null&&(e<32||e===127)}function re(e){return e!==null&&(e<0||e===32)}function $(e){return e!==null&&e<-2}function U(e){return e===-2||e===-1||e===32}var El=Dt(/\s/),_l=Dt(Al);function Dt(e){return t;function t(n){return n!==null&&e.test(String.fromCharCode(n))}}function as(e){if(e===null||re(e)||El(e))return 1;if(_l(e))return 2}function $n(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);Bl(m,-l),Bl(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,$n(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):$(u)?e.attempt(Um,s,l)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||$(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),a)}function l(u){return e.exit("codeIndented"),t(u)}}function Zm(e,t,n){let i=this;return r;function r(s){return i.parser.lazy[i.now().line]?n(s):$(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),r):z(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):$(s)?r(s):n(s)}}var us={name:"codeText",tokenize:Jm,resolve:Qm,previous:Xm};function Qm(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 Qr(e,t,n,i,r,o,s,a,l){let u=l||Number.POSITIVE_INFINITY,p=0;return m;function m(b){return b===60?(e.enter(i),e.enter(r),e.enter(o),e.consume(b),e.exit(o),c):b===null||b===41||mi(b)?n(b):(e.enter(i),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),g(b))}function c(b){return b===62?(e.enter(o),e.consume(b),e.exit(o),e.exit(r),e.exit(i),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),d(b))}function d(b){return b===62?(e.exit("chunkString"),e.exit(a),c(b)):b===null||b===60||$(b)?n(b):(e.consume(b),b===92?h:d)}function h(b){return b===60||b===62||b===92?(e.consume(b),d):d(b)}function g(b){return b===40?++p>u?n(b):(e.consume(b),g):b===41?p--?(e.consume(b),g):(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(i),t(b)):b===null||re(b)?p?n(b):(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(i),t(b)):mi(b)?n(b):(e.consume(b),b===92?x:g)}function x(b){return b===40||b===41||b===92?(e.consume(b),g):g(b)}}function Xr(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)?(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)||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 Jr(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):$(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),z(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(c))}function p(c){return c===s||c===null||$(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 Qt(e,t){let n;return i;function i(r){return $(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),n=!0,i):U(r)?z(e,i,n?"linePrefix":"lineSuffix")(r):t(r)}}function De(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var cs={name:"definition",tokenize:sd},od={tokenize:ad,partial:!0};function sd(e,t,n){let i=this,r;return o;function o(l){return e.enter("definition"),Xr.call(i,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(l)}function s(l){return r=De(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),l===58?(e.enter("definitionMarker"),e.consume(l),e.exit("definitionMarker"),Qt(e,Qr(e,e.attempt(od,z(e,a,"whitespace"),z(e,a,"whitespace")),n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString"))):n(l)}function a(l){return l===null||$(l)?(e.exit("definition"),i.parser.defined.includes(r)||i.parser.defined.push(r),t(l)):n(l)}}function ad(e,t,n){return i;function i(s){return re(s)?Qt(e,r)(s):n(s)}function r(s){return s===34||s===39||s===40?Jr(e,z(e,o,"whitespace"),n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s):n(s)}function o(s){return s===null||$(s)?t(s):n(s)}}var ms={name:"hardBreakEscape",tokenize:ld};function ld(e,t,n){return i;function i(o){return e.enter("hardBreakEscape"),e.enter("escapeMarker"),e.consume(o),r}function r(o){return $(o)?(e.exit("escapeMarker"),e.exit("hardBreakEscape"),t(o)):n(o)}}var ds={name:"headingAtx",tokenize:pd,resolve:ud};function ud(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 pd(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||$(p)?(e.exit("atxHeading"),t(p)):U(p)?z(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 Il=["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"],fs=["pre","script","style","textarea"];var hs={name:"htmlFlow",tokenize:dd,resolveTo:md,concrete:!0},cd={tokenize:fd,partial:!0};function md(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 dd(e,t,n){let i=this,r,o,s,a,l;return u;function u(y){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(y),p}function p(y){return y===33?(e.consume(y),m):y===47?(e.consume(y),h):y===63?(e.consume(y),r=3,i.interrupt?t:le):Ze(y)?(e.consume(y),s=String.fromCharCode(y),o=!0,g):n(y)}function m(y){return y===45?(e.consume(y),r=2,c):y===91?(e.consume(y),r=5,s="CDATA[",a=0,d):Ze(y)?(e.consume(y),r=4,i.interrupt?t:le):n(y)}function c(y){return y===45?(e.consume(y),i.interrupt?t:le):n(y)}function d(y){return y===s.charCodeAt(a++)?(e.consume(y),a===s.length?i.interrupt?t:Y:d):n(y)}function h(y){return Ze(y)?(e.consume(y),s=String.fromCharCode(y),g):n(y)}function g(y){return y===null||y===47||y===62||re(y)?y!==47&&o&&fs.includes(s.toLowerCase())?(r=1,i.interrupt?t(y):Y(y)):Il.includes(s.toLowerCase())?(r=6,y===47?(e.consume(y),x):i.interrupt?t(y):Y(y)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(y):o?C(y):b(y)):y===45||ze(y)?(e.consume(y),s+=String.fromCharCode(y),g):n(y)}function x(y){return y===62?(e.consume(y),i.interrupt?t:Y):n(y)}function b(y){return U(y)?(e.consume(y),b):P(y)}function C(y){return y===47?(e.consume(y),P):y===58||y===95||Ze(y)?(e.consume(y),O):U(y)?(e.consume(y),C):P(y)}function O(y){return y===45||y===46||y===58||y===95||ze(y)?(e.consume(y),O):E(y)}function E(y){return y===61?(e.consume(y),I):U(y)?(e.consume(y),E):C(y)}function I(y){return y===null||y===60||y===61||y===62||y===96?n(y):y===34||y===39?(e.consume(y),l=y,T):U(y)?(e.consume(y),I):(l=null,B(y))}function T(y){return y===null||$(y)?n(y):y===l?(e.consume(y),M):(e.consume(y),T)}function B(y){return y===null||y===34||y===39||y===60||y===61||y===62||y===96||re(y)?E(y):(e.consume(y),B)}function M(y){return y===47||y===62||U(y)?C(y):n(y)}function P(y){return y===62?(e.consume(y),K):n(y)}function K(y){return U(y)?(e.consume(y),K):y===null||$(y)?Y(y):n(y)}function Y(y){return y===45&&r===2?(e.consume(y),X):y===60&&r===1?(e.consume(y),G):y===62&&r===4?(e.consume(y),ne):y===63&&r===3?(e.consume(y),le):y===93&&r===5?(e.consume(y),ae):$(y)&&(r===6||r===7)?e.check(cd,ne,j)(y):y===null||$(y)?j(y):(e.consume(y),Y)}function j(y){return e.exit("htmlFlowData"),F(y)}function F(y){return y===null?w(y):$(y)?e.attempt({tokenize:V,partial:!0},F,w)(y):(e.enter("htmlFlowData"),Y(y))}function V(y,ct,Ke){return Ne;function Ne(je){return y.enter("lineEnding"),y.consume(je),y.exit("lineEnding"),rt}function rt(je){return i.parser.lazy[i.now().line]?Ke(je):ct(je)}}function X(y){return y===45?(e.consume(y),le):Y(y)}function G(y){return y===47?(e.consume(y),s="",se):Y(y)}function se(y){return y===62&&fs.includes(s.toLowerCase())?(e.consume(y),ne):Ze(y)&&s.length<8?(e.consume(y),s+=String.fromCharCode(y),se):Y(y)}function ae(y){return y===93?(e.consume(y),le):Y(y)}function le(y){return y===62?(e.consume(y),ne):y===45&&r===2?(e.consume(y),le):Y(y)}function ne(y){return y===null||$(y)?(e.exit("htmlFlowData"),w(y)):(e.consume(y),ne)}function w(y){return e.exit("htmlFlow"),t(y)}}function fd(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 gs={name:"htmlText",tokenize:hd};function hd(e,t,n){let i=this,r,o,s,a;return l;function l(w){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(w),u}function u(w){return w===33?(e.consume(w),p):w===47?(e.consume(w),B):w===63?(e.consume(w),I):Ze(w)?(e.consume(w),K):n(w)}function p(w){return w===45?(e.consume(w),m):w===91?(e.consume(w),o="CDATA[",s=0,x):Ze(w)?(e.consume(w),E):n(w)}function m(w){return w===45?(e.consume(w),c):n(w)}function c(w){return w===null||w===62?n(w):w===45?(e.consume(w),d):h(w)}function d(w){return w===null||w===62?n(w):h(w)}function h(w){return w===null?n(w):w===45?(e.consume(w),g):$(w)?(a=h,ae(w)):(e.consume(w),h)}function g(w){return w===45?(e.consume(w),ne):h(w)}function x(w){return w===o.charCodeAt(s++)?(e.consume(w),s===o.length?b:x):n(w)}function b(w){return w===null?n(w):w===93?(e.consume(w),C):$(w)?(a=b,ae(w)):(e.consume(w),b)}function C(w){return w===93?(e.consume(w),O):b(w)}function O(w){return w===62?ne(w):w===93?(e.consume(w),O):b(w)}function E(w){return w===null||w===62?ne(w):$(w)?(a=E,ae(w)):(e.consume(w),E)}function I(w){return w===null?n(w):w===63?(e.consume(w),T):$(w)?(a=I,ae(w)):(e.consume(w),I)}function T(w){return w===62?ne(w):I(w)}function B(w){return Ze(w)?(e.consume(w),M):n(w)}function M(w){return w===45||ze(w)?(e.consume(w),M):P(w)}function P(w){return $(w)?(a=P,ae(w)):U(w)?(e.consume(w),P):ne(w)}function K(w){return w===45||ze(w)?(e.consume(w),K):w===47||w===62||re(w)?Y(w):n(w)}function Y(w){return w===47?(e.consume(w),ne):w===58||w===95||Ze(w)?(e.consume(w),j):$(w)?(a=Y,ae(w)):U(w)?(e.consume(w),Y):ne(w)}function j(w){return w===45||w===46||w===58||w===95||ze(w)?(e.consume(w),j):F(w)}function F(w){return w===61?(e.consume(w),V):$(w)?(a=F,ae(w)):U(w)?(e.consume(w),F):Y(w)}function V(w){return w===null||w===60||w===61||w===62||w===96?n(w):w===34||w===39?(e.consume(w),r=w,X):$(w)?(a=V,ae(w)):U(w)?(e.consume(w),V):(e.consume(w),r=void 0,se)}function X(w){return w===r?(e.consume(w),G):w===null?n(w):$(w)?(a=X,ae(w)):(e.consume(w),X)}function G(w){return w===62||w===47||re(w)?Y(w):n(w)}function se(w){return w===null||w===34||w===39||w===60||w===61||w===96?n(w):w===62||re(w)?Y(w):(e.consume(w),se)}function ae(w){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),z(e,le,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function le(w){return e.enter("htmlTextData"),a(w)}function ne(w){return w===62?(e.consume(w),e.exit("htmlTextData"),e.exit("htmlText"),t):n(w)}}var Xt={name:"labelEnd",tokenize:vd,resolveTo:xd,resolveAll:wd},gd={tokenize:kd},yd={tokenize:Sd},bd={tokenize:Td};function wd(e){let t=-1,n;for(;++t999?n(c):c===93?s?(e.exit("chunkString"),d=e.exit("gfmFootnoteCallString"),r.includes(De(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 zd(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 x;return g===null||g===91||s>999?n(g):g===93?a?(x=e.exit("gfmFootnoteDefinitionLabelString"),o=De(i.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d):n(g):$(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||$(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"),z(e,h,"gfmFootnoteDefinitionWhitespace")):n(g)}function h(g){return r.includes(o)||r.push(o),t(g)}}function qd(e,t,n){return e.check(yt,t,e.attempt(Pd,t,n))}function Kd(e){e.exit("gfmFootnoteDefinition")}function jd(e,t,n){let i=this;return z(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 Vd={tokenize:Wd},xs={text:{[91]:Vd}};function Wd(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:Ud},t,n)):n(a)}}function Ud(e,t,n){let i=this;return z(e,r,"whitespace");function r(o){let s=i.events[i.events.length-1];return(s&&s[1].type==="whitespace"||$(o))&&o!==null?t(o):n(o)}}var Fl={}.hasOwnProperty;function to(e){let t={},n=-1;for(;++ns))return;let B=t.events.length,M=B,P,K;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){if(P){K=t.events[M][1].end;break}P=!0}for(b(i),T=B;TO;){let I=n[E];t.containerState=I[1],I[0].exit.call(t,e)}n.length=O}function C(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}function of(e,t,n){return z(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}var Kl={tokenize:sf};function sf(e){let t=this,n=e.attempt(yt,i,e.attempt(this.parser.constructs.flowInitial,r,z(e,e.attempt(this.parser.constructs.flow,r,e.attempt(ps,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:Gl()},Vl=Ul("string"),Wl=Ul("text");function Ul(e){return{tokenize:t,resolveAll:Gl(e==="text"?af: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 uf(e,t){let n=-1,i=[],r;for(;++nyf,contentInitial:()=>cf,disable:()=>bf,document:()=>pf,flow:()=>df,flowInitial:()=>mf,insideSpan:()=>gf,string:()=>ff,text:()=>hf});var pf={[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]:Vr},cf={[91]:cs},mf={[-2]:fi,[-1]:fi,[32]:fi},df={[35]:ds,[42]:Jt,[45]:[eo,Jt],[60]:hs,[61]:eo,[95]:Jt,[96]:Gr,[126]:Gr},ff={[38]:Ur,[92]:Wr},hf={[-5]:hi,[-4]:hi,[-3]:hi,[33]:ys,[38]:Ur,[42]:di,[60]:[ls,gs],[91]:bs,[92]:[ms,Wr],[93]:Xt,[95]:di,[96]:us},gf={null:[di,jl]},yf={null:[42,95]},bf={null:[]};function Ql(e={}){let t=to([ks].concat(e.extensions||[])),n={defined:[],lazy:{},constructs:t,content:i(Yl),document:i(ql),flow:i(Kl),string:i(Vl),text:i(Wl)};return n;function i(r){return o;function o(s){return Zl(n,r,s)}}}var Xl=/[\0\t\n\r]/g;function Jl(){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 wf=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function tu(e){return e.replace(wf,xf)}function xf(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let r=n.charCodeAt(1),o=r===120||r===88;return no(n.slice(o?2:1),o?16:10)}return Dn(n)||e}function gi(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?nu(e.position):"start"in e||"end"in e?nu(e):"line"in e||"column"in e?Ss(e):""}function Ss(e){return iu(e&&e.line)+":"+iu(e&&e.column)}function nu(e){return Ss(e&&e.start)+"-"+Ss(e&&e.end)}function iu(e){return e&&typeof e=="number"?e:1}var Ts={}.hasOwnProperty,Os=function(e,t,n){return typeof t!="string"&&(n=t,t=void 0),vf(n)(eu(Ql(n).document().write(Jl()(e,t,!0))))};function vf(e={}){let t=ou({transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(zt),autolinkProtocol:j,autolinkEmail:j,atxHeading:l(Wn),blockQuote:l(Et),characterEscape:j,characterReference:j,codeFenced:l(Yt),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:l(Yt,u),codeText:l(Mo,u),codeTextData:j,data:j,codeFlowValue:j,definition:l(Io),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:l(hr),hardBreakEscape:l(gr),hardBreakTrailing:l(gr),htmlFlow:l(yr,u),htmlFlowData:j,htmlText:l(yr,u),htmlTextData:j,image:l(wt),label:u,link:l(zt),listItem:l(br),listItemValue:g,listOrdered:l(Un,h),listUnordered:l(Un),paragraph:l(Gn),reference:rt,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:l(Wn),strong:l(wr),thematicBreak:l(vr)},exit:{atxHeading:m(),atxHeadingSequence:M,autolink:m(),autolinkEmail:mt,autolinkProtocol:ot,blockQuote:m(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:J,characterReferenceMarkerNumeric:J,characterReferenceValue:bt,codeFenced:m(O),codeFencedFence:C,codeFencedFenceInfo:x,codeFencedFenceMeta:b,codeFlowValue:F,codeIndented:m(E),codeText:m(ae),codeTextData:F,data:F,definition:m(),definitionDestinationString:B,definitionLabelString:I,definitionTitleString:T,emphasis:m(),hardBreakEscape:m(X),hardBreakTrailing:m(X),htmlFlow:m(G),htmlFlowData:F,htmlText:m(se),htmlTextData:F,image:m(ne),label:y,labelText:w,lineEnding:V,link:m(le),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:je,resourceDestinationString:ct,resourceTitleString:Ke,resource:Ne,setextHeading:m(Y),setextHeadingLineSequence:K,setextHeadingText:P,strong:m(),thematicBreak:m()}},e.mdastExtensions||[]),n={};return i;function i(L){let R={type:"root",children:[]},q=[R],Z=[],Xe=[],Zn={stack:q,tokenStack:Z,config:t,enter:p,exit:c,buffer:u,resume:d,setData:o,getData:s},ie=-1;for(;++ie0){let Ee=Z[Z.length-1];(Ee[1]||ru).call(Zn,void 0,Ee[0])}for(R.position={start:a(L.length>0?L[0][1].start:{line:1,column:1,offset:0}),end:a(L.length>0?L[L.length-2][1].end:{line:1,column:1,offset:0})},ie=-1;++ie{i.push(r.position)}),i.sort((r,o)=>o.start.offset-r.start.offset),i}function uu(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 io(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 pu(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 cu(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 gu(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 yu(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 bu(e){let t=be("blockquote",e);for(let n of t)e=Vt(e,n.start.offset,n.end.offset,!0);return e}function wu(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 x=1,b=a(m);if(l.has(b)?t==="ascending"&&(x=l.get(b)+1,l.set(b,x)):l.set(b,1),u>b){let C=u;for(;C>b;)l.delete(C--)}return u=b,`${m}${x}${n}${g}`}),e=ve(e,o,r.end.offset,s)}return e}function xu(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 vu(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:$e(`--- ---`)},wikiLink:{replaceAction:Go,placeholder:"{WIKI_LINK_PLACEHOLDER}"},tag:{replaceAction:En,placeholder:"#tag-placeholder"},obsidianMultiLineComments:{replaceAction:ml,placeholder:"{OBSIDIAN_COMMENT_PLACEHOLDER}"},table:{replaceAction:Qo,placeholder:"{TABLE_PLACEHOLDER}"},link:{replaceAction:Lf,placeholder:"{REGULAR_LINK_PLACEHOLDER}"}};function D(e,t,n){let i=[];for(let r of e){let o;if(typeof r.replaceAction=="string")o=Of(t,r.placeholder,r.replaceAction);else if(r.replaceAction instanceof RegExp)o=Af(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"),$e(o))})}),t}function Of(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 Af(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 Lf(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(Cr)||(i.push(o),e=ve(e,r.start.offset,r.end.offset,t))}return i.reverse(),{newText:e,replacedValues:i}}var en=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}},yi=class extends k{get OptionsClass(){return en}get name(){return"Capitalize Headings"}get description(){return"Headings should be formatted with capitalization"}get type(){return"Heading"}apply(t,n){return D([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:en,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:en,name:"Ignore Cased Words",description:"Only apply title case style to words that are all lowercase",optionsKey:"ignoreCasedWords"}),new Ae({OptionsClass:en,name:"Ignore Words",description:"A comma separated list of words to ignore when capitalizing",optionsKey:"ignoreWords",splitter:Zo,separator:", "}),new Ae({OptionsClass:en,name:"Lowercase Words",description:"A comma separated list of words to keep lowercase",optionsKey:"lowercaseWords",splitter:Zo,separator:", "})]}};yi=A([k.register],yi);var ro=class{constructor(){this.innerNewLines=!1}},bi=class extends k{get OptionsClass(){return ro}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:ro,name:"Inner New Lines",description:"Remove new lines that are not at the start or the end of the YAML",optionsKey:"innerNewLines"})]}};bi=A([k.register],bi);var As=class{},wi=class extends k{get OptionsClass(){return As}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 D([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[]}};wi=A([k.register],wi);var Ls=class{},xi=class extends k{get OptionsClass(){return Ls}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 D([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[]}};xi=A([k.register],xi);var oo=class{constructor(){this.tabsize=4}},vi=class extends k{get OptionsClass(){return oo}get name(){return"Convert Spaces to Tabs"}get description(){return"Converts leading spaces to tabs."}get type(){return"Spacing"}apply(t,n){return D([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 zr({OptionsClass:oo,name:"Tabsize",description:"Number of spaces that will be converted to a tab",optionsKey:"tabsize"})]}};vi=A([k.register],vi);var so=class{constructor(){this.style="consistent"}},ki=class extends k{get OptionsClass(){return so}get name(){return"Emphasis Style"}get description(){return"Makes sure the emphasis style is consistent."}get type(){return"Content"}apply(t,n){return D([S.code,S.yaml,S.link,S.wikiLink,S.tag,S.math,S.inlineMath],t,i=>io(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:so,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"}]})]}};ki=A([k.register],ki);var Cs=class{},Si=class extends k{get OptionsClass(){return Cs}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 bu(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[]}};Si=A([k.register],Si);var Es=class{},Ti=class extends k{get OptionsClass(){return Es}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 gu(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[]}};Ti=A([k.register],Ti);var ao=class{constructor(){this.minimumNumberOfDollarSignsToBeAMathBlock=2}};A([k.noSettingControl()],ao.prototype,"minimumNumberOfDollarSignsToBeAMathBlock",2);var Oi=class extends k{get OptionsClass(){return ao}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 D([S.yaml,S.code],t,i=>yu(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[]}};Oi=A([k.register],Oi);var _s=class{},Ai=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 D([S.yaml,S.code],t,i=>fl(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[]}};Ai=A([k.register],Ai);var Li=class{constructor(){this.defaultEscapeCharacter='"';this.tryToEscapeSingleLineArrays=!1}};A([k.noSettingControl()],Li.prototype,"defaultEscapeCharacter",2);var tn=class extends k{get OptionsClass(){return Li}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;p||(c+=l);let d=a.substring(c).trim();if(d.startsWith("[")){if(n.tryToEscapeSingleLineArrays){if(d.length<3)continue;let h=d.substring(1,d.length-1).split(","),g=h.length;for(let x=0;x{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[]}};Ci=A([k.register],Ci);var Bs=class{},Ei=class extends k{get OptionsClass(){return Bs}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 D([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[]}};Ei=A([k.register],Ei);var _i=class{constructor(){this.defaultEscapeCharacter='"';this.forceYamlEscape=[]}};A([k.noSettingControl()],_i.prototype,"defaultEscapeCharacter",2);var nn=class extends k{get OptionsClass(){return _i}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(" [")||ns(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:_i,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}};nn=A([k.register],nn);var Ms=class{},rn=class extends k{get OptionsClass(){return Ms}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(${ri}|${Jo}):(.*?)(?=\\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}};rn=A([k.register],rn);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 Bi=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 si)if(n.formatAliasKey&&Object.keys(r).includes(o)){i=Te(i,o,Ge(Br(ht(Oe(i,o))),n.aliasArrayStyle));break}for(let o of oi)if(n.formatTagKey&&Object.keys(r).includes(o)){i=Te(i,o,Ge(_r(ht(Oe(i,o))),n.tagArrayStyle));break}if(n.formatArrayKeys){let o=[...si,...oi,...n.forceMultiLineArrayStyle,...n.forceSingleLineArrayStyle];for(let s of Object.keys(r))o.includes(s)||!Array.isArray(r[s])||(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"}})]}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"})]}};Bi=A([k.register],Bi);var Is=class{},Mi=class extends k{get OptionsClass(){return Is}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 D([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:Fi,name:"Bottom",description:"Insert a blank line after headings",optionsKey:"bottom"}),new te({OptionsClass:Fi,name:"Empty Line Between Yaml and Header",description:"Keep the empty line between the Yaml frontmatter and header",optionsKey:"emptyLineAfterYaml"})]}};Ii=A([k.register],Ii);var po=class{constructor(){this.textToInsert=["aliases: ","tags: "]}},Ri=class extends k{get OptionsClass(){return po}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/,$e(`--- ${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:po,name:"Text to insert",description:"Text to insert into the YAML frontmatter",optionsKey:"textToInsert"})]}};Ri=A([k.register],Ri);var Fs=class{},$i=class extends k{get OptionsClass(){return Fs}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[]}};$i=A([k.register],$i);var Rs=class{},Di=class extends k{get OptionsClass(){return Rs}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 D([S.code,S.yaml],t,i=>uu(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[]}};Di=A([k.register],Di);var co=class{constructor(){this.minimumNumberOfDollarSignsToBeAMathBlock=2}};A([k.noSettingControl()],co.prototype,"minimumNumberOfDollarSignsToBeAMathBlock",2);var Pi=class extends k{get OptionsClass(){return co}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 D([S.code,S.inlineCode],t,i=>vu(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[]}};Pi=A([k.register],Pi);var Pn=class{constructor(){this.tagArrayStyle="single-line";this.howToHandleExistingTags="Nothing";this.tagsToIgnore=[]}};A([k.noSettingControl()],Pn.prototype,"tagArrayStyle",2);var Ni=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 D([S.code,S.inlineCode,S.math,S.html],t,i=>{let r=i.match(En);return r&&(i=ft(i),i=Se(i,o=>{o=o.replace(`--- `,"").replace("---","");let s=[],a=ri;for(let p of oi){let m=Oe(o,p);if(m!=null){s=_r(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(En,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(En,""))),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"})]}};Ni=A([k.register],Ni);var $s=class{},Tu="'\"\u2018\u2019\u201C\u201D`[]",Hi=class extends k{get OptionsClass(){return $s}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 D([S.code,S.yaml,S.link,S.wikiLink,S.tag,S.image,S.inlineCode],t,i=>{let r=i.match(/(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s`\]'"‘’“”>]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s`\]'"‘’“”>]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s`\]'"‘’“”>]{2,}|www\.[a-zA-Z0-9]+\.[^\s`\]'"‘’“”>]{2,})/gi);if(!r)return i;let o=0,s=r.length;for(let a=0;a=i.length?void 0:i.charAt(p);if(m!=null&&Tu.includes(m)&&c!=null&&Tu.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[]}};Hi=A([k.register],Hi);var zi=class{constructor(){this.numberStyle="ascending";this.listEndStyle="."}},Yi=class extends k{get OptionsClass(){return zi}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 D([S.code,S.yaml,S.tag],t,i=>wu(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:zi,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:zi,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)`)"}]})]}};Yi=A([k.register],Yi);var Ds=class{},qi=class extends k{get OptionsClass(){return Ds}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 D([S.obsidianMultiLineComments,S.yaml,S.table],t,cu)}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[]}};qi=A([k.register],qi);var mo=class{};A([k.noSettingControl()],mo.prototype,"lineContent",2);var on=class extends k{get OptionsClass(){return mo}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[]}};on=A([k.register],on);var fo=class{};A([k.noSettingControl()],fo.prototype,"lineContent",2);var sn=class extends k{get OptionsClass(){return fo}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[]}};sn=A([k.register],sn);var Ps=class{},an=class extends k{get OptionsClass(){return Ps}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(Er,"\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[]}};an=A([k.register],an);var Ns=class{},Ki=class extends k{get OptionsClass(){return Ns}get name(){return"Proper Ellipsis"}get description(){return"Replaces three consecutive dots with an ellipsis."}get type(){return"Content"}apply(t,n){return D([S.code,S.yaml,S.link,S.wikiLink,S.tag],t,i=>i.replaceAll(Er,"\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[]}};Ki=A([k.register],Ki);var Hs=class{},ji=class extends k{get OptionsClass(){return Hs}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 D([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[]}};ji=A([k.register],ji);var Ys=class{},Vi=class extends k{get OptionsClass(){return Ys}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 D([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[]}};Vi=A([k.register],Vi);var ln=class extends k{get OptionsClass(){return ln}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 D([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[]}};ln=A([k.register],ln);var zs=class{},Wi=class extends k{get OptionsClass(){return zs}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 D([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[]}};Wi=A([k.register],Wi);var qs=class{},Ui=class extends k{get OptionsClass(){return qs}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 D([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[]}};Ui=A([k.register],Ui);var Ks=class{},un=class extends k{get OptionsClass(){return Ks}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[]}};un=A([k.register],un);var js=class{},pn=class extends k{get OptionsClass(){return js}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[]}};pn=A([k.register],pn);var Vs=class{},cn=class extends k{get OptionsClass(){return Vs}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[]}};cn=A([k.register],cn);var Ws=class{},Gi=class extends k{get OptionsClass(){return Ws}get name(){return"Remove link spacing"}get description(){return"Removes spacing around link text."}get type(){return"Spacing"}apply(t,n){return t=mu(t),dl(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[]}};Gi=A([k.register],Gi);var Us=class{},mn=class extends k{get OptionsClass(){return Us}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[]}};mn=A([k.register],mn);var Gs=class{},Zi=class extends k{get OptionsClass(){return Gs}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 D([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[]}};Zi=A([k.register],Zi);var Zs=class{},Qi=class extends k{get OptionsClass(){return Zs}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=D([S.code,S.yaml,S.link,S.wikiLink,S.tag,S.list],t,o);return s=hu(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[]}};Qi=A([k.register],Qi);var ho=class{constructor(){this.yamlKeysToRemove=[]}},Xi=class extends k{get OptionsClass(){return ho}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=Wt(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:ho,name:"YAML Keys to Remove",description:"The yaml keys to remove from the yaml frontmatter with or without colons",optionsKey:"yamlKeysToRemove"})]}};Xi=A([k.register],Xi);var Qs=class{},Ji=class extends k{get OptionsClass(){return Qs}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 D([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[]}};Ji=A([k.register],Ji);var Xs=class{},er=class extends k{get OptionsClass(){return Xs}get name(){return"Space between Chinese and English or numbers"}get description(){return"Ensures that Chinese and English or numbers are separated by a single space. Follows these [guidelines](https://github.com/sparanoid/chinese-copywriting-guidelines)"}get type(){return"Spacing"}apply(t,n){let i=/([\u4e00-\u9fa5])( *)(\[[^[]*\]\(.*\)|`[^`]*`|\w+|[-+'"([{¥$]|\*[^*])/gm,r=/(\[[^[]*\]\(.*\)|`[^`]*`|\w+|[-+;:'"°%$)\]}]|[^*]\*)( *)([\u4e00-\u9fa5])/gm,o=function(a){return a.replace(i,"$1 $3").replace(r,"$1 $3")},s=D([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=du(s,o),s=fu(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) `})]}get optionBuilders(){return[]}};er=A([k.register],er);var go=class{constructor(){this.style="consistent"}},tr=class extends k{get OptionsClass(){return go}get name(){return"Strong Style"}get description(){return"Makes sure the strong style is consistent."}get type(){return"Content"}apply(t,n){return D([S.code,S.yaml,S.link,S.wikiLink,S.tag,S.math,S.inlineMath],t,i=>io(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:go,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"}]})]}};tr=A([k.register],tr);var yo=class{constructor(){this.twoSpaceLineBreak=!1}},nr=class extends k{get OptionsClass(){return yo}get name(){return"Trailing spaces"}get description(){return"Removes extra spaces after every line."}get type(){return"Spacing"}apply(t,n){return D([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:yo,name:"Two Space Linebreak",description:'Ignore two spaces followed by a line break ("Two Space Rule").',optionsKey:"twoSpaceLineBreak"})]}};nr=A([k.register],nr);var Js=class{},ir=class extends k{get OptionsClass(){return Js}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 D([S.obsidianMultiLineComments,S.yaml,S.table],t,pu)}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[]}};ir=A([k.register],ir);var bo=class{constructor(){this.listStyle="consistent"}},rr=class extends k{get OptionsClass(){return bo}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 D([S.code,S.yaml,S.tag],t,i=>xu(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:bo,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"}]})]}};rr=A([k.register],rr);var St=class{constructor(){this.priorityKeysAtStartOfYaml=!0;this.yamlKeyPrioritySortOrder=[];this.yamlSortOrderForOtherKeys="None"}};A([k.noSettingControl()],St.prototype,"dateModifiedKey",2),A([k.noSettingControl()],St.prototype,"currentTimeFormatted",2),A([k.noSettingControl()],St.prototype,"yamlTimestampDateModifiedEnabled",2);var dn=class extends k{get OptionsClass(){return St}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,E){return O==E?E:Te(E,n.dateModifiedKey," "+n.currentTimeFormatted)},a=function(O,E,I){let T=`${E}${O}`;return I&&(T=`${O}${E}`),n.yamlTimestampDateModifiedEnabled&&(T=s(i[1],T)),t.replace(i[1],T)},l=function(O,E){let I="";for(let T of E){let B=Oe(O,T);B!==null&&(B.includes(` `)?I+=`${T}:${B} `:I+=`${T}: ${B} `,O=Wt(O,T))}return{remainingYaml:O,sortedYamlKeyValues:I}},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,E){return O=O.toLowerCase(),E=E.toLowerCase(),O>E?-1:E>O?1:0},g=function(O,E){return O=O.toLowerCase(),E=E.toLowerCase(),O{let s=` ${n.dateCreatedKey}: [^ ]+ `,a=` ${n.dateCreatedKey}:[ ]* `,l=new RegExp(a),u=new RegExp(s);if(n.dateCreated){let p=(0,Tt.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,$e(c)+` `),i=!0;else if(d){if(d){let h=(0,Tt.moment)(o.match(u)[0].replace(n.dateCreatedKey+":","").trim(),n.format,n.locale,!0);(h==null||!h.isValid())&&(o=o.replace(u,$e(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,Tt.moment)(n.fileModifiedTime);h.locale(n.locale);let g=n.currentTime.format(n.format),x=` ${n.dateModifiedKey}: ${g}`,b=d.test(o);if(b){let C=(0,Tt.moment)(o.match(d)[0].replace(n.dateModifiedKey+":","").trim(),n.format,n.locale,!0);(i||C==null||!C.isValid()||Math.abs(C.diff(h,"seconds"))>5)&&(o=o.replace(d,$e(x)+` `))}else if(c.test(o))o=o.replace(c,$e(x)+` `);else if(!b){let C=o.indexOf(` ---`);o=jt(o,C,x)}}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,Tt.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,Tt.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,Tt.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,Tt.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 Gt({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 Gt({OptionsClass:Qe,name:"Date Modified Key",description:"Which YAML key to use for modification date",optionsKey:"dateModifiedKey"}),new qr({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 Ot=class{constructor(){this.preserveExistingAliasesSectionStyle=!0;this.keepAliasThatMatchesTheFilename=!1;this.useYamlKeyToKeepTrackOfOldFilenameOrHeading=!0;this.aliasArrayStyle="multi-line";this.defaultEscapeCharacter='"'}};A([k.noSettingControl()],Ot.prototype,"aliasArrayStyle",2),A([k.noSettingControl()],Ot.prototype,"fileName",2),A([k.noSettingControl()],Ot.prototype,"defaultEscapeCharacter",2);var or=class extends k{get OptionsClass(){return Ot}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=D([S.code,S.yaml,S.tag],t,c=>{let d=c.match(/^#\s+(.*)/m);return d?d[1]:""});i=i||n.fileName;let r=null,o=t.match(ke)[1],s=!n.keepAliasThatMatchesTheFilename&&i===n.fileName;n.useYamlKeyToKeepTrackOfOldFilenameOrHeading&&(r=Je(Oe(o,ai)));let a=o.replace(`--- `,"").replace(` ---`,""),l=Je(o);r=Je(Oe(o,ai)),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 si)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 x=Br(ht(c)),b=u(x,s);b===""?a=Wt(a,p):n.preserveExistingAliasesSectionStyle?!h&&(g&&i==b||!g||x==b)?a=Te(a,p,Ge(b,d)):a=Te(a,p,Ge(b,n.aliasArrayStyle)):a=Te(a,p,Ge(b,n.aliasArrayStyle))}else s||(a=Te(a,es,Ge(i,n.aliasArrayStyle)));return!n.useYamlKeyToKeepTrackOfOldFilenameOrHeading||s?a=Wt(a,ai):a=Te(a,ai,` ${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}})]}get optionBuilders(){return[new te({OptionsClass:Ot,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:Ot,name:"Keep alias that matches the filename",description:"Such aliases are usually redundant",optionsKey:"keepAliasThatMatchesTheFilename"}),new te({OptionsClass:Ot,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"})]}};or=A([k.register],or);var Nn=class{constructor(){this.defaultEscapeCharacter='"';this.titleKey="title"}};A([k.noSettingControl()],Nn.prototype,"fileName",2),A([k.noSettingControl()],Nn.prototype,"defaultEscapeCharacter",2);var sr=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=D([S.code,S.yaml,S.tag],t,r=>{let o=r.match(/^#\s+(.*)/m);return o?o[1]:""});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,$e(` ${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"}})]}get optionBuilders(){return[new Gt({OptionsClass:Nn,name:"Title Key",description:"Which YAML key to use for title",optionsKey:"titleKey"})]}};sr=A([k.register],sr);var Lh=` `,Ch=` `,Eh=` `,_h=` `,Bh=` `,Mh=` `,Ih=` `,Fh=` `,Rh=` `,$h=` `,Dh=` `,Ph=` `,Me={folder:{id:"lint-folder",source:Ch},file:{id:"lint-file",source:Lh},vault:{id:"lint-vault",source:Eh},whitespace:{id:"lint-whitespace",source:_h},math:{id:"lint-math",source:Bh},content:{id:"lint-content",source:Mh},paste:{id:"lint-paste",source:Ih},custom:{id:"lint-custom",source:Fh},heading:{id:"lint-heading",source:Rh},footer:{id:"lint-footer",source:$h},yaml:{id:"lint-yaml",source:Dh},general:{id:"lint-general",source:Ph}};var Hn=require("obsidian");var wo=class{constructor(){this.disabledRules=[]}lintText(t){let n=t.oldText;this.disabledRules=yl(n);let i=this.runBeforeRegularRules(t);for(let r of gt){if(this.disabledRules.includes(r.alias())){Ft(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 t.oldText=i,this.runAfterRegularRules(n,t)}runBeforeRegularRules(t){let n=t.oldText;return[n]=rn.applyIfEnabled(n,t.settings,this.disabledRules),[n]=tn.applyIfEnabled(n,t.settings,this.disabledRules,{defaultEscapeCharacter:t.settings.commonStyles.escapeCharacter}),n}runAfterRegularRules(t,n){let i=n.oldText;[i]=nn.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]=dn.applyIfEnabled(i,n.settings,this.disabledRules,{currentTimeFormatted:r.format(s.format),yamlTimestampDateModifiedEnabled:o&&s.dateModified,dateModifiedKey:s.dateModifiedKey}),i}runCustomCommands(t,n){Ft("Running Custom Lint Commands");let i=new Set;for(let r of t){if(r.id){if(i.has(r.id)){Yr(`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){Pr(o,`Custom Lint Command ${r.id}`)}}}runPasteLint(t,n){let i=n.oldText;return[i]=un.applyIfEnabled(i,n.settings,[]),[i]=mn.applyIfEnabled(i,n.settings,[]),[i]=cn.applyIfEnabled(i,n.settings,[]),[i]=an.applyIfEnabled(i,n.settings,[]),[i]=pn.applyIfEnabled(i,n.settings,[]),[i]=on.applyIfEnabled(i,n.settings,[],{lineContent:t}),[i]=sn.applyIfEnabled(i,n.settings,[],{lineContent:t}),[i]=Zt.applyIfEnabled(i,n.settings,[],{lineContent:t}),i}};function xo(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 vo=require("obsidian"),ar=class extends vo.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 vo.Notice(r),this.close(),await o()}),setTimeout(()=>{a.focus()},50)})}};var ce=require("obsidian");var Uu=require("obsidian");var Wu=require("obsidian");var pe="top",we="bottom",he="right",de="left",ko="auto",Nt=[pe,we,he,de],At="start",fn="end",Au="clippingParents",So="viewport",Yn="popper",Lu="reference",ea=Nt.reduce(function(e,t){return e.concat([t+"-"+At,t+"-"+fn])},[]),To=[].concat(Nt,[ko]).reduce(function(e,t){return e.concat([t,t+"-"+At,t+"-"+fn])},[]),Nh="beforeRead",Hh="read",Yh="afterRead",zh="beforeMain",qh="main",Kh="afterMain",jh="beforeWrite",Vh="write",Wh="afterWrite",Cu=[Nh,Hh,Yh,zh,qh,Kh,jh,Vh,Wh];function Le(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 zn(e){if(typeof ShadowRoot>"u")return!1;var t=ue(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Uh(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)||!Le(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 Gh(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)||!Le(r)||(Object.assign(r.style,a),Object.keys(o).forEach(function(l){r.removeAttribute(l)}))})}}var Eu={name:"applyStyles",enabled:!0,phase:"write",fn:Uh,effect:Gh,requires:["computeStyles"]};function Ce(e){return e.split("-")[0]}var lt=Math.max,hn=Math.min,Lt=Math.round;function qn(){var e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function lr(){return!/^((?!chrome|android).)*safari/i.test(qn())}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&&Lt(i.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Lt(i.height)/e.offsetHeight||1);var s=tt(e)?ue(e):window,a=s.visualViewport,l=!lr()&&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 gn(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 ur(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&zn(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function qe(e){return ue(e).getComputedStyle(e)}function ta(e){return["table","td","th"].indexOf(Le(e))>=0}function Ie(e){return((tt(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ct(e){return Le(e)==="html"?e:e.assignedSlot||e.parentNode||(zn(e)?e.host:null)||Ie(e)}function _u(e){return!xe(e)||qe(e).position==="fixed"?null:e.offsetParent}function Zh(e){var t=/firefox/i.test(qn()),n=/Trident/i.test(qn());if(n&&xe(e)){var i=qe(e);if(i.position==="fixed")return null}var r=Ct(e);for(zn(r)&&(r=r.host);xe(r)&&["html","body"].indexOf(Le(r))<0;){var o=qe(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=_u(e);n&&ta(n)&&qe(n).position==="static";)n=_u(n);return n&&(Le(n)==="html"||Le(n)==="body"&&qe(n).position==="static")?t:n||Zh(e)||t}function yn(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function bn(e,t,n){return lt(e,hn(t,n))}function Bu(e,t,n){var i=bn(e,t,n);return i>n?n:i}function pr(){return{top:0,right:0,bottom:0,left:0}}function cr(e){return Object.assign({},pr(),e)}function mr(e,t){return t.reduce(function(n,i){return n[i]=e,n},{})}var Qh=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,cr(typeof t!="number"?t:mr(t,Nt))};function Xh(e){var t,n=e.state,i=e.name,r=e.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Ce(n.placement),l=yn(a),u=[de,he].indexOf(a)>=0,p=u?"height":"width";if(!(!o||!s)){var m=Qh(r.padding,n),c=gn(o),d=l==="y"?pe:de,h=l==="y"?we:he,g=n.rects.reference[p]+n.rects.reference[l]-s[l]-n.rects.popper[p],x=s[l]-n.rects.reference[l],b=ut(o),C=b?l==="y"?b.clientHeight||0:b.clientWidth||0:0,O=g/2-x/2,E=m[d],I=C-c[p]-m[h],T=C/2-c[p]/2+O,B=bn(E,T,I),M=l;n.modifiersData[i]=(t={},t[M]=B,t.centerOffset=B-T,t)}}function Jh(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)||!ur(t.elements.popper,r)||(t.elements.arrow=r))}var Mu={name:"arrow",enabled:!0,phase:"main",fn:Xh,effect:Jh,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function it(e){return e.split("-")[1]}var eg={top:"auto",right:"auto",bottom:"auto",left:"auto"};function tg(e){var t=e.x,n=e.y,i=window,r=i.devicePixelRatio||1;return{x:Lt(t*r)/r||0,y:Lt(n*r)/r||0}}function Iu(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,x=typeof p=="function"?p({x:d,y:g}):{x:d,y:g};d=x.x,g=x.y;var b=s.hasOwnProperty("x"),C=s.hasOwnProperty("y"),O=de,E=pe,I=window;if(u){var T=ut(n),B="clientHeight",M="clientWidth";if(T===ue(n)&&(T=Ie(n),qe(T).position!=="static"&&a==="absolute"&&(B="scrollHeight",M="scrollWidth")),T=T,r===pe||(r===de||r===he)&&o===fn){E=we;var P=m&&T===I&&I.visualViewport?I.visualViewport.height:T[B];g-=P-i.height,g*=l?1:-1}if(r===de||(r===pe||r===we)&&o===fn){O=he;var K=m&&T===I&&I.visualViewport?I.visualViewport.width:T[M];d-=K-i.width,d*=l?1:-1}}var Y=Object.assign({position:a},u&&eg),j=p===!0?tg({x:d,y:g}):{x:d,y:g};if(d=j.x,g=j.y,l){var F;return Object.assign({},Y,(F={},F[E]=C?"0":"",F[O]=b?"0":"",F.transform=(I.devicePixelRatio||1)<=1?"translate("+d+"px, "+g+"px)":"translate3d("+d+"px, "+g+"px, 0)",F))}return Object.assign({},Y,(t={},t[E]=C?g+"px":"",t[O]=b?d+"px":"",t.transform="",t))}function ng(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:Ce(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,Iu(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,Iu(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 Fu={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:ng,data:{}};var Oo={passive:!0};function ig(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,Oo)}),a&&l.addEventListener("resize",n.update,Oo),function(){o&&u.forEach(function(p){p.removeEventListener("scroll",n.update,Oo)}),a&&l.removeEventListener("resize",n.update,Oo)}}var Ru={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:ig,data:{}};var rg={left:"right",right:"left",bottom:"top",top:"bottom"};function Kn(e){return e.replace(/left|right|bottom|top/g,function(t){return rg[t]})}var og={start:"end",end:"start"};function Ao(e){return e.replace(/start|end/g,function(t){return og[t]})}function wn(e){var t=ue(e),n=t.pageXOffset,i=t.pageYOffset;return{scrollLeft:n,scrollTop:i}}function xn(e){return nt(Ie(e)).left+wn(e).scrollLeft}function na(e,t){var n=ue(e),i=Ie(e),r=n.visualViewport,o=i.clientWidth,s=i.clientHeight,a=0,l=0;if(r){o=r.width,s=r.height;var u=lr();(u||!u&&t==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}return{width:o,height:s,x:a+xn(e),y:l}}function ia(e){var t,n=Ie(e),i=wn(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+xn(e),l=-i.scrollTop;return qe(r||n).direction==="rtl"&&(a+=lt(n.clientWidth,r?r.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function vn(e){var t=qe(e),n=t.overflow,i=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+i)}function Lo(e){return["html","body","#document"].indexOf(Le(e))>=0?e.ownerDocument.body:xe(e)&&vn(e)?e:Lo(Ct(e))}function Ht(e,t){var n;t===void 0&&(t=[]);var i=Lo(e),r=i===((n=e.ownerDocument)==null?void 0:n.body),o=ue(i),s=r?[o].concat(o.visualViewport||[],vn(i)?i:[]):i,a=t.concat(s);return r?a:a.concat(Ht(Ct(s)))}function jn(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function sg(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 $u(e,t,n){return t===So?jn(na(e,n)):tt(t)?sg(t,n):jn(ia(Ie(e)))}function ag(e){var t=Ht(Ct(e)),n=["absolute","fixed"].indexOf(qe(e).position)>=0,i=n&&xe(e)?ut(e):e;return tt(i)?t.filter(function(r){return tt(r)&&ur(r,i)&&Le(r)!=="body"}):[]}function ra(e,t,n,i){var r=t==="clippingParents"?ag(e):[].concat(t),o=[].concat(r,[n]),s=o[0],a=o.reduce(function(l,u){var p=$u(e,u,i);return l.top=lt(p.top,l.top),l.right=hn(p.right,l.right),l.bottom=hn(p.bottom,l.bottom),l.left=lt(p.left,l.left),l},$u(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 dr(e){var t=e.reference,n=e.element,i=e.placement,r=i?Ce(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 de:l={x:t.x-n.width,y:a};break;default:l={x:t.x,y:t.y}}var u=r?yn(r):null;if(u!=null){var p=u==="y"?"height":"width";switch(o){case At:l[u]=l[u]-(t[p]/2-n[p]/2);break;case fn: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?Au:a,u=n.rootBoundary,p=u===void 0?So:u,m=n.elementContext,c=m===void 0?Yn:m,d=n.altBoundary,h=d===void 0?!1:d,g=n.padding,x=g===void 0?0:g,b=cr(typeof x!="number"?x:mr(x,Nt)),C=c===Yn?Lu:Yn,O=e.rects.popper,E=e.elements[h?C:c],I=ra(tt(E)?E:E.contextElement||Ie(e.elements.popper),l,p,s),T=nt(e.elements.reference),B=dr({reference:T,element:O,strategy:"absolute",placement:r}),M=jn(Object.assign({},O,B)),P=c===Yn?M:T,K={top:I.top-P.top+b.top,bottom:P.bottom-I.bottom+b.bottom,left:I.left-P.left+b.left,right:P.right-I.right+b.right},Y=e.modifiersData.offset;if(c===Yn&&Y){var j=Y[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 oa(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?To:l,p=it(i),m=p?a?ea:ea.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})[Ce(g)],h},{});return Object.keys(d).sort(function(h,g){return d[h]-d[g]})}function lg(e){if(Ce(e)===ko)return[];var t=Kn(e);return[Ao(e),t,Ao(t)]}function ug(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,x=t.options.placement,b=Ce(x),C=b===x,O=l||(C||!h?[Kn(x)]:lg(x)),E=[x].concat(O).reduce(function(Ke,Ne){return Ke.concat(Ce(Ne)===ko?oa(t,{placement:Ne,boundary:p,rootBoundary:m,padding:u,flipVariations:h,allowedAutoPlacements:g}):Ne)},[]),I=t.rects.reference,T=t.rects.popper,B=new Map,M=!0,P=E[0],K=0;K=0,X=V?"width":"height",G=pt(t,{placement:Y,boundary:p,rootBoundary:m,altBoundary:c,padding:u}),se=V?F?he:de:F?we:pe;I[X]>T[X]&&(se=Kn(se));var ae=Kn(se),le=[];if(o&&le.push(G[j]<=0),a&&le.push(G[se]<=0,G[ae]<=0),le.every(function(Ke){return Ke})){P=Y,M=!1;break}B.set(Y,le)}if(M)for(var ne=h?3:1,w=function(Ne){var rt=E.find(function(je){var J=B.get(je);if(J)return J.slice(0,Ne).every(function(bt){return bt})});if(rt)return P=rt,"break"},y=ne;y>0;y--){var ct=w(y);if(ct==="break")break}t.placement!==P&&(t.modifiersData[i]._skip=!0,t.placement=P,t.reset=!0)}}var Du={name:"flip",enabled:!0,phase:"main",fn:ug,requiresIfExists:["offset"],data:{_skip:!1}};function Pu(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 Nu(e){return[pe,he,we,de].some(function(t){return e[t]>=0})}function pg(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=Pu(s,i),u=Pu(a,r,o),p=Nu(l),m=Nu(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 Hu={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:pg};function cg(e,t,n){var i=Ce(e),r=[de,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,[de,he].indexOf(i)>=0?{x:a,y:s}:{x:s,y:a}}function mg(e){var t=e.state,n=e.options,i=e.name,r=n.offset,o=r===void 0?[0,0]:r,s=To.reduce(function(p,m){return p[m]=cg(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 Yu={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:mg};function dg(e){var t=e.state,n=e.name;t.modifiersData[n]=dr({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}var zu={name:"popperOffsets",enabled:!0,phase:"read",fn:dg,data:{}};function sa(e){return e==="x"?"y":"x"}function fg(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,x=pt(t,{boundary:l,rootBoundary:u,padding:m,altBoundary:p}),b=Ce(t.placement),C=it(t.placement),O=!C,E=yn(b),I=sa(E),T=t.modifiersData.popperOffsets,B=t.rects.reference,M=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),Y=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,j={x:0,y:0};if(!!T){if(o){var F,V=E==="y"?pe:de,X=E==="y"?we:he,G=E==="y"?"height":"width",se=T[E],ae=se+x[V],le=se-x[X],ne=d?-M[G]/2:0,w=C===At?B[G]:M[G],y=C===At?-M[G]:-B[G],ct=t.elements.arrow,Ke=d&&ct?gn(ct):{width:0,height:0},Ne=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:pr(),rt=Ne[V],je=Ne[X],J=bn(0,B[G],Ke[G]),bt=O?B[G]/2-ne-J-rt-K.mainAxis:w-J-rt-K.mainAxis,ot=O?-B[G]/2+ne+J+je+K.mainAxis:y+J+je+K.mainAxis,mt=t.elements.arrow&&ut(t.elements.arrow),Et=mt?E==="y"?mt.clientTop||0:mt.clientLeft||0:0,Yt=(F=Y?.[E])!=null?F:0,Mo=se+bt-Yt-Et,Io=se+ot-Yt,hr=bn(d?hn(ae,Mo):ae,se,d?lt(le,Io):le);T[E]=hr,j[E]=hr-se}if(a){var Wn,gr=E==="x"?pe:de,yr=E==="x"?we:he,wt=T[I],zt=I==="y"?"height":"width",Un=wt+x[gr],br=wt-x[yr],Gn=[pe,de].indexOf(b)!==-1,wr=(Wn=Y?.[I])!=null?Wn:0,xr=Gn?Un:wt-B[zt]-M[zt]-wr+K.altAxis,vr=Gn?wt+B[zt]+M[zt]-wr-K.altAxis:br,L=d&&Gn?Bu(xr,wt,vr):bn(d?xr:Un,wt,d?vr:br);T[I]=L,j[I]=L-wt}t.modifiersData[i]=j}}var qu={name:"preventOverflow",enabled:!0,phase:"main",fn:fg,requiresIfExists:["offset"]};function aa(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function la(e){return e===ue(e)||!xe(e)?wn(e):aa(e)}function hg(e){var t=e.getBoundingClientRect(),n=Lt(t.width)/e.offsetWidth||1,i=Lt(t.height)/e.offsetHeight||1;return n!==1||i!==1}function ua(e,t,n){n===void 0&&(n=!1);var i=xe(t),r=xe(t)&&hg(t),o=Ie(t),s=nt(e,r,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!n)&&((Le(t)!=="body"||vn(o))&&(a=la(t)),xe(t)?(l=nt(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):o&&(l.x=xn(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function gg(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 pa(e){var t=gg(e);return Cu.reduce(function(n,i){return n.concat(t.filter(function(r){return r.phase===i}))},[])}function ca(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function ma(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 Ku={placement:"bottom",modifiers:[],strategy:"absolute"};function ju(){for(var e=arguments.length,t=new Array(e),n=0;n(e%t+t)%t,fa=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=bg(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)}},Co=class{constructor(t,n){this.app=t,this.inputEl=n,this.scope=new Wu.Scope,this.suggestEl=createDiv("suggestion-container");let i=this.suggestEl.createDiv("suggestion");this.suggest=new fa(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=da(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 fr=class extends Co{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 wg={General:Me.general.id,Custom:Me.custom.id,YAML:Me.yaml.id,Heading:Me.heading.id,Footnote:Me.footer.id,Content:Me.content.id,Spacing:Me.whitespace.id,Paste:Me.paste.id},Eo=class extends ce.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,ce.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.generateCustomCommandSettings(u,l)),this.createSearchZeroState(o)}createTabAndContent(n,i,r,o){let s=this.selectedTab===n,a=i.createDiv("linter-navigation-item"),l="linter-desktop";ce.Platform.isMobile&&(l="linter-mobile"),a.addClass(l),(0,ce.setIcon)(a.createSpan({cls:"linter-navigation-item-icon"}),wg[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(ce.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)}generateCustomCommandSettings(n,i){i.createEl(ce.Platform.isMobile?"h4":"h3",{text:"Custom Commands"});let r=`Custom commands are Obsidian commands that get run after the linter is finished running its regular rules. This means that they do not run before the YAML timestamp logic runs, so they can cause YAML timestamp to be triggered on the next run of the linter. You may only select an Obsidian command once. **_Note that this currently only works on linting the current file._**`,o=`When selecting an option, make sure to select the option either by using the mouse or by hitting the enter key. Other selection methods may not work and only selections of an actual Obsidian command or an empty string will be saved.`;this.addSettingToMasterSettingsList(n,i,n.toLowerCase(),r.replaceAll(` `," ")+o.replaceAll(` `," ")),We(r,i.createEl("p")),i.createEl("p",{text:o}).style.color="#EED202";function s(a,l,u){if(u<0||u===a.length)return;let p=a[l];a[l]=a[u],a[u]=p}new ce.Setting(i).addButton(a=>{a.setButtonText("Add new command").setCta().onClick(()=>{this.plugin.settings.lintCommands.push({id:"",name:""}),this.plugin.saveSettings(),this.display();let l=document.getElementsByClassName("linter-custom-command");l[l.length-1].focus()})}),this.plugin.settings.lintCommands.forEach((a,l)=>{new ce.Setting(i).addSearch(u=>{new fr(this.app,u.inputEl,this.plugin.settings.lintCommands),u.setPlaceholder("Obsidian command").setValue(a.name).onChange(p=>{let m={id:u.inputEl.getAttribute("commandId"),name:p};m.name&&m.id?(this.plugin.settings.lintCommands[l]=m,this.plugin.saveSettings()):!m.name&&!m.id&&(this.plugin.settings.lintCommands[l]=m,this.plugin.saveSettings())}),u.inputEl.setAttr("tabIndex",l),u.inputEl.addClass("linter-custom-command")}).addExtraButton(u=>{u.setIcon("up-chevron-glyph").setTooltip("Move up").onClick(()=>{s(this.plugin.settings.lintCommands,l,l-1),this.plugin.saveSettings(),this.display()})}).addExtraButton(u=>{u.setIcon("down-chevron-glyph").setTooltip("Move down").onClick(()=>{s(this.plugin.settings.lintCommands,l,l+1),this.plugin.saveSettings(),this.display()})}).addExtraButton(u=>{u.setIcon("cross").setTooltip("Delete").onClick(()=>{this.plugin.settings.lintCommands.splice(l,1),this.plugin.saveSettings(),this.display()})})})}generateGeneralSettings(n,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 ce.Setting(r).setName(o).addToggle(c=>{c.setValue(this.plugin.settings.lintOnSave).onChange(async d=>{this.plugin.settings.lintOnSave=d,await this.plugin.saveSettings()})});We(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 ce.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 ce.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 ce.Setting(r).setName(o).setDesc(s).addDropdown(c=>{c.addOption("system-default",`Same as system (${l})`),Uu.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 ce.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 ce.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 ce.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 ce.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 ce.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(ce.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 xg={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"},vg={ruleConfigs:{},lintOnSave:!1,displayChanged:!0,foldersToIgnore:[],linterLocale:"system-default",logLevel:Gu.default.levels.ERROR,lintCommands:[],commonStyles:{aliasArrayStyle:"single-line",tagArrayStyle:"single-line",minimumNumberOfDollarSignsToBeAMathBlock:2,escapeCharacter:'"'}},Bo=class extends oe.Plugin{constructor(){super(...arguments);this.eventRefs=[];this.isEnabled=!0;this.rulesRunner=new wo}async onload(){ui("Loading plugin"),this.isEnabled=!0;for(let n in Me){let i=Me[n];(0,oe.addIcon)(i.id,i.source)}await this.loadSettings(),this.addCommands(),this.registerEventsAndSaveCallback(),this.addSettingTab(new Eo(this.app,this))}async onunload(){ui("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({},vg,n),kl(this.settings.logLevel),this.setOrUpdateMomentInstance();let i=this.settings.ruleConfigs["Move Tags to Yaml"];if(i){let o=i["Force Yaml Escape on Keys"];o&&(this.settings.ruleConfigs["Force YAML Escape"]||(this.settings.ruleConfigs["Force YAML Escape"]={}),this.settings.ruleConfigs["Force YAML Escape"]["Force YAML Escape on Keys"]=o??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 o=r["Remove the hashtag from tags in content body"];o!=null&&(this.settings.ruleConfigs["Move Tags to Yaml"]["Body tag operation"]=o?"Remove hashtag":"Nothing",delete this.settings.ruleConfigs["Move Tags to Yaml"]["Remove the hashtag from tags in content body"])}this.moveSettingsToCommonSettings();for(let o of gt)this.settings.ruleConfigs[o.name]||(this.settings.ruleConfigs[o.name]=o.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:Me.file.id,hotkeys:[{modifiers:["Mod","Alt"],key:"L"}]}),this.addCommand({id:"lint-all-files",name:"Lint all files in the vault",icon:Me.vault.id,callback:()=>{let n="This will edit all of your files and may introduce errors.",i="Lint All",r="Linting all files...";new ar(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:Me.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(Me.file.id).setTitle("Lint file").onClick(async()=>{this.runLinterFile(i)})}):i instanceof oe.TFolder&&n.addItem(o=>{o.setTitle("Lint folder").setIcon(Me.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=ul(await this.app.vault.read(n)),r=this.rulesRunner.lintText(xo(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){ui("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 ar(this.app,i,r,o,()=>this.runLinterAllFilesInFolder(n)).open()}runLinterEditor(n){ui("Running linter");let i=this.app.workspace.getActiveFile(),r=n.getValue(),o;try{o=this.rulesRunner.lintText(xo(r,i,this.momentLocale,this.settings))}catch(m){this.handleLintError(i,m,"Lint File Error in File '${file.path}'",!1);return}let a=new Vn.default.diff_match_patch().diff_main(r,o),l="";a.forEach(m=>{function c(g){let x=g.split(` `);return{line:x.length-1,ch:x[x.length-1].length}}let[d,h]=m;if(d==Vn.default.DIFF_INSERT)n.replaceRange(h,c(l)),l+=h;else if(d==Vn.default.DIFF_DELETE){let g=c(l),x=l;x+=h;let b=c(x);n.replaceRange("",g,b)}else l+=h});let u=a.map(m=>m[0]==Vn.default.DIFF_INSERT?m[1].length:0).reduce((m,c)=>m+c,0),p=a.map(m=>m[0]==Vn.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=xg[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);Ft(`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 It?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"),vl(s,i)}async modifyPasteEvent(n){let i=this.getEditor();if(!i)return;let r=n.clipboardData.getData("text/plain");if(!r)return;if(/((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()[\]{};:'".,<>?«»“”‘’]))/i.test(r.trim())){Yr("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 s=this.app.vault.getConfig("autoConvertHtml"),a=n.clipboardData.getData("text/html"),l=a&&s?(0,oe.htmlToMarkdown)(a):r;l=this.rulesRunner.runPasteLint(this.getLineContent(i),xo(l,null,this.momentLocale,this.settings)),i.replaceSelection(l)}async pasteAsPlainText(n){let i=await navigator.clipboard.readText();if(!i){new oe.Notice("There is no clipboard content.");return}n.replaceSelection(i)}getEditor(){let n=this.app.workspace.getActiveViewOfType(oe.MarkdownView);return n?n.editor:null}getLineContent(n){let i=n.getCursor("from").line;return n.getLine(i)}moveSettingsToCommonSettings(){let n,i=this.settings.ruleConfigs["YAML Title Alias"];if(i&&i["YAML aliases section style"]){if(i["Inserts the title of the file into the YAML frontmatter's aliases section. Gets the title from the first H1 or filename."])switch(i["YAML aliases section style"]){case"Multi-line array":n="multi-line";break;case"Single-line array":n="single-line";break;case"Single string that expands to multi-line array if needed":n="single string to multi-line";break;case"Single string that expands to single-line array if needed":n="single string to single-line";break}delete this.settings.ruleConfigs["YAML Title Alias"]["YAML aliases section style"]}let r=this.settings.ruleConfigs["Format Yaml Array"];if(r&&r["Yaml aliases section style"]){if(r["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."]&&r["Format yaml aliases section"]){let l=r["Yaml aliases section style"];if(!n)n=l;else switch(l){case"single-line":n="single-line";break;case"multi-line":n!="single-line"&&(n="single-line");break;case"single string comma delimited":n!="single-line"&&n!="multi-line"&&(n="single string comma delimited");break;case"single string to multi-line":n!="single-line"&&n!="multi-line"&&(n="single string to multi-line");break;case"single string to single-line":n!="single-line"&&n!="multi-line"&&(n="single string to single-line");break}}delete this.settings.ruleConfigs["Format Yaml Array"]["Yaml aliases section style"]}n&&(this.settings.commonStyles.aliasArrayStyle=n);let o;r&&r["Yaml tags section style"]&&(r["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."]&&r["Format yaml tags section"]&&(o=r["Yaml tags section style"]),delete this.settings.ruleConfigs["Format Yaml Array"]["Yaml tags section style"]);let s=this.settings.ruleConfigs["Move Tags to Yaml"];if(s&&s["Yaml tags section style"]){if(s["Move all tags to Yaml frontmatter of the document."]){let l=s["Yaml tags section style"];if(!o)o=l;else switch(l){case"single-line":o="single-line";break;case"multi-line":o!="single-line"&&(o="single-line");break;case"single string comma delimited":o!="single-line"&&o!="multi-line"&&(o="single string comma delimited");break;case"single string to multi-line":o!="single-line"&&o!="multi-line"&&(o="single string to multi-line");break;case"single string to single-line":o!="single-line"&&o!="multi-line"&&(o="single string to single-line");break;case"single-line space delimited":o!="single-line"&&o!="multi-line"&&o!="single string comma delimited"&&o!="single string to single-line"&&o!="single string to multi-line"&&(o="single-line space delimited");break;case"single string space delimited":o!="single-line"&&o!="multi-line"&&o!="single string comma delimited"&&o!="single string to single-line"&&o!="single string to multi-line"&&(o="single string space delimited");break}}delete this.settings.ruleConfigs["Move Tags to Yaml"]["Yaml tags section style"]}o&&(this.settings.commonStyles.tagArrayStyle=o);let a=this.settings.ruleConfigs["Escape YAML Special Characters"];a&&(this.settings.commonStyles.escapeCharacter=a["Default Escape Character"]??this.settings.commonStyles.escapeCharacter,delete this.settings.ruleConfigs["Escape YAML Special Characters"]["Default Escape Character"]),this.saveSettings()}}; /*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */