Files
obsidian-vault/.obsidian/plugins/obsidian-linter/main.js
T

438 lines
882 KiB
JavaScript
Raw Normal View History

2026-08-31 09:38:04 +08:00
/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/
var vg=Object.create;var Vr=Object.defineProperty;var np=Object.getOwnPropertyDescriptor;var Lg=Object.getOwnPropertyNames;var Ag=Object.getPrototypeOf,Sg=Object.prototype.hasOwnProperty;var ip=t=>{throw TypeError(t)};var li=(t,n)=>()=>(n||t((n={exports:{}}).exports,n),n.exports),Bc=(t,n)=>{for(var e in n)Vr(t,e,{get:n[e],enumerable:!0})},rp=(t,n,e,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of Lg(n))!Sg.call(t,r)&&r!==e&&Vr(t,r,{get:()=>n[r],enumerable:!(i=np(n,r))||i.enumerable});return t};var ci=(t,n,e)=>(e=t!=null?vg(Ag(t)):{},rp(n||!t||!t.__esModule?Vr(e,"default",{value:t,enumerable:!0}):e,t)),Eg=t=>rp(Vr({},"__esModule",{value:!0}),t),x=(t,n,e,i)=>{for(var r=i>1?void 0:i?np(n,e):n,s=t.length-1,a;s>=0;s--)(a=t[s])&&(r=(i?a(n,e,r):a(r))||r);return i&&r&&Vr(n,e,r),r};var Rc=(t,n,e)=>n.has(t)||ip("Cannot "+e);var P=(t,n,e)=>(Rc(t,n,"read from private field"),e?e.call(t):n.get(t)),dt=(t,n,e)=>n.has(t)?ip("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(t):n.set(t,e),Ye=(t,n,e,i)=>(Rc(t,n,"write to private field"),i?i.call(t,e):n.set(t,e),e),be=(t,n,e)=>(Rc(t,n,"access private method"),e);var Fc=(t,n,e,i)=>({set _(r){Ye(t,n,r,e)},get _(){return P(t,n,i)}});var to=li((op,eo)=>{(function(t,n){"use strict";typeof define=="function"&&define.amd?define(n):typeof eo=="object"&&eo.exports?eo.exports=n():t.log=n()})(op,function(){"use strict";var t=function(){},n="undefined",e=typeof window!==n&&typeof window.navigator!==n&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"],r={},s=null;function a(f,h){var g=f[h];if(typeof g.bind=="function")return g.bind(f);try{return Function.prototype.bind.call(g,f)}catch{return function(){return Function.prototype.apply.apply(g,[f,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 l(f){return f==="debug"&&(f="log"),typeof console===n?!1:f==="trace"&&e?o:console[f]!==void 0?a(console,f):console.log!==void 0?a(console,"log"):t}function c(){for(var f=this.getLevel(),h=0;h<i.length;h++){var g=i[h];this[g]=h<f?t:this.methodFactory(g,f,this.name)}if(this.log=this.debug,typeof console===n&&f<this.levels.SILENT)return"No console available for logging"}function u(f){return function(){typeof console!==n&&(c.call(this),this[f].apply(this,arguments))}}function d(f,h,g){return l(f)||u.apply(this,arguments)}function p(f,h){var g=this,b,w,v,T="loglevel";typeof f=="string"?T+=":"+f:typeof f=="symbol"&&(T=void 0);function O(N){var q=(i[N]||"silent").toUpperCase();if(!(typeof window===n||!T)){try{window.localStorage[T]=q;return}catch{}try{window.document.cookie=encodeURIComponent(T)+"="+q+";"}catch{}}}function S(){var N;if(!(typeof window===n||!T)){try{N=window.localStorage[T]}catch{}if(typeof N===n)try{var q=window.document.cookie,_=encodeURIComponent(T),Y=q.indexOf(_+"=");Y!==-1&&(N=/^([^;]+)/.exec(q.slice(Y+_.length+1))[1])}catch{}return g.levels[N]===void 0&&(N=void 0),N}}function M(){if(!(typeof window===n||!T)){try{window.localStorage.removeItem(T)}catch{}try{window.document.cookie=encodeURIComponent(T)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function C(N){var q=N;if(typeof q=="string"&&g.levels[q.toUpperCase()]!==void 0&&(q=g.levels[q.toUpperCase()]),typeof q=="number"&&q>=0&&q<=g.levels.SILENT)return q;throw new TypeError("log.setLevel() called with invalid level: "+N)}g.name=f,g.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},g.methodFactory=h||d,g.getLevel=function(){return v??w??b},g.setLevel=function(N,q){return v=C(N),q!==!1&&O(v),c.call(g)},g.setDefaultLevel=function(N){w=C(N),S()||g.setLevel(N,!1)},g.resetLevel=function(){v=null,M(),c.call(g)},g.enableAll=function(N){g.setLevel(g.levels.TRACE,N)},g.disableAll=function(N){g.setLevel(g.levels.SILENT,N)},g.rebuild=function(){if(s!==g&&(b=C(s.getLevel())),c.call(g),s===g)for(var N in r)r[N].rebuild()},b=C(s?s.getLevel():"WARN");var B=S();B!=null&&(v=C(B)),c.call(g)}s=new p,s.getLogger=functi
`,u),d==-1&&(d=l.length-1);var m=l.substring(u,d+1);(i.hasOwnProperty?i.hasOwnProperty(m):i[m]!==void 0)?c+=String.fromCharCode(i[m]):(p==s&&(m=l.substring(u),d=l.length),c+=String.fromCharCode(p),i[m]=p,e[p++]=m),u=d+1}return c}var s=4e4,a=r(t);s=65535;var o=r(n);return{chars1:a,chars2:o,lineArray:e}};R.prototype.diff_charsToLines_=function(t,n){for(var e=0;e<t.length;e++){for(var i=t[e][1],r=[],s=0;s<i.length;s++)r[s]=n[i.charCodeAt(s)];t[e][1]=r.join("")}};R.prototype.diff_commonPrefix=function(t,n){if(!t||!n||t.charAt(0)!=n.charAt(0))return 0;for(var e=0,i=Math.min(t.length,n.length),r=i,s=0;e<r;)t.substring(s,r)==n.substring(s,r)?(e=r,s=e):i=r,r=Math.floor((i-e)/2+e);return r};R.prototype.diff_commonSuffix=function(t,n){if(!t||!n||t.charAt(t.length-1)!=n.charAt(n.length-1))return 0;for(var e=0,i=Math.min(t.length,n.length),r=i,s=0;e<r;)t.substring(t.length-r,t.length-s)==n.substring(n.length-r,n.length-s)?(e=r,s=e):i=r,r=Math.floor((i-e)/2+e);return r};R.prototype.diff_commonOverlap_=function(t,n){var e=t.length,i=n.length;if(e==0||i==0)return 0;e>i?t=t.substring(e-i):e<i&&(n=n.substring(0,e));var r=Math.min(e,i);if(t==n)return r;for(var s=0,a=1;;){var o=t.substring(r-a),l=n.indexOf(o);if(l==-1)return s;a+=l,(l==0||t.substring(r-a)==n.substring(0,a))&&(s=a,a++)}};R.prototype.diff_halfMatch_=function(t,n){if(this.Diff_Timeout<=0)return null;var e=t.length>n.length?t:n,i=t.length>n.length?n:t;if(e.length<4||i.length*2<e.length)return null;var r=this;function s(f,h,g){for(var b=f.substring(g,g+Math.floor(f.length/4)),w=-1,v="",T,O,S,M;(w=h.indexOf(b,w+1))!=-1;){var C=r.diff_commonPrefix(f.substring(g),h.substring(w)),B=r.diff_commonSuffix(f.substring(0,g),h.substring(0,w));v.length<B+C&&(v=h.substring(w-B,w)+h.substring(w,w+C),T=f.substring(0,g-B),O=f.substring(g+C),S=h.substring(0,w-B),M=h.substring(w+C))}return v.length*2>=f.length?[T,O,S,M,v]:null}var a=s(e,i,Math.ceil(e.length/4)),o=s(e,i,Math.ceil(e.length/2)),l;if(!a&&!o)return null;o?a?l=a[4].length>o[4].length?a:o:l=o:l=a;var c,u,d,p;t.length>n.length?(c=l[0],u=l[1],d=l[2],p=l[3]):(d=l[0],p=l[1],c=l[2],u=l[3]);var m=l[4];return[c,u,d,p,m]};R.prototype.diff_cleanupSemantic=function(t){for(var n=!1,e=[],i=0,r=null,s=0,a=0,o=0,l=0,c=0;s<t.length;)t[s][0]==Q?(e[i++]=s,a=l,o=c,l=0,c=0,r=t[s][1]):(t[s][0]==pe?l+=t[s][1].length:c+=t[s][1].length,r&&r.length<=Math.max(a,o)&&r.length<=Math.max(l,c)&&(t.splice(e[i-1],0,new R.Diff(le,r)),t[e[i-1]+1][0]=pe,i--,i--,s=i>0?e[i-1]:-1,a=0,o=0,l=0,c=0,r=null,n=!0)),s++;for(n&&this.diff_cleanupMerge(t),this.diff_cleanupSemanticLossless(t),s=1;s<t.length;){if(t[s-1][0]==le&&t[s][0]==pe){var u=t[s-1][1],d=t[s][1],p=this.diff_commonOverlap_(u,d),m=this.diff_commonOverlap_(d,u);p>=m?(p>=u.length/2||p>=d.length/2)&&(t.splice(s,0,new R.Diff(Q,d.substring(0,p))),t[s-1][1]=u.substring(0,u.length-p),t[s+1][1]=d.substring(p),s++):(m>=u.length/2||m>=d.length/2)&&(t.splice(s,0,new R.Diff(Q,u.substring(0,m))),t[s-1][0]=pe,t[s-1][1]=d.substring(0,d.length-m),t[s+1][0]=le,t[s+1][1]=u.substring(m),s++),s++}s++}};R.prototype.diff_cleanupSemanticLossless=function(t){function n(m,f){if(!m||!f)return 6;var h=m.charAt(m.length-1),g=f.charAt(0),b=h.match(R.nonAlphaNumericRegex_),w=g.match(R.nonAlphaNumericRegex_),v=b&&h.match(R.whitespaceRegex_),T=w&&g.match(R.whitespaceRegex_),O=v&&h.match(R.linebreakRegex_),S=T&&g.match(R.linebreakRegex_),M=O&&m.match(R.blanklineEndRegex_),C=S&&f.match(R.blanklineStartRegex_);return M||C?5:O||S?4:b&&!v&&T?3:v||T?2:b||w?1:0}for(var e=1;e<t.length-1;){if(t[e-1][0]==Q&&t[e+1][0]==Q){var i=t[e-1][1],r=t[e][1],s=t[e+1][1],a=this.diff_commonSuffix(i,r);if(a){var o=r.substring(r.length-a);i=i.substring(0,i.length-a),r=o+r.substring(0,r.length-a),s=o+s}for(var l=i,c=r,u=s,d=n(i,r)+n(r,s);r.charAt(0)===s.charAt(0);){i+=r.charAt(0),r=r.substring(1)+s.charAt(0),s=s.substring(1);var p=n(i,r)+n(r,s);p>=d&&(d=p,l=i,c=r,u=s)}t[e-1][1]!=l&&(l?t[e-1][1]=l:(t.splice(e-1,1),e--),t[e][1]=c,u?t[e+1][1]=u:(t.splice(e+1,1),e--))}e++}};R.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/;R.whitespaceRegex_=/\s/;R.linebreakRegex_=/[\r\n]/;R.blanklineEnd
`),i=0,r=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;i<e.length;){var s=e[i].match(r);if(!s)throw new Error("Invalid patch string: "+e[i]);var a=new R.patch_obj;for(n.push(a),a.start1=parseInt(s[1],10),s[2]===""?(a.start1--,a.length1=1):s[2]=="0"?a.length1=0:(a.start1--,a.length1=parseInt(s[2],10)),a.start2=parseInt(s[3],10),s[4]===""?(a.start2--,a.length2=1):s[4]=="0"?a.length2=0:(a.start2--,a.length2=parseInt(s[4],10)),i++;i<e.length;){var o=e[i].charAt(0);try{var l=decodeURI(e[i].substring(1))}catch{throw new Error("Illegal escape in patch_fromText: "+l)}if(o=="-")a.diffs.push(new R.Diff(le,l));else if(o=="+")a.diffs.push(new R.Diff(pe,l));else if(o==" ")a.diffs.push(new R.Diff(Q,l));else{if(o=="@")break;if(o!=="")throw new Error('Invalid patch mode "'+o+'" in: '+l)}i++}}return n};R.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0};R.patch_obj.prototype.toString=function(){var t,n;this.length1===0?t=this.start1+",0":this.length1==1?t=this.start1+1:t=this.start1+1+","+this.length1,this.length2===0?n=this.start2+",0":this.length2==1?n=this.start2+1:n=this.start2+1+","+this.length2;for(var e=["@@ -"+t+" +"+n+` @@
`],i,r=0;r<this.diffs.length;r++){switch(this.diffs[r][0]){case pe:i="+";break;case le:i="-";break;case Q:i=" ";break}e[r+1]=i+encodeURI(this.diffs[r][1])+`
`}return e.join("").replace(/%20/g," ")};Fr.exports=R;Fr.exports.diff_match_patch=R;Fr.exports.DIFF_DELETE=le;Fr.exports.DIFF_INSERT=pe;Fr.exports.DIFF_EQUAL=Q});var Gh=li((dj,Wh)=>{Wh.exports=_L;var Dv=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Nv=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Yv=["Su","Mo","Tu","We","Th","Fr","Sa"],dc=["January","February","March","April","May","June","July","August","September","October","November","December"],Kv=["ACDT","ACST","ACWT","ADT","ACT","AEDT","AEST","AFT","AKDT","AKST","ALMT","AMT","AMST","ANAT","ANAST","AQTT","ART","AST","AWDT","AWST","AZOT","AZOST","AZT","AZST","BNT","BDT","BOT","BRT","BRST","BST","BTT","B","CAST","CAT","CCT","CDT","CEDT","CEST","CET","CHADT","CHAST","CHOT","CHOST","CHsT","CHUT","CIT","CKT","CLST","CLT","COT","CST","CVT","CWST","CXT","C","DAVT","DDUT","DST","EASST","EAST","EAT","ECT","EDT","EEDT","EEST","EET","EGT","EGST","EST","E","EIT","FET","FJT","FJST","FKST","FKT","FNT","F","GALT","GAMT","GET","GFT","GILT","GMT","GST","GYT","G","HADT","HAST","HKT","HOVT","HOVST","HST","ICT","IDT","IOT","IRDT","IRKT","IRKST","IRST","IST","JST","KGT","KOST","KRAT","KRAST","KST","KUYT","LHDT","LHST","LINT","L","MAGT","MAGST","MART","MAWT","MDT","MeST","MHT","MIST","MMT","MSD","MSK","MST","MUT","MVT","MYT","NCT","NDT","NFT","N","NOVT","NOVST","NPT","NRT","NST","NT","NUT","NZDT","NZST","OMST","OMSST","ORAT","O","PDT","PET","PETT","PETST","PGT","PHT","PHOT","PKT","PMDT","PMST","PONT","PST","PWT","PYT","PYST","P","QYZT","RET","ROTT","R","SAKT","SAMT","SAST","SBT","SCT","SGT","SRT","SLT","SLST","SRET","SST","SYOT","TAHT","TFT","TJT","TKT","TLT","TMT","TOT","TRUT","TVT","T","ULAT","ULAST","UTC","UYST","UYT","UZT","U","VET","VLAT","VLAST","VOLT","VUT","V","WAKT","WAT","WAST","WDT","WEDT","WEST","WET","WFT","WGT","WGST","WIB","WIT","WITA","WST","WT","YAKT","YAKST","YAP","YEK","YEKS"],pc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],_v=new RegExp(Dv.join("|"),"i"),zv=new RegExp(Nv.join("|"),"i"),Pv=new RegExp("\\b("+Yv.join("|")+")\\b","i"),qv=new RegExp(dc.join("|"),"i"),Hv=new RegExp(pc.join("|"),"i"),$v=new RegExp("\\b("+Kv.join("|")+")\\b","i"),Uv=/(\d+)(st|nd|rd|th)\b/i,jv=/(\d{1,4})([/.-])(\d{1,2})[/.-](\d{1,4})/,Vv=/((\+|-)(12:00|11:00|10:00|09:30|09:00|08:00|07:00|06:00|05:00|04:00|03:30|03:00|02:00|01:00|00:00|01:00|02:00|03:00|03:30|04:00|04:30|05:00|05:30|05:45|06:00|06:30|07:00|08:00|08:45|09:00|09:30|10:00|10:30|11:00|12:00|12:45|13:00|14:00))$/,Wv=/((\+|-)(1200|1100|1000|0930|0900|0800|0700|0600|0500|0400|0330|0300|0200|0100|0000|0100|0200|0300|0330|0400|0430|0500|0530|0545|0600|0630|0700|0800|0845|0900|0930|1000|1030|1100|1200|1245|1300|1400))$/,_r="("+["AM?","PM?"].join("|")+")",Gv=new RegExp("0\\d\\:\\d{1,2}\\:\\d{1,2}(\\s*)"+_r,"i"),Qv=new RegExp("0\\d\\:\\d{1,2}(\\s*)"+_r,"i"),Zv=new RegExp("0\\d(\\s*)"+_r,"i"),Jv=new RegExp("\\d{1,2}\\:\\d{1,2}\\:\\d{1,2}(\\s*)"+_r,"i"),Xv=new RegExp("\\d{1,2}\\:\\d{1,2}(\\s*)"+_r,"i"),eL=new RegExp("\\d{1,2}(\\s*)"+_r,"i"),tL=new RegExp("\\d{1,2}"),nL=new RegExp(dc.join("|")+"-\\d{2}","i"),iL=new RegExp(pc.join("|")+"-\\d{2}","i"),Gd=new RegExp("(\\d{1,2})(\\D+)("+dc.join("|")+"|"+pc.join("|")+")(\\2)('?\\d{2,4})"),rL=/\d{2}:\d{2}:\d{2}\.\d{3}/,sL=/\d{2}:\d{2}:\d{2}\.\d{2}/,aL=/\d{2}:\d{2}:\d{2}\.\d{1}/,oL=/T\d{2}:\d{2}:\d{2}/,lL=/0\d:\d{2}:\d{2}/,cL=/0\d:\d{2}/,uL=/\b([01]?[0-9]|2[0-3]):[0-5][0-9]:\d{2}/,dL=/\b([01]?[0-9]|2[0-3]):[0-5][0-9]:\d{2}\.\d{3}/,pL=/\b([01]?[0-9]|2[0-3]):[0-5][0-9]:\d{2}\.\d{2}/,mL=/\b([01]?[0-9]|2[0-3]):[0-5][0-9]:\d{2}\.\d{1}/,fL=/\b([01]?[0-9]|2[0-3]):[0-5][0-9]/,hL=/24:00:\d{2}/,gL=/24:00:\d{2}\.\d{3}/,yL=/24:00:\d{2}\.\d{2}/,bL=/24:00:\d{2}\.\d{1}/,kL=/24:00/,wL=/\d{4}/,vL=/\d{2}/,LL=/'\d{2}/,Hh=/0\d/,$h=/\d{1,2}/,AL=/0\d/,SL=/\d{1,2}/,EL=/^([1-9])\/([1-9]|0[1-9])$/,TL=/^([1-9])\/(1[012])$/,xL=/^(0[1-9]|[12][0-9]|3[01])\/([1-9])$/,OL=/^(0[1-9]|[12][0-9]|3[01])\/(1[012]|0[1-9])$/,ML=/^([1-9])(\D)([1-9][0-9])$/,CL=/^([1-9])(\D)([0][0-9])$/,IL=/^(0[1-9]|1[012])(\D)([1-9][0-9])$/,BL=/^(0[1-9]|1[012])(\D)([0][0-9])$/,Qd=/([/][M]|[M][/]|[MM]|[M
`;e+=`${n.name} ${n.message}`,n.stack&&(e+=`
`+n.stack),ce.default.error(e),Gr&&so(e.substring(e.indexOf("]")+2),ce.default.levels.TRACE)}function It(t){ce.default.info(`${no} ${t}`),Gr&&so(t,ce.default.levels.INFO)}function et(t){ce.default.debug(`${no} ${t}`),Gr&&so(t,ce.default.levels.DEBUG)}function vt(t){ce.default.warn(`${no} ${t}`),Gr&&so(t,ce.default.levels.WARN)}function ui(t){ce.default.getLevel()>ce.default.levels.DEBUG||Nc.set(t,performance.now())}function In(t){if(ce.default.getLevel()>ce.default.levels.DEBUG)return;Nc.has(t)||vt(E("logs.timing-key-not-found").replace("{TIMING_KEY}",t));let n=performance.now()-Nc.get(t);et(`${t}: ${n} `+E("logs.milliseconds-abbreviation"))}function so(t,n){ce.default.getLevel()<=n&&io.push(t)}function lp(){io=[]}function Yc(t){Gr=t}function ao(t){switch(t){case"INFO":{ce.default.setLevel("info");break}case"TRACE":{ce.default.setLevel("trace");break}case"DEBUG":{ce.default.setLevel("debug");break}case"SILENT":{ce.default.setLevel("silent");break}case"ERROR":{ce.default.setLevel("error");break}case"WARN":{ce.default.setLevel("warn");break}}}function cp(t){switch(t){case ce.default.levels.INFO:return"INFO";case ce.default.levels.TRACE:return"TRACE";case ce.default.levels.DEBUG:return"DEBUG";case ce.default.levels.SILENT:return"SILENT";case ce.default.levels.ERROR:return"ERROR";case ce.default.levels.WARN:return"WARN"}}var up={};var dp={};var pp={};var mp={commands:{"lint-file":{name:"Linten Sie die aktuelle Datei","error-message":"Lint-Datei-Fehler in der Datei"},"lint-file-unless-ignored":{name:"Linten Sie die aktuelle Datei, es sei denn, sie wird ignoriert"},"lint-all-files":{name:"Linten Sie alle Dateien im Vault","error-message":"Beim Linten aller Dateien Fehler in der Datei","success-message":"Alle Dateien gelinted","errors-message-singular":"Beim Linten aller Dateien gab es einen Fehler.","errors-message-plural":"Beim Linten aller Dateien gab es {NUM} Fehler.","start-message":"Dadurch werden alle Ihre Dateien ver\xE4ndert und es k\xF6nnen Fehler entstehen.","submit-button-text":"Linte alle","submit-button-notice-text":"Linte alle Dateien..."},"lint-all-files-in-folder":{name:"Linte alle Dateien im aktuellen Ordner","start-message":"Dadurch werden alle Ihre Dateien in {FOLDER_NAME} bearbeitet, einschlie\xDFlich der Dateien in den Unterordnern, was zu Fehlern f\xFChren kann.","submit-button-text":"Linte alle Dateien in {FOLDER_NAME}","submit-button-notice-text":"Linten aller Dateien in {FOLDER_NAME}...","error-message":"Beim Linten aller Dateien im Ordner gab es Fehler in der Datei","success-message":"Alle {NUM}-Dateien in {FOLDER_NAME} wurden gelinted.","message-singular":"Alle {NUM}-Dateien in {FOLDER_NAME} wurden gelinted und es trat ein Fehler auf.","message-plural":"Alle {FILE_COUNT}-Dateien in {FOLDER_NAME} wurden gelinted und es gab {ERROR_COUNT} Fehler."},"paste-as-plain-text":{name:"Einf\xFCgen als reiner Text und ohne \xC4nderungen"},"lint-file-pop-up-menu-text":{name:"Linte Datei"},"lint-folder-pop-up-menu-text":{name:"Linte Ordner"}},logs:{"plugin-load":"Plugin wird geladen","plugin-unload":"Plugin entladen","folder-lint":"Linting-Ordner ","linter-run":"Laufender Linter","paste-link-warning":"Abgebrochenes Einf\xFCgen des Lints, da der Inhalt der Zwischenablage ein Link ist, wodurch Konflikte mit anderen Plugins vermieden werden, die das Einf\xFCgen \xE4ndern.","see-console":"Weitere Informationen finden Sie in der Konsole.","unknown-error":"Beim Linten ist ein unbekannter Fehler aufgetreten.","moment-locale-not-found":"Beim Versuch, Moment.js locale auf {MOMENT_LOCALE} umzustellen, wurde {CURRENT_LOCALE} angezeigt","file-change-lint-message-start":"Linted","pre-rules":"Regeln vor regul\xE4ren Regeln","post-rules":"Regeln nach regul\xE4ren Regeln","rule-running":"Laufende Regeln","custom-regex":"Benutzerdefinierte Regex-Regeln","running-custom-regex":"Ausf\xFChren von benutzerdefinierten Regex","running-custom-lint-command":"Ausf\xFChren von benutzerdefinierten Lint-Befehlen","custom-lint-duplicate-warning":'Sie k\xF6nnen denselben Befehl ("{COMMAND_NAME}") nicht zweimal als benutzerdefinierte Lint-Regel
`)break;r.trim()===""||r===">"?e=r+e:e="",i--}return[e,i]}function Hc(t=""){let[n]=sr(t,t.length);return`
`+n.trim()}function Dp(t="",n=!1,e=1){let i=Hc(t),r=Rn(i,">");return(n||fo.test(t))&&e===r||e<r?i.substring(0,i.lastIndexOf(">")):i}function Bg(t,n){if(n===0)return t;let e=n,i=n;for(;e>=0;){let r=t.charAt(e);if(r.trim()!=="")break;r===`
`&&(i=e),e--}return e<0||i===0?t.substring(n+1):t.substring(0,i)+`
`+t.substring(n)}function Rg(t,n,e,i=!1,r=!1){if(e===0)return t;let s=n.split(">").length-1,a=e,o=e,l=0,c=!1,u="";for(;a>=0;){let w=t.charAt(a);if(w.trim()!==""&&w!==">")break;if(w===">"){if(c)break;l++}else if(w===`
`)if(l===0||l===s||l+1===s)o=a,l=0,u===`
`&&(c=!0);else break;a--,u=w}if(a<0||o===0)return t.substring(e+1);let d=t.substring(o,e);if(d===`
`||d.startsWith(`
`))return t.substring(0,o)+`
`+t.substring(e);let m=t.lastIndexOf(`
`,o-1),f="";m===-1?f=t.substring(0,o):f=t.substring(m,o);let h,g=t.indexOf(`
`,e+1);g===-1?h=t.substring(e):h=t.substring(e,g);let b;return r?b=Dp(f,i,s):Rn(f,">")!=0&&!fo.test(f)&&(Jr.test(f)||Jr.test(h))?b=t.substring(o,e).trimEnd():b=Hc(f),t.substring(0,o)+b+t.substring(e)}function Fg(t,n){if(n===t.length-1)return t;let e=n,i=n,r=!0;for(;e<t.length;){let s=t.charAt(e);if(s.trim()!=="")break;s===`
`&&(r?r=!1:i=e),e++}return e===t.length||i===t.length-1?t.substring(0,n):t.substring(0,n)+`
`+t.substring(i)}function Dg(t,n,e,i=!1,r=!1){if(e===t.length-1)return t;let s=n.split(">").length-1,a=e,o=e,l=!0,c=0,u=!1,d="",p=!0,m=t.charAt(a-1);for(;a<t.length;){let O=t.charAt(a);if(O.trim()!==""&&O!==">")break;if(O===">"){if(u)break;c++}else if(O===`
`)if(c===0||c===s||c+1===s)c=0,l?l=!1:o=a,d===`
`&&(u=!0);else break;if(a++,d=O,p&&O===`
`&&r&&m===`
`){o=a;break}p=!1}if(a===t.length||o===t.length-1)return t.substring(0,e);let f=t.substring(e,o);if(f===`
`||f.endsWith(`
`))return t.substring(0,e)+`
`+t.substring(o);let g=t.indexOf(`
`,o+1),b="";g===-1?b=t.substring(o):b=t.substring(o+1,g);let w,v=t.lastIndexOf(`
`,e-1);v===-1?w=t.substring(0,o):w=t.substring(v+1,e);let T;return r?T=Dp(b,i,s):Jr.test(b)||Jr.test(w)?T=t.substring(e,o).trimEnd():T=Hc(b),t.substring(0,e)+T+t.substring(o)}function Bn(t,n,e,i=!1){let[r,s]=sr(t,n);if(r.trim()!==""){let o=fo.test(t.substring(n,e)),l=Rn(r,">"),c=Yg(t,e,l),u=Dg(t,r,c,o,i);return s=Ng(u,s,l),Rg(u,r,s,o,i)}let a=Fg(t,e);return Bg(a,s)}function Np(t,n=0){let e=3735928559^n,i=1103547991^n;for(let r=0,s;r<t.length;r++)s=t.charCodeAt(r),e=Math.imul(e^s,2654435761),i=Math.imul(i^s,1597334677);return e=Math.imul(e^e>>>16,2246822507)^Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507)^Math.imul(e^e>>>13,3266489909),4294967296*(2097151&i)+(e>>>0)}function Yp(t){return t=t.replaceAll("\\\\","\\"),t=t.replaceAll("\\f","\f"),t=t.replaceAll("\\n",`
`),t=t.replaceAll("\\r","\r"),t=t.replaceAll("\\t"," "),t=t.replaceAll("\\v","\v"),t}function ar(t,n){if(n==0)return n;let e=n;for(;e>0&&t.charAt(e-1)!==`
`;)e--;return e}function Kp(t,n,e,i){return i>t.length-1?t:t.slice(0,i)+t.slice(i,t.length).replace(n,e)}function Rn(t,n){let e=0;for(let i=0,r=t.length;i<r;i++){let s=t.indexOf(n,i);s>-1&&(e++,i=s)}return e}function mo(t){let n=typeof t;return n!="string"?n==="number":!isNaN(t)&&!isNaN(parseFloat(t))}function _p(t,n){let e=[],i=-1;for(;(i=n.indexOf(t,i+1))>=0;)e.push(i);return e}function Ng(t,n,e){let i=n,r=n+1,s="",a=!1,o=0;for(;r<t.length;){if(s=t.charAt(r),s.trim()!==""&&s!==">"){a=!0;break}else if(s===`
`){if(o!==e)break;o=0,i=r}else s===">"&&o++;r++}return a?i:n}function Yg(t,n,e){let i=n,r=n-1,s="",a=!1,o=0;for(;r>=0;){if(s=t.charAt(r),s.trim()!==""&&s!==">"){a=!0;break}else if(s===`
`){if(o!==e)break;o=0,i=r}else s===">"&&o++;r--}return a?i:n}function or(t){let n=lr(t),e=new Map,i="",r=[],s=[];for(let a of n){i=t.substring(a.startIndex,a.endIndex),r=i.split(`
`),r.splice(0,2);for(let o of r){if(s=o.split("|"),s.length!==4){vt(E("options.custom-auto-correct.custom-row-parse-warning").replace("{ROW}",o));continue}e.set(s[1].trim().toLowerCase(),s[2].trim())}}return e}function zp(t){return t.replace(/[\\[\]<>_*~=`$]/g,"\\$&")}function Pp(t){return t.replace(/(\\+)([!"#$%&'()*+,-./:;<=>?@[\\\]^_`{|}~])/g,(n,e,i)=>{let r=e.length,s=Math.floor(r/2);return"\\".repeat(s)+i})}function qe(t,n,e,i){let r=t.length,s=0,a;if(n<0?n=-n>r?0:r+n:n=n>r?r:n,e=e>0?e:0,i.length<1e4)a=Array.from(i),a.unshift(n,e),t.splice(...a);else for(e&&t.splice(n,e);s<i.length;)a=i.slice(s,s+1e4),a.unshift(n,0),t.splice(...a),s+=1e4,n+=1e4}function tt(t,n){return t.length>0?(qe(t,t.length,0,n),t):n}var Kg=Fn(/\p{P}/u),pt=Fn(/[A-Za-z]/),nt=Fn(/[\dA-Za-z]/),qp=Fn(/[#-'*+\--9=?A-Z^-~]/);function Xr(t){return t!==null&&(t<32||t===127)}var es=Fn(/\d/),Hp=Fn(/[\dA-Fa-f]/),$c=Fn(/[!-/:-@[-`{-~]/);function F(t){return t!==null&&t<-2}function oe(t){return t!==null&&(t<0||t===32)}function U(t){return t===-2||t===-1||t===32}function $p(t){return $c(t)||Kg(t)}var Up=Fn(/\s/);function Fn(t){return n;function n(e){return e!==null&&e>-1&&t.test(String.fromCharCode(e))}}function Uc(t){if(t===null||oe(t)||Up(t))return 1;if($p(t))return 2}function cr(t,n,e){let i=[],r=-1;for(;++r<t.length;){let s=t[r].resolveAll;s&&!i.includes(s)&&(n=s(n,e),i.push(s))}return n}var ts={name:"attention",tokenize:zg,resolveAll:_g};function _g(t,n){let e=-1,i,r,s,a,o,l,c,u;for(;++e<t.length;)if(t[e][0]==="enter"&&t[e][1].type==="attentionSequence"&&t[e][1]._close){for(i=e;i--;)if(t[i][0]==="exit"&&t[i][1].type==="attentionSequence"&&t[i][1]._open&&n.sliceSerialize(t[i][1]).charCodeAt(0)===n.sliceSerialize(t[e][1]).charCodeAt(0)){if((t[i][1]._close||t[e][1]._open)&&(t[e][1].end.offset-t[e][1].start.offset)%3&&!((t[i][1].end.offset-t[i][1].start.offset+t[e][1].end.offset-t[e][1].start.offset)%3))continue;l=t[i][1].end.offset-t[i][1].start.offset>1&&t[e][1].end.offset-t[e][1].start.offset>1?2:1;let d=Object.assign({},t[i][1].end),p=Object.assign({},t[e][1].start);jp(d,-l),jp(p,l),a={type:l>1?"strongSequence":"emphasisSequence",start:d,end:Object.assign({},t[i][1].end)},o={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},t[e][1].start),end:p},s={type:l>1?"strongText":"emphasisText",start:Object.assign({},t[i][1].end),end:Object.assign({},t[e][1].start)},r={type:l>1?"strong":"emphasis",start:Object.assign({},a.start),end:Object.assign({},o.end)},t[i][1].end=Object.assign({},a.start),t[e][1].start=Object.assign({},o.end),c=[],t[i][1].end.offset-t[i][1].start.offset&&(c=tt(c,[["enter",t[i][1],n],["exit",t[i][1],n]])),c=tt(c,[["enter",r,n],["enter",a,n],["exit",a,n],["enter",s,n]]),c=tt(c,cr(n.parser.constructs.insideSpan.null,t.slice(i+1,e),n)),c=tt(c,[["exit",s,n],["enter",o,n],["exit",o,n],["exit",r,n]]),t[e][1].end.offset-t[e][1].start.offset?(u=2,c=tt(c,[["enter",t[e][1],n],["exit",t[e][1],n]])):u=0,qe(t,i-1,e-i+3,c),e=i+c.length-u-2;break}}for(e=-1;++e<t.length;)t[e][1].type==="attentionSequence"&&(t[e][1].type="data");return t}function zg(t,n){let e=this.parser.constructs.attentionMarkers.null,i=this.previous,r=Uc(i),s;return a;function a(l){return s=l,t.enter("attentionSequence"),o(l)}function o(l){if(l===s)return t.consume(l),o;let c=t.exit("attentionSequence"),u=Uc(l),d=!u||u===2&&r||e.includes(l),p=!r||r===2&&u||e.includes(i);return c._open=!!(s===42?d:d&&(r||!p)),c._close=!!(s===42?p:p&&(u||!d)),n(l)}}function jp(t,n){t.column+=n,t.offset+=n,t._bufferIndex+=n}var jc={name:"autolink",tokenize:Pg};function Pg(t,n,e){let i=0;return r;function r(m){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(m),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),s}function s(m){return pt(m)?(t.consume(m),a):c(m)}function a(m){return m===43||m===45||m===46||nt(m)?(i=1,o(m)):c(m)}function o(m){return m===58?(t.consume(m),i=0,l):(m===43||m===45||m===46||nt(m))&&i++<32?(t.consume(m),o):(i=0,c(m))}function l(m){return m===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(m),t.exit("autolinkMarker"),t.exit("autolink
`;break}case-3:{a=`\r
`;break}case-2:{a=n?" ":" ";break}case-1:{if(!n&&r)continue;a=" ";break}default:a=String.fromCharCode(s)}r=s===-2,i.push(a)}return i.join("")}var pu={};Bc(pu,{attentionMarkers:()=>Tb,contentInitial:()=>wb,disable:()=>xb,document:()=>kb,flow:()=>Lb,flowInitial:()=>vb,insideSpan:()=>Eb,string:()=>Ab,text:()=>Sb});var kb={42:Qe,43:Qe,45:Qe,48:Qe,49:Qe,50:Qe,51:Qe,52:Qe,53:Qe,54:Qe,55:Qe,56:Qe,57:Qe,62:ho},wb={91:Gc},vb={[-2]:ns,[-1]:ns,32:ns},Lb={35:Zc,42:hi,45:[Ao,hi],60:Xc,61:Ao,95:hi,96:bo,126:bo},Ab={38:yo,92:go},Sb={[-5]:is,[-4]:is,[-3]:is,33:tu,38:yo,42:ts,60:[jc,eu],91:nu,92:[Qc,go],93:fi,95:ts,96:Vc},Eb={null:[ts,um]},Tb={null:[42,95]},xb={null:[]};function mu(t){let e=Eo([pu,...(t||{}).extensions||[]]),i={defined:[],lazy:{},constructs:e,content:r(am),document:r(lm),flow:r(cm),string:r(dm),text:r(pm)};return i;function r(s){return a;function a(o){return hm(i,s,o)}}}function fu(t){for(;!ko(t););return t}var gm=/[\0\t\n\r]/g;function hu(){let t=1,n="",e=!0,i;return r;function r(s,a,o){let l=[],c,u,d,p,m;for(s=n+(typeof s=="string"?s.toString():new TextDecoder(a||void 0).decode(s)),d=0,n="",e&&(s.charCodeAt(0)===65279&&d++,e=void 0);d<s.length;){if(gm.lastIndex=d,c=gm.exec(s),p=c&&c.index!==void 0?c.index:s.length,m=s.charCodeAt(p),!c){n=s.slice(d);break}if(m===10&&d===p&&i)l.push(-3),i=void 0;else switch(i&&(l.push(-5),i=void 0),d<p&&(l.push(s.slice(d,p)),t+=p-d),m){case 0:{l.push(65533),t++;break}case 9:{for(u=Math.ceil(t/4)*4,l.push(-2);t++<u;)l.push(-1);break}case 10:{l.push(-4),t=1;break}default:i=!0,t=1}d=p+1}return o&&(i&&l.push(-5),n&&l.push(n),l.push(null)),l}}var Ob=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ym(t){return t.replace(Ob,Mb)}function Mb(t,n,e){if(n)return n;if(e.charCodeAt(0)===35){let r=e.charCodeAt(1),s=r===120||r===88;return To(e.slice(s?2:1),s?16:10)}return ur(e)||t}function dr(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?bm(t.position):"start"in t||"end"in t?bm(t):"line"in t||"column"in t?gu(t):""}function gu(t){return km(t&&t.line)+":"+km(t&&t.column)}function bm(t){return gu(t&&t.start)+"-"+gu(t&&t.end)}function km(t){return t&&typeof t=="number"?t:1}var vm={}.hasOwnProperty;function yu(t,n,e){return typeof n!="string"&&(e=n,n=void 0),Cb(e)(fu(mu(e).document().write(hu()(t,n,!0))))}function Cb(t){let n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Qa),autolinkProtocol:B,autolinkEmail:B,atxHeading:s(Va),blockQuote:s(pn),characterEscape:B,characterReference:B,codeFenced:s(wt),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(wt,a),codeText:s(Zt,a),codeTextData:B,data:B,codeFlowValue:B,definition:s(Cn),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(nr),hardBreakEscape:s(Wa),hardBreakTrailing:s(Wa),htmlFlow:s(Hr,a),htmlFlowData:B,htmlText:s(Hr,a),htmlTextData:B,image:s(Ga),label:a,link:s(Qa),listItem:s(mn),listItemValue:p,listOrdered:s(Za,d),listUnordered:s(Za),paragraph:s(ir),reference:A,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(Va),strong:s(Ja),thematicBreak:s($r)},exit:{atxHeading:l(),atxHeadingSequence:O,autolink:l(),autolinkEmail:me,autolinkProtocol:dn,blockQuote:l(),characterEscapeValue:N,characterReferenceMarkerHexadecimal:We,characterReferenceMarkerNumeric:We,characterReferenceValue:un,codeFenced:l(g),codeFencedFence:h,codeFencedFenceInfo:m,codeFencedFenceMeta:f,codeFlowValue:N,codeIndented:l(b),codeText:l(V),codeTextData:N,data:N,definition:l(),definitionDestinationString:T,definitionLabelString:w,definitionTitleString:v,emphasis:l(),hardBreakEscape:l(_),hardBreakTrailing:l(_),htmlFlow:l(Y),htmlFlowData:N,htmlText:l(j),htmlTextData:N,image:l(re),label:Ne,labelText:je,lineEnding:q,link:l(X),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:Ce,resourceDestinationString:L,resourceTitleString:Ve,resource:Xe,setextHeading:l(C),setextHeadingLineSequence:M,setextHeadingText:S,strong:l(),thematicBreak:l()}};Lm(n,(t||{}).mdastExtensions||[]);let e={};return i;function
`&&(t=t.substring(0,l.end.offset)+t.substring(l.end.offset+1)),l.end.offset<t.length&&t[l.end.offset]===`
`&&(t=t.substring(0,l.end.offset)+t.substring(l.end.offset+1)),t=t.substring(0,l.start.offset)+t.substring(l.end.offset),a(t,c,l.start.offset)}for(let l of r){let c=l[1],u=c.referencePositions.length-c.footnotesReferencingKey.length;u=u>=0?u:0;let d=0;for(let p of c.footnotesReferencingKey){if(d+u>=c.referencePositions.length)throw new Error(E("logs.missing-footnote-error-message").replace("{FOOTNOTE}",p));s.set(p,c.referencePositions[u+d++])}}i=i.sort((l,c)=>s.get(l)-s.get(c)),i.length>0&&(t=t.trimEnd());let o=`
`;n?o=`
`:i.length>0&&(t+=`
`);for(let l of i)t+=o+l;return t}function Mm(t){let n=Ae("footnoteDefinition",t),e=[],i=new Map,r=new Map,s=[],a=new Set,o=[],l=function(d,p,m){let f=p.match(/\[\^.*?\]/)[0];i.set(p,f);let h=a.has(f);if(h&&e.includes(p)){o.unshift(p);return}else if(h)throw new Error(E("logs.too-many-footnotes-error-message").replace("{FOOTNOTE_KEY}",f));let g;do g=d.lastIndexOf(f,m),g!==-1&&((g+p.length>d.length||d.substring(g,g+p.length)!==p)&&s.push({key:f,position:g}),m=g-1);while(g>0);a.add(f)};for(let d of n){let p=t.substring(d.start.offset,d.end.offset);e.unshift(p),l(t,p,d.start.offset)}let c=1,u=new Set;for(let d of e){if(u.has(d))continue;u.add(d);let p=i.get(d),m=`[^${c++}]`;r.set(p,m)}s.sort((d,p)=>p.position-d.position);for(let d of s){let p=r.get(d.key);t=Kp(t,d.key,p,d.position)}for(let d of u){let p=i.get(d),m=r.get(p);t=t.replace(d,d.replace(p,m))}for(let d of o){let p=t.replace(`
${d}
`,`
`);t===p&&(p=t.replace(d,"")),t=p}return t}function xo(t,n,e){let i=Ae(e,t);if(i.length===0)return t;let r="";if(n==="underscore")r="_";else if(n==="asterisk")r="*";else{let s=i[i.length-1];r=t.substring(s.start.offset,s.start.offset+1)}e==="strong"&&(r+=r);for(let s of i){let a=r+t.substring(s.start.offset+r.length,s.end.offset-r.length)+r;t=ue(t,s.start.offset,s.end.offset,a)}return t}function Cm(t,n){let e=Ae("paragraph",t);if(e.length===0)return t;for(let i of e){let r=t.substring(i.start.offset,i.end.offset).split(`
`),s=r.length-1;if(s<1)continue;let a=0;if(!(Zm.test(r[0])&&r[1].startsWith(">")&&(a=1,s<2))){for(let o=a;o<s;o++){let l=r[o];Ub(l,n)||(r[o]=jb(l,n))}t=ue(t,i.start.offset,i.end.offset,r.join(`
`))}}return t}function Ub(t,n){return!!(t.endsWith("<br>")&&n=="<br>"||t.endsWith("<br/>")&&n=="<br/>"||t.endsWith(" ")&&n==" "||!t.endsWith("\\\\")&&t.endsWith("\\")&&n=="\\")}function jb(t,n){t=t.trimEnd();let e=0;return t.endsWith("<br>")&&(e=4),t.endsWith("<br/>")&&(e=5),!t.endsWith("\\\\")&&t.endsWith("\\")&&(e=1),e&&(t=t.substring(0,t.length-e)),t.trimEnd()+n}function Im(t){let n=t.endsWith(`
`),e=Ae("paragraph",t);if(e.length===0)return t;for(let i of e){let r=i.start.offset;for(r>0&&r--;r>=0&&t.charAt(r)!=`
`;)r--;r++;let s=t.substring(r,i.end.offset).split(`
`),a=s[0].trimStart();if(a.startsWith(">")||a.match(Oo)||a.match(Mo))continue;let o=s.length,l=[],c=!1;for(let f=0;f<o;f++){let h=s[f];if(c){let g=l.length-1;l[g]+=`
`+h}else l.push(h);c=h.endsWith("<br>")||h.endsWith("<br/>")||h.endsWith(" ")||!h.endsWith("\\\\")&&h.endsWith("\\")}for(;r>0&&t.charAt(r-1)==`
`;)r--;let u=t.length,d=i.end.offset;for(d<u&&d++;d<u&&t.charAt(d)==`
`;)d++;let p=`
`;r==0&&(p="");let m=`
`;d==u&&(m=""),t=ue(t,r,d,p+l.join(`
`)+m)}return n&&!t.endsWith(`
`)&&(t+=`
`),t}function Bm(t){let n=Ae("link",t);for(let e of n){if(e==null)continue;let i=t.substring(e.start.offset,e.end.offset);if(!i.match(ls))continue;let r=i.indexOf("]"),s=i.substring(0,1)+i.substring(1,r).trim()+i.substring(r);t=ue(t,e.start.offset,e.end.offset,s)}return t}function Rm(t,n){let e=Ae("emphasis",t);for(let i of e){let r=t.substring(i.start.offset+1,i.end.offset-1);r=n(r),t=ue(t,i.start.offset+1,i.end.offset-1,r)}return t}function Fm(t,n){let e=Ae("strong",t);for(let i of e){let r=t.substring(i.start.offset+2,i.end.offset-2);r=n(r),t=ue(t,i.start.offset+2,i.end.offset-2,r)}return t}function Kn(t,n,e=!1){let i=Hb(t,e);for(let r of i){let s=r.position.start.offset;if(r.isEmpty){for(;s<r.position.end.offset&&t.charAt(s).trim()!=="";)s++;s<r.position.end.offset&&s++}else{for(;s>0&&t.charAt(s-1).trim()==="";)s--;(s===0||t.charAt(s-1).trim()!="")&&s++}let a=t.substring(s,r.position.end.offset);Qm.test(a)&&(s+=4,a=a.substring(4)),a=n(a),t=ue(t,s,r.position.end.offset,a)}return t}function Dm(t){let n=Ae("code",t);for(let e of n){let i=t.substring(e.start.offset,e.end.offset);!i.startsWith("```")&&!i.startsWith("~~~")||(t=Bn(t,e.start.offset,e.end.offset))}return t}function Nm(t,n){let e=Ae("math",t);for(let i of e)t=Bn(t,i.start.offset,i.end.offset);e=Ae("inlineMath",t);for(let i of e)t.substring(i.start.offset,i.end.offset).startsWith("$".repeat(n))&&(t=Bn(t,i.start.offset,i.end.offset));return t}function Ym(t){let n=Ae("blockquote",t);for(let e of n){let i=e.end.offset;for(;i<t.length-1&&t.charAt(i)!==`
`;)i++;t=Bn(t,e.start.offset,i,!0)}return t}function Km(t){let n=Ae("thematicBreak",t);for(let e of n)t=Bn(t,e.start.offset,e.end.offset);return t}function _m(t,n,e,i){let r=Ae("list",t);if(!r)return t;for(let s of r){let a=s.start.offset;for(;a>0&&t.charAt(a-1)!==`
`;)a--;let o=t.substring(a,s.end.offset),l=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},c=new Map,u=function(p,m){let f=m;for(;f>p;)c.delete(f--)},d=-1;o=o.replace(/^(( |\t|> )*)((\d+(\.|\)))|[-*+])([^\n]*)$/gm,(p,m="",f,h,g,b,w)=>{let v=n==="preserve"||i?Number(g):1,T=l(m);if(!/^\d/.test(h)){let O=T>d?T:d;return u(T,O),p}return c.has(T)?n==="ascending"?(v=c.get(T)+1,c.set(T,v)):i&&(v=c.get(T)):c.set(T,v),d>T&&u(T,d),d=T,`${m}${v}${e}${w}`}),t=ue(t,a,s.end.offset,o)}return t}function zm(t,n){let e=Ae("listItem",t);if(!e)return t;let i=/^((\d+[.)])|(- \[[ x]\]))/m,r=n;if(n=="consistent"){let s=e.length-1;for(;s>=0;){let a=t.substring(e[s].start.offset,e[s].end.offset);if(s--,!a.match(i)){r=a.charAt(0);break}}if(s==-1)return t}for(let s of e){let a=t.substring(s.start.offset,s.end.offset);a.match(i)||(a=r+a.substring(1),t=ue(t,s.start.offset,s.end.offset,a))}return t}function Mu(t,n){let e=Ae("blockquote",t);for(let i of e){let r=i.end.offset;for(;r<t.length-1&&t.charAt(r)!==`
`;)r++;let s=t.substring(i.start.offset,r);s=n(s),t=ue(t,i.start.offset,r,s)}return t}function Pm(t,n){let e=Ae("math",t),i=new RegExp("^(\\${"+n+",})(\\n*)"),r=new RegExp("(\\n*)(\\${"+n+",})([^\\$]*)$");for(let s of e){let a=t.substring(s.start.offset,s.end.offset),o=Vb(a,n,s.start.offset);for(let l of o)t=Tm(t,l.startIndex,l.endIndex,i,r)}e=Ae("inlineMath",t);for(let s of e)t.substring(s.start.offset,s.end.offset).startsWith("$".repeat(n))&&(t=Tm(t,s.start.offset,s.end.offset,i,r));return t}function Vb(t,n,e){let i="$".repeat(n),r=n;for(;t.charAt(r)==="$";)i+="$",r++;let s=[],a=Rn(t,i);if(a<=1)return[];if(a===2)return s.unshift({startIndex:e,endIndex:e+t.length}),s;a===3&&s.unshift({startIndex:e,endIndex:e+t.indexOf(i,i.length)+i.length}),a%2===1&&a--;let o=e,l=i.length;for(;a>2;){let c=t.indexOf(i,l)+i.length;s.unshift({startIndex:o,endIndex:e+c}),o=e+c+1,l=c+1,a-=2}return s.unshift({startIndex:e+t.indexOf(i,l),endIndex:e+t.length}),s}function Tm(t,n,e,i,r){let s=t.substring(ar(t,n),n)??"",[a]=sr(s,s.length),o=t.substring(ar(t,e),e)??"",l=t.substring(n,e),c=Um.test(s.trim()),u=!1;for(l=l.replace(i,(d,p,m="")=>{let f="";return!c&&s.trim()!=""?(f+=`
`,u=!0):c&&!Tu.test(s)&&(f+=`
`+a,u=!0),f+=p+`
`,m===""&&c&&(f+=a),f}),l=l.replace(r,(d,p="",m,f)=>{let h=p==="";return h&&c&&Tu.test(o.trim())?d:h&&c?`
`+a+m+f:`
`+m+f});u&&n>0;){let d=t[n-1];if(d!==" "&&d!==" ")break;n--}return ue(t,n,e,l)}function lr(t){let n=[...t.matchAll(jm)],e=[];for(let i of n){let r=ar(t,i.index);if(r===0)continue;let s=ar(t,r-1),a=i[0],o=t.substring(r,i.index+a.length);if(Wb(o,a))continue;let l=s,c=t.substring(s,r-1);if(!a.includes("|")&&!c.includes("|"))continue;c=c.replace(xu,f=>{let h=f.trim();return h===""||h==="|"||(l+=f.length-1),""});let u=a.replace(xu,"");if(c.endsWith("|")&&(c=c.slice(0,-1)),u.endsWith("|")&&(u=u.slice(0,-1)),xm(c)!==xm(u))continue;if(s!==0){let f=ar(t,s-1),h=t.substring(f,s-1);if(h.startsWith("|")||h.endsWith("|"))continue}let d=i.index+i[0].length;if(d>=t.length-1){e.push({startIndex:l,endIndex:t.length});continue}let p=t.substring(d+1).split(`
`),m=0;for(;m<p.length&&Vm.test(p[m]);)d+=p[m].length+1,m++;e.push({startIndex:l,endIndex:d})}return e.reverse()}function Wb(t,n){if(t.trim()===""||n.includes("||"))return!0;let e=t.replace(n,"");return/[^\s>]/.test(e)}function xm(t){let n=!1,e=0,i=0,r="";for(let s=0;s<t.length;s++)r=t[s],r==="\\"?(e++,n=e%2==1):(e=0,r==="|"&&!n&&i++,n=!1);return i}function qm(t){let n=0,e=[],i=[...t.matchAll(Wm)];if(!i||i.length===0)return e;let r=[...t.matchAll(Gm)];return i.forEach(s=>{n=s.index;let a=!1,o=t.length-1;for(;r&&r.length!==0&&!a;)if(r[0].index<=n)r.shift();else{a=!0;let l=r[0];o=l.index+l[0].length}e.push({startIndex:n,endIndex:o}),!r||r.length}),e.reverse()}function Hm(t,n){let e=Ae("code",t);for(let i of e){let r=t.substring(i.start.offset,i.end.offset);!r.startsWith("```")||r.substring(3,r.indexOf(`
`)).trim()!==""||(t=ue(t,i.start.offset+3,i.start.offset+3,n))}return t}function $m(t,n){let e=$b(t),i=[];for(let r of e){let s=n(r.text);if(s!==r.text){let a=t.substring(r.position.start.offset,r.position.end.offset),o=r.position.start.offset+a.indexOf(r.text);i.push({startIndex:o,endIndex:o+r.text.length,newText:s})}}for(let r of i)t=ue(t,r.startIndex,r.endIndex,r.newText);return t}var _n=/^([ \t]*)(#+)([ \t]+)([^\n\r]*?)([ \t]+#+)?$/gm,Jm=`^XXX\\.*?
(?:((?:.|
)*?)
)?XXX(?=\\s|$)$`,He=/^---\n((?:(((?!---)(?:.|\n)*?)\n)?))---(?=\n|$)/,Gb=Jm.replaceAll("X","`"),Qb=Jm.replaceAll("X","~"),Zb=`^(( |( {4})).*
)+`,hO=new RegExp(`${Gb}|${Qb}|${Zb}`,"gm"),Co=/(!?)\[{2}([^\][\n|]+)(\|([^\][\n|]+))?(\|([^\][\n|]+))?\]{2}/g,ls=/(!?)\[([^[]*)\](\(.*\))/g,cs=/(\s|^)(#[\p{L}\-_\d/\p{Emoji_Presentation}]+)/gu,Xm=/^%%\n[^%]*\n%%/gm,us=/[,\s]+/,ef=/\S+/g,Io=/(\. ?){2}\./g,ds="\\s*(>\\s*)*",Tu=/^(>( |\t)*)+\$*?$/m,Um=/^\s*(>\s*)+/m,jm=/(\|? *:?-{1,}:? *\|?)(\| *:?-{1,}:? *\|?)*( |\t)*$/gm,xu=/^(((>[ ]?)*)|([ ]{0,3}))\|/m,Vm=/[^\n]*?\|[^\n]*?(\n|$)/m,tf=/(([a-z\-0-9]+:)\/{2,3})([^\s/?#]*[^\s")'.?!/]|[/])?(([/?#][^\s")']*[^\s")'.?!])|[/])?/gi,zn=/(?:(?:(?:[a-z]+:)?\/\/)|www\.)(?:localhost|(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?:(?:[a-fA-F\d]{1,4}:){7}(?:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,2}|:)|(?:[a-fA-F\d]{1,4}:){4}(?:(?::[a-fA-F\d]{1,4}){0,1}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,3}|:)|(?:[a-fA-F\d]{1,4}:){3}(?:(?::[a-fA-F\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,4}|:)|(?:[a-fA-F\d]{1,4}:){2}(?:(?::[a-fA-F\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,5}|:)|(?:[a-fA-F\d]{1,4}:){1}(?:(?::[a-fA-F\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,6}|:)|(?::(?:(?::[a-fA-F\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,7}|:)))(?:%[0-9a-zA-Z]{1,})?|(?:(?:[a-z0-9][-_]*)*[a-z0-9]+)(?:\.(?:[a-z0-9]-*)*[a-z0-9]+)*(?:\.(?:[a-z]{2,})))(?::\d{2,5})?(?:(?:[/?#][a-z0-9-_%/&=?$.+~!*‘(,#@]*[a-z0-9-%_/$+~!*‘(,])|[/])?/gi,gO=new RegExp("^"+zn.source+"$","si"),nf=/<a[\s]+([^>]+)>((?:.(?!<\/a>))*.)<\/a>/g,rf=/[\p{L}\p{N}\p{Pc}\p{M}\-'’`]+/gu,sf=/&[^\s]+;$/mi,Wm=mf(!0),Gm=mf(!1),af=/[“”„«»]/g,of=/[‘’‚‹›]/g,lf=/<%[^]*?%>/g,yi="\\[.\\]",Qm=new RegExp(`^${yi}`),cf=new RegExp(`^${ds}- ${yi} `),Bo=new RegExp(`^\\s*- ${yi} `),Oo=new RegExp(`^\\s*(- |\\* |\\+ |\\d+[.)] |- (${yi}) )`,"m"),Mo=/^(\[\^[^\]]*\]) ?([,.;!:?])/gm,Zm=/^ ?\[![^\s]*\]/m,fo=/^(>\s*)+\[![^\s]*\]/m,Jr=/^\n?(>\s*)+((```)|(~~~))/m,Cu=RegExp(/\p{L}/,"u"),Ro=/(\n([\t\v\f\r \u00a0\u2000-\u200b\u2028-\u2029\u3000]+)?){2,}\n/g;function it(t){return t.replace(/\$/g,"$$$$")}function mt(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function uf(t){let n=t.match(Co);if(n){for(let e of n)if(e.includes("|")){let i=e.indexOf("|"),r=e.substring(0,i+1)+e.substring(i+1,e.length-2).trim()+"]]";t=t.replace(e,r)}}return t}function df(t){let n=lr(t);if(n.length===0)return t;for(let e of n)t=Bn(t,e.startIndex,e.endIndex);return t}function Fo(t){let n=t.match(/^#\s+(.*)/m);if(n&&n[1]){let e=n[1];return e=e.replaceAll(Co,(i,r,s,a)=>a!=null?a.replace("|",""):s),e=e.replaceAll(ls,"$2"),Pp(e)}return""}function pf(t){return[...t.matchAll(cs)].map(n=>n[2])}function mf(t){let n="(?:<!-{2,}|%%) *linter-{ENDING_TEXT} *(?:-{2,}>|%%)",e="";return t?e+="disable":e+="enable",new RegExp(n.replace("{ENDING_TEXT}",e),"g")}var Do=Symbol.for("yaml.alias"),No=Symbol.for("yaml.document"),Rt=Symbol.for("yaml.map"),Iu=Symbol.for("yaml.pair"),ft=Symbol.for("yaml.scalar"),gn=Symbol.for("yaml.seq"),rt=Symbol.for("yaml.node.type"),Ft=t=>!!t&&typeof t=="object"&&t[rt]===Do,Dt=t=>!!t&&typeof t=="object"&&t[rt]===No,Nt=t=>!!t&&typeof t=="object"&&t[rt]===Rt,ee=t=>!!t&&typeof t=="object"&&t[rt]===Iu,G=t=>!!t&&typeof t=="object"&&t[rt]===ft,Yt=t=>!!t&&typeof t=="object"&&t[rt]===gn;function se(t){if(t&&typeof t=="object")switch(t[rt]){case Rt:case gn:return!0}return!1}function te(t){if(t&&typeof t=="object")switch(t[rt]){case Do:case Rt:case ft:case gn:return!0}return!1}var Yo=t=>(G(t)||se(t))&&!!t.anchor;var ot=Symbol("break visit"),ff=Symbol("skip children"),Xt=Symbol("
`)}};tn.defaultYaml={explicit:!1,version:"1.2"};tn.defaultTags={"!!":"tag:yaml.org,2002:"};function _o(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let e=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(e)}return!0}function Bu(t){let n=new Set;return en(t,{Value(e,i){i.anchor&&n.add(i.anchor)}}),n}function Ru(t,n){for(let e=1;;++e){let i=`${t}${e}`;if(!n.has(i))return i}}function bf(t,n){let e=[],i=new Map,r=null;return{onAnchor:s=>{e.push(s),r??(r=Bu(t));let a=Ru(n,r);return r.add(a),a},setAnchors:()=>{for(let s of e){let a=i.get(s);if(typeof a=="object"&&a.anchor&&(G(a.node)||se(a.node)))a.node.anchor=a.anchor;else{let o=new Error("Failed to resolve repeated object (this should not happen)");throw o.source=s,o}}},sourceObjects:i}}function Pn(t,n,e,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,s=i.length;r<s;++r){let a=i[r],o=Pn(t,i,String(r),a);o===void 0?delete i[r]:o!==a&&(i[r]=o)}else if(i instanceof Map)for(let r of Array.from(i.keys())){let s=i.get(r),a=Pn(t,i,r,s);a===void 0?i.delete(r):a!==s&&i.set(r,a)}else if(i instanceof Set)for(let r of Array.from(i)){let s=Pn(t,i,r,r);s===void 0?i.delete(r):s!==r&&(i.delete(r),i.add(s))}else for(let[r,s]of Object.entries(i)){let a=Pn(t,i,r,s);a===void 0?delete i[r]:a!==s&&(i[r]=a)}return t.call(n,e,i)}function Be(t,n,e){if(Array.isArray(t))return t.map((i,r)=>Be(i,String(r),e));if(t&&typeof t.toJSON=="function"){if(!e||!Yo(t))return t.toJSON(n,e);let i={aliasCount:0,count:1,res:void 0};e.anchors.set(t,i),e.onCreate=s=>{i.res=s,delete e.onCreate};let r=t.toJSON(n,e);return e.onCreate&&e.onCreate(r),r}return typeof t=="bigint"&&!e?.keep?Number(t):t}var qn=class{constructor(n){Object.defineProperty(this,rt,{value:n})}clone(){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(n.range=this.range.slice()),n}toJS(n,{mapAsMap:e,maxAliasCount:i,onAnchor:r,reviver:s}={}){if(!Dt(n))throw new TypeError("A document argument is required");let a={anchors:new Map,doc:n,keep:!0,mapAsMap:e===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},o=Be(this,"",a);if(typeof r=="function")for(let{count:l,res:c}of a.anchors.values())r(c,l);return typeof s=="function"?Pn(s,{"":o},"",o):o}};var yn=class extends qn{constructor(n){super(Do),this.source=n,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(n,e){if(e?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let i;e?.aliasResolveCache?i=e.aliasResolveCache:(i=[],en(n,{Node:(s,a)=>{(Ft(a)||Yo(a))&&i.push(a)}}),e&&(e.aliasResolveCache=i));let r;for(let s of i){if(s===this)break;s.anchor===this.source&&(r=s)}return r}toJSON(n,e){if(!e)return{source:this.source};let{anchors:i,doc:r,maxAliasCount:s}=e,a=this.resolve(r,e);if(!a){let l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let o=i.get(a);if(o||(Be(a,null,e),o=i.get(a)),o?.res===void 0){let l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(s>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=zo(r,a,i)),o.count*o.aliasCount>s)){let l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return o.res}toString(n,e,i){let r=`*${this.source}`;if(n){if(_o(this.source),n.options.verifyAliasOrder&&!n.anchors.has(this.source)){let s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(n.implicitKey)return`${r} `}return r}};function zo(t,n,e){if(Ft(n)){let i=n.resolve(t),r=e&&i&&e.get(i);return r?r.count*r.aliasCount:0}else if(se(n)){let i=0;for(let r of n.items){let s=zo(t,r,e);s>i&&(i=s)}return i}else if(ee(n)){let i=zo(t,n.key,e),r=zo(t,n.value,e);return Math.max(i,r)}return 1}var Po=t=>!t||typeof t!="function"&&typeof t!="object",z=class extends qn{constructor(n){super(ft),this.value=n}toJSON(n,e){return e?.keep?this.value:Be(this.value,n,e)}toString(){return String(this.value)}};z.BLOCK_FOLDED="BLOCK_FOLDED";z.BLOCK_LITERAL="BLOCK_LITERAL
`)?At(e,n):e.includes(`
`)?`
`+At(e,n):(t.endsWith(" ")?"":" ")+e;var Fu="flow",qo="block",ms="quoted";function fs(t,n,e="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:s=20,onFold:a,onOverflow:o}={}){if(!r||r<0)return t;r<s&&(s=0);let l=Math.max(1+s,1+r-n.length);if(t.length<=l)return t;let c=[],u={},d=r-n.length;typeof i=="number"&&(i>r-Math.max(2,s)?c.push(0):d=r-i);let p,m,f=!1,h=-1,g=-1,b=-1;e===qo&&(h=wf(t,h,n.length),h!==-1&&(d=h+l));for(let v;v=t[h+=1];){if(e===ms&&v==="\\"){switch(g=h,t[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}b=h}if(v===`
`)e===qo&&(h=wf(t,h,n.length)),d=h+n.length+l,p=void 0;else{if(v===" "&&m&&m!==" "&&m!==`
`&&m!==" "){let T=t[h+1];T&&T!==" "&&T!==`
`&&T!==" "&&(p=h)}if(h>=d)if(p)c.push(p),d=p+l,p=void 0;else if(e===ms){for(;m===" "||m===" ";)m=v,v=t[h+=1],f=!0;let T=h>b+1?h-2:g-1;if(u[T])return t;c.push(T),u[T]=!0,d=T+l,p=void 0}else f=!0}m=v}if(f&&o&&o(),c.length===0)return t;a&&a();let w=t.slice(0,c[0]);for(let v=0;v<c.length;++v){let T=c[v],O=c[v+1]||t.length;T===0?w=`
${n}${t.slice(0,O)}`:(e===ms&&u[T]&&(w+=`${t[T]}\\`),w+=`
${n}${t.slice(T+1,O)}`)}return w}function wf(t,n,e){let i=n,r=n+1,s=t[r];for(;s===" "||s===" ";)if(n<r+e)s=t[++n];else{do s=t[++n];while(s&&s!==`
`);i=n,r=n+1,s=t[r]}return i}var $o=(t,n)=>({indentAtStart:n?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Uo=t=>/^(%|---|\.\.\.)/m.test(t);function nk(t,n,e){if(!n||n<0)return!1;let i=n-e,r=t.length;if(r<=i)return!1;for(let s=0,a=0;s<r;++s)if(t[s]===`
`){if(s-a>i)return!0;if(a=s+1,r-a<=i)return!1}return!0}function hs(t,n){let e=JSON.stringify(t);if(n.options.doubleQuotedAsJSON)return e;let{implicitKey:i}=n,r=n.options.doubleQuotedMinMultiLineLength,s=n.indent||(Uo(t)?" ":""),a="",o=0;for(let l=0,c=e[l];c;c=e[++l])if(c===" "&&e[l+1]==="\\"&&e[l+2]==="n"&&(a+=e.slice(o,l)+"\\ ",l+=1,o=l,c="\\"),c==="\\")switch(e[l+1]){case"u":{a+=e.slice(o,l);let u=e.substr(l+2,4);switch(u){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:u.substr(0,2)==="00"?a+="\\x"+u.substr(2):a+=e.substr(l,6)}l+=5,o=l+1}break;case"n":if(i||e[l+2]==='"'||e.length<r)l+=1;else{for(a+=e.slice(o,l)+`
`;e[l+2]==="\\"&&e[l+3]==="n"&&e[l+4]!=='"';)a+=`
`,l+=2;a+=s,e[l+2]===" "&&(a+="\\"),l+=1,o=l+1}break;default:l+=1}return a=o?a+e.slice(o):e,i?a:fs(a,s,ms,$o(n,!1))}function Du(t,n){if(n.options.singleQuote===!1||n.implicitKey&&t.includes(`
`)||/[ \t]\n|\n[ \t]/.test(t))return hs(t,n);let e=n.indent||(Uo(t)?" ":""),i="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
${e}`)+"'";return n.implicitKey?i:fs(i,e,Fu,$o(n,!1))}function gr(t,n){let{singleQuote:e}=n.options,i;if(e===!1)i=hs;else{let r=t.includes('"'),s=t.includes("'");r&&!s?i=Du:s&&!r?i=hs:i=e?Du:hs}return i(t,n)}var Nu;try{Nu=new RegExp(`(^|(?<!
))
+(?!
|$)`,"g")}catch{Nu=/\n+(?!\n|$)/g}function Ho({comment:t,type:n,value:e},i,r,s){let{blockQuote:a,commentString:o,lineWidth:l}=i.options;if(!a||/\n[\t ]+$/.test(e))return gr(e,i);let c=i.indent||(i.forceBlockIndent||Uo(e)?" ":""),u=a==="literal"?!0:a==="folded"||n===z.BLOCK_FOLDED?!1:n===z.BLOCK_LITERAL?!0:!nk(e,l,c.length);if(!e)return u?`|
`:`>
`;let d,p;for(p=e.length;p>0;--p){let O=e[p-1];if(O!==`
`&&O!==" "&&O!==" ")break}let m=e.substring(p),f=m.indexOf(`
`);f===-1?d="-":e===m||f!==m.length-1?(d="+",s&&s()):d="",m&&(e=e.slice(0,-m.length),m[m.length-1]===`
`&&(m=m.slice(0,-1)),m=m.replace(Nu,`$&${c}`));let h=!1,g,b=-1;for(g=0;g<e.length;++g){let O=e[g];if(O===" ")h=!0;else if(O===`
`)b=g;else break}let w=e.substring(0,b<g?b+1:g);w&&(e=e.substring(w.length),w=w.replace(/\n+/g,`$&${c}`));let T=(h?c?"2":"1":"")+d;if(t&&(T+=" "+o(t.replace(/ ?[\r\n]+/g," ")),r&&r()),!u){let O=e.replace(/\n+/g,`
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),S=!1,M=$o(i,!0);a!=="folded"&&n!==z.BLOCK_FOLDED&&(M.onOverflow=()=>{S=!0});let C=fs(`${w}${O}${m}`,c,qo,M);if(!S)return`>${T}
${c}${C}`}return e=e.replace(/\n+/g,`$&${c}`),`|${T}
${c}${w}${e}${m}`}function ik(t,n,e,i){let{type:r,value:s}=t,{actualString:a,implicitKey:o,indent:l,indentStep:c,inFlow:u}=n;if(o&&s.includes(`
`)||u&&/[[\]{},]/.test(s))return gr(s,n);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return o||u||!s.includes(`
`)?gr(s,n):Ho(t,n,e,i);if(!o&&!u&&r!==z.PLAIN&&s.includes(`
`))return Ho(t,n,e,i);if(Uo(s)){if(l==="")return n.forceBlockIndent=!0,Ho(t,n,e,i);if(o&&l===c)return gr(s,n)}let d=s.replace(/\n+/g,`$&
${l}`);if(a){let p=h=>h.default&&h.tag!=="tag:yaml.org,2002:str"&&h.test?.test(d),{compat:m,tags:f}=n.doc.schema;if(f.some(p)||m?.some(p))return gr(s,n)}return o?d:fs(d,l,Fu,$o(n,!1))}function kn(t,n,e,i){let{implicitKey:r,inFlow:s}=n,a=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:o}=t;o!==z.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(o=z.QUOTE_DOUBLE);let l=u=>{switch(u){case z.BLOCK_FOLDED:case z.BLOCK_LITERAL:return r||s?gr(a.value,n):Ho(a,n,e,i);case z.QUOTE_DOUBLE:return hs(a.value,n);case z.QUOTE_SINGLE:return Du(a.value,n);case z.PLAIN:return ik(a,n,e,i);default:return null}},c=l(o);if(c===null){let{defaultKeyType:u,defaultStringType:d}=n.options,p=r&&u||d;if(c=l(p),c===null)throw new Error(`Unsupported default string type ${p}`)}return c}function jo(t,n){let e=Object.assign({blockQuote:!0,commentString:kf,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,n),i;switch(e.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:t,flowCollectionPadding:e.flowCollectionPadding?" ":"",indent:"",indentStep:typeof e.indent=="number"?" ".repeat(e.indent):" ",inFlow:i,options:e}}function rk(t,n){if(n.tag){let r=t.filter(s=>s.tag===n.tag);if(r.length>0)return r.find(s=>s.format===n.format)??r[0]}let e,i;if(G(n)){i=n.value;let r=t.filter(s=>s.identify?.(i));if(r.length>1){let s=r.filter(a=>a.test);s.length>0&&(r=s)}e=r.find(s=>s.format===n.format)??r.find(s=>!s.format)}else i=n,e=t.find(r=>r.nodeClass&&i instanceof r.nodeClass);if(!e){let r=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${r} value`)}return e}function sk(t,n,{anchors:e,doc:i}){if(!i.directives)return"";let r=[],s=(G(t)||se(t))&&t.anchor;s&&_o(s)&&(e.add(s),r.push(`&${s}`));let a=t.tag??(n.default?null:n.tag);return a&&r.push(i.directives.tagString(a)),r.join(" ")}function wn(t,n,e,i){if(ee(t))return t.toString(n,e,i);if(Ft(t)){if(n.doc.directives)return t.toString(n);if(n.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");n.resolvedAliases?n.resolvedAliases.add(t):n.resolvedAliases=new Set([t]),t=t.resolve(n.doc)}let r,s=te(t)?t:n.doc.createNode(t,{onTagObj:l=>r=l});r??(r=rk(n.doc.schema.tags,s));let a=sk(s,r,n);a.length>0&&(n.indentAtStart=(n.indentAtStart??0)+a.length+1);let o=typeof r.stringify=="function"?r.stringify(s,n,e,i):G(s)?kn(s,n,e,i):s.toString(n,e,i);return a?G(s)||o[0]==="{"||o[0]==="["?`${a} ${o}`:`${a}
${n.indent}${o}`:o}function vf({key:t,value:n},e,i,r){let{allNullValues:s,doc:a,indent:o,indentStep:l,options:{commentString:c,indentSeq:u,simpleKeys:d}}=e,p=te(t)&&t.comment||null;if(d){if(p)throw new Error("With simple keys, key nodes cannot have comments");if(se(t)||!te(t)&&typeof t=="object"){let M="With simple keys, collection cannot be used as a key value";throw new Error(M)}}let m=!d&&(!t||p&&n==null&&!e.inFlow||se(t)||(G(t)?t.type===z.BLOCK_FOLDED||t.type===z.BLOCK_LITERAL:typeof t=="object"));e=Object.assign({},e,{allNullValues:!1,implicitKey:!m&&(d||!s),indent:o+l});let f=!1,h=!1,g=wn(t,e,()=>f=!0,()=>h=!0);if(!m&&!e.inFlow&&g.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(e.inFlow){if(s||n==null)return f&&i&&i(),g===""?"?":m?`? ${g}`:g}else if(s&&!d||n==null&&m)return g=`? ${g}`,p&&!f?g+=nn(g,e.indent,c(p)):h&&r&&r(),g;f&&(p=null),m?(p&&(g+=nn(g,e.indent,c(p))),g=`? ${g}
${o}:`):(g=`${g}:`,p&&(g+=nn(g,e.indent,c(p))));let b,w,v;te(n)?(b=!!n.spaceBefore,w=n.commentBefore,v=n.comment):(b=!1,w=null,v=null,n&&typeof n=="object"&&(n=a.createNode(n))),e.implicitKey=!1,!m&&!p&&G(n)&&(e.indentAtStart=g.length+1),h=!1,!u&&l.length>=2&&!e.inFlow&&!m&&Yt(n)&&!n.flow&&!n.tag&&!n.anchor&&(e.indent=e.indent.substring(2));let T=!1,O=wn(n,e,()=>T=!0,()=>h=!0),S=" ";if(p||b||w){if(S=b?`
`:"",w){let M=c(w);S+=`
${At(M,e.indent)}`}O===""&&!e.inFlow?S===`
`&&v&&(S=`
`):S+=`
${e.indent}`}else if(!m&&se(n)){let M=O[0],C=O.indexOf(`
`),B=C!==-1,N=e.inFlow??n.flow??n.items.length===0;if(B||!N){let q=!1;if(B&&(M==="&"||M==="!")){let _=O.indexOf(" ");M==="&"&&_!==-1&&_<C&&O[_+1]==="!"&&(_=O.indexOf(" ",_+1)),(_===-1||C<_)&&(q=!0)}q||(S=`
${e.indent}`)}}else(O===""||O[0]===`
`)&&(S="");return g+=S+O,e.inFlow?T&&i&&i():v&&!T?g+=nn(g,e.indent,c(v)):h&&r&&r(),g}function Vo(t,n){(t==="debug"||t==="warn")&&console.warn(n)}var Wo="<<",Kt={identify:t=>t===Wo||typeof t=="symbol"&&t.description===Wo,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new z(Symbol(Wo)),{addToJSMap:Ku}),stringify:()=>Wo},Lf=(t,n)=>(Kt.identify(n)||G(n)&&(!n.type||n.type===z.PLAIN)&&Kt.identify(n.value))&&t?.doc.schema.tags.some(e=>e.tag===Kt.tag&&e.default);function Ku(t,n,e){let i=Af(t,e);if(Yt(i))for(let r of i.items)Yu(t,n,r);else if(Array.isArray(i))for(let r of i)Yu(t,n,r);else Yu(t,n,i)}function Yu(t,n,e){let i=Af(t,e);if(!Nt(i))throw new Error("Merge sources must be maps or map aliases");let r=i.toJSON(null,t,Map);for(let[s,a]of r)n instanceof Map?n.has(s)||n.set(s,a):n instanceof Set?n.add(s):Object.prototype.hasOwnProperty.call(n,s)||Object.defineProperty(n,s,{value:a,writable:!0,enumerable:!0,configurable:!0});return n}function Af(t,n){return t&&Ft(n)?n.resolve(t.doc,t):n}function Go(t,n,{key:e,value:i}){if(te(e)&&e.addToJSMap)e.addToJSMap(t,n,i);else if(Lf(t,e))Ku(t,n,i);else{let r=Be(e,"",t);if(n instanceof Map)n.set(r,Be(i,r,t));else if(n instanceof Set)n.add(r);else{let s=ak(e,r,t),a=Be(i,s,t);s in n?Object.defineProperty(n,s,{value:a,writable:!0,enumerable:!0,configurable:!0}):n[s]=a}}return n}function ak(t,n,e){if(n===null)return"";if(typeof n!="object")return String(n);if(te(t)&&e?.doc){let i=jo(e.doc,{});i.anchors=new Set;for(let s of e.anchors.keys())i.anchors.add(s.anchor);i.inFlow=!0,i.inStringifyKey=!0;let r=t.toString(i);if(!e.mapKeyWarned){let s=JSON.stringify(r);s.length>40&&(s=s.substring(0,36)+'..."'),Vo(e.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),e.mapKeyWarned=!0}return r}return JSON.stringify(n)}function yr(t,n,e){let i=bn(t,void 0,e),r=bn(n,void 0,e);return new Se(i,r)}var Se=class t{constructor(n,e=null){Object.defineProperty(this,rt,{value:Iu}),this.key=n,this.value=e}clone(n){let{key:e,value:i}=this;return te(e)&&(e=e.clone(n)),te(i)&&(i=i.clone(n)),new t(e,i)}toJSON(n,e){let i=e?.mapAsMap?new Map:{};return Go(e,i,this)}toString(n,e,i){return n?.doc?vf(this,n,e,i):JSON.stringify(this)}};function Zo(t,n,e){return(n.inFlow??t.flow?lk:ok)(t,n,e)}function ok({comment:t,items:n},e,{blockItemPrefix:i,flowChars:r,itemIndent:s,onChompKeep:a,onComment:o}){let{indent:l,options:{commentString:c}}=e,u=Object.assign({},e,{indent:s,type:null}),d=!1,p=[];for(let f=0;f<n.length;++f){let h=n[f],g=null;if(te(h))!d&&h.spaceBefore&&p.push(""),Qo(e,p,h.commentBefore,d),h.comment&&(g=h.comment);else if(ee(h)){let w=te(h.key)?h.key:null;w&&(!d&&w.spaceBefore&&p.push(""),Qo(e,p,w.commentBefore,d))}d=!1;let b=wn(h,u,()=>g=null,()=>d=!0);g&&(b+=nn(b,s,c(g))),d&&g&&(d=!1),p.push(i+b)}let m;if(p.length===0)m=r.start+r.end;else{m=p[0];for(let f=1;f<p.length;++f){let h=p[f];m+=h?`
${l}${h}`:`
`}}return t?(m+=`
`+At(c(t),l),o&&o()):d&&a&&a(),m}function lk({items:t},n,{flowChars:e,itemIndent:i}){let{indent:r,indentStep:s,flowCollectionPadding:a,options:{commentString:o}}=n;i+=s;let l=Object.assign({},n,{indent:i,inFlow:!0,type:null}),c=!1,u=0,d=[];for(let f=0;f<t.length;++f){let h=t[f],g=null;if(te(h))h.spaceBefore&&d.push(""),Qo(n,d,h.commentBefore,!1),h.comment&&(g=h.comment);else if(ee(h)){let w=te(h.key)?h.key:null;w&&(w.spaceBefore&&d.push(""),Qo(n,d,w.commentBefore,!1),w.comment&&(c=!0));let v=te(h.value)?h.value:null;v?(v.comment&&(g=v.comment),v.commentBefore&&(c=!0)):h.value==null&&w?.comment&&(g=w.comment)}g&&(c=!0);let b=wn(h,l,()=>g=null);c||(c=d.length>u||b.includes(`
`)),f<t.length-1?b+=",":n.options.trailingComma&&(n.options.lineWidth>0&&(c||(c=d.reduce((w,v)=>w+v.length+2,2)+(b.length+2)>n.options.lineWidth)),c&&(b+=",")),g&&(b+=nn(b,i,o(g))),d.push(b),u=d.length}let{start:p,end:m}=e;if(d.length===0)return p+m;if(!c){let f=d.reduce((h,g)=>h+g.length+2,2);c=n.options.lineWidth>0&&f>n.options.lineWidth}if(c){let f=p;for(let h of d)f+=h?`
${s}${r}${h}`:`
`;return`${f}
${r}${m}`}else return`${p}${a}${d.join(" ")}${a}${m}`}function Qo({indent:t,options:{commentString:n}},e,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){let s=At(n(i),t);e.push(s.trimStart())}}function Hn(t,n){let e=G(n)?n.value:n;for(let i of t)if(ee(i)&&(i.key===n||i.key===e||G(i.key)&&i.key.value===e))return i}var ke=class extends fr{static get tagName(){return"tag:yaml.org,2002:map"}constructor(n){super(Rt,n),this.items=[]}static from(n,e,i){let{keepUndefined:r,replacer:s}=i,a=new this(n),o=(l,c)=>{if(typeof s=="function")c=s.call(e,l,c);else if(Array.isArray(s)&&!s.includes(l))return;(c!==void 0||r)&&a.items.push(yr(l,c,i))};if(e instanceof Map)for(let[l,c]of e)o(l,c);else if(e&&typeof e=="object")for(let l of Object.keys(e))o(l,e[l]);return typeof n.sortMapEntries=="function"&&a.items.sort(n.sortMapEntries),a}add(n,e){let i;ee(n)?i=n:!n||typeof n!="object"||!("key"in n)?i=new Se(n,n?.value):i=new Se(n.key,n.value);let r=Hn(this.items,i.key),s=this.schema?.sortMapEntries;if(r){if(!e)throw new Error(`Key ${i.key} already set`);G(r.value)&&Po(i.value)?r.value.value=i.value:r.value=i.value}else if(s){let a=this.items.findIndex(o=>s(i,o)<0);a===-1?this.items.push(i):this.items.splice(a,0,i)}else this.items.push(i)}delete(n){let e=Hn(this.items,n);return e?this.items.splice(this.items.indexOf(e),1).length>0:!1}get(n,e){let r=Hn(this.items,n)?.value;return(!e&&G(r)?r.value:r)??void 0}has(n){return!!Hn(this.items,n)}set(n,e){this.add(new Se(n,e),!0)}toJSON(n,e,i){let r=i?new i:e?.mapAsMap?new Map:{};e?.onCreate&&e.onCreate(r);for(let s of this.items)Go(e,r,s);return r}toString(n,e,i){if(!n)return JSON.stringify(this);for(let r of this.items)if(!ee(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!n.allNullValues&&this.hasAllNullValues(!1)&&(n=Object.assign({},n,{allNullValues:!0})),Zo(this,n,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:n.indent||"",onChompKeep:i,onComment:e})}};var _t={collection:"map",default:!0,nodeClass:ke,tag:"tag:yaml.org,2002:map",resolve(t,n){return Nt(t)||n("Expected a mapping for this tag"),t},createNode:(t,n,e)=>ke.from(t,n,e)};var Ze=class extends fr{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(n){super(gn,n),this.items=[]}add(n){this.items.push(n)}delete(n){let e=Jo(n);return typeof e!="number"?!1:this.items.splice(e,1).length>0}get(n,e){let i=Jo(n);if(typeof i!="number")return;let r=this.items[i];return!e&&G(r)?r.value:r}has(n){let e=Jo(n);return typeof e=="number"&&e<this.items.length}set(n,e){let i=Jo(n);if(typeof i!="number")throw new Error(`Expected a valid index, not ${n}.`);let r=this.items[i];G(r)&&Po(e)?r.value=e:this.items[i]=e}toJSON(n,e){let i=[];e?.onCreate&&e.onCreate(i);let r=0;for(let s of this.items)i.push(Be(s,String(r++),e));return i}toString(n,e,i){return n?Zo(this,n,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(n.indent||"")+" ",onChompKeep:i,onComment:e}):JSON.stringify(this)}static from(n,e,i){let{replacer:r}=i,s=new this(n);if(e&&Symbol.iterator in Object(e)){let a=0;for(let o of e){if(typeof r=="function"){let l=e instanceof Set?o:String(a++);o=r.call(e,l,o)}s.items.push(bn(o,void 0,i))}}return s}};function Jo(t){let n=G(t)?t.value:t;return n&&typeof n=="string"&&(n=Number(n)),typeof n=="number"&&Number.isInteger(n)&&n>=0?n:null}var zt={collection:"seq",default:!0,nodeClass:Ze,tag:"tag:yaml.org,2002:seq",resolve(t,n){return Yt(t)||n("Expected a sequence for this tag"),t},createNode:(t,n,e)=>Ze.from(t,n,e)};var $n={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,n,e,i){return n=Object.assign({actualString:!0},n),kn(t,n,e,i)}};var bi={identify:t=>t==null,createNode:()=>new z(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new z(null),stringify:({source:t},n)=>typeof t=="string"&&bi.test.test(t)?t:n.options.nullStr};var gs={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new z(t[0]==="t"||t[0]==="T"),stringify({source:t,valu
`:" ")}return kn({comment:t,type:n,value:o},i,r,s)}};function zu(t,n){if(Yt(t))for(let e=0;e<t.items.length;++e){let i=t.items[e];if(!ee(i)){if(Nt(i)){i.items.length>1&&n("Each pair must have its own sequence indicator");let r=i.items[0]||new Se(new z(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore}
${r.key.commentBefore}`:i.commentBefore),i.comment){let s=r.value??r.key;s.comment=s.comment?`${i.comment}
${s.comment}`:i.comment}i=r}t.items[e]=ee(i)?i:new Se(i)}}else n("Expected a sequence for this tag");return t}function Pu(t,n,e){let{replacer:i}=e,r=new Ze(t);r.tag="tag:yaml.org,2002:pairs";let s=0;if(n&&Symbol.iterator in Object(n))for(let a of n){typeof i=="function"&&(a=i.call(n,String(s++),a));let o,l;if(Array.isArray(a))if(a.length===2)o=a[0],l=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){let c=Object.keys(a);if(c.length===1)o=c[0],l=a[o];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else o=a;r.items.push(yr(o,l,e))}return r}var bs={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:zu,createNode:Pu};var br=class t extends Ze{constructor(){super(),this.add=ke.prototype.add.bind(this),this.delete=ke.prototype.delete.bind(this),this.get=ke.prototype.get.bind(this),this.has=ke.prototype.has.bind(this),this.set=ke.prototype.set.bind(this),this.tag=t.tag}toJSON(n,e){if(!e)return super.toJSON(n);let i=new Map;e?.onCreate&&e.onCreate(i);for(let r of this.items){let s,a;if(ee(r)?(s=Be(r.key,"",e),a=Be(r.value,s,e)):s=Be(r,"",e),i.has(s))throw new Error("Ordered maps must not include duplicate keys");i.set(s,a)}return i}static from(n,e,i){let r=Pu(n,e,i),s=new this;return s.items=r.items,s}};br.tag="tag:yaml.org,2002:omap";var ks={collection:"seq",identify:t=>t instanceof Map,nodeClass:br,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,n){let e=zu(t,n),i=[];for(let{key:r}of e.items)G(r)&&(i.includes(r.value)?n(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new br,e)},createNode:(t,n,e)=>br.from(t,n,e)};function Of({value:t,source:n},e){return n&&(t?qu:Hu).test.test(n)?n:t?e.options.trueStr:e.options.falseStr}var qu={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new z(!0),stringify:Of},Hu={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new z(!1),stringify:Of};var Mf={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Je},Cf={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let n=Number(t.value);return isFinite(n)?n.toExponential():Je(t)}},If={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let n=new z(parseFloat(t.replace(/_/g,""))),e=t.indexOf(".");if(e!==-1){let i=t.substring(e+1).replace(/_/g,"");i[i.length-1]==="0"&&(n.minFractionDigits=i.length)}return n},stringify:Je};var ws=t=>typeof t=="bigint"||Number.isInteger(t);function ol(t,n,e,{intAsBigInt:i}){let r=t[0];if((r==="-"||r==="+")&&(n+=1),t=t.substring(n).replace(/_/g,""),i){switch(e){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let a=BigInt(t);return r==="-"?BigInt(-1)*a:a}let s=parseInt(t,e);return r==="-"?-1*s:s}function $u(t,n,e){let{value:i}=t;if(ws(i)){let r=i.toString(n);return i<0?"-"+e+r.substr(1):e+r}return Je(t)}var Bf={identify:ws,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,n,e)=>ol(t,2,2,e),stringify:t=>$u(t,2,"0b")},Rf={identify:ws,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,n,e)=>ol(t,1,8,e),stringify:t=>$u(t,8,"0")},Ff={identify:ws,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,n,e)=>ol(t,0,10,e),stringify:Je},Df={identify:ws,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,n,e)=>ol(t,2,16,e),stringify:t=>$u(t,16,"0x")};var kr=class t extends ke{constructor(n){super(n),this.tag=t.tag}add(n){let e;ee(n)?e=n:n&&typeof n=="object"&&"key"in n&&"value"in n&
`)?(e.push("..."),e.push(At(l,""))):e.push(`... ${l}`)}else e.push("...");else{let l=t.comment;l&&a&&(l=l.replace(/^\n+/,"")),l&&((!a||o)&&e[e.length-1]!==""&&e.push(""),e.push(At(s(l),"")))}return e.join(`
`)+`
`}var Pt=class t{constructor(n,e,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,rt,{value:No});let r=null;typeof e=="function"||Array.isArray(e)?r=e:i===void 0&&e&&(i=e,e=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=s;let{version:a}=s;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new tn({version:a}),this.setSchema(a,i),this.contents=n===void 0?null:this.createNode(n,r,i)}clone(){let n=Object.create(t.prototype,{[rt]:{value:No}});return n.commentBefore=this.commentBefore,n.comment=this.comment,n.errors=this.errors.slice(),n.warnings=this.warnings.slice(),n.options=Object.assign({},this.options),this.directives&&(n.directives=this.directives.clone()),n.schema=this.schema.clone(),n.contents=te(this.contents)?this.contents.clone(n.schema):this.contents,this.range&&(n.range=this.range.slice()),n}add(n){vr(this.contents)&&this.contents.add(n)}addIn(n,e){vr(this.contents)&&this.contents.addIn(n,e)}createAlias(n,e){if(!n.anchor){let i=Bu(this);n.anchor=!e||i.has(e)?Ru(e||"a",i):e}return new yn(n.anchor)}createNode(n,e,i){let r;if(typeof e=="function")n=e.call({"":n},"",n),r=e;else if(Array.isArray(e)){let g=w=>typeof w=="number"||w instanceof String||w instanceof Number,b=e.filter(g).map(String);b.length>0&&(e=e.concat(b)),r=e}else i===void 0&&e&&(i=e,e=void 0);let{aliasDuplicateObjects:s,anchorPrefix:a,flow:o,keepUndefined:l,onTagObj:c,tag:u}=i??{},{onAnchor:d,setAnchors:p,sourceObjects:m}=bf(this,a||"a"),f={aliasDuplicateObjects:s??!0,keepUndefined:l??!1,onAnchor:d,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:m},h=bn(n,u,f);return o&&se(h)&&(h.flow=!0),p(),h}createPair(n,e,i={}){let r=this.createNode(n,null,i),s=this.createNode(e,null,i);return new Se(r,s)}delete(n){return vr(this.contents)?this.contents.delete(n):!1}deleteIn(n){return hr(n)?this.contents==null?!1:(this.contents=null,!0):vr(this.contents)?this.contents.deleteIn(n):!1}get(n,e){return se(this.contents)?this.contents.get(n,e):void 0}getIn(n,e){return hr(n)?!e&&G(this.contents)?this.contents.value:this.contents:se(this.contents)?this.contents.getIn(n,e):void 0}has(n){return se(this.contents)?this.contents.has(n):!1}hasIn(n){return hr(n)?this.contents!==void 0:se(this.contents)?this.contents.hasIn(n):!1}set(n,e){this.contents==null?this.contents=ps(this.schema,[n],e):vr(this.contents)&&this.contents.set(n,e)}setIn(n,e){hr(n)?this.contents=e:this.contents==null?this.contents=ps(this.schema,Array.from(n),e):vr(this.contents)&&this.contents.setIn(n,e)}setSchema(n,e={}){typeof n=="number"&&(n=String(n));let i;switch(n){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new tn({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=n:this.directives=new tn({version:n}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{let r=JSON.stringify(n);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(e.schema instanceof Object)this.schema=e.schema;else if(i)this.schema=new Ls(Object.assign(i,e));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:n,jsonArg:e,mapAsMap:i,maxAliasCount:r,onAnchor:s,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!n,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},l=Be(this.contents,e??"",o);if(typeof s=="function")for(let{count:c,res:u}of o.anchors.values())s(u,c);return typeof a=="function"?Pn(a,{"":l},"",l):l}toJSON(n,e){return this.toJS({json:!0,jsonArg:n,mapAsMap:!1,onAnchor:e})}toString(n={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in n&&(!Number.isInteger(n.indent)||Number(n.indent)<=0)){let e=JSON.stringify(n.indent);throw new Error
`),a=o+a}if(/[^ ]/.test(a)){let o=1,l=e.linePos[1];l?.line===i&&l.col>r&&(o=Math.max(1,Math.min(l.col-r,80-s)));let c=" ".repeat(s)+"^".repeat(o);e.message+=`:
${a}
${c}
`}};function rn(t,{flow:n,indicator:e,next:i,offset:r,onError:s,parentIndent:a,startOnNewline:o}){let l=!1,c=o,u=o,d="",p="",m=!1,f=!1,h=null,g=null,b=null,w=null,v=null,T=null,O=null;for(let C of t)switch(f&&(C.type!=="space"&&C.type!=="newline"&&C.type!=="comma"&&s(C.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),f=!1),h&&(c&&C.type!=="comment"&&C.type!=="newline"&&s(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),C.type){case"space":!n&&(e!=="doc-start"||i?.type!=="flow-collection")&&C.source.includes(" ")&&(h=C),u=!0;break;case"comment":{u||s(C,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let B=C.source.substring(1)||" ";d?d+=p+B:d=B,p="",c=!1;break}case"newline":c?d?d+=C.source:(!T||e!=="seq-item-ind")&&(l=!0):p+=C.source,c=!0,m=!0,(g||b)&&(w=C),u=!0;break;case"anchor":g&&s(C,"MULTIPLE_ANCHORS","A node can have at most one anchor"),C.source.endsWith(":")&&s(C.offset+C.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=C,O??(O=C.offset),c=!1,u=!1,f=!0;break;case"tag":{b&&s(C,"MULTIPLE_TAGS","A node can have at most one tag"),b=C,O??(O=C.offset),c=!1,u=!1,f=!0;break}case e:(g||b)&&s(C,"BAD_PROP_ORDER",`Anchors and tags must be after the ${C.source} indicator`),T&&s(C,"UNEXPECTED_TOKEN",`Unexpected ${C.source} in ${n??"collection"}`),T=C,c=e==="seq-item-ind"||e==="explicit-key-ind",u=!1;break;case"comma":if(n){v&&s(C,"UNEXPECTED_TOKEN",`Unexpected , in ${n}`),v=C,c=!1,u=!1;break}default:s(C,"UNEXPECTED_TOKEN",`Unexpected ${C.type} token`),c=!1,u=!1}let S=t[t.length-1],M=S?S.offset+S.source.length:r;return f&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&s(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(c&&h.indent<=a||i?.type==="block-map"||i?.type==="block-seq")&&s(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:v,found:T,spaceBefore:l,comment:d,hasNewline:m,anchor:g,tag:b,newlineAfterProp:w,end:M,start:O??M}}function Un(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
`))return!0;if(t.end){for(let n of t.end)if(n.type==="newline")return!0}return!1;case"flow-collection":for(let n of t.items){for(let e of n.start)if(e.type==="newline")return!0;if(n.sep){for(let e of n.sep)if(e.type==="newline")return!0}if(Un(n.key)||Un(n.value))return!0}return!1;default:return!0}}function Es(t,n,e){if(n?.type==="flow-collection"){let i=n.end[0];i.indent===t&&(i.source==="]"||i.source==="}")&&Un(n)&&e(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function dl(t,n,e){let{uniqueKeys:i}=t.options;if(i===!1)return!1;let r=typeof i=="function"?i:(s,a)=>s===a||G(s)&&G(a)&&s.value===a.value;return n.some(s=>r(s.key,e))}var Pf="All mapping items must start at the same column";function qf({composeNode:t,composeEmptyNode:n},e,i,r,s){let a=s?.nodeClass??ke,o=new a(e.schema);e.atRoot&&(e.atRoot=!1);let l=i.offset,c=null;for(let u of i.items){let{start:d,key:p,sep:m,value:f}=u,h=rn(d,{indicator:"explicit-key-ind",next:p??m?.[0],offset:l,onError:r,parentIndent:i.indent,startOnNewline:!0}),g=!h.found;if(g){if(p&&(p.type==="block-seq"?r(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in p&&p.indent!==i.indent&&r(l,"BAD_INDENT",Pf)),!h.anchor&&!h.tag&&!m){c=h.end,h.comment&&(o.comment?o.comment+=`
`+h.comment:o.comment=h.comment);continue}(h.newlineAfterProp||Un(p))&&r(p??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else h.found?.indent!==i.indent&&r(l,"BAD_INDENT",Pf);e.atKey=!0;let b=h.end,w=p?t(e,p,h,r):n(e,b,d,null,h,r);e.schema.compat&&Es(i.indent,p,r),e.atKey=!1,dl(e,o.items,w)&&r(b,"DUPLICATE_KEY","Map keys must be unique");let v=rn(m??[],{indicator:"map-value-ind",next:f,offset:w.range[2],onError:r,parentIndent:i.indent,startOnNewline:!p||p.type==="block-scalar"});if(l=v.end,v.found){g&&(f?.type==="block-map"&&!v.hasNewline&&r(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),e.options.strict&&h.start<v.found.offset-1024&&r(w.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let T=f?t(e,f,v,r):n(e,l,m,null,v,r);e.schema.compat&&Es(i.indent,f,r),l=T.range[2];let O=new Se(w,T);e.options.keepSourceTokens&&(O.srcToken=u),o.items.push(O)}else{g&&r(w.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),v.comment&&(w.comment?w.comment+=`
`+v.comment:w.comment=v.comment);let T=new Se(w);e.options.keepSourceTokens&&(T.srcToken=u),o.items.push(T)}}return c&&c<l&&r(c,"IMPOSSIBLE","Map comment with trailing content"),o.range=[i.offset,l,c??l],o}function Hf({composeNode:t,composeEmptyNode:n},e,i,r,s){let a=s?.nodeClass??Ze,o=new a(e.schema);e.atRoot&&(e.atRoot=!1),e.atKey&&(e.atKey=!1);let l=i.offset,c=null;for(let{start:u,value:d}of i.items){let p=rn(u,{indicator:"seq-item-ind",next:d,offset:l,onError:r,parentIndent:i.indent,startOnNewline:!0});if(!p.found)if(p.anchor||p.tag||d)d?.type==="block-seq"?r(p.end,"BAD_INDENT","All sequence items must start at the same column"):r(l,"MISSING_CHAR","Sequence item without - indicator");else{c=p.end,p.comment&&(o.comment=p.comment);continue}let m=d?t(e,d,p,r):n(e,p.end,u,null,p,r);e.schema.compat&&Es(i.indent,d,r),l=m.range[2],o.items.push(m)}return o.range=[i.offset,l,c??l],o}function sn(t,n,e,i){let r="";if(t){let s=!1,a="";for(let o of t){let{source:l,type:c}=o;switch(c){case"space":s=!0;break;case"comment":{e&&!s&&i(o,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=l.substring(1)||" ";r?r+=a+u:r=u,a="";break}case"newline":r&&(a+=l),s=!0;break;default:i(o,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}n+=l.length}}return{comment:r,offset:n}}var Wu="Block collections are not allowed within flow collections",Gu=t=>t&&(t.type==="block-map"||t.type==="block-seq");function $f({composeNode:t,composeEmptyNode:n},e,i,r,s){let a=i.start.source==="{",o=a?"flow map":"flow sequence",l=s?.nodeClass??(a?ke:Ze),c=new l(e.schema);c.flow=!0;let u=e.atRoot;u&&(e.atRoot=!1),e.atKey&&(e.atKey=!1);let d=i.offset+i.start.source.length;for(let g=0;g<i.items.length;++g){let b=i.items[g],{start:w,key:v,sep:T,value:O}=b,S=rn(w,{flow:o,indicator:"explicit-key-ind",next:v??T?.[0],offset:d,onError:r,parentIndent:i.indent,startOnNewline:!1});if(!S.found){if(!S.anchor&&!S.tag&&!T&&!O){g===0&&S.comma?r(S.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`):g<i.items.length-1&&r(S.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${o}`),S.comment&&(c.comment?c.comment+=`
`+S.comment:c.comment=S.comment),d=S.end;continue}!a&&e.options.strict&&Un(v)&&r(v,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(g===0)S.comma&&r(S.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`);else if(S.comma||r(S.start,"MISSING_CHAR",`Missing , between ${o} items`),S.comment){let M="";e:for(let C of w)switch(C.type){case"comma":case"space":break;case"comment":M=C.source.substring(1);break e;default:break e}if(M){let C=c.items[c.items.length-1];ee(C)&&(C=C.value??C.key),C.comment?C.comment+=`
`+M:C.comment=M,S.comment=S.comment.substring(M.length+1)}}if(!a&&!T&&!S.found){let M=O?t(e,O,S,r):n(e,S.end,T,null,S,r);c.items.push(M),d=M.range[2],Gu(O)&&r(M.range,"BLOCK_IN_FLOW",Wu)}else{e.atKey=!0;let M=S.end,C=v?t(e,v,S,r):n(e,M,w,null,S,r);Gu(v)&&r(C.range,"BLOCK_IN_FLOW",Wu),e.atKey=!1;let B=rn(T??[],{flow:o,indicator:"map-value-ind",next:O,offset:C.range[2],onError:r,parentIndent:i.indent,startOnNewline:!1});if(B.found){if(!a&&!S.found&&e.options.strict){if(T)for(let _ of T){if(_===B.found)break;if(_.type==="newline"){r(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}S.start<B.found.offset-1024&&r(B.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else O&&("source"in O&&O.source?.[0]===":"?r(O,"MISSING_CHAR",`Missing space after : in ${o}`):r(B.start,"MISSING_CHAR",`Missing , or : between ${o} items`));let N=O?t(e,O,B,r):B.found?n(e,B.end,T,null,B,r):null;N?Gu(O)&&r(N.range,"BLOCK_IN_FLOW",Wu):B.comment&&(C.comment?C.comment+=`
`+B.comment:C.comment=B.comment);let q=new Se(C,N);if(e.options.keepSourceTokens&&(q.srcToken=b),a){let _=c;dl(e,_.items,C)&&r(M,"DUPLICATE_KEY","Map keys must be unique"),_.items.push(q)}else{let _=new ke(e.schema);_.flow=!0,_.items.push(q);let Y=(N??C).range;_.range=[C.range[0],Y[1],Y[2]],c.items.push(_)}d=N?N.range[2]:B.end}}let p=a?"}":"]",[m,...f]=i.end,h=d;if(m?.source===p)h=m.offset+m.source.length;else{let g=o[0].toUpperCase()+o.substring(1),b=u?`${g} must end with a ${p}`:`${g} in block collection must be sufficiently indented and end with a ${p}`;r(d,u?"MISSING_CHAR":"BAD_INDENT",b),m&&m.source.length!==1&&f.unshift(m)}if(f.length>0){let g=sn(f,h,e.options.strict,r);g.comment&&(c.comment?c.comment+=`
`+g.comment:c.comment=g.comment),c.range=[i.offset,h,g.offset]}else c.range=[i.offset,h,h];return c}function Qu(t,n,e,i,r,s){let a=e.type==="block-map"?qf(t,n,e,i,s):e.type==="block-seq"?Hf(t,n,e,i,s):$f(t,n,e,i,s),o=a.constructor;return r==="!"||r===o.tagName?(a.tag=o.tagName,a):(r&&(a.tag=r),a)}function Uf(t,n,e,i,r){let s=i.tag,a=s?n.directives.tagName(s.source,p=>r(s,"TAG_RESOLVE_FAILED",p)):null;if(e.type==="block-seq"){let{anchor:p,newlineAfterProp:m}=i,f=p&&s?p.offset>s.offset?p:s:p??s;f&&(!m||m.offset<f.offset)&&r(f,"MISSING_CHAR","Missing newline after block sequence props")}let o=e.type==="block-map"?"map":e.type==="block-seq"?"seq":e.start.source==="{"?"map":"seq";if(!s||!a||a==="!"||a===ke.tagName&&o==="map"||a===Ze.tagName&&o==="seq")return Qu(t,n,e,r,a);let l=n.schema.tags.find(p=>p.tag===a&&p.collection===o);if(!l){let p=n.schema.knownTags[a];if(p?.collection===o)n.schema.tags.push(Object.assign({},p,{default:!1})),l=p;else return p?r(s,"BAD_COLLECTION_TYPE",`${p.tag} used for ${o} collection, but expects ${p.collection??"scalar"}`,!0):r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),Qu(t,n,e,r,a)}let c=Qu(t,n,e,r,a,l),u=l.resolve?.(c,p=>r(s,"TAG_RESOLVE_FAILED",p),n.options)??c,d=te(u)?u:new z(u);return d.range=c.range,d.tag=a,l?.format&&(d.format=l.format),d}function pl(t,n,e){let i=n.offset,r=pk(n,t.options.strict,e);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};let s=r.mode===">"?z.BLOCK_FOLDED:z.BLOCK_LITERAL,a=n.source?mk(n.source):[],o=a.length;for(let h=a.length-1;h>=0;--h){let g=a[h][1];if(g===""||g==="\r")o=h;else break}if(o===0){let h=r.chomp==="+"&&a.length>0?`
`.repeat(Math.max(1,a.length-1)):"",g=i+r.length;return n.source&&(g+=n.source.length),{value:h,type:s,comment:r.comment,range:[i,g,g]}}let l=n.indent+r.indent,c=n.offset+r.length,u=0;for(let h=0;h<o;++h){let[g,b]=a[h];if(b===""||b==="\r")r.indent===0&&g.length>l&&(l=g.length);else{g.length<l&&e(c+g.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(l=g.length),u=h,l===0&&!t.atRoot&&e(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=g.length+b.length+1}for(let h=a.length-1;h>=o;--h)a[h][0].length>l&&(o=h+1);let d="",p="",m=!1;for(let h=0;h<u;++h)d+=a[h][0].slice(l)+`
`;for(let h=u;h<o;++h){let[g,b]=a[h];c+=g.length+b.length+1;let w=b[b.length-1]==="\r";if(w&&(b=b.slice(0,-1)),b&&g.length<l){let T=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;e(c-b.length-(w?2:1),"BAD_INDENT",T),g=""}s===z.BLOCK_LITERAL?(d+=p+g.slice(l)+b,p=`
`):g.length>l||b[0]===" "?(p===" "?p=`
`:!m&&p===`
`&&(p=`
`),d+=p+g.slice(l)+b,p=`
`,m=!0):b===""?p===`
`?d+=`
`:p=`
`:(d+=p+b,p=" ",m=!1)}switch(r.chomp){case"-":break;case"+":for(let h=o;h<a.length;++h)d+=`
`+a[h][0].slice(l);d[d.length-1]!==`
`&&(d+=`
`);break;default:d+=`
`}let f=i+r.length+n.source.length;return{value:d,type:s,comment:r.comment,range:[i,f,f]}}function pk({offset:t,props:n},e,i){if(n[0].type!=="block-scalar-header")return i(n[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:r}=n[0],s=r[0],a=0,o="",l=-1;for(let p=1;p<r.length;++p){let m=r[p];if(!o&&(m==="-"||m==="+"))o=m;else{let f=Number(m);!a&&f?a=f:l===-1&&(l=t+p)}}l!==-1&&i(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let c=!1,u="",d=r.length;for(let p=1;p<n.length;++p){let m=n[p];switch(m.type){case"space":c=!0;case"newline":d+=m.source.length;break;case"comment":e&&!c&&i(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=m.source.length,u=m.source.substring(1);break;case"error":i(m,"UNEXPECTED_TOKEN",m.message),d+=m.source.length;break;default:{let f=`Unexpected token in block scalar header: ${m.type}`;i(m,"UNEXPECTED_TOKEN",f);let h=m.source;h&&typeof h=="string"&&(d+=h.length)}}}return{mode:s,indent:a,chomp:o,comment:u,length:d}}function mk(t){let n=t.split(/\n( *)/),e=n[0],i=e.match(/^( *)/),s=[i?.[1]?[i[1],e.slice(i[1].length)]:["",e]];for(let a=1;a<n.length;a+=2)s.push([n[a],n[a+1]]);return s}function ml(t,n,e){let{offset:i,type:r,source:s,end:a}=t,o,l,c=(p,m,f)=>e(i+p,m,f);switch(r){case"scalar":o=z.PLAIN,l=fk(s,c);break;case"single-quoted-scalar":o=z.QUOTE_SINGLE,l=hk(s,c);break;case"double-quoted-scalar":o=z.QUOTE_DOUBLE,l=gk(s,c);break;default:return e(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[i,i+s.length,i+s.length]}}let u=i+s.length,d=sn(a,u,n,e);return{value:l,type:o,comment:d.comment,range:[i,u,d.offset]}}function fk(t,n){let e="";switch(t[0]){case" ":e="a tab character";break;case",":e="flow indicator character ,";break;case"%":e="directive indicator character %";break;case"|":case">":{e=`block scalar indicator ${t[0]}`;break}case"@":case"`":{e=`reserved character ${t[0]}`;break}}return e&&n(0,"BAD_SCALAR_START",`Plain value cannot start with ${e}`),jf(t)}function hk(t,n){return(t[t.length-1]!=="'"||t.length===1)&&n(t.length,"MISSING_CHAR","Missing closing 'quote"),jf(t.slice(1,-1)).replace(/''/g,"'")}function jf(t){let n,e;try{n=new RegExp(`(.*?)(?<![ ])[ ]*\r?
`,"sy"),e=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
`,"sy")}catch{n=/(.*?)[ \t]*\r?\n/sy,e=/[ \t]*(.*?)[ \t]*\r?\n/sy}let i=n.exec(t);if(!i)return t;let r=i[1],s=" ",a=n.lastIndex;for(e.lastIndex=a;i=e.exec(t);)i[1]===""?s===`
`?r+=s:s=`
`:(r+=s+i[1],s=" "),a=e.lastIndex;let o=/[ \t]*(.*)/sy;return o.lastIndex=a,i=o.exec(t),r+s+(i?.[1]??"")}function gk(t,n){let e="";for(let i=1;i<t.length-1;++i){let r=t[i];if(!(r==="\r"&&t[i+1]===`
`))if(r===`
`){let{fold:s,offset:a}=yk(t,i);e+=s,i=a}else if(r==="\\"){let s=t[++i],a=bk[s];if(a)e+=a;else if(s===`
`)for(s=t[i+1];s===" "||s===" ";)s=t[++i+1];else if(s==="\r"&&t[i+1]===`
`)for(s=t[++i+1];s===" "||s===" ";)s=t[++i+1];else if(s==="x"||s==="u"||s==="U"){let o=s==="x"?2:s==="u"?4:8;e+=kk(t,i+1,o,n),i+=o}else{let o=t.substr(i-1,2);n(i-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),e+=o}}else if(r===" "||r===" "){let s=i,a=t[i+1];for(;a===" "||a===" ";)a=t[++i+1];a!==`
`&&!(a==="\r"&&t[i+2]===`
`)&&(e+=i>s?t.slice(s,i+1):r)}else e+=r}return(t[t.length-1]!=='"'||t.length===1)&&n(t.length,"MISSING_CHAR",'Missing closing "quote'),e}function yk(t,n){let e="",i=t[n+1];for(;(i===" "||i===" "||i===`
`||i==="\r")&&!(i==="\r"&&t[n+2]!==`
`);)i===`
`&&(e+=`
`),n+=1,i=t[n+1];return e||(e=" "),{fold:e,offset:n}}var bk={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function kk(t,n,e,i){let r=t.substr(n,e),a=r.length===e&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(a)}catch{let o=t.substr(n-2,e+2);return i(n-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),o}}function Zu(t,n,e,i){let{value:r,type:s,comment:a,range:o}=n.type==="block-scalar"?pl(t,n,i):ml(n,t.options.strict,i),l=e?t.directives.tagName(e.source,d=>i(e,"TAG_RESOLVE_FAILED",d)):null,c;t.options.stringKeys&&t.atKey?c=t.schema[ft]:l?c=wk(t.schema,r,l,e,i):n.type==="scalar"?c=vk(t,r,n,i):c=t.schema[ft];let u;try{let d=c.resolve(r,p=>i(e??n,"TAG_RESOLVE_FAILED",p),t.options);u=G(d)?d:new z(d)}catch(d){let p=d instanceof Error?d.message:String(d);i(e??n,"TAG_RESOLVE_FAILED",p),u=new z(r)}return u.range=o,u.source=r,s&&(u.type=s),l&&(u.tag=l),c.format&&(u.format=c.format),a&&(u.comment=a),u}function wk(t,n,e,i,r){if(e==="!")return t[ft];let s=[];for(let o of t.tags)if(!o.collection&&o.tag===e)if(o.default&&o.test)s.push(o);else return o;for(let o of s)if(o.test?.test(n))return o;let a=t.knownTags[e];return a&&!a.collection?(t.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${e}`,e!=="tag:yaml.org,2002:str"),t[ft])}function vk({atKey:t,directives:n,schema:e},i,r,s){let a=e.tags.find(o=>(o.default===!0||t&&o.default==="key")&&o.test?.test(i))||e[ft];if(e.compat){let o=e.compat.find(l=>l.default&&l.test?.test(i))??e[ft];if(a.tag!==o.tag){let l=n.tagString(a.tag),c=n.tagString(o.tag),u=`Value may be parsed as either ${l} or ${c}`;s(r,"TAG_RESOLVE_FAILED",u,!0)}}return a}function Vf(t,n,e){if(n){e??(e=n.length);for(let i=e-1;i>=0;--i){let r=n[i];switch(r.type){case"space":case"comment":case"newline":t-=r.source.length;continue}for(r=n[++i];r?.type==="space";)t+=r.source.length,r=n[++i];break}}return t}var Lk={composeNode:Ju,composeEmptyNode:fl};function Ju(t,n,e,i){let r=t.atKey,{spaceBefore:s,comment:a,anchor:o,tag:l}=e,c,u=!0;switch(n.type){case"alias":c=Ak(t,n,i),(o||l)&&i(n,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=Zu(t,n,l,i),o&&(c.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=Uf(Lk,t,n,e,i),o&&(c.anchor=o.source.substring(1))}catch(d){let p=d instanceof Error?d.message:String(d);i(n,"RESOURCE_EXHAUSTION",p)}break;default:{let d=n.type==="error"?n.message:`Unsupported token (type: ${n.type})`;i(n,"UNEXPECTED_TOKEN",d),u=!1}}return c??(c=fl(t,n.offset,void 0,null,e,i)),o&&c.anchor===""&&i(o,"BAD_ALIAS","Anchor cannot be an empty string"),r&&t.options.stringKeys&&(!G(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&i(l??n,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(c.spaceBefore=!0),a&&(n.type==="scalar"&&n.source===""?c.comment=a:c.commentBefore=a),t.options.keepSourceTokens&&u&&(c.srcToken=n),c}function fl(t,n,e,i,{spaceBefore:r,comment:s,anchor:a,tag:o,end:l},c){let u={type:"scalar",offset:Vf(n,e,i),indent:-1,source:""},d=Zu(t,u,o,c);return a&&(d.anchor=a.source.substring(1),d.anchor===""&&c(a,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(d.spaceBefore=!0),s&&(d.comment=s,d.range[2]=l),d}function Ak({options:t},{offset:n,source:e,end:i},r){let s=new yn(e.substring(1));s.source===""&&r(n,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&r(n+e.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let a=n+e.length,o=sn(i,a,t.strict,r);return s.range=[n,a,o.offset],o.comment&&(s.comment=o.comment),s}function Wf(t,n,{offset:e,start:i,value:r,end:s},a){let o=Object.assign({_directives:n},t),l=new Pt(void 0,o),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},u=rn(i,{indicator:"doc-start",next:r??s?.[0],offset:e,onError:a,parentIndent:0,startOnNewline:!0});u.found&&(l.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!u.hasNewline&&a(u.end,"MISSING_CHAR",
`:`
`)+(s.substring(1)||" "),e=!0,i=!1;break;case"%":t[r+1]?.[0]!=="#"&&(r+=1),e=!1;break;default:e||(i=!0),e=!1}}return{comment:n,afterEmptyLine:i}}var xs=class{constructor(n={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,i,r,s)=>{let a=Ts(e);s?this.warnings.push(new Ss(a,i,r)):this.errors.push(new lt(a,i,r))},this.directives=new tn({version:n.version||"1.2"}),this.options=n}decorate(n,e){let{comment:i,afterEmptyLine:r}=Gf(this.prelude);if(i){let s=n.contents;if(e)n.comment=n.comment?`${n.comment}
${i}`:i;else if(r||n.directives.docStart||!s)n.commentBefore=i;else if(se(s)&&!s.flow&&s.items.length>0){let a=s.items[0];ee(a)&&(a=a.key);let o=a.commentBefore;a.commentBefore=o?`${i}
${o}`:i}else{let a=s.commentBefore;s.commentBefore=a?`${i}
${a}`:i}}e?(Array.prototype.push.apply(n.errors,this.errors),Array.prototype.push.apply(n.warnings,this.warnings)):(n.errors=this.errors,n.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Gf(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(n,e=!1,i=-1){for(let r of n)yield*this.next(r);yield*this.end(e,i)}*next(n){switch(n.type){case"directive":this.directives.add(n.source,(e,i,r)=>{let s=Ts(n);s[0]+=e,this.onError(s,"BAD_DIRECTIVE",i,r)}),this.prelude.push(n.source),this.atDirectives=!0;break;case"document":{let e=Wf(this.options,this.directives,n,this.onError);this.atDirectives&&!e.directives.docStart&&this.onError(n,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(e,!1),this.doc&&(yield this.doc),this.doc=e,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(n.source);break;case"error":{let e=n.source?`${n.message}: ${JSON.stringify(n.source)}`:n.message,i=new lt(Ts(n),"UNEXPECTED_TOKEN",e);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){let i="Unexpected doc-end without preceding document";this.errors.push(new lt(Ts(n),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;let e=sn(n.end,n.offset+n.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),e.comment){let i=this.doc.comment;this.doc.comment=i?`${i}
${e.comment}`:e.comment}this.doc.range[2]=e.offset;break}default:this.errors.push(new lt(Ts(n),"UNEXPECTED_TOKEN",`Unsupported token ${n.type}`))}}*end(n=!1,e=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(n){let i=Object.assign({_directives:this.directives},this.options),r=new Pt(void 0,i);this.atDirectives&&this.onError(e,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,e,e],this.decorate(r,!1),yield r}}};var yl={};Bc(yl,{BOM:()=>Os,DOCUMENT:()=>Ms,FLOW_END:()=>Cs,SCALAR:()=>Lr,createScalarToken:()=>Zf,isCollection:()=>Tk,isScalar:()=>xk,prettyToken:()=>Ok,resolveAsScalar:()=>Qf,setScalarValue:()=>Jf,stringify:()=>eh,tokenType:()=>td,visit:()=>jn});function Qf(t,n=!0,e){if(t){let i=(r,s,a)=>{let o=typeof r=="number"?r:Array.isArray(r)?r[0]:r.offset;if(e)e(o,s,a);else throw new lt([o,o+1],s,a)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return ml(t,n,i);case"block-scalar":return pl({options:{strict:n}},t,i)}}return null}function Zf(t,n){let{implicitKey:e=!1,indent:i,inFlow:r=!1,offset:s=-1,type:a="PLAIN"}=n,o=kn({type:a,value:t},{implicitKey:e,indent:i>0?" ".repeat(i):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}}),l=n.end??[{type:"newline",offset:-1,indent:i,source:`
`}];switch(o[0]){case"|":case">":{let c=o.indexOf(`
`),u=o.substring(0,c),d=o.substring(c+1)+`
`,p=[{type:"block-scalar-header",offset:s,indent:i,source:u}];return Xf(p,l)||p.push({type:"newline",offset:-1,indent:i,source:`
`}),{type:"block-scalar",offset:s,indent:i,props:p,source:d}}case'"':return{type:"double-quoted-scalar",offset:s,indent:i,source:o,end:l};case"'":return{type:"single-quoted-scalar",offset:s,indent:i,source:o,end:l};default:return{type:"scalar",offset:s,indent:i,source:o,end:l}}}function Jf(t,n,e={}){let{afterKey:i=!1,implicitKey:r=!1,inFlow:s=!1,type:a}=e,o="indent"in t?t.indent:null;if(i&&typeof o=="number"&&(o+=2),!a)switch(t.type){case"single-quoted-scalar":a="QUOTE_SINGLE";break;case"double-quoted-scalar":a="QUOTE_DOUBLE";break;case"block-scalar":{let c=t.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:a="PLAIN"}let l=kn({type:a,value:n},{implicitKey:r||o===null,indent:o!==null&&o>0?" ".repeat(o):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":Sk(t,l);break;case'"':Xu(t,l,"double-quoted-scalar");break;case"'":Xu(t,l,"single-quoted-scalar");break;default:Xu(t,l,"scalar")}}function Sk(t,n){let e=n.indexOf(`
`),i=n.substring(0,e),r=n.substring(e+1)+`
`;if(t.type==="block-scalar"){let s=t.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=i,t.source=r}else{let{offset:s}=t,a="indent"in t?t.indent:-1,o=[{type:"block-scalar-header",offset:s,indent:a,source:i}];Xf(o,"end"in t?t.end:void 0)||o.push({type:"newline",offset:-1,indent:a,source:`
`});for(let l of Object.keys(t))l!=="type"&&l!=="offset"&&delete t[l];Object.assign(t,{type:"block-scalar",indent:a,props:o,source:r})}}function Xf(t,n){if(n)for(let e of n)switch(e.type){case"space":case"comment":t.push(e);break;case"newline":return t.push(e),!0}return!1}function Xu(t,n,e){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=e,t.source=n;break;case"block-scalar":{let i=t.props.slice(1),r=n.length;t.props[0].type==="block-scalar-header"&&(r-=t.props[0].source.length);for(let s of i)s.offset+=r;delete t.props,Object.assign(t,{type:e,source:n,end:i});break}case"block-map":case"block-seq":{let r={type:"newline",offset:t.offset+n.length,indent:t.indent,source:`
`};delete t.items,Object.assign(t,{type:e,source:n,end:[r]});break}default:{let i="indent"in t?t.indent:-1,r="end"in t&&Array.isArray(t.end)?t.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(t))s!=="type"&&s!=="offset"&&delete t[s];Object.assign(t,{type:e,indent:i,source:n,end:r})}}}var eh=t=>"type"in t?gl(t):hl(t);function gl(t){switch(t.type){case"block-scalar":{let n="";for(let e of t.props)n+=gl(e);return n+t.source}case"block-map":case"block-seq":{let n="";for(let e of t.items)n+=hl(e);return n}case"flow-collection":{let n=t.start.source;for(let e of t.items)n+=hl(e);for(let e of t.end)n+=e.source;return n}case"document":{let n=hl(t);if(t.end)for(let e of t.end)n+=e.source;return n}default:{let n=t.source;if("end"in t&&t.end)for(let e of t.end)n+=e.source;return n}}}function hl({start:t,key:n,sep:e,value:i}){let r="";for(let s of t)r+=s.source;if(n&&(r+=gl(n)),e)for(let s of e)r+=s.source;return i&&(r+=gl(i)),r}var ed=Symbol("break visit"),Ek=Symbol("skip children"),th=Symbol("remove item");function jn(t,n){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),nh(Object.freeze([]),t,n)}jn.BREAK=ed;jn.SKIP=Ek;jn.REMOVE=th;jn.itemAtPath=(t,n)=>{let e=t;for(let[i,r]of n){let s=e?.[i];if(s&&"items"in s)e=s.items[r];else return}return e};jn.parentCollection=(t,n)=>{let e=jn.itemAtPath(t,n.slice(0,-1)),i=n[n.length-1][0],r=e?.[i];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};function nh(t,n,e){let i=e(n,t);if(typeof i=="symbol")return i;for(let r of["key","value"]){let s=n[r];if(s&&"items"in s){for(let a=0;a<s.items.length;++a){let o=nh(Object.freeze(t.concat([[r,a]])),s.items[a],e);if(typeof o=="number")a=o-1;else{if(o===ed)return ed;o===th&&(s.items.splice(a,1),a-=1)}}typeof i=="function"&&r==="key"&&(i=i(n,t))}}return typeof i=="function"?i(n,t):i}var Os="\uFEFF",Ms="",Cs="",Lr="",Tk=t=>!!t&&"items"in t,xk=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function Ok(t){switch(t){case Os:return"<BOM>";case Ms:return"<DOC>";case Cs:return"<FLOW_END>";case Lr:return"<SCALAR>";default:return JSON.stringify(t)}}function td(t){switch(t){case Os:return"byte-order-mark";case Ms:return"doc-mode";case Cs:return"flow-error-end";case Lr:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
`:case`\r
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function qt(t){switch(t){case void 0:case" ":case`
`:case"\r":case" ":return!0;default:return!1}}var ih=new Set("0123456789ABCDEFabcdef"),Mk=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),bl=new Set(",[]{}"),Ck=new Set(` ,[]{}
\r `),nd=t=>!t||Ck.has(t),Is=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(n,e=!1){if(n){if(typeof n!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+n:n,this.lineEndPos=null}this.atEnd=!e;let i=this.next??"stream";for(;i&&(e||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let n=this.pos,e=this.buffer[n];for(;e===" "||e===" ";)e=this.buffer[++n];return!e||e==="#"||e===`
`?!0:e==="\r"?this.buffer[n+1]===`
`:!1}charAt(n){return this.buffer[this.pos+n]}continueScalar(n){let e=this.buffer[n];if(this.indentNext>0){let i=0;for(;e===" ";)e=this.buffer[++i+n];if(e==="\r"){let r=this.buffer[i+n+1];if(r===`
`||!r&&!this.atEnd)return n+i+1}return e===`
`||i>=this.indentNext||!e&&!this.atEnd?n+i:-1}if(e==="-"||e==="."){let i=this.buffer.substr(n,3);if((i==="---"||i==="...")&&qt(this.buffer[n+3]))return-1}return n}getLine(){let n=this.lineEndPos;return(typeof n!="number"||n!==-1&&n<this.pos)&&(n=this.buffer.indexOf(`
`,this.pos),this.lineEndPos=n),n===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[n-1]==="\r"&&(n-=1),this.buffer.substring(this.pos,n))}hasChars(n){return this.pos+n<=this.buffer.length}setNext(n){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=n,null}peek(n){return this.buffer.substr(this.pos,n)}*parseNext(n){switch(n){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let n=this.getLine();if(n===null)return this.setNext("stream");if(n[0]===Os&&(yield*this.pushCount(1),n=n.substring(1)),n[0]==="%"){let e=n.length,i=n.indexOf("#");for(;i!==-1;){let s=n[i-1];if(s===" "||s===" "){e=i-1;break}else i=n.indexOf("#",i+1)}for(;;){let s=n[e-1];if(s===" "||s===" ")e-=1;else break}let r=(yield*this.pushCount(e))+(yield*this.pushSpaces(!0));return yield*this.pushCount(n.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){let e=yield*this.pushSpaces(!0);return yield*this.pushCount(n.length-e),yield*this.pushNewline(),"stream"}return yield Ms,yield*this.parseLineStart()}*parseLineStart(){let n=this.charAt(0);if(!n&&!this.atEnd)return this.setNext("line-start");if(n==="-"||n==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let e=this.peek(3);if((e==="---"||e==="...")&&qt(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,e==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!qt(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[n,e]=this.peek(2);if(!e&&!this.atEnd)return this.setNext("block-start");if((n==="-"||n==="?"||n===":")&&qt(e)){let i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let n=this.getLine();if(n===null)return this.setNext("doc");let e=yield*this.pushIndicators();switch(n[e]){case"#":yield*this.pushCount(n.length-e);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(nd),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return e+=yield*this.parseBlockScalarHeader(),e+=yield*this.pushSpaces(!0),yield*this.pushCount(n.length-e),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let n,e,i=-1;do n=yield*this.pushNewline(),n>0?(e=yield*this.pushSpaces(!1),this.indentValue=i=e):e=0,e+=yield*this.pushSpaces(!0);while(n+e>0);let r=this.getLine();if(r===null)return this.setNext("flow");if((i!==-1&&i<this.indentNext&&r[0]!=="#"||i===0&&(r.startsWith("---")||r.startsWith("..."))&&qt(r[3]))&&!(i===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield Cs,yield*this.parseLineStart();let s=0;for(;r[s]===",";)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s+=yield*this.pushIndicators(),r[s]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-s),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(nd),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let a=this.charAt(1);if(this.flowKey||qt(a)||a===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flo
`,this.pos);if(r!==-1){for(;r!==-1;){let s=this.continueScalar(r+1);if(s===-1)break;r=i.indexOf(`
`,s)}r!==-1&&(e=r-(i[r-1]==="\r"?2:1))}if(e===-1){if(!this.atEnd)return this.setNext("quoted-scalar");e=this.buffer.length}return yield*this.pushToIndex(e+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let n=this.pos;for(;;){let e=this.buffer[++n];if(e==="+")this.blockScalarKeep=!0;else if(e>"0"&&e<="9")this.blockScalarIndent=Number(e)-1;else if(e!=="-")break}return yield*this.pushUntil(e=>qt(e)||e==="#")}*parseBlockScalar(){let n=this.pos-1,e=0,i;e:for(let s=this.pos;i=this.buffer[s];++s)switch(i){case" ":e+=1;break;case`
`:n=s,e=0;break;case"\r":{let a=this.buffer[s+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===`
`)break}default:break e}if(!i&&!this.atEnd)return this.setNext("block-scalar");if(e>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=e:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let s=this.continueScalar(n+1);if(s===-1)break;n=this.buffer.indexOf(`
`,s)}while(n!==-1);if(n===-1){if(!this.atEnd)return this.setNext("block-scalar");n=this.buffer.length}}let r=n+1;for(i=this.buffer[r];i===" ";)i=this.buffer[++r];if(i===" "){for(;i===" "||i===" "||i==="\r"||i===`
`;)i=this.buffer[++r];n=r-1}else if(!this.blockScalarKeep)do{let s=n-1,a=this.buffer[s];a==="\r"&&(a=this.buffer[--s]);let o=s;for(;a===" ";)a=this.buffer[--s];if(a===`
`&&s>=this.pos&&s+1+e>o)n=s;else break}while(!0);return yield Lr,yield*this.pushToIndex(n+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let n=this.flowLevel>0,e=this.pos-1,i=this.pos-1,r;for(;r=this.buffer[++i];)if(r===":"){let s=this.buffer[i+1];if(qt(s)||n&&bl.has(s))break;e=i}else if(qt(r)){let s=this.buffer[i+1];if(r==="\r"&&(s===`
`?(i+=1,r=`
`,s=this.buffer[i+1]):e=i),s==="#"||n&&bl.has(s))break;if(r===`
`){let a=this.continueScalar(i+1);if(a===-1)break;i=Math.max(i,a-2)}}else{if(n&&bl.has(r))break;e=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield Lr,yield*this.pushToIndex(e+1,!0),n?"flow":"doc")}*pushCount(n){return n>0?(yield this.buffer.substr(this.pos,n),this.pos+=n,n):0}*pushToIndex(n,e){let i=this.buffer.slice(this.pos,n);return i?(yield i,this.pos+=i.length,i.length):(e&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(nd))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let n=this.flowLevel>0,e=this.charAt(1);if(qt(e)||n&&bl.has(e))return n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let n=this.pos+2,e=this.buffer[n];for(;!qt(e)&&e!==">";)e=this.buffer[++n];return yield*this.pushToIndex(e===">"?n+1:n,!1)}else{let n=this.pos+1,e=this.buffer[n];for(;e;)if(Mk.has(e))e=this.buffer[++n];else if(e==="%"&&ih.has(this.buffer[n+1])&&ih.has(this.buffer[n+2]))e=this.buffer[n+=3];else break;return yield*this.pushToIndex(n,!1)}}*pushNewline(){let n=this.buffer[this.pos];return n===`
`?yield*this.pushCount(1):n==="\r"&&this.charAt(1)===`
`?yield*this.pushCount(2):0}*pushSpaces(n){let e=this.pos-1,i;do i=this.buffer[++e];while(i===" "||n&&i===" ");let r=e-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=e),r}*pushUntil(n){let e=this.pos,i=this.buffer[e];for(;!n(i);)i=this.buffer[++e];return yield*this.pushToIndex(e,!1)}};var Bs=class{constructor(){this.lineStarts=[],this.addNewLine=n=>this.lineStarts.push(n),this.linePos=n=>{let e=0,i=this.lineStarts.length;for(;e<i;){let s=e+i>>1;this.lineStarts[s]<n?e=s+1:i=s}if(this.lineStarts[e]===n)return{line:e+1,col:1};if(e===0)return{line:0,col:n};let r=this.lineStarts[e-1];return{line:e,col:n-r+1}}}};function Vn(t,n){for(let e=0;e<t.length;++e)if(t[e].type===n)return!0;return!1}function rh(t){for(let n=0;n<t.length;++n)switch(t[n].type){case"space":case"comment":case"newline":break;default:return n}return-1}function ah(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function kl(t){switch(t.type){case"document":return t.start;case"block-map":{let n=t.items[t.items.length-1];return n.sep??n.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function Ar(t){if(t.length===0)return[];let n=t.length;e:for(;--n>=0;)switch(t[n].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++n]?.type==="space";);return t.splice(n,t.length)}function sh(t){if(t.start.type==="flow-seq-start")for(let n of t.items)n.sep&&!n.value&&!Vn(n.start,"explicit-key-ind")&&!Vn(n.sep,"map-value-ind")&&(n.key&&(n.value=n.key),delete n.key,ah(n.value)?n.value.end?Array.prototype.push.apply(n.value.end,n.sep):n.value.end=n.sep:Array.prototype.push.apply(n.start,n.sep),delete n.sep)}var Rs=class{constructor(n){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new Is,this.onNewLine=n}*parse(n,e=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let i of this.lexer.lex(n,e))yield*this.next(i);e||(yield*this.end())}*next(n){if(this.source=n,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=n.length;return}let e=td(n);if(e)if(e==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=e,yield*this.step(),e){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+n.length);break;case"space":this.atNewLine&&n[0]===" "&&(this.indent+=n.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=n.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=n.length}else{let i=`Not a YAML token: ${n}`;yield*this.pop({type:"error",offset:this.offset,message:i,source:n}),this.offset+=n.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let n=this.peek(1);if(this.type==="doc-end"&&n?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!n)return yield*this.stream();switch(n.type){case"document":return yield*this.document(n);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(n);case"block-scalar":return yield*this.blockScalar(n);case"block-map":return yield*this.blockMap(n);case"block-seq":return yield*this.blockSequence(n);case"flow-collection":return yield*this.flowCollection(n);case"doc-end":return yield*this.documentEnd(n)}yield*this.pop()}peek(n){return this.stack[this.stack.length-n]}*pop(n){let e=n??this.stack.pop();if(!e)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield e;else{let i=this.peek(1);switch(e.type==="block-scalar"?e.indent="indent"in i?i.indent:0:e.type==="flow-collection"&&i.type==="document"&&(e.indent=0),e.type==="flow-collection"&&sh(e),i.type){case"document":i.value=e;b
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
`,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(n){let e=n.items[n.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,e.value){let i="end"in e.value?e.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):n.items.push({start:[this.sourceToken]})}else e.sep?e.sep.push(this.sourceToken):e.start.push(this.sourceToken);return;case"space":case"comment":if(e.value)n.items.push({start:[this.sourceToken]});else if(e.sep)e.sep.push(this.sourceToken);else{if(this.atIndentedComment(e.start,n.indent)){let r=n.items[n.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,e.start),r.push(this.sourceToken),n.items.pop();return}}e.start.push(this.sourceToken)}return}if(this.indent>=n.indent){let i=!this.onKeyLine&&this.indent===n.indent,r=i&&(e.sep||e.explicitKey)&&this.type!=="seq-item-ind",s=[];if(r&&e.sep&&!e.value){let a=[];for(let o=0;o<e.sep.length;++o){let l=e.sep[o];switch(l.type){case"newline":a.push(o);break;case"space":break;case"comment":l.indent>n.indent&&(a.length=0);break;default:a.length=0}}a.length>=2&&(s=e.sep.splice(a[1]))}switch(this.type){case"anchor":case"tag":r||e.value?(s.push(this.sourceToken),n.items.push({start:s}),this.onKeyLine=!0):e.sep?e.sep.push(this.sourceToken):e.start.push(this.sourceToken);return;case"explicit-key-ind":!e.sep&&!e.explicitKey?(e.start.push(this.sourceToken),e.explicitKey=!0):r||e.value?(s.push(this.sourceToken),n.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(e.explicitKey)if(e.sep)if(e.value)n.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Vn(e.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(ah(e.key)&&!Vn(e.sep,"newline")){let a=Ar(e.start),o=e.key,l=e.sep;l.push(this.sourceToken),delete e.key,delete e.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:o,sep:l}]})}else s.length>0?e.sep=e.sep.concat(s,this.sourceToken):e.sep.push(this.sourceToken);else if(Vn(e.start,"newline"))Object.assign(e,{key:null,sep:[this.sourceToken]});else{let a=Ar(e.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else e.sep?e.value||r?n.items.push({start:s,key:null,sep:[this.sourceToken]}):Vn(e.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):e.sep.push(this.sourceToken):Object.assign(e,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let a=this.flowScalar(this.type);r||e.value?(n.items.push({start:s,key:a,sep:[]}),this.onKeyLine=!0):e.sep?this.stack.push(a):(Object.assign(e,{key:a,sep:[]}),this.onKeyLine=!0);return}default:{let a=this.startBlockValue(n);if(a){if(a.type==="block-seq"){if(!e.explicitKey&&e.sep&&!Vn(e.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else i&&n.items.push({start:s});this.stack.push(a);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(n){let e=n.items[n.items.length-1];switch(this.type){case"newline":if(e.value){let i="end"in e.value?e.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):n.items.push({start:[this.sourceToken]})}else e.start.push(this.sourceToken);return;case"space":case"comment":if(e.value)n.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(e.start,n.indent)){let r=n.items[n.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,e.start),r.push(this.sourceToken),n.items.pop();return}}e.start.push(this.sourceToken)}return;case"anchor":case"tag":if(e.valu
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
`,e)+1}return{type:n,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(n){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let e=kl(n),i=Ar(e);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let e=kl(n),i=Ar(e);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(n,e){return this.type!=="comment"||this.indent<=e?!1:n.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(n){this.type!=="doc-mode"&&(n.end?n.end.push(this.sourceToken):n.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(n){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:n.end?n.end.push(this.sourceToken):n.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};function Ik(t){let n=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||n&&new Bs||null,prettyErrors:n}}function wl(t,n={}){let{lineCounter:e,prettyErrors:i}=Ik(n),r=new Rs(e?.addNewLine),s=new xs(n),a=null;for(let o of s.compose(r.parse(t),!0,t.length))if(!a)a=o;else if(a.options.logLevel!=="silent"){a.errors.push(new lt(o.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&e&&(a.errors.forEach(Vu(t,e)),a.warnings.forEach(Vu(t,e))),a}function vl(t,n,e){let i;typeof n=="function"?i=n:e===void 0&&n&&typeof n=="object"&&(e=n);let r=wl(t,e);if(!r)return null;if(r.warnings.forEach(s=>Vo(r.options.logLevel,s)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:i},e))}function Ll(t,n,e){let i=null;if(typeof n=="function"||Array.isArray(n)?i=n:e===void 0&&n&&(e=n),typeof e=="string"&&(e=e.length),typeof e=="number"){let r=Math.round(e);e=r<1?void 0:r>8?{indent:8}:{indent:r}}if(t===void 0){let{keepUndefined:r}=e??n??{};if(!r)return}return Dt(t)&&!i?t.toString(e):new Pt(t,i,e).toString(e)}var id="tag",Fs="tags",Ht=[id,Fs],Rk="alias",rd="aliases",$t=[Rk,rd],sd="linter-yaml-title-alias",Sr="disabled rules";function an(t){return t.match(He)===null&&(t=`---
---
`+t),t}function Er(t){let n=t.match(He);return n?n[1]:null}function Ee(t,n){if(!t.match(He))return t;let e=t.match(He)[0],i=n(e);return t=t.replace(e,it(i)),t}function ad(t,n=!0){return n?new RegExp(`^([\\t ]*)${t}:[ \\t]*(\\S.*|(?:(?:\\n *- \\S.*)|((?:\\n *- *))*|(\\n([ \\t]+[^\\n]*))*)*)\\n`,"m"):new RegExp(`^${t}:[ \\t]*(\\S.*|(?:(?:\\n *- \\S.*)|((?:\\n *- *))*|(\\n([ \\t]+[^\\n]*))*)*)\\n`,"m")}function de(t,n,e){let i=`${n}:${e}
`,r=!1,s=t.replace(ad(n),(a,o)=>(r=!0,o+i));return r||(s=`${t}${i}`),s}function we(t,n,e=!0){let i=t.match(ad(n,e));if(i==null)return null;let r=i[2];return e||(r=i[1]),r}function Ds(t,n,e=!0){return t.replace(ad(n,e),"")}function gt(t){if(t==null)return null;let n=vl(t.replace(/\n(\t)+/g,`
`));return n??{}}function lh(t){if(t==null)return null;let n=wl(t.replace(/\n(\t)+/g,`
`),{keepSourceTokens:!0});return n??null}function od(t){let n=new Pt(t.options);n.contents=new ke;let e=t.contents.srcToken;return n.contents.srcToken={offset:e.offset,type:e.type,indent:e.indent,start:e.start,end:e.end,items:[]},n}function ki(t){if(!t||!t.contents)return"";let n=t.contents.items;return!n||n.length==0?"":yl.stringify(t.contents.srcToken)}function xe(t,n,e,i,r=!1){if(typeof t=="string"&&(t=[t]),t==null||t.length===0)return Fk(n);let s=i&&(n=="multi-line"||n=="single string to multi-line"&&t.length>1);if(r||s)for(let a=0;a<t.length;a++){let o=t[a],l=Wn(o);l&&(o=o.substring(1,o.length-1));let c=r&&mo(o);l&&c||(c||l&&s)&&(t[a]=ht(o,e,c))}switch(n){case"single string to single-line":if(t.length===1)return" "+t[0];case"single-line":for(let a=0;a<t.length;a++)t[a].includes(",")&&!Wn(t[a])&&(t[a]=ht(t[a],e,!0));return" "+oh(t);case"single string to multi-line":if(t.length===1)return" "+t[0];case"multi-line":return Dk(t);case"single string space delimited":return t.length===1?" "+t[0]:" "+t.join(" ");case"single string comma delimited":for(let a=0;a<t.length;a++)t[a].includes(",")&&!Wn(t[a])&&(t[a]=ht(t[a],e,!0));return t.length===1?" "+t[0]:" "+t.join(", ");case"single-line space delimited":return t.length===1?" "+t[0]:" "+oh(t).replaceAll(", "," ")}}function Fk(t){switch(t){case"single-line":case"single-line space delimited":case"multi-line":return" []";case"single string to single-line":case"single string to multi-line":case"single string space delimited":case"single string comma delimited":return" "}}function oh(t){return t==null||t.length===0?"[]":"["+t.join(", ")+"]"}function Dk(t){return t==null||t.length===0?"[]":`
- `+t.join(`
- `)}function Ke(t){if(t==null||t.length===0)return null;if(t=t.trimEnd(),t.startsWith("["))return t=t.substring(1),t.endsWith("]")&&(t=t.substring(0,t.length-1)),t.length===0?null:Al(t,",").filter(e=>e!="");if(t.includes(`
`)){let n=t.split(/[ \t]*\n[ \t]*-[ \t]*/);return n.splice(0,1),n=n.filter(e=>e!=""),n==null||n.length===0?null:n}return t}function Gn(t){if(t==null)return[];let n=[],e=[];Array.isArray(t)?e=t:t.includes(",")?e=Al(t,","):e=Al(t," ");for(let i of e)n.push(i.trim());return n}function Qn(t){return typeof t=="string"?Al(t,","):t}function Al(t,n=","){if(t==""||t==null)return null;if(n.length>1)throw new Error(E("logs.invalid-delimiter-error-message"));let e=[],i="",r=0;for(;r<t.length;){let s=t.charAt(r);if(s===n)e.push(i.trim()),i="";else if(s==='"'||s==="'"){let a=t.indexOf(s,r+1);a!=-1?(i+=t.substring(r,a+1),r=a):i+=s}else i+=s;r++}return i.trim()!=""&&e.push(i.trim()),e}function Wn(t){return t.length>1&&(t.startsWith("'")&&t.endsWith("'")||t.startsWith('"')&&t.endsWith('"'))}function ht(t,n,e=!1,i=!1){let r=Nk(t,n,e);if(i)return r;try{if(vl(r,{logLevel:"error"})===t)return r}catch{}let s=Ll(t,{lineWidth:-1,quotingType:n,forceQuotes:e}).slice(0,-1),a=Ll(t,{lineWidth:-1,quotingType:n=='"'?"'":'"',forceQuotes:e}).slice(0,-1);return a===t||a.length<s.length?a:s}function Nk(t,n,e=!1){if(Wn(t))return t;let i=t.includes("'"),r=t.includes('"'),s=t.includes(": ");return!i&&!r&&!s&&!e||i&&r?t:i?`"${t}"`:r?`'${t}'`:`${n}${t}${n}`}function ch(t){let n=we(t,Sr);if(n==null)return[];let e=n.includes(`
`)?`${Sr}:
`:`${Sr}: `;e+=n;let r=gt(e)["disabled rules"];return r?(typeof r=="string"&&(r=[r]),r):[]}var Br=require("obsidian");function Re(t){t.addClass("linter-visually-hidden")}function $e(t){t.removeClass("linter-visually-hidden")}function ct(t,n){if(t.includes("</")){let e=document.createRange();n.append(e.createContextualFragment(t))}else n.setText(t)}var Ir=require("obsidian");var uh=require("obsidian");var Sl=class{constructor(n,e,i,r,s,a,o,l,c,u){this.containerEl=n;this.name=e;this.description=i;this.warning=r;this.addInputTooltip=s;this.refreshBtnTooltip=a;this.app=o;this.saveSettings=l;this.onAddInput=c;this.onRefresh=u}display(){this.containerEl.createDiv({cls:"setting-item-name",text:this.name});let n=this.containerEl.createDiv({cls:"setting-item-description"});ct(this.description,n.createEl("p",{cls:"custom-row-description"})),new uh.Setting(this.containerEl).addButton(e=>{e.setIcon("plus-with-circle").setTooltip(this.addInputTooltip).onClick(()=>this.onAddInput()),e.buttonEl.addClass("clickable-icon")}).addButton(e=>{e.setIcon("reset").setTooltip(this.refreshBtnTooltip).onClick(()=>this.onRefresh()),e.buttonEl.addClass("clickable-icon")}).setClass("linter-border-bottom").setDesc(this.warning??"").descEl.addClass("mod-warning"),this.inputElDiv=this.containerEl.createDiv(),this.showInputEls()}resetInputEls(){this.inputElDiv.empty(),this.showInputEls()}};var Bh=require("obsidian");var Te="top",Fe="bottom",Ie="right",Oe="left",El="auto",Zn=[Te,Fe,Ie,Oe],vn="start",wi="end",dh="clippingParents",Tl="viewport",Tr="popper",ph="reference",ld=Zn.reduce(function(t,n){return t.concat([n+"-"+vn,n+"-"+wi])},[]),xl=[].concat(Zn,[El]).reduce(function(t,n){return t.concat([n,n+"-"+vn,n+"-"+wi])},[]),Yk="beforeRead",Kk="read",_k="afterRead",zk="beforeMain",Pk="main",qk="afterMain",Hk="beforeWrite",$k="write",Uk="afterWrite",mh=[Yk,Kk,_k,zk,Pk,qk,Hk,$k,Uk];function _e(t){return t?(t.nodeName||"").toLowerCase():null}function he(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var n=t.ownerDocument;return n&&n.defaultView||window}return t}function St(t){var n=he(t).Element;return t instanceof n||t instanceof Element}function De(t){var n=he(t).HTMLElement;return t instanceof n||t instanceof HTMLElement}function xr(t){if(typeof ShadowRoot>"u")return!1;var n=he(t).ShadowRoot;return t instanceof n||t instanceof ShadowRoot}function jk(t){var n=t.state;Object.keys(n.elements).forEach(function(e){var i=n.styles[e]||{},r=n.attributes[e]||{},s=n.elements[e];!De(s)||!_e(s)||(Object.assign(s.style,i),Object.keys(r).forEach(function(a){var o=r[a];o===!1?s.removeAttribute(a):s.setAttribute(a,o===!0?"":o)}))})}function Vk(t){var n=t.state,e={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(n.elements.popper.style,e.popper),n.styles=e,n.elements.arrow&&Object.assign(n.elements.arrow.style,e.arrow),function(){Object.keys(n.elements).forEach(function(i){var r=n.elements[i],s=n.attributes[i]||{},a=Object.keys(n.styles.hasOwnProperty(i)?n.styles[i]:e[i]),o=a.reduce(function(l,c){return l[c]="",l},{});!De(r)||!_e(r)||(Object.assign(r.style,o),Object.keys(s).forEach(function(l){r.removeAttribute(l)}))})}}var fh={name:"applyStyles",enabled:!0,phase:"write",fn:jk,effect:Vk,requires:["computeStyles"]};function ze(t){return t.split("-")[0]}var Ut=Math.max,vi=Math.min,Ln=Math.round;function Or(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(n){return n.brand+"/"+n.version}).join(" "):navigator.userAgent}function Ns(){return!/^((?!chrome|android).)*safari/i.test(Or())}function Et(t,n,e){n===void 0&&(n=!1),e===void 0&&(e=!1);var i=t.getBoundingClientRect(),r=1,s=1;n&&De(t)&&(r=t.offsetWidth>0&&Ln(i.width)/t.offsetWidth||1,s=t.offsetHeight>0&&Ln(i.height)/t.offsetHeight||1);var a=St(t)?he(t):window,o=a.visualViewport,l=!Ns()&&e,c=(i.left+(l&&o?o.offsetLeft:0))/r,u=(i.top+(l&&o?o.offsetTop:0))/s,d=i.width/r,p=i.height/s;return{width:d,height:p,top:u,right:c+d,bottom:u+p,left:c,x:c,y:u}}function Li(t){var n=Et(t),e=t.
---`)},wikiLink:{replaceAction:Co,placeholder:"{WIKI_LINK_PLACEHOLDER}"},obsidianMultiLineComments:{replaceAction:Xm,placeholder:"{OBSIDIAN_COMMENT_PLACEHOLDER}"},footnoteAtStartOfLine:{replaceAction:Mo,placeholder:"{FOOTNOTE_AT_START_OF_LINE_PLACEHOLDER}"},footnoteAfterATask:{replaceAction:/- \[.] (\[\^\w+\]) ?([,.;!:?])/gm,placeholder:"{FOOTNOTE_AFTER_A_TASK_PLACEHOLDER}"},url:{replaceAction:zn,placeholder:"{URL_PLACEHOLDER}"},anchorTag:{replaceAction:nf,placeholder:"{ANCHOR_PLACEHOLDER}"},templaterCommand:{replaceAction:lf,placeholder:"{TEMPLATER_PLACEHOLDER}"},link:{replaceAction:kw,placeholder:"{REGULAR_LINK_PLACEHOLDER}"},tag:{replaceAction:ww,placeholder:"#tag-placeholder"},table:{replaceAction:vw,placeholder:"{TABLE_PLACEHOLDER}"},customIgnore:{replaceAction:Lw,placeholder:"{CUSTOM_IGNORE_PLACEHOLDER}"}};function Me(t,n,e){let i=[],r=[];for(let s of t){if(typeof s.replaceAction=="string")[r,n]=yw(n,s.placeholder,s.replaceAction);else if(s.replaceAction instanceof RegExp)[r,n]=bw(n,s.placeholder,s.replaceAction);else if(typeof s.replaceAction=="function"){let a=s.replaceAction;[r,n]=a(n,s.placeholder)}i.push(...r)}return n=e(n),i=i.reverse(),i!=null&&i.length>0&&i.forEach(s=>{n=n.replace(new RegExp(s.placeholder,"i"),it(s.replacedValue))}),n}function yw(t,n,e){let i=Ae(e,t),r=[];e==="list"&&(i=Aw(i));for(let a of i){let o=t.substring(a.start.offset,a.end.offset);r.push({placeholder:Oi(n),replacedValue:o})}let s=0;for(let a of i)t=ue(t,a.start.offset,a.end.offset,r[s++].placeholder);return r.reverse(),[r,t]}function bw(t,n,e){let i=[];return e.flags.includes("g")?t=t.replaceAll(e,r=>{let s=Oi(n);return i.push({placeholder:s,replacedValue:r}),s}):t=t.replace(e,r=>{let s=Oi(n);return i.push({placeholder:s,replacedValue:r}),s}),[i,t]}function kw(t,n){let e=Ae("link",t),i=[],r=[];for(let a of e){if(a==null)continue;let o=t.substring(a.start.offset,a.end.offset);o.match(ls)&&(r.push(a),i.push({placeholder:Oi(n),replacedValue:o}))}let s=0;for(let a of r)t=ue(t,a.start.offset,a.end.offset,i[s++].placeholder);return i.reverse(),[i,t]}function ww(t,n){let e=[];return t=t.replace(cs,(i,r,s)=>{let a=Oi(n);return e.push({placeholder:a,replacedValue:s}),r+a}),[e,t]}function vw(t,n){let e=lr(t),i=new Array(e.length),r=0,s=i.length;for(let o of e)i[s-1-r++]={placeholder:Oi(n),replacedValue:t.substring(o.startIndex,o.endIndex)};let a=s-1;for(let o of e)t=ue(t,o.startIndex,o.endIndex,i[a--].placeholder);return[i,t]}function Lw(t,n){let e=qm(t),i=new Array(e.length),r=0,s=i.length;for(let o of e)i[s-1-r++]={placeholder:Oi(n),replacedValue:t.substring(o.startIndex,o.endIndex)};let a=s-1;for(let o of e)t=ue(t,o.startIndex,o.endIndex,i[a--].placeholder);return[i,t]}function Aw(t){if(t.length<2)return t;let n=t.pop(),e=null,i=[n];for(;t.length>0;)e=t.pop(),(n.start.offset>=e.end.offset||e.start.offset>=n.end.offset)&&(i.unshift(e),n=e);return i}function Oi(t){if(t.includes("---"))return t;let n=Date.now().toString(36)+Math.random().toString(36).substring(2,10);return t.endsWith("}")?t.replace("}",n+"}"):t+n}var K=(a=>(a.YAML="YAML",a.HEADING="Heading",a.FOOTNOTE="Footnote",a.CONTENT="Content",a.SPACING="Spacing",a.PASTE="Paste",a))(K||{}),Kl=class{constructor(n,e,i,r,s,a,o=[],l=!1,c=[],u=null){this.nameKey=n;this.descriptionKey=e;this.settingsKey=i;this.alias=r;this.type=s;this.applyAfterIgnore=a;this.options=o;this.hasSpecialExecutionOrder=l;this.ignoreTypes=c;this.ruleHeading=this.getName().toLowerCase().replaceAll(" ","-"),o.unshift(new ti("enabled",this.descriptionKey,"",!1,r,(d,p)=>{if(d&&u&&u(d,p),o.length>1)for(let m=1;m<o.length;m++)d?o[m].unhide():o[m].hide()}));for(let d of o)d.ruleAlias=r}getDefaultOptions(){let n={};for(let e of this.options)n[e.configKey]=e.defaultValue;return n}getOptions(n){return n.ruleConfigs[this.settingsKey]}getName(){return E(this.nameKey)}getDescription(){return E(this.descriptionKey)}getURL(){return"https://platers.github.io/obsidian-linter/settings/"+this.type.toLowerCase()+"-rules/#"+this.ruleHeading}enabledOptionName(){return this.options[0].configKey}apply(n,e){return Me(this.ignoreTypes,n,i=>
[ ]{`+Math.min.apply(Math,r)+"}","g");i=i.map(function(o){return o.replace(s,`
`)})}i[0]=i[0].replace(/^\r?\n/,"");var a=i[0];return n.forEach(function(o,l){var c=a.match(/(?:^|\n)( *)$/),u=c?c[1]:"",d=o;typeof o=="string"&&o.includes(`
`)&&(d=String(o).split(`
`).map(function(p,m){return m===0?p:""+u+p}).join(`
`)),a+=d+i[l+1]}),a}var zh=Sw;var Cc=require("obsidian");var Ph=1e4,Dr,$s,ni,at=class at{static getRule(){if(!P(at,Dr).has(this.name)){let n=new this,e=new Kl(n.nameKey,n.descriptionKey,n.settingsKey,n.alias,n.type,n.safeApply.bind(n),n.optionBuilders.map(i=>i.option),n.hasSpecialExecutionOrder,n.ignoreTypes,n.disableConflictingOptions);P(at,Dr).set(this.name,e),P(at,$s).set(n.alias,n)}return P(at,Dr).get(this.name)}static applyIfEnabledBase(n,e,i,r){let s=n.getOptions(i);if(s[n.enabledOptionName()]){ui(n.alias);let a=Object.assign({},s,r);et(`${E("logs.run-rule-text")} ${n.getName()}`);try{let o=n.apply(e,a);return In(n.alias),o.length>Ph?et(o.slice(0,Ph-1)+"..."):et(o),[o,!0]}catch(o){In(n.alias),zl(o,n.getName())}}else return[e,!1]}static getBuilderByName(n){return P(at,$s).get(n)}static setNoSettingControl(n,e){P(at,ni).has(n)||P(at,ni).set(n,[]),P(at,ni).get(n).push(e)}static hasSettingControl(n,e){return!P(at,ni).has(n)||!P(at,ni).get(n).includes(e)}};Dr=new WeakMap,$s=new WeakMap,ni=new WeakMap,dt(at,Dr,new Map),dt(at,$s,new Map),dt(at,ni,new Map);var ii=at,k=class extends ii{constructor(n){super(),this.alias=n.nameKey.substring(6,n.nameKey.length-5),this.settingsKey=this.alias,this.nameKey=n.nameKey,this.descriptionKey=n.descriptionKey,this.type=n.type,this.hasSpecialExecutionOrder=n.hasSpecialExecutionOrder??!1,this.disableConflictingOptions=n.disableConflictingOptions??null,n.ruleIgnoreTypes?this.ignoreTypes=[y.customIgnore,...n.ruleIgnoreTypes]:this.ignoreTypes=[y.customIgnore]}static register(n){let e=n.getRule();Yh(e)}safeApply(n,e){return this.apply(n,this.buildRuleOptions(e))}buildRuleOptions(n){n=n??{};let e=new this.OptionsClass,i=Object.assign(e,n);for(let r of this.optionBuilders)r.setRuleOption(i,n);return i}static applyIfEnabled(n,e,i,r){let s=this.getRule();return i.includes(s.alias)?(et(s.alias+" "+E("logs.disabled-text")),[n,!1]):ii.applyIfEnabledBase(s,n,e,r)}static getRuleOptions(n){let e=ii.getRule.bind(this)(),i=new this,r=e.getOptions(n);return i.buildRuleOptions(r)}static noSettingControl(){return(n,e)=>{let i=n.constructor.name;ii.setNoSettingControl(i,e)}}};var Nr,Sn=class{constructor(n){dt(this,Nr);this.OptionsClass=n.OptionsClass;let e=n.nameKey.split(".");e.length==1?this.configKey=e[0]:this.configKey=e[e.length-2],this.nameKey=n.nameKey,this.descriptionKey=n.descriptionKey,this.optionsKey=n.optionsKey}get defaultValue(){return new this.OptionsClass()[this.optionsKey]}get option(){return P(this,Nr)||Ye(this,Nr,this.buildOption()),P(this,Nr)}setRuleOption(n,e){let i=e[this.configKey];i!==void 0&&(n[this.optionsKey]=i)}};Nr=new WeakMap;var $=class extends Sn{constructor(n){super(n),this.onChange=n.onChange??null}buildOption(){return new ti(this.configKey,this.nameKey,this.descriptionKey,this.defaultValue,null,this.onChange)}},Pl=class extends Sn{buildOption(){return new Hs(this.configKey,this.nameKey,this.descriptionKey,this.defaultValue)}},ne=class extends Sn{constructor(n){super(n),this.records=n.records.map(e=>new Dl("enums."+e.value,e.description))}buildOption(){return new Nl(this.configKey,this.nameKey,this.descriptionKey,this.defaultValue,this.records)}},ge=class extends Sn{constructor(n){super(n),this.separator=n.separator??`
`,this.splitter=n.splitter??/\n/}buildOption(){return new Rl(this.configKey,this.nameKey,this.descriptionKey,this.defaultValue.join(this.separator))}setRuleOption(n,e){if(e[this.configKey]!==void 0){let i=e[this.configKey].split(this.splitter).filter(function(r){return r!=""});n[this.optionsKey]=i}}},ye=class extends Sn{buildOption(){return new Hs(this.configKey,this.nameKey,this.descriptionKey,this.defaultValue)}},ql=class extends Sn{buildOption(){return new Fl(this.configKey,this.nameKey,this.descriptionKey,this.defaultValue)}},Hl=class extends Sn{buildOption(){return new Yl(this.configKey,this.nameKey,this.descriptionKey)}};var Ad=class{},ri=class extends k{constructor(){super({nameKey:"rules.add-blank-line-after-yaml.name",descriptionKey:"rules.add-blank-line-after-yaml.description",type:"YAML",hasSpecialExecutionOrder:!0})}get OptionsClass(){return Ad}apply(n,e){let i=n.match(He);if(i===null)return n;let r=i[0],s=n.indexOf(r)+r.length;return s+1>=n.length||n.trimEnd()===r.trimEnd()||n.charAt(s+1)===`
`?n:n.replace(r,r+`
`)}get optionBuilders(){return[]}};ri=x([k.register],ri);var Ci=class{constructor(){this.ignoreWords=[];this.extraAutoCorrectFiles=[];this.skipWordsWithMultipleCapitals=!1;this.misspellingToCorrection=new Map}};x([k.noSettingControl()],Ci.prototype,"misspellingToCorrection",2);var Ii=class extends k{constructor(){super({nameKey:"rules.auto-correct-common-misspellings.name",descriptionKey:"rules.auto-correct-common-misspellings.description",type:"Content",hasSpecialExecutionOrder:!0,ruleIgnoreTypes:[y.yaml,y.code,y.inlineCode,y.math,y.inlineMath,y.link,y.wikiLink,y.tag,y.image,y.url]})}get OptionsClass(){return Ci}apply(n,e){return n.replaceAll(rf,i=>this.replaceWordWithCorrectCasing(i,e))}replaceWordWithCorrectCasing(n,e){let i=n.toLowerCase();if(e.ignoreWords.includes(i)||e.skipWordsWithMultipleCapitals&&n.length>1&&i.substring(1)!==n.substring(1))return n;if(e.misspellingToCorrection.has(i))return this.determineCorrectedWord(n,e.misspellingToCorrection.get(i));if(e.extraAutoCorrectFiles){for(let r=0;r<e.extraAutoCorrectFiles.length;r++)if(e.extraAutoCorrectFiles[r].customReplacements instanceof Map&&e.extraAutoCorrectFiles[r].customReplacements?.has(i))return this.determineCorrectedWord(n,e.extraAutoCorrectFiles[r].customReplacements.get(i))}return n}determineCorrectedWord(n,e){return n.charAt(0)==n.charAt(0).toUpperCase()&&(e=e.charAt(0).toUpperCase()+e.substring(1)),e}get optionBuilders(){return[new ge({OptionsClass:Ci,nameKey:"rules.auto-correct-common-misspellings.ignore-words.name",descriptionKey:"rules.auto-correct-common-misspellings.ignore-words.description",optionsKey:"ignoreWords",splitter:us,separator:", "}),new $({OptionsClass:Ci,nameKey:"rules.auto-correct-common-misspellings.skip-words-with-multiple-capitals.name",descriptionKey:"rules.auto-correct-common-misspellings.skip-words-with-multiple-capitals.description",optionsKey:"skipWordsWithMultipleCapitals"}),new Hl({OptionsClass:Ci,nameKey:"rules.auto-correct-common-misspellings.extra-auto-correct-files.name",descriptionKey:"rules.auto-correct-common-misspellings.extra-auto-correct-files.description",optionsKey:"extraAutoCorrectFiles"})]}};Ii=x([k.register],Ii);var $l=class{constructor(){this.style="space"}},Bi=class extends k{constructor(){super({nameKey:"rules.blockquote-style.name",descriptionKey:"rules.blockquote-style.description",type:"Content",hasSpecialExecutionOrder:!0,ruleIgnoreTypes:[y.html,y.code,y.math]})}get OptionsClass(){return $l}apply(n,e){return e.style==="space"?Mu(n,i=>this.updateBlockquoteLines(i,this.addSpaceToIndicator)):Mu(n,i=>this.updateBlockquoteLines(i,this.removeSpaceFromIndicator))}removeSpaceFromIndicator(n,e){return e?n.replace(/>[ \t]+>/g,">>"):n.replace(/>[ \t]+/g,">")}addSpaceToIndicator(n,e){let i=n.replace(/>([^ ]|$)/g,"> $1").replace(/>>/g,"> >");return e?i:i.replace(/>(?:[ \t]{2,}|\t+)/g,"> ")}updateBlockquoteLines(n,e){let i=0,r=0,s="",a="",o=0,l=n,c=!1,u=new RegExp(y.math.placeholder.replace("}",".+}"),""),d=new RegExp(y.code.placeholder.replace("}",".+}"),"");do{r=l.indexOf(`
`,i),r===-1&&(r=l.length-1,c=!0),[s,o]=sr(l,r-1);let p=o+s.length+1,m=r;c&&m++;let f=l.substring(p,m);if(f.match(u)||f.match(d)){i++;continue}let h=Oo.test(f);a=e(s,h),o++,l=ue(l,o,o+s.length,a),i=r+1+a.length-s.length}while(!c);return l}get optionBuilders(){return[new ne({OptionsClass:$l,nameKey:"rules.blockquote-style.style.name",descriptionKey:"rules.blockquote-style.style.description",optionsKey:"style",records:[{value:"space",description:"> indicator is followed by a space"},{value:"no space",description:">indicator is not followed by a space"}]})]}};Bi=x([k.register],Bi);var Ul=class{};x([k.noSettingControl()],Ul.prototype,"lineContent",2);var Ri=class extends k{constructor(){super({nameKey:"rules.add-blockquote-indentation-on-paste.name",descriptionKey:"rules.add-blockquote-indentation-on-paste.description",type:"Paste"})}get OptionsClass(){return Ul}apply(n,e){let i=/^(\s*)((> ?)+) .*/,r=e.lineContent.match(i);if(!r)return n;let s=r[1]??"",a=r[2]??"";return n.trim().replace(/\n/gm,`
${s}${a} `)}get optionBuilders(){return[]}};Ri=x([k.register],Ri);var En=class{constructor(){this.style="Title Case";this.ignoreWords=["macOS","iOS","iPhone","iPad","JavaScript","TypeScript","AppleScript","I"];this.lowercaseWords=["a","an","the","aboard","about","abt.","above","abreast","absent","across","after","against","along","aloft","alongside","amid","amidst","mid","midst","among","amongst","anti","apropos","around","round","as","aslant","astride","at","atop","ontop","bar","barring","before","B4","behind","below","beneath","neath","beside","besides","between","'tween","beyond","but","by","chez","circa","c.","ca.","come","concerning","contra","counting","cum","despite","spite","down","during","effective","ere","except","excepting","excluding","failing","following","for","from","in","including","inside","into","less","like","minus","modulo","mod","near","nearer","nearest","next","notwithstanding","of","o'","off","offshore","on","onto","opposite","out","outside","over","o'er","pace","past","pending","per","plus","post","pre","pro","qua","re","regarding","respecting","sans","save","saving","short","since","sub","than","through","thru","throughout","thruout","till","times","to","t'","touching","toward","towards","under","underneath","unlike","until","unto","up","upon","versus","vs.","v.","via","vice","vis-\xE0-vis","wanting","with","w/","w.","c\u0304","within","w/i","without","'thout","w/o","abroad","adrift","aft","afterward","afterwards","ahead","apart","ashore","aside","away","back","backward","backwards","beforehand","downhill","downstage","downstairs","downstream","downward","downwards","downwind","east","eastward","eastwards","forth","forward","forwards","heavenward","heavenwards","hence","henceforth","here","hereby","herein","hereof","hereto","herewith","home","homeward","homewards","indoors","inward","inwards","leftward","leftwards","north","northeast","northward","northwards","northwest","now","onward","onwards","outdoors","outward","outwards","overboard","overhead","overland","overseas","rightward","rightwards","seaward","seawards","skywards","skyward","south","southeast","southwards","southward","southwest","then","thence","thenceforth","there","thereby","therein","thereof","thereto","therewith","together","underfoot","underground","uphill","upstage","upstairs","upstream","upward","upwards","upwind","west","westward","westwards","when","whence","where","whereby","wherein","whereto","wherewith","although","because","considering","given","granted","if","lest","once","provided","providing","seeing","so","supposing","though","unless","whenever","whereas","wherever","while","whilst","ago","inasmuch","even","whether","whose","whoever","why","how","whatever","what","both","and","or","either","neither","nor","just","rather","such","that","yet","is","it"];this.startingWordIgnoreCharacters=`'"(\u2018\u201C-`;this.endingWordIgnoreCharacters=`.?!,:;'")\u201D\u20190123456789-`;this.ignoreCasedWords=!0}},Fi=class extends k{constructor(){super({nameKey:"rules.capitalize-headings.name",descriptionKey:"rules.capitalize-headings.description",type:"Heading",hasSpecialExecutionOrder:!0,ruleIgnoreTypes:[y.code,y.inlineCode,y.yaml,y.link,y.wikiLink,y.tag]})}get OptionsClass(){return En}apply(n,e){return n.replace(_n,i=>{if(e.style==="ALL CAPS")return i.toUpperCase();let r=e.style==="First letter",s=i.match(ef);if(!s)return i;let a=e.startingWordIgnoreCharacters?.length==0?"":`[${mt(e.startingWordIgnoreCharacters)}]?`,o=e.endingWordIgnoreCharacters?.length==0?"":`[${mt(e.endingWordIgnoreCharacters)}]*`,l=new RegExp(`^${a}[\\p{L}\u2019'-]{1,}${o}$`,"u"),c=e.ignoreWords,u=e.lowercaseWords,d=0,p=!0;for(let m=1;m<s.length;m++){if(!s[m].match(l)||s[m]==="-"||s[m]==="'")continue;if(e.startingWordIgnoreCharacters?.includes(s[m][0])&&(d=1),e.ignoreCasedWords&&s[m]!==s[m].toLowerCase()||c.includes(s[m])||(s[m]=s[m].toLowerCase(),(!u.includes(s[m])&&!r||p===!0)&&(d===0?s[m]=s[m][d].toUpperCase()+s[m].slice(d+1):s[m]=s[m][0]+s[m][d].toUpperCase()+s[m].slice(d+1))),p=!1,e.ignoreCasedWords&&r)break}return s.join(" ")})}get optionBuilders(){retu
`),i=i.replace(/\n+---/,`
---`),e.innerNewLines&&(i=i.replaceAll(/\n{2,}/g,`
`)),i))}get optionBuilders(){return[new $({OptionsClass:jl,nameKey:"rules.compact-yaml.inner-new-lines.name",descriptionKey:"rules.compact-yaml.inner-new-lines.description",optionsKey:"innerNewLines"})]}};Us=x([k.register],Us);var Sd=class{},Di=class extends k{constructor(){super({nameKey:"rules.consecutive-blank-lines.name",descriptionKey:"rules.consecutive-blank-lines.description",type:"Spacing",ruleIgnoreTypes:[y.code,y.math,y.yaml,y.link,y.wikiLink,y.tag],hasSpecialExecutionOrder:!0})}get OptionsClass(){return Sd}apply(n,e){return n.replace(Ro,`
`)}get optionBuilders(){return[]}};Di=x([k.register],Di);var Ed=class{},js=class extends k{constructor(){super({nameKey:"rules.convert-bullet-list-markers.name",descriptionKey:"rules.convert-bullet-list-markers.description",type:"Content",ruleIgnoreTypes:[y.code,y.math,y.yaml,y.link,y.wikiLink,y.tag]})}get OptionsClass(){return Ed}apply(n,e){return n.replace(/^([^\S\n]*)([•§])([^\S\n]*)/gm,"$1-$3")}get optionBuilders(){return[]}};js=x([k.register],js);var Vl=class{constructor(){this.tabsize=4}},Vs=class extends k{constructor(){super({nameKey:"rules.convert-spaces-to-tabs.name",descriptionKey:"rules.convert-spaces-to-tabs.description",type:"Spacing",ruleIgnoreTypes:[y.code,y.math,y.yaml,y.link,y.wikiLink,y.tag]})}get OptionsClass(){return Vl}apply(n,e){let i=String(e.tabsize),r=new RegExp("^( *) {"+i+"}","gm");n=this.replaceAllRegexMatches(n,r);let s=new RegExp("^((>( | *))*(>( | )) *) {"+i+"}","gm");return n=this.replaceAllRegexMatches(n,s),n}replaceAllRegexMatches(n,e){for(;n.match(e)!=null;)n=n.replace(e,"$1 ");return n}get optionBuilders(){return[new Pl({OptionsClass:Vl,nameKey:"rules.convert-spaces-to-tabs.tabsize.name",descriptionKey:"rules.convert-spaces-to-tabs.tabsize.description",optionsKey:"tabsize"})]}};Vs=x([k.register],Vs);var Wt=class{constructor(){this.aliasArrayStyle="single-line";this.dedupeAliasKey=!0;this.tagArrayStyle="single-line";this.dedupeTagKey=!0;this.dedupeArrayKeys=!0;this.ignoreDedupeArrayKeys=[];this.defaultEscapeCharacter='"';this.removeUnnecessaryEscapeCharsForMultiLineArrays=!1}};x([k.noSettingControl()],Wt.prototype,"aliasArrayStyle",2),x([k.noSettingControl()],Wt.prototype,"tagArrayStyle",2),x([k.noSettingControl()],Wt.prototype,"defaultEscapeCharacter",2),x([k.noSettingControl()],Wt.prototype,"removeUnnecessaryEscapeCharsForMultiLineArrays",2);var Ws=class extends k{constructor(){super({nameKey:"rules.dedupe-yaml-array-values.name",descriptionKey:"rules.dedupe-yaml-array-values.description",type:"YAML"})}get OptionsClass(){return Wt}apply(n,e){return Ee(n,i=>{let r=gt(i.replace(`---
`,"").replace(`
---`,""));if(!r)return i;for(let s of $t)if(e.dedupeAliasKey&&Object.keys(r).includes(s)){i=de(i,s,xe(Qn(this.getUniqueArray(Ke(we(i,s)))),e.aliasArrayStyle,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays,!0));break}for(let s of Ht)if(e.dedupeTagKey&&Object.keys(r).includes(s)){i=de(i,s,xe(Gn(this.getUniqueArray(Ke(we(i,s)))),e.tagArrayStyle,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays));break}if(e.dedupeArrayKeys){let s=[...$t,...Ht,...e.ignoreDedupeArrayKeys];for(let a of Object.keys(r)){if(s.includes(a)||!Array.isArray(r[a])||r[a].length!==0&&typeof r[a][0]=="object"&&r[a][0]!==null)continue;let o=we(i,a),l="single-line";o.includes(`
`)&&(l="multi-line");let c=this.getUniqueArray(Ke(o));i=de(i,a,xe(c,l,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays))}}return i})}getUniqueArray(n){return n==null||typeof n=="string"||n.length<=1?n:[...new Set(n)]}get optionBuilders(){return[new $({OptionsClass:Wt,nameKey:"rules.dedupe-yaml-array-values.dedupe-alias-key.name",descriptionKey:"rules.dedupe-yaml-array-values.dedupe-alias-key.description",optionsKey:"dedupeAliasKey"}),new $({OptionsClass:Wt,nameKey:"rules.dedupe-yaml-array-values.dedupe-tag-key.name",descriptionKey:"rules.dedupe-yaml-array-values.dedupe-tag-key.description",optionsKey:"dedupeTagKey"}),new $({OptionsClass:Wt,nameKey:"rules.dedupe-yaml-array-values.dedupe-array-keys.name",descriptionKey:"rules.dedupe-yaml-array-values.dedupe-array-keys.description",optionsKey:"dedupeArrayKeys"}),new ge({OptionsClass:Wt,nameKey:"rules.dedupe-yaml-array-values.ignore-keys.name",descriptionKey:"rules.dedupe-yaml-array-values.ignore-keys.description",optionsKey:"ignoreDedupeArrayKeys"})]}};Ws=x([k.register],Ws);var Wl=class{constructor(){this.defaultLanguage=""}},Gs=class extends k{constructor(){super({nameKey:"rules.default-language-for-code-fences.name",descriptionKey:"rules.default-language-for-code-fences.description",type:"Content",ruleIgnoreTypes:[y.yaml,y.math,y.link,y.wikiLink,y.tag]})}get OptionsClass(){return Wl}apply(n,e){return Hm(n,e.defaultLanguage)}get optionBuilders(){return[new ye({OptionsClass:Wl,nameKey:"rules.default-language-for-code-fences.default-language.name",descriptionKey:"rules.default-language-for-code-fences.default-language.description",optionsKey:"defaultLanguage"})]}};Gs=x([k.register],Gs);var Gl=class{constructor(){this.style="consistent"}},Qs=class extends k{constructor(){super({nameKey:"rules.emphasis-style.name",descriptionKey:"rules.emphasis-style.description",type:"Content",ruleIgnoreTypes:[y.code,y.math,y.yaml,y.link,y.wikiLink,y.tag,y.inlineMath]})}get OptionsClass(){return Gl}apply(n,e){return xo(n,e.style,"emphasis")}get optionBuilders(){return[new ne({OptionsClass:Gl,nameKey:"rules.emphasis-style.style.name",descriptionKey:"rules.emphasis-style.style.description",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"}]})]}};Qs=x([k.register],Qs);var Td=class{},Zs=class extends k{constructor(){super({nameKey:"rules.empty-line-around-blockquotes.name",descriptionKey:"rules.empty-line-around-blockquotes.description",type:"Spacing"})}get OptionsClass(){return Td}apply(n,e){return Ym(n)}get optionBuilders(){return[]}};Zs=x([k.register],Zs);var xd=class{},Js=class extends k{constructor(){super({nameKey:"rules.empty-line-around-code-fences.name",descriptionKey:"rules.empty-line-around-code-fences.description",type:"Spacing"})}get OptionsClass(){return xd}apply(n,e){return Dm(n)}get optionBuilders(){return[]}};Js=x([k.register],Js);var Od=class{},Xs=class extends k{constructor(){super({nameKey:"rules.empty-line-around-horizontal-rules.name",descriptionKey:"rules.empty-line-around-horizontal-rules.description",type:"Spacing"})}get OptionsClass(){return Od}apply(n,e){return Km(n)}get optionBuilders(){return[]}};Xs=x([k.register],Xs);var Ql=class{constructor(){this.minimumNumberOfDollarSignsToBeAMathBlock=2}};x([k.noSettingControl()],Ql.prototype,"minimumNumberOfDollarSignsToBeAMathBlock",2);var ea=class extends k{constructor(){super({nameKey:"rules.empty-line-around-math-blocks.name",descriptionKey:"rules.empty-line-around-math-blocks.description",type:"Spacing",ruleIgnoreTypes:[y.yaml,y.code]})}get OptionsClass(){return Ql}apply(n,e){return Nm(n,e.minimumNumberOfDollarSignsToBeAMathBlock)}get optionBuilders(){return[]}};ea=x([k.register],ea);var Md=class{},ta=class extends k{constructor(){super({nameKey:"rules.empty-line-around-tables.name",descriptionKey:"rules.empty-line-around-tables.description",type:"
`),s=r.length;if(s<1)return i;for(let a=0;a<s;a++){let o=r[a].trim(),l=o.indexOf(":"),c=l<0||l+1>=o.length,u=o.startsWith("-"),d=u&&o.length<2;if(c&&d)continue;let p=1;if(!u)p+=l;else if(l!==-1&&a+1<s){let f=r[a],h=f.indexOf("-")+1;for(;h<f.length&&f.charAt(h)===" ";)h++;let g=0,b=r[a+1];for(;g<b.length&&b.charAt(g)===" ";)g++;h<=g&&(p+=l)}let m=o.substring(p).trim();if(m.startsWith("[")){if(e.tryToEscapeSingleLineArrays){if(m.length<3)continue;let f=m.substring(1,m.length-1).split(","),h=f.length;for(let g=0;g<h;g++){let b=f[g].trim();b.startsWith("[")&&(b=b.substring(1).trimStart()),b.endsWith("]")&&(b=b.substring(0,b.length-1).trimEnd()),f[g]=f[g].replace(b,ht(b,e.defaultEscapeCharacter,!1,!0))}r[a]=r[a].replace(m,"["+f.join(",")+"]")}continue}r[a]=r[a].replace(m,ht(m,e.defaultEscapeCharacter,!1,!0))}return r.join(`
`)})}get optionBuilders(){return[new $({OptionsClass:na,nameKey:"rules.escape-yaml-special-characters.try-to-escape-single-line-arrays.name",descriptionKey:"rules.escape-yaml-special-characters.try-to-escape-single-line-arrays.description",optionsKey:"tryToEscapeSingleLineArrays"})]}};Ni=x([k.register],Ni);var qh=require("obsidian");var ln=class extends qh.Modal{constructor(n,e,i,r,s){super(n),this.modalEl.addClass("confirm-modal"),this.contentEl.createEl("h3",{text:E("warning-text"),cls:"modal-heading"});let a=this.contentEl.createEl("p");a.id="confirm-dialog",ct(E("disabled-other-rule-notice").replace("{NAME_1}",E(e)).replace("{NAME_2}",E(i)),a),this.contentEl.createDiv("modal-button-container",o=>{o.createEl("button",{text:E("cancel-button-text")}).addEventListener("click",()=>{s(),this.close()});let l=o.createEl("button",{attr:{type:"submit"},cls:"mod-cta",text:E("ok")});l.addEventListener("click",()=>{this.close(),r()}),setTimeout(()=>{l.focus()},50)})}};var Zl=class{};x([k.noSettingControl()],Zl.prototype,"fileName",2);var ia=class extends k{constructor(){super({nameKey:"rules.file-name-heading.name",descriptionKey:"rules.file-name-heading.description",type:"Heading",ruleIgnoreTypes:[y.code,y.math,y.yaml,y.link,y.wikiLink,y.tag],disableConflictingOptions(n,e){let i=yt["header-increment"],r=i.options[0],s=i.options[1];n&&r.getValue()&&new ln(e,"rules.file-name-heading.name","rules.header-increment.start-at-h2.name",()=>{s.setValue(!1)},()=>{yt["file-name-heading"].options[0].setValue(!1)}).open()}})}get OptionsClass(){return Zl}apply(n,e){if(n.match(/^#\s.*/m))return n;let r=e.fileName,s=n.indexOf(`
---`);s=s==-1||!n.startsWith(`---
`)?0:s+5;let a=`# ${zp(r)}
`;return n.length<s&&(a=`
`+a),di(n,s,a)}get optionBuilders(){return[]}};ia=x([k.register],ia);var Cd=class{},ra=class extends k{constructor(){super({nameKey:"rules.footnote-after-punctuation.name",descriptionKey:"rules.footnote-after-punctuation.description",type:"Footnote",ruleIgnoreTypes:[y.code,y.inlineCode,y.math,y.yaml,y.link,y.wikiLink,y.tag,y.footnoteAtStartOfLine,y.footnoteAfterATask]})}get OptionsClass(){return Cd}apply(n,e){return n.replace(/(\[\^[^\]]+\]) ?([,.;!:?])/gm,"$2$1")}get optionBuilders(){return[]}};ra=x([k.register],ra);var sa=class{constructor(){this.defaultEscapeCharacter='"';this.forceYamlEscape=[]}};x([k.noSettingControl()],sa.prototype,"defaultEscapeCharacter",2);var Yi=class extends k{constructor(){super({nameKey:"rules.force-yaml-escape.name",descriptionKey:"rules.force-yaml-escape.description",type:"YAML",hasSpecialExecutionOrder:!0})}get OptionsClass(){return sa}apply(n,e){return Ee(n,i=>{for(let r of e.forceYamlEscape){let s=we(i,r);if(s!=null){if(s.includes(`
`)||s.startsWith(" [")||Wn(s))continue;s=ht(s,e.defaultEscapeCharacter,!0),i=de(i,r," "+s)}}return i})}get optionBuilders(){return[new ge({OptionsClass:sa,nameKey:"rules.force-yaml-escape.force-yaml-escape-keys.name",descriptionKey:"rules.force-yaml-escape.force-yaml-escape-keys.description",optionsKey:"forceYamlEscape"})]}};Yi=x([k.register],Yi);var Id=class{},Ki=class extends k{constructor(){super({nameKey:"rules.format-tags-in-yaml.name",descriptionKey:"rules.format-tags-in-yaml.description",type:"YAML",hasSpecialExecutionOrder:!0})}get OptionsClass(){return Id}apply(n,e){return Ee(n,i=>i.replace(new RegExp(`^(${Fs}|${id}):[ \\t]*(\\S.*|(?:(?:\\n *- \\S.*)|((?:\\n *- *))*|(\\n([ \\t]+[^\\n]*))*)*)\\n`,"m"),function(r){return r.replaceAll("#","")}))}get optionBuilders(){return[]}};Ki=x([k.register],Ki);var bt=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=[];this.defaultEscapeCharacter='"';this.removeUnnecessaryEscapeCharsForMultiLineArrays=!1}};x([k.noSettingControl()],bt.prototype,"aliasArrayStyle",2),x([k.noSettingControl()],bt.prototype,"tagArrayStyle",2),x([k.noSettingControl()],bt.prototype,"defaultEscapeCharacter",2),x([k.noSettingControl()],bt.prototype,"removeUnnecessaryEscapeCharsForMultiLineArrays",2);var aa=class extends k{constructor(){super({nameKey:"rules.format-yaml-array.name",descriptionKey:"rules.format-yaml-array.description",type:"YAML"})}get OptionsClass(){return bt}apply(n,e){return Ee(n,i=>{let r=gt(i.replace(`---
`,"").replace(`
---`,""));if(!r)return i;for(let s of $t)if(e.formatAliasKey&&Object.keys(r).includes(s)){i=de(i,s,xe(Qn(Ke(we(i,s))),e.aliasArrayStyle,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays,!0));break}for(let s of Ht)if(e.formatTagKey&&Object.keys(r).includes(s)){i=de(i,s,xe(Gn(Ke(we(i,s))),e.tagArrayStyle,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays));break}if(e.formatArrayKeys){let s=[...$t,...Ht,...e.forceMultiLineArrayStyle,...e.forceSingleLineArrayStyle];for(let a of Object.keys(r))s.includes(a)||!Array.isArray(r[a])||r[a].length!==0&&typeof r[a][0]=="object"&&r[a][0]!==null||(i=de(i,a,xe(Ke(we(i,a)),e.defaultArrayStyle,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays)))}for(let s of e.forceSingleLineArrayStyle)Object.keys(r).includes(s)&&(i=de(i,s,xe(Ke(we(i,s)),"single-line",e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays)));for(let s of e.forceMultiLineArrayStyle)Object.keys(r).includes(s)&&(i=de(i,s,xe(Ke(we(i,s)),"multi-line",e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays)));return i})}get optionBuilders(){return[new $({OptionsClass:bt,nameKey:"rules.format-yaml-array.alias-key.name",descriptionKey:"rules.format-yaml-array.alias-key.description",optionsKey:"formatAliasKey"}),new $({OptionsClass:bt,nameKey:"rules.format-yaml-array.tag-key.name",descriptionKey:"rules.format-yaml-array.tag-key.description",optionsKey:"formatTagKey"}),new ne({OptionsClass:bt,nameKey:"rules.format-yaml-array.default-array-style.name",descriptionKey:"rules.format-yaml-array.default-array-style.description",optionsKey:"defaultArrayStyle",records:[{value:"multi-line",description:"```key:\\n - value```"},{value:"single-line",description:"```key: [value]```"}]}),new $({OptionsClass:bt,nameKey:"rules.format-yaml-array.default-array-keys.name",descriptionKey:"rules.format-yaml-array.default-array-keys.description",optionsKey:"formatArrayKeys"}),new ge({OptionsClass:bt,nameKey:"rules.format-yaml-array.force-single-line-array-style.name",descriptionKey:"rules.format-yaml-array.force-single-line-array-style.description",optionsKey:"forceSingleLineArrayStyle"}),new ge({OptionsClass:bt,nameKey:"rules.format-yaml-array.force-multi-line-array-style.name",descriptionKey:"rules.format-yaml-array.force-multi-line-array-style.description",optionsKey:"forceMultiLineArrayStyle"})]}};aa=x([k.register],aa);var Jl=class{constructor(){this.startAtH2=!1}},oa=class extends k{constructor(){super({nameKey:"rules.header-increment.name",descriptionKey:"rules.header-increment.description",type:"Heading",ruleIgnoreTypes:[y.code,y.math,y.yaml,y.link,y.wikiLink,y.tag]})}get OptionsClass(){return Jl}apply(n,e){let i=0,r=e.startAtH2?2:1,s=[],a=[0,0,0,0,0,0],o=a.length;return n.replace(_n,(l,c="",u="",d="",p="",m="")=>{let f=u.length;if(f=f<=o?f:o,a[f-1]>=0&&f<i){let h=a.length;for(;s.length!==0&&f<=s[s.length-1];)h=s.pop();s.length===0?h=0:h--;for(let g=a.length-1;g>=h;g--)a[g]=0}if(a[f-1]<=0){let h=i,g=s.length+r;g=g<=o?g:o;for(let b=h;b<f-1;b++)a[b]=g-1;s.push(f),a[f-1]=g}return i=f,c+"#".repeat(a[f-1])+d+p+m})}get optionBuilders(){return[new $({OptionsClass:Jl,nameKey:"rules.header-increment.start-at-h2.name",descriptionKey:"rules.header-increment.start-at-h2.description",optionsKey:"startAtH2",onChange(n,e){let i=yt["file-name-heading"].options[0];n&&i.getValue()&&new ln(e,"rules.header-increment.start-at-h2.name","rules.file-name-heading.name",()=>{i.setValue(!1)},()=>{yt["header-increment"].options[1].setValue(!1)}).open()}})]}};oa=x([k.register],oa);var ca=class{constructor(){this.bottom=!0;this.emptyLineAfterYaml=!0}},la=class extends k{constructor(){super({nameKey:"rules.heading-blank-lines.name",descriptionKey:"rules.heading-blank-lines.description",type:"Spacing",ruleIgnoreTypes:[y.code,y.math,y.yaml,y.link,y.wikiLink]})}get OptionsClass(){return ca}apply(n,e){return e.bottom?(n=n.replace(/^(#+\s.*)/gm,`
$1
`),n=n.replace(/\n+(#+\s.*)/g,`
$1`),n=n.replace(/(^#+\s.*)\n+/gm,`$1
`)):n=n.replace(/^([^#\n][^\n]+)\n+(#+\s.*)/gm,`$1
$2`),n=n.replace(/^\n+(#+\s.*)/,"$1"),n=n.replace(/(#+\s.*)\n+$/,"$1"),e.emptyLineAfterYaml||(n=n.replace(new RegExp("("+He.source+")\\n+(#+\\s.*)"),`$1
$5`)),n}get optionBuilders(){return[new $({OptionsClass:ca,nameKey:"rules.heading-blank-lines.bottom.name",descriptionKey:"rules.heading-blank-lines.bottom.description",optionsKey:"bottom"}),new $({OptionsClass:ca,nameKey:"rules.heading-blank-lines.empty-line-after-yaml.name",descriptionKey:"rules.heading-blank-lines.empty-line-after-yaml.description",optionsKey:"emptyLineAfterYaml"})]}};la=x([k.register],la);var Bd=class{},ua=class extends k{constructor(){super({nameKey:"rules.headings-start-line.name",descriptionKey:"rules.headings-start-line.description",type:"Heading",ruleIgnoreTypes:[y.code,y.math,y.yaml]})}get OptionsClass(){return Bd}apply(n,e){return n.replaceAll(_n,i=>i.trimStart())}get optionBuilders(){return[]}};ua=x([k.register],ua);var Xl=class{constructor(){this.textToInsert=["aliases: ","tags: "]}},da=class extends k{constructor(){super({nameKey:"rules.insert-yaml-attributes.name",descriptionKey:"rules.insert-yaml-attributes.description",type:"YAML"})}get OptionsClass(){return Xl}apply(n,e){return n=an(n),Ee(n,i=>{let r=e.textToInsert.reverse(),s=gt(i.match(He)[1]);for(let a of r){let o=a.split(":")[0];Object.prototype.hasOwnProperty.call(s,o)||(i=i.replace(/^---\n/,it(`---
${a}
`)))}return i})}get optionBuilders(){return[new ge({OptionsClass:Xl,nameKey:"rules.insert-yaml-attributes.text-to-insert.name",descriptionKey:"rules.insert-yaml-attributes.text-to-insert.description",optionsKey:"textToInsert"})]}};da=x([k.register],da);var Rd=class{},pa=class extends k{constructor(){super({nameKey:"rules.line-break-at-document-end.name",descriptionKey:"rules.line-break-at-document-end.description",type:"Spacing"})}get OptionsClass(){return Rd}apply(n,e){return n.length===0||(n=n.replace(/\n+$/g,""),n+=`
`),n}get optionBuilders(){return[]}};pa=x([k.register],pa);var ec=class{constructor(){this.includeBlankLineBetweenFootnotes=!1}},ma=class extends k{constructor(){super({nameKey:"rules.move-footnotes-to-the-bottom.name",descriptionKey:"rules.move-footnotes-to-the-bottom.description",type:"Footnote",ruleIgnoreTypes:[y.code,y.inlineCode,y.math,y.yaml]})}get OptionsClass(){return ec}apply(n,e){return Om(n,e.includeBlankLineBetweenFootnotes)}get optionBuilders(){return[new $({OptionsClass:ec,nameKey:"rules.move-footnotes-to-the-bottom.include-blank-line-between-footnotes.name",descriptionKey:"rules.move-footnotes-to-the-bottom.include-blank-line-between-footnotes.description",optionsKey:"includeBlankLineBetweenFootnotes"})]}};ma=x([k.register],ma);var tc=class{constructor(){this.minimumNumberOfDollarSignsToBeAMathBlock=2}};x([k.noSettingControl()],tc.prototype,"minimumNumberOfDollarSignsToBeAMathBlock",2);var _i=class extends k{constructor(){super({nameKey:"rules.move-math-block-indicators-to-their-own-line.name",descriptionKey:"rules.move-math-block-indicators-to-their-own-line.description",type:"Spacing",ruleIgnoreTypes:[y.code,y.inlineCode],hasSpecialExecutionOrder:!0})}get OptionsClass(){return tc}apply(n,e){return Pm(n,e.minimumNumberOfDollarSignsToBeAMathBlock)}get optionBuilders(){return[]}};_i=x([k.register],_i);var si=class{constructor(){this.tagArrayStyle="single-line";this.howToHandleExistingTags="Nothing";this.tagsToIgnore=[];this.defaultEscapeCharacter='"';this.removeUnnecessaryEscapeCharsForMultiLineArrays=!1}};x([k.noSettingControl()],si.prototype,"tagArrayStyle",2),x([k.noSettingControl()],si.prototype,"defaultEscapeCharacter",2),x([k.noSettingControl()],si.prototype,"removeUnnecessaryEscapeCharsForMultiLineArrays",2);var fa=class extends k{constructor(){super({nameKey:"rules.move-tags-to-yaml.name",descriptionKey:"rules.move-tags-to-yaml.description",type:"YAML",ruleIgnoreTypes:[y.code,y.inlineCode,y.math,y.html,y.wikiLink,y.link]})}get OptionsClass(){return si}apply(n,e){let i;return Me([y.yaml],n,r=>(i=pf(r),r)),i.length===0||(n=an(n),n=Ee(n,r=>{r=r.replace(`---
`,"").replace("---","");let s=[],a=Fs;for(let c of Ht){let u=we(r,c);if(u!=null){s=Gn(Ke(u)),a=c;break}}let o=new Set;if(typeof s=="string")o.add(s),s=[s];else if(s!=null)for(let c of s)o.add(c);else s=[];for(let c of i){let u=c.trim().substring(1);!o.has(u)&&!e.tagsToIgnore.includes(u)&&(o.add(u),s.push(u))}return`---
${de(r,a,xe(s,e.tagArrayStyle,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays))}---`}),n=Me([y.yaml],n,r=>(e.howToHandleExistingTags!=="Nothing"&&(r=r.replace(cs,s=>{let a=s.indexOf("#"),o=s.substring(a+1);return e.tagsToIgnore.includes(o)?s:e.howToHandleExistingTags==="Remove hashtag"?s.substring(0,a)+o:""})),r)),n=n.replace(/(\n---)( |\t)+/,"$1")),n}get optionBuilders(){return[new ne({OptionsClass:si,nameKey:"rules.move-tags-to-yaml.how-to-handle-existing-tags.name",descriptionKey:"rules.move-tags-to-yaml.how-to-handle-existing-tags.description",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 ge({OptionsClass:si,nameKey:"rules.move-tags-to-yaml.tags-to-ignore.name",descriptionKey:"rules.move-tags-to-yaml.tags-to-ignore.description",optionsKey:"tagsToIgnore"})]}};fa=x([k.register],fa);var ic=class{constructor(){this.noBareURIs=!1}},nc="'\"\u2018\u2019\u201C\u201D`[]",iv=["http","ftp","https","smtp"],ha=class extends k{constructor(){super({nameKey:"rules.no-bare-urls.name",descriptionKey:"rules.no-bare-urls.description",type:"Content",ruleIgnoreTypes:[y.code,y.math,y.yaml,y.link,y.wikiLink,y.tag,y.image,y.inlineCode,y.anchorTag,y.html]})}get OptionsClass(){return ic}apply(n,e){let i=n.match(zn);if(i&&(n=this.handleMatches(n,i,!1)),e.noBareURIs){let r=n.match(tf);r&&(n=this.handleMatches(n,r,!0))}return n}handleMatches(n,e,i){let r=0,s=e.length;for(let a=0;a<s;a++){let o=e[a],l=n.indexOf(o,r),c=l+o.length;o.charAt(0)==="<"&&(o=o.substring(1),l++),o.charAt(o.length-1)===">"&&(o=o.substring(0,o.length-1),c--);let u=l===0?void 0:n.charAt(l-1),d=c>=n.length?void 0:n.charAt(c),p=Rn(o,"(");if(p!=0&&p!=Rn(o,")")&&d==")"?(o+=d,c++,d=c>=n.length?void 0:n.charAt(c)):p==0&&o.endsWith(")")&&(d=")",c--,o=o.substring(0,o.length-1)),this.skipMatch(u,d,o,i)){r=l+o.length;continue}if(u!=null&&u==="<"&&d!=null&&d===">"){let m=l-1;for(;m>0&&n.charAt(m-1)==="<";)m--;let f=c;for(;f<n.length-1&&n.charAt(f+1)===">";)f++;n=ue(n,m,f+1,"<"+o+">"),r=l+o.length;continue}n=ue(n,l,l+o.length,"<"+o+">"),r=l+o.length+2}return n}skipMatch(n,e,i,r){let s=n!=null&&nc.includes(n)||nc.includes(i.charAt(0)),a=e!=null&&nc.includes(e)||nc.includes(i.charAt(i.length-1));return s&&a?!0:r?iv.includes(i.substring(0,i.indexOf(":"))):!1}get optionBuilders(){return[new $({OptionsClass:ic,nameKey:"rules.no-bare-urls.no-bare-uris.name",descriptionKey:"rules.no-bare-urls.no-bare-uris.description",optionsKey:"noBareURIs"})]}};ha=x([k.register],ha);var Kr=class{constructor(){this.numberStyle="ascending";this.listEndStyle="."}},ga=class extends k{constructor(){super({nameKey:"rules.ordered-list-style.name",descriptionKey:"rules.ordered-list-style.description",type:"Content",ruleIgnoreTypes:[y.code,y.math,y.yaml,y.tag]})}get OptionsClass(){return Kr}apply(n,e){return _m(n,e.numberStyle,e.listEndStyle,e.preserveStart)}get optionBuilders(){return[new ne({OptionsClass:Kr,nameKey:"rules.ordered-list-style.number-style.name",descriptionKey:"rules.ordered-list-style.number-style.description",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 same"},{value:"preserve",description:"Preserves ordered list item indicators as they are"}]}),new ne({OptionsClass:Kr,nameKey:"rules.ordered-list-style.list-end-style.name",descriptionKey:"rules.ordered-list-style.list-end-style.description",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)`)"}]}),new $({OptionsClass:Kr,name
(?:(?:[ \v\f\r \xA0\u2000-\u200B\u2028-\u2029\u3000]+)?
){1,}${i}$`,"gm"),s,a=e;do s=a.match(r),a=a.replaceAll(r,`$1
$4`);while(s);return a}}get OptionsClass(){return _d}apply(e,i){let r=`(( |\\t)*- ${yi}( |\\t)+.+)`;e=this.replaceEmptyLinesBetweenList(e,r),e=this.replaceEmptyLinesBetweenList(e,"(( |\\t)*\\d+\\.( |\\t)+.+)"),e=this.replaceEmptyLinesBetweenList(e,"(( |\\t)*\\+( |\\t)+.+)");let o=`(( |\\t)*-(?! ${yi})( |\\t)+.+)`;return e=this.replaceEmptyLinesBetweenList(e,o),this.replaceEmptyLinesBetweenList(e,"(( |\\t)*\\*( |\\t)+.+)")}get optionBuilders(){return[]}};Sa=x([k.register],Sa);var zd=class{},Ea=class extends k{constructor(){super({nameKey:"rules.remove-empty-list-markers.name",descriptionKey:"rules.remove-empty-list-markers.description",type:"Content",ruleIgnoreTypes:[y.code,y.math,y.yaml,y.link,y.wikiLink,y.tag]})}get OptionsClass(){return zd}apply(n,e){let i=new RegExp(`^${ds}(-|\\*|\\+|\\d+[.)]|- (\\[(.)\\]))\\s*?$`,"gm");return n=n.replace(new RegExp(i.source+"\\n","gm"),""),n=n.replace(new RegExp("\\n"+i.source,"gm"),""),n.replace(i,"")}get optionBuilders(){return[]}};Ea=x([k.register],Ea);var Pd=class{},Ta=class extends k{constructor(){super({nameKey:"rules.remove-hyphenated-line-breaks.name",descriptionKey:"rules.remove-hyphenated-line-breaks.description",type:"Content",ruleIgnoreTypes:[y.code,y.math,y.yaml,y.link,y.wikiLink,y.tag]})}get OptionsClass(){return Pd}apply(n,e){return n.replace(/\b[-‐] \b/g,"")}get optionBuilders(){return[]}};Ta=x([k.register],Ta);var qd=class{},$i=class extends k{constructor(){super({nameKey:"rules.remove-hyphens-on-paste.name",descriptionKey:"rules.remove-hyphens-on-paste.description",type:"Paste"})}get OptionsClass(){return qd}apply(n,e){return n.replace(/([^\s-])[-‐]\s+\n?(?=\w)/g,"$1")}get optionBuilders(){return[]}};$i=x([k.register],$i);var Hd=class{},Ui=class extends k{constructor(){super({nameKey:"rules.remove-leading-or-trailing-whitespace-on-paste.name",descriptionKey:"rules.remove-leading-or-trailing-whitespace-on-paste.description",type:"Paste"})}get OptionsClass(){return Hd}apply(n,e){return n.replace(/^[\n ]+|\s+$/g,"")}get optionBuilders(){return[]}};Ui=x([k.register],Ui);var $d=class{},ji=class extends k{constructor(){super({nameKey:"rules.remove-leftover-footnotes-from-quote-on-paste.name",descriptionKey:"rules.remove-leftover-footnotes-from-quote-on-paste.description",ruleIgnoreTypes:[y.wikiLink,y.link,y.image],type:"Paste"})}get OptionsClass(){return $d}apply(n,e){return n.replace(/(\D)[.,]\d+/g,"$1")}get optionBuilders(){return[]}};ji=x([k.register],ji);var Ud=class{},xa=class extends k{constructor(){super({nameKey:"rules.remove-link-spacing.name",descriptionKey:"rules.remove-link-spacing.description",type:"Spacing"})}get OptionsClass(){return Ud}apply(n,e){return n=Bm(n),uf(n)}get optionBuilders(){return[]}};xa=x([k.register],xa);var jd=class{},Vi=class extends k{constructor(){super({nameKey:"rules.remove-multiple-blank-lines-on-paste.name",descriptionKey:"rules.remove-multiple-blank-lines-on-paste.description",type:"Paste"})}get OptionsClass(){return jd}apply(n,e){return n.replace(Ro,`
`)}get optionBuilders(){return[]}};Vi=x([k.register],Vi);var Vd=class{},Oa=class extends k{constructor(){super({nameKey:"rules.remove-multiple-spaces.name",descriptionKey:"rules.remove-multiple-spaces.description",type:"Content",ruleIgnoreTypes:[y.code,y.inlineCode,y.math,y.inlineMath,y.yaml,y.link,y.wikiLink,y.tag,y.table,y.image]})}get OptionsClass(){return Vd}apply(n,e){return n=Me([y.list],n,i=>i.replace(/(?!^>)([^\s])( ){2,}([^\s])/gm,"$1 $3")),n=Kn(n,i=>i.replace(/([^\s])( ){2,}([^\s])/gm,"$1 $3")),n}get optionBuilders(){return[]}};Oa=x([k.register],Oa);var Wi=class{constructor(){this.includeFullwidthForms=!0;this.includeCJKSymbolsAndPunctuation=!0;this.includeDashes=!0;this.otherSymbols=""}},Ma=class extends k{constructor(){super({nameKey:"rules.remove-space-around-characters.name",descriptionKey:"rules.remove-space-around-characters.description",type:"Spacing",ruleIgnoreTypes:[y.code,y.inlineCode,y.math,y.yaml,y.link,y.wikiLink,y.tag]})}get OptionsClass(){return Wi}apply(n,e){let i="";if(e.includeFullwidthForms&&(i+="\uFF01-\uFF5E"),e.includeCJKSymbolsAndPunctuation&&(i+="\u3000-\u303F"),e.includeDashes&&(i+="\u2013\u2014"),i+=mt(e.otherSymbols),!i)return n;let r=new RegExp(`([ ])+([${i}])`,"g"),s=new RegExp(`([${i}])([ ])+`,"g"),a=function(l){return l.replace(r,"$2").replace(s,"$1")},o=Me([y.list,y.heading],n,a);return o=Kn(o,a),o=$m(o,a),o}get optionBuilders(){return[new $({nameKey:"rules.remove-space-around-characters.include-fullwidth-forms.name",descriptionKey:"rules.remove-space-around-characters.include-fullwidth-forms.description",OptionsClass:Wi,optionsKey:"includeFullwidthForms"}),new $({nameKey:"rules.remove-space-around-characters.include-cjk-symbols-and-punctuation.name",descriptionKey:"rules.remove-space-around-characters.include-cjk-symbols-and-punctuation.description",OptionsClass:Wi,optionsKey:"includeCJKSymbolsAndPunctuation"}),new $({nameKey:"rules.remove-space-around-characters.include-dashes.name",descriptionKey:"rules.remove-space-around-characters.include-dashes.description",OptionsClass:Wi,optionsKey:"includeDashes"}),new ye({nameKey:"rules.remove-space-around-characters.other-symbols.name",descriptionKey:"rules.remove-space-around-characters.other-symbols.description",OptionsClass:Wi,optionsKey:"otherSymbols"})]}};Ma=x([k.register],Ma);var Ia=class{constructor(){this.charactersToRemoveSpacesBefore=",!?;:).\u2019\u201D]";this.charactersToRemoveSpacesAfter="\xBF\xA1\u2018\u201C(["}},Ca=class extends k{constructor(){super({nameKey:"rules.remove-space-before-or-after-characters.name",descriptionKey:"rules.remove-space-before-or-after-characters.description",type:"Spacing",ruleIgnoreTypes:[y.code,y.math,y.yaml,y.link,y.wikiLink,y.tag]})}get OptionsClass(){return Ia}apply(n,e){let i=mt(e.charactersToRemoveSpacesBefore),r=mt(e.charactersToRemoveSpacesAfter);if(!i&&!r)return n;let s=new RegExp(`([ ])+([${i}])`,"g"),a=new RegExp(`([${r}])([ ])+`,"g"),o=function(c){return c.replace(s,"$2").replace(a,"$1")},l=Me([y.list,y.html],n,o);return l=Kn(l,o),l}get optionBuilders(){return[new ye({nameKey:"rules.remove-space-before-or-after-characters.characters-to-remove-space-before.name",descriptionKey:"rules.remove-space-before-or-after-characters.characters-to-remove-space-before.description",OptionsClass:Ia,optionsKey:"charactersToRemoveSpacesBefore"}),new ye({nameKey:"rules.remove-space-before-or-after-characters.characters-to-remove-space-after.name",descriptionKey:"rules.remove-space-before-or-after-characters.characters-to-remove-space-after.description",OptionsClass:Ia,optionsKey:"charactersToRemoveSpacesAfter"})]}};Ca=x([k.register],Ca);var rc=class{constructor(){this.punctuationToRemove=".,;:!\u3002\uFF0C\uFF1B\uFF1A\uFF01"}},Ba=class extends k{constructor(){super({nameKey:"rules.remove-trailing-punctuation-in-heading.name",descriptionKey:"rules.remove-trailing-punctuation-in-heading.description",type:"Heading",ruleIgnoreTypes:[y.code,y.math,y.yaml]})}get OptionsClass(){return rc}apply(n,e){return n.replaceAll(_n,(i,r="",s="",a="",o="",l="")=>{if(o==""||o.match(sf))return i;let c=o.trimEnd(),
`,"").replace(`
---`,""));if(!r)return i;for(let s of $t)if(e.sortAliasKey&&Object.keys(r).includes(s)){i=de(i,s,xe(Qn(this.sortArray(Ke(we(i,s)),e.sortOrder)),e.aliasArrayStyle,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays,!0));break}for(let s of Ht)if(e.sortTagKey&&Object.keys(r).includes(s)){i=de(i,s,xe(Gn(this.sortArray(Ke(we(i,s)),e.sortOrder)),e.tagArrayStyle,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays));break}if(e.sortArrayKeys){let s=[...$t,...Ht,...e.ignoreSortArrayKeys];for(let a of Object.keys(r)){if(s.includes(a)||!Array.isArray(r[a])||r[a].length!==0&&typeof r[a][0]=="object"&&r[a][0]!==null)continue;let o=we(i,a),l="single-line";o.includes(`
`)&&(l="multi-line");let c=this.sortArray(Ke(o),e.sortOrder);i=de(i,a,xe(c,l,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays))}}return i})}sortArray(n,e){return n==null||typeof n=="string"||n.length<=1||(n.sort(function(i,r){let s=i.toLowerCase().localeCompare(r.toLowerCase());return s===0?i.localeCompare(r):s}),e==="Ascending Alphabetical")||n.reverse(),n}get optionBuilders(){return[new $({OptionsClass:xt,nameKey:"rules.sort-yaml-array-values.sort-alias-key.name",descriptionKey:"rules.sort-yaml-array-values.sort-alias-key.description",optionsKey:"sortAliasKey"}),new $({OptionsClass:xt,nameKey:"rules.sort-yaml-array-values.sort-tag-key.name",descriptionKey:"rules.sort-yaml-array-values.sort-tag-key.description",optionsKey:"sortTagKey"}),new $({OptionsClass:xt,nameKey:"rules.sort-yaml-array-values.sort-array-keys.name",descriptionKey:"rules.sort-yaml-array-values.sort-array-keys.description",optionsKey:"sortArrayKeys"}),new ge({OptionsClass:xt,nameKey:"rules.sort-yaml-array-values.ignore-keys.name",descriptionKey:"rules.sort-yaml-array-values.ignore-keys.description",optionsKey:"ignoreSortArrayKeys"}),new ne({OptionsClass:xt,nameKey:"rules.sort-yaml-array-values.sort-order.name",descriptionKey:"rules.sort-yaml-array-values.sort-order.description",optionsKey:"sortOrder",records:[{value:"Ascending Alphabetical",description:"Sorts the array values from a to z"},{value:"Descending Alphabetical",description:"Sorts the array values from z to a"}]})]}};Fa=x([k.register],Fa);var Wd=class{},Da=class extends k{constructor(){super({nameKey:"rules.space-after-list-markers.name",descriptionKey:"rules.space-after-list-markers.description",type:"Spacing",ruleIgnoreTypes:[y.code,y.math,y.yaml,y.link,y.wikiLink,y.tag]})}get OptionsClass(){return Wd}apply(n,e){return n=n.replace(/^(\s*\d+\.|\s*[-+*])[^\S\r\n]+/gm,"$1 "),n.replace(/^(\s*\d+\.|\s*[-+*]\s+\[[ xX]\])[^\S\r\n]+/gm,"$1 ")}get optionBuilders(){return[]}};Da=x([k.register],Da);var Ya=class{constructor(){this.englishNonLetterCharactersAfterCJKCharacters=`-+'"([\xA5$`;this.englishNonLetterCharactersBeforeCJKCharacters=`-+;:'"\xB0%$)]`}},Na=class extends k{constructor(){super({nameKey:"rules.space-between-chinese-japanese-or-korean-and-english-or-numbers.name",descriptionKey:"rules.space-between-chinese-japanese-or-korean-and-english-or-numbers.description",type:"Spacing",ruleIgnoreTypes:[y.code,y.inlineCode,y.yaml,y.image,y.link,y.wikiLink,y.tag,y.math,y.inlineMath,y.html]})}get OptionsClass(){return Ya}apply(n,e){let i=this.buildHeadRegex(e.englishNonLetterCharactersAfterCJKCharacters),r=this.buildTailRegex(e.englishNonLetterCharactersBeforeCJKCharacters),s=`${y.link.placeholder}|${y.inlineMath.placeholder}|${y.inlineCode.placeholder}|${y.wikiLink.placeholder}`.replaceAll("{","\\{").replaceAll("}",".+\\}"),a=new RegExp(`(\\p{sc=Han}|\\p{sc=Katakana}|\\p{sc=Hiragana}|\\p{sc=Hangul})( *)(${s})`,"gmu"),o=new RegExp(`(${s})( *)(\\p{sc=Han}|\\p{sc=Katakana}|\\p{sc=Hiragana}|\\p{sc=Hangul})`,"gmu"),l=function(u){return u.replace(i,"$1 $3").replace(r,"$1 $3")},c=Me([y.italics,y.bold],n,l);return c=c.replace(a,"$1 $3").replace(o,"$1 $3"),c=Rm(c,l),c=Fm(c,l),c}buildHeadRegex(n){n&&n!==""&&(n=n.replaceAll(/\s/g,""));let e="";return n&&n.length!=0&&(e=`|[${mt(n)}]`),new RegExp(`(\\p{sc=Han}|\\p{sc=Katakana}|\\p{sc=Hiragana}|\\p{sc=Hangul})( *)(\\[[^[]*\\]\\(.*\\)|\`[^\`]*\`|\\w+${e}|\\*[^*])`,"gmu")}buildTailRegex(n){n&&n!==""&&(n=n.replaceAll(/\s/g,""));let e="";return n&&n.length!=0&&(e=`|[${mt(n)}]`),new RegExp(`(\\[[^[]*\\]\\(.*\\)|\`[^\`]*\`|\\w+${e}|[^*]\\*)( *)(\\p{sc=Han}|\\p{sc=Katakana}|\\p{sc=Hiragana}|\\p{sc=Hangul})`,"gmu")}get optionBuilders(){return[new ye({OptionsClass:Ya,nameKey:"rules.space-between-chinese-japanese-or-korean-and-english-or-numbers.english-symbols-punctuation-before.name",descriptionKey:"rules.space-between-chinese-japanese-or-korean-and-english-or-numbers.english-symbols-punctuation-before.description",optionsKey:"englishNonLetterCharactersBeforeCJKCharacters"}),new ye({OptionsClass:Ya,nameKey:"rules.space-between-chinese-japanese-
${e.dateCreatedKey}: [^
]+
`,s=`
${e.dateCreatedKey}:[ ]*
`,a=new RegExp(s),o=new RegExp(r),l=(0,Ot.moment)(e.fileCreatedTime);l.locale(e.locale);let c=e.convertToUTC?l.utc().format(e.format):l.format(e.format),u=`
${e.dateCreatedKey}: ${c}`,d=o.test(n);if(!d&&a.test(n))n=n.replace(a,it(u)+`
`),i=!0;else if(d){if(d){let p=this.getYAMLTimestampString(n,o,e.dateCreatedKey),m=(0,Jd.default)(p);if(e.dateCreatedSourceOfTruth=="frontmatter"&&e.format!==m){let f=this.parseValueToCurrentFormatIfPossible(p,e.format,e.locale,e.convertToUTC);if(f==null)throw new Error(E("logs.invalid-date-format-error").replace("{DATE}",p).replace("{FILE_NAME}",e.fileName));let h=e.convertToUTC?f.utc().format(e.format):f.format(e.format);if(h!==p){let g=`
${e.dateCreatedKey}: ${h}`;n=n.replace(o,it(g)+`
`),i=!0}}else if(e.dateCreatedSourceOfTruth!="frontmatter"){let f=(0,Ot.moment)(p,e.format,e.locale);(f==null||!f.isValid()||e.format!==""&&f.format(e.format)!=p)&&(n=n.replace(o,it(u)+`
`),i=!0)}}}else{let p=n.indexOf(`
---`);n=di(n,p,`
${e.dateCreatedKey}: ${c}`),i=!0}return[n,i]}handleDateModifiedValue(n,e,i){let r=`
${i.dateModifiedKey}: [^
]+
`,s=`
${i.dateModifiedKey}:[ ]*
`,a=new RegExp(s),o=new RegExp(r),l=(0,Ot.moment)(i.fileModifiedTime);l.locale(i.locale);let c=i.convertToUTC?i.currentTime.utc().format(i.format):i.currentTime.format(i.format),u=`
${i.dateModifiedKey}: ${c}`,d=o.test(n);if(d){let p=this.getYAMLTimestampString(n,o,i.dateModifiedKey),m=(0,Ot.moment)(p,i.format,i.locale);(e||m==null||!m.isValid()||m.format(i.format)!=p||i.dateModifiedSourceOfTruth!="user or Linter edits"&&this.getTimeDifferenceInSeconds(m,l,i)>5)&&(n=n.replace(o,it(u)+`
`))}else if(a.test(n))n=n.replace(a,it(u)+`
`);else if(!d){let p=n.indexOf(`
---`);n=di(n,p,u)}return n}parseValueToCurrentFormatIfPossible(n,e,i,r){if(n==null)return null;let s=r?Ot.moment.utc(n,e,i,!0):(0,Ot.moment)(n,e,i,!0);if(s!=null&&s.isValid())return s;let a=(0,Jd.default)(n);if(a!=null){let o=r?Ot.moment.utc(n,a):(0,Ot.moment)(n,a);o.locale(i);let l=r?o.utc().format(e):o.format(e);return r?Ot.moment.utc(l,e,i,!0):(0,Ot.moment)(l,e,i,!0)}return null}getYAMLTimestampString(n,e,i){return n.match(e)[0].replace(i+":","").trim()}getTimeDifferenceInSeconds(n,e,i){let r=(0,Ot.moment)(e.format(i.format),i.format,i.locale,!0);return Math.abs(n.diff(r,"seconds"))}get optionBuilders(){return[new $({OptionsClass:Pe,nameKey:"rules.yaml-timestamp.date-created.name",descriptionKey:"rules.yaml-timestamp.date-created.description",optionsKey:"dateCreated"}),new ye({OptionsClass:Pe,nameKey:"rules.yaml-timestamp.date-created-key.name",descriptionKey:"rules.yaml-timestamp.date-created-key.description",optionsKey:"dateCreatedKey"}),new ne({OptionsClass:Pe,nameKey:"rules.yaml-timestamp.date-created-source-of-truth.name",descriptionKey:"rules.yaml-timestamp.date-created-source-of-truth.description",optionsKey:"dateCreatedSourceOfTruth",records:[{value:"file system",description:"The file system date created value is used to set the value of date created in the frontmatter"},{value:"frontmatter",description:"When a value is present in the frontmatter for date created, this value is used as the value for the date created"}]}),new $({OptionsClass:Pe,nameKey:"rules.yaml-timestamp.date-modified.name",descriptionKey:"rules.yaml-timestamp.date-modified.description",optionsKey:"dateModified"}),new ye({OptionsClass:Pe,nameKey:"rules.yaml-timestamp.date-modified-key.name",descriptionKey:"rules.yaml-timestamp.date-modified-key.description",optionsKey:"dateModifiedKey"}),new ne({OptionsClass:Pe,nameKey:"rules.yaml-timestamp.date-modified-source-of-truth.name",descriptionKey:"rules.yaml-timestamp.date-modified-source-of-truth.description",optionsKey:"dateModifiedSourceOfTruth",records:[{value:"file system",description:"The file system date modified value is used to set the value of date modified in the frontmatter"},{value:"user or Linter edits",description:"When a value is present in the frontmatter for date modified, date modified is kept as is unless the Linter makes a change to a note or the user edits a note with the setting `{NAME}` set to something other than `{NEVER}`.".replace("{NAME}",E("rules.yaml-timestamp.update-on-file-contents-updated.name")).replace("{NEVER}",E("enums.never"))}]}),new ql({OptionsClass:Pe,nameKey:"rules.yaml-timestamp.format.name",descriptionKey:"rules.yaml-timestamp.format.description",optionsKey:"format"}),new $({OptionsClass:Pe,nameKey:"rules.yaml-timestamp.convert-to-utc.name",descriptionKey:"rules.yaml-timestamp.convert-to-utc.description",optionsKey:"convertToUTC"}),new ne({OptionsClass:Pe,nameKey:"rules.yaml-timestamp.update-on-file-contents-updated.name",descriptionKey:"rules.yaml-timestamp.update-on-file-contents-updated.description",optionsKey:"timestampUpdateOnFileContentUpdated",records:[{value:"never",description:"never"},{value:"after 5 seconds",description:"after 5 seconds"},{value:"after 10 seconds",description:"after 10 seconds"},{value:"after 15 seconds",description:"after 15 seconds"},{value:"after 30 seconds",description:"after 30 seconds"},{value:"after 1 minute",description:"after 1 minute"}]})]}};xn=x([k.register],xn);var Gt=class{constructor(){this.preserveExistingAliasesSectionStyle=!0;this.keepAliasThatMatchesTheFilename=!1;this.useYamlKeyToKeepTrackOfOldFilenameOrHeading=!0;this.aliasHelperKey=sd;this.aliasArrayStyle="multi-line";this.defaultEscapeCharacter='"';this.removeUnnecessaryEscapeCharsForMultiLineArrays=!1}};x([k.noSettingControl()],Gt.prototype,"aliasArrayStyle",2),x([k.noSettingControl()],Gt.prototype,"fileName",2),x([k.noSettingControl()],Gt.prototype,"defaultEscapeCharacter",2),x([k.noSettingControl()],Gt.prototype,"removeUnnecessaryEscapeCharsForMultiLineArrays",2);var Zi=class extends k{constructor(){super({nameKey:"rules.yaml-title-alias.name",descrip
`,"").replace(`
---`,""),c=gt(a),u=e.aliasHelperKey??sd;u.endsWith(":")&&(u=u.substring(0,u.length-1)),s=c[u]??null,s!=null&&(s=s+"",s=ht(s,e.defaultEscapeCharacter,this.forceEscape(s,e.aliasArrayStyle)));let d=null,p=Object.keys(c);for(let h of $t)if(p.includes(h)){d=h;break}if(d!=null){let h=we(l,d),g="multi-line",b=h==="",w=!1;!h.includes(`
`)&&!(h==="[]"&&e.aliasArrayStyle==="multi-line")&&(h.match(/^\[.*\]/)===null?(g="single string to single-line",w=!0):g="single-line");let v=Qn(Ke(h)),T=this.getNewAliasValue(v,o,r,s);T===""?l=Ds(l,d):e.preserveExistingAliasesSectionStyle?!b&&(w&&r==T||!w||v==T)?l=de(l,d,xe(T,g,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays,!0)):l=de(l,d,xe(T,e.aliasArrayStyle,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays,!0)):l=de(l,d,xe(T,e.aliasArrayStyle,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays,!0))}else o||(l=de(l,rd,xe(r,e.aliasArrayStyle,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays,!0)));!e.useYamlKeyToKeepTrackOfOldFilenameOrHeading||o?l=Ds(l,u):l=de(l,u,` ${r}`);let m=`---
${a}---`,f=`---
${l}---`;return l===""&&(f=""),n=n.replace(m,f),l===""&&(n=n.trimStart()),n}getTitleInfo(n,e,i,r){let s=Me([y.code,y.math,y.yaml,y.tag],n,Fo);s=s||e;let a=ht(s,r,this.forceEscape(s,i));return[s,a]}forceEscape(n,e){return mo(n)||n.includes(",")&&(e==="single-line"||e==="single string to single-line"||e==="single string comma delimited")}getNewAliasValue(n,e,i,r){if(n==null)return e?"":i;if(typeof n=="string")e?n===i&&(n=""):r===n?n=i:n=[i,n];else if(r!==null){let s=n.indexOf(r);s===-1&&Wn(r)&&(s=n.indexOf(r.substring(1,r.length-1))),s!==-1?e?n.splice(s,1):n[s]=i:n=[i,...n]}else{let s=n.indexOf(i);s!==-1?e&&n.splice(s,1):e||(n=[i,...n])}return n===""||n.length===0?"":n}get optionBuilders(){return[new $({OptionsClass:Gt,nameKey:"rules.yaml-title-alias.preserve-existing-alias-section-style.name",descriptionKey:"rules.yaml-title-alias.preserve-existing-alias-section-style.description",optionsKey:"preserveExistingAliasesSectionStyle"}),new $({OptionsClass:Gt,nameKey:"rules.yaml-title-alias.keep-alias-that-matches-the-filename.name",descriptionKey:"rules.yaml-title-alias.keep-alias-that-matches-the-filename.description",optionsKey:"keepAliasThatMatchesTheFilename"}),new $({OptionsClass:Gt,nameKey:"rules.yaml-title-alias.use-yaml-key-to-keep-track-of-old-filename-or-heading.name",descriptionKey:"rules.yaml-title-alias.use-yaml-key-to-keep-track-of-old-filename-or-heading.description",optionsKey:"useYamlKeyToKeepTrackOfOldFilenameOrHeading"}),new ye({OptionsClass:Gt,nameKey:"rules.yaml-title-alias.alias-helper-key.name",descriptionKey:"rules.yaml-title-alias.alias-helper-key.description",optionsKey:"aliasHelperKey"})]}};Zi=x([k.register],Zi);var Ji=class{constructor(){this.defaultEscapeCharacter='"';this.titleKey="title";this.mode="first-h1-or-filename-if-h1-missing"}};x([k.noSettingControl()],Ji.prototype,"fileName",2),x([k.noSettingControl()],Ji.prototype,"defaultEscapeCharacter",2);var Xi=class extends k{constructor(){super({nameKey:"rules.yaml-title.name",descriptionKey:"rules.yaml-title.description",type:"YAML",hasSpecialExecutionOrder:!0})}get OptionsClass(){return Ji}apply(n,e){n=an(n);let i="";switch(e.mode){case"filename":i=e.fileName;break;case"first-h1":i=this.getFirstH1Header(n);break;default:i=this.getFirstH1Header(n),i=i||e.fileName}return i=ht(i,e.defaultEscapeCharacter),Ee(n,r=>{let s=`
${e.titleKey}:.*
`,a=new RegExp(s);if(a.test(r))r=r.replace(a,it(`
${e.titleKey}: ${i}
`));else{let o=r.indexOf(`
---`);r=di(r,o,`
${e.titleKey}: ${i}`)}return r})}getFirstH1Header(n){return Me([y.code,y.math,y.yaml,y.tag],n,Fo)}get optionBuilders(){return[new ye({OptionsClass:Ji,nameKey:"rules.yaml-title.title-key.name",descriptionKey:"rules.yaml-title.title-key.description",optionsKey:"titleKey"}),new ne({OptionsClass:Ji,nameKey:"rules.yaml-title.mode.name",descriptionKey:"rules.yaml-title.mode.description",optionsKey:"mode",records:[{value:"first-h1-or-filename-if-h1-missing",description:"Uses the first H1 in the file or the filename of the file if there is not H1"},{value:"filename",description:"Uses the filename as the title"},{value:"first-h1",description:"Uses the first H1 in the file as the title"}]})]}};Xi=x([k.register],Xi);var jL=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file-cog">
<circle cx="6" cy="13" r="3"/>
<path d="m9.7 14.4-.9-.3"/>
<path d="m3.2 11.9-.9-.3"/>
<path d="m4.6 16.7.3-.9"/>
<path d="m7.6 16.7-.4-1"/>
<path d="m4.8 10.3-.4-1"/>
<path d="m2.3 14.6 1-.4"/>
<path d="m8.7 11.8 1-.4"/>
<path d="m7.4 9.3-.3.9"/>
<path d="M14 2v6h6"/>
<path d="M4 5.5V4a2 2 0 0 1 2-2h8.5L20 7.5V20a2 2 0 0 1-2 2H6a2 2 0 0 1-2-1.5"/>
</svg>`,VL=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-folder-cog">
<circle cx="18" cy="18" r="3"/>
<path d="M10.5 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v3.5"/>
<path d="m21.7 19.4-.9-.3"/>
<path d="m15.2 16.9-.9-.3"/>
<path d="m16.6 21.7.3-.9"/>
<path d="m19.1 15.2.3-.9"/>
<path d="m19.6 21.7-.4-1"/>
<path d="m16.8 15.3-.4-1"/>
<path d="m14.3 19.6 1-.4"/>
<path d="m20.7 16.8 1-.4"/>
</svg>`,WL=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-server-cog">
<circle cx="12" cy="12" r="3"/><path d="M4.5 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-.5"/>
<path d="M4.5 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-.5"/>
<path d="M6 6h.01"/><path d="M6 18h.01"/>
<path d="m15.7 13.4-.9-.3"/>
<path d="m9.2 10.9-.9-.3"/>
<path d="m10.6 15.7.3-.9"/>
<path d="m13.6 15.7-.4-1"/>
<path d="m10.8 9.3-.4-1"/>
<path d="m8.3 13.6 1-.4"/>
<path d="m14.7 10.8 1-.4"/>
<path d="m13.4 8.3-.3.9"/>
</svg>`,GL=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-pilcrow">
<path d="M13 4v16"/>
<path d="M17 4v16"/>
<path d="M19 4H9.5a4.5 4.5 0 0 0 0 9H13"/>
</svg>`,QL=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-function-square">
<rect width="18" height="18" x="3" y="3" rx="2" ry="2"/>
<path d="M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3"/>
<path d="M9 11.2h5.7"/>
</svg>`,ZL=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-gantt-chart-square">
<rect width="18" height="18" x="3" y="3" rx="2"/>
<path d="M9 8h7"/>
<path d="M8 12h6"/>
<path d="M11 16h5"/>
</svg>`,JL=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-clipboard-list">
<rect width="8" height="4" x="8" y="2" rx="1" ry="1"/>
<path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/>
<path d="M12 11h4"/>
<path d="M12 16h4"/>
<path d="M8 11h.01"/>
<path d="M8 16h.01"/>
</svg>`,XL=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-book-plus">
<path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20"/>
<path d="M9 10h6"/>
<path d="M12 7v6"/>
</svg>`,eA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-heading-1">
<path d="M4 12h8"/>
<path d="M4 18V6"/>
<path d="M12 18V6"/>
<path d="m17 12 3-2v8"/>
</svg>`,tA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-superscript">
<path d="m4 19 8-8"/>
<path d="m12 19-8-8"/>
<path d="M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06"/>
</svg>`,nA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file-code-2">
<path d="M4 22h14a2 2 0 0 0 2-2V7.5L14.5 2H6a2 2 0 0 0-2 2v4"/>
<polyline points="14 2 14 8 20 8"/>
<path d="m9 18 3-3-3-3"/>
<path d="m5 12-3 3 3 3"/>
</svg>`,iA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-settings">
<path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/>
<circle cx="12" cy="12" r="3"/>
</svg>`,rA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-bug-play">
<path d="m8 2 1.88 1.88"/>
<path d="M14.12 3.88 16 2"/>
<path d="M9 7.13v-1a3.003 3.003 0 1 1 6 0v1"/>
<path d="M18 11a4 4 0 0 0-4-4h-4a4 4 0 0 0-4 4v3a6.1 6.1 0 0 0 2 4.5"/>
<path d="M6.53 9C4.6 8.8 3 7.1 3 5"/>
<path d="M6 13H2"/>
<path d="M3 21c0-2.1 1.7-3.9 3.8-4"/>
<path d="M20.97 5c0 2.1-1.6 3.8-3.5 4"/>
<path d="m12 12 8 5-8 5Z"/>
</svg>`,sA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-clipboard">
<rect width="8" height="4" x="8" y="2" rx="1" ry="1"/>
<path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/>
</svg>`,aA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-check">
<polyline points="20 6 9 17 4 12"/>
</svg>`,oA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file-x">
<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/>
<path d="M14 2v4a2 2 0 0 0 2 2h4"/>
<path d="m14.5 12.5-5 5"/>
<path d="m9.5 12.5 5 5"/>
</svg>`,lA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-folder-x">
<path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"/>
<path d="m9.5 10.5 5 5"/>
<path d="m14.5 10.5-5 5"/>
</svg>`,ve={folder:{id:"lint-folder",source:VL},ignoreFolder:{id:"lint-ignore-folder",source:lA},file:{id:"lint-file",source:jL},ignoreFile:{id:"lint-ignored-file",source:oA},vault:{id:"lint-vault",source:WL},whitespace:{id:"lint-whitespace",source:GL},math:{id:"lint-math",source:QL},content:{id:"lint-content",source:ZL},paste:{id:"lint-paste",source:JL},custom:{id:"lint-custom",source:XL},heading:{id:"lint-heading",source:eA},footer:{id:"lint-footer",source:tA},yaml:{id:"lint-yaml",source:nA},general:{id:"lint-general",source:iA},debug:{id:"lint-debug",source:rA},clipboard:{id:"linter-clipboard",source:sA},success:{id:"linter-success",source:aA}};var zr=require("obsidian");var mc=class{constructor(){this.disabledRules=[]}lintText(n){this.skipFile=!1;let e=n.oldText;if([this.disabledRules,this.skipFile]=_l(e),this.skipFile)return e;ui(E("logs.rule-running"));let i=E("logs.pre-rules");ui(i);let r=this.runBeforeRegularRules(n);In(i);let s=!1;for(let l of n.settings.ruleConfigs["auto-correct-common-misspellings"]["extra-auto-correct-files"]??[])if(l.filePath!=""){s=!0;break}let a=E("logs.disabled-text");for(let l of on){if(this.disabledRules.includes(l.alias)){et(l.alias+" "+a);continue}else if(l.hasSpecialExecutionOrder||l.type==="Paste")continue;if(l.alias==="auto-correct-common-misspellings"&&s){let c=!1;for(let u of n.settings.ruleConfigs["auto-correct-common-misspellings"]["extra-auto-correct-files"]??[])if(u.filePath==n.fileInfo.path){c=!0;break}if(c){et(l.alias+" "+a);continue}}[r]=ii.applyIfEnabledBase(l,r,n.settings,{fileCreatedTime:n.fileInfo.createdAtFormatted,fileModifiedTime:n.fileInfo.modifiedAtFormatted,fileName:n.fileInfo.name,locale:n.momentLocale,minimumNumberOfDollarSignsToBeAMathBlock:n.settings.commonStyles.minimumNumberOfDollarSignsToBeAMathBlock,aliasArrayStyle:n.settings.commonStyles.aliasArrayStyle,tagArrayStyle:n.settings.commonStyles.tagArrayStyle,defaultEscapeCharacter:n.settings.commonStyles.escapeCharacter,removeUnnecessaryEscapeCharsForMultiLineArrays:n.settings.commonStyles.removeUnnecessaryEscapeCharsForMultiLineArrays})}let o=E("logs.custom-regex");return ui(o),r=this.runCustomRegexReplacement(n.settings.customRegexes,r),In(o),n.oldText=r,this.runAfterRegularRules(e,n)}runBeforeRegularRules(n){let e=n.oldText;return[e]=Ki.applyIfEnabled(e,n.settings,this.disabledRules),[e]=Ni.applyIfEnabled(e,n.settings,this.disabledRules,{defaultEscapeCharacter:n.settings.commonStyles.escapeCharacter}),[e]=_i.applyIfEnabled(e,n.settings,this.disabledRules,{minimumNumberOfDollarSignsToBeAMathBlock:n.settings.commonStyles.minimumNumberOfDollarSignsToBeAMathBlock}),[e]=Ii.applyIfEnabled(e,n.settings,this.disabledRules,{misspellingToCorrection:n.defaultMisspellings}),e}runAfterRegularRules(n,e){let i=e.oldText,r=E("logs.post-rules");ui(r),[i]=Fi.applyIfEnabled(i,e.settings,this.disabledRules),[i]=Xi.applyIfEnabled(i,e.settings,this.disabledRules,{fileName:e.fileInfo.name,defaultEscapeCharacter:e.settings.commonStyles.escapeCharacter}),[i]=Zi.applyIfEnabled(i,e.settings,this.disabledRules,{fileName:e.fileInfo.name,aliasArrayStyle:e.settings.commonStyles.aliasArrayStyle,defaultEscapeCharacter:e.settings.commonStyles.escapeCharacter,removeUnnecessaryEscapeCharsForMultiLineArrays:e.settings.commonStyles.removeUnnecessaryEscapeCharsForMultiLineArrays}),[i]=Bi.applyIfEnabled(i,e.settings,this.disabledRules),[i]=Yi.applyIfEnabled(i,e.settings,this.disabledRules,{defaultEscapeCharacter:e.settings.commonStyles.escapeCharacter}),[i]=Gi.applyIfEnabled(i,e.settings,this.disabledRules),[i]=Di.applyIfEnabled(i,e.settings,this.disabledRules);let s=i.match(He);s!=null&&([i]=ri.applyIfEnabled(i,e.settings,this.disabledRules));let a=e.getCurrentTime(),o;[i,o]=xn.applyIfEnabled(i,e.settings,this.disabledRules,{fileCreatedTime:e.fileInfo.createdAtFormatted,fileModifiedTime:e.fileInfo.modifiedAtFormatted,currentTime:a,alreadyModified:n!=i,locale:e.momentLocale}),s===null&&([i]=ri.applyIfEnabled(i,e.settings,this.disabledRules));let l=xn.getRuleOptions(e.settings);return a=e.getCurrentTime(),l.convertToUTC&&(a=a.utc()),[i]=Qi.appl
`),c+=`/${a.find}/${a.flags}/${a.replace}/`,et(c);let u=new RegExp(`${a.find}`,a.flags);r=r.replace(u,Yp(a.replace)),s!=r&&et(r),s=r}return r})}runPasteLint(n,e,i){let r=i.oldText;return[r]=$i.applyIfEnabled(r,i.settings,[]),[r]=Vi.applyIfEnabled(r,i.settings,[]),[r]=ji.applyIfEnabled(r,i.settings,[]),[r]=qi.applyIfEnabled(r,i.settings,[]),[r]=Ui.applyIfEnabled(r,i.settings,[]),[r]=zi.applyIfEnabled(r,i.settings,[],{lineContent:n,selectedText:e}),[r]=Pi.applyIfEnabled(r,i.settings,[],{lineContent:n,selectedText:e}),[r]=Ri.applyIfEnabled(r,i.settings,[],{lineContent:n}),r}runYAMLTimestampByItself(n){let e=n.oldText,i=n.getCurrentTime();return[e]=xn.applyIfEnabled(e,n.settings,this.disabledRules,{fileCreatedTime:n.fileInfo.createdAtFormatted,fileModifiedTime:n.fileInfo.modifiedAtFormatted,currentTime:i,alreadyModified:!0,locale:n.momentLocale}),e}};function er(t,n=null,e,i,r){let s=n&&n.stat.ctime!==0?(0,zr.moment)(n.stat.ctime):(0,zr.moment)();s.locale(e);let a=n?(0,zr.moment)(n.stat.mtime):(0,zr.moment)();a.locale(e);let o=a.format(),l=s.format();return{oldText:t,fileInfo:{name:n?n.basename:"",createdAtFormatted:l,modifiedAtFormatted:o,path:n?n.path:""},settings:i,momentLocale:e,getCurrentTime:()=>{let c=(0,zr.moment)();return c.locale(e),c},defaultMisspellings:r}}var fc=require("obsidian");var qa=class extends fc.Modal{constructor(n,e,i,r,s,a=!1,o){super(n),this.modalEl.addClass("confirm-modal"),this.contentEl.createEl("h3",{text:E("warning-text"),cls:"modal-heading"}),a&&this.contentEl.createEl("p",{text:E("custom-command-warning"),cls:"modal-warn"}),this.contentEl.createEl("p",{text:e+" "+E("file-backup-text")}).id="confirm-dialog";let l;if(o){let c=this.contentEl.createDiv("confirm-modal-checkbox-container");l=c.createEl("input",{type:"checkbox",attr:{id:"suppress-confirmation"}}),c.createEl("label",{text:E("do-not-show-again"),attr:{for:"suppress-confirmation"}})}this.contentEl.createDiv("modal-button-container",c=>{c.createEl("button",{text:E("cancel-button-text")}).addEventListener("click",()=>this.close());let u=c.createEl("button",{attr:{type:"submit"},cls:"mod-cta",text:i});u.addEventListener("click",async d=>{o&&l?.checked&&await o(),new fc.Notice(r),this.close(),await s()}),setTimeout(()=>{u.focus()},50)})}};var ja=require("obsidian");var hc=require("obsidian");var cA={General:ve.general.id,Custom:ve.custom.id,YAML:ve.yaml.id,Heading:ve.heading.id,Footnote:ve.footer.id,Content:ve.content.id,Spacing:ve.whitespace.id,Paste:ve.paste.id,Debug:ve.debug.id},uA={General:"tabs.names.general",Custom:"tabs.names.custom",YAML:"tabs.names.yaml",Heading:"tabs.names.heading",Footnote:"tabs.names.footnote",Content:"tabs.names.content",Spacing:"tabs.names.spacing",Paste:"tabs.names.paste",Debug:"tabs.names.debug"},cn=class{constructor(n,e,i,r,s){this.name=i;this.isMobile=r;this.plugin=s;this.searchSettingInfo=[];this.navButton=n.createDiv("linter-navigation-item");let a="linter-desktop";r&&(a="linter-mobile"),this.navButton.addClass(a),(0,hc.setIcon)(this.navButton.createSpan({cls:"linter-navigation-item-icon"}),cA[i]);let o=E(uA[i]);this.navButton.createSpan().setText(o),this.contentEl=e.createDiv("linter-tab-settings"),this.contentEl.id=i.toLowerCase().replace(" ","-"),this.headingEl=new hc.Setting(this.contentEl).setName(o).setHeading().nameEl,Re(this.headingEl)}addSettingSearchInfo(n,e="",i="",r=[],s=void 0){this.searchSettingInfo.push({containerEl:n,name:e.toLowerCase(),description:i.toLowerCase(),options:r,alias:s})}addSettingSearchInfoForGeneralSettings(n){this.searchSettingInfo.push({containerEl:n.containerEl,name:n.name.toLowerCase(),description:n.description.toLowerCase(),options:[],alias:void 0})}updateTabDisplayMode(n,e="the status is still the same"){switch(n?(this.navButton.addClass("linter-navigation-item-selected"),$e(this.contentEl)):(this.navButton.removeClass("linter-navigation-item-selected"),Re(this.contentEl)),e){case"entering search mode by focusing on the search input box":$e(this.contentEl),$e(this.headingEl);for(let i of this.searchSettingInfo)$e(i.containerEl);break;case"leaving search mode by sel
`," "));let w=this.contentEl.createDiv(),v=new bc(w,this.plugin.settings.filesToIgnore,this.app,()=>{this.plugin.saveSettings()});this.addSettingSearchInfo(w,v.name,v.description.replaceAll(`
`," "));let T=this.contentEl.createDiv(),O=new kc(T,this.plugin.settings.additionalFileExtensions,this.app,()=>{this.plugin.saveSettings()});this.addSettingSearchInfo(T,O.name,O.description.replaceAll(`
`," "))}};var lg=require("obsidian"),vc=class extends cn{constructor(e,i,r,s,a,o){super(e,i,r,a,o);this.rules=s;this.display()}display(){for(let e of this.rules){let i=this.contentEl.createDiv();i.id=e.alias,new lg.Setting(i).setHeading().nameEl.createEl("a",{href:e.getURL(),text:e.getName()});let r=[],s=!0,a=!1;for(let o of e.options)o.display(i,this.plugin.settings,this.plugin),r.push(o.getSearchInfo()),s?(s=!1,o instanceof ti&&(a=!this.plugin.settings.ruleConfigs[o.ruleAlias][o.configKey])):a&&o.hide();this.addSettingSearchInfo(i,e.getName().toLowerCase(),e.getDescription().toLowerCase(),r,i.id)}}};var cg=require("obsidian");var $a=class extends Xn{constructor(e,i,r=[]){super(e,i);this.app=e;this.inputEl=i;this.valuesToExclude=r}getSuggestions(e){let i=this.app.commands.listCommands();if(!i)return[];let r=i.filter(o=>{for(let l of this.valuesToExclude)if(l.id==o.id&&!(this.inputEl.hasAttribute("commandId")&&this.inputEl.getAttribute("commandId")==o.id))return!1;return!0}),s=[],a=e.toLowerCase();return r.forEach(o=>{(o.id.contains(a)||o.name.toLowerCase().contains(a))&&s.push(o)}),s}renderSuggestion(e,i){i.setText(e.name)}selectSuggestion(e){this.inputEl.value=e.name,this.inputEl.setAttribute("commandId",e.id),this.inputEl.trigger("input"),this.close()}};var Lc=class extends Mt{constructor(e,i,r,s){super(e,E("options.custom-command.name"),E("options.custom-command.description"),E("options.custom-command.warning"),E("options.custom-command.add-input-button-text"),r,s,()=>{let a={id:"",name:"",enabled:!0};this.lintCommands.push(a),this.saveSettings(),this.addCommand(a,this.lintCommands.length-1,!0)});this.lintCommands=i;this.display()}showInputEls(){this.lintCommands.forEach((e,i)=>{this.addCommand(e,i)})}addCommand(e,i,r=!1){new cg.Setting(this.inputElDiv).addSearch(s=>{new $a(this.app,s.inputEl,this.lintCommands),s.setPlaceholder(E("options.custom-command.command-search-placeholder-text")).setValue(e.name).onChange(a=>{let o={id:s.inputEl.getAttribute("commandId"),name:a,enabled:e.enabled};o.name&&o.id?(this.lintCommands[i]=o,this.saveSettings()):!o.name&&!o.id&&(this.lintCommands[i]=o,this.saveSettings())}),s.inputEl.setAttr("tabIndex",i),s.inputEl.addClass("linter-custom-command"),r&&s.inputEl.focus()}).addExtraButton(s=>{s.setIcon("up-chevron-glyph").setTooltip(E("options.custom-command.move-up-tooltip")).onClick(()=>{this.arrayMove(i,i-1),this.saveSettings(),this.resetInputEls()})}).addExtraButton(s=>{s.setIcon("down-chevron-glyph").setTooltip(E("options.custom-command.move-down-tooltip")).onClick(()=>{this.arrayMove(i,i+1),this.saveSettings(),this.resetInputEls()})}).addExtraButton(s=>{s.setIcon("trash").setTooltip(E("options.custom-command.delete-tooltip")).onClick(()=>{this.lintCommands.splice(i,1),this.saveSettings(),this.resetInputEls()})}).addToggle(s=>{s.setValue(e.enabled).onChange(a=>{e.enabled=a,this.saveSettings()})})}arrayMove(e,i){if(i<0||i===this.lintCommands.length)return;let r=this.lintCommands[e];this.lintCommands[e]=this.lintCommands[i],this.lintCommands[i]=r}};var Xd=require("obsidian");var pA="gm",Ac=class extends Mt{constructor(e,i,r,s){super(e,E("options.custom-replace.name"),E("options.custom-replace.description"),E("options.custom-replace.warning"),E("options.custom-replace.add-input-button-text"),r,s,()=>{let a={label:"",find:"",replace:"",flags:pA,enabled:!0};this.regexes.push(a),this.saveSettings(),this.addRegex(a,this.regexes.length-1,!0)});this.regexes=i;this.display(),this.inputElDiv.addClass("linter-custom-regex-replacement-container")}showInputEls(){this.regexes.forEach((e,i)=>{this.addRegex(e,i)})}addRegex(e,i,r=!1){let s=this.inputElDiv.createDiv({cls:"linter-custom-regex-replacement"}),a=s.createDiv(),o=new Xd.Setting(a).addText(u=>{u.setPlaceholder(E("options.custom-replace.label-placeholder-text")).setValue(e.label).onChange(d=>{this.regexes[i].label=d,this.saveSettings()}),u.inputEl.setAttr("inputIndex",i),u.inputEl.addClass("linter-custom-regex-replacement-label-input"),r&&u.inputEl.focus()});o.controlEl.addClass("linter-custom-regex-replacement-label"),o.descEl.remove(),o.in
`," ")+i.warning.replaceAll(`
`," "));let r=this.contentEl.createDiv(),s=new Ac(r,this.plugin.settings.customRegexes,this.app,()=>{this.plugin.saveSettings()});this.addSettingSearchInfo(r,s.name,s.description.replaceAll(`
`," ")+s.warning.replaceAll(`
`," "))}};var Tc=require("obsidian");var Ec=class{constructor(n,e,i,r){this.containerEl=n;this.searchZeroState=e;this.tabNameToTab=i;this.onFocus=r;this.searchSettingInfo=new Map;this.searchSettingsDebounce=(0,Tc.debounce)(n=>{this.searchSettings(n)},1e3);for(let[s,a]of i)this.searchSettingInfo.set(s,a.searchSettingInfo);this.display()}display(){let n=new Tc.Setting(this.containerEl);n.settingEl.addClass("linter-no-border"),n.addSearch(e=>{this.search=e}),this.search.setPlaceholder(E("tabs.default-search-bar-text")),this.search.inputEl.onfocus=()=>{this.onFocus()},this.search.onChange(e=>{this.searchSettingsDebounce(e.toLowerCase())})}searchSettings(n){let e=new Set,i=function(r,s){$e(r),e.has(s)||e.add(s)};for(let[r,s]of this.searchSettingInfo)for(let a of s)if(n.trim()===""||a.alias?.includes(n)||a.description.includes(n)||a.name.includes(n))i(a.containerEl,r);else if(a.options&&a.options.length>0)for(let o of a.options){if(o.description.toLowerCase().includes(n)||o.name.toLowerCase().includes(n)){i(a.containerEl,r);break}else if(o.options){for(let l of o.options)if(l.description.toLowerCase().includes(n)||l.value.toLowerCase().includes(n)){i(a.containerEl,r);break}}Re(a.containerEl)}else Re(a.containerEl);for(let[r,s]of this.tabNameToTab)e.has(r)?$e(s.headingEl):Re(s.headingEl);e.size===0?$e(this.searchZeroState):Re(this.searchZeroState)}focusOnInput(){this.search.inputEl.focus()}};var ug=ci(to());var Pr=require("obsidian");var Ua=class{constructor(n,e,i,r=!0){this.containerEl=n;this.name=e;this.description=i;this.disabled=r;this.display()}display(){this.settingEl=this.containerEl.createDiv();let n=this.settingEl.createDiv("setting-item-info");this.nameEl=n.createDiv("setting-item-name"),this.nameEl.setText(this.name),this.descEl=n.createDiv("setting-item-description"),this.descEl.setText(this.description),this.inputContainerEl=this.settingEl.createDiv("full-width-textbox-input-wrapper"),this.inputContainerEl.onmouseover=()=>{this.getInput().trim()!=""&&this.copyEl.removeClass("linter-visually-hidden")},this.inputContainerEl.onmouseleave=()=>{this.copyEl.addClass("linter-visually-hidden")},this.inputEl=this.inputContainerEl.createEl("textarea",{cls:"full-width"}),this.inputEl.spellcheck=!1,this.inputEl.disabled=this.disabled,this.copyEl=this.inputContainerEl.createDiv({cls:"settings-copy-button linter-visually-hidden ",attr:{"aria-label":E("copy-aria-label")}}),this.copyIconEl=this.copyEl.createSpan(),(0,Pr.setIcon)(this.copyIconEl,"linter-clipboard"),this.copyIconEl.onclick=()=>{this.handleCopy(this.copyIconEl)}}getInput(){return this.inputEl.value}handleCopy(n){navigator.clipboard.writeText(this.getInput()).then(()=>{(0,Pr.setIcon)(n,"linter-success"),setTimeout(()=>{(0,Pr.setIcon)(n,"linter-clipboard")},1500)},e=>{new Pr.Notice(`${E("notice-text.copy-to-clipboard-failed")+e}`,0)})}hide(){Re(this.settingEl)}unhide(){$e(this.settingEl)}};var mA=Object.keys(ug.default.levels),xc=class extends cn{constructor(n,e,i,r){super(n,e,"Debug",i,r),this.display()}display(){let n=this.contentEl.createDiv(),e={isForEnum:!0,values:mA,descriptions:[]};this.addSettingSearchInfoForGeneralSettings(new On(n,"tabs.debug.log-level.name","tabs.debug.log-level.description","logLevel",this.plugin,e,async()=>{ao(this.plugin.settings.logLevel)})),n=this.contentEl.createDiv();let i=E("tabs.debug.linter-config.name"),r=E("tabs.debug.linter-config.description");new Ua(n,i,r).inputEl.setText(JSON.stringify(this.plugin.settings,null,2)),this.addSettingSearchInfo(n,i,r);let a=null;n=this.contentEl.createDiv();let o=new Qt(n,"tabs.debug.log-collection.name","tabs.debug.log-collection.description","recordLintOnSaveLogs",this.plugin,l=>{l?a.unhide():a.hide()});this.addSettingSearchInfoForGeneralSettings(o),n=this.contentEl.createDiv(),i=E("tabs.debug.linter-logs.name"),r=E("tabs.debug.linter-logs.description"),a=new Ua(n,i,""),a.inputEl.setText(io.join(`
`)),ct(r,a.descEl),o.getBoolean()||a.hide(),this.addSettingSearchInfo(n,i,r)}};var Oc=class extends ja.PluginSettingTab{constructor(e,i){super(e,i);this.plugin=i;this.tabNameToTab=new Map;this.selectedTab="General"}display(){let{containerEl:e}=this;e.empty();let i=e.createDiv("linter-setting-title");ja.Platform.isMobile?i.addClass("linter-mobile"):i.createEl("h1").setText(E("linter-title")),this.navContainer=e.createEl("nav",{cls:"linter-setting-header"}),this.tabNavEl=this.navContainer.createDiv("linter-setting-tab-group"),this.settingsContentEl=e.createDiv("linter-setting-content"),this.addTabs(ja.Platform.isMobile),this.createSearchZeroState(),this.generateSearchBar(i),this.selectedTab==""&&this.tabSearcher.focusOnInput()}addTabs(e){this.addTab(new wc(this.tabNavEl,this.settingsContentEl,e,this.plugin,this.app));for(let i of Object.values(K))this.addTab(new vc(this.tabNavEl,this.settingsContentEl,i,Mi.get(i),e,this.plugin));this.addTab(new Sc(this.tabNavEl,this.settingsContentEl,e,this.app,this.plugin)),this.addTab(new xc(this.tabNavEl,this.settingsContentEl,e,this.plugin))}generateSearchBar(e){this.tabSearcher=new Ec(e,this.searchZeroState,this.tabNameToTab,()=>{for(let i of this.tabNameToTab.values()){i.updateTabDisplayMode(!1,"entering search mode by focusing on the search input box");let r=this.tabSearcher.search.getValue();this.selectedTab==""&&r.trim()!=""&&this.tabSearcher.searchSettings(r.toLowerCase()),this.selectedTab=""}})}createSearchZeroState(){this.searchZeroState=this.settingsContentEl.createDiv({cls:"search-zero-state"}),Re(this.searchZeroState),this.searchZeroState.createEl("p",{text:E("empty-search-results-text")})}addTab(e){e.navButton.onclick=()=>{this.onTabClick(e.name)},e.updateTabDisplayMode(this.selectedTab===e.name,"the status is still the same"),this.tabNameToTab.set(e.name,e)}onTabClick(e){if(this.selectedTab!==e){if(this.selectedTab=="")for(let[i,r]of this.tabNameToTab)r.updateTabDisplayMode(i===e,"leaving search mode by selecting a tab");else Re(this.searchZeroState),this.tabNameToTab.get(e).updateTabDisplayMode(!0),this.tabNameToTab.get(this.selectedTab).updateTabDisplayMode(!1);this.selectedTab=e}}};var pg=require("obsidian");var fA=/^---\n/gm,dg=`${Sr}:`,Mc=class extends pg.EditorSuggest{constructor(e){super(e.app);this.plugin=e;this.inline=!1;let i=E("all-rules-option");this.ruleInfo=[{displayName:i,name:i.toLowerCase(),alias:"all"}];for(let r of on){let s=r.getName();this.ruleInfo.push({displayName:s,name:s.toLowerCase(),alias:r.alias})}}onTrigger(e,i,r){let s=i.getLine(e.line).toLowerCase();if(s.startsWith(dg)||this.disabledRulesIsEndOfStartOfFileToCursor(i.getRange({line:0,ch:0},e))){this.inline=s.startsWith(dg);let o=i.getLine(e.line).substring(0,e.ch),l=o.match(/(\S+)$/)?.first().replaceAll("[","").replaceAll("]","");if(l)return{end:e,start:{ch:o.lastIndexOf(l),line:e.line},query:l}}return null}getSuggestions(e){let[i,r]=_l(e.editor.getValue());if(r)return[];let s=e.query.toLowerCase();return this.ruleInfo.filter(o=>(o.name.contains(s)||o.alias.contains(s))&&!i.includes(o.alias))}renderSuggestion(e,i){i.addClass("mod-complex");let r=i.createDiv({cls:"suggestion-content"});r.createDiv({cls:"suggestion-title"}).setText(`${e.displayName}`),r.createDiv({cls:"suggestion-note"}).setText(`${e.alias}`)}selectSuggestion(e){if(this.context){let i=e.alias;this.inline?i=`${i},`:i=`${i}
-`,this.context.editor.replaceRange(`${i} `,this.context.start,this.context.end)}}disabledRulesIsEndOfStartOfFileToCursor(e){if(!e||!e.length||e.match(fA)?.length!=1)return!1;let i=we(e+`
`,Sr)?.trimEnd();return i===null?!1:e.trimEnd().endsWith(i)}};var kg=ci(gg()),wg=ci(to());var tr=require("obsidian");var tp="default-misspellings.md",ep=`https://raw.githubusercontent.com/platers/obsidian-linter/refs/heads/master/src/utils/${tp}`;async function yg(t,n){let e=t.app,i=t.manifest.dir??"",r=(0,tr.normalizePath)(i+"/"+tp);if(await e.vault.adapter.exists(r))return;let s=new tr.Notice(E("rules.auto-correct-common-misspellings.default-install")),a;try{a=await(0,tr.requestUrl)(ep)}catch(o){ro(E("rules.auto-correct-common-misspellings.default-install-failed").replace("{URL}",ep),o)}if(!a||a.status!==200){let o=E("rules.auto-correct-common-misspellings.default-install-failed").replace("{URL}",ep)+E("logs.see-console");await n(o);return}await e.vault.adapter.exists(i)||await e.vault.adapter.mkdir(i),await e.vault.adapter.writeBinary(r,a.arrayBuffer),s.hide()}async function bg(t){let n=t.app,e=t.manifest.dir??"",i=(0,tr.normalizePath)(e+"/"+tp);return await n.vault.adapter.exists(i)?await n.vault.adapter.read(i):(vt(E("rules.auto-correct-common-misspellings.defaults-missing").replace("{FILE}",i)),"")}var hA={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"},Mn=0,Ic=class extends Z.Plugin{constructor(){super(...arguments);this.eventRefs=[];this.isEnabled=!0;this.rulesRunner=new mc;this.overridePaste=!1;this.hasCustomCommands=!1;this.customCommandsLock=new kg.default;this.originalSaveCallback=null;this.editorLintFiles=[];this.fileLintFiles=new Set;this.customCommandsCallback=null;this.currentlyOpeningSidebar=!1;this.activeFileChangeDebouncer=new Map;this.defaultAutoCorrectMisspellings=new Map;this.hasLoadedMisspellingFiles=!1;this.saveSettingsDebounce=(0,Z.debounce)(async e=>{await this.saveData(e)},5e3)}async onload(){Kh(),lo((0,Z.getLanguage)()),It(E("logs.plugin-load")),this.isEnabled=!0;for(let e in ve){let i=ve[e];(0,Z.addIcon)(i.id,i.source)}await this.loadSettings(),this.addCommands(),this.registerEventsAndSaveCallback(),this.registerEditorSuggest(new Mc(this)),this.settingsTab=new Oc(this.app,this),this.addSettingTab(this.settingsTab)}async onunload(){It(E("logs.plugin-unload")),this.isEnabled=!1;for(let i of this.eventRefs)this.app.workspace.offref(i);let e=this.app.commands?.commands?.["editor:save-file"];e&&e.checkCallback&&this.originalSaveCallback&&(e.checkCallback=this.originalSaveCallback)}async loadSettings(){let e=await this.loadData();this.settings=Object.assign({},Pa,e),typeof this.settings.suppressMessageWhenNoChange!="boolean"&&(this.settings.suppressMessageWhenNoChange=!1),typeof this.settings.logLevel=="number"&&(this.settings.logLevel=cp(this.settings.logLevel)),ao(this.settings.logLevel),await this.setOrUpdateMomentInstance(),this.updatePasteOverrideStatus(),this.updateHasCustomCommandStatus()}async saveSettings(){this.hasLoadedMisspellingFiles||await this.loadAutoCorrectFiles(!1),this.saveSettingsDebounce(this.settings),this.updatePasteOverrideStatus(),this.updateHasCustomCommandStatus()}addCommands(){let e=this;this.addCommand({id:"lint-file",name:E("commands.lint-file.name"),editorCheckCallback(i,r,s){if(i)return e.isMarkdownFile(s.file)&&r.cm!=null;e.runLinterEditor(r)},icon:ve.file.id}),this.addCommand({id:"lint-file-unless-ignored",name:E("commands.lint-file-unless-ignored.name"),editorCheckCallback(i,r,s){if(i)return e.isMarkdownFile(s.file);!e.shouldIgnoreFile(s.file)&&r.cm&&e.runLinterEditor(r)},icon:ve.file.id}),this.addCommand({id:"lint-all-files",name:E("commands.lint-all-files.name"),icon:ve.vault.id,callback:()=>{if(this.settings.suppressLintAllFilesConfirmationModal){this.runLinterAllFiles(this.app);return}let i=E("commands.lint-all-files.start-message"),r=E("commands.lint-all-files.submit-button-text"),s=E("commands.lint-all-files.submit-button-notice-text");new qa(this.app,i,r,s,()=>this.runLinterAllFiles(this.app),this.settings.lintCommands&&this.settings.lintCommands.length>0,async()=>{this.settings.suppressLintAllFilesConfirmat
`+r),new Z.Notice(r),this.settings.ruleConfigs["auto-correct-common-misspellings"].enabled=!1,await this.saveSettings()}),!!this.settings.ruleConfigs["auto-correct-common-misspellings"].enabled)){this.defaultAutoCorrectMisspellings=or(pi(await bg(this)));for(let r of this.settings.ruleConfigs["auto-correct-common-misspellings"]["extra-auto-correct-files"]??[])if(r.filePath!=""){let s=this.getFileFromPath(r.filePath);s&&(r.customReplacements=or(pi(await this.app.vault.cachedRead(s))))}this.hasLoadedMisspellingFiles=!0}}onMenuOpenCallback(e,i,r){i instanceof Z.TFile&&this.isMarkdownFile(i)?this.shouldIgnoreFile(i)||(e.addItem(s=>{s.setIcon(ve.file.id).setTitle(E("commands.lint-file-pop-up-menu-text.name")).onClick(()=>{let a=this.app.workspace.getActiveFile(),o=this.getEditor();a===i&&o&&o.cm?this.runLinterEditor(o):this.runLinterFile(i)})}),e.addItem(s=>{s.setIcon(ve.ignoreFile.id).setTitle(E("commands.ignore-file-pop-up-menu-text.name")).onClick(()=>{this.addFileToIgnoreList(i)})})):i instanceof Z.TFolder&&(this.settings.foldersToIgnore.includes(i.path)||(e.addItem(s=>{s.setTitle(E("commands.lint-folder-pop-up-menu-text.name")).setIcon(ve.folder.id).onClick(()=>this.createFolderLintModal(i))}),e.addItem(s=>{s.setTitle(E("commands.ignore-folder-pop-up-menu-text.name")).setIcon(ve.ignoreFolder.id).onClick(()=>{this.addFolderToIgnoreList(i)})})))}async onActiveLeafChange(){if(!this.isEnabled||this.currentlyOpeningSidebar)return;let e=this.app.workspace.getActiveFile(),i=this.lastActiveFile==null?!1:await this.app.vault.adapter.exists(this.lastActiveFile.path);if(!this.settings.lintOnFileChange||!i||this.lastActiveFile===e||!this.isMarkdownFile(this.lastActiveFile)||this.shouldIgnoreFile(this.lastActiveFile)){this.lastActiveFile=e;return}try{await this.runLinterFile(this.lastActiveFile,!0)}catch(r){this.handleLintError(this.lastActiveFile,r,E("commands.lint-file.error-message")+" '{FILE_PATH}'",!1)}finally{this.lastActiveFile=e}}shouldIgnoreFile(e){for(let i of this.settings.foldersToIgnore)if(i.length>0&&e.path.startsWith((0,Z.normalizePath)(i)+"/"))return!0;for(let i of this.settings.filesToIgnore){if(!i.match)continue;if(new RegExp(`${i.match}`,i.flags).test(e.path))return!0}return!1}isMarkdownFile(e){return e&&(e.extension==="md"||this.settings.additionalFileExtensions.includes(e.extension))}async runLinterFile(e,i=!1){let r=pi(await this.app.vault.read(e)),s=this.rulesRunner.lintText(er(r,e,this.momentLocale,this.settings,this.defaultAutoCorrectMisspellings));if(r!=s){if(await this.app.vault.modify(e,s),i){let a=E("logs.file-change-lint-message-start")+" "+this.lastActiveFile.path;this.settings.displayLintOnFileChangeNotice&&new Z.Notice(a),It(a)}this.fileLintFiles.add(e);return}await this.runCustomCommandsInSidebar(e)}async runLinterAllFiles(e){let i=0;if(await Promise.all(e.vault.getMarkdownFiles().map(async r=>{if(!this.shouldIgnoreFile(r))try{await this.runLinterFile(r)}catch(s){this.handleLintError(r,s,E("commands.lint-all-files.error-message")+" '{FILE_PATH}'"),i+=1}})),i===0)new Z.Notice(E("commands.lint-all-files.success-message"),Mn);else{let r=i===1?E("commands.lint-all-files.errors-message-singular"):E("commands.lint-all-files.errors-message-plural").replace("{NUM}",i.toString());new Z.Notice(r,Mn)}}async runLinterAllFilesInFolder(e){It(E("logs.folder-lint")+e.name);let i=0,r=0,s=this.getAllFilesInFolder(e);if(await Promise.all(s.map(async a=>{if(!this.shouldIgnoreFile(a)){try{await this.runLinterFile(a)}catch(o){this.handleLintError(a,o,E("commands.lint-all-files-in-folder.error-message")+" '{FILE_PATH}'"),i+=1}r++}})),i===0)new Z.Notice(E("commands.lint-all-files-in-folder.success-message").replace("{NUM}",r.toString()).replace("{FOLDER_NAME}",e.name),Mn);else{let a=i===1?E("commands.lint-all-files-in-folder.message-singular").replace("{NUM}",r.toString()).replace("{FOLDER_NAME}",e.name):E("commands.lint-all-files-in-folder.message-plural").replace("{FILE_COUNT}",r.toString()).replace("{FOLDER_NAME}",e.name).replace("{ERROR_COUNT}",i.toString());new Z.Notice(a,Mn)}}createFolderLintModal(e){if(this.settings
`+E("disabled-conflicting-rule-notice").replace("{NAME_1}",E("rules.header-increment.start-at-h2.name")).replace("{NAME_2}",E("rules.file-name-heading.name"))),this.settings.ruleConfigs["paragraph-blank-lines"]&&this.settings.ruleConfigs["paragraph-blank-lines"].enabled&&this.settings.ruleConfigs["two-spaces-between-lines-with-content"]&&this.settings.ruleConfigs["two-spaces-between-lines-with-content"].enabled&&(this.settings.ruleConfigs["paragraph-blank-lines"].enabled=!1,e=!0,r&&(i+=`
`),r=!0,i+=`
`+E("disabled-conflicting-rule-notice").replace("{NAME_1}",E("rules.paragraph-blank-lines.name")).replace("{NAME_2}",E("rules.two-spaces-between-lines-with-content.name"))),r&&new Z.Notice(i,Mn);for(let s of on){let a=s.getDefaultOptions();if(!this.settings.ruleConfigs[s.alias]){this.settings.ruleConfigs[s.alias]=a,e=!0;continue}if(s.alias=="space-between-chinese-japanese-or-korean-and-english-or-numbers")"english-symbols-punctuation-before"in this.settings.ruleConfigs[s.alias]||(this.settings.ruleConfigs[s.alias]["english-symbols-punctuation-before"]=a["english-symbols-punctuation-before"],e=!0),"english-symbols-punctuation-after"in this.settings.ruleConfigs[s.alias]||(this.settings.ruleConfigs[s.alias]["english-symbols-punctuation-after"]=a["english-symbols-punctuation-after"],e=!0);else if(s.alias=="yaml-timestamp"){let o=s.getDefaultOptions();"force-retention-of-create-value"in this.settings.ruleConfigs[s.alias]&&("date-created-source-of-truth"in this.settings.ruleConfigs[s.alias]||(this.settings.ruleConfigs[s.alias]["force-retention-of-create-value"]?this.settings.ruleConfigs[s.alias]["date-created-source-of-truth"]="frontmatter":this.settings.ruleConfigs[s.alias]["date-created-source-of-truth"]=o["date-created-source-of-truth"]),delete this.settings.ruleConfigs[s.alias]["force-retention-of-create-value"],e=!0),"date-modified-source-of-truth"in this.settings.ruleConfigs[s.alias]||(this.settings.ruleConfigs[s.alias]["date-modified-source-of-truth"]=o["date-modified-source-of-truth"],e=!0)}for(let o of Object.keys(a))Object.hasOwn(this.settings.ruleConfigs[s.alias],o)||(this.settings.ruleConfigs[s.alias][o]=a[o],e=!0)}for(let s of this.settings.customRegexes)Object.hasOwn(s,"enabled")||(s.enabled=!0,e=!0);for(let s of this.settings.lintCommands)Object.hasOwn(s,"enabled")||(s.enabled=!0,e=!0);e&&await this.saveSettings()}createDebouncedFileUpdate(){let e=5e3;switch(this.settings.ruleConfigs["yaml-timestamp"]["update-on-file-contents-updated"]??"never"){case"after 10 seconds":e=1e4;break;case"after 15 seconds":e=15e3;break;case"after 30 seconds":e=3e4;break;case"after 1 minute":e=6e4;break}return(0,Z.debounce)(async(i,r)=>{if(!this.activeFileChangeDebouncer.has(i.path)){vt(E("logs.file-change-yaml-lint-warning"));return}let s=this.activeFileChangeDebouncer.get(i.path);s.isRunning=!0;let a=r.getValue(),o=await this.app.vault.cachedRead(i),l=a===o,c="";if(l){c=a;let u=c;if(c!=s.originalText){It(E("logs.file-change-yaml-lint-run"));try{u=this.rulesRunner.runYAMLTimestampByItself(er(c,i,this.momentLocale,this.settings,null))}catch(f){this.handleLintError(i,f,E("commands.lint-file.error-message")+" '{FILE_PATH}'",!1);return}let d,p=!1,m;if(s.markdownInfo instanceof Z.MarkdownView&&(d=s.markdownInfo,m=d.getState(),p=m.mode!=="source",p)){let f=d.getState();f.mode="source",await d.setState(f,{history:!1})}this.updateEditor(c,u,r),p&&(await d.setState(m,{history:!1}),await d.leaf.rebuildView())}else It(E("logs.file-change-yaml-lint-skipped"))}else c=o,c!=s.originalText?(It(E("logs.file-change-yaml-lint-run")),await this.app.vault.process(i,u=>{It(E("logs.file-change-yaml-lint-run"));try{return this.rulesRunner.runYAMLTimestampByItself(er(c,i,this.momentLocale,this.settings,null))}catch(d){return this.handleLintError(i,d,E("commands.lint-file.error-message")+" '{FILE_PATH}'",!1),u}})):It(E("logs.file-change-yaml-lint-skipped"));this.activeFileChangeDebouncer.delete(i.path),s.isRunning=!1},e,!0)}updateEditor(e,i,r){let a=new qr.default.diff_match_patch().diff_main(e,i),o="";return a.forEach(l=>{let[c,u]=l;if(c==qr.default.DIFF_INSERT)r.cm.dispatch({changes:[{from:r.posToOffset(this.endOfDocument(o)),insert:u}],filter:!1}),o+=u;else if(c==qr.default.DIFF_DELETE){let d=this.endOfDocument(o),p=o;p+=u;let m=this.endOfDocument(p);r.cm.dispatch({changes:[{from:r.posToOffset(d),to:r.posToOffset(m),insert:""}],filter:!1})}else o+=u}),a}displayChangedMessage(e,i){let r=this.settings.suppressMessageWhenNoChange??!1;if(this.settings.displayChanged){if(r&&e+i===0)return;let s=zh`
${e} ${E("notice-text.characters-added")}
${i} ${E("notice-text.characters-removed")}
`;new Z.Notice(s)}}handleLintError(e,i,r,s=!0){let a=r.replace("{FILE_PATH}",e.path),o=E("logs.see-console");i instanceof Rr?s?new Z.Notice(`${a} ${i.message}.
${o}`,Mn):new Z.Notice(`${i.message}.
${o}`,Mn):new Z.Notice(`${E("logs.unknown-error")} ${o}`,Mn),ro(a,i)}async modifyPasteEvent(e,i){if(!i)return;let r=e.clipboardData.getData("text/plain");if(!r)return;let s=r.trim();if(zn.lastIndex=0,zn.test(s)){vt(E("logs.paste-link-warning"));return}if(e.stopPropagation(),e.preventDefault(),!e.defaultPrevented)return;let a=this.app.vault.getConfig("autoConvertHtml"),o=e.clipboardData.getData("text/html"),l=o&&a&&o.indexOf("<!-- obsidian -->")===-1?(0,Z.htmlToMarkdown)(o):r,c=i.listSelections();if(c.length===1){let u=c[0];l=this.rulesRunner.runPasteLint(this.getLineContent(i,u),i.getSelection()??"",er(l,null,this.momentLocale,this.settings,null)),i.replaceSelection(l)}else this.handleMultiCursorPaste(i,c,l)}handleMultiCursorPaste(e,i,r){let s=this.convertContentIntoProperPasteContent(i,r),a=[];i.forEach((o,l)=>{r=this.rulesRunner.runPasteLint(this.getLineContent(e,o),e.getRange(o.anchor,o.head)??"",er(s[l],null,this.momentLocale,this.settings,null)),a.push({text:r,from:o.anchor,to:o.head})}),e.transaction({changes:a})}convertContentIntoProperPasteContent(e,i){let r=i.split(`
`),s=[];if(r.length%e.length!==0)for(let a=0;a<e.length;a++)s.push(i);else{let a=r.length/e.length,o="";for(let l=0;l<r.length;l++)o+=r[l],(l+1===e.length||(l+1)%a===0)&&(s.push(o),o="")}return s}async pasteAsPlainText(e){let i=await navigator.clipboard.readText();if(!i){new Z.Notice(E("notice-text.empty-clipboard"),Mn);return}e.replaceSelection(i)}setCustomCommandCallback(e){(0,wg.warn)(E("logs.custom-command-callback-warning")),this.customCommandsCallback=e}async runCustomCommandsInSidebar(e){if(!this.settings.lintCommands||this.settings.lintCommands.length==0||!this.hasCustomCommands)return;let i=this.app.workspace.getRightLeaf(!1),r=this.getEditor();await this.customCommandsLock.acquire("command",async()=>{this.currentlyOpeningSidebar=!0,await i.openFile(e,{active:!0}),this.rulesRunner.runCustomCommands(this.settings.lintCommands,this.app.commands),this.customCommandsCallback&&await this.customCommandsCallback(e)}),i.detach(),r&&r.focus(),this.currentlyOpeningSidebar=!1}async runCustomCommands(e){!this.settings.lintCommands||this.settings.lintCommands.length==0||!this.hasCustomCommands||await this.customCommandsLock.acquire("command",async()=>{try{this.rulesRunner.runCustomCommands(this.settings.lintCommands,this.app.commands)}catch(i){this.handleLintError(e,i,E("commands.lint-file.error-message")+" '{FILE_PATH}'",!1)}this.customCommandsCallback&&await this.customCommandsCallback(e)})}getEditor(){let e=this.app.workspace.getActiveViewOfType(Z.MarkdownView);return e?e.editor:null}getLineContent(e,i){return e.getLine(i.anchor.line)}async moveConfigValuesToKeyBasedFormat(){lo("en");let e=!1;for(let i of on){let r=E("rules."+i.alias+".name"),s=this.settings.ruleConfigs[r];if(s!=null){let a=E("rules."+i.alias+".description"),o={enabled:s[a]??!1};for(let l of i.options){if(l.configKey==="enabled")continue;let c=E("rules."+i.alias+"."+l.configKey+".name");o[l.configKey]=s[c]??l.defaultValue}this.settings.ruleConfigs[i.alias]=o,delete this.settings.ruleConfigs[r],e=!0}}return this.settings.settingsConvertedToConfigKeyValues=!0,await this.saveSettings(),lo((0,Z.getLanguage)()),e}getAllFilesInFolder(e){let i=[],r=[e];for(let s of r)for(let a of s.children)a instanceof Z.TFile&&this.isMarkdownFile(a)?i.push(a):a instanceof Z.TFolder&&r.push(a);return i}updatePasteOverrideStatus(){for(let e of Mi.get("Paste"))if(e.getOptions(this.settings)?.enabled){this.overridePaste=!0;return}this.overridePaste=!1}updateHasCustomCommandStatus(){for(let e of this.settings.lintCommands)if(e.id&&e.id.trim()!=""&&e.enabled){this.hasCustomCommands=!0;return}this.hasCustomCommands=!1}endOfDocument(e){let i=e.split(`
`);return{line:i.length-1,ch:i[i.length-1].length}}getFileFromPath(e){let i=this.app.vault.getAbstractFileByPath((0,Z.normalizePath)(e));return i instanceof Z.TFile?i:null}updateFileDebouncerText(e,i){this.activeFileChangeDebouncer.has(e.path)&&(this.activeFileChangeDebouncer.get(e.path).originalText=i)}async addFileToIgnoreList(e){this.settings.filesToIgnore.push({match:"^"+mt(e.path)+"$",flags:"",label:""}),await this.saveSettings()}async addFolderToIgnoreList(e){this.settings.foldersToIgnore.push(e.path),await this.saveSettings()}};
/* nosourcemap */