wikiparser-node 1.34.0 → 1.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,31 +1,31 @@
1
- "use strict";(()=>{var ru=Object.defineProperty,lu=Object.defineProperties;var ou=Object.getOwnPropertyDescriptors;var es=Object.getOwnPropertySymbols;var Gn=Object.prototype.hasOwnProperty,Vn=Object.prototype.propertyIsEnumerable;var Qn=e=>{throw TypeError(e)};var Ws=(e,t,s)=>t in e?ru(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,he=(e,t)=>{for(var s in t||(t={}))Gn.call(t,s)&&Ws(e,s,t[s]);if(es)for(var s of es(t))Vn.call(t,s)&&Ws(e,s,t[s]);return e},je=(e,t)=>lu(e,ou(t));var Jn=(e,t)=>{var s={};for(var i in e)Gn.call(e,i)&&t.indexOf(i)<0&&(s[i]=e[i]);if(e!=null&&es)for(var i of es(e))t.indexOf(i)<0&&Vn.call(e,i)&&(s[i]=e[i]);return s};var au=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Pe=(e,t,s)=>Ws(e,typeof t!="symbol"?t+"":t,s),qs=(e,t,s)=>t.has(e)||Qn("Cannot "+s);var b=(e,t,s)=>(qs(e,t,"read from private field"),s?s.call(e):t.get(e)),L=(e,t,s)=>t.has(e)?Qn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),E=(e,t,s,i)=>(qs(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),P=(e,t,s)=>(qs(e,t,"access private method"),s);var Xn=(e,t,s,i)=>({set _(r){E(e,t,r,s)},get _(){return b(e,t,i)}});var xd=au((bd,nu)=>{var Xl=Object.create,st=Object.defineProperty,Kl=Object.getOwnPropertyDescriptor,mn=Object.getOwnPropertyNames,uu=Object.getPrototypeOf,du=Object.prototype.hasOwnProperty,Yl=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),kt=e=>{throw TypeError(e)},Zl=(e,t,s)=>t in e?st(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Kn=(e,t)=>st(e,"name",{value:t,configurable:!0}),$=(e,t)=>function(){return e&&(t=(0,e[mn(e)[0]])(e=0)),t},eo=(e,t)=>function(){return t||(0,e[mn(e)[0]])((t={exports:{}}).exports,t),t.exports},Z=(e,t)=>{for(var s in t)st(e,s,{get:t[s],enumerable:!0})},to=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of mn(t))!du.call(e,r)&&r!==s&&st(e,r,{get:()=>t[r],enumerable:!(i=Kl(t,r))||i.enumerable});return e},hu=(e,t,s)=>(s=e!=null?Xl(uu(e)):{},to(t||!e||!e.__esModule?st(s,"default",{value:e,enumerable:!0}):s,e)),J=e=>to(st({},"__esModule",{value:!0}),e),X=e=>{var t;return[,,,Xl((t=e==null?void 0:e[Yl("metadata")])!=null?t:null)]},so=["class","method","getter","setter","accessor","field","value","get","set"],Rt=e=>e!==void 0&&typeof e!="function"?kt("Function expected"):e,cu=(e,t,s,i,r)=>({kind:so[e],name:t,metadata:i,addInitializer:n=>s._?kt("Already initialized"):r.push(Rt(n||null))}),xn=(e,t)=>Zl(t,Yl("metadata"),e[3]),G=(e,t,s,i)=>{for(var r=0,n=e[t>>1],l=n&&n.length;r<l;r++)t&1?n[r].call(s):i=n[r].call(s,i);return i},V=(e,t,s,i,r,n)=>{var l,o,u,d,a,h=t&7,g=!!(t&8),c=!!(t&16),p=h>3?e.length+1:h?g?1:2:0,f=so[h+5],m=h>3&&(e[p-1]=[]),S=e[p]||(e[p]=[]),A=h&&(!c&&!g&&(r=r.prototype),h<5&&(h>3||!c)&&Kl(h<4?r:{get[s](){return ce(this,n)},set[s](v){return ke(this,n,v)}},s));h?c&&h<4&&Kn(n,(h>2?"set ":h>1?"get ":"")+s):Kn(r,s);for(var w=i.length-1;w>=0;w--)d=cu(h,s,u={},e[3],S),h&&(d.static=g,d.private=c,a=d.access={has:c?v=>pu(r,v):v=>s in v},h^3&&(a.get=c?v=>(h^1?ce:Yi)(v,r,h^4?n:A.get):v=>v[s]),h>2&&(a.set=c?(v,k)=>ke(v,r,k,h^4?n:A.set):(v,k)=>v[s]=k)),o=(0,i[w])(h?h<4?c?n:A[f]:h>4?void 0:{get:A.get,set:A.set}:r,d),u._=1,h^4||o===void 0?Rt(o)&&(h>4?m.unshift(o):h?c?n=o:A[f]=o:r=o):typeof o!="object"||o===null?kt("Object expected"):(Rt(l=o.get)&&(A.get=l),Rt(l=o.set)&&(A.set=l),Rt(l=o.init)&&m.unshift(l));return h||xn(e,r),A&&st(r,s,A),c?h^4?n:A:r},gu=(e,t,s)=>Zl(e,typeof t!="symbol"?t+"":t,s),vn=(e,t,s)=>t.has(e)||kt("Cannot "+s),pu=(e,t)=>Object(t)!==t?kt('Cannot use the "in" operator on this value'):e.has(t),ce=(e,t,s)=>(vn(e,t,"read from private field"),s?s.call(e):t.get(e)),ze=(e,t,s)=>t.has(e)?kt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),ke=(e,t,s,i)=>(vn(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),Yi=(e,t,s)=>(vn(e,t,"access private method"),s),fu=(e,t,s,i)=>({set _(r){ke(e,t,r,s)},get _(){return ce(e,t,i)}}),io,ys,no=$({"base.ts"(){"use strict";io=(()=>{const e={redirect:1,onlyinclude:1,noinclude:1,include:1,comment:1,ext:1,arg:2,"magic-word":2,template:2,heading:2,html:3,table:4,hr:5,"double-underscore":5,link:6,category:6,file:6,quote:7,"ext-link":8,"free-ext-link":9,"magic-link":9,list:10,dd:10,converter:11};return Object.setPrototypeOf(e,null),e})(),ys=(()=>{const e=["arg-in-ext","bold-header","format-leakage","fostered-content","h1","illegal-attr","insecure-style","invalid-gallery","invalid-imagemap","invalid-invoke","invalid-isbn","invalid-json","invalid-url","lonely-apos","lonely-bracket","lonely-http","nested-link","no-arg","no-duplicate","no-ignored","obsolete-attr","obsolete-tag","parsing-order","pipe-like","syntax-like","table-layout","tag-like","unbalanced-header","unclosed-comment","unclosed-quote","unclosed-table","unescaped","unknown-page","unmatched-tag","unterminated-url","url-encoding","var-anchor","void-ext"];return Object.freeze(e),e})()}});function Ae(e,t,s){return s===1?e.replace(/\0(\d+)g\x7F/gu,(i,r)=>Ae(String(t[r]),t,2)):s===2?e.replace(/\0(\d+)n\x7F/gu,(i,r)=>String(t[r])):e.replace(/\0(\d+)\x7F/gu,(i,r)=>t[r])}var De,Ms,bt,yt,wt,at,ro,fe,it,Yn,Zn,ts,ws,lo,er,tr,mu,de=$({"util/string.ts"(){"use strict";De=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Ms=String.raw`[^[\]<>"\0-\x1F\x7F${De}\uFFFD]`,bt=String.raw`(?:\[[\da-f:.]+\]|${Ms})`,yt=String.raw`(?:${Ms}|\0\d+[cn!~]\x7F)*`,wt=e=>e.trim().toLowerCase(),at=(e,t)=>s=>s.replace(e,t),ro=at(/[\0\x7F]|\r$/gmu,""),fe=at(/\0\d+[cn]\x7F/gu,""),it=(e,t="")=>e.map(s=>typeof s=="string"?s:s.text()).join(t),Yn={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},Zn=at(/&(?:#(\d+|[Xx][\da-fA-F]+)|([lg]t|[LG]T|[lr]brac[ke]|nbsp|amp|AMP|quot|QUOT));/gu,(e,t,s)=>t?String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t)):Yn[s.toLowerCase()]),ws=e=>(ts!=null||(ts=Zn),ts(e)),lo=at(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),er={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},tr=(e=/[&<>"{}[\]|]/gu)=>at(e,t=>`&${er[t]};`),mu=tr(/[&<>]/gu)}}),xu=eo({"config/minimum.json"(e,t){t.exports={ext:[],html:[["b","bdi","del","i","ins","u","font","big","small","sub","sup","h1","h2","h3","h4","h5","h6","cite","code","em","s","strike","strong","tt","var","div","center","blockquote","ol","ul","dl","table","caption","pre","ruby","rb","rp","rt","rtc","p","span","abbr","dfn","kbd","samp","data","time","mark","tr","td","th","q","bdo"],["li","dt","dd"],["br","wbr","hr","meta","link"]],namespaces:{0:"",6:"File",10:"Template",14:"Category",828:"Module"},nsid:{"":0,file:6,template:10,category:14,module:828},functionHook:["msgnw"],variable:["!","=","pageid","articlepath","server","servername","scriptpath","stylepath"],parserFunction:[{msgnw:"msgnw",pageid:"pageid",articlepath:"articlepath",server:"server",servername:"servername",scriptpath:"scriptpath",stylepath:"stylepath","#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"formatdate","#dateformat":"formatdate","#invoke":"invoke","#while":"while","#dowhile":"dowhile","#loop":"loop","#forargs":"forargs","#fornumargs":"fornumargs","#if":"if","#ifeq":"ifeq","#switch":"switch","#ifexist":"ifexist","#ifexpr":"ifexpr","#iferror":"iferror","#time":"time","#timel":"timel","#expr":"expr","#rel2abs":"rel2abs","#titleparts":"titleparts","#categorytree":"categorytree","#urldecode":"urldecode","#choose":"choose","#var":"var","#varexists":"varexists","#var_final":"var_final","#vardefine":"vardefine","#vardefineecho":"vardefineecho","#widget":"widget","#related":"related","#regex":"regex","#regex_var":"regex_var","#regexquote":"regexquote","#regexall":"regexall","#len":"len","#pos":"pos","#rpos":"rpos","#sub":"sub","#count":"count","#rmatch":"rmatch","#rreplace":"rreplace","#replace":"replace","#rsplit":"rsplit","#explode":"explode","#tab":"tab","#seo":"seo","#babel":"babel","#translation":"translation","#commaseparatedlist":"commaseparatedlist","#coordinates":"coordinates","#lst":"lst","#lsth":"lsth","#lstx":"lstx","#assessment":"assessment","#mentor":"mentor","#property":"property","#target":"target","#section":"lst","#section-x":"lstx","#section-h":"lsth","#statements":"statements","#useliquidthreads":"useliquidthreads","#lqtpagelimit":"lqtpagelimit","#avatar":"avatar","#img":"img","#chart":"chart"},{"!":"!","=":"=","#FORMAL":"formal","#bcp47":"bcp47","#dir":"dir","#interwikilink":"interwikilink","#interlanguagelink":"interlanguagelink","#contentmodel":"contentmodel","#timef":"timef","#timefl":"timefl"},["msg","raw"],["subst","safesubst"]],doubleUnderscore:[[],[]],protocol:"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|matrix:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|wikipedia://|worldwind://|xmpp:",interwiki:[],img:{},redirection:["#redirect"],variants:[]}}}),ve,oo,ao,Ss,Zi,Ee=$({"util/constants.ts"(){"use strict";ve=11,oo=void 0,ao=new Set(["alt","link","lang","page","caption"]),Ss=new Set(["tiff","tif","png","gif","jpg","jpeg","webp","xcf","pdf","svg","djvu"]),Zi=xu()}});function vt(e){const t=new Map,s=new WeakMap;return i=>{const r=typeof i=="string"?t:s;if(r.has(i)){const l=r.get(i);return l.lastIndex=0,l}const n=e(i);return r.set(i,n),n}}var Qt,fs,ss,sr,uo,Ge=$({"../common/dist/index.mjs"(){"use strict";Qt=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25")),fs=e=>{const t=[];let s=0;for(const i of e.split(`
2
- `)){const r=s+i.length;t.push([i,s,r]),s=r+1}return t},ss=e=>e&&Number(e[1]),sr=(e,t)=>{var i;let s;for(const r of t){const{line:n,column:l,position:o}=r;o==null?n?(s!=null||(s=fs(e)),(i=r.column)!=null||(r.column=1),r.position=s[n-1][1]+(r.column-1)):(r.position=0,r.line=1,r.column=1):(!n||!l)&&(s!=null||(s=fs(e)),r.line=s.findIndex(([,,u])=>o<=u)+1,r.column=o-s[r.line-1][1]+1)}return t},uo=(e,t)=>{if(t||e.trim())try{JSON.parse(e)}catch(s){const{message:i}=s,r=ss(/\bline (\d+)/u.exec(i)),n=ss(/\bcolumn (\d+)/u.exec(i)),l=ss(/\bposition (\d+)/u.exec(i));return sr(e,[{message:i,line:r,column:n,position:l,severity:"error"}])}return[]}}}),re,ue=$({"lib/rect.ts"(){"use strict";var e,t,s,i,en,n;re=(n=class{constructor(l,o){L(this,i);L(this,e);L(this,t);L(this,s);E(this,e,l),E(this,t,o)}get start(){return b(this,t)}get top(){return P(this,i,en).call(this).top}get left(){return P(this,i,en).call(this).left}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakSet,en=function(){var l;return(l=b(this,s))!=null||E(this,s,b(this,e).getRootNode().posFromIndex(b(this,t))),b(this,s)},n)}}),ir,nr,ms,tn,zs,M,B,$e,Ts,D,bn,He,yn,wn,Sn,Jt,St,kn,tt,ho,q=$({"util/lint.ts"(){"use strict";Ge(),Te(),ue(),j(),ir=new Set(["tr","td","th","caption"]),nr=new Set(["Template:!!","Template:!-"]),ms=e=>{const t=e.childNodes.find(s=>s.text().trim());if(!t||t.type==="text"&&t.data.trim().startsWith("!")||t.is("magic-word")&&t.name==="!"||t.is("template")&&nr.has(t.name)||t.is("html")&&ir.has(t.name))return!1;if(t.is("arg"))return t.length>1&&ms(t.childNodes[1]);if(t.is("magic-word"))try{const s=t.getPossibleValues().map(ms);return s.includes(2)?2:s.includes(1)&&1}catch(s){}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?1:2},tn=(e,t,s,i)=>({line:e+s-1,character:(s===1?t:0)+i}),zs=e=>(t,s,i,r,n="error")=>{const{start:l}=s,{top:o,left:u}=s instanceof re?s:new re(t,l),{offsetHeight:d,offsetWidth:a}=t,{startIndex:h,startLine:g,startCol:c}=e(t,l,o,u),{line:p,character:f}=tn(g,c,d,a);return{rule:i,message:I.msg(r),severity:n,startIndex:h,endIndex:h+t.toString().length,startLine:g,endLine:p,startCol:c,endCol:f}},M=zs((e,t,s,i)=>{const r=e.getRelativeIndex(),{top:n,left:l}=e.parentNode.posFromIndex(r);return{startIndex:t+r,startLine:s+n,startCol:n?l:i+l}}),B=zs((e,t,s,i)=>({startIndex:t,startLine:s,startCol:i})),$e=(e,t,s,i=0)=>({desc:I.msg(t),range:[e.startIndex+i,e.endIndex],text:s}),Ts=(e,t,s)=>({desc:I.msg(t),range:[e,e],text:s}),D=(e,t=0,s="")=>typeof e=="number"?{desc:I.msg("remove"),range:[e,e+t],text:s}:$e(e,"remove",s,t),bn=(e,t)=>$e(e,"decode",Qt(t.text().replace(/%(?=21|3[ce]|5[bd]|7[b-d])/giu,"%25"))),He=(e,t,s=0)=>({desc:I.msg("close"),range:[e+s,e],text:t}),yn=e=>({desc:I.msg("open"),range:[e+1,e+2],text:""}),wn=(e,t)=>$e(e,"comment",`<!--${t}-->`),Sn=(e,t)=>$e(e,"uppercase",t.toUpperCase()),Jt=(e,t=0)=>({desc:I.msg("whitespace"),range:[e,e+t],text:" "}),St=(e,t,s=1)=>({desc:I.msg("escape"),range:[e,e+s],text:t.repeat(s)}),kn=(e,t)=>({desc:I.msg("escape"),range:[e,e+t.length],text:t.replace(/\|/gu,"&#124;")}),tt=(e,t,s,i)=>{if(e&&(i||I.viewOnly&&e[0]===be.rev))return e[1];const r=t();return(i||I.viewOnly)&&s([be.rev,r]),r},ho=(e,t)=>e==="ol"&&t==="type"?["1","a","A","i","I"]:e==="th"&&t==="scope"?["row","col","rowgroup","colgroup"]:t==="dir"?["ltr","rtl","auto"]:t==="aria-hidden"?["true","false"]:[]}}),rr,An,co=$({"util/selector.ts"(){"use strict";rr=e=>{if(e.includes("#")){const t=e.indexOf("#"),s=e.slice(0,t),i=e.slice(t+1);return(r,n)=>(t===0||r===s)&&n===i}return t=>t===e},An=(e,t,s)=>{if(e=e.trim(),!e)return(()=>!0);const i=e.split(",").map(r=>r.trim()).filter(r=>r!=="").map(rr);return(({type:r,name:n})=>i.some(l=>l(r,n)))}}}),vu=eo({"../node_modules/binary-search/index.js"(e,t){t.exports=function(s,i,r,n,l){var o,u;if(n===void 0)n=0;else if(n=n|0,n<0||n>=s.length)throw new RangeError("invalid lower bound");if(l===void 0)l=s.length-1;else if(l=l|0,l<n||l>=s.length)throw new RangeError("invalid upper bound");for(;n<=l;)if(o=n+(l-n>>>1),u=+r(s[o],i,o,s),u<0)n=o+1;else if(u>0)l=o-1;else return o;return~n}}}),lr,go,bu=$({"util/search.ts"(){"use strict";lr=hu(vu()),go=(e,t,s)=>{const i=(0,lr.default)(e,t,s);return i<0?~i:i}}}),Cs,_n=$({"mixin/cached.ts"(){"use strict";q(),Cs=(e=!0)=>t=>{const s=new WeakMap;return function(...i){return tt(s.get(this),()=>t.apply(this,i),r=>{s.set(this,r)},e)}}}}),po,yu=$({"mixin/nodeLike.ts"(){"use strict";po=e=>{class t extends e{get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get offsetHeight(){return this.getDimension().height}get offsetWidth(){return this.getDimension().width}}return t}}}),or,ar,is,_t,Tt,ns,Ct,$t,It,Ye,fo=$({"lib/node.ts"(){"use strict";Ge(),bu(),q(),Te(),_n(),yu(),j(),ar=[po],or=[Cs(!1)],Ye=class{constructor(){G(It,5,this),gu(this,"childNodes",[]),ze(this,is),ze(this,_t),ze(this,Tt),ze(this,ns),ze(this,Ct),ze(this,$t,{})}get parentNode(){return ce(this,is)}get nextSibling(){return ce(this,_t)}get previousSibling(){return ce(this,Tt)}getChildNodes(){const{childNodes:e}=this;return Object.isFrozen(e)?[...e]:e}getAttribute(e){return e==="padding"?0:this[e]}setAttribute(e,t){switch(e){case"parentNode":ke(this,is,t),t||(ke(this,_t,void 0),ke(this,Tt,void 0));break;case"nextSibling":ke(this,_t,t);break;case"previousSibling":ke(this,Tt,t);break;case"aIndex":I.viewOnly&&ke(this,Ct,[be.rev,t]);break;default:this[e]=t}}getRootNode(){return tt(ce(this,ns),()=>{var e,t;return(t=(e=this.parentNode)==null?void 0:e.getRootNode())!=null?t:this},e=>{const[,t]=e;t.type==="root"&&ke(this,ns,e)})}indexFromPos(e,t){{if(e<0||t<0)return;const s=this.getLines();if(e>=s.length)return;const[,i,r]=s[e],n=i+t;return n>r?void 0:n}}posFromIndex(e){{const{length:t}=String(this);if(e+=e<0?t:0,e>=0&&e<=t){const s=this.getLines(),i=go(s,e,([,,r],n)=>r-n);return{top:i,left:e-s[i][1]}}return}}getDimension(){{const e=this.getLines(),t=e[e.length-1];return{height:e.length,width:t[2]-t[1]}}}getGaps(e){return 0}getRelativeIndex(e){if(e===void 0){const{parentNode:t}=this;return t?t.getRelativeIndex(t.childNodes.indexOf(this)):0}return tt(ce(this,$t)[e],()=>{const{childNodes:t}=this,s=e+(e<0?t.length:0);let i=this.getAttribute("padding");for(let r=0;r<s;r++)I.viewOnly&&(ce(this,$t)[r]=[be.rev,i]),i+=t[r].toString().length+this.getGaps(r);return i},t=>{ce(this,$t)[e]=t})}getAbsoluteIndex(){return tt(ce(this,Ct),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{ke(this,Ct,e)})}getBoundingClientRect(){this.lspError("AstNode.getBoundingClientRect")}is(e){return this.type===e}getLines(){return fs(String(this))}seal(e,t){}lspError(e){throw new Error(`${e} method is only available in the LSP version!`)}},It=X(null),is=new WeakMap,_t=new WeakMap,Tt=new WeakMap,ns=new WeakMap,Ct=new WeakMap,$t=new WeakMap,V(It,1,"getLines",or,Ye),Ye=V(It,0,"AstNode",ar,Ye),G(It,1,Ye)}}),mo,wu=$({"mixin/elementLike.ts"(){"use strict";co(),mo=e=>{var t,sn;{class i extends e{constructor(){super(...arguments);L(this,t)}getElementBy(l){const o=[...this.childNodes].reverse();for(;o.length>0;){const u=o.pop(),{type:d,childNodes:a}=u;if(d!=="text"){if(l(u))return u;for(let h=a.length-1;h>=0;h--)o.push(a[h])}}}querySelector(l){return this.getElementBy(P(this,t,sn).call(this,l))}getElementsBy(l){const o=[...this.childNodes].reverse(),u=[];for(;o.length>0;){const d=o.pop(),{type:a,childNodes:h}=d;if(a!=="text"){l(d)&&u.push(d);for(let g=h.length-1;g>=0;g--)o.push(h[g])}}return u}querySelectorAll(l){return this.getElementsBy(P(this,t,sn).call(this,l))}escape(){}}return t=new WeakSet,sn=function(l){return An(l,this)},i}}}}),ur,Us,dr,Ot,Su=$({"lib/element.ts"(){"use strict";de(),Te(),co(),fo(),wu(),ur=[mo],Ot=class extends(dr=Ye){get length(){return this.childNodes.length}text(e){return it(this.childNodes,e)}removeAt(e){this.lspError("AstElement.removeAt")}insertAt(e,t=this.length){return Mn(this,t,0,[e]),e}closest(e){const t=An(e,this);let{parentNode:s}=this;for(;s;){if(t(s))return s;({parentNode:s}=s)}}isInside(e){var t;return((t=this.closest(`${e},ext`))==null?void 0:t.type)===e}append(...e){this.safeAppend(e)}safeAppend(e){for(const t of e)this.insertAt(t)}safeReplaceChildren(e){}setText(e,t=0){t+=t<0?this.length:0;const s=this.childNodes[t],{data:i}=s;return s.replaceData(e),i}toString(e,t=""){return this.childNodes.map(s=>s.toString(e)).join(t)}caretPositionFromIndex(e){this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(e){this.lspError("AstElement.elementFromIndex")}elementFromPoint(e,t){this.lspError("AstElement.elementFromPoint")}lint(e=this.getAbsoluteIndex(),t){{const s=[];for(let i=0,r=e+this.getAttribute("padding");i<this.length;i++){const n=this.childNodes[i];n.setAttribute("aIndex",r);const l=n.lint(r,t);l.length>0&&Array.prototype.push.apply(s,l),r+=n.toString().length+this.getGaps(i)}return s}}print(e={}){}json(e,t=this.getAbsoluteIndex()){}},Us=X(dr),Ot=V(Us,0,"AstElement",ur,Ot),G(Us,1,Ot)}}),rs,Ds,hr,cr,gr,pr,Hs,fr,nn,ku=$({"lib/text.ts"(){"use strict";var e,xo,s;de(),q(),j(),fo(),rs=String.raw`[${De}\t]*`,Ds=String.raw`<(?:/[^\S\n]*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|\n={2,}`,hr=new RegExp(String.raw`${Ds}|https?[:/]/+|(?:rfc|pmid)(?=[-::]?${rs}\d)|isbn(?=[-::]?${rs}(?:\d(?:${rs}|-)){6})`,"giu"),cr=new RegExp(Ds,"giu"),gr=new Set(["attr-value","ext-link-text","link-text"]),pr={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},Hs=new Set(["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"]),fr=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch(i){return/\w/u}})(),nn=(s=class extends Ye{constructor(r){super();L(this,e);Pe(this,"data","");this.data=r}get type(){return"text"}toString(r){var n;return r&&!((n=this.parentNode)!=null&&n.getAttribute("built"))?fe(this.data):this.data}text(){return this.data}lint(r=this.getAbsoluteIndex(),n){var l,o,u;{if(n===!1)return[];const{data:d,parentNode:a,nextSibling:h,previousSibling:g}=this;if(!a)throw new Error("An isolated text node cannot be linted!");const{type:c,parentNode:p}=a;if(c==="attr-value"){const{name:z,tag:U}=p;if(U==="ref"&&(z==="name"||z==="follow")||z==="group"&&(U==="ref"||U==="references")||U==="choose"&&(z==="before"||z==="after"))return[]}if(n!=null||(n=a.isPlain()&&!gr.has(c)?hr:cr),d.search(n)===-1)return[];n.lastIndex=0;const f=[],m=h==null?void 0:h.type,S=h==null?void 0:h.name,A=g==null?void 0:g.type,w=this.getRootNode(),v=w.toString(),{ext:k,html:y,variants:C}=w.getAttribute("config"),{top:x,left:_}=w.posFromIndex(r),{lintConfig:T}=I,N=T.rules["tag-like"],F=typeof N=="object"&&N[1]?new Set(Object.keys(N[1]).filter(z=>z!=="invalid"&&z!=="disallowed")):new Set,Q=new Set(["onlyinclude","noinclude","includeonly",...k,...y[0],...y[1],...y[2],...F,...T.getSeverity("tag-like","disallowed")?Hs:[]]);for(let z=n.exec(d);z;z=n.exec(d)){let{index:U,0:O}=z;const[,pe,ge]=z,we=O==="["&&c==="ext-link-text";if(O.startsWith("<")&&!Q.has(pe.toLowerCase())||we&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(d.slice(U+1))||h!=null&&h.is("ext")&&S==="nowiki"&&((l=h.innerText)!=null&&l.includes("]"))))continue;if(ge&&ge!=="]"){const{length:oe}=ge;U+=oe,O=O.slice(oe)}else O.startsWith(`
3
- ==`)&&(U++,O=O.slice(1));O=O.toLowerCase();const[K]=O,Re=O==="rfc"||O==="pmid"||O==="isbn",H=K==="{",le=K==="}",ee=K==="[",te=K==="]";let{length:ne}=O;te&&(U||ne>1)&&n.lastIndex--;let ae=r+U,Y=ae+ne,se,xe,qe,Je;const Xe=v[Y],Os=v[ae-1],js=H||ee,Ps=O==="{"&&Os==="-"&&C.length>0,Bs=O==="}"&&Xe==="-"&&C.length>0,zn=ee&&m==="free-ext-link"&&!d.slice(U+1).trim()||te&&A==="free-ext-link"&&!d.slice(0,U).includes("]");if(Re)se="lonely-http",O=O.toUpperCase(),xe=T.getSeverity(se,O);else if(K==="<"){se="tag-like";let oe;/^<\/?\s/u.test(O)||!/[\s/>]/u.test(Xe!=null?Xe:"")?oe="invalid":F.has(pe)?oe=pe:Hs.has(pe)&&!k.includes(pe)&&(oe="disallowed"),xe=T.getSeverity(se,oe)}else if(K==="=")se="syntax-like",xe=T.getSeverity(se,"heading");else if(Ps||Bs)se="lonely-bracket",xe=T.getSeverity(se,"converter"),Ps&&U>0?(O="-{",U--,ae--,ne=2):Bs&&U<d.length-1&&(O="}-",Y++,ne=2);else if(zn)se="lonely-bracket",xe=T.getSeverity(se,"extLink");else if(js||le||te)if(se="lonely-bracket",ne>1||H&&Xe===K||le&&Os===K)xe=T.getSeverity(se,"double");else{if(!we){const oe=pr[K],Se=js?d.slice(U+1):d.slice(0,U);if(H&&((o=oe.exec(Se))==null?void 0:o[0])==="}"||le&&((u=oe.exec(Se))==null?void 0:u[0])==="{")continue;if(!Se.includes(K)){const Oe=js?"nextSibling":"previousSibling";let Ce=this[Oe];for(;Ce&&(Ce.type!=="text"||!oe.test(Ce.data));)Ce=Ce[Oe];if(Ce&&oe.exec(Ce.data)[0]!==K)continue}}xe=T.getSeverity(se,"single")}else se="lonely-http",xe=T.getSeverity(se);if(!xe)continue;const Un=this.posFromIndex(U),{line:Dn,character:Hn}=tn(x,_,Un.top+1,Un.left);if(K==="="){const oe=d.indexOf(`
1
+ "use strict";(()=>{var ru=Object.defineProperty,lu=Object.defineProperties;var ou=Object.getOwnPropertyDescriptors;var es=Object.getOwnPropertySymbols;var Gn=Object.prototype.hasOwnProperty,Vn=Object.prototype.propertyIsEnumerable;var Qn=e=>{throw TypeError(e)};var Ws=(e,t,s)=>t in e?ru(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,he=(e,t)=>{for(var s in t||(t={}))Gn.call(t,s)&&Ws(e,s,t[s]);if(es)for(var s of es(t))Vn.call(t,s)&&Ws(e,s,t[s]);return e},je=(e,t)=>lu(e,ou(t));var Jn=(e,t)=>{var s={};for(var n in e)Gn.call(e,n)&&t.indexOf(n)<0&&(s[n]=e[n]);if(e!=null&&es)for(var n of es(e))t.indexOf(n)<0&&Vn.call(e,n)&&(s[n]=e[n]);return s};var au=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Pe=(e,t,s)=>Ws(e,typeof t!="symbol"?t+"":t,s),qs=(e,t,s)=>t.has(e)||Qn("Cannot "+s);var b=(e,t,s)=>(qs(e,t,"read from private field"),s?s.call(e):t.get(e)),L=(e,t,s)=>t.has(e)?Qn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),E=(e,t,s,n)=>(qs(e,t,"write to private field"),n?n.call(e,s):t.set(e,s),s),P=(e,t,s)=>(qs(e,t,"access private method"),s);var Xn=(e,t,s,n)=>({set _(r){E(e,t,r,s)},get _(){return b(e,t,n)}});var xd=au((bd,nu)=>{var Xl=Object.create,st=Object.defineProperty,Kl=Object.getOwnPropertyDescriptor,mn=Object.getOwnPropertyNames,uu=Object.getPrototypeOf,du=Object.prototype.hasOwnProperty,Yl=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),kt=e=>{throw TypeError(e)},Zl=(e,t,s)=>t in e?st(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Kn=(e,t)=>st(e,"name",{value:t,configurable:!0}),$=(e,t)=>function(){return e&&(t=(0,e[mn(e)[0]])(e=0)),t},eo=(e,t)=>function(){return t||(0,e[mn(e)[0]])((t={exports:{}}).exports,t),t.exports},Z=(e,t)=>{for(var s in t)st(e,s,{get:t[s],enumerable:!0})},to=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of mn(t))!du.call(e,r)&&r!==s&&st(e,r,{get:()=>t[r],enumerable:!(n=Kl(t,r))||n.enumerable});return e},hu=(e,t,s)=>(s=e!=null?Xl(uu(e)):{},to(t||!e||!e.__esModule?st(s,"default",{value:e,enumerable:!0}):s,e)),J=e=>to(st({},"__esModule",{value:!0}),e),X=e=>{var t;return[,,,Xl((t=e==null?void 0:e[Yl("metadata")])!=null?t:null)]},so=["class","method","getter","setter","accessor","field","value","get","set"],Rt=e=>e!==void 0&&typeof e!="function"?kt("Function expected"):e,cu=(e,t,s,n,r)=>({kind:so[e],name:t,metadata:n,addInitializer:i=>s._?kt("Already initialized"):r.push(Rt(i||null))}),xn=(e,t)=>Zl(t,Yl("metadata"),e[3]),G=(e,t,s,n)=>{for(var r=0,i=e[t>>1],l=i&&i.length;r<l;r++)t&1?i[r].call(s):n=i[r].call(s,n);return n},V=(e,t,s,n,r,i)=>{var l,o,u,d,a,h=t&7,g=!!(t&8),c=!!(t&16),p=h>3?e.length+1:h?g?1:2:0,f=so[h+5],m=h>3&&(e[p-1]=[]),S=e[p]||(e[p]=[]),k=h&&(!c&&!g&&(r=r.prototype),h<5&&(h>3||!c)&&Kl(h<4?r:{get[s](){return ce(this,i)},set[s](v){return ke(this,i,v)}},s));h?c&&h<4&&Kn(i,(h>2?"set ":h>1?"get ":"")+s):Kn(r,s);for(var w=n.length-1;w>=0;w--)d=cu(h,s,u={},e[3],S),h&&(d.static=g,d.private=c,a=d.access={has:c?v=>pu(r,v):v=>s in v},h^3&&(a.get=c?v=>(h^1?ce:Yi)(v,r,h^4?i:k.get):v=>v[s]),h>2&&(a.set=c?(v,A)=>ke(v,r,A,h^4?i:k.set):(v,A)=>v[s]=A)),o=(0,n[w])(h?h<4?c?i:k[f]:h>4?void 0:{get:k.get,set:k.set}:r,d),u._=1,h^4||o===void 0?Rt(o)&&(h>4?m.unshift(o):h?c?i=o:k[f]=o:r=o):typeof o!="object"||o===null?kt("Object expected"):(Rt(l=o.get)&&(k.get=l),Rt(l=o.set)&&(k.set=l),Rt(l=o.init)&&m.unshift(l));return h||xn(e,r),k&&st(r,s,k),c?h^4?i:k:r},gu=(e,t,s)=>Zl(e,typeof t!="symbol"?t+"":t,s),vn=(e,t,s)=>t.has(e)||kt("Cannot "+s),pu=(e,t)=>Object(t)!==t?kt('Cannot use the "in" operator on this value'):e.has(t),ce=(e,t,s)=>(vn(e,t,"read from private field"),s?s.call(e):t.get(e)),ze=(e,t,s)=>t.has(e)?kt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),ke=(e,t,s,n)=>(vn(e,t,"write to private field"),n?n.call(e,s):t.set(e,s),s),Yi=(e,t,s)=>(vn(e,t,"access private method"),s),fu=(e,t,s,n)=>({set _(r){ke(e,t,r,s)},get _(){return ce(e,t,n)}}),io,ys,no=$({"base.ts"(){"use strict";io=(()=>{const e={redirect:1,onlyinclude:1,noinclude:1,include:1,comment:1,ext:1,arg:2,"magic-word":2,template:2,heading:2,html:3,table:4,hr:5,"double-underscore":5,link:6,category:6,file:6,quote:7,"ext-link":8,"free-ext-link":9,"magic-link":9,list:10,dd:10,converter:11};return Object.setPrototypeOf(e,null),e})(),ys=(()=>{const e=["arg-in-ext","bold-header","format-leakage","fostered-content","h1","illegal-attr","insecure-style","invalid-gallery","invalid-imagemap","invalid-invoke","invalid-isbn","invalid-json","invalid-url","lonely-apos","lonely-bracket","lonely-http","nested-link","no-arg","no-duplicate","no-ignored","obsolete-attr","obsolete-tag","parsing-order","pipe-like","syntax-like","table-layout","tag-like","unbalanced-header","unclosed-comment","unclosed-quote","unclosed-table","unescaped","unknown-page","unmatched-tag","unterminated-url","url-encoding","var-anchor","void-ext"];return Object.freeze(e),e})()}});function Ae(e,t,s){return s===1?e.replace(/\0(\d+)g\x7F/gu,(n,r)=>Ae(String(t[r]),t,2)):s===2?e.replace(/\0(\d+)n\x7F/gu,(n,r)=>String(t[r])):e.replace(/\0(\d+)\x7F/gu,(n,r)=>t[r])}var De,Ms,bt,yt,wt,at,ro,fe,it,Yn,Zn,ts,ws,lo,er,tr,mu,de=$({"util/string.ts"(){"use strict";De=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Ms=String.raw`[^[\]<>"\0-\x1F\x7F${De}\uFFFD]`,bt=String.raw`(?:\[[\da-f:.]+\]|${Ms})`,yt=String.raw`(?:${Ms}|\0\d+[cn!~]\x7F)*`,wt=e=>e.trim().toLowerCase(),at=(e,t)=>s=>s.replace(e,t),ro=at(/[\0\x7F]|\r$/gmu,""),fe=at(/\0\d+[cn]\x7F/gu,""),it=(e,t="")=>e.map(s=>typeof s=="string"?s:s.text()).join(t),Yn={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},Zn=at(/&(?:#(\d+|[Xx][\da-fA-F]+)|([lg]t|[LG]T|[lr]brac[ke]|nbsp|amp|AMP|quot|QUOT));/gu,(e,t,s)=>t?String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t)):Yn[s.toLowerCase()]),ws=e=>(ts!=null||(ts=Zn),ts(e)),lo=at(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),er={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},tr=(e=/[&<>"{}[\]|]/gu)=>at(e,t=>`&${er[t]};`),mu=tr(/[&<>]/gu)}}),xu=eo({"config/minimum.json"(e,t){t.exports={ext:[],html:[["b","bdi","del","i","ins","u","font","big","small","sub","sup","h1","h2","h3","h4","h5","h6","cite","code","em","s","strike","strong","tt","var","div","center","blockquote","ol","ul","dl","table","caption","pre","ruby","rb","rp","rt","rtc","p","span","abbr","dfn","kbd","samp","data","time","mark","tr","td","th","q","bdo"],["li","dt","dd"],["br","wbr","hr","meta","link"]],namespaces:{0:"",6:"File",10:"Template",14:"Category",828:"Module"},nsid:{"":0,file:6,template:10,category:14,module:828},functionHook:["msgnw"],variable:["!","=","pageid","articlepath","server","servername","scriptpath","stylepath"],parserFunction:[{msgnw:"msgnw",pageid:"pageid",articlepath:"articlepath",server:"server",servername:"servername",scriptpath:"scriptpath",stylepath:"stylepath","#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"formatdate","#dateformat":"formatdate","#invoke":"invoke","#while":"while","#dowhile":"dowhile","#loop":"loop","#forargs":"forargs","#fornumargs":"fornumargs","#if":"if","#ifeq":"ifeq","#switch":"switch","#ifexist":"ifexist","#ifexpr":"ifexpr","#iferror":"iferror","#time":"time","#timel":"timel","#expr":"expr","#rel2abs":"rel2abs","#titleparts":"titleparts","#categorytree":"categorytree","#urldecode":"urldecode","#choose":"choose","#var":"var","#varexists":"varexists","#var_final":"var_final","#vardefine":"vardefine","#vardefineecho":"vardefineecho","#widget":"widget","#related":"related","#regex":"regex","#regex_var":"regex_var","#regexquote":"regexquote","#regexall":"regexall","#len":"len","#pos":"pos","#rpos":"rpos","#sub":"sub","#count":"count","#rmatch":"rmatch","#rreplace":"rreplace","#replace":"replace","#rsplit":"rsplit","#explode":"explode","#tab":"tab","#seo":"seo","#babel":"babel","#translation":"translation","#commaseparatedlist":"commaseparatedlist","#coordinates":"coordinates","#lst":"lst","#lsth":"lsth","#lstx":"lstx","#assessment":"assessment","#mentor":"mentor","#property":"property","#target":"target","#section":"lst","#section-x":"lstx","#section-h":"lsth","#statements":"statements","#useliquidthreads":"useliquidthreads","#lqtpagelimit":"lqtpagelimit","#avatar":"avatar","#img":"img","#chart":"chart"},{"!":"!","=":"=","#FORMAL":"formal","#bcp47":"bcp47","#dir":"dir","#interwikilink":"interwikilink","#interlanguagelink":"interlanguagelink","#contentmodel":"contentmodel","#timef":"timef","#timefl":"timefl"},["msg","raw"],["subst","safesubst"]],doubleUnderscore:[[],[]],protocol:"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|matrix:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|wikipedia://|worldwind://|xmpp:",interwiki:[],img:{},redirection:["#redirect"],variants:[]}}}),ve,oo,ao,Ss,Zi,Ee=$({"util/constants.ts"(){"use strict";ve=11,oo=void 0,ao=new Set(["alt","link","lang","page","caption"]),Ss=new Set(["tiff","tif","png","gif","jpg","jpeg","webp","xcf","pdf","svg","djvu"]),Zi=xu()}});function vt(e){const t=new Map,s=new WeakMap;return n=>{const r=typeof n=="string"?t:s;if(r.has(n)){const l=r.get(n);return l.lastIndex=0,l}const i=e(n);return r.set(n,i),i}}var Qt,fs,ss,sr,uo,Ge=$({"../common/dist/index.mjs"(){"use strict";Qt=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25")),fs=e=>{const t=[];let s=0;for(const n of e.split(`
2
+ `)){const r=s+n.length;t.push([n,s,r]),s=r+1}return t},ss=e=>e&&Number(e[1]),sr=(e,t)=>{var r;let s;const n=i=>{s!=null||(s=fs(e));const l=s.findIndex(([,,o])=>i<=o)+1;return{line:l,column:i-s[l-1][1]+1}};for(const i of t){const{line:l,column:o,from:u,to:d}=i;u==null?l?(s!=null||(s=fs(e)),(r=i.column)!=null||(i.column=1),i.from=s[l-1][1]+(i.column-1)):(i.from=0,i.line=1,i.column=1):(!l||!o)&&Object.assign(i,n(u)),d!==void 0&&({line:i.endLine,column:i.endColumn}=n(d)),i.position=i.from}return t},uo=(e,t)=>{if(t||e.trim())try{JSON.parse(e)}catch(s){const{message:n}=s,r=ss(/\bline (\d+)/u.exec(n)),i=ss(/\bcolumn (\d+)/u.exec(n)),l=ss(/\bposition (\d+)/u.exec(n));return sr(e,[{message:n,line:r,column:i,from:l,severity:"error"}])}return[]}}}),re,ue=$({"lib/rect.ts"(){"use strict";var e,t,s,n,en,i;re=(i=class{constructor(l,o){L(this,n);L(this,e);L(this,t);L(this,s);E(this,e,l),E(this,t,o)}get start(){return b(this,t)}get top(){return P(this,n,en).call(this).top}get left(){return P(this,n,en).call(this).left}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n=new WeakSet,en=function(){var l;return(l=b(this,s))!=null||E(this,s,b(this,e).getRootNode().posFromIndex(b(this,t))),b(this,s)},i)}}),ir,nr,ms,tn,zs,M,B,$e,Ts,D,bn,He,yn,wn,Sn,Jt,St,kn,tt,ho,q=$({"util/lint.ts"(){"use strict";Ge(),Te(),ue(),j(),ir=new Set(["tr","td","th","caption"]),nr=new Set(["Template:!!","Template:!-"]),ms=e=>{const t=e.childNodes.find(s=>s.text().trim());if(!t||t.type==="text"&&t.data.trim().startsWith("!")||t.is("magic-word")&&t.name==="!"||t.is("template")&&nr.has(t.name)||t.is("html")&&ir.has(t.name))return!1;if(t.is("arg"))return t.length>1&&ms(t.childNodes[1]);if(t.is("magic-word"))try{const s=t.getPossibleValues().map(ms);return s.includes(2)?2:s.includes(1)&&1}catch(s){}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?1:2},tn=(e,t,s,n)=>({line:e+s-1,character:(s===1?t:0)+n}),zs=e=>(t,s,n,r,i="error")=>{const{start:l}=s,{top:o,left:u}=s instanceof re?s:new re(t,l),{offsetHeight:d,offsetWidth:a}=t,{startIndex:h,startLine:g,startCol:c}=e(t,l,o,u),{line:p,character:f}=tn(g,c,d,a);return{rule:n,message:I.msg(r),severity:i,startIndex:h,endIndex:h+t.toString().length,startLine:g,endLine:p,startCol:c,endCol:f}},M=zs((e,t,s,n)=>{const r=e.getRelativeIndex(),{top:i,left:l}=e.parentNode.posFromIndex(r);return{startIndex:t+r,startLine:s+i,startCol:i?l:n+l}}),B=zs((e,t,s,n)=>({startIndex:t,startLine:s,startCol:n})),$e=(e,t,s,n=0)=>({desc:I.msg(t),range:[e.startIndex+n,e.endIndex],text:s}),Ts=(e,t,s)=>({desc:I.msg(t),range:[e,e],text:s}),D=(e,t=0,s="")=>typeof e=="number"?{desc:I.msg("remove"),range:[e,e+t],text:s}:$e(e,"remove",s,t),bn=(e,t)=>$e(e,"decode",Qt(t.text().replace(/%(?=21|3[ce]|5[bd]|7[b-d])/giu,"%25"))),He=(e,t,s=0)=>({desc:I.msg("close"),range:[e+s,e],text:t}),yn=e=>({desc:I.msg("open"),range:[e+1,e+2],text:""}),wn=(e,t)=>$e(e,"comment",`<!--${t}-->`),Sn=(e,t)=>$e(e,"uppercase",t.toUpperCase()),Jt=(e,t=0)=>({desc:I.msg("whitespace"),range:[e,e+t],text:" "}),St=(e,t,s=1)=>({desc:I.msg("escape"),range:[e,e+s],text:t.repeat(s)}),kn=(e,t)=>({desc:I.msg("escape"),range:[e,e+t.length],text:t.replace(/\|/gu,"&#124;")}),tt=(e,t,s,n)=>{if(e&&(n||I.viewOnly&&e[0]===be.rev))return e[1];const r=t();return(n||I.viewOnly)&&s([be.rev,r]),r},ho=(e,t)=>e==="ol"&&t==="type"?["1","a","A","i","I"]:e==="th"&&t==="scope"?["row","col","rowgroup","colgroup"]:t==="dir"?["ltr","rtl","auto"]:t==="aria-hidden"?["true","false"]:[]}}),rr,An,co=$({"util/selector.ts"(){"use strict";rr=e=>{if(e.includes("#")){const t=e.indexOf("#"),s=e.slice(0,t),n=e.slice(t+1);return(r,i)=>(t===0||r===s)&&i===n}return t=>t===e},An=(e,t,s)=>{if(e=e.trim(),!e)return(()=>!0);const n=e.split(",").map(r=>r.trim()).filter(r=>r!=="").map(rr);return(({type:r,name:i})=>n.some(l=>l(r,i)))}}}),vu=eo({"../node_modules/binary-search/index.js"(e,t){t.exports=function(s,n,r,i,l){var o,u;if(i===void 0)i=0;else if(i=i|0,i<0||i>=s.length)throw new RangeError("invalid lower bound");if(l===void 0)l=s.length-1;else if(l=l|0,l<i||l>=s.length)throw new RangeError("invalid upper bound");for(;i<=l;)if(o=i+(l-i>>>1),u=+r(s[o],n,o,s),u<0)i=o+1;else if(u>0)l=o-1;else return o;return~i}}}),lr,go,bu=$({"util/search.ts"(){"use strict";lr=hu(vu()),go=(e,t,s)=>{const n=(0,lr.default)(e,t,s);return n<0?~n:n}}}),Cs,_n=$({"mixin/cached.ts"(){"use strict";q(),Cs=(e=!0)=>t=>{const s=new WeakMap;return function(...n){return tt(s.get(this),()=>t.apply(this,n),r=>{s.set(this,r)},e)}}}}),po,yu=$({"mixin/nodeLike.ts"(){"use strict";po=e=>{class t extends e{get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get offsetHeight(){return this.getDimension().height}get offsetWidth(){return this.getDimension().width}}return t}}}),or,ar,is,_t,Tt,ns,Ct,$t,It,Ye,fo=$({"lib/node.ts"(){"use strict";Ge(),bu(),q(),Te(),_n(),yu(),j(),ar=[po],or=[Cs(!1)],Ye=class{constructor(){G(It,5,this),gu(this,"childNodes",[]),ze(this,is),ze(this,_t),ze(this,Tt),ze(this,ns),ze(this,Ct),ze(this,$t,{})}get parentNode(){return ce(this,is)}get nextSibling(){return ce(this,_t)}get previousSibling(){return ce(this,Tt)}getChildNodes(){const{childNodes:e}=this;return Object.isFrozen(e)?[...e]:e}getAttribute(e){return e==="padding"?0:this[e]}setAttribute(e,t){switch(e){case"parentNode":ke(this,is,t),t||(ke(this,_t,void 0),ke(this,Tt,void 0));break;case"nextSibling":ke(this,_t,t);break;case"previousSibling":ke(this,Tt,t);break;case"aIndex":I.viewOnly&&ke(this,Ct,[be.rev,t]);break;default:this[e]=t}}getRootNode(){return tt(ce(this,ns),()=>{var e,t;return(t=(e=this.parentNode)==null?void 0:e.getRootNode())!=null?t:this},e=>{const[,t]=e;t.type==="root"&&ke(this,ns,e)})}indexFromPos(e,t){{if(e<0||t<0)return;const s=this.getLines();if(e>=s.length)return;const[,n,r]=s[e],i=n+t;return i>r?void 0:i}}posFromIndex(e){{const{length:t}=String(this);if(e+=e<0?t:0,e>=0&&e<=t){const s=this.getLines(),n=go(s,e,([,,r],i)=>r-i);return{top:n,left:e-s[n][1]}}return}}getDimension(){{const e=this.getLines(),t=e[e.length-1];return{height:e.length,width:t[2]-t[1]}}}getGaps(e){return 0}getRelativeIndex(e){if(e===void 0){const{parentNode:t}=this;return t?t.getRelativeIndex(t.childNodes.indexOf(this)):0}return tt(ce(this,$t)[e],()=>{const{childNodes:t}=this,s=e+(e<0?t.length:0);let n=this.getAttribute("padding");for(let r=0;r<s;r++)I.viewOnly&&(ce(this,$t)[r]=[be.rev,n]),n+=t[r].toString().length+this.getGaps(r);return n},t=>{ce(this,$t)[e]=t})}getAbsoluteIndex(){return tt(ce(this,Ct),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{ke(this,Ct,e)})}getBoundingClientRect(){this.lspError("AstNode.getBoundingClientRect")}is(e){return this.type===e}getLines(){return fs(String(this))}seal(e,t){}lspError(e){throw new Error(`${e} method is only available in the LSP version!`)}},It=X(null),is=new WeakMap,_t=new WeakMap,Tt=new WeakMap,ns=new WeakMap,Ct=new WeakMap,$t=new WeakMap,V(It,1,"getLines",or,Ye),Ye=V(It,0,"AstNode",ar,Ye),G(It,1,Ye)}}),mo,wu=$({"mixin/elementLike.ts"(){"use strict";co(),mo=e=>{var t,sn;{class n extends e{constructor(){super(...arguments);L(this,t)}getElementBy(l){const o=[...this.childNodes].reverse();for(;o.length>0;){const u=o.pop(),{type:d,childNodes:a}=u;if(d!=="text"){if(l(u))return u;for(let h=a.length-1;h>=0;h--)o.push(a[h])}}}querySelector(l){return this.getElementBy(P(this,t,sn).call(this,l))}getElementsBy(l){const o=[...this.childNodes].reverse(),u=[];for(;o.length>0;){const d=o.pop(),{type:a,childNodes:h}=d;if(a!=="text"){l(d)&&u.push(d);for(let g=h.length-1;g>=0;g--)o.push(h[g])}}return u}querySelectorAll(l){return this.getElementsBy(P(this,t,sn).call(this,l))}escape(){}}return t=new WeakSet,sn=function(l){return An(l,this)},n}}}}),ur,Us,dr,Ot,Su=$({"lib/element.ts"(){"use strict";de(),Te(),co(),fo(),wu(),ur=[mo],Ot=class extends(dr=Ye){get length(){return this.childNodes.length}text(e){return it(this.childNodes,e)}removeAt(e){this.lspError("AstElement.removeAt")}insertAt(e,t=this.length){return Mn(this,t,0,[e]),e}closest(e){const t=An(e,this);let{parentNode:s}=this;for(;s;){if(t(s))return s;({parentNode:s}=s)}}isInside(e){var t;return((t=this.closest(`${e},ext`))==null?void 0:t.type)===e}append(...e){this.safeAppend(e)}safeAppend(e){for(const t of e)this.insertAt(t)}safeReplaceChildren(e){}setText(e,t=0){t+=t<0?this.length:0;const s=this.childNodes[t],{data:n}=s;return s.replaceData(e),n}toString(e,t=""){return this.childNodes.map(s=>s.toString(e)).join(t)}caretPositionFromIndex(e){this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(e){this.lspError("AstElement.elementFromIndex")}elementFromPoint(e,t){this.lspError("AstElement.elementFromPoint")}lint(e=this.getAbsoluteIndex(),t){{const s=[];for(let n=0,r=e+this.getAttribute("padding");n<this.length;n++){const i=this.childNodes[n];i.setAttribute("aIndex",r);const l=i.lint(r,t);l.length>0&&Array.prototype.push.apply(s,l),r+=i.toString().length+this.getGaps(n)}return s}}print(e={}){}json(e,t=this.getAbsoluteIndex()){}},Us=X(dr),Ot=V(Us,0,"AstElement",ur,Ot),G(Us,1,Ot)}}),rs,Ds,hr,cr,gr,pr,Hs,fr,nn,ku=$({"lib/text.ts"(){"use strict";var e,xo,s;de(),q(),j(),fo(),rs=String.raw`[${De}\t]*`,Ds=String.raw`<(?:/[^\S\n]*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|\n={2,}`,hr=new RegExp(String.raw`${Ds}|https?[:/]/+|(?:rfc|pmid)(?=[-::]?${rs}\d)|isbn(?=[-::]?${rs}(?:\d(?:${rs}|-)){6})`,"giu"),cr=new RegExp(Ds,"giu"),gr=new Set(["attr-value","ext-link-text","link-text"]),pr={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},Hs=new Set(["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"]),fr=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch(n){return/\w/u}})(),nn=(s=class extends Ye{constructor(r){super();L(this,e);Pe(this,"data","");this.data=r}get type(){return"text"}toString(r){var i;return r&&!((i=this.parentNode)!=null&&i.getAttribute("built"))?fe(this.data):this.data}text(){return this.data}lint(r=this.getAbsoluteIndex(),i){var l,o,u;{if(i===!1)return[];const{data:d,parentNode:a,nextSibling:h,previousSibling:g}=this;if(!a)throw new Error("An isolated text node cannot be linted!");const{type:c,parentNode:p}=a;if(c==="attr-value"){const{name:z,tag:U}=p;if(U==="ref"&&(z==="name"||z==="follow")||z==="group"&&(U==="ref"||U==="references")||U==="choose"&&(z==="before"||z==="after"))return[]}if(i!=null||(i=a.isPlain()&&!gr.has(c)?hr:cr),d.search(i)===-1)return[];i.lastIndex=0;const f=[],m=h==null?void 0:h.type,S=h==null?void 0:h.name,k=g==null?void 0:g.type,w=this.getRootNode(),v=w.toString(),{ext:A,html:y,variants:C}=w.getAttribute("config"),{top:x,left:_}=w.posFromIndex(r),{lintConfig:T}=I,N=T.rules["tag-like"],F=typeof N=="object"&&N[1]?new Set(Object.keys(N[1]).filter(z=>z!=="invalid"&&z!=="disallowed")):new Set,Q=new Set(["onlyinclude","noinclude","includeonly",...A,...y[0],...y[1],...y[2],...F,...T.getSeverity("tag-like","disallowed")?Hs:[]]);for(let z=i.exec(d);z;z=i.exec(d)){let{index:U,0:O}=z;const[,pe,ge]=z,we=O==="["&&c==="ext-link-text";if(O.startsWith("<")&&!Q.has(pe.toLowerCase())||we&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(d.slice(U+1))||h!=null&&h.is("ext")&&S==="nowiki"&&((l=h.innerText)!=null&&l.includes("]"))))continue;if(ge&&ge!=="]"){const{length:oe}=ge;U+=oe,O=O.slice(oe)}else O.startsWith(`
3
+ ==`)&&(U++,O=O.slice(1));O=O.toLowerCase();const[K]=O,Re=O==="rfc"||O==="pmid"||O==="isbn",H=K==="{",le=K==="}",ee=K==="[",te=K==="]";let{length:ne}=O;te&&(U||ne>1)&&i.lastIndex--;let ae=r+U,Y=ae+ne,se,xe,qe,Je;const Xe=v[Y],Os=v[ae-1],js=H||ee,Ps=O==="{"&&Os==="-"&&C.length>0,Bs=O==="}"&&Xe==="-"&&C.length>0,zn=ee&&m==="free-ext-link"&&!d.slice(U+1).trim()||te&&k==="free-ext-link"&&!d.slice(0,U).includes("]");if(Re)se="lonely-http",O=O.toUpperCase(),xe=T.getSeverity(se,O);else if(K==="<"){se="tag-like";let oe;/^<\/?\s/u.test(O)||!/[\s/>]/u.test(Xe!=null?Xe:"")?oe="invalid":F.has(pe)?oe=pe:Hs.has(pe)&&!A.includes(pe)&&(oe="disallowed"),xe=T.getSeverity(se,oe)}else if(K==="=")se="syntax-like",xe=T.getSeverity(se,"heading");else if(Ps||Bs)se="lonely-bracket",xe=T.getSeverity(se,"converter"),Ps&&U>0?(O="-{",U--,ae--,ne=2):Bs&&U<d.length-1&&(O="}-",Y++,ne=2);else if(zn)se="lonely-bracket",xe=T.getSeverity(se,"extLink");else if(js||le||te)if(se="lonely-bracket",ne>1||H&&Xe===K||le&&Os===K)xe=T.getSeverity(se,"double");else{if(!we){const oe=pr[K],Se=js?d.slice(U+1):d.slice(0,U);if(H&&((o=oe.exec(Se))==null?void 0:o[0])==="}"||le&&((u=oe.exec(Se))==null?void 0:u[0])==="{")continue;if(!Se.includes(K)){const Oe=js?"nextSibling":"previousSibling";let Ce=this[Oe];for(;Ce&&(Ce.type!=="text"||!oe.test(Ce.data));)Ce=Ce[Oe];if(Ce&&oe.exec(Ce.data)[0]!==K)continue}}xe=T.getSeverity(se,"single")}else se="lonely-http",xe=T.getSeverity(se);if(!xe)continue;const Un=this.posFromIndex(U),{line:Dn,character:Hn}=tn(x,_,Un.top+1,Un.left);if(K==="="){const oe=d.indexOf(`
4
4
  `,U);let Se=h,Oe;if(oe===-1){let Ce=0;for(;Se&&!(Se.type==="text"&&(Ce=Se.data.indexOf(`
5
- `),Ce!==-1));)Se=Se.nextSibling;if(!Se)continue;Oe=Se.data.slice(0,Ce)}else Oe=d.slice(U+ne,oe);if(!/(?:^|[^=])=+\s*(?:\S\s*)?$/u.test(Oe))continue;oe===-1?(Y=Se.getAbsoluteIndex()+Oe.length,{top:qe,left:Je}=w.posFromIndex(Y)):(Y+=Oe.length,ne+=Oe.length)}const Ke={rule:se,message:I.msg(K==="="?"header-like":"lonely",Re||K==="h"||Ps||Bs?O:K),severity:xe,startIndex:ae,endIndex:Y,startLine:Dn,endLine:qe!=null?qe:Dn,startCol:Hn,endCol:Je!=null?Je:Hn+ne};if(T.computeEditInfo)if(K==="<")Ke.suggestions=[St(ae,"&lt;")];else if(K==="h"&&c!=="link-text"&&fr.test(Os||""))Ke.suggestions=[Jt(ae)];else if(we){const oe=a.getAbsoluteIndex()+a.toString().length;Ke.suggestions=[St(oe,"&#93;")]}else if(O==="]"&&zn){const oe=r-g.toString().length;Ke.suggestions=[Ts(oe,"left-bracket","[")]}else Re&&(Ke.suggestions=[...z[0]===O?[]:[Sn(Ke,O)],...Xe===":"||Xe===":"?[Jt(Y,1)]:[]]);f.push(Ke)}return f}}replaceData(r){P(this,e,xo).call(this,r)}splitText(r){this.lspError("AstText.splitText")}escape(){}print(){}},e=new WeakSet,xo=function(r){this.setAttribute("data",r)},s)}}),Ve,nt=$({"mixin/hidden.ts"(){"use strict";Ve=(e=!0,t=!0)=>s=>{class i extends s{text(){return""}lint(n){return e?[]:super.lint(n)}}return i}}}),me,ye=$({"mixin/noEscape.ts"(){"use strict";me=e=>{}}}),Qe,rt=$({"src/syntax.ts"(){"use strict";var e,t;W(),Qe=(t=class extends R{constructor(i,r,n,l,o){super(i,n,l,o);L(this,e);E(this,e,r)}get type(){return b(this,e)}lint(i=this.getAbsoluteIndex()){return super.lint(i,!1)}},e=new WeakMap,t)}}),Fe,We=$({"mixin/padded.ts"(){"use strict";Fe=({length:e})=>t=>{class s extends t{getAttribute(r){return r==="padding"?e:super.getAttribute(r)}}return s}}}),Le,lt=$({"src/atom.ts"(){"use strict";var e,t;W(),Le=(t=class extends R{constructor(i,r,n,l,o){super(i,n,l,o);L(this,e);E(this,e,r)}get type(){return b(this,e)}set type(i){E(this,e,i)}getAttribute(i){var r;return i==="invalid"?this.type==="converter-flag"&&!!((r=this.parentNode)!=null&&r.isInvalidFlag(this)):super.getAttribute(i)}},e=new WeakMap,t)}}),mr,Gs,xr,Be,Kt=$({"src/link/base.ts"(){"use strict";var e,t,s,i,vo,n;q(),Ee(),Te(),ue(),We(),ye(),j(),W(),lt(),mr=[me,Fe("[[")],Be=(n=class extends(xr=R){constructor(o,u,d,a=[],h="|"){super(void 0,d,a,{});L(this,i);L(this,e,!0);L(this,t);L(this,s);if(this.insertAt(new Le(o,"link-target",d,a,{})),u!==void 0){const g=new R(u,d,a,{});g.type="link-text",g.setAttribute("stage",ve-1),this.insertAt(g)}E(this,t,h)}get link(){}get fragment(){}afterBuild(){E(this,s,this.getTitle()),b(this,t).includes("\0")&&E(this,t,this.buildFromStr(b(this,t),0)),P(this,i,vo).call(this),super.afterBuild()}setAttribute(o,u){o==="bracket"?E(this,e,u):o==="title"?E(this,s,u):super.setAttribute(o,u)}toString(o){const u=super.toString(o,b(this,t));return b(this,e)?`[[${u}]]`:u}text(){const o=super.text("|");return b(this,e)?`[[${o}]]`:o}getAttribute(o){return o==="title"?b(this,s):super.getAttribute(o)}getGaps(o){return o===0?b(this,t).length:1}lint(o=this.getAbsoluteIndex(),u){{const d=super.lint(o,u),{childNodes:[a,h],type:g}=this,{encoded:c,fragment:p}=b(this,s),{lintConfig:f}=I,{computeEditInfo:m,fix:S}=f,A=new re(this,o);let w="unknown-page",v=f.getSeverity(w);if(v&&a.childNodes.some(({type:k})=>k==="template")&&d.push(M(a,A,w,"template-in-link",v)),w="url-encoding",v=f.getSeverity(w),v&&c){const k=M(a,A,w,"unnecessary-encoding",v);(m||S)&&(k.fix=bn(k,a)),d.push(k)}if(w="pipe-like",v=f.getSeverity(w,"link"),v&&(g==="link"||g==="category")){const k=h==null?void 0:h.childNodes.findIndex(C=>C.type==="text"&&C.data.includes("|")),y=h==null?void 0:h.childNodes[k];if(y){const C=M(h,A,w,"pipe-in-link",v);if(m){const x=C.startIndex+h.getRelativeIndex(k);C.suggestions=[kn(x,y.data)]}d.push(C)}}if(w="no-ignored",v=f.getSeverity(w,"fragment"),v&&p!==void 0&&!Za(g)){const k=M(a,A,w,"useless-fragment",v);if(m||S){const y=a.childNodes.findIndex(x=>x.type==="text"&&x.data.includes("#")),C=a.childNodes[y];C&&(k.fix=D(k,a.getRelativeIndex(y)+C.data.indexOf("#")))}d.push(k)}return d}}getTitle(o,u){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:u,temporary:o,decode:!0,selfLink:!0})}print(){}json(o,u=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakSet,vo=function(){this.type!=="ext-inner"&&this.setAttribute("name",b(this,s).title)},n),Gs=X(xr),Be=V(Gs,0,"LinkBaseToken",mr,Be),G(Gs,1,Be)}}),vr,Vs,br,Ie,ot=$({"src/nowiki/base.ts"(){"use strict";ye(),W(),vr=[me],Ie=class extends(br=R){get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}},Vs=X(br),Ie=V(Vs,0,"NowikiBaseToken",vr,Ie),G(Vs,1,Ie)}}),yr,Qs,wr,_e,At=$({"src/nowiki/noinclude.ts"(){"use strict";q(),nt(),j(),ot(),yr=[Ve(!1)],_e=class extends(wr=Ie){get type(){return"noinclude"}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){{const{lintConfig:t}=I,s="no-ignored",i=t.getSeverity(s,"include");if(i){const{innerText:r}=this,n=/^<(noinclude|includeonly|onlyinclude)\s+(?:[^\s>/]|\/(?!>))[^>]*>$/iu.exec(r);if(n){const l=B(this,{start:e},s,"useless-attribute",i),{computeEditInfo:o}=t,u=n[1].length+1,d=r.endsWith("/>")?2:1;return l.startIndex+=u,l.startCol+=u,l.endIndex-=d,l.endCol-=d,o&&(l.suggestions=[D(l)]),[l]}}return[]}}},Qs=X(wr),_e=V(Qs,0,"NoincludeToken",yr,_e),G(Qs,1,_e)}}),bo,Au=$({"src/link/redirectTarget.ts"(){"use strict";q(),j(),Kt(),At(),bo=class extends Be{get type(){return"redirect-target"}constructor(e,t,s,i){super(e,void 0,s,i),t!==void 0&&this.insertAt(new _e(t,s,i))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,{halfParsed:!0,decode:!0,page:""})}lint(e=this.getAbsoluteIndex()){{const t=super.lint(e,!1),s="no-ignored",{lintConfig:i}=I,r=i.getSeverity(s,"redirect");if(r&&this.length===2){const n=M(this.lastChild,{start:e},s,"useless-link-text",r);n.startIndex--,n.startCol--,(i.computeEditInfo||i.fix)&&(n.fix=D(n)),t.push(n)}return t}}}}}),Sr,Js,kr,jt,_u=$({"src/redirect.ts"(){"use strict";var e,t,s;nt(),ye(),W(),rt(),Au(),Sr=[Ve(!1,!1),me],jt=(s=class extends(kr=R){constructor(r,n,l,o,u,d,a=[]){super(void 0,d,a);L(this,e);L(this,t);E(this,e,r),E(this,t,u),this.append(new Qe(n,"redirect-syntax",d,a),new bo(l,o==null?void 0:o.slice(1),d,a))}get type(){return"redirect"}getAttribute(r){return r==="padding"?b(this,e).length:super.getAttribute(r)}toString(r){return b(this,e)+super.toString(r)+b(this,t)}lint(r=this.getAbsoluteIndex()){{const n=r+b(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",n),this.lastChild.lint(n)}}print(){}},e=new WeakMap,t=new WeakMap,s),Js=X(kr),jt=V(Js,0,"RedirectToken",Sr,jt),G(Js,1,jt)}}),yo={};Z(yo,{parseRedirect:()=>wo});var wo,Tu=$({"parser/redirect.ts"(){"use strict";j(),_u(),wo=(e,t,s)=>{var r;(r=t.regexRedirect)!=null||(t.regexRedirect=new RegExp(String.raw`^(\s*)((?:${t.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));const i=t.regexRedirect.exec(e);return i&&I.normalizeTitle(i[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,page:""}).valid?(e=`\0${s.length}o${e.slice(i[0].length)}`,new jt(...i.slice(1),t,s),e):!1}}}),Ar,Xs,_r,Pt,Cu=$({"src/onlyinclude.ts"(){"use strict";We(),ye(),W(),Ar=[me,Fe("<onlyinclude>")],Pt=class extends(_r=R){get type(){return"onlyinclude"}toString(e){return`<onlyinclude>${super.toString(e)}</onlyinclude>`}isPlain(){return!0}print(){}},Xs=X(_r),Pt=V(Xs,0,"OnlyincludeToken",Ar,Pt),G(Xs,1,Pt)}}),Yt,$s=$({"mixin/gapped.ts"(){"use strict";Yt=(e=1)=>t=>{class s extends t{getGaps(){return e}}return s}}}),Tr,Ks,Cr,Ze,Tn=$({"src/tagPair/index.ts"(){"use strict";var e,t,s;$s(),ye(),W(),Tr=[Yt(),me],Ze=(s=class extends(Cr=R){constructor(r,n,l,o,u,d=[]){super(void 0,u);L(this,e);L(this,t);Pe(this,"closed");this.setAttribute("name",r.toLowerCase()),E(this,e,[r,o||r]),this.closed=o!=="",E(this,t,o===void 0),this.append(n,l);const a=typeof n=="string"?-1:d.indexOf(n);d.splice(a===-1?1/0:a,0,this)}get innerText(){return b(this,t)?void 0:this.lastChild.text()}get selfClosing(){return b(this,t)}toString(r){const{firstChild:n,lastChild:l}=this,[o,u]=b(this,e);return b(this,t)?`<${o}${n.toString(r)}/>`:`<${o}${n.toString(r)}>${l.toString(r)}${this.closed?`</${u}>`:""}`}text(){const[r,n]=b(this,e);return b(this,t)?`<${r}${this.firstChild.text()}/>`:`<${r}${super.text(">")}${this.closed?`</${n}>`:""}`}getAttribute(r){return r==="padding"?b(this,e)[0].length+1:super.getAttribute(r)}print(){}json(r,n=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s),Ks=X(Cr),Ze=V(Ks,0,"TagPairToken",Tr,Ze),G(Ks,1,Ze)}}),$r,Ys,Ir,Bt,$u=$({"src/tagPair/include.ts"(){"use strict";q(),ue(),nt(),j(),Tn(),$r=[Ve(!1)],Bt=class extends(Ir=Ze){get type(){return"include"}constructor(e,t="",s,i,r,n){super(e,t,s!=null?s:"",s===void 0||i!=null?i:"",r,n)}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){{const t=[],{firstChild:s,closed:i,name:r}=this,n=new re(this,e),l=["no-ignored","unclosed-comment"],{lintConfig:o}=I,{computeEditInfo:u}=o,d=l.map(a=>o.getSeverity(a,"include"));if(d[0]&&s.data.trim()){const a=M(s,n,l[0],"useless-attribute",d[0]);u&&(a.suggestions=[D(a)]),t.push(a)}if(d[1]&&!i){const a=B(this,n,l[1],I.msg("unclosed",`<${r}>`),d[1]);u&&(a.suggestions=[He(a.endIndex,`</${r}>`)]),t.push(a)}return t}}},Ys=X(Ir),Bt=V(Ys,0,"IncludeToken",$r,Bt),G(Ys,1,Bt)}}),Is,Cn=$({"mixin/attributesParent.ts"(){"use strict";Is=(e=0)=>t=>{var s,So;{class r extends t{constructor(){super(...arguments);L(this,s)}hasAttr(o){this.lspError("AttributesParent.hasAttr")}getAttr(o){return P(this,s,So).call(this).getAttr(o)}}return s=new WeakSet,So=function(){return this.childNodes[e]},r}}}}),ie,Zs,ei,Nt,ls,ti,Lt,si,ii,ni,os,ri,li,oi,Me,ko,Ao,_o,To,Co,$o=$({"util/sharable.ts"(){"use strict";ie=new Set(["align"]),Zs=new Set(["cite"]),ei=new Set(["cite","datetime"]),Nt=new Set(["width"]),ls=new Set(["axis","align","bgcolor","height","width","valign"]),ti=new Set([...ls,"abbr","headers","scope","rowspan","colspan"]),Lt=new Set(["type"]),si=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),ii=new Set(["clear"]),ni=new Set(["bgcolor","align","valign"]),os=new Set(["id","qid","forcemathmode","type","display"]),ri=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),li=new Set(["weight"]),oi=new Set(["width","height","zoom","latitude","longitude","align","mapstyle","lang","alt","text"]),Me=new Set,ko=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"]),Ao={div:ie,h1:ie,h2:ie,h3:ie,h4:ie,h5:ie,h6:ie,blockquote:Zs,q:Zs,p:ie,br:ii,pre:Nt,ins:ei,del:ei,ul:Lt,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...si,"border"]),caption:ie,tr:ni,td:ti,th:ti,font:new Set(["size","color","face"]),hr:Nt,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Lt,poem:ie,categorytree:ie,combooption:ie,img:new Set(["alt","src","width","height","loading","srcset"])},_o={pre:new Set(["format"]),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:Me,indicator:new Set(["name"]),langconvert:new Set(["from","to"]),ref:new Set(["group","name","follow","dir","details"]),references:new Set(["group","responsive"]),charinsert:new Set(["label"]),choose:new Set(["uncached","before","after"]),option:li,choicetemplate:li,imagemap:Me,inputbox:Me,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:Me,poll:new Set(["id","show-results-before-voting"]),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"]),math:new Set([...os,"chem"]),chem:os,ce:os,hiero:Me,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:ri,syntaxhighlight:ri,templatedata:Me,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:Me,mapframe:new Set([...oi,"frameless"]),maplink:new Set([...oi,"class"]),rss:new Set(["template","templatename","max","highlight","filter","filterout","reverse","date","item-max-length"]),"page-collection":new Set(["lang","name","description","end-date"])},To={table:si,td:new Set([...ls,"scope"]),th:ls,br:ii,caption:ie,div:ie,hr:Nt,h1:ie,h2:ie,h3:ie,h4:ie,h5:ie,h6:ie,li:Lt,p:ie,pre:Nt,tr:ni,ul:Lt},Co={dynamicpagelist:["category","notcategory","namespace","count","offset","imagewidth","imageheight","imagesperrow","mode","gallerycaption","galleryshowfilesize","galleryshowfilename","order","ordermethod","redirects","stablepages","qualitypages","suppresserrors","addfirstcategorydate","shownamespace","ignoresubpages","googlehack","nofollow"],inputbox:["preloadparams[]","type","width","preload","preloadtitle","page","editintro","useve","usedt","summary","nosummary","minor","break","default","placeholder","bgcolor","buttonlabel","searchbuttonlabel","fulltextbutton","namespaces","labeltext","hidden","id","inline","prefix","dir","searchengine","searchtype","searchfilter","tour","arialabel"]}}}),Nr,Lr,Er,Fr,xs,Iu=$({"src/attribute.ts"(){"use strict";var e,t,s,i,r,Io,rn,o;q(),de(),Ee(),$o(),ue(),j(),W(),lt(),Nr=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,Lr=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,Er=new Set(["ext","arg","magic-word","template"]),Fr=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),xs=(o=class extends R{constructor(d,a,h,g,c,p="",f,m=[]){const S=new Le(h,"attr-key",c,m);let A;if(h==="title"||a==="img"&&h==="alt")A=new R(f,c,m,{}),A.type="attr-value",A.setAttribute("stage",ve-1);else if(a==="gallery"&&h==="caption"||a==="ref"&&h==="details"||(a==="mapframe"||a==="maplink")&&h==="text"||a==="choose"&&(h==="before"||h==="after")){const w=je(he({},c),{excludes:[...c.excludes,"heading","html","table","hr","list"]});A=new R(f,w,m,{}),A.type="attr-value",A.setAttribute("stage",1)}else A=new Le(f,"attr-value",c,m,{});super(void 0,c,m);L(this,r);L(this,e);L(this,t);L(this,s);L(this,i);E(this,e,d),this.append(S,A),E(this,s,p),E(this,i,[...g]),E(this,t,a),this.setAttribute("name",wt(fe(h)))}get type(){return b(this,e)}get tag(){return b(this,t)}get balanced(){return!b(this,s)||b(this,i)[0]===b(this,i)[1]}afterBuild(){b(this,s).includes("\0")&&E(this,s,this.buildFromStr(b(this,s),0)),this.parentNode&&E(this,t,this.parentNode.name),P(this,r,Io).call(this),super.afterBuild()}toString(d){const[a="",h=""]=b(this,i);return b(this,s)?super.toString(d,b(this,s)+a)+h:this.firstChild.toString(d)}text(){return b(this,s)?`${super.text(`${b(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var d,a;return b(this,s)?b(this,s).length+((a=(d=b(this,i)[0])==null?void 0:d.length)!=null?a:0):0}lint(d=this.getAbsoluteIndex(),a){var h;{const g=super.lint(d,a),{balanced:c,firstChild:p,lastChild:f,name:m,tag:S}=this,A=new re(this,d),w=["unclosed-quote","obsolete-attr"],{lintConfig:v}=I,k=w.map(C=>v.getSeverity(C,m));if(k[0]&&!c){const C=M(f,A,w[0],"unclosed-quotes",k[0]);C.startIndex--,C.startCol--,v.computeEditInfo&&(C.suggestions=[He(C.endIndex,b(this,i)[0])]),g.push(C)}const y=P(this,r,rn).call(this,d,A);return y&&g.push(y),k[1]&&((h=To[S])!=null&&h.has(m))&&g.push(M(p,A,w[1],"obsolete-attribute",k[1])),g}}getValue(){return b(this,s)?this.lastChild.text().trim():this.type==="ext-attr"||""}escape(){}getAttribute(d){return d==="invalid"?P(this,r,rn).call(this):super.getAttribute(d)}print(){}json(d,a=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakSet,Io=function(){this.setAttribute("name",wt(this.firstChild.text()))},rn=function(d,a){const{firstChild:h,lastChild:g,type:c,name:p,tag:f,parentNode:m}=this,S=!g.childNodes.some(({type:_})=>Er.has(_)),A=this.getValue(),w=_o[f],v=Ao[f],{length:k}=this.toString();let y="illegal-attr",C,x;if({lintConfig:C}=I,{computeEditInfo:x}=C,!(w!=null&&w.has(p))&&!(v!=null&&v.has(p))&&(c==="ext-attr"?w||v:!/\{\{[^{]+\}\}/u.test(p))&&(c==="ext-attr"&&!v||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(p)&&(f==="meta"||f==="link"||!ko.has(p)))||(p==="itemtype"||p==="itemid"||p==="itemref")&&!(m!=null&&m.hasAttr("itemscope"))){if(d===void 0)return!0;{const _=C.getSeverity(y,"unknown");if(_){const T=M(h,a,y,"illegal-attribute-name",_);return x&&(T.suggestions=[D(d,k)]),T}}}else if(p==="style"&&typeof A=="string"&&Nr.test(A)){if(d===void 0)return!0;{y="insecure-style";const _=C.getSeverity(y);return _&&M(g,a,y,"insecure-style",_)}}else if(p==="tabindex"&&typeof A=="string"&&A!=="0"){if(d===void 0)return!0;{const _=C.getSeverity(y,"tabindex");if(_){const T=M(g,a,y,"nonzero-tabindex",_);return x&&(T.suggestions=[D(d,k),$e(T,"0 tabindex","0")]),T}}}else if(typeof A=="string"&&((/^xmlns:[\w:.-]+$/u.test(p)||Fr.has(p))&&Lr.test(A)||S&&(p==="href"||f==="img"&&p==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(A))){if(d===void 0)return!0;{const _=C.getSeverity(y,"value");return _&&M(g,a,y,"illegal-attribute-value",_)}}else if(S&&c!=="ext-attr"){const _=ho(f,p),T=String(A).toLowerCase();if(_.length>0&&_.every(N=>N!==T)){if(d===void 0)return!0;{const N=C.getSeverity(y,"value");return N&&M(g,a,y,"illegal-attribute-value",N)}}}return!1},o)}}),ai,Rr,Or,Ns,$n=$({"src/attributes.ts"(){"use strict";var e,t,ln,i;q(),de(),ue(),j(),W(),lt(),Iu(),ai=r=>r.slice(0,-1),Rr=r=>`${ai(r)}-dirty`,Or=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch(r){return/[^\W_]/u}})(),Ns=(i=class extends R{constructor(n,l,o,u,d=[]){super(void 0,u,d,{});L(this,t);L(this,e);if(E(this,e,l),this.setAttribute("name",o),n){const a=/([^\s/](?:(?!\0\d+~\x7F)[^\s/=])*)(?:((?:\s(?:\s|\0\d+[cn]\x7F)*)?(?:=|\0\d+~\x7F)(?:\s|\0\d+[cn]\x7F)*)(?:(["'])([\s\S]*?)(\3|$)|(\S*)))?/gu;let h="",g=a.exec(n),c=0;const p=(()=>{h&&(super.insertAt(new Le(h,Rr(l),u,d,{})),h="")});for(;g;){const{index:f,0:m,1:S,2:A,3:w,4:v,5:k,6:y}=g;if(h+=n.slice(c,f),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(fe(S).trim())){const C=v!=null?v:y,x=[w,k],_=new xs(ai(l),o,S,x,u,A,C,d);p(),super.insertAt(_)}else h+=m;({lastIndex:c}=a),g=a.exec(n)}h+=n.slice(c),p()}}get type(){return b(this,e)}afterBuild(){const{parentNode:n}=this;n!=null&&n.is("td")&&this.setAttribute("name",n.subtype),super.afterBuild()}getAttrTokens(n){return this.childNodes.filter(l=>l instanceof xs&&(!n||l.name===wt(n)))}hasAttr(n){return this.getAttrTokens(n).length>0}getAttrToken(n){{const l=this.getAttrTokens(n);return l[l.length-1]}}getAttr(n){var l;return(l=this.getAttrToken(n))==null?void 0:l.getValue()}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),{parentNode:u,childNodes:d}=this,a=new Map,h=new Set,g=new re(this,n),c=["no-ignored","no-duplicate"],{lintConfig:p}=I,{computeEditInfo:f,fix:m}=p,S=["closingTag","invalidAttributes","nonWordAttributes"].map(w=>p.getSeverity(c[0],w));if(S[0]&&P(this,t,ln).call(this)){const w=B(this,g,c[0],"attributes-of-closing-tag",S[0]);if(f){const v=u.getAbsoluteIndex();w.suggestions=[D(w),yn(v)]}o.push(w)}for(const w of d)if(w instanceof xs){const{name:v}=w;a.has(v)?(h.add(v),a.get(v).push(w)):a.set(v,[w])}else{const v=w.text().trim(),k=S[Or.test(v)?1:2];if(v&&k){const y=M(w,g,c[0],"invalid-attribute",k);f&&(y.suggestions=[D(y,0," ")]),o.push(y)}}const A=p.getSeverity(c[1],"attribute");if(A&&h.size>0)for(const w of h){const v=a.get(w).map(k=>{const y=k.getValue();return[k,y===!0?"":y]});Array.prototype.push.apply(o,v.map(([k,y],C)=>{const x=M(k,g,c[1],I.msg("duplicate-attribute",w),A);if(f||m){const _=D(x);!y||v.slice(0,C).some(([,T])=>T===y)?x.fix=_:f&&(x.suggestions=[_])}return x}))}return o}}escape(){}getAttribute(n){return n==="invalid"?P(this,t,ln).call(this):super.getAttribute(n)}print(){}},e=new WeakMap,t=new WeakSet,ln=function(){const{parentNode:n}=this;return(n==null?void 0:n.type)==="html"&&n.closing&&this.text().trim()!==""},i)}}),No={};Z(No,{PreToken:()=>Lo});var Lo,Nu=$({"src/pre.ts"(){"use strict";Ee(),W(),At(),Lo=class extends R{get type(){return"ext-inner"}constructor(e,t,s=[]){if(e){const i=/<nowiki>/giu,r=/<\/nowiki>/giu,{length:n}=i.source;let l=i.exec(e);l&&(r.lastIndex=l.index+n);let o=r.exec(e),u=0,d="";for(;l&&o;)new _e(l[0],t,s,!0),new _e(o[0],t,s,!0),d+=`${e.slice(u,l.index)}\0${s.length-1}n${e.slice(l.index+n,o.index)}\0${s.length}n`,u=o.index+n+1,i.lastIndex=u,l=i.exec(e),l&&(r.lastIndex=l.index+n),o=r.exec(e);e=d+e.slice(u)}super(e,t,s,{}),this.setAttribute("stage",ve-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),Ls,In=$({"src/multiLine/index.ts"(){"use strict";W(),Ls=class extends R{get type(){return"ext-inner"}toString(e){return super.toString(e,`
5
+ `),Ce!==-1));)Se=Se.nextSibling;if(!Se)continue;Oe=Se.data.slice(0,Ce)}else Oe=d.slice(U+ne,oe);if(!/(?:^|[^=])=+\s*(?:\S\s*)?$/u.test(Oe))continue;oe===-1?(Y=Se.getAbsoluteIndex()+Oe.length,{top:qe,left:Je}=w.posFromIndex(Y)):(Y+=Oe.length,ne+=Oe.length)}const Ke={rule:se,message:I.msg(K==="="?"header-like":"lonely",Re||K==="h"||Ps||Bs?O:K),severity:xe,startIndex:ae,endIndex:Y,startLine:Dn,endLine:qe!=null?qe:Dn,startCol:Hn,endCol:Je!=null?Je:Hn+ne};if(T.computeEditInfo)if(K==="<")Ke.suggestions=[St(ae,"&lt;")];else if(K==="h"&&c!=="link-text"&&fr.test(Os||""))Ke.suggestions=[Jt(ae)];else if(we){const oe=a.getAbsoluteIndex()+a.toString().length;Ke.suggestions=[St(oe,"&#93;")]}else if(O==="]"&&zn){const oe=r-g.toString().length;Ke.suggestions=[Ts(oe,"left-bracket","[")]}else Re&&(Ke.suggestions=[...z[0]===O?[]:[Sn(Ke,O)],...Xe===":"||Xe===":"?[Jt(Y,1)]:[]]);f.push(Ke)}return f}}replaceData(r){P(this,e,xo).call(this,r)}splitText(r){this.lspError("AstText.splitText")}escape(){}print(){}},e=new WeakSet,xo=function(r){this.setAttribute("data",r)},s)}}),Ve,nt=$({"mixin/hidden.ts"(){"use strict";Ve=(e=!0,t=!0)=>s=>{class n extends s{text(){return""}lint(i){return e?[]:super.lint(i)}}return n}}}),me,ye=$({"mixin/noEscape.ts"(){"use strict";me=e=>{}}}),Qe,rt=$({"src/syntax.ts"(){"use strict";var e,t;W(),Qe=(t=class extends R{constructor(n,r,i,l,o){super(n,i,l,o);L(this,e);E(this,e,r)}get type(){return b(this,e)}lint(n=this.getAbsoluteIndex()){return super.lint(n,!1)}},e=new WeakMap,t)}}),Fe,We=$({"mixin/padded.ts"(){"use strict";Fe=({length:e})=>t=>{class s extends t{getAttribute(r){return r==="padding"?e:super.getAttribute(r)}}return s}}}),Le,lt=$({"src/atom.ts"(){"use strict";var e,t;W(),Le=(t=class extends R{constructor(n,r,i,l,o){super(n,i,l,o);L(this,e);E(this,e,r)}get type(){return b(this,e)}set type(n){E(this,e,n)}getAttribute(n){var r;return n==="invalid"?this.type==="converter-flag"&&!!((r=this.parentNode)!=null&&r.isInvalidFlag(this)):super.getAttribute(n)}},e=new WeakMap,t)}}),mr,Gs,xr,Be,Kt=$({"src/link/base.ts"(){"use strict";var e,t,s,n,vo,i;q(),Ee(),Te(),ue(),We(),ye(),j(),W(),lt(),mr=[me,Fe("[[")],Be=(i=class extends(xr=R){constructor(o,u,d,a=[],h="|"){super(void 0,d,a,{});L(this,n);L(this,e,!0);L(this,t);L(this,s);if(this.insertAt(new Le(o,"link-target",d,a,{})),u!==void 0){const g=new R(u,d,a,{});g.type="link-text",g.setAttribute("stage",ve-1),this.insertAt(g)}E(this,t,h)}get link(){}get fragment(){}afterBuild(){E(this,s,this.getTitle()),b(this,t).includes("\0")&&E(this,t,this.buildFromStr(b(this,t),0)),P(this,n,vo).call(this),super.afterBuild()}setAttribute(o,u){o==="bracket"?E(this,e,u):o==="title"?E(this,s,u):super.setAttribute(o,u)}toString(o){const u=super.toString(o,b(this,t));return b(this,e)?`[[${u}]]`:u}text(){const o=super.text("|");return b(this,e)?`[[${o}]]`:o}getAttribute(o){return o==="title"?b(this,s):super.getAttribute(o)}getGaps(o){return o===0?b(this,t).length:1}lint(o=this.getAbsoluteIndex(),u){{const d=super.lint(o,u),{childNodes:[a,h],type:g}=this,{encoded:c,fragment:p}=b(this,s),{lintConfig:f}=I,{computeEditInfo:m,fix:S}=f,k=new re(this,o);let w="unknown-page",v=f.getSeverity(w);if(v&&a.childNodes.some(({type:A})=>A==="template")&&d.push(M(a,k,w,"template-in-link",v)),w="url-encoding",v=f.getSeverity(w),v&&c){const A=M(a,k,w,"unnecessary-encoding",v);(m||S)&&(A.fix=bn(A,a)),d.push(A)}if(w="pipe-like",v=f.getSeverity(w,"link"),v&&(g==="link"||g==="category")){const A=h==null?void 0:h.childNodes.findIndex(C=>C.type==="text"&&C.data.includes("|")),y=h==null?void 0:h.childNodes[A];if(y){const C=M(h,k,w,"pipe-in-link",v);if(m){const x=C.startIndex+h.getRelativeIndex(A);C.suggestions=[kn(x,y.data)]}d.push(C)}}if(w="no-ignored",v=f.getSeverity(w,"fragment"),v&&p!==void 0&&!Za(g)){const A=M(a,k,w,"useless-fragment",v);if(m||S){const y=a.childNodes.findIndex(x=>x.type==="text"&&x.data.includes("#")),C=a.childNodes[y];C&&(A.fix=D(A,a.getRelativeIndex(y)+C.data.indexOf("#")))}d.push(A)}return d}}getTitle(o,u){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:u,temporary:o,decode:!0,selfLink:!0})}print(){}json(o,u=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n=new WeakSet,vo=function(){this.type!=="ext-inner"&&this.setAttribute("name",b(this,s).title)},i),Gs=X(xr),Be=V(Gs,0,"LinkBaseToken",mr,Be),G(Gs,1,Be)}}),vr,Vs,br,Ie,ot=$({"src/nowiki/base.ts"(){"use strict";ye(),W(),vr=[me],Ie=class extends(br=R){get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}},Vs=X(br),Ie=V(Vs,0,"NowikiBaseToken",vr,Ie),G(Vs,1,Ie)}}),yr,Qs,wr,_e,At=$({"src/nowiki/noinclude.ts"(){"use strict";q(),nt(),j(),ot(),yr=[Ve(!1)],_e=class extends(wr=Ie){get type(){return"noinclude"}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){{const{lintConfig:t}=I,s="no-ignored",n=t.getSeverity(s,"include");if(n){const{innerText:r}=this,i=/^<(includeonly|(?:no|only)include)\s+(?:[^\s>/]|\/(?!>))[^>]*>$/iu.exec(r);if(i){const l=B(this,{start:e},s,"useless-attribute",n),{computeEditInfo:o}=t,u=i[1].length+1,d=r.endsWith("/>")?2:1;return l.startIndex+=u,l.startCol+=u,l.endIndex-=d,l.endCol-=d,o&&(l.suggestions=[D(l)]),[l]}}return[]}}},Qs=X(wr),_e=V(Qs,0,"NoincludeToken",yr,_e),G(Qs,1,_e)}}),bo,Au=$({"src/link/redirectTarget.ts"(){"use strict";q(),j(),Kt(),At(),bo=class extends Be{get type(){return"redirect-target"}constructor(e,t,s,n){super(e,void 0,s,n),t!==void 0&&this.insertAt(new _e(t,s,n))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,{halfParsed:!0,decode:!0,page:""})}lint(e=this.getAbsoluteIndex()){{const t=super.lint(e,!1),s="no-ignored",{lintConfig:n}=I,r=n.getSeverity(s,"redirect");if(r&&this.length===2){const i=M(this.lastChild,{start:e},s,"useless-link-text",r);i.startIndex--,i.startCol--,(n.computeEditInfo||n.fix)&&(i.fix=D(i)),t.push(i)}return t}}}}}),Sr,Js,kr,jt,_u=$({"src/redirect.ts"(){"use strict";var e,t,s;nt(),ye(),W(),rt(),Au(),Sr=[Ve(!1,!1),me],jt=(s=class extends(kr=R){constructor(r,i,l,o,u,d,a=[]){super(void 0,d,a);L(this,e);L(this,t);E(this,e,r),E(this,t,u),this.append(new Qe(i,"redirect-syntax",d,a),new bo(l,o==null?void 0:o.slice(1),d,a))}get type(){return"redirect"}getAttribute(r){return r==="padding"?b(this,e).length:super.getAttribute(r)}toString(r){return b(this,e)+super.toString(r)+b(this,t)}lint(r=this.getAbsoluteIndex()){{const i=r+b(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",i),this.lastChild.lint(i)}}print(){}},e=new WeakMap,t=new WeakMap,s),Js=X(kr),jt=V(Js,0,"RedirectToken",Sr,jt),G(Js,1,jt)}}),yo={};Z(yo,{parseRedirect:()=>wo});var wo,Tu=$({"parser/redirect.ts"(){"use strict";j(),_u(),wo=(e,t,s)=>{var r;(r=t.regexRedirect)!=null||(t.regexRedirect=new RegExp(String.raw`^(\s*)((?:${t.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));const n=t.regexRedirect.exec(e);return n&&I.normalizeTitle(n[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,page:""}).valid?(e=`\0${s.length}o${e.slice(n[0].length)}`,new jt(...n.slice(1),t,s),e):!1}}}),Ar,Xs,_r,Pt,Cu=$({"src/onlyinclude.ts"(){"use strict";We(),ye(),W(),Ar=[me,Fe("<onlyinclude>")],Pt=class extends(_r=R){get type(){return"onlyinclude"}toString(e){return`<onlyinclude>${super.toString(e)}</onlyinclude>`}isPlain(){return!0}print(){}},Xs=X(_r),Pt=V(Xs,0,"OnlyincludeToken",Ar,Pt),G(Xs,1,Pt)}}),Yt,$s=$({"mixin/gapped.ts"(){"use strict";Yt=(e=1)=>t=>{class s extends t{getGaps(){return e}}return s}}}),Tr,Ks,Cr,Ze,Tn=$({"src/tagPair/index.ts"(){"use strict";var e,t,s;$s(),ye(),W(),Tr=[Yt(),me],Ze=(s=class extends(Cr=R){constructor(r,i,l,o,u,d=[]){super(void 0,u);L(this,e);L(this,t);Pe(this,"closed");this.setAttribute("name",r.toLowerCase()),E(this,e,[r,o||r]),this.closed=o!=="",E(this,t,o===void 0),this.append(i,l);const a=typeof i=="string"?-1:d.indexOf(i);d.splice(a===-1?1/0:a,0,this)}get innerText(){return b(this,t)?void 0:this.lastChild.text()}get selfClosing(){return b(this,t)}toString(r){const{firstChild:i,lastChild:l}=this,[o,u]=b(this,e);return b(this,t)?`<${o}${i.toString(r)}/>`:`<${o}${i.toString(r)}>${l.toString(r)}${this.closed?`</${u}>`:""}`}text(){const[r,i]=b(this,e);return b(this,t)?`<${r}${this.firstChild.text()}/>`:`<${r}${super.text(">")}${this.closed?`</${i}>`:""}`}getAttribute(r){return r==="padding"?b(this,e)[0].length+1:super.getAttribute(r)}print(){}json(r,i=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s),Ks=X(Cr),Ze=V(Ks,0,"TagPairToken",Tr,Ze),G(Ks,1,Ze)}}),$r,Ys,Ir,Bt,$u=$({"src/tagPair/include.ts"(){"use strict";q(),ue(),nt(),j(),Tn(),$r=[Ve(!1)],Bt=class extends(Ir=Ze){get type(){return"include"}constructor(e,t="",s,n,r,i){super(e,t,s!=null?s:"",s===void 0||n!=null?n:"",r,i)}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){{const t=[],{firstChild:s,closed:n,name:r}=this,i=new re(this,e),l=["no-ignored","unclosed-comment"],{lintConfig:o}=I,{computeEditInfo:u}=o,d=l.map(a=>o.getSeverity(a,"include"));if(d[0]&&s.data.trim()){const a=M(s,i,l[0],"useless-attribute",d[0]);u&&(a.suggestions=[D(a)]),t.push(a)}if(d[1]&&!n){const a=B(this,i,l[1],I.msg("unclosed",`<${r}>`),d[1]);u&&(a.suggestions=[He(a.endIndex,`</${r}>`)]),t.push(a)}return t}}},Ys=X(Ir),Bt=V(Ys,0,"IncludeToken",$r,Bt),G(Ys,1,Bt)}}),Is,Cn=$({"mixin/attributesParent.ts"(){"use strict";Is=(e=0)=>t=>{var s,So;{class r extends t{constructor(){super(...arguments);L(this,s)}hasAttr(o){this.lspError("AttributesParent.hasAttr")}getAttr(o){return P(this,s,So).call(this).getAttr(o)}}return s=new WeakSet,So=function(){return this.childNodes[e]},r}}}}),ie,Zs,ei,Nt,ls,ti,Lt,si,ii,ni,os,ri,li,oi,Me,ko,Ao,_o,To,Co,$o=$({"util/sharable.ts"(){"use strict";ie=new Set(["align"]),Zs=new Set(["cite"]),ei=new Set(["cite","datetime"]),Nt=new Set(["width"]),ls=new Set(["axis","align","bgcolor","height","width","valign"]),ti=new Set([...ls,"abbr","headers","scope","rowspan","colspan"]),Lt=new Set(["type"]),si=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),ii=new Set(["clear"]),ni=new Set(["bgcolor","align","valign"]),os=new Set(["id","qid","forcemathmode","type","display"]),ri=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),li=new Set(["weight"]),oi=new Set(["width","height","zoom","latitude","longitude","align","mapstyle","lang","alt","text"]),Me=new Set,ko=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"]),Ao={div:ie,h1:ie,h2:ie,h3:ie,h4:ie,h5:ie,h6:ie,blockquote:Zs,q:Zs,p:ie,br:ii,pre:Nt,ins:ei,del:ei,ul:Lt,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...si,"border"]),caption:ie,tr:ni,td:ti,th:ti,font:new Set(["size","color","face"]),hr:Nt,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Lt,poem:ie,categorytree:ie,combooption:ie,img:new Set(["alt","src","width","height","loading","srcset"])},_o={pre:new Set(["format"]),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:Me,indicator:new Set(["name"]),langconvert:new Set(["from","to"]),ref:new Set(["group","name","follow","dir","details"]),references:new Set(["group","responsive"]),charinsert:new Set(["label"]),choose:new Set(["uncached","before","after"]),option:li,choicetemplate:li,imagemap:Me,inputbox:Me,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:Me,poll:new Set(["id","show-results-before-voting"]),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"]),math:new Set([...os,"chem"]),chem:os,ce:os,hiero:Me,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:ri,syntaxhighlight:ri,templatedata:Me,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:Me,mapframe:new Set([...oi,"frameless"]),maplink:new Set([...oi,"class"]),rss:new Set(["template","templatename","max","highlight","filter","filterout","reverse","date","item-max-length"]),"page-collection":new Set(["lang","name","description","end-date"])},To={table:si,td:new Set([...ls,"scope"]),th:ls,br:ii,caption:ie,div:ie,hr:Nt,h1:ie,h2:ie,h3:ie,h4:ie,h5:ie,h6:ie,li:Lt,p:ie,pre:Nt,tr:ni,ul:Lt},Co={dynamicpagelist:["category","notcategory","namespace","count","offset","imagewidth","imageheight","imagesperrow","mode","gallerycaption","galleryshowfilesize","galleryshowfilename","order","ordermethod","redirects","stablepages","qualitypages","suppresserrors","addfirstcategorydate","shownamespace","ignoresubpages","googlehack","nofollow"],inputbox:["preloadparams[]","type","width","preload","preloadtitle","page","editintro","useve","usedt","summary","nosummary","minor","break","default","placeholder","bgcolor","buttonlabel","searchbuttonlabel","fulltextbutton","namespaces","labeltext","hidden","id","inline","prefix","dir","searchengine","searchtype","searchfilter","tour","arialabel"]}}}),Nr,Lr,Er,Fr,xs,Iu=$({"src/attribute.ts"(){"use strict";var e,t,s,n,r,Io,rn,o;q(),de(),Ee(),$o(),ue(),j(),W(),lt(),Nr=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,Lr=/(?:^|\s|\*\/)(?:java|vb)script(?:\W|$)/iu,Er=new Set(["ext","arg","magic-word","template"]),Fr=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),xs=(o=class extends R{constructor(d,a,h,g,c,p="",f,m=[]){const S=new Le(h,"attr-key",c,m);let k;if(h==="title"||a==="img"&&h==="alt")k=new R(f,c,m,{}),k.type="attr-value",k.setAttribute("stage",ve-1);else if(a==="gallery"&&h==="caption"||a==="ref"&&h==="details"||(a==="mapframe"||a==="maplink")&&h==="text"||a==="choose"&&(h==="before"||h==="after")){const w=je(he({},c),{excludes:[...c.excludes,"heading","html","table","hr","list"]});k=new R(f,w,m,{}),k.type="attr-value",k.setAttribute("stage",1)}else k=new Le(f,"attr-value",c,m,{});super(void 0,c,m);L(this,r);L(this,e);L(this,t);L(this,s);L(this,n);E(this,e,d),this.append(S,k),E(this,s,p),E(this,n,[...g]),E(this,t,a),this.setAttribute("name",wt(fe(h)))}get type(){return b(this,e)}get tag(){return b(this,t)}get balanced(){return!b(this,s)||b(this,n)[0]===b(this,n)[1]}afterBuild(){b(this,s).includes("\0")&&E(this,s,this.buildFromStr(b(this,s),0)),this.parentNode&&E(this,t,this.parentNode.name),P(this,r,Io).call(this),super.afterBuild()}toString(d){const[a="",h=""]=b(this,n);return b(this,s)?super.toString(d,b(this,s)+a)+h:this.firstChild.toString(d)}text(){return b(this,s)?`${super.text(`${b(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var d,a;return b(this,s)?b(this,s).length+((a=(d=b(this,n)[0])==null?void 0:d.length)!=null?a:0):0}lint(d=this.getAbsoluteIndex(),a){var h;{const g=super.lint(d,a),{balanced:c,firstChild:p,lastChild:f,name:m,tag:S}=this,k=new re(this,d),w=["unclosed-quote","obsolete-attr"],{lintConfig:v}=I,A=w.map(C=>v.getSeverity(C,m));if(A[0]&&!c){const C=M(f,k,w[0],"unclosed-quotes",A[0]);C.startIndex--,C.startCol--,v.computeEditInfo&&(C.suggestions=[He(C.endIndex,b(this,n)[0])]),g.push(C)}const y=P(this,r,rn).call(this,d,k);return y&&g.push(y),A[1]&&((h=To[S])!=null&&h.has(m))&&g.push(M(p,k,w[1],"obsolete-attribute",A[1])),g}}getValue(){return b(this,s)?this.lastChild.text().trim():this.type==="ext-attr"||""}escape(){}getAttribute(d){return d==="invalid"?P(this,r,rn).call(this):super.getAttribute(d)}print(){}json(d,a=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n=new WeakMap,r=new WeakSet,Io=function(){this.setAttribute("name",wt(this.firstChild.text()))},rn=function(d,a){const{firstChild:h,lastChild:g,type:c,name:p,tag:f,parentNode:m}=this,S=!g.childNodes.some(({type:_})=>Er.has(_)),k=this.getValue(),w=_o[f],v=Ao[f],{length:A}=this.toString();let y="illegal-attr",C,x;if({lintConfig:C}=I,{computeEditInfo:x}=C,!(w!=null&&w.has(p))&&!(v!=null&&v.has(p))&&(c==="ext-attr"?w||v:!/\{\{[^{]+\}\}/u.test(p))&&(c==="ext-attr"&&!v||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(p)&&(f==="meta"||f==="link"||!ko.has(p)))||(p==="itemtype"||p==="itemid"||p==="itemref")&&!(m!=null&&m.hasAttr("itemscope"))){if(d===void 0)return!0;{const _=C.getSeverity(y,"unknown");if(_){const T=M(h,a,y,"illegal-attribute-name",_);return x&&(T.suggestions=[D(d,A)]),T}}}else if(p==="style"&&typeof k=="string"&&Nr.test(k)){if(d===void 0)return!0;{y="insecure-style";const _=C.getSeverity(y);return _&&M(g,a,y,"insecure-style",_)}}else if(p==="tabindex"&&typeof k=="string"&&k!=="0"){if(d===void 0)return!0;{const _=C.getSeverity(y,"tabindex");if(_){const T=M(g,a,y,"nonzero-tabindex",_);return x&&(T.suggestions=[D(d,A),$e(T,"0 tabindex","0")]),T}}}else if(typeof k=="string"&&((/^xmlns:[\w:.-]+$/u.test(p)||Fr.has(p))&&Lr.test(k)||S&&(p==="href"||f==="img"&&p==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(k))){if(d===void 0)return!0;{const _=C.getSeverity(y,"value");return _&&M(g,a,y,"illegal-attribute-value",_)}}else if(S&&c!=="ext-attr"){const _=ho(f,p),T=String(k).toLowerCase();if(_.length>0&&_.every(N=>N!==T)){if(d===void 0)return!0;{const N=C.getSeverity(y,"value");return N&&M(g,a,y,"illegal-attribute-value",N)}}}return!1},o)}}),ai,Rr,Or,Ns,$n=$({"src/attributes.ts"(){"use strict";var e,t,ln,n;q(),de(),ue(),j(),W(),lt(),Iu(),ai=r=>r.slice(0,-1),Rr=r=>`${ai(r)}-dirty`,Or=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch(r){return/[^\W_]/u}})(),Ns=(n=class extends R{constructor(i,l,o,u,d=[]){super(void 0,u,d,{});L(this,t);L(this,e);if(E(this,e,l),this.setAttribute("name",o),i){const a=/([^\s/](?:(?!\0\d+~\x7F)[^\s/=])*)(?:((?:\s(?:\s|\0\d+[cn]\x7F)*)?(?:=|\0\d+~\x7F)(?:\s|\0\d+[cn]\x7F)*)(?:(["'])([\s\S]*?)(\3|$)|(\S*)))?/gu;let h="",g=a.exec(i),c=0;const p=(()=>{h&&(super.insertAt(new Le(h,Rr(l),u,d,{})),h="")});for(;g;){const{index:f,0:m,1:S,2:k,3:w,4:v,5:A,6:y}=g;if(h+=i.slice(c,f),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(fe(S).trim())){const C=v!=null?v:y,x=[w,A],_=new xs(ai(l),o,S,x,u,k,C,d);p(),super.insertAt(_)}else h+=m;({lastIndex:c}=a),g=a.exec(i)}h+=i.slice(c),p()}}get type(){return b(this,e)}afterBuild(){const{parentNode:i}=this;i!=null&&i.is("td")&&this.setAttribute("name",i.subtype),super.afterBuild()}getAttrTokens(i){return this.childNodes.filter(l=>l instanceof xs&&(!i||l.name===wt(i)))}hasAttr(i){return this.getAttrTokens(i).length>0}getAttrToken(i){{const l=this.getAttrTokens(i);return l[l.length-1]}}getAttr(i){var l;return(l=this.getAttrToken(i))==null?void 0:l.getValue()}lint(i=this.getAbsoluteIndex(),l){{const o=super.lint(i,l),{parentNode:u,childNodes:d}=this,a=new Map,h=new Set,g=new re(this,i),c=["no-ignored","no-duplicate"],{lintConfig:p}=I,{computeEditInfo:f,fix:m}=p,S=["closingTag","invalidAttributes","nonWordAttributes"].map(w=>p.getSeverity(c[0],w));if(S[0]&&P(this,t,ln).call(this)){const w=B(this,g,c[0],"attributes-of-closing-tag",S[0]);if(f){const v=u.getAbsoluteIndex();w.suggestions=[D(w),yn(v)]}o.push(w)}for(const w of d)if(w instanceof xs){const{name:v}=w;a.has(v)?(h.add(v),a.get(v).push(w)):a.set(v,[w])}else{const v=w.text().trim(),A=S[Or.test(v)?1:2];if(v&&A){const y=M(w,g,c[0],"invalid-attribute",A);f&&(y.suggestions=[D(y,0," ")]),o.push(y)}}const k=p.getSeverity(c[1],"attribute");if(k&&h.size>0)for(const w of h){const v=a.get(w).map(A=>{const y=A.getValue();return[A,y===!0?"":y]});Array.prototype.push.apply(o,v.map(([A,y],C)=>{const x=M(A,g,c[1],I.msg("duplicate-attribute",w),k);if(f||m){const _=D(x);!y||v.slice(0,C).some(([,T])=>T===y)?x.fix=_:f&&(x.suggestions=[_])}return x}))}return o}}escape(){}getAttribute(i){return i==="invalid"?P(this,t,ln).call(this):super.getAttribute(i)}print(){}},e=new WeakMap,t=new WeakSet,ln=function(){const{parentNode:i}=this;return(i==null?void 0:i.type)==="html"&&i.closing&&this.text().trim()!==""},n)}}),No={};Z(No,{PreToken:()=>Lo});var Lo,Nu=$({"src/pre.ts"(){"use strict";Ee(),W(),At(),Lo=class extends R{get type(){return"ext-inner"}constructor(e,t,s=[]){if(e){const n=/<nowiki>/giu,r=/<\/nowiki>/giu,{length:i}=n.source;let l=n.exec(e);l&&(r.lastIndex=l.index+i);let o=r.exec(e),u=0,d="";for(;l&&o;)new _e(l[0],t,s,!0),new _e(o[0],t,s,!0),d+=`${e.slice(u,l.index)}\0${s.length-1}n${e.slice(l.index+i,o.index)}\0${s.length}n`,u=o.index+i+1,n.lastIndex=u,l=n.exec(e),l&&(r.lastIndex=l.index+i),o=r.exec(e);e=d+e.slice(u)}super(e,t,s,{}),this.setAttribute("stage",ve-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),Ls,In=$({"src/multiLine/index.ts"(){"use strict";W(),Ls=class extends R{get type(){return"ext-inner"}toString(e){return super.toString(e,`
6
6
  `)}text(){return super.text(`
7
7
  `).replace(/\n\s*\n/gu,`
8
- `)}getGaps(){return 1}print(){}}}}),Eo,Lu=$({"src/paramLine.ts"(){"use strict";q(),$o(),j(),W(),Eo=class extends R{get type(){return"param-line"}constructor(e,t,s,i,r){super(t,s,i,r),this.setAttribute("name",e)}lint(e=this.getAbsoluteIndex()){{const t="no-ignored",{lintConfig:s}=I,{name:i,childNodes:r}=this,n=s.getSeverity(t,i);if(!n)return[];const l=I.msg("invalid-parameter",i);if(r.some(({type:h})=>h==="ext"))return[B(this,{start:e},t,l,n)];const o=r.filter(({type:h})=>h!=="comment"&&h!=="include"&&h!=="noinclude"),u=i==="inputbox",d=u?o.findIndex(({type:h})=>h!=="text"):-1;let a=o.slice(0,d===-1?void 0:d).map(String).join("").trim();if(a){u&&(a=a.toLowerCase());const h=a.indexOf("="),g=a.slice(0,h===-1?void 0:h).trim(),c=Co[i];if(h===-1?d===-1||!c.some(p=>p.startsWith(g)):!c.includes(g)){const p=B(this,{start:e},t,l,n);return s.computeEditInfo&&(p.suggestions=[D(p)]),[p]}}return super.lint(e,!1)}}}}}),Fo={};Z(Fo,{ParamTagToken:()=>Nn});var Nn,Ro=$({"src/multiLine/paramTag.ts"(){"use strict";Fs(),In(),Lu(),Nn=class extends Ls{constructor(e,t,s,i,r=[],n){super(void 0,i,r,{}),s&&this.safeAppend(s.split(`
9
- `).map(l=>n?l:Zt(l,i,r,t)).map(l=>new Eo(e,l,i,r,{}))),r.splice(r.indexOf(this),1),r.push(this)}}}}),jr,ui,Pr,ht,Oo=$({"src/heading.ts"(){"use strict";var e,t,on,i;q(),Te(),ue(),ye(),j(),W(),rt(),jr=[me],ht=(i=class extends(Pr=R){constructor(n,l,o,u=[]){super(void 0,o,u);L(this,t);L(this,e);E(this,e,n);const d=new R(l[0],o,u);d.type="heading-title",d.setAttribute("stage",2);const a=new Qe(l[1],"heading-trail",o,u);this.append(d,a)}get type(){return"heading"}get level(){return b(this,e)}toString(n){const l=P(this,t,on).call(this);return l+this.firstChild.toString(n)+l+this.lastChild.toString(n)}text(){const n=P(this,t,on).call(this);return n+this.firstChild.text()+n}getAttribute(n){return n==="invalid"?this.inHtmlAttrs()===2:n==="padding"?this.level:super.getAttribute(n)}getGaps(){return this.level}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),{firstChild:u,level:d}=this,a=u.toString(),h=a.startsWith("="),g=h||a.endsWith("="),c=new re(this,n),p=this.inHtmlAttrs(),f=["h1","unbalanced-header","format-leakage"],{lintConfig:m}=I,{computeEditInfo:S,fix:A}=m,w=f.map(v=>m.getSeverity(v,"apostrophe"));if(w[0]&&this.level===1){const v=M(u,c,f[0],"<h1>",w[0]);S&&!g&&(v.suggestions=[$e(v,"h2",`=${a}=`)]),o.push(v)}if(w[1]&&g){const v=I.msg("unbalanced-in-section-header",'"="'),k=M(u,c,f[1],v,w[1]);if(!(!S||a==="="))if(h){const[y]=/^=+/u.exec(a),C=d+y.length;k.suggestions=[{desc:`h${d}`,range:[k.startIndex,k.startIndex+y.length],text:""}],C<7&&k.suggestions.push({desc:`h${C}`,range:[k.endIndex,k.endIndex],text:y})}else{const y=/[^=](=+)$/u.exec(a)[1],C=d+y.length;k.suggestions=[{desc:`h${d}`,range:[k.endIndex-y.length,k.endIndex],text:""}],C<7&&k.suggestions.push({desc:`h${C}`,range:[k.startIndex,k.startIndex],text:y})}o.push(k)}if(p){const v="parsing-order",k=m.getSeverity(v,p===2?"heading":"templateInTable");k&&o.push(B(this,c,v,"header-in-html",k))}if(w[2]){const v=this.getRootNode().toString(),k=u.childNodes.filter(Rs("quote")),y=k.filter(({bold:x})=>x),C=k.filter(({italic:x})=>x);if(y.length%2){const x=M(y[y.length-1],je(he({},c),{start:n+d,left:c.left+d}),f[2],I.msg("unbalanced-in-section-header","bold-apostrophes"),w[2]);if(S||A){const _=n+d+a.length,T=D(x);v.slice(x.endIndex,_).trim()?S&&(x.suggestions=[T,He(_,"'''")]):y.length===1&&C.length===0?x.fix=T:S&&(x.suggestions=[T])}o.push(x)}if(C.length%2){const x=M(C[C.length-1],{start:n+d},f[2],I.msg("unbalanced-in-section-header","italic-apostrophes"),w[2]);if(S||A){const _=n+d+a.length;v.slice(x.endIndex,_).trim()?S&&(x.suggestions=[He(_,"''")]):C.length===1&&y.length===0?x.fix=D(x):S&&(x.suggestions=[D(x)])}o.push(x)}}return o}}print(){}json(n,l=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakSet,on=function(){return"=".repeat(this.level)},i),ui=X(Pr),ht=V(ui,0,"HeadingToken",jr,ht),G(ui,1,ht)}}),Br,jo,Eu=$({"src/parameter.ts"(){"use strict";de(),q(),j(),W(),Br=new RegExp(`https?://${bt}${yt}$`,"iu"),jo=class extends R{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){}constructor(e,t,s,i=[]){super(void 0,s,i);const r=new R(typeof e=="number"?void 0:e,s,i,{}),n=new R(t,s,i);r.type="parameter-key",r.setAttribute("stage",2),n.type="parameter-value",n.setAttribute("stage",2),this.append(r,n)}trimName(e,t=!0){const s=(typeof e=="string"?e:e.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",s),s}afterBuild(){if(!this.anon){const{parentNode:e,firstChild:t}=this,s=this.trimName(t);e&&e.getArgs(s,!1,!1).add(this)}super.afterBuild()}toString(e){return this.anon?this.lastChild.toString(e):super.toString(e,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(e=this.getAbsoluteIndex(),t){var s;{const i=super.lint(e,t),r="unescaped",{lintConfig:n}=I,l=n.getSeverity(r);if(l){const{firstChild:o}=this,u=(s=Br.exec(o.text()))==null?void 0:s[0];try{if(u&&new URL(u).search){const d=M(o,{start:e},r,"unescaped-query",l);d.startIndex=d.endIndex,d.startLine=d.endLine,d.startCol=d.endCol,d.endIndex++,d.endCol++,(n.computeEditInfo||n.fix)&&(d.fix=St(d.startIndex,"{{=}}")),i.push(d)}}catch(d){}}return i}}print(){}json(e,t=this.getAbsoluteIndex()){}}}}),Wr,di,qr,ct,Fu=$({"src/transclude.ts"(){"use strict";var e,t,s,i,r,n,an,Po,u;de(),q(),Te(),ue(),$s(),ye(),j(),W(),Eu(),lt(),rt(),Wr=[me,Yt()],ct=(u=class extends(qr=R){constructor(a,h,g,c=[]){var _,T;let p;const f=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(a);f&&(p=Number(f[1]),a=a.replace(`\0${p}h`,c[p].toString().replace(/^\n/u,"")));super(void 0,g,c,{});L(this,n);Pe(this,"modifier","");L(this,e,"template");L(this,t,":");L(this,s,!1);L(this,i,new Map);L(this,r);const{parserFunction:m,variable:S,functionHook:A}=g,w=(_=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(a))==null?void 0:_[0];if(w)this.setAttribute("modifier",w),a=a.slice(w.length);else if(a.includes(":")){const[N,...F]=a.split(":"),[Q]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((T=F[0])!=null?T:"");this.setModifier(`${N}:${Q}`)&&(a=F.join(":").slice(Q.length))}const v=a.search(/[::]/u),k=a[v]===":",y=v!==-1;if(y||h.length===0&&!b(this,s)){const N=y?a.slice(0,v):a,F=y&&a.slice(v+1),Q=fe(N),z=y?Q.slice(Q.search(/\S/u))+(k?":":""):Q.trim(),[,U,O]=eu(z,m),pe=!("functionHook"in g)||A.includes(O),ge=S.includes(O);if(y?O&&pe:ge){this.setAttribute("name",O),E(this,e,"magic-word"),k&&E(this,t,":");const we=new Qe(N,"magic-word-name",g,c);if(super.insertAt(we),F!==!1&&h.unshift([F]),this.name==="invoke")for(let K=0;K<2;K++){const Re=h.shift();if(!Re)break;const H=new Le(Re.join("="),`invoke-${K?"function":"module"}`,g,c);super.insertAt(H)}}}if(this.type==="template"){const N=fe(a).trim();if(!this.normalizeTitle(N,10,{halfParsed:!0,temporary:!0}).valid)throw c.pop(),new SyntaxError("Invalid template name");const F=new Le(a,"template-name",g,c,{});super.insertAt(F)}typeof p=="number"&&(c[p]=void 0);const C=this.isTemplate();let x=1;for(let N=0;N<h.length;N++){const F=h[N];C||this.name==="switch"&&N>0||this.name==="tag"&&N>1||(F[0]=F.join("="),F.length=1),F.length===1&&(F.unshift(x),x++),this.insertAt(new jo(...F,g,c))}this.seal("modifier")}get type(){return b(this,e)}get module(){}get function(){}setModifier(a){const{parserFunction:[,,h,g]}=this.getAttribute("config"),c=fe(a).trim();if(a&&!c.endsWith(":"))return!1;const p=c.slice(0,-1).toLowerCase(),f=h.includes(p),m=g.includes(p);return(b(this,s)?f:m||!a)||(be.running||this.length>1)&&(f||m||!a)?(this.setAttribute("modifier",a),E(this,s,f),!!a):!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"&&(E(this,r,P(this,n,an).call(this)),this.setAttribute("name",b(this,r).title))}toString(a){const{childNodes:h,length:g,firstChild:c,modifier:p,type:f}=this;return`{{${p}${f==="magic-word"?c.toString(a)+(g===1?"":b(this,t))+h.slice(1).map(m=>m.toString(a)).join("|"):super.toString(a,"|")}}}`}text(){const{childNodes:a,length:h,firstChild:g,modifier:c,type:p,name:f}=this;return p==="magic-word"&&f==="vardefine"?"":`{{${c}${p==="magic-word"?g.text()+(h===1?"":b(this,t))+it(a.slice(1),"|"):super.text("|")}}}`}getAttribute(a){switch(a){case"padding":return this.modifier.length+2;case"title":return b(this,r);case"colon":return b(this,t);case"invalid":default:return super.getAttribute(a)}}lint(a=this.getAbsoluteIndex(),h){{const g=super.lint(a,h);if(!this.isTemplate())return g;const{type:c,childNodes:p,length:f}=this,m=new re(this,a),{lintConfig:S}=I,{computeEditInfo:A}=S,w=c==="magic-word";let v="no-ignored",k=S.getSeverity(v,"fragment");if(w&&!P(this,n,an).call(this).valid)v="invalid-invoke",k=S.getSeverity(v,"name"),k&&g.push(M(p[1],m,v,"illegal-module",k));else if(k){const y=p[w?1:0],C=y.childNodes.findIndex(_=>_.type==="text"&&ws(_.data).includes("#")),x=y.childNodes[C];if(x){const _=M(y,m,v,"useless-fragment",k);A&&(_.suggestions=[D(_,y.getRelativeIndex(C)+x.data.indexOf("#"))]),g.push(_)}}if(v="invalid-invoke",k=S.getSeverity(v,"function"),k&&w&&f===2)return g.push(B(this,m,v,"missing-function",k)),g;if(v="no-duplicate",k=S.getSeverity(v,"parameter"),k){const y=this.getDuplicatedArgs().filter(([,x])=>!x[0].querySelector("ext")),C="duplicate-parameter";for(const[,x]of y)Array.prototype.push.apply(g,x.map(_=>{const T=M(_,m,v,C,k);return A&&(T.suggestions=[D(T,-1)]),T}))}return g}}insertAt(a,h=this.length){return super.insertAt(a,h),a.anon?P(this,n,Po).call(this,a):a.name&&this.getArgs(a.name,!1,!1).add(a),a}getAllArgs(){return this.childNodes.filter(Rs("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:a})=>a)}getArgs(a,h,g=!0){const c=String(a).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");let p;return b(this,i).has(c)?p=b(this,i).get(c):(p=new Set(this.getAllArgs().filter(({name:f})=>c===f)),b(this,i).set(c,p)),p}getDuplicatedArgs(){return[...b(this,i)].filter(([,{size:a}])=>a>1).map(([a,h])=>[a,[...h]])}getPossibleValues(){const{type:a,name:h,childNodes:g}=this;if(a==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let c,p;switch(h){case"if":case"ifexist":case"ifexpr":case"iferror":c=2;break;case"ifeq":c=3;break;case"switch":{const f=g.slice(2),m=f[f.length-1];p=[...f.filter(({anon:S})=>!S),...m!=null&&m.anon?[m]:[]].map(({lastChild:S})=>S);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}p!=null||(p=g.slice(c,c+2).map(({lastChild:f})=>f));for(let f=0;f<p.length;){const{length:m,0:S}=p[f].childNodes.filter(A=>A.text().trim());if(m===0)p.splice(f,1);else if(m>1||!S.is("magic-word"))f++;else try{const A=S.getPossibleValues();Array.prototype.splice.apply(p,[f,1,...A]),f+=A.length}catch(A){f++}}return p}print(){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakSet,an=function(){const a=this.type==="template";return this.normalizeTitle((a?"":"Module:")+fe(this.childNodes[a?0:1].text()),10,he({temporary:!0},!a&&{page:""}))},Po=function(a){const h=this.getAnonArgs(),g=typeof a!="number";for(let c=g?h.indexOf(a):a-1;c<h.length;c++){const p=h[c],{name:f}=p,m=String(c+1);(f!==m||p===a)&&(p.setAttribute("name",m),this.getArgs(m,!1,!1).add(p))}},u),di=X(qr),ct=V(di,0,"TranscludeToken",Wr,ct),G(di,1,ct)}}),Mr,hi,zr,Wt,Ru=$({"src/hidden.ts"(){"use strict";nt(),ye(),W(),Mr=[Ve(),me],Wt=class extends(zr=R){get type(){return"hidden"}getAttribute(e){return e==="invalid"||super.getAttribute(e)}},hi=X(zr),Wt=V(hi,0,"HiddenToken",Mr,Wt),G(hi,1,Wt)}}),Ur,ci,Dr,qt,Ou=$({"src/arg.ts"(){"use strict";var e,ju,s;de(),q(),ue(),We(),$s(),ye(),j(),W(),lt(),Ru(),Ur=[me,Fe("{{{"),Yt()],qt=(s=class extends(Dr=R){constructor(r,n,l=[]){super(void 0,n,l,{});L(this,e);for(let o=0;o<r.length;o++){const u=r[o];if(o===0){const d=new Le(u,"arg-name",n,l,{});super.insertAt(d)}else if(o>1){const d=new Wt(u,n,l);super.insertAt(d)}else{const d=new R(u,n,l);d.type="arg-default",d.setAttribute("stage",2),super.insertAt(d)}}}get type(){return"arg"}get default(){}toString(r){return`{{{${super.toString(r,"|")}}}}`}text(){return`{{{${it(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){super.afterBuild()}lint(r=this.getAbsoluteIndex(),n){{const{childNodes:[l,o,...u]}=this;l.setAttribute("aIndex",r+3);const d=l.lint(r+3,n);if(o){const m=r+4+l.toString().length;o.setAttribute("aIndex",m);const S=o.lint(m,n);S.length>0&&Array.prototype.push.apply(d,S)}const a=["no-ignored","no-arg"],{lintConfig:h}=I,{computeEditInfo:g}=h,c=new re(this,r),p=a.map(m=>h.getSeverity(m,"arg"));if(p[0]&&u.length>0&&Array.prototype.push.apply(d,u.map(m=>{const S=M(m,c,a[0],"invisible-triple-braces",p[0]);return S.startIndex--,S.startCol--,g&&(S.suggestions=[D(S),St(S.startIndex,"{{!}}")]),S})),p[1]&&!this.getAttribute("include")){const m=B(this,c,a[1],"unexpected-argument",p[1]);g&&o&&(m.suggestions=[$e(m,"expand",o.text())]),d.push(m)}const f=this.closest("ext");if(f){const m="arg-in-ext",S=h.getSeverity(m,f.name);S&&d.push(B(this,c,m,"argument-in-ext",S))}return d}}print(){}json(r,n=this.getAbsoluteIndex()){}},e=new WeakSet,ju=function(){},s),ci=X(Dr),qt=V(ci,0,"ArgToken",Ur,qt),G(ci,1,qt)}}),Bo={};Z(Bo,{parseBraces:()=>Es});var Hr,gi,as,pi,fi,mi,Gr,xi,Es,Ln=$({"parser/braces.ts"(){"use strict";Ge(),de(),Oo(),Fu(),Ou(),Hr={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},gi=String.raw`\[(?!\[)`,as=String.raw`\n(?![=\0])`,pi=String.raw`|\{{2,}`,fi=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),mi=vt(e=>new RegExp(e,"gmu")),Gr=new RegExp(String.raw`\{\{((?:[^\n{}[]|${gi}|${as})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${as})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${gi}|${as})*\}-`,"gu"),xi=e=>{const t=wt(fe(e));return fi.has(t)?fi.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},Es=(e,t,s)=>{var p,f,m,S,A;const i=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,r]}=t,n=[],l=[],o=(w,v,k,y)=>{v[v.length-1].push(Ae(w.slice(k,y),l))};let u;do u!==void 0&&(e=u),u=e.replace(Gr,(w,v,k)=>{if(v!==void 0||typeof k=="string")try{const{length:y}=s,C=(v!=null?v:k).split("|");return new ct(Ae(C[0],l),C.slice(1).map(x=>{const _=x.indexOf("=");return(_===-1?[x]:[x.slice(0,_),x.slice(_+1)]).map(T=>Ae(T,l))}),t,s),`\0${y}${xi(C[0])}`}catch(y){if(!(y instanceof SyntaxError)||y.message!=="Invalid template name")throw y}return l.push(Ae(w,l)),`\0${l.length-1}`});while(u!==e);e=u;const d=e.lastIndexOf("}}")-e.length;let a=d+e.length!==-1,h=mi(i+(a?pi:"")),g=h.exec(e),c;for(;g||c!==void 0&&c<=e.length&&((f=(p=n[n.length-1])==null?void 0:p[0])!=null&&f.startsWith("="));){if(g!=null&&g[1]){const[,{length:Q}]=g;g[0]=g[0].slice(Q),g.index+=Q}const{0:w,index:v}=g!=null?g:{0:`
10
- `,index:e.length},k=(m=n.pop())!=null?m:{},{0:y,index:C,parts:x,findEqual:_,pos:T}=k,N=w==="="&&_;if(w==="]]"||w==="}-")c=v+2;else if(w===`
11
- `){c=v+1;const{pos:Q,findEqual:z}=(S=n[n.length-1])!=null?S:{};if(Q===void 0||z||fe(e.slice(Q,C))!==""){const U=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(e.slice(C,v));U&&(U[2]=Ae(U[2],l),U[2].includes(`
12
- `)||(e=`${e.slice(0,C)}\0${s.length}h${e.slice(v)}`,c=C+4+String(s.length).length,new ht(U[1].length,U.slice(2),t,s)))}}else if(w==="|"||N)c=v+1,o(e,x,T,v),w==="|"&&x.push([]),k.pos=c,k.findEqual=w==="|",n.push(k);else if(w.startsWith("}}")){const Q=w.slice(0,Math.min(y.length,3)),z=y.length-Q.length,{length:U}=s;c=v+Q.length,o(e,x,T,v);let O=!1,pe="t";if(Q.length===3){const ge=x.map(K=>K.join("=")),we=ge.length>1&&fe(ge[1]).trim();new qt(ge,t,s),we&&we.endsWith(":")&&r.includes(we.slice(0,-1).toLowerCase())&&(pe="s")}else try{new ct(x[0][0],x.slice(1),t,s),pe=xi(x[0][0])}catch(ge){if(ge instanceof SyntaxError&&ge.message==="Invalid template name")O=!0;else throw ge}O||(e=`${e.slice(0,C+z)}\0${U}${pe}${e.slice(c)}`,c=C+z+3+String(U).length,z>1?n.push({0:y.slice(0,z),index:C,pos:C+z,parts:[[]]}):z===1&&e[C-1]==="-"&&n.push({0:"-{",index:C-1,pos:C+1,parts:[[]]}))}else c=v+w.length,w.startsWith("{")&&(g.pos=c,g.parts=[[]]),n.push(..."0"in k?[k]:[],g);let F=n[n.length-1];if(a&&d+e.length<c)for(a=!1;(A=F==null?void 0:F[0])!=null&&A.startsWith("{");)n.pop(),F=n[n.length-1];h=mi(i+(a?pi:"")+(F?`|${Hr[F[0][0]]}${F.findEqual?"|=":""}`:"")),h.lastIndex=c,g=h.exec(e)}return Ae(e,l)}}}),Wo={};Z(Wo,{InputboxToken:()=>qo});var qo,Pu=$({"src/multiLine/inputbox.ts"(){"use strict";Fs(),Ln(),Ro(),qo=class extends Nn{constructor(e,t,s,i,r=[]){const n=Symbol("InputboxToken"),l=i.excludes.includes("heading")?i:je(he({},i),{excludes:[...i.excludes,"heading"]}),{length:o}=r;r.push(n),s&&(s=Zt(s,l,r,t)),s&&(s=Es(s,l,r)),r.splice(o,1),super(e,t,s,l,r,{})}}}}),vs={};Z(vs,{NestedToken:()=>Mo});var Vr,Qr,Mo,vi=$({"src/nested.ts"(){"use strict";var e,t,s;q(),ue(),Fs(),Ln(),j(),W(),oa(),At(),Vr=new Set(["comment","include","arg","template","magic-word"]),Qr=[!1,!0].map(i=>{const r=i?"includeonly":"noinclude";return new RegExp(String.raw`^(?:<${r}(?:\s[^>]*)?/?>|</${r}\s*>)$`,"iu")}),Mo=(s=class extends R{constructor(r,n,l,o,u=[]){if(typeof n=="boolean"){const d=Symbol("NestedToken"),{length:a}=u;u.push(d),r&&(r=Zt(r,o,u,n)),r&&(r=Es(r,o,u)),u.splice(a,1)}else r&&(r=r.replace(n,(d,a,h,g,c)=>{const p=`\0${u.length+1}e`;return new mt(a,h,g,c,o,!1,u),p}));r&&(r=r.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(d,a,h)=>(new _e(h,o,u),`${a}\0${u.length}n`)));super(r,o,u);L(this,e);L(this,t);E(this,e,[...l]),E(this,t,n)}get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex(),n){{const l=super.lint(r,n),o="no-ignored",{lintConfig:u}=I,d=u.getSeverity(o,this.name);if(!d)return l;const a=new re(this,r),h=typeof b(this,t)=="boolean"?Qr[b(this,t)?1:0]:/^<!--[\s\S]*-->$/u;return[...l,...this.childNodes.filter(g=>{const{type:c,name:p}=g;if(c==="ext")return!b(this,e).includes(p);if(Vr.has(c))return!1;const f=g.toString().trim();return f&&!h.test(f)}).map(g=>{const c=M(g,a,o,I.msg("invalid-content",this.name),d);return u.computeEditInfo&&(c.suggestions=[D(c),wn(c,g.toString())]),c})]}}},e=new WeakMap,t=new WeakMap,s)}});function Jr(e,t,s,i,r){t=fe(t).trim();let n=t.replace(e==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(e){case"width":return!n&&!!t||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(n);case"link":{const l=i==="gallery-image";if(n){if(zo(s.protocol).test(n))return Uo(s.protocol).test(n)?t:l;n.startsWith("[[")&&n.endsWith("]]")&&(n=n.slice(2,-2))}else return t;const o=I.normalizeTitle(n,0,!1,s,{halfParsed:r,decode:!0,selfLink:!0,page:""});return o.valid?o:l}case"lang":return(i==="svg"||i==="svgz")&&!/[^a-z\d-]/u.test(n);case"alt":case"class":case"manualthumb":return!0;case"page":return(i==="djvu"||i==="djv"||i==="pdf")&&Number(n)>0;default:return!!n&&!isNaN(n)}}var zo,Uo,Xr,Kr,Yr,bi,Zr,Mt,Bu=$({"src/imageParameter.ts"(){"use strict";var e,t,Do,r;Ge(),de(),q(),Ee(),Te(),ye(),j(),W(),zo=vt(n=>new RegExp(String.raw`^(?:${n}|//|\0\d+m\x7F)`,"iu")),Uo=vt(n=>new RegExp(String.raw`^(?:(?:${n}|//)${bt}|\0\d+m\x7F)${yt}$`,"iu")),Xr=vt(n=>new RegExp(String.raw`^(\s*(?!\s))${n.replace("$1","(.*)")}${n.endsWith("$1")?`(?=$|
13
- )`:""}(\s*)$`,"u")),Kr=n=>{if(n)n.startsWith("//")&&(n=`https:${n}`);else return n;return new URL(n).href},Yr=[me],Mt=(r=class extends(Zr=R){constructor(l,o,u,d,a){var n=(...i)=>(super(...i),L(this,t),L(this,e,""),this);let h;const g=Object.entries(d.img).map(([p,f])=>[p,f,Xr(p)]),c=g.find(([,p,f])=>(h=f.exec(l),h&&(h.length!==4||Jr(p,h[2],d,p==="link"?u:o,!0)!==!1)));if(c&&h){h.length===3?(n(void 0,d,a),E(this,e,l)):(n(h[2],d,a,{}),E(this,e,h[1]+c[0]+h[3])),this.setAttribute("name",c[1]),c[1]==="alt"&&this.setAttribute("stage",ve-1);return}n(l,d.excludes.includes("list")?d:je(he({},d),{excludes:[...d.excludes,"list"]}),a),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get type(){return"image-parameter"}get thumb(){return this.name==="manualthumb"?this.normalizeTitle(`File:${super.text().trim()}`,6,{page:""}):void 0}get link(){{if(this.name!=="link")return;const l=super.text().trim();return be.run(()=>{var d;const o=new R(l,this.getAttribute("config"));if(o.parseOnce(0,this.getAttribute("include")).parseOnce(),/^\0\d+m\x7F/u.test(o.firstChild.toString()))return l;const u=Jr("link",l,this.getAttribute("config"),(d=this.parentNode)==null?void 0:d.type);return u===!0?void 0:u},I)}}afterBuild(){var l;(l=this.parentNode)!=null&&l.is("gallery-image")&&!ao.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(l){return b(this,e)?b(this,e).replace("$1",super.toString(l)):super.toString(l)}text(){return b(this,e)?b(this,e).replace("$1",super.text()).trim():super.text().trim()}isPlain(){return this.name==="caption"||this.name==="alt"}getAttribute(l){return l==="invalid"?this.name==="invalid":l==="padding"?Math.max(0,b(this,e).indexOf("$1")):super.getAttribute(l)}lint(l=this.getAbsoluteIndex(),o){{const u=super.lint(l,o),{lintConfig:d}=I,{computeEditInfo:a,fix:h}=d,{link:g,name:c}=this,p=c==="width"&&this.getValue();if(c==="invalid"||p&&p.endsWith("px")){const f="invalid-gallery",m=d.getSeverity(f,"parameter");if(m){const S=B(this,{start:l},f,"invalid-image-parameter",m);(a||h)&&(S.fix=p?D(S,0,p):D(S,-1)),u.push(S)}}else if(c==="link"){if(g===void 0){const f="invalid-gallery",m=d.getSeverity(f,"link");m&&u.push(B(this,{start:l},f,"invalid-gallery-link",m))}else if(typeof g=="string"){const f="invalid-url",m=d.getSeverity(f);if(m&&!this.querySelector("magic-word"))try{Kr(g)}catch(S){u.push(B(this,{start:l},f,"invalid-url",m))}}else if(g.encoded){const f="url-encoding",m=d.getSeverity(f,"file");if(m){const S=B(this,{start:l},f,"unnecessary-encoding",m);(a||h)&&(S.fix=bn(S,this)),u.push(S)}}}else if(c==="manualthumb"){const f="invalid-gallery",m=d.getSeverity(f,"thumb");if(m&&!this.querySelector("arg,magic-word,template")){const{valid:S,ns:A,extension:w}=this.thumb;(!S||A!==6||!Ss.has(w))&&u.push(B(this,{start:l},f,"invalid-thumb",m))}}return u}}getValue(){return this.name==="invalid"?this.text():P(this,t,Do).call(this)||super.text()}print(){}},e=new WeakMap,t=new WeakSet,Do=function(){return b(this,e)&&!b(this,e).includes("$1")},r),bi=X(Zr),Mt=V(bi,0,"ImageParameterToken",Yr,Mt),G(bi,1,Mt)}}),yi,el,tl,wi,Si,sl,ki,En,Ho=$({"src/link/file.ts"(){"use strict";q(),Ee(),ue(),j(),Kt(),Bu(),yi=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),el=new Set(["arg"]),tl=new Set(["template","magic-word"]),wi=new Set(["left","right","center","none"]),Si=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),sl=e=>{if(e===void 0)return[];const t=/-\{|\}-|\|/gu,s=[];let i=t.exec(e),r=0,n=0;for(;i;){const{0:l,index:o}=i;l!=="|"?r+=l==="-{"?1:-1:r===0&&(s.push(e.slice(n,o)),{lastIndex:n}=t),i=t.exec(e)}return s.push(e.slice(n)),s},ki=(e,t)=>e.filter(({childNodes:s})=>!s.some(i=>i.text().trim()&&t.has(i.type))),En=class extends Be{get type(){return"file"}get extension(){}constructor(e,t,s,i=[],r="|",n){super(e,void 0,s,i,r);const{extension:l}=this.getTitle(!0,!0);this.safeAppend(sl(t).map(o=>new Mt(o,l,n,s,i)))}lint(e=this.getAbsoluteIndex(),t){var s;{const i=super.lint(e,t),r=ki(this.getAllArgs(),el),n=[...new Set(r.map(({name:y})=>y))],l=n.filter(y=>yi.has(y)),o=n.filter(y=>wi.has(y)),u=n.filter(y=>Si.has(y)),[d]=l,a=d==="framed"||d==="manualthumb",h=new re(this,e),{lintConfig:g}=I,{computeEditInfo:c,fix:p}=g,{ns:f,extension:m}=this.getAttribute("title"),{firstChild:S}=this;let A="nested-link",w=g.getSeverity(A,"file");if(w&&Ss.has(m)&&this.isInside("ext-link-text")&&((s=this.getValue("link"))==null?void 0:s.trim())!==""){const y=B(this,h,A,"link-in-extlink",w);if(c||p){const C=this.getArg("link");if(C){const x=e+C.getRelativeIndex();y.fix={desc:I.msg("delink"),range:[x,x+C.toString().length],text:"link="}}else y.fix=Ts(y.endIndex-2,"delink","|link=")}i.push(y)}if(A="invalid-gallery",w=g.getSeverity(A,"extension"),w&&f===6&&!m&&!S.querySelector("arg,magic-word,template")&&i.push(B(this,h,A,"missing-extension",w)),w=g.getSeverity(A,"parameter"),w&&a)for(const y of r.filter(({name:C})=>C==="width")){const C=M(y,h,A,"invalid-image-parameter",w);(c||p)&&(C.fix=D(C,-1)),i.push(C)}if(r.length===n.length&&l.length<2&&o.length<2&&u.length<2)return i;A="no-duplicate";const v=["unknownImageParameter","imageParameter"].map(y=>g.getSeverity(A,y)),k=(y,C,x,_=!0)=>y.map(T=>{if(w=v[Number(typeof _=="function"?_(T):_)],!w)return!1;const N=M(T,h,A,I.msg(`${C}-image-parameter`,x),w);return c&&(N.suggestions=[D(N,-1)]),N}).filter(T=>T!==!1);for(const y of n){if(y==="invalid"||y==="width"&&a)continue;const C=y==="caption";let x=r.filter(({name:_})=>_===y);if(C&&(x=[...x.slice(0,-1).filter(_=>_.text()),...x.slice(-1)]),x.length>1){let _=!C||!m||Ss.has(m);if(C&&_){const T=ki(x,tl);_=T.length>1&&(N=>T.includes(N))}Array.prototype.push.apply(i,k(x,"duplicate",y,_))}}return l.length>1&&Array.prototype.push.apply(i,k(r.filter(({name:y})=>yi.has(y)),"conflicting","frame")),o.length>1&&Array.prototype.push.apply(i,k(r.filter(({name:y})=>wi.has(y)),"conflicting","horizontal-alignment")),u.length>1&&Array.prototype.push.apply(i,k(r.filter(({name:y})=>Si.has(y)),"conflicting","vertical-alignment")),i}}getAllArgs(){return this.childNodes.slice(1)}getArgs(e){return this.getAllArgs().filter(({name:t})=>e===t)}getArg(e){{const t=this.getArgs(e);return t[e==="manualthumb"?0:t.length-1]}}getValue(e){var t;return(t=this.getArg(e))==null?void 0:t.getValue()}json(e,t=this.getAbsoluteIndex()){}}}}),il,Ai,nl,gt,Go=$({"src/link/galleryImage.ts"(){"use strict";var e,un,s;q(),Ee(),We(),j(),W(),Ho(),il=[Fe("")],gt=(s=class extends(nl=En){constructor(r,n,l,o,u=[]){let d;if(l!==void 0){const{length:h}=u;d=new R(l,o,u);for(let g=0;g<ve-1;g++)d.parseOnce();u.splice(h,1)}const a=`${r}-image`;super(n,d==null?void 0:d.firstChild.toString(),o,u,void 0,a);L(this,e);Pe(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=a,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(r){const n=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),n?0:6,{halfParsed:!0,temporary:r,decode:!n,page:""})}lint(r=this.getAbsoluteIndex(),n){{const l=super.lint(r,n),o="invalid-gallery",{lintConfig:u}=I,d=u.getSeverity(o,"image");if(d&&P(this,e,un).call(this)){const a=B(this,{start:r},o,"invalid-gallery",d);u.computeEditInfo&&(a.suggestions=[Ts(r,"prefix","File:")]),l.push(a)}return l}}getAttribute(r){return r==="invalid"?P(this,e,un).call(this):super.getAttribute(r)}},e=new WeakSet,un=function(){return this.getAttribute("title").ns!==6},s),Ai=X(nl),gt=V(Ai,0,"GalleryImageToken",il,gt),G(Ai,1,gt)}}),ks,Vo=$({"src/nowiki/commentLine.ts"(){"use strict";At(),ks=class extends _e{}}}),Qo={};Z(Qo,{GalleryToken:()=>Jo});var Jo,Wu=$({"src/multiLine/gallery.ts"(){"use strict";var e,Xo,qu,i;q(),j(),In(),Go(),Vo(),Jo=(i=class extends Ls{constructor(n,l,o=[]){var u;super(void 0,l,o,{});L(this,e);for(const d of(u=n==null?void 0:n.split(`
14
- `))!=null?u:[]){const a=/^([^|]+)(?:\|(.*))?/u.exec(d);if(!a){super.insertAt(d.trim()?new ks(d,l,o):d);continue}const[,h,g]=a;P(this,e,Xo).call(this,h)?super.insertAt(new gt("gallery",h,g,l,o)):super.insertAt(new ks(d,l,o))}}get widths(){}get heights(){}lint(n=this.getAbsoluteIndex(),l){{const{top:o,left:u}=this.getRootNode().posFromIndex(n),d=[],a="no-ignored",{lintConfig:h}=I,g=["Image","NoImage","Comment"].map(c=>h.getSeverity(a,`gallery${c}`));for(let c=0;c<this.length;c++){const p=this.childNodes[c],f=p.toString(),{length:m}=f,S=f.trim(),{type:A}=p,w=o+c,v=c?0:u;if(p.setAttribute("aIndex",n),A==="noinclude"&&S&&!/^<!--.*-->$/u.test(S)){let[k]=g;if(S.startsWith("|")?[,k]=g:(S.startsWith("<!--")||S.endsWith("-->"))&&([,,k]=g),k){const y=n+m,C={rule:a,message:I.msg("invalid-content","gallery"),severity:k,startIndex:n,endIndex:y,startLine:w,endLine:w,startCol:v,endCol:v+m};h.computeEditInfo&&(C.suggestions=[D(C),wn(C,f)]),d.push(C)}}else if(A!=="noinclude"&&A!=="text"){const k=p.lint(n,l);k.length>0&&Array.prototype.push.apply(d,k)}n+=m+1}return d}}json(n,l=this.getAbsoluteIndex()){}},e=new WeakSet,Xo=function(n){return this.normalizeTitle(n,6,{halfParsed:!0,temporary:!0,decode:!0,page:""}).valid},qu=function(n){},i)}}),Fn,Ko=$({"src/link/index.ts"(){"use strict";Ge(),q(),j(),Kt(),Fn=class extends Be{get type(){return"link"}get innerText(){return this.length>1?this.lastChild.text():Qt(this.firstChild.text().replace(/^\s*:?/u,""))}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i="nested-link",{lintConfig:r}=I,n=r.getSeverity(i);if(n&&this.isInside("ext-link-text")){const l=B(this,{start:e},i,"link-in-extlink",n);(r.computeEditInfo||r.fix)&&(l.fix=$e(l,"delink",this.innerText)),s.push(l)}return s}}}}}),rl,ll,Xt,Rn=$({"src/magicLink.ts"(){"use strict";var e,t,dn,i;q(),de(),ue(),j(),W(),rl=String.raw`(?:[${De}\t]|&nbsp;|&#0*160;|&#[xX]0*[aA]0;)`,ll=new RegExp(`${rl}+`,"gu"),Xt=(i=class extends R{constructor(n,l="free-ext-link",o=I.getConfig(),u){super(n,o,u,{});L(this,t);L(this,e);E(this,e,l)}get type(){return b(this,e)}get innerText(){const n=new Map([["!","|"],["=","="]]);let l=it(this.childNodes.map(o=>{const{type:u}=o,d=String(o.name);return u==="magic-word"&&n.has(d)?n.get(d):o}));return this.type==="magic-link"&&(l=l.replace(ll," ")),l}get link(){const{innerText:n}=this;return this.type==="magic-link"?n.startsWith("ISBN")?`ISBN ${n.slice(5).replace(/[- ]/gu,"").replace(/x$/u,"X")}`:n:lo(n).replace(/\n/gu,"%0A")}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),u=new re(this,n),{lintConfig:d}=I,{type:a,childNodes:h}=this;if(a==="magic-link"){const f="invalid-isbn",m=d.getSeverity(f);return m&&P(this,t,dn).call(this)&&o.push(B(this,u,f,"invalid-isbn",m)),o}let g="invalid-url",c=d.getSeverity(g);if(c&&!this.querySelector("magic-word"))try{this.getUrl()}catch(f){o.push(B(this,u,g,"invalid-url",c))}const p=a==="ext-link-url";if(g="unterminated-url",c=d.getSeverity(g,p?"pipe":"punctuation"),c){const f=p?/\|/u:/[,;。:!?()]+/u,m=h.find(S=>S.type==="text"&&f.test(S.data));if(m){const{data:S}=m,A=M(m,u,g,I.msg("in-url",p?'"|"':"full-width-punctuation"),c);if(d.computeEditInfo){const{index:w,0:v}=f.exec(S),k=A.startIndex+w;A.suggestions=p?[Jt(k,1)]:[Jt(k),{desc:I.msg("encode"),range:[k,k+v.length],text:encodeURI(v)}]}o.push(A)}}return o}}getUrl(n){this.lspError("MagicLinkToken.getUrl")}getAttribute(n){return n==="invalid"?P(this,t,dn).call(this):super.getAttribute(n)}},e=new WeakMap,t=new WeakSet,dn=function(){if(this.type==="magic-link"){const{link:n}=this;if(n.startsWith("ISBN")){const l=[...n.slice(5)].map(o=>o==="X"?10:Number(o));return l.length===10?l.reduce((o,u,d)=>o+u*(10-d),0)%11!==0:l.length===13&&(l[12]===10||l.reduce((o,u,d)=>o+u*(d%2?3:1),0)%10!==0)}}return!1},i)}}),ol,_i,al,pt,Yo=$({"src/extLink.ts"(){"use strict";var e,t;Ee(),q(),We(),j(),W(),Rn(),ol=[Fe("[")],pt=(t=class extends(al=R){constructor(i,r="",n="",l,o=[]){super(void 0,l,o,{});L(this,e);const u=i&&/^\0\d+f\x7F$/u.test(i)?o[Number(i.slice(1,-2))]:new Xt(i,"ext-link-url",l,o);if(this.insertAt(u),E(this,e,r),n){const d=new R(n,l,o,{});d.type="ext-link-text",d.setAttribute("stage",ve-1),this.insertAt(d)}}get type(){return"ext-link"}toString(i){return this.length===1?`[${super.toString(i)}${b(this,e)}]`:`[${super.toString(i,b(this,e))}]`}text(){return`[${super.text(" ")}]`}getGaps(){return b(this,e).length}lint(i=this.getAbsoluteIndex(),r){{const n=super.lint(i,r),l="var-anchor",o=I.lintConfig.getSeverity(l,"extLink");return o&&this.length===1&&this.isInside("heading-title")&&n.push(B(this,{start:i},l,"variable-anchor",o)),n}}print(){}},e=new WeakMap,t),_i=X(al),pt=V(_i,0,"ExtLinkToken",ol,pt),G(_i,1,pt)}}),hn,Mu=$({"src/imagemapLink.ts"(){"use strict";W(),At(),Ko(),Yo(),hn=class extends R{get type(){return"imagemap-link"}constructor(e,t,s,i,r=[]){super(void 0,i,r),this.append(e,t.length===2?new Fn(...t,i,r):new pt(...t,i,r),new _e(s,i,r))}}}}),Zo={};Z(Zo,{ImagemapToken:()=>ea});var ea,zu=$({"src/multiLine/imagemap.ts"(){"use strict";q(),Te(),ue(),j(),In(),Vo(),Go(),Mu(),ea=class extends Ls{get image(){return this.childNodes.find(Rs("imagemap-image"))}constructor(e,t=I.getConfig(),s=[]){if(super(void 0,t,s,{}),!e)return;const i=e.split(`
15
- `),r=new Set(t.protocol.split("|"));let n=!0,l=!1;for(const o of i){const u=o.trim();if(!(l||!u||u.startsWith("#"))){if(n){const d=o.indexOf("|"),a=d===-1?o:o.slice(0,d),h=this.normalizeTitle(a,0,{halfParsed:!0,temporary:!0,page:""});if(h.valid&&h.ns===6){const g=new gt("imagemap",a,d===-1?void 0:o.slice(d+1),t,s);super.insertAt(g),n=!1;continue}else l=!0}else if(o.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(o);continue}else if(o.includes("[")){const d=o.indexOf("["),a=o.slice(d),h=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(a);if(h){if(this.normalizeTitle(h[1],0,{halfParsed:!0,temporary:!0,selfLink:!0,page:""}).valid){super.insertAt(new hn(o.slice(0,d),h.slice(1),a.slice(a.indexOf("]]")+2),t,s));continue}}else if(a.startsWith("[//")||r.has(a.slice(1,a.indexOf(":")+1))||r.has(a.slice(1,a.indexOf("//")+2))){const g=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(a);if(g){super.insertAt(new hn(o.slice(0,d),g.slice(1),a.slice(a.indexOf("]")+1),t,s));continue}}}}super.insertAt(new ks(o,t,s))}}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new re(this,e),{childNodes:r,image:n}=this,l="invalid-imagemap",{lintConfig:o}=I,u=o.getSeverity(l,n?"link":"image");return u&&(n?Array.prototype.push.apply(s,r.filter(d=>{const a=d.toString().trim();return d.is("noinclude")&&a&&!a.startsWith("#")}).map(d=>{const a=M(d,i,l,"invalid-imagemap-link",u);return o.computeEditInfo&&(a.suggestions=[D(a,-1),$e(a,"comment","# ")]),a})):s.push(B(this,i,l,"imagemap-without-image",u))),s}}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}}}}),ul,Ti,dl,ft,ta=$({"src/nowiki/comment.ts"(){"use strict";q(),nt(),We(),j(),ot(),ul=[Ve(!1),Fe("<!--")],ft=class extends(dl=Ie){constructor(t,s,i,r){super(t,i,r);Pe(this,"closed");this.closed=s}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){{if(this.closed)return[];const s="unclosed-comment",{lintConfig:i}=I,r=i.getSeverity(s);if(!r)return[];const n=B(this,{start:t},s,"unclosed-comment",r);return i.computeEditInfo&&(n.suggestions=[He(n.endIndex,"-->")]),[n]}}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){}},Ti=X(dl),ft=V(Ti,0,"CommentToken",ul,ft),G(Ti,1,ft)}}),sa={};Z(sa,{CommentedToken:()=>ia});var ia,Uu=$({"src/commented.ts"(){"use strict";W(),ta(),ia=class extends R{get type(){return"ext-inner"}constructor(e,t,s=[]){if(super(void 0,t,s,{AstText:":",CommentToken:":"}),e){let i=e.indexOf("<!--"),r=i!==-1&&e.indexOf("-->",i+4),n=0;for(;r!==!1&&r!==-1;)i>n&&this.insertAt(e.slice(n,i)),this.insertAt(new ft(e.slice(i+4,r),!0,t,s)),n=r+3,i=e.indexOf("<!--",n),r=i!==-1&&e.indexOf("-->",i+4);n<e.length&&this.insertAt(e.slice(n))}}lint(e=this.getAbsoluteIndex()){return super.lint(e,new RegExp(String.raw`<\s*(?:\/\s*)?(${this.name})\b`,"giu"))}}}}),na={};Z(na,{CategorytreeToken:()=>zt});var hl,Ci,cl,zt,Du=$({"src/link/categorytree.ts"(){"use strict";q(),We(),j(),Kt(),hl=[Fe("")],zt=class extends(cl=Be){get type(){return"ext-inner"}constructor(e,t,s,i=[]){super(e,t,s,i),this.setAttribute("bracket",!1)}getTitle(){const e=this.firstChild.toString().trim(),t={halfParsed:!0},s=this.normalizeTitle(e,14,t);return s.valid&&s.ns===14?s:this.normalizeTitle(`Category:${e}`,0,t)}lint(e=this.getAbsoluteIndex()){{const t="no-ignored",s=I.lintConfig.getSeverity(t,"categorytree");if(s){const{link:i}=this;if(!i.valid||i.ns!==14)return[B(this,{start:e},t,"invalid-category",s)]}return super.lint(e,!1)}}},Ci=X(cl),zt=V(Ci,0,"CategorytreeToken",hl,zt),G(Ci,1,zt)}}),ra={};Z(ra,{NowikiToken:()=>la});var gl,pl,la,Hu=$({"src/nowiki/index.ts"(){"use strict";var e,cn,s;Ge(),q(),ue(),j(),ot(),gl=vt(i=>new RegExp(String.raw`<\s*(?:/\s*)${i==="nowiki"?"":"?"}(${i})\b`,"giu")),pl=new Set(["languages","section","templatestyles"]),la=(s=class extends Ie{constructor(){super(...arguments);L(this,e)}get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex()){{const{name:n,innerText:l}=this,{lintConfig:o}=I;let u="void-ext",d=o.getSeverity(u,n);if(d&&P(this,e,cn).call(this)){const a=B(this,{start:r},u,I.msg("nothing-in",n),d);return o.computeEditInfo&&(a.suggestions=[D(a)]),[a]}{u="invalid-json";const a=o.getSeverity(u);if(n==="templatedata"&&a)return uo(l).map(({message:h,position:g,line:c,column:p})=>{d=a;const f=new re(this,r),m=r+g,S=f.top+c-1,A=(c>1?0:f.left)+p-1;return{rule:u,message:h,severity:d,startIndex:m,endIndex:m,startLine:S,endLine:S,startCol:A,endCol:A}}).filter(h=>h!==!1)}return super.lint(r,gl(n))}}getAttribute(r){return r==="invalid"?P(this,e,cn).call(this):super.getAttribute(r)}},e=new WeakSet,cn=function(){const{name:r,firstChild:{data:n}}=this;return pl.has(r)&&!!n},s)}}),fl,$i,ml,mt,oa=$({"src/tagPair/ext.ts"(){"use strict";q(),ue(),j(),Cn(),W(),Tn(),$n(),fl=[Is()],mt=class extends(ml=Ze){get type(){return"ext"}constructor(e,t,s,i,r=I.getConfig(),n=!1,l=[]){const o=e.toLowerCase(),u=new Ns(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",o,r,l),d=je(he({},r),{ext:r.ext.filter(h=>h!==o),excludes:[...r.excludes],inExt:!0});let a;switch(o){case"pre":if(u.getAttr("format")!=="wikitext"){const{PreToken:h}=(Nu(),J(No));a=new h(s,d,l);break}case"indicator":case"poem":case"ref":case"option":case"combooption":case"tab":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":o==="poem"?d.excludes.push("heading"):o==="tab"&&(d.ext=d.ext.filter(h=>h!=="tabs")),a=new R(s,d,l);break;case"dynamicpagelist":{const{ParamTagToken:h}=(Ro(),J(Fo));a=new h(o,n,s,d,l);break}case"inputbox":{const{InputboxToken:h}=(Pu(),J(Wo));a=new h(o,n,s,d,l);break}case"references":{const{NestedToken:h}=(vi(),J(vs));d.excludes.push("heading"),a=new h(s,n,["ref"],d,l);break}case"choose":{const{NestedToken:h}=(vi(),J(vs));a=new h(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],d,l);break}case"combobox":{const{NestedToken:h}=(vi(),J(vs));a=new h(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],d,l);break}case"gallery":{const{GalleryToken:h}=(Wu(),J(Qo));a=new h(s,d,l);break}case"imagemap":{const{ImagemapToken:h}=(zu(),J(Zo));a=new h(s,d,l);break}case"hiero":{const{CommentedToken:h}=(Uu(),J(sa));a=new h(s,d,l);break}case"categorytree":{const{CategorytreeToken:h}=(Du(),J(na));a=new h(s,void 0,d,l);break}default:{const{NowikiToken:h}=(Hu(),J(ra));a=new h(s,d,l)}}a.setAttribute("name",o),a.type==="plain"&&(a.type="ext-inner"),super(e,u,a,i,r,l),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),{lintConfig:i}=I,r=new re(this,e);if(this.name!=="nowiki"){const n=this.inHtmlAttrs(),l="parsing-order",o=n&&i.getSeverity(l,n===2?"ext":"templateInTable");o&&s.push(B(this,r,l,"ext-in-html",o))}if(this.name==="ref"){let n="var-anchor",l=i.getSeverity(n,"ref");l&&this.closest("heading-title")&&s.push(B(this,r,n,"variable-anchor",l)),n="nested-link",l=i.getSeverity(n,"ref"),l&&this.closest("link-text,ext-link-text")&&s.push(B(this,r,n,"ref-in-link",l))}return s}}},$i=X(ml),mt=V($i,0,"ExtToken",fl,mt),G($i,1,mt)}}),On,aa=$({"src/tag/index.ts"(){"use strict";var e,t,s,i;q(),Te(),W(),j(),On=(i=class extends R{constructor(n,l,o,u,d){super(void 0,u,d);L(this,e);L(this,t);L(this,s);this.insertAt(l),E(this,e,o),E(this,t,n)}get closing(){return b(this,e)}toString(n){return`<${b(this,e)?"/":""}${b(this,t)}${super.toString(n)}${this.selfClosing?"/":""}>`}text(n=""){const{closing:l}=this;return`<${l&&!n?"/":""}${b(this,t)}${l?"":super.text()}${n}>`}getAttribute(n){return n==="padding"?b(this,t).length+(b(this,e)?2:1):super.getAttribute(n)}findMatchingTag(){return tt(b(this,s),()=>{const{type:n,name:l,parentNode:o,closing:u,selfClosing:d}=this;let a=!1,h=!1;if(n==="html"){const{html:[,S,A]}=this.getAttribute("config");a=A.includes(l),h=S.includes(l)}if(a||h&&d)return this;if(!o)return;const{childNodes:g}=o,c=g.indexOf(this),p=u?g.slice(0,c).reverse():g.slice(c+1),f=[this],{rev:m}=be;for(const S of p)if(!(!S.is(n)||n==="html"&&(S.name!==l||h&&S.selfClosing)))if(b(S,e)===u){if(n==="tvar")return;f.push(S)}else{const A=f.pop();if(A===this)return S;I.viewOnly&&(E(A,s,[m,S]),E(S,s,[m,A]))}if(I.viewOnly)for(const S of f)E(S,s,[m,void 0])},n=>{E(this,s,n),n[1]&&n[1]!==this&&E(n[1],s,[be.rev,this])})}print(){}json(n,l=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i)}}),xl,Ii,vl,Ue,Gu=$({"src/tag/tvar.ts"(){"use strict";nt(),ye(),aa(),rt(),xl=[Ve(),me],Ue=class extends(vl=On){get type(){return"tvar"}constructor(e,t,s,i,r){const n=new Qe(t,"tvar-name",i,r);super(e,n,s,i,r)}},Ii=X(vl),Ue=V(Ii,0,"TvarToken",xl,Ue),G(Ii,1,Ue)}}),ua={};Z(ua,{TranslateToken:()=>da});var da,Vu=$({"src/tagPair/translate.ts"(){"use strict";var e,Qu,s;W(),Tn(),rt(),Gu(),da=(s=class extends Ze{constructor(r,n,l,o=[]){const u=new Qe(r,"translate-attr",l,o);n=n==null?void 0:n.replace(/<tvar(\|[^>]+)>([\s\S]*?)<\/>/gu,(a,h,g)=>(new Ue("tvar",h,!1,l,o),new Ue("","",!0,l,o),`\0${o.length-2}n${g}\0${o.length}n`)).replace(/<(tvar)(\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\3|[^"'\s>]+))?\s*)>([\s\S]*?)<\/(tvar)(\s*)>/giu,(a,h,g,c,p,f,m)=>(new Ue(h,g,!1,l,o),new Ue(f,m,!0,l,o),`\0${o.length-2}n${p}\0${o.length}n`));const d=new R(n,l,o);d.type="translate-inner";super("translate",u,d,"translate",l,o);L(this,e);this.seal("closed",!0)}get type(){return"translate"}get selfClosing(){return!1}toString(r){return r?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){}},e=new WeakSet,Qu=function(){},s)}}),ha={};Z(ha,{parseCommentAndExt:()=>Zt});var Ni,bl,us,yl,Li,Zt,Fs=$({"parser/commentAndExt.ts"(){"use strict";Ge(),de(),Cu(),At(),$u(),oa(),ta(),Ni="<onlyinclude>",bl="</onlyinclude>",{length:us}=Ni,yl=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",s=e?"noinclude":"includeonly";return vt(i=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${i})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(${"\\1"}\s*)>)|<(${s})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${s}\s*)>|$))`,"giu"))}),Li=e=>{const t=e.indexOf(Ni);return{i:t,j:e.indexOf(bl,t+us)}},Zt=(e,t,s,i)=>{if(i){let{i:u,j:d}=Li(e);if(u!==-1&&d!==-1){let a="";const h=g=>{new _e(g,t,s),a+=`\0${s.length-1}n`};for(;u!==-1&&d!==-1;){const g=`\0${s.length}g`;new Pt(e.slice(u+us,d),t,s),u>0&&h(e.slice(0,u)),a+=g,e=e.slice(d+us+1),{i:u,j:d}=Li(e)}return e&&h(e),a}}const{ext:r}=t;let n=r,l=t;if(r.includes("translate")){const{TranslateToken:u}=(Vu(),J(ua)),d=[];n=r.filter(a=>a!=="translate"&&a!=="tvar"),l=je(he({},t),{ext:n}),e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,a=>(d.push(a),`\0${d.length-1}`)).replace(/<translate( nowrap)?>([\s\S]*?)<\/translate>/gu,(a,h,g)=>{const c=s.length;return new u(h,g&&Ae(g,d),l,s),`\0${c}g`}),e=Ae(e,d)}const o=yl[i?1:0](n.join("|"));return o.lastIndex=0,o.test(e)?e.replace(o,(u,d,a,h,g,c,p,f,m)=>{const S=s.length;let A="n";if(d)A="e",new mt(d,a,h,g,l,c,s);else if(u.startsWith("<!--")){A="c";const w=u.endsWith("-->");new ft(Ae(u,s,1).slice(4,w?-3:void 0),w,t,s)}else c?new Bt(c,p&&Ae(p,s,1),f&&Ae(f,s,1),m,t,s):new _e(u,t,s,!0);return`\0${S}${A}`}):e}}}),wl,Sl,kl,Al,Ei,_l,Ut,Ju=$({"src/tag/html.ts"(){"use strict";var e,t;q(),ue(),Cn(),j(),aa(),wl=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),Sl=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"]),kl=new Set(["strike","big","center","font","tt"]),Al=[Is()],Ut=(t=class extends(_l=On){constructor(i,r,n,l,o,u){super(i,r,n,o,u);L(this,e);this.setAttribute("name",i.toLowerCase()),E(this,e,l)}get type(){return"html"}get selfClosing(){return b(this,e)}text(){const{closing:i,selfClosing:r,name:n}=this,{html:[,,l]}=this.getAttribute("config");return l.includes(n)?i&&n!=="br"?"":super.text("/"):super.text(r&&!i?"/":"")}lint(i=this.getAbsoluteIndex(),r){{const n=super.lint(i,r),{name:l,parentNode:o,closing:u,selfClosing:d}=this,a=new re(this,i),{lintConfig:h}=I,{computeEditInfo:g,fix:c}=h,p=this.inTableAttrs();let f="h1",m=h.getSeverity(f,"html");if(m&&l==="h1"&&!u){const y=B(this,a,f,"<h1>",m);g&&(y.suggestions=[{desc:"h2",range:[i+2,i+3],text:"2"}]),n.push(y)}if(f="parsing-order",m=p&&h.getSeverity(f,p===2?"html":"templateInTable"),m){const y=B(this,a,f,"html-in-table",m);g&&p===2&&(y.suggestions=[D(y)]),n.push(y)}if(f="obsolete-tag",m=h.getSeverity(f,l),m&&kl.has(l)&&n.push(B(this,a,f,"obsolete-tag",m)),f="bold-header",m=h.getSeverity(f,l),m&&(l==="b"||l==="strong")&&this.isInside("heading-title")){const y=B(this,a,f,"bold-in-header",m);g&&(y.suggestions=[D(y)]),n.push(y)}const{html:[,S,A]}=this.getAttribute("config"),w=A.includes(l),v=S.includes(l),k=!w&&!v;if(f="unmatched-tag",u&&(d||w)||d&&k){if(m=h.getSeverity(f,u?"both":"selfClosing"),m){const y=B(this,a,f,u?"closing-and-self-closing":"invalid-self-closing",m);if(g||c){const C=yn(i),x={desc:I.msg("no-self-closing"),range:[y.endIndex-2,y.endIndex-1],text:""};v?g&&(y.suggestions=[C,x]):u?y.fix=w?C:x:g&&(y.suggestions=[x,He(y.endIndex,`></${l}>`,-2)])}n.push(y)}}else if(!this.findMatchingTag()){const y=B(this,a,f,u?"unmatched-closing":"unclosed-tag"),C=this.closest("magic-word");if(C&&wl.has(C.name))m=h.getSeverity(f,"conditional");else if(u)m=h.getSeverity(f,"closing"),y.suggestions=[D(y)];else{m=h.getSeverity(f,"opening");const x=o==null?void 0:o.childNodes;Sl.has(l)&&(x!=null&&x.slice(0,x.indexOf(this)).some(_=>_.is("html")&&_.name===l&&!_.findMatchingTag())&&(y.suggestions=[He(i+1,"/")]),this.isInside("heading-title")&&(y.rule="format-leakage",m=h.getSeverity("format-leakage",l)))}m&&(y.severity=m,n.push(y))}return n}}getAttribute(i){return i==="invalid"?this.inTableAttrs()===2:super.getAttribute(i)}json(i,r=this.getAbsoluteIndex()){}},e=new WeakMap,t),Ei=X(_l),Ut=V(Ei,0,"HtmlToken",Al,Ut),G(Ei,1,Ut)}}),ca={};Z(ca,{parseHtml:()=>ga});var Tl,ga,Xu=$({"parser/html.ts"(){"use strict";$n(),Ju(),Tl=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,ga=(e,t,s)=>{var l;const{html:i}=t;(l=t.htmlElements)!=null||(t.htmlElements=new Set([...i[0],...i[1],...i[2]]));const r=e.split("<");let n=r.shift();for(const o of r){const u=Tl.exec(o),d=u==null?void 0:u[2],a=d==null?void 0:d.toLowerCase();if(!u||!t.htmlElements.has(a)){n+=`<${o}`;continue}const[,h,,g="",c,p]=u,{length:f}=s,m=new Ns(g,"html-attrs",a,t,s),S=m.hasAttr("itemprop");if(a==="meta"&&!(S&&m.hasAttr("content"))||a==="link"&&!(S&&m.hasAttr("href"))){n+=`<${o}`,s.length=f;continue}n+=`\0${s.length}x${p}`,new Ut(d,m,h==="/",c==="/>",t,s)}return n}}}),Cl,Fi,$l,xt,pa=$({"src/table/base.ts"(){"use strict";Cn(),W(),rt(),$n(),Cl=[Is(1)],xt=class extends($l=R){constructor(e,t,s,i,r,n=[],l){super(void 0,r,n,l),this.append(new Qe(t,"table-syntax",r,n),new Ns(i,"table-attrs",s,r,n))}escape(){}},Fi=X($l),xt=V(Fi,0,"TableBaseToken",Cl,xt),G(Fi,1,xt)}}),Il,Ri,Ne,ds,Et,Ft,As,fa=$({"src/table/td.ts"(){"use strict";q(),ue(),_n(),j(),W(),pa(),As=class extends(Ri=xt,Il=[Cs(!1)],Ri){constructor(e,t,s,i=[]){var o;let r=/\||\0\d+!\x7F/u.exec(t!=null?t:""),n=r?t.slice(0,r.index):"";/\[\[|-\{/u.test(n)&&(r=null,n=""),super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",n,s,i),G(ds,5,this),ze(this,Et),ze(this,Ne,""),r&&([fu(this,Ne)._]=r);const l=new R(t==null?void 0:t.slice(((o=r==null?void 0:r.index)!=null?o:NaN)+ce(this,Ne).length),s,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 Yi(this,Et,Ft).call(this).subtype}afterBuild(){ce(this,Ne).includes("\0")&&ke(this,Ne,this.buildFromStr(ce(this,Ne),0)),super.afterBuild()}toString(e){const{childNodes:[t,s,i]}=this;return t.toString(e)+s.toString(e)+ce(this,Ne)+i.toString(e)}text(){const{childNodes:[e,t,s]}=this;return e.text()+t.text()+ce(this,Ne)+s.text()}getGaps(e){return e===1?ce(this,Ne).length:0}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new re(this,e+this.getRelativeIndex(this.length-1)),r="pipe-like",{lintConfig:n}=I,{computeEditInfo:l,fix:o}=n,u=["td","double"].map(d=>n.getSeverity(r,d));for(const d of this.lastChild.childNodes)if(d.type==="text"){const{data:a}=d;if(a.includes("|")){const h=a.includes("||"),g=u[h?1:0];if(g){const c=M(d,i,r,"pipe-in-table",g);if(l||o)if(h){const p={caption:"|+",td:"|",th:"!"}[this.subtype];c.fix=$e(c,"newline",a.replace(/\|\|/gu,`
8
+ `)}getGaps(){return 1}print(){}}}}),Eo,Lu=$({"src/paramLine.ts"(){"use strict";q(),$o(),j(),W(),Eo=class extends R{get type(){return"param-line"}constructor(e,t,s,n,r){super(t,s,n,r),this.setAttribute("name",e)}lint(e=this.getAbsoluteIndex()){{const t="no-ignored",{lintConfig:s}=I,{name:n,childNodes:r}=this,i=s.getSeverity(t,n);if(!i)return[];const l=I.msg("invalid-parameter",n);if(r.some(({type:h})=>h==="ext"))return[B(this,{start:e},t,l,i)];const o=r.filter(({type:h})=>h!=="comment"&&h!=="include"&&h!=="noinclude"),u=n==="inputbox",d=u?o.findIndex(({type:h})=>h!=="text"):-1;let a=o.slice(0,d===-1?void 0:d).map(String).join("").trim();if(a){u&&(a=a.toLowerCase());const h=a.indexOf("="),g=a.slice(0,h===-1?void 0:h).trim(),c=Co[n];if(h===-1?d===-1||!c.some(p=>p.startsWith(g)):!c.includes(g)){const p=B(this,{start:e},t,l,i);return s.computeEditInfo&&(p.suggestions=[D(p)]),[p]}}return super.lint(e,!1)}}}}}),Fo={};Z(Fo,{ParamTagToken:()=>Nn});var Nn,Ro=$({"src/multiLine/paramTag.ts"(){"use strict";Fs(),In(),Lu(),Nn=class extends Ls{constructor(e,t,s,n,r=[],i){super(void 0,n,r,{}),s&&this.safeAppend(s.split(`
9
+ `).map(l=>i?l:Zt(l,n,r,t)).map(l=>new Eo(e,l,n,r,{}))),r.splice(r.indexOf(this),1),r.push(this)}}}}),jr,ui,Pr,ht,Oo=$({"src/heading.ts"(){"use strict";var e,t,on,n;q(),Te(),ue(),ye(),j(),W(),rt(),jr=[me],ht=(n=class extends(Pr=R){constructor(i,l,o,u=[]){super(void 0,o,u);L(this,t);L(this,e);E(this,e,i);const d=new R(l[0],o,u);d.type="heading-title",d.setAttribute("stage",2);const a=new Qe(l[1],"heading-trail",o,u);this.append(d,a)}get type(){return"heading"}get level(){return b(this,e)}toString(i){const l=P(this,t,on).call(this);return l+this.firstChild.toString(i)+l+this.lastChild.toString(i)}text(){const i=P(this,t,on).call(this);return i+this.firstChild.text()+i}getAttribute(i){return i==="invalid"?this.inHtmlAttrs()===2:i==="padding"?this.level:super.getAttribute(i)}getGaps(){return this.level}lint(i=this.getAbsoluteIndex(),l){{const o=super.lint(i,l),{firstChild:u,level:d}=this,a=u.toString(),h=a.startsWith("="),g=h||a.endsWith("="),c=new re(this,i),p=this.inHtmlAttrs(),f=["h1","unbalanced-header","format-leakage"],{lintConfig:m}=I,{computeEditInfo:S,fix:k}=m,w=f.map(v=>m.getSeverity(v,"apostrophe"));if(w[0]&&this.level===1){const v=M(u,c,f[0],"<h1>",w[0]);S&&!g&&(v.suggestions=[$e(v,"h2",`=${a}=`)]),o.push(v)}if(w[1]&&g){const v=I.msg("unbalanced-in-section-header",'"="'),A=M(u,c,f[1],v,w[1]);if(!(!S||a==="="))if(h){const[y]=/^=+/u.exec(a),C=d+y.length;A.suggestions=[{desc:`h${d}`,range:[A.startIndex,A.startIndex+y.length],text:""}],C<7&&A.suggestions.push({desc:`h${C}`,range:[A.endIndex,A.endIndex],text:y})}else{const y=/[^=](=+)$/u.exec(a)[1],C=d+y.length;A.suggestions=[{desc:`h${d}`,range:[A.endIndex-y.length,A.endIndex],text:""}],C<7&&A.suggestions.push({desc:`h${C}`,range:[A.startIndex,A.startIndex],text:y})}o.push(A)}if(p){const v="parsing-order",A=m.getSeverity(v,p===2?"heading":"templateInTable");A&&o.push(B(this,c,v,"header-in-html",A))}if(w[2]){const v=this.getRootNode().toString(),A=u.childNodes.filter(Rs("quote")),y=A.filter(({bold:x})=>x),C=A.filter(({italic:x})=>x);if(y.length%2){const x=M(y[y.length-1],je(he({},c),{start:i+d,left:c.left+d}),f[2],I.msg("unbalanced-in-section-header","bold-apostrophes"),w[2]);if(S||k){const _=i+d+a.length,T=D(x);v.slice(x.endIndex,_).trim()?S&&(x.suggestions=[T,He(_,"'''")]):y.length===1&&C.length===0?x.fix=T:S&&(x.suggestions=[T])}o.push(x)}if(C.length%2){const x=M(C[C.length-1],{start:i+d},f[2],I.msg("unbalanced-in-section-header","italic-apostrophes"),w[2]);if(S||k){const _=i+d+a.length;v.slice(x.endIndex,_).trim()?S&&(x.suggestions=[He(_,"''")]):C.length===1&&y.length===0?x.fix=D(x):S&&(x.suggestions=[D(x)])}o.push(x)}}return o}}print(){}json(i,l=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakSet,on=function(){return"=".repeat(this.level)},n),ui=X(Pr),ht=V(ui,0,"HeadingToken",jr,ht),G(ui,1,ht)}}),Br,jo,Eu=$({"src/parameter.ts"(){"use strict";de(),q(),j(),W(),Br=new RegExp(`https?://${bt}${yt}$`,"iu"),jo=class extends R{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){}constructor(e,t,s,n=[]){super(void 0,s,n);const r=new R(typeof e=="number"?void 0:e,s,n,{}),i=new R(t,s,n);r.type="parameter-key",r.setAttribute("stage",2),i.type="parameter-value",i.setAttribute("stage",2),this.append(r,i)}trimName(e,t=!0){const s=(typeof e=="string"?e:e.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",s),s}afterBuild(){if(!this.anon){const{parentNode:e,firstChild:t}=this,s=this.trimName(t);e&&e.getArgs(s,!1,!1).add(this)}super.afterBuild()}toString(e){return this.anon?this.lastChild.toString(e):super.toString(e,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(e=this.getAbsoluteIndex(),t){var s;{const n=super.lint(e,t),r="unescaped",{lintConfig:i}=I,l=i.getSeverity(r);if(l){const{firstChild:o}=this,u=(s=Br.exec(o.text()))==null?void 0:s[0];try{if(u&&new URL(u).search){const d=M(o,{start:e},r,"unescaped-query",l);d.startIndex=d.endIndex,d.startLine=d.endLine,d.startCol=d.endCol,d.endIndex++,d.endCol++,(i.computeEditInfo||i.fix)&&(d.fix=St(d.startIndex,"{{=}}")),n.push(d)}}catch(d){}}return n}}print(){}json(e,t=this.getAbsoluteIndex()){}}}}),Wr,di,qr,ct,Fu=$({"src/transclude.ts"(){"use strict";var e,t,s,n,r,i,an,Po,u;de(),q(),Te(),ue(),$s(),ye(),j(),W(),Eu(),lt(),rt(),Wr=[me,Yt()],ct=(u=class extends(qr=R){constructor(a,h,g,c=[]){var _,T;let p;const f=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(a);f&&(p=Number(f[1]),a=a.replace(`\0${p}h`,c[p].toString().replace(/^\n/u,"")));super(void 0,g,c,{});L(this,i);Pe(this,"modifier","");L(this,e,"template");L(this,t,":");L(this,s,!1);L(this,n,new Map);L(this,r);const{parserFunction:m,variable:S,functionHook:k}=g,w=(_=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(a))==null?void 0:_[0];if(w)this.setAttribute("modifier",w),a=a.slice(w.length);else if(a.includes(":")){const[N,...F]=a.split(":"),[Q]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((T=F[0])!=null?T:"");this.setModifier(`${N}:${Q}`)&&(a=F.join(":").slice(Q.length))}const v=a.search(/[::]/u),A=a[v]===":",y=v!==-1;if(y||h.length===0&&!b(this,s)){const N=y?a.slice(0,v):a,F=y&&a.slice(v+1),Q=fe(N),z=y?Q.slice(Q.search(/\S/u))+(A?":":""):Q.trim(),[,U,O]=eu(z,m),pe=!("functionHook"in g)||k.includes(O),ge=S.includes(O);if(y?O&&pe:ge){this.setAttribute("name",O),E(this,e,"magic-word"),A&&E(this,t,":");const we=new Qe(N,"magic-word-name",g,c);if(super.insertAt(we),F!==!1&&h.unshift([F]),this.name==="invoke")for(let K=0;K<2;K++){const Re=h.shift();if(!Re)break;const H=new Le(Re.join("="),`invoke-${K?"function":"module"}`,g,c);super.insertAt(H)}}}if(this.type==="template"){const N=fe(a).trim();if(!this.normalizeTitle(N,10,{halfParsed:!0,temporary:!0}).valid)throw c.pop(),new SyntaxError("Invalid template name");const F=new Le(a,"template-name",g,c,{});super.insertAt(F)}typeof p=="number"&&(c[p]=void 0);const C=this.isTemplate();let x=1;for(let N=0;N<h.length;N++){const F=h[N];C||this.name==="switch"&&N>0||this.name==="tag"&&N>1||(F[0]=F.join("="),F.length=1),F.length===1&&(F.unshift(x),x++),this.insertAt(new jo(...F,g,c))}this.seal("modifier")}get type(){return b(this,e)}get module(){}get function(){}setModifier(a){const{parserFunction:[,,h,g]}=this.getAttribute("config"),c=fe(a).trim();if(a&&!c.endsWith(":"))return!1;const p=c.slice(0,-1).toLowerCase(),f=h.includes(p),m=g.includes(p);return(b(this,s)?f:m||!a)||(be.running||this.length>1)&&(f||m||!a)?(this.setAttribute("modifier",a),E(this,s,f),!!a):!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"&&(E(this,r,P(this,i,an).call(this)),this.setAttribute("name",b(this,r).title))}toString(a){const{childNodes:h,length:g,firstChild:c,modifier:p,type:f}=this;return`{{${p}${f==="magic-word"?c.toString(a)+(g===1?"":b(this,t))+h.slice(1).map(m=>m.toString(a)).join("|"):super.toString(a,"|")}}}`}text(){const{childNodes:a,length:h,firstChild:g,modifier:c,type:p,name:f}=this;return p==="magic-word"&&f==="vardefine"?"":`{{${c}${p==="magic-word"?g.text()+(h===1?"":b(this,t))+it(a.slice(1),"|"):super.text("|")}}}`}getAttribute(a){switch(a){case"padding":return this.modifier.length+2;case"title":return b(this,r);case"colon":return b(this,t);case"invalid":default:return super.getAttribute(a)}}lint(a=this.getAbsoluteIndex(),h){{const g=super.lint(a,h);if(!this.isTemplate())return g;const{type:c,childNodes:p,length:f}=this,m=new re(this,a),{lintConfig:S}=I,{computeEditInfo:k}=S,w=c==="magic-word";let v="no-ignored",A=S.getSeverity(v,"fragment");if(w&&!P(this,i,an).call(this).valid)v="invalid-invoke",A=S.getSeverity(v,"name"),A&&g.push(M(p[1],m,v,"illegal-module",A));else if(A){const y=p[w?1:0],C=y.childNodes.findIndex(_=>_.type==="text"&&ws(_.data).includes("#")),x=y.childNodes[C];if(x){const _=M(y,m,v,"useless-fragment",A);k&&(_.suggestions=[D(_,y.getRelativeIndex(C)+x.data.indexOf("#"))]),g.push(_)}}if(v="invalid-invoke",A=S.getSeverity(v,"function"),A&&w&&f===2)return g.push(B(this,m,v,"missing-function",A)),g;if(v="no-duplicate",A=S.getSeverity(v,"parameter"),A){const y=this.getDuplicatedArgs().filter(([,x])=>!x[0].querySelector("ext")),C="duplicate-parameter";for(const[,x]of y)Array.prototype.push.apply(g,x.map(_=>{const T=M(_,m,v,C,A);return k&&(T.suggestions=[D(T,-1)]),T}))}return g}}insertAt(a,h=this.length){return super.insertAt(a,h),a.anon?P(this,i,Po).call(this,a):a.name&&this.getArgs(a.name,!1,!1).add(a),a}getAllArgs(){return this.childNodes.filter(Rs("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:a})=>a)}getArgs(a,h,g=!0){const c=String(a).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");let p;return b(this,n).has(c)?p=b(this,n).get(c):(p=new Set(this.getAllArgs().filter(({name:f})=>c===f)),b(this,n).set(c,p)),p}getDuplicatedArgs(){return[...b(this,n)].filter(([,{size:a}])=>a>1).map(([a,h])=>[a,[...h]])}getPossibleValues(){const{type:a,name:h,childNodes:g}=this;if(a==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let c,p;switch(h){case"if":case"ifexist":case"ifexpr":case"iferror":c=2;break;case"ifeq":c=3;break;case"switch":{const f=g.slice(2),m=f[f.length-1];p=[...f.filter(({anon:S})=>!S),...m!=null&&m.anon?[m]:[]].map(({lastChild:S})=>S);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}p!=null||(p=g.slice(c,c+2).map(({lastChild:f})=>f));for(let f=0;f<p.length;){const{length:m,0:S}=p[f].childNodes.filter(k=>k.text().trim());if(m===0)p.splice(f,1);else if(m>1||!S.is("magic-word"))f++;else try{const k=S.getPossibleValues();Array.prototype.splice.apply(p,[f,1,...k]),f+=k.length}catch(k){f++}}return p}print(){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n=new WeakMap,r=new WeakMap,i=new WeakSet,an=function(){const a=this.type==="template";return this.normalizeTitle((a?"":"Module:")+fe(this.childNodes[a?0:1].text()),10,he({temporary:!0},!a&&{page:""}))},Po=function(a){const h=this.getAnonArgs(),g=typeof a!="number";for(let c=g?h.indexOf(a):a-1;c<h.length;c++){const p=h[c],{name:f}=p,m=String(c+1);(f!==m||p===a)&&(p.setAttribute("name",m),this.getArgs(m,!1,!1).add(p))}},u),di=X(qr),ct=V(di,0,"TranscludeToken",Wr,ct),G(di,1,ct)}}),Mr,hi,zr,Wt,Ru=$({"src/hidden.ts"(){"use strict";nt(),ye(),W(),Mr=[Ve(),me],Wt=class extends(zr=R){get type(){return"hidden"}getAttribute(e){return e==="invalid"||super.getAttribute(e)}},hi=X(zr),Wt=V(hi,0,"HiddenToken",Mr,Wt),G(hi,1,Wt)}}),Ur,ci,Dr,qt,Ou=$({"src/arg.ts"(){"use strict";var e,ju,s;de(),q(),ue(),We(),$s(),ye(),j(),W(),lt(),Ru(),Ur=[me,Fe("{{{"),Yt()],qt=(s=class extends(Dr=R){constructor(r,i,l=[]){super(void 0,i,l,{});L(this,e);for(let o=0;o<r.length;o++){const u=r[o];if(o===0){const d=new Le(u,"arg-name",i,l,{});super.insertAt(d)}else if(o>1){const d=new Wt(u,i,l);super.insertAt(d)}else{const d=new R(u,i,l);d.type="arg-default",d.setAttribute("stage",2),super.insertAt(d)}}}get type(){return"arg"}get default(){}toString(r){return`{{{${super.toString(r,"|")}}}}`}text(){return`{{{${it(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){super.afterBuild()}lint(r=this.getAbsoluteIndex(),i){{const{childNodes:[l,o,...u]}=this;l.setAttribute("aIndex",r+3);const d=l.lint(r+3,i);if(o){const m=r+4+l.toString().length;o.setAttribute("aIndex",m);const S=o.lint(m,i);S.length>0&&Array.prototype.push.apply(d,S)}const a=["no-ignored","no-arg"],{lintConfig:h}=I,{computeEditInfo:g}=h,c=new re(this,r),p=a.map(m=>h.getSeverity(m,"arg"));if(p[0]&&u.length>0&&Array.prototype.push.apply(d,u.map(m=>{const S=M(m,c,a[0],"invisible-triple-braces",p[0]);return S.startIndex--,S.startCol--,g&&(S.suggestions=[D(S),St(S.startIndex,"{{!}}")]),S})),p[1]&&!this.getAttribute("include")){const m=B(this,c,a[1],"unexpected-argument",p[1]);g&&o&&(m.suggestions=[$e(m,"expand",o.text())]),d.push(m)}const f=this.closest("ext");if(f){const m="arg-in-ext",S=h.getSeverity(m,f.name);S&&d.push(B(this,c,m,"argument-in-ext",S))}return d}}print(){}json(r,i=this.getAbsoluteIndex()){}},e=new WeakSet,ju=function(){},s),ci=X(Dr),qt=V(ci,0,"ArgToken",Ur,qt),G(ci,1,qt)}}),Bo={};Z(Bo,{parseBraces:()=>Es});var Hr,gi,as,pi,fi,mi,Gr,xi,Es,Ln=$({"parser/braces.ts"(){"use strict";Ge(),de(),Oo(),Fu(),Ou(),Hr={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},gi=String.raw`\[(?!\[)`,as=String.raw`\n(?![=\0])`,pi=String.raw`|\{{2,}`,fi=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),mi=vt(e=>new RegExp(e,"gmu")),Gr=new RegExp(String.raw`\{\{((?:[^\n{}[]|${gi}|${as})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${as})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${gi}|${as})*\}-`,"gu"),xi=e=>{const t=wt(fe(e));return fi.has(t)?fi.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},Es=(e,t,s)=>{var p,f,m,S,k;const n=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,r]}=t,i=[],l=[],o=(w,v,A,y)=>{v[v.length-1].push(Ae(w.slice(A,y),l))};let u;do u!==void 0&&(e=u),u=e.replace(Gr,(w,v,A)=>{if(v!==void 0||typeof A=="string")try{const{length:y}=s,C=(v!=null?v:A).split("|");return new ct(Ae(C[0],l),C.slice(1).map(x=>{const _=x.indexOf("=");return(_===-1?[x]:[x.slice(0,_),x.slice(_+1)]).map(T=>Ae(T,l))}),t,s),`\0${y}${xi(C[0])}`}catch(y){if(!(y instanceof SyntaxError)||y.message!=="Invalid template name")throw y}return l.push(Ae(w,l)),`\0${l.length-1}`});while(u!==e);e=u;const d=e.lastIndexOf("}}")-e.length;let a=d+e.length!==-1,h=mi(n+(a?pi:"")),g=h.exec(e),c;for(;g||c!==void 0&&c<=e.length&&((f=(p=i[i.length-1])==null?void 0:p[0])!=null&&f.startsWith("="));){if(g!=null&&g[1]){const[,{length:Q}]=g;g[0]=g[0].slice(Q),g.index+=Q}const{0:w,index:v}=g!=null?g:{0:`
10
+ `,index:e.length},A=(m=i.pop())!=null?m:{},{0:y,index:C,parts:x,findEqual:_,pos:T}=A,N=w==="="&&_;if(w==="]]"||w==="}-")c=v+2;else if(w===`
11
+ `){c=v+1;const{pos:Q,findEqual:z}=(S=i[i.length-1])!=null?S:{};if(Q===void 0||z||fe(e.slice(Q,C))!==""){const U=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(e.slice(C,v));U&&(U[2]=Ae(U[2],l),U[2].includes(`
12
+ `)||(e=`${e.slice(0,C)}\0${s.length}h${e.slice(v)}`,c=C+4+String(s.length).length,new ht(U[1].length,U.slice(2),t,s)))}}else if(w==="|"||N)c=v+1,o(e,x,T,v),w==="|"&&x.push([]),A.pos=c,A.findEqual=w==="|",i.push(A);else if(w.startsWith("}}")){const Q=w.slice(0,Math.min(y.length,3)),z=y.length-Q.length,{length:U}=s;c=v+Q.length,o(e,x,T,v);let O=!1,pe="t";if(Q.length===3){const ge=x.map(K=>K.join("=")),we=ge.length>1&&fe(ge[1]).trim();new qt(ge,t,s),we&&we.endsWith(":")&&r.includes(we.slice(0,-1).toLowerCase())&&(pe="s")}else try{new ct(x[0][0],x.slice(1),t,s),pe=xi(x[0][0])}catch(ge){if(ge instanceof SyntaxError&&ge.message==="Invalid template name")O=!0;else throw ge}O||(e=`${e.slice(0,C+z)}\0${U}${pe}${e.slice(c)}`,c=C+z+3+String(U).length,z>1?i.push({0:y.slice(0,z),index:C,pos:C+z,parts:[[]]}):z===1&&e[C-1]==="-"&&i.push({0:"-{",index:C-1,pos:C+1,parts:[[]]}))}else c=v+w.length,w.startsWith("{")&&(g.pos=c,g.parts=[[]]),i.push(..."0"in A?[A]:[],g);let F=i[i.length-1];if(a&&d+e.length<c)for(a=!1;(k=F==null?void 0:F[0])!=null&&k.startsWith("{");)i.pop(),F=i[i.length-1];h=mi(n+(a?pi:"")+(F?`|${Hr[F[0][0]]}${F.findEqual?"|=":""}`:"")),h.lastIndex=c,g=h.exec(e)}return Ae(e,l)}}}),Wo={};Z(Wo,{InputboxToken:()=>qo});var qo,Pu=$({"src/multiLine/inputbox.ts"(){"use strict";Fs(),Ln(),Ro(),qo=class extends Nn{constructor(e,t,s,n,r=[]){const i=Symbol("InputboxToken"),l=n.excludes.includes("heading")?n:je(he({},n),{excludes:[...n.excludes,"heading"]}),{length:o}=r;r.push(i),s&&(s=Zt(s,l,r,t)),s&&(s=Es(s,l,r)),r.splice(o,1),super(e,t,s,l,r,{})}}}}),vs={};Z(vs,{NestedToken:()=>Mo});var Vr,Qr,Mo,vi=$({"src/nested.ts"(){"use strict";var e,t,s;q(),ue(),Fs(),Ln(),j(),W(),oa(),At(),Vr=new Set(["comment","include","arg","template","magic-word"]),Qr=[!1,!0].map(n=>{const r=n?"includeonly":"noinclude";return new RegExp(String.raw`^(?:<${r}(?:\s[^>]*)?/?>|</${r}\s*>)$`,"iu")}),Mo=(s=class extends R{constructor(r,i,l,o,u=[]){if(typeof i=="boolean"){const d=Symbol("NestedToken"),{length:a}=u;u.push(d),r&&(r=Zt(r,o,u,i)),r&&(r=Es(r,o,u)),u.splice(a,1)}else r&&(r=r.replace(i,(d,a,h,g,c)=>{const p=`\0${u.length+1}e`;return new mt(a,h,g,c,o,!1,u),p}));r&&(r=r.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(d,a,h)=>(new _e(h,o,u),`${a}\0${u.length}n`)));super(r,o,u);L(this,e);L(this,t);E(this,e,[...l]),E(this,t,i)}get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex(),i){{const l=super.lint(r,i),o="no-ignored",{lintConfig:u}=I,d=u.getSeverity(o,this.name);if(!d)return l;const a=new re(this,r),h=typeof b(this,t)=="boolean"?Qr[b(this,t)?1:0]:/^<!--[\s\S]*-->$/u;return[...l,...this.childNodes.filter(g=>{const{type:c,name:p}=g;if(c==="ext")return!b(this,e).includes(p);if(Vr.has(c))return!1;const f=g.toString().trim();return f&&!h.test(f)}).map(g=>{const c=M(g,a,o,I.msg("invalid-content",this.name),d);return u.computeEditInfo&&(c.suggestions=[D(c),wn(c,g.toString())]),c})]}}},e=new WeakMap,t=new WeakMap,s)}});function Jr(e,t,s,n,r){t=fe(t).trim();let i=t.replace(e==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(e){case"width":return!i&&!!t||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(i);case"link":{const l=n==="gallery-image";if(i){if(zo(s.protocol).test(i))return Uo(s.protocol).test(i)?t:l;i.startsWith("[[")&&i.endsWith("]]")&&(i=i.slice(2,-2))}else return t;const o=I.normalizeTitle(i,0,!1,s,{halfParsed:r,decode:!0,selfLink:!0,page:""});return o.valid?o: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 zo,Uo,Xr,Kr,Yr,bi,Zr,Mt,Bu=$({"src/imageParameter.ts"(){"use strict";var e,t,Do,r;Ge(),de(),q(),Ee(),Te(),ye(),j(),W(),zo=vt(i=>new RegExp(String.raw`^(?:${i}|//|\0\d+m\x7F)`,"iu")),Uo=vt(i=>new RegExp(String.raw`^(?:(?:${i}|//)${bt}|\0\d+m\x7F)${yt}$`,"iu")),Xr=vt(i=>new RegExp(String.raw`^(\s*(?!\s))${i.replace("$1","(.*)")}${i.endsWith("$1")?`(?=$|
13
+ )`:""}(\s*)$`,"u")),Kr=i=>{if(i)i.startsWith("//")&&(i=`https:${i}`);else return i;return new URL(i).href},Yr=[me],Mt=(r=class extends(Zr=R){constructor(l,o,u,d,a){var i=(...n)=>(super(...n),L(this,t),L(this,e,""),this);let h;const g=Object.entries(d.img).map(([p,f])=>[p,f,Xr(p)]),c=g.find(([,p,f])=>(h=f.exec(l),h&&(h.length!==4||Jr(p,h[2],d,p==="link"?u:o,!0)!==!1)));if(c&&h){h.length===3?(i(void 0,d,a),E(this,e,l)):(i(h[2],d,a,{}),E(this,e,h[1]+c[0]+h[3])),this.setAttribute("name",c[1]),c[1]==="alt"&&this.setAttribute("stage",ve-1);return}i(l,d.excludes.includes("list")?d:je(he({},d),{excludes:[...d.excludes,"list"]}),a),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get type(){return"image-parameter"}get thumb(){return this.name==="manualthumb"?this.normalizeTitle(`File:${super.text().trim()}`,6,{page:""}):void 0}get link(){{if(this.name!=="link")return;const l=super.text().trim();return be.run(()=>{var d;const o=new R(l,this.getAttribute("config"));if(o.parseOnce(0,this.getAttribute("include")).parseOnce(),/^\0\d+m\x7F/u.test(o.firstChild.toString()))return l;const u=Jr("link",l,this.getAttribute("config"),(d=this.parentNode)==null?void 0:d.type);return u===!0?void 0:u},I)}}afterBuild(){var l;(l=this.parentNode)!=null&&l.is("gallery-image")&&!ao.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(l){return b(this,e)?b(this,e).replace("$1",super.toString(l)):super.toString(l)}text(){return b(this,e)?b(this,e).replace("$1",super.text()).trim():super.text().trim()}isPlain(){return this.name==="caption"||this.name==="alt"}getAttribute(l){return l==="invalid"?this.name==="invalid":l==="padding"?Math.max(0,b(this,e).indexOf("$1")):super.getAttribute(l)}lint(l=this.getAbsoluteIndex(),o){{const u=super.lint(l,o),{lintConfig:d}=I,{computeEditInfo:a,fix:h}=d,{link:g,name:c}=this,p=c==="width"&&this.getValue();if(c==="invalid"||p&&p.endsWith("px")){const f="invalid-gallery",m=d.getSeverity(f,"parameter");if(m){const S=B(this,{start:l},f,"invalid-image-parameter",m);(a||h)&&(S.fix=p?D(S,0,p):D(S,-1)),u.push(S)}}else if(c==="link"){if(g===void 0){const f="invalid-gallery",m=d.getSeverity(f,"link");m&&u.push(B(this,{start:l},f,"invalid-gallery-link",m))}else if(typeof g=="string"){const f="invalid-url",m=d.getSeverity(f);if(m&&!this.querySelector("magic-word"))try{Kr(g)}catch(S){u.push(B(this,{start:l},f,"invalid-url",m))}}else if(g.encoded){const f="url-encoding",m=d.getSeverity(f,"file");if(m){const S=B(this,{start:l},f,"unnecessary-encoding",m);(a||h)&&(S.fix=bn(S,this)),u.push(S)}}}else if(c==="manualthumb"){const f="invalid-gallery",m=d.getSeverity(f,"thumb");if(m&&!this.querySelector("arg,magic-word,template")){const{valid:S,ns:k,extension:w}=this.thumb;(!S||k!==6||!Ss.has(w))&&u.push(B(this,{start:l},f,"invalid-thumb",m))}}return u}}getValue(){return this.name==="invalid"?this.text():P(this,t,Do).call(this)||super.text()}print(){}},e=new WeakMap,t=new WeakSet,Do=function(){return b(this,e)&&!b(this,e).includes("$1")},r),bi=X(Zr),Mt=V(bi,0,"ImageParameterToken",Yr,Mt),G(bi,1,Mt)}}),yi,el,tl,wi,Si,sl,ki,En,Ho=$({"src/link/file.ts"(){"use strict";q(),Ee(),ue(),j(),Kt(),Bu(),yi=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),el=new Set(["arg"]),tl=new Set(["template","magic-word"]),wi=new Set(["left","right","center","none"]),Si=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),sl=e=>{if(e===void 0)return[];const t=/-\{|\}-|\|/gu,s=[];let n=t.exec(e),r=0,i=0;for(;n;){const{0:l,index:o}=n;l!=="|"?r+=l==="-{"?1:-1:r===0&&(s.push(e.slice(i,o)),{lastIndex:i}=t),n=t.exec(e)}return s.push(e.slice(i)),s},ki=(e,t)=>e.filter(({childNodes:s})=>!s.some(n=>n.text().trim()&&t.has(n.type))),En=class extends Be{get type(){return"file"}get extension(){}constructor(e,t,s,n=[],r="|",i){super(e,void 0,s,n,r);const{extension:l}=this.getTitle(!0,!0);this.safeAppend(sl(t).map(o=>new Mt(o,l,i,s,n)))}lint(e=this.getAbsoluteIndex(),t){var s;{const n=super.lint(e,t),r=ki(this.getAllArgs(),el),i=[...new Set(r.map(({name:y})=>y))],l=i.filter(y=>yi.has(y)),o=i.filter(y=>wi.has(y)),u=i.filter(y=>Si.has(y)),[d]=l,a=d==="framed"||d==="manualthumb",h=new re(this,e),{lintConfig:g}=I,{computeEditInfo:c,fix:p}=g,{ns:f,extension:m}=this.getAttribute("title"),{firstChild:S}=this;let k="nested-link",w=g.getSeverity(k,"file");if(w&&Ss.has(m)&&this.isInside("ext-link-text")&&((s=this.getValue("link"))==null?void 0:s.trim())!==""){const y=B(this,h,k,"link-in-extlink",w);if(c||p){const C=this.getArg("link");if(C){const x=e+C.getRelativeIndex();y.fix={desc:I.msg("delink"),range:[x,x+C.toString().length],text:"link="}}else y.fix=Ts(y.endIndex-2,"delink","|link=")}n.push(y)}if(k="invalid-gallery",w=g.getSeverity(k,"extension"),w&&f===6&&!m&&!S.querySelector("arg,magic-word,template")&&n.push(B(this,h,k,"missing-extension",w)),w=g.getSeverity(k,"parameter"),w&&a)for(const y of r.filter(({name:C})=>C==="width")){const C=M(y,h,k,"invalid-image-parameter",w);(c||p)&&(C.fix=D(C,-1)),n.push(C)}if(r.length===i.length&&l.length<2&&o.length<2&&u.length<2)return n;k="no-duplicate";const v=["unknownImageParameter","imageParameter"].map(y=>g.getSeverity(k,y)),A=(y,C,x,_=!0)=>y.map(T=>{if(w=v[Number(typeof _=="function"?_(T):_)],!w)return!1;const N=M(T,h,k,I.msg(`${C}-image-parameter`,x),w);return c&&(N.suggestions=[D(N,-1)]),N}).filter(T=>T!==!1);for(const y of i){if(y==="invalid"||y==="width"&&a)continue;const C=y==="caption";let x=r.filter(({name:_})=>_===y);if(C&&(x=[...x.slice(0,-1).filter(_=>_.text()),...x.slice(-1)]),x.length>1){let _=!C||!m||Ss.has(m);if(C&&_){const T=ki(x,tl);_=T.length>1&&(N=>T.includes(N))}Array.prototype.push.apply(n,A(x,"duplicate",y,_))}}return l.length>1&&Array.prototype.push.apply(n,A(r.filter(({name:y})=>yi.has(y)),"conflicting","frame")),o.length>1&&Array.prototype.push.apply(n,A(r.filter(({name:y})=>wi.has(y)),"conflicting","horizontal-alignment")),u.length>1&&Array.prototype.push.apply(n,A(r.filter(({name:y})=>Si.has(y)),"conflicting","vertical-alignment")),n}}getAllArgs(){return this.childNodes.slice(1)}getArgs(e){return this.getAllArgs().filter(({name:t})=>e===t)}getArg(e){{const t=this.getArgs(e);return t[e==="manualthumb"?0:t.length-1]}}getValue(e){var t;return(t=this.getArg(e))==null?void 0:t.getValue()}json(e,t=this.getAbsoluteIndex()){}}}}),il,Ai,nl,gt,Go=$({"src/link/galleryImage.ts"(){"use strict";var e,un,s;q(),Ee(),We(),j(),W(),Ho(),il=[Fe("")],gt=(s=class extends(nl=En){constructor(r,i,l,o,u=[]){let d;if(l!==void 0){const{length:h}=u;d=new R(l,o,u);for(let g=0;g<ve-1;g++)d.parseOnce();u.splice(h,1)}const a=`${r}-image`;super(i,d==null?void 0:d.firstChild.toString(),o,u,void 0,a);L(this,e);Pe(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=a,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(r){const i=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),i?0:6,{halfParsed:!0,temporary:r,decode:!i,page:""})}lint(r=this.getAbsoluteIndex(),i){{const l=super.lint(r,i),o="invalid-gallery",{lintConfig:u}=I,d=u.getSeverity(o,"image");if(d&&P(this,e,un).call(this)){const a=B(this,{start:r},o,"invalid-gallery",d);u.computeEditInfo&&(a.suggestions=[Ts(r,"prefix","File:")]),l.push(a)}return l}}getAttribute(r){return r==="invalid"?P(this,e,un).call(this):super.getAttribute(r)}},e=new WeakSet,un=function(){return this.getAttribute("title").ns!==6},s),Ai=X(nl),gt=V(Ai,0,"GalleryImageToken",il,gt),G(Ai,1,gt)}}),ks,Vo=$({"src/nowiki/commentLine.ts"(){"use strict";At(),ks=class extends _e{}}}),Qo={};Z(Qo,{GalleryToken:()=>Jo});var Jo,Wu=$({"src/multiLine/gallery.ts"(){"use strict";var e,Xo,qu,n;q(),j(),In(),Go(),Vo(),Jo=(n=class extends Ls{constructor(i,l,o=[]){var u;super(void 0,l,o,{});L(this,e);for(const d of(u=i==null?void 0:i.split(`
14
+ `))!=null?u:[]){const a=/^([^|]+)(?:\|(.*))?/u.exec(d);if(!a){super.insertAt(d.trim()?new ks(d,l,o):d);continue}const[,h,g]=a;P(this,e,Xo).call(this,h)?super.insertAt(new gt("gallery",h,g,l,o)):super.insertAt(new ks(d,l,o))}}get widths(){}get heights(){}lint(i=this.getAbsoluteIndex(),l){{const{top:o,left:u}=this.getRootNode().posFromIndex(i),d=[],a="no-ignored",{lintConfig:h}=I,g=["Image","NoImage","Comment"].map(c=>h.getSeverity(a,`gallery${c}`));for(let c=0;c<this.length;c++){const p=this.childNodes[c],f=p.toString(),{length:m}=f,S=f.trim(),{type:k}=p,w=o+c,v=c?0:u;if(p.setAttribute("aIndex",i),k==="noinclude"&&S&&!/^<!--.*-->$/u.test(S)){let[A]=g;if(S.startsWith("|")?[,A]=g:(S.startsWith("<!--")||S.endsWith("-->"))&&([,,A]=g),A){const y=i+m,C={rule:a,message:I.msg("invalid-content","gallery"),severity:A,startIndex:i,endIndex:y,startLine:w,endLine:w,startCol:v,endCol:v+m};h.computeEditInfo&&(C.suggestions=[D(C),wn(C,f)]),d.push(C)}}else if(k!=="noinclude"&&k!=="text"){const A=p.lint(i,l);A.length>0&&Array.prototype.push.apply(d,A)}i+=m+1}return d}}json(i,l=this.getAbsoluteIndex()){}},e=new WeakSet,Xo=function(i){return this.normalizeTitle(i,6,{halfParsed:!0,temporary:!0,decode:!0,page:""}).valid},qu=function(i){},n)}}),Fn,Ko=$({"src/link/index.ts"(){"use strict";Ge(),q(),j(),Kt(),Fn=class extends Be{get type(){return"link"}get innerText(){return this.length>1?this.lastChild.text():Qt(this.firstChild.text().replace(/^\s*:?/u,""))}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),n="nested-link",{lintConfig:r}=I,i=r.getSeverity(n);if(i&&this.isInside("ext-link-text")){const l=B(this,{start:e},n,"link-in-extlink",i);(r.computeEditInfo||r.fix)&&(l.fix=$e(l,"delink",this.innerText)),s.push(l)}return s}}}}}),rl,ll,Xt,Rn=$({"src/magicLink.ts"(){"use strict";var e,t,dn,n;q(),de(),ue(),j(),W(),rl=String.raw`(?:[${De}\t]|&nbsp;|&#0*160;|&#[xX]0*[aA]0;)`,ll=new RegExp(`${rl}+`,"gu"),Xt=(n=class extends R{constructor(i,l="free-ext-link",o=I.getConfig(),u){super(i,o,u,{});L(this,t);L(this,e);E(this,e,l)}get type(){return b(this,e)}get innerText(){const i=new Map([["!","|"],["=","="]]);let l=it(this.childNodes.map(o=>{const{type:u}=o,d=String(o.name);return u==="magic-word"&&i.has(d)?i.get(d):o}));return this.type==="magic-link"&&(l=l.replace(ll," ")),l}get link(){const{innerText:i}=this;return this.type==="magic-link"?i.startsWith("ISBN")?`ISBN ${i.slice(5).replace(/[- ]/gu,"").replace(/x$/u,"X")}`:i:lo(i).replace(/\n/gu,"%0A")}lint(i=this.getAbsoluteIndex(),l){{const o=super.lint(i,l),u=new re(this,i),{lintConfig:d}=I,{type:a,childNodes:h}=this;if(a==="magic-link"){const f="invalid-isbn",m=d.getSeverity(f);return m&&P(this,t,dn).call(this)&&o.push(B(this,u,f,"invalid-isbn",m)),o}let g="invalid-url",c=d.getSeverity(g);if(c&&!this.querySelector("magic-word"))try{this.getUrl()}catch(f){o.push(B(this,u,g,"invalid-url",c))}const p=a==="ext-link-url";if(g="unterminated-url",c=d.getSeverity(g,p?"pipe":"punctuation"),c){const f=p?/\|/u:/[,;。:!?()]+/u,m=h.find(S=>S.type==="text"&&f.test(S.data));if(m){const{data:S}=m,k=M(m,u,g,I.msg("in-url",p?'"|"':"full-width-punctuation"),c);if(d.computeEditInfo){const{index:w,0:v}=f.exec(S),A=k.startIndex+w;k.suggestions=p?[Jt(A,1)]:[Jt(A),{desc:I.msg("encode"),range:[A,A+v.length],text:encodeURI(v)}]}o.push(k)}}return o}}getUrl(i){this.lspError("MagicLinkToken.getUrl")}getAttribute(i){return i==="invalid"?P(this,t,dn).call(this):super.getAttribute(i)}},e=new WeakMap,t=new WeakSet,dn=function(){if(this.type==="magic-link"){const{link:i}=this;if(i.startsWith("ISBN")){const l=[...i.slice(5)].map(o=>o==="X"?10:Number(o));return l.length===10?l.reduce((o,u,d)=>o+u*(10-d),0)%11!==0:l.length===13&&(l[12]===10||l.reduce((o,u,d)=>o+u*(d%2?3:1),0)%10!==0)}}return!1},n)}}),ol,_i,al,pt,Yo=$({"src/extLink.ts"(){"use strict";var e,t;Ee(),q(),We(),j(),W(),Rn(),ol=[Fe("[")],pt=(t=class extends(al=R){constructor(n,r="",i="",l,o=[]){super(void 0,l,o,{});L(this,e);const u=n&&/^\0\d+f\x7F$/u.test(n)?o[Number(n.slice(1,-2))]:new Xt(n,"ext-link-url",l,o);if(this.insertAt(u),E(this,e,r),i){const d=new R(i,l,o,{});d.type="ext-link-text",d.setAttribute("stage",ve-1),this.insertAt(d)}}get type(){return"ext-link"}toString(n){return this.length===1?`[${super.toString(n)}${b(this,e)}]`:`[${super.toString(n,b(this,e))}]`}text(){return`[${super.text(" ")}]`}getGaps(){return b(this,e).length}lint(n=this.getAbsoluteIndex(),r){{const i=super.lint(n,r),l="var-anchor",o=I.lintConfig.getSeverity(l,"extLink");return o&&this.length===1&&this.isInside("heading-title")&&i.push(B(this,{start:n},l,"variable-anchor",o)),i}}print(){}},e=new WeakMap,t),_i=X(al),pt=V(_i,0,"ExtLinkToken",ol,pt),G(_i,1,pt)}}),hn,Mu=$({"src/imagemapLink.ts"(){"use strict";W(),At(),Ko(),Yo(),hn=class extends R{get type(){return"imagemap-link"}constructor(e,t,s,n,r=[]){super(void 0,n,r),this.append(e,t.length===2?new Fn(...t,n,r):new pt(...t,n,r),new _e(s,n,r))}}}}),Zo={};Z(Zo,{ImagemapToken:()=>ea});var ea,zu=$({"src/multiLine/imagemap.ts"(){"use strict";q(),Te(),ue(),j(),In(),Vo(),Go(),Mu(),ea=class extends Ls{get image(){return this.childNodes.find(Rs("imagemap-image"))}constructor(e,t=I.getConfig(),s=[]){if(super(void 0,t,s,{}),!e)return;const n=e.split(`
15
+ `),r=new Set(t.protocol.split("|"));let i=!0,l=!1;for(const o of n){const u=o.trim();if(!(l||!u||u.startsWith("#"))){if(i){const d=o.indexOf("|"),a=d===-1?o:o.slice(0,d),h=this.normalizeTitle(a,0,{halfParsed:!0,temporary:!0,page:""});if(h.valid&&h.ns===6){const g=new gt("imagemap",a,d===-1?void 0:o.slice(d+1),t,s);super.insertAt(g),i=!1;continue}else l=!0}else if(o.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(o);continue}else if(o.includes("[")){const d=o.indexOf("["),a=o.slice(d),h=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(a);if(h){if(this.normalizeTitle(h[1],0,{halfParsed:!0,temporary:!0,selfLink:!0,page:""}).valid){super.insertAt(new hn(o.slice(0,d),h.slice(1),a.slice(a.indexOf("]]")+2),t,s));continue}}else if(a.startsWith("[//")||r.has(a.slice(1,a.indexOf(":")+1))||r.has(a.slice(1,a.indexOf("//")+2))){const g=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(a);if(g){super.insertAt(new hn(o.slice(0,d),g.slice(1),a.slice(a.indexOf("]")+1),t,s));continue}}}}super.insertAt(new ks(o,t,s))}}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),n=new re(this,e),{childNodes:r,image:i}=this,l="invalid-imagemap",{lintConfig:o}=I,u=o.getSeverity(l,i?"link":"image");return u&&(i?Array.prototype.push.apply(s,r.filter(d=>{const a=d.toString().trim();return d.is("noinclude")&&a&&!a.startsWith("#")}).map(d=>{const a=M(d,n,l,"invalid-imagemap-link",u);return o.computeEditInfo&&(a.suggestions=[D(a,-1),$e(a,"comment","# ")]),a})):s.push(B(this,n,l,"imagemap-without-image",u))),s}}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}}}}),ul,Ti,dl,ft,ta=$({"src/nowiki/comment.ts"(){"use strict";q(),nt(),We(),j(),ot(),ul=[Ve(!1),Fe("<!--")],ft=class extends(dl=Ie){constructor(t,s,n,r){super(t,n,r);Pe(this,"closed");this.closed=s}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){{if(this.closed)return[];const s="unclosed-comment",{lintConfig:n}=I,r=n.getSeverity(s);if(!r)return[];const i=B(this,{start:t},s,"unclosed-comment",r);return n.computeEditInfo&&(i.suggestions=[He(i.endIndex,"-->")]),[i]}}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){}},Ti=X(dl),ft=V(Ti,0,"CommentToken",ul,ft),G(Ti,1,ft)}}),sa={};Z(sa,{CommentedToken:()=>ia});var ia,Uu=$({"src/commented.ts"(){"use strict";W(),ta(),ia=class extends R{get type(){return"ext-inner"}constructor(e,t,s=[]){if(super(void 0,t,s,{AstText:":",CommentToken:":"}),e){let n=e.indexOf("<!--"),r=n!==-1&&e.indexOf("-->",n+4),i=0;for(;r!==!1&&r!==-1;)n>i&&this.insertAt(e.slice(i,n)),this.insertAt(new ft(e.slice(n+4,r),!0,t,s)),i=r+3,n=e.indexOf("<!--",i),r=n!==-1&&e.indexOf("-->",n+4);i<e.length&&this.insertAt(e.slice(i))}}lint(e=this.getAbsoluteIndex()){return super.lint(e,new RegExp(String.raw`<\s*(?:\/\s*)?(${this.name})\b`,"giu"))}}}}),na={};Z(na,{CategorytreeToken:()=>zt});var hl,Ci,cl,zt,Du=$({"src/link/categorytree.ts"(){"use strict";q(),We(),j(),Kt(),hl=[Fe("")],zt=class extends(cl=Be){get type(){return"ext-inner"}constructor(e,t,s,n=[]){super(e,t,s,n),this.setAttribute("bracket",!1)}getTitle(){const e=this.firstChild.toString().trim(),t={halfParsed:!0},s=this.normalizeTitle(e,14,t);return s.valid&&s.ns===14?s:this.normalizeTitle(`Category:${e}`,0,t)}lint(e=this.getAbsoluteIndex()){{const t="no-ignored",s=I.lintConfig.getSeverity(t,"categorytree");if(s){const{link:n}=this;if(!n.valid||n.ns!==14)return[B(this,{start:e},t,"invalid-category",s)]}return super.lint(e,!1)}}},Ci=X(cl),zt=V(Ci,0,"CategorytreeToken",hl,zt),G(Ci,1,zt)}}),ra={};Z(ra,{NowikiToken:()=>la});var gl,pl,la,Hu=$({"src/nowiki/index.ts"(){"use strict";var e,cn,s;Ge(),q(),ue(),j(),ot(),gl=vt(n=>new RegExp(String.raw`<\s*(?:/\s*)${n==="nowiki"?"":"?"}(${n})\b`,"giu")),pl=new Set(["languages","section","templatestyles"]),la=(s=class extends Ie{constructor(){super(...arguments);L(this,e)}get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex()){{const{name:i,innerText:l}=this,{lintConfig:o}=I;let u="void-ext",d=o.getSeverity(u,i);if(d&&P(this,e,cn).call(this)){const a=B(this,{start:r},u,I.msg("nothing-in",i),d);return o.computeEditInfo&&(a.suggestions=[D(a)]),[a]}{u="invalid-json";const a=o.getSeverity(u);if(i==="templatedata"&&a)return uo(l).map(({message:h,from:g,to:c=g,line:p,endLine:f=p,column:m,endColumn:S=m})=>{d=a;const k=new re(this,r);return{rule:u,message:h,severity:d,startIndex:r+g,endIndex:r+c,startLine:k.top+p-1,endLine:k.top+f-1,startCol:(p>1?0:k.left)+m-1,endCol:(f>1?0:k.left)+S-1}}).filter(h=>h!==!1)}return super.lint(r,gl(i))}}getAttribute(r){return r==="invalid"?P(this,e,cn).call(this):super.getAttribute(r)}},e=new WeakSet,cn=function(){const{name:r,firstChild:{data:i}}=this;return pl.has(r)&&!!i},s)}}),fl,$i,ml,mt,oa=$({"src/tagPair/ext.ts"(){"use strict";q(),ue(),j(),Cn(),W(),Tn(),$n(),fl=[Is()],mt=class extends(ml=Ze){get type(){return"ext"}constructor(e,t,s,n,r=I.getConfig(),i=!1,l=[]){const o=e.toLowerCase(),u=new Ns(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",o,r,l),d=je(he({},r),{ext:r.ext.filter(h=>h!==o),excludes:[...r.excludes],inExt:!0});let a;switch(o){case"pre":if(u.getAttr("format")!=="wikitext"){const{PreToken:h}=(Nu(),J(No));a=new h(s,d,l);break}case"indicator":case"poem":case"ref":case"option":case"combooption":case"tab":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":o==="poem"?d.excludes.push("heading"):o==="tab"&&(d.ext=d.ext.filter(h=>h!=="tabs")),a=new R(s,d,l);break;case"dynamicpagelist":{const{ParamTagToken:h}=(Ro(),J(Fo));a=new h(o,i,s,d,l);break}case"inputbox":{const{InputboxToken:h}=(Pu(),J(Wo));a=new h(o,i,s,d,l);break}case"references":{const{NestedToken:h}=(vi(),J(vs));d.excludes.push("heading"),a=new h(s,i,["ref"],d,l);break}case"choose":{const{NestedToken:h}=(vi(),J(vs));a=new h(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],d,l);break}case"combobox":{const{NestedToken:h}=(vi(),J(vs));a=new h(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],d,l);break}case"gallery":{const{GalleryToken:h}=(Wu(),J(Qo));a=new h(s,d,l);break}case"imagemap":{const{ImagemapToken:h}=(zu(),J(Zo));a=new h(s,d,l);break}case"hiero":{const{CommentedToken:h}=(Uu(),J(sa));a=new h(s,d,l);break}case"categorytree":{const{CategorytreeToken:h}=(Du(),J(na));a=new h(s,void 0,d,l);break}default:{const{NowikiToken:h}=(Hu(),J(ra));a=new h(s,d,l)}}a.setAttribute("name",o),a.type==="plain"&&(a.type="ext-inner"),super(e,u,a,n,r,l),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),{lintConfig:n}=I,r=new re(this,e);if(this.name!=="nowiki"){const i=this.inHtmlAttrs(),l="parsing-order",o=i&&n.getSeverity(l,i===2?"ext":"templateInTable");o&&s.push(B(this,r,l,"ext-in-html",o))}if(this.name==="ref"){let i="var-anchor",l=n.getSeverity(i,"ref");l&&this.closest("heading-title")&&s.push(B(this,r,i,"variable-anchor",l)),i="nested-link",l=n.getSeverity(i,"ref"),l&&this.closest("link-text,ext-link-text")&&s.push(B(this,r,i,"ref-in-link",l))}return s}}},$i=X(ml),mt=V($i,0,"ExtToken",fl,mt),G($i,1,mt)}}),On,aa=$({"src/tag/index.ts"(){"use strict";var e,t,s,n;q(),Te(),W(),j(),On=(n=class extends R{constructor(i,l,o,u,d){super(void 0,u,d);L(this,e);L(this,t);L(this,s);this.insertAt(l),E(this,e,o),E(this,t,i)}get closing(){return b(this,e)}toString(i){return`<${b(this,e)?"/":""}${b(this,t)}${super.toString(i)}${this.selfClosing?"/":""}>`}text(i=""){const{closing:l}=this;return`<${l&&!i?"/":""}${b(this,t)}${l?"":super.text()}${i}>`}getAttribute(i){return i==="padding"?b(this,t).length+(b(this,e)?2:1):super.getAttribute(i)}findMatchingTag(){return tt(b(this,s),()=>{const{type:i,name:l,parentNode:o,closing:u,selfClosing:d}=this;let a=!1,h=!1;if(i==="html"){const{html:[,S,k]}=this.getAttribute("config");a=k.includes(l),h=S.includes(l)}if(a||h&&d)return this;if(!o)return;const{childNodes:g}=o,c=g.indexOf(this),p=u?g.slice(0,c).reverse():g.slice(c+1),f=[this],{rev:m}=be;for(const S of p)if(!(!S.is(i)||i==="html"&&(S.name!==l||h&&S.selfClosing)))if(b(S,e)===u){if(i==="tvar")return;f.push(S)}else{const k=f.pop();if(k===this)return S;I.viewOnly&&(E(k,s,[m,S]),E(S,s,[m,k]))}if(I.viewOnly)for(const S of f)E(S,s,[m,void 0])},i=>{E(this,s,i),i[1]&&i[1]!==this&&E(i[1],s,[be.rev,this])})}print(){}json(i,l=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n)}}),xl,Ii,vl,Ue,Gu=$({"src/tag/tvar.ts"(){"use strict";nt(),ye(),aa(),rt(),xl=[Ve(),me],Ue=class extends(vl=On){get type(){return"tvar"}constructor(e,t,s,n,r){const i=new Qe(t,"tvar-name",n,r);super(e,i,s,n,r)}},Ii=X(vl),Ue=V(Ii,0,"TvarToken",xl,Ue),G(Ii,1,Ue)}}),ua={};Z(ua,{TranslateToken:()=>da});var da,Vu=$({"src/tagPair/translate.ts"(){"use strict";var e,Qu,s;W(),Tn(),rt(),Gu(),da=(s=class extends Ze{constructor(r,i,l,o=[]){const u=new Qe(r,"translate-attr",l,o);i=i==null?void 0:i.replace(/<tvar(\|[^>]+)>([\s\S]*?)<\/>/gu,(a,h,g)=>(new Ue("tvar",h,!1,l,o),new Ue("","",!0,l,o),`\0${o.length-2}n${g}\0${o.length}n`)).replace(/<(tvar)(\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\3|[^"'\s>]+))?\s*)>([\s\S]*?)<\/(tvar)(\s*)>/giu,(a,h,g,c,p,f,m)=>(new Ue(h,g,!1,l,o),new Ue(f,m,!0,l,o),`\0${o.length-2}n${p}\0${o.length}n`));const d=new R(i,l,o);d.type="translate-inner";super("translate",u,d,"translate",l,o);L(this,e);this.seal("closed",!0)}get type(){return"translate"}get selfClosing(){return!1}toString(r){return r?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){}},e=new WeakSet,Qu=function(){},s)}}),ha={};Z(ha,{parseCommentAndExt:()=>Zt});var Ni,bl,us,yl,Li,Zt,Fs=$({"parser/commentAndExt.ts"(){"use strict";Ge(),de(),Cu(),At(),$u(),oa(),ta(),Ni="<onlyinclude>",bl="</onlyinclude>",{length:us}=Ni,yl=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",s=e?"noinclude":"includeonly";return vt(n=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${n})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(${"\\1"}\s*)>)|<(${s})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${s}\s*)>|$))`,"giu"))}),Li=e=>{const t=e.indexOf(Ni);return{i:t,j:e.indexOf(bl,t+us)}},Zt=(e,t,s,n)=>{if(n){let{i:u,j:d}=Li(e);if(u!==-1&&d!==-1){let a="";const h=g=>{new _e(g,t,s),a+=`\0${s.length-1}n`};for(;u!==-1&&d!==-1;){const g=`\0${s.length}g`;new Pt(e.slice(u+us,d),t,s),u>0&&h(e.slice(0,u)),a+=g,e=e.slice(d+us+1),{i:u,j:d}=Li(e)}return e&&h(e),a}}const{ext:r}=t;let i=r,l=t;if(r.includes("translate")){const{TranslateToken:u}=(Vu(),J(ua)),d=[];i=r.filter(a=>a!=="translate"&&a!=="tvar"),l=je(he({},t),{ext:i}),e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,a=>(d.push(a),`\0${d.length-1}`)).replace(/<translate( nowrap)?>([\s\S]*?)<\/translate>/gu,(a,h,g)=>{const c=s.length;return new u(h,g&&Ae(g,d),l,s),`\0${c}g`}),e=Ae(e,d)}const o=yl[n?1:0](i.join("|"));return o.lastIndex=0,o.test(e)?e.replace(o,(u,d,a,h,g,c,p,f,m)=>{const S=s.length;let k="n";if(d)k="e",new mt(d,a,h,g,l,c,s);else if(u.startsWith("<!--")){k="c";const w=u.endsWith("-->");new ft(Ae(u,s,1).slice(4,w?-3:void 0),w,t,s)}else c?new Bt(c,p&&Ae(p,s,1),f&&Ae(f,s,1),m,t,s):new _e(u,t,s,!0);return`\0${S}${k}`}):e}}}),wl,Sl,kl,Al,Ei,_l,Ut,Ju=$({"src/tag/html.ts"(){"use strict";var e,t;q(),ue(),Cn(),j(),aa(),wl=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),Sl=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"]),kl=new Set(["strike","big","center","font","tt"]),Al=[Is()],Ut=(t=class extends(_l=On){constructor(n,r,i,l,o,u){super(n,r,i,o,u);L(this,e);this.setAttribute("name",n.toLowerCase()),E(this,e,l)}get type(){return"html"}get selfClosing(){return b(this,e)}text(){const{closing:n,selfClosing:r,name:i}=this,{html:[,,l]}=this.getAttribute("config");return l.includes(i)?n&&i!=="br"?"":super.text("/"):super.text(r&&!n?"/":"")}lint(n=this.getAbsoluteIndex(),r){{const i=super.lint(n,r),{name:l,parentNode:o,closing:u,selfClosing:d}=this,a=new re(this,n),{lintConfig:h}=I,{computeEditInfo:g,fix:c}=h,p=this.inTableAttrs();let f="h1",m=h.getSeverity(f,"html");if(m&&l==="h1"&&!u){const y=B(this,a,f,"<h1>",m);g&&(y.suggestions=[{desc:"h2",range:[n+2,n+3],text:"2"}]),i.push(y)}if(f="parsing-order",m=p&&h.getSeverity(f,p===2?"html":"templateInTable"),m){const y=B(this,a,f,"html-in-table",m);g&&p===2&&(y.suggestions=[D(y)]),i.push(y)}if(f="obsolete-tag",m=h.getSeverity(f,l),m&&kl.has(l)&&i.push(B(this,a,f,"obsolete-tag",m)),f="bold-header",m=h.getSeverity(f,l),m&&(l==="b"||l==="strong")&&this.isInside("heading-title")){const y=B(this,a,f,"bold-in-header",m);g&&(y.suggestions=[D(y)]),i.push(y)}const{html:[,S,k]}=this.getAttribute("config"),w=k.includes(l),v=S.includes(l),A=!w&&!v;if(f="unmatched-tag",u&&(d||w)||d&&A){if(m=h.getSeverity(f,u?"both":"selfClosing"),m){const y=B(this,a,f,u?"closing-and-self-closing":"invalid-self-closing",m);if(g||c){const C=yn(n),x={desc:I.msg("no-self-closing"),range:[y.endIndex-2,y.endIndex-1],text:""};v?g&&(y.suggestions=[C,x]):u?y.fix=w?C:x:g&&(y.suggestions=[x,He(y.endIndex,`></${l}>`,-2)])}i.push(y)}}else if(!this.findMatchingTag()){const y=B(this,a,f,u?"unmatched-closing":"unclosed-tag"),C=this.closest("magic-word");if(C&&wl.has(C.name))m=h.getSeverity(f,"conditional");else if(u)m=h.getSeverity(f,"closing"),y.suggestions=[D(y)];else{m=h.getSeverity(f,"opening");const x=o==null?void 0:o.childNodes;Sl.has(l)&&(x!=null&&x.slice(0,x.indexOf(this)).some(_=>_.is("html")&&_.name===l&&!_.findMatchingTag())&&(y.suggestions=[He(n+1,"/")]),this.isInside("heading-title")&&(y.rule="format-leakage",m=h.getSeverity("format-leakage",l)))}m&&(y.severity=m,i.push(y))}return i}}getAttribute(n){return n==="invalid"?this.inTableAttrs()===2:super.getAttribute(n)}json(n,r=this.getAbsoluteIndex()){}},e=new WeakMap,t),Ei=X(_l),Ut=V(Ei,0,"HtmlToken",Al,Ut),G(Ei,1,Ut)}}),ca={};Z(ca,{parseHtml:()=>ga});var Tl,ga,Xu=$({"parser/html.ts"(){"use strict";$n(),Ju(),Tl=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,ga=(e,t,s)=>{var l;const{html:n}=t;(l=t.htmlElements)!=null||(t.htmlElements=new Set([...n[0],...n[1],...n[2]]));const r=e.split("<");let i=r.shift();for(const o of r){const u=Tl.exec(o),d=u==null?void 0:u[2],a=d==null?void 0:d.toLowerCase();if(!u||!t.htmlElements.has(a)){i+=`<${o}`;continue}const[,h,,g="",c,p]=u,{length:f}=s,m=new Ns(g,"html-attrs",a,t,s),S=m.hasAttr("itemprop");if(a==="meta"&&!(S&&m.hasAttr("content"))||a==="link"&&!(S&&m.hasAttr("href"))){i+=`<${o}`,s.length=f;continue}i+=`\0${s.length}x${p}`,new Ut(d,m,h==="/",c==="/>",t,s)}return i}}}),Cl,Fi,$l,xt,pa=$({"src/table/base.ts"(){"use strict";Cn(),W(),rt(),$n(),Cl=[Is(1)],xt=class extends($l=R){constructor(e,t,s,n,r,i=[],l){super(void 0,r,i,l),this.append(new Qe(t,"table-syntax",r,i),new Ns(n,"table-attrs",s,r,i))}escape(){}},Fi=X($l),xt=V(Fi,0,"TableBaseToken",Cl,xt),G(Fi,1,xt)}}),Il,Ri,Ne,ds,Et,Ft,As,fa=$({"src/table/td.ts"(){"use strict";q(),ue(),_n(),j(),W(),pa(),As=class extends(Ri=xt,Il=[Cs(!1)],Ri){constructor(e,t,s,n=[]){var o;let r=/\||\0\d+!\x7F/u.exec(t!=null?t:""),i=r?t.slice(0,r.index):"";/\[\[|-\{/u.test(i)&&(r=null,i=""),super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",i,s,n),G(ds,5,this),ze(this,Et),ze(this,Ne,""),r&&([fu(this,Ne)._]=r);const l=new R(t==null?void 0:t.slice(((o=r==null?void 0:r.index)!=null?o:NaN)+ce(this,Ne).length),s,n);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 Yi(this,Et,Ft).call(this).subtype}afterBuild(){ce(this,Ne).includes("\0")&&ke(this,Ne,this.buildFromStr(ce(this,Ne),0)),super.afterBuild()}toString(e){const{childNodes:[t,s,n]}=this;return t.toString(e)+s.toString(e)+ce(this,Ne)+n.toString(e)}text(){const{childNodes:[e,t,s]}=this;return e.text()+t.text()+ce(this,Ne)+s.text()}getGaps(e){return e===1?ce(this,Ne).length:0}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),n=new re(this,e+this.getRelativeIndex(this.length-1)),r="pipe-like",{lintConfig:i}=I,{computeEditInfo:l,fix:o}=i,u=["td","double"].map(d=>i.getSeverity(r,d));for(const d of this.lastChild.childNodes)if(d.type==="text"){const{data:a}=d;if(a.includes("|")){const h=a.includes("||"),g=u[h?1:0];if(g){const c=M(d,n,r,"pipe-in-table",g);if(l||o)if(h){const p={caption:"|+",td:"|",th:"!"}[this.subtype];c.fix=$e(c,"newline",a.replace(/\|\|/gu,`
16
16
  ${p}`))}else l&&(c.suggestions=[kn(c.startIndex,a)]);s.push(c)}}}return s}}isIndependent(){return this.firstChild.text().startsWith(`
17
- `)}getAttr(e){{const t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}}escape(){}print(){}json(e,t=this.getAbsoluteIndex()){}},ds=X(Ri),Ne=new WeakMap,Et=new WeakSet,Ft=function(){var e;const t=this.firstChild.text(),s=t.slice(-1);let i="td";if(s==="!"?i="th":s==="+"&&(i="caption"),this.isIndependent())return{subtype:i};const{previousSibling:r}=this;return he({},Yi(e=r,Et,Ft).call(e))},Ft=V(ds,17,"#getSyntax",Il,Et,Ft),xn(ds,As)}}),jn,ma=$({"src/table/trBase.ts"(){"use strict";q(),j(),pa(),fa(),jn=class extends xt{lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=this.childNodes.find(({type:o})=>o==="table-inter");if(!i)return s;const r=ms(i),n="fostered-content",l=r&&I.lintConfig.getSeverity(n,r===2?void 0:"transclusion");if(l){const o=M(i,{start:e},n,"content-outside-table",l);o.startIndex++,o.startLine++,o.startCol=0,s.push(o)}return s}}getRowCount(){return Number(this.childNodes.some(e=>e instanceof As&&e.isIndependent()&&!e.firstChild.text().endsWith("+")))}}}}),Nl,Ll,Oi,hs,bs,Ku=$({"src/table/index.ts"(){"use strict";q(),Te(),ue(),_n(),j(),ma(),rt(),Nl=class extends Array{},bs=class extends(Oi=jn,Ll=[Cs(!1)],Oi){constructor(e,t,s,i){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,"table",t,s,i,{}),G(hs,5,this)}get type(){return"table"}get closed(){return this.lastChild.is("table-syntax")}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new re(this,e),r=["unclosed-table","table-layout"],n=r.map(l=>I.lintConfig.getSeverity(l));if(n[0]&&!this.closed&&s.push(M(this.firstChild,i,r[0],"unclosed-table",n[0])),n[1]){const l=this.getLayout(),{length:o}=l;if(o>1){let u=1,d=1/0,a=0;for(;a<o;a++){const h=l[a],g=h.length;if(g<u)break;g<d&&(d=g);const c=h.indexOf(h[g-1])+1;if(c>d)break;c>u&&(u=c)}if(a<o){const h=this.getNthRow(a),g=M(h,i,r[1],"inconsistent-table",n[1]);g.startIndex++,g.startLine++,g.startCol=0,s.push(g)}}}return s}}close(e=`
18
- |}`,t){be.run(()=>{const s=new Qe(t?e:void 0,"table-syntax",this.getAttribute("config"),this.getAttribute("accum"));super.insertAt(s)})}getLayout(e){{const t=this.getAllRows(),{length:s}=t,i=Nl.from(tu(s,()=>[]));for(let r=0;r<i.length;r++){const n=i[r];let l=0,o=0,u;for(const d of t[r].childNodes.slice(2))if(d.is("td")){if(d.isIndependent()&&(u=d.subtype!=="caption"),u){const a={row:r,column:l},{rowspan:h,colspan:g}=d;for(l++;n[o];)o++;for(let c=r;c<Math.min(r+h,s);c++)for(let p=o;p<o+g;p++)i[c][p]=a;o+=g}}else if(Ya(d))break}return i}}getAllRows(){return[...super.getRowCount()?[this]:[],...this.childNodes.slice(1).filter(e=>e.is("tr")&&e.getRowCount()>0)]}getNthRow(e,t,s){{const i=super.getRowCount();if(e===0&&i)return this;i&&e--;for(const r of this.childNodes.slice(2)){const{type:n}=r;if(n==="tr"&&r.getRowCount()&&(e--,e<0))return r}return}}json(e,t=this.getAbsoluteIndex()){}},hs=X(Oi),V(hs,1,"getLayout",Ll,bs),xn(hs,bs)}}),xa,Yu=$({"src/table/tr.ts"(){"use strict";ma(),xa=class extends jn{get type(){return"tr"}constructor(e,t,s,i){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,e,"tr",t,s,i)}}}}),Pn,va=$({"src/nowiki/listBase.ts"(){"use strict";ot(),Pn=class extends Ie{get indent(){}json(e,t=this.getAbsoluteIndex()){}}}}),Bn,ba=$({"src/nowiki/dd.ts"(){"use strict";va(),Bn=class extends Pn{get type(){return"dd"}}}}),ya={};Z(ya,{parseTable:()=>wa});var El,ji,wa,Zu=$({"parser/table.ts"(){"use strict";W(),Ku(),Yu(),fa(),ba(),El=e=>e.lastChild.constructor!==R,ji=(e,t)=>e.is("td")?t.pop():e,wa=({firstChild:{data:e},type:t,name:s},i,r)=>{const n=[],l=e.split(`
17
+ `)}getAttr(e){{const t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}}escape(){}print(){}json(e,t=this.getAbsoluteIndex()){}},ds=X(Ri),Ne=new WeakMap,Et=new WeakSet,Ft=function(){var e;const t=this.firstChild.text(),s=t.slice(-1);let n="td";if(s==="!"?n="th":s==="+"&&(n="caption"),this.isIndependent())return{subtype:n};const{previousSibling:r}=this;return he({},Yi(e=r,Et,Ft).call(e))},Ft=V(ds,17,"#getSyntax",Il,Et,Ft),xn(ds,As)}}),jn,ma=$({"src/table/trBase.ts"(){"use strict";q(),j(),pa(),fa(),jn=class extends xt{lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),n=this.childNodes.find(({type:o})=>o==="table-inter");if(!n)return s;const r=ms(n),i="fostered-content",l=r&&I.lintConfig.getSeverity(i,r===2?void 0:"transclusion");if(l){const o=M(n,{start:e},i,"content-outside-table",l);o.startIndex++,o.startLine++,o.startCol=0,s.push(o)}return s}}getRowCount(){return Number(this.childNodes.some(e=>e instanceof As&&e.isIndependent()&&!e.firstChild.text().endsWith("+")))}}}}),Nl,Ll,Oi,hs,bs,Ku=$({"src/table/index.ts"(){"use strict";q(),Te(),ue(),_n(),j(),ma(),rt(),Nl=class extends Array{},bs=class extends(Oi=jn,Ll=[Cs(!1)],Oi){constructor(e,t,s,n){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,"table",t,s,n,{}),G(hs,5,this)}get type(){return"table"}get closed(){return this.lastChild.is("table-syntax")}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),n=new re(this,e),r=["unclosed-table","table-layout"],i=r.map(l=>I.lintConfig.getSeverity(l));if(i[0]&&!this.closed&&s.push(M(this.firstChild,n,r[0],"unclosed-table",i[0])),i[1]){const l=this.getLayout(),{length:o}=l;if(o>1){let u=1,d=1/0,a=0;for(;a<o;a++){const h=l[a],g=h.length;if(g<u)break;g<d&&(d=g);const c=h.indexOf(h[g-1])+1;if(c>d)break;c>u&&(u=c)}if(a<o){const h=this.getNthRow(a),g=M(h,n,r[1],"inconsistent-table",i[1]);g.startIndex++,g.startLine++,g.startCol=0,s.push(g)}}}return s}}close(e=`
18
+ |}`,t){be.run(()=>{const s=new Qe(t?e:void 0,"table-syntax",this.getAttribute("config"),this.getAttribute("accum"));super.insertAt(s)})}getLayout(e){{const t=this.getAllRows(),{length:s}=t,n=Nl.from(tu(s,()=>[]));for(let r=0;r<n.length;r++){const i=n[r];let l=0,o=0,u;for(const d of t[r].childNodes.slice(2))if(d.is("td")){if(d.isIndependent()&&(u=d.subtype!=="caption"),u){const a={row:r,column:l},{rowspan:h,colspan:g}=d;for(l++;i[o];)o++;for(let c=r;c<Math.min(r+h,s);c++)for(let p=o;p<o+g;p++)n[c][p]=a;o+=g}}else if(Ya(d))break}return n}}getAllRows(){return[...super.getRowCount()?[this]:[],...this.childNodes.slice(1).filter(e=>e.is("tr")&&e.getRowCount()>0)]}getNthRow(e,t,s){{const n=super.getRowCount();if(e===0&&n)return this;n&&e--;for(const r of this.childNodes.slice(2)){const{type:i}=r;if(i==="tr"&&r.getRowCount()&&(e--,e<0))return r}return}}json(e,t=this.getAbsoluteIndex()){}},hs=X(Oi),V(hs,1,"getLayout",Ll,bs),xn(hs,bs)}}),xa,Yu=$({"src/table/tr.ts"(){"use strict";ma(),xa=class extends jn{get type(){return"tr"}constructor(e,t,s,n){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,e,"tr",t,s,n)}}}}),Pn,va=$({"src/nowiki/listBase.ts"(){"use strict";ot(),Pn=class extends Ie{get indent(){}json(e,t=this.getAbsoluteIndex()){}}}}),Bn,ba=$({"src/nowiki/dd.ts"(){"use strict";va(),Bn=class extends Pn{get type(){return"dd"}}}}),ya={};Z(ya,{parseTable:()=>wa});var El,ji,wa,Zu=$({"parser/table.ts"(){"use strict";W(),Ku(),Yu(),fa(),ba(),El=e=>e.lastChild.constructor!==R,ji=(e,t)=>e.is("td")?t.pop():e,wa=({firstChild:{data:e},type:t,name:s},n,r)=>{const i=[],l=e.split(`
19
19
  `);let o=t==="root"||t==="parameter-value"||t==="ext-inner"&&s==="poem"?"":`
20
- ${l.shift()}`,u;const d=(a,h)=>{if(!h){o+=a;return}const{lastChild:g}=h;if(El(h)){const c=new R(a,i,r);c.type="table-inter",c.setAttribute("stage",3),h.insertAt(c)}else g.setText(g.toString()+a)};for(const a of l){u=n.pop();const[h]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(a),g=a.slice(h.length),c=/^(:*)((?:\s|\0\d+[cn]\x7F)*)(\{\||\{(?:\0\d+[cn]\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(g);if(c){for(;u&&!u.is("td");)u=n.pop();const[,w,v,k,y]=c;w&&new Bn(w,i,r),d(`
21
- ${h}${w&&`\0${r.length-1}d`}${v}\0${r.length}b`,u),n.push(...u?[u]:[],new bs(k,y,i,r));continue}else if(!u){o+=`
20
+ ${l.shift()}`,u;const d=(a,h)=>{if(!h){o+=a;return}const{lastChild:g}=h;if(El(h)){const c=new R(a,n,r);c.type="table-inter",c.setAttribute("stage",3),h.insertAt(c)}else g.setText(g.toString()+a)};for(const a of l){u=i.pop();const[h]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(a),g=a.slice(h.length),c=/^(:*)((?:\s|\0\d+[cn]\x7F)*)(\{\||\{(?:\0\d+[cn]\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(g);if(c){for(;u&&!u.is("td");)u=i.pop();const[,w,v,A,y]=c;w&&new Bn(w,n,r),d(`
21
+ ${h}${w&&`\0${r.length-1}d`}${v}\0${r.length}b`,u),i.push(...u?[u]:[],new bs(A,y,n,r));continue}else if(!u){o+=`
22
22
  ${a}`;continue}const p=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(g);if(!p){d(`
23
- ${a}`,u),n.push(u);continue}const[,f,m,S,A]=p;if(f){for(;!u.is("table");)u=n.pop();u.close(`
24
- ${h}${f}`,!0),d(A,n[n.length-1])}else if(m){u=ji(u,n),u.is("tr")&&(u=n.pop());const w=new xa(`
25
- ${h}${m}`,A,i,r);n.push(u,w),u.insertAt(w)}else{u=ji(u,n);const w=S==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu;let v=w.exec(A),k=0,y=`
26
- ${h}${S}`;const C=x=>{const _=new As(y,A.slice(k,v==null?void 0:v.index),i,r);return x.insertAt(_),_};for(;v;)C(u),{lastIndex:k}=w,[y]=v,v=w.exec(A);n.push(u,C(u))}}return o.slice(1)}}}),Dt,ed=$({"../cm-util/dist/index.mjs"(){"use strict";Dt=e=>!/^_{2}.+_{2}$/u.test(e)}}),Sa,td=$({"src/nowiki/hr.ts"(){"use strict";ot(),Sa=class extends Ie{get type(){return"hr"}}}}),Fl,Pi,Rl,Ht,sd=$({"src/nowiki/doubleUnderscore.ts"(){"use strict";var e,t;nt(),We(),ot(),Fl=[Ve(),Fe("__")],Ht=(t=class extends(Rl=Ie){constructor(i,r,n,l,o){var h,g;super(i,l,o);L(this,e);const u=i.toLowerCase(),{doubleUnderscore:[,,d,a]}=l;this.setAttribute("name",(g=r?(h=a==null?void 0:a[i])==null?void 0:h.toLowerCase():d==null?void 0:d[u])!=null?g:u),E(this,e,n)}get type(){return"double-underscore"}toString(){const i=b(this,e)?"__":"__";return i+this.innerText+i}print(){}},e=new WeakMap,t),Pi=X(Rl),Ht=V(Pi,0,"DoubleUnderscoreToken",Fl,Ht),G(Pi,1,Ht)}}),ka={};Z(ka,{parseHrAndDoubleUnderscore:()=>Aa});var Aa,id=$({"parser/hrAndDoubleUnderscore.ts"(){"use strict";ed(),td(),sd(),Oo(),Aa=({firstChild:{data:e},type:t,name:s},i,r)=>{var d,a,h;const{doubleUnderscore:[n,l,o]}=i,u=[...n,...l];return(d=i.insensitiveDoubleUnderscore)!=null||(i.insensitiveDoubleUnderscore=new Set(n.filter(Dt))),(a=i.sensitiveDoubleUnderscore)!=null||(i.sensitiveDoubleUnderscore=new Set(l.filter(Dt))),(h=i.regexHrAndDoubleUnderscore)!=null||(i.regexHrAndDoubleUnderscore=new RegExp(String.raw`^((?:\0\d+[cno]\x7F)*)(-{4,})|__(${u.filter(Dt).join("|")})__|_{2}(${u.filter(g=>!Dt(g)).map(g=>g.slice(2,-2)).join("|")})_{2}`,"gimu")),t!=="root"&&(t!=="ext-inner"||s!=="poem")&&(e=`\0${e}`),e=e.replace(i.regexHrAndDoubleUnderscore,(g,c,p,f,m)=>{var k;if(p)return new Sa(p,i,r),`${c}\0${r.length-1}r`;const S=f!=null?f:m,A=i.sensitiveDoubleUnderscore.has(S),w=S.toLowerCase(),v=i.insensitiveDoubleUnderscore.has(w);return A||v?(new Ht(S,A,!!m,i,r),`\0${r.length-1}${v&&((k=o==null?void 0:o[w])!=null?k:w)==="toc"?"u":"n"}`):g}),i.excludes.includes("heading")||(e=e.replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(g,c,p,f,m)=>{const S=`${c}\0${r.length}h`;return new ht(p.length,[f,m],i,r),S})),t==="root"||t==="ext-inner"&&s==="poem"?e:e.slice(1)}}}),_a,nd=$({"src/nowiki/quote.ts"(){"use strict";var e,t;q(),ue(),j(),ot(),_a=(t=class extends Ie{constructor(i,r,n,l){super(i,n,l);L(this,e);E(this,e,r)}get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}get closing(){return he(he({},this.bold?{bold:b(this,e).bold}:void 0),this.italic?{italic:b(this,e).italic}:void 0)}text(){const{parentNode:i,innerText:r}=this;return i!=null&&i.is("image-parameter")&&i.name!=="caption"?"":r}lint(i=this.getAbsoluteIndex()){{const{previousSibling:r,bold:n,closing:l}=this,o=(r==null?void 0:r.type)==="text"?r.data:void 0,u=[],d=new re(this,i),a=["lonely-apos","bold-header"],{lintConfig:h}=I,{computeEditInfo:g}=h,c=[void 0,"word"].map(f=>h.getSeverity(a[0],f)),p=h.getSeverity(a[1]);if(o!=null&&o.endsWith("'")){const f=c[(l.bold||l.italic)&&/[a-z\d]'$/iu.test(o)?1:0];if(f){const m=B(this,d,a[0],I.msg("lonely","'"),f),{startLine:S,startCol:A}=m,[,{length:w}]=/(?:^|[^'])('+)$/u.exec(o),v=i-w,k=je(he({},m),{startIndex:v,endIndex:i,endLine:S,startCol:A-w,endCol:A});g&&(k.suggestions=[St(v,"&apos;",w),D(k)]),u.push(k)}}if(p&&n&&this.isInside("heading-title")){const f=B(this,d,a[1],"bold-in-header",p);g&&(f.suggestions=[D(f)]),u.push(f)}return u}}json(i,r=this.getAbsoluteIndex()){}},e=new WeakMap,t)}}),Ta={};Z(Ta,{parseQuotes:()=>Wn});var Wn,Ca=$({"parser/quotes.ts"(){"use strict";nd(),Wn=(e,t,s,i)=>{var c;const r=e.split(/('{2,})/u),{length:n}=r;if(n===1)return e;let l=0,o=0,u,d,a;for(let p=1;p<n;p+=2){const f=r[p].length;switch(f){case 2:o++;break;case 4:r[p-1]+="'",r[p]="'''";case 3:if(l++,u!==void 0)break;r[p-1].endsWith(" ")?d===void 0&&a===void 0&&(a=p):r[p-1].slice(-2,-1)===" "?u=p:d!=null||(d=p);break;default:r[p-1]+="'".repeat(f-5),r[p]="'''''",o++,l++}}if(o%2===1&&l%2===1){const p=(c=u!=null?u:d)!=null?c:a;p!==void 0&&(r[p]="''",r[p-1]+="'")}let h=!1,g=!1;for(let p=1;p<n;p+=2){const f=r[p].length,m=f!==2,S=f!==3,A=new _a(r[p],{bold:m&&!!h,italic:S&&!!g},t,s);m&&(h=!h&&A),S&&(g=!g&&A),r[p]=`\0${s.length-1}q`}return r.join("")}}}),$a={};Z($a,{parseExternalLinks:()=>qn});var qn,Ia=$({"parser/externalLinks.ts"(){"use strict";de(),Yo(),Rn(),qn=(e,t,s,i)=>{var r;return(r=t.regexExternalLinks)!=null||(t.regexExternalLinks=new RegExp(String.raw`\[((?:\0\d+[cn]\x7F)*(?:\0\d+f\x7F|(?:(?:${t.protocol}|//)${bt}|\0\d+m\x7F)${yt}(?=[[\]<>"\t${De}]|\0\d)))([${De}]*(?![${De}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),e.replace(t.regexExternalLinks,(n,l,o,u)=>{const{length:d}=s,a=/&[lg]t;/u.exec(l);return a&&(o="",u=l.slice(a.index)+o+u,l=l.slice(0,a.index)),i?(new Xt(l,"ext-link-url",t,s),`[\0${d}f${o}${u}]`):(new pt(l,o,u,t,s),`\0${d}w`)})}}}),Na,rd=$({"src/link/category.ts"(){"use strict";Kt(),Na=class extends Be{get type(){return"category"}get sortkey(){}json(e,t=this.getAbsoluteIndex()){}}}}),La={};Z(La,{parseLinks:()=>gn});var Ol,gn,ld=$({"parser/links.ts"(){"use strict";de(),j(),Ca(),Ia(),Ko(),Ho(),rd(),Ol=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,gn=(e,t,s,i,r)=>{var u;(u=t.regexLinks)!=null||(t.regexLinks=new RegExp(String.raw`^\s*(?:${t.protocol}|//)`,"iu"));const n=t.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]]))?\]\]([\s\S]*)$/u:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])*)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]])?)?\]\]([\s\S]*)$/u,l=e.split("[[");let o=l.shift();for(let d=0;d<l.length;d++){let a=!1,h,g,c,p;const f=l[d],m=n.exec(f);if(m)[,h,g,c,p]=m,p.startsWith("]")&&(c!=null&&c.includes("["))&&(c+="]",p=p.slice(1));else{const y=Ol.exec(f);y&&(a=!0,[,h,g,c]=y)}if(h===void 0||t.regexLinks.test(h)||/\0\d+[exhbru]\x7F/u.test(h)){o+=`[[${f}`;continue}let S=fe(h).trim();const A=S.startsWith(":");if(A&&a){o+=`[[${f}`;continue}else!S&&c&&!c.includes(`
27
- `)&&(S=fe(c).trim());const{ns:w,valid:v}=I.normalizeTitle(S,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0,page:i});if(v){if(a){if(w!==6){o+=`[[${f}`;continue}let y=!1;for(d++;d<l.length;d++){const C=l[d],x=C.split("]]");if(x.length>2){y=!0,c+=`[[${x[0]}]]${x[1]}`,p=x.slice(2).join("]]");break}else if(x.length===2)c+=`[[${x[0]}]]${x[1]}`;else{c+=`[[${C}`;break}}if(c=gn(c,t,s,i,r),!y){o+=`[[${h}${g}${c}`;continue}}}else{o+=`[[${f}`;continue}c&&(c=Wn(c,t,s,r));let k=Fn;A||(w===6?(c&&(c=qn(c,t,s,!0)),k=En):w===14&&(k=Na)),c===void 0&&g&&(c=""),o+=`\0${s.length}l${p}`,new k(h,c,t,s,g)}return o}}}),Ea={};Z(Ea,{parseMagicLinks:()=>Fa});var Bi,Wi,qi,Mi,Fa,od=$({"parser/magicLinks.ts"(){"use strict";de(),Rn(),Bi=String.raw`[${De}\t]|&nbsp;|&#0*160;|&#x0*a0;`,Wi=`(?:${Bi})+`,qi=`(?:${Bi}|-)`,Mi=String.raw`(?:RFC|PMID)${Wi}\d+\b|ISBN${Wi}(?:97[89]${qi}?)?(?:\d${qi}?){9}[\dx]\b`,Fa=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${bt}${yt})|${Mi})`,"giu")}catch(i){t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${bt}${yt})|${Mi})`,"giu")}return e.replace(t.regexMagicLinks,(i,r,n)=>{let l=r?i.slice(r.length):i;if(n){let o="";const u=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(l);u&&(o=l.slice(u.index),l=l.slice(0,u.index));const d=l.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,a=d.exec(l);if(a){let h=1;a[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(l.slice(0,a.index))&&(h=2),o=l.slice(a.index+h)+o,l=l.slice(0,a.index+h)}return o.length>=n.length?i:(new Xt(l,void 0,t,s),`${r}\0${s.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(l))return i;return new Xt(l,"magic-link",t,s),`${r}\0${s.length-1}i`})}}}),Ra,ad=$({"util/html.ts"(){"use strict";Ra=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,i)=>s!==e[i])}}),jl,Oa,ud=$({"src/nowiki/list.ts"(){"use strict";q(),j(),va(),jl=new Set(["link","category","file"]),Oa=class extends Pn{get type(){return"list"}lint(e=this.getAbsoluteIndex()){var t;{const s="syntax-like",i=I.lintConfig.getSeverity(s,"redirect"),{innerText:r}=this;if(i&&r==="#"){let{nextSibling:n}=this;if((n==null?void 0:n.type)==="text"&&jl.has((t=n.nextSibling)==null?void 0:t.type)&&new RegExp(String.raw`^(?:${this.getAttribute("config").redirection.join("|")})\s*(?::\s*)?$`,"iu").test(`#${n.data}`)){const o=B(n,{start:e+1},s,"redirect-like",i);return o.startIndex--,o.startCol--,o.endIndex+=2,o.endCol+=2,[o]}}return[]}}}}}),ja={};Z(ja,{parseList:()=>Pa});var Pa,dd=$({"parser/list.ts"(){"use strict";ad(),ud(),ba(),Pa=(e,t,s,i)=>{const r=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!r)return t.lastPrefix="",e;const[n,l,o,u]=r,d=o.replace(/;/gu,":"),a=Ra(d,t.lastPrefix),h=((a>1?o.slice(a-1):o)+u).split(/(?=;)/u),g=h[0].startsWith(";");let c=h.length-(g?0:1);if(a>1){const T=o.slice(0,a-1);if(g){const N=T.split(/(?=;)/u);h.unshift(...N),c+=T.includes(";")?N.length:0}else h[0]=T+h[0]}t.lastPrefix=d;let p=l+h.map((T,N)=>`\0${i.length+N}d`).join("")+e.slice(n.length);for(const T of h)new Oa(T,s,i);if(!c)return p;const{html:[f,,m]}=s,S=/:+|-\{|\0\d+[xq]\x7F/gu;let A=S,w=A.exec(p),v=0,k=!1,y=!1,C=0;const x=(T,N)=>(new Bn(T,s,i),`${p.slice(0,N)}\0${i.length-1}d${p.slice(N+T.length)}`),_=T=>{T?v&&v--:v++};for(;w&&c;){const{0:T,index:N}=w;if(T==="-{"){if(!C){const{lastIndex:F}=A;A=/-\{|\}-/gu,A.lastIndex=F}C++}else if(T==="}-"){if(C--,!C){const{lastIndex:F}=A;A=S,A.lastIndex=F}}else if(T.endsWith("x")){const{name:F,closing:Q,selfClosing:z}=i[Number(T.slice(1,-2))];(f.includes(F)||!z&&!m.includes(F))&&_(Q)}else if(T.endsWith("q")){const{bold:F,italic:Q}=i[Number(T.slice(1,-2))];F&&(_(k),k=!k),Q&&(_(y),y=!y)}else if(v===0){if(T.length>=c)return x(T.slice(0,c),N);c-=T.length,A.lastIndex=N+4+String(i.length).length,p=x(T,N)}w=A.exec(p)}return p}}}),zi,Pl,Ui,Bl,Gt,hd=$({"src/converterFlags.ts"(){"use strict";var e,t;q(),ue(),$s(),ye(),j(),W(),lt(),zi=new Set(["A","T","R","D","-","H","N"]),Pl=[Yt(),me],Gt=(t=class extends(Bl=R){constructor(i,r,n=[]){super(void 0,r,n,{});L(this,e);this.safeAppend(i.map(l=>new Le(l,"converter-flag",r,n)))}get type(){return"converter-flags"}afterBuild(){E(this,e,this.childNodes.map(i=>i.text().trim())),super.afterBuild()}toString(i){return super.toString(i,";")}text(){return super.text(";")}getUnknownFlags(){return new Set(b(this,e).filter(i=>/\{{3}[^{}]+\}{3}/u.test(i)))}getVariantFlags(){const i=new Set(this.getAttribute("config").variants);return new Set(b(this,e).filter(r=>i.has(r)))}isInvalidFlag(i,r,n,l){return!!i&&!r.has(i)&&!n.has(i)&&(r.size>0||!l.has(i))}lint(i=this.getAbsoluteIndex(),r){{const n=this.getVariantFlags(),l=this.getUnknownFlags(),o=new Set(b(this,e).filter(m=>zi.has(m))),u=b(this,e).filter(m=>!m).length,d=b(this,e).length-l.size-u,{lintConfig:a}=I,{computeEditInfo:h,fix:g}=a,c=super.lint(i,r);if(n.size===d||o.size===d)return c;const p="no-ignored",f=a.getSeverity(p,"conversionFlag");if(f){const m=new re(this,i);for(let S=0;S<this.length;S++){const A=this.childNodes[S],w=A.text().trim();if(this.isInvalidFlag(w,n,l,o)){const v=M(A,m,p,"invalid-conversion-flag",f);(h||g)&&(n.size===0&&zi.has(w.toUpperCase())?v.fix=Sn(v,w):h&&(v.suggestions=[D(v,S&&-1)])),c.push(v)}}}return c}}print(){}},e=new WeakMap,t),Ui=X(Bl),Gt=V(Ui,0,"ConverterFlagsToken",Pl,Gt),G(Ui,1,Gt)}}),cs,Wl,Di,ql,et,cd=$({"src/converterRule.ts"(){"use strict";Ee(),ye(),j(),W(),lt(),cs=(e,t,s,i)=>{const r=new R(e,s,i);return r.type=`converter-rule-${t}`,r.setAttribute("stage",ve),r},Wl=[me],et=class extends(ql=R){get type(){return"converter-rule"}get variant(){}constructor(e,t=!0,s=I.getConfig(),i=[]){super(void 0,s,i,{});const r=e.indexOf(":"),n=e.slice(0,r).indexOf("=>"),l=n===-1?e.slice(0,r):e.slice(n+2,r);t&&s.variants.includes(l.trim().toLowerCase())?(super.insertAt(new Le(l,"converter-rule-variant",s,i)),super.insertAt(cs(e.slice(r+1),"to",s,i)),n!==-1&&super.insertAt(cs(e.slice(0,n),"from",s,i),0)):super.insertAt(cs(e,"to",s,i))}toString(e){const{childNodes:t,firstChild:s,lastChild:i}=this;return t.length===3?`${s.toString(e)}=>${t[1].toString(e)}:${i.toString(e)}`:super.toString(e,":")}text(){const{childNodes:e,firstChild:t,lastChild:s}=this;return e.length===3?`${t.text()}=>${e[1].text()}:${s.text()}`:super.text(":")}getGaps(e){return e===0&&this.length===3?2:1}print(){}json(e,t=this.getAbsoluteIndex()){}},Di=X(ql),et=V(Di,0,"ConverterRuleToken",Wl,et),G(Di,1,et)}}),Ml,Hi,zl,Vt,gd=$({"src/converter.ts"(){"use strict";de(),We(),ye(),W(),hd(),cd(),Ml=[me,Fe("-{")],Vt=class extends(zl=R){get type(){return"converter"}constructor(e,t,s,i=[]){super(void 0,s,i),this.insertAt(new Gt(e,s,i));const[r]=t,n=r.includes(":"),l=new et(r,n,s,i);(n?l.length===1:t.length===2&&!fe(t[1]).trim())?this.insertAt(new et(t.join(";"),!1,s,i)):this.safeAppend([l,...t.slice(1).map(o=>new et(o,!0,s,i))])}toString(e){const{childNodes:[t,...s]}=this;return`-{${t.toString(e)}${t.length>0?"|":""}${s.map(i=>i.toString(e)).join(";")}}-`}text(){const{childNodes:[e,...t]}=this;return`-{${e.text()}|${it(t,";")}}-`}getGaps(e){return e||this.firstChild.length>0?1:0}print(){}},Hi=X(zl),Vt=V(Hi,0,"ConverterToken",Ml,Vt),G(Hi,1,Vt)}}),Ba={};Z(Ba,{parseConverter:()=>Wa});var Wa,pd=$({"parser/converter.ts"(){"use strict";gd(),Wa=(e,t,s)=>{var u;(u=t.regexConverter)!=null||(t.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${t.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"iu"));const i=/-\{/gu,r=/-\{|\}-/gu,n=[];let l=i,o=l.exec(e);for(;o;){const{0:d,index:a}=o;if(d==="}-"){const h=n.pop(),{length:g}=s,c=e.slice(h.index+2,a),p=c.indexOf("|"),[f,m]=p===-1?[[],c]:[c.slice(0,p).split(";"),c.slice(p+1)],S=m.replace(/(&[#a-z\d]+);/giu,"$1"),A=S.split(t.regexConverter).map(w=>w.replace(/\x01/gu,";"));new Vt(f,A,t,s),e=`${e.slice(0,h.index)}\0${g}v${e.slice(a+2)}`,n.length===0&&(l=i),l.lastIndex=h.index+3+String(g).length}else n.push(o),l=r,l.lastIndex=a+2;o=l.exec(e)}return e}}}),_s={};Z(_s,{Token:()=>R});var Ul,R,W=$({"src/index.ts"(){"use strict";var e,t,s,i,r,n,l,o,u,qa,Ma,za,Ua,Da,Ha,Ga,Va,Qa,Ja,Xa,Ka,k;de(),Ee(),q(),Te(),j(),Su(),ku(),Ul=["category","html-attr#id,ext-attr#id,table-attr#id"],R=(k=class extends Ot{constructor(x,_=I.getConfig(),T=[],N){super();L(this,u);L(this,e,"plain");L(this,t,0);L(this,s);L(this,i);L(this,r);L(this,n,!1);L(this,l);L(this,o);typeof x=="string"&&this.insertAt(x),E(this,s,_),E(this,i,T),T.push(this)}get type(){return b(this,e)}set type(x){E(this,e,x)}get pageName(){return b(this.getRootNode(),o)}set pageName(x){if(x){const _=this.normalizeTitle(x,0,{temporary:!0,page:""});E(this,o,_.valid?_.title:void 0)}else E(this,o,x===""?"":void 0)}parseOnce(x=b(this,t),_=!1,T){if(x<b(this,t)||this.length!==1||!this.isPlain())return this;if(b(this,t)>=ve)return this;switch(x){case 0:if(this.type==="root"){b(this,i).pop();const N=P(this,u,qa).call(this);_&&(_=!N)}E(this,r,_),P(this,u,Ma).call(this,_);break;case 1:P(this,u,za).call(this);break;case 2:P(this,u,Ua).call(this);break;case 3:P(this,u,Da).call(this);break;case 4:P(this,u,Ha).call(this);break;case 5:P(this,u,Ga).call(this,T);break;case 6:P(this,u,Va).call(this,T);break;case 7:P(this,u,Qa).call(this);break;case 8:P(this,u,Ja).call(this);break;case 9:P(this,u,Xa).call(this);break;case 10:P(this,u,Ka).call(this)}if(this.type==="root")for(const N of b(this,i))N==null||N.parseOnce(x,_,T);return Xn(this,t)._++,this}buildFromStr(x,_){const T=x.split(/[\0\x7F]/u).map((N,F)=>{if(F%2===0)return N&&new nn(N);const Q=Number(N.slice(0,-1));return b(this,i)[Q]}).filter(N=>N!=="");return _===0?T.map(String).join(""):_===1?it(T):T}build(){E(this,t,ve);const{length:x,firstChild:_}=this,T=_==null?void 0:_.toString();if(x===1&&_.type==="text"&&T.includes("\0")&&(Mn(this,0,1,this.buildFromStr(T)),this.type==="root"))for(const N of b(this,i))N==null||N.build()}afterBuild(){if(this.type==="root")for(const x of b(this,i))x==null||x.afterBuild();E(this,n,!0)}parse(x=ve,_,T){for(x=Math.min(x,ve);b(this,t)<x;)this.parseOnce(b(this,t),_,T);return x&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===k}getAttribute(x){var _;switch(x){case"config":return b(this,s);case"include":return(_=b(this,r))!=null?_:!!b(this.getRootNode(),r);case"accum":return b(this,i);case"built":return b(this,n);case"stage":return b(this,t);case"invalid":default:return super.getAttribute(x)}}setAttribute(x,_){switch(x){case"stage":b(this,t)===0&&this.type==="root"&&b(this,i).shift(),E(this,t,_);break;default:super.setAttribute(x,_)}}insertAt(x,_=this.length){const T=typeof x=="string"?new nn(x):x,{length:N}=this;_+=_<0?N:0,super.insertAt(T,_);const{type:F}=T;return F==="root"&&(T.type="plain"),T}normalizeTitle(x,_=0,T){return I.normalizeTitle(x,_,this.getAttribute("include"),b(this,s),he({page:this.pageName},T))}inTableAttrs(){var x;return this.isInside("table-attrs")&&((x=this.closest("table-attrs,arg,parameter"))!=null&&x.is("table-attrs")?2:1)}inHtmlAttrs(){return this.isInside("html-attrs")?2:this.inTableAttrs()}lint(x=this.getAbsoluteIndex(),_){var T;{const{lintConfig:N}=I,{computeEditInfo:F,fix:Q,ignoreDisables:z,configurationComment:U}=N;let O=super.lint(x,_);if(this.type==="root"){const pe=new Map,ge="no-duplicate",we=["category","id"].map(H=>N.getSeverity(ge,H)),K=this.toString(),Re=Ul.filter((H,le)=>we[le]).join();if(Re){for(const H of this.querySelectorAll(Re)){let le;if(H.is("category"))le=H.name;else{const ee=H.getValue();ee&&ee!==!0&&(le=`#${ee}`)}if(le){const ee=pe.get(le);ee?ee.add(H):pe.set(le,new Set([H]))}}for(const[H,le]of pe)if(le.size>1&&!H.startsWith("#mw-customcollapsible-")){const ee=!H.startsWith("#"),te=`duplicate-${ee?"category":"id"}`,ne=we[ee?0:1];O.push(...[...le].map(ae=>{const Y=B(ae,{start:ae.getAbsoluteIndex()},ge,te,ne);return F&&ee&&(Y.suggestions=[D(Y)]),Y}))}}if(!z){const H=new RegExp(String.raw`<!--\s*${U}-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->`,"gu"),le=[];let ee=H.exec(K);for(;ee;){const{1:te,index:ne}=ee,ae=(T=ee[2])==null?void 0:T.trim();let Y;(te==="disable-line"||te==="disable-next-line")&&(Y=this.posFromIndex(ne).top+(te==="disable-line"?0:1)),le.push({line:Y,from:te==="disable"?H.lastIndex:void 0,to:te==="enable"?H.lastIndex:void 0,rules:ae?new Set(ae.split(",").map(se=>se.trim())):void 0}),ee=H.exec(K)}O=O.filter(({rule:te,startLine:ne,startIndex:ae})=>{const Y={pos:0};for(const{line:se,from:xe,to:qe,rules:Je}of le){if(se&&se>ne+1)break;if(Je&&!Je.has(te))continue;if(se===ne)return!1;xe<=ae&&xe>Y.pos?(Y.pos=xe,Y.type="from"):qe<=ae&&qe>Y.pos&&(Y.pos=qe,Y.type="to")}return Y.type!=="from"})}if(Q&&O.some(({fix:H})=>H)){const H=O.map(({fix:te})=>te).filter(te=>te!==void 0).sort(({range:[te,ne]},{range:[ae,Y]})=>ne===Y?ae-te:Y-ne);let le=1/0,ee=K;for(const{range:[te,ne],text:ae}of H)ne<=le&&(ee=ee.slice(0,te)+ae+ee.slice(ne),le=te);Object.assign(O,{output:ee})}if(!F)for(const H of O)delete H.fix,delete H.suggestions}return O}}toString(x,_){return x?super.toString(!0,_):tt(b(this,l),()=>super.toString(!1,_),T=>{const N=this.getRootNode();N.type==="root"&&b(N,n)&&E(this,l,T)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakMap,l=new WeakMap,o=new WeakMap,u=new WeakSet,qa=function(){const{parseRedirect:x}=(Tu(),J(yo)),_=this.firstChild.toString(),T=x(_,b(this,s),b(this,i));return T!==!1&&this.setText(T),!!T},Ma=function(x){const{parseCommentAndExt:_}=(Fs(),J(ha));this.setText(_(this.firstChild.toString(),b(this,s),b(this,i),x))},za=function(){const{parseBraces:x}=(Ln(),J(Bo)),_=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,T=x(_,b(this,s),b(this,i));this.setText(this.type==="root"?T:T.slice(1))},Ua=function(){if(b(this,s).excludes.includes("html"))return;const{parseHtml:x}=(Xu(),J(ca));this.setText(x(this.firstChild.toString(),b(this,s),b(this,i)))},Da=function(){if(b(this,s).excludes.includes("table"))return;const{parseTable:x}=(Zu(),J(ya));this.setText(x(this,b(this,s),b(this,i)))},Ha=function(){if(b(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:x}=(id(),J(ka));this.setText(x(this,b(this,s),b(this,i)))},Ga=function(x){const{parseLinks:_}=(ld(),J(La));this.setText(_(this.firstChild.toString(),b(this,s),b(this,i),this.pageName,x))},Va=function(x){const{parseQuotes:_}=(Ca(),J(Ta)),T=this.firstChild.toString().split(`
28
- `);for(let N=0;N<T.length;N++)T[N]=_(T[N],b(this,s),b(this,i),x);this.setText(T.join(`
29
- `))},Qa=function(){const{parseExternalLinks:x}=(Ia(),J($a));this.setText(x(this.firstChild.toString(),b(this,s),b(this,i)))},Ja=function(){const{parseMagicLinks:x}=(od(),J(Ea));this.setText(x(this.firstChild.toString(),b(this,s),b(this,i)))},Xa=function(){if(b(this,s).excludes.includes("list"))return;const{parseList:x}=(dd(),J(ja)),{firstChild:_,type:T,name:N}=this,F=_.toString().split(`
30
- `),Q={lastPrefix:""};let z=T==="root"||T==="ext-inner"&&N==="poem"?0:1;for(;z<F.length;z++)F[z]=x(F[z],Q,b(this,s),b(this,i));this.setText(F.join(`
31
- `))},Ka=function(){if(b(this,s).variants.length>0){const{parseConverter:x}=(pd(),J(Ba));this.setText(x(this.firstChild.toString(),b(this,s),b(this,i)))}},k)}}),be,Rs,Ya,Za,Mn,eu,tu,Te=$({"util/debug.ts"(){"use strict";be={running:!1,run(e,t){const{running:s}=this;this.running=!0;const i=t==null?void 0:t.internal;t&&(t.internal=!0);const r=()=>{this.running=s,t&&(t.internal=i)};try{const{Token:n}=(W(),J(_s)),l=e();return l instanceof n&&!l.getAttribute("built")&&l.afterBuild(),r(),l}catch(n){throw r(),n}},internal(e,t){const{internal:s}=t;t.internal=!0;const i=e();return t.internal=s,i},rev:0},Rs=e=>t=>t.type===e,Ya=({type:e})=>e==="tr"||e==="table-syntax",Za=e=>e==="redirect-target"||e==="link",Mn=(e,t,s,i=[])=>{var l,o;let r=e.getChildNodes(),n;r.length===s?(n=r,r=i):n=Array.prototype.splice.apply(r,[t,s,...i]);for(let u=0;u<i.length;u++){const d=i[u];d.setAttribute("parentNode",e),d.setAttribute("nextSibling",r[t+u+1]),d.setAttribute("previousSibling",r[t+u-1])}return(l=r[t-1])==null||l.setAttribute("nextSibling",r[t]),(o=r[t+i.length])==null||o.setAttribute("previousSibling",r[t+i.length-1]),r===i&&e.setAttribute("childNodes",r),n},eu=(e,t)=>{const s=e.toLowerCase(),[i,r]=t,n=Object.prototype.hasOwnProperty.call(r,e);return[s,n,n?r[e]:Object.prototype.hasOwnProperty.call(i,s)&&i[s]]},tu=(e,t)=>Array.from({length:e},(s,i)=>t(i))}}),ut,Gi,gs,Vi,Dl,Qi,Hl,Gl,pn,fd=$({"lib/lintConfig.ts"(){"use strict";var e,t;no(),ut=new Map([[0,!1],[1,"warning"],[2,"error"],[!1,!1],["off",!1],["warning","warning"],["error","error"]]),Gi={"arg-in-ext":1,"bold-header":[1,{}],"format-leakage":[1,{}],"fostered-content":[1,{}],h1:[1,{}],"illegal-attr":[2,{}],"insecure-style":2,"invalid-gallery":[2,{parameter:1}],"invalid-imagemap":[2,{}],"invalid-invoke":[2,{}],"invalid-isbn":2,"invalid-json":[2,{duplicate:1}],"invalid-url":1,"lonely-apos":[1,{}],"lonely-bracket":[1,{extLink:2}],"lonely-http":[1,{}],"nested-link":[2,{}],"no-arg":1,"no-duplicate":[2,{category:1,id:1,unknownImageParameter:1}],"no-ignored":[2,{fragment:1,galleryComment:1,galleryNoImage:1,include:1,nonWordAttributes:1,redirect:1}],"obsolete-attr":1,"obsolete-tag":1,"parsing-order":[2,{templateInTable:1}],"pipe-like":[1,{double:2}],"syntax-like":[2,{}],"table-layout":1,"tag-like":[2,{disallowed:1,invalid:1}],"unbalanced-header":2,"unclosed-comment":[1,{}],"unclosed-quote":1,"unclosed-table":2,unescaped:2,"unknown-page":1,"unmatched-tag":[1,{both:2,selfClosing:2}],"unterminated-url":[1,{}],"url-encoding":[1,{}],"var-anchor":[1,{}],"void-ext":[2,{}]},Object.freeze(Gi),gs={configurationComment:"lint",ignoreDisables:!1,fix:!0,computeEditInfo:!0},Object.freeze(gs),Vi=s=>ut.has(s),Dl=s=>Vi(s)||Array.isArray(s)&&Vi(s[0])&&(s.length===1||typeof s[1]=="object"),Qi=(s,i,r)=>{if(ys.includes(i)){if(r===void 0)return!1;if(Dl(r))return s[i]=r,!0}else throw new RangeError(`Unknown lint rule: ${i}`);throw new RangeError(`Invalid lint config for ${i}: ${JSON.stringify(r)}`)},Hl=typeof structuredClone=="function"?structuredClone:(s=>JSON.parse(JSON.stringify(s))),Gl=class{constructor(s){if(Object.assign(this,Hl(Gi)),!!s)for(const[i,r]of Object.entries(s))Qi(this,i,r)}getSeverity(s,i){var n,l;const r=this[s];return typeof r!="object"?ut.get(r):i&&(l=ut.get((n=r[1])==null?void 0:n[i]))!=null?l:ut.get(r[0])}},pn=(t=class{constructor(s){L(this,e);if(Object.assign(this,gs),s&&!("rules"in s)&&Object.keys(s).some(r=>ys.includes(r)))this.rules=s;else{const i=s!=null?s:{},{rules:r}=i,n=Jn(i,["rules"]);this.rules=r;for(const[l,o]of Object.entries(n))o!==void 0&&Object.prototype.hasOwnProperty.call(gs,l)&&(this[l]=o)}}get rules(){return b(this,e)}set rules(s){E(this,e,new Proxy(new Gl(s),{set:Qi,deleteProperty(){return!1}}))}getSeverity(s,i){return b(this,e).getSeverity(s,i)}},e=new WeakMap,t)}}),Ji,fn,md=$({"lib/title.ts"(){"use strict";var e,t,s,i,r,n,su,o;Ge(),de(),Ji=u=>{const[,{length:d},a]=/^((?:\.\.\/)*)([\s\S]*)/u.exec(u);return[d/3,a]},fn=(o=class{constructor(u,d,a,{temporary:h,decode:g,selfLink:c,page:p}={}){L(this,n);L(this,e);L(this,t);L(this,s);L(this,i);L(this,r);Pe(this,"page");Pe(this,"valid");Pe(this,"encoded",!1);this.page=p;const f=u.trim(),m=f.startsWith("../");if(g&&u.includes("%"))try{const v=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(u);u=Qt(u),this.encoded=v}catch(v){}if(u=ws(u).replace(/[_ ]+/gu," ").trim(),m||p&&f.startsWith("/"))E(this,i,0);else{let v=d;u.startsWith(":")&&(v=0,u=u.slice(1).trim());const k=u.split(":");if(k.length>1){const y=wt(k[0]),C=Object.prototype.hasOwnProperty.call(a.nsid,y)&&a.nsid[y];C&&(v=C,u=k.slice(1).join(":").trim())}E(this,i,v)}const S=u.indexOf("#");if(S!==-1){let v=u.slice(S).trim().slice(1);if(v.includes("%"))try{v=Qt(v)}catch(k){}E(this,r,v.replace(/ /gu,"_")),u=u.slice(0,S).trim()}const[A,w]=m?Ji(u):[0,u];this.valid=!!(u||c&&this.ns===0&&b(this,r)!==void 0)&&ws(u)===u&&(A===0||p===void 0||p.split("/",A+1).length>A)&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(w),this.main=u,E(this,t,a.namespaces),E(this,s,a.articlePath||"/wiki/$1"),b(this,s).includes("$1")||E(this,s,b(this,s)+`${b(this,s).endsWith("/")?"":"/"}$1`)}get ns(){return b(this,i)}get fragment(){return b(this,r)}get main(){return b(this,e)}set main(u){u=u.replace(/_/gu," ").trim(),E(this,e,u&&u[0].toUpperCase()+u.slice(1))}get prefix(){const u=b(this,t)[this.ns];return u+(u&&":")}get title(){return this.getRedirection()[1]}get extension(){const{main:u}=this,d=u.lastIndexOf(".");return d===-1?void 0:u.slice(d+1).toLowerCase()}getRedirection(){const{prefix:u}=this,d=u;return P(this,n,su).call(this,d)}setFragment(u){E(this,r,u)}getUrl(u){throw new Error("Title.getUrl method is only available in the LSP version!")}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakSet,su=function(u){var a,h;let d=(u+this.main).replace(/ /gu,"_");if(d.startsWith("/"))d=((a=this.page)!=null?a:"")+d.replace(/(.)\/$/u,"$1");else if(d.startsWith("../")&&((h=this.page)!=null&&h.includes("/"))){const[g,c]=Ji(d),p=this.page.split("/");p.length>g&&(d=p.slice(0,-g).join("/")+(c&&"/")+c)}return[!1,d]},o)}}),iu={};Z(iu,{default:()=>I});nu.exports=J(iu);var ps,Xi,Vl,Ql,dt,Ki,Jl,I,j=$({"index.ts"(){no(),Te(),Ee(),de(),fd(),md(),ps=!0,Xi=new pn,Ql=(e,t,s)=>typeof e=="string"?[!!t,s,e]:[!!e,t,s],dt={config:Zi,get rules(){return ys},get i18n(){return he(he({},oo),Vl)},set i18n(e){Vl=e},get lintConfig(){return Xi},set lintConfig(e){Xi=new pn(e)},get viewOnly(){return ps},set viewOnly(e){ps&&!e&&be.rev++,ps=e},internal:!1,getConfig(e){const t=e!=null?e:this.config,{doubleUnderscore:s,ext:i,parserFunction:r,variable:n}=t;for(let l=0;l<2;l++)s.length>l+2&&s[l].length===0&&(s[l]=Object.keys(s[l+2]));return i.includes("translate")&&!n.includes("translationlanguage")&&(n.push("translationlanguage"),r[1].TRANSLATIONLANGUAGE="translationlanguage"),je(he(he({},Zi),t),{excludes:[]})},msg(e,t=""){var s;return e&&((s=this.i18n[e])!=null?s:e).replace("$1",this.msg(t))},normalizeTitle(e,t=0,s,i=dt.getConfig(),r){let n;if(r!=null&&r.halfParsed)n=new fn(e,t,i,r);else{const{Token:l}=(W(),J(_s));n=be.run(()=>{const o=new l(e,i);o.type="root",o.pageName=r==null?void 0:r.page,o.parseOnce(0,s).parseOnce();const u=new fn(o.firstChild.toString(),t,i,r);o.build();for(const d of["main","fragment"]){const a=u[d];if(a!=null&&a.includes("\0")){const h=o.buildFromStr(a,1);d==="main"?u.main=h:u.setFragment(h)}}return u},this)}return n},parse(e,t,s,i,r){e=ro(e);let n,l,o,u;typeof t=="string"?(n=!!s,l=i,o=r,u=t):(n=!!t,l=s,o=i,u=r),l!=null||(l=ve),o!=null||(o=this.getConfig());let d;typeof l!="number"&&(d=Array.isArray(l)?l:[l],l=Math.max(...d.map(g=>io[g]||ve)));const{Token:a}=(W(),J(_s));return be.run(()=>{const g=new a(e,o);return g.type="root",g.pageName=u,g.parse(l,n)})},parseWithRef(e,t,s,i=t.getAttribute("include")){return this.parse(e,i,s,t.getAttribute("config"),t.pageName)},createLanguageService(e={}){},lint(e,t,s,i){{const[r,n,l]=Ql(t,s,i);return be.internal(()=>this.parse(e,r,void 0,n,l).lint(),this)}},print(e,t,s,i){}},Ki={},Jl=new Set(["lintConfig","normalizeTitle","parse","createLanguageService"]);for(const e of Object.keys(dt))Jl.has(e)||(Ki[e]={enumerable:!1});Object.defineProperties(dt,Ki),Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:dt}),I=dt}});j()});xd();})();
23
+ ${a}`,u),i.push(u);continue}const[,f,m,S,k]=p;if(f){for(;!u.is("table");)u=i.pop();u.close(`
24
+ ${h}${f}`,!0),d(k,i[i.length-1])}else if(m){u=ji(u,i),u.is("tr")&&(u=i.pop());const w=new xa(`
25
+ ${h}${m}`,k,n,r);i.push(u,w),u.insertAt(w)}else{u=ji(u,i);const w=S==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu;let v=w.exec(k),A=0,y=`
26
+ ${h}${S}`;const C=x=>{const _=new As(y,k.slice(A,v==null?void 0:v.index),n,r);return x.insertAt(_),_};for(;v;)C(u),{lastIndex:A}=w,[y]=v,v=w.exec(k);i.push(u,C(u))}}return o.slice(1)}}}),Dt,ed=$({"../cm-util/dist/index.mjs"(){"use strict";Dt=e=>!/^_{2}.+_{2}$/u.test(e)}}),Sa,td=$({"src/nowiki/hr.ts"(){"use strict";ot(),Sa=class extends Ie{get type(){return"hr"}}}}),Fl,Pi,Rl,Ht,sd=$({"src/nowiki/doubleUnderscore.ts"(){"use strict";var e,t;nt(),We(),ot(),Fl=[Ve(),Fe("__")],Ht=(t=class extends(Rl=Ie){constructor(n,r,i,l,o){var h,g;super(n,l,o);L(this,e);const u=n.toLowerCase(),{doubleUnderscore:[,,d,a]}=l;this.setAttribute("name",(g=r?(h=a==null?void 0:a[n])==null?void 0:h.toLowerCase():d==null?void 0:d[u])!=null?g:u),E(this,e,i)}get type(){return"double-underscore"}toString(){const n=b(this,e)?"__":"__";return n+this.innerText+n}print(){}},e=new WeakMap,t),Pi=X(Rl),Ht=V(Pi,0,"DoubleUnderscoreToken",Fl,Ht),G(Pi,1,Ht)}}),ka={};Z(ka,{parseHrAndDoubleUnderscore:()=>Aa});var Aa,id=$({"parser/hrAndDoubleUnderscore.ts"(){"use strict";ed(),td(),sd(),Oo(),Aa=({firstChild:{data:e},type:t,name:s},n,r)=>{var d,a,h;const{doubleUnderscore:[i,l,o]}=n,u=[...i,...l];return(d=n.insensitiveDoubleUnderscore)!=null||(n.insensitiveDoubleUnderscore=new Set(i.filter(Dt))),(a=n.sensitiveDoubleUnderscore)!=null||(n.sensitiveDoubleUnderscore=new Set(l.filter(Dt))),(h=n.regexHrAndDoubleUnderscore)!=null||(n.regexHrAndDoubleUnderscore=new RegExp(String.raw`^((?:\0\d+[cno]\x7F)*)(-{4,})|__(${u.filter(Dt).join("|")})__|_{2}(${u.filter(g=>!Dt(g)).map(g=>g.slice(2,-2)).join("|")})_{2}`,"gimu")),t!=="root"&&(t!=="ext-inner"||s!=="poem")&&(e=`\0${e}`),e=e.replace(n.regexHrAndDoubleUnderscore,(g,c,p,f,m)=>{var A;if(p)return new Sa(p,n,r),`${c}\0${r.length-1}r`;const S=f!=null?f:m,k=n.sensitiveDoubleUnderscore.has(S),w=S.toLowerCase(),v=n.insensitiveDoubleUnderscore.has(w);return k||v?(new Ht(S,k,!!m,n,r),`\0${r.length-1}${v&&((A=o==null?void 0:o[w])!=null?A:w)==="toc"?"u":"n"}`):g}),n.excludes.includes("heading")||(e=e.replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(g,c,p,f,m)=>{const S=`${c}\0${r.length}h`;return new ht(p.length,[f,m],n,r),S})),t==="root"||t==="ext-inner"&&s==="poem"?e:e.slice(1)}}}),_a,nd=$({"src/nowiki/quote.ts"(){"use strict";var e,t;q(),ue(),j(),ot(),_a=(t=class extends Ie{constructor(n,r,i,l){super(n,i,l);L(this,e);E(this,e,r)}get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}get closing(){return he(he({},this.bold?{bold:b(this,e).bold}:void 0),this.italic?{italic:b(this,e).italic}:void 0)}text(){const{parentNode:n,innerText:r}=this;return n!=null&&n.is("image-parameter")&&n.name!=="caption"?"":r}lint(n=this.getAbsoluteIndex()){{const{previousSibling:r,bold:i,closing:l}=this,o=(r==null?void 0:r.type)==="text"?r.data:void 0,u=[],d=new re(this,n),a=["lonely-apos","bold-header"],{lintConfig:h}=I,{computeEditInfo:g}=h,c=[void 0,"word"].map(f=>h.getSeverity(a[0],f)),p=h.getSeverity(a[1]);if(o!=null&&o.endsWith("'")){const f=c[(l.bold||l.italic)&&/[a-z\d]'$/iu.test(o)?1:0];if(f){const m=B(this,d,a[0],I.msg("lonely","'"),f),{startLine:S,startCol:k}=m,[,{length:w}]=/(?:^|[^'])('+)$/u.exec(o),v=n-w,A=je(he({},m),{startIndex:v,endIndex:n,endLine:S,startCol:k-w,endCol:k});g&&(A.suggestions=[St(v,"&apos;",w),D(A)]),u.push(A)}}if(p&&i&&this.isInside("heading-title")){const f=B(this,d,a[1],"bold-in-header",p);g&&(f.suggestions=[D(f)]),u.push(f)}return u}}json(n,r=this.getAbsoluteIndex()){}},e=new WeakMap,t)}}),Ta={};Z(Ta,{parseQuotes:()=>Wn});var Wn,Ca=$({"parser/quotes.ts"(){"use strict";nd(),Wn=(e,t,s,n)=>{var c;const r=e.split(/('{2,})/u),{length:i}=r;if(i===1)return e;let l=0,o=0,u,d,a;for(let p=1;p<i;p+=2){const f=r[p].length;switch(f){case 2:o++;break;case 4:r[p-1]+="'",r[p]="'''";case 3:if(l++,u!==void 0)break;r[p-1].endsWith(" ")?d===void 0&&a===void 0&&(a=p):r[p-1].slice(-2,-1)===" "?u=p:d!=null||(d=p);break;default:r[p-1]+="'".repeat(f-5),r[p]="'''''",o++,l++}}if(o%2===1&&l%2===1){const p=(c=u!=null?u:d)!=null?c:a;p!==void 0&&(r[p]="''",r[p-1]+="'")}let h=!1,g=!1;for(let p=1;p<i;p+=2){const f=r[p].length,m=f!==2,S=f!==3,k=new _a(r[p],{bold:m&&!!h,italic:S&&!!g},t,s);m&&(h=!h&&k),S&&(g=!g&&k),r[p]=`\0${s.length-1}q`}return r.join("")}}}),$a={};Z($a,{parseExternalLinks:()=>qn});var qn,Ia=$({"parser/externalLinks.ts"(){"use strict";de(),Yo(),Rn(),qn=(e,t,s,n)=>{var r;return(r=t.regexExternalLinks)!=null||(t.regexExternalLinks=new RegExp(String.raw`\[((?:\0\d+[cn]\x7F)*(?:\0\d+f\x7F|(?:(?:${t.protocol}|//)${bt}|\0\d+m\x7F)${yt}(?=[[\]<>"\t${De}]|\0\d)))([${De}]*(?![${De}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),e.replace(t.regexExternalLinks,(i,l,o,u)=>{const{length:d}=s,a=/&[lg]t;/u.exec(l);return a&&(o="",u=l.slice(a.index)+o+u,l=l.slice(0,a.index)),n?(new Xt(l,"ext-link-url",t,s),`[\0${d}f${o}${u}]`):(new pt(l,o,u,t,s),`\0${d}w`)})}}}),Na,rd=$({"src/link/category.ts"(){"use strict";Kt(),Na=class extends Be{get type(){return"category"}get sortkey(){}json(e,t=this.getAbsoluteIndex()){}}}}),La={};Z(La,{parseLinks:()=>gn});var Ol,gn,ld=$({"parser/links.ts"(){"use strict";de(),j(),Ca(),Ia(),Ko(),Ho(),rd(),Ol=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,gn=(e,t,s,n,r)=>{var u;(u=t.regexLinks)!=null||(t.regexLinks=new RegExp(String.raw`^\s*(?:${t.protocol}|//)`,"iu"));const i=t.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]]))?\]\]([\s\S]*)$/u:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])*)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]])?)?\]\]([\s\S]*)$/u,l=e.split("[[");let o=l.shift();for(let d=0;d<l.length;d++){let a=!1,h,g,c,p;const f=l[d],m=i.exec(f);if(m)[,h,g,c,p]=m,p.startsWith("]")&&(c!=null&&c.includes("["))&&(c+="]",p=p.slice(1));else{const y=Ol.exec(f);y&&(a=!0,[,h,g,c]=y)}if(h===void 0||t.regexLinks.test(h)||/\0\d+[exhbru]\x7F/u.test(h)){o+=`[[${f}`;continue}let S=fe(h).trim();const k=S.startsWith(":");if(k&&a){o+=`[[${f}`;continue}else!S&&c&&!c.includes(`
27
+ `)&&(S=fe(c).trim());const{ns:w,valid:v}=I.normalizeTitle(S,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0,page:n});if(v){if(a){if(w!==6){o+=`[[${f}`;continue}let y=!1;for(d++;d<l.length;d++){const C=l[d],x=C.split("]]");if(x.length>2){y=!0,c+=`[[${x[0]}]]${x[1]}`,p=x.slice(2).join("]]");break}else if(x.length===2)c+=`[[${x[0]}]]${x[1]}`;else{c+=`[[${C}`;break}}if(c=gn(c,t,s,n,r),!y){o+=`[[${h}${g}${c}`;continue}}}else{o+=`[[${f}`;continue}c&&(c=Wn(c,t,s,r));let A=Fn;k||(w===6?(c&&(c=qn(c,t,s,!0)),A=En):w===14&&(A=Na)),c===void 0&&g&&(c=""),o+=`\0${s.length}l${p}`,new A(h,c,t,s,g)}return o}}}),Ea={};Z(Ea,{parseMagicLinks:()=>Fa});var Bi,Wi,qi,Mi,Fa,od=$({"parser/magicLinks.ts"(){"use strict";de(),Rn(),Bi=String.raw`[${De}\t]|&nbsp;|&#0*160;|&#x0*a0;`,Wi=`(?:${Bi})+`,qi=`(?:${Bi}|-)`,Mi=String.raw`(?:RFC|PMID)${Wi}\d+\b|ISBN${Wi}(?:97[89]${qi}?)?(?:\d${qi}?){9}[\dx]\b`,Fa=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${bt}${yt})|${Mi})`,"giu")}catch(n){t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${bt}${yt})|${Mi})`,"giu")}return e.replace(t.regexMagicLinks,(n,r,i)=>{let l=r?n.slice(r.length):n;if(i){let o="";const u=/&(?:[lg]t|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(l);u&&(o=l.slice(u.index),l=l.slice(0,u.index));const d=l.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,a=d.exec(l);if(a){let h=1;a[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(l.slice(0,a.index))&&(h=2),o=l.slice(a.index+h)+o,l=l.slice(0,a.index+h)}return o.length>=i.length?n:(new Xt(l,void 0,t,s),`${r}\0${s.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(l))return n;return new Xt(l,"magic-link",t,s),`${r}\0${s.length-1}i`})}}}),Ra,ad=$({"util/html.ts"(){"use strict";Ra=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,n)=>s!==e[n])}}),jl,Oa,ud=$({"src/nowiki/list.ts"(){"use strict";q(),j(),va(),jl=new Set(["link","category","file"]),Oa=class extends Pn{get type(){return"list"}lint(e=this.getAbsoluteIndex()){var t;{const s="syntax-like",n=I.lintConfig.getSeverity(s,"redirect"),{innerText:r}=this;if(n&&r==="#"){let{nextSibling:i}=this;if((i==null?void 0:i.type)==="text"&&jl.has((t=i.nextSibling)==null?void 0:t.type)&&new RegExp(String.raw`^(?:${this.getAttribute("config").redirection.join("|")})\s*(?::\s*)?$`,"iu").test(`#${i.data}`)){const o=B(i,{start:e+1},s,"redirect-like",n);return o.startIndex--,o.startCol--,o.endIndex+=2,o.endCol+=2,[o]}}return[]}}}}}),ja={};Z(ja,{parseList:()=>Pa});var Pa,dd=$({"parser/list.ts"(){"use strict";ad(),ud(),ba(),Pa=(e,t,s,n)=>{const r=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!r)return t.lastPrefix="",e;const[i,l,o,u]=r,d=o.replace(/;/gu,":"),a=Ra(d,t.lastPrefix),h=((a>1?o.slice(a-1):o)+u).split(/(?=;)/u),g=h[0].startsWith(";");let c=h.length-(g?0:1);if(a>1){const T=o.slice(0,a-1);if(g){const N=T.split(/(?=;)/u);h.unshift(...N),c+=T.includes(";")?N.length:0}else h[0]=T+h[0]}t.lastPrefix=d;let p=l+h.map((T,N)=>`\0${n.length+N}d`).join("")+e.slice(i.length);for(const T of h)new Oa(T,s,n);if(!c)return p;const{html:[f,,m]}=s,S=/:+|-\{|\0\d+[xq]\x7F/gu;let k=S,w=k.exec(p),v=0,A=!1,y=!1,C=0;const x=(T,N)=>(new Bn(T,s,n),`${p.slice(0,N)}\0${n.length-1}d${p.slice(N+T.length)}`),_=T=>{T?v&&v--:v++};for(;w&&c;){const{0:T,index:N}=w;if(T==="-{"){if(!C){const{lastIndex:F}=k;k=/-\{|\}-/gu,k.lastIndex=F}C++}else if(T==="}-"){if(C--,!C){const{lastIndex:F}=k;k=S,k.lastIndex=F}}else if(T.endsWith("x")){const{name:F,closing:Q,selfClosing:z}=n[Number(T.slice(1,-2))];(f.includes(F)||!z&&!m.includes(F))&&_(Q)}else if(T.endsWith("q")){const{bold:F,italic:Q}=n[Number(T.slice(1,-2))];F&&(_(A),A=!A),Q&&(_(y),y=!y)}else if(v===0){if(T.length>=c)return x(T.slice(0,c),N);c-=T.length,k.lastIndex=N+4+String(n.length).length,p=x(T,N)}w=k.exec(p)}return p}}}),zi,Pl,Ui,Bl,Gt,hd=$({"src/converterFlags.ts"(){"use strict";var e,t;q(),ue(),$s(),ye(),j(),W(),lt(),zi=new Set(["A","T","R","D","-","H","N"]),Pl=[Yt(),me],Gt=(t=class extends(Bl=R){constructor(n,r,i=[]){super(void 0,r,i,{});L(this,e);this.safeAppend(n.map(l=>new Le(l,"converter-flag",r,i)))}get type(){return"converter-flags"}afterBuild(){E(this,e,this.childNodes.map(n=>n.text().trim())),super.afterBuild()}toString(n){return super.toString(n,";")}text(){return super.text(";")}getUnknownFlags(){return new Set(b(this,e).filter(n=>/\{{3}[^{}]+\}{3}/u.test(n)))}getVariantFlags(){const n=new Set(this.getAttribute("config").variants);return new Set(b(this,e).filter(r=>n.has(r)))}isInvalidFlag(n,r,i,l){return!!n&&!r.has(n)&&!i.has(n)&&(r.size>0||!l.has(n))}lint(n=this.getAbsoluteIndex(),r){{const i=this.getVariantFlags(),l=this.getUnknownFlags(),o=new Set(b(this,e).filter(m=>zi.has(m))),u=b(this,e).filter(m=>!m).length,d=b(this,e).length-l.size-u,{lintConfig:a}=I,{computeEditInfo:h,fix:g}=a,c=super.lint(n,r);if(i.size===d||o.size===d)return c;const p="no-ignored",f=a.getSeverity(p,"conversionFlag");if(f){const m=new re(this,n);for(let S=0;S<this.length;S++){const k=this.childNodes[S],w=k.text().trim();if(this.isInvalidFlag(w,i,l,o)){const v=M(k,m,p,"invalid-conversion-flag",f);(h||g)&&(i.size===0&&zi.has(w.toUpperCase())?v.fix=Sn(v,w):h&&(v.suggestions=[D(v,S&&-1)])),c.push(v)}}}return c}}print(){}},e=new WeakMap,t),Ui=X(Bl),Gt=V(Ui,0,"ConverterFlagsToken",Pl,Gt),G(Ui,1,Gt)}}),cs,Wl,Di,ql,et,cd=$({"src/converterRule.ts"(){"use strict";Ee(),ye(),j(),W(),lt(),cs=(e,t,s,n)=>{const r=new R(e,s,n);return r.type=`converter-rule-${t}`,r.setAttribute("stage",ve),r},Wl=[me],et=class extends(ql=R){get type(){return"converter-rule"}get variant(){}constructor(e,t=!0,s=I.getConfig(),n=[]){super(void 0,s,n,{});const r=e.indexOf(":"),i=e.slice(0,r).indexOf("=>"),l=i===-1?e.slice(0,r):e.slice(i+2,r);t&&s.variants.includes(l.trim().toLowerCase())?(super.insertAt(new Le(l,"converter-rule-variant",s,n)),super.insertAt(cs(e.slice(r+1),"to",s,n)),i!==-1&&super.insertAt(cs(e.slice(0,i),"from",s,n),0)):super.insertAt(cs(e,"to",s,n))}toString(e){const{childNodes:t,firstChild:s,lastChild:n}=this;return t.length===3?`${s.toString(e)}=>${t[1].toString(e)}:${n.toString(e)}`:super.toString(e,":")}text(){const{childNodes:e,firstChild:t,lastChild:s}=this;return e.length===3?`${t.text()}=>${e[1].text()}:${s.text()}`:super.text(":")}getGaps(e){return e===0&&this.length===3?2:1}print(){}json(e,t=this.getAbsoluteIndex()){}},Di=X(ql),et=V(Di,0,"ConverterRuleToken",Wl,et),G(Di,1,et)}}),Ml,Hi,zl,Vt,gd=$({"src/converter.ts"(){"use strict";de(),We(),ye(),W(),hd(),cd(),Ml=[me,Fe("-{")],Vt=class extends(zl=R){get type(){return"converter"}constructor(e,t,s,n=[]){super(void 0,s,n),this.insertAt(new Gt(e,s,n));const[r]=t,i=r.includes(":"),l=new et(r,i,s,n);(i?l.length===1:t.length===2&&!fe(t[1]).trim())?this.insertAt(new et(t.join(";"),!1,s,n)):this.safeAppend([l,...t.slice(1).map(o=>new et(o,!0,s,n))])}toString(e){const{childNodes:[t,...s]}=this;return`-{${t.toString(e)}${t.length>0?"|":""}${s.map(n=>n.toString(e)).join(";")}}-`}text(){const{childNodes:[e,...t]}=this;return`-{${e.text()}|${it(t,";")}}-`}getGaps(e){return e||this.firstChild.length>0?1:0}print(){}},Hi=X(zl),Vt=V(Hi,0,"ConverterToken",Ml,Vt),G(Hi,1,Vt)}}),Ba={};Z(Ba,{parseConverter:()=>Wa});var Wa,pd=$({"parser/converter.ts"(){"use strict";gd(),Wa=(e,t,s)=>{var u;(u=t.regexConverter)!=null||(t.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${t.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"iu"));const n=/-\{/gu,r=/-\{|\}-/gu,i=[];let l=n,o=l.exec(e);for(;o;){const{0:d,index:a}=o;if(d==="}-"){const h=i.pop(),{length:g}=s,c=e.slice(h.index+2,a),p=c.indexOf("|"),[f,m]=p===-1?[[],c]:[c.slice(0,p).split(";"),c.slice(p+1)],S=m.replace(/(&[#a-z\d]+);/giu,"$1"),k=S.split(t.regexConverter).map(w=>w.replace(/\x01/gu,";"));new Vt(f,k,t,s),e=`${e.slice(0,h.index)}\0${g}v${e.slice(a+2)}`,i.length===0&&(l=n),l.lastIndex=h.index+3+String(g).length}else i.push(o),l=r,l.lastIndex=a+2;o=l.exec(e)}return e}}}),_s={};Z(_s,{Token:()=>R});var Ul,R,W=$({"src/index.ts"(){"use strict";var e,t,s,n,r,i,l,o,u,qa,Ma,za,Ua,Da,Ha,Ga,Va,Qa,Ja,Xa,Ka,A;de(),Ee(),q(),Te(),j(),Su(),ku(),Ul=["category","html-attr#id,ext-attr#id,table-attr#id"],R=(A=class extends Ot{constructor(x,_=I.getConfig(),T=[],N){super();L(this,u);L(this,e,"plain");L(this,t,0);L(this,s);L(this,n);L(this,r);L(this,i,!1);L(this,l);L(this,o);typeof x=="string"&&this.insertAt(x),E(this,s,_),E(this,n,T),T.push(this)}get type(){return b(this,e)}set type(x){E(this,e,x)}get pageName(){return b(this.getRootNode(),o)}set pageName(x){if(x){const _=this.normalizeTitle(x,0,{temporary:!0,page:""});E(this,o,_.valid?_.title:void 0)}else E(this,o,x===""?"":void 0)}parseOnce(x=b(this,t),_=!1,T){if(x<b(this,t)||this.length!==1||!this.isPlain())return this;if(b(this,t)>=ve)return this;switch(x){case 0:if(this.type==="root"){b(this,n).pop();const N=P(this,u,qa).call(this);_&&(_=!N)}E(this,r,_),P(this,u,Ma).call(this,_);break;case 1:P(this,u,za).call(this);break;case 2:P(this,u,Ua).call(this);break;case 3:P(this,u,Da).call(this);break;case 4:P(this,u,Ha).call(this);break;case 5:P(this,u,Ga).call(this,T);break;case 6:P(this,u,Va).call(this,T);break;case 7:P(this,u,Qa).call(this);break;case 8:P(this,u,Ja).call(this);break;case 9:P(this,u,Xa).call(this);break;case 10:P(this,u,Ka).call(this)}if(this.type==="root")for(const N of b(this,n))N==null||N.parseOnce(x,_,T);return Xn(this,t)._++,this}buildFromStr(x,_){const T=x.split(/[\0\x7F]/u).map((N,F)=>{if(F%2===0)return N&&new nn(N);const Q=Number(N.slice(0,-1));return b(this,n)[Q]}).filter(N=>N!=="");return _===0?T.map(String).join(""):_===1?it(T):T}build(){E(this,t,ve);const{length:x,firstChild:_}=this,T=_==null?void 0:_.toString();if(x===1&&_.type==="text"&&T.includes("\0")&&(Mn(this,0,1,this.buildFromStr(T)),this.type==="root"))for(const N of b(this,n))N==null||N.build()}afterBuild(){if(this.type==="root")for(const x of b(this,n))x==null||x.afterBuild();E(this,i,!0)}parse(x=ve,_,T){for(x=Math.min(x,ve);b(this,t)<x;)this.parseOnce(b(this,t),_,T);return x&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===A}getAttribute(x){var _;switch(x){case"config":return b(this,s);case"include":return(_=b(this,r))!=null?_:!!b(this.getRootNode(),r);case"accum":return b(this,n);case"built":return b(this,i);case"stage":return b(this,t);case"invalid":default:return super.getAttribute(x)}}setAttribute(x,_){switch(x){case"stage":b(this,t)===0&&this.type==="root"&&b(this,n).shift(),E(this,t,_);break;default:super.setAttribute(x,_)}}insertAt(x,_=this.length){const T=typeof x=="string"?new nn(x):x,{length:N}=this;_+=_<0?N:0,super.insertAt(T,_);const{type:F}=T;return F==="root"&&(T.type="plain"),T}normalizeTitle(x,_=0,T){return I.normalizeTitle(x,_,this.getAttribute("include"),b(this,s),he({page:this.pageName},T))}inTableAttrs(){var x;return this.isInside("table-attrs")&&((x=this.closest("table-attrs,arg,parameter"))!=null&&x.is("table-attrs")?2:1)}inHtmlAttrs(){return this.isInside("html-attrs")?2:this.inTableAttrs()}lint(x=this.getAbsoluteIndex(),_){var T;{const{lintConfig:N}=I,{computeEditInfo:F,fix:Q,ignoreDisables:z,configurationComment:U}=N;let O=super.lint(x,_);if(this.type==="root"){const pe=new Map,ge="no-duplicate",we=["category","id"].map(H=>N.getSeverity(ge,H)),K=this.toString(),Re=Ul.filter((H,le)=>we[le]).join();if(Re){for(const H of this.querySelectorAll(Re)){let le;if(H.is("category"))le=H.name;else{const ee=H.getValue();ee&&ee!==!0&&(le=`#${ee}`)}if(le){const ee=pe.get(le);ee?ee.add(H):pe.set(le,new Set([H]))}}for(const[H,le]of pe)if(le.size>1&&!H.startsWith("#mw-customcollapsible-")){const ee=!H.startsWith("#"),te=`duplicate-${ee?"category":"id"}`,ne=we[ee?0:1];O.push(...[...le].map(ae=>{const Y=B(ae,{start:ae.getAbsoluteIndex()},ge,te,ne);return F&&ee&&(Y.suggestions=[D(Y)]),Y}))}}if(!z){const H=new RegExp(String.raw`<!--\s*${U}-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->`,"gu"),le=[];let ee=H.exec(K);for(;ee;){const{1:te,index:ne}=ee,ae=(T=ee[2])==null?void 0:T.trim();let Y;(te==="disable-line"||te==="disable-next-line")&&(Y=this.posFromIndex(ne).top+(te==="disable-line"?0:1)),le.push({line:Y,from:te==="disable"?H.lastIndex:void 0,to:te==="enable"?H.lastIndex:void 0,rules:ae?new Set(ae.split(",").map(se=>se.trim())):void 0}),ee=H.exec(K)}O=O.filter(({rule:te,startLine:ne,startIndex:ae})=>{const Y={pos:0};for(const{line:se,from:xe,to:qe,rules:Je}of le){if(se&&se>ne+1)break;if(Je&&!Je.has(te))continue;if(se===ne)return!1;xe<=ae&&xe>Y.pos?(Y.pos=xe,Y.type="from"):qe<=ae&&qe>Y.pos&&(Y.pos=qe,Y.type="to")}return Y.type!=="from"})}if(Q&&O.some(({fix:H})=>H)){const H=O.map(({fix:te})=>te).filter(te=>te!==void 0).sort(({range:[te,ne]},{range:[ae,Y]})=>ne===Y?ae-te:Y-ne);let le=1/0,ee=K;for(const{range:[te,ne],text:ae}of H)ne<=le&&(ee=ee.slice(0,te)+ae+ee.slice(ne),le=te);Object.assign(O,{output:ee})}if(!F)for(const H of O)delete H.fix,delete H.suggestions}return O}}toString(x,_){return x?super.toString(!0,_):tt(b(this,l),()=>super.toString(!1,_),T=>{const N=this.getRootNode();N.type==="root"&&b(N,i)&&E(this,l,T)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n=new WeakMap,r=new WeakMap,i=new WeakMap,l=new WeakMap,o=new WeakMap,u=new WeakSet,qa=function(){const{parseRedirect:x}=(Tu(),J(yo)),_=this.firstChild.toString(),T=x(_,b(this,s),b(this,n));return T!==!1&&this.setText(T),!!T},Ma=function(x){const{parseCommentAndExt:_}=(Fs(),J(ha));this.setText(_(this.firstChild.toString(),b(this,s),b(this,n),x))},za=function(){const{parseBraces:x}=(Ln(),J(Bo)),_=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,T=x(_,b(this,s),b(this,n));this.setText(this.type==="root"?T:T.slice(1))},Ua=function(){if(b(this,s).excludes.includes("html"))return;const{parseHtml:x}=(Xu(),J(ca));this.setText(x(this.firstChild.toString(),b(this,s),b(this,n)))},Da=function(){if(b(this,s).excludes.includes("table"))return;const{parseTable:x}=(Zu(),J(ya));this.setText(x(this,b(this,s),b(this,n)))},Ha=function(){if(b(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:x}=(id(),J(ka));this.setText(x(this,b(this,s),b(this,n)))},Ga=function(x){const{parseLinks:_}=(ld(),J(La));this.setText(_(this.firstChild.toString(),b(this,s),b(this,n),this.pageName,x))},Va=function(x){const{parseQuotes:_}=(Ca(),J(Ta)),T=this.firstChild.toString().split(`
28
+ `);for(let N=0;N<T.length;N++)T[N]=_(T[N],b(this,s),b(this,n),x);this.setText(T.join(`
29
+ `))},Qa=function(){const{parseExternalLinks:x}=(Ia(),J($a));this.setText(x(this.firstChild.toString(),b(this,s),b(this,n)))},Ja=function(){const{parseMagicLinks:x}=(od(),J(Ea));this.setText(x(this.firstChild.toString(),b(this,s),b(this,n)))},Xa=function(){if(b(this,s).excludes.includes("list"))return;const{parseList:x}=(dd(),J(ja)),{firstChild:_,type:T,name:N}=this,F=_.toString().split(`
30
+ `),Q={lastPrefix:""};let z=T==="root"||T==="ext-inner"&&N==="poem"?0:1;for(;z<F.length;z++)F[z]=x(F[z],Q,b(this,s),b(this,n));this.setText(F.join(`
31
+ `))},Ka=function(){if(b(this,s).variants.length>0){const{parseConverter:x}=(pd(),J(Ba));this.setText(x(this.firstChild.toString(),b(this,s),b(this,n)))}},A)}}),be,Rs,Ya,Za,Mn,eu,tu,Te=$({"util/debug.ts"(){"use strict";be={running:!1,run(e,t){const{running:s}=this;this.running=!0;const n=t==null?void 0:t.internal;t&&(t.internal=!0);const r=()=>{this.running=s,t&&(t.internal=n)};try{const{Token:i}=(W(),J(_s)),l=e();return l instanceof i&&!l.getAttribute("built")&&l.afterBuild(),r(),l}catch(i){throw r(),i}},internal(e,t){const{internal:s}=t;t.internal=!0;const n=e();return t.internal=s,n},rev:0},Rs=e=>t=>t.type===e,Ya=({type:e})=>e==="tr"||e==="table-syntax",Za=e=>e==="redirect-target"||e==="link",Mn=(e,t,s,n=[])=>{var l,o;let r=e.getChildNodes(),i;r.length===s?(i=r,r=n):i=Array.prototype.splice.apply(r,[t,s,...n]);for(let u=0;u<n.length;u++){const d=n[u];d.setAttribute("parentNode",e),d.setAttribute("nextSibling",r[t+u+1]),d.setAttribute("previousSibling",r[t+u-1])}return(l=r[t-1])==null||l.setAttribute("nextSibling",r[t]),(o=r[t+n.length])==null||o.setAttribute("previousSibling",r[t+n.length-1]),r===n&&e.setAttribute("childNodes",r),i},eu=(e,t)=>{const s=e.toLowerCase(),[n,r]=t,i=Object.prototype.hasOwnProperty.call(r,e);return[s,i,i?r[e]:Object.prototype.hasOwnProperty.call(n,s)&&n[s]]},tu=(e,t)=>Array.from({length:e},(s,n)=>t(n))}}),ut,Gi,gs,Vi,Dl,Qi,Hl,Gl,pn,fd=$({"lib/lintConfig.ts"(){"use strict";var e,t;no(),ut=new Map([[0,!1],[1,"warning"],[2,"error"],[!1,!1],["off",!1],["warning","warning"],["error","error"]]),Gi={"arg-in-ext":1,"bold-header":[1,{}],"format-leakage":[1,{}],"fostered-content":[1,{}],h1:[1,{}],"illegal-attr":[2,{}],"insecure-style":2,"invalid-gallery":[2,{parameter:1}],"invalid-imagemap":[2,{}],"invalid-invoke":[2,{}],"invalid-isbn":2,"invalid-json":[2,{duplicate:1}],"invalid-url":1,"lonely-apos":[1,{}],"lonely-bracket":[1,{extLink:2}],"lonely-http":[1,{}],"nested-link":[2,{}],"no-arg":1,"no-duplicate":[2,{category:1,id:1,unknownImageParameter:1}],"no-ignored":[2,{fragment:1,galleryComment:1,galleryNoImage:1,include:1,nonWordAttributes:1,redirect:1}],"obsolete-attr":1,"obsolete-tag":1,"parsing-order":[2,{templateInTable:1}],"pipe-like":[1,{double:2}],"syntax-like":[2,{}],"table-layout":1,"tag-like":[2,{disallowed:1,invalid:1}],"unbalanced-header":2,"unclosed-comment":[1,{}],"unclosed-quote":1,"unclosed-table":2,unescaped:2,"unknown-page":1,"unmatched-tag":[1,{both:2,selfClosing:2}],"unterminated-url":[1,{}],"url-encoding":[1,{}],"var-anchor":[1,{}],"void-ext":[2,{}]},Object.freeze(Gi),gs={configurationComment:"lint",ignoreDisables:!1,fix:!0,computeEditInfo:!0},Object.freeze(gs),Vi=s=>ut.has(s),Dl=s=>Vi(s)||Array.isArray(s)&&Vi(s[0])&&(s.length===1||typeof s[1]=="object"),Qi=(s,n,r)=>{if(ys.includes(n)){if(r===void 0)return!1;if(Dl(r))return s[n]=r,!0}else throw new RangeError(`Unknown lint rule: ${n}`);throw new RangeError(`Invalid lint config for ${n}: ${JSON.stringify(r)}`)},Hl=typeof structuredClone=="function"?structuredClone:(s=>JSON.parse(JSON.stringify(s))),Gl=class{constructor(s){if(Object.assign(this,Hl(Gi)),!!s)for(const[n,r]of Object.entries(s))Qi(this,n,r)}getSeverity(s,n){var i,l;const r=this[s];return typeof r!="object"?ut.get(r):n&&(l=ut.get((i=r[1])==null?void 0:i[n]))!=null?l:ut.get(r[0])}},pn=(t=class{constructor(s){L(this,e);if(Object.assign(this,gs),s&&!("rules"in s)&&Object.keys(s).some(r=>ys.includes(r)))this.rules=s;else{const n=s!=null?s:{},{rules:r}=n,i=Jn(n,["rules"]);this.rules=r;for(const[l,o]of Object.entries(i))o!==void 0&&Object.prototype.hasOwnProperty.call(gs,l)&&(this[l]=o)}}get rules(){return b(this,e)}set rules(s){E(this,e,new Proxy(new Gl(s),{set:Qi,deleteProperty(){return!1}}))}getSeverity(s,n){return b(this,e).getSeverity(s,n)}},e=new WeakMap,t)}}),Ji,fn,md=$({"lib/title.ts"(){"use strict";var e,t,s,n,r,i,su,o;Ge(),de(),Ji=u=>{const[,{length:d},a]=/^((?:\.\.\/)*)([\s\S]*)/u.exec(u);return[d/3,a]},fn=(o=class{constructor(u,d,a,{temporary:h,decode:g,selfLink:c,page:p}={}){L(this,i);L(this,e);L(this,t);L(this,s);L(this,n);L(this,r);Pe(this,"page");Pe(this,"valid");Pe(this,"encoded",!1);this.page=p;const f=u.trim(),m=f.startsWith("../");if(g&&u.includes("%"))try{const v=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(u);u=Qt(u),this.encoded=v}catch(v){}if(u=ws(u).replace(/[_ ]+/gu," ").trim(),m||p&&f.startsWith("/"))E(this,n,0);else{let v=d;u.startsWith(":")&&(v=0,u=u.slice(1).trim());const A=u.split(":");if(A.length>1){const y=wt(A[0]),C=Object.prototype.hasOwnProperty.call(a.nsid,y)&&a.nsid[y];C&&(v=C,u=A.slice(1).join(":").trim())}E(this,n,v)}const S=u.indexOf("#");if(S!==-1){let v=u.slice(S).trim().slice(1);if(v.includes("%"))try{v=Qt(v)}catch(A){}E(this,r,v.replace(/ /gu,"_")),u=u.slice(0,S).trim()}const[k,w]=m?Ji(u):[0,u];this.valid=!!(u||c&&this.ns===0&&b(this,r)!==void 0)&&ws(u)===u&&(k===0||p===void 0||p.split("/",k+1).length>k)&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(w),this.main=u,E(this,t,a.namespaces),E(this,s,a.articlePath||"/wiki/$1"),b(this,s).includes("$1")||E(this,s,b(this,s)+`${b(this,s).endsWith("/")?"":"/"}$1`)}get ns(){return b(this,n)}get fragment(){return b(this,r)}get main(){return b(this,e)}set main(u){u=u.replace(/_/gu," ").trim(),E(this,e,u&&u[0].toUpperCase()+u.slice(1))}get prefix(){const u=b(this,t)[this.ns];return u+(u&&":")}get title(){return this.getRedirection()[1]}get extension(){const{main:u}=this,d=u.lastIndexOf(".");return d===-1?void 0:u.slice(d+1).toLowerCase()}getRedirection(){const{prefix:u}=this,d=u;return P(this,i,su).call(this,d)}setFragment(u){E(this,r,u)}getUrl(u){throw new Error("Title.getUrl method is only available in the LSP version!")}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n=new WeakMap,r=new WeakMap,i=new WeakSet,su=function(u){var a,h;let d=(u+this.main).replace(/ /gu,"_");if(d.startsWith("/"))d=((a=this.page)!=null?a:"")+d.replace(/(.)\/$/u,"$1");else if(d.startsWith("../")&&((h=this.page)!=null&&h.includes("/"))){const[g,c]=Ji(d),p=this.page.split("/");p.length>g&&(d=p.slice(0,-g).join("/")+(c&&"/")+c)}return[!1,d]},o)}}),iu={};Z(iu,{default:()=>I});nu.exports=J(iu);var ps,Xi,Vl,Ql,dt,Ki,Jl,I,j=$({"index.ts"(){no(),Te(),Ee(),de(),fd(),md(),ps=!0,Xi=new pn,Ql=(e,t,s)=>typeof e=="string"?[!!t,s,e]:[!!e,t,s],dt={config:Zi,get rules(){return ys},get i18n(){return he(he({},oo),Vl)},set i18n(e){Vl=e},get lintConfig(){return Xi},set lintConfig(e){Xi=new pn(e)},get viewOnly(){return ps},set viewOnly(e){ps&&!e&&be.rev++,ps=e},internal:!1,getConfig(e){const t=e!=null?e:this.config,{doubleUnderscore:s,ext:n,parserFunction:r,variable:i}=t;for(let l=0;l<2;l++)s.length>l+2&&s[l].length===0&&(s[l]=Object.keys(s[l+2]));return n.includes("translate")&&!i.includes("translationlanguage")&&(i.push("translationlanguage"),r[1].TRANSLATIONLANGUAGE="translationlanguage"),je(he(he({},Zi),t),{excludes:[]})},msg(e,t=""){var s;return e&&((s=this.i18n[e])!=null?s:e).replace("$1",this.msg(t))},normalizeTitle(e,t=0,s,n=dt.getConfig(),r){let i;if(r!=null&&r.halfParsed)i=new fn(e,t,n,r);else{const{Token:l}=(W(),J(_s));i=be.run(()=>{const o=new l(e,n);o.type="root",o.pageName=r==null?void 0:r.page,o.parseOnce(0,s).parseOnce();const u=new fn(o.firstChild.toString(),t,n,r);o.build();for(const d of["main","fragment"]){const a=u[d];if(a!=null&&a.includes("\0")){const h=o.buildFromStr(a,1);d==="main"?u.main=h:u.setFragment(h)}}return u},this)}return i},parse(e,t,s,n,r){e=ro(e);let i,l,o,u;typeof t=="string"?(i=!!s,l=n,o=r,u=t):(i=!!t,l=s,o=n,u=r),l!=null||(l=ve),o!=null||(o=this.getConfig());let d;typeof l!="number"&&(d=Array.isArray(l)?l:[l],l=Math.max(...d.map(g=>io[g]||ve)));const{Token:a}=(W(),J(_s));return be.run(()=>{const g=new a(e,o);return g.type="root",g.pageName=u,g.parse(l,i)})},parseWithRef(e,t,s,n=t.getAttribute("include")){return this.parse(e,n,s,t.getAttribute("config"),t.pageName)},createLanguageService(e={}){},lint(e,t,s,n){{const[r,i,l]=Ql(t,s,n);return be.internal(()=>this.parse(e,r,void 0,i,l).lint(),this)}},print(e,t,s,n){}},Ki={},Jl=new Set(["lintConfig","normalizeTitle","parse","createLanguageService"]);for(const e of Object.keys(dt))Jl.has(e)||(Ki[e]={enumerable:!1});Object.defineProperties(dt,Ki),Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:dt}),I=dt}});j()});xd();})();