435 lines
739 KiB
JavaScript
435 lines
739 KiB
JavaScript
|
|
/*
|
|||
|
|
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
|||
|
|
if you want to view the source, please visit the github repository of this plugin
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
var yg=Object.create;var jr=Object.defineProperty;var sp=Object.getOwnPropertyDescriptor;var bg=Object.getOwnPropertyNames;var kg=Object.getPrototypeOf,vg=Object.prototype.hasOwnProperty;var ri=(t,n)=>()=>(n||t((n={exports:{}}).exports,n),n.exports),Rc=(t,n)=>{for(var e in n)jr(t,e,{get:n[e],enumerable:!0})},ap=(t,n,e,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of bg(n))!vg.call(t,r)&&r!==e&&jr(t,r,{get:()=>n[r],enumerable:!(i=sp(n,r))||i.enumerable});return t};var si=(t,n,e)=>(e=t!=null?yg(kg(t)):{},ap(n||!t||!t.__esModule?jr(e,"default",{value:t,enumerable:!0}):e,t)),wg=t=>ap(jr({},"__esModule",{value:!0}),t),x=(t,n,e,i)=>{for(var r=i>1?void 0:i?sp(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&&jr(n,e,r),r};var Fc=(t,n,e)=>{if(!n.has(t))throw TypeError("Cannot "+e)};var _=(t,n,e)=>(Fc(t,n,"read from private field"),e?e.call(t):n.get(t)),Me=(t,n,e)=>{if(n.has(t))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(t):n.set(t,e)},Ke=(t,n,e,i)=>(Fc(t,n,"write to private field"),i?i.call(t,e):n.set(t,e),e);var Dc=(t,n,e,i)=>({set _(r){Ke(t,n,r,e)},get _(){return _(t,n,i)}}),ge=(t,n,e)=>(Fc(t,n,"access private method"),e);var so=ri((cp,ro)=>{(function(t,n){"use strict";typeof define=="function"&&define.amd?define(n):typeof ro=="object"&&ro.exports?ro.exports=n():t.log=n()})(cp,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,v,w,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 L(){var N;if(!(typeof window===n||!T)){try{N=window.localStorage[T]}catch{}if(typeof N===n)try{var q=window.document.cookie,Y=encodeURIComponent(T),K=q.indexOf(Y+"=");K!==-1&&(N=/^([^;]+)/.exec(q.slice(K+Y.length+1))[1])}catch{}return g.levels[N]===void 0&&(N=void 0),N}}function C(){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 M(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 w??v??b},g.setLevel=function(N,q){return w=M(N),q!==!1&&O(w),c.call(g)},g.setDefaultLevel=function(N){v=M(N),L()||g.setLevel(N,!1)},g.resetLevel=function(){w=null,C(),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=M(s.getLevel())),c.call(g),s===g)for(var N in r)r[N].rebuild()},b=M(s?s.getLevel():"WARN");var B=L();B!=null&&(w=M(B)),c.call(g)}s=new p,s.getLogger=f
|
|||
|
|
`,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)),v=-1,w="",T,O,L,C;(v=h.indexOf(b,v+1))!=-1;){var M=r.diff_commonPrefix(f.substring(g),h.substring(v)),B=r.diff_commonSuffix(f.substring(0,g),h.substring(0,v));w.length<B+M&&(w=h.substring(v-B,v)+h.substring(v,v+M),T=f.substring(0,g-B),O=f.substring(g+M),L=h.substring(0,v-B),C=h.substring(v+M))}return w.length*2>=f.length?[T,O,L,C,w]: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]==de?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(oe,r)),t[e[i-1]+1][0]=de,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]==oe&&t[s][0]==de){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]=de,t[s-1][1]=d.substring(0,d.length-m),t[s+1][0]=oe,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_),v=g.match(R.nonAlphaNumericRegex_),w=b&&h.match(R.whitespaceRegex_),T=v&&g.match(R.whitespaceRegex_),O=w&&h.match(R.linebreakRegex_),L=T&&g.match(R.linebreakRegex_),C=O&&m.match(R.blanklineEndRegex_),M=L&&f.match(R.blanklineStartRegex_);return C||M?5:O||L?4:b&&!w&&T?3:w||T?2:b||v?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(oe,l));else if(o=="+")a.diffs.push(new R.Diff(de,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 de:i="+";break;case oe:i="-";break;case Q:i=" ";break}e[r+1]=i+encodeURI(this.diffs[r][1])+`
|
|||
|
|
`}return e.join("").replace(/%20/g," ")};Rr.exports=R;Rr.exports.diff_match_patch=R;Rr.exports.DIFF_DELETE=oe;Rr.exports.DIFF_INSERT=de;Rr.exports.DIFF_EQUAL=Q});var Uh=ri((ij,$h)=>{$h.exports=DS;var Iw=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Bw=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Rw=["Su","Mo","Tu","We","Th","Fr","Sa"],fc=["January","February","March","April","May","June","July","August","September","October","November","December"],Fw=["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"],hc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Dw=new RegExp(Iw.join("|"),"i"),Nw=new RegExp(Bw.join("|"),"i"),Kw=new RegExp("\\b("+Rw.join("|")+")\\b","i"),zw=new RegExp(fc.join("|"),"i"),Yw=new RegExp(hc.join("|"),"i"),Pw=new RegExp("\\b("+Fw.join("|")+")\\b","i"),_w=/(\d+)(st|nd|rd|th)\b/i,qw=/(\d{1,4})([/.-])(\d{1,2})[/.-](\d{1,4})/,Hw=/((\+|-)(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))$/,$w=/((\+|-)(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))$/,zr="("+["AM?","PM?"].join("|")+")",Uw=new RegExp("0\\d\\:\\d{1,2}\\:\\d{1,2}(\\s*)"+zr,"i"),jw=new RegExp("0\\d\\:\\d{1,2}(\\s*)"+zr,"i"),Vw=new RegExp("0\\d(\\s*)"+zr,"i"),Ww=new RegExp("\\d{1,2}\\:\\d{1,2}\\:\\d{1,2}(\\s*)"+zr,"i"),Gw=new RegExp("\\d{1,2}\\:\\d{1,2}(\\s*)"+zr,"i"),Qw=new RegExp("\\d{1,2}(\\s*)"+zr,"i"),Zw=new RegExp("\\d{1,2}"),Jw=new RegExp(fc.join("|")+"-\\d{2}","i"),Xw=new RegExp(hc.join("|")+"-\\d{2}","i"),Jd=new RegExp("(\\d{1,2})(\\D+)("+fc.join("|")+"|"+hc.join("|")+")(\\2)('?\\d{2,4})"),eS=/\d{2}:\d{2}:\d{2}\.\d{3}/,tS=/\d{2}:\d{2}:\d{2}\.\d{2}/,nS=/\d{2}:\d{2}:\d{2}\.\d{1}/,iS=/T\d{2}:\d{2}:\d{2}/,rS=/0\d:\d{2}:\d{2}/,sS=/0\d:\d{2}/,aS=/\b([01]?[0-9]|2[0-3]):[0-5][0-9]:\d{2}/,oS=/\b([01]?[0-9]|2[0-3]):[0-5][0-9]:\d{2}\.\d{3}/,lS=/\b([01]?[0-9]|2[0-3]):[0-5][0-9]:\d{2}\.\d{2}/,cS=/\b([01]?[0-9]|2[0-3]):[0-5][0-9]:\d{2}\.\d{1}/,uS=/\b([01]?[0-9]|2[0-3]):[0-5][0-9]/,dS=/24:00:\d{2}/,pS=/24:00:\d{2}\.\d{3}/,mS=/24:00:\d{2}\.\d{2}/,fS=/24:00:\d{2}\.\d{1}/,hS=/24:00/,gS=/\d{4}/,yS=/\d{2}/,bS=/'\d{2}/,Yh=/0\d/,Ph=/\d{1,2}/,kS=/0\d/,vS=/\d{1,2}/,wS=/^([1-9])\/([1-9]|0[1-9])$/,SS=/^([1-9])\/(1[012])$/,AS=/^(0[1-9]|[12][0-9]|3[01])\/([1-9])$/,LS=/^(0[1-9]|[12][0-9]|3[01])\/(1[012]|0[1-9])$/,ES=/^([1-9])(\D)([1-9][0-9])$/,TS=/^([1-9])(\D)([0][0-9])$/,xS=/^(0[1-9]|1[012])(\D)([1-9][0-9])$/,OS=/^(0[1-9]|1[012])(\D)([0][0-9])$/,Xd=/([/][M]|[M][/]|[MM]|[M
|
|||
|
|
`;e+=`${n.name} ${n.message}`,n.stack&&(e+=`
|
|||
|
|
`+n.stack),le.default.error(e),Wr&&co(e.substring(e.indexOf("]")+2),le.default.levels.TRACE)}function Ot(t){le.default.info(`${ao} ${t}`),Wr&&co(t,le.default.levels.INFO)}function et(t){le.default.debug(`${ao} ${t}`),Wr&&co(t,le.default.levels.DEBUG)}function kt(t){le.default.warn(`${ao} ${t}`),Wr&&co(t,le.default.levels.WARN)}function ai(t){le.default.getLevel()>le.default.levels.DEBUG||Kc.set(t,performance.now())}function Mn(t){if(le.default.getLevel()>le.default.levels.DEBUG)return;Kc.has(t)||kt(E("logs.timing-key-not-found").replace("{TIMING_KEY}",t));let n=performance.now()-Kc.get(t);et(`${t}: ${n} `+E("logs.milliseconds-abbreviation"))}function co(t,n){le.default.getLevel()<=n&&oo.push(t)}function up(){oo=[]}function zc(t){Wr=t}function uo(t){switch(t){case"INFO":{le.default.setLevel("info");break}case"TRACE":{le.default.setLevel("trace");break}case"DEBUG":{le.default.setLevel("debug");break}case"SILENT":{le.default.setLevel("silent");break}case"ERROR":{le.default.setLevel("error");break}case"WARN":{le.default.setLevel("warn");break}}}function dp(t){switch(t){case le.default.levels.INFO:return"INFO";case le.default.levels.TRACE:return"TRACE";case le.default.levels.DEBUG:return"DEBUG";case le.default.levels.SILENT:return"SILENT";case le.default.levels.ERROR:return"ERROR";case le.default.levels.WARN:return"WARN"}}var pp={};var mp={};var fp={};var hp={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 Uc(t=""){let[n]=ir(t,t.length);return`
|
|||
|
|
`+n.trim()}function Dp(t="",n=!1,e=1){let i=Uc(t),r=Bn(i,">");return(n||bo.test(t))&&e===r||e<r?i.substring(0,i.lastIndexOf(">")):i}function Og(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 Cg(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 v=t.charAt(a);if(v.trim()!==""&&v!==">")break;if(v===">"){if(c)break;l++}else if(v===`
|
|||
|
|
`)if(l===0||l===s||l+1===s)o=a,l=0,u===`
|
|||
|
|
`&&(c=!0);else break;a--,u=v}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):Bn(f,">")!=0&&!bo.test(f)&&(Zr.test(f)||Zr.test(h))?b=t.substring(o,e).trimEnd():b=Uc(f),t.substring(0,o)+b+t.substring(e)}function Mg(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 Ig(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 v,w=t.lastIndexOf(`
|
|||
|
|
`,e-1);w===-1?v=t.substring(0,o):v=t.substring(w+1,e);let T;return r?T=Dp(b,i,s):Zr.test(b)||Zr.test(v)?T=t.substring(e,o).trimEnd():T=Uc(b),t.substring(0,e)+T+t.substring(o)}function In(t,n,e,i=!1){let[r,s]=ir(t,n);if(r.trim()!==""){let o=bo.test(t.substring(n,e)),l=Bn(r,">"),c=Rg(t,e,l),u=Ig(t,r,c,o,i);return s=Bg(u,s,l),Cg(u,r,s,o,i)}let a=Mg(t,e);return Og(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 Kp(t){return t=t.replaceAll("\\f","\f"),t=t.replaceAll("\\n",`
|
|||
|
|
`),t=t.replaceAll("\\r","\r"),t=t.replaceAll("\\t"," "),t=t.replaceAll("\\v","\v"),t=t.replaceAll("\\\\","\\"),t}function rr(t,n){if(n==0)return n;let e=n;for(;e>0&&t.charAt(e-1)!==`
|
|||
|
|
`;)e--;return e}function zp(t,n,e,i){return i>t.length-1?t:t.slice(0,i)+t.slice(i,t.length).replace(n,e)}function Bn(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 yo(t){let n=typeof t;return n!="string"?n==="number":!isNaN(t)&&!isNaN(parseFloat(t))}function Yp(t,n){let e=[],i=-1;for(;(i=n.indexOf(t,i+1))>=0;)e.push(i);return e}function Bg(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 Rg(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 sr(t){let n=ar(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){kt(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 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 Fg=Rn(/\p{P}/u),dt=Rn(/[A-Za-z]/),nt=Rn(/[\dA-Za-z]/),Pp=Rn(/[#-'*+\--9=?A-Z^-~]/);function Jr(t){return t!==null&&(t<32||t===127)}var Xr=Rn(/\d/),_p=Rn(/[\dA-Fa-f]/),jc=Rn(/[!-/:-@[-`{-~]/);function F(t){return t!==null&&t<-2}function ae(t){return t!==null&&(t<0||t===32)}function $(t){return t===-2||t===-1||t===32}function qp(t){return jc(t)||Fg(t)}var Hp=Rn(/\s/);function Rn(t){return n;function n(e){return e!==null&&e>-1&&t.test(String.fromCharCode(e))}}function Vc(t){if(t===null||ae(t)||Hp(t))return 1;if(qp(t))return 2}function or(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 es={name:"attention",tokenize:Ng,resolveAll:Dg};function Dg(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);$p(d,-l),$p(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,or(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 Ng(t,n){let e=this.parser.constructs.attentionMarkers.null,i=this.previous,r=Vc(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=Vc(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 $p(t,n){t.column+=n,t.offset+=n,t._bufferIndex+=n}var Wc={name:"autolink",tokenize:Kg};function Kg(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 dt(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"),n):m===null||m===32||m===60||Jr(m)?e(m):(t.consume(m),l)}function c(m){return m===64?(t.consume(m),u):Pp(m)?(t.consume(m),c):e(m)}function u(m){return nt(m)?d(m):e(m)}function d(m){return m===46?(t.consu
|
|||
|
|
`;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 fu={};Rc(fu,{attentionMarkers:()=>Sb,contentInitial:()=>gb,disable:()=>Ab,document:()=>hb,flow:()=>bb,flowInitial:()=>yb,insideSpan:()=>wb,string:()=>kb,text:()=>vb});var hb={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:ko},gb={91:Zc},yb={[-2]:ts,[-1]:ts,32:ts},bb={35:Xc,42:di,45:[xo,di],60:tu,61:xo,95:di,96:So,126:So},kb={38:wo,92:vo},vb={[-5]:ns,[-4]:ns,[-3]:ns,33:iu,38:wo,42:es,60:[Wc,nu],91:ru,92:[Jc,vo],93:ui,95:es,96:Gc},wb={null:[es,lm]},Sb={null:[42,95]},Ab={null:[]};function hu(t){let e=Co([fu,...(t||{}).extensions||[]]),i={defined:[],lazy:{},constructs:e,content:r(rm),document:r(am),flow:r(om),string:r(cm),text:r(um)};return i;function r(s){return a;function a(o){return mm(i,s,o)}}}function gu(t){for(;!Ao(t););return t}var fm=/[\0\t\n\r]/g;function yu(){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(fm.lastIndex=d,c=fm.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 Lb=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function hm(t){return t.replace(Lb,Eb)}function Eb(t,n,e){if(n)return n;if(e.charCodeAt(0)===35){let r=e.charCodeAt(1),s=r===120||r===88;return Mo(e.slice(s?2:1),s?16:10)}return lr(e)||t}function cr(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?gm(t.position):"start"in t||"end"in t?gm(t):"line"in t||"column"in t?bu(t):""}function bu(t){return ym(t&&t.line)+":"+ym(t&&t.column)}function gm(t){return bu(t&&t.start)+"-"+bu(t&&t.end)}function ym(t){return t&&typeof t=="number"?t:1}var km={}.hasOwnProperty;function ku(t,n,e){return typeof n!="string"&&(e=n,n=void 0),Tb(e)(gu(hu(e).document().write(yu()(t,n,!0))))}function Tb(t){let n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(eo),autolinkProtocol:B,autolinkEmail:B,atxHeading:s(Za),blockQuote:s(pn),characterEscape:B,characterReference:B,codeFenced:s(bt),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(bt,a),codeText:s(Gt,a),codeTextData:B,data:B,codeFlowValue:B,definition:s(Cn),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(er),hardBreakEscape:s(Ja),hardBreakTrailing:s(Ja),htmlFlow:s(qr,a),htmlFlowData:B,htmlText:s(qr,a),htmlTextData:B,image:s(Xa),label:a,link:s(eo),listItem:s(mn),listItemValue:p,listOrdered:s(to,d),listUnordered:s(to),paragraph:s(tr),reference:A,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(Za),strong:s(no),thematicBreak:s(Hr)},exit:{atxHeading:l(),atxHeadingSequence:O,autolink:l(),autolinkEmail:pe,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:v,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(Y),hardBreakTrailing:l(Y),htmlFlow:l(K),htmlFlowData:N,htmlText:l(j),htmlTextData:N,image:l(ie),label:Ne,labelText:je,lineEnding:q,link:l(X),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:Ce,resourceDestinationString:S,resourceTitleString:Ve,resource:Xe,setextHeading:l(M),setextHeadingLineSequence:C,setextHeadingText:L,strong:l(),thematicBreak:l()}};vm(n,(t||{}).mdastExtensions||[]);let e={};return i;function
|
|||
|
|
`&&(t=t.substring(0,a.end.offset)+t.substring(a.end.offset+1)),a.end.offset<t.length&&t[a.end.offset]===`
|
|||
|
|
`&&(t=t.substring(0,a.end.offset)+t.substring(a.end.offset+1)),t=t.substring(0,a.start.offset)+t.substring(a.end.offset),s(t,o,a.start.offset)}for(let a of i){let o=a[1],l=o.referencePositions.length-o.footnotesReferencingKey.length;l=l>=0?l:0;let c=0;for(let u of o.footnotesReferencingKey){if(c+l>=o.referencePositions.length)throw new Error(E("logs.missing-footnote-error-message").replace("{FOOTNOTE}",u));r.set(u,o.referencePositions[l+c++])}}e=e.sort((a,o)=>r.get(a)-r.get(o)),e.length>0&&(t=t.trimEnd()+`
|
|||
|
|
`);for(let a of e)t+=`
|
|||
|
|
`+a;return t}function xm(t){let n=Se("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=zp(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 Ro(t,n,e){let i=Se(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=ce(t,s.start.offset,s.end.offset,a)}return t}function Om(t,n){let e=Se("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)){for(let a=0;a<s;a++){let o=r[a];_b(o,n)||(r[a]=qb(o,n))}t=ce(t,i.start.offset,i.end.offset,r.join(`
|
|||
|
|
`))}}return t}function _b(t,n){return!!(t.endsWith("<br>")&&n=="<br>"||t.endsWith("<br/>")&&n=="<br/>"||t.endsWith(" ")&&n==" "||!t.endsWith("\\\\")&&t.endsWith("\\")&&n=="\\")}function qb(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 Cm(t){let n=t.endsWith(`
|
|||
|
|
`),e=Se("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(Fo)||a.match(Do))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=ce(t,r,d,p+l.join(`
|
|||
|
|
|
|||
|
|
`)+m)}return n&&!t.endsWith(`
|
|||
|
|
`)&&(t+=`
|
|||
|
|
`),t}function Mm(t){let n=Se("link",t);for(let e of n){if(e==null)continue;let i=t.substring(e.start.offset,e.end.offset);if(!i.match(ps))continue;let r=i.indexOf("]"),s=i.substring(0,1)+i.substring(1,r).trim()+i.substring(r);t=ce(t,e.start.offset,e.end.offset,s)}return t}function Im(t,n){let e=Se("emphasis",t);for(let i of e){let r=t.substring(i.start.offset+1,i.end.offset-1);r=n(r),t=ce(t,i.start.offset+1,i.end.offset-1,r)}return t}function Bm(t,n){let e=Se("strong",t);for(let i of e){let r=t.substring(i.start.offset+2,i.end.offset-2);r=n(r),t=ce(t,i.start.offset+2,i.end.offset-2,r)}return t}function Kn(t,n,e=!1){let i=Yb(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);Wm.test(a)&&(s+=4,a=a.substring(4)),a=n(a),t=ce(t,s,r.position.end.offset,a)}return t}function Rm(t){let n=Se("code",t);for(let e of n){let i=t.substring(e.start.offset,e.end.offset);!i.startsWith("```")&&!i.startsWith("~~~")||(t=In(t,e.start.offset,e.end.offset))}return t}function Fm(t,n){let e=Se("math",t);for(let i of e)t=In(t,i.start.offset,i.end.offset);e=Se("inlineMath",t);for(let i of e)t.substring(i.start.offset,i.end.offset).startsWith("$".repeat(n))&&(t=In(t,i.start.offset,i.end.offset));return t}function Dm(t){let n=Se("blockquote",t);for(let e of n){let i=e.end.offset;for(;i<t.length-1&&t.charAt(i)!==`
|
|||
|
|
`;)i++;t=In(t,e.start.offset,i,!0)}return t}function Nm(t){let n=Se("thematicBreak",t);for(let e of n)t=In(t,e.start.offset,e.end.offset);return t}function Km(t,n,e,i){let r=Se("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,v)=>{let w=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"?(w=c.get(T)+1,c.set(T,w)):i&&(w=c.get(T)):c.set(T,w),d>T&&u(T,d),d=T,`${m}${w}${e}${v}`}),t=ce(t,a,s.end.offset,o)}return t}function zm(t,n){let e=Se("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=ce(t,s.start.offset,s.end.offset,a))}return t}function Iu(t,n){let e=Se("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=ce(t,i.start.offset,r,s)}return t}function Ym(t,n){let e=Se("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=Hb(a,n,s.start.offset);for(let l of o)t=Lm(t,l.startIndex,l.endIndex,i,r)}e=Se("inlineMath",t);for(let s of e)t.substring(s.start.offset,s.end.offset).startsWith("$".repeat(n))&&(t=Lm(t,s.start.offset,s.end.offset,i,r));return t}function Hb(t,n,e){let i="$".repeat(n),r=n;for(;t.charAt(r)==="$";)i+="$",r++;let s=[],a=Bn(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 Lm(t,n,e,i,r){let s=t.substring(rr(t,n),n)??"",[a]=ir(s,s.length),o=t.substring(rr(t,e),e)??"",l=t.substring(n,e),c=Hm.test(s.trim()),u=!1;for(l=l.replace(i,(d,p,m="")=>{let f="";return!c&&s.trim()!=""?(f+=`
|
|||
|
|
`,u=!0):c&&!Ou.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&&Ou.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 ce(t,n,e,l)}function ar(t){let n=[...t.matchAll($m)],e=[];for(let i of n){let r=rr(t,i.index);if(r===0)continue;let s=rr(t,r-1),a=i[0],o=t.substring(r,i.index+a.length);if($b(o,a))continue;let l=s,c=t.substring(s,r-1);if(!a.includes("|")&&!c.includes("|"))continue;c=c.replace(Cu,f=>{let h=f.trim();return h===""||h==="|"||(l+=f.length-1),""});let u=a.replace(Cu,"");if(c.endsWith("|")&&(c=c.slice(0,-1)),u.endsWith("|")&&(u=u.slice(0,-1)),Em(c)!==Em(u))continue;if(s!==0){let f=rr(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&&Um.test(p[m]);)d+=p[m].length+1,m++;e.push({startIndex:l,endIndex:d})}return e.reverse()}function $b(t,n){if(t.trim()===""||n.includes("||"))return!0;let e=t.replace(n,"");return/[^\s>]/.test(e)}function Em(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 Pm(t){let n=0,e=[],i=[...t.matchAll(jm)];if(!i||i.length===0)return e;let r=[...t.matchAll(Vm)];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 _m(t,n){let e=Se("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=ce(t,i.start.offset+3,i.start.offset+3,n))}return t}function qm(t,n){let e=Pb(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=ce(t,r.startIndex,r.endIndex,r.newText);return t}var zn=/^([ \t]*)(#+)([ \t]+)([^\n\r]*?)([ \t]+#+)?$/gm,Gm=`^XXX\\.*?
|
|||
|
|
(?:((?:.|
|
|||
|
|
)*?)
|
|||
|
|
)?XXX(?=\\s|$)$`,He=/^---\n((?:(((?!---)(?:.|\n)*?)\n)?))---(?=\n|$)/,Ub=Gm.replaceAll("X","`"),jb=Gm.replaceAll("X","~"),Vb=`^(( |( {4})).*
|
|||
|
|
)+`,cO=new RegExp(`${Ub}|${jb}|${Vb}`,"gm"),No=/(!?)\[{2}([^\][\n|]+)(\|([^\][\n|]+))?(\|([^\][\n|]+))?\]{2}/g,ps=/(!?)\[([^[]*)\](\(.*\))/g,ms=/(\s|^)(#[\p{L}\-_\d/\p{Emoji_Presentation}]+)/gu,Qm=/^%%\n[^%]*\n%%/gm,fs=/[,\s]+/,Ko=/(\. ?){2}\./g,hs="\\s*(>\\s*)*",Ou=/^(>( |\t)*)+\$*?$/m,Hm=/^\s*(>\s*)+/m,$m=/(\|? *:?-{1,}:? *\|?)(\| *:?-{1,}:? *\|?)*( |\t)*$/gm,Cu=/^(((>[ ]?)*)|([ ]{0,3}))\|/m,Um=/[^\n]*?\|[^\n]*?(\n|$)/m,Zm=/(([a-z\-0-9]+:)\/{2,3})([^\s/?#]*[^\s")'.?!/]|[/])?(([/?#][^\s")']*[^\s")'.?!])|[/])?/gi,mi=/(?:(?:(?:[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,uO=new RegExp("^"+mi.source+"$","si"),Jm=/<a[\s]+([^>]+)>((?:.(?!<\/a>))*.)<\/a>/g,Xm=/[\p{L}\p{N}\p{Pc}\p{M}\-'’`]+/gu,ef=/&[^\s]+;$/mi,jm=cf(!0),Vm=cf(!1),tf=/[“”„«»]/g,nf=/[‘’‚‹›]/g,rf=/<%[^]*?%>/g,fi="\\[.\\]",Wm=new RegExp(`^${fi}`),sf=new RegExp(`^${hs}- ${fi} `),zo=new RegExp(`^\\s*- ${fi} `),Fo=new RegExp(`^\\s*(-|\\*|\\+|\\d+[.)]|- (${fi}))`,"m"),Do=/^(\[\^[^\]]*\]) ?([,.;!:?])/gm,bo=/^(>\s*)+\[![^\s]*\]/m,Zr=/^\n?(>\s*)+((```)|(~~~))/m,Bu=RegExp(/\p{L}/,"u");function it(t){return t.replace(/\$/g,"$$$$")}function Zt(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function af(t){let n=t.match(No);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 of(t){let n=ar(t);if(n.length===0)return t;for(let e of n)t=In(t,e.startIndex,e.endIndex);return t}function Yo(t){let n=t.match(/^#\s+(.*)/m);if(n&&n[1]){let e=n[1];return e=e.replaceAll(No,(i,r,s,a)=>a!=null?a.replace("|",""):s),e.replaceAll(ps,"$2")}return""}function lf(t){return[...t.matchAll(ms)].map(n=>n[2])}function cf(t){let n="(?:<!-{2,}|%%) *linter-{ENDING_TEXT} *(?:-{2,}>|%%)",e="";return t?e+="disable":e+="enable",new RegExp(n.replace("{ENDING_TEXT}",e),"g")}var Po=Symbol.for("yaml.alias"),_o=Symbol.for("yaml.document"),Mt=Symbol.for("yaml.map"),Ru=Symbol.for("yaml.pair"),mt=Symbol.for("yaml.scalar"),gn=Symbol.for("yaml.seq"),rt=Symbol.for("yaml.node.type"),It=t=>!!t&&typeof t=="object"&&t[rt]===Po,Bt=t=>!!t&&typeof t=="object"&&t[rt]===_o,Rt=t=>!!t&&typeof t=="object"&&t[rt]===Mt,ee=t=>!!t&&typeof t=="object"&&t[rt]===Ru,G=t=>!!t&&typeof t=="object"&&t[rt]===mt,Ft=t=>!!t&&typeof t=="object"&&t[rt]===gn;function re(t){if(t&&typeof t=="object")switch(t[rt]){case Mt:case gn:return!0}return!1}function te(t){if(t&&typeof t=="object")switch(t[rt]){case Po:case Mt:case mt:case gn:return!0}return!1}var uf=t=>(G(t)||re(t))&&!!t.anchor;var ot=Symbol("break visit"),df=Symbol("skip children"),Jt=Symbol("remove node");function Dt(t,n){let e=pf(n);Bt(t)?ur(null,t.contents,e,Object.freeze([t]))===Jt&&(t.contents=null):
|
|||
|
|
`)}};Xt.defaultYaml={explicit:!1,version:"1.2"};Xt.defaultTags={"!!":"tag:yaml.org,2002:"};function Ho(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 Fu(t){let n=new Set;return Dt(t,{Value(e,i){i.anchor&&n.add(i.anchor)}}),n}function Du(t,n){for(let e=1;;++e){let i=`${t}${e}`;if(!n.has(i))return i}}function hf(t,n){let e=[],i=new Map,r=null;return{onAnchor:s=>{e.push(s),r||(r=Fu(t));let a=Du(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)||re(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 Yn(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=Yn(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=Yn(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=Yn(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=Yn(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||!uf(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 Pn=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(!Bt(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"?Yn(s,{"":o},"",o):o}};var yn=class extends Pn{constructor(n){super(Po),this.source=n,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(n){let e;return Dt(n,{Node:(i,r)=>{if(r===this)return Dt.BREAK;r.anchor===this.source&&(e=r)}}),e}toJSON(n,e){if(!e)return{source:this.source};let{anchors:i,doc:r,maxAliasCount:s}=e,a=this.resolve(r);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||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=$o(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(Ho(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 $o(t,n,e){if(It(n)){let i=n.resolve(t),r=e&&i&&e.get(i);return r?r.count*r.aliasCount:0}else if(re(n)){let i=0;for(let r of n.items){let s=$o(t,r,e);s>i&&(i=s)}return i}else if(ee(n)){let i=$o(t,n.key,e),r=$o(t,n.value,e);return Math.max(i,r)}return 1}var Uo=t=>!t||typeof t!="function"&&typeof t!="object",P=class extends Pn{constructor(n){super(mt),this.value=n}toJSON(n,e){return e?.keep?this.value:Be(this.value,n,e)}toString(){return String(this.value)}};P.BLOCK_FOLDED="BLOCK_FOLDED";P.BLOCK_LITERAL="BLOCK_LITERAL";P.PLAIN="PLAIN";P.QUOTE_DOUBLE="QUOTE_DOUBLE";P.QUOTE_SINGLE="QUOTE_SINGLE";var Qb="tag:yaml.org,2002:";function Zb(t,n,e){if(n){let i=e.filter(s=>s.tag===n),r=i.find(s=>!s.format)??i[0];if(!r)th
|
|||
|
|
`)?wt(e,n):e.includes(`
|
|||
|
|
`)?`
|
|||
|
|
`+wt(e,n):(t.endsWith(" ")?"":" ")+e;var Nu="flow",jo="block",ys="quoted";function bs(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===jo&&(h=yf(t,h,n.length),h!==-1&&(d=h+l));for(let w;w=t[h+=1];){if(e===ys&&w==="\\"){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(w===`
|
|||
|
|
`)e===jo&&(h=yf(t,h,n.length)),d=h+n.length+l,p=void 0;else{if(w===" "&&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===ys){for(;m===" "||m===" ";)m=w,w=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=w}if(f&&o&&o(),c.length===0)return t;a&&a();let v=t.slice(0,c[0]);for(let w=0;w<c.length;++w){let T=c[w],O=c[w+1]||t.length;T===0?v=`
|
|||
|
|
${n}${t.slice(0,O)}`:(e===ys&&u[T]&&(v+=`${t[T]}\\`),v+=`
|
|||
|
|
${n}${t.slice(T+1,O)}`)}return v}function yf(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 Wo=(t,n)=>({indentAtStart:n?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Go=t=>/^(%|---|\.\.\.)/m.test(t);function Jb(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 ks(t,n){let e=JSON.stringify(t);if(n.options.doubleQuotedAsJSON)return e;let{implicitKey:i}=n,r=n.options.doubleQuotedMinMultiLineLength,s=n.indent||(Go(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:bs(a,s,ys,Wo(n,!1))}function Ku(t,n){if(n.options.singleQuote===!1||n.implicitKey&&t.includes(`
|
|||
|
|
`)||/[ \t]\n|\n[ \t]/.test(t))return ks(t,n);let e=n.indent||(Go(t)?" ":""),i="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
|
|||
|
|
${e}`)+"'";return n.implicitKey?i:bs(i,e,Nu,Wo(n,!1))}function fr(t,n){let{singleQuote:e}=n.options,i;if(e===!1)i=ks;else{let r=t.includes('"'),s=t.includes("'");r&&!s?i=Ku:s&&!r?i=ks:i=e?Ku:ks}return i(t,n)}var zu;try{zu=new RegExp(`(^|(?<!
|
|||
|
|
))
|
|||
|
|
+(?!
|
|||
|
|
|$)`,"g")}catch{zu=/\n+(?!\n|$)/g}function Vo({comment:t,type:n,value:e},i,r,s){let{blockQuote:a,commentString:o,lineWidth:l}=i.options;if(!a||/\n[\t ]+$/.test(e)||/^\s*$/.test(e))return fr(e,i);let c=i.indent||(i.forceBlockIndent||Go(e)?" ":""),u=a==="literal"?!0:a==="folded"||n===P.BLOCK_FOLDED?!1:n===P.BLOCK_LITERAL?!0:!Jb(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(zu,`$&${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 v=e.substring(0,b<g?b+1:g);v&&(e=e.substring(v.length),v=v.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}`),L=!1,C=Wo(i,!0);a!=="folded"&&n!==P.BLOCK_FOLDED&&(C.onOverflow=()=>{L=!0});let M=bs(`${v}${O}${m}`,c,jo,C);if(!L)return`>${T}
|
|||
|
|
${c}${M}`}return e=e.replace(/\n+/g,`$&${c}`),`|${T}
|
|||
|
|
${c}${v}${e}${m}`}function Xb(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 fr(s,n);if(!s||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return o||u||!s.includes(`
|
|||
|
|
`)?fr(s,n):Vo(t,n,e,i);if(!o&&!u&&r!==P.PLAIN&&s.includes(`
|
|||
|
|
`))return Vo(t,n,e,i);if(Go(s)){if(l==="")return n.forceBlockIndent=!0,Vo(t,n,e,i);if(o&&l===c)return fr(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 fr(s,n)}return o?d:bs(d,l,Nu,Wo(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!==P.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(o=P.QUOTE_DOUBLE);let l=u=>{switch(u){case P.BLOCK_FOLDED:case P.BLOCK_LITERAL:return r||s?fr(a.value,n):Vo(a,n,e,i);case P.QUOTE_DOUBLE:return ks(a.value,n);case P.QUOTE_SINGLE:return Ku(a.value,n);case P.PLAIN:return Xb(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 Qo(t,n){let e=Object.assign({blockQuote:!0,commentString:gf,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,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 ek(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??typeof i;throw new Error(`Tag not resolved for ${r} value`)}return e}function tk(t,n,{anchors:e,doc:i}){if(!i.directives)return"";let r=[],s=(G(t)||re(t))&&t.anchor;s&&Ho(s)&&(e.add(s),r.push(`&${s}`));let a=t.tag?t.tag:n.default?null:n.tag;return a&&r.push(i.directives.tagString(a)),r.join(" ")}function vn(t,n,e,i){if(ee(t))return t.toString(n,e,i);if(It(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=ek(n.doc.schema.tags,s));let a=tk(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 bf({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(re(t)||!te(t)&&typeof t=="object"){let C="With simple keys, collection cannot be used as a key value";throw new Error(C)}}let m=!d&&(!t||p&&n==null&&!e.inFlow||re(t)||(G(t)?t.type===P.BLOCK_FOLDED||t.type===P.BLOCK_LITERAL:typeof t=="object"));e=Object.assign({},e,{allNullValues:!1,implicitKey:!m&&(d||!s),indent:o+l});let f=!1,h=!1,g=vn(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+=en(g,e.indent,c(p)):h&&r&&r(),g;f&&(p=null),m?(p&&(g+=en(g,e.indent,c(p))),g=`? ${g}
|
|||
|
|
${o}:`):(g=`${g}:`,p&&(g+=en(g,e.indent,c(p))));let b,v,w;te(n)?(b=!!n.spaceBefore,v=n.commentBefore,w=n.comment):(b=!1,v=null,w=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&&Ft(n)&&!n.flow&&!n.tag&&!n.anchor&&(e.indent=e.indent.substring(2));let T=!1,O=vn(n,e,()=>T=!0,()=>h=!0),L=" ";if(p||b||v){if(L=b?`
|
|||
|
|
`:"",v){let C=c(v);L+=`
|
|||
|
|
${wt(C,e.indent)}`}O===""&&!e.inFlow?L===`
|
|||
|
|
`&&(L=`
|
|||
|
|
|
|||
|
|
`):L+=`
|
|||
|
|
${e.indent}`}else if(!m&&re(n)){let C=O[0],M=O.indexOf(`
|
|||
|
|
`),B=M!==-1,N=e.inFlow??n.flow??n.items.length===0;if(B||!N){let q=!1;if(B&&(C==="&"||C==="!")){let Y=O.indexOf(" ");C==="&"&&Y!==-1&&Y<M&&O[Y+1]==="!"&&(Y=O.indexOf(" ",Y+1)),(Y===-1||M<Y)&&(q=!0)}q||(L=`
|
|||
|
|
${e.indent}`)}}else(O===""||O[0]===`
|
|||
|
|
`)&&(L="");return g+=L+O,e.inFlow?T&&i&&i():w&&!T?g+=en(g,e.indent,c(w)):h&&r&&r(),g}function Zo(t,n){(t==="debug"||t==="warn")&&console.warn(n)}var Jo="<<",Nt={identify:t=>t===Jo||typeof t=="symbol"&&t.description===Jo,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new P(Symbol(Jo)),{addToJSMap:Pu}),stringify:()=>Jo},kf=(t,n)=>(Nt.identify(n)||G(n)&&(!n.type||n.type===P.PLAIN)&&Nt.identify(n.value))&&t?.doc.schema.tags.some(e=>e.tag===Nt.tag&&e.default);function Pu(t,n,e){if(e=t&&It(e)?e.resolve(t.doc):e,Ft(e))for(let i of e.items)Yu(t,n,i);else if(Array.isArray(e))for(let i of e)Yu(t,n,i);else Yu(t,n,e)}function Yu(t,n,e){let i=t&&It(e)?e.resolve(t.doc):e;if(!Rt(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 Xo(t,n,{key:e,value:i}){if(te(e)&&e.addToJSMap)e.addToJSMap(t,n,i);else if(kf(t,e))Pu(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=nk(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 nk(t,n,e){if(n===null)return"";if(typeof n!="object")return String(n);if(te(t)&&e?.doc){let i=Qo(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)+'..."'),Zo(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 hr(t,n,e){let i=bn(t,void 0,e),r=bn(n,void 0,e);return new Ae(i,r)}var Ae=class t{constructor(n,e=null){Object.defineProperty(this,rt,{value:Ru}),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 Xo(e,i,this)}toString(n,e,i){return n?.doc?bf(this,n,e,i):JSON.stringify(this)}};function tl(t,n,e){return(n.inFlow??t.flow?rk:ik)(t,n,e)}function ik({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(""),el(e,p,h.commentBefore,d),h.comment&&(g=h.comment);else if(ee(h)){let v=te(h.key)?h.key:null;v&&(!d&&v.spaceBefore&&p.push(""),el(e,p,v.commentBefore,d))}d=!1;let b=vn(h,u,()=>g=null,()=>d=!0);g&&(b+=en(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+=`
|
|||
|
|
`+wt(c(t),l),o&&o()):d&&a&&a(),m}function rk({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(""),el(n,d,h.commentBefore,!1),h.comment&&(g=h.comment);else if(ee(h)){let v=te(h.key)?h.key:null;v&&(v.spaceBefore&&d.push(""),el(n,d,v.commentBefore,!1),v.comment&&(c=!0));let w=te(h.value)?h.value:null;w?(w.comment&&(g=w.comment),w.commentBefore&&(c=!0)):h.value==null&&v?.comment&&(g=v.comment)}g&&(c=!0);let b=vn(h,l,()=>g=null);f<t.length-1&&(b+=","),g&&(b+=en(b,i,o(g))),!c&&(d.length>u||b.includes(`
|
|||
|
|
`))&&(c=!0),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 el({indent:t,options:{commentString:n}},e,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){let s=wt(n(i),t);e.push(s.trimStart())}}function _n(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 ye=class extends pr{static get tagName(){return"tag:yaml.org,2002:map"}constructor(n){super(Mt,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(hr(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 Ae(n,n?.value):i=new Ae(n.key,n.value);let r=_n(this.items,i.key),s=this.schema?.sortMapEntries;if(r){if(!e)throw new Error(`Key ${i.key} already set`);G(r.value)&&Uo(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=_n(this.items,n);return e?this.items.splice(this.items.indexOf(e),1).length>0:!1}get(n,e){let r=_n(this.items,n)?.value;return(!e&&G(r)?r.value:r)??void 0}has(n){return!!_n(this.items,n)}set(n,e){this.add(new Ae(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)Xo(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})),tl(this,n,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:n.indent||"",onChompKeep:i,onComment:e})}};var Kt={collection:"map",default:!0,nodeClass:ye,tag:"tag:yaml.org,2002:map",resolve(t,n){return Rt(t)||n("Expected a mapping for this tag"),t},createNode:(t,n,e)=>ye.from(t,n,e)};var Ze=class extends pr{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=nl(n);return typeof e!="number"?!1:this.items.splice(e,1).length>0}get(n,e){let i=nl(n);if(typeof i!="number")return;let r=this.items[i];return!e&&G(r)?r.value:r}has(n){let e=nl(n);return typeof e=="number"&&e<this.items.length}set(n,e){let i=nl(n);if(typeof i!="number")throw new Error(`Expected a valid index, not ${n}.`);let r=this.items[i];G(r)&&Uo(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?tl(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 nl(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 Ft(t)||n("Expected a sequence for this tag"),t},createNode:(t,n,e)=>Ze.from(t,n,e)};var qn={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 hi={identify:t=>t==null,createNode:()=>new P(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new P(null),stringify:({source:t},n)=>typeof t=="string"&&hi.test.test(t)?t:n.options.nullStr};var vs={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new P(t[0]==="t"||t[0]==="T"),stringify({source:t,valu
|
|||
|
|
`:" ")}return kn({comment:t,type:n,value:o},i,r,s)}};function qu(t,n){if(Ft(t))for(let e=0;e<t.items.length;++e){let i=t.items[e];if(!ee(i)){if(Rt(i)){i.items.length>1&&n("Each pair must have its own sequence indicator");let r=i.items[0]||new Ae(new P(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 Ae(i)}}else n("Expected a sequence for this tag");return t}function Hu(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(hr(o,l,e))}return r}var Ss={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:qu,createNode:Hu};var gr=class t extends Ze{constructor(){super(),this.add=ye.prototype.add.bind(this),this.delete=ye.prototype.delete.bind(this),this.get=ye.prototype.get.bind(this),this.has=ye.prototype.has.bind(this),this.set=ye.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=Hu(n,e,i),s=new this;return s.items=r.items,s}};gr.tag="tag:yaml.org,2002:omap";var As={collection:"seq",identify:t=>t instanceof Map,nodeClass:gr,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,n){let e=qu(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 gr,e)},createNode:(t,n,e)=>gr.from(t,n,e)};function Lf({value:t,source:n},e){return n&&(t?$u:Uu).test.test(n)?n:t?e.options.trueStr:e.options.falseStr}var $u={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 P(!0),stringify:Lf},Uu={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 P(!1),stringify:Lf};var Ef={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},Tf={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)}},xf={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 P(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 Ls=t=>typeof t=="bigint"||Number.isInteger(t);function dl(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 ju(t,n,e){let{value:i}=t;if(Ls(i)){let r=i.toString(n);return i<0?"-"+e+r.substr(1):e+r}return Je(t)}var Of={identify:Ls,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,n,e)=>dl(t,2,2,e),stringify:t=>ju(t,2,"0b")},Cf={identify:Ls,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,n,e)=>dl(t,1,8,e),stringify:t=>ju(t,8,"0")},Mf={identify:Ls,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,n,e)=>dl(t,0,10,e),stringify:Je},If={identify:Ls,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,n,e)=>dl(t,2,16,e),stringify:t=>ju(t,16,"0x")};var yr=class t extends ye{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(wt(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(wt(s(l),"")))}return e.join(`
|
|||
|
|
`)+`
|
|||
|
|
`}var Yt=class t{constructor(n,e,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,rt,{value:_o});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 Xt({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:_o}});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){kr(this.contents)&&this.contents.add(n)}addIn(n,e){kr(this.contents)&&this.contents.addIn(n,e)}createAlias(n,e){if(!n.anchor){let i=Fu(this);n.anchor=!e||i.has(e)?Du(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=v=>typeof v=="number"||v instanceof String||v 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}=hf(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&&re(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 Ae(r,s)}delete(n){return kr(this.contents)?this.contents.delete(n):!1}deleteIn(n){return mr(n)?this.contents==null?!1:(this.contents=null,!0):kr(this.contents)?this.contents.deleteIn(n):!1}get(n,e){return re(this.contents)?this.contents.get(n,e):void 0}getIn(n,e){return mr(n)?!e&&G(this.contents)?this.contents.value:this.contents:re(this.contents)?this.contents.getIn(n,e):void 0}has(n){return re(this.contents)?this.contents.has(n):!1}hasIn(n){return mr(n)?this.contents!==void 0:re(this.contents)?this.contents.hasIn(n):!1}set(n,e){this.contents==null?this.contents=gs(this.schema,[n],e):kr(this.contents)&&this.contents.set(n,e)}setIn(n,e){mr(n)?this.contents=e:this.contents==null?this.contents=gs(this.schema,Array.from(n),e):kr(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 Xt({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 Xt({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 Ts(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"?Yn(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&&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 tn(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,v=null,w=null,T=null,O=null;for(let M of t)switch(f&&(M.type!=="space"&&M.type!=="newline"&&M.type!=="comma"&&s(M.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),f=!1),h&&(c&&M.type!=="comment"&&M.type!=="newline"&&s(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),M.type){case"space":!n&&(e!=="doc-start"||i?.type!=="flow-collection")&&M.source.includes(" ")&&(h=M),u=!0;break;case"comment":{u||s(M,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let B=M.source.substring(1)||" ";d?d+=p+B:d=B,p="",c=!1;break}case"newline":c?d?d+=M.source:(!T||e!=="seq-item-ind")&&(l=!0):p+=M.source,c=!0,m=!0,(g||b)&&(v=M),u=!0;break;case"anchor":g&&s(M,"MULTIPLE_ANCHORS","A node can have at most one anchor"),M.source.endsWith(":")&&s(M.offset+M.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=M,O===null&&(O=M.offset),c=!1,u=!1,f=!0;break;case"tag":{b&&s(M,"MULTIPLE_TAGS","A node can have at most one tag"),b=M,O===null&&(O=M.offset),c=!1,u=!1,f=!0;break}case e:(g||b)&&s(M,"BAD_PROP_ORDER",`Anchors and tags must be after the ${M.source} indicator`),T&&s(M,"UNEXPECTED_TOKEN",`Unexpected ${M.source} in ${n??"collection"}`),T=M,c=e==="seq-item-ind"||e==="explicit-key-ind",u=!1;break;case"comma":if(n){w&&s(M,"UNEXPECTED_TOKEN",`Unexpected , in ${n}`),w=M,c=!1,u=!1;break}default:s(M,"UNEXPECTED_TOKEN",`Unexpected ${M.type} token`),c=!1,u=!1}let L=t[t.length-1],C=L?L.offset+L.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:w,found:T,spaceBefore:l,comment:d,hasNewline:m,anchor:g,tag:b,newlineAfterProp:v,end:C,start:O??C}}function Hn(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(Hn(n.key)||Hn(n.value))return!0}return!1;default:return!0}}function Cs(t,n,e){if(n?.type==="flow-collection"){let i=n.end[0];i.indent===t&&(i.source==="]"||i.source==="}")&&Hn(n)&&e(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function hl(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 Kf="All mapping items must start at the same column";function zf({composeNode:t,composeEmptyNode:n},e,i,r,s){let a=s?.nodeClass??ye,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=tn(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",Kf)),!h.anchor&&!h.tag&&!m){c=h.end,h.comment&&(o.comment?o.comment+=`
|
|||
|
|
`+h.comment:o.comment=h.comment);continue}(h.newlineAfterProp||Hn(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",Kf);e.atKey=!0;let b=h.end,v=p?t(e,p,h,r):n(e,b,d,null,h,r);e.schema.compat&&Cs(i.indent,p,r),e.atKey=!1,hl(e,o.items,v)&&r(b,"DUPLICATE_KEY","Map keys must be unique");let w=tn(m??[],{indicator:"map-value-ind",next:f,offset:v.range[2],onError:r,parentIndent:i.indent,startOnNewline:!p||p.type==="block-scalar"});if(l=w.end,w.found){g&&(f?.type==="block-map"&&!w.hasNewline&&r(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),e.options.strict&&h.start<w.found.offset-1024&&r(v.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,w,r):n(e,l,m,null,w,r);e.schema.compat&&Cs(i.indent,f,r),l=T.range[2];let O=new Ae(v,T);e.options.keepSourceTokens&&(O.srcToken=u),o.items.push(O)}else{g&&r(v.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),w.comment&&(v.comment?v.comment+=`
|
|||
|
|
`+w.comment:v.comment=w.comment);let T=new Ae(v);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 Yf({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=tn(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&&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&&Cs(i.indent,d,r),l=m.range[2],o.items.push(m)}return o.range=[i.offset,l,c??l],o}function nn(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 Qu="Block collections are not allowed within flow collections",Zu=t=>t&&(t.type==="block-map"||t.type==="block-seq");function Pf({composeNode:t,composeEmptyNode:n},e,i,r,s){let a=i.start.source==="{",o=a?"flow map":"flow sequence",l=s?.nodeClass??(a?ye: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:v,key:w,sep:T,value:O}=b,L=tn(v,{flow:o,indicator:"explicit-key-ind",next:w??T?.[0],offset:d,onError:r,parentIndent:i.indent,startOnNewline:!1});if(!L.found){if(!L.anchor&&!L.tag&&!T&&!O){g===0&&L.comma?r(L.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`):g<i.items.length-1&&r(L.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${o}`),L.comment&&(c.comment?c.comment+=`
|
|||
|
|
`+L.comment:c.comment=L.comment),d=L.end;continue}!a&&e.options.strict&&Hn(w)&&r(w,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(g===0)L.comma&&r(L.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`);else if(L.comma||r(L.start,"MISSING_CHAR",`Missing , between ${o} items`),L.comment){let C="";e:for(let M of v)switch(M.type){case"comma":case"space":break;case"comment":C=M.source.substring(1);break e;default:break e}if(C){let M=c.items[c.items.length-1];ee(M)&&(M=M.value??M.key),M.comment?M.comment+=`
|
|||
|
|
`+C:M.comment=C,L.comment=L.comment.substring(C.length+1)}}if(!a&&!T&&!L.found){let C=O?t(e,O,L,r):n(e,L.end,T,null,L,r);c.items.push(C),d=C.range[2],Zu(O)&&r(C.range,"BLOCK_IN_FLOW",Qu)}else{e.atKey=!0;let C=L.end,M=w?t(e,w,L,r):n(e,C,v,null,L,r);Zu(w)&&r(M.range,"BLOCK_IN_FLOW",Qu),e.atKey=!1;let B=tn(T??[],{flow:o,indicator:"map-value-ind",next:O,offset:M.range[2],onError:r,parentIndent:i.indent,startOnNewline:!1});if(B.found){if(!a&&!L.found&&e.options.strict){if(T)for(let Y of T){if(Y===B.found)break;if(Y.type==="newline"){r(Y,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}L.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&&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?Zu(O)&&r(N.range,"BLOCK_IN_FLOW",Qu):B.comment&&(M.comment?M.comment+=`
|
|||
|
|
`+B.comment:M.comment=B.comment);let q=new Ae(M,N);if(e.options.keepSourceTokens&&(q.srcToken=b),a){let Y=c;hl(e,Y.items,M)&&r(C,"DUPLICATE_KEY","Map keys must be unique"),Y.items.push(q)}else{let Y=new ye(e.schema);Y.flow=!0,Y.items.push(q);let K=(N??M).range;Y.range=[M.range[0],K[1],K[2]],c.items.push(Y)}d=N?N.range[2]:B.end}}let p=a?"}":"]",[m,...f]=i.end,h=d;if(m&&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=nn(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 Ju(t,n,e,i,r,s){let a=e.type==="block-map"?zf(t,n,e,i,s):e.type==="block-seq"?Yf(t,n,e,i,s):Pf(t,n,e,i,s),o=a.constructor;return r==="!"||r===o.tagName?(a.tag=o.tagName,a):(r&&(a.tag=r),a)}function _f(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===ye.tagName&&o==="map"||a===Ze.tagName&&o==="seq")return Ju(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&&p.collection===o)n.schema.tags.push(Object.assign({},p,{default:!1})),l=p;else return p?.collection?r(s,"BAD_COLLECTION_TYPE",`${p.tag} used for ${o} collection, but expects ${p.collection}`,!0):r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),Ju(t,n,e,r,a)}let c=Ju(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 P(u);return d.range=c.range,d.tag=a,l?.format&&(d.format=l.format),d}function gl(t,n,e){let i=n.offset,r=lk(n,t.options.strict,e);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};let s=r.mode===">"?P.BLOCK_FOLDED:P.BLOCK_LITERAL,a=n.source?ck(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 v=b[b.length-1]==="\r";if(v&&(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-(v?2:1),"BAD_INDENT",T),g=""}s===P.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 lk({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 ck(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 yl(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=P.PLAIN,l=uk(s,c);break;case"single-quoted-scalar":o=P.QUOTE_SINGLE,l=dk(s,c);break;case"double-quoted-scalar":o=P.QUOTE_DOUBLE,l=pk(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=nn(a,u,n,e);return{value:l,type:o,comment:d.comment,range:[i,u,d.offset]}}function uk(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}`),qf(t)}function dk(t,n){return(t[t.length-1]!=="'"||t.length===1)&&n(t.length,"MISSING_CHAR","Missing closing 'quote"),qf(t.slice(1,-1)).replace(/''/g,"'")}function qf(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 pk(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}=mk(t,i);e+=s,i=a}else if(r==="\\"){let s=t[++i],a=fk[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={x:2,u:4,U:8}[s];e+=hk(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 mk(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 fk={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|||
|
|
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function hk(t,n,e,i){let r=t.substr(n,e),a=r.length===e&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;if(isNaN(a)){let o=t.substr(n-2,e+2);return i(n-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),o}return String.fromCodePoint(a)}function Xu(t,n,e,i){let{value:r,type:s,comment:a,range:o}=n.type==="block-scalar"?gl(t,n,i):yl(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[mt]:l?c=gk(t.schema,r,l,e,i):n.type==="scalar"?c=yk(t,r,n,i):c=t.schema[mt];let u;try{let d=c.resolve(r,p=>i(e??n,"TAG_RESOLVE_FAILED",p),t.options);u=G(d)?d:new P(d)}catch(d){let p=d instanceof Error?d.message:String(d);i(e??n,"TAG_RESOLVE_FAILED",p),u=new P(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 gk(t,n,e,i,r){if(e==="!")return t[mt];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[mt])}function yk({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[mt];if(e.compat){let o=e.compat.find(l=>l.default&&l.test?.test(i))??e[mt];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 Hf(t,n,e){if(n){e===null&&(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 bk={composeNode:ed,composeEmptyNode:bl};function ed(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=kk(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=Xu(t,n,l,i),o&&(c.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":c=_f(bk,t,n,e,i),o&&(c.anchor=o.source.substring(1));break;default:{let d=n.type==="error"?n.message:`Unsupported token (type: ${n.type})`;i(n,"UNEXPECTED_TOKEN",d),c=bl(t,n.offset,void 0,null,e,i),u=!1}}return 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 bl(t,n,e,i,{spaceBefore:r,comment:s,anchor:a,tag:o,end:l},c){let u={type:"scalar",offset:Hf(n,e,i),indent:-1,source:""},d=Xu(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 kk({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=nn(i,a,t.strict,r);return s.range=[n,a,o.offset],o.comment&&(s.comment=o.comment),s}function $f(t,n,{offset:e,start:i,value:r,end:s},a){let o=Object.assign({_directives:n},t),l=new Yt(void 0,o),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},u=tn(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","Block collection cannot start on same line with directives-end marker")),l.content
|
|||
|
|
|
|||
|
|
`:`
|
|||
|
|
`)+(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 Is=class{constructor(n={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,i,r,s)=>{let a=Ms(e);s?this.warnings.push(new Os(a,i,r)):this.errors.push(new lt(a,i,r))},this.directives=new Xt({version:n.version||"1.2"}),this.options=n}decorate(n,e){let{comment:i,afterEmptyLine:r}=Uf(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(re(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:Uf(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=Ms(n);s[0]+=e,this.onError(s,"BAD_DIRECTIVE",i,r)}),this.prelude.push(n.source),this.atDirectives=!0;break;case"document":{let e=$f(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(Ms(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(Ms(n),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;let e=nn(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(Ms(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 Yt(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 wl={};Rc(wl,{BOM:()=>Bs,DOCUMENT:()=>Rs,FLOW_END:()=>Fs,SCALAR:()=>vr,createScalarToken:()=>Vf,isCollection:()=>Sk,isScalar:()=>Ak,prettyToken:()=>Lk,resolveAsScalar:()=>jf,setScalarValue:()=>Wf,stringify:()=>Qf,tokenType:()=>id,visit:()=>$n});function jf(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 yl(t,n,i);case"block-scalar":return gl({options:{strict:n}},t,i)}}return null}function Vf(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 Gf(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 Wf(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">":vk(t,l);break;case'"':td(t,l,"double-quoted-scalar");break;case"'":td(t,l,"single-quoted-scalar");break;default:td(t,l,"scalar")}}function vk(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}];Gf(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 Gf(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 td(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 Qf=t=>"type"in t?vl(t):kl(t);function vl(t){switch(t.type){case"block-scalar":{let n="";for(let e of t.props)n+=vl(e);return n+t.source}case"block-map":case"block-seq":{let n="";for(let e of t.items)n+=kl(e);return n}case"flow-collection":{let n=t.start.source;for(let e of t.items)n+=kl(e);for(let e of t.end)n+=e.source;return n}case"document":{let n=kl(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 kl({start:t,key:n,sep:e,value:i}){let r="";for(let s of t)r+=s.source;if(n&&(r+=vl(n)),e)for(let s of e)r+=s.source;return i&&(r+=vl(i)),r}var nd=Symbol("break visit"),wk=Symbol("skip children"),Zf=Symbol("remove item");function $n(t,n){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),Jf(Object.freeze([]),t,n)}$n.BREAK=nd;$n.SKIP=wk;$n.REMOVE=Zf;$n.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};$n.parentCollection=(t,n)=>{let e=$n.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 Jf(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=Jf(Object.freeze(t.concat([[r,a]])),s.items[a],e);if(typeof o=="number")a=o-1;else{if(o===nd)return nd;o===Zf&&(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 Bs="\uFEFF",Rs="",Fs="",vr="",Sk=t=>!!t&&"items"in t,Ak=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function Lk(t){switch(t){case Bs:return"<BOM>";case Rs:return"<DOC>";case Fs:return"<FLOW_END>";case vr:return"<SCALAR>";default:return JSON.stringify(t)}}function id(t){switch(t){case Bs:return"byte-order-mark";case Rs:return"doc-mode";case Fs:return"flow-error-end";case vr: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 Pt(t){switch(t){case void 0:case" ":case`
|
|||
|
|
`:case"\r":case" ":return!0;default:return!1}}var Xf=new Set("0123456789ABCDEFabcdef"),Ek=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Sl=new Set(",[]{}"),Tk=new Set(` ,[]{}
|
|||
|
|
\r `),rd=t=>!t||Tk.has(t),Ds=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==="...")&&Pt(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]===Bs&&(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 Rs,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==="...")&&Pt(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&&!Pt(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===":")&&Pt(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(rd),"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("..."))&&Pt(r[3]))&&!(i===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield Fs,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(rd),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let a=this.charAt(1);if(this.flowKey||Pt(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=>Pt(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 vr,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(Pt(s)||n&&Sl.has(s))break;e=i}else if(Pt(r)){let s=this.buffer[i+1];if(r==="\r"&&(s===`
|
|||
|
|
`?(i+=1,r=`
|
|||
|
|
`,s=this.buffer[i+1]):e=i),s==="#"||n&&Sl.has(s))break;if(r===`
|
|||
|
|
`){let a=this.continueScalar(i+1);if(a===-1)break;i=Math.max(i,a-2)}}else{if(n&&Sl.has(r))break;e=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield vr,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(rd))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let n=this.flowLevel>0,e=this.charAt(1);if(Pt(e)||n&&Sl.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(;!Pt(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(Ek.has(e))e=this.buffer[++n];else if(e==="%"&&Xf.has(this.buffer[n+1])&&Xf.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 Ns=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 gi(t,n){for(let e=0;e<t.length;++e)if(t[e].type===n)return!0;return!1}function eh(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 nh(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 Al(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 wr(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 th(t){if(t.start.type==="flow-seq-start")for(let n of t.items)n.sep&&!n.value&&!gi(n.start,"explicit-key-ind")&&!gi(n.sep,"map-value-ind")&&(n.key&&(n.value=n.key),delete n.key,nh(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 Ks=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 Ds,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=id(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||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"&&th(e),i.type){case"document":i.valu
|
|||
|
|
`)+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(gi(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(nh(e.key)&&!gi(e.sep,"newline")){let a=wr(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(gi(e.start,"newline"))Object.assign(e,{key:null,sep:[this.sourceToken]});else{let a=wr(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]}):gi(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){i&&a.type!=="block-seq"&&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.value||this.indent<=n.indent)break;e.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==n.indent)break;e.value||gi(e.start,"seq-item-ind")?n.items.push({start:[this.sourceTo
|
|||
|
|
`)+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=Al(n),i=wr(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=Al(n),i=wr(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;case"space":case"comment":default:n.end?n.end.push(this.sourceToken):n.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};function xk(t){let n=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||n&&new Ns||null,prettyErrors:n}}function Ll(t,n={}){let{lineCounter:e,prettyErrors:i}=xk(n),r=new Ks(e?.addNewLine),s=new Is(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(Gu(t,e)),a.warnings.forEach(Gu(t,e))),a}function El(t,n,e){let i;typeof n=="function"?i=n:e===void 0&&n&&typeof n=="object"&&(e=n);let r=Ll(t,e);if(!r)return null;if(r.warnings.forEach(s=>Zo(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 Tl(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 Bt(t)&&!i?t.toString(e):new Yt(t,i,e).toString(e)}var sd="tag",zs="tags",_t=[sd,zs],Ck="alias",ad="aliases",qt=[Ck,ad],od="linter-yaml-title-alias",Sr="disabled rules";function rn(t){return t.match(He)===null&&(t=`---
|
|||
|
|
---
|
|||
|
|
`+t),t}function Ar(t){let n=t.match(He);return n?n[1]:null}function Le(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 ld(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 ue(t,n,e){let i=`${n}:${e}
|
|||
|
|
`,r=!1,s=t.replace(ld(n),(a,o)=>(r=!0,o+i));return r||(s=`${t}${i}`),s}function be(t,n,e=!0){let i=t.match(ld(n,e));if(i==null)return null;let r=i[2];return e||(r=i[1]),r}function Ys(t,n,e=!0){return t.replace(ld(n,e),"")}function ft(t){if(t==null)return null;let n=El(t.replace(/\n(\t)+/g,`
|
|||
|
|
`));return n??{}}function rh(t){if(t==null)return null;let n=Ll(t.replace(/\n(\t)+/g,`
|
|||
|
|
`),{keepSourceTokens:!0});return n??null}function cd(t){let n=new Yt(t.options);n.contents=new ye;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 yi(t){if(!t||!t.contents)return"";let n=t.contents.items;return!n||n.length==0?"":wl.stringify(t.contents.srcToken)}function Te(t,n,e,i,r=!1){if(typeof t=="string"&&(t=[t]),t==null||t.length===0)return Mk(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=Lr(o);l&&(o=o.substring(1,o.length-1));let c=r&&yo(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":return" "+ih(t);case"single string to multi-line":if(t.length===1)return" "+t[0];case"multi-line":return Ik(t);case"single string space delimited":return t.length===1?" "+t[0]:" "+t.join(" ");case"single string comma delimited":return t.length===1?" "+t[0]:" "+t.join(", ");case"single-line space delimited":return t.length===1?" "+t[0]:" "+ih(t).replaceAll(", "," ")}}function Mk(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 ih(t){return t==null||t.length===0?"[]":"["+t.join(", ")+"]"}function Ik(t){return t==null||t.length===0?"[]":`
|
|||
|
|
- `+t.join(`
|
|||
|
|
- `)}function ze(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:xl(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 Un(t){if(t==null)return[];let n=[],e=[];Array.isArray(t)?e=t:t.includes(",")?e=xl(t,","):e=xl(t," ");for(let i of e)n.push(i.trim());return n}function jn(t){return typeof t=="string"?xl(t,","):t}function xl(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 Lr(t){return t.length>1&&(t.startsWith("'")&&t.endsWith("'")||t.startsWith('"')&&t.endsWith('"'))}function Ht(t,n,e=!1,i=!1){let r=Bk(t,n,e);if(i)return r;try{if(El(r)===t)return r}catch{}let s=Tl(t,{lineWidth:-1,quotingType:n,forceQuotes:e}).slice(0,-1),a=Tl(t,{lineWidth:-1,quotingType:n=='"'?"'":'"',forceQuotes:e}).slice(0,-1);return a===t||a.length<s.length?a:s}function Bk(t,n,e=!1){if(Lr(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 sh(t){let n=be(t,Sr);if(n==null)return[];let e=n.includes(`
|
|||
|
|
`)?`${Sr}:
|
|||
|
|
`:`${Sr}: `;e+=n;let r=ft(e)["disabled rules"];return r?(typeof r=="string"&&(r=[r]),r):[]}var Ir=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 Mr=require("obsidian");var ah=require("obsidian");var Ol=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 ah.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 Oh=require("obsidian");var Ee="top",Fe="bottom",Ie="right",xe="left",Cl="auto",Vn=[Ee,Fe,Ie,xe],wn="start",bi="end",oh="clippingParents",Ml="viewport",Er="popper",lh="reference",ud=Vn.reduce(function(t,n){return t.concat([n+"-"+wn,n+"-"+bi])},[]),Il=[].concat(Vn,[Cl]).reduce(function(t,n){return t.concat([n,n+"-"+wn,n+"-"+bi])},[]),Rk="beforeRead",Fk="read",Dk="afterRead",Nk="beforeMain",Kk="main",zk="afterMain",Yk="beforeWrite",Pk="write",_k="afterWrite",ch=[Rk,Fk,Dk,Nk,Kk,zk,Yk,Pk,_k];function Ye(t){return t?(t.nodeName||"").toLowerCase():null}function fe(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=fe(t).Element;return t instanceof n||t instanceof Element}function De(t){var n=fe(t).HTMLElement;return t instanceof n||t instanceof HTMLElement}function Tr(t){if(typeof ShadowRoot>"u")return!1;var n=fe(t).ShadowRoot;return t instanceof n||t instanceof ShadowRoot}function qk(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)||!Ye(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 Hk(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)||!Ye(r)||(Object.assign(r.style,o),Object.keys(s).forEach(function(l){r.removeAttribute(l)}))})}}var uh={name:"applyStyles",enabled:!0,phase:"write",fn:qk,effect:Hk,requires:["computeStyles"]};function Pe(t){return t.split("-")[0]}var $t=Math.max,ki=Math.min,Sn=Math.round;function xr(){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 Ps(){return!/^((?!chrome|android).)*safari/i.test(xr())}function At(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&&Sn(i.width)/t.offsetWidth||1,s=t.offsetHeight>0&&Sn(i.height)/t.offsetHeight||1);var a=St(t)?fe(t):window,o=a.visualViewport,l=!Ps()&&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 vi(t){var n=At(t),e=t.
|
|||
|
|
---`)},wikiLink:{replaceAction:No,placeholder:"{WIKI_LINK_PLACEHOLDER}"},obsidianMultiLineComments:{replaceAction:Qm,placeholder:"{OBSIDIAN_COMMENT_PLACEHOLDER}"},footnoteAtStartOfLine:{replaceAction:Do,placeholder:"{FOOTNOTE_AT_START_OF_LINE_PLACEHOLDER}"},footnoteAfterATask:{replaceAction:/- \[.] (\[\^\w+\]) ?([,.;!:?])/gm,placeholder:"{FOOTNOTE_AFTER_A_TASK_PLACEHOLDER}"},url:{replaceAction:mi,placeholder:"{URL_PLACEHOLDER}"},anchorTag:{replaceAction:Jm,placeholder:"{ANCHOR_PLACEHOLDER}"},templaterCommand:{replaceAction:rf,placeholder:"{TEMPLATER_PLACEHOLDER}"},link:{replaceAction:hv,placeholder:"{REGULAR_LINK_PLACEHOLDER}"},tag:{replaceAction:gv,placeholder:"#tag-placeholder"},table:{replaceAction:yv,placeholder:"{TABLE_PLACEHOLDER}"},customIgnore:{replaceAction:bv,placeholder:"{CUSTOM_IGNORE_PLACEHOLDER}"}};function ke(t,n,e){let i=[],r=[];for(let s of t){if(typeof s.replaceAction=="string")[r,n]=mv(n,s.placeholder,s.replaceAction);else if(s.replaceAction instanceof RegExp)[r,n]=fv(n,s.placeholder,s.replaceAction);else if(typeof s.replaceAction=="function"){let a=s.replaceAction;[r,n]=a(n,s.placeholder)}i.push({replacedValues:r,placeholder:s.placeholder})}return n=e(n),i=i.reverse(),i!=null&&i.length>0&&i.forEach(s=>{s.replacedValues.forEach(a=>{n=n.replace(new RegExp(s.placeholder,"i"),it(a))})}),n}function mv(t,n,e){let i=Se(e,t),r=[];e==="list"&&(i=kv(i));for(let s of i){let a=t.substring(s.start.offset,s.end.offset);r.push(a)}for(let s of i)t=ce(t,s.start.offset,s.end.offset,n);return r.reverse(),[r,t]}function fv(t,n,e){let i=t.match(e),r=[];if(e.flags.includes("g")){if(t=t.replaceAll(e,n),i)for(let s of i)r.push(s)}else t=t.replace(e,n),i&&r.push(i[0]);return[r,t]}function hv(t,n){let e=Se("link",t),i=[],r=[];for(let s of e){if(s==null)continue;let a=t.substring(s.start.offset,s.end.offset);a.match(ps)&&(r.push(s),i.push(a))}for(let s of r)t=ce(t,s.start.offset,s.end.offset,n);return i.reverse(),[i,t]}function gv(t,n){let e=[];return t=t.replace(ms,(i,r,s)=>(e.push(s),r+n)),[e,t]}function yv(t,n){let e=ar(t),i=new Array(e.length),r=0,s=i.length;for(let a of e)i[s-1-r++]=t.substring(a.startIndex,a.endIndex);for(let a of e)t=ce(t,a.startIndex,a.endIndex,n);return[i,t]}function bv(t,n){let e=Pm(t),i=new Array(e.length),r=0,s=i.length;for(let a of e)i[s-1-r++]=t.substring(a.startIndex,a.endIndex);for(let a of e)t=ce(t,a.startIndex,a.endIndex,n);return[i,t]}function kv(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}var z=(a=>(a.YAML="YAML",a.HEADING="Heading",a.FOOTNOTE="Footnote",a.CONTENT="Content",a.SPACING="Spacing",a.PASTE="Paste",a))(z||{}),ql=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 Zn("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 ke(this.ignoreTypes,n,i=>this.applyAfterIgnore(i,e))}};var Bh=Object.values(z);function Hl(t){let n=Ar(t);if(n===null)return[[],!1];let e=sh(n);return e.includes("all")?[sn.map(i=>i.alias),!0]:[e,!1]}var sn=[],ht={},Ti=new Map;function Rh(t){sn.push(t),ht[t.alias]=t,Ti.has(t.type)?Ti.get(t.type).push(t):Ti.set(t.type,[t])}function Fh(){sn.sort((t,n)=>Bh.indexOf(t.type)-Bh.indexOf(n.type)||t.settingsKey.localeCompare(n.settingsKey))}function $l(t,n){let e;throw t instanceof lt?(e=
|
|||
|
|
[ ]{`+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 Nh=vv;var Ic=require("obsidian");var Kh=1e4,Fr,Ws,Jn,at=class at{static getRule(){if(!_(at,Fr).has(this.name)){let n=new this,e=new ql(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);_(at,Fr).set(this.name,e),_(at,Ws).set(n.alias,n)}return _(at,Fr).get(this.name)}static applyIfEnabledBase(n,e,i,r){let s=n.getOptions(i);if(s[n.enabledOptionName()]){ai(n.alias);let a=Object.assign({},s,r);et(`${E("logs.run-rule-text")} ${n.getName()}`);try{let o=n.apply(e,a);return Mn(n.alias),o.length>Kh?et(o.slice(0,Kh-1)+"..."):et(o),[o,!0]}catch(o){Mn(n.alias),$l(o,n.getName())}}else return[e,!1]}static getBuilderByName(n){return _(at,Ws).get(n)}static setNoSettingControl(n,e){_(at,Jn).has(n)||_(at,Jn).set(n,[]),_(at,Jn).get(n).push(e)}static hasSettingControl(n,e){return!_(at,Jn).has(n)||!_(at,Jn).get(n).includes(e)}};Fr=new WeakMap,Ws=new WeakMap,Jn=new WeakMap,Me(at,Fr,new Map),Me(at,Ws,new Map),Me(at,Jn,new Map);var Xn=at,k=class extends Xn{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();Rh(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]):Xn.applyIfEnabledBase(s,n,e,r)}static getRuleOptions(n){let e=Xn.getRule.bind(this)(),i=new this,r=e.getOptions(n);return i.buildRuleOptions(r)}static noSettingControl(){return(n,e)=>{let i=n.constructor.name;Xn.setNoSettingControl(i,e)}}};var Dr,Ln=class{constructor(n){Me(this,Dr,void 0);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 _(this,Dr)||Ke(this,Dr,this.buildOption()),_(this,Dr)}setRuleOption(n,e){let i=e[this.configKey];i!==void 0&&(n[this.optionsKey]=i)}};Dr=new WeakMap;var U=class extends Ln{constructor(n){super(n),this.onChange=n.onChange??null}buildOption(){return new Zn(this.configKey,this.nameKey,this.descriptionKey,this.defaultValue,null,this.onChange)}},Ul=class extends Ln{buildOption(){return new Vs(this.configKey,this.nameKey,this.descriptionKey,this.defaultValue)}},ne=class extends Ln{constructor(n){super(n),this.records=n.records.map(e=>new Yl("enums."+e.value,e.description))}buildOption(){return new Pl(this.configKey,this.nameKey,this.descriptionKey,this.defaultValue,this.records)}},he=class extends Ln{constructor(n){super(n),this.separator=n.separator??`
|
|||
|
|
`,this.splitter=n.splitter??/\n/}buildOption(){return new Kl(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}}},Oe=class extends Ln{buildOption(){return new Vs(this.configKey,this.nameKey,this.descriptionKey,this.defaultValue)}},jl=class extends Ln{buildOption(){return new zl(this.configKey,this.nameKey,this.descriptionKey,this.defaultValue)}},Vl=class extends Ln{buildOption(){return new _l(this.configKey,this.nameKey,this.descriptionKey)}};var Ed=class{},ei=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 Ed}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[]}};ei=x([k.register],ei);var xi=class{constructor(){this.ignoreWords=[];this.extraAutoCorrectFiles=[];this.skipWordsWithMultipleCapitals=!1;this.misspellingToCorrection=new Map}};x([k.noSettingControl()],xi.prototype,"misspellingToCorrection",2);var Oi=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 xi}apply(n,e){return n.replaceAll(Xm,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 he({OptionsClass:xi,nameKey:"rules.auto-correct-common-misspellings.ignore-words.name",descriptionKey:"rules.auto-correct-common-misspellings.ignore-words.description",optionsKey:"ignoreWords",splitter:fs,separator:", "}),new U({OptionsClass:xi,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 Vl({OptionsClass:xi,nameKey:"rules.auto-correct-common-misspellings.extra-auto-correct-files.name",descriptionKey:"rules.auto-correct-common-misspellings.extra-auto-correct-files.description",optionsKey:"extraAutoCorrectFiles"})]}};Oi=x([k.register],Oi);var Wl=class{constructor(){this.style="space"}},Ci=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 Wl}apply(n,e){return e.style==="space"?Iu(n,i=>this.updateBlockquoteLines(i,this.addSpaceToIndicator)):Iu(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;do{r=l.indexOf(`
|
|||
|
|
`,i),r===-1&&(r=l.length-1,c=!0),[s,o]=ir(l,r-1);let u=o+s.length+1,d=r;c&&d++;let p=l.substring(u,d);if(p.includes(y.math.placeholder)||p.includes(y.code.placeholder)){i++;continue}let m=Fo.test(p);a=e(s,m),o++,l=ce(l,o,o+s.length,a),i=r+1+a.length-s.length}while(!c);return l}get optionBuilders(){return[new ne({OptionsClass:Wl,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"}]})]}};Ci=x([k.register],Ci);var Gl=class{};x([k.noSettingControl()],Gl.prototype,"lineContent",2);var Mi=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 Gl}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[]}};Mi=x([k.register],Mi);var Ii=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","according to","as regards","counter to","instead of","owing to","pertaining to","at the behest of","at the expense of","at the hands of","at risk of","at the risk of","at variance with","by dint of","by means of","by virtue of","by way of","for the sake of","for sake of","for lack of","for want of","from want of","in accordance with","in addition to","in case of","in charge of","in compliance with","in conformity with","in contact with","in exchange for","in favor of","in front of","in lieu of","in light of","in the light of","in line with","in place of","in point of","in quest of","in relation to","in regard to","with regard to","in respect to","with respect to","in return for","in search of","in step with","in touch with","in terms of","in the name of","in view of","on account of","on behalf of","on grounds of","on the grounds of","on the part of","on top of","with a view to","with the exception of","\xE0 la","a la","as soon as","as well as","close to","due to","far from","in case","other than","prior to","pursuant to","regardless of","subsequent to","as long as","as much as","as far as","by the time","in as much as","inasmuch","in order to","in order that","even","provide that","if only","whether","whose","whoever","why","how","or not","whatever","what","both","and","or","not only","but also","either","neither","nor","just","rather","no sooner","such","that","yet","is","it"];this.ignoreCasedWords=!0}},Bi=class extends k{const
|
|||
|
|
`),i=i.replace(/\n+---/,`
|
|||
|
|
---`),e.innerNewLines&&(i=i.replaceAll(/\n{2,}/g,`
|
|||
|
|
`)),i))}get optionBuilders(){return[new U({OptionsClass:Ql,nameKey:"rules.compact-yaml.inner-new-lines.name",descriptionKey:"rules.compact-yaml.inner-new-lines.description",optionsKey:"innerNewLines"})]}};Gs=x([k.register],Gs);var Td=class{},Ri=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 Td}apply(n,e){return n.replace(/(\n([\t\v\f\r \u00a0\u2000-\u200b\u2028-\u2029\u3000]+)?){2,}\n/g,`
|
|||
|
|
|
|||
|
|
`)}get optionBuilders(){return[]}};Ri=x([k.register],Ri);var xd=class{},Qs=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 xd}apply(n,e){return n.replace(/^([^\S\n]*)([•§])([^\S\n]*)/gm,"$1-$3")}get optionBuilders(){return[]}};Qs=x([k.register],Qs);var Zl=class{constructor(){this.tabsize=4}},Zs=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 Zl}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 Ul({OptionsClass:Zl,nameKey:"rules.convert-spaces-to-tabs.tabsize.name",descriptionKey:"rules.convert-spaces-to-tabs.tabsize.description",optionsKey:"tabsize"})]}};Zs=x([k.register],Zs);var Vt=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()],Vt.prototype,"aliasArrayStyle",2),x([k.noSettingControl()],Vt.prototype,"tagArrayStyle",2),x([k.noSettingControl()],Vt.prototype,"defaultEscapeCharacter",2),x([k.noSettingControl()],Vt.prototype,"removeUnnecessaryEscapeCharsForMultiLineArrays",2);var Js=class extends k{constructor(){super({nameKey:"rules.dedupe-yaml-array-values.name",descriptionKey:"rules.dedupe-yaml-array-values.description",type:"YAML"})}get OptionsClass(){return Vt}apply(n,e){return Le(n,i=>{let r=ft(i.replace(`---
|
|||
|
|
`,"").replace(`
|
|||
|
|
---`,""));if(!r)return i;for(let s of qt)if(e.dedupeAliasKey&&Object.keys(r).includes(s)){i=ue(i,s,Te(jn(this.getUniqueArray(ze(be(i,s)))),e.aliasArrayStyle,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays,!0));break}for(let s of _t)if(e.dedupeTagKey&&Object.keys(r).includes(s)){i=ue(i,s,Te(Un(this.getUniqueArray(ze(be(i,s)))),e.tagArrayStyle,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays));break}if(e.dedupeArrayKeys){let s=[...qt,..._t,...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=be(i,a),l="single-line";o.includes(`
|
|||
|
|
`)&&(l="multi-line");let c=this.getUniqueArray(ze(o));i=ue(i,a,Te(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 U({OptionsClass:Vt,nameKey:"rules.dedupe-yaml-array-values.dedupe-alias-key.name",descriptionKey:"rules.dedupe-yaml-array-values.dedupe-alias-key.description",optionsKey:"dedupeAliasKey"}),new U({OptionsClass:Vt,nameKey:"rules.dedupe-yaml-array-values.dedupe-tag-key.name",descriptionKey:"rules.dedupe-yaml-array-values.dedupe-tag-key.description",optionsKey:"dedupeTagKey"}),new U({OptionsClass:Vt,nameKey:"rules.dedupe-yaml-array-values.dedupe-array-keys.name",descriptionKey:"rules.dedupe-yaml-array-values.dedupe-array-keys.description",optionsKey:"dedupeArrayKeys"}),new he({OptionsClass:Vt,nameKey:"rules.dedupe-yaml-array-values.ignore-keys.name",descriptionKey:"rules.dedupe-yaml-array-values.ignore-keys.description",optionsKey:"ignoreDedupeArrayKeys"})]}};Js=x([k.register],Js);var Jl=class{constructor(){this.defaultLanguage=""}},Xs=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.yaml,y.link,y.wikiLink,y.tag]})}get OptionsClass(){return Jl}apply(n,e){return _m(n,e.defaultLanguage)}get optionBuilders(){return[new Oe({OptionsClass:Jl,nameKey:"rules.default-language-for-code-fences.default-language.name",descriptionKey:"rules.default-language-for-code-fences.default-language.description",optionsKey:"defaultLanguage"})]}};Xs=x([k.register],Xs);var Xl=class{constructor(){this.style="consistent"}},ea=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.math,y.inlineMath]})}get OptionsClass(){return Xl}apply(n,e){return Ro(n,e.style,"emphasis")}get optionBuilders(){return[new ne({OptionsClass:Xl,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"}]})]}};ea=x([k.register],ea);var Od=class{},ta=class extends k{constructor(){super({nameKey:"rules.empty-line-around-blockquotes.name",descriptionKey:"rules.empty-line-around-blockquotes.description",type:"Spacing"})}get OptionsClass(){return Od}apply(n,e){return Dm(n)}get optionBuilders(){return[]}};ta=x([k.register],ta);var Cd=class{},na=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 Cd}apply(n,e){return Rm(n)}get optionBuilders(){return[]}};na=x([k.register],na);var Md=class{},ia=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 Md}apply(n,e){return Nm(n)}get optionBuilders(){return[]}};ia=x([k.register],ia);var ec=class{constructor(){this.minimumNumberOfDollarSignsToBeAMathBlock=2}};x([k.noSettingControl()],ec.prototype,"minimumNumberOfDollarSignsToBeAMathBlock",2);var ra=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 ec}apply(n,e){return Fm(n,e.minimumNumberOfDollarSignsToBeAMathBlock)}get optionBuilders(){return[]}};ra=x([k.register],ra);var Id=class{},sa=class extends k{constructor(){super({nameKey:"rules.empty-line-around-tables.name",descriptionKey:"rules.empty-line-around-tables.descr
|
|||
|
|
`),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 U({OptionsClass:aa,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"})]}};Fi=x([k.register],Fi);var zh=require("obsidian");var an=class extends zh.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 tc=class{};x([k.noSettingControl()],tc.prototype,"fileName",2);var oa=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=ht["header-increment"],r=i.options[0],s=i.options[1];n&&r.getValue()&&new an(e,"rules.file-name-heading.name","rules.header-increment.start-at-h2.name",()=>{s.setValue(!1)},()=>{ht["file-name-heading"].options[0].setValue(!1)}).open()}})}get OptionsClass(){return tc}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=`# ${r}
|
|||
|
|
`;return n.length<s&&(a=`
|
|||
|
|
`+a),oi(n,s,a)}get optionBuilders(){return[]}};oa=x([k.register],oa);var Bd=class{},la=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 Bd}apply(n,e){return n.replace(/(\[\^[^\]]+\]) ?([,.;!:?])/gm,"$2$1")}get optionBuilders(){return[]}};la=x([k.register],la);var ca=class{constructor(){this.defaultEscapeCharacter='"';this.forceYamlEscape=[]}};x([k.noSettingControl()],ca.prototype,"defaultEscapeCharacter",2);var Di=class extends k{constructor(){super({nameKey:"rules.force-yaml-escape.name",descriptionKey:"rules.force-yaml-escape.description",type:"YAML",hasSpecialExecutionOrder:!0})}get OptionsClass(){return ca}apply(n,e){return Le(n,i=>{for(let r of e.forceYamlEscape){let s=be(i,r);if(s!=null){if(s.includes(`
|
|||
|
|
`)||s.startsWith(" [")||Lr(s))continue;s=Ht(s,e.defaultEscapeCharacter,!0),i=ue(i,r," "+s)}}return i})}get optionBuilders(){return[new he({OptionsClass:ca,nameKey:"rules.force-yaml-escape.force-yaml-escape-keys.name",descriptionKey:"rules.force-yaml-escape.force-yaml-escape-keys.description",optionsKey:"forceYamlEscape"})]}};Di=x([k.register],Di);var Rd=class{},Ni=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 Rd}apply(n,e){return Le(n,i=>i.replace(new RegExp(`^(${zs}|${sd}):[ \\t]*(\\S.*|(?:(?:\\n *- \\S.*)|((?:\\n *- *))*|(\\n([ \\t]+[^\\n]*))*)*)\\n`,"m"),function(r){return r.replaceAll("#","")}))}get optionBuilders(){return[]}};Ni=x([k.register],Ni);var gt=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()],gt.prototype,"aliasArrayStyle",2),x([k.noSettingControl()],gt.prototype,"tagArrayStyle",2),x([k.noSettingControl()],gt.prototype,"defaultEscapeCharacter",2),x([k.noSettingControl()],gt.prototype,"removeUnnecessaryEscapeCharsForMultiLineArrays",2);var ua=class extends k{constructor(){super({nameKey:"rules.format-yaml-array.name",descriptionKey:"rules.format-yaml-array.description",type:"YAML"})}get OptionsClass(){return gt}apply(n,e){return Le(n,i=>{let r=ft(i.replace(`---
|
|||
|
|
`,"").replace(`
|
|||
|
|
---`,""));if(!r)return i;for(let s of qt)if(e.formatAliasKey&&Object.keys(r).includes(s)){i=ue(i,s,Te(jn(ze(be(i,s))),e.aliasArrayStyle,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays,!0));break}for(let s of _t)if(e.formatTagKey&&Object.keys(r).includes(s)){i=ue(i,s,Te(Un(ze(be(i,s))),e.tagArrayStyle,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays));break}if(e.formatArrayKeys){let s=[...qt,..._t,...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=ue(i,a,Te(ze(be(i,a)),e.defaultArrayStyle,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays)))}for(let s of e.forceSingleLineArrayStyle)Object.keys(r).includes(s)&&(i=ue(i,s,Te(ze(be(i,s)),"single-line",e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays)));for(let s of e.forceMultiLineArrayStyle)Object.keys(r).includes(s)&&(i=ue(i,s,Te(ze(be(i,s)),"multi-line",e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays)));return i})}get optionBuilders(){return[new U({OptionsClass:gt,nameKey:"rules.format-yaml-array.alias-key.name",descriptionKey:"rules.format-yaml-array.alias-key.description",optionsKey:"formatAliasKey"}),new U({OptionsClass:gt,nameKey:"rules.format-yaml-array.tag-key.name",descriptionKey:"rules.format-yaml-array.tag-key.description",optionsKey:"formatTagKey"}),new ne({OptionsClass:gt,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 U({OptionsClass:gt,nameKey:"rules.format-yaml-array.default-array-keys.name",descriptionKey:"rules.format-yaml-array.default-array-keys.description",optionsKey:"formatArrayKeys"}),new he({OptionsClass:gt,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 he({OptionsClass:gt,nameKey:"rules.format-yaml-array.force-multi-line-array-style.name",descriptionKey:"rules.format-yaml-array.force-multi-line-array-style.description",optionsKey:"forceMultiLineArrayStyle"})]}};ua=x([k.register],ua);var nc=class{constructor(){this.startAtH2=!1}},da=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 nc}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(zn,(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 U({OptionsClass:nc,nameKey:"rules.header-increment.start-at-h2.name",descriptionKey:"rules.header-increment.start-at-h2.description",optionsKey:"startAtH2",onChange(n,e){let i=ht["file-name-heading"].options[0];n&&i.getValue()&&new an(e,"rules.header-increment.start-at-h2.name","rules.file-name-heading.name",()=>{i.setValue(!1)},()=>{ht["header-increment"].options[1].setValue(!1)}).open()}})]}};da=x([k.register],da);var ma=class{constructor(){this.bottom=!0;this.emptyLineAfterYaml=!0}},pa=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 ma}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 U({OptionsClass:ma,nameKey:"rules.heading-blank-lines.bottom.name",descriptionKey:"rules.heading-blank-lines.bottom.description",optionsKey:"bottom"}),new U({OptionsClass:ma,nameKey:"rules.heading-blank-lines.empty-line-after-yaml.name",descriptionKey:"rules.heading-blank-lines.empty-line-after-yaml.description",optionsKey:"emptyLineAfterYaml"})]}};pa=x([k.register],pa);var Fd=class{},fa=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 Fd}apply(n,e){return n.replaceAll(zn,i=>i.trimStart())}get optionBuilders(){return[]}};fa=x([k.register],fa);var ic=class{constructor(){this.textToInsert=["aliases: ","tags: "]}},ha=class extends k{constructor(){super({nameKey:"rules.insert-yaml-attributes.name",descriptionKey:"rules.insert-yaml-attributes.description",type:"YAML"})}get OptionsClass(){return ic}apply(n,e){return n=rn(n),Le(n,i=>{let r=e.textToInsert.reverse(),s=ft(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 he({OptionsClass:ic,nameKey:"rules.insert-yaml-attributes.text-to-insert.name",descriptionKey:"rules.insert-yaml-attributes.text-to-insert.description",optionsKey:"textToInsert"})]}};ha=x([k.register],ha);var Dd=class{},ga=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 Dd}apply(n,e){return n.length===0||(n=n.replace(/\n+$/g,""),n+=`
|
|||
|
|
`),n}get optionBuilders(){return[]}};ga=x([k.register],ga);var Nd=class{},ya=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 Nd}apply(n,e){return Tm(n)}get optionBuilders(){return[]}};ya=x([k.register],ya);var rc=class{constructor(){this.minimumNumberOfDollarSignsToBeAMathBlock=2}};x([k.noSettingControl()],rc.prototype,"minimumNumberOfDollarSignsToBeAMathBlock",2);var Ki=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 rc}apply(n,e){return Ym(n,e.minimumNumberOfDollarSignsToBeAMathBlock)}get optionBuilders(){return[]}};Ki=x([k.register],Ki);var ti=class{constructor(){this.tagArrayStyle="single-line";this.howToHandleExistingTags="Nothing";this.tagsToIgnore=[];this.defaultEscapeCharacter='"';this.removeUnnecessaryEscapeCharsForMultiLineArrays=!1}};x([k.noSettingControl()],ti.prototype,"tagArrayStyle",2),x([k.noSettingControl()],ti.prototype,"defaultEscapeCharacter",2),x([k.noSettingControl()],ti.prototype,"removeUnnecessaryEscapeCharsForMultiLineArrays",2);var ba=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 ti}apply(n,e){let i;return ke([y.yaml],n,r=>(i=lf(r),r)),i.length===0||(n=rn(n),n=Le(n,r=>{r=r.replace(`---
|
|||
|
|
`,"").replace("---","");let s=[],a=zs;for(let c of _t){let u=be(r,c);if(u!=null){s=Un(ze(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`---
|
|||
|
|
${ue(r,a,Te(s,e.tagArrayStyle,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays))}---`}),n=ke([y.yaml],n,r=>(e.howToHandleExistingTags!=="Nothing"&&(r=r.replace(ms,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:ti,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 he({OptionsClass:ti,nameKey:"rules.move-tags-to-yaml.tags-to-ignore.name",descriptionKey:"rules.move-tags-to-yaml.tags-to-ignore.description",optionsKey:"tagsToIgnore"})]}};ba=x([k.register],ba);var ac=class{constructor(){this.noBareURIs=!1}},sc="'\"\u2018\u2019\u201C\u201D`[]",Xv=["http","ftp","https","smtp"],ka=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 ac}apply(n,e){let i=n.match(mi);if(i&&(n=this.handleMatches(n,i,!1)),e.noBareURIs){let r=n.match(Zm);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=Bn(o,"(");if(p!=0&&p!=Bn(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=ce(n,m,f+1,"<"+o+">"),r=l+o.length;continue}n=ce(n,l,l+o.length,"<"+o+">"),r=l+o.length+2}return n}skipMatch(n,e,i,r){let s=n!=null&&sc.includes(n)||sc.includes(i.charAt(0)),a=e!=null&&sc.includes(e)||sc.includes(i.charAt(i.length-1));return s&&a?!0:r?Xv.includes(i.substring(0,i.indexOf(":"))):!1}get optionBuilders(){return[new U({OptionsClass:ac,nameKey:"rules.no-bare-urls.no-bare-uris.name",descriptionKey:"rules.no-bare-urls.no-bare-uris.description",optionsKey:"noBareURIs"})]}};ka=x([k.register],ka);var Kr=class{constructor(){this.numberStyle="ascending";this.listEndStyle="."}},va=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 Km(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 U({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 qd}apply(e,i){let r=`(( |\\t)*- ${fi}( |\\t)+.+)`;e=this.replaceEmptyLinesBetweenList(e,r),e=this.replaceEmptyLinesBetweenList(e,"(( |\\t)*\\d+\\.( |\\t)+.+)"),e=this.replaceEmptyLinesBetweenList(e,"(( |\\t)*\\+( |\\t)+.+)");let o=`(( |\\t)*-(?! ${fi})( |\\t)+.+)`;return e=this.replaceEmptyLinesBetweenList(e,o),this.replaceEmptyLinesBetweenList(e,"(( |\\t)*\\*( |\\t)+.+)")}get optionBuilders(){return[]}};Oa=x([k.register],Oa);var Hd=class{},Ca=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 Hd}apply(n,e){let i=new RegExp(`^${hs}(-|\\*|\\+|\\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[]}};Ca=x([k.register],Ca);var $d=class{},Ma=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 $d}apply(n,e){return n.replace(/\b[-‐] \b/g,"")}get optionBuilders(){return[]}};Ma=x([k.register],Ma);var Ud=class{},qi=class extends k{constructor(){super({nameKey:"rules.remove-hyphens-on-paste.name",descriptionKey:"rules.remove-hyphens-on-paste.description",type:"Paste"})}get OptionsClass(){return Ud}apply(n,e){return n.replace(/([^\s-])[-‐]\s+\n?(?=\w)/g,"$1")}get optionBuilders(){return[]}};qi=x([k.register],qi);var jd=class{},Hi=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 jd}apply(n,e){return n.replace(/^[\n ]+|\s+$/g,"")}get optionBuilders(){return[]}};Hi=x([k.register],Hi);var Vd=class{},$i=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 Vd}apply(n,e){return n.replace(/(\D)[.,]\d+/g,"$1")}get optionBuilders(){return[]}};$i=x([k.register],$i);var Wd=class{},Ia=class extends k{constructor(){super({nameKey:"rules.remove-link-spacing.name",descriptionKey:"rules.remove-link-spacing.description",type:"Spacing"})}get OptionsClass(){return Wd}apply(n,e){return n=Mm(n),af(n)}get optionBuilders(){return[]}};Ia=x([k.register],Ia);var Gd=class{},Ui=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 Gd}apply(n,e){return n.replace(/\n{3,}/g,`
|
|||
|
|
|
|||
|
|
`)}get optionBuilders(){return[]}};Ui=x([k.register],Ui);var Qd=class{},Ba=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 Qd}apply(n,e){return n=ke([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[]}};Ba=x([k.register],Ba);var ji=class{constructor(){this.includeFullwidthForms=!0;this.includeCJKSymbolsAndPunctuation=!0;this.includeDashes=!0;this.otherSymbols=""}},Ra=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 ji}apply(n,e){let i="";if(e.includeFullwidthForms&&(i+="\uFF01-\uFF5E"),e.includeCJKSymbolsAndPunctuation&&(i+="\u3000-\u303F"),e.includeDashes&&(i+="\u2013\u2014"),i+=Zt(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=ke([y.list,y.heading],n,a);return o=Kn(o,a),o=qm(o,a),o}get optionBuilders(){return[new U({nameKey:"rules.remove-space-around-characters.include-fullwidth-forms.name",descriptionKey:"rules.remove-space-around-characters.include-fullwidth-forms.description",OptionsClass:ji,optionsKey:"includeFullwidthForms"}),new U({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:ji,optionsKey:"includeCJKSymbolsAndPunctuation"}),new U({nameKey:"rules.remove-space-around-characters.include-dashes.name",descriptionKey:"rules.remove-space-around-characters.include-dashes.description",OptionsClass:ji,optionsKey:"includeDashes"}),new Oe({nameKey:"rules.remove-space-around-characters.other-symbols.name",descriptionKey:"rules.remove-space-around-characters.other-symbols.description",OptionsClass:ji,optionsKey:"otherSymbols"})]}};Ra=x([k.register],Ra);var Da=class{constructor(){this.charactersToRemoveSpacesBefore=",!?;:).\u2019\u201D]";this.charactersToRemoveSpacesAfter="\xBF\xA1\u2018\u201C(["}},Fa=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 Da}apply(n,e){let i=Zt(e.charactersToRemoveSpacesBefore),r=Zt(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=ke([y.list,y.html],n,o);return l=Kn(l,o),l}get optionBuilders(){return[new Oe({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:Da,optionsKey:"charactersToRemoveSpacesBefore"}),new Oe({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:Da,optionsKey:"charactersToRemoveSpacesAfter"})]}};Fa=x([k.register],Fa);var oc=class{constructor(){this.punctuationToRemove=".,;:!\u3002\uFF0C\uFF1B\uFF1A\uFF01"}},Na=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 oc}apply(n,e){return n.replaceAll(zn,(i,r="",s="",a="",o="",l="")=>{if(o==""||o.match(ef))return i;let c=o.trimEnd(),
|
|||
|
|
`,"").replace(`
|
|||
|
|
---`,""));if(!r)return i;for(let s of qt)if(e.sortAliasKey&&Object.keys(r).includes(s)){i=ue(i,s,Te(jn(this.sortArray(ze(be(i,s)),e.sortOrder)),e.aliasArrayStyle,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays,!0));break}for(let s of _t)if(e.sortTagKey&&Object.keys(r).includes(s)){i=ue(i,s,Te(Un(this.sortArray(ze(be(i,s)),e.sortOrder)),e.tagArrayStyle,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays));break}if(e.sortArrayKeys){let s=[...qt,..._t,...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=be(i,a),l="single-line";o.includes(`
|
|||
|
|
`)&&(l="multi-line");let c=this.sortArray(ze(o),e.sortOrder);i=ue(i,a,Te(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 U({OptionsClass:Et,nameKey:"rules.sort-yaml-array-values.sort-alias-key.name",descriptionKey:"rules.sort-yaml-array-values.sort-alias-key.description",optionsKey:"sortAliasKey"}),new U({OptionsClass:Et,nameKey:"rules.sort-yaml-array-values.sort-tag-key.name",descriptionKey:"rules.sort-yaml-array-values.sort-tag-key.description",optionsKey:"sortTagKey"}),new U({OptionsClass:Et,nameKey:"rules.sort-yaml-array-values.sort-array-keys.name",descriptionKey:"rules.sort-yaml-array-values.sort-array-keys.description",optionsKey:"sortArrayKeys"}),new he({OptionsClass:Et,nameKey:"rules.sort-yaml-array-values.ignore-keys.name",descriptionKey:"rules.sort-yaml-array-values.ignore-keys.description",optionsKey:"ignoreSortArrayKeys"}),new ne({OptionsClass:Et,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"}]})]}};za=x([k.register],za);var Zd=class{},Ya=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 Zd}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[]}};Ya=x([k.register],Ya);var _a=class{constructor(){this.englishNonLetterCharactersAfterCJKCharacters=`-+'"([\xA5$`;this.englishNonLetterCharactersBeforeCJKCharacters=`-+;:'"\xB0%$)]`}},Pa=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 _a}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=ke([y.italics,y.bold],n,l);return c=c.replace(a,"$1 $3").replace(o,"$1 $3"),c=Im(c,l),c=Bm(c,l),c}buildHeadRegex(n){n&&n!==""&&(n=n.replaceAll(/\s/g,""));let e="";return n&&n.length!=0&&(e=`|[${Zt(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=`|[${Zt(n)}]`),new RegExp(`(\\[[^[]*\\]\\(.*\\)|\`[^\`]*\`|\\w+${e}|[^*]\\*)( *)(\\p{sc=Han}|\\p{sc=Katakana}|\\p{sc=Hiragana}|\\p{sc=Hangul})`,"gmu")}get optionBuilders(){return[new Oe({OptionsClass:_a,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 Oe({OptionsClass:_a,nameKey:"rules.space-between-chinese-japanese-or
|
|||
|
|
${e.dateCreatedKey}: [^
|
|||
|
|
]+
|
|||
|
|
`,s=`
|
|||
|
|
${e.dateCreatedKey}:[ ]*
|
|||
|
|
`,a=new RegExp(s),o=new RegExp(r),l=(0,Tt.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,tp.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,Tt.moment)(p,e.format,e.locale,!0);(f==null||!f.isValid())&&(n=n.replace(o,it(u)+`
|
|||
|
|
`),i=!0)}}}else{let p=n.indexOf(`
|
|||
|
|
---`);n=oi(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,Tt.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=(0,Tt.moment)(this.getYAMLTimestampString(n,o,i.dateModifiedKey),i.format,i.locale,!0);(e||p==null||!p.isValid()||i.dateModifiedSourceOfTruth!="user or Linter edits"&&this.getTimeDifferenceInSeconds(p,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=oi(n,p,u)}return n}parseValueToCurrentFormatIfPossible(n,e,i,r){if(n==null)return null;let s=r?Tt.moment.utc(n,e,i,!0):(0,Tt.moment)(n,e,i,!0);if(s!=null&&s.isValid())return s;let a=(0,tp.default)(n);if(a!=null){let o=r?Tt.moment.utc(n,a):(0,Tt.moment)(n,a);o.locale(i);let l=r?o.utc().format(e):o.format(e);return r?Tt.moment.utc(l,e,i,!0):(0,Tt.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,Tt.moment)(e.format(i.format),i.format,i.locale,!0);return Math.abs(n.diff(r,"seconds"))}get optionBuilders(){return[new U({OptionsClass:_e,nameKey:"rules.yaml-timestamp.date-created.name",descriptionKey:"rules.yaml-timestamp.date-created.description",optionsKey:"dateCreated"}),new Oe({OptionsClass:_e,nameKey:"rules.yaml-timestamp.date-created-key.name",descriptionKey:"rules.yaml-timestamp.date-created-key.description",optionsKey:"dateCreatedKey"}),new ne({OptionsClass:_e,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 U({OptionsClass:_e,nameKey:"rules.yaml-timestamp.date-modified.name",descriptionKey:"rules.yaml-timestamp.date-modified.description",optionsKey:"dateModified"}),new Oe({OptionsClass:_e,nameKey:"rules.yaml-timestamp.date-modified-key.name",descriptionKey:"rules.yaml-timestamp.date-modified-key.description",optionsKey:"dateModifiedKey"}),new ne({OptionsClass:_e,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 jl({OptionsClass:_e,nameKey:"rules.yaml-timestamp.format.name",descriptionKey:"rules.yaml-timestamp.format.description",optionsKey:"format"}),new U({OptionsClass:_e,nameKey:"rules.yaml-timestamp.convert-to-utc.name",descriptionKey:"rules.yaml-timestamp.convert-to-utc.description",optionsKey:"convertToUTC"}),new ne({OptionsClass:_e,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"}]})]}};Tn=x([k.register],Tn);var Wt=class{constructor(){this.preserveExistingAliasesSectionStyle=!0;this.keepAliasThatMatchesTheFilename=!1;this.useYamlKeyToKeepTrackOfOldFilenameOrHeading=!0;this.aliasHelperKey=od;this.aliasArrayStyle="multi-line";this.defaultEscapeCharacter='"';this.removeUnnecessaryEscapeCharsForMultiLineArrays=!1}};x([k.noSettingControl()],Wt.prototype,"aliasArrayStyle",2),x([k.noSettingControl()],Wt.prototype,"fileName",2),x([k.noSettingControl()],Wt.prototype,"defaultEscapeCharacter",2),x([k.noSettingControl()],Wt.prototype,"removeUnnecessaryEscapeCharsForMultiLineArrays",2);var Gi=class extends k{constructor(){super({nameKey:"rules.yaml-title-alias.name",descrip
|
|||
|
|
`,"").replace(`
|
|||
|
|
---`,""),c=ft(a),u=e.aliasHelperKey??od;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 qt)if(p.includes(h)){d=h;break}if(d!=null){let h=be(l,d),g="multi-line",b=h==="",v=!1;!h.includes(`
|
|||
|
|
`)&&!(h==="[]"&&e.aliasArrayStyle==="multi-line")&&(h.match(/^\[.*\]/)===null?(g="single string to single-line",v=!0):g="single-line");let w=jn(ze(h)),T=this.getNewAliasValue(w,o,r,s);T===""?l=Ys(l,d):e.preserveExistingAliasesSectionStyle?!b&&(v&&r==T||!v||w==T)?l=ue(l,d,Te(T,g,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays,!0)):l=ue(l,d,Te(T,e.aliasArrayStyle,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays,!0)):l=ue(l,d,Te(T,e.aliasArrayStyle,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays,!0))}else o||(l=ue(l,ad,Te(r,e.aliasArrayStyle,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays,!0)));!e.useYamlKeyToKeepTrackOfOldFilenameOrHeading||o?l=Ys(l,u):l=ue(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=ke([y.code,y.math,y.yaml,y.tag],n,Yo);s=s||e;let a=Ht(s,r,this.forceEscape(s,i));return[s,a]}forceEscape(n,e){return yo(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&&Lr(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 U({OptionsClass:Wt,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 U({OptionsClass:Wt,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 U({OptionsClass:Wt,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 Oe({OptionsClass:Wt,nameKey:"rules.yaml-title-alias.alias-helper-key.name",descriptionKey:"rules.yaml-title-alias.alias-helper-key.description",optionsKey:"aliasHelperKey"})]}};Gi=x([k.register],Gi);var Qi=class{constructor(){this.defaultEscapeCharacter='"';this.titleKey="title";this.mode="first-h1-or-filename-if-h1-missing"}};x([k.noSettingControl()],Qi.prototype,"fileName",2),x([k.noSettingControl()],Qi.prototype,"defaultEscapeCharacter",2);var Zi=class extends k{constructor(){super({nameKey:"rules.yaml-title.name",descriptionKey:"rules.yaml-title.description",type:"YAML",hasSpecialExecutionOrder:!0})}get OptionsClass(){return Qi}apply(n,e){n=rn(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),Le(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=oi(r,o,`
|
|||
|
|
${e.titleKey}: ${i}`)}return r})}getFirstH1Header(n){return ke([y.code,y.math,y.yaml,y.tag],n,Yo)}get optionBuilders(){return[new Oe({OptionsClass:Qi,nameKey:"rules.yaml-title.title-key.name",descriptionKey:"rules.yaml-title.title-key.description",optionsKey:"titleKey"}),new ne({OptionsClass:Qi,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"}]})]}};Zi=x([k.register],Zi);var qS=`<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>`,HS=`<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>`,$S=`<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>`,US=`<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>`,jS=`<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>`,VS=`<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>`,WS=`<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>`,GS=`<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>`,QS=`<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>`,ZS=`<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>`,JS=`<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>`,XS=`<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>`,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-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>`,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-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>`,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-check">
|
|||
|
|
<polyline points="20 6 9 17 4 12"/>
|
|||
|
|
</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-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>`,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-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:HS},ignoreFolder:{id:"lint-ignore-folder",source:rA},file:{id:"lint-file",source:qS},ignoreFile:{id:"lint-ignored-file",source:iA},vault:{id:"lint-vault",source:$S},whitespace:{id:"lint-whitespace",source:US},math:{id:"lint-math",source:jS},content:{id:"lint-content",source:VS},paste:{id:"lint-paste",source:WS},custom:{id:"lint-custom",source:GS},heading:{id:"lint-heading",source:QS},footer:{id:"lint-footer",source:ZS},yaml:{id:"lint-yaml",source:JS},general:{id:"lint-general",source:XS},debug:{id:"lint-debug",source:eA},clipboard:{id:"linter-clipboard",source:tA},success:{id:"linter-success",source:nA}};var Yr=require("obsidian");var gc=class{constructor(){this.disabledRules=[]}lintText(n){this.skipFile=!1;let e=n.oldText;if([this.disabledRules,this.skipFile]=Hl(e),this.skipFile)return e;ai(E("logs.rule-running"));let i=E("logs.pre-rules");ai(i);let r=this.runBeforeRegularRules(n);Mn(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 sn){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]=Xn.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 ai(o),r=this.runCustomRegexReplacement(n.settings.customRegexes,r),Mn(o),n.oldText=r,this.runAfterRegularRules(e,n)}runBeforeRegularRules(n){let e=n.oldText;return[e]=Ni.applyIfEnabled(e,n.settings,this.disabledRules),[e]=Fi.applyIfEnabled(e,n.settings,this.disabledRules,{defaultEscapeCharacter:n.settings.commonStyles.escapeCharacter}),[e]=Ki.applyIfEnabled(e,n.settings,this.disabledRules,{minimumNumberOfDollarSignsToBeAMathBlock:n.settings.commonStyles.minimumNumberOfDollarSignsToBeAMathBlock}),[e]=Oi.applyIfEnabled(e,n.settings,this.disabledRules,{misspellingToCorrection:n.defaultMisspellings}),e}runAfterRegularRules(n,e){let i=e.oldText,r=E("logs.post-rules");ai(r),[i]=Bi.applyIfEnabled(i,e.settings,this.disabledRules),[i]=Zi.applyIfEnabled(i,e.settings,this.disabledRules,{fileName:e.fileInfo.name,defaultEscapeCharacter:e.settings.commonStyles.escapeCharacter}),[i]=Gi.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]=Ci.applyIfEnabled(i,e.settings,this.disabledRules),[i]=Di.applyIfEnabled(i,e.settings,this.disabledRules,{defaultEscapeCharacter:e.settings.commonStyles.escapeCharacter}),[i]=Vi.applyIfEnabled(i,e.settings,this.disabledRules),[i]=Ri.applyIfEnabled(i,e.settings,this.disabledRules);let s=i.match(He);s!=null&&([i]=ei.applyIfEnabled(i,e.settings,this.disabledRules));let a=e.getCurrentTime(),o;[i,o]=Tn.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]=ei.applyIfEnabled(i,e.settings,this.disabledRules));let l=Tn.getRuleOptions(e.settings);return a=e.getCurrentTime(),l.convertToUTC&&(a=a.utc()),[i]=Wi.appl
|
|||
|
|
`),c+=`/${a.find}/${a.flags}/${a.replace}/`,et(c);let u=new RegExp(`${a.find}`,a.flags);r=r.replace(u,Kp(a.replace)),s!=r&&et(r),s=r}return r})}runPasteLint(n,e,i){let r=i.oldText;return[r]=qi.applyIfEnabled(r,i.settings,[]),[r]=Ui.applyIfEnabled(r,i.settings,[]),[r]=$i.applyIfEnabled(r,i.settings,[]),[r]=Pi.applyIfEnabled(r,i.settings,[]),[r]=Hi.applyIfEnabled(r,i.settings,[]),[r]=zi.applyIfEnabled(r,i.settings,[],{lineContent:n,selectedText:e}),[r]=Yi.applyIfEnabled(r,i.settings,[],{lineContent:n,selectedText:e}),[r]=Mi.applyIfEnabled(r,i.settings,[],{lineContent:n}),r}runYAMLTimestampByItself(n){let e=n.oldText,i=n.getCurrentTime();return[e]=Tn.applyIfEnabled(e,n.settings,this.disabledRules,{fileCreatedTime:n.fileInfo.createdAtFormatted,fileModifiedTime:n.fileInfo.modifiedAtFormatted,currentTime:i,alreadyModified:!0,locale:n.momentLocale}),e}};function Ji(t,n=null,e,i,r){let s=n&&n.stat.ctime!==0?(0,Yr.moment)(n.stat.ctime):(0,Yr.moment)();s.locale(e);let a=n?(0,Yr.moment)(n.stat.mtime):(0,Yr.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,Yr.moment)();return c.locale(e),c},defaultMisspellings:r}}var yc=require("obsidian");var ja=class extends yc.Modal{constructor(n,e,i,r,s,a=!1){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",this.contentEl.createDiv("modal-button-container",o=>{o.createEl("button",{text:E("cancel-button-text")}).addEventListener("click",()=>this.close());let l=o.createEl("button",{attr:{type:"submit"},cls:"mod-cta",text:i});l.addEventListener("click",async c=>{new yc.Notice(r),this.close(),await s()}),setTimeout(()=>{l.focus()},50)})}};var Qa=require("obsidian");var bc=require("obsidian");var sA={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},aA={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"},on=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,bc.setIcon)(this.navButton.createSpan({cls:"linter-navigation-item-icon"}),sA[i]);let o=E(aA[i]);this.navButton.createSpan().setText(o),this.contentEl=e.createDiv("linter-tab-settings"),this.contentEl.id=i.toLowerCase().replace(" ","-"),this.headingEl=new bc.Setting(this.contentEl).setName(o).setHeading().nameEl,Re(this.headingEl)}addSettingSearchInfo(n,e="",i="",r=null,s=null){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:null,alias:null})}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 selecting a tab":Re(this.headingEl);for(let i of this.searchSettingInfo)$e(i.containerEl);break}}};var ng=require("obsidian");var Gh=require("obsidian");var ni=class{constructor(n,e,i,r,s,a=null){this.containerEl=n;this.keyToUpdate=r;this.plugin=s;this.beforeSave=a;th
|
|||
|
|
`," "));let b=this.contentEl.createDiv(),v=new wc(b,this.plugin.settings.filesToIgnore,this.app,()=>{this.plugin.saveSettings()});this.addSettingSearchInfo(b,v.name,v.description.replaceAll(`
|
|||
|
|
`," "))}};var ig=require("obsidian"),Ac=class extends on{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 ig.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 Zn&&(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 rg=require("obsidian");var Wa=class extends Gn{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 cn{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 rg.Setting(this.inputElDiv).addSearch(s=>{new Wa(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})})}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 np=require("obsidian");var lA="gm",Ec=class extends cn{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:lA,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 np.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.infoEl.remove(),o.name
|
|||
|
|
`," ")+i.warning.replaceAll(`
|
|||
|
|
`," "));let r=this.contentEl.createDiv(),s=new Ec(r,this.plugin.settings.customRegexes,this.app,()=>{this.plugin.saveSettings()});this.addSettingSearchInfo(r,s.name,s.description.replaceAll(`
|
|||
|
|
`," ")+s.warning.replaceAll(`
|
|||
|
|
`," "))}};var sg=require("obsidian");var xc=class{constructor(n,e,i,r){this.containerEl=n;this.searchZeroState=e;this.tabNameToTab=i;this.onFocus=r;this.searchSettingInfo=new Map;for(let[s,a]of i)this.searchSettingInfo.set(s,a.searchSettingInfo);this.display()}display(){let n=new sg.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.searchSettings(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)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 ag=si(so());var Pr=require("obsidian");var Ga=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 cA=Object.keys(ag.default.levels),Oc=class extends on{constructor(n,e,i,r){super(n,e,"Debug",i,r),this.display()}display(){let n=this.contentEl.createDiv(),e={isForEnum:!0,values:cA,descriptions:[]};this.addSettingSearchInfoForGeneralSettings(new xn(n,"tabs.debug.log-level.name","tabs.debug.log-level.description","logLevel",this.plugin,e,async()=>{uo(this.plugin.settings.logLevel)})),n=this.contentEl.createDiv();let i=E("tabs.debug.linter-config.name"),r=E("tabs.debug.linter-config.description");new Ga(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 ln(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 Ga(n,i,""),a.inputEl.setText(oo.join(`
|
|||
|
|
`)),ct(r,a.descEl),o.getBoolean()||a.hide(),this.addSettingSearchInfo(n,i,r)}};var Cc=class extends Qa.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");Qa.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(Qa.Platform.isMobile),this.createSearchZeroState(),this.generateSearchBar(i),this.selectedTab==""&&this.tabSearcher.focusOnInput()}addTabs(e){this.addTab(new Sc(this.tabNavEl,this.settingsContentEl,e,this.plugin,this.app));for(let i of Object.values(z))this.addTab(new Ac(this.tabNavEl,this.settingsContentEl,i,Ti.get(i),e,this.plugin));this.addTab(new Tc(this.tabNavEl,this.settingsContentEl,e,this.app,this.plugin)),this.addTab(new Oc(this.tabNavEl,this.settingsContentEl,e,this.plugin))}generateSearchBar(e){this.tabSearcher=new xc(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 lg=require("obsidian");var uA=/^---\n/gm,og=`${Sr}:`,Mc=class extends lg.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 sn){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(og)||this.disabledRulesIsEndOfStartOfFileToCursor(i.getRange({line:0,ch:0},e))){this.inline=s.startsWith(og);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]=Hl(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(uA)?.length!=1)return!1;let i=be(e+`
|
|||
|
|
`,Sr)?.trimEnd();return i===null?!1:e.trimEnd().endsWith(i)}};var hg=si(pg()),gg=si(so());var Xi=require("obsidian");var rp="default-misspellings.md",ip=`https://raw.githubusercontent.com/platers/obsidian-linter/refs/heads/master/src/utils/${rp}`;async function mg(t,n){let e=t.app,i=t.manifest.dir??"",r=(0,Xi.normalizePath)(i+"/"+rp);if(await e.vault.adapter.exists(r))return;let s=new Xi.Notice(E("rules.auto-correct-common-misspellings.default-install")),a;try{a=await(0,Xi.requestUrl)(ip)}catch(o){lo(E("rules.auto-correct-common-misspellings.default-install-failed").replace("{URL}",ip),o)}if(!a||a.status!==200){let o=E("rules.auto-correct-common-misspellings.default-install-failed").replace("{URL}",ip)+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 fg(t){let n=t.app,e=t.manifest.dir??"",i=(0,Xi.normalizePath)(e+"/"+rp);return await n.vault.adapter.exists(i)?await n.vault.adapter.read(i):(kt(E("rules.auto-correct-common-misspellings.defaults-missing").replace("{FILE}",i)),"")}var dA={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"},On=0,Bc=class extends Z.Plugin{constructor(){super(...arguments);this.eventRefs=[];this.isEnabled=!0;this.rulesRunner=new gc;this.overridePaste=!1;this.hasCustomCommands=!1;this.customCommandsLock=new hg.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}async onload(){Fh(),mo((0,Z.getLanguage)()),Ot(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 Cc(this.app,this),this.addSettingTab(this.settingsTab)}async onunload(){Ot(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({},Ua,e),typeof this.settings.logLevel=="number"&&(this.settings.logLevel=dp(this.settings.logLevel)),uo(this.settings.logLevel),await this.setOrUpdateMomentInstance(),this.updatePasteOverrideStatus(),this.updateHasCustomCommandStatus()}async saveSettings(){this.hasLoadedMisspellingFiles||await this.loadAutoCorrectFiles(!1),await this.saveData(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:()=>{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 ja(this.app,i,r,s,()=>this.runLinterAllFiles(this.app),this.settings.lintCommands&&this.settings.lintCommands.length>0).open()}}),this.addCommand({id:"lint-all-files-in-folder",name:E("commands.lint-all-files-in-folder.name"),icon:ve.folder.id,editorCheckCallback:(i,r,s)=>{if(i)return s&&s.file&&s.file instanceof Z.TFile&&s.file.parent?!s.file.parent.isRoot():!1;e.createFolderLintModal(s.file.parent)}}),this.addCommand({id:"paste-as-plain-text",name:E("comma
|
|||
|
|
`+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=sr(li(await fg(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=sr(li(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(()=>void 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"}async runLinterFile(e,i=!1){let r=li(await this.app.vault.read(e)),s=this.rulesRunner.lintText(Ji(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),Ot(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"),On);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,On)}}async runLinterAllFilesInFolder(e){Ot(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),On);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,On)}}createFolderLintModal(e){let i=E("commands.lint-all-files-in-folder.start-message").replace("{FOLDER_N
|
|||
|
|
`+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,On);for(let s of sn){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)){kt(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){Ot(E("logs.file-change-yaml-lint-run"));try{u=this.rulesRunner.runYAMLTimestampByItself(Ji(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 Ot(E("logs.file-change-yaml-lint-skipped"))}else c=o,c!=s.originalText?(Ot(E("logs.file-change-yaml-lint-run")),await this.app.vault.process(i,u=>{Ot(E("logs.file-change-yaml-lint-run"));try{return this.rulesRunner.runYAMLTimestampByItself(Ji(c,i,this.momentLocale,this.settings,null))}catch(d){return this.handleLintError(i,d,E("commands.lint-file.error-message")+" '{FILE_PATH}'",!1),u}})):Ot(E("logs.file-change-yaml-lint-skipped"));this.activeFileChangeDebouncer.delete(i.path),s.isRunning=!1},e,!0)}updateEditor(e,i,r){let a=new _r.default.diff_match_patch().diff_main(e,i),o="";return a.forEach(l=>{let[c,u]=l;if(c==_r.default.DIFF_INSERT)r.cm.dispatch({changes:[{from:r.posToOffset(this.endOfDocument(o)),insert:u}],filter:!1}),o+=u;else if(c==_r.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){if(this.settings.displayChanged){let r=Nh`
|
|||
|
|
${e} ${E("notice-text.characters-added")}
|
|||
|
|
${i} ${E("notice-text.characters-removed")}
|
|||
|
|
`;new Z.Notice(r)}}handleLintError(e,i,r,s=!0){let a=r.replace("{FILE_PATH}",e.path),o=E("logs.see-console");i instanceof Br?s?new Z.Notice(`${a} ${i.message}.
|
|||
|
|
${o}`,On):new Z.Notice(`${i.message}.
|
|||
|
|
${o}`,On):new Z.Notice(`${E("logs.unknown-error")} ${o}`,On),lo(a,i)}async modifyPasteEvent(e,i){if(!i)return;let r=e.clipboardData.getData("text/plain");if(!r)return;let s=r.trim();if(mi.test(s)){kt(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?(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()??"",Ji(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)??"",Ji(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"),On);return}e.replaceSelection(i)}setCustomCommandCallback(e){(0,gg.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(){mo("en");let e=!1;for(let i of sn){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(),mo((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 Ti.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:"^"+Zt(e.path)+"$",flags:"",label:""}),await this.saveSettings()}async addFolderToIgnoreList(e){this.settings.foldersToIgnore.push(e.path),await this.saveSettings()}};
|
|||
|
|
|
|||
|
|
/* nosourcemap */
|