From 76b83152e8b3a4c9ca3e7a78274634224e83f714 Mon Sep 17 00:00:00 2001 From: Bhsd <55071315+bhsd-harry@users.noreply.github.com> Date: Wed, 20 Nov 2024 21:55:46 +0800 Subject: [PATCH] chore: bump version to v1.13.5-b --- bundle/bundle.min.js | 45 +++++++++++++++++++++-------------------- extensions/base.ts | 2 +- extensions/dist/base.js | 2 +- 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/bundle/bundle.min.js b/bundle/bundle.min.js index 8e68a01a..df660c0a 100644 --- a/bundle/bundle.min.js +++ b/bundle/bundle.min.js @@ -1,37 +1,38 @@ -"use strict";(()=>{var zn=Object.create;var De=Object.defineProperty;var Wn=Object.getOwnPropertyDescriptor;var co=Object.getOwnPropertyNames;var ho=Object.getPrototypeOf,mo=Object.prototype.hasOwnProperty;var Un=(a,r)=>(r=Symbol[a])?r:Symbol.for("Symbol."+a),dt=a=>{throw TypeError(a)};var fo=(a,r,e)=>r in a?De(a,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[r]=e;var Gn=(a,r)=>De(a,"name",{value:r,configurable:!0});var b=(a,r)=>()=>(a&&(r=a(a=0)),r);var Dn=(a,r)=>()=>(r||a((r={exports:{}}).exports,r),r.exports),se=(a,r)=>{for(var e in r)De(a,e,{get:r[e],enumerable:!0})},Hn=(a,r,e,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of co(r))!mo.call(a,n)&&n!==e&&De(a,n,{get:()=>r[n],enumerable:!(t=Wn(r,n))||t.enumerable});return a};var xo=(a,r,e)=>(e=a!=null?zn(ho(a)):{},Hn(r||!a||!a.__esModule?De(e,"default",{value:a,enumerable:!0}):e,a)),Z=a=>Hn(De({},"__esModule",{value:!0}),a);var le=a=>{var r;return[,,,zn((r=a==null?void 0:a[Un("metadata")])!=null?r:null)]},Vn=["class","method","getter","setter","accessor","field","value","get","set"],Ot=a=>a!==void 0&&typeof a!="function"?dt("Function expected"):a,bo=(a,r,e,t,n)=>({kind:Vn[a],name:r,metadata:t,addInitializer:i=>e._?dt("Already initialized"):n.push(Ot(i||null))}),de=(a,r,e,t)=>{for(var n=0,i=a[r>>1],s=i&&i.length;n{var s,o,l,g,p,d=r&7,c=!!(r&8),h=!!(r&16),m=d>3?a.length+1:d?c?1:2:0,k=Vn[d+5],x=d>3&&(a[m-1]=[]),A=a[m]||(a[m]=[]),S=d&&(!h&&!c&&(n=n.prototype),d<5&&(d>3||!h)&&Wn(d<4?n:{get[e](){return u(this,i)},set[e](w){return v(this,i,w)}},e));d?h&&d<4&&Gn(i,(d>2?"set ":d>1?"get ":"")+e):Gn(n,e);for(var $=t.length-1;$>=0;$--)g=bo(d,e,l={},a[3],A),d&&(g.static=c,g.private=h,p=g.access={has:h?w=>To(n,w):w=>e in w},d^3&&(p.get=h?w=>(d^1?u:R)(w,n,d^4?i:S.get):w=>w[e]),d>2&&(p.set=h?(w,L)=>v(w,n,L,d^4?i:S.set):(w,L)=>w[e]=L)),o=(0,t[$])(d?d<4?h?i:S[k]:d>4?void 0:{get:S.get,set:S.set}:n,g),l._=1,d^4||o===void 0?Ot(o)&&(d>4?x.unshift(o):d?h?i=o:S[k]=o:n=o):typeof o!="object"||o===null?dt("Object expected"):(Ot(s=o.get)&&(S.get=s),Ot(s=o.set)&&(S.set=s),Ot(s=o.init)&&x.unshift(s));return d||(n[Un("metadata")]=a[3]),S&&De(n,e,S),h?d^4?i:S:n},X=(a,r,e)=>fo(a,typeof r!="symbol"?r+"":r,e),Qr=(a,r,e)=>r.has(a)||dt("Cannot "+e),To=(a,r)=>Object(r)!==r?dt('Cannot use the "in" operator on this value'):a.has(r),u=(a,r,e)=>(Qr(a,r,"read from private field"),e?e.call(a):r.get(a)),T=(a,r,e)=>r.has(a)?dt("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(a):r.set(a,e),v=(a,r,e,t)=>(Qr(a,r,"write to private field"),t?t.call(a,e):r.set(a,e),e),R=(a,r,e)=>(Qr(a,r,"access private method"),e);var dr=(a,r,e,t)=>({set _(n){v(a,r,n,e)},get _(){return u(a,r,t)}});var Zr,Xn,Qn=b(()=>{"use strict";Zr={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};Object.setPrototypeOf(Zr,null);Xn=["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"]});var ni=Dn((Na,ri)=>{"use strict";var Kr=Object.defineProperty,yo=Object.getOwnPropertyDescriptor,ko=Object.getOwnPropertyNames,vo=Object.prototype.hasOwnProperty,Ao=(a,r)=>{for(var e in r)Kr(a,e,{get:r[e],enumerable:!0})},wo=(a,r,e,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of ko(r))!vo.call(a,n)&&n!==e&&Kr(a,n,{get:()=>r[n],enumerable:!(t=yo(r,n))||t.enumerable});return a},So=a=>wo(Kr({},"__esModule",{value:!0}),a),Jn={};Ao(Jn,{CDN:()=>Kn,getObject:()=>Fo,loadScript:()=>Io,normalizeTitle:()=>Eo,parseVersion:()=>Po,rawurldecode:()=>ti,setObject:()=>Ro,splitColors:()=>Lo});ri.exports=So(Jn);var Kn="https://testingcf.jsdelivr.net",Yn=String.raw`#(?:[\da-f]{3,4}|(?:[\da-f]{2}){3,4})(?![\p{L}\d_])`,Be=String.raw`(?:\d*\.)?\d+%?`,Zn=String.raw`(?:\d*\.)?\d+(?:deg|grad|rad|turn)?`,ei=String.raw`rgba?\(\s*(?:${String.raw`${new Array(3).fill(Be).join(String.raw`\s+`)}(?:\s*\/\s*${Be})?`}|${String.raw`${new Array(3).fill(Be).join(String.raw`\s*,\s*`)}(?:\s*,\s*${Be})?`})\s*\)`,Co=String.raw`hsla?\(\s*(?:${String.raw`${Zn}\s+${Be}\s+${Be}(?:\s*\/\s*${Be})?`}|${String.raw`${Zn}${String.raw`\s*,\s*(?:\d*\.)?\d+%`.repeat(2)}(?:\s*,\s*${Be})?`})\s*\)`,$o=new RegExp(String.raw`(^|[^\p{L}\d_])(${Yn}|${ei}|${Co})`,"giu"),No=new RegExp(String.raw`(^|[^\p{L}\d_])(${Yn}|${ei})`,"giu"),Jr;typeof document=="object"&&(Jr=document.createElement("span"));var ti=a=>decodeURIComponent(a.replace(/%(?![\da-f]{2})/giu,"%25")),Eo=a=>{let r=ti(a);return/[<>[\]|{}]/u.test(r)?r:(Jr.innerHTML=r,Jr.textContent)},Lo=(a,r=!0)=>{let e=[],t=r?$o:No;t.lastIndex=0;let n=t.exec(a),i=0;for(;n;){let s=n.index+n[1].length;s>i&&e.push([a.slice(i,s),i,s,!1]),{lastIndex:i}=t,e.push([n[2],s,i,!0]),n=t.exec(a)}return a.length>i&&e.push([a.slice(i),i,a.length,!1]),e},Io=(a,r,e)=>new Promise(t=>{let n=`${Kn}/${a}`,i=window;for(let s of r.split("."))i=i==null?void 0:i[s];if(i)t();else if(e&&typeof define=="function"&&"amd"in define){let s=window.require;s.config({paths:{[r]:n}}),s([r],o=>{Object.assign(window,{[r]:o}),t()})}else{let s=document.createElement("script");s.src=n,s.onload=()=>{t()},document.head.append(s)}}),Fo=a=>JSON.parse(String(localStorage.getItem(a))),Ro=(a,r)=>{localStorage.setItem(a,JSON.stringify(r))},Po=a=>a.split(".",3).map(Number)});var pr,ii,Ae,we,He,si,te,oi,ge,Bo,Mt,ai,li,jo,qo,pt,Ne,J=b(()=>{"use strict";pr=xo(ni()),ii=String.raw`[^[\]<>"\0-\x1F\x7F\p{Zs}\uFFFD]`,Ae=String.raw`(?:\[[\da-f:.]+\]|${ii})`,we=String.raw`(?:${ii}|\0\d+[cn!~]\x7F)*`,He=(a,r)=>e=>e.replace(a,r),si=He(/[\0\x7F]|\r$/gmu,""),te=He(/\0\d+[cn]\x7F/gu,""),oi=He(/[\\{}()|.?*+^$[\]]/gu,String.raw`\$&`),ge=(a,r="")=>a.map(e=>typeof e=="string"?e:e.text()).join(r),Bo={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},Mt=He(/&(?:#(\d+|[Xx][\da-fA-F]+)|([lLgG][tT]|[lr]brac[ke]|nbsp|amp|AMP|quot|QUOT));/gu,(a,r,e)=>r?String.fromCodePoint(+((/^x/iu.test(r)?"0":"")+r)):Bo[e.toLowerCase()]),ai=He(/&#(\d+|x[\da-f]+);/giu,(a,r)=>String.fromCodePoint(+((/^x/iu.test(r)?"0":"")+r))),li=He(/\n/gu,String.raw`\n`),jo={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},qo=a=>He(a,r=>`&${jo[r]};`),pt=qo(/[&<>]/gu),Ne=(a,r={})=>{let{pre:e="",post:t="",sep:n=""}=r;return e+a.map(i=>i.print()).join(n)+t}});var di=Dn((La,_o)=>{_o.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","828":"Module"},nsid:{file:6,category:14},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","#regex":"regex","#related":"related","#cscore":"cscore"},["!","=","#FORMAL","#timef","#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 Yr,Se=b(()=>{"use strict";Yr=di()});var Ve,E,Q=b(()=>{"use strict";E=class{constructor(r,e){T(this,Ve);X(this,"token");X(this,"start");this.token=r,this.start=e}get top(){var r;return(r=u(this,Ve))!=null||v(this,Ve,this.getPosition()),u(this,Ve).top}get left(){var r;return(r=u(this,Ve))!=null||v(this,Ve,this.getPosition()),u(this,Ve).left}getPosition(){return this.token.getRootNode().posFromIndex(this.start)}};Ve=new WeakMap});var pi,C,N,_=b(()=>{"use strict";Q();F();pi=a=>(r,e,t,n,i="error")=>{let{start:s}=e,{top:o,left:l}=e instanceof E?e:new E(r,s),{offsetHeight:g,offsetWidth:p}=r,{startIndex:d,startLine:c,startCol:h}=a(r,s,o,l);return{rule:t,message:f.msg(n),severity:i,startIndex:d,endIndex:d+r.toString().length,startLine:c,endLine:c+g-1,startCol:h,endCol:g===1?h+p:p}},C=pi((a,r,e,t)=>{let n=a.getRelativeIndex(),{top:i,left:s}=a.parentNode.posFromIndex(n);return{startIndex:r+n,startLine:e+i,startCol:i?s:t+s}}),N=pi((a,r,e,t)=>({startIndex:r,startLine:e,startCol:t}))});var gr,gi=b(()=>{"use strict";gr=(a,r,e)=>({type:t,name:n})=>a.split(",").some(i=>{let[s,...o]=i.trim().split("#");return(!s||s===t)&&o.every(l=>l===n)})});var ui,ci,Gt,zt,en,gt,tn=b(()=>{"use strict";ui=a=>{let r=a.split(` -`),e=r.length;return{height:e,width:r[e-1].length}},ci=(a,r)=>r.childNodes.slice(0,a).reduce((e,t,n)=>e+t.toString().length+r.getGaps(n),0)+r.getAttribute("padding"),gt=class{constructor(){T(this,zt);X(this,"childNodes",[]);T(this,Gt)}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get parentNode(){return u(this,Gt)}get nextSibling(){var e;let r=(e=this.parentNode)==null?void 0:e.childNodes;return r&&r[r.indexOf(this)+1]}get previousSibling(){var e;let r=(e=this.parentNode)==null?void 0:e.childNodes;return r&&r[r.indexOf(this)-1]}get offsetHeight(){return R(this,zt,en).call(this).height}get offsetWidth(){return R(this,zt,en).call(this).width}getAttribute(r){return r==="padding"?0:this[r]}setAttribute(r,e){r==="parentNode"?v(this,Gt,e):this[r]=e}getRootNode(){let{parentNode:r}=this;for(;r!=null&&r.parentNode;)({parentNode:r}=r);return r!=null?r:this}posFromIndex(r){let e=String(this);if(r>=-e.length&&r<=e.length){let{height:t,width:n}=ui(e.slice(0,r));return{top:t-1,left:n}}}getGaps(r){return 0}getRelativeIndex(r){if(r===void 0){let{parentNode:e}=this;return e?ci(e.childNodes.indexOf(this),e):0}return ci(r,this)}getAbsoluteIndex(){let{parentNode:r}=this;return r?r.getAbsoluteIndex()+this.getRelativeIndex():0}seal(r,e){Object.defineProperty(this,r,{enumerable:!e&&!!this[r],configurable:!0})}is(r){return this.type===r}};Gt=new WeakMap,zt=new WeakSet,en=function(){return ui(String(this))}});var je,rn,nn,ur,hi=b(()=>{"use strict";J();be();gi();tn();ur=class extends gt{constructor(){super(...arguments);T(this,je)}get length(){return this.childNodes.length}text(e){return ge(this.childNodes,e)}normalize(){let e=[...this.childNodes],t=n=>{e.splice(n,1)};for(let n=e.length-1;n>=0;n--){let{type:i,data:s}=e[n];i!=="text"||this.getGaps(n-1)||s===""&&t(n)}this.setAttribute("childNodes",e)}removeAt(e){return sn(this,e,1)[0]}insertAt(e,t=this.length){return sn(this,t,0,[e]),e}closest(e){let t=gr(e,this),{parentNode:n}=this;for(;n;){if(t(n))return n;({parentNode:n}=n)}}querySelector(e){let t=gr(e,this);return R(this,je,rn).call(this,t)}querySelectorAll(e){let t=gr(e,this);return R(this,je,nn).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 n=this.childNodes[t],{data:i}=n;return n.replaceData(e),i}toString(e,t=""){return this.childNodes.map(n=>n.toString(e)).join(t)}lint(e=this.getAbsoluteIndex(),t){let n=[];for(let i=0,s=e+this.getAttribute("padding");i`}${Ne(this.childNodes,e)}${t===""?"":""}`:""}json(e,t=this.getAbsoluteIndex()){let n={...this,type:this.type,range:[t,t+this.toString().length],childNodes:[]};for(let i=0,s=t+this.getAttribute("padding");i{"use strict";J();F();tn();mi=String.raw`<\s*(?:/\s*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+`,Oo=new RegExp(String.raw`${mi}|https?[:/]/+`,"giu"),Mo=new RegExp(mi,"giu"),Go=new RegExp(String.raw`^https?://${Ae}${we}\.(?:gif|png|jpg|jpeg)$`,"iu"),zo={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},Wo={"<":"tag-like","[":"lonely-bracket","{":"lonely-bracket","]":"lonely-bracket","}":"lonely-bracket",h:"lonely-http"},Uo=["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"],Wt=class extends gt{constructor(e){super();T(this,cr);X(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"))?te(this.data):this.data}text(){return this.data}lint(e=this.getAbsoluteIndex(),t){var B,j,q;if(t===!1)return[];let{data:n,parentNode:i,nextSibling:s,previousSibling:o}=this;if(!i)throw new Error("An isolated text node cannot be linted!");let{type:l,name:g,parentNode:p}=i,d=!1;if(l==="attr-value"){let{type:D,name:H,tag:ne}=p;if(D!=="ext-attr")d=!0;else if(ne==="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"&&g==="link"||d?Mo:Oo),n.search(t)===-1)return[];t.lastIndex=0;let c=[],h=s==null?void 0:s.type,m=s==null?void 0:s.name,k=o==null?void 0:o.type,x=this.getRootNode(),{ext:A,html:S}=x.getAttribute("config"),{top:$,left:w}=x.posFromIndex(e),L=new Set(["onlyinclude","noinclude","includeonly",A,S,Uo].flat(2));for(let D=t.exec(n);D;D=t.exec(n)){let[,H,ne]=D,{0:ee,index:W}=D;if(ne&&ne!=="]"){let{length:ae}=ne;W+=ae,ee=ee.slice(ae)}let{0:I,length:xe}=ee;if(I==="<"&&!L.has(H.toLowerCase())||I==="["&&l==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(n.slice(W+1))||s!=null&&s.is("ext")&&m==="nowiki"&&((B=s.innerText)!=null&&B.includes("]"))))continue;if(I==="]"&&(W||xe>1))t.lastIndex--;else if(I==="h"&&W===0&&l==="ext-link-text"&&Go.test(n))continue;let ke=e+W,Pe=ke+xe,ie=x.toString(),ve=ie[Pe],lt=ie[ke-1],Hr=xe>1&&!(I==="<"&&!/[\s/>]/u.test(ve!=null?ve:"")||d&&(I==="["||I==="]"))||I==="{"&&(ve===I||lt==="-")||I==="}"&&(lt===I||ve==="-")||I==="["&&(ve===I||l==="ext-link-text"||h==="free-ext-link"&&!n.slice(W+1).trim())||I==="]"&&(lt===I||k==="free-ext-link"&&!n.slice(0,W).includes("]"))?"error":"warning",Vr=I==="{"||I==="[";if(Hr==="warning"&&(Vr||(I==="]"||I==="}"))){let ae=zo[I],Xr=Vr?n.slice(W+1):n.slice(0,W);if(I==="{"&&((j=ae.exec(Xr))==null?void 0:j[0])==="}"||I==="}"&&((q=ae.exec(Xr))==null?void 0:q[0])==="{")continue;if(!Xr.includes(I)){let Mn=Vr?"nextSibling":"previousSibling",Ue=this[Mn];for(;Ue&&(Ue.type!=="text"||!ae.test(Ue.data));)Ue=Ue[Mn];if(Ue&&ae.exec(Ue.data)[0]!==I)continue}}let lr=n.slice(0,W).split(` -`),qn=lr.length+$-1,_n=lr[lr.length-1],On=lr.length===1?w+_n.length:_n.length,_t={rule:Wo[I],message:f.msg('lonely "$1"',I==="h"?ee:I),severity:Hr,startIndex:ke,endIndex:Pe,startLine:qn,endLine:qn,startCol:On,endCol:On+xe};if(I==="<")_t.suggestions=[{desc:"escape",range:[ke,ke+1],text:"<"}];else if(I==="h"&&!(l==="ext-link-text"||l==="link-text")&&/[\p{L}\d_]/u.test(lt||""))_t.suggestions=[{desc:"whitespace",range:[ke,ke],text:" "}];else if(I==="["&&l==="ext-link-text"){let ae=i.getAbsoluteIndex()+i.toString().length;_t.suggestions=[{desc:"escape",range:[ae,ae+1],text:"]"}]}else if(I==="]"&&k==="free-ext-link"&&Hr==="error"){let ae=e-o.toString().length;_t.fix={range:[ae,ae],text:"["}}c.push(_t)}return c}replaceData(e){R(this,cr,fi).call(this,e)}print(){return pt(this.data)}};cr=new WeakSet,fi=function(e){this.setAttribute("data",e)}});var ue,Xe=b(()=>{"use strict";be();ue=(a=!0,r=!0)=>(e,t)=>{class n extends e{text(){return""}lint(s){return a?[]:super.lint(s)}}return hr(n,e),n}});var Ut,ce,ut=b(()=>{"use strict";P();ce=class extends y{constructor(e,t,n,i,s,o){super(e,i,s,o);T(this,Ut);v(this,Ut,n)}get type(){return u(this,Ut)}lint(e=this.getAbsoluteIndex()){return super.lint(e,!1)}};Ut=new WeakMap});var ct,G,Ee=b(()=>{"use strict";P();G=class extends y{constructor(e,t,n,i,s){super(e,n,i,s);T(this,ct);v(this,ct,t)}get type(){return u(this,ct)}set type(e){v(this,ct,e)}};ct=new WeakMap});var Do,Qe,Te,qe,Ce,Ht=b(()=>{"use strict";_();Se();Q();F();P();Ee();Do=a=>a==="redirect-target"||a==="link",Ce=class extends y{constructor(e,t,n=f.getConfig(),i=[],s="|"){super(void 0,n,i,{});T(this,Qe,!0);T(this,Te);T(this,qe);if(this.insertAt(new G(e,"link-target",n,i,{})),t!==void 0){let o=new y(t,n,i,{});o.type="link-text",o.setAttribute("stage",10),this.insertAt(o)}v(this,Te,s)}afterBuild(){v(this,qe,this.getTitle()),u(this,Te).includes("\0")&&v(this,Te,this.buildFromStr(u(this,Te),0)),this.setAttribute("name",u(this,qe).title),super.afterBuild()}setAttribute(e,t){e==="bracket"?v(this,Qe,t):e==="title"?v(this,qe,t):super.setAttribute(e,t)}toString(e){let t=super.toString(e,u(this,Te));return u(this,Qe)?`[[${t}]]`:t}text(){let e=super.text("|");return u(this,Qe)?`[[${e}]]`:e}getAttribute(e){return e==="title"?u(this,qe):e==="padding"?2:super.getAttribute(e)}getGaps(e){return e===0?u(this,Te).length:1}lint(e=this.getAbsoluteIndex(),t){let n=super.lint(e,t),{childNodes:[i,s],type:o}=this,{encoded:l,fragment:g}=u(this,qe),p=new E(this,e);if(i.childNodes.some(({type:d})=>d==="template")&&n.push(C(i,p,"unknown-page","template in an internal link target","warning")),l&&n.push(C(i,p,"url-encoding","unnecessary URL encoding in an internal link")),o==="link"||o==="category"){let d=s==null?void 0:s.childNodes.find(c=>c.type==="text"&&c.data.includes("|"));if(d){let c=C(s,p,"pipe-like",'additional "|" in the link text',"warning"),h=c.startIndex+d.getRelativeIndex();c.suggestions=[{desc:"escape",range:[h,h+d.data.length],text:d.data.replace(/\|/gu,"|")}],n.push(c)}}if(g!==void 0&&!Do(o)){let d=C(i,p,"no-ignored","useless fragment"),c=i.childNodes.find(h=>h.type==="text"&&h.data.includes("#"));c&&(d.fix={range:[d.startIndex+c.getRelativeIndex()+c.data.indexOf("#"),d.endIndex],text:""}),n.push(d)}return n}getTitle(e){return this.normalizeTitle(this.firstChild.toString(!0),0,e,!0,!0)}print(){return super.print(u(this,Qe)?{pre:"[[",post:"]]",sep:u(this,Te)}:{sep:u(this,Te)})}};Qe=new WeakMap,Te=new WeakMap,qe=new WeakMap});var re,_e=b(()=>{"use strict";P();re=class extends y{get innerText(){return this.firstChild.data}constructor(r="",e,t){super(r,e,t)}}});var bi,on,Ho,U,Oe=b(()=>{"use strict";Xe();_e();bi=[ue()];U=class extends(Ho=re){get type(){return"noinclude"}toString(r){return r?"":super.toString()}};on=le(Ho),U=pe(on,0,"NoincludeToken",bi,U),de(on,1,U)});var mr,Ti=b(()=>{"use strict";_();F();Ht();Oe();mr=class extends Ce{get type(){return"redirect-target"}constructor(r,e,t=f.getConfig(),n=[]){super(r,void 0,t,n),e!==void 0&&this.insertAt(new U(e,t,n))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,!0,!0)}lint(r=this.getAbsoluteIndex()){let e=super.lint(r,!1);if(this.length===2){let t=C(this.lastChild,{start:r},"no-ignored","useless link text");t.startIndex--,t.startCol--,t.fix={range:[t.startIndex,t.endIndex],text:""},e.push(t)}return e}}});var yi,Me,ht,an,Vo,Ze,ki=b(()=>{"use strict";Xe();F();P();ut();Ti();yi=[ue(!1,!1)];Ze=class extends(Vo=y){constructor(e,t,n,i,s,o=f.getConfig(),l=[]){super(void 0,o,l);T(this,Me);T(this,ht);v(this,Me,e),v(this,ht,s);let g=new RegExp(String.raw`^(?:${o.redirection.join("|")})\s*(?::\s*)?$`,"iu");this.append(new ce(t,g,"redirect-syntax",o,l,{}),new mr(n,i==null?void 0:i.slice(1),o,l))}get type(){return"redirect"}getAttribute(e){return e==="padding"?u(this,Me).length:super.getAttribute(e)}toString(e){return u(this,Me)+super.toString(e)+u(this,ht)}lint(e=this.getAbsoluteIndex()){return this.lastChild.lint(e+u(this,Me).length+this.firstChild.toString().length)}print(){return super.print({pre:u(this,Me),post:u(this,ht)})}};an=le(Vo),Me=new WeakMap,ht=new WeakMap,Ze=pe(an,0,"RedirectToken",yi,Ze),de(an,1,Ze)});var vi={};se(vi,{parseRedirect:()=>Xo});var Xo,Ai=b(()=>{"use strict";F();ki();Xo=(a,r,e)=>{var n;(n=r.regexRedirect)!=null||(r.regexRedirect=new RegExp(String.raw`^(\s*)((?:${r.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));let t=r.regexRedirect.exec(a);return t&&f.normalizeTitle(t[3],0,!1,r,!0,!0).valid?(a=`\0${e.length}o\x7F${a.slice(t[0].length)}`,new Ze(...t.slice(1),r,e),a):!1}});var fr,wi=b(()=>{"use strict";P();fr=class extends y{get type(){return"onlyinclude"}toString(r){return`${super.toString(r)}`}getAttribute(r){return r==="padding"?13:r==="plain"||super.getAttribute(r)}print(){return super.print({pre:'<onlyinclude>',post:'</onlyinclude>'})}}});var Ge,mt,ln=b(()=>{"use strict";P();mt=class extends y{constructor(e,t,n,i,s,o=[]){super(void 0,s);T(this,Ge);X(this,"closed");X(this,"selfClosing");this.setAttribute("name",e.toLowerCase()),v(this,Ge,[e,i||e]),this.closed=i!=="",this.selfClosing=i===void 0,this.append(t,n);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:n,lastChild:i}=this,[s,o]=u(this,Ge);return t?`<${s}${n.toString(e)}/>`:`<${s}${n.toString(e)}>${i.toString(e)}${this.closed?``:""}`}text(){let[e,t]=u(this,Ge);return this.selfClosing?`<${e}${this.firstChild.text()}/>`:`<${e}${super.text(">")}${this.closed?``:""}`}getAttribute(e){return e==="padding"?u(this,Ge)[0].length+1:super.getAttribute(e)}getGaps(){return 1}print(){let[e,t]=u(this,Ge);return super.print(this.selfClosing?{pre:`<${e}`,post:"/>"}:{pre:`<${e}`,sep:">",post:this.closed?`</${t}>`:""})}};Ge=new WeakMap});var Si,dn,Qo,Je,Ci=b(()=>{"use strict";_();Q();Xe();F();ln();Si=[ue(!1)];Je=class extends(Qo=mt){get type(){return"include"}constructor(r,e="",t,n,i,s){super(r,e,t!=null?t:"",t===void 0||n!=null?n:"",i,s)}toString(r){return r?"":super.toString()}lint(r=this.getAbsoluteIndex()){let e=[],{firstChild:t,closed:n,name:i}=this,s=new E(this,r);if(t.data.trim()){let o=C(t,s,"no-ignored","useless attribute","warning");o.suggestions=[{desc:"remove",range:[o.startIndex,o.endIndex],text:""}],e.push(o)}if(!n){let o=N(this,s,"unclosed-comment",f.msg("unclosed $1",`<${i}>`));o.suggestions=[{desc:"close",range:[o.endIndex,o.endIndex],text:``}],e.push(o)}return e}};dn=le(Qo),Je=pe(dn,0,"IncludeToken",Si,Je),de(dn,1,Je)});var V,$i,Ni,br,pn,Ei,ft,Li,Ii,Fi,xr,Ri,Pi,Bi,ji,qi=b(()=>{"use strict";V=new Set(["align"]),$i=new Set(["cite"]),Ni=new Set(["cite","datetime"]),br=new Set(["width"]),pn=new Set(["axis","align","bgcolor","height","width","valign"]),Ei=new Set([...pn,"abbr","headers","scope","rowspan","colspan"]),ft=new Set(["type"]),Li=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),Ii=new Set(["clear"]),Fi=new Set(["bgcolor","align","valign"]),xr=new Set,Ri=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"]),Pi={div:V,h1:V,h2:V,h3:V,h4:V,h5:V,h6:V,blockquote:$i,q:$i,p:V,br:Ii,pre:br,ins:Ni,del:Ni,ul:ft,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...Li,"border"]),caption:V,tr:Fi,td:Ei,th:Ei,img:new Set(["alt","src","width","height","srcset"]),font:new Set(["size","color","face"]),hr:br,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:ft,poem:V,categorytree:V,combooption:V},Bi={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:xr,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:xr,inputbox:xr,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:xr,poll:new Set(["id","show-results-before-voting"]),sm2:ft,flashmp3:ft,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"])},ji={table:Li,td:new Set([...pn,"scope"]),th:pn,br:Ii,caption:V,div:V,hr:br,h1:V,h2:V,h3:V,h4:V,h5:V,h6:V,li:ft,p:V,pre:br,tr:Fi,ul:ft}});var Zo,Vt,xt,Y,$e,bt,_i=b(()=>{"use strict";_();J();Se();qi();Q();F();P();Ee();Zo=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,bt=class extends y{constructor(e,t,n,i="",s,o=[],l=f.getConfig(),g=[]){let p=new G(n,"attr-key",l,g),d;if(n==="title"||t==="img"&&n==="alt")d=new y(s,l,g,{}),d.type="attr-value",d.setAttribute("stage",10);else if(t==="gallery"&&n==="caption"||t==="choose"&&(n==="before"||n==="after")){let c={...l,excludes:[...l.excludes,"heading","html","table","hr","list"]};d=new y(s,c,g,{}),d.type="attr-value",d.setAttribute("stage",1)}else d=new G(s,"attr-value",l,g,{});super(void 0,l,g);T(this,Vt);T(this,xt);T(this,Y);T(this,$e);v(this,Vt,e),this.append(p,d),v(this,Y,i),v(this,$e,[...o]),v(this,xt,t),this.setAttribute("name",te(n).trim().toLowerCase())}get type(){return u(this,Vt)}get tag(){return u(this,xt)}get balanced(){return!u(this,Y)||u(this,$e)[0]===u(this,$e)[1]}afterBuild(){u(this,Y).includes("\0")&&v(this,Y,this.buildFromStr(u(this,Y),0)),this.parentNode&&v(this,xt,this.parentNode.name),this.setAttribute("name",this.firstChild.toString(!0).trim().toLowerCase()),super.afterBuild()}toString(e){let[t="",n=""]=u(this,$e);return u(this,Y)?super.toString(e,u(this,Y)+t)+n:this.firstChild.toString(e)}text(){return u(this,Y)?`${super.text(`${u(this,Y).trim()}"`)}"`:this.firstChild.text()}getGaps(){var e,t;return u(this,Y)?u(this,Y).length+((t=(e=u(this,$e)[0])==null?void 0:e.length)!=null?t:0):0}lint(e=this.getAbsoluteIndex(),t){var k;let n=super.lint(e,t),{balanced:i,firstChild:s,lastChild:o,type:l,name:g,tag:p}=this,d=this.getValue(),c=new E(this,e);if(!i){let x=C(o,c,"unclosed-quote",f.msg("unclosed $1","quotes"),"warning");x.startIndex--,x.startCol--;let A={range:[x.endIndex,x.endIndex],text:u(this,$e)[0]};o.childNodes.some(({type:S,data:$})=>S==="text"&&/\s/u.test($))?x.suggestions=[{desc:"close",...A}]:x.fix=A,n.push(x)}let h=Bi[p],m=Pi[p];if(!(h!=null&&h.has(g))&&!(m!=null&&m.has(g))&&(l==="ext-attr"?h||m:!/\{\{[^{]+\}\}/u.test(g))&&(l==="ext-attr"&&!m||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(g)&&(p==="meta"||p==="link"||!Ri.has(g))))n.push(C(s,c,"illegal-attr","illegal attribute name"));else if((k=ji[p])!=null&&k.has(g))n.push(C(s,c,"obsolete-attr","obsolete attribute","warning"));else if(g==="style"&&typeof d=="string"&&Zo.test(d))n.push(C(o,c,"insecure-style","insecure style"));else if(g==="tabindex"&&typeof d=="string"&&d!=="0"){let x=C(o,c,"illegal-attr","nonzero tabindex");x.suggestions=[{desc:"remove",range:[e,x.endIndex],text:""},{desc:"0 tabindex",range:[x.startIndex,x.endIndex],text:"0"}],n.push(x)}return n}getValue(){return u(this,Y)?this.lastChild.text().trim():this.type==="ext-attr"||""}print(){let[e="",t=""]=u(this,$e);return u(this,Y)?super.print({sep:pt(u(this,Y))+e,post:t}):super.print()}};Vt=new WeakMap,xt=new WeakMap,Y=new WeakMap,$e=new WeakMap});var Oi,Jo,Xt,ze,Tr=b(()=>{"use strict";_();J();Q();F();P();Ee();_i();Oi=a=>a.slice(0,-1),Jo=a=>`${Oi(a)}-dirty`,ze=class extends y{constructor(e,t,n,i=f.getConfig(),s=[]){super(void 0,i,s,{});T(this,Xt);if(v(this,Xt,t),this.setAttribute("name",n),e){let o=/([^\s/](?:(?!\0\d+~\x7F)[^\s/=])*)(?:((?:\s(?:\s|\0\d+[cn]\x7F)*)?(?:=|\0\d+~\x7F)(?:\s|\0\d+[cn]\x7F)*)(?:(["'])(.*?)(\3|$)|(\S*)))?/gsu,l="",g=o.exec(e),p=0,d=()=>{l&&(super.insertAt(new G(l,Jo(t),i,s,{})),l="")};for(;g;){let{index:c,0:h,1:m,2:k,3:x,4:A,5:S,6:$}=g;if(l+=e.slice(p,c),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(te(m).trim())){let w=A!=null?A:$,L=[x,S],B=new bt(Oi(t),n,m,k,w,L,i,s);d(),super.insertAt(B)}else l+=h;({lastIndex:p}=o),g=o.exec(e)}l+=e.slice(p),d()}}get type(){return u(this,Xt)}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 bt&&(!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 n=super.lint(e,t),{parentNode:i,childNodes:s}=this,o=new Map,l=new Set,g=new E(this,e);if((i==null?void 0:i.type)==="html"&&i.closing&&this.text().trim()){let p=N(this,g,"no-ignored","attributes of a closing tag");p.fix={range:[e,p.endIndex],text:""},n.push(p)}for(let p of s)if(p instanceof bt){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 c=C(p,g,"no-ignored","containing invalid attribute",/[\p{L}\d]/u.test(d)?"error":"warning");c.suggestions=[{desc:"remove",range:[c.startIndex,c.endIndex],text:" "}],n.push(c)}}if(l.size>0)for(let p of l)n.push(...o.get(p).map(d=>C(d,g,"no-duplicate",f.msg("duplicated $1 attribute",p))));return n}print(){return this.toString()?`${this.childNodes.map(e=>e.print(e instanceof G?{class:e.toString().trim()&&"attr-dirty"}:void 0)).join("")}`:""}};Xt=new WeakMap});var yr,Mi=b(()=>{"use strict";Se();F();P();Oe();yr=class extends y{get type(){return"ext-inner"}constructor(r,e=f.getConfig(),t=[]){if(r){let n=//giu,i=/<\/nowiki>/giu,{length:s}=n.source,o=n.exec(r);o&&(i.lastIndex=o.index+s);let l=i.exec(r),g=0,p="";for(;o&&l;)new U(o[0],e,t),new U(l[0],e,t),p+=`${r.slice(g,o.index)}\0${t.length-1}n\x7F${r.slice(o.index+s,l.index)}\0${t.length}n\x7F`,g=l.index+s+1,n.lastIndex=g,o=n.exec(r),o&&(i.lastIndex=o.index+s),l=i.exec(r);r=p+r.slice(g)}super(r,e,t,{}),this.setAttribute("stage",10)}getAttribute(r){return r==="plain"||super.getAttribute(r)}lint(r=this.getAbsoluteIndex()){return super.lint(r,/<\s*\/\s*(pre)\b/giu)}}});var Tt,gn=b(()=>{"use strict";_();Q();Qt();F();P();Ee();Tt=class extends y{get type(){return"ext-inner"}constructor(r,e,t=f.getConfig(),n=[],i){if(super(void 0,t,n,{}),e){let s=G;this.append(...e.split(` +"use strict";(()=>{var zn=Object.create;var De=Object.defineProperty;var Wn=Object.getOwnPropertyDescriptor;var co=Object.getOwnPropertyNames;var ho=Object.getPrototypeOf,mo=Object.prototype.hasOwnProperty;var Un=(a,r)=>(r=Symbol[a])?r:Symbol.for("Symbol."+a),dt=a=>{throw TypeError(a)};var fo=(a,r,e)=>r in a?De(a,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[r]=e;var Gn=(a,r)=>De(a,"name",{value:r,configurable:!0});var b=(a,r)=>()=>(a&&(r=a(a=0)),r);var Dn=(a,r)=>()=>(r||a((r={exports:{}}).exports,r),r.exports),se=(a,r)=>{for(var e in r)De(a,e,{get:r[e],enumerable:!0})},Hn=(a,r,e,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of co(r))!mo.call(a,n)&&n!==e&&De(a,n,{get:()=>r[n],enumerable:!(t=Wn(r,n))||t.enumerable});return a};var xo=(a,r,e)=>(e=a!=null?zn(ho(a)):{},Hn(r||!a||!a.__esModule?De(e,"default",{value:a,enumerable:!0}):e,a)),Z=a=>Hn(De({},"__esModule",{value:!0}),a);var le=a=>{var r;return[,,,zn((r=a==null?void 0:a[Un("metadata")])!=null?r:null)]},Vn=["class","method","getter","setter","accessor","field","value","get","set"],Ot=a=>a!==void 0&&typeof a!="function"?dt("Function expected"):a,bo=(a,r,e,t,n)=>({kind:Vn[a],name:r,metadata:t,addInitializer:i=>e._?dt("Already initialized"):n.push(Ot(i||null))}),de=(a,r,e,t)=>{for(var n=0,i=a[r>>1],s=i&&i.length;n{var s,o,l,p,g,d=r&7,c=!!(r&8),h=!!(r&16),m=d>3?a.length+1:d?c?1:2:0,k=Vn[d+5],x=d>3&&(a[m-1]=[]),A=a[m]||(a[m]=[]),S=d&&(!h&&!c&&(n=n.prototype),d<5&&(d>3||!h)&&Wn(d<4?n:{get[e](){return u(this,i)},set[e](w){return v(this,i,w)}},e));d?h&&d<4&&Gn(i,(d>2?"set ":d>1?"get ":"")+e):Gn(n,e);for(var $=t.length-1;$>=0;$--)p=bo(d,e,l={},a[3],A),d&&(p.static=c,p.private=h,g=p.access={has:h?w=>To(n,w):w=>e in w},d^3&&(g.get=h?w=>(d^1?u:R)(w,n,d^4?i:S.get):w=>w[e]),d>2&&(g.set=h?(w,L)=>v(w,n,L,d^4?i:S.set):(w,L)=>w[e]=L)),o=(0,t[$])(d?d<4?h?i:S[k]:d>4?void 0:{get:S.get,set:S.set}:n,p),l._=1,d^4||o===void 0?Ot(o)&&(d>4?x.unshift(o):d?h?i=o:S[k]=o:n=o):typeof o!="object"||o===null?dt("Object expected"):(Ot(s=o.get)&&(S.get=s),Ot(s=o.set)&&(S.set=s),Ot(s=o.init)&&x.unshift(s));return d||(n[Un("metadata")]=a[3]),S&&De(n,e,S),h?d^4?i:S:n},X=(a,r,e)=>fo(a,typeof r!="symbol"?r+"":r,e),Qr=(a,r,e)=>r.has(a)||dt("Cannot "+e),To=(a,r)=>Object(r)!==r?dt('Cannot use the "in" operator on this value'):a.has(r),u=(a,r,e)=>(Qr(a,r,"read from private field"),e?e.call(a):r.get(a)),T=(a,r,e)=>r.has(a)?dt("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(a):r.set(a,e),v=(a,r,e,t)=>(Qr(a,r,"write to private field"),t?t.call(a,e):r.set(a,e),e),R=(a,r,e)=>(Qr(a,r,"access private method"),e);var dr=(a,r,e,t)=>({set _(n){v(a,r,n,e)},get _(){return u(a,r,t)}});var Zr,Xn,Qn=b(()=>{"use strict";Zr={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};Object.setPrototypeOf(Zr,null);Xn=["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"]});var ni=Dn((Ea,ri)=>{"use strict";var Kr=Object.defineProperty,yo=Object.getOwnPropertyDescriptor,ko=Object.getOwnPropertyNames,vo=Object.prototype.hasOwnProperty,Ao=(a,r)=>{for(var e in r)Kr(a,e,{get:r[e],enumerable:!0})},wo=(a,r,e,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of ko(r))!vo.call(a,n)&&n!==e&&Kr(a,n,{get:()=>r[n],enumerable:!(t=yo(r,n))||t.enumerable});return a},So=a=>wo(Kr({},"__esModule",{value:!0}),a),Jn={};Ao(Jn,{CDN:()=>Kn,getObject:()=>Ro,loadScript:()=>Fo,normalizeTitle:()=>Eo,numToHex:()=>Lo,parseVersion:()=>Bo,rawurldecode:()=>ti,setObject:()=>Po,splitColors:()=>Io});ri.exports=So(Jn);var Kn="https://testingcf.jsdelivr.net",Yn=String.raw`#(?:[\da-f]{3,4}|(?:[\da-f]{2}){3,4})(?![\p{L}\d_])`,Be=String.raw`(?:\d*\.)?\d+%?`,Zn=String.raw`(?:\d*\.)?\d+(?:deg|grad|rad|turn)?`,ei=String.raw`rgba?\(\s*(?:${String.raw`${new Array(3).fill(Be).join(String.raw`\s+`)}(?:\s*\/\s*${Be})?`}|${String.raw`${new Array(3).fill(Be).join(String.raw`\s*,\s*`)}(?:\s*,\s*${Be})?`})\s*\)`,Co=String.raw`hsla?\(\s*(?:${String.raw`${Zn}\s+${Be}\s+${Be}(?:\s*\/\s*${Be})?`}|${String.raw`${Zn}${String.raw`\s*,\s*(?:\d*\.)?\d+%`.repeat(2)}(?:\s*,\s*${Be})?`})\s*\)`,$o=new RegExp(String.raw`(^|[^\p{L}\d_])(${Yn}|${ei}|${Co})`,"giu"),No=new RegExp(String.raw`(^|[^\p{L}\d_])(${Yn}|${ei})`,"giu"),Jr;typeof document=="object"&&(Jr=document.createElement("span"));var ti=a=>decodeURIComponent(a.replace(/%(?![\da-f]{2})/giu,"%25")),Eo=a=>{let r=ti(a);return/[<>[\]|{}]/u.test(r)?r:(Jr.innerHTML=r,Jr.textContent)},Lo=a=>Math.round(a*255).toString(16).padStart(2,"0"),Io=(a,r=!0)=>{let e=[],t=r?$o:No;t.lastIndex=0;let n=t.exec(a),i=0;for(;n;){let s=n.index+n[1].length;s>i&&e.push([a.slice(i,s),i,s,!1]),{lastIndex:i}=t,e.push([n[2],s,i,!0]),n=t.exec(a)}return a.length>i&&e.push([a.slice(i),i,a.length,!1]),e},Fo=(a,r,e)=>new Promise(t=>{let n=`${Kn}/${a}`,i=window;for(let s of r.split("."))i=i==null?void 0:i[s];if(i)t();else if(e&&typeof define=="function"&&"amd"in define){let s=window.require;s.config({paths:{[r]:n}}),s([r],o=>{Object.assign(window,{[r]:o}),t()})}else{let s=document.createElement("script");s.src=n,s.onload=()=>{t()},document.head.append(s)}}),Ro=a=>JSON.parse(String(localStorage.getItem(a))),Po=(a,r)=>{localStorage.setItem(a,JSON.stringify(r))},Bo=a=>a.split(".",3).map(Number)});var gr,ii,Ae,we,He,si,te,oi,pe,jo,Mt,ai,li,qo,_o,gt,Ne,J=b(()=>{"use strict";gr=xo(ni()),ii=String.raw`[^[\]<>"\0-\x1F\x7F\p{Zs}\uFFFD]`,Ae=String.raw`(?:\[[\da-f:.]+\]|${ii})`,we=String.raw`(?:${ii}|\0\d+[cn!~]\x7F)*`,He=(a,r)=>e=>e.replace(a,r),si=He(/[\0\x7F]|\r$/gmu,""),te=He(/\0\d+[cn]\x7F/gu,""),oi=He(/[\\{}()|.?*+^$[\]]/gu,String.raw`\$&`),pe=(a,r="")=>a.map(e=>typeof e=="string"?e:e.text()).join(r),jo={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},Mt=He(/&(?:#(\d+|[Xx][\da-fA-F]+)|([lLgG][tT]|[lr]brac[ke]|nbsp|amp|AMP|quot|QUOT));/gu,(a,r,e)=>r?String.fromCodePoint(+((/^x/iu.test(r)?"0":"")+r)):jo[e.toLowerCase()]),ai=He(/&#(\d+|x[\da-f]+);/giu,(a,r)=>String.fromCodePoint(+((/^x/iu.test(r)?"0":"")+r))),li=He(/\n/gu,String.raw`\n`),qo={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},_o=a=>He(a,r=>`&${qo[r]};`),gt=_o(/[&<>]/gu),Ne=(a,r={})=>{let{pre:e="",post:t="",sep:n=""}=r;return e+a.map(i=>i.print()).join(n)+t}});var di=Dn((Ia,Oo)=>{Oo.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","828":"Module"},nsid:{file:6,category:14},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","#regex":"regex","#related":"related","#cscore":"cscore"},["!","=","#FORMAL","#timef","#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 Yr,Se=b(()=>{"use strict";Yr=di()});var Ve,E,Q=b(()=>{"use strict";E=class{constructor(r,e){T(this,Ve);X(this,"token");X(this,"start");this.token=r,this.start=e}get top(){var r;return(r=u(this,Ve))!=null||v(this,Ve,this.getPosition()),u(this,Ve).top}get left(){var r;return(r=u(this,Ve))!=null||v(this,Ve,this.getPosition()),u(this,Ve).left}getPosition(){return this.token.getRootNode().posFromIndex(this.start)}};Ve=new WeakMap});var gi,C,N,_=b(()=>{"use strict";Q();F();gi=a=>(r,e,t,n,i="error")=>{let{start:s}=e,{top:o,left:l}=e instanceof E?e:new E(r,s),{offsetHeight:p,offsetWidth:g}=r,{startIndex:d,startLine:c,startCol:h}=a(r,s,o,l);return{rule:t,message:f.msg(n),severity:i,startIndex:d,endIndex:d+r.toString().length,startLine:c,endLine:c+p-1,startCol:h,endCol:p===1?h+g:g}},C=gi((a,r,e,t)=>{let n=a.getRelativeIndex(),{top:i,left:s}=a.parentNode.posFromIndex(n);return{startIndex:r+n,startLine:e+i,startCol:i?s:t+s}}),N=gi((a,r,e,t)=>({startIndex:r,startLine:e,startCol:t}))});var pr,pi=b(()=>{"use strict";pr=(a,r,e)=>({type:t,name:n})=>a.split(",").some(i=>{let[s,...o]=i.trim().split("#");return(!s||s===t)&&o.every(l=>l===n)})});var ui,ci,Gt,zt,en,pt,tn=b(()=>{"use strict";ui=a=>{let r=a.split(` +`),e=r.length;return{height:e,width:r[e-1].length}},ci=(a,r)=>r.childNodes.slice(0,a).reduce((e,t,n)=>e+t.toString().length+r.getGaps(n),0)+r.getAttribute("padding"),pt=class{constructor(){T(this,zt);X(this,"childNodes",[]);T(this,Gt)}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get parentNode(){return u(this,Gt)}get nextSibling(){var e;let r=(e=this.parentNode)==null?void 0:e.childNodes;return r&&r[r.indexOf(this)+1]}get previousSibling(){var e;let r=(e=this.parentNode)==null?void 0:e.childNodes;return r&&r[r.indexOf(this)-1]}get offsetHeight(){return R(this,zt,en).call(this).height}get offsetWidth(){return R(this,zt,en).call(this).width}getAttribute(r){return r==="padding"?0:this[r]}setAttribute(r,e){r==="parentNode"?v(this,Gt,e):this[r]=e}getRootNode(){let{parentNode:r}=this;for(;r!=null&&r.parentNode;)({parentNode:r}=r);return r!=null?r:this}indexFromPos(r,e){let t=String(this).split(` +`);return r>=0&&e>=0&&r<=t.length-1&&e<=t[r].length?t.slice(0,r).reduce((n,i)=>n+i.length+1,0)+e:void 0}posFromIndex(r){let e=String(this);if(r>=-e.length&&r<=e.length){let{height:t,width:n}=ui(e.slice(0,r));return{top:t-1,left:n}}}getGaps(r){return 0}getRelativeIndex(r){if(r===void 0){let{parentNode:e}=this;return e?ci(e.childNodes.indexOf(this),e):0}return ci(r,this)}getAbsoluteIndex(){let{parentNode:r}=this;return r?r.getAbsoluteIndex()+this.getRelativeIndex():0}seal(r,e){Object.defineProperty(this,r,{enumerable:!e&&!!this[r],configurable:!0})}is(r){return this.type===r}};Gt=new WeakMap,zt=new WeakSet,en=function(){return ui(String(this))}});var je,rn,nn,ur,hi=b(()=>{"use strict";J();be();pi();tn();ur=class extends pt{constructor(){super(...arguments);T(this,je)}get length(){return this.childNodes.length}text(e){return pe(this.childNodes,e)}normalize(){let e=[...this.childNodes],t=n=>{e.splice(n,1)};for(let n=e.length-1;n>=0;n--){let{type:i,data:s}=e[n];i!=="text"||this.getGaps(n-1)||s===""&&t(n)}this.setAttribute("childNodes",e)}removeAt(e){return sn(this,e,1)[0]}insertAt(e,t=this.length){return sn(this,t,0,[e]),e}closest(e){let t=pr(e,this),{parentNode:n}=this;for(;n;){if(t(n))return n;({parentNode:n}=n)}}querySelector(e){let t=pr(e,this);return R(this,je,rn).call(this,t)}querySelectorAll(e){let t=pr(e,this);return R(this,je,nn).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 n=this.childNodes[t],{data:i}=n;return n.replaceData(e),i}toString(e,t=""){return this.childNodes.map(n=>n.toString(e)).join(t)}lint(e=this.getAbsoluteIndex(),t){let n=[];for(let i=0,s=e+this.getAttribute("padding");i`}${Ne(this.childNodes,e)}${t===""?"":""}`:""}json(e,t=this.getAbsoluteIndex()){let n={...this,type:this.type,range:[t,t+this.toString().length],childNodes:[]};for(let i=0,s=t+this.getAttribute("padding");i{"use strict";J();F();tn();mi=String.raw`<\s*(?:/\s*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+`,Mo=new RegExp(String.raw`${mi}|https?[:/]/+`,"giu"),Go=new RegExp(mi,"giu"),zo=new RegExp(String.raw`^https?://${Ae}${we}\.(?:gif|png|jpg|jpeg)$`,"iu"),Wo={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},Uo={"<":"tag-like","[":"lonely-bracket","{":"lonely-bracket","]":"lonely-bracket","}":"lonely-bracket",h:"lonely-http"},Do=["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"],Wt=class extends pt{constructor(e){super();T(this,cr);X(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"))?te(this.data):this.data}text(){return this.data}lint(e=this.getAbsoluteIndex(),t){var B,j,q;if(t===!1)return[];let{data:n,parentNode:i,nextSibling:s,previousSibling:o}=this;if(!i)throw new Error("An isolated text node cannot be linted!");let{type:l,name:p,parentNode:g}=i,d=!1;if(l==="attr-value"){let{type:D,name:H,tag:ne}=g;if(D!=="ext-attr")d=!0;else if(ne==="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"&&p==="link"||d?Go:Mo),n.search(t)===-1)return[];t.lastIndex=0;let c=[],h=s==null?void 0:s.type,m=s==null?void 0:s.name,k=o==null?void 0:o.type,x=this.getRootNode(),{ext:A,html:S}=x.getAttribute("config"),{top:$,left:w}=x.posFromIndex(e),L=new Set(["onlyinclude","noinclude","includeonly",A,S,Do].flat(2));for(let D=t.exec(n);D;D=t.exec(n)){let[,H,ne]=D,{0:ee,index:W}=D;if(ne&&ne!=="]"){let{length:ae}=ne;W+=ae,ee=ee.slice(ae)}let{0:I,length:xe}=ee;if(I==="<"&&!L.has(H.toLowerCase())||I==="["&&l==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(n.slice(W+1))||s!=null&&s.is("ext")&&m==="nowiki"&&((B=s.innerText)!=null&&B.includes("]"))))continue;if(I==="]"&&(W||xe>1))t.lastIndex--;else if(I==="h"&&W===0&&l==="ext-link-text"&&zo.test(n))continue;let ke=e+W,Pe=ke+xe,ie=x.toString(),ve=ie[Pe],lt=ie[ke-1],Hr=xe>1&&!(I==="<"&&!/[\s/>]/u.test(ve!=null?ve:"")||d&&(I==="["||I==="]"))||I==="{"&&(ve===I||lt==="-")||I==="}"&&(lt===I||ve==="-")||I==="["&&(ve===I||l==="ext-link-text"||h==="free-ext-link"&&!n.slice(W+1).trim())||I==="]"&&(lt===I||k==="free-ext-link"&&!n.slice(0,W).includes("]"))?"error":"warning",Vr=I==="{"||I==="[";if(Hr==="warning"&&(Vr||(I==="]"||I==="}"))){let ae=Wo[I],Xr=Vr?n.slice(W+1):n.slice(0,W);if(I==="{"&&((j=ae.exec(Xr))==null?void 0:j[0])==="}"||I==="}"&&((q=ae.exec(Xr))==null?void 0:q[0])==="{")continue;if(!Xr.includes(I)){let Mn=Vr?"nextSibling":"previousSibling",Ue=this[Mn];for(;Ue&&(Ue.type!=="text"||!ae.test(Ue.data));)Ue=Ue[Mn];if(Ue&&ae.exec(Ue.data)[0]!==I)continue}}let lr=n.slice(0,W).split(` +`),qn=lr.length+$-1,_n=lr[lr.length-1],On=lr.length===1?w+_n.length:_n.length,_t={rule:Uo[I],message:f.msg('lonely "$1"',I==="h"?ee:I),severity:Hr,startIndex:ke,endIndex:Pe,startLine:qn,endLine:qn,startCol:On,endCol:On+xe};if(I==="<")_t.suggestions=[{desc:"escape",range:[ke,ke+1],text:"<"}];else if(I==="h"&&!(l==="ext-link-text"||l==="link-text")&&/[\p{L}\d_]/u.test(lt||""))_t.suggestions=[{desc:"whitespace",range:[ke,ke],text:" "}];else if(I==="["&&l==="ext-link-text"){let ae=i.getAbsoluteIndex()+i.toString().length;_t.suggestions=[{desc:"escape",range:[ae,ae+1],text:"]"}]}else if(I==="]"&&k==="free-ext-link"&&Hr==="error"){let ae=e-o.toString().length;_t.fix={range:[ae,ae],text:"["}}c.push(_t)}return c}replaceData(e){R(this,cr,fi).call(this,e)}print(){return gt(this.data)}};cr=new WeakSet,fi=function(e){this.setAttribute("data",e)}});var ue,Xe=b(()=>{"use strict";be();ue=(a=!0,r=!0)=>(e,t)=>{class n extends e{text(){return""}lint(s){return a?[]:super.lint(s)}}return hr(n,e),n}});var Ut,ce,ut=b(()=>{"use strict";P();ce=class extends y{constructor(e,t,n,i,s,o){super(e,i,s,o);T(this,Ut);v(this,Ut,n)}get type(){return u(this,Ut)}lint(e=this.getAbsoluteIndex()){return super.lint(e,!1)}};Ut=new WeakMap});var ct,G,Ee=b(()=>{"use strict";P();G=class extends y{constructor(e,t,n,i,s){super(e,n,i,s);T(this,ct);v(this,ct,t)}get type(){return u(this,ct)}set type(e){v(this,ct,e)}};ct=new WeakMap});var Ho,Qe,Te,qe,Ce,Ht=b(()=>{"use strict";_();Se();Q();F();P();Ee();Ho=a=>a==="redirect-target"||a==="link",Ce=class extends y{constructor(e,t,n=f.getConfig(),i=[],s="|"){super(void 0,n,i,{});T(this,Qe,!0);T(this,Te);T(this,qe);if(this.insertAt(new G(e,"link-target",n,i,{})),t!==void 0){let o=new y(t,n,i,{});o.type="link-text",o.setAttribute("stage",10),this.insertAt(o)}v(this,Te,s)}afterBuild(){v(this,qe,this.getTitle()),u(this,Te).includes("\0")&&v(this,Te,this.buildFromStr(u(this,Te),0)),this.setAttribute("name",u(this,qe).title),super.afterBuild()}setAttribute(e,t){e==="bracket"?v(this,Qe,t):e==="title"?v(this,qe,t):super.setAttribute(e,t)}toString(e){let t=super.toString(e,u(this,Te));return u(this,Qe)?`[[${t}]]`:t}text(){let e=super.text("|");return u(this,Qe)?`[[${e}]]`:e}getAttribute(e){return e==="title"?u(this,qe):e==="padding"?2:super.getAttribute(e)}getGaps(e){return e===0?u(this,Te).length:1}lint(e=this.getAbsoluteIndex(),t){let n=super.lint(e,t),{childNodes:[i,s],type:o}=this,{encoded:l,fragment:p}=u(this,qe),g=new E(this,e);if(i.childNodes.some(({type:d})=>d==="template")&&n.push(C(i,g,"unknown-page","template in an internal link target","warning")),l&&n.push(C(i,g,"url-encoding","unnecessary URL encoding in an internal link")),o==="link"||o==="category"){let d=s==null?void 0:s.childNodes.find(c=>c.type==="text"&&c.data.includes("|"));if(d){let c=C(s,g,"pipe-like",'additional "|" in the link text',"warning"),h=c.startIndex+d.getRelativeIndex();c.suggestions=[{desc:"escape",range:[h,h+d.data.length],text:d.data.replace(/\|/gu,"|")}],n.push(c)}}if(p!==void 0&&!Ho(o)){let d=C(i,g,"no-ignored","useless fragment"),c=i.childNodes.find(h=>h.type==="text"&&h.data.includes("#"));c&&(d.fix={range:[d.startIndex+c.getRelativeIndex()+c.data.indexOf("#"),d.endIndex],text:""}),n.push(d)}return n}getTitle(e){return this.normalizeTitle(this.firstChild.toString(!0),0,e,!0,!0)}print(){return super.print(u(this,Qe)?{pre:"[[",post:"]]",sep:u(this,Te)}:{sep:u(this,Te)})}};Qe=new WeakMap,Te=new WeakMap,qe=new WeakMap});var re,_e=b(()=>{"use strict";P();re=class extends y{get innerText(){return this.firstChild.data}constructor(r="",e,t){super(r,e,t)}}});var bi,on,Vo,U,Oe=b(()=>{"use strict";Xe();_e();bi=[ue()];U=class extends(Vo=re){get type(){return"noinclude"}toString(r){return r?"":super.toString()}};on=le(Vo),U=ge(on,0,"NoincludeToken",bi,U),de(on,1,U)});var mr,Ti=b(()=>{"use strict";_();F();Ht();Oe();mr=class extends Ce{get type(){return"redirect-target"}constructor(r,e,t=f.getConfig(),n=[]){super(r,void 0,t,n),e!==void 0&&this.insertAt(new U(e,t,n))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,!0,!0)}lint(r=this.getAbsoluteIndex()){let e=super.lint(r,!1);if(this.length===2){let t=C(this.lastChild,{start:r},"no-ignored","useless link text");t.startIndex--,t.startCol--,t.fix={range:[t.startIndex,t.endIndex],text:""},e.push(t)}return e}}});var yi,Me,ht,an,Xo,Ze,ki=b(()=>{"use strict";Xe();F();P();ut();Ti();yi=[ue(!1,!1)];Ze=class extends(Xo=y){constructor(e,t,n,i,s,o=f.getConfig(),l=[]){super(void 0,o,l);T(this,Me);T(this,ht);v(this,Me,e),v(this,ht,s);let p=new RegExp(String.raw`^(?:${o.redirection.join("|")})\s*(?::\s*)?$`,"iu");this.append(new ce(t,p,"redirect-syntax",o,l,{}),new mr(n,i==null?void 0:i.slice(1),o,l))}get type(){return"redirect"}getAttribute(e){return e==="padding"?u(this,Me).length:super.getAttribute(e)}toString(e){return u(this,Me)+super.toString(e)+u(this,ht)}lint(e=this.getAbsoluteIndex()){return this.lastChild.lint(e+u(this,Me).length+this.firstChild.toString().length)}print(){return super.print({pre:u(this,Me),post:u(this,ht)})}};an=le(Xo),Me=new WeakMap,ht=new WeakMap,Ze=ge(an,0,"RedirectToken",yi,Ze),de(an,1,Ze)});var vi={};se(vi,{parseRedirect:()=>Qo});var Qo,Ai=b(()=>{"use strict";F();ki();Qo=(a,r,e)=>{var n;(n=r.regexRedirect)!=null||(r.regexRedirect=new RegExp(String.raw`^(\s*)((?:${r.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));let t=r.regexRedirect.exec(a);return t&&f.normalizeTitle(t[3],0,!1,r,!0,!0).valid?(a=`\0${e.length}o\x7F${a.slice(t[0].length)}`,new Ze(...t.slice(1),r,e),a):!1}});var fr,wi=b(()=>{"use strict";P();fr=class extends y{get type(){return"onlyinclude"}toString(r){return`${super.toString(r)}`}getAttribute(r){return r==="padding"?13:r==="plain"||super.getAttribute(r)}print(){return super.print({pre:'<onlyinclude>',post:'</onlyinclude>'})}}});var Ge,mt,ln=b(()=>{"use strict";P();mt=class extends y{constructor(e,t,n,i,s,o=[]){super(void 0,s);T(this,Ge);X(this,"closed");X(this,"selfClosing");this.setAttribute("name",e.toLowerCase()),v(this,Ge,[e,i||e]),this.closed=i!=="",this.selfClosing=i===void 0,this.append(t,n);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:n,lastChild:i}=this,[s,o]=u(this,Ge);return t?`<${s}${n.toString(e)}/>`:`<${s}${n.toString(e)}>${i.toString(e)}${this.closed?``:""}`}text(){let[e,t]=u(this,Ge);return this.selfClosing?`<${e}${this.firstChild.text()}/>`:`<${e}${super.text(">")}${this.closed?``:""}`}getAttribute(e){return e==="padding"?u(this,Ge)[0].length+1:super.getAttribute(e)}getGaps(){return 1}print(){let[e,t]=u(this,Ge);return super.print(this.selfClosing?{pre:`<${e}`,post:"/>"}:{pre:`<${e}`,sep:">",post:this.closed?`</${t}>`:""})}};Ge=new WeakMap});var Si,dn,Zo,Je,Ci=b(()=>{"use strict";_();Q();Xe();F();ln();Si=[ue(!1)];Je=class extends(Zo=mt){get type(){return"include"}constructor(r,e="",t,n,i,s){super(r,e,t!=null?t:"",t===void 0||n!=null?n:"",i,s)}toString(r){return r?"":super.toString()}lint(r=this.getAbsoluteIndex()){let e=[],{firstChild:t,closed:n,name:i}=this,s=new E(this,r);if(t.data.trim()){let o=C(t,s,"no-ignored","useless attribute","warning");o.suggestions=[{desc:"remove",range:[o.startIndex,o.endIndex],text:""}],e.push(o)}if(!n){let o=N(this,s,"unclosed-comment",f.msg("unclosed $1",`<${i}>`));o.suggestions=[{desc:"close",range:[o.endIndex,o.endIndex],text:``}],e.push(o)}return e}};dn=le(Zo),Je=ge(dn,0,"IncludeToken",Si,Je),de(dn,1,Je)});var V,$i,Ni,br,gn,Ei,ft,Li,Ii,Fi,xr,Ri,Pi,Bi,ji,qi=b(()=>{"use strict";V=new Set(["align"]),$i=new Set(["cite"]),Ni=new Set(["cite","datetime"]),br=new Set(["width"]),gn=new Set(["axis","align","bgcolor","height","width","valign"]),Ei=new Set([...gn,"abbr","headers","scope","rowspan","colspan"]),ft=new Set(["type"]),Li=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),Ii=new Set(["clear"]),Fi=new Set(["bgcolor","align","valign"]),xr=new Set,Ri=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"]),Pi={div:V,h1:V,h2:V,h3:V,h4:V,h5:V,h6:V,blockquote:$i,q:$i,p:V,br:Ii,pre:br,ins:Ni,del:Ni,ul:ft,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...Li,"border"]),caption:V,tr:Fi,td:Ei,th:Ei,img:new Set(["alt","src","width","height","srcset"]),font:new Set(["size","color","face"]),hr:br,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:ft,poem:V,categorytree:V,combooption:V},Bi={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:xr,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:xr,inputbox:xr,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:xr,poll:new Set(["id","show-results-before-voting"]),sm2:ft,flashmp3:ft,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"])},ji={table:Li,td:new Set([...gn,"scope"]),th:gn,br:Ii,caption:V,div:V,hr:br,h1:V,h2:V,h3:V,h4:V,h5:V,h6:V,li:ft,p:V,pre:br,tr:Fi,ul:ft}});var Jo,Vt,xt,Y,$e,bt,_i=b(()=>{"use strict";_();J();Se();qi();Q();F();P();Ee();Jo=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,bt=class extends y{constructor(e,t,n,i="",s,o=[],l=f.getConfig(),p=[]){let g=new G(n,"attr-key",l,p),d;if(n==="title"||t==="img"&&n==="alt")d=new y(s,l,p,{}),d.type="attr-value",d.setAttribute("stage",10);else if(t==="gallery"&&n==="caption"||t==="choose"&&(n==="before"||n==="after")){let c={...l,excludes:[...l.excludes,"heading","html","table","hr","list"]};d=new y(s,c,p,{}),d.type="attr-value",d.setAttribute("stage",1)}else d=new G(s,"attr-value",l,p,{});super(void 0,l,p);T(this,Vt);T(this,xt);T(this,Y);T(this,$e);v(this,Vt,e),this.append(g,d),v(this,Y,i),v(this,$e,[...o]),v(this,xt,t),this.setAttribute("name",te(n).trim().toLowerCase())}get type(){return u(this,Vt)}get tag(){return u(this,xt)}get balanced(){return!u(this,Y)||u(this,$e)[0]===u(this,$e)[1]}afterBuild(){u(this,Y).includes("\0")&&v(this,Y,this.buildFromStr(u(this,Y),0)),this.parentNode&&v(this,xt,this.parentNode.name),this.setAttribute("name",this.firstChild.toString(!0).trim().toLowerCase()),super.afterBuild()}toString(e){let[t="",n=""]=u(this,$e);return u(this,Y)?super.toString(e,u(this,Y)+t)+n:this.firstChild.toString(e)}text(){return u(this,Y)?`${super.text(`${u(this,Y).trim()}"`)}"`:this.firstChild.text()}getGaps(){var e,t;return u(this,Y)?u(this,Y).length+((t=(e=u(this,$e)[0])==null?void 0:e.length)!=null?t:0):0}lint(e=this.getAbsoluteIndex(),t){var k;let n=super.lint(e,t),{balanced:i,firstChild:s,lastChild:o,type:l,name:p,tag:g}=this,d=this.getValue(),c=new E(this,e);if(!i){let x=C(o,c,"unclosed-quote",f.msg("unclosed $1","quotes"),"warning");x.startIndex--,x.startCol--;let A={range:[x.endIndex,x.endIndex],text:u(this,$e)[0]};o.childNodes.some(({type:S,data:$})=>S==="text"&&/\s/u.test($))?x.suggestions=[{desc:"close",...A}]:x.fix=A,n.push(x)}let h=Bi[g],m=Pi[g];if(!(h!=null&&h.has(p))&&!(m!=null&&m.has(p))&&(l==="ext-attr"?h||m:!/\{\{[^{]+\}\}/u.test(p))&&(l==="ext-attr"&&!m||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(p)&&(g==="meta"||g==="link"||!Ri.has(p))))n.push(C(s,c,"illegal-attr","illegal attribute name"));else if((k=ji[g])!=null&&k.has(p))n.push(C(s,c,"obsolete-attr","obsolete attribute","warning"));else if(p==="style"&&typeof d=="string"&&Jo.test(d))n.push(C(o,c,"insecure-style","insecure style"));else if(p==="tabindex"&&typeof d=="string"&&d!=="0"){let x=C(o,c,"illegal-attr","nonzero tabindex");x.suggestions=[{desc:"remove",range:[e,x.endIndex],text:""},{desc:"0 tabindex",range:[x.startIndex,x.endIndex],text:"0"}],n.push(x)}return n}getValue(){return u(this,Y)?this.lastChild.text().trim():this.type==="ext-attr"||""}print(){let[e="",t=""]=u(this,$e);return u(this,Y)?super.print({sep:gt(u(this,Y))+e,post:t}):super.print()}};Vt=new WeakMap,xt=new WeakMap,Y=new WeakMap,$e=new WeakMap});var Oi,Ko,Xt,ze,Tr=b(()=>{"use strict";_();J();Q();F();P();Ee();_i();Oi=a=>a.slice(0,-1),Ko=a=>`${Oi(a)}-dirty`,ze=class extends y{constructor(e,t,n,i=f.getConfig(),s=[]){super(void 0,i,s,{});T(this,Xt);if(v(this,Xt,t),this.setAttribute("name",n),e){let o=/([^\s/](?:(?!\0\d+~\x7F)[^\s/=])*)(?:((?:\s(?:\s|\0\d+[cn]\x7F)*)?(?:=|\0\d+~\x7F)(?:\s|\0\d+[cn]\x7F)*)(?:(["'])(.*?)(\3|$)|(\S*)))?/gsu,l="",p=o.exec(e),g=0,d=()=>{l&&(super.insertAt(new G(l,Ko(t),i,s,{})),l="")};for(;p;){let{index:c,0:h,1:m,2:k,3:x,4:A,5:S,6:$}=p;if(l+=e.slice(g,c),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(te(m).trim())){let w=A!=null?A:$,L=[x,S],B=new bt(Oi(t),n,m,k,w,L,i,s);d(),super.insertAt(B)}else l+=h;({lastIndex:g}=o),p=o.exec(e)}l+=e.slice(g),d()}}get type(){return u(this,Xt)}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 bt&&(!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 n=super.lint(e,t),{parentNode:i,childNodes:s}=this,o=new Map,l=new Set,p=new E(this,e);if((i==null?void 0:i.type)==="html"&&i.closing&&this.text().trim()){let g=N(this,p,"no-ignored","attributes of a closing tag");g.fix={range:[e,g.endIndex],text:""},n.push(g)}for(let g of s)if(g instanceof bt){let{name:d}=g;o.has(d)?(l.add(d),o.get(d).push(g)):o.set(d,[g])}else{let d=g.text().trim();if(d){let c=C(g,p,"no-ignored","containing invalid attribute",/[\p{L}\d]/u.test(d)?"error":"warning");c.suggestions=[{desc:"remove",range:[c.startIndex,c.endIndex],text:" "}],n.push(c)}}if(l.size>0)for(let g of l)n.push(...o.get(g).map(d=>C(d,p,"no-duplicate",f.msg("duplicated $1 attribute",g))));return n}print(){return this.toString()?`${this.childNodes.map(e=>e.print(e instanceof G?{class:e.toString().trim()&&"attr-dirty"}:void 0)).join("")}`:""}};Xt=new WeakMap});var yr,Mi=b(()=>{"use strict";Se();F();P();Oe();yr=class extends y{get type(){return"ext-inner"}constructor(r,e=f.getConfig(),t=[]){if(r){let n=//giu,i=/<\/nowiki>/giu,{length:s}=n.source,o=n.exec(r);o&&(i.lastIndex=o.index+s);let l=i.exec(r),p=0,g="";for(;o&&l;)new U(o[0],e,t),new U(l[0],e,t),g+=`${r.slice(p,o.index)}\0${t.length-1}n\x7F${r.slice(o.index+s,l.index)}\0${t.length}n\x7F`,p=l.index+s+1,n.lastIndex=p,o=n.exec(r),o&&(i.lastIndex=o.index+s),l=i.exec(r);r=g+r.slice(p)}super(r,e,t,{}),this.setAttribute("stage",10)}getAttribute(r){return r==="plain"||super.getAttribute(r)}lint(r=this.getAbsoluteIndex()){return super.lint(r,/<\s*\/\s*(pre)\b/giu)}}});var Tt,pn=b(()=>{"use strict";_();Q();Qt();F();P();Ee();Tt=class extends y{get type(){return"ext-inner"}constructor(r,e,t=f.getConfig(),n=[],i){if(super(void 0,t,n,{}),e){let s=G;this.append(...e.split(` `).map(o=>i?o:Ke(o,t,n,r)).map(o=>new s(o,"param-line",t,n,{})))}n.splice(n.indexOf(this),1),n.push(this)}toString(r){return super.toString(r,` `)}text(){return super.text(` -`)}getGaps(){return 1}lint(r=this.getAbsoluteIndex()){let e=new E(this,r),t=f.msg("invalid parameter of <$1>",this.name),n=[];for(let i of this.childNodes){let s=i.childNodes.filter(({type:o})=>o!=="comment"&&o!=="include"&&o!=="noinclude");if(s.some(({type:o})=>o==="ext"))n.push(C(i,e,"no-ignored",t));else{let o=s.findIndex(({type:g})=>g!=="text"),l=s.slice(0,o>=0?o:void 0).map(String).join("");if(l&&!(o>=0?/^[a-z]+(?:\[\])?\s*(?:=|$)/iu:/^[a-z]+(?:\[\])?\s*=/iu).test(l)){let g=C(i,e,"no-ignored",t);g.suggestions=[{desc:"remove",range:[g.startIndex,g.endIndex],text:""}],n.push(g)}else n.push(...i.lint(r,!1))}r+=i.toString().length+1}return n}print(){return super.print({sep:` -`})}}});var Zt,yt,kr,kt,un=b(()=>{"use strict";_();be();Q();F();P();ut();kt=class extends y{constructor(e,t,n=f.getConfig(),i=[]){super(void 0,n,i);T(this,yt);T(this,Zt);v(this,Zt,e);let s=new y(t[0],n,i);s.type="heading-title",s.setAttribute("stage",2);let o=new ce(t[1],/^\s*$/u,"heading-trail",n,i,{});this.append(s,o)}get type(){return"heading"}get level(){return u(this,Zt)}toString(e){let t=u(this,yt,kr);return t+this.firstChild.toString(e)+t+this.lastChild.toString(e)}text(){let e=u(this,yt,kr);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 n=super.lint(e,t),{firstChild:i,level:s}=this,o=i.toString(),l=i.childNodes.filter(vt("quote")),g=l.filter(({bold:c})=>c),p=l.filter(({italic:c})=>c),d=new E(this,e);return this.level===1&&n.push(C(i,d,"h1","

")),(o.startsWith("=")||o.endsWith("="))&&n.push(C(i,d,"unbalanced-header",f.msg("unbalanced $1 in a section header",'"="'))),this.closest("html-attrs,table-attrs")&&n.push(N(this,d,"parsing-order","section header in a HTML tag")),g.length%2&&n.push(C(g[g.length-1],{...d,start:e+s,left:d.left+s},"format-leakage",f.msg("unbalanced $1 in a section header","bold apostrophes"))),p.length%2&&n.push(C(p[p.length-1],{start:e+s},"format-leakage",f.msg("unbalanced $1 in a section header","italic apostrophes"))),n}print(){let e=u(this,yt,kr);return super.print({pre:e,sep:e})}json(){let e=super.json();return e.level=this.level,e}};Zt=new WeakMap,yt=new WeakSet,kr=function(){return"=".repeat(this.level)}});var Ko,vr,Gi=b(()=>{"use strict";J();_();F();P();Ko=new RegExp(`https?://${Ae}${we}$`,"iu"),vr=class extends y{get type(){return"parameter"}get anon(){return this.firstChild.length===0}constructor(r,e,t=f.getConfig(),n=[]){super(void 0,t,n);let i=new y(typeof r=="number"?void 0:r,t,n,{}),s=new y(e,t,n);i.type="parameter-key",i.setAttribute("stage",2),s.type="parameter-value",s.setAttribute("stage",2),this.append(i,s)}trimName(r,e=!0){let t=(typeof r=="string"?r:r.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:r,firstChild:e}=this,t=this.trimName(e);r&&r.getArgs(t,!1,!1).add(this)}super.afterBuild()}toString(r){return this.anon?this.lastChild.toString(r):super.toString(r,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(r=this.getAbsoluteIndex(),e){var s;let t=super.lint(r,e),{firstChild:n}=this,i=(s=Ko.exec(n.text()))==null?void 0:s[0];if(i&&new URL(i).search){let o=C(n,{start:r},"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:"{{=}}"},t.push(o)}return t}print(){return super.print({sep:this.anon?"":"="})}json(){let r=super.json();return r.anon=this.anon,r}}});var Yo,Kt,Ye,et,tt,cn,zi,Jt,Wi=b(()=>{"use strict";J();_();be();Se();Q();F();P();Gi();Ee();ut();Yo=new Set(["pageid","articlepath","server","servername","scriptpath","stylepath"]),Jt=class extends y{constructor(e,t,n=f.getConfig(),i=[]){var m,k;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,n,i,{});T(this,tt);X(this,"modifier","");T(this,Kt,"template");T(this,Ye,!1);T(this,et,new Map);let{parserFunction:[l,g]}=n,p=(m=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(e))==null?void 0:m[0];if(p)this.setAttribute("modifier",p),e=e.slice(p.length);else if(e.includes(":")){let[x,...A]=e.split(":"),[S]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((k=A[0])!=null?k:"");this.setModifier(`${x}:${S}`)&&(e=A.join(":").slice(S.length))}let d=e.includes(":");if(d||t.length===0&&!u(this,Ye)){let[x,...A]=e.split(":"),S=te(x),$=S[A.length>0?"trimStart":"trim"](),w=$.toLowerCase(),L=Object.prototype.hasOwnProperty.call(l,w)&&l[w],B=g.includes($);if(B||Yo.has(L)||d&&L){this.setAttribute("name",L||w.replace(/^#/u,"")),v(this,Kt,"magic-word");let q=new RegExp(String.raw`^\s*${$}\s*$`,B?"u":"iu"),D=new ce(x,q,"magic-word-name",n,i,{});if(super.insertAt(D),A.length>0&&t.unshift([A.join(":")]),this.name==="invoke")for(let H=0;H<2;H++){let ne=t.shift();if(!ne)break;let ee=new G(ne.join("="),`invoke-${H?"function":"module"}`,n,i);super.insertAt(ee)}}}if(this.type==="template"){let x=te(e).trim();if(!this.normalizeTitle(x,10,!0).valid)throw i.pop(),new SyntaxError("Invalid template name");let A=new G(e,"template-name",n,i,{});super.insertAt(A)}typeof s=="number"&&(i[s]=void 0);let c=this.isTemplate(),h=1;for(let[x,A]of t.entries())!c&&!(this.name==="switch"&&x>0)&&(A[0]=A.join("="),A.length=1),A.length===1&&(A.unshift(h),h++),this.insertAt(new vr(...A,n,i));this.seal("modifier")}get type(){return u(this,Kt)}setModifier(e){let{parserFunction:[,,t,n]}=this.getAttribute("config"),i=te(e).trim();if(e&&!i.endsWith(":"))return!1;let s=i.slice(0,-1).toLowerCase(),o=t.includes(s),l=n.includes(s);return u(this,Ye)&&o||!u(this,Ye)&&(l||e==="")||(ye.running||this.length>1)&&(o||l||e==="")?(this.setAttribute("modifier",e),v(this,Ye,o),!!e):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0)),super.afterBuild(),this.isTemplate()&&this.type==="template"&&this.setAttribute("name",R(this,tt,cn).call(this).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:n,modifier:i,type:s,name:o}=this;return s==="magic-word"&&o==="vardefine"?"":`{{${i}${s==="magic-word"?n.text()+(t===1?"":":")+ge(e.slice(1),"|"):super.text("|")}}}`}getAttribute(e){switch(e){case"padding":return this.modifier.length+2;default:return super.getAttribute(e)}}getGaps(){return 1}lint(e=this.getAbsoluteIndex(),t){let n=super.lint(e,t);if(!this.isTemplate())return n;let{type:i,childNodes:s,length:o}=this,l=new E(this,e),g=i==="magic-word";if(g&&!R(this,tt,cn).call(this).valid)n.push(C(s[1],l,"invalid-invoke","illegal module name"));else{let d=s[g?1:0],c=d.childNodes.find(h=>h.type==="text"&&Mt(h.data).includes("#"));if(c){let h=C(d,l,"no-ignored","useless fragment");h.fix={range:[h.startIndex+c.getRelativeIndex()+c.data.indexOf("#"),h.endIndex],text:""},n.push(h)}}if(g&&o===2)return n.push(N(this,l,"invalid-invoke","missing module function")),n;let p=this.getDuplicatedArgs().filter(([,d])=>!d[0].querySelector("ext"));return p.length>0&&n.push(...p.flatMap(([,d])=>d).map(d=>C(d,l,"no-duplicate","duplicated parameter"))),n}insertAt(e,t=this.length){return super.insertAt(e,t),e.anon?R(this,tt,zi).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getAllArgs(){return this.childNodes.filter(vt("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:e})=>e)}getArgs(e,t,n=!0){let i=String(e).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),s;return u(this,et).has(i)?s=u(this,et).get(i):(s=new Set(this.getAllArgs().filter(({name:o})=>i===o)),u(this,et).set(i,s)),s}getDuplicatedArgs(){return[...u(this,et)].filter(([,{size:e}])=>e>1).map(([e,t])=>[e,[...t]])}getPossibleValues(){let{type:e,name:t,childNodes:n}=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=n.slice(i,i+2).map(({childNodes:[,o]})=>o);for(let o=0;op.text().trim());if(l===0)s.splice(o,1);else if(l>1||g.type!=="magic-word")o++;else try{let p=g.getPossibleValues();s.splice(o,1,...p),o+=p.length}catch(p){o++}}return s}print(){let{childNodes:e,length:t,firstChild:n,modifier:i,type:s}=this;return`{{${pt(i)}${s==="magic-word"?n.print()+(t===1?"":":")+Ne(e.slice(1),{sep:"|"}):Ne(e,{sep:"|"})}}}`}};Kt=new WeakMap,Ye=new WeakMap,et=new WeakMap,tt=new WeakSet,cn=function(){let e=this.type==="template",t=this.childNodes[e?0:1];return this.normalizeTitle(t.toString(!0),e?10:828)},zi=function(e){let t=this.getAnonArgs(),n=typeof e!="number";for(let i=n?t.indexOf(e):e-1;i{"use strict";Xe();P();Ui=[ue()];rt=class extends(ea=y){get type(){return"hidden"}};hn=le(ea),rt=pe(hn,0,"HiddenToken",Ui,rt),de(hn,1,rt)});var wr,Hi,Ar,Vi=b(()=>{"use strict";J();_();Q();F();P();Ee();Di();Ar=class extends y{constructor(e,t=f.getConfig(),n=[]){super(void 0,t,n,{});T(this,wr);for(let[i,s]of e.entries())if(i===0){let o=new G(s,"arg-name",t,n,{});super.insertAt(o)}else if(i>1){let o=new rt(s,t,n);super.insertAt(o)}else{let o=new y(s,t,n);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`{{{${ge(this.childNodes.slice(0,2),"|")}}}}`}getAttribute(e){return e==="padding"?3:super.getAttribute(e)}getGaps(){return 1}afterBuild(){R(this,wr,Hi).call(this),super.afterBuild()}lint(e=this.getAbsoluteIndex(),t){let{childNodes:[n,i,...s]}=this;if(!this.getAttribute("include")){let l=N(this,{start:e},"no-arg","unexpected template argument");return i&&(l.fix={range:[e,l.endIndex],text:i.text()}),[l]}let o=n.lint(e+3,t);if(i&&o.push(...i.lint(e+4+n.toString().length,t)),s.length>0){let l=new E(this,e);o.push(...s.map(g=>{let p=C(g,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:"|"})}};wr=new WeakSet,Hi=function(){this.setAttribute("name",this.firstChild.toString(!0).trim())}});var Xi={};se(Xi,{parseBraces:()=>Yt});var ta,mn,ra,Yt,Sr=b(()=>{"use strict";J();un();Wi();Vi();ta={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},mn=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),ra=/\{\{\s*([^\s\0<>[\]{}|_#&%:.]+)\s*\}\}(?!\})/gu,Yt=(a,r,e)=>{var c,h,m,k,x,A;let t=String.raw`${(c=r.excludes)!=null&&c.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,n=String.raw`|\{{2,}`,{parserFunction:[,,,i]}=r,s=[];a=a.replace(ra,(S,$)=>{var w;return new Jt(S.slice(2,-2),[],r,e),`\0${e.length-2}${(w=mn.get($.toLowerCase()))!=null?w:"t"}\x7F`});let o=a.lastIndexOf("}}")-a.length,l=o+a.length!==-1,g=new RegExp(t+(l?n:""),"gmu"),p=g.exec(a),d;for(;p||d!==void 0&&d<=a.length&&((m=(h=s[s.length-1])==null?void 0:h[0])!=null&&m.startsWith("="));){if(p!=null&&p[1]){let[,{length:W}]=p;p[0]=p[0].slice(W),p.index+=W}let{0:S,index:$}=p!=null?p:{0:` +`)}getGaps(){return 1}lint(r=this.getAbsoluteIndex()){let e=new E(this,r),t=f.msg("invalid parameter of <$1>",this.name),n=[];for(let i of this.childNodes){let s=i.childNodes.filter(({type:o})=>o!=="comment"&&o!=="include"&&o!=="noinclude");if(s.some(({type:o})=>o==="ext"))n.push(C(i,e,"no-ignored",t));else{let o=s.findIndex(({type:p})=>p!=="text"),l=s.slice(0,o>=0?o:void 0).map(String).join("");if(l&&!(o>=0?/^[a-z]+(?:\[\])?\s*(?:=|$)/iu:/^[a-z]+(?:\[\])?\s*=/iu).test(l)){let p=C(i,e,"no-ignored",t);p.suggestions=[{desc:"remove",range:[p.startIndex,p.endIndex],text:""}],n.push(p)}else n.push(...i.lint(r,!1))}r+=i.toString().length+1}return n}print(){return super.print({sep:` +`})}}});var Zt,yt,kr,kt,un=b(()=>{"use strict";_();be();Q();F();P();ut();kt=class extends y{constructor(e,t,n=f.getConfig(),i=[]){super(void 0,n,i);T(this,yt);T(this,Zt);v(this,Zt,e);let s=new y(t[0],n,i);s.type="heading-title",s.setAttribute("stage",2);let o=new ce(t[1],/^\s*$/u,"heading-trail",n,i,{});this.append(s,o)}get type(){return"heading"}get level(){return u(this,Zt)}toString(e){let t=u(this,yt,kr);return t+this.firstChild.toString(e)+t+this.lastChild.toString(e)}text(){let e=u(this,yt,kr);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 n=super.lint(e,t),{firstChild:i,level:s}=this,o=i.toString(),l=i.childNodes.filter(vt("quote")),p=l.filter(({bold:c})=>c),g=l.filter(({italic:c})=>c),d=new E(this,e);return this.level===1&&n.push(C(i,d,"h1","

")),(o.startsWith("=")||o.endsWith("="))&&n.push(C(i,d,"unbalanced-header",f.msg("unbalanced $1 in a section header",'"="'))),this.closest("html-attrs,table-attrs")&&n.push(N(this,d,"parsing-order","section header in a HTML tag")),p.length%2&&n.push(C(p[p.length-1],{...d,start:e+s,left:d.left+s},"format-leakage",f.msg("unbalanced $1 in a section header","bold apostrophes"))),g.length%2&&n.push(C(g[g.length-1],{start:e+s},"format-leakage",f.msg("unbalanced $1 in a section header","italic apostrophes"))),n}print(){let e=u(this,yt,kr);return super.print({pre:e,sep:e})}json(){let e=super.json();return e.level=this.level,e}};Zt=new WeakMap,yt=new WeakSet,kr=function(){return"=".repeat(this.level)}});var Yo,vr,Gi=b(()=>{"use strict";J();_();F();P();Yo=new RegExp(`https?://${Ae}${we}$`,"iu"),vr=class extends y{get type(){return"parameter"}get anon(){return this.firstChild.length===0}constructor(r,e,t=f.getConfig(),n=[]){super(void 0,t,n);let i=new y(typeof r=="number"?void 0:r,t,n,{}),s=new y(e,t,n);i.type="parameter-key",i.setAttribute("stage",2),s.type="parameter-value",s.setAttribute("stage",2),this.append(i,s)}trimName(r,e=!0){let t=(typeof r=="string"?r:r.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:r,firstChild:e}=this,t=this.trimName(e);r&&r.getArgs(t,!1,!1).add(this)}super.afterBuild()}toString(r){return this.anon?this.lastChild.toString(r):super.toString(r,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(r=this.getAbsoluteIndex(),e){var s;let t=super.lint(r,e),{firstChild:n}=this,i=(s=Yo.exec(n.text()))==null?void 0:s[0];if(i&&new URL(i).search){let o=C(n,{start:r},"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:"{{=}}"},t.push(o)}return t}print(){return super.print({sep:this.anon?"":"="})}json(){let r=super.json();return r.anon=this.anon,r}}});var ea,Kt,Ye,et,tt,cn,zi,Jt,Wi=b(()=>{"use strict";J();_();be();Se();Q();F();P();Gi();Ee();ut();ea=new Set(["pageid","articlepath","server","servername","scriptpath","stylepath"]),Jt=class extends y{constructor(e,t,n=f.getConfig(),i=[]){var m,k;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,n,i,{});T(this,tt);X(this,"modifier","");T(this,Kt,"template");T(this,Ye,!1);T(this,et,new Map);let{parserFunction:[l,p]}=n,g=(m=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(e))==null?void 0:m[0];if(g)this.setAttribute("modifier",g),e=e.slice(g.length);else if(e.includes(":")){let[x,...A]=e.split(":"),[S]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((k=A[0])!=null?k:"");this.setModifier(`${x}:${S}`)&&(e=A.join(":").slice(S.length))}let d=e.includes(":");if(d||t.length===0&&!u(this,Ye)){let[x,...A]=e.split(":"),S=te(x),$=S[A.length>0?"trimStart":"trim"](),w=$.toLowerCase(),L=Object.prototype.hasOwnProperty.call(l,w)&&l[w],B=p.includes($);if(B||ea.has(L)||d&&L){this.setAttribute("name",L||w.replace(/^#/u,"")),v(this,Kt,"magic-word");let q=new RegExp(String.raw`^\s*${$}\s*$`,B?"u":"iu"),D=new ce(x,q,"magic-word-name",n,i,{});if(super.insertAt(D),A.length>0&&t.unshift([A.join(":")]),this.name==="invoke")for(let H=0;H<2;H++){let ne=t.shift();if(!ne)break;let ee=new G(ne.join("="),`invoke-${H?"function":"module"}`,n,i);super.insertAt(ee)}}}if(this.type==="template"){let x=te(e).trim();if(!this.normalizeTitle(x,10,!0).valid)throw i.pop(),new SyntaxError("Invalid template name");let A=new G(e,"template-name",n,i,{});super.insertAt(A)}typeof s=="number"&&(i[s]=void 0);let c=this.isTemplate(),h=1;for(let[x,A]of t.entries())!c&&!(this.name==="switch"&&x>0)&&(A[0]=A.join("="),A.length=1),A.length===1&&(A.unshift(h),h++),this.insertAt(new vr(...A,n,i));this.seal("modifier")}get type(){return u(this,Kt)}setModifier(e){let{parserFunction:[,,t,n]}=this.getAttribute("config"),i=te(e).trim();if(e&&!i.endsWith(":"))return!1;let s=i.slice(0,-1).toLowerCase(),o=t.includes(s),l=n.includes(s);return u(this,Ye)&&o||!u(this,Ye)&&(l||e==="")||(ye.running||this.length>1)&&(o||l||e==="")?(this.setAttribute("modifier",e),v(this,Ye,o),!!e):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0)),super.afterBuild(),this.isTemplate()&&this.type==="template"&&this.setAttribute("name",R(this,tt,cn).call(this).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:n,modifier:i,type:s,name:o}=this;return s==="magic-word"&&o==="vardefine"?"":`{{${i}${s==="magic-word"?n.text()+(t===1?"":":")+pe(e.slice(1),"|"):super.text("|")}}}`}getAttribute(e){switch(e){case"padding":return this.modifier.length+2;default:return super.getAttribute(e)}}getGaps(){return 1}lint(e=this.getAbsoluteIndex(),t){let n=super.lint(e,t);if(!this.isTemplate())return n;let{type:i,childNodes:s,length:o}=this,l=new E(this,e),p=i==="magic-word";if(p&&!R(this,tt,cn).call(this).valid)n.push(C(s[1],l,"invalid-invoke","illegal module name"));else{let d=s[p?1:0],c=d.childNodes.find(h=>h.type==="text"&&Mt(h.data).includes("#"));if(c){let h=C(d,l,"no-ignored","useless fragment");h.fix={range:[h.startIndex+c.getRelativeIndex()+c.data.indexOf("#"),h.endIndex],text:""},n.push(h)}}if(p&&o===2)return n.push(N(this,l,"invalid-invoke","missing module function")),n;let g=this.getDuplicatedArgs().filter(([,d])=>!d[0].querySelector("ext"));return g.length>0&&n.push(...g.flatMap(([,d])=>d).map(d=>C(d,l,"no-duplicate","duplicated parameter"))),n}insertAt(e,t=this.length){return super.insertAt(e,t),e.anon?R(this,tt,zi).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getAllArgs(){return this.childNodes.filter(vt("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:e})=>e)}getArgs(e,t,n=!0){let i=String(e).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),s;return u(this,et).has(i)?s=u(this,et).get(i):(s=new Set(this.getAllArgs().filter(({name:o})=>i===o)),u(this,et).set(i,s)),s}getDuplicatedArgs(){return[...u(this,et)].filter(([,{size:e}])=>e>1).map(([e,t])=>[e,[...t]])}getPossibleValues(){let{type:e,name:t,childNodes:n}=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=n.slice(i,i+2).map(({childNodes:[,o]})=>o);for(let o=0;og.text().trim());if(l===0)s.splice(o,1);else if(l>1||p.type!=="magic-word")o++;else try{let g=p.getPossibleValues();s.splice(o,1,...g),o+=g.length}catch(g){o++}}return s}print(){let{childNodes:e,length:t,firstChild:n,modifier:i,type:s}=this;return`{{${gt(i)}${s==="magic-word"?n.print()+(t===1?"":":")+Ne(e.slice(1),{sep:"|"}):Ne(e,{sep:"|"})}}}`}};Kt=new WeakMap,Ye=new WeakMap,et=new WeakMap,tt=new WeakSet,cn=function(){let e=this.type==="template",t=this.childNodes[e?0:1];return this.normalizeTitle(t.toString(!0),e?10:828)},zi=function(e){let t=this.getAnonArgs(),n=typeof e!="number";for(let i=n?t.indexOf(e):e-1;i{"use strict";Xe();P();Ui=[ue()];rt=class extends(ta=y){get type(){return"hidden"}};hn=le(ta),rt=ge(hn,0,"HiddenToken",Ui,rt),de(hn,1,rt)});var wr,Hi,Ar,Vi=b(()=>{"use strict";J();_();Q();F();P();Ee();Di();Ar=class extends y{constructor(e,t=f.getConfig(),n=[]){super(void 0,t,n,{});T(this,wr);for(let[i,s]of e.entries())if(i===0){let o=new G(s,"arg-name",t,n,{});super.insertAt(o)}else if(i>1){let o=new rt(s,t,n);super.insertAt(o)}else{let o=new y(s,t,n);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`{{{${pe(this.childNodes.slice(0,2),"|")}}}}`}getAttribute(e){return e==="padding"?3:super.getAttribute(e)}getGaps(){return 1}afterBuild(){R(this,wr,Hi).call(this),super.afterBuild()}lint(e=this.getAbsoluteIndex(),t){let{childNodes:[n,i,...s]}=this;if(!this.getAttribute("include")){let l=N(this,{start:e},"no-arg","unexpected template argument");return i&&(l.fix={range:[e,l.endIndex],text:i.text()}),[l]}let o=n.lint(e+3,t);if(i&&o.push(...i.lint(e+4+n.toString().length,t)),s.length>0){let l=new E(this,e);o.push(...s.map(p=>{let g=C(p,l,"no-ignored","invisible content inside triple braces");return g.startIndex--,g.startCol--,g.suggestions=[{desc:"remove",range:[g.startIndex,g.endIndex],text:""},{desc:"escape",range:[g.startIndex,g.startIndex+1],text:"{{!}}"}],g}))}return o}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}};wr=new WeakSet,Hi=function(){this.setAttribute("name",this.firstChild.toString(!0).trim())}});var Xi={};se(Xi,{parseBraces:()=>Yt});var ra,mn,na,Yt,Sr=b(()=>{"use strict";J();un();Wi();Vi();ra={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},mn=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),na=/\{\{\s*([^\s\0<>[\]{}|_#&%:.]+)\s*\}\}(?!\})/gu,Yt=(a,r,e)=>{var c,h,m,k,x,A;let t=String.raw`${(c=r.excludes)!=null&&c.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,n=String.raw`|\{{2,}`,{parserFunction:[,,,i]}=r,s=[];a=a.replace(na,(S,$)=>{var w;return new Jt(S.slice(2,-2),[],r,e),`\0${e.length-2}${(w=mn.get($.toLowerCase()))!=null?w:"t"}\x7F`});let o=a.lastIndexOf("}}")-a.length,l=o+a.length!==-1,p=new RegExp(t+(l?n:""),"gmu"),g=p.exec(a),d;for(;g||d!==void 0&&d<=a.length&&((m=(h=s[s.length-1])==null?void 0:h[0])!=null&&m.startsWith("="));){if(g!=null&&g[1]){let[,{length:W}]=g;g[0]=g[0].slice(W),g.index+=W}let{0:S,index:$}=g!=null?g:{0:` `,index:a.length},w=(k=s.pop())!=null?k:{},{0:L,index:B,parts:j,findEqual:q,pos:D}=w,H=S==="="&&q,ne=W=>{j[j.length-1].push(W.slice(D,$))};if(S==="]]"||S==="}-")d=$+2;else if(S===` -`){d=$+1;let{pos:W,findEqual:I}=(x=s[s.length-1])!=null?x:{};if(W===void 0||I||te(a.slice(W,B))!==""){let xe=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(a.slice(B,$));xe&&(a=`${a.slice(0,B)}\0${e.length}h\x7F${a.slice($)}`,d=B+4+String(e.length).length,new kt(xe[1].length,xe.slice(2),r,e))}}else if(S==="|"||H)d=$+1,ne(a),S==="|"&&j.push([]),w.pos=d,w.findEqual=S==="|",s.push(w);else if(S.startsWith("}}")){let W=S.slice(0,Math.min(L.length,3)),I=L.length-W.length,{length:xe}=e;d=$+W.length,ne(a);let ke=!1,Pe="t";if(W.length===3){let ie=j.map(lt=>lt.join("=")),ve=ie.length>1&&te(ie[1]).trim();new Ar(ie,r,e),ve&&ve.endsWith(":")&&i.includes(ve.slice(0,-1).toLowerCase())&&(Pe="s")}else try{new Jt(j[0][0],j.slice(1),r,e);let ie=te(j[0][0]).trim();mn.has(ie.toLowerCase())?Pe=mn.get(ie.toLowerCase()):/^(?:filepath|(?:full|canonical)urle?):./iu.test(ie)?Pe="m":/^#vardefine:./iu.test(ie)&&(Pe="n")}catch(ie){if(ie instanceof SyntaxError&&ie.message==="Invalid template name")ke=!0;else throw ie}ke||(a=`${a.slice(0,B+I)}\0${xe}${Pe}\x7F${a.slice(d)}`,d=B+I+3+String(xe).length,I>1?s.push({0:L.slice(0,I),index:B,pos:B+I,parts:[[]]}):I===1&&a[B-1]==="-"&&s.push({0:"-{",index:B-1,pos:B+1,parts:[[]]}))}else d=$+S.length,S.startsWith("{")&&(p.pos=d,p.parts=[[]]),s.push(..."0"in w?[w]:[],p);let ee=s[s.length-1];if(l&&o+a.length{"use strict";Qt();Sr();F();gn();Cr=class extends Tt{constructor(r,e,t=f.getConfig(),n=[]){let i=Symbol("InputboxToken"),{length:s}=n;n.push(i),e&&(e=Ke(e,t,n,r)),e&&(e=Yt(e,t,n)),n.splice(s,1),super(r,e,t,n,{})}}});function Zi(a,r,e,t,n){r=r.trim();let i=r.replace(a==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(a){case"width":return!i&&!!r||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(i);case"link":{if(!i)return r;let s=new RegExp(String.raw`^(?:${e.protocol}|//|\0\d+m\x7F)`,"iu"),o=new RegExp(String.raw`^(?:(?:${e.protocol}|//)${Ae}|\0\d+m\x7F)${we}$`,"iu");if(s.test(i))return o.test(i)&&r;i.startsWith("[[")&&i.endsWith("]]")&&(i=i.slice(2,-2));let l=f.normalizeTitle(i,0,!1,e,t,!0,!0);return l.valid&&l}case"lang":return(n==="svg"||n==="svgz")&&!/[^a-z\d-]/u.test(i);case"alt":case"class":case"manualthumb":return!0;case"page":return(n==="djvu"||n==="djv"||n==="pdf")&&Number(i)>0;default:return!!i&&!isNaN(i)}}var na,oe,Nr,Ji,$r,Ki=b(()=>{"use strict";J();_();F();P();na=new Set(["alt","link","lang","page","caption"]);$r=class extends y{constructor(e,t,n=f.getConfig(),i){var r=(...kp)=>(super(...kp),T(this,Nr),T(this,oe,""),this);var g;let s,o=Object.entries(n.img).map(([p,d])=>[p,d,new RegExp(String.raw`^(\s*(?!\s))${p.replace("$1","(.*)")}${p.endsWith("$1")?`(?=$| -)`:""}(\s*)$`,"u")]),l=o.find(([,p,d])=>(s=d.exec(e),s&&(s.length!==4||Zi(p,s[2],n,!0,t)!==!1)));if(l&&s){s.length===3?(r(void 0,n,i),v(this,oe,e)):(r(s[2],n,i,{}),v(this,oe,s[1]+l[0]+s[3])),this.setAttribute("name",l[1]);return}r(e,{...n,excludes:[...(g=n.excludes)!=null?g:[],"list"]},i),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get type(){return"image-parameter"}get link(){return this.name==="link"?Zi("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var e;((e=this.parentNode)==null?void 0:e.type)==="gallery-image"&&!na.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(e){return u(this,oe)?u(this,oe).replace("$1",super.toString(e)):super.toString(e)}text(){return u(this,oe)?u(this,oe).replace("$1",super.text()).trim():super.text().trim()}getAttribute(e){return e==="plain"?this.name==="caption":e==="padding"?Math.max(0,u(this,oe).indexOf("$1")):super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){let n=super.lint(e,t),{link:i,name:s}=this;if(s==="invalid"){let o=N(this,{start:e},"invalid-gallery","invalid image parameter");o.fix={range:[e-1,o.endIndex],text:""},n.push(o)}else typeof i=="object"&&i.encoded&&n.push(N(this,{start:e},"url-encoding","unnecessary URL encoding in an internal link"));return n}getValue(){return this.name==="invalid"?this.text():R(this,Nr,Ji).call(this)||super.text()}print(){return u(this,oe)?`${u(this,oe).replace("$1",`${Ne(this.childNodes)}`)}`:super.print({class:"image-caption"})}};oe=new WeakMap,Nr=new WeakSet,Ji=function(){return u(this,oe)&&!u(this,oe).includes("$1")}});var Yi,es,ts,ia,At,fn=b(()=>{"use strict";J();_();Q();F();Ht();Ki();Yi=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),es=new Set(["left","right","center","none"]),ts=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),ia=(a,r,e,t)=>{if(t===void 0)return[];let n=new RegExp(`${[a,r,e].map(oi).join("|")}`,"gu"),i=[],s=n.exec(t),o=0,l=0;for(;s;){let{0:g,index:p}=s;g!==e?o+=g===a?1:-1:o===0&&(i.push(t.slice(l,p)),{lastIndex:l}=n),s=n.exec(t)}return i.push(t.slice(l)),i},At=class extends Ce{get type(){return"file"}get extension(){return this.getTitle().extension}constructor(r,e,t=f.getConfig(),n=[],i="|"){super(r,void 0,t,n,i);let{extension:s}=this.getTitle(!0);this.append(...ia("-{","}-","|",e).map(o=>new $r(o,s,t,n)))}lint(r=this.getAbsoluteIndex(),e){var h;let t=super.lint(r,e),n=this.getAllArgs().filter(({childNodes:m})=>{let k=m.filter(x=>x.text().trim());return k.length!==1||k[0].type!=="arg"}),i=[...new Set(n.map(({name:m})=>m))],s=i.filter(m=>Yi.has(m)),o=i.filter(m=>es.has(m)),l=i.filter(m=>ts.has(m)),[g]=s,p=g==="framed"||g==="manualthumb",d=new E(this,r);if(this.closest("ext-link-text")&&((h=this.getValue("link"))==null?void 0:h.trim())!==""&&t.push(N(this,d,"nested-link","internal link in an external link")),p)for(let m of n.filter(({name:k})=>k==="width")){let k=C(m,d,"invalid-gallery","invalid image parameter");k.fix={range:[k.startIndex-1,k.endIndex],text:""},t.push(k)}if(n.length===i.length&&s.length<2&&o.length<2&&l.length<2)return t;let c=(m,k)=>x=>C(x,d,"no-duplicate",f.msg(`${m} image $1 parameter`,k));for(let m of i){if(m==="invalid"||m==="width"&&p)continue;let k=n.filter(({name:x})=>x===m);m==="caption"&&(k=[...k.slice(0,-1).filter(x=>x.text()),...k.slice(-1)]),k.length>1&&t.push(...k.map(c("duplicated",m)))}return s.length>1&&t.push(...n.filter(({name:m})=>Yi.has(m)).map(c("conflicting","frame"))),o.length>1&&t.push(...n.filter(({name:m})=>es.has(m)).map(c("conflicting","horizontal-alignment"))),l.length>1&&t.push(...n.filter(({name:m})=>ts.has(m)).map(c("conflicting","vertical-alignment"))),t}getAllArgs(){return this.childNodes.slice(1)}getArgs(r){return this.getAllArgs().filter(({name:e})=>r===e)}getArg(r){let e=this.getArgs(r);return e[r==="manualthumb"?0:e.length-1]}getValue(r){var e;return(e=this.getArg(r))==null?void 0:e.getValue()}}});var wt,xn=b(()=>{"use strict";_();Se();F();P();fn();wt=class extends At{constructor(e,t,n,i=f.getConfig(),s=[]){let o;if(n!==void 0){let{length:l}=s;o=new y(n,i,s);for(let g=1;g<11;g++)o.parseOnce();s.splice(l,1)}super(t,o==null?void 0:o.toString(),i,s);X(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=`${e}-image`,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(){let e=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),e?0:6,!0,!e)}getAttribute(e){return e==="padding"?0:super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){let n=super.lint(e,t),{ns:i,interwiki:s}=this.getAttribute("title");return(s||i!==6)&&n.push(N(this,{start:e},"invalid-gallery","invalid gallery image")),n}}});var Lr,rs,Er,ns=b(()=>{"use strict";F();P();xn();Oe();Er=class extends y{constructor(e,t=f.getConfig(),n=[]){var i;super(void 0,t,n,{});T(this,Lr);for(let s of(i=e==null?void 0:e.split(` -`))!=null?i:[]){let o=/^([^|]+)(?:\|(.*))?/u.exec(s);if(!o){super.insertAt(s.trim()?new U(s,t,n):s);continue}let[,l,g]=o;R(this,Lr,rs).call(this,l)?super.insertAt(new wt("gallery",l,g,t,n)):super.insertAt(new U(s,t,n))}}get type(){return"ext-inner"}toString(e){return super.toString(e,` +`){d=$+1;let{pos:W,findEqual:I}=(x=s[s.length-1])!=null?x:{};if(W===void 0||I||te(a.slice(W,B))!==""){let xe=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(a.slice(B,$));xe&&(a=`${a.slice(0,B)}\0${e.length}h\x7F${a.slice($)}`,d=B+4+String(e.length).length,new kt(xe[1].length,xe.slice(2),r,e))}}else if(S==="|"||H)d=$+1,ne(a),S==="|"&&j.push([]),w.pos=d,w.findEqual=S==="|",s.push(w);else if(S.startsWith("}}")){let W=S.slice(0,Math.min(L.length,3)),I=L.length-W.length,{length:xe}=e;d=$+W.length,ne(a);let ke=!1,Pe="t";if(W.length===3){let ie=j.map(lt=>lt.join("=")),ve=ie.length>1&&te(ie[1]).trim();new Ar(ie,r,e),ve&&ve.endsWith(":")&&i.includes(ve.slice(0,-1).toLowerCase())&&(Pe="s")}else try{new Jt(j[0][0],j.slice(1),r,e);let ie=te(j[0][0]).trim();mn.has(ie.toLowerCase())?Pe=mn.get(ie.toLowerCase()):/^(?:filepath|(?:full|canonical)urle?):./iu.test(ie)?Pe="m":/^#vardefine:./iu.test(ie)&&(Pe="n")}catch(ie){if(ie instanceof SyntaxError&&ie.message==="Invalid template name")ke=!0;else throw ie}ke||(a=`${a.slice(0,B+I)}\0${xe}${Pe}\x7F${a.slice(d)}`,d=B+I+3+String(xe).length,I>1?s.push({0:L.slice(0,I),index:B,pos:B+I,parts:[[]]}):I===1&&a[B-1]==="-"&&s.push({0:"-{",index:B-1,pos:B+1,parts:[[]]}))}else d=$+S.length,S.startsWith("{")&&(g.pos=d,g.parts=[[]]),s.push(..."0"in w?[w]:[],g);let ee=s[s.length-1];if(l&&o+a.length{"use strict";Qt();Sr();F();pn();Cr=class extends Tt{constructor(r,e,t=f.getConfig(),n=[]){let i=Symbol("InputboxToken"),{length:s}=n;n.push(i),e&&(e=Ke(e,t,n,r)),e&&(e=Yt(e,t,n)),n.splice(s,1),super(r,e,t,n,{})}}});function Zi(a,r,e,t,n){r=r.trim();let i=r.replace(a==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(a){case"width":return!i&&!!r||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(i);case"link":{if(!i)return r;let s=new RegExp(String.raw`^(?:${e.protocol}|//|\0\d+m\x7F)`,"iu"),o=new RegExp(String.raw`^(?:(?:${e.protocol}|//)${Ae}|\0\d+m\x7F)${we}$`,"iu");if(s.test(i))return o.test(i)&&r;i.startsWith("[[")&&i.endsWith("]]")&&(i=i.slice(2,-2));let l=f.normalizeTitle(i,0,!1,e,t,!0,!0);return l.valid&&l}case"lang":return(n==="svg"||n==="svgz")&&!/[^a-z\d-]/u.test(i);case"alt":case"class":case"manualthumb":return!0;case"page":return(n==="djvu"||n==="djv"||n==="pdf")&&Number(i)>0;default:return!!i&&!isNaN(i)}}var ia,oe,Nr,Ji,$r,Ki=b(()=>{"use strict";J();_();F();P();ia=new Set(["alt","link","lang","page","caption"]);$r=class extends y{constructor(e,t,n=f.getConfig(),i){var r=(...vg)=>(super(...vg),T(this,Nr),T(this,oe,""),this);var p;let s,o=Object.entries(n.img).map(([g,d])=>[g,d,new RegExp(String.raw`^(\s*(?!\s))${g.replace("$1","(.*)")}${g.endsWith("$1")?`(?=$| +)`:""}(\s*)$`,"u")]),l=o.find(([,g,d])=>(s=d.exec(e),s&&(s.length!==4||Zi(g,s[2],n,!0,t)!==!1)));if(l&&s){s.length===3?(r(void 0,n,i),v(this,oe,e)):(r(s[2],n,i,{}),v(this,oe,s[1]+l[0]+s[3])),this.setAttribute("name",l[1]);return}r(e,{...n,excludes:[...(p=n.excludes)!=null?p:[],"list"]},i),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get type(){return"image-parameter"}get link(){return this.name==="link"?Zi("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var e;((e=this.parentNode)==null?void 0:e.type)==="gallery-image"&&!ia.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(e){return u(this,oe)?u(this,oe).replace("$1",super.toString(e)):super.toString(e)}text(){return u(this,oe)?u(this,oe).replace("$1",super.text()).trim():super.text().trim()}getAttribute(e){return e==="plain"?this.name==="caption":e==="padding"?Math.max(0,u(this,oe).indexOf("$1")):super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){let n=super.lint(e,t),{link:i,name:s}=this;if(s==="invalid"){let o=N(this,{start:e},"invalid-gallery","invalid image parameter");o.fix={range:[e-1,o.endIndex],text:""},n.push(o)}else typeof i=="object"&&i.encoded&&n.push(N(this,{start:e},"url-encoding","unnecessary URL encoding in an internal link"));return n}getValue(){return this.name==="invalid"?this.text():R(this,Nr,Ji).call(this)||super.text()}print(){return u(this,oe)?`${u(this,oe).replace("$1",`${Ne(this.childNodes)}`)}`:super.print({class:"image-caption"})}};oe=new WeakMap,Nr=new WeakSet,Ji=function(){return u(this,oe)&&!u(this,oe).includes("$1")}});var Yi,es,ts,sa,At,fn=b(()=>{"use strict";J();_();Q();F();Ht();Ki();Yi=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),es=new Set(["left","right","center","none"]),ts=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),sa=(a,r,e,t)=>{if(t===void 0)return[];let n=new RegExp(`${[a,r,e].map(oi).join("|")}`,"gu"),i=[],s=n.exec(t),o=0,l=0;for(;s;){let{0:p,index:g}=s;p!==e?o+=p===a?1:-1:o===0&&(i.push(t.slice(l,g)),{lastIndex:l}=n),s=n.exec(t)}return i.push(t.slice(l)),i},At=class extends Ce{get type(){return"file"}get extension(){return this.getTitle().extension}constructor(r,e,t=f.getConfig(),n=[],i="|"){super(r,void 0,t,n,i);let{extension:s}=this.getTitle(!0);this.append(...sa("-{","}-","|",e).map(o=>new $r(o,s,t,n)))}lint(r=this.getAbsoluteIndex(),e){var h;let t=super.lint(r,e),n=this.getAllArgs().filter(({childNodes:m})=>{let k=m.filter(x=>x.text().trim());return k.length!==1||k[0].type!=="arg"}),i=[...new Set(n.map(({name:m})=>m))],s=i.filter(m=>Yi.has(m)),o=i.filter(m=>es.has(m)),l=i.filter(m=>ts.has(m)),[p]=s,g=p==="framed"||p==="manualthumb",d=new E(this,r);if(this.closest("ext-link-text")&&((h=this.getValue("link"))==null?void 0:h.trim())!==""&&t.push(N(this,d,"nested-link","internal link in an external link")),g)for(let m of n.filter(({name:k})=>k==="width")){let k=C(m,d,"invalid-gallery","invalid image parameter");k.fix={range:[k.startIndex-1,k.endIndex],text:""},t.push(k)}if(n.length===i.length&&s.length<2&&o.length<2&&l.length<2)return t;let c=(m,k)=>x=>C(x,d,"no-duplicate",f.msg(`${m} image $1 parameter`,k));for(let m of i){if(m==="invalid"||m==="width"&&g)continue;let k=n.filter(({name:x})=>x===m);m==="caption"&&(k=[...k.slice(0,-1).filter(x=>x.text()),...k.slice(-1)]),k.length>1&&t.push(...k.map(c("duplicated",m)))}return s.length>1&&t.push(...n.filter(({name:m})=>Yi.has(m)).map(c("conflicting","frame"))),o.length>1&&t.push(...n.filter(({name:m})=>es.has(m)).map(c("conflicting","horizontal-alignment"))),l.length>1&&t.push(...n.filter(({name:m})=>ts.has(m)).map(c("conflicting","vertical-alignment"))),t}getAllArgs(){return this.childNodes.slice(1)}getArgs(r){return this.getAllArgs().filter(({name:e})=>r===e)}getArg(r){let e=this.getArgs(r);return e[r==="manualthumb"?0:e.length-1]}getValue(r){var e;return(e=this.getArg(r))==null?void 0:e.getValue()}}});var wt,xn=b(()=>{"use strict";_();Se();F();P();fn();wt=class extends At{constructor(e,t,n,i=f.getConfig(),s=[]){let o;if(n!==void 0){let{length:l}=s;o=new y(n,i,s);for(let p=1;p<11;p++)o.parseOnce();s.splice(l,1)}super(t,o==null?void 0:o.toString(),i,s);X(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=`${e}-image`,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(){let e=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),e?0:6,!0,!e)}getAttribute(e){return e==="padding"?0:super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){let n=super.lint(e,t),{ns:i,interwiki:s}=this.getAttribute("title");return(s||i!==6)&&n.push(N(this,{start:e},"invalid-gallery","invalid gallery image")),n}}});var Lr,rs,Er,ns=b(()=>{"use strict";F();P();xn();Oe();Er=class extends y{constructor(e,t=f.getConfig(),n=[]){var i;super(void 0,t,n,{});T(this,Lr);for(let s of(i=e==null?void 0:e.split(` +`))!=null?i:[]){let o=/^([^|]+)(?:\|(.*))?/u.exec(s);if(!o){super.insertAt(s.trim()?new U(s,t,n):s);continue}let[,l,p]=o;R(this,Lr,rs).call(this,l)?super.insertAt(new wt("gallery",l,p,t,n)):super.insertAt(new U(s,t,n))}}get type(){return"ext-inner"}toString(e){return super.toString(e,` `)}text(){return super.text(` `).replace(/\n\s*\n/gu,` -`)}getGaps(){return 1}lint(e=this.getAbsoluteIndex(),t){let{top:n,left:i}=this.getRootNode().posFromIndex(e),s=[];for(let[o,l]of this.childNodes.entries()){let g=l.toString(),{length:p}=g,d=g.trim(),c=n+o,h=o?0:i;if(l.type==="noinclude"&&d&&!/^$/u.test(d)){let m=e+p;s.push({rule:"no-ignored",message:f.msg("invalid content in <$1>","gallery"),severity:d.startsWith("|")?"warning":"error",startIndex:e,endIndex:m,startLine:c,endLine:c,startCol:h,endCol:h+p,suggestions:[{desc:"remove",range:[e,m],text:""},{desc:"comment",range:[e,m],text:``}]})}else l.type!=="noinclude"&&l.type!=="text"&&s.push(...l.lint(e,t));e+=p+1}return s}print(){return super.print({sep:` -`})}};Lr=new WeakSet,rs=function(e){return this.normalizeTitle(e,6,!0,!0).valid}});var St,bn=b(()=>{"use strict";_();Ht();St=class extends Ce{get type(){return"link"}lint(r=this.getAbsoluteIndex(),e){let t=super.lint(r,e);return this.closest("ext-link-text")&&t.push(N(this,{start:r},"nested-link","internal link in an external link")),t}}});var sa,oa,er,Le,Ir=b(()=>{"use strict";_();J();Q();F();P();sa=String.raw`(?:[\p{Zs}\t]| |�*160;|&#[xX]0*[aA]0;)`,oa=new RegExp(`${sa}+`,"gu"),Le=class extends y{constructor(e,t="free-ext-link",n=f.getConfig(),i){super(e,n,i,{});T(this,er);v(this,er,t)}get type(){return u(this,er)}get innerText(){let e=new Map([["!","|"],["=","="]]),t=ge(this.childNodes.map(n=>{let{type:i}=n,s=String(n.name);return i==="magic-word"&&e.has(s)?e.get(s):n}));return this.type==="magic-link"&&(t=t.replace(oa," ")),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:ai(e)}lint(e=this.getAbsoluteIndex(),t){let n=super.lint(e,t),i=new E(this,e);if(this.type==="magic-link"){let{link:g}=this;if(g.startsWith("ISBN")){let p=[...g.slice(5)].map(d=>d==="X"?10:Number(d));(p.length===10&&p.reduce((d,c,h)=>d+c*(10-h),0)%11||p.length===13&&(p[12]===10||p.reduce((d,c,h)=>d+c*(h%2?3:1),0)%10))&&n.push(N(this,i,"invalid-isbn","invalid ISBN"))}return n}let s=this.type==="ext-link-url",o=s?/\|/u:/[,;。:!?()]+/u,l=this.childNodes.find(g=>g.type==="text"&&o.test(g.data));if(l){let{data:g}=l,p=C(l,i,"unterminated-url",f.msg("$1 in URL",s?'"|"':"full-width punctuation"),"warning"),{index:d,0:c}=o.exec(g),h=p.startIndex+d;p.suggestions=s?[{desc:"whitespace",range:[h,h+1],text:" "}]:[{desc:"whitespace",range:[h,h],text:" "},{desc:"escape",range:[h,h+c.length],text:encodeURI(c)}],n.push(p)}return n}};er=new WeakMap});var Ie,Ct,Tn=b(()=>{"use strict";Se();_();F();P();Ir();Ct=class extends y{constructor(e,t="",n="",i=f.getConfig(),s=[]){super(void 0,i,s,{});T(this,Ie);let o=e&&/^\0\d+f\x7F$/u.test(e)?s[Number(e.slice(1,-2))]:new Le(e,"ext-link-url",i,s);if(this.insertAt(o),v(this,Ie,t),n){let l=new y(n,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)}${u(this,Ie)}]`:`[${super.toString(e,u(this,Ie))}]`}text(){return`[${super.text(" ")}]`}getAttribute(e){return e==="padding"?1:super.getAttribute(e)}getGaps(){return u(this,Ie).length}lint(e=this.getAbsoluteIndex(),t){let n=super.lint(e,t);return this.length===1&&this.closest("heading-title")&&n.push(N(this,{start:e},"var-anchor","variable anchor in a section header")),n}print(){return super.print(this.length===1?{pre:"[",post:`${u(this,Ie)}]`}:{pre:"[",sep:u(this,Ie),post:"]"})}};Ie=new WeakMap});var tr,is=b(()=>{"use strict";F();P();Oe();bn();Tn();tr=class extends y{get type(){return"imagemap-link"}constructor(r,e,t,n=f.getConfig(),i=[]){super(void 0,n,i),this.append(r,e.length===2?new St(...e,n,i):new Ct(...e,n,i),new U(t,n,i))}}});var Fr,ss=b(()=>{"use strict";_();be();Q();F();P();Oe();xn();is();Fr=class extends y{get type(){return"ext-inner"}get image(){return this.childNodes.find(vt("imagemap-image"))}constructor(r,e=f.getConfig(),t=[]){if(super(void 0,e,t,{}),!r)return;let n=r.split(` -`),i=new Set(e.protocol.split("|")),s=U,o=!0,l=!1;for(let g of n){let p=g.trim();if(!(l||!p||p.startsWith("#"))){if(o){let[d,...c]=g.split("|"),h=this.normalizeTitle(d,0,!0);if(h.valid&&!h.interwiki&&h.ns===6){let m=new wt("imagemap",d,c.length>0?c.join("|"):void 0,e,t);super.insertAt(m),o=!1;continue}else l=!0}else if(g.trim().split(/[\t ]/u)[0]==="desc"){super.insertAt(g);continue}else if(g.includes("[")){let d=g.indexOf("["),c=g.slice(d),h=/^\[\[([^|]+)(?:\|([^\]]+))?\]\][\w\s]*$/u.exec(c);if(h){if(this.normalizeTitle(h[1],0,!0,!1,!0).valid){super.insertAt(new tr(g.slice(0,d),h.slice(1),c.slice(c.indexOf("]]")+2),e,t));continue}}else if(i.has(c.slice(1,c.indexOf(":")+1))||i.has(c.slice(1,c.indexOf("//")+2))){let m=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(c);if(m){super.insertAt(new tr(g.slice(0,d),m.slice(1),c.slice(c.indexOf("]")+1),e,t));continue}}}}super.insertAt(new s(g,e,t))}}toString(r){return super.toString(r,` +`)}getGaps(){return 1}lint(e=this.getAbsoluteIndex(),t){let{top:n,left:i}=this.getRootNode().posFromIndex(e),s=[];for(let[o,l]of this.childNodes.entries()){let p=l.toString(),{length:g}=p,d=p.trim(),c=n+o,h=o?0:i;if(l.type==="noinclude"&&d&&!/^$/u.test(d)){let m=e+g;s.push({rule:"no-ignored",message:f.msg("invalid content in <$1>","gallery"),severity:d.startsWith("|")?"warning":"error",startIndex:e,endIndex:m,startLine:c,endLine:c,startCol:h,endCol:h+g,suggestions:[{desc:"remove",range:[e,m],text:""},{desc:"comment",range:[e,m],text:``}]})}else l.type!=="noinclude"&&l.type!=="text"&&s.push(...l.lint(e,t));e+=g+1}return s}print(){return super.print({sep:` +`})}};Lr=new WeakSet,rs=function(e){return this.normalizeTitle(e,6,!0,!0).valid}});var St,bn=b(()=>{"use strict";_();Ht();St=class extends Ce{get type(){return"link"}lint(r=this.getAbsoluteIndex(),e){let t=super.lint(r,e);return this.closest("ext-link-text")&&t.push(N(this,{start:r},"nested-link","internal link in an external link")),t}}});var oa,aa,er,Le,Ir=b(()=>{"use strict";_();J();Q();F();P();oa=String.raw`(?:[\p{Zs}\t]| |�*160;|&#[xX]0*[aA]0;)`,aa=new RegExp(`${oa}+`,"gu"),Le=class extends y{constructor(e,t="free-ext-link",n=f.getConfig(),i){super(e,n,i,{});T(this,er);v(this,er,t)}get type(){return u(this,er)}get innerText(){let e=new Map([["!","|"],["=","="]]),t=pe(this.childNodes.map(n=>{let{type:i}=n,s=String(n.name);return i==="magic-word"&&e.has(s)?e.get(s):n}));return this.type==="magic-link"&&(t=t.replace(aa," ")),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:ai(e)}lint(e=this.getAbsoluteIndex(),t){let n=super.lint(e,t),i=new E(this,e);if(this.type==="magic-link"){let{link:p}=this;if(p.startsWith("ISBN")){let g=[...p.slice(5)].map(d=>d==="X"?10:Number(d));(g.length===10&&g.reduce((d,c,h)=>d+c*(10-h),0)%11||g.length===13&&(g[12]===10||g.reduce((d,c,h)=>d+c*(h%2?3:1),0)%10))&&n.push(N(this,i,"invalid-isbn","invalid ISBN"))}return n}let s=this.type==="ext-link-url",o=s?/\|/u:/[,;。:!?()]+/u,l=this.childNodes.find(p=>p.type==="text"&&o.test(p.data));if(l){let{data:p}=l,g=C(l,i,"unterminated-url",f.msg("$1 in URL",s?'"|"':"full-width punctuation"),"warning"),{index:d,0:c}=o.exec(p),h=g.startIndex+d;g.suggestions=s?[{desc:"whitespace",range:[h,h+1],text:" "}]:[{desc:"whitespace",range:[h,h],text:" "},{desc:"escape",range:[h,h+c.length],text:encodeURI(c)}],n.push(g)}return n}};er=new WeakMap});var Ie,Ct,Tn=b(()=>{"use strict";Se();_();F();P();Ir();Ct=class extends y{constructor(e,t="",n="",i=f.getConfig(),s=[]){super(void 0,i,s,{});T(this,Ie);let o=e&&/^\0\d+f\x7F$/u.test(e)?s[Number(e.slice(1,-2))]:new Le(e,"ext-link-url",i,s);if(this.insertAt(o),v(this,Ie,t),n){let l=new y(n,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)}${u(this,Ie)}]`:`[${super.toString(e,u(this,Ie))}]`}text(){return`[${super.text(" ")}]`}getAttribute(e){return e==="padding"?1:super.getAttribute(e)}getGaps(){return u(this,Ie).length}lint(e=this.getAbsoluteIndex(),t){let n=super.lint(e,t);return this.length===1&&this.closest("heading-title")&&n.push(N(this,{start:e},"var-anchor","variable anchor in a section header")),n}print(){return super.print(this.length===1?{pre:"[",post:`${u(this,Ie)}]`}:{pre:"[",sep:u(this,Ie),post:"]"})}};Ie=new WeakMap});var tr,is=b(()=>{"use strict";F();P();Oe();bn();Tn();tr=class extends y{get type(){return"imagemap-link"}constructor(r,e,t,n=f.getConfig(),i=[]){super(void 0,n,i),this.append(r,e.length===2?new St(...e,n,i):new Ct(...e,n,i),new U(t,n,i))}}});var Fr,ss=b(()=>{"use strict";_();be();Q();F();P();Oe();xn();is();Fr=class extends y{get type(){return"ext-inner"}get image(){return this.childNodes.find(vt("imagemap-image"))}constructor(r,e=f.getConfig(),t=[]){if(super(void 0,e,t,{}),!r)return;let n=r.split(` +`),i=new Set(e.protocol.split("|")),s=U,o=!0,l=!1;for(let p of n){let g=p.trim();if(!(l||!g||g.startsWith("#"))){if(o){let[d,...c]=p.split("|"),h=this.normalizeTitle(d,0,!0);if(h.valid&&!h.interwiki&&h.ns===6){let m=new wt("imagemap",d,c.length>0?c.join("|"):void 0,e,t);super.insertAt(m),o=!1;continue}else l=!0}else if(p.trim().split(/[\t ]/u)[0]==="desc"){super.insertAt(p);continue}else if(p.includes("[")){let d=p.indexOf("["),c=p.slice(d),h=/^\[\[([^|]+)(?:\|([^\]]+))?\]\][\w\s]*$/u.exec(c);if(h){if(this.normalizeTitle(h[1],0,!0,!1,!0).valid){super.insertAt(new tr(p.slice(0,d),h.slice(1),c.slice(c.indexOf("]]")+2),e,t));continue}}else if(i.has(c.slice(1,c.indexOf(":")+1))||i.has(c.slice(1,c.indexOf("//")+2))){let m=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(c);if(m){super.insertAt(new tr(p.slice(0,d),m.slice(1),c.slice(c.indexOf("]")+1),e,t));continue}}}}super.insertAt(new s(p,e,t))}}toString(r){return super.toString(r,` `)}text(){return super.text(` `).replace(/\n{2,}/gu,` `)}getGaps(){return 1}lint(r=this.getAbsoluteIndex(),e){let t=super.lint(r,e),n=new E(this,r);return this.image?t.push(...this.childNodes.filter(i=>{let s=i.toString().trim();return i.type==="noinclude"&&s&&!s.startsWith("#")}).map(i=>C(i,n,"invalid-imagemap","invalid link in "))):t.push(N(this,n,"invalid-imagemap"," without an image")),t}print(){return super.print({sep:` -`})}}});var Rr,os=b(()=>{"use strict";_();F();_e();Rr=class extends re{get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex()){let{name:e,firstChild:{data:t}}=this;if((e==="templatestyles"||e==="section")&&t){let n=N(this,{start:r},"void-ext",f.msg("nothing should be in <$1>",e));return n.fix={range:[r,n.endIndex],text:""},[n]}return super.lint(r,new RegExp(String.raw`<\s*(?:/\s*)${e==="nowiki"?"":"?"}(${e})\b`,"giu"))}}});var Pr={};se(Pr,{NestedToken:()=>yn});var aa,rr,$t,yn,Br=b(()=>{"use strict";_();Q();Qt();Sr();F();P();kn();Oe();aa=new Set(["comment","include","arg","template","magic-word"]),yn=class extends y{constructor(e,t,n,i=f.getConfig(),s=[]){if(typeof t=="boolean"){let o=Symbol("InputboxToken"),{length:l}=s;s.push(o),e&&(e=Ke(e,i,s,t)),e&&(e=Yt(e,i,s)),s.splice(l,1)}else e&&(e=e.replace(t,(o,l,g,p,d)=>{let c=`\0${s.length+1}e\x7F`;return new Nt(l,g,p,d,i,!1,s),c}));e&&(e=e.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(o,l,g)=>(new U(g,i,s),`${l}\0${s.length}n\x7F`)));super(e,i,s);T(this,rr);T(this,$t);v(this,rr,[...n]),v(this,$t,t)}get type(){return"ext-inner"}lint(e=this.getAbsoluteIndex(),t){let n=new E(this,e),i=u(this,$t)?"includeonly":"noinclude",s=typeof u(this,$t)=="boolean"?new RegExp(String.raw`^(?:<${i}(?:\s[^>]*)?/?>|)$`,"iu"):/^$/su;return[...super.lint(e,t),...this.childNodes.filter(o=>{if(o.type==="ext")return!u(this,rr).includes(o.name);if(aa.has(o.type))return!1;let l=o.toString().trim();return l&&!s.test(l)}).map(o=>{let l=C(o,n,"no-ignored",f.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:``}],l})]}};rr=new WeakMap,$t=new WeakMap});var as,Nt,kn=b(()=>{"use strict";_();Q();F();P();ln();Tr();Mi();gn();Qi();ns();ss();os();as=(a,r)=>{let e=new Set(a);return e.delete(r),[...e]},Nt=class extends mt{get type(){return"ext"}constructor(r,e,t,n,i=f.getConfig(),s=!1,o=[]){var c;let l=r.toLowerCase(),g=new ze(!e||e.trimStart()!==e?e:` ${e}`,"ext-attrs",l,i,o),p={...i,ext:as(i.ext,l),excludes:[...(c=i.excludes)!=null?c:[]]},d;switch(p.inExt=!0,l){case"tab":p.ext=as(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 y(t,p,o);break;case"pre":d=new yr(t,p,o);break;case"dynamicpagelist":d=new Tt(s,t,p,o);break;case"inputbox":p.excludes.push("heading"),d=new Cr(s,t,p,o);break;case"references":{let{NestedToken:h}=(Br(),Z(Pr));p.excludes.push("heading"),d=new h(t,s,["ref"],p,o);break}case"choose":{let{NestedToken:h}=(Br(),Z(Pr));d=new h(t,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>(.*?)<\/(\1)>)/gsu,["option","choicetemplate"],p,o);break}case"combobox":{let{NestedToken:h}=(Br(),Z(Pr));d=new h(t,/<(combooption)(\s[^>]*?)?(?:\/>|>(.*?)<\/(combooption\s*)>)/gisu,["combooption"],p,o);break}case"gallery":d=new Er(t,p,o);break;case"imagemap":d=new Fr(t,p,o);break;default:d=new Rr(t,p,o)}d.setAttribute("name",l),d.type==="plain"&&(d.type="ext-inner"),super(r,g,d,n,i,o),this.seal("closed",!0)}lint(r=this.getAbsoluteIndex(),e){let t=super.lint(r,e),n=new E(this,r);return this.name!=="nowiki"&&this.closest("html-attrs,table-attrs")&&t.push(N(this,n,"parsing-order","extension tag in HTML tag attributes")),this.name==="ref"&&this.closest("heading-title")&&t.push(N(this,n,"var-anchor","variable anchor in a section header")),t}}});var ls,vn,la,nt,ds=b(()=>{"use strict";_();Xe();F();_e();ls=[ue(!1)];nt=class extends(la=re){constructor(e,t=!0,n,i){super(e,n,i);X(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=N(this,{start:e},"unclosed-comment",f.msg("unclosed $1","HTML comment"));return t.fix={range:[t.endIndex,t.endIndex],text:"-->"},[t]}toString(e){return e?"":`":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}};vn=le(la),nt=pe(vn,0,"CommentToken",ls,nt),de(vn,1,nt)});var ps={};se(ps,{parseCommentAndExt:()=>Ke});var Ke,Qt=b(()=>{"use strict";wi();Oe();Ci();kn();ds();Ke=(a,r,e,t)=>{let n="",i="",{length:s}=n,o=()=>{let c=a.indexOf(n);return{i:c,j:a.indexOf(i,c+s)}};if(t){let{i:c,j:h}=o();if(c!==-1&&h!==-1){let m="",k=x=>{new U(x,r,e),m+=`\0${e.length-1}n\x7F`};for(;c!==-1&&h!==-1;){let x=`\0${e.length}e\x7F`;new fr(a.slice(c+s,h),r,e),c>0&&k(a.slice(0,c)),m+=x,a=a.slice(h+s+1),{i:c,j:h}=o()}return a&&k(a),m}}let l=r.ext.join("|"),g=t?"includeonly":"(?:no|only)include",p=t?"noinclude":"includeonly",d=new RegExp(String.raw`|$)|<${g}(?:\s[^>]*)?/?>||<(${l})(\s[^>]*?)?(?:/>|>(.*?))|<(${p})(\s[^>]*?)?(?:/>|>(.*?)(?:|$))`,"gisu");return a.replace(d,(c,h,m,k,x,A,S,$,w)=>{let L=e.length,B="n";if(h)B="e",new Nt(h,m,k,x,r,A,e);else if(c.startsWith("");new nt(c.slice(4,j?-3:void 0),j,r,e)}else A?new Je(A,S,$,w,r,e):new U(c,r,e);return`\0${L}${B}\x7F`})}});var da,pa,ga,Et,he,We,jr,gs=b(()=>{"use strict";_();J();Q();P();da=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),pa=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"]),ga=new Set(["strike","big","center","font","tt"]),jr=class extends y{constructor(e,t,n,i,s,o){super(void 0,s,o);T(this,Et);T(this,he);T(this,We);this.insertAt(t),this.setAttribute("name",e.toLowerCase()),v(this,Et,n),v(this,he,i),v(this,We,e)}get type(){return"html"}get selfClosing(){return u(this,he)}get closing(){return u(this,Et)}toString(e){return`<${this.closing?"/":""}${u(this,We)}${super.toString(e)}${u(this,he)?"/":""}>`}text(){let{closing:e}=this,t=u(this,We)+(e?"":super.text());return`<${e?"/":""}${t}${u(this,he)?"/":""}>`}getAttribute(e){return e==="padding"?u(this,We).length+(this.closing?2:1):super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){var s;let n=super.lint(e,t),i=new E(this,e);this.name==="h1"&&!this.closing&&n.push(N(this,i,"h1","

")),this.closest("table-attrs")&&n.push(N(this,i,"parsing-order","HTML tag in table attributes"));try{this.findMatchingTag()}catch(o){if(o instanceof SyntaxError){let{message:l}=o,g=l.split(":")[0].toLowerCase(),p=N(this,i,"unmatched-tag",g);if(g==="unclosed tag"&&!this.closest("heading-title"))if(pa.has(this.name)){let d=(s=this.parentNode)==null?void 0:s.childNodes,c=d==null?void 0:d.indexOf(this);d!=null&&d.slice(0,c).some(({type:h,name:m})=>h==="html"&&m===this.name)||(p.severity="warning")}else p.severity="warning";else if(g==="unmatched closing tag"){let d=this.closest("magic-word");d&&da.has(d.name)?p.severity="warning":p.suggestions=[{desc:"remove",range:[e,p.endIndex],text:""}]}else if(g==="tag that is both closing and self-closing"){let{html:[,,d]}=this.getAttribute("config");d.includes(this.name)&&(p.fix={range:[e+1,e+2],text:""})}n.push(p)}}return ga.has(this.name)&&n.push(N(this,i,"obsolete-tag","obsolete HTML tag","warning")),(this.name==="b"||this.name==="strong")&&this.closest("heading-title")&&n.push(N(this,i,"bold-header","bold in section header","warning")),n}findMatchingTag(){let{html:[e,t,n]}=this.getAttribute("config"),{name:i,parentNode:s,closing:o}=this,l=li(this.toString());if(o&&(u(this,he)||n.includes(i)))throw new SyntaxError(`Tag that is both closing and self-closing: ${l}`);if(n.includes(i)||u(this,he)&&t.includes(i))return this;if(u(this,he)&&e.includes(i))throw new SyntaxError(`Invalid self-closing tag: ${l}`);if(!s)return;let{childNodes:g}=s,p=g.indexOf(this),d=(o?g.slice(0,p).reverse():g.slice(p+1)).filter(h=>h.type==="html"&&h.name===i),c=o?-1:1;for(let h of d)if(u(h,Et)?c--:c++,c===0)return h;throw new SyntaxError(`${o?"Unmatched closing":"Unclosed"} tag: ${l}`)}print(){return super.print({pre:`<${this.closing?"/":""}${u(this,We)}`,post:`${u(this,he)?"/":""}>`})}json(){let e=super.json();return Object.assign(e,{closing:this.closing,selfClosing:u(this,he)}),e}};Et=new WeakMap,he=new WeakMap,We=new WeakMap});var us={};se(us,{parseHtml:()=>ua});var ua,cs=b(()=>{"use strict";Tr();gs();ua=(a,r,e)=>{let t=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,{html:n}=r,i=new Set([...n[0],...n[1],...n[2]]),s=a.split("<"),o=s.shift();for(let l of s){let g=t.exec(l),p=g==null?void 0:g[2],d=p==null?void 0:p.toLowerCase();if(!g||!i.has(d)){o+=`<${l}`;continue}let[,c,,h="",m,k]=g,{length:x}=e,A=new ze(h,"html-attrs",d,r,e),S=A.getAttr("itemprop");if(d==="meta"&&(S===void 0||A.getAttr("content")===void 0)||d==="link"&&(S===void 0||A.getAttr("href")===void 0)){o+=`<${l}`,e.length=x;continue}o+=`\0${e.length}x\x7F${k}`,new jr(p,A,c==="/",m==="/>",r,e)}return o}});var hs,fs=b(()=>{"use strict";be();hs=(a=0)=>(r,e)=>{var n,ms;class t extends r{constructor(){super(...arguments);T(this,n)}getAttr(l){return u(this,n,ms).getAttr(l)}}return n=new WeakSet,ms=function(){return this.childNodes[a]},hr(t,r),t}});var Lt,An=b(()=>{"use strict";fs();F();P();ut();Tr();Lt=class extends hs(1)(y){constructor(r,e,t,n,i=f.getConfig(),s=[],o){super(void 0,i,s,o),this.append(new ce(e,r,"table-syntax",i,s,{}),new ze(n,"table-attrs",t,i,s))}}});var me,nr,st,wn,xs,it,Sn=b(()=>{"use strict";_();Se();be();Q();F();P();An();it=class extends Lt{constructor(e,t,n=f.getConfig(),i=[]){var g;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,n,i);T(this,st);T(this,me,"");T(this,nr);s&&([dr(this,me)._]=s);let l=new y(t==null?void 0:t.slice(((g=s==null?void 0:s.index)!=null?g:NaN)+u(this,me).length),n,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 R(this,st,wn).call(this).subtype}afterBuild(){u(this,me).includes("\0")&&v(this,me,this.buildFromStr(u(this,me),0)),super.afterBuild()}toString(e){let{childNodes:[t,n,i]}=this;return t.toString(e)+n.toString(e)+u(this,me)+i.toString(e)}text(){let{childNodes:[e,t,n]}=this;return e.text()+t.text()+u(this,me)+n.text()}getGaps(e){return e===1?u(this,me).length:0}lint(e=this.getAbsoluteIndex(),t){let n=super.lint(e,t),i=new E(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("||"),g=C(s,i,"pipe-like",'additional "|" in a table cell',l?"error":"warning");if(l){let p={caption:"|+",td:"|",th:"!"}[this.subtype];g.fix={range:[g.startIndex,g.endIndex],text:o.replace(/\|\|/gu,` -${p}`)}}else g.suggestions=[{desc:"escape",range:[g.startIndex,g.endIndex],text:o.replace(/\|/gu,"|")}];n.push(g)}}return n}isIndependent(){return this.firstChild.text().startsWith(` -`)}getAttr(e){let t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}print(){let{childNodes:[e,t,n]}=this;return`${e.print()}${t.print()}${u(this,me)}${n.print()}`}json(){let e=super.json();return e.subtype=this.subtype,e}};me=new WeakMap,nr=new WeakMap,st=new WeakSet,wn=function(){var t;let{rev:e}=ye;return(t=u(this,nr))!=null||v(this,nr,[e,R(this,st,xs).call(this)]),u(this,nr)[1]},xs=function(){var o;let e=this.firstChild.text(),t=e.slice(-1),n="td";if(t==="!"?n="th":t==="+"&&(n="caption"),this.isIndependent())return{subtype:n};let{previousSibling:i}=this;return{...R(o=i,st,wn).call(o)}}});var It,Cn=b(()=>{"use strict";_();An();Sn();It=class extends Lt{lint(r=this.getAbsoluteIndex(),e){let t=super.lint(r,e),n=this.childNodes.find(({type:l})=>l==="table-inter");if(!n)return t;let i=n.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=C(n,{start:r},"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(r=>r instanceof it&&r.isIndependent()&&!r.firstChild.text().endsWith("+")))}getNthCol(r,e){let t=0;for(let n of this.childNodes.slice(2))if(n instanceof it&&(n.isIndependent()&&(t=+(n.subtype!=="caption")),r-=t,r<0))return n}}});var ca,ha,$n,qr,bs=b(()=>{"use strict";_();be();Q();F();Cn();ut();ca=/^\n[^\S\n]*(?:\|\}|\{\{\s*!\s*\}\}\}|\{\{\s*!\)\s*\}\})$/u,ha=({type:a})=>a==="tr"||a==="table-syntax",$n=class extends Array{},qr=class extends It{get type(){return"table"}get closed(){return this.lastChild.type==="table-syntax"}constructor(r,e,t,n){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,r,"table",e,t,n,{})}lint(r=this.getAbsoluteIndex(),e){let t=super.lint(r,e),n=new E(this,r);this.closed||t.push(C(this.firstChild,n,"unclosed-table",f.msg("unclosed $1","table")));let i=this.getLayout(),{length:s}=i;if(s>1){let o=1,l=1/0,g=0;for(;gl)break;c>o&&(o=c)}if(g{let s=new ce(void 0,ca,"table-syntax",t,n,{});super.insertAt(s)}),this.lastChild.replaceChildren(...i)}getLayout(r){let e=this.getAllRows(),{length:t}=e,n=new $n(...Ts(t,()=>[]));for(let[i,s]of n.entries()){let o=0,l=0,g;for(let p of e[i].childNodes.slice(2))if(p.type==="td"){if(p.isIndependent()&&(g=p.subtype!=="caption"),g){let d={row:i,column:o},{rowspan:c,colspan:h}=p;for(o++;s[l];)l++;for(let m=i;mr.type==="tr"&&r.getRowCount()>0)]}getNthCell(r){var t;let e=r;return e&&((t=this.getNthRow(e.row,!1,!1))==null?void 0:t.getNthCol(e.column))}getNthRow(r,e,t){let n=super.getRowCount();if(r===0&&n)return this;n&&r--;for(let i of this.childNodes.slice(2))if(i.type==="tr"&&i.getRowCount()&&(r--,r<0))return i}json(){let r=super.json();return r.closed=this.closed,r}}});var _r,ys=b(()=>{"use strict";Cn();_r=class extends It{get type(){return"tr"}constructor(r,e,t,n){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,r,"tr",e,t,n,{})}}});var Ft,Nn=b(()=>{"use strict";_e();Ft=class extends re{}});var Rt,En=b(()=>{"use strict";Nn();Rt=class extends Ft{get type(){return"dd"}}});var ks={};se(ks,{parseTable:()=>fa});var ma,fa,vs=b(()=>{"use strict";P();bs();ys();Sn();En();ma=a=>a.lastChild.constructor!==y,fa=({firstChild:{data:a},type:r,name:e},t,n)=>{let i=[],s=a.split(` +`})}}});var Rr,os=b(()=>{"use strict";_();F();_e();Rr=class extends re{get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex()){let{name:e,firstChild:{data:t}}=this;if((e==="templatestyles"||e==="section")&&t){let n=N(this,{start:r},"void-ext",f.msg("nothing should be in <$1>",e));return n.fix={range:[r,n.endIndex],text:""},[n]}return super.lint(r,new RegExp(String.raw`<\s*(?:/\s*)${e==="nowiki"?"":"?"}(${e})\b`,"giu"))}}});var Pr={};se(Pr,{NestedToken:()=>yn});var la,rr,$t,yn,Br=b(()=>{"use strict";_();Q();Qt();Sr();F();P();kn();Oe();la=new Set(["comment","include","arg","template","magic-word"]),yn=class extends y{constructor(e,t,n,i=f.getConfig(),s=[]){if(typeof t=="boolean"){let o=Symbol("InputboxToken"),{length:l}=s;s.push(o),e&&(e=Ke(e,i,s,t)),e&&(e=Yt(e,i,s)),s.splice(l,1)}else e&&(e=e.replace(t,(o,l,p,g,d)=>{let c=`\0${s.length+1}e\x7F`;return new Nt(l,p,g,d,i,!1,s),c}));e&&(e=e.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(o,l,p)=>(new U(p,i,s),`${l}\0${s.length}n\x7F`)));super(e,i,s);T(this,rr);T(this,$t);v(this,rr,[...n]),v(this,$t,t)}get type(){return"ext-inner"}lint(e=this.getAbsoluteIndex(),t){let n=new E(this,e),i=u(this,$t)?"includeonly":"noinclude",s=typeof u(this,$t)=="boolean"?new RegExp(String.raw`^(?:<${i}(?:\s[^>]*)?/?>|)$`,"iu"):/^$/su;return[...super.lint(e,t),...this.childNodes.filter(o=>{if(o.type==="ext")return!u(this,rr).includes(o.name);if(la.has(o.type))return!1;let l=o.toString().trim();return l&&!s.test(l)}).map(o=>{let l=C(o,n,"no-ignored",f.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:``}],l})]}};rr=new WeakMap,$t=new WeakMap});var as,Nt,kn=b(()=>{"use strict";_();Q();F();P();ln();Tr();Mi();pn();Qi();ns();ss();os();as=(a,r)=>{let e=new Set(a);return e.delete(r),[...e]},Nt=class extends mt{get type(){return"ext"}constructor(r,e,t,n,i=f.getConfig(),s=!1,o=[]){var c;let l=r.toLowerCase(),p=new ze(!e||e.trimStart()!==e?e:` ${e}`,"ext-attrs",l,i,o),g={...i,ext:as(i.ext,l),excludes:[...(c=i.excludes)!=null?c:[]]},d;switch(g.inExt=!0,l){case"tab":g.ext=as(g.ext,"tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":l==="poem"&&g.excludes.push("heading"),d=new y(t,g,o);break;case"pre":d=new yr(t,g,o);break;case"dynamicpagelist":d=new Tt(s,t,g,o);break;case"inputbox":g.excludes.push("heading"),d=new Cr(s,t,g,o);break;case"references":{let{NestedToken:h}=(Br(),Z(Pr));g.excludes.push("heading"),d=new h(t,s,["ref"],g,o);break}case"choose":{let{NestedToken:h}=(Br(),Z(Pr));d=new h(t,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>(.*?)<\/(\1)>)/gsu,["option","choicetemplate"],g,o);break}case"combobox":{let{NestedToken:h}=(Br(),Z(Pr));d=new h(t,/<(combooption)(\s[^>]*?)?(?:\/>|>(.*?)<\/(combooption\s*)>)/gisu,["combooption"],g,o);break}case"gallery":d=new Er(t,g,o);break;case"imagemap":d=new Fr(t,g,o);break;default:d=new Rr(t,g,o)}d.setAttribute("name",l),d.type==="plain"&&(d.type="ext-inner"),super(r,p,d,n,i,o),this.seal("closed",!0)}lint(r=this.getAbsoluteIndex(),e){let t=super.lint(r,e),n=new E(this,r);return this.name!=="nowiki"&&this.closest("html-attrs,table-attrs")&&t.push(N(this,n,"parsing-order","extension tag in HTML tag attributes")),this.name==="ref"&&this.closest("heading-title")&&t.push(N(this,n,"var-anchor","variable anchor in a section header")),t}}});var ls,vn,da,nt,ds=b(()=>{"use strict";_();Xe();F();_e();ls=[ue(!1)];nt=class extends(da=re){constructor(e,t=!0,n,i){super(e,n,i);X(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=N(this,{start:e},"unclosed-comment",f.msg("unclosed $1","HTML comment"));return t.fix={range:[t.endIndex,t.endIndex],text:"-->"},[t]}toString(e){return e?"":`":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}};vn=le(da),nt=ge(vn,0,"CommentToken",ls,nt),de(vn,1,nt)});var gs={};se(gs,{parseCommentAndExt:()=>Ke});var Ke,Qt=b(()=>{"use strict";wi();Oe();Ci();kn();ds();Ke=(a,r,e,t)=>{let n="",i="",{length:s}=n,o=()=>{let c=a.indexOf(n);return{i:c,j:a.indexOf(i,c+s)}};if(t){let{i:c,j:h}=o();if(c!==-1&&h!==-1){let m="",k=x=>{new U(x,r,e),m+=`\0${e.length-1}n\x7F`};for(;c!==-1&&h!==-1;){let x=`\0${e.length}e\x7F`;new fr(a.slice(c+s,h),r,e),c>0&&k(a.slice(0,c)),m+=x,a=a.slice(h+s+1),{i:c,j:h}=o()}return a&&k(a),m}}let l=r.ext.join("|"),p=t?"includeonly":"(?:no|only)include",g=t?"noinclude":"includeonly",d=new RegExp(String.raw`|$)|<${p}(?:\s[^>]*)?/?>||<(${l})(\s[^>]*?)?(?:/>|>(.*?))|<(${g})(\s[^>]*?)?(?:/>|>(.*?)(?:|$))`,"gisu");return a.replace(d,(c,h,m,k,x,A,S,$,w)=>{let L=e.length,B="n";if(h)B="e",new Nt(h,m,k,x,r,A,e);else if(c.startsWith("");new nt(c.slice(4,j?-3:void 0),j,r,e)}else A?new Je(A,S,$,w,r,e):new U(c,r,e);return`\0${L}${B}\x7F`})}});var ga,pa,ua,Et,he,We,jr,ps=b(()=>{"use strict";_();J();Q();P();ga=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),pa=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"]),ua=new Set(["strike","big","center","font","tt"]),jr=class extends y{constructor(e,t,n,i,s,o){super(void 0,s,o);T(this,Et);T(this,he);T(this,We);this.insertAt(t),this.setAttribute("name",e.toLowerCase()),v(this,Et,n),v(this,he,i),v(this,We,e)}get type(){return"html"}get selfClosing(){return u(this,he)}get closing(){return u(this,Et)}toString(e){return`<${this.closing?"/":""}${u(this,We)}${super.toString(e)}${u(this,he)?"/":""}>`}text(){let{closing:e}=this,t=u(this,We)+(e?"":super.text());return`<${e?"/":""}${t}${u(this,he)?"/":""}>`}getAttribute(e){return e==="padding"?u(this,We).length+(this.closing?2:1):super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){var s;let n=super.lint(e,t),i=new E(this,e);this.name==="h1"&&!this.closing&&n.push(N(this,i,"h1","

")),this.closest("table-attrs")&&n.push(N(this,i,"parsing-order","HTML tag in table attributes"));try{this.findMatchingTag()}catch(o){if(o instanceof SyntaxError){let{message:l}=o,p=l.split(":")[0].toLowerCase(),g=N(this,i,"unmatched-tag",p);if(p==="unclosed tag"&&!this.closest("heading-title"))if(pa.has(this.name)){let d=(s=this.parentNode)==null?void 0:s.childNodes,c=d==null?void 0:d.indexOf(this);d!=null&&d.slice(0,c).some(({type:h,name:m})=>h==="html"&&m===this.name)||(g.severity="warning")}else g.severity="warning";else if(p==="unmatched closing tag"){let d=this.closest("magic-word");d&&ga.has(d.name)?g.severity="warning":g.suggestions=[{desc:"remove",range:[e,g.endIndex],text:""}]}else if(p==="tag that is both closing and self-closing"){let{html:[,,d]}=this.getAttribute("config");d.includes(this.name)&&(g.fix={range:[e+1,e+2],text:""})}n.push(g)}}return ua.has(this.name)&&n.push(N(this,i,"obsolete-tag","obsolete HTML tag","warning")),(this.name==="b"||this.name==="strong")&&this.closest("heading-title")&&n.push(N(this,i,"bold-header","bold in section header","warning")),n}findMatchingTag(){let{html:[e,t,n]}=this.getAttribute("config"),{name:i,parentNode:s,closing:o}=this,l=li(this.toString());if(o&&(u(this,he)||n.includes(i)))throw new SyntaxError(`Tag that is both closing and self-closing: ${l}`);if(n.includes(i)||u(this,he)&&t.includes(i))return this;if(u(this,he)&&e.includes(i))throw new SyntaxError(`Invalid self-closing tag: ${l}`);if(!s)return;let{childNodes:p}=s,g=p.indexOf(this),d=(o?p.slice(0,g).reverse():p.slice(g+1)).filter(h=>h.type==="html"&&h.name===i),c=o?-1:1;for(let h of d)if(u(h,Et)?c--:c++,c===0)return h;throw new SyntaxError(`${o?"Unmatched closing":"Unclosed"} tag: ${l}`)}print(){return super.print({pre:`<${this.closing?"/":""}${u(this,We)}`,post:`${u(this,he)?"/":""}>`})}json(){let e=super.json();return Object.assign(e,{closing:this.closing,selfClosing:u(this,he)}),e}};Et=new WeakMap,he=new WeakMap,We=new WeakMap});var us={};se(us,{parseHtml:()=>ca});var ca,cs=b(()=>{"use strict";Tr();ps();ca=(a,r,e)=>{let t=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,{html:n}=r,i=new Set([...n[0],...n[1],...n[2]]),s=a.split("<"),o=s.shift();for(let l of s){let p=t.exec(l),g=p==null?void 0:p[2],d=g==null?void 0:g.toLowerCase();if(!p||!i.has(d)){o+=`<${l}`;continue}let[,c,,h="",m,k]=p,{length:x}=e,A=new ze(h,"html-attrs",d,r,e),S=A.getAttr("itemprop");if(d==="meta"&&(S===void 0||A.getAttr("content")===void 0)||d==="link"&&(S===void 0||A.getAttr("href")===void 0)){o+=`<${l}`,e.length=x;continue}o+=`\0${e.length}x\x7F${k}`,new jr(g,A,c==="/",m==="/>",r,e)}return o}});var hs,fs=b(()=>{"use strict";be();hs=(a=0)=>(r,e)=>{var n,ms;class t extends r{constructor(){super(...arguments);T(this,n)}getAttr(l){return u(this,n,ms).getAttr(l)}}return n=new WeakSet,ms=function(){return this.childNodes[a]},hr(t,r),t}});var Lt,An=b(()=>{"use strict";fs();F();P();ut();Tr();Lt=class extends hs(1)(y){constructor(r,e,t,n,i=f.getConfig(),s=[],o){super(void 0,i,s,o),this.append(new ce(e,r,"table-syntax",i,s,{}),new ze(n,"table-attrs",t,i,s))}}});var me,nr,st,wn,xs,it,Sn=b(()=>{"use strict";_();Se();be();Q();F();P();An();it=class extends Lt{constructor(e,t,n=f.getConfig(),i=[]){var p;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,n,i);T(this,st);T(this,me,"");T(this,nr);s&&([dr(this,me)._]=s);let l=new y(t==null?void 0:t.slice(((p=s==null?void 0:s.index)!=null?p:NaN)+u(this,me).length),n,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 R(this,st,wn).call(this).subtype}afterBuild(){u(this,me).includes("\0")&&v(this,me,this.buildFromStr(u(this,me),0)),super.afterBuild()}toString(e){let{childNodes:[t,n,i]}=this;return t.toString(e)+n.toString(e)+u(this,me)+i.toString(e)}text(){let{childNodes:[e,t,n]}=this;return e.text()+t.text()+u(this,me)+n.text()}getGaps(e){return e===1?u(this,me).length:0}lint(e=this.getAbsoluteIndex(),t){let n=super.lint(e,t),i=new E(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("||"),p=C(s,i,"pipe-like",'additional "|" in a table cell',l?"error":"warning");if(l){let g={caption:"|+",td:"|",th:"!"}[this.subtype];p.fix={range:[p.startIndex,p.endIndex],text:o.replace(/\|\|/gu,` +${g}`)}}else p.suggestions=[{desc:"escape",range:[p.startIndex,p.endIndex],text:o.replace(/\|/gu,"|")}];n.push(p)}}return n}isIndependent(){return this.firstChild.text().startsWith(` +`)}getAttr(e){let t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}print(){let{childNodes:[e,t,n]}=this;return`${e.print()}${t.print()}${u(this,me)}${n.print()}`}json(){let e=super.json();return e.subtype=this.subtype,e}};me=new WeakMap,nr=new WeakMap,st=new WeakSet,wn=function(){var t;let{rev:e}=ye;return(t=u(this,nr))!=null||v(this,nr,[e,R(this,st,xs).call(this)]),u(this,nr)[1]},xs=function(){var o;let e=this.firstChild.text(),t=e.slice(-1),n="td";if(t==="!"?n="th":t==="+"&&(n="caption"),this.isIndependent())return{subtype:n};let{previousSibling:i}=this;return{...R(o=i,st,wn).call(o)}}});var It,Cn=b(()=>{"use strict";_();An();Sn();It=class extends Lt{lint(r=this.getAbsoluteIndex(),e){let t=super.lint(r,e),n=this.childNodes.find(({type:l})=>l==="table-inter");if(!n)return t;let i=n.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=C(n,{start:r},"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(r=>r instanceof it&&r.isIndependent()&&!r.firstChild.text().endsWith("+")))}getNthCol(r,e){let t=0;for(let n of this.childNodes.slice(2))if(n instanceof it&&(n.isIndependent()&&(t=+(n.subtype!=="caption")),r-=t,r<0))return n}}});var ha,ma,$n,qr,bs=b(()=>{"use strict";_();be();Q();F();Cn();ut();ha=/^\n[^\S\n]*(?:\|\}|\{\{\s*!\s*\}\}\}|\{\{\s*!\)\s*\}\})$/u,ma=({type:a})=>a==="tr"||a==="table-syntax",$n=class extends Array{},qr=class extends It{get type(){return"table"}get closed(){return this.lastChild.type==="table-syntax"}constructor(r,e,t,n){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,r,"table",e,t,n,{})}lint(r=this.getAbsoluteIndex(),e){let t=super.lint(r,e),n=new E(this,r);this.closed||t.push(C(this.firstChild,n,"unclosed-table",f.msg("unclosed $1","table")));let i=this.getLayout(),{length:s}=i;if(s>1){let o=1,l=1/0,p=0;for(;pl)break;c>o&&(o=c)}if(p{let s=new ce(void 0,ha,"table-syntax",t,n,{});super.insertAt(s)}),this.lastChild.replaceChildren(...i)}getLayout(r){let e=this.getAllRows(),{length:t}=e,n=new $n(...Ts(t,()=>[]));for(let[i,s]of n.entries()){let o=0,l=0,p;for(let g of e[i].childNodes.slice(2))if(g.type==="td"){if(g.isIndependent()&&(p=g.subtype!=="caption"),p){let d={row:i,column:o},{rowspan:c,colspan:h}=g;for(o++;s[l];)l++;for(let m=i;mr.type==="tr"&&r.getRowCount()>0)]}getNthCell(r){var t;let e=r;return e&&((t=this.getNthRow(e.row,!1,!1))==null?void 0:t.getNthCol(e.column))}getNthRow(r,e,t){let n=super.getRowCount();if(r===0&&n)return this;n&&r--;for(let i of this.childNodes.slice(2))if(i.type==="tr"&&i.getRowCount()&&(r--,r<0))return i}json(){let r=super.json();return r.closed=this.closed,r}}});var _r,ys=b(()=>{"use strict";Cn();_r=class extends It{get type(){return"tr"}constructor(r,e,t,n){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,r,"tr",e,t,n,{})}}});var Ft,Nn=b(()=>{"use strict";_e();Ft=class extends re{}});var Rt,En=b(()=>{"use strict";Nn();Rt=class extends Ft{get type(){return"dd"}}});var ks={};se(ks,{parseTable:()=>xa});var fa,xa,vs=b(()=>{"use strict";P();bs();ys();Sn();En();fa=a=>a.lastChild.constructor!==y,xa=({firstChild:{data:a},type:r,name:e},t,n)=>{let i=[],s=a.split(` `),o=r==="root"||r==="parameter-value"||r==="ext-inner"&&e==="poem"?"":` -${s.shift()}`,l,g=(d,c)=>{if(!c){o+=d;return}let{lastChild:h}=c;if(ma(c)){let m=new y(d,t,n);m.type="table-inter",m.setAttribute("stage",3),c.insertAt(m)}else h.setText(h.toString()+d)},p=()=>l.type==="td"?i.pop():l;for(let d of s){l=i.pop();let[c]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(d),h=d.slice(c.length),m=/^(:*)((?:\s|\0\d+[cn]\x7F)*)(\{\||\{(?:\0\d+[cn]\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(h);if(m){for(;l&&l.type!=="td";)l=i.pop();let[,w,L,B,j]=m;w&&new Rt(w,t,n),g(` +${s.shift()}`,l,p=(d,c)=>{if(!c){o+=d;return}let{lastChild:h}=c;if(fa(c)){let m=new y(d,t,n);m.type="table-inter",m.setAttribute("stage",3),c.insertAt(m)}else h.setText(h.toString()+d)},g=()=>l.type==="td"?i.pop():l;for(let d of s){l=i.pop();let[c]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(d),h=d.slice(c.length),m=/^(:*)((?:\s|\0\d+[cn]\x7F)*)(\{\||\{(?:\0\d+[cn]\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(h);if(m){for(;l&&l.type!=="td";)l=i.pop();let[,w,L,B,j]=m;w&&new Rt(w,t,n),p(` ${c}${w&&`\0${n.length-1}d\x7F`}${L}\0${n.length}b\x7F`,l),i.push(...l?[l]:[],new qr(B,j,t,n));continue}else if(!l){o+=` -${d}`;continue}let k=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(h);if(!k){g(` +${d}`;continue}let k=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(h);if(!k){p(` ${d}`,l),i.push(l);continue}let[,x,A,S,$]=k;if(x){for(;l.type!=="table";)l=i.pop();l.close(` -${c}${x}`,!0),g($,i[i.length-1])}else if(A){l=p(),l.type==="tr"&&(l=i.pop());let w=new _r(` -${c}${A}`,$,t,n);i.push(l,w),l.insertAt(w)}else{l=p();let w=S==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu,L=w.exec($),B=0,j=` -${c}${S}`,q=D=>{let H=new it(j,$.slice(B,L==null?void 0:L.index),t,n);return D.insertAt(H),H};for(;L;)q(l),{lastIndex:B}=w,[j]=L,L=w.exec($);i.push(l,q(l))}}return o.slice(1)}});var Or,As=b(()=>{"use strict";_e();Or=class extends re{get type(){return"hr"}}});var ws,Ln,xa,ot,Ss=b(()=>{"use strict";Xe();F();_e();ws=[ue()];ot=class extends(xa=re){get type(){return"double-underscore"}constructor(r,e,t=f.getConfig(),n){super(r,t,n)}getAttribute(r){return r==="padding"?2:super.getAttribute(r)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}};Ln=le(xa),ot=pe(Ln,0,"DoubleUnderscoreToken",ws,ot),de(Ln,1,ot)});var Cs={};se(Cs,{parseHrAndDoubleUnderscore:()=>ba});var ba,$s=b(()=>{"use strict";As();Ss();un();ba=({firstChild:{data:a},type:r,name:e},t,n)=>{var l;let{doubleUnderscore:i}=t,s=new Set(i[0]),o=new Set(i[1]);return(l=t.regexHrAndDoubleUnderscore)!=null||(t.regexHrAndDoubleUnderscore=new RegExp(`__(${[...s,...o].join("|")})__`,"giu")),r!=="root"&&(r!=="ext-inner"||e!=="poem")&&(a=`\0${a}`),a=a.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(g,p,d)=>(new Or(d,t,n),`${p}\0${n.length-1}r\x7F`)).replace(t.regexHrAndDoubleUnderscore,(g,p)=>{var m,k;let d=o.has(p),c=p.toLowerCase(),h=s.has(c);return d||h?(new ot(p,d,t,n),`\0${n.length-1}${h&&((k=(m=i[2])==null?void 0:m[c])!=null?k:c)==="toc"?"u":"n"}\x7F`):g}).replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(g,p,d,c,h)=>{let m=`${p}\0${n.length}h\x7F`;return new kt(d.length,[c,h],t,n),m}),r==="root"||r==="ext-inner"&&e==="poem"?a:a.slice(1)}});var Mr,Ns=b(()=>{"use strict";_();Q();F();_e();Mr=class extends re{get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}text(){let{parentNode:r,innerText:e}=this;return(r==null?void 0:r.type)==="image-parameter"&&r.name!=="caption"?"":e}lint(r=this.getAbsoluteIndex()){let{previousSibling:e,nextSibling:t,bold:n}=this,i=f.msg('lonely "$1"',"'"),s=[],o=new E(this,r),l,g=(p,d,c)=>({desc:"escape",range:[p,d],text:"'".repeat(c)});if((e==null?void 0:e.type)==="text"&&e.data.endsWith("'")){l=N(this,o,"lonely-apos",i);let{startIndex:p,startLine:d,startCol:c}=l,[,{length:h}]=/(?:^|[^'])('+)$/u.exec(e.data),m=r-h;s.push({...l,startIndex:m,endIndex:p,startCol:c-h,endLine:d,endCol:c,suggestions:[g(m,p,h)]})}if((t==null?void 0:t.type)==="text"&&t.data.startsWith("'")){l!=null||(l=N(this,o,"lonely-apos",i));let{endIndex:p,endLine:d,endCol:c}=l,[{length:h}]=/^'+/u.exec(t.data),m=p+h;s.push({...l,startIndex:p,endIndex:m,startLine:d,startCol:c,endCol:c+h,suggestions:[g(p,m,h)]})}return n&&this.closest("heading-title")&&s.push(N(this,o,"bold-header","bold in section header","warning")),s}json(){let r=super.json();return Object.assign(r,{bold:this.bold,italic:this.italic}),r}}});var Es={};se(Es,{parseQuotes:()=>In});var In,Fn=b(()=>{"use strict";Ns();In=(a,r,e)=>{var p;let t=a.split(/('{2,})/u),{length:n}=t;if(n===1)return a;let i=0,s=0,o,l,g;for(let d=1;dRn});var Rn,Pn=b(()=>{"use strict";J();Tn();Ir();Rn=(a,r,e,t)=>{var n;return(n=r.regexExternalLinks)!=null||(r.regexExternalLinks=new RegExp(String.raw`\[(\0\d+f\x7F|(?:(?:${r.protocol}|//)${Ae}|\0\d+m\x7F)${we}(?=[[\]<>"\t\p{Zs}]|\0\d))(\p{Zs}*(?!\p{Zs}))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),a.replace(r.regexExternalLinks,(i,s,o,l)=>{let{length:g}=e,p=/&[lg]t;/u.exec(s);return p&&(s=s.slice(0,p.index),o="",l=s.slice(p.index)+o+l),t?(new Le(s,"ext-link-url",r,e),`[\0${g}f\x7F${o}${l}]`):(new Ct(s,o,l,r,e),`\0${g}w\x7F`)})}});var Gr,Is=b(()=>{"use strict";Ht();Gr=class extends Ce{get type(){return"category"}}});var Rs={};se(Rs,{parseLinks:()=>Fs});var Ta,Fs,Ps=b(()=>{"use strict";F();Fn();Pn();bn();fn();Is();Ta=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)(.*)$/su,Fs=(a,r,e)=>{var s;(s=r.regexLinks)!=null||(r.regexLinks=new RegExp(String.raw`^\s*(?:${r.protocol}|//)`,"iu"));let t=r.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)(.*?[^\]]))?\]\](.*)$/su:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)(.*?[^\]])?)?\]\](.*)$/su,n=a.split("[["),i=n.shift();for(let o=0;o2){L=!0,d+=`[[${j[0]}]]${j[1]}`,c=j.slice(2).join("]]");break}else if(j.length===2)d+=`[[${j[0]}]]${j[1]}`;else{d+=`[[${B}`;break}}if(d=Fs(d,r,e),!L){i+=`[[${g}${p}${d}`;continue}}}else{i+=`[[${h}`;continue}d&&(d=In(d,r,e));let w=St;k||(!$&&A===6?(d&&(d=Rn(d,r,e,!0)),w=At):!$&&A===14&&(w=Gr)),d===void 0&&p&&(d=""),i+=`\0${e.length}l\x7F${c}`,new w(g,d,r,e,p)}return i}});var _s={};se(_s,{parseMagicLinks:()=>ka});var qs,Bs,js,ya,ka,Os=b(()=>{"use strict";J();Ir();qs=String.raw`[\p{Zs}\t]| |�*160;|�*a0;`,Bs=`(?:${qs})+`,js=`(?:${qs}|-)`,ya=String.raw`(?:RFC|PMID)${Bs}\d+\b|ISBN${Bs}(?:97[89]${js}?)?(?:\d${js}?){9}[\dx]\b`,ka=(a,r,e)=>{var t;return(t=r.regexMagicLinks)!=null||(r.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\d_])(?:(?:${r.protocol})(${Ae}${we})|${ya})`,"giu")),a.replace(r.regexMagicLinks,(n,i,s)=>{let o=i?n.slice(i.length):n;if(s){let l="",g=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(o);g&&(l=o.slice(g.index),o=o.slice(0,g.index));let p=o.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,d=p.exec(o);if(d){let c=1;d[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(o.slice(0,d.index))&&(c=2),l=o.slice(d.index+c)+l,o=o.slice(0,d.index+c)}return l.length>=s.length?n:(new Le(o,void 0,r,e),`${i}\0${e.length-1}w\x7F${l}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(o))return n;return new Le(o,"magic-link",r,e),`${i}\0${e.length-1}i\x7F`})}});var Ms,Gs=b(()=>{"use strict";Ms=(a,r)=>a.startsWith(r)?r.length:[...r].findIndex((e,t)=>e!==a[t])});var zr,zs=b(()=>{"use strict";Nn();zr=class extends Ft{get type(){return"list"}}});var Ws={};se(Ws,{parseList:()=>va});var va,Us=b(()=>{"use strict";Gs();zs();En();va=(a,r,e,t)=>{let n=/^((?:\0\d+[cno]\x7F)*)([;:*#]+\s*)/u.exec(a);if(!n)return r.lastPrefix="",a;let[i,s,o]=n,l=o.replace(/;/gu,":"),g=Ms(l,r.lastPrefix),p=(g>1?o.slice(g-1):o).split(/(?=;)/u),d=p[0].startsWith(";"),c=p.length-(d?0:1);if(g>1){let q=o.slice(0,g-1);d?p.unshift(q):p[0]=q+p[0]}r.lastPrefix=l;let h=s+p.map((q,D)=>`\0${t.length+D}d\x7F`).join("")+a.slice(i.length);for(let q of p)new zr(q,e,t);if(!c)return h;let{html:[m]}=e,k=/:+|-\{|\0\d+[xq]\x7F/gu,x=k,A=x.exec(h),S=0,$=!1,w=!1,L=0,B=(q,D)=>(new Rt(q,e,t),`${h.slice(0,D)}\0${t.length-1}d\x7F${h.slice(D+q.length)}`),j=q=>{q?S&&S--:S++};for(;A&&c;){let{0:q,index:D}=A;if(q==="-{"){if(!L){let{lastIndex:H}=x;x=/-\{|\}-/gu,x.lastIndex=H}L++}else if(q==="}-"){if(L--,!L){let{lastIndex:H}=x;x=k,x.lastIndex=H}}else if(q.endsWith("x\x7F")){let{name:H,closing:ne,selfClosing:ee}=t[Number(q.slice(1,-2))];(!ee||m.includes(H))&&j(ne)}else if(q.endsWith("q\x7F")){let{bold:H,italic:ne}=t[Number(q.slice(1,-2))];H&&(j($),$=!$),ne&&(j(w),w=!w)}else if(S===0){if(q.length>=c)return B(q.slice(0,c),D);c-=q.length,x.lastIndex=D+4+String(t.length).length,h=B(q,D)}A=x.exec(h)}return h}});var Ds,Fe,Wr,Hs=b(()=>{"use strict";_();Q();F();P();Ee();Ds=new Set(["A","T","R","D","-","H","N"]),Wr=class extends y{constructor(e,t=f.getConfig(),n=[]){super(void 0,t,n,{});T(this,Fe);this.append(...e.map(i=>new G(i,"converter-flag",t,n)))}get type(){return"converter-flags"}afterBuild(){v(this,Fe,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(u(this,Fe).filter(e=>/\{{3}[^{}]+\}{3}/u.test(e)))}getVariantFlags(){let e=new Set(this.getAttribute("config").variants);return new Set(u(this,Fe).filter(t=>e.has(t)))}lint(e=this.getAbsoluteIndex(),t){let n=this.getVariantFlags(),i=this.getUnknownFlags(),s=new Set(u(this,Fe).filter(d=>Ds.has(d))),o=u(this,Fe).filter(d=>!d).length,l=u(this,Fe).length-i.size-o,g=super.lint(e,t);if(n.size===l||s.size===l)return g;let p=new E(this,e);for(let[d,c]of this.childNodes.entries()){let h=c.text().trim();if(h&&!n.has(h)&&!i.has(h)&&(n.size>0||!s.has(h))){let m=C(c,p,"no-ignored","invalid conversion flag");n.size===0&&Ds.has(h.toUpperCase())?m.fix={range:[m.startIndex,m.endIndex],text:h.toUpperCase()}:m.suggestions=[{desc:"remove",range:[m.startIndex-(d&&1),m.endIndex],text:""}],g.push(m)}}return g}print(){return super.print({sep:";"})}};Fe=new WeakMap});var Pt,Vs=b(()=>{"use strict";F();P();Ee();Pt=class extends y{get type(){return"converter-rule"}constructor(r,e=!0,t=f.getConfig(),n=[]){super(void 0,t,n);let i=r.indexOf(":"),s=r.slice(0,i).indexOf("=>"),o=s===-1?r.slice(0,i):r.slice(s+2,i);e&&t.variants.includes(o.trim())?(super.insertAt(new G(o,"converter-rule-variant",t,n)),super.insertAt(new G(r.slice(i+1),"converter-rule-to",t,n)),s!==-1&&super.insertAt(new G(r.slice(0,s),"converter-rule-from",t,n),0)):super.insertAt(new G(r,"converter-rule-to",t,n))}toString(r){let{childNodes:e,firstChild:t,lastChild:n}=this;return e.length===3?`${t.toString(r)}=>${e[1].toString(r)}:${n.toString(r)}`:super.toString(r,":")}text(){let{childNodes:r,firstChild:e,lastChild:t}=this;return r.length===3?`${e.text()}=>${r[1].text()}:${t.text()}`:super.text(":")}getGaps(r){return r===0&&this.length===3?2:1}print(){let{childNodes:r}=this;if(r.length===3){let[e,t,n]=r;return`${e.print()}=>${t.print()}:${n.print()}`}return super.print({sep:":"})}}});var Ur,Xs=b(()=>{"use strict";J();F();P();Hs();Vs();Ur=class extends y{get type(){return"converter"}constructor(r,e,t=f.getConfig(),n=[]){super(void 0,t,n),this.append(new Wr(r,t,n));let[i]=e,s=i.includes(":"),o=new Pt(i,s,t,n);s&&o.length===1||!s&&e.length===2&&!te(e[1]).trim()?this.insertAt(new Pt(e.join(";"),!1,t,n)):this.append(o,...e.slice(1).map(l=>new Pt(l,!0,t,n)))}toString(r){let{childNodes:[e,...t]}=this;return`-{${e.toString(r)}${e.length>0?"|":""}${t.map(n=>n.toString(r)).join(";")}}-`}text(){let{childNodes:[r,...e]}=this;return`-{${r.text()}|${ge(e,";")}}-`}getAttribute(r){return r==="padding"?2:super.getAttribute(r)}getGaps(r){return r||this.firstChild.length>0?1:0}print(){let{childNodes:[r,...e]}=this;return`-{${r.print()}${r.length>0?"|":""}${Ne(e,{sep:";"})}}-`}}});var Qs={};se(Qs,{parseConverter:()=>Aa});var Aa,Zs=b(()=>{"use strict";Xs();Aa=(a,r,e)=>{var l;(l=r.regexConverter)!=null||(r.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${r.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"u"));let t=/-\{/gu,n=/-\{|\}-/gu,i=[],s=t,o=s.exec(a);for(;o;){let{0:g,index:p}=o;if(g==="}-"){let d=i.pop(),{length:c}=e,h=a.slice(d.index+2,p),m=h.indexOf("|"),[k,x]=m===-1?[[],h]:[h.slice(0,m).split(";"),h.slice(m+1)],A=x.replace(/(&[#a-z\d]+);/giu,"$1"),S=A.split(r.regexConverter).map($=>$.replace(/\x01/gu,";"));new Ur(k,S,r,e),a=`${a.slice(0,d.index)}\0${c}v\x7F${a.slice(p+2)}`,i.length===0&&(s=t),s.lastIndex=d.index+3+String(c).length}else i.push(o),s=n,s.lastIndex=p+2;o=s.exec(a)}return a}});var Dr={};se(Dr,{Token:()=>y});var ir,fe,O,z,at,Bt,sr,M,Js,Ks,Ys,eo,to,ro,no,io,so,oo,ao,lo,Bn,y,P=b(()=>{"use strict";J();Se();be();_();F();hi();xi();Bn=class Bn extends ur{constructor(e,t=f.getConfig(),n=[],i){super();T(this,M);T(this,ir,"plain");T(this,fe,0);T(this,O);T(this,z);T(this,at);T(this,Bt,!1);T(this,sr);typeof e=="string"&&this.insertAt(e),v(this,O,t),v(this,z,n),n.push(this)}get type(){return u(this,ir)}set type(e){v(this,ir,e)}parseOnce(e=u(this,fe),t=!1){if(e=11)return this;switch(e){case 0:if(this.type==="root"){u(this,z).pop();let n=R(this,M,Js).call(this);t&&(t=!n)}v(this,at,t),R(this,M,Ks).call(this,t);break;case 1:R(this,M,Ys).call(this);break;case 2:R(this,M,eo).call(this);break;case 3:R(this,M,to).call(this);break;case 4:R(this,M,ro).call(this);break;case 5:R(this,M,no).call(this);break;case 6:R(this,M,io).call(this);break;case 7:R(this,M,so).call(this);break;case 8:R(this,M,oo).call(this);break;case 9:R(this,M,ao).call(this);break;case 10:R(this,M,lo).call(this)}if(this.type==="root")for(let n of u(this,z))n==null||n.parseOnce(e,t);return dr(this,fe)._++,this}buildFromStr(e,t){let n=e.split(/[\0\x7F]/u).map((i,s)=>{if(s%2===0)return new Wt(i);if(isNaN(i.slice(-1)))return u(this,z)[Number(i.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${i}`)});return t===0?n.map(String).join(""):t===1?ge(n):n}build(){v(this,fe,11);let{length:e,firstChild:t}=this,n=t==null?void 0:t.toString();if(e===1&&t.type==="text"&&n.includes("\0")&&(this.replaceChildren(...this.buildFromStr(n)),this.normalize(),this.type==="root"))for(let i of u(this,z))i==null||i.build()}afterBuild(){if(this.type==="root")for(let e of u(this,z))e==null||e.afterBuild();v(this,Bt,!0)}parse(e=11,t){for(e=Math.min(e,11);u(this,fe)1&&!m.startsWith("#mw-customcollapsible-")){let x=!m.startsWith("#"),A=`duplicated ${x?"category":"id"}`,S=x?"error":"warning";n.push(...[...k].map($=>{let w=N($,{start:$.getAbsoluteIndex()},"no-duplicate",A,S);return x&&(w.suggestions=[{desc:"remove",range:[w.startIndex,w.endIndex],text:""}]),w}))}let l=//gu,g=this.toString(),p=[],d=l.exec(g),c=0,h=0;for(;d;){let{1:m,index:k}=d,x=(i=d[2])==null?void 0:i.trim();h+=g.slice(c,k).split(` -`).length-1,c=k,p.push({line:h+(m==="disable-line"?0:1),from:m==="disable"?l.lastIndex:void 0,to:m==="enable"?l.lastIndex:void 0,rules:x?new Set(x.split(",").map(A=>A.trim())):void 0}),d=l.exec(g)}n=n.filter(({rule:m,startLine:k,startIndex:x})=>{let A={pos:0};for(let{line:S,from:$,to:w,rules:L}of p){if(S>k+1)break;if(L&&!L.has(m))continue;if(S===k&&$===void 0&&w===void 0)return!1;$<=x&&$>A.pos?(A.pos=$,A.type="from"):w<=x&&w>A.pos&&(A.pos=w,A.type="to")}return A.type!=="from"})}return n}toString(e,t){var s;let{rev:n}=ye,i=this.getRootNode();return!e&&i.type==="root"&&u(i,Bt)?((s=u(this,sr))!=null||v(this,sr,[n,super.toString(!1,t)]),u(this,sr)[1]):super.toString(e,t)}};ir=new WeakMap,fe=new WeakMap,O=new WeakMap,z=new WeakMap,at=new WeakMap,Bt=new WeakMap,sr=new WeakMap,M=new WeakSet,Js=function(){let{parseRedirect:e}=(Ai(),Z(vi)),t=this.firstChild.toString(),n=e(t,u(this,O),u(this,z));return n&&this.setText(n),!!n},Ks=function(e){let{parseCommentAndExt:t}=(Qt(),Z(ps));this.setText(t(this.firstChild.toString(),u(this,O),u(this,z),e))},Ys=function(){let{parseBraces:e}=(Sr(),Z(Xi)),t=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,n=e(t,u(this,O),u(this,z));this.setText(this.type==="root"?n:n.slice(1))},eo=function(){var t;if((t=u(this,O).excludes)!=null&&t.includes("html"))return;let{parseHtml:e}=(cs(),Z(us));this.setText(e(this.firstChild.toString(),u(this,O),u(this,z)))},to=function(){var t;if((t=u(this,O).excludes)!=null&&t.includes("table"))return;let{parseTable:e}=(vs(),Z(ks));this.setText(e(this,u(this,O),u(this,z)))},ro=function(){var t;if((t=u(this,O).excludes)!=null&&t.includes("hr"))return;let{parseHrAndDoubleUnderscore:e}=($s(),Z(Cs));this.setText(e(this,u(this,O),u(this,z)))},no=function(){let{parseLinks:e}=(Ps(),Z(Rs));this.setText(e(this.firstChild.toString(),u(this,O),u(this,z)))},io=function(){var n;if((n=u(this,O).excludes)!=null&&n.includes("quote"))return;let{parseQuotes:e}=(Fn(),Z(Es)),t=this.firstChild.toString().split(` +${c}${x}`,!0),p($,i[i.length-1])}else if(A){l=g(),l.type==="tr"&&(l=i.pop());let w=new _r(` +${c}${A}`,$,t,n);i.push(l,w),l.insertAt(w)}else{l=g();let w=S==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu,L=w.exec($),B=0,j=` +${c}${S}`,q=D=>{let H=new it(j,$.slice(B,L==null?void 0:L.index),t,n);return D.insertAt(H),H};for(;L;)q(l),{lastIndex:B}=w,[j]=L,L=w.exec($);i.push(l,q(l))}}return o.slice(1)}});var Or,As=b(()=>{"use strict";_e();Or=class extends re{get type(){return"hr"}}});var ws,Ln,ba,ot,Ss=b(()=>{"use strict";Xe();F();_e();ws=[ue()];ot=class extends(ba=re){get type(){return"double-underscore"}constructor(r,e,t=f.getConfig(),n){super(r,t,n)}getAttribute(r){return r==="padding"?2:super.getAttribute(r)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}};Ln=le(ba),ot=ge(Ln,0,"DoubleUnderscoreToken",ws,ot),de(Ln,1,ot)});var Cs={};se(Cs,{parseHrAndDoubleUnderscore:()=>Ta});var Ta,$s=b(()=>{"use strict";As();Ss();un();Ta=({firstChild:{data:a},type:r,name:e},t,n)=>{var l;let{doubleUnderscore:i}=t,s=new Set(i[0]),o=new Set(i[1]);return(l=t.regexHrAndDoubleUnderscore)!=null||(t.regexHrAndDoubleUnderscore=new RegExp(`__(${[...s,...o].join("|")})__`,"giu")),r!=="root"&&(r!=="ext-inner"||e!=="poem")&&(a=`\0${a}`),a=a.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(p,g,d)=>(new Or(d,t,n),`${g}\0${n.length-1}r\x7F`)).replace(t.regexHrAndDoubleUnderscore,(p,g)=>{var m,k;let d=o.has(g),c=g.toLowerCase(),h=s.has(c);return d||h?(new ot(g,d,t,n),`\0${n.length-1}${h&&((k=(m=i[2])==null?void 0:m[c])!=null?k:c)==="toc"?"u":"n"}\x7F`):p}).replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(p,g,d,c,h)=>{let m=`${g}\0${n.length}h\x7F`;return new kt(d.length,[c,h],t,n),m}),r==="root"||r==="ext-inner"&&e==="poem"?a:a.slice(1)}});var Mr,Ns=b(()=>{"use strict";_();Q();F();_e();Mr=class extends re{get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}text(){let{parentNode:r,innerText:e}=this;return(r==null?void 0:r.type)==="image-parameter"&&r.name!=="caption"?"":e}lint(r=this.getAbsoluteIndex()){let{previousSibling:e,nextSibling:t,bold:n}=this,i=f.msg('lonely "$1"',"'"),s=[],o=new E(this,r),l,p=(g,d,c)=>({desc:"escape",range:[g,d],text:"'".repeat(c)});if((e==null?void 0:e.type)==="text"&&e.data.endsWith("'")){l=N(this,o,"lonely-apos",i);let{startIndex:g,startLine:d,startCol:c}=l,[,{length:h}]=/(?:^|[^'])('+)$/u.exec(e.data),m=r-h;s.push({...l,startIndex:m,endIndex:g,startCol:c-h,endLine:d,endCol:c,suggestions:[p(m,g,h)]})}if((t==null?void 0:t.type)==="text"&&t.data.startsWith("'")){l!=null||(l=N(this,o,"lonely-apos",i));let{endIndex:g,endLine:d,endCol:c}=l,[{length:h}]=/^'+/u.exec(t.data),m=g+h;s.push({...l,startIndex:g,endIndex:m,startLine:d,startCol:c,endCol:c+h,suggestions:[p(g,m,h)]})}return n&&this.closest("heading-title")&&s.push(N(this,o,"bold-header","bold in section header","warning")),s}json(){let r=super.json();return Object.assign(r,{bold:this.bold,italic:this.italic}),r}}});var Es={};se(Es,{parseQuotes:()=>In});var In,Fn=b(()=>{"use strict";Ns();In=(a,r,e)=>{var g;let t=a.split(/('{2,})/u),{length:n}=t;if(n===1)return a;let i=0,s=0,o,l,p;for(let d=1;dRn});var Rn,Pn=b(()=>{"use strict";J();Tn();Ir();Rn=(a,r,e,t)=>{var n;return(n=r.regexExternalLinks)!=null||(r.regexExternalLinks=new RegExp(String.raw`\[(\0\d+f\x7F|(?:(?:${r.protocol}|//)${Ae}|\0\d+m\x7F)${we}(?=[[\]<>"\t\p{Zs}]|\0\d))(\p{Zs}*(?!\p{Zs}))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),a.replace(r.regexExternalLinks,(i,s,o,l)=>{let{length:p}=e,g=/&[lg]t;/u.exec(s);return g&&(s=s.slice(0,g.index),o="",l=s.slice(g.index)+o+l),t?(new Le(s,"ext-link-url",r,e),`[\0${p}f\x7F${o}${l}]`):(new Ct(s,o,l,r,e),`\0${p}w\x7F`)})}});var Gr,Is=b(()=>{"use strict";Ht();Gr=class extends Ce{get type(){return"category"}}});var Rs={};se(Rs,{parseLinks:()=>Fs});var ya,Fs,Ps=b(()=>{"use strict";F();Fn();Pn();bn();fn();Is();ya=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)(.*)$/su,Fs=(a,r,e)=>{var s;(s=r.regexLinks)!=null||(r.regexLinks=new RegExp(String.raw`^\s*(?:${r.protocol}|//)`,"iu"));let t=r.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)(.*?[^\]]))?\]\](.*)$/su:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)(.*?[^\]])?)?\]\](.*)$/su,n=a.split("[["),i=n.shift();for(let o=0;o2){L=!0,d+=`[[${j[0]}]]${j[1]}`,c=j.slice(2).join("]]");break}else if(j.length===2)d+=`[[${j[0]}]]${j[1]}`;else{d+=`[[${B}`;break}}if(d=Fs(d,r,e),!L){i+=`[[${p}${g}${d}`;continue}}}else{i+=`[[${h}`;continue}d&&(d=In(d,r,e));let w=St;k||(!$&&A===6?(d&&(d=Rn(d,r,e,!0)),w=At):!$&&A===14&&(w=Gr)),d===void 0&&g&&(d=""),i+=`\0${e.length}l\x7F${c}`,new w(p,d,r,e,g)}return i}});var _s={};se(_s,{parseMagicLinks:()=>va});var qs,Bs,js,ka,va,Os=b(()=>{"use strict";J();Ir();qs=String.raw`[\p{Zs}\t]| |�*160;|�*a0;`,Bs=`(?:${qs})+`,js=`(?:${qs}|-)`,ka=String.raw`(?:RFC|PMID)${Bs}\d+\b|ISBN${Bs}(?:97[89]${js}?)?(?:\d${js}?){9}[\dx]\b`,va=(a,r,e)=>{var t;return(t=r.regexMagicLinks)!=null||(r.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\d_])(?:(?:${r.protocol})(${Ae}${we})|${ka})`,"giu")),a.replace(r.regexMagicLinks,(n,i,s)=>{let o=i?n.slice(i.length):n;if(s){let l="",p=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(o);p&&(l=o.slice(p.index),o=o.slice(0,p.index));let g=o.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,d=g.exec(o);if(d){let c=1;d[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(o.slice(0,d.index))&&(c=2),l=o.slice(d.index+c)+l,o=o.slice(0,d.index+c)}return l.length>=s.length?n:(new Le(o,void 0,r,e),`${i}\0${e.length-1}w\x7F${l}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(o))return n;return new Le(o,"magic-link",r,e),`${i}\0${e.length-1}i\x7F`})}});var Ms,Gs=b(()=>{"use strict";Ms=(a,r)=>a.startsWith(r)?r.length:[...r].findIndex((e,t)=>e!==a[t])});var zr,zs=b(()=>{"use strict";Nn();zr=class extends Ft{get type(){return"list"}}});var Ws={};se(Ws,{parseList:()=>Aa});var Aa,Us=b(()=>{"use strict";Gs();zs();En();Aa=(a,r,e,t)=>{let n=/^((?:\0\d+[cno]\x7F)*)([;:*#]+\s*)/u.exec(a);if(!n)return r.lastPrefix="",a;let[i,s,o]=n,l=o.replace(/;/gu,":"),p=Ms(l,r.lastPrefix),g=(p>1?o.slice(p-1):o).split(/(?=;)/u),d=g[0].startsWith(";"),c=g.length-(d?0:1);if(p>1){let q=o.slice(0,p-1);d?g.unshift(q):g[0]=q+g[0]}r.lastPrefix=l;let h=s+g.map((q,D)=>`\0${t.length+D}d\x7F`).join("")+a.slice(i.length);for(let q of g)new zr(q,e,t);if(!c)return h;let{html:[m]}=e,k=/:+|-\{|\0\d+[xq]\x7F/gu,x=k,A=x.exec(h),S=0,$=!1,w=!1,L=0,B=(q,D)=>(new Rt(q,e,t),`${h.slice(0,D)}\0${t.length-1}d\x7F${h.slice(D+q.length)}`),j=q=>{q?S&&S--:S++};for(;A&&c;){let{0:q,index:D}=A;if(q==="-{"){if(!L){let{lastIndex:H}=x;x=/-\{|\}-/gu,x.lastIndex=H}L++}else if(q==="}-"){if(L--,!L){let{lastIndex:H}=x;x=k,x.lastIndex=H}}else if(q.endsWith("x\x7F")){let{name:H,closing:ne,selfClosing:ee}=t[Number(q.slice(1,-2))];(!ee||m.includes(H))&&j(ne)}else if(q.endsWith("q\x7F")){let{bold:H,italic:ne}=t[Number(q.slice(1,-2))];H&&(j($),$=!$),ne&&(j(w),w=!w)}else if(S===0){if(q.length>=c)return B(q.slice(0,c),D);c-=q.length,x.lastIndex=D+4+String(t.length).length,h=B(q,D)}A=x.exec(h)}return h}});var Ds,Fe,Wr,Hs=b(()=>{"use strict";_();Q();F();P();Ee();Ds=new Set(["A","T","R","D","-","H","N"]),Wr=class extends y{constructor(e,t=f.getConfig(),n=[]){super(void 0,t,n,{});T(this,Fe);this.append(...e.map(i=>new G(i,"converter-flag",t,n)))}get type(){return"converter-flags"}afterBuild(){v(this,Fe,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(u(this,Fe).filter(e=>/\{{3}[^{}]+\}{3}/u.test(e)))}getVariantFlags(){let e=new Set(this.getAttribute("config").variants);return new Set(u(this,Fe).filter(t=>e.has(t)))}lint(e=this.getAbsoluteIndex(),t){let n=this.getVariantFlags(),i=this.getUnknownFlags(),s=new Set(u(this,Fe).filter(d=>Ds.has(d))),o=u(this,Fe).filter(d=>!d).length,l=u(this,Fe).length-i.size-o,p=super.lint(e,t);if(n.size===l||s.size===l)return p;let g=new E(this,e);for(let[d,c]of this.childNodes.entries()){let h=c.text().trim();if(h&&!n.has(h)&&!i.has(h)&&(n.size>0||!s.has(h))){let m=C(c,g,"no-ignored","invalid conversion flag");n.size===0&&Ds.has(h.toUpperCase())?m.fix={range:[m.startIndex,m.endIndex],text:h.toUpperCase()}:m.suggestions=[{desc:"remove",range:[m.startIndex-(d&&1),m.endIndex],text:""}],p.push(m)}}return p}print(){return super.print({sep:";"})}};Fe=new WeakMap});var Pt,Vs=b(()=>{"use strict";F();P();Ee();Pt=class extends y{get type(){return"converter-rule"}constructor(r,e=!0,t=f.getConfig(),n=[]){super(void 0,t,n);let i=r.indexOf(":"),s=r.slice(0,i).indexOf("=>"),o=s===-1?r.slice(0,i):r.slice(s+2,i);e&&t.variants.includes(o.trim())?(super.insertAt(new G(o,"converter-rule-variant",t,n)),super.insertAt(new G(r.slice(i+1),"converter-rule-to",t,n)),s!==-1&&super.insertAt(new G(r.slice(0,s),"converter-rule-from",t,n),0)):super.insertAt(new G(r,"converter-rule-to",t,n))}toString(r){let{childNodes:e,firstChild:t,lastChild:n}=this;return e.length===3?`${t.toString(r)}=>${e[1].toString(r)}:${n.toString(r)}`:super.toString(r,":")}text(){let{childNodes:r,firstChild:e,lastChild:t}=this;return r.length===3?`${e.text()}=>${r[1].text()}:${t.text()}`:super.text(":")}getGaps(r){return r===0&&this.length===3?2:1}print(){let{childNodes:r}=this;if(r.length===3){let[e,t,n]=r;return`${e.print()}=>${t.print()}:${n.print()}`}return super.print({sep:":"})}}});var Ur,Xs=b(()=>{"use strict";J();F();P();Hs();Vs();Ur=class extends y{get type(){return"converter"}constructor(r,e,t=f.getConfig(),n=[]){super(void 0,t,n),this.append(new Wr(r,t,n));let[i]=e,s=i.includes(":"),o=new Pt(i,s,t,n);s&&o.length===1||!s&&e.length===2&&!te(e[1]).trim()?this.insertAt(new Pt(e.join(";"),!1,t,n)):this.append(o,...e.slice(1).map(l=>new Pt(l,!0,t,n)))}toString(r){let{childNodes:[e,...t]}=this;return`-{${e.toString(r)}${e.length>0?"|":""}${t.map(n=>n.toString(r)).join(";")}}-`}text(){let{childNodes:[r,...e]}=this;return`-{${r.text()}|${pe(e,";")}}-`}getAttribute(r){return r==="padding"?2:super.getAttribute(r)}getGaps(r){return r||this.firstChild.length>0?1:0}print(){let{childNodes:[r,...e]}=this;return`-{${r.print()}${r.length>0?"|":""}${Ne(e,{sep:";"})}}-`}}});var Qs={};se(Qs,{parseConverter:()=>wa});var wa,Zs=b(()=>{"use strict";Xs();wa=(a,r,e)=>{var l;(l=r.regexConverter)!=null||(r.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${r.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"u"));let t=/-\{/gu,n=/-\{|\}-/gu,i=[],s=t,o=s.exec(a);for(;o;){let{0:p,index:g}=o;if(p==="}-"){let d=i.pop(),{length:c}=e,h=a.slice(d.index+2,g),m=h.indexOf("|"),[k,x]=m===-1?[[],h]:[h.slice(0,m).split(";"),h.slice(m+1)],A=x.replace(/(&[#a-z\d]+);/giu,"$1"),S=A.split(r.regexConverter).map($=>$.replace(/\x01/gu,";"));new Ur(k,S,r,e),a=`${a.slice(0,d.index)}\0${c}v\x7F${a.slice(g+2)}`,i.length===0&&(s=t),s.lastIndex=d.index+3+String(c).length}else i.push(o),s=n,s.lastIndex=g+2;o=s.exec(a)}return a}});var Dr={};se(Dr,{Token:()=>y});var ir,fe,O,z,at,Bt,sr,M,Js,Ks,Ys,eo,to,ro,no,io,so,oo,ao,lo,Bn,y,P=b(()=>{"use strict";J();Se();be();_();F();hi();xi();Bn=class Bn extends ur{constructor(e,t=f.getConfig(),n=[],i){super();T(this,M);T(this,ir,"plain");T(this,fe,0);T(this,O);T(this,z);T(this,at);T(this,Bt,!1);T(this,sr);typeof e=="string"&&this.insertAt(e),v(this,O,t),v(this,z,n),n.push(this)}get type(){return u(this,ir)}set type(e){v(this,ir,e)}parseOnce(e=u(this,fe),t=!1){if(e=11)return this;switch(e){case 0:if(this.type==="root"){u(this,z).pop();let n=R(this,M,Js).call(this);t&&(t=!n)}v(this,at,t),R(this,M,Ks).call(this,t);break;case 1:R(this,M,Ys).call(this);break;case 2:R(this,M,eo).call(this);break;case 3:R(this,M,to).call(this);break;case 4:R(this,M,ro).call(this);break;case 5:R(this,M,no).call(this);break;case 6:R(this,M,io).call(this);break;case 7:R(this,M,so).call(this);break;case 8:R(this,M,oo).call(this);break;case 9:R(this,M,ao).call(this);break;case 10:R(this,M,lo).call(this)}if(this.type==="root")for(let n of u(this,z))n==null||n.parseOnce(e,t);return dr(this,fe)._++,this}buildFromStr(e,t){let n=e.split(/[\0\x7F]/u).map((i,s)=>{if(s%2===0)return new Wt(i);if(isNaN(i.slice(-1)))return u(this,z)[Number(i.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${i}`)});return t===0?n.map(String).join(""):t===1?pe(n):n}build(){v(this,fe,11);let{length:e,firstChild:t}=this,n=t==null?void 0:t.toString();if(e===1&&t.type==="text"&&n.includes("\0")&&(this.replaceChildren(...this.buildFromStr(n)),this.normalize(),this.type==="root"))for(let i of u(this,z))i==null||i.build()}afterBuild(){if(this.type==="root")for(let e of u(this,z))e==null||e.afterBuild();v(this,Bt,!0)}parse(e=11,t){for(e=Math.min(e,11);u(this,fe)1&&!m.startsWith("#mw-customcollapsible-")){let x=!m.startsWith("#"),A=`duplicated ${x?"category":"id"}`,S=x?"error":"warning";n.push(...[...k].map($=>{let w=N($,{start:$.getAbsoluteIndex()},"no-duplicate",A,S);return x&&(w.suggestions=[{desc:"remove",range:[w.startIndex,w.endIndex],text:""}]),w}))}let l=//gu,p=this.toString(),g=[],d=l.exec(p),c=0,h=0;for(;d;){let{1:m,index:k}=d,x=(i=d[2])==null?void 0:i.trim();h+=p.slice(c,k).split(` +`).length-1,c=k,g.push({line:h+(m==="disable-line"?0:1),from:m==="disable"?l.lastIndex:void 0,to:m==="enable"?l.lastIndex:void 0,rules:x?new Set(x.split(",").map(A=>A.trim())):void 0}),d=l.exec(p)}n=n.filter(({rule:m,startLine:k,startIndex:x})=>{let A={pos:0};for(let{line:S,from:$,to:w,rules:L}of g){if(S>k+1)break;if(L&&!L.has(m))continue;if(S===k&&$===void 0&&w===void 0)return!1;$<=x&&$>A.pos?(A.pos=$,A.type="from"):w<=x&&w>A.pos&&(A.pos=w,A.type="to")}return A.type!=="from"})}return n}toString(e,t){var s;let{rev:n}=ye,i=this.getRootNode();return!e&&i.type==="root"&&u(i,Bt)?((s=u(this,sr))!=null||v(this,sr,[n,super.toString(!1,t)]),u(this,sr)[1]):super.toString(e,t)}};ir=new WeakMap,fe=new WeakMap,O=new WeakMap,z=new WeakMap,at=new WeakMap,Bt=new WeakMap,sr=new WeakMap,M=new WeakSet,Js=function(){let{parseRedirect:e}=(Ai(),Z(vi)),t=this.firstChild.toString(),n=e(t,u(this,O),u(this,z));return n&&this.setText(n),!!n},Ks=function(e){let{parseCommentAndExt:t}=(Qt(),Z(gs));this.setText(t(this.firstChild.toString(),u(this,O),u(this,z),e))},Ys=function(){let{parseBraces:e}=(Sr(),Z(Xi)),t=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,n=e(t,u(this,O),u(this,z));this.setText(this.type==="root"?n:n.slice(1))},eo=function(){var t;if((t=u(this,O).excludes)!=null&&t.includes("html"))return;let{parseHtml:e}=(cs(),Z(us));this.setText(e(this.firstChild.toString(),u(this,O),u(this,z)))},to=function(){var t;if((t=u(this,O).excludes)!=null&&t.includes("table"))return;let{parseTable:e}=(vs(),Z(ks));this.setText(e(this,u(this,O),u(this,z)))},ro=function(){var t;if((t=u(this,O).excludes)!=null&&t.includes("hr"))return;let{parseHrAndDoubleUnderscore:e}=($s(),Z(Cs));this.setText(e(this,u(this,O),u(this,z)))},no=function(){let{parseLinks:e}=(Ps(),Z(Rs));this.setText(e(this.firstChild.toString(),u(this,O),u(this,z)))},io=function(){var n;if((n=u(this,O).excludes)!=null&&n.includes("quote"))return;let{parseQuotes:e}=(Fn(),Z(Es)),t=this.firstChild.toString().split(` `);for(let i=0;i0){let{parseConverter:e}=(Zs(),Z(Qs));this.setText(e(this.firstChild.toString(),u(this,O),u(this,z)))}};y=Bn});var ye,vt,sn,Ts,hr,be=b(()=>{"use strict";ye={running:!1,run(a){let{running:r}=this;this.running=!0;try{let{Token:e}=(P(),Z(Dr)),t=a();return t instanceof e&&!t.getAttribute("built")&&t.afterBuild(),this.running=r,t}catch(e){throw this.running=r,e}},rev:0},vt=a=>r=>r.type===a,sn=(a,r,e,t=[])=>{let n=[...a.childNodes],i=n.splice(r,e,...t);a.setAttribute("childNodes",n);for(let s of t)s.setAttribute("parentNode",a);return i},Ts=(a,r)=>new Array(a).fill(void 0).map((e,t)=>r(t)),hr=(a,r)=>{Object.defineProperty(a,"name",{value:r.name})}});var po={};se(po,{Title:()=>jn});var or,ar,jt,Re,jn,go=b(()=>{"use strict";J();jn=class{constructor(r,e,t,n,i){T(this,or);T(this,ar);T(this,jt);T(this,Re);X(this,"interwiki","");X(this,"valid");X(this,"encoded",!1);let s=r.trim().startsWith("../");if(n&&r.includes("%"))try{let l=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(r);r=(0,pr.rawurldecode)(r),this.encoded=l}catch(l){}if(r=Mt(r).replace(/[_ ]+/gu," ").trim(),s)v(this,jt,0);else{let l=e;r.startsWith(":")&&(l=0,r=r.slice(1).trim());let g=r.split(":");if(g.length>1){let p=g[0].trim().toLowerCase(),d=Object.prototype.hasOwnProperty.call(t.nsid,p)&&t.nsid[p];d&&(l=d,r=g.slice(1).join(":").trim())}v(this,jt,l)}let o=r.indexOf("#");if(o!==-1){let l=r.slice(o+1).trimEnd();if(l.includes("%"))try{l=(0,pr.rawurldecode)(l)}catch(g){}v(this,Re,l.replace(/ /gu,"_")),r=r.slice(0,o).trim()}this.valid=!!(r||this.interwiki||i&&this.ns===0&&u(this,Re)!==void 0)&&Mt(r)===r&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(s?/^(?:\.\.\/)+(.*)/u.exec(r)[1]:r),this.main=r,Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}}),v(this,ar,t.namespaces)}get ns(){return u(this,jt)}get fragment(){return u(this,Re)}get main(){return u(this,or)}set main(r){r=r.replace(/_/gu," ").trim(),v(this,or,r&&r[0].toUpperCase()+r.slice(1))}get prefix(){let r=u(this,ar)[this.ns];return r+(r&&":")}get title(){return this.getRedirection()[1]}get extension(){let{main:r}=this,e=r.lastIndexOf(".");return e===-1?void 0:r.slice(e+1).toLowerCase()}toString(r){return`${r?this.title.replace(/_/gu," "):this.title}${u(this,Re)===void 0?"":`#${u(this,Re)}`}`}getRedirection(){return[!1,(this.interwiki+(this.interwiki&&":")+this.prefix+this.main).replace(/ /gu,"_")]}setFragment(r){v(this,Re,r)}};or=new WeakMap,ar=new WeakMap,jt=new WeakMap,Re=new WeakMap});var qt,uo,wa,f,F=b(()=>{Qn();be();Se();J();qt={config:Yr,i18n:void 0,rules:Xn,getConfig(){let{doubleUnderscore:a}=this.config;return a.length>2&&a[0].length===0&&(a[0]=Object.keys(a[2])),{...Yr,...this.config,excludes:[]}},msg(a,r=""){var e,t;return a&&((t=(e=this.i18n)==null?void 0:e[a])!=null?t:a).replace("$1",this.msg(r))},normalizeTitle(a,r=0,e,t=qt.getConfig(),n,i=!1,s=!1){let{Title:o}=(go(),Z(po)),l;if(n)l=new o(a,r,t,i,s);else{let{Token:g}=(P(),Z(Dr));l=ye.run(()=>{let p=new g(a,t);p.type="root",p.parseOnce(0,e).parseOnce();let d=new o(p.toString(),r,t,i,s);for(let c of["main","fragment"]){let h=d[c];if(h!=null&&h.includes("\0")){let m=p.buildFromStr(h,1);c==="main"?d.main=m:d.setFragment(m)}}return d})}return l},parse(a,r,e=11,t=qt.getConfig()){if(a=si(a),typeof e!="number"){let s=Array.isArray(e)?e:[e];e=Math.max(...s.map(o=>Zr[o]||11))}let{Token:n}=(P(),Z(Dr));return ye.run(()=>{let s=new n(a,t);return s.type="root",s.parse(e,r)})}},uo={},wa=new Set(["normalizeTitle","parse"]);for(let a in qt)wa.has(a)||(uo[a]={enumerable:!1});Object.defineProperties(qt,uo);Object.assign(globalThis,{Parser:qt});f=qt});F();})(); +`))},lo=function(){if(u(this,O).variants.length>0){let{parseConverter:e}=(Zs(),Z(Qs));this.setText(e(this.firstChild.toString(),u(this,O),u(this,z)))}};y=Bn});var ye,vt,sn,Ts,hr,be=b(()=>{"use strict";ye={running:!1,run(a){let{running:r}=this;this.running=!0;try{let{Token:e}=(P(),Z(Dr)),t=a();return t instanceof e&&!t.getAttribute("built")&&t.afterBuild(),this.running=r,t}catch(e){throw this.running=r,e}},rev:0},vt=a=>r=>r.type===a,sn=(a,r,e,t=[])=>{let n=[...a.childNodes],i=n.splice(r,e,...t);a.setAttribute("childNodes",n);for(let s of t)s.setAttribute("parentNode",a);return i},Ts=(a,r)=>new Array(a).fill(void 0).map((e,t)=>r(t)),hr=(a,r)=>{Object.defineProperty(a,"name",{value:r.name})}});var go={};se(go,{Title:()=>jn});var or,ar,jt,Re,jn,po=b(()=>{"use strict";J();jn=class{constructor(r,e,t,n,i){T(this,or);T(this,ar);T(this,jt);T(this,Re);X(this,"interwiki","");X(this,"valid");X(this,"encoded",!1);let s=r.trim().startsWith("../");if(n&&r.includes("%"))try{let l=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(r);r=(0,gr.rawurldecode)(r),this.encoded=l}catch(l){}if(r=Mt(r).replace(/[_ ]+/gu," ").trim(),s)v(this,jt,0);else{let l=e;r.startsWith(":")&&(l=0,r=r.slice(1).trim());let p=r.split(":");if(p.length>1){let g=p[0].trim().toLowerCase(),d=Object.prototype.hasOwnProperty.call(t.nsid,g)&&t.nsid[g];d&&(l=d,r=p.slice(1).join(":").trim())}v(this,jt,l)}let o=r.indexOf("#");if(o!==-1){let l=r.slice(o+1).trimEnd();if(l.includes("%"))try{l=(0,gr.rawurldecode)(l)}catch(p){}v(this,Re,l.replace(/ /gu,"_")),r=r.slice(0,o).trim()}this.valid=!!(r||this.interwiki||i&&this.ns===0&&u(this,Re)!==void 0)&&Mt(r)===r&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(s?/^(?:\.\.\/)+(.*)/u.exec(r)[1]:r),this.main=r,Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}}),v(this,ar,t.namespaces)}get ns(){return u(this,jt)}get fragment(){return u(this,Re)}get main(){return u(this,or)}set main(r){r=r.replace(/_/gu," ").trim(),v(this,or,r&&r[0].toUpperCase()+r.slice(1))}get prefix(){let r=u(this,ar)[this.ns];return r+(r&&":")}get title(){return this.getRedirection()[1]}get extension(){let{main:r}=this,e=r.lastIndexOf(".");return e===-1?void 0:r.slice(e+1).toLowerCase()}toString(r){return`${r?this.title.replace(/_/gu," "):this.title}${u(this,Re)===void 0?"":`#${u(this,Re)}`}`}getRedirection(){return[!1,(this.interwiki+(this.interwiki&&":")+this.prefix+this.main).replace(/ /gu,"_")]}setFragment(r){v(this,Re,r)}};or=new WeakMap,ar=new WeakMap,jt=new WeakMap,Re=new WeakMap});var qt,uo,Sa,f,F=b(()=>{Qn();be();Se();J();qt={config:Yr,i18n:void 0,rules:Xn,getConfig(){let{doubleUnderscore:a}=this.config;return a.length>2&&a[0].length===0&&(a[0]=Object.keys(a[2])),{...Yr,...this.config,excludes:[]}},msg(a,r=""){var e,t;return a&&((t=(e=this.i18n)==null?void 0:e[a])!=null?t:a).replace("$1",this.msg(r))},normalizeTitle(a,r=0,e,t=qt.getConfig(),n,i=!1,s=!1){let{Title:o}=(po(),Z(go)),l;if(n)l=new o(a,r,t,i,s);else{let{Token:p}=(P(),Z(Dr));l=ye.run(()=>{let g=new p(a,t);g.type="root",g.parseOnce(0,e).parseOnce();let d=new o(g.toString(),r,t,i,s);for(let c of["main","fragment"]){let h=d[c];if(h!=null&&h.includes("\0")){let m=g.buildFromStr(h,1);c==="main"?d.main=m:d.setFragment(m)}}return d})}return l},parse(a,r,e=11,t=qt.getConfig()){if(a=si(a),typeof e!="number"){let s=Array.isArray(e)?e:[e];e=Math.max(...s.map(o=>Zr[o]||11))}let{Token:n}=(P(),Z(Dr));return ye.run(()=>{let s=new n(a,t);return s.type="root",s.parse(e,r)})}},uo={},Sa=new Set(["normalizeTitle","parse"]);for(let a in qt)Sa.has(a)||(uo[a]={enumerable:!1});Object.defineProperties(qt,uo);Object.assign(globalThis,{Parser:qt});f=qt});F();})(); //# sourceMappingURL=bundle.min.js.map diff --git a/extensions/base.ts b/extensions/base.ts index 4e938bdd..ae618c59 100644 --- a/extensions/base.ts +++ b/extensions/base.ts @@ -2,7 +2,7 @@ import type {Config, LintError, AST, wikiparse as Wikiparse} from './typings'; declare type WorkerListener = (e: {data: [number, T, string]}) => void; -const version = '1.13.4', +const version = '1.13.5', src = (document.currentScript as HTMLScriptElement | null)?.src, file = /\/extensions\/dist\/base\.(?:min\.)?js$/u, CDN = src && file.test(src) diff --git a/extensions/dist/base.js b/extensions/dist/base.js index 250f0fc0..f177c279 100644 --- a/extensions/dist/base.js +++ b/extensions/dist/base.js @@ -1,6 +1,6 @@ (() => { var _a; -const version = '1.13.4', src = (_a = document.currentScript) === null || _a === void 0 ? void 0 : _a.src, file = /\/extensions\/dist\/base\.(?:min\.)?js$/u, CDN = src && file.test(src) +const version = '1.13.5', src = (_a = document.currentScript) === null || _a === void 0 ? void 0 : _a.src, file = /\/extensions\/dist\/base\.(?:min\.)?js$/u, CDN = src && file.test(src) ? src.replace(file, '') : `https://testingcf.jsdelivr.net/gh/bhsd-harry/wikiparser-node@${version}-b`; const workerJS = () => {