wikiparser-node 1.17.1 → 1.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,38 +0,0 @@
1
- "use strict";(()=>{var la=Object.create;var vt=Object.defineProperty;var Bi=Object.getOwnPropertyDescriptor;var da=Object.getOwnPropertyNames;var ga=Object.prototype.hasOwnProperty;var qi=(a,n)=>(n=Symbol[a])?n:Symbol.for("Symbol."+a),At=a=>{throw TypeError(a)};var _i=(a,n,e)=>n in a?vt(a,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[n]=e;var ji=(a,n)=>vt(a,"name",{value:n,configurable:!0});var k=(a,n)=>()=>(a&&(n=a(a=0)),n);var ua=(a,n)=>()=>(n||a((n={exports:{}}).exports,n),n.exports),se=(a,n)=>{for(var e in n)vt(a,e,{get:n[e],enumerable:!0})},pa=(a,n,e,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of da(n))!ga.call(a,r)&&r!==e&&vt(a,r,{get:()=>n[r],enumerable:!(t=Bi(n,r))||t.enumerable});return a};var J=a=>pa(vt({},"__esModule",{value:!0}),a);var oe=a=>{var n;return[,,,la((n=a==null?void 0:a[qi("metadata")])!=null?n:null)]},Oi=["class","method","getter","setter","accessor","field","value","get","set"],cr=a=>a!==void 0&&typeof a!="function"?At("Function expected"):a,ca=(a,n,e,t,r)=>({kind:Oi[a],name:n,metadata:t,addInitializer:i=>e._?At("Already initialized"):r.push(cr(i||null))}),ma=(a,n)=>_i(n,qi("metadata"),a[3]),ae=(a,n,e,t)=>{for(var r=0,i=a[n>>1],s=i&&i.length;r<s;r++)n&1?i[r].call(e):t=i[r].call(e,t);return t},le=(a,n,e,t,r,i)=>{var s,o,l,u,p,d=n&7,g=!!(n&8),f=!!(n&16),h=d>3?a.length+1:d?g?1:2:0,m=Oi[d+5],x=d>3&&(a[h-1]=[]),y=a[h]||(a[h]=[]),w=d&&(!f&&!g&&(r=r.prototype),d<5&&(d>3||!f)&&Bi(d<4?r:{get[e](){return c(this,i)},set[e]($){return b(this,i,$)}},e));d?f&&d<4&&ji(i,(d>2?"set ":d>1?"get ":"")+e):ji(r,e);for(var C=t.length-1;C>=0;C--)u=ca(d,e,l={},a[3],y),d&&(u.static=g,u.private=f,p=u.access={has:f?$=>ha(r,$):$=>e in $},d^3&&(p.get=f?$=>(d^1?c:A)($,r,d^4?i:w.get):$=>$[e]),d>2&&(p.set=f?($,E)=>b($,r,E,d^4?i:w.set):($,E)=>$[e]=E)),o=(0,t[C])(d?d<4?f?i:w[m]:d>4?void 0:{get:w.get,set:w.set}:r,u),l._=1,d^4||o===void 0?cr(o)&&(d>4?x.unshift(o):d?f?i=o:w[m]=o:r=o):typeof o!="object"||o===null?At("Object expected"):(cr(s=o.get)&&(w.get=s),cr(s=o.set)&&(w.set=s),cr(s=o.init)&&x.unshift(s));return d||ma(a,r),w&&vt(r,e,w),f?d^4?i:w:r},te=(a,n,e)=>_i(a,typeof n!="symbol"?n+"":n,e),qn=(a,n,e)=>n.has(a)||At("Cannot "+e),ha=(a,n)=>Object(n)!==n?At('Cannot use the "in" operator on this value'):a.has(n),c=(a,n,e)=>(qn(a,n,"read from private field"),e?e.call(a):n.get(a)),T=(a,n,e)=>n.has(a)?At("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(a):n.set(a,e),b=(a,n,e,t)=>(qn(a,n,"write to private field"),t?t.call(a,e):n.set(a,e),e),A=(a,n,e)=>(qn(a,n,"access private method"),e);var Vr=(a,n,e,t)=>({set _(r){b(a,n,r,e)},get _(){return c(a,n,t)}});var Mi,Di,Wi=k(()=>{"use strict";Mi=(()=>{let a={redirect:1,onlyinclude:1,noinclude:1,include:1,comment:1,ext:1,arg:2,"magic-word":2,template:2,heading:2,html:3,table:4,hr:5,"double-underscore":5,link:6,category:6,file:6,quote:7,"ext-link":8,"free-ext-link":9,"magic-link":9,list:10,dd:10,converter:11};return Object.setPrototypeOf(a,null),a})(),Di=(()=>{let a=["bold-header","format-leakage","fostered-content","h1","illegal-attr","insecure-style","invalid-gallery","invalid-imagemap","invalid-invoke","invalid-isbn","lonely-apos","lonely-bracket","lonely-http","nested-link","no-arg","no-duplicate","no-ignored","obsolete-attr","obsolete-tag","parsing-order","pipe-like","table-layout","tag-like","unbalanced-header","unclosed-comment","unclosed-quote","unclosed-table","unescaped","unknown-page","unmatched-tag","unterminated-url","url-encoding","var-anchor","void-ext"];return Object.freeze(a),a})()});var Ge,mr,fa,Hi,_n=k(()=>{"use strict";Ge=a=>decodeURIComponent(a.replace(/%(?![\da-f]{2})/giu,"%25")),mr=a=>Math.round(a*255).toString(16).padStart(2,"0"),fa=(()=>{let a=String.raw`#(?:[\da-f]{3,4}|(?:[\da-f]{2}){3,4})(?![\p{L}\d_])`,n=String.raw`(?:\d*\.)?\d+%?`,e=String.raw`(?:\d*\.)?\d+(?:deg|grad|rad|turn)?`,t=String.raw`rgba?\(\s*(?:${String.raw`${new Array(3).fill(n).join(String.raw`\s+`)}(?:\s*\/\s*${n})?`}|${String.raw`${new Array(3).fill(n).join(String.raw`\s*,\s*`)}(?:\s*,\s*${n})?`})\s*\)`,r=String.raw`hsla?\(\s*(?:${String.raw`${e}\s+${n}\s+${n}(?:\s*\/\s*${n})?`}|${String.raw`${e}${String.raw`\s*,\s*(?:\d*\.)?\d+%`.repeat(2)}(?:\s*,\s*${n})?`})\s*\)`;return{full:new RegExp(String.raw`(^|[^\p{L}\d_])(${a}|${t}|${r})`,"giu"),rgb:new RegExp(String.raw`(^|[^\p{L}\d_])(${a}|${t})`,"giu")}})(),Hi=(a,n=!0)=>{let e=[],t=fa[n?"full":"rgb"];t.lastIndex=0;let r=t.exec(a),i=0;for(;r;){let s=r.index+r[1].length;s>i&&e.push([a.slice(i,s),i,s,!1]),{lastIndex:i}=t,e.push([r[2],s,i,a.charAt(s-1)!=="&"||!/^#\d+$/u.test(r[2])]),r=t.exec(a)}return a.length>i&&e.push([a.slice(i),i,a.length,!1]),e}});var $e,Ui,je,Be,nt,St,de,zi,Te,xa,ba,it,Gi,wl,Ta,ya,wt,qe,Y=k(()=>{"use strict";_n();$e=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Ui=String.raw`[^[\]<>"\0-\x1F\x7F${$e}\uFFFD]`,je=String.raw`(?:\[[\da-f:.]+\]|${Ui})`,Be=String.raw`(?:${Ui}|\0\d+[cn!~]\x7F)*`,nt=(a,n)=>e=>e.replace(a,n),St=nt(/[\0\x7F]|\r$/gmu,""),de=nt(/\0\d+[cn]\x7F/gu,""),zi=nt(/[\\{}()|.?*+^$[\]]/gu,String.raw`\$&`),Te=(a,n="")=>a.map(e=>typeof e=="string"?e:e.text()).join(n),xa={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},ba=nt(/&(?:#(\d+|[Xx][\da-fA-F]+)|([lg]t|[LG]T|[lr]brac[ke]|nbsp|amp|AMP|quot|QUOT));/gu,(a,n,e)=>n?String.fromCodePoint(+((/^x/iu.test(n)?"0":"")+n)):xa[e.toLowerCase()]),it=a=>ba(a),Gi=nt(/&#(\d+|x[\da-f]+);/giu,(a,n)=>String.fromCodePoint(+((/^x/iu.test(n)?"0":"")+n))),wl=nt(/\n/gu,String.raw`\n`),Ta={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},ya=a=>nt(a,n=>`&${Ta[n]};`),wt=ya(/[&<>]/gu),qe=(a,n={})=>{let{pre:e="",post:t="",sep:r=""}=n;return e+a.map(i=>i.print()).join(r)+t}});var Vi=ua((Il,ka)=>{ka.exports={ext:[],html:[["b","bdi","del","i","ins","u","font","big","small","sub","sup","h1","h2","h3","h4","h5","h6","cite","code","em","s","strike","strong","tt","var","div","center","blockquote","ol","ul","dl","table","caption","pre","ruby","rb","rp","rt","rtc","p","span","abbr","dfn","kbd","samp","data","time","mark","tr","td","th","q","bdo"],["li","dt","dd"],["br","wbr","hr","meta","link"]],namespaces:{"0":"","6":"File","10":"Template","14":"Category","828":"Module"},nsid:{"":0,file:6,template:10,category:14,module:828},variable:["!","=","pageid","articlepath","server","servername","scriptpath","stylepath"],parserFunction:[{"#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"formatdate","#dateformat":"formatdate","#invoke":"invoke","#while":"while","#dowhile":"dowhile","#loop":"loop","#forargs":"forargs","#fornumargs":"fornumargs","#if":"if","#ifeq":"ifeq","#switch":"switch","#ifexist":"ifexist","#ifexpr":"ifexpr","#iferror":"iferror","#time":"time","#timel":"timel","#expr":"expr","#rel2abs":"rel2abs","#titleparts":"titleparts","#categorytree":"categorytree","#urldecode":"urldecode","#choose":"choose","#var":"var","#varexists":"varexists","#var_final":"var_final","#vardefine":"vardefine","#vardefineecho":"vardefineecho","#widget":"widget","#related":"related","#cscore":"cscore","#regex":"regex","#regex_var":"regex_var","#regexquote":"regexquote","#regexall":"regexall","#len":"len","#pos":"pos","#rpos":"rpos","#sub":"sub","#count":"count","#replace":"replace","#explode":"explode","#tab":"tab","#seo":"seo","#babel":"babel","#commaseparatedlist":"commaseparatedlist","#coordinates":"coordinates","#lst":"lst","#lsth":"lsth","#lstx":"lstx","#assessment":"assessment","#mentor":"mentor","#property":"property","#target":"target","#section":"section","#section-x":"section-x","#section-h":"section-h","#statements":"statements"},{"!":"!","=":"=","#FORMAL":"formal","#bcp47":"bcp47","#dir":"dir","#interwikilink":"interwikilink","#interlanguagelink":"interlanguagelink","#timef":"timef","#timefl":"timefl"},["msg","raw"],["subst","safesubst"]],doubleUnderscore:[[],[]],protocol:"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|matrix:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|worldwind://|xmpp:",interwiki:[],img:{},redirection:["#redirect"],variants:[]}});var On,Qi=k(()=>{"use strict";On=Vi()});var hr,Ct,fr,xr,Mn,j,ee=k(()=>{"use strict";j=class{constructor(n,e){T(this,xr);T(this,hr);T(this,Ct);T(this,fr);b(this,hr,n),b(this,Ct,e)}get start(){return c(this,Ct)}get top(){return A(this,xr,Mn).call(this).top}get left(){return A(this,xr,Mn).call(this).left}};hr=new WeakMap,Ct=new WeakMap,fr=new WeakMap,xr=new WeakSet,Mn=function(){var n;return(n=c(this,fr))!=null||b(this,fr,c(this,hr).getRootNode().posFromIndex(c(this,Ct))),c(this,fr)}});var $t,Xi,I,P,Ie,D=k(()=>{"use strict";ye();ee();W();$t=(a,n,e,t)=>({line:a+e-1,character:(e===1?n:0)+t}),Xi=a=>(n,e,t,r,i="error")=>{let{start:s}=e,{top:o,left:l}=e instanceof j?e:new j(n,s),{offsetHeight:u,offsetWidth:p}=n,{startIndex:d,startLine:g,startCol:f}=a(n,s,o,l),{line:h,character:m}=$t(g,f,u,p);return{rule:t,message:v.msg(r),severity:i,startIndex:d,endIndex:d+n.toString().length,startLine:g,endLine:h,startCol:f,endCol:m}},I=Xi((a,n,e,t)=>{let r=a.getRelativeIndex(),{top:i,left:s}=a.parentNode.posFromIndex(r);return{startIndex:n+r,startLine:e+i,startCol:i?s:t+s}}),P=Xi((a,n,e,t)=>({startIndex:n,startLine:e,startCol:t})),Ie=(a,n,e)=>{if(a)return a[1];let t=n();return e([re.rev,t]),t}});var va,Qr,Ki=k(()=>{"use strict";va=(a,n,e)=>{let[t,...r]=a.split("#");return(!t||t===n)&&r.every(i=>i===e)},Qr=(a,n,e)=>({type:t,name:r})=>a.split(",").some(i=>va(i.trim(),t,r))});var br,It,Nt,Tr,yr,Et,Lt,Ft,Xr,Pt,Dn=k(()=>{"use strict";D();ye();Pt=class{constructor(){T(this,Ft);te(this,"childNodes",[]);T(this,br);T(this,It);T(this,Nt);T(this,Tr);T(this,yr);T(this,Et);T(this,Lt,{})}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get parentNode(){return c(this,br)}get nextSibling(){return c(this,It)}get previousSibling(){return c(this,Nt)}get offsetHeight(){return A(this,Ft,Xr).call(this).height}get offsetWidth(){return A(this,Ft,Xr).call(this).width}getChildNodes(){let{childNodes:n}=this;return Object.isFrozen(n)?[...n]:n}getAttribute(n){return n==="padding"?0:this[n]}setAttribute(n,e){switch(n){case"parentNode":b(this,br,e),e||(b(this,It,void 0),b(this,Nt,void 0));break;case"nextSibling":b(this,It,e);break;case"previousSibling":b(this,Nt,e);break;case"aIndex":b(this,Et,[re.rev,e]);break;default:this[n]=e}}getRootNode(){return Ie(c(this,yr),()=>{var n,e;return(e=(n=this.parentNode)==null?void 0:n.getRootNode())!=null?e:this},n=>{let[,e]=n;e.type==="root"&&b(this,yr,n)})}indexFromPos(n,e){{if(n<0||e<0)return;let t=this.getLines();if(n>=t.length)return;let[,r,i]=t[n],s=r+e;return s>i?void 0:s}}posFromIndex(n){let{length:e}=String(this);if(n+=n<0?e:0,n>=0&&n<=e){let t=this.getLines(),r=t.findIndex(([,,i])=>n<=i);return{top:r,left:n-t[r][1]}}}getGaps(n){return 0}getRelativeIndex(n){if(n===void 0){let{parentNode:e}=this;return e?e.getRelativeIndex(e.childNodes.indexOf(this)):0}return Ie(c(this,Lt)[n],()=>{let{childNodes:e}=this,t=n+(n<0?e.length:0),r=this.getAttribute("padding");for(let i=0;i<t;i++)c(this,Lt)[i]=[re.rev,r],r+=e[i].toString().length+this.getGaps(i);return r},e=>{c(this,Lt)[n]=e})}getAbsoluteIndex(){return Ie(c(this,Et),()=>{let{parentNode:n}=this;return n?n.getAbsoluteIndex()+this.getRelativeIndex():0},n=>{b(this,Et,n)})}getBoundingClientRect(){return{...A(this,Ft,Xr).call(this),...this.getRootNode().posFromIndex(this.getAbsoluteIndex())}}seal(n,e){Object.defineProperty(this,n,{enumerable:!e&&!!this[n],configurable:!0})}is(n){return this.type===n}getLines(){return Ie(c(this,Tr),()=>{let n=[],e=0;for(let t of String(this).split(`
2
- `)){let r=e+t.length;n.push([t,e,r]),e=r+1}return n},n=>{b(this,Tr,n)})}};br=new WeakMap,It=new WeakMap,Nt=new WeakMap,Tr=new WeakMap,yr=new WeakMap,Et=new WeakMap,Lt=new WeakMap,Ft=new WeakSet,Xr=function(){let n=this.getLines(),e=n[n.length-1];return{height:n.length,width:e[2]-e[1]}}});var Ve,Wn,Hn,Kr,Ji=k(()=>{"use strict";Y();ye();Ki();Dn();Kr=class extends Pt{constructor(){super(...arguments);T(this,Ve)}get length(){return this.childNodes.length}text(e){return Te(this.childNodes,e)}normalize(){let e=this.getChildNodes(),t=r=>{var i,s;e.splice(r,1),(i=e[r-1])==null||i.setAttribute("nextSibling",e[r]),(s=e[r])==null||s.setAttribute("previousSibling",e[r-1])};for(let r=e.length-1;r>=0;r--){let{type:i,data:s}=e[r];i!=="text"||e.length===1||this.getGaps(r-(r&&1))||s===""&&t(r)}this.setAttribute("childNodes",e)}removeAt(e){return Un(this,e,1)[0]}insertAt(e,t=this.length){return Un(this,t,0,[e]),e}closest(e){let t=Qr(e,this),{parentNode:r}=this;for(;r;){if(t(r))return r;({parentNode:r}=r)}}querySelector(e){let t=Qr(e,this);return A(this,Ve,Wn).call(this,t)}querySelectorAll(e){let t=Qr(e,this);return A(this,Ve,Hn).call(this,t)}append(...e){for(let t of e)this.insertAt(t)}replaceChildren(...e){for(let t=this.length-1;t>=0;t--)this.removeAt(t);this.append(...e)}setText(e,t=0){t+=t<0?this.length:0;let r=this.childNodes[t],{data:i}=r;return r.replaceData(e),i}toString(e,t=""){return this.childNodes.map(r=>r.toString(e)).join(t)}caretPositionFromIndex(e){{if(e===void 0)return;let{length:t}=this.toString();if(e>t||e<-t)return;e+=e<0?t:0;let r=this,i=0,s=0;for(;r.type!=="text";){let{childNodes:o}=r;i+=r.getAttribute("padding");for(let l=0;i<=e&&l<o.length;l++){let u=o[l],{nextSibling:p}=u,d=u.toString(),g=d.length;if(u.setAttribute("aIndex",i),i+=g,i>e||i===e&&g>0&&(!p||p.type==="text"||u.type!=="text"&&(d.trim()||!p.toString().trim()))){r=u,i-=g,s=i;break}i+=r.getGaps(l)}if(r.childNodes===o)return{offsetNode:r,offset:e-s}}return{offsetNode:r,offset:e-s}}}elementFromIndex(e){var t;{let r=(t=this.caretPositionFromIndex(e))==null?void 0:t.offsetNode;return(r==null?void 0:r.type)==="text"?r.parentNode:r}}elementFromPoint(e,t){return this.elementFromIndex(this.indexFromPos(t,e))}lint(e=this.getAbsoluteIndex(),t){let r=[];for(let i=0,s=e+this.getAttribute("padding");i<this.length;i++){let o=this.childNodes[i];o.setAttribute("aIndex",s),r.push(...o.lint(s,t)),s+=o.toString().length+this.getGaps(i)}return r}print(e={}){let t=e.class;return this.toString()?(t===""?"":`<span class="wpb-${t!=null?t:this.type}">`)+qe(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){let r={...this,type:this.type,range:[t,t+this.toString().length],childNodes:[]};for(let i=0,s=t+this.getAttribute("padding");i<this.length;i++){let o=this.childNodes[i],{length:l}=o.toString();o.setAttribute("aIndex",s),r.childNodes.push(o.type==="text"?{data:o.data,range:[s,s+l]}:o.json(void 0,s)),s+=l+this.getGaps(i)}return r}};Ve=new WeakSet,Wn=function(e){var t;for(let r of this.childNodes){if(r.type==="text")continue;if(e(r))return r;let i=A(t=r,Ve,Wn).call(t,e);if(i)return i}},Hn=function(e){var r;let t=[];for(let i of this.childNodes)i.type!=="text"&&(e(i)&&t.push(i),t.push(...A(r=i,Ve,Hn).call(r,e)));return t}});var zn,Yi,Aa,Sa,wa,Ca,$a,Ia,Gn,Jr,Zi,kr,es=k(()=>{"use strict";Y();D();W();Dn();zn=String.raw`[${$e}\t]*`,Yi=String.raw`<\s*(?:/\s*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${zn}\d)|isbn(?=[-::]?${zn}(?:\d(?:${zn}|-)){6})`,Aa=new RegExp(String.raw`${Yi}|https?[:/]/+`,"giu"),Sa=new RegExp(Yi,"giu"),wa=new Set(["attr-value","ext-link-text","link-text"]),Ca={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},$a={"<":"tag-like","[":"lonely-bracket","{":"lonely-bracket","]":"lonely-bracket","}":"lonely-bracket",h:"lonely-http",r:"lonely-http",p:"lonely-http",i:"lonely-http"},Ia=["html","head","style","title","body","a","audio","img","video","embed","iframe","object","canvas","script","col","colgroup","tbody","tfoot","thead","button","input","label","option","select","textarea"];try{Gn=new RegExp(String.raw`[\p{L}\d_]`,"u")}catch(a){Gn=/\w/u}kr=class extends Pt{constructor(e){super();T(this,Jr);te(this,"data","");Object.defineProperties(this,{childNodes:{enumerable:!1,configurable:!1},data:{value:e}})}get type(){return"text"}toString(e){var t;return e&&!((t=this.parentNode)!=null&&t.getAttribute("built"))?de(this.data):this.data}text(){return this.data}lint(e=this.getAbsoluteIndex(),t){var M,F,Q;if(t===!1)return[];let{data:r,parentNode:i,nextSibling:s,previousSibling:o}=this;if(!i)throw new Error("An isolated text node cannot be linted!");let{type:l,name:u,parentNode:p}=i,d=!1;if(l==="attr-value"){let{type:R,name:H,tag:G}=p;if(R!=="ext-attr")d=!0;else if(G==="choose"&&(H==="before"||H==="after"))return[]}if(t!=null||(t=l==="free-ext-link"||l==="ext-link-url"||l==="ext-link-text"||l==="image-parameter"&&u==="link"||d?Sa:Aa),r.search(t)===-1)return[];t.lastIndex=0;let g=[],f=s==null?void 0:s.type,h=s==null?void 0:s.name,m=o==null?void 0:o.type,x=this.getRootNode(),y=x.toString(),{ext:w,html:C}=x.getAttribute("config"),{top:$,left:E}=x.posFromIndex(e),_=new Set(["onlyinclude","noinclude","includeonly",...w,...C[0],...C[1],...C[2],...Ia]);for(let R=t.exec(r);R;R=t.exec(r)){let[,H,G]=R,{index:L}=R,q=R[0].toLowerCase();if(G&&G!=="]"){let{length:fe}=G;L+=fe,q=q.slice(fe)}let{0:N,length:ue}=q,ie=N==="r"||N==="p"||N==="i";if(N==="<"&&!_.has(H.toLowerCase())||N==="["&&l==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(r.slice(L+1))||s!=null&&s.is("ext")&&h==="nowiki"&&((M=s.innerText)!=null&&M.includes("]")))||ie&&(!i.getAttribute("plain")||wa.has(l)))continue;N==="]"&&(L||ue>1)&&t.lastIndex--;let me=e+L,pe=me+ue,be=y[pe],yt=y[me-1],Rn=ue>1&&!(N==="<"&&!/[\s/>]/u.test(be!=null?be:"")||d&&(N==="["||N==="]")||ie&&l==="parameter-value")||N==="{"&&(be===N||yt==="-")||N==="}"&&(yt===N||be==="-")||N==="["&&(be===N||l==="ext-link-text"||f==="free-ext-link"&&!r.slice(L+1).trim())||N==="]"&&(yt===N||m==="free-ext-link"&&!r.slice(0,L).includes("]"))?"error":"warning",jn=N==="{"||N==="[";if(Rn==="warning"&&(jn||(N==="]"||N==="}"))){let fe=Ca[N],Bn=jn?r.slice(L+1):r.slice(0,L);if(N==="{"&&((F=fe.exec(Bn))==null?void 0:F[0])==="}"||N==="}"&&((Q=fe.exec(Bn))==null?void 0:Q[0])==="{")continue;if(!Bn.includes(N)){let Ri=jn?"nextSibling":"previousSibling",rt=this[Ri];for(;rt&&(rt.type!=="text"||!fe.test(rt.data));)rt=rt[Ri];if(rt&&fe.exec(rt.data)[0]!==N)continue}}ie&&(q=q.toUpperCase());let Li=this.posFromIndex(L),{line:Fi,character:Pi}=$t($,E,Li.top+1,Li.left),kt={rule:$a[N],message:v.msg('lonely "$1"',ie||N==="h"?q:N),severity:Rn,startIndex:me,endIndex:pe,startLine:Fi,endLine:Fi,startCol:Pi,endCol:Pi+ue};if(N==="<")kt.suggestions=[{desc:"escape",range:[me,me+1],text:"&lt;"}];else if(N==="h"&&l!=="link-text"&&Gn.test(yt||""))kt.suggestions=[{desc:"whitespace",range:[me,me],text:" "}];else if(N==="["&&l==="ext-link-text"){let fe=i.getAbsoluteIndex()+i.toString().length;kt.suggestions=[{desc:"escape",range:[fe,fe+1],text:"&#93;"}]}else if(N==="]"&&m==="free-ext-link"&&Rn==="error"){let fe=e-o.toString().length;kt.fix={range:[fe,fe],text:"[",desc:"left bracket"}}else ie&&(kt.suggestions=[...R[0]===q?[]:[{desc:"uppercase",range:[me,pe],text:q}],...be===":"||be==="\uFF1A"?[{desc:"whitespace",range:[pe,pe+1],text:" "}]:[]]);g.push(kt)}return g}replaceData(e){A(this,Jr,Zi).call(this,e)}print(){return wt(this.data)}};Jr=new WeakSet,Zi=function(e){this.setAttribute("data",e)}});var ke,st=k(()=>{"use strict";ye();ke=(a=!0,n=!0)=>(e,t)=>{class r extends e{text(){return""}lint(s){return a?[]:super.lint(s)}}return Yr(r,e),r}});var vr,ve,Rt=k(()=>{"use strict";B();ve=class extends S{constructor(e,t,r,i,s,o){super(e,i,s,o);T(this,vr);b(this,vr,r)}get type(){return c(this,vr)}lint(e=this.getAbsoluteIndex()){return super.lint(e,!1)}};vr=new WeakMap});var jt,V,_e=k(()=>{"use strict";B();V=class extends S{constructor(e,t,r,i,s){super(e,r,i,s);T(this,jt);b(this,jt,t)}get type(){return c(this,jt)}set type(e){b(this,jt,e)}};jt=new WeakMap});var Na,ot,Ne,Le,Fe,Ar=k(()=>{"use strict";D();Y();ee();W();B();_e();Na=a=>a==="redirect-target"||a==="link",Fe=class extends S{constructor(e,t,r=v.getConfig(),i=[],s="|"){super(void 0,r,i,{});T(this,ot,!0);T(this,Ne);T(this,Le);if(this.insertAt(new V(e,"link-target",r,i,{})),t!==void 0){let o=new S(t,r,i,{});o.type="link-text",o.setAttribute("stage",10),this.insertAt(o)}b(this,Ne,s)}get link(){return c(this,Le)}get fragment(){return c(this,Le).fragment}afterBuild(){b(this,Le,this.getTitle()),c(this,Ne).includes("\0")&&b(this,Ne,this.buildFromStr(c(this,Ne),0)),this.setAttribute("name",c(this,Le).title),super.afterBuild()}setAttribute(e,t){e==="bracket"?b(this,ot,t):e==="title"?b(this,Le,t):super.setAttribute(e,t)}toString(e){let t=super.toString(e,c(this,Ne));return c(this,ot)?`[[${t}]]`:t}text(){let e=super.text("|");return c(this,ot)?`[[${e}]]`:e}getAttribute(e){return e==="title"?c(this,Le):e==="padding"?2:super.getAttribute(e)}getGaps(e){return e===0?c(this,Ne).length:1}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{childNodes:[i,s],type:o}=this,{encoded:l,fragment:u}=c(this,Le),p=new j(this,e);if(i.childNodes.some(({type:d})=>d==="template")&&r.push(I(i,p,"unknown-page","template in an internal link target","warning")),l){let d=I(i,p,"url-encoding","unnecessary URL encoding in an internal link");d.suggestions=[{desc:"decode",range:[d.startIndex,d.endIndex],text:Ge(i.text())}],r.push(d)}if(o==="link"||o==="category"){let d=s==null?void 0:s.childNodes.findIndex(f=>f.type==="text"&&f.data.includes("|")),g=s==null?void 0:s.childNodes[d];if(g){let f=I(s,p,"pipe-like",'additional "|" in the link text',"warning"),h=f.startIndex+s.getRelativeIndex(d);f.suggestions=[{desc:"escape",range:[h,h+g.data.length],text:g.data.replace(/\|/gu,"&#124;")}],r.push(f)}}if(u!==void 0&&!Na(o)){let d=I(i,p,"no-ignored","useless fragment"),g=i.childNodes.findIndex(h=>h.type==="text"&&h.data.includes("#")),f=i.childNodes[g];f&&(d.fix={range:[d.startIndex+i.getRelativeIndex(g)+f.data.indexOf("#"),d.endIndex],text:"",desc:"remove"}),r.push(d)}return r}getTitle(e,t){return this.normalizeTitle(this.firstChild.toString(!0),0,e,t,!0,!0)}print(){return super.print(c(this,ot)?{pre:"[[",post:"]]",sep:c(this,Ne)}:{sep:c(this,Ne)})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t),{type:i,fragment:s}=this;return s!==void 0&&(i==="link"||i==="redirect-target")&&(r.fragment=s),r}};ot=new WeakMap,Ne=new WeakMap,Le=new WeakMap});var ge,Qe=k(()=>{"use strict";B();ge=class extends S{get innerText(){return this.firstChild.data}constructor(n="",e,t){super(n,e,t)}}});var ts,Vn,Ea,K,Xe=k(()=>{"use strict";st();Qe();ts=[ke()];K=class extends(Ea=ge){get type(){return"noinclude"}toString(n){return n?"":super.toString()}};Vn=oe(Ea),K=le(Vn,0,"NoincludeToken",ts,K),ae(Vn,1,K)});var Zr,rs=k(()=>{"use strict";D();Ar();Xe();Zr=class extends Fe{get type(){return"redirect-target"}constructor(n,e,t,r){super(n,void 0,t,r),e!==void 0&&this.insertAt(new K(e,t,r))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,!1,!0,!0)}lint(n=this.getAbsoluteIndex()){let e=super.lint(n,!1);if(this.length===2){let t=I(this.lastChild,{start:n},"no-ignored","useless link text");t.startIndex--,t.startCol--,t.fix={range:[t.startIndex,t.endIndex],text:"",desc:"remove"},e.push(t)}return e}}});var ns,Ke,Bt,Qn,La,at,is=k(()=>{"use strict";st();B();Rt();rs();ns=[ke(!1,!1)];at=class extends(La=S){constructor(e,t,r,i,s,o,l=[]){super(void 0,o,l);T(this,Ke);T(this,Bt);b(this,Ke,e),b(this,Bt,s);let u=new RegExp(String.raw`^(?:${o.redirection.join("|")})\s*(?::\s*)?$`,"iu");this.append(new ve(t,u,"redirect-syntax",o,l,{}),new Zr(r,i==null?void 0:i.slice(1),o,l))}get type(){return"redirect"}getAttribute(e){return e==="padding"?c(this,Ke).length:super.getAttribute(e)}toString(e){return c(this,Ke)+super.toString(e)+c(this,Bt)}lint(e=this.getAbsoluteIndex()){let t=e+c(this,Ke).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",t),this.lastChild.lint(t)}print(){return super.print({pre:c(this,Ke),post:c(this,Bt)})}};Qn=oe(La),Ke=new WeakMap,Bt=new WeakMap,at=le(Qn,0,"RedirectToken",ns,at),ae(Qn,1,at)});var ss={};se(ss,{parseRedirect:()=>Fa});var Fa,os=k(()=>{"use strict";W();is();Fa=(a,n,e)=>{var r;(r=n.regexRedirect)!=null||(n.regexRedirect=new RegExp(String.raw`^(\s*)((?:${n.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));let t=n.regexRedirect.exec(a);return t&&v.normalizeTitle(t[3],0,!1,n,!0,!0,!0).valid?(a=`\0${e.length}o\x7F${a.slice(t[0].length)}`,new at(...t.slice(1),n,e),a):!1}});var en,as=k(()=>{"use strict";B();en=class extends S{get type(){return"onlyinclude"}toString(n){return`<onlyinclude>${super.toString(n)}</onlyinclude>`}getAttribute(n){return n==="padding"?13:n==="plain"||super.getAttribute(n)}print(){return super.print({pre:'<span class="wpb-ext">&lt;onlyinclude&gt;</span>',post:'<span class="wpb-ext">&lt;/onlyinclude&gt;</span>'})}}});var Je,qt,Xn=k(()=>{"use strict";B();qt=class extends S{constructor(e,t,r,i,s,o=[]){super(void 0,s);T(this,Je);te(this,"closed");te(this,"selfClosing");this.setAttribute("name",e.toLowerCase()),b(this,Je,[e,i||e]),this.closed=i!=="",this.selfClosing=i===void 0,this.append(t,r);let l=typeof t=="string"?-1:o.indexOf(t);o.splice(l===-1?1/0:l,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(e){let{selfClosing:t,firstChild:r,lastChild:i}=this,[s,o]=c(this,Je);return t?`<${s}${r.toString(e)}/>`:`<${s}${r.toString(e)}>${i.toString(e)}${this.closed?`</${o}>`:""}`}text(){let[e,t]=c(this,Je);return this.selfClosing?`<${e}${this.firstChild.text()}/>`:`<${e}${super.text(">")}${this.closed?`</${t}>`:""}`}getAttribute(e){return e==="padding"?c(this,Je)[0].length+1:super.getAttribute(e)}getGaps(){return 1}print(){let[e,t]=c(this,Je);return super.print(this.selfClosing?{pre:`&lt;${e}`,post:"/&gt;"}:{pre:`&lt;${e}`,sep:"&gt;",post:this.closed?`&lt;/${t}&gt;`:""})}};Je=new WeakMap});var ls,Kn,Pa,lt,ds=k(()=>{"use strict";D();ee();st();W();Xn();ls=[ke(!1)];lt=class extends(Pa=qt){get type(){return"include"}constructor(n,e="",t,r,i,s){super(n,e,t!=null?t:"",t===void 0||r!=null?r:"",i,s)}toString(n){return n?"":super.toString()}lint(n=this.getAbsoluteIndex()){let e=[],{firstChild:t,closed:r,name:i}=this,s=new j(this,n);if(t.data.trim()){let o=I(t,s,"no-ignored","useless attribute","warning");o.suggestions=[{desc:"remove",range:[o.startIndex,o.endIndex],text:""}],e.push(o)}if(!r){let o=P(this,s,"unclosed-comment",v.msg("unclosed $1",`<${i}>`));o.suggestions=[{desc:"close",range:[o.endIndex,o.endIndex],text:`</${i}>`}],e.push(o)}return e}};Kn=oe(Pa),lt=le(Kn,0,"IncludeToken",ls,lt),ae(Kn,1,lt)});var _t,tn=k(()=>{"use strict";ye();_t=(a=0)=>(n,e)=>{var r,gs;class t extends n{constructor(){super(...arguments);T(this,r)}getAttr(l){return A(this,r,gs).call(this).getAttr(l)}}return r=new WeakSet,gs=function(){return this.childNodes[a]},Yr(t,n),t}});var Z,us,ps,nn,Jn,cs,Ot,ms,hs,fs,rn,sn,on,an,xs,Yn=k(()=>{"use strict";Z=new Set(["align"]),us=new Set(["cite"]),ps=new Set(["cite","datetime"]),nn=new Set(["width"]),Jn=new Set(["axis","align","bgcolor","height","width","valign"]),cs=new Set([...Jn,"abbr","headers","scope","rowspan","colspan"]),Ot=new Set(["type"]),ms=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),hs=new Set(["clear"]),fs=new Set(["bgcolor","align","valign"]),rn=new Set,sn=new Set(["id","class","style","lang","dir","title","tabindex","aria-describedby","aria-flowto","aria-hidden","aria-label","aria-labelledby","aria-level","aria-owns","role","about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),on={div:Z,h1:Z,h2:Z,h3:Z,h4:Z,h5:Z,h6:Z,blockquote:us,q:us,p:Z,br:hs,pre:nn,ins:ps,del:ps,ul:Ot,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...ms,"border"]),caption:Z,tr:fs,td:cs,th:cs,img:new Set(["alt","src","width","height","srcset"]),font:new Set(["size","color","face"]),hr:nn,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Ot,poem:Z,categorytree:Z,combooption:Z},an={gallery:new Set(["mode","showfilename","caption","perrow","widths","heights","showthumbnails"]),poem:new Set(["compact"]),categorytree:new Set(["hideroot","onlyroot","depth","mode","hideprefix","namespaces","showcount","notranslations"]),combooption:new Set(["name","for","inline"]),nowiki:rn,indicator:new Set(["name"]),langconvert:new Set(["from","to"]),ref:new Set(["group","name","extends","follow","dir"]),references:new Set(["group","responsive"]),charinsert:new Set(["label"]),choose:new Set(["uncached","before","after"]),option:new Set(["weight"]),imagemap:rn,inputbox:rn,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:rn,poll:new Set(["id","show-results-before-voting"]),sm2:Ot,flashmp3:Ot,score:new Set(["line_width_inches","lang","override_midi","raw","note-language","override_audio","override_ogg","sound","vorbis"]),seo:new Set(["title","title_mode","title_separator","keywords","description","robots","google_bot","image","image_width","image_height","image_alt","type","site_name","locale","section","author","published_time","twitter_site"]),tab:new Set(["nested","name","index","class","block","inline","openname","closename","collapsed","dropdown","style","bgcolor","container","id","title"]),tabs:new Set(["plain","class","container","id","title","style"]),combobox:new Set(["placeholder","value","id","class","text","dropdown","style"])},xs={table:ms,td:new Set([...Jn,"scope"]),th:Jn,br:hs,caption:Z,div:Z,hr:nn,h1:Z,h2:Z,h3:Z,h4:Z,h5:Z,h6:Z,li:Ot,p:Z,pre:nn,tr:fs,ul:Ot}});var Ra,Sr,Mt,ne,Pe,Dt,bs=k(()=>{"use strict";D();Y();Yn();ee();W();B();_e();Ra=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,Dt=class extends S{constructor(e,t,r,i="",s,o=[],l=v.getConfig(),u=[]){let p=new V(r,"attr-key",l,u),d;if(r==="title"||t==="img"&&r==="alt")d=new S(s,l,u,{}),d.type="attr-value",d.setAttribute("stage",10);else if(t==="gallery"&&r==="caption"||t==="choose"&&(r==="before"||r==="after")){let g={...l,excludes:[...l.excludes,"heading","html","table","hr","list"]};d=new S(s,g,u,{}),d.type="attr-value",d.setAttribute("stage",1)}else d=new V(s,"attr-value",l,u,{});super(void 0,l,u);T(this,Sr);T(this,Mt);T(this,ne);T(this,Pe);b(this,Sr,e),this.append(p,d),b(this,ne,i),b(this,Pe,[...o]),b(this,Mt,t),this.setAttribute("name",de(r).trim().toLowerCase())}get type(){return c(this,Sr)}get tag(){return c(this,Mt)}get balanced(){return!c(this,ne)||c(this,Pe)[0]===c(this,Pe)[1]}afterBuild(){c(this,ne).includes("\0")&&b(this,ne,this.buildFromStr(c(this,ne),0)),this.parentNode&&b(this,Mt,this.parentNode.name),this.setAttribute("name",this.firstChild.toString(!0).trim().toLowerCase()),super.afterBuild()}toString(e){let[t="",r=""]=c(this,Pe);return c(this,ne)?super.toString(e,c(this,ne)+t)+r:this.firstChild.toString(e)}text(){return c(this,ne)?`${super.text(`${c(this,ne).trim()}"`)}"`:this.firstChild.text()}getGaps(){var e,t;return c(this,ne)?c(this,ne).length+((t=(e=c(this,Pe)[0])==null?void 0:e.length)!=null?t:0):0}lint(e=this.getAbsoluteIndex(),t){var x;let r=super.lint(e,t),{balanced:i,firstChild:s,lastChild:o,type:l,name:u,tag:p}=this,d=this.getValue(),g=new j(this,e);if(!i){let y=I(o,g,"unclosed-quote",v.msg("unclosed $1","quotes"),"warning");y.startIndex--,y.startCol--,y.suggestions=[{range:[y.endIndex,y.endIndex],text:c(this,Pe)[0],desc:"close"}],r.push(y)}let f=an[p],h=on[p],{length:m}=this.toString();if(!(f!=null&&f.has(u))&&!(h!=null&&h.has(u))&&(l==="ext-attr"?f||h:!/\{\{[^{]+\}\}/u.test(u))&&(l==="ext-attr"&&!h||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(u)&&(p==="meta"||p==="link"||!sn.has(u)))){let y=I(s,g,"illegal-attr","illegal attribute name");y.suggestions=[{desc:"remove",range:[e,e+m],text:""}],r.push(y)}else if((x=xs[p])!=null&&x.has(u))r.push(I(s,g,"obsolete-attr","obsolete attribute","warning"));else if(u==="style"&&typeof d=="string"&&Ra.test(d))r.push(I(o,g,"insecure-style","insecure style"));else if(u==="tabindex"&&typeof d=="string"&&d!=="0"){let y=I(o,g,"illegal-attr","nonzero tabindex");y.suggestions=[{desc:"remove",range:[e,e+m],text:""},{desc:"0 tabindex",range:[y.startIndex,y.endIndex],text:"0"}],r.push(y)}return r}getValue(){return c(this,ne)?this.lastChild.text().trim():this.type==="ext-attr"||""}print(){let[e="",t=""]=c(this,Pe);return c(this,ne)?super.print({sep:wt(c(this,ne))+e,post:t}):super.print()}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return r.tag=this.tag,r}};Sr=new WeakMap,Mt=new WeakMap,ne=new WeakMap,Pe=new WeakMap});var Ts,ja,Zn,wr,Ye,ln=k(()=>{"use strict";D();Y();ee();W();B();_e();bs();Ts=a=>a.slice(0,-1),ja=a=>`${Ts(a)}-dirty`;try{Zn=new RegExp(String.raw`[\p{L}\d]`,"u")}catch(a){Zn=/[^\W_]/u}Ye=class extends S{constructor(e,t,r,i,s=[]){super(void 0,i,s,{});T(this,wr);if(b(this,wr,t),this.setAttribute("name",r),e){let o=/([^\s/](?:(?!\0\d+~\x7F)[^\s/=])*)(?:((?:\s(?:\s|\0\d+[cn]\x7F)*)?(?:=|\0\d+~\x7F)(?:\s|\0\d+[cn]\x7F)*)(?:(["'])([\s\S]*?)(\3|$)|(\S*)))?/gu,l="",u=o.exec(e),p=0,d=()=>{l&&(super.insertAt(new V(l,ja(t),i,s,{})),l="")};for(;u;){let{index:g,0:f,1:h,2:m,3:x,4:y,5:w,6:C}=u;if(l+=e.slice(p,g),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(de(h).trim())){let $=y!=null?y:C,E=[x,w],_=new Dt(Ts(t),r,h,m,$,E,i,s);d(),super.insertAt(_)}else l+=f;({lastIndex:p}=o),u=o.exec(e)}l+=e.slice(p),d()}}get type(){return c(this,wr)}afterBuild(){let{parentNode:e}=this;(e==null?void 0:e.type)==="td"&&e.subtype==="caption"&&this.setAttribute("name","caption"),super.afterBuild()}getAttrTokens(e){return this.childNodes.filter(t=>t instanceof Dt&&(!e||t.name===e.toLowerCase().trim()))}getAttrToken(e){let t=this.getAttrTokens(e);return t[t.length-1]}getAttr(e){var t;return(t=this.getAttrToken(e))==null?void 0:t.getValue()}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{parentNode:i,childNodes:s}=this,o=new Map,l=new Set,u=new j(this,e);if((i==null?void 0:i.type)==="html"&&i.closing&&this.text().trim()){let p=P(this,u,"no-ignored","attributes of a closing tag"),d=i.getAbsoluteIndex();p.suggestions=[{desc:"remove",range:[e,p.endIndex],text:""},{desc:"open",range:[d+1,d+2],text:""}],r.push(p)}for(let p of s)if(p instanceof Dt){let{name:d}=p;o.has(d)?(l.add(d),o.get(d).push(p)):o.set(d,[p])}else{let d=p.text().trim();if(d){let g=I(p,u,"no-ignored","containing invalid attribute",Zn.test(d)?"error":"warning");g.suggestions=[{desc:"remove",range:[g.startIndex,g.endIndex],text:" "}],r.push(g)}}if(l.size>0)for(let p of l){let d=o.get(p).map(g=>{let f=g.getValue();return[g,f===!0?"":f]});r.push(...d.map(([g,f],h)=>{let m=I(g,u,"no-duplicate",v.msg("duplicated $1 attribute",p)),x={desc:"remove",range:[m.startIndex,m.endIndex],text:""};return!f||d.slice(0,h).some(([,y])=>y===f)?m.fix=x:m.suggestions=[x],m}))}return r}print(){return this.toString()?`<span class="wpb-${this.type}">${this.childNodes.map(e=>e.print(e instanceof V?{class:e.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}};wr=new WeakMap});var dn,ys=k(()=>{"use strict";W();B();Xe();dn=class extends S{get type(){return"ext-inner"}constructor(n,e=v.getConfig(),t=[]){if(n){let r=/<nowiki>/giu,i=/<\/nowiki>/giu,{length:s}=r.source,o=r.exec(n);o&&(i.lastIndex=o.index+s);let l=i.exec(n),u=0,p="";for(;o&&l;)new K(o[0],e,t),new K(l[0],e,t),p+=`${n.slice(u,o.index)}\0${t.length-1}n\x7F${n.slice(o.index+s,l.index)}\0${t.length}n\x7F`,u=l.index+s+1,r.lastIndex=u,o=r.exec(n),o&&(i.lastIndex=o.index+s),l=i.exec(n);n=p+n.slice(u)}super(n,e,t,{}),this.setAttribute("stage",10)}getAttribute(n){return n==="plain"||super.getAttribute(n)}lint(n=this.getAbsoluteIndex()){return super.lint(n,/<\s*\/\s*(pre)\b/giu)}}});var Wt,ei=k(()=>{"use strict";D();ee();Cr();W();B();_e();Wt=class extends S{get type(){return"ext-inner"}constructor(n,e,t=v.getConfig(),r=[],i){if(super(void 0,t,r,{}),e){let s=V;this.append(...e.split(`
3
- `).map(o=>i?o:dt(o,t,r,n)).map(o=>new s(o,"param-line",t,r,{})))}r.splice(r.indexOf(this),1),r.push(this)}toString(n){return super.toString(n,`
4
- `)}text(){return super.text(`
5
- `)}getGaps(){return 1}lint(n=this.getAbsoluteIndex()){let e=new j(this,n),t=v.msg("invalid parameter of <$1>",this.name),r=[];for(let i of this.childNodes){i.setAttribute("aIndex",n);let s=i.childNodes.filter(({type:o})=>o!=="comment"&&o!=="include"&&o!=="noinclude");if(s.some(({type:o})=>o==="ext"))r.push(I(i,e,"no-ignored",t));else{let o=s.findIndex(({type:u})=>u!=="text"),l=s.slice(0,o===-1?void 0:o).map(String).join("");if(l&&!(o===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(l)){let u=I(i,e,"no-ignored",t);u.suggestions=[{desc:"remove",range:[u.startIndex,u.endIndex],text:""}],r.push(u)}else r.push(...i.lint(n,!1))}n+=i.toString().length+1}return r}print(){return super.print({sep:`
6
- `})}}});var $r,Ht,gn,Ut,ti=k(()=>{"use strict";D();ye();ee();W();B();Rt();Ut=class extends S{constructor(e,t,r,i=[]){super(void 0,r,i);T(this,Ht);T(this,$r);b(this,$r,e);let s=new S(t[0],r,i);s.type="heading-title",s.setAttribute("stage",2);let o=new ve(t[1],/^\s*$/u,"heading-trail",r,i,{});this.append(s,o)}get type(){return"heading"}get level(){return c(this,$r)}toString(e){let t=A(this,Ht,gn).call(this);return t+this.firstChild.toString(e)+t+this.lastChild.toString(e)}text(){let e=A(this,Ht,gn).call(this);return e+this.firstChild.text()+e}getAttribute(e){return e==="padding"?this.level:super.getAttribute(e)}getGaps(){return this.level}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{firstChild:i,level:s}=this,o=i.toString(),l=o.startsWith("="),u=l||o.endsWith("="),p=i.childNodes.filter(zt("quote")),d=p.filter(({bold:m})=>m),g=p.filter(({italic:m})=>m),f=new j(this,e);if(this.level===1){let m=I(i,f,"h1","<h1>");u||(m.suggestions=[{desc:"h2",range:[m.startIndex,m.endIndex],text:`=${o}=`}]),r.push(m)}if(u){let m=I(i,f,"unbalanced-header",v.msg("unbalanced $1 in a section header",'"="'));if(o!=="=")if(l){let[x]=/^=+/u.exec(o);m.suggestions=[{desc:`h${s}`,range:[m.startIndex,m.startIndex+x.length],text:""},{desc:`h${s+x.length}`,range:[m.endIndex,m.endIndex],text:x}]}else{let x=/[^=](=+)$/u.exec(o)[1];m.suggestions=[{desc:`h${s}`,range:[m.endIndex-x.length,m.endIndex],text:""},{desc:`h${s+x.length}`,range:[m.startIndex,m.startIndex],text:x}]}r.push(m)}this.closest("html-attrs,table-attrs")&&r.push(P(this,f,"parsing-order","section header in an HTML tag"));let h=this.getRootNode().toString();if(d.length%2){let m=I(d[d.length-1],{...f,start:e+s,left:f.left+s},"format-leakage",v.msg("unbalanced $1 in a section header","bold apostrophes")),x=e+s+o.length;h.slice(m.endIndex,x).trim()?m.suggestions=[{desc:"close",range:[x,x],text:"'''"}]:m.fix={desc:"remove",range:[m.startIndex,m.endIndex],text:""},r.push(m)}if(g.length%2){let m=I(g[g.length-1],{start:e+s},"format-leakage",v.msg("unbalanced $1 in a section header","italic apostrophes")),x=e+s+o.length;m.fix=h.slice(m.endIndex,x).trim()?{desc:"close",range:[x,x],text:"''"}:{desc:"remove",range:[m.startIndex,m.endIndex],text:""},r.push(m)}return r}print(){let e=A(this,Ht,gn).call(this);return super.print({pre:e,sep:e})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return r.level=this.level,r}};$r=new WeakMap,Ht=new WeakSet,gn=function(){return"=".repeat(this.level)}});var Ba,un,ks=k(()=>{"use strict";Y();D();W();B();Ba=new RegExp(`https?://${je}${Be}$`,"iu"),un=class extends S{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){var n;try{return!!((n=this.parentNode)!=null&&n.getDuplicatedArgs().some(([e])=>e===this.name))}catch(e){return!1}}constructor(n,e,t=v.getConfig(),r=[]){super(void 0,t,r);let i=new S(typeof n=="number"?void 0:n,t,r,{}),s=new S(e,t,r);i.type="parameter-key",i.setAttribute("stage",2),s.type="parameter-value",s.setAttribute("stage",2),this.append(i,s)}trimName(n,e=!0){let t=(typeof n=="string"?n:n.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",t),t}afterBuild(){if(!this.anon){let{parentNode:n,firstChild:e}=this,t=this.trimName(e);n&&n.getArgs(t,!1,!1).add(this)}super.afterBuild()}toString(n){return this.anon?this.lastChild.toString(n):super.toString(n,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(n=this.getAbsoluteIndex(),e){var s;let t=super.lint(n,e),{firstChild:r}=this,i=(s=Ba.exec(r.text()))==null?void 0:s[0];if(i&&new URL(i).search){let o=I(r,{start:n},"unescaped","unescaped query string in an anonymous parameter");o.startIndex=o.endIndex,o.startLine=o.endLine,o.startCol=o.endCol,o.endIndex++,o.endCol++,o.fix={range:[o.startIndex,o.endIndex],text:"{{=}}",desc:"escape"},t.push(o)}return t}print(){return super.print({sep:this.anon?"":"="})}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e);return Object.assign(t,{anon:this.anon,duplicated:this.duplicated}),t}}});var Nr,gt,ut,Gt,Ze,pn,vs,Ir,As=k(()=>{"use strict";Y();D();ye();ee();B();ks();_e();Rt();Ir=class extends S{constructor(e,t,r,i=[]){var m,x;let s,o=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(e);o&&(s=Number(o[1]),e=e.replace(`\0${s}h\x7F`,i[s].toString().replace(/^\n/u,"")));super(void 0,r,i,{});T(this,Ze);te(this,"modifier","");T(this,Nr,"template");T(this,gt,!1);T(this,ut,new Map);T(this,Gt);let{parserFunction:[l,u],variable:p}=r,d=(m=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(e))==null?void 0:m[0];if(d)this.setAttribute("modifier",d),e=e.slice(d.length);else if(e.includes(":")){let[y,...w]=e.split(":"),[C]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((x=w[0])!=null?x:"");this.setModifier(`${y}:${C}`)&&(e=w.join(":").slice(C.length))}let g=e.includes(":");if(g||t.length===0&&!c(this,gt)){let y=e.indexOf(":"),w=y===-1?e:e.slice(0,y),C=y===-1?void 0:e.slice(y+1),$=de(w),E=$[C===void 0?"trim":"trimStart"](),_=E.toLowerCase(),M=Array.isArray(u),F=M?u.includes(E):Object.prototype.hasOwnProperty.call(u,E),Q=!M&&F?u[E]:Object.prototype.hasOwnProperty.call(l,_)&&l[_];if(M&&F||p.includes(Q)||g&&Q){this.setAttribute("name",Q||_.replace(/^#/u,"")),b(this,Nr,"magic-word");let H=new RegExp(String.raw`^\s*${E}\s*$`,F?"u":"iu"),G=new ve(w,H,"magic-word-name",r,i,{});if(super.insertAt(G),C!==void 0&&t.unshift([C]),this.name==="invoke")for(let L=0;L<2;L++){let q=t.shift();if(!q)break;let N=new V(q.join("="),`invoke-${L?"function":"module"}`,r,i);super.insertAt(N)}}}if(this.type==="template"){let y=de(e).trim();if(!this.normalizeTitle(y,10,!0,!0).valid)throw i.pop(),new SyntaxError("Invalid template name");let w=new V(e,"template-name",r,i,{});super.insertAt(w)}typeof s=="number"&&(i[s]=void 0);let f=this.isTemplate(),h=1;for(let y=0;y<t.length;y++){let w=t[y];f||this.name==="switch"&&y>0||this.name==="tag"&&y>1||(w[0]=w.join("="),w.length=1),w.length===1&&(w.unshift(h),h++),this.insertAt(new un(...w,r,i))}this.seal("modifier")}get type(){return c(this,Nr)}setModifier(e){let{parserFunction:[,,t,r]}=this.getAttribute("config"),i=de(e).trim();if(e&&!i.endsWith(":"))return!1;let s=i.slice(0,-1).toLowerCase(),o=t.includes(s),l=r.includes(s);return c(this,gt)&&o||!c(this,gt)&&(l||e==="")||(re.running||this.length>1)&&(o||l||e==="")?(this.setAttribute("modifier",e),b(this,gt,o),!!e):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}getModule(){var e;if(this.type!=="magic-word"||this.name!=="invoke")throw new Error("TranscludeToken.getModule method is only for modules!");return[A(this,Ze,pn).call(this).title,(e=this.childNodes[2])==null?void 0:e.toString(!0).trim()]}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0)),super.afterBuild(),this.isTemplate()&&this.type==="template"&&(b(this,Gt,A(this,Ze,pn).call(this)),this.setAttribute("name",c(this,Gt).title))}toString(e){return`{{${this.modifier}${this.type==="magic-word"?this.firstChild.toString(e)+(this.length===1?"":":")+this.childNodes.slice(1).map(t=>t.toString(e)).join("|"):super.toString(e,"|")}}}`}text(){let{childNodes:e,length:t,firstChild:r,modifier:i,type:s,name:o}=this;return s==="magic-word"&&o==="vardefine"?"":`{{${i}${s==="magic-word"?r.text()+(t===1?"":":")+Te(e.slice(1),"|"):super.text("|")}}}`}getAttribute(e){switch(e){case"padding":return this.modifier.length+2;case"title":return c(this,Gt);default:return super.getAttribute(e)}}getGaps(){return 1}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t);if(!this.isTemplate())return r;let{type:i,childNodes:s,length:o}=this,l=new j(this,e),u=i==="magic-word";if(u&&!A(this,Ze,pn).call(this).valid)r.push(I(s[1],l,"invalid-invoke","illegal module name"));else{let d=s[u?1:0],g=d.childNodes.findIndex(h=>h.type==="text"&&it(h.data).includes("#")),f=d.childNodes[g];if(f){let h=I(d,l,"no-ignored","useless fragment");h.fix={range:[h.startIndex+d.getRelativeIndex(g)+f.data.indexOf("#"),h.endIndex],text:"",desc:"remove"},r.push(h)}}if(u&&o===2)return r.push(P(this,l,"invalid-invoke","missing module function")),r;let p=this.getDuplicatedArgs().filter(([,d])=>!d[0].querySelector("ext"));if(p.length>0)for(let[,d]of p)r.push(...d.map(g=>{let f=I(g,l,"no-duplicate","duplicated parameter");return f.suggestions=[{desc:"remove",range:[f.startIndex-1,f.endIndex],text:""}],f}));return r}insertAt(e,t=this.length){return super.insertAt(e,t),e.anon?A(this,Ze,vs).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getAllArgs(){return this.childNodes.filter(zt("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:e})=>e)}getArgs(e,t,r=!0){let i=String(e).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),s;return c(this,ut).has(i)?s=c(this,ut).get(i):(s=new Set(this.getAllArgs().filter(({name:o})=>i===o)),c(this,ut).set(i,s)),s}getDuplicatedArgs(){return[...c(this,ut)].filter(([,{size:e}])=>e>1).map(([e,t])=>[e,[...t]])}getPossibleValues(){let{type:e,name:t,childNodes:r}=this;if(e==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let i;switch(t){case"if":case"ifexist":case"ifexpr":case"iferror":i=2;break;case"ifeq":i=3;break;default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}let s=r.slice(i,i+2).map(({childNodes:[,o]})=>o);for(let o=0;o<s.length;){let{length:l,0:u}=s[o].childNodes.filter(p=>p.text().trim());if(l===0)s.splice(o,1);else if(l>1||u.type!=="magic-word")o++;else try{let p=u.getPossibleValues();s.splice(o,1,...p),o+=p.length}catch(p){o++}}return s}print(){let{childNodes:e,length:t,firstChild:r,modifier:i,type:s}=this;return`<span class="wpb-${s}">{{${wt(i)}${s==="magic-word"?r.print()+(t===1?"":":")+qe(e.slice(1),{sep:"|"}):qe(e,{sep:"|"})}}}</span>`}};Nr=new WeakMap,gt=new WeakMap,ut=new WeakMap,Gt=new WeakMap,Ze=new WeakSet,pn=function(){let e=this.type==="template";return this.normalizeTitle(this.childNodes[e?0:1].toString(!0),e?10:828,!0)},vs=function(e){let t=this.getAnonArgs(),r=typeof e!="number";for(let i=r?t.indexOf(e):e-1;i<t.length;i++){let s=t[i],{name:o}=s,l=String(i+1);(o!==l||s===e)&&(s.setAttribute("name",l),this.getArgs(l,!1,!1).add(s))}}});var Ss,ri,qa,pt,ws=k(()=>{"use strict";st();B();Ss=[ke()];pt=class extends(qa=S){get type(){return"hidden"}};ri=oe(qa),pt=le(ri,0,"HiddenToken",Ss,pt),ae(ri,1,pt)});var mn,Cs,cn,$s=k(()=>{"use strict";Y();D();ee();B();_e();ws();cn=class extends S{constructor(e,t,r=[]){super(void 0,t,r,{});T(this,mn);for(let i=0;i<e.length;i++){let s=e[i];if(i===0){let o=new V(s,"arg-name",t,r,{});super.insertAt(o)}else if(i>1){let o=new pt(s,t,r);super.insertAt(o)}else{let o=new S(s,t,r);o.type="arg-default",o.setAttribute("stage",2),super.insertAt(o)}}}get type(){return"arg"}get default(){var e,t;return(t=(e=this.childNodes[1])==null?void 0:e.text())!=null?t:!1}toString(e){return`{{{${super.toString(e,"|")}}}}`}text(){return`{{{${Te(this.childNodes.slice(0,2),"|")}}}}`}getAttribute(e){return e==="padding"?3:super.getAttribute(e)}getGaps(){return 1}afterBuild(){A(this,mn,Cs).call(this),super.afterBuild()}lint(e=this.getAbsoluteIndex(),t){let{childNodes:[r,i,...s]}=this;if(!this.getAttribute("include")){let l=P(this,{start:e},"no-arg","unexpected template argument");return i&&(l.suggestions=[{range:[e,l.endIndex],text:i.text(),desc:"expand"}]),[l]}r.setAttribute("aIndex",e+3);let o=r.lint(e+3,t);if(i){let l=e+4+r.toString().length;i.setAttribute("aIndex",l),o.push(...i.lint(l,t))}if(s.length>0){let l=new j(this,e);o.push(...s.map(u=>{let p=I(u,l,"no-ignored","invisible content inside triple braces");return p.startIndex--,p.startCol--,p.suggestions=[{desc:"remove",range:[p.startIndex,p.endIndex],text:""},{desc:"escape",range:[p.startIndex,p.startIndex+1],text:"{{!}}"}],p}))}return o}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return r.default=this.default,r}};mn=new WeakSet,Cs=function(){this.setAttribute("name",this.firstChild.toString(!0).trim())}});var Ls={};se(Ls,{parseBraces:()=>Er});var _a,Is,Ns,Es,Er,hn=k(()=>{"use strict";Y();ti();As();$s();_a={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},Is=String.raw`|\{{2,}`,Ns=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),Es=a=>{let n=de(a).trim().toLowerCase();return Ns.has(n)?Ns.get(n):/^(?:filepath|(?:full|canonical)urle?):./u.test(n)?"m":/^#vardefine:./u.test(n)?"n":"t"},Er=(a,n,e)=>{var f,h,m,x,y,w;let t=String.raw`${(f=n.excludes)!=null&&f.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,r]}=n,i=[],s=[],o=C=>C.replace(/\0(\d+)\x7F/gu,($,E)=>s[E]);a=a.replace(/\{\{([^\n{}[]*)\}\}(?!\})|\[\[[^\n[\]{]*\]\]/gu,(C,$)=>{if($!==void 0)try{let{length:E}=e,_=$.split("|");return new Ir(_[0],_.slice(1).map(M=>{let F=M.indexOf("=");return F===-1?[M]:[M.slice(0,F),M.slice(F+1)]}),n,e),`\0${E}${Es(_[0])}\x7F`}catch(E){if(!(E instanceof SyntaxError)||E.message!=="Invalid template name")throw E}return s.push(C),`\0${s.length-1}\x7F`});let l=a.lastIndexOf("}}")-a.length,u=l+a.length!==-1,p=new RegExp(t+(u?Is:""),"gmu"),d=p.exec(a),g;for(;d||g!==void 0&&g<=a.length&&((m=(h=i[i.length-1])==null?void 0:h[0])!=null&&m.startsWith("="));){if(d!=null&&d[1]){let[,{length:q}]=d;d[0]=d[0].slice(q),d.index+=q}let{0:C,index:$}=d!=null?d:{0:`
7
- `,index:a.length},E=(x=i.pop())!=null?x:{},{0:_,index:M,parts:F,findEqual:Q,pos:R}=E,H=C==="="&&Q,G=q=>{F[F.length-1].push(o(q.slice(R,$)))};if(C==="]]"||C==="}-")g=$+2;else if(C===`
8
- `){g=$+1;let{pos:q,findEqual:N}=(y=i[i.length-1])!=null?y:{};if(q===void 0||N||de(a.slice(q,M))!==""){let ue=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(a.slice(M,$));ue&&(a=`${a.slice(0,M)}\0${e.length}h\x7F${a.slice($)}`,g=M+4+String(e.length).length,ue[2]=o(ue[2]),new Ut(ue[1].length,ue.slice(2),n,e))}}else if(C==="|"||H)g=$+1,G(a),C==="|"&&F.push([]),E.pos=g,E.findEqual=C==="|",i.push(E);else if(C.startsWith("}}")){let q=C.slice(0,Math.min(_.length,3)),N=_.length-q.length,{length:ue}=e;g=$+q.length,G(a);let ie=!1,me="t";if(q.length===3){let pe=F.map(yt=>yt.join("=")),be=pe.length>1&&de(pe[1]).trim();new cn(pe,n,e),be&&be.endsWith(":")&&r.includes(be.slice(0,-1).toLowerCase())&&(me="s")}else try{new Ir(F[0][0],F.slice(1),n,e),me=Es(F[0][0])}catch(pe){if(pe instanceof SyntaxError&&pe.message==="Invalid template name")ie=!0;else throw pe}ie||(a=`${a.slice(0,M+N)}\0${ue}${me}\x7F${a.slice(g)}`,g=M+N+3+String(ue).length,N>1?i.push({0:_.slice(0,N),index:M,pos:M+N,parts:[[]]}):N===1&&a[M-1]==="-"&&i.push({0:"-{",index:M-1,pos:M+1,parts:[[]]}))}else g=$+C.length,C.startsWith("{")&&(d.pos=g,d.parts=[[]]),i.push(..."0"in E?[E]:[],d);let L=i[i.length-1];if(u&&l+a.length<g)for(u=!1;(w=L==null?void 0:L[0])!=null&&w.startsWith("{");)i.pop(),L=i[i.length-1];p=new RegExp(t+(u?Is:"")+(L?`|${_a[L[0][0]]}${L.findEqual?"|=":""}`:""),"gmu"),p.lastIndex=g,d=p.exec(a)}return o(a)}});var fn,Fs=k(()=>{"use strict";Cr();hn();W();ei();fn=class extends Wt{constructor(n,e,t=v.getConfig(),r=[]){let i=Symbol("InputboxToken"),{length:s}=r;r.push(i),e&&(e=dt(e,t,r,n)),e&&(e=Er(e,t,r)),r.splice(s,1),super(n,e,t,r,{})}}});function Ps(a,n,e,t,r){n=n.trim();let i=n.replace(a==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(a){case"width":return!i&&!!n||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(i);case"link":{if(!i)return n;let s=new RegExp(String.raw`^(?:${e.protocol}|//|\0\d+m\x7F)`,"iu"),o=new RegExp(String.raw`^(?:(?:${e.protocol}|//)${je}|\0\d+m\x7F)${Be}$`,"iu");if(s.test(i))return o.test(i)&&n;i.startsWith("[[")&&i.endsWith("]]")&&(i=i.slice(2,-2));let l=v.normalizeTitle(i,0,!1,e,!1,t,!0,!0);return l.valid&&l}case"lang":return(r==="svg"||r==="svgz")&&!/[^a-z\d-]/u.test(i);case"alt":case"class":case"manualthumb":return!0;case"page":return(r==="djvu"||r==="djv"||r==="pdf")&&Number(i)>0;default:return!!i&&!isNaN(i)}}var Oa,he,bn,Rs,xn,js=k(()=>{"use strict";Y();D();W();B();Oa=new Set(["alt","link","lang","page","caption"]);xn=class extends S{constructor(e,t,r,i){var n=(...Tu)=>(super(...Tu),T(this,bn),T(this,he,""),this);var u;let s,o=Object.entries(r.img).map(([p,d])=>{let g=new RegExp(String.raw`^(\s*(?!\s))${p.replace("$1","(.*)")}${p.endsWith("$1")?`(?=$|
9
- )`:""}(\s*)$`,"u");return[p,d,g]}),l=o.find(([,p,d])=>(s=d.exec(e),s&&(s.length!==4||Ps(p,s[2],r,!0,t)!==!1)));if(l&&s){s.length===3?(n(void 0,r,i),b(this,he,e)):(n(s[2],r,i,{}),b(this,he,s[1]+l[0]+s[3])),this.setAttribute("name",l[1]);return}n(e,{...r,excludes:[...(u=r.excludes)!=null?u:[],"list"]},i),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get type(){return"image-parameter"}get link(){return this.name==="link"?Ps("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var e;((e=this.parentNode)==null?void 0:e.type)==="gallery-image"&&!Oa.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(e){return c(this,he)?c(this,he).replace("$1",super.toString(e)):super.toString(e)}text(){return c(this,he)?c(this,he).replace("$1",super.text()).trim():super.text().trim()}getAttribute(e){return e==="plain"?this.name==="caption":e==="padding"?Math.max(0,c(this,he).indexOf("$1")):super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{link:i,name:s}=this;if(s==="invalid"){let o=P(this,{start:e},"invalid-gallery","invalid image parameter");o.fix={range:[e-1,o.endIndex],text:"",desc:"remove"},r.push(o)}else if(typeof i=="object"&&i.encoded){let o=P(this,{start:e},"url-encoding","unnecessary URL encoding in an internal link");o.suggestions=[{desc:"decode",range:[e,o.endIndex],text:Ge(this.text())}],r.push(o)}return r}getValue(){return this.name==="invalid"?this.text():A(this,bn,Rs).call(this)||super.text()}print(){return c(this,he)?`<span class="wpb-image-parameter">${c(this,he).replace("$1",`<span class="wpb-image-caption">${qe(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}};he=new WeakMap,bn=new WeakSet,Rs=function(){return c(this,he)&&!c(this,he).includes("$1")}});var Bs,qs,_s,Ma,Vt,ni=k(()=>{"use strict";Y();D();ee();W();Ar();js();Bs=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),qs=new Set(["left","right","center","none"]),_s=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),Ma=(a,n,e,t)=>{if(t===void 0)return[];let r=new RegExp(`${[a,n,e].map(zi).join("|")}`,"gu"),i=[],s=r.exec(t),o=0,l=0;for(;s;){let{0:u,index:p}=s;u!==e?o+=u===a?1:-1:o===0&&(i.push(t.slice(l,p)),{lastIndex:l}=r),s=r.exec(t)}return i.push(t.slice(l)),i},Vt=class extends Fe{get type(){return"file"}get extension(){return this.getAttribute("title").extension}constructor(n,e,t=v.getConfig(),r=[],i="|"){super(n,void 0,t,r,i);let{extension:s}=this.getTitle(!0,!0);this.append(...Ma("-{","}-","|",e).map(o=>new xn(o,s,t,r)))}lint(n=this.getAbsoluteIndex(),e){var f;let t=super.lint(n,e),r=this.getAllArgs().filter(({childNodes:h})=>{let m=h.filter(x=>x.text().trim());return m.length!==1||m[0].type!=="arg"}),i=[...new Set(r.map(({name:h})=>h))],s=i.filter(h=>Bs.has(h)),o=i.filter(h=>qs.has(h)),l=i.filter(h=>_s.has(h)),[u]=s,p=u==="framed"||u==="manualthumb",d=new j(this,n);if(this.closest("ext-link-text")&&((f=this.getValue("link"))==null?void 0:f.trim())!==""&&t.push(P(this,d,"nested-link","internal link in an external link")),p)for(let h of r.filter(({name:m})=>m==="width")){let m=I(h,d,"invalid-gallery","invalid image parameter");m.fix={range:[m.startIndex-1,m.endIndex],text:"",desc:"remove"},t.push(m)}if(r.length===i.length&&s.length<2&&o.length<2&&l.length<2)return t;let g=(h,m)=>x=>{let y=I(x,d,"no-duplicate",v.msg(`${h} image $1 parameter`,m));return y.suggestions=[{desc:"remove",range:[y.startIndex-1,y.endIndex],text:""}],y};for(let h of i){if(h==="invalid"||h==="width"&&p)continue;let m=r.filter(({name:x})=>x===h);h==="caption"&&(m=[...m.slice(0,-1).filter(x=>x.text()),...m.slice(-1)]),m.length>1&&t.push(...m.map(g("duplicated",h)))}return s.length>1&&t.push(...r.filter(({name:h})=>Bs.has(h)).map(g("conflicting","frame"))),o.length>1&&t.push(...r.filter(({name:h})=>qs.has(h)).map(g("conflicting","horizontal-alignment"))),l.length>1&&t.push(...r.filter(({name:h})=>_s.has(h)).map(g("conflicting","vertical-alignment"))),t}getAllArgs(){return this.childNodes.slice(1)}getArgs(n){return this.getAllArgs().filter(({name:e})=>n===e)}getArg(n){let e=this.getArgs(n);return e[n==="manualthumb"?0:e.length-1]}getValue(n){var e;return(e=this.getArg(n))==null?void 0:e.getValue()}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e),{extension:r}=this;return r&&(t.extension=r),t}}});var Qt,ii=k(()=>{"use strict";D();W();B();ni();Qt=class extends Vt{constructor(e,t,r,i=v.getConfig(),s=[]){let o;if(r!==void 0){let{length:l}=s;o=new S(r,i,s);for(let u=1;u<11;u++)o.parseOnce();s.splice(l,1)}super(t,o==null?void 0:o.toString(),i,s);te(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=`${e}-image`,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(e){let t=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),t?0:6,e,!0,!t)}getAttribute(e){return e==="padding"?0:super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{ns:i}=this.getAttribute("title");if(i!==6){let s=P(this,{start:e},"invalid-gallery","invalid gallery image");s.suggestions=[{desc:"prefix",range:[e,e],text:"File:"}],r.push(s)}return r}}});var ct,Os,si,Tn,Ms=k(()=>{"use strict";W();B();ii();Xe();Tn=class extends S{constructor(e,t=v.getConfig(),r=[]){var i;super(void 0,t,r,{});T(this,ct);for(let s of(i=e==null?void 0:e.split(`
10
- `))!=null?i:[]){let o=/^([^|]+)(?:\|(.*))?/u.exec(s);if(!o){super.insertAt(s.trim()?new K(s,t,r):s);continue}let[,l,u]=o;A(this,ct,Os).call(this,l)?super.insertAt(new Qt("gallery",l,u,t,r)):super.insertAt(new K(s,t,r))}}get type(){return"ext-inner"}get widths(){return A(this,ct,si).call(this,"widths")}get heights(){return A(this,ct,si).call(this,"heights")}toString(e){return super.toString(e,`
11
- `)}text(){return super.text(`
12
- `).replace(/\n\s*\n/gu,`
13
- `)}getGaps(){return 1}lint(e=this.getAbsoluteIndex(),t){let{top:r,left:i}=this.getRootNode().posFromIndex(e),s=[];for(let o=0;o<this.length;o++){let l=this.childNodes[o],u=l.toString(),{length:p}=u,d=u.trim(),{type:g}=l,f=r+o,h=o?0:i;if(l.setAttribute("aIndex",e),g==="noinclude"&&d&&!/^<!--.*-->$/u.test(d)){let m=e+p;s.push({rule:"no-ignored",message:v.msg("invalid content in <$1>","gallery"),severity:d.startsWith("|")?"warning":"error",startIndex:e,endIndex:m,startLine:f,endLine:f,startCol:h,endCol:h+p,suggestions:[{desc:"remove",range:[e,m],text:""},{desc:"comment",range:[e,m],text:`<!--${u}-->`}]})}else g!=="noinclude"&&g!=="text"&&s.push(...l.lint(e,t));e+=p+1}return s}print(){return super.print({sep:`
14
- `})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return Object.assign(r,{widths:this.widths,heights:this.heights}),r}};ct=new WeakSet,Os=function(e){return this.normalizeTitle(e,6,!0,!0,!0).valid},si=function(e){var i,s;let t=(i=this.parentNode)==null?void 0:i.getAttr(e),r=typeof t=="string"&&((s=/^(\d+)\s*(?:px)?$/u.exec(t))==null?void 0:s[1]);return r&&Number(r)||120}});var Xt,oi=k(()=>{"use strict";D();Ar();Xt=class extends Fe{get type(){return"link"}lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e);return this.closest("ext-link-text")&&t.push(P(this,{start:n},"nested-link","internal link in an external link")),t}}});var Da,Wa,Lr,Oe,yn=k(()=>{"use strict";D();Y();ee();W();B();Da=String.raw`(?:[${$e}\t]|&nbsp;|&#0*160;|&#[xX]0*[aA]0;)`,Wa=new RegExp(`${Da}+`,"gu"),Oe=class extends S{constructor(e,t="free-ext-link",r=v.getConfig(),i){super(e,r,i,{});T(this,Lr);b(this,Lr,t)}get type(){return c(this,Lr)}get innerText(){let e=new Map([["!","|"],["=","="]]),t=Te(this.childNodes.map(r=>{let{type:i}=r,s=String(r.name);return i==="magic-word"&&e.has(s)?e.get(s):r}));return this.type==="magic-link"&&(t=t.replace(Wa," ")),t}get link(){let{innerText:e}=this;return this.type==="magic-link"?e.startsWith("ISBN")?`ISBN ${e.slice(5).replace(/[- ]/gu,"").replace(/x$/u,"X")}`:e:Gi(e)}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),i=new j(this,e),{type:s,childNodes:o}=this;if(s==="magic-link"){let{link:d}=this;if(d.startsWith("ISBN")){let g=[...d.slice(5)].map(f=>f==="X"?10:Number(f));(g.length===10&&g.reduce((f,h,m)=>f+h*(10-m),0)%11||g.length===13&&(g[12]===10||g.reduce((f,h,m)=>f+h*(m%2?3:1),0)%10))&&r.push(P(this,i,"invalid-isbn","invalid ISBN"))}return r}let l=s==="ext-link-url",u=l?/\|/u:/[,;。:!?()]+/u,p=o.find(d=>d.type==="text"&&u.test(d.data));if(p){let{data:d}=p,g=I(p,i,"unterminated-url",v.msg("$1 in URL",l?'"|"':"full-width punctuation"),"warning"),{index:f,0:h}=u.exec(d),m=g.startIndex+f;g.suggestions=l?[{desc:"whitespace",range:[m,m+1],text:" "}]:[{desc:"whitespace",range:[m,m],text:" "},{desc:"escape",range:[m,m+h.length],text:encodeURI(h)}],r.push(g)}return r}getUrl(e){{let{type:t}=this,{link:r}=this;if(t==="magic-link"){if(r.startsWith("ISBN"))return this.normalizeTitle(`BookSources/${r.slice(5)}`,-1,!0).getUrl(e);r=r.startsWith("RFC")?`https://tools.ietf.org/html/rfc${r.slice(4)}`:`https://pubmed.ncbi.nlm.nih.gov/${r.slice(5)}`}else r.startsWith("//")&&(r=`https:${r}`);return new URL(r)}}};Lr=new WeakMap});var Me,Kt,ai=k(()=>{"use strict";D();W();B();yn();Kt=class extends S{constructor(e,t="",r="",i=v.getConfig(),s=[]){super(void 0,i,s,{});T(this,Me);let o=e&&/^\0\d+f\x7F$/u.test(e)?s[Number(e.slice(1,-2))]:new Oe(e,"ext-link-url",i,s);if(this.insertAt(o),b(this,Me,t),r){let l=new S(r,i,s,{});l.type="ext-link-text",l.setAttribute("stage",10),this.insertAt(l)}}get type(){return"ext-link"}toString(e){return this.length===1?`[${super.toString(e)}${c(this,Me)}]`:`[${super.toString(e,c(this,Me))}]`}text(){return`[${super.text(" ")}]`}getAttribute(e){return e==="padding"?1:super.getAttribute(e)}getGaps(){return c(this,Me).length}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t);return this.length===1&&this.closest("heading-title")&&r.push(P(this,{start:e},"var-anchor","variable anchor in a section header")),r}print(){return super.print(this.length===1?{pre:"[",post:`${c(this,Me)}]`}:{pre:"[",sep:c(this,Me),post:"]"})}};Me=new WeakMap});var Fr,Ds=k(()=>{"use strict";B();Xe();oi();ai();Fr=class extends S{get type(){return"imagemap-link"}constructor(n,e,t,r,i=[]){super(void 0,r,i),this.append(n,e.length===2?new Xt(...e,r,i):new Kt(...e,r,i),new K(t,r,i))}}});var kn,Ws=k(()=>{"use strict";D();ye();ee();W();B();Xe();ii();Ds();kn=class extends S{get type(){return"ext-inner"}get image(){return this.childNodes.find(zt("imagemap-image"))}constructor(n,e=v.getConfig(),t=[]){if(super(void 0,e,t,{}),!n)return;let r=n.split(`
15
- `),i=new Set(e.protocol.split("|")),s=K,o=!0,l=!1;for(let u of r){let p=u.trim();if(!(l||!p||p.startsWith("#"))){if(o){let d=u.indexOf("|"),g=d===-1?u:u.slice(0,d),{valid:f,ns:h}=this.normalizeTitle(g,0,!0,!0);if(f&&h===6){let m=new Qt("imagemap",g,d===-1?void 0:u.slice(d+1),e,t);super.insertAt(m),o=!1;continue}else l=!0}else if(u.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(u);continue}else if(u.includes("[")){let d=u.indexOf("["),g=u.slice(d),f=/^\[\[([^|]+)(?:\|([^\]]+))?\]\][\w\s]*$/u.exec(g);if(f){if(this.normalizeTitle(f[1],0,!0,!0,!1,!0).valid){super.insertAt(new Fr(u.slice(0,d),f.slice(1),g.slice(g.indexOf("]]")+2),e,t));continue}}else if(i.has(g.slice(1,g.indexOf(":")+1))||i.has(g.slice(1,g.indexOf("//")+2))){let h=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(g);if(h){super.insertAt(new Fr(u.slice(0,d),h.slice(1),g.slice(g.indexOf("]")+1),e,t));continue}}}}super.insertAt(new s(u,e,t))}}toString(n){return super.toString(n,`
16
- `)}text(){return super.text(`
17
- `).replace(/\n{2,}/gu,`
18
- `)}getGaps(){return 1}lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e),r=new j(this,n);return this.image?t.push(...this.childNodes.filter(i=>{let s=i.toString().trim();return i.type==="noinclude"&&s&&!s.startsWith("#")}).map(i=>{let s=I(i,r,"invalid-imagemap","invalid link in <imagemap>");return s.suggestions=[{desc:"remove",range:[s.startIndex-1,s.endIndex],text:""},{desc:"comment",range:[s.startIndex,s.startIndex],text:"# "}],s})):t.push(P(this,r,"invalid-imagemap","<imagemap> without an image")),t}print(){return super.print({sep:`
19
- `})}}});var vn,Hs=k(()=>{"use strict";D();W();Qe();vn=class extends ge{get type(){return"ext-inner"}lint(n=this.getAbsoluteIndex()){let{name:e,firstChild:{data:t}}=this;if((e==="templatestyles"||e==="section")&&t){let i=P(this,{start:n},"void-ext",v.msg("nothing should be in <$1>",e));return i.fix={range:[n,i.endIndex],text:"",desc:"empty"},[i]}let r=new RegExp(String.raw`<\s*(?:/\s*)${e==="nowiki"?"":"?"}(${e})\b`,"giu");return super.lint(n,r)}}});var An={};se(An,{NestedToken:()=>li});var Ha,Pr,Jt,li,Sn=k(()=>{"use strict";D();ee();Cr();hn();W();B();di();Xe();Ha=new Set(["comment","include","arg","template","magic-word"]),li=class extends S{constructor(e,t,r,i,s=[]){if(typeof t=="boolean"){let o=Symbol("InputboxToken"),{length:l}=s;s.push(o),e&&(e=dt(e,i,s,t)),e&&(e=Er(e,i,s)),s.splice(l,1)}else e&&(e=e.replace(t,(o,l,u,p,d)=>{let g=`\0${s.length+1}e\x7F`;return new De(l,u,p,d,i,!1,s),g}));e&&(e=e.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(o,l,u)=>(new K(u,i,s),`${l}\0${s.length}n\x7F`)));super(e,i,s);T(this,Pr);T(this,Jt);b(this,Pr,[...r]),b(this,Jt,t)}get type(){return"ext-inner"}lint(e=this.getAbsoluteIndex(),t){let r=new j(this,e),i=c(this,Jt)?"includeonly":"noinclude",s=typeof c(this,Jt)=="boolean"?new RegExp(String.raw`^(?:<${i}(?:\s[^>]*)?/?>|</${i}\s*>)$`,"iu"):/^<!--[\s\S]*-->$/u;return[...super.lint(e,t),...this.childNodes.filter(o=>{let{type:l,name:u}=o;if(l==="ext")return!c(this,Pr).includes(u);if(Ha.has(l))return!1;let p=o.toString().trim();return p&&!s.test(p)}).map(o=>{let l=I(o,r,"no-ignored",v.msg("invalid content in <$1>",this.name));return l.suggestions=[{desc:"remove",range:[l.startIndex,l.endIndex],text:""},{desc:"comment",range:[l.startIndex,l.endIndex],text:`<!--${o.toString()}-->`}],l})]}};Pr=new WeakMap,Jt=new WeakMap});var Us,zs,gi,Ua,De,di=k(()=>{"use strict";D();ee();W();tn();B();Xn();ln();ys();ei();Fs();Ms();Ws();Hs();Us=(a,n)=>{let e=new Set(a);return e.delete(n),[...e]};zs=[_t()];De=class extends(Ua=qt){get type(){return"ext"}constructor(n,e,t,r,i=v.getConfig(),s=!1,o=[]){var g;let l=n.toLowerCase(),u=new Ye(!e||/^\s/u.test(e)?e:` ${e}`,"ext-attrs",l,i,o),p={...i,ext:Us(i.ext,l),excludes:[...(g=i.excludes)!=null?g:[]]},d;switch(p.inExt=!0,l){case"tab":p.ext=Us(p.ext,"tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":l==="poem"&&p.excludes.push("heading"),d=new S(t,p,o);break;case"pre":d=new dn(t,p,o);break;case"dynamicpagelist":d=new Wt(s,t,p,o);break;case"inputbox":p.excludes.push("heading"),d=new fn(s,t,p,o);break;case"references":{let{NestedToken:f}=(Sn(),J(An));p.excludes.push("heading"),d=new f(t,s,["ref"],p,o);break}case"choose":{let{NestedToken:f}=(Sn(),J(An));d=new f(t,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],p,o);break}case"combobox":{let{NestedToken:f}=(Sn(),J(An));d=new f(t,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],p,o);break}case"gallery":d=new Tn(t,p,o);break;case"imagemap":d=new kn(t,p,o);break;default:d=new vn(t,p,o)}d.setAttribute("name",l),d.type==="plain"&&(d.type="ext-inner"),super(n,u,d,r,i,o),this.seal("closed",!0)}lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e),r=new j(this,n);return this.name!=="nowiki"&&this.closest("html-attrs,table-attrs")&&t.push(P(this,r,"parsing-order","extension tag in HTML tag attributes")),this.name==="ref"&&this.closest("heading-title")&&t.push(P(this,r,"var-anchor","variable anchor in a section header")),t}};gi=oe(Ua),De=le(gi,0,"ExtToken",zs,De),ae(gi,1,De)});var Gs,ui,za,mt,Vs=k(()=>{"use strict";D();st();W();Qe();Gs=[ke(!1)];mt=class extends(za=ge){constructor(e,t,r,i){super(e,r,i);te(this,"closed");this.closed=t}get type(){return"comment"}getAttribute(e){return e==="padding"?4:super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){if(this.closed)return[];let t=P(this,{start:e},"unclosed-comment",v.msg("unclosed $1","HTML comment"));return t.suggestions=[{range:[t.endIndex,t.endIndex],text:"-->",desc:"close"}],[t]}toString(e){return e?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"&lt;!--",post:this.closed?"--&gt;":""})}};ui=oe(za),mt=le(ui,0,"CommentToken",Gs,mt),ae(ui,1,mt)});var Ks={};se(Ks,{parseCommentAndExt:()=>dt});var Xs,Ga,pi,Va,Qa,Xa,Qs,dt,Cr=k(()=>{"use strict";as();Xe();ds();di();Vs();Xs="<onlyinclude>",Ga="</onlyinclude>",{length:pi}=Xs,Va=new WeakMap,Qa=new WeakMap,Xa=(a,n)=>{let e=n?Va:Qa;if(e.has(a))return e.get(a);let t=n?"includeonly":"(?:no|only)include",r=n?"noinclude":"includeonly",i=new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${a.join("|")})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(\1\s*)>)|<(${r})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${r}\s*)>|$))`,"giu");return e.set(a,i),i},Qs=a=>{let n=a.indexOf(Xs);return{i:n,j:a.indexOf(Ga,n+pi)}},dt=(a,n,e,t)=>{if(t){let{i:r,j:i}=Qs(a);if(r!==-1&&i!==-1){let s="",o=l=>{new K(l,n,e),s+=`\0${e.length-1}n\x7F`};for(;r!==-1&&i!==-1;){let l=`\0${e.length}e\x7F`;new en(a.slice(r+pi,i),n,e),r>0&&o(a.slice(0,r)),s+=l,a=a.slice(i+pi+1),{i:r,j:i}=Qs(a)}return a&&o(a),s}}return a.replace(Xa(n.ext,t),(r,i,s,o,l,u,p,d,g)=>{let f=e.length,h="n";if(i)h="e",new De(i,s,o,l,n,u,e);else if(r.startsWith("<!--")){h="c";let m=r.endsWith("-->");new mt(r.slice(4,m?-3:void 0),m,n,e)}else u?new lt(u,p,d,g,n,e):new K(r,n,e);return`\0${f}${h}\x7F`})}});var Ka,Ja,Ya,Js,Yt,Re,et,We,ci,Za,ht,Ys=k(()=>{"use strict";D();ye();ee();tn();B();Ka=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),Ja=new Set(["b","big","center","cite","code","del","dfn","em","font","i","ins","kbd","mark","pre","q","s","samp","small","strike","strong","sub","sup","tt","u","var"]),Ya=new Set(["strike","big","center","font","tt"]);Js=[_t()];ht=class extends(Za=S){constructor(e,t,r,i,s,o){super(void 0,s,o);T(this,Yt);T(this,Re);T(this,et);T(this,We);this.insertAt(t),this.setAttribute("name",e.toLowerCase()),b(this,Yt,r),b(this,Re,i),b(this,et,e)}get type(){return"html"}get selfClosing(){return c(this,Re)}get closing(){return c(this,Yt)}toString(e){return`<${this.closing?"/":""}${c(this,et)}${super.toString(e)}${c(this,Re)?"/":""}>`}text(){let{closing:e}=this,t=c(this,et)+(e?"":super.text());return`<${e?"/":""}${t}${c(this,Re)?"/":""}>`}getAttribute(e){return e==="padding"?c(this,et).length+(this.closing?2:1):super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{name:i,parentNode:s,closing:o,selfClosing:l}=this,u=new j(this,e);if(i==="h1"&&!o){let m=P(this,u,"h1","<h1>");m.suggestions=[{desc:"h2",range:[e+2,e+3],text:"2"}],r.push(m)}if(this.closest("table-attrs")){let m=P(this,u,"parsing-order","HTML tag in table attributes");m.fix={desc:"remove",range:[e,m.endIndex],text:""},r.push(m)}Ya.has(i)&&r.push(P(this,u,"obsolete-tag","obsolete HTML tag","warning")),(i==="b"||i==="strong")&&this.closest("heading-title")&&r.push(P(this,u,"bold-header","bold in section header","warning"));let{html:[,p,d]}=this.getAttribute("config"),g=d.includes(i),f=p.includes(i);if(o&&(l||g)||l&&(!g&&!f)){let m=P(this,u,"unmatched-tag",o?"tag that is both closing and self-closing":"invalid self-closing tag"),x={desc:"open",range:[e+1,e+2],text:""},y={desc:"no self-closing",range:[m.endIndex-2,m.endIndex-1],text:""};f?m.suggestions=[x,y]:o?m.fix=g?x:y:m.suggestions=[y,{desc:"close",range:[m.endIndex-2,m.endIndex],text:`></${i}>`}],r.push(m)}else if(!this.findMatchingTag()){let m=P(this,u,"unmatched-tag",o?"unmatched closing tag":"unclosed tag");if(o){let x=this.closest("magic-word");x&&Ka.has(x.name)?m.severity="warning":m.suggestions=[{desc:"remove",range:[e,m.endIndex],text:""}]}else{let x=s==null?void 0:s.childNodes;Ja.has(i)&&(x!=null&&x.slice(0,x.indexOf(this)).some(({type:y,name:w})=>y==="html"&&w===i))?m.suggestions=[{desc:"close",range:[e+1,e+1],text:"/"}]:this.closest("heading-title")||(m.severity="warning")}r.push(m)}return r}findMatchingTag(){return Ie(c(this,We),()=>{let{name:e,parentNode:t,closing:r,selfClosing:i}=this,{html:[,s,o]}=this.getAttribute("config"),l=o.includes(e),u=s.includes(e);if(l||u&&i)return this;if(!t)return;let{childNodes:p}=t,d=p.indexOf(this),g=r?p.slice(0,d).reverse():p.slice(d+1),f=[this],{rev:h}=re;for(let m of g)if(!(!m.is("html")||m.name!==e||u&&c(m,Re)))if(c(m,Yt)===r)f.push(m);else{let x=f.pop();if(x===this)return m;b(x,We,[h,m]),b(m,We,[h,x])}for(let m of f)b(m,We,[h,void 0])},e=>{b(this,We,e),e[1]&&e[1]!==this&&b(e[1],We,[re.rev,this])})}print(){return super.print({pre:`&lt;${this.closing?"/":""}${c(this,et)}`,post:`${c(this,Re)?"/":""}&gt;`})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return Object.assign(r,{closing:this.closing,selfClosing:c(this,Re)}),r}};ci=oe(Za),Yt=new WeakMap,Re=new WeakMap,et=new WeakMap,We=new WeakMap,ht=le(ci,0,"HtmlToken",Js,ht),ae(ci,1,ht)});var Zs={};se(Zs,{parseHtml:()=>tl});var el,tl,eo=k(()=>{"use strict";ln();Ys();el=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,tl=(a,n,e)=>{var s;let{html:t}=n;(s=n.htmlElements)!=null||(n.htmlElements=new Set([...t[0],...t[1],...t[2]]));let r=a.split("<"),i=r.shift();for(let o of r){let l=el.exec(o),u=l==null?void 0:l[2],p=u==null?void 0:u.toLowerCase();if(!l||!n.htmlElements.has(p)){i+=`<${o}`;continue}let[,d,,g="",f,h]=l,{length:m}=e,x=new Ye(g,"html-attrs",p,n,e),y=x.getAttr("itemprop");if(p==="meta"&&(y===void 0||x.getAttr("content")===void 0)||p==="link"&&(y===void 0||x.getAttr("href")===void 0)){i+=`<${o}`,e.length=m;continue}i+=`\0${e.length}x\x7F${h}`,new ht(u,x,d==="/",f==="/>",n,e)}return i}});var Zt,mi=k(()=>{"use strict";tn();W();B();Rt();ln();Zt=class extends _t(1)(S){constructor(n,e,t,r,i=v.getConfig(),s=[],o){super(void 0,i,s,o),this.append(new ve(e,n,"table-syntax",i,s,{}),new Ye(r,"table-attrs",t,i,s))}}});var Ae,Rr,jr,hi,er,fi=k(()=>{"use strict";D();ee();W();B();mi();er=class extends Zt{constructor(e,t,r=v.getConfig(),i=[]){var u;let s=/\||\0\d+!\x7F/u.exec(t!=null?t:""),o=s?t.slice(0,s.index):"";/\[\[|-\{/u.test(o)&&(s=null,o="");super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",o,r,i);T(this,jr);T(this,Ae,"");T(this,Rr);s&&([Vr(this,Ae)._]=s);let l=new S(t==null?void 0:t.slice(((u=s==null?void 0:s.index)!=null?u:NaN)+c(this,Ae).length),r,i);l.type="td-inner",l.setAttribute("stage",4),this.insertAt(l)}get type(){return"td"}get rowspan(){return this.getAttr("rowspan")}get colspan(){return this.getAttr("colspan")}get subtype(){return A(this,jr,hi).call(this).subtype}afterBuild(){c(this,Ae).includes("\0")&&b(this,Ae,this.buildFromStr(c(this,Ae),0)),super.afterBuild()}toString(e){let{childNodes:[t,r,i]}=this;return t.toString(e)+r.toString(e)+c(this,Ae)+i.toString(e)}text(){let{childNodes:[e,t,r]}=this;return e.text()+t.text()+c(this,Ae)+r.text()}getGaps(e){return e===1?c(this,Ae).length:0}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),i=new j(this,e+this.getRelativeIndex(this.length-1));for(let s of this.lastChild.childNodes)if(s.type==="text"){let{data:o}=s;if(o.includes("|")){let l=o.includes("||"),u=I(s,i,"pipe-like",'additional "|" in a table cell',l?"error":"warning");if(l){let p={caption:"|+",td:"|",th:"!"}[this.subtype];u.fix={range:[u.startIndex,u.endIndex],text:o.replace(/\|\|/gu,`
20
- ${p}`),desc:"newline"}}else u.suggestions=[{desc:"escape",range:[u.startIndex,u.endIndex],text:o.replace(/\|/gu,"&#124;")}];r.push(u)}}return r}isIndependent(){return this.firstChild.text().startsWith(`
21
- `)}getAttr(e){let t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}print(){let{childNodes:[e,t,r]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${c(this,Ae)}${r.print()}</span>`}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return Object.assign(r,{subtype:this.subtype,rowspan:this.rowspan,colspan:this.colspan}),r}};Ae=new WeakMap,Rr=new WeakMap,jr=new WeakSet,hi=function(){return Ie(c(this,Rr),()=>{var o;let e=this.firstChild.text(),t=e.slice(-1),r="td";if(t==="!"?r="th":t==="+"&&(r="caption"),this.isIndependent())return{subtype:r};let{previousSibling:i}=this;return{...A(o=i,jr,hi).call(o)}},e=>{b(this,Rr,e)})}});var tr,xi=k(()=>{"use strict";D();mi();fi();tr=class extends Zt{lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e),r=this.childNodes.find(({type:l})=>l==="table-inter");if(!r)return t;let i=r.childNodes.find(l=>l.text().trim()),s=/^\s*(?:!|\{\{\s*![!-]?\s*\}\})/u;if(!i||s.test(i.toString())||i.is("arg")&&s.test(i.default||""))return t;if(i.is("magic-word"))try{if(i.getPossibleValues().every(l=>s.test(l.text())))return t}catch(l){}let o=I(r,{start:n},"fostered-content","content to be moved out from the table");return o.severity=i.type==="template"?"warning":"error",o.startIndex++,o.startLine++,o.startCol=0,t.push(o),t}getRowCount(){return Number(this.childNodes.some(n=>n instanceof er&&n.isIndependent()&&!n.firstChild.text().endsWith("+")))}}});var rl,nl,il,bi,wn,to=k(()=>{"use strict";D();ye();ee();W();xi();Rt();rl=/^\n[^\S\n]*(?:\|\}|\{\{\s*!\s*\}\}\}|\{\{\s*!\)\s*\}\})$/u,nl=(a,n)=>new Array(a).fill(void 0).map((e,t)=>n(t)),il=({type:a})=>a==="tr"||a==="table-syntax",bi=class extends Array{},wn=class extends tr{get type(){return"table"}get closed(){return this.lastChild.type==="table-syntax"}constructor(n,e,t,r){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,n,"table",e,t,r,{})}lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e),r=new j(this,n);this.closed||t.push(I(this.firstChild,r,"unclosed-table",v.msg("unclosed $1","table")));let i=this.getLayout(),{length:s}=i;if(s>1){let o=1,l=1/0,u=0;for(;u<s;u++){let p=i[u],d=p.length;if(d<o)break;d<l&&(l=d);let g=p.indexOf(p[d-1])+1;if(g>l)break;g>o&&(o=g)}if(u<s){let p=I(this.getNthRow(u),r,"table-layout","inconsistent table layout","warning");p.startIndex++,p.startLine++,p.startCol=0,t.push(p)}}return t}close(n=`
22
- |}`,e){let t=this.getAttribute("config"),r=this.getAttribute("accum"),i=e?[n]:v.parse(n,this.getAttribute("include"),2,t).childNodes;re.run(()=>{let s=new ve(void 0,rl,"table-syntax",t,r);super.insertAt(s)}),this.lastChild.replaceChildren(...i)}getLayout(n){let e=this.getAllRows(),{length:t}=e,r=new bi(...nl(t,()=>[]));for(let i=0;i<r.length;i++){let s=r[i],o=0,l=0,u;for(let p of e[i].childNodes.slice(2))if(p.type==="td"){if(p.isIndependent()&&(u=p.subtype!=="caption"),u){let d={row:i,column:o},{rowspan:g,colspan:f}=p;for(o++;s[l];)l++;for(let h=i;h<Math.min(i+g,t);h++)for(let m=l;m<l+f;m++)r[h][m]=d;l+=f}}else if(il(p))break}return r}getAllRows(){return[...super.getRowCount()?[this]:[],...this.childNodes.slice(1).filter(n=>n.type==="tr"&&n.getRowCount()>0)]}getNthRow(n,e,t){let r=super.getRowCount();if(n===0&&r)return this;r&&n--;for(let i of this.childNodes.slice(2)){let{type:s}=i;if(s==="tr"&&i.getRowCount()&&(n--,n<0))return i}}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e);return t.closed=this.closed,t}}});var Cn,ro=k(()=>{"use strict";xi();Cn=class extends tr{get type(){return"tr"}constructor(n,e,t,r){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,n,"tr",e,t,r)}}});var rr,Ti=k(()=>{"use strict";Qe();rr=class extends ge{get indent(){return this.innerText.split(":").length-1}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e),{indent:r}=this;return r&&(t.indent=r),t}}});var nr,yi=k(()=>{"use strict";Ti();nr=class extends rr{get type(){return"dd"}}});var io={};se(io,{parseTable:()=>ol});var sl,no,ol,so=k(()=>{"use strict";B();to();ro();fi();yi();sl=a=>a.lastChild.constructor!==S,no=(a,n)=>a.type==="td"?n.pop():a,ol=({firstChild:{data:a},type:n,name:e},t,r)=>{let i=[],s=a.split(`
23
- `),o=n==="root"||n==="parameter-value"||n==="ext-inner"&&e==="poem"?"":`
24
- ${s.shift()}`,l,u=(p,d)=>{if(!d){o+=p;return}let{lastChild:g}=d;if(sl(d)){let f=new S(p,t,r);f.type="table-inter",f.setAttribute("stage",3),d.insertAt(f)}else g.setText(g.toString()+p)};for(let p of s){l=i.pop();let[d]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(p),g=p.slice(d.length),f=/^(:*)((?:\s|\0\d+[cn]\x7F)*)(\{\||\{(?:\0\d+[cn]\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(g);if(f){for(;l&&l.type!=="td";)l=i.pop();let[,C,$,E,_]=f;C&&new nr(C,t,r),u(`
25
- ${d}${C&&`\0${r.length-1}d\x7F`}${$}\0${r.length}b\x7F`,l),i.push(...l?[l]:[],new wn(E,_,t,r));continue}else if(!l){o+=`
26
- ${p}`;continue}let h=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(g);if(!h){u(`
27
- ${p}`,l),i.push(l);continue}let[,m,x,y,w]=h;if(m){for(;l.type!=="table";)l=i.pop();l.close(`
28
- ${d}${m}`,!0),u(w,i[i.length-1])}else if(x){l=no(l,i),l.type==="tr"&&(l=i.pop());let C=new Cn(`
29
- ${d}${x}`,w,t,r);i.push(l,C),l.insertAt(C)}else{l=no(l,i);let C=y==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu,$=C.exec(w),E=0,_=`
30
- ${d}${y}`,M=F=>{let Q=new er(_,w.slice(E,$==null?void 0:$.index),t,r);return F.insertAt(Q),Q};for(;$;)M(l),{lastIndex:E}=C,[_]=$,$=C.exec(w);i.push(l,M(l))}}return o.slice(1)}});var $n,oo=k(()=>{"use strict";Qe();$n=class extends ge{get type(){return"hr"}}});var ao,ki,al,ft,lo=k(()=>{"use strict";st();Qe();ao=[ke()];ft=class extends(al=ge){get type(){return"double-underscore"}constructor(n,e,t,r){super(n,t,r)}getAttribute(n){return n==="padding"?2:super.getAttribute(n)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}};ki=oe(al),ft=le(ki,0,"DoubleUnderscoreToken",ao,ft),ae(ki,1,ft)});var go={};se(go,{parseHrAndDoubleUnderscore:()=>ll});var ll,uo=k(()=>{"use strict";oo();lo();ti();ll=({firstChild:{data:a},type:n,name:e},t,r)=>{var l,u,p;let{doubleUnderscore:[i,s,o]}=t;return(l=t.insensitiveDoubleUnderscore)!=null||(t.insensitiveDoubleUnderscore=new Set(i)),(u=t.sensitiveDoubleUnderscore)!=null||(t.sensitiveDoubleUnderscore=new Set(s)),(p=t.regexHrAndDoubleUnderscore)!=null||(t.regexHrAndDoubleUnderscore=new RegExp(`__(${[...i,...s].join("|")})__`,"giu")),n!=="root"&&(n!=="ext-inner"||e!=="poem")&&(a=`\0${a}`),a=a.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(d,g,f)=>(new $n(f,t,r),`${g}\0${r.length-1}r\x7F`)).replace(t.regexHrAndDoubleUnderscore,(d,g)=>{var x;let f=t.sensitiveDoubleUnderscore.has(g),h=g.toLowerCase(),m=t.insensitiveDoubleUnderscore.has(h);return f||m?(new ft(g,f,t,r),`\0${r.length-1}${m&&((x=o==null?void 0:o[h])!=null?x:h)==="toc"?"u":"n"}\x7F`):d}).replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(d,g,f,h,m)=>{let x=`${g}\0${r.length}h\x7F`;return new Ut(f.length,[h,m],t,r),x}),n==="root"||n==="ext-inner"&&e==="poem"?a:a.slice(1)}});var In,po=k(()=>{"use strict";D();ee();W();Qe();In=class extends ge{get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}text(){let{parentNode:n,innerText:e}=this;return(n==null?void 0:n.type)==="image-parameter"&&n.name!=="caption"?"":e}lint(n=this.getAbsoluteIndex()){let{previousSibling:e,nextSibling:t,bold:r}=this,i=v.msg('lonely "$1"',"'"),s=[],o=new j(this,n),l=(u,p,d)=>[{desc:"escape",range:[u,p],text:"&apos;".repeat(d)},{desc:"remove",range:[u,p],text:""}];if((e==null?void 0:e.type)==="text"&&e.data.endsWith("'")){let u=P(this,o,"lonely-apos",i),{startIndex:p,startLine:d,startCol:g}=u,[,{length:f}]=/(?:^|[^'])('+)$/u.exec(e.data),h=n-f;s.push({...u,startIndex:h,endIndex:p,endLine:d,startCol:g-f,endCol:g,suggestions:l(h,p,f)})}if((t==null?void 0:t.type)==="text"&&t.data.startsWith("'")){let u=P(this,o,"lonely-apos",i),{endIndex:p,endLine:d,endCol:g}=u,[{length:f}]=/^'+/u.exec(t.data),h=p+f;s.push({...u,startIndex:p,endIndex:h,startLine:d,startCol:g,endCol:g+f,suggestions:l(p,h,f)})}if(r&&this.closest("heading-title")){let u=P(this,o,"bold-header","bold in section header","warning");u.suggestions=[{desc:"remove",range:[n,n+3],text:""}],s.push(u)}return s}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e);return Object.assign(t,{bold:this.bold,italic:this.italic}),t}}});var co={};se(co,{parseQuotes:()=>vi});var vi,Ai=k(()=>{"use strict";po();vi=(a,n,e,t)=>{var d;let r=a.split(/('{2,})/u),{length:i}=r;if(i===1)return a;let s=0,o=0,l,u,p;for(let g=1;g<i;g+=2){let f=r[g].length;switch(f){case 2:o++;break;case 4:r[g-1]+="'",r[g]="'''";case 3:if(s++,l!==void 0)break;r[g-1].endsWith(" ")?u===void 0&&p===void 0&&(p=g):r[g-1].slice(-2,-1)===" "?l=g:u!=null||(u=g);break;default:r[g-1]+="'".repeat(f-5),r[g]="'''''",o++,s++}}if(o%2===1&&s%2===1){let g=(d=l!=null?l:u)!=null?d:p;g!==void 0&&(r[g]="''",r[g-1]+="'")}for(let g=1;g<i;g+=2)new In(r[g],n,e),r[g]=`\0${e.length-1}q\x7F`;return r.join("")}});var mo={};se(mo,{parseExternalLinks:()=>Si});var Si,wi=k(()=>{"use strict";Y();ai();yn();Si=(a,n,e,t)=>{var r;return(r=n.regexExternalLinks)!=null||(n.regexExternalLinks=new RegExp(String.raw`\[(\0\d+f\x7F|(?:(?:${n.protocol}|//)${je}|\0\d+m\x7F)${Be}(?=[[\]<>"\t${$e}]|\0\d))([${$e}]*(?![${$e}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),a.replace(n.regexExternalLinks,(i,s,o,l)=>{let{length:u}=e,p=/&[lg]t;/u.exec(s);return p&&(o="",l=s.slice(p.index)+o+l,s=s.slice(0,p.index)),t?(new Oe(s,"ext-link-url",n,e),`[\0${u}f\x7F${o}${l}]`):(new Kt(s,o,l,n,e),`\0${u}w\x7F`)})}});var Nn,ho=k(()=>{"use strict";Y();Ar();Nn=class extends Fe{get type(){return"category"}get sortkey(){let{childNodes:[,n]}=this;return n&&it(n.text())}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e),{sortkey:r}=this;return r&&(t.sortkey=r),t}}});var xo={};se(xo,{parseLinks:()=>fo});var dl,fo,bo=k(()=>{"use strict";W();Ai();wi();oi();ni();ho();dl=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,fo=(a,n,e,t)=>{var o;(o=n.regexLinks)!=null||(n.regexLinks=new RegExp(String.raw`^\s*(?:${n.protocol}|//)`,"iu"));let r=n.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]]))?\]\]([\s\S]*)$/u:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]])?)?\]\]([\s\S]*)$/u,i=a.split("[["),s=i.shift();for(let l=0;l<i.length;l++){let u=!1,p,d,g,f,h=i[l],m=r.exec(h);if(m)[,p,d,g,f]=m,f.startsWith("]")&&(g!=null&&g.includes("["))&&(g+="]",f=f.slice(1));else{let $=dl.exec(h);$&&(u=!0,[,p,d,g]=$)}if(p===void 0||n.regexLinks.test(p)||/\0\d+[exhbru]\x7F/u.test(p)){s+=`[[${h}`;continue}let x=p.trim().startsWith(":");if(x&&u){s+=`[[${h}`;continue}let{ns:y,valid:w}=v.normalizeTitle(p,0,!1,n,!0,!0,!0,!0);if(w){if(u){if(y!==6){s+=`[[${h}`;continue}let $=!1;for(l++;l<i.length;l++){let E=i[l],_=E.split("]]");if(_.length>2){$=!0,g+=`[[${_[0]}]]${_[1]}`,f=_.slice(2).join("]]");break}else if(_.length===2)g+=`[[${_[0]}]]${_[1]}`;else{g+=`[[${E}`;break}}if(g=fo(g,n,e,t),!$){s+=`[[${p}${d}${g}`;continue}}}else{s+=`[[${h}`;continue}g&&(g=vi(g,n,e,t));let C=Xt;x||(y===6?(g&&(g=Si(g,n,e,!0)),C=Vt):y===14&&(C=Nn)),g===void 0&&d&&(g=""),s+=`\0${e.length}l\x7F${f}`,new C(p,g,n,e,d)}return s}});var Ao={};se(Ao,{parseMagicLinks:()=>gl});var vo,To,yo,ko,gl,So=k(()=>{"use strict";Y();yn();vo=String.raw`[${$e}\t]|&nbsp;|&#0*160;|&#x0*a0;`,To=`(?:${vo})+`,yo=`(?:${vo}|-)`,ko=String.raw`(?:RFC|PMID)${To}\d+\b|ISBN${To}(?:97[89]${yo}?)?(?:\d${yo}?){9}[\dx]\b`,gl=(a,n,e)=>{if(!n.regexMagicLinks)try{n.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\d_])(?:(?:${n.protocol})(${je}${Be})|${ko})`,"giu")}catch(t){n.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${n.protocol})(${je}${Be})|${ko})`,"giu")}return a.replace(n.regexMagicLinks,(t,r,i)=>{let s=r?t.slice(r.length):t;if(i){let o="",l=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(s);l&&(o=s.slice(l.index),s=s.slice(0,l.index));let u=s.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,p=u.exec(s);if(p){let d=1;p[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(s.slice(0,p.index))&&(d=2),o=s.slice(p.index+d)+o,s=s.slice(0,p.index+d)}return o.length>=i.length?t:(new Oe(s,void 0,n,e),`${r}\0${e.length-1}w\x7F${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(s))return t;return new Oe(s,"magic-link",n,e),`${r}\0${e.length-1}i\x7F`})}});var wo,Co=k(()=>{"use strict";wo=(a,n)=>a.startsWith(n)?n.length:[...n].findIndex((e,t)=>e!==a[t])});var En,$o=k(()=>{"use strict";Ti();En=class extends rr{get type(){return"list"}}});var Io={};se(Io,{parseList:()=>ul});var ul,No=k(()=>{"use strict";Co();$o();yi();ul=(a,n,e,t)=>{let r=/^((?:\0\d+[cno]\x7F)*)([;:*#]+\s*)/u.exec(a);if(!r)return n.lastPrefix="",a;let[i,s,o]=r,l=o.replace(/;/gu,":"),u=wo(l,n.lastPrefix),p=(u>1?o.slice(u-1):o).split(/(?=;)/u),d=p[0].startsWith(";"),g=p.length-(d?0:1);if(u>1){let F=o.slice(0,u-1);d?p.unshift(F):p[0]=F+p[0]}n.lastPrefix=l;let f=s+p.map((F,Q)=>`\0${t.length+Q}d\x7F`).join("")+a.slice(i.length);for(let F of p)new En(F,e,t);if(!g)return f;let{html:[h]}=e,m=/:+|-\{|\0\d+[xq]\x7F/gu,x=m,y=x.exec(f),w=0,C=!1,$=!1,E=0,_=(F,Q)=>(new nr(F,e,t),`${f.slice(0,Q)}\0${t.length-1}d\x7F${f.slice(Q+F.length)}`),M=F=>{F?w&&w--:w++};for(;y&&g;){let{0:F,index:Q}=y;if(F==="-{"){if(!E){let{lastIndex:R}=x;x=/-\{|\}-/gu,x.lastIndex=R}E++}else if(F==="}-"){if(E--,!E){let{lastIndex:R}=x;x=m,x.lastIndex=R}}else if(F.endsWith("x\x7F")){let{name:R,closing:H,selfClosing:G}=t[Number(F.slice(1,-2))];(!G||h.includes(R))&&M(H)}else if(F.endsWith("q\x7F")){let{bold:R,italic:H}=t[Number(F.slice(1,-2))];R&&(M(C),C=!C),H&&(M($),$=!$)}else if(w===0){if(F.length>=g)return _(F.slice(0,g),Q);g-=F.length,x.lastIndex=Q+4+String(t.length).length,f=_(F,Q)}y=x.exec(f)}return f}});var Eo,He,Ln,Lo=k(()=>{"use strict";D();ee();B();_e();Eo=new Set(["A","T","R","D","-","H","N"]),Ln=class extends S{constructor(e,t,r=[]){super(void 0,t,r,{});T(this,He);this.append(...e.map(i=>new V(i,"converter-flag",t,r)))}get type(){return"converter-flags"}afterBuild(){b(this,He,this.childNodes.map(e=>e.text().trim())),super.afterBuild()}toString(e){return super.toString(e,";")}text(){return super.text(";")}getGaps(){return 1}getUnknownFlags(){return new Set(c(this,He).filter(e=>/\{{3}[^{}]+\}{3}/u.test(e)))}getVariantFlags(){let e=new Set(this.getAttribute("config").variants);return new Set(c(this,He).filter(t=>e.has(t)))}lint(e=this.getAbsoluteIndex(),t){let r=this.getVariantFlags(),i=this.getUnknownFlags(),s=new Set(c(this,He).filter(d=>Eo.has(d))),o=c(this,He).filter(d=>!d).length,l=c(this,He).length-i.size-o,u=super.lint(e,t);if(r.size===l||s.size===l)return u;let p=new j(this,e);for(let d=0;d<this.length;d++){let g=this.childNodes[d],f=g.text().trim();if(f&&!r.has(f)&&!i.has(f)&&(r.size>0||!s.has(f))){let h=I(g,p,"no-ignored","invalid conversion flag");r.size===0&&Eo.has(f.toUpperCase())?h.fix={range:[h.startIndex,h.endIndex],text:f.toUpperCase(),desc:"uppercase"}:h.suggestions=[{desc:"remove",range:[h.startIndex-(d&&1),h.endIndex],text:""}],u.push(h)}}return u}print(){return super.print({sep:";"})}};He=new WeakMap});var ir,Fo=k(()=>{"use strict";W();B();_e();ir=class extends S{get type(){return"converter-rule"}get variant(){var n,e;return(e=(n=this.childNodes[this.length-2])==null?void 0:n.text().trim())!=null?e:""}constructor(n,e=!0,t=v.getConfig(),r=[]){super(void 0,t,r);let i=n.indexOf(":"),s=n.slice(0,i).indexOf("=>"),o=s===-1?n.slice(0,i):n.slice(s+2,i);e&&t.variants.includes(o.trim())?(super.insertAt(new V(o,"converter-rule-variant",t,r)),super.insertAt(new V(n.slice(i+1),"converter-rule-to",t,r)),s!==-1&&super.insertAt(new V(n.slice(0,s),"converter-rule-from",t,r),0)):super.insertAt(new V(n,"converter-rule-to",t,r))}toString(n){let{childNodes:e,firstChild:t,lastChild:r}=this;return e.length===3?`${t.toString(n)}=>${e[1].toString(n)}:${r.toString(n)}`:super.toString(n,":")}text(){let{childNodes:n,firstChild:e,lastChild:t}=this;return n.length===3?`${e.text()}=>${n[1].text()}:${t.text()}`:super.text(":")}getGaps(n){return n===0&&this.length===3?2:1}print(){let{childNodes:n}=this;if(n.length===3){let[e,t,r]=n;return`<span class="wpb-converter-rule">${e.print()}=>${t.print()}:${r.print()}</span>`}return super.print({sep:":"})}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e);return t.variant=this.variant,t}}});var Fn,Po=k(()=>{"use strict";Y();B();Lo();Fo();Fn=class extends S{get type(){return"converter"}constructor(n,e,t,r=[]){super(void 0,t,r),this.append(new Ln(n,t,r));let[i]=e,s=i.includes(":"),o=new ir(i,s,t,r);s&&o.length===1||!s&&e.length===2&&!de(e[1]).trim()?this.insertAt(new ir(e.join(";"),!1,t,r)):this.append(o,...e.slice(1).map(l=>new ir(l,!0,t,r)))}toString(n){let{childNodes:[e,...t]}=this;return`-{${e.toString(n)}${e.length>0?"|":""}${t.map(r=>r.toString(n)).join(";")}}-`}text(){let{childNodes:[n,...e]}=this;return`-{${n.text()}|${Te(e,";")}}-`}getAttribute(n){return n==="padding"?2:super.getAttribute(n)}getGaps(n){return n||this.firstChild.length>0?1:0}print(){let{childNodes:[n,...e]}=this;return`<span class="wpb-converter">-{${n.print()}${n.length>0?"|":""}${qe(e,{sep:";"})}}-</span>`}}});var Ro={};se(Ro,{parseConverter:()=>pl});var pl,jo=k(()=>{"use strict";Po();pl=(a,n,e)=>{var l;(l=n.regexConverter)!=null||(n.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${n.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"u"));let t=/-\{/gu,r=/-\{|\}-/gu,i=[],s=t,o=s.exec(a);for(;o;){let{0:u,index:p}=o;if(u==="}-"){let d=i.pop(),{length:g}=e,f=a.slice(d.index+2,p),h=f.indexOf("|"),[m,x]=h===-1?[[],f]:[f.slice(0,h).split(";"),f.slice(h+1)],y=x.replace(/(&[#a-z\d]+);/giu,"$1"),w=y.split(n.regexConverter).map(C=>C.replace(/\x01/gu,";"));new Fn(m,w,n,e),a=`${a.slice(0,d.index)}\0${g}v\x7F${a.slice(p+2)}`,i.length===0&&(s=t),s.lastIndex=d.index+3+String(g).length}else i.push(o),s=r,s.lastIndex=p+2;o=s.exec(a)}return a}});var _r={};se(_r,{Token:()=>S});var Br,Se,U,X,xt,sr,qr,z,Bo,qo,_o,Oo,Mo,Do,Wo,Ho,Uo,zo,Go,Vo,Ci,S,B=k(()=>{"use strict";Y();D();W();Ji();es();Ci=class Ci extends Kr{constructor(e,t=v.getConfig(),r=[],i){super();T(this,z);T(this,Br,"plain");T(this,Se,0);T(this,U);T(this,X);T(this,xt);T(this,sr,!1);T(this,qr);typeof e=="string"&&this.insertAt(e),b(this,U,t),b(this,X,r),r.push(this)}get type(){return c(this,Br)}set type(e){b(this,Br,e)}parseOnce(e=c(this,Se),t=!1,r){if(e<c(this,Se)||this.length===0||!this.getAttribute("plain"))return this;if(c(this,Se)>=11)return this;switch(e){case 0:if(this.type==="root"){c(this,X).pop();let i=A(this,z,Bo).call(this);t&&(t=!i)}b(this,xt,t),A(this,z,qo).call(this,t);break;case 1:A(this,z,_o).call(this);break;case 2:A(this,z,Oo).call(this);break;case 3:A(this,z,Mo).call(this);break;case 4:A(this,z,Do).call(this);break;case 5:A(this,z,Wo).call(this,r);break;case 6:A(this,z,Ho).call(this,r);break;case 7:A(this,z,Uo).call(this);break;case 8:A(this,z,zo).call(this);break;case 9:A(this,z,Go).call(this);break;case 10:A(this,z,Vo).call(this)}if(this.type==="root")for(let i of c(this,X))i==null||i.parseOnce(e,t,r);return Vr(this,Se)._++,this}buildFromStr(e,t){let r=e.split(/[\0\x7F]/u).map((i,s)=>{if(s%2===0)return new kr(i);if(isNaN(i.slice(-1)))return c(this,X)[Number(i.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${i}`)});return t===0?r.map(String).join(""):t===1?Te(r):r}build(){b(this,Se,11);let{length:e,firstChild:t}=this,r=t==null?void 0:t.toString();if(e===1&&t.type==="text"&&r.includes("\0")&&(this.replaceChildren(...this.buildFromStr(r)),this.normalize(),this.type==="root"))for(let i of c(this,X))i==null||i.build()}afterBuild(){if(this.type==="root")for(let e of c(this,X))e==null||e.afterBuild();b(this,sr,!0)}parse(e=11,t,r){for(e=Math.min(e,11);c(this,Se)<e;)this.parseOnce(c(this,Se),t,r);return e&&(this.build(),this.afterBuild()),this}getAttribute(e){var t;switch(e){case"plain":return this.constructor===Ci;case"config":return c(this,U);case"include":return(t=c(this,xt))!=null?t:!!c(this.getRootNode(),xt);case"accum":return c(this,X);case"built":return c(this,sr);default:return super.getAttribute(e)}}setAttribute(e,t){switch(e){case"stage":c(this,Se)===0&&this.type==="root"&&c(this,X).shift(),b(this,Se,t);break;default:super.setAttribute(e,t)}}insertAt(e,t=this.length){let r=typeof e=="string"?new kr(e):e;super.insertAt(r,t);let{type:i}=r;return i==="root"&&(r.type="plain"),r}normalizeTitle(e,t=0,r,i,s,o){return v.normalizeTitle(e,t,c(this,xt),c(this,U),r,i,s,o)}lint(e=this.getAbsoluteIndex(),t){var i;let r=super.lint(e,t);if(this.type==="root"){let s=new Map,o="category,html-attr#id,ext-attr#id,table-attr#id";for(let g of this.querySelectorAll(o)){let f;if(g.type==="category")f=g.name;else{let h=g.getValue();h&&h!==!0&&(f=`#${h}`)}if(f){let h=s.get(f);h?h.add(g):s.set(f,new Set([g]))}}for(let[g,f]of s)if(f.size>1&&!g.startsWith("#mw-customcollapsible-")){let h=!g.startsWith("#"),m=`duplicated ${h?"category":"id"}`,x=h?"error":"warning";r.push(...[...f].map(y=>{let w=P(y,{start:y.getAbsoluteIndex()},"no-duplicate",m,x);return h&&(w.suggestions=[{desc:"remove",range:[w.startIndex,w.endIndex],text:""}]),w}))}let l=/<!--\s*lint-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->/gu,u=this.toString(),p=[],d=l.exec(u);for(;d;){let{1:g,index:f}=d,h=(i=d[2])==null?void 0:i.trim();p.push({line:this.posFromIndex(f).top+(g==="disable-line"?0:1),from:g==="disable"?l.lastIndex:void 0,to:g==="enable"?l.lastIndex:void 0,rules:h?new Set(h.split(",").map(m=>m.trim())):void 0}),d=l.exec(u)}r=r.filter(({rule:g,startLine:f,startIndex:h})=>{let m={pos:0};for(let{line:x,from:y,to:w,rules:C}of p){if(x>f+1)break;if(C&&!C.has(g))continue;if(x===f&&y===void 0&&w===void 0)return!1;y<=h&&y>m.pos?(m.pos=y,m.type="from"):w<=h&&w>m.pos&&(m.pos=w,m.type="to")}return m.type!=="from"})}return r}toString(e,t){return e?super.toString(!0,t):Ie(c(this,qr),()=>super.toString(!1,t),r=>{let i=this.getRootNode();i.type==="root"&&c(i,sr)&&b(this,qr,r)})}};Br=new WeakMap,Se=new WeakMap,U=new WeakMap,X=new WeakMap,xt=new WeakMap,sr=new WeakMap,qr=new WeakMap,z=new WeakSet,Bo=function(){let{parseRedirect:e}=(os(),J(ss)),t=this.firstChild.toString(),r=e(t,c(this,U),c(this,X));return r&&this.setText(r),!!r},qo=function(e){let{parseCommentAndExt:t}=(Cr(),J(Ks));this.setText(t(this.firstChild.toString(),c(this,U),c(this,X),e))},_o=function(){let{parseBraces:e}=(hn(),J(Ls)),t=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,r=e(t,c(this,U),c(this,X));this.setText(this.type==="root"?r:r.slice(1))},Oo=function(){var t;if((t=c(this,U).excludes)!=null&&t.includes("html"))return;let{parseHtml:e}=(eo(),J(Zs));this.setText(e(this.firstChild.toString(),c(this,U),c(this,X)))},Mo=function(){var t;if((t=c(this,U).excludes)!=null&&t.includes("table"))return;let{parseTable:e}=(so(),J(io));this.setText(e(this,c(this,U),c(this,X)))},Do=function(){var t;if((t=c(this,U).excludes)!=null&&t.includes("hr"))return;let{parseHrAndDoubleUnderscore:e}=(uo(),J(go));this.setText(e(this,c(this,U),c(this,X)))},Wo=function(e){let{parseLinks:t}=(bo(),J(xo));this.setText(t(this.firstChild.toString(),c(this,U),c(this,X),e))},Ho=function(e){var i;if((i=c(this,U).excludes)!=null&&i.includes("quote"))return;let{parseQuotes:t}=(Ai(),J(co)),r=this.firstChild.toString().split(`
31
- `);for(let s=0;s<r.length;s++)r[s]=t(r[s],c(this,U),c(this,X),e);this.setText(r.join(`
32
- `))},Uo=function(){var t;if((t=c(this,U).excludes)!=null&&t.includes("extLink"))return;let{parseExternalLinks:e}=(wi(),J(mo));this.setText(e(this.firstChild.toString(),c(this,U),c(this,X)))},zo=function(){var t;if((t=c(this,U).excludes)!=null&&t.includes("magicLink"))return;let{parseMagicLinks:e}=(So(),J(Ao));this.setText(e(this.firstChild.toString(),c(this,U),c(this,X)))},Go=function(){var u;if((u=c(this,U).excludes)!=null&&u.includes("list"))return;let{parseList:e}=(No(),J(Io)),{firstChild:t,type:r,name:i}=this,s=t.toString().split(`
33
- `),o={lastPrefix:""},l=r==="root"||r==="ext-inner"&&i==="poem"?0:1;for(;l<s.length;l++)s[l]=e(s[l],o,c(this,U),c(this,X));this.setText(s.join(`
34
- `))},Vo=function(){if(c(this,U).variants.length>0){let{parseConverter:e}=(jo(),J(Ro));this.setText(e(this.firstChild.toString(),c(this,U),c(this,X)))}};S=Ci});var re,zt,Un,Yr,ye=k(()=>{"use strict";re={running:!1,run(a){let{running:n}=this;this.running=!0;try{let{Token:e}=(B(),J(_r)),t=a();return t instanceof e&&!t.getAttribute("built")&&t.afterBuild(),this.running=n,t}catch(e){throw this.running=n,e}},rev:0},zt=a=>n=>n.type===a,Un=(a,n,e,t=[])=>{var s,o;let r=a.getChildNodes(),i=r.splice(n,e,...t);for(let l=0;l<t.length;l++){let u=t[l];u.setAttribute("parentNode",a),u.setAttribute("nextSibling",r[n+l+1]),u.setAttribute("previousSibling",r[n+l-1])}return(s=r[n-1])==null||s.setAttribute("nextSibling",r[n]),(o=r[n+t.length])==null||o.setAttribute("previousSibling",r[n+t.length-1]),i},Yr=(a,n)=>{Object.defineProperty(a,"name",{value:n.name})}});var Qo={};se(Qo,{Title:()=>$i});var Or,Mr,we,or,bt,$i,Xo=k(()=>{"use strict";Y();$i=class{constructor(n,e,t,r,i,s){T(this,Or);T(this,Mr);T(this,we);T(this,or);T(this,bt);te(this,"valid");te(this,"encoded",!1);let o=n.trim().startsWith("../");if(i&&n.includes("%"))try{let u=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(n);n=Ge(n),this.encoded=u}catch(u){}if(n=it(n).replace(/[_ ]+/gu," ").trim(),o)b(this,or,0);else{let u=e;n.startsWith(":")&&(u=0,n=n.slice(1).trim());let p=n.split(":");if(p.length>1){let d=p[0].trim().toLowerCase(),g=Object.prototype.hasOwnProperty.call(t.nsid,d)&&t.nsid[d];g&&(u=g,n=p.slice(1).join(":").trim())}b(this,or,u)}let l=n.indexOf("#");if(l!==-1){let u=n.slice(l).trim().slice(1);if(u.includes("%"))try{u=Ge(u)}catch(p){}b(this,bt,u.replace(/ /gu,"_")),n=n.slice(0,l).trim()}this.valid=!!(n||s&&this.ns===0&&c(this,bt)!==void 0)&&it(n)===n&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(o?/^(?:\.\.\/)+(.*)/u.exec(n)[1]:n),this.main=n,b(this,Mr,t.namespaces),b(this,we,t.articlePath||"/wiki/$1"),c(this,we).includes("$1")||b(this,we,c(this,we)+`${c(this,we).endsWith("/")?"":"/"}$1`),r||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return c(this,or)}get fragment(){return c(this,bt)}get main(){return c(this,Or)}set main(n){n=n.replace(/_/gu," ").trim(),b(this,Or,n&&n[0].toUpperCase()+n.slice(1))}get prefix(){let n=c(this,Mr)[this.ns];return n+(n&&":")}get title(){return this.getRedirection()[1]}get extension(){let{main:n}=this,e=n.lastIndexOf(".");return e===-1?void 0:n.slice(e+1).toLowerCase()}getRedirection(){return[!1,(this.prefix+this.main).replace(/ /gu,"_")]}setFragment(n){b(this,bt,n)}getUrl(n){{typeof n=="string"&&(b(this,we,n||"/wiki/$1"),c(this,we).includes("$1")||b(this,we,c(this,we)+`${c(this,we).endsWith("/")?"":"/"}$1`));let{title:e,fragment:t}=this;return e?c(this,we).replace("$1",encodeURIComponent(e)+(t?`#${encodeURIComponent(t)}`:"")):t===void 0?"":`#${encodeURIComponent(t)}`}}};Or=new WeakMap,Mr=new WeakMap,we=new WeakMap,or=new WeakMap,bt=new WeakMap});var sa={};se(sa,{LanguageService:()=>Ii,tasks:()=>Zo});var Zo,cl,ml,hl,fl,ea,xl,bl,Tl,Ko,zr,ta,ar,ce,Jo,ra,Dr,Wr,lr,Pn,Yo,Ee,tt,Ue,ze,dr,Gr,gr,ur,pr,O,Hr,Ce,Ni,na,Ei,ia,Ur,Ii,oa=k(()=>{"use strict";_n();Yn();D();Y();W();Zo=new WeakMap,cl=new Set(["ref"]),ml=new Set(["ref","references"]),hl=new Set(["name","extends","follow"]),fl=new Set(["group"]),ea=new Set(["arg-name","template-name","magic-word-name","link-target","parameter-key"]),xl=new Set(["ext","html","attr-key","image-parameter","heading-title","heading",...ea]),bl=new Set(["text","comment","noinclude","include"]),Tl=["ext","html","table"].map(a=>`${a}-attr#style`).join(),Ko=a=>a.every(({type:n})=>bl.has(n)),zr=(a,n)=>{let{top:e,left:t}=a.posFromIndex(n);return{line:e,character:t}},ta=(a,n,e)=>({start:zr(a,n),end:zr(a,e)}),ar=a=>{let{top:n,left:e,height:t,width:r}=a.getBoundingClientRect();return{start:{line:n,character:e},end:$t(n,e,t,r)}},ce=(a,n,e,{line:t,character:r},i)=>[...new Set(a)].map(s=>({label:s,kind:n,textEdit:{range:{start:{line:t,character:r-e.length},end:{line:t,character:r}},newText:s+(i!=null?i:"")}})),Jo=(a,{line:n,character:e})=>{let t=a.indexFromPos(n,e);return a.caretPositionFromIndex(t+Number(/\w/u.test(a.toString().charAt(t))))},ra=(a,n,e)=>{let{type:t,parentNode:r={}}=a,{name:i,tag:s}=r;return t==="attr-value"&&n.has(s)&&e.has(i)?a.toString().trim():NaN},Dr=a=>ra(a,cl,hl),Wr=a=>ra(a,ml,fl),lr=(a,n)=>{let e=a==null?void 0:a.getAttr(n);return e!==!0&&e||!1},Pn=a=>{let{type:n,name:e,parentNode:t}=a;switch(n){case"heading":return a.level;case"heading-title":return t.level;case"parameter-key":return`${t.parentNode.name}|${t.name}`;case"ext":case"html":case"image-parameter":return e;default:return t.name}},Yo=(a,n,e=!1)=>({range:ta(a,...n.range),newText:n.text,title:`${e?"Fix":"Suggestion"}: ${n.desc}`,fix:e}),Ii=class{constructor(n){T(this,O);T(this,Ee);T(this,tt);T(this,Ue);T(this,ze);T(this,dr);T(this,Gr);T(this,gr);T(this,ur);T(this,pr);te(this,"include",!0);te(this,"data");Zo.set(n,this)}destroy(){Object.setPrototypeOf(this,null)}async provideDocumentColors(n,e,t=!0){let r=await A(this,O,Ce).call(this,e);return r.querySelectorAll("attr-value,parameter-value,arg-default").reverse().flatMap(({type:i,childNodes:s})=>i!=="attr-value"&&!Ko(s)?[]:s.filter(o=>o.type==="text").reverse().flatMap(o=>{let l=Hi(o.data,t).filter(([,,,p])=>p);if(l.length===0)return[];let u=o.getAbsoluteIndex();return l.map(([p,d,g])=>{let f=n(p);return f.length===4&&{color:{red:f[0]/255,green:f[1]/255,blue:f[2]/255,alpha:f[3]},range:ta(r,u+d,u+g)}}).filter(Boolean)}))}provideColorPresentations(n){let{color:{red:e,green:t,blue:r,alpha:i},range:s}=n,o=`#${mr(e)}${mr(t)}${mr(r)}${i<1?mr(i):""}`;return[{label:o,textEdit:{range:s,newText:o}}]}async provideCompletionItems(n,e){var C,$,E,_,M,F,Q;let{re:t,allTags:r,functions:i,switches:s,protocols:o,params:l,tags:u,ext:p}=A(this,O,ia).call(this),{line:d,character:g}=e,f=n.split(/\r?\n/u,d+1)[d],h=t.exec((C=f==null?void 0:f.slice(0,g))!=null?C:"");if((h==null?void 0:h[1])!==void 0){let R=h[1].startsWith("/");return ce(r,"Class",h[1].slice(R?1:0),e,R&&!(f!=null&&f.slice(g).trim().startsWith(">"))?">":"")}else{if(h!=null&&h[4])return ce(s,"Constant",h[4],e);if((h==null?void 0:h[5])!==void 0)return ce(o,"Reference",h[5],e)}let m=await A(this,O,Ce).call(this,n),x;if(h!=null&&h[2]){x=m.elementFromPoint(h.index+h[2].length-1,d);let R=($=h[3])!=null?$:"";if(h[2]==="{{{")return ce(m.querySelectorAll("arg").filter(L=>L.name&&L!==x).map(({name:L})=>L),"Variable",R,e);let H=R.startsWith(":"),G=H?R.slice(1).trimStart():R;return h[2]==="[["?ce(m.querySelectorAll("link,file,category,redirect-target").filter(L=>L!==x).map(({name:L})=>L),"Folder",G,e):[...ce(i,"Function",R,e),...R.startsWith("#")?[]:ce(m.querySelectorAll("template").filter(L=>L!==x).map(L=>{let{name:q}=L;if(H)return q;let{ns:N}=L.getAttribute("title");return N===0?`:${q}`:N===10?q.slice(9):q}),"Folder",G,e)]}let y,w;if((h==null?void 0:h[7])===void 0&&(x=m.elementFromPoint(g,d),{type:y,parentNode:w}=x),(h==null?void 0:h[6])!==void 0||y==="image-parameter"){let R=m.indexFromPos(d,g),H=(_=(E=h==null?void 0:h[6])==null?void 0:E.trimStart())!=null?_:c(this,Ee).slice(x.getAbsoluteIndex(),R).trimStart(),G=c(this,Ee).charAt(R)==="=";return[...ce(l,"Property",H,e).filter(({label:L})=>!G||!/[= ]$/u.test(L)),...ce(m.querySelectorAll("image-parameter#width").filter(L=>L!==x).map(L=>L.text()),"Unit",H,e)]}else if((h==null?void 0:h[7])!==void 0||y==="attr-key"){let R=(F=(M=h==null?void 0:h[7])==null?void 0:M.toLowerCase())!=null?F:w.tag,H=(Q=h==null?void 0:h[9])!=null?Q:x.toString().slice(0,g-m.posFromIndex(x.getAbsoluteIndex()).left);if(!u.has(R))return;let G=on[R],L=an[R],q=L&&ce(L,"Field",H,e);return p.includes(R)&&!G?q:[...q!=null?q:[],...R==="meta"||R==="link"?[]:ce(sn,"Property",H,e),...G?ce(G,"Property",H,e):[],...ce(["data-"],"Variable",H,e),...ce(["xmlns:"],"Interface",H,e)]}else if(y==="parameter-key"||y==="parameter-value"&&w.anon){let R=w.parentNode,{type:H,name:G}=R;if(H==="magic-word"&&G!=="invoke")return;let L=m.indexFromPos(d,g),q=c(this,Ee).slice(x.getAbsoluteIndex(),L).trimStart(),[N,ue]=H==="magic-word"?R.getModule():[];return q?ce(m.querySelectorAll("parameter").filter(ie=>{if(ie===w||ie.anon||ie.parentNode.type!==H||ie.parentNode.name!==G)return!1;if(H==="template")return!0;let[me,pe]=ie.parentNode.getModule();return me===N&&pe===ue}).map(({name:ie})=>ie),"Variable",q,e,y==="parameter-value"?"=":""):void 0}}async provideDiagnostics(n,e=!0){let t=await A(this,O,Ce).call(this,n),r=t.lint();return[(e?r:r.filter(({severity:l})=>l==="error")).map(({startLine:l,startCol:u,endLine:p,endCol:d,severity:g,rule:f,message:h,fix:m,suggestions:x})=>({range:{start:{line:l,character:u},end:{line:p,character:d}},severity:g==="error"?1:2,source:"WikiLint",code:f,message:h,data:[...m?[Yo(t,m,!0)]:[],...x?x.map(y=>Yo(t,y)):[]]})),[],[]].flat(2)}async provideFoldingRanges(n){let e=await A(this,O,Ce).call(this,n),{length:t}=e.getLines(),r=[],i=new Array(6),s=e.querySelectorAll("heading-title,table,template,magic-word");for(let o of[...s].reverse())o.getRelativeIndex();for(let o of s){let{offsetHeight:l}=o;if(o.type==="heading-title"||l>2){let{top:u}=e.posFromIndex(o.getAbsoluteIndex());if(o.type==="heading-title"){let{level:p}=o.parentNode;for(let d=p-1;d<6;d++){let g=i[d];g!==void 0&&g<u-1&&r.push({startLine:g,endLine:u-1,kind:"region"}),i[d]=void 0}i[p-1]=u+l-1}else r.push({startLine:u,endLine:u+l-2,kind:"region"})}}for(let o of i)o!==void 0&&o<t-1&&r.push({startLine:o,endLine:t-1,kind:"region"});return r}async provideLinks(n){let{articlePath:e,protocol:t}=v.getConfig(),r=e==null?void 0:e.includes("//"),i=new RegExp(`^(?:${t}|//)`,"iu");return(await A(this,O,Ce).call(this,n)).querySelectorAll(`magic-link,ext-link-url,free-ext-link,attr-value,image-parameter#link${r?",link-target,template-name,invoke-module":""}`).reverse().map(s=>{let{type:o,parentNode:l,firstChild:u,lastChild:p,childNodes:d,length:g}=s,{name:f,tag:h}=l;if(!(o!=="attr-value"||f==="src"&&["templatestyles","img"].includes(h)||f==="cite"&&["blockquote","del","ins","q"].includes(h))||!Ko(d))return!1;let m=d.filter(x=>x.type==="text").map(({data:x})=>x).join("").trim();if(!m)return!1;try{if(s.is("magic-link")||s.is("ext-link-url")||s.is("free-ext-link"))m=s.getUrl(e);else if(o==="link-target"&&(l.is("link")||l.is("redirect-target")||l.is("category"))){if(m.startsWith("/"))return!1;m=l.link.getUrl(e)}else if(o==="template-name")m=l.getAttribute("title").getUrl(e);else if(["link-target","invoke-module"].includes(o)||o==="attr-value"&&f==="src"&&h==="templatestyles"||o==="image-parameter"&&!i.test(m)){if(!r||m.startsWith("/"))return!1;let x=0;o==="attr-value"?x=10:o==="invoke-module"&&(x=828);let y=v.normalizeTitle(m,x,!1,void 0,!0);if(!y.valid)return!1;m=y.getUrl()}if(typeof m=="string"&&m.startsWith("//")&&(m=`https:${m}`),m=new URL(m).href,o==="image-parameter"){let x=u.getBoundingClientRect(),{top:y,left:w,height:C,width:$}=g===1?x:p.getBoundingClientRect();return{range:{start:{line:x.top,character:x.left},end:$t(y,w,C,$)},target:m}}return{range:ar(s),target:m}}catch(x){return!1}}).filter(Boolean)}async provideReferences(n,e){let t=await A(this,O,Ce).call(this,n),{offsetNode:r,offset:i}=Jo(t,e),s=r.type==="text"?r.parentNode:r,o=i===0&&(s.type==="ext-attr-dirty"||s.type==="html-attr-dirty")?s.parentNode.parentNode:s,{type:l}=o,u=Dr(o),p=Wr(o);if(!u&&!p&&!xl.has(l))return;let d=Pn(o),g=t.querySelectorAll(l==="heading-title"?"heading":l).filter(f=>l==="attr-value"?Dr(f)===u||Wr(f)===p:Pn(f)===d).reverse().map(f=>({range:ar(f.type==="parameter-key"?f.parentNode:f)}));return g.length===0?void 0:g}async provideDefinition(n,e){let t=await A(this,O,Ce).call(this,n),r=t.elementFromPoint(e.character,e.line),i=r.is("ext")&&r.name==="ref"?r:r.closest("ext#ref"),s=lr(i,"name");if(!s)return;let o=lr(i,"group"),l=t.querySelectorAll("ext#ref").filter(u=>u.innerText&&lr(u,"name")===s&&lr(u,"group")===o).reverse().map(({lastChild:u})=>({range:ar(u)}));return l.length===0?void 0:l}async resolveRenameLocation(n,e){let t=await A(this,O,Ce).call(this,n),r=t.elementFromPoint(e.character,e.line),{type:i}=r,s=Dr(r),o=Wr(r);return!s&&!o&&(!ea.has(i)||i==="parameter-key"&&/^[1-9]\d*$/u.test(r.parentNode.name)||i==="link-target"&&!["link","redirect-target"].includes(r.parentNode.type))?void 0:ar(r)}async provideRenameEdits(n,e,t){let r=await A(this,O,Ce).call(this,n),i=r.elementFromPoint(e.character,e.line),{type:s}=i,o=Dr(i),l=o&&lr(i.parentNode.parentNode,"group"),u=Wr(i),p=Pn(i),d=r.querySelectorAll(s).filter(g=>{let{type:f}=g.parentNode;return s==="link-target"&&f!=="link"&&f!=="redirect-target"?!1:s==="attr-value"?Wr(g)===u||Dr(g)===o&&lr(g.parentNode.parentNode,"group")===l:Pn(g)===p});return d.length===0?void 0:{changes:{"":d.reverse().map(g=>({range:ar(g),newText:t}))}}}async provideHover(n,e){if(!this.data)return;let t=await A(this,O,Ce).call(this,n),{offsetNode:r,offset:i}=Jo(t,e),s=r.type==="text"?r.parentNode:r,{type:o,parentNode:l,length:u,name:p}=s,d,g,f;if(s.is("double-underscore")&&i>0)d=this.data.behaviorSwitches.find(({aliases:h})=>h.includes(s.innerText.toLowerCase()));else if(o==="magic-word-name")d=A(this,O,Ur).call(this,l.name),g=s.toString(!0).trim();else if(s.is("magic-word")&&!s.modifier&&u===1&&(i>0||t.posFromIndex(s.getAbsoluteIndex()).left===e.character))d=A(this,O,Ur).call(this,p),g=s.firstChild.toString(!0).trim();else if((s.is("magic-word")||s.is("template"))&&s.modifier&&i>=2&&s.getRelativeIndex(0)>i&&(g=s.modifier.trim().slice(0,-1),d=A(this,O,Ur).call(this,g.toLowerCase()),d)){let h=s.getAbsoluteIndex();f={start:zr(t,h+2),end:zr(t,h+s.modifier.trimEnd().length+1)}}return d&&{contents:{kind:"markdown",value:(d.signatures?`${d.signatures.map(h=>`- **{{ ${g}${h.length===0?"**":":** "}${h.map(({label:m,const:x})=>x?m:`*${m}*`).join(" **|** ")} **}}**`).join(`
35
- `)}
36
-
37
- `:"")+d.description},range:f!=null?f:ar(s)}}async provideSignatureHelp(n,e){if(!this.data)return;let{line:t,character:r}=e,i=n.split(/\r?\n/u,t+1)[t],{lastChild:s}=await A(this,O,na).call(this,`${i.slice(0,r+/^[^{}<]*/u.exec(i.slice(r))[0].length)}}}`);if(!s.is("magic-word")||s.length===1)return;let{name:o,childNodes:l,firstChild:u}=s,p=A(this,O,Ur).call(this,o);if(!(p!=null&&p.signatures))return;let d=l.length-1,g=p.signatures.filter(m=>{var x;return(m.length>=d||((x=m[m.length-1])==null?void 0:x.rest))&&m.every(({label:y,const:w},C)=>{var E;let $=w&&C<d&&((E=l[C+1])==null?void 0:E.toString(!0).trim());return!$||y.toLowerCase().includes($.toLowerCase())})});if(g.length===0)return;let f=-1;for(let m=s.getAbsoluteIndex()+s.getAttribute("padding");f<d&&(m+=l[f+1].toString().length+1,!(m>r));f++);let h=u.toString(!0).trim();return{signatures:g.map(m=>({label:`{{${h}${m.length===0?"":":"}${m.map(({label:x})=>x).join("|")}}}`,parameters:m.map(({label:x,const:y})=>({label:x,...y?{documentation:"Predefined parameter"}:void 0})),...m.length<d?{activeParameter:Math.min(f,m.length-1)}:void 0})),activeParameter:f}}async provideInlayHints(n){let e=[],t=await A(this,O,Ce).call(this,n);for(let r of t.querySelectorAll("template,magic-word#invoke").reverse()){let{type:i,childNodes:s}=r;e.push(...s.slice(i==="template"?1:3).filter(({anon:o})=>o).reverse().map(o=>({position:zr(t,o.getAbsoluteIndex()),label:`${o.name}=`,kind:2})))}return e}findStyleTokens(){return c(this,dr).querySelectorAll(Tl).filter(({lastChild:{length:n,firstChild:e}})=>n===1&&e.type==="text")}};Ee=new WeakMap,tt=new WeakMap,Ue=new WeakMap,ze=new WeakMap,dr=new WeakMap,Gr=new WeakMap,gr=new WeakMap,ur=new WeakMap,pr=new WeakMap,O=new WeakSet,Hr=function(){return c(this,gr)===v.config&&c(this,ur)===this.include},Ce=async function(n){var e;return n=St(n),!c(this,Ue)&&A(this,O,Hr).call(this)&&c(this,Ee)===n?c(this,dr):(b(this,Ee,n),(e=c(this,Ue))!=null||b(this,Ue,A(this,O,Ni).call(this)),c(this,Ue))},Ni=async function(){let n=v.getConfig();b(this,gr,v.config),b(this,ur,this.include);let e=c(this,Ee),t=await v.partialParse(e,()=>c(this,Ee),this.include,n);return A(this,O,Hr).call(this)&&c(this,Ee)===e?(b(this,dr,t),b(this,Ue,void 0),t):(b(this,Ue,A(this,O,Ni).call(this)),c(this,Ue))},na=async function(n){var e;return n=St(n),!c(this,ze)&&A(this,O,Hr).call(this)&&c(this,tt)===n?c(this,Gr):(b(this,tt,n),(e=c(this,ze))!=null||b(this,ze,A(this,O,Ei).call(this)),c(this,ze))},Ei=async function(){let n=v.getConfig();b(this,gr,v.config),b(this,ur,this.include);let e=c(this,tt),t=await v.partialParse(e,()=>c(this,tt),this.include,n);return A(this,O,Hr).call(this)&&c(this,tt)===e?(b(this,Gr,t),b(this,ze,void 0),t):(b(this,ze,A(this,O,Ei).call(this)),c(this,ze))},ia=function(){if(!c(this,pr)){let{nsid:n,ext:e,html:t,parserFunction:[r,i,...s],doubleUnderscore:o,protocol:l,img:u}=v.getConfig(),p=new Set([e,t].flat(2)),d=new RegExp("(?:"+String.raw`<(\/?\w*)`+"|"+String.raw`(\{{2,4}|\[\[)\s*([^|{}<>[\]\s][^|{}<>[\]#]*)?`+"|"+String.raw`(__(?:(?!__)[\p{L}\d_])*)`+"|"+String.raw`(?<!\[)\[([a-z:/]*)`+"|"+String.raw`\[\[\s*(?:${Object.entries(n).filter(([,g])=>g===6).map(([g])=>g).join("|")})\s*:[^[\]{}<>]+\|([^[\]{}<>|=]*)`+"|"+String.raw`<(\w+)(?:\s(?:[^<>{}|=\s]+(?:\s*=\s*(?:[^\s"']\S*|(["']).*?\8))?(?=\s))*)?\s(\w*)`+")$","iu");b(this,pr,{re:d,ext:e,tags:p,allTags:[...p,"onlyinclude","includeonly","noinclude"],functions:[Object.keys(r),Array.isArray(i)?i:Object.keys(i),s].flat(2),switches:o.slice(0,2).flat().map(g=>`__${g}__`),protocols:l.split("|"),params:Object.keys(u).filter(g=>g.endsWith("$1")||!g.includes("$1")).map(g=>g.replace(/\$1$/u,""))})}return c(this,pr)},Ur=function(n){return this.data.parserFunctions.find(({aliases:e})=>e.some(t=>t.replace(/^#/u,"")===n))}});var Tt,aa,yl,v,W=k(()=>{Wi();ye();Qi();Y();Tt={config:On,i18n:void 0,rules:Di,getConfig(){let{doubleUnderscore:a}=this.config;for(let n=0;n<2;n++)a.length>n+2&&a[n].length===0&&(a[n]=Object.keys(a[n+2]));return{...On,...this.config,excludes:[]}},msg(a,n=""){var e,t;return a&&((t=(e=this.i18n)==null?void 0:e[a])!=null?t:a).replace("$1",this.msg(n))},normalizeTitle(a,n=0,e,t=Tt.getConfig(),r=!1,i,s=!1,o=!1){let{Title:l}=(Xo(),J(Qo)),u;if(i)u=new l(a,n,t,r,s,o);else{let{Token:p}=(B(),J(_r));u=re.run(()=>{let d=new p(a,t);d.type="root",d.parseOnce(0,e).parseOnce();let g=new l(d.toString(),n,t,r,s,o);for(let f of["main","fragment"]){let h=g[f];if(h!=null&&h.includes("\0")){let m=d.buildFromStr(h,1);f==="main"?g.main=m:g.setFragment(m)}}return g})}return u},parse(a,n,e=11,t=Tt.getConfig()){if(a=St(a),typeof e!="number"){let s=Array.isArray(e)?e:[e];e=Math.max(...s.map(o=>Mi[o]||11))}let{Token:r}=(B(),J(_r));return re.run(()=>{let s=new r(a,t);return s.type="root",s.parse(e,n)})},async partialParse(a,n,e,t=Tt.getConfig()){let{Token:r}=(B(),J(_r)),i=typeof setImmediate=="function"?setImmediate:setTimeout,{running:s}=re;re.running=!0;let o=new r(St(a),t);o.type="root";let l=0;return await new Promise(u=>{let p=()=>{n()===a?(l++,i(d,0)):u()},d=()=>{l===12?(o.afterBuild(),u()):(o[l===11?"build":"parseOnce"](l,e),p())};i(d,0)}),re.running=s,o},createLanguageService(a){var n;{let e=(oa(),J(sa)),{LanguageService:t,tasks:r}=e;return(n=r.get(a))!=null?n:new t(a)}}},aa={},yl=new Set(["normalizeTitle","parse","createLanguageService"]);for(let a in Tt)yl.has(a)||(aa[a]={enumerable:!1});Object.defineProperties(Tt,aa);Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:Tt});v=Tt});W();})();
38
- //# sourceMappingURL=bundle.lsp.js.map
@@ -1 +0,0 @@
1
- export declare const commonHtmlAttrs: Set<string>, htmlAttrs: Record<string, Set<string>>, extAttrs: Record<string, Set<string>>, obsoleteAttrs: Record<string, Set<string>>;