wikiparser-node 1.35.0 → 1.35.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -28
- package/bundle/bundle-es8.min.js +29 -29
- package/bundle/bundle-lsp.min.js +34 -34
- package/bundle/bundle.min.js +24 -24
- package/config/default.json +3 -0
- package/config/enwiki.json +3 -0
- package/config/jawiki.json +3 -0
- package/config/minimum.json +1 -0
- package/config/zhwiki.json +3 -0
- package/coverage/badge.svg +1 -1
- package/data/signatures.json +13 -0
- package/dist/addon/attribute.js +13 -12
- package/dist/addon/link.js +3 -3
- package/dist/addon/token.js +4 -4
- package/dist/addon/transclude.js +8 -8
- package/dist/base.d.mts +3 -1
- package/dist/base.d.ts +3 -1
- package/dist/bin/config.js +3 -3
- package/dist/index.js +21 -13
- package/dist/lib/document.js +14 -12
- package/dist/lib/element.d.ts +2 -1
- package/dist/lib/element.js +17 -13
- package/dist/lib/lintConfig.js +7 -6
- package/dist/lib/lsp.js +10 -8
- package/dist/lib/node.js +8 -6
- package/dist/lib/range.js +17 -13
- package/dist/lib/ranges.js +25 -26
- package/dist/lib/text.js +14 -13
- package/dist/lib/title.js +7 -6
- package/dist/parser/braces.js +5 -7
- package/dist/parser/hrAndDoubleUnderscore.js +2 -2
- package/dist/parser/list.js +1 -1
- package/dist/parser/magicLinks.js +2 -1
- package/dist/parser/selector.js +15 -15
- package/dist/src/arg.js +4 -4
- package/dist/src/atom.js +1 -1
- package/dist/src/attribute.js +5 -4
- package/dist/src/attributes.js +10 -7
- package/dist/src/converter.js +4 -4
- package/dist/src/converterRule.js +2 -2
- package/dist/src/heading.js +2 -2
- package/dist/src/imageParameter.js +12 -3
- package/dist/src/index.js +15 -10
- package/dist/src/link/base.js +10 -7
- package/dist/src/link/category.js +3 -3
- package/dist/src/link/file.js +6 -5
- package/dist/src/link/index.js +5 -3
- package/dist/src/multiLine/gallery.js +2 -2
- package/dist/src/nowiki/comment.js +4 -3
- package/dist/src/nowiki/doubleUnderscore.js +1 -1
- package/dist/src/nowiki/listBase.js +2 -2
- package/dist/src/nowiki/noinclude.js +1 -1
- package/dist/src/nowiki/quote.js +3 -3
- package/dist/src/onlyinclude.js +1 -1
- package/dist/src/parameter.js +2 -2
- package/dist/src/table/index.js +9 -8
- package/dist/src/table/td.js +5 -5
- package/dist/src/table/trBase.js +4 -4
- package/dist/src/tag/html.js +9 -9
- package/dist/src/tag/index.js +6 -5
- package/dist/src/tag/tvar.js +4 -3
- package/dist/src/tagPair/index.js +6 -4
- package/dist/src/transclude.js +3 -3
- package/dist/util/debug.js +3 -2
- package/dist/util/diff.js +11 -6
- package/dist/util/selector.js +1 -1
- package/dist/util/string.js +2 -2
- package/extensions/dist/base.js +12 -4
- package/extensions/dist/codejar.js +1 -1
- package/package.json +27 -27
- package/logo.png +0 -0
package/bundle/bundle-es8.min.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
"use strict";(()=>{var
|
|
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,"|")}),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++,
|
|
4
|
-
`,U)
|
|
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,"<")];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,"]")]}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,`
|
|
1
|
+
"use strict";(()=>{var eo=Object.create;var vt=Object.defineProperty,$d=Object.defineProperties,to=Object.getOwnPropertyDescriptor,Id=Object.getOwnPropertyDescriptors,Fd=Object.getOwnPropertyNames,Cn=Object.getOwnPropertySymbols,Rd=Object.getPrototypeOf,mi=Object.prototype.hasOwnProperty,ro=Object.prototype.propertyIsEnumerable;var no=(o,r)=>(r=Symbol[o])?r:Symbol.for("Symbol."+o),Yt=o=>{throw TypeError(o)};var wn=(o,r,e)=>r in o?vt(o,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[r]=e,V=(o,r)=>{for(var e in r||(r={}))mi.call(r,e)&&wn(o,e,r[e]);if(Cn)for(var e of Cn(r))ro.call(r,e)&&wn(o,e,r[e]);return o},ge=(o,r)=>$d(o,Id(r)),Zs=(o,r)=>vt(o,"name",{value:r,configurable:!0});var hi=(o,r)=>{var e={};for(var t in o)mi.call(o,t)&&r.indexOf(t)<0&&(e[t]=o[t]);if(o!=null&&Cn)for(var t of Cn(o))r.indexOf(t)<0&&ro.call(o,t)&&(e[t]=o[t]);return e};var w=(o,r)=>()=>(o&&(r=o(o=0)),r);var io=(o,r)=>()=>(r||o((r={exports:{}}).exports,r),r.exports),Z=(o,r)=>{for(var e in r)vt(o,e,{get:r[e],enumerable:!0})},so=(o,r,e,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of Fd(r))!mi.call(o,n)&&n!==e&&vt(o,n,{get:()=>r[n],enumerable:!(t=to(r,n))||t.enumerable});return o};var Pd=(o,r,e)=>(e=o!=null?eo(Rd(o)):{},so(r||!o||!o.__esModule?vt(e,"default",{value:o,enumerable:!0}):e,o)),X=o=>so(vt({},"__esModule",{value:!0}),o);var B=o=>{var r;return[,,,eo((r=o==null?void 0:o[no("metadata")])!=null?r:null)]},oo=["class","method","getter","setter","accessor","field","value","get","set"],Fr=o=>o!==void 0&&typeof o!="function"?Yt("Function expected"):o,Bd=(o,r,e,t,n)=>({kind:oo[o],name:r,metadata:t,addInitializer:i=>e._?Yt("Already initialized"):n.push(Fr(i||null))}),Rr=(o,r)=>wn(r,no("metadata"),o[3]),R=(o,r,e,t)=>{for(var n=0,i=o[r>>1],s=i&&i.length;n<s;n++)r&1?i[n].call(e):t=i[n].call(e,t);return t},P=(o,r,e,t,n,i)=>{var s,a,l,u,g,d=r&7,p=!!(r&8),c=!!(r&16),f=d>3?o.length+1:d?p?1:2:0,h=oo[d+5],x=d>3&&(o[f-1]=[]),T=o[f]||(o[f]=[]),b=d&&(!c&&!p&&(n=n.prototype),d<5&&(d>3||!c)&&to(d<4?n:{get[e](){return m(this,i)},set[e](k){return C(this,i,k)}},e));d?c&&d<4&&Zs(i,(d>2?"set ":d>1?"get ":"")+e):Zs(n,e);for(var y=t.length-1;y>=0;y--)u=Bd(d,e,l={},o[3],T),d&&(u.static=p,u.private=c,g=u.access={has:c?k=>jd(n,k):k=>e in k},d^3&&(g.get=c?k=>(d^1?m:I)(k,n,d^4?i:b.get):k=>k[e]),d>2&&(g.set=c?(k,A)=>C(k,n,A,d^4?i:b.set):(k,A)=>k[e]=A)),a=(0,t[y])(d?d<4?c?i:b[h]:d>4?void 0:{get:b.get,set:b.set}:n,u),l._=1,d^4||a===void 0?Fr(a)&&(d>4?x.unshift(a):d?c?i=a:b[h]=a:n=a):typeof a!="object"||a===null?Yt("Object expected"):(Fr(s=a.get)&&(b.get=s),Fr(s=a.set)&&(b.set=s),Fr(s=a.init)&&x.unshift(s));return d||Rr(o,n),b&&vt(n,e,b),c?d^4?i:b:n},ce=(o,r,e)=>wn(o,typeof r!="symbol"?r+"":r,e),bi=(o,r,e)=>r.has(o)||Yt("Cannot "+e),jd=(o,r)=>Object(r)!==r?Yt('Cannot use the "in" operator on this value'):o.has(r),m=(o,r,e)=>(bi(o,r,"read from private field"),e?e.call(o):r.get(o)),S=(o,r,e)=>r.has(o)?Yt("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(o):r.set(o,e),C=(o,r,e,t)=>(bi(o,r,"write to private field"),t?t.call(o,e):r.set(o,e),e),I=(o,r,e)=>(bi(o,r,"access private method"),e);var En=(o,r,e,t)=>({set _(n){C(o,r,n,e)},get _(){return m(o,r,t)}});var ao,Pr,xi=w(()=>{"use strict";ao=(()=>{let o={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(o,null),o})(),Pr=(()=>{let o=["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(o),o})()});function ke(o,r,e){return e===1?o.replace(/\0(\d+)g\x7F/gu,(t,n)=>ke(String(r[n]),r,2)):e===2?o.replace(/\0(\d+)n\x7F/gu,(t,n)=>String(r[n])):o.replace(/\0(\d+)\x7F/gu,(t,n)=>r[n])}var Ie,lo,De,Me,Ue,Br,go,re,Ee,Od,qd,Ln,jr,uo,_d,Wd,hu,ae=w(()=>{"use strict";Ie=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,lo=String.raw`[^[\]<>"\0-\x1F\x7F${Ie}\uFFFD]`,De=String.raw`(?:\[[\da-f:.]+\]|${lo})`,Me=String.raw`(?:${lo}|\0\d+[cn!~]\x7F)*`,Ue=o=>o.trim().toLowerCase();Br=(o,r)=>e=>e.replace(o,r),go=Br(/[\0\x7F]|\r$/gmu,""),re=Br(/\0\d+[cn]\x7F/gu,""),Ee=(o,r="")=>o.map(e=>typeof e=="string"?e:e.text()).join(r),Od={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},qd=Br(/&(?:#(\d+|[Xx][\da-fA-F]+)|([lg]t|[LG]T|[lr]brac[ke]|nbsp|amp|AMP|quot|QUOT));/gu,(o,r,e)=>r?String.fromCodePoint(+((/^x/iu.test(r)?"0":"")+r)):Od[e.toLowerCase()]),jr=o=>(Ln!=null||(Ln=qd),Ln(o)),uo=Br(/&#(\d+|x[\da-f]+);/giu,(o,r)=>String.fromCodePoint(+((/^x/iu.test(r)?"0":"")+r))),_d={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},Wd=(o=/[&<>"{}[\]|]/gu)=>Br(o,r=>`&${_d[r]};`),hu=Wd(/[&<>]/gu)});var po=io((xu,Dd)=>{Dd.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","#isbn":"isbn","#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:[]}});var fo,Or,yi,Nn=w(()=>{"use strict";fo=new Set(["alt","link","lang","page","caption"]),Or=new Set(["tiff","tif","png","gif","jpg","jpeg","webp","xcf","pdf","svg","djvu"]),yi=po()});function Be(o){let r=new Map,e=new WeakMap;return t=>{let n=typeof t=="string"?r:e;if(n.has(t)){let s=n.get(t);return s.lastIndex=0,s}let i=o(t);return n.set(t,i),i}}var At,$n,Ti,Md,co,ze=w(()=>{"use strict";At=o=>decodeURIComponent(o.replace(/%(?![\da-f]{2})/giu,"%25"));$n=o=>{let r=[],e=0;for(let t of o.split(`
|
|
2
|
+
`)){let n=e+t.length;r.push([t,e,n]),e=n+1}return r},Ti=o=>o&&Number(o[1]),Md=(o,r)=>{var n;let e,t=i=>{e!=null||(e=$n(o));let s=e.findIndex(([,,a])=>i<=a)+1;return{line:s,column:i-e[s-1][1]+1}};for(let i of r){let{line:s,column:a,from:l,to:u}=i;l==null?s?(e!=null||(e=$n(o)),(n=i.column)!=null||(i.column=1),i.from=e[s-1][1]+(i.column-1)):(i.from=0,i.line=1,i.column=1):(!s||!a)&&Object.assign(i,t(l)),u!==void 0&&({line:i.endLine,column:i.endColumn}=t(u)),i.position=i.from}return r},co=(o,r)=>{if(r||o.trim())try{JSON.parse(o)}catch(e){let{message:t}=e,n=Ti(/\bline (\d+)/u.exec(t)),i=Ti(/\bcolumn (\d+)/u.exec(t)),s=Ti(/\bposition (\d+)/u.exec(t));return Md(o,[{message:t,line:n,column:i,from:s,severity:"error"}])}return[]}});var qr,Zt,_r,Wr,ki,W,se=w(()=>{"use strict";W=class{constructor(r,e){S(this,Wr);S(this,qr);S(this,Zt);S(this,_r);C(this,qr,r),C(this,Zt,e)}get start(){return m(this,Zt)}get top(){return I(this,Wr,ki).call(this).top}get left(){return I(this,Wr,ki).call(this).left}};qr=new WeakMap,Zt=new WeakMap,_r=new WeakMap,Wr=new WeakSet,ki=function(){var r;return(r=m(this,_r))!=null||C(this,_r,m(this,qr).getRootNode().posFromIndex(m(this,Zt))),m(this,_r)}});var Ud,zd,In,vi,mo,j,F,me,er,O,Fn,Le,Rn,Pn,Bn,st,Ge,jn,je,ho,z=w(()=>{"use strict";ze();Se();se();D();Ud=new Set(["tr","td","th","caption"]),zd=new Set(["Template:!!","Template:!-"]),In=o=>{let r=o.childNodes.find(e=>e.text().trim());if(!r||r.type==="text"&&r.data.trim().startsWith("!")||r.is("magic-word")&&r.name==="!"||r.is("template")&&zd.has(r.name)||r.is("html")&&Ud.has(r.name))return!1;if(r.is("arg"))return r.length>1&&In(r.childNodes[1]);if(r.is("magic-word"))try{let e=r.getPossibleValues().map(In);return e.includes(2)?2:e.includes(1)&&1}catch(e){}return r.is("template")||r.is("magic-word")&&r.name==="invoke"?1:2},vi=(o,r,e,t)=>({line:o+e-1,character:(e===1?r:0)+t}),mo=o=>(r,e,t,n,i="error")=>{let{start:s}=e,{top:a,left:l}=e instanceof W?e:new W(r,s),{offsetHeight:u,offsetWidth:g}=r,{startIndex:d,startLine:p,startCol:c}=o(r,s,a,l),{line:f,character:h}=vi(p,c,u,g);return{rule:t,message:v.msg(n),severity:i,startIndex:d,endIndex:d+r.toString().length,startLine:p,endLine:f,startCol:c,endCol:h}},j=mo((o,r,e,t)=>{let n=o.getRelativeIndex(),{top:i,left:s}=o.parentNode.posFromIndex(n);return{startIndex:r+n,startLine:e+i,startCol:i?s:t+s}}),F=mo((o,r,e,t)=>({startIndex:r,startLine:e,startCol:t})),me=(o,r,e,t=0)=>({desc:v.msg(r),range:[o.startIndex+t,o.endIndex],text:e}),er=(o,r,e)=>({desc:v.msg(r),range:[o,o],text:e}),O=(o,r=0,e="")=>typeof o=="number"?{desc:v.msg("remove"),range:[o,o+r],text:e}:me(o,"remove",e,r),Fn=(o,r)=>me(o,"decode",At(r.text().replace(/%(?=21|3[ce]|5[bd]|7[b-d])/giu,"%25"))),Le=(o,r,e=0)=>({desc:v.msg("close"),range:[o+e,o],text:r}),Rn=o=>({desc:v.msg("open"),range:[o+1,o+2],text:""}),Pn=(o,r)=>me(o,"comment",`<!--${r}-->`),Bn=(o,r)=>me(o,"uppercase",r.toUpperCase()),st=(o,r=0)=>({desc:v.msg("whitespace"),range:[o,o+r],text:" "}),Ge=(o,r,e=1)=>({desc:v.msg("escape"),range:[o,o+e],text:r.repeat(e)}),jn=(o,r)=>({desc:v.msg("escape"),range:[o,o+r.length],text:r.replace(/\|/gu,"|")}),je=(o,r,e,t)=>{if(o&&(t||v.viewOnly&&o[0]===oe.rev))return o[1];let n=r();return(t||v.viewOnly)&&e([oe.rev,n]),n},ho=(o,r)=>o==="ol"&&r==="type"?["1","a","A","i","I"]:o==="th"&&r==="scope"?["row","col","rowgroup","colgroup"]:r==="dir"?["ltr","rtl","auto"]:r==="aria-hidden"?["true","false"]:[]});var Gd,On,Ai=w(()=>{"use strict";Gd=o=>{if(o.includes("#")){let r=o.indexOf("#"),e=o.slice(0,r),t=o.slice(r+1);return(n,i)=>(r===0||n===e)&&i===t}return r=>r===o},On=(o,r,e)=>{if(o=o.trim(),!o)return(()=>!0);let t=o.split(",").map(n=>n.trim()).filter(n=>n!=="").map(Gd);return(({type:n,name:i})=>t.some(s=>s(n,i)))}});var xo=io(($u,bo)=>{bo.exports=function(o,r,e,t,n){var i,s;if(t===void 0)t=0;else if(t=t|0,t<0||t>=o.length)throw new RangeError("invalid lower bound");if(n===void 0)n=o.length-1;else if(n=n|0,n<t||n>=o.length)throw new RangeError("invalid upper bound");for(;t<=n;)if(i=t+(n-t>>>1),s=+e(o[i],r,i,o),s<0)t=i+1;else if(s>0)n=i-1;else return i;return~t}});var yo,To,ko=w(()=>{"use strict";yo=Pd(xo()),To=(o,r,e)=>{let t=(0,yo.default)(o,r,e);return t<0?~t:t}});var tr,qn=w(()=>{"use strict";z();tr=(o=!0)=>r=>{let e=new WeakMap;return function(...t){return je(e.get(this),()=>r.apply(this,t),n=>{e.set(this,n)},o)}}});var vo,Ao=w(()=>{"use strict";vo=o=>{class r extends o{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 r}});var So,Co,Mr,rr,nr,Ur,ir,sr,Dr,Oe,Si=w(()=>{"use strict";ze();ko();z();Se();qn();Ao();D();Co=[vo],So=[tr(!1)];Oe=class{constructor(){R(Dr,5,this);ce(this,"childNodes",[]);S(this,Mr);S(this,rr);S(this,nr);S(this,Ur);S(this,ir);S(this,sr,{})}get parentNode(){return m(this,Mr)}get nextSibling(){return m(this,rr)}get previousSibling(){return m(this,nr)}getChildNodes(){let{childNodes:r}=this;return Object.isFrozen(r)?[...r]:r}getAttribute(r){return r==="padding"?0:this[r]}setAttribute(r,e){switch(r){case"parentNode":C(this,Mr,e),e||(C(this,rr,void 0),C(this,nr,void 0));break;case"nextSibling":C(this,rr,e);break;case"previousSibling":C(this,nr,e);break;case"aIndex":v.viewOnly&&C(this,ir,[oe.rev,e]);break;default:this[r]=e}}getRootNode(){return je(m(this,Ur),()=>{var r,e;return(e=(r=this.parentNode)==null?void 0:r.getRootNode())!=null?e:this},r=>{let[,e]=r;e.type==="root"&&C(this,Ur,r)})}indexFromPos(r,e){{if(r<0||e<0)return;let t=this.getLines();if(r>=t.length)return;let[,n,i]=t[r],s=n+e;return s>i?void 0:s}}posFromIndex(r){{let{length:e}=String(this);if(r+=r<0?e:0,r>=0&&r<=e){let t=this.getLines(),n=To(t,r,([,,i],s)=>i-s);return{top:n,left:r-t[n][1]}}return}}getDimension(){{let r=this.getLines(),e=r[r.length-1];return{height:r.length,width:e[2]-e[1]}}}getGaps(r){return 0}getRelativeIndex(r){if(r===void 0){let{parentNode:e}=this;return e?e.getRelativeIndex(e.childNodes.indexOf(this)):0}return je(m(this,sr)[r],()=>{let{childNodes:e}=this,t=r+(r<0?e.length:0),n=this.getAttribute("padding");for(let i=0;i<t;i++)v.viewOnly&&(m(this,sr)[i]=[oe.rev,n]),n+=e[i].toString().length+this.getGaps(i);return n},e=>{m(this,sr)[r]=e})}getAbsoluteIndex(){return je(m(this,ir),()=>{let{parentNode:r}=this;return r?r.getAbsoluteIndex()+this.getRelativeIndex():0},r=>{C(this,ir,r)})}getBoundingClientRect(){this.lspError("AstNode.getBoundingClientRect")}is(r){return this.type===r}getLines(){return $n(String(this))}seal(r,e){}lspError(r){throw new Error(`${r} method is only available in the LSP version!`)}};Dr=B(null),Mr=new WeakMap,rr=new WeakMap,nr=new WeakMap,Ur=new WeakMap,ir=new WeakMap,sr=new WeakMap,P(Dr,1,"getLines",So,Oe),Oe=P(Dr,0,"AstNode",Co,Oe),R(Dr,1,Oe)});var wo,Eo=w(()=>{"use strict";Ai();wo=o=>{var r,Ci;{class t extends o{constructor(){super(...arguments);S(this,r)}getElementBy(s){let a=[...this.childNodes].reverse();for(;a.length>0;){let l=a.pop(),{type:u,childNodes:g}=l;if(u!=="text"){if(s(l))return l;for(let d=g.length-1;d>=0;d--)a.push(g[d])}}}querySelector(s){return this.getElementBy(I(this,r,Ci).call(this,s))}getElementsBy(s){let a=[...this.childNodes].reverse(),l=[];for(;a.length>0;){let u=a.pop(),{type:g,childNodes:d}=u;if(g!=="text"){s(u)&&l.push(u);for(let p=d.length-1;p>=0;p--)a.push(d[p])}}return l}querySelectorAll(s){return this.getElementsBy(I(this,r,Ci).call(this,s))}escape(){}}return r=new WeakSet,Ci=function(s){return On(s,this)},t}}});var Lo,wi,Hd,St,No=w(()=>{"use strict";ae();Se();Ai();Si();Eo();Lo=[wo];St=class extends(Hd=Oe){get length(){return this.childNodes.length}text(r){return Ee(this.childNodes,r)}removeAt(r){this.lspError("AstElement.removeAt")}insertAt(r,e=this.length){return _n(this,e,0,[r]),r}closest(r){let e=On(r,this),{parentNode:t}=this;for(;t;){if(e(t))return t;({parentNode:t}=t)}}isInside(r){var e;return((e=this.closest(`${r},ext`))==null?void 0:e.type)===r}append(...r){this.safeAppend(r)}safeAppend(r){for(let e of r)this.insertAt(e)}safeReplaceChildren(r){}setText(r,e=0){e+=e<0?this.length:0;let t=this.childNodes[e],{data:n}=t;return t.replaceData(r),n}toString(r,e=""){return this.childNodes.map(t=>t.toString(r)).join(e)}caretPositionFromIndex(r){this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(r){this.lspError("AstElement.elementFromIndex")}elementFromPoint(r,e){this.lspError("AstElement.elementFromPoint")}lint(r=this.getAbsoluteIndex(),e){{let t=[];for(let n=0,i=r+this.getAttribute("padding");n<this.length;n++){let s=this.childNodes[n];s.setAttribute("aIndex",i);let a=s.lint(i,e);a.length>0&&Array.prototype.push.apply(t,a),i+=s.toString().length+this.getGaps(n)}return t}}print(r={}){}json(r,e=1/0,t=this.getAbsoluteIndex()){}};wi=B(Hd),St=P(wi,0,"AstElement",Lo,St),R(wi,1,St)});var Ei,Io,Vd,Qd,Xd,Jd,$o,Kd,Wn,Fo,zr,Ro=w(()=>{"use strict";ae();z();D();Si();Ei=String.raw`[${Ie}\t]*`,Io=String.raw`<(?:/[^\S\n]*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|\n={2,}`,Vd=new RegExp(String.raw`${Io}|https?[:/]/+|(?:rfc|pmid)(?=[-::]?${Ei}\d)|isbn(?=[-::]?${Ei}(?:\d(?:${Ei}|-)){6})`,"giu"),Qd=new RegExp(Io,"giu"),Xd=new Set(["attr-value","ext-link-text","link-text"]),Jd={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},$o=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"]),Kd=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch(o){return/\w/u}})(),zr=class extends Oe{constructor(e){super();S(this,Wn);ce(this,"data","");this.data=e}get type(){return"text"}toString(e){var t;return e&&!((t=this.parentNode)!=null&&t.getAttribute("built"))?re(this.data):this.data}text(){return this.data}lint(e=this.getAbsoluteIndex(),t){var n,i,s;{if(t===!1)return[];let{data:a,parentNode:l,nextSibling:u,previousSibling:g}=this;if(!l)throw new Error("An isolated text node cannot be linted!");let{type:d,parentNode:p}=l;if(d==="attr-value"){let{name:_,tag:U}=p;if(U==="ref"&&(_==="name"||_==="follow")||_==="group"&&(U==="ref"||U==="references")||U==="choose"&&(_==="before"||_==="after"))return[]}if(t!=null||(t=l.isPlain()&&!Xd.has(d)?Vd:Qd),a.search(t)===-1)return[];t.lastIndex=0;let c=[],f=u==null?void 0:u.type,h=u==null?void 0:u.name,x=g==null?void 0:g.type,T=this.getRootNode(),b=T.toString(),{ext:y,html:k,variants:A}=T.getAttribute("config"),{top:N,left:E}=T.posFromIndex(e),{lintConfig:$}=v,H=$.rules["tag-like"],q=typeof H=="object"&&H[1]?new Set(Object.keys(H[1]).filter(_=>_!=="invalid"&&_!=="disallowed")):new Set,K=new Set(["onlyinclude","noinclude","includeonly",...y,...k[0],...k[1],...k[2],...q,...$.getSeverity("tag-like","disallowed")?$o:[]]);for(let _=t.exec(a);_;_=t.exec(a)){let{index:U,0:M}=_,[,be,Jt]=_,bt=M==="["&&d==="ext-link-text";if(Jt&&Jt!=="]"){let{length:ie}=Jt;U+=ie,M=M.slice(ie)}else{if(M.startsWith("<")&&!K.has(be.toLowerCase())||bt&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(a.slice(U+1))||u!=null&&u.is("ext")&&h==="nowiki"&&((n=u.innerText)!=null&&n.includes("]"))))continue;M.startsWith(`
|
|
3
|
+
==`)&&(U++,M=M.slice(1))}M=M.toLowerCase();let[Y]=M,xt=M==="rfc"||M==="pmid"||M==="isbn",Ir=Y==="{",di=Y==="}",Qs=Y==="[",gi=Y==="]",{length:it}=M;gi&&(U||it>1)&&t.lastIndex--;let Kt=e+U,yt=Kt+it,fe,Pe,An,Sn,Tt=b[yt],ui=b[Kt-1],pi=Ir||Qs,fi=M==="{"&&ui==="-"&&A.length>0,ci=M==="}"&&Tt==="-"&&A.length>0,Xs=Qs&&f==="free-ext-link"&&!a.slice(U+1).trim()||gi&&x==="free-ext-link"&&!a.slice(0,U).includes("]");if(xt)fe="lonely-http",M=M.toUpperCase(),Pe=$.getSeverity(fe,M);else if(Y==="<"){fe="tag-like";let ie;/^<\/?\s/u.test(M)||!/[\s/>]/u.test(Tt!=null?Tt:"")?ie="invalid":q.has(be)?ie=be:$o.has(be)&&!y.includes(be)&&(ie="disallowed"),Pe=$.getSeverity(fe,ie)}else if(Y==="=")fe="syntax-like",Pe=$.getSeverity(fe,"heading");else if(fi||ci)fe="lonely-bracket",Pe=$.getSeverity(fe,"converter"),fi&&U>0?(M="-{",U--,Kt--,it=2):ci&&U<a.length-1&&(M="}-",yt++,it=2);else if(Xs)fe="lonely-bracket",Pe=$.getSeverity(fe,"extLink");else if(pi||di||gi)if(fe="lonely-bracket",it>1||Ir&&Tt===Y||di&&ui===Y)Pe=$.getSeverity(fe,"double");else{if(!bt){let ie=Jd[Y],we=pi?a.slice(U+1):a.slice(0,U);if(Ir&&((i=ie.exec(we))==null?void 0:i[0])==="}"||di&&((s=ie.exec(we))==null?void 0:s[0])==="{")continue;if(!we.includes(Y)){let We=pi?"nextSibling":"previousSibling",$e=this[We];for(;$e&&($e.type!=="text"||!ie.test($e.data));)$e=$e[We];if($e&&ie.exec($e.data)[0]!==Y)continue}}Pe=$.getSeverity(fe,"single")}else fe="lonely-http",Pe=$.getSeverity(fe);if(!Pe)continue;let Js=this.posFromIndex(U),{line:Ks,character:Ys}=vi(N,E,Js.top+1,Js.left);if(Y==="="){let ie=a.indexOf(`
|
|
4
|
+
`,U),we=u,We;if(ie===-1){let $e=0;for(;we&&!(we.type==="text"&&($e=we.data.indexOf(`
|
|
5
|
+
`),$e!==-1));)we=we.nextSibling;if(!we)continue;We=we.data.slice(0,$e)}else We=a.slice(U+it,ie);if(!/(?:^|[^=])=+\s*(?:\S\s*)?$/u.test(We))continue;ie===-1?(yt=we.getAbsoluteIndex()+We.length,{top:An,left:Sn}=T.posFromIndex(yt)):(yt+=We.length,it+=We.length)}let kt={rule:fe,message:v.msg(Y==="="?"header-like":"lonely",xt||Y==="h"||fi||ci?M:Y),severity:Pe,startIndex:Kt,endIndex:yt,startLine:Ks,endLine:An!=null?An:Ks,startCol:Ys,endCol:Sn!=null?Sn:Ys+it};if($.computeEditInfo)if(Y==="<")kt.suggestions=[Ge(Kt,"<")];else if(Y==="h"&&d!=="link-text"&&Kd.test(ui||""))kt.suggestions=[st(Kt)];else if(bt){let ie=l.getAbsoluteIndex()+l.toString().length;kt.suggestions=[Ge(ie,"]")]}else if(M==="]"&&Xs){let ie=e-g.toString().length;kt.suggestions=[er(ie,"left-bracket","[")]}else xt&&(kt.suggestions=[..._[0]===M?[]:[Bn(kt,M)],...Tt===":"||Tt===":"?[st(yt,1)]:[]]);c.push(kt)}return c}}replaceData(e){I(this,Wn,Fo).call(this,e)}splitText(e){this.lspError("AstText.splitText")}escape(){}print(){}};Wn=new WeakSet,Fo=function(e){this.setAttribute("data",e)}});var ve,ot=w(()=>{"use strict";ve=(o=!0,r=!0)=>e=>{class t extends e{text(){return""}lint(i){return o?[]:super.lint(i)}}return t}});var Q,xe=w(()=>{"use strict";Q=o=>{}});var Gr,he,at=w(()=>{"use strict";G();he=class extends L{constructor(e,t,n,i,s){super(e,n,i,s);S(this,Gr);C(this,Gr,t)}get type(){return m(this,Gr)}lint(e=this.getAbsoluteIndex()){return super.lint(e,!1)}};Gr=new WeakMap});var ue,qe=w(()=>{"use strict";ue=({length:o})=>r=>{class e extends r{getAttribute(n){return n==="padding"?o:super.getAttribute(n)}}return e}});var or,pe,lt=w(()=>{"use strict";G();pe=class extends L{constructor(e,t,n,i,s){super(e,n,i,s);S(this,or);C(this,or,t)}get type(){return m(this,or)}set type(e){C(this,or,e)}getAttribute(e){var t;return e==="invalid"?this.type==="converter-flag"&&!!((t=this.parentNode)!=null&&t.isInvalidFlag(this)):super.getAttribute(e)}};or=new WeakMap});var Po,ar,He,dt,Dn,Bo,Li,Yd,ye,lr=w(()=>{"use strict";z();Se();se();qe();xe();D();G();lt();Po=[Q,ue("[[")];ye=class extends(Yd=L){constructor(e,t,n,i=[],s="|"){super(void 0,n,i,{});S(this,Dn);S(this,ar,!0);S(this,He);S(this,dt);if(this.insertAt(new pe(e,"link-target",n,i,{})),t!==void 0){let a=new L(t,n,i,{});a.type="link-text",a.setAttribute("stage",10),this.insertAt(a)}C(this,He,s)}get link(){}get fragment(){}afterBuild(){C(this,dt,this.getTitle()),m(this,He).includes("\0")&&C(this,He,this.buildFromStr(m(this,He),0)),I(this,Dn,Bo).call(this),super.afterBuild()}setAttribute(e,t){e==="bracket"?C(this,ar,t):e==="title"?C(this,dt,t):super.setAttribute(e,t)}toString(e){let t=super.toString(e,m(this,He));return m(this,ar)?`[[${t}]]`:t}text(){let e=super.text("|");return m(this,ar)?`[[${e}]]`:e}getAttribute(e){return e==="title"?m(this,dt):super.getAttribute(e)}getGaps(e){return e===0?m(this,He).length:1}lint(e=this.getAbsoluteIndex(),t){{let n=super.lint(e,t),{childNodes:[i,s],type:a}=this,{encoded:l,fragment:u}=m(this,dt),{lintConfig:g}=v,{computeEditInfo:d,fix:p}=g,c=new W(this,e),f="unknown-page",h=g.getSeverity(f);if(h&&i.childNodes.some(({type:x})=>x==="template")&&n.push(j(i,c,f,"template-in-link",h)),f="url-encoding",h=g.getSeverity(f),h&&l){let x=j(i,c,f,"unnecessary-encoding",h);(d||p)&&(x.fix=Fn(x,i)),n.push(x)}if(f="pipe-like",h=g.getSeverity(f,"link"),h&&(a==="link"||a==="category")){let x=s==null?void 0:s.childNodes.findIndex(b=>b.type==="text"&&b.data.includes("|")),T=s==null?void 0:s.childNodes[x];if(T){let b=j(s,c,f,"pipe-in-link",h);if(d){let y=b.startIndex+s.getRelativeIndex(x);b.suggestions=[jn(y,T.data)]}n.push(b)}}if(f="no-ignored",h=g.getSeverity(f,"fragment"),h&&u!==void 0&&!jo(a)){let x=j(i,c,f,"useless-fragment",h);if(d||p){let T=i.childNodes.findIndex(y=>y.type==="text"&&y.data.includes("#")),b=i.childNodes[T];b&&(x.fix=O(x,i.getRelativeIndex(T)+b.data.indexOf("#")))}n.push(x)}return n}}getTitle(e,t){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:t,temporary:e,decode:!0,selfLink:!0})}print(){}json(e,t,n=this.getAbsoluteIndex()){}};Li=B(Yd),ar=new WeakMap,He=new WeakMap,dt=new WeakMap,Dn=new WeakSet,Bo=function(){this.type!=="ext-inner"&&this.setAttribute("name",m(this,dt).title)},ye=P(Li,0,"LinkBaseToken",Po,ye),R(Li,1,ye)});var Oo,Ni,Zd,le,gt=w(()=>{"use strict";xe();G();Oo=[Q];le=class extends(Zd=L){get innerText(){return this.firstChild.data}constructor(r="",e,t){super(r,e,t)}};Ni=B(Zd),le=P(Ni,0,"NowikiBaseToken",Oo,le),R(Ni,1,le)});var qo,$i,eg,de,Ct=w(()=>{"use strict";z();ot();D();gt();qo=[ve(!1)];de=class extends(eg=le){get type(){return"noinclude"}toString(r){return r?"":super.toString()}lint(r=this.getAbsoluteIndex()){{let{lintConfig:e}=v,t="no-ignored",n=e.getSeverity(t,"include");if(n){let{innerText:i}=this,s=/^<(includeonly|(?:no|only)include)\s+(?:[^\s>/]|\/(?!>))[^>]*>$/iu.exec(i);if(s){let a=F(this,{start:r},t,"useless-attribute",n),{computeEditInfo:l}=e,u=s[1].length+1,g=i.endsWith("/>")?2:1;return a.startIndex+=u,a.startCol+=u,a.endIndex-=g,a.endCol-=g,l&&(a.suggestions=[O(a)]),[a]}}return[]}}};$i=B(eg),de=P($i,0,"NoincludeToken",qo,de),R($i,1,de)});var Mn,_o=w(()=>{"use strict";z();D();lr();Ct();Mn=class extends ye{get type(){return"redirect-target"}constructor(r,e,t,n){super(r,void 0,t,n),e!==void 0&&this.insertAt(new de(e,t,n))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,{halfParsed:!0,decode:!0,page:""})}lint(r=this.getAbsoluteIndex()){{let e=super.lint(r,!1),t="no-ignored",{lintConfig:n}=v,i=n.getSeverity(t,"redirect");if(i&&this.length===2){let s=j(this.lastChild,{start:r},t,"useless-link-text",i);s.startIndex--,s.startCol--,(n.computeEditInfo||n.fix)&&(s.fix=O(s)),e.push(s)}return e}}}});var Wo,Et,Hr,Ii,tg,wt,Do=w(()=>{"use strict";ot();xe();G();at();_o();Wo=[ve(!1,!1),Q];wt=class extends(tg=L){constructor(e,t,n,i,s,a,l=[]){super(void 0,a,l);S(this,Et);S(this,Hr);C(this,Et,e),C(this,Hr,s),this.append(new he(t,"redirect-syntax",a,l),new Mn(n,i==null?void 0:i.slice(1),a,l))}get type(){return"redirect"}getAttribute(e){return e==="padding"?m(this,Et).length:super.getAttribute(e)}toString(e){return m(this,Et)+super.toString(e)+m(this,Hr)}lint(e=this.getAbsoluteIndex()){{let t=e+m(this,Et).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",t),this.lastChild.lint(t)}}print(){}};Ii=B(tg),Et=new WeakMap,Hr=new WeakMap,wt=P(Ii,0,"RedirectToken",Wo,wt),R(Ii,1,wt)});var Mo={};Z(Mo,{parseRedirect:()=>rg});var rg,Uo=w(()=>{"use strict";D();Do();rg=(o,r,e)=>{var n;(n=r.regexRedirect)!=null||(r.regexRedirect=new RegExp(String.raw`^(\s*)((?:${r.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));let t=r.regexRedirect.exec(o);return t&&v.normalizeTitle(t[3],0,!1,r,{halfParsed:!0,temporary:!0,decode:!0,page:""}).valid?(o=`\0${e.length}o${o.slice(t[0].length)}`,new wt(...t.slice(1),r,e),o):!1}});var zo,Fi,ng,Lt,Go=w(()=>{"use strict";qe();xe();G();zo=[Q,ue("<onlyinclude>")];Lt=class extends(ng=L){get type(){return"onlyinclude"}toString(r){return`<onlyinclude>${super.toString(r)}</onlyinclude>`}isPlain(){return!0}print(){}};Fi=B(ng),Lt=P(Fi,0,"OnlyincludeToken",zo,Lt),R(Fi,1,Lt)});var ut,Vr=w(()=>{"use strict";ut=(o=1)=>r=>{class e extends r{getGaps(){return o}}return e}});var Ho,Nt,pt,Ri,ig,Fe,Un=w(()=>{"use strict";Vr();xe();G();Ho=[ut(),Q];Fe=class extends(ig=L){constructor(e,t,n,i,s,a=[]){super(void 0,s);S(this,Nt);S(this,pt);ce(this,"closed");this.setAttribute("name",e.toLowerCase()),C(this,Nt,[e,i||e]),this.closed=i!=="",C(this,pt,i===void 0),this.append(t,n);let l=typeof t=="string"?-1:a.indexOf(t);a.splice(l===-1?1/0:l,0,this)}get innerText(){return m(this,pt)?void 0:this.lastChild.text()}get selfClosing(){return m(this,pt)}toString(e){let{firstChild:t,lastChild:n}=this,[i,s]=m(this,Nt);return m(this,pt)?`<${i}${t.toString(e)}/>`:`<${i}${t.toString(e)}>${n.toString(e)}${this.closed?`</${s}>`:""}`}text(){let[e,t]=m(this,Nt);return m(this,pt)?`<${e}${this.firstChild.text()}/>`:`<${e}${super.text(">")}${this.closed?`</${t}>`:""}`}getAttribute(e){return e==="padding"?m(this,Nt)[0].length+1:super.getAttribute(e)}print(){}json(e,t,n=this.getAbsoluteIndex()){}};Ri=B(ig),Nt=new WeakMap,pt=new WeakMap,Fe=P(Ri,0,"TagPairToken",Ho,Fe),R(Ri,1,Fe)});var Vo,Pi,sg,$t,Qo=w(()=>{"use strict";z();se();ot();D();Un();Vo=[ve(!1)];$t=class extends(sg=Fe){get type(){return"include"}constructor(r,e="",t,n,i,s){super(r,e,t!=null?t:"",t===void 0||n!=null?n:"",i,s)}toString(r){return r?"":super.toString()}lint(r=this.getAbsoluteIndex()){{let e=[],{firstChild:t,closed:n,name:i}=this,s=new W(this,r),a=["no-ignored","unclosed-comment"],{lintConfig:l}=v,{computeEditInfo:u}=l,g=a.map(d=>l.getSeverity(d,"include"));if(g[0]&&t.data.trim()){let d=j(t,s,a[0],"useless-attribute",g[0]);u&&(d.suggestions=[O(d)]),e.push(d)}if(g[1]&&!n){let d=F(this,s,a[1],v.msg("unclosed",`<${i}>`),g[1]);u&&(d.suggestions=[Le(d.endIndex,`</${i}>`)]),e.push(d)}return e}}};Pi=B(sg),$t=P(Pi,0,"IncludeToken",Vo,$t),R(Pi,1,$t)});var dr,zn=w(()=>{"use strict";dr=(o=0)=>r=>{var e,Xo;{class n extends r{constructor(){super(...arguments);S(this,e)}hasAttr(a){this.lspError("AttributesParent.hasAttr")}getAttr(a){return I(this,e,Xo).call(this).getAttr(a)}}return e=new WeakSet,Xo=function(){return this.childNodes[o]},n}}});var ne,Jo,Ko,Gn,ji,Yo,Hn,ra,na,ia,Bi,Zo,ea,ta,It,sa,oa,aa,la,da,Oi=w(()=>{"use strict";ne=new Set(["align"]),Jo=new Set(["cite"]),Ko=new Set(["cite","datetime"]),Gn=new Set(["width"]),ji=new Set(["axis","align","bgcolor","height","width","valign"]),Yo=new Set([...ji,"abbr","headers","scope","rowspan","colspan"]),Hn=new Set(["type"]),ra=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),na=new Set(["clear"]),ia=new Set(["bgcolor","align","valign"]),Bi=new Set(["id","qid","forcemathmode","type","display"]),Zo=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),ea=new Set(["weight"]),ta=new Set(["width","height","zoom","latitude","longitude","align","mapstyle","lang","alt","text"]),It=new Set,sa=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"]),oa={div:ne,h1:ne,h2:ne,h3:ne,h4:ne,h5:ne,h6:ne,blockquote:Jo,q:Jo,p:ne,br:na,pre:Gn,ins:Ko,del:Ko,ul:Hn,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...ra,"border"]),caption:ne,tr:ia,td:Yo,th:Yo,font:new Set(["size","color","face"]),hr:Gn,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Hn,poem:ne,categorytree:ne,combooption:ne,img:new Set(["alt","src","width","height","loading","srcset"])},aa={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:It,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:ea,choicetemplate:ea,imagemap:It,inputbox:It,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:It,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([...Bi,"chem"]),chem:Bi,ce:Bi,hiero:It,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:Zo,syntaxhighlight:Zo,templatedata:It,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:It,mapframe:new Set([...ta,"frameless"]),maplink:new Set([...ta,"class"]),rss:new Set(["template","templatename","max","highlight","filter","filterout","reverse","date","item-max-length"]),"page-collection":new Set(["lang","name","description","end-date"])},la={table:ra,td:new Set([...ji,"scope"]),th:ji,br:na,caption:ne,div:ne,hr:Gn,h1:ne,h2:ne,h3:ne,h4:ne,h5:ne,h6:ne,li:Hn,p:ne,pre:Gn,tr:ia,ul:Hn},da={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"]}});var og,ag,lg,dg,Qr,gr,Te,Ve,Ft,ga,qi,ur,ua=w(()=>{"use strict";z();ae();Oi();se();D();G();lt();og=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,ag=/(?:^|\s|\*\/)(?:java|vb)script(?:\W|$)/iu,lg=new Set(["ext","arg","magic-word","template"]),dg=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),ur=class extends L{constructor(e,t,n,i,s,a="",l,u=[]){let g=new pe(n,"attr-key",s,u),d;if(n==="title"||t==="img"&&n==="alt")d=new L(l,s,u,{}),d.type="attr-value",d.setAttribute("stage",10);else if(t==="gallery"&&n==="caption"||t==="ref"&&n==="details"||(t==="mapframe"||t==="maplink")&&n==="text"||t==="choose"&&(n==="before"||n==="after")){let p=ge(V({},s),{excludes:[...s.excludes,"heading","html","table","hr","list"]});d=new L(l,p,u,{}),d.type="attr-value",d.setAttribute("stage",1)}else d=new pe(l,"attr-value",s,u,{});super(void 0,s,u);S(this,Ft);S(this,Qr);S(this,gr);S(this,Te);S(this,Ve);C(this,Qr,e),this.append(g,d),C(this,Te,a),C(this,Ve,[...i]),C(this,gr,t),this.setAttribute("name",Ue(re(n)))}get type(){return m(this,Qr)}get tag(){return m(this,gr)}get balanced(){return!m(this,Te)||m(this,Ve)[0]===m(this,Ve)[1]}afterBuild(){m(this,Te).includes("\0")&&C(this,Te,this.buildFromStr(m(this,Te),0)),this.parentNode&&C(this,gr,this.parentNode.name),I(this,Ft,ga).call(this),super.afterBuild()}toString(e){let[t="",n=""]=m(this,Ve);return m(this,Te)?super.toString(e,m(this,Te)+t)+n:this.firstChild.toString(e)}text(){return m(this,Te)?`${super.text(`${m(this,Te).trim()}"`)}"`:this.firstChild.text()}getGaps(){var e,t;return m(this,Te)?m(this,Te).length+((t=(e=m(this,Ve)[0])==null?void 0:e.length)!=null?t:0):0}lint(e=this.getAbsoluteIndex(),t){var n;{let i=super.lint(e,t),{balanced:s,firstChild:a,lastChild:l,name:u,tag:g}=this,d=new W(this,e),p=["unclosed-quote","obsolete-attr"],{lintConfig:c}=v,f=p.map(x=>c.getSeverity(x,u));if(f[0]&&!s){let x=j(l,d,p[0],"unclosed-quotes",f[0]);x.startIndex--,x.startCol--,c.computeEditInfo&&(x.suggestions=[Le(x.endIndex,m(this,Ve)[0])]),i.push(x)}let h=I(this,Ft,qi).call(this,e,d);return h&&i.push(h),f[1]&&((n=la[g])!=null&&n.has(u))&&i.push(j(a,d,p[1],"obsolete-attribute",f[1])),i}}getValue(){return m(this,Te)?this.lastChild.text().trim():this.type==="ext-attr"||""}escape(){}getAttribute(e){return e==="invalid"?I(this,Ft,qi).call(this):super.getAttribute(e)}print(){}json(e,t,n=this.getAbsoluteIndex()){}};Qr=new WeakMap,gr=new WeakMap,Te=new WeakMap,Ve=new WeakMap,Ft=new WeakSet,ga=function(){this.setAttribute("name",Ue(this.firstChild.text()))},qi=function(e,t){let{firstChild:n,lastChild:i,type:s,name:a,tag:l,parentNode:u}=this,g=!i.childNodes.some(({type:b})=>lg.has(b)),d=this.getValue(),p=aa[l],c=oa[l],{length:f}=this.toString(),h="illegal-attr",x,T;if({lintConfig:x}=v,{computeEditInfo:T}=x,!(p!=null&&p.has(a))&&!(c!=null&&c.has(a))&&(s==="ext-attr"?p||c:!/\{\{[^{]+\}\}/u.test(a))&&(s==="ext-attr"&&!c||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(a)&&(l==="meta"||l==="link"||!sa.has(a)))||(a==="itemtype"||a==="itemid"||a==="itemref")&&!(u!=null&&u.hasAttr("itemscope"))){if(e===void 0)return!0;{let b=x.getSeverity(h,"unknown");if(b){let y=j(n,t,h,"illegal-attribute-name",b);return T&&(y.suggestions=[O(e,f)]),y}}}else if(a==="style"&&typeof d=="string"&&og.test(d)){if(e===void 0)return!0;{h="insecure-style";let b=x.getSeverity(h);return b&&j(i,t,h,"insecure-style",b)}}else if(a==="tabindex"&&typeof d=="string"&&d!=="0"){if(e===void 0)return!0;{let b=x.getSeverity(h,"tabindex");if(b){let y=j(i,t,h,"nonzero-tabindex",b);return T&&(y.suggestions=[O(e,f),me(y,"0 tabindex","0")]),y}}}else if(typeof d=="string"&&((/^xmlns:[\w:.-]+$/u.test(a)||dg.has(a))&&ag.test(d)||g&&(a==="href"||l==="img"&&a==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(d))){if(e===void 0)return!0;{let b=x.getSeverity(h,"value");return b&&j(i,t,h,"illegal-attribute-value",b)}}else if(g&&s!=="ext-attr"){let b=ho(l,a),y=String(d).toLowerCase();if(b.length>0&&b.every(k=>k!==y)){if(e===void 0)return!0;{let k=x.getSeverity(h,"value");return k&&j(i,t,h,"illegal-attribute-value",k)}}}return!1}});var pa,gg,ug,Xr,Jr,_i,ft,Vn=w(()=>{"use strict";z();ae();se();D();G();lt();ua();pa=o=>o.slice(0,-1),gg=o=>`${pa(o)}-dirty`,ug=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch(o){return/[^\W_]/u}})(),ft=class extends L{constructor(e,t,n,i,s=[]){super(void 0,i,s,{});S(this,Jr);S(this,Xr);if(C(this,Xr,t),this.setAttribute("name",n),e){let 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,l="",u=a.exec(e),g=0,d=()=>{l&&(super.insertAt(new pe(l,gg(t),i,s,{})),l="")};for(;u;){let{index:p,0:c,1:f,2:h,3:x,4:T,5:b,6:y}=u;if(l+=e.slice(g,p),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(re(f).trim())){let k=T!=null?T:y,A=[x,b],N=new ur(pa(t),n,f,A,i,h,k,s);d(),super.insertAt(N)}else l+=c;({lastIndex:g}=a),u=a.exec(e)}l+=e.slice(g),d()}}get type(){return m(this,Xr)}afterBuild(){let{parentNode:e}=this;e!=null&&e.is("td")&&this.setAttribute("name",e.subtype),super.afterBuild()}getAttrTokens(e){return this.childNodes.filter(t=>t instanceof ur&&(!e||t.name===Ue(e)))}hasAttr(e){return this.getAttrTokens(e).length>0}getAttrToken(e){{let t=this.getAttrTokens(e);return t[t.length-1]}}getAttr(e){var t;return(t=this.getAttrToken(e))==null?void 0:t.getValue()}lint(e=this.getAbsoluteIndex(),t){{let n=super.lint(e,t),{parentNode:i,childNodes:s}=this,a=new Map,l=new Set,u=new W(this,e),g=["no-ignored","no-duplicate"],{lintConfig:d}=v,{computeEditInfo:p,fix:c}=d,f=["closingTag","invalidAttributes","nonWordAttributes"].map(x=>d.getSeverity(g[0],x));if(f[0]&&I(this,Jr,_i).call(this)){let x=F(this,u,g[0],"attributes-of-closing-tag",f[0]);if(p){let T=i.getAbsoluteIndex();x.suggestions=[O(x),Rn(T)]}n.push(x)}for(let x of s)if(x instanceof ur){let{name:T}=x;a.has(T)?(l.add(T),a.get(T).push(x)):a.set(T,[x])}else{let T=x.text().trim(),b=f[ug.test(T)?1:2];if(T&&b){let y=j(x,u,g[0],"invalid-attribute",b);p&&(y.suggestions=[O(y,0," ")]),n.push(y)}}let h=d.getSeverity(g[1],"attribute");if(h&&l.size>0)for(let x of l){let T=a.get(x).map(b=>{let y=b.getValue();return[b,y===!0?"":y]});Array.prototype.push.apply(n,T.map(([b,y],k)=>{let A=j(b,u,g[1],v.msg("duplicate-attribute",x),h);if(p||c){let N=O(A);!y||T.slice(0,k).some(([,E])=>E===y)?A.fix=N:p&&(A.suggestions=[N])}return A}))}return n}}escape(){}getAttribute(e){return e==="invalid"?I(this,Jr,_i).call(this):super.getAttribute(e)}print(){}};Xr=new WeakMap,Jr=new WeakSet,_i=function(){let{parentNode:e}=this;return(e==null?void 0:e.type)==="html"&&e.closing&&this.text().trim()!==""}});var fa={};Z(fa,{PreToken:()=>Wi});var Wi,ca=w(()=>{"use strict";G();Ct();Wi=class extends L{get type(){return"ext-inner"}constructor(r,e,t=[]){if(r){let n=/<nowiki>/giu,i=/<\/nowiki>/giu,{length:s}=n.source,a=n.exec(r);a&&(i.lastIndex=a.index+s);let l=i.exec(r),u=0,g="";for(;a&&l;)new de(a[0],e,t,!0),new de(l[0],e,t,!0),g+=`${r.slice(u,a.index)}\0${t.length-1}n${r.slice(a.index+s,l.index)}\0${t.length}n`,u=l.index+s+1,n.lastIndex=u,a=n.exec(r),a&&(i.lastIndex=a.index+s),l=i.exec(r);r=g+r.slice(u)}super(r,e,t,{}),this.setAttribute("stage",10)}isPlain(){return!0}lint(r=this.getAbsoluteIndex()){return super.lint(r,/<\s*\/\s*(pre)\b/giu)}}});var ct,Qn=w(()=>{"use strict";G();ct=class extends L{get type(){return"ext-inner"}toString(r){return super.toString(r,`
|
|
6
6
|
`)}text(){return super.text(`
|
|
7
7
|
`).replace(/\n\s*\n/gu,`
|
|
8
|
-
`)}getGaps(){return 1}print(){}}}
|
|
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:
|
|
11
|
-
`){c=
|
|
12
|
-
`)||(
|
|
13
|
-
)`:""}(\s*)$`,"u")),
|
|
14
|
-
`))!=null?
|
|
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
|
-
${
|
|
17
|
-
`)}getAttr(e){{
|
|
18
|
-
|}`,t){
|
|
19
|
-
`)
|
|
20
|
-
${
|
|
21
|
-
${
|
|
22
|
-
${
|
|
23
|
-
${
|
|
24
|
-
${
|
|
25
|
-
${
|
|
26
|
-
${
|
|
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]| |�*160;|�*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
|
|
29
|
-
`))},
|
|
30
|
-
`),
|
|
31
|
-
`))},
|
|
8
|
+
`)}getGaps(){return 1}print(){}}});var Xn,ma=w(()=>{"use strict";z();Oi();D();G();Xn=class extends L{get type(){return"param-line"}constructor(r,e,t,n,i){super(e,t,n,i),this.setAttribute("name",r)}lint(r=this.getAbsoluteIndex()){{let e="no-ignored",{lintConfig:t}=v,{name:n,childNodes:i}=this,s=t.getSeverity(e,n);if(!s)return[];let a=v.msg("invalid-parameter",n);if(i.some(({type:p})=>p==="ext"))return[F(this,{start:r},e,a,s)];let l=i.filter(({type:p})=>p!=="comment"&&p!=="include"&&p!=="noinclude"),u=n==="inputbox",g=u?l.findIndex(({type:p})=>p!=="text"):-1,d=l.slice(0,g===-1?void 0:g).map(String).join("").trim();if(d){u&&(d=d.toLowerCase());let p=d.indexOf("="),c=d.slice(0,p===-1?void 0:p).trim(),f=da[n];if(p===-1?g===-1||!f.some(h=>h.startsWith(c)):!f.includes(c)){let h=F(this,{start:r},e,a,s);return t.computeEditInfo&&(h.suggestions=[O(h)]),[h]}}return super.lint(r,!1)}}}});var ha={};Z(ha,{ParamTagToken:()=>Kr});var Kr,Di=w(()=>{"use strict";Yr();Qn();ma();Kr=class extends ct{constructor(r,e,t,n,i=[],s){super(void 0,n,i,{}),t&&this.safeAppend(t.split(`
|
|
9
|
+
`).map(a=>s?a:Rt(a,n,i,e)).map(a=>new Xn(r,a,n,i,{}))),i.splice(i.indexOf(this),1),i.push(this)}}});var ba,Zr,en,Ui,Mi,pg,Qe,zi=w(()=>{"use strict";z();Se();se();xe();D();G();at();ba=[Q];Qe=class extends(pg=L){constructor(e,t,n,i=[]){super(void 0,n,i);S(this,en);S(this,Zr);C(this,Zr,e);let s=new L(t[0],n,i);s.type="heading-title",s.setAttribute("stage",2);let a=new he(t[1],"heading-trail",n,i);this.append(s,a)}get type(){return"heading"}get level(){return m(this,Zr)}toString(e){let t=I(this,en,Ui).call(this);return t+this.firstChild.toString(e)+t+this.lastChild.toString(e)}text(){let e=I(this,en,Ui).call(this);return e+this.firstChild.text()+e}getAttribute(e){return e==="invalid"?this.inHtmlAttrs()===2:e==="padding"?this.level:super.getAttribute(e)}getGaps(){return this.level}lint(e=this.getAbsoluteIndex(),t){{let n=super.lint(e,t),{firstChild:i,level:s}=this,a=i.toString(),l=a.startsWith("="),u=l||a.endsWith("="),g=new W(this,e),d=this.inHtmlAttrs(),p=["h1","unbalanced-header","format-leakage"],{lintConfig:c}=v,{computeEditInfo:f,fix:h}=c,x=p.map(T=>c.getSeverity(T,"apostrophe"));if(x[0]&&this.level===1){let T=j(i,g,p[0],"<h1>",x[0]);f&&!u&&(T.suggestions=[me(T,"h2",`=${a}=`)]),n.push(T)}if(x[1]&&u){let T=v.msg("unbalanced-in-section-header",'"="'),b=j(i,g,p[1],T,x[1]);if(!(!f||a==="="))if(l){let[y]=/^=+/u.exec(a),k=s+y.length;b.suggestions=[{desc:`h${s}`,range:[b.startIndex,b.startIndex+y.length],text:""}],k<7&&b.suggestions.push({desc:`h${k}`,range:[b.endIndex,b.endIndex],text:y})}else{let y=/[^=](=+)$/u.exec(a)[1],k=s+y.length;b.suggestions=[{desc:`h${s}`,range:[b.endIndex-y.length,b.endIndex],text:""}],k<7&&b.suggestions.push({desc:`h${k}`,range:[b.startIndex,b.startIndex],text:y})}n.push(b)}if(d){let T="parsing-order",b=c.getSeverity(T,d===2?"heading":"templateInTable");b&&n.push(F(this,g,T,"header-in-html",b))}if(x[2]){let T=this.getRootNode().toString(),b=i.childNodes.filter(pr("quote")),y=b.filter(({bold:A})=>A),k=b.filter(({italic:A})=>A);if(y.length%2){let A=j(y[y.length-1],ge(V({},g),{start:e+s,left:g.left+s}),p[2],v.msg("unbalanced-in-section-header","bold-apostrophes"),x[2]);if(f||h){let N=e+s+a.length,E=O(A);T.slice(A.endIndex,N).trim()?f&&(A.suggestions=[E,Le(N,"'''")]):y.length===1&&k.length===0?A.fix=E:f&&(A.suggestions=[E])}n.push(A)}if(k.length%2){let A=j(k[k.length-1],{start:e+s},p[2],v.msg("unbalanced-in-section-header","italic-apostrophes"),x[2]);if(f||h){let N=e+s+a.length;T.slice(A.endIndex,N).trim()?f&&(A.suggestions=[Le(N,"''")]):k.length===1&&y.length===0?A.fix=O(A):f&&(A.suggestions=[O(A)])}n.push(A)}}return n}}print(){}json(e,t,n=this.getAbsoluteIndex()){}};Mi=B(pg),Zr=new WeakMap,en=new WeakSet,Ui=function(){return"=".repeat(this.level)},Qe=P(Mi,0,"HeadingToken",ba,Qe),R(Mi,1,Qe)});var fg,Jn,xa=w(()=>{"use strict";ae();z();D();G();fg=new RegExp(`https?://${De}${Me}$`,"iu"),Jn=class extends L{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){}constructor(r,e,t,n=[]){super(void 0,t,n);let i=new L(typeof r=="number"?void 0:r,t,n,{}),s=new L(e,t,n);i.type="parameter-key",i.setAttribute("stage",2),s.type="parameter-value",s.setAttribute("stage",2),this.append(i,s)}trimName(r,e=!0){let t=(typeof r=="string"?r:r.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",t),t}afterBuild(){if(!this.anon){let{parentNode:r,firstChild:e}=this,t=this.trimName(e);r&&r.getArgs(t,!1,!1).add(this)}super.afterBuild()}toString(r){return this.anon?this.lastChild.toString(r):super.toString(r,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(r=this.getAbsoluteIndex(),e){var t;{let n=super.lint(r,e),i="unescaped",{lintConfig:s}=v,a=s.getSeverity(i);if(a){let{firstChild:l}=this,u=(t=fg.exec(l.text()))==null?void 0:t[0];try{if(u&&new URL(u).search){let g=j(l,{start:r},i,"unescaped-query",a);g.startIndex=g.endIndex,g.startLine=g.endLine,g.startCol=g.endCol,g.endIndex++,g.endCol++,(s.computeEditInfo||s.fix)&&(g.fix=Ge(g.startIndex,"{{=}}")),n.push(g)}}catch(g){}}return n}}print(){}json(r,e,t=this.getAbsoluteIndex()){}}});var ya,tn,Pt,fr,Bt,cr,jt,Hi,Ta,Gi,cg,mt,ka=w(()=>{"use strict";ae();z();Se();se();Vr();xe();D();G();xa();lt();at();ya=[Q,ut()];mt=class extends(cg=L){constructor(e,t,n,i=[]){var T,b;let s,a=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(e);a&&(s=Number(a[1]),e=e.replace(`\0${s}h`,i[s].toString().replace(/^\n/u,"")));super(void 0,n,i,{});S(this,jt);ce(this,"modifier","");S(this,tn,"template");S(this,Pt,":");S(this,fr,!1);S(this,Bt,new Map);S(this,cr);let{parserFunction:l,variable:u,functionHook:g}=n,d=(T=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(e))==null?void 0:T[0];if(d)this.setAttribute("modifier",d),e=e.slice(d.length);else if(e.includes(":")){let[y,...k]=e.split(":"),[A]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((b=k[0])!=null?b:"");this.setModifier(`${y}:${A}`)&&(e=k.join(":").slice(A.length))}let p=e.search(/[::]/u),c=e[p]===":",f=p!==-1;if(f||t.length===0&&!m(this,fr)){let y=f?e.slice(0,p):e,k=f&&e.slice(p+1),A=re(y),N=f?A.slice(A.search(/\S/u))+(c?":":""):A.trim(),[,E,$]=va(N,l),H=!("functionHook"in n)||g.includes($),q=u.includes($);if(f?$&&H:q){this.setAttribute("name",$),C(this,tn,"magic-word"),c&&C(this,Pt,":");let K=new he(y,"magic-word-name",n,i);if(super.insertAt(K),k!==!1&&t.unshift([k]),this.name==="invoke")for(let _=0;_<2;_++){let U=t.shift();if(!U)break;let M=new pe(U.join("="),`invoke-${_?"function":"module"}`,n,i);super.insertAt(M)}}}if(this.type==="template"){let y=re(e).trim();if(!this.normalizeTitle(y,10,{halfParsed:!0,temporary:!0}).valid)throw i.pop(),new SyntaxError("Invalid template name");let k=new pe(e,"template-name",n,i,{});super.insertAt(k)}typeof s=="number"&&(i[s]=void 0);let h=this.isTemplate(),x=1;for(let y=0;y<t.length;y++){let k=t[y];h||this.name==="switch"&&y>0||this.name==="tag"&&y>1||(k[0]=k.join("="),k.length=1),k.length===1&&(k.unshift(x),x++),this.insertAt(new Jn(...k,n,i))}this.seal("modifier")}get type(){return m(this,tn)}get module(){}get function(){}setModifier(e){let[,,t,n]=this.getAttribute("config").parserFunction,i=re(e).trim();if(e&&!i.endsWith(":"))return!1;let s=i.slice(0,-1).toLowerCase(),a=t.includes(s),l=n.includes(s);return(m(this,fr)?a:l||!e)||(oe.running||this.length>1)&&(a||l||!e)?(this.setAttribute("modifier",e),C(this,fr,a),!!e):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0)),super.afterBuild(),this.isTemplate()&&this.type==="template"&&(C(this,cr,I(this,jt,Hi).call(this)),this.setAttribute("name",m(this,cr).title))}toString(e){let{childNodes:t,length:n,firstChild:i,modifier:s,type:a}=this;return`{{${s}${a==="magic-word"?i.toString(e)+(n===1?"":m(this,Pt))+t.slice(1).map(l=>l.toString(e)).join("|"):super.toString(e,"|")}}}`}text(){let{childNodes:e,length:t,firstChild:n,modifier:i,type:s,name:a}=this;return s==="magic-word"&&a==="vardefine"?"":`{{${i}${s==="magic-word"?n.text()+(t===1?"":m(this,Pt))+Ee(e.slice(1),"|"):super.text("|")}}}`}getAttribute(e){switch(e){case"padding":return this.modifier.length+2;case"title":return m(this,cr);case"colon":return m(this,Pt);default:return super.getAttribute(e)}}lint(e=this.getAbsoluteIndex(),t){{let n=super.lint(e,t);if(!this.isTemplate())return n;let{type:i,childNodes:s,length:a}=this,l=new W(this,e),{lintConfig:u}=v,{computeEditInfo:g}=u,d=i==="magic-word",p="no-ignored",c=u.getSeverity(p,"fragment");if(d&&!I(this,jt,Hi).call(this).valid)p="invalid-invoke",c=u.getSeverity(p,"name"),c&&n.push(j(s[1],l,p,"illegal-module",c));else if(c){let f=s[d?1:0],h=f.childNodes.findIndex(T=>T.type==="text"&&jr(T.data).includes("#")),x=f.childNodes[h];if(x){let T=j(f,l,p,"useless-fragment",c);g&&(T.suggestions=[O(T,f.getRelativeIndex(h)+x.data.indexOf("#"))]),n.push(T)}}if(p="invalid-invoke",c=u.getSeverity(p,"function"),c&&d&&a===2)return n.push(F(this,l,p,"missing-function",c)),n;if(p="no-duplicate",c=u.getSeverity(p,"parameter"),c){let f=this.getDuplicatedArgs().filter(([,x])=>!x[0].querySelector("ext")),h="duplicate-parameter";for(let[,x]of f)Array.prototype.push.apply(n,x.map(T=>{let b=j(T,l,p,h,c);return g&&(b.suggestions=[O(b,-1)]),b}))}return n}}insertAt(e,t=this.length){return super.insertAt(e,t),e.anon?I(this,jt,Ta).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getAllArgs(){return this.childNodes.filter(pr("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:e})=>e)}getArgs(e,t,n=!0){let i=String(e).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),s;return m(this,Bt).has(i)?s=m(this,Bt).get(i):(s=new Set(this.getAllArgs().filter(({name:a})=>i===a)),m(this,Bt).set(i,s)),s}getDuplicatedArgs(){return[...m(this,Bt)].filter(([,{size:e}])=>e>1).map(([e,t])=>[e,[...t]])}getPossibleValues(){let{type:e,name:t,childNodes:n}=this;if(e==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let i,s;switch(t){case"if":case"ifexist":case"ifexpr":case"iferror":i=2;break;case"ifeq":i=3;break;case"switch":{let a=n.slice(2),l=a[a.length-1];s=[...a.filter(({anon:u})=>!u),...l!=null&&l.anon?[l]:[]].map(({lastChild:u})=>u);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}s!=null||(s=n.slice(i,i+2).map(({lastChild:a})=>a));for(let a=0;a<s.length;){let{length:l,0:u}=s[a].childNodes.filter(g=>g.text().trim());if(l===0)s.splice(a,1);else if(l>1||!u.is("magic-word"))a++;else try{let g=u.getPossibleValues();Array.prototype.splice.apply(s,[a,1,...g]),a+=g.length}catch(g){a++}}return s}print(){}};Gi=B(cg),tn=new WeakMap,Pt=new WeakMap,fr=new WeakMap,Bt=new WeakMap,cr=new WeakMap,jt=new WeakSet,Hi=function(){let e=this.type==="template";return this.normalizeTitle((e?"":"Module:")+re(this.childNodes[e?0:1].text()),10,V({temporary:!0},!e&&{page:""}))},Ta=function(e){let t=this.getAnonArgs(),n=typeof e!="number";for(let i=n?t.indexOf(e):e-1;i<t.length;i++){let s=t[i],{name:a}=s,l=String(i+1);(a!==l||s===e)&&(s.setAttribute("name",l),this.getArgs(l,!1,!1).add(s))}},mt=P(Gi,0,"TranscludeToken",ya,mt),R(Gi,1,mt)});var Aa,Vi,mg,Ot,Sa=w(()=>{"use strict";ot();xe();G();Aa=[ve(),Q];Ot=class extends(mg=L){get type(){return"hidden"}getAttribute(r){return r==="invalid"||super.getAttribute(r)}};Vi=B(mg),Ot=P(Vi,0,"HiddenToken",Aa,Ot),R(Vi,1,Ot)});var Ca,Xi,hg,Qi,bg,qt,wa=w(()=>{"use strict";ae();z();se();qe();Vr();xe();D();G();lt();Sa();Ca=[Q,ue("{{{"),ut()];qt=class extends(bg=L){constructor(e,t,n=[]){super(void 0,t,n,{});S(this,Xi);for(let i=0;i<e.length;i++){let s=e[i];if(i===0){let a=new pe(s,"arg-name",t,n,{});super.insertAt(a)}else if(i>1){let a=new Ot(s,t,n);super.insertAt(a)}else{let a=new L(s,t,n);a.type="arg-default",a.setAttribute("stage",2),super.insertAt(a)}}}get type(){return"arg"}get default(){}toString(e){return`{{{${super.toString(e,"|")}}}}`}text(){return`{{{${Ee(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){super.afterBuild()}lint(e=this.getAbsoluteIndex(),t){{let[n,i,...s]=this.childNodes;n.setAttribute("aIndex",e+3);let a=n.lint(e+3,t);if(i){let f=e+4+n.toString().length;i.setAttribute("aIndex",f);let h=i.lint(f,t);h.length>0&&Array.prototype.push.apply(a,h)}let l=["no-ignored","no-arg"],{lintConfig:u}=v,{computeEditInfo:g}=u,d=new W(this,e),p=l.map(f=>u.getSeverity(f,"arg"));if(p[0]&&s.length>0&&Array.prototype.push.apply(a,s.map(f=>{let h=j(f,d,l[0],"invisible-triple-braces",p[0]);return h.startIndex--,h.startCol--,g&&(h.suggestions=[O(h),Ge(h.startIndex,"{{!}}")]),h})),p[1]&&!this.getAttribute("include")){let f=F(this,d,l[1],"unexpected-argument",p[1]);g&&i&&(f.suggestions=[me(f,"expand",i.text())]),a.push(f)}let c=this.closest("ext");if(c){let f="arg-in-ext",h=u.getSeverity(f,c.name);h&&a.push(F(this,d,f,"argument-in-ext",h))}return a}}print(){}json(e,t,n=this.getAbsoluteIndex()){}};Qi=B(bg),Xi=new WeakSet,hg=function(){},qt=P(Qi,0,"ArgToken",Ca,qt),R(Qi,1,qt)});var Ra={};Z(Ra,{parseBraces:()=>rn});var xg,Ea,Ji,La,Na,$a,Fa,Ia,rn,Kn=w(()=>{"use strict";ze();ae();zi();ka();wa();xg={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},Ea=String.raw`\[(?!\[)`,Ji=String.raw`\n(?![=\0])`,La=String.raw`|\{{2,}`,Na=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),$a=Be(o=>new RegExp(o,"gmu"));Fa=new RegExp(String.raw`\{\{((?:[^\n{}[]|${Ea}|${Ji})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${Ji})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${Ea}|${Ji})*\}-`,"gu");Ia=o=>{let r=Ue(re(o));return Na.has(r)?Na.get(r):/^(?:filepath|(?:full|canonical)urle?):./u.test(r)?"m":/^#vardefine:./u.test(r)?"n":"t"},rn=(o,r,e)=>{var f,h,x,T,b;let t=String.raw`${r.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,[,,,n]=r.parserFunction,i=[],s=[],a=(y,k,A,N)=>{k[k.length-1].push(ke(y.slice(A,N),s))},l;do l!==void 0&&(o=l),l=o.replace(Fa,(y,k,A)=>{if(k!==void 0||typeof A=="string")try{let{length:N}=e,E=(k!=null?k:A).split("|");return new mt(ke(E[0],s),E.slice(1).map($=>{let H=$.indexOf("=");return(H===-1?[$]:[$.slice(0,H),$.slice(H+1)]).map(q=>ke(q,s))}),r,e),`\0${N}${Ia(E[0])}`}catch(N){if(!(N instanceof SyntaxError)||N.message!=="Invalid template name")throw N}return s.push(ke(y,s)),`\0${s.length-1}`});while(l!==o);o=l;let u=o.lastIndexOf("}}")-o.length,g=u+o.length!==-1,d=$a(t+(g?La:"")),p=d.exec(o),c;for(;p||c!==void 0&&c<=o.length&&((h=(f=i[i.length-1])==null?void 0:f[0])!=null&&h.startsWith("="));){if(p!=null&&p[1]){let[,{length:U}]=p;p[0]=p[0].slice(U),p.index+=U}let{0:y,index:k}=p!=null?p:{0:`
|
|
10
|
+
`,index:o.length},A=(x=i.pop())!=null?x:{},{0:N,index:E,parts:$,findEqual:H,pos:q}=A,K=y==="="&&H;if(y==="]]"||y==="}-")c=k+2;else if(y===`
|
|
11
|
+
`){c=k+1;let{pos:U,findEqual:M}=(T=i[i.length-1])!=null?T:{};if(U===void 0||M||re(o.slice(U,E))!==""){let be=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(o.slice(E,k));be&&(be[2]=ke(be[2],s),be[2].includes(`
|
|
12
|
+
`)||(o=`${o.slice(0,E)}\0${e.length}h${o.slice(k)}`,c=E+4+String(e.length).length,new Qe(be[1].length,be.slice(2),r,e)))}}else if(y==="|"||K)c=k+1,a(o,$,q,k),y==="|"&&$.push([]),A.pos=c,A.findEqual=y==="|",i.push(A);else if(y.startsWith("}}")){let U=y.slice(0,Math.min(N.length,3)),M=N.length-U.length,{length:be}=e;c=k+U.length,a(o,$,q,k);let Jt=!1,bt="t";if(U.length===3){let Y=$.map(Ir=>Ir.join("=")),xt=Y.length>1&&re(Y[1]).trim();new qt(Y,r,e),xt&&xt.endsWith(":")&&n.includes(xt.slice(0,-1).toLowerCase())&&(bt="s")}else try{new mt($[0][0],$.slice(1),r,e),bt=Ia($[0][0])}catch(Y){if(!(Y instanceof SyntaxError&&Y.message==="Invalid template name"))throw Y;Jt=!0}Jt||(o=`${o.slice(0,E+M)}\0${be}${bt}${o.slice(c)}`,c=E+M+3+String(be).length,M>1?i.push({0:N.slice(0,M),index:E,pos:E+M,parts:[[]]}):M===1&&o[E-1]==="-"&&i.push({0:"-{",index:E-1,pos:E+1,parts:[[]]}))}else c=k+y.length,y.startsWith("{")&&(p.pos=c,p.parts=[[]]),i.push(..."0"in A?[A]:[],p);let _=i[i.length-1];if(g&&u+o.length<c)for(g=!1;(b=_==null?void 0:_[0])!=null&&b.startsWith("{");)i.pop(),_=i[i.length-1];d=$a(t+(g?La:"")+(_?`|${xg[_[0][0]]}${_.findEqual?"|=":""}`:"")),d.lastIndex=c,p=d.exec(o)}return ke(o,s)}});var Pa={};Z(Pa,{InputboxToken:()=>Ki});var Ki,Ba=w(()=>{"use strict";Yr();Kn();Di();Ki=class extends Kr{constructor(r,e,t,n,i=[]){let s=Symbol("InputboxToken"),a=n.excludes.includes("heading")?n:ge(V({},n),{excludes:[...n.excludes,"heading"]}),{length:l}=i;i.push(s),t&&(t=Rt(t,a,i,e)),t&&(t=rn(t,a,i)),i.splice(l,1),super(r,e,t,a,i,{})}}});var Yn={};Z(Yn,{NestedToken:()=>Yi});var yg,Tg,nn,mr,Yi,Zn=w(()=>{"use strict";z();se();Yr();Kn();D();G();Zi();Ct();yg=new Set(["comment","include","arg","template","magic-word"]),Tg=[!1,!0].map(o=>{let r=o?"includeonly":"noinclude";return new RegExp(String.raw`^(?:<${r}(?:\s[^>]*)?/?>|</${r}\s*>)$`,"iu")}),Yi=class extends L{constructor(e,t,n,i,s=[]){if(typeof t=="boolean"){let a=Symbol("NestedToken"),{length:l}=s;s.push(a),e&&(e=Rt(e,i,s,t)),e&&(e=rn(e,i,s)),s.splice(l,1)}else e&&(e=e.replace(t,(a,l,u,g,d)=>{let p=`\0${s.length+1}e`;return new Xe(l,u,g,d,i,!1,s),p}));e&&(e=e.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(a,l,u)=>(new de(u,i,s),`${l}\0${s.length}n`)));super(e,i,s);S(this,nn);S(this,mr);C(this,nn,[...n]),C(this,mr,t)}get type(){return"ext-inner"}lint(e=this.getAbsoluteIndex(),t){{let n=super.lint(e,t),i="no-ignored",{lintConfig:s}=v,a=s.getSeverity(i,this.name);if(!a)return n;let l=new W(this,e),u=typeof m(this,mr)=="boolean"?Tg[m(this,mr)?1:0]:/^<!--[\s\S]*-->$/u;return[...n,...this.childNodes.filter(g=>{let{type:d,name:p}=g;if(d==="ext")return!m(this,nn).includes(p);if(yg.has(d))return!1;let c=g.toString().trim();return c&&!u.test(c)}).map(g=>{let d=j(g,l,i,v.msg("invalid-content",this.name),a);return s.computeEditInfo&&(d.suggestions=[O(d),Pn(d,g.toString())]),d})]}}};nn=new WeakMap,mr=new WeakMap});function es(o,r,e,t,n){r=re(r).trim();let i=r.replace(o==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(o){case"width":return!i&&!!r||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(i);case"link":{let s=t==="gallery-image";if(i){if(kg(e.protocol).test(i))return vg(e.protocol).test(i)?r:s;i.startsWith("[[")&&i.endsWith("]]")&&(i=i.slice(2,-2))}else return r;let a=v.normalizeTitle(i,0,!1,e,{halfParsed:n,decode:!0,selfLink:!0,page:""});return a.valid?a:s}case"lang":return(t==="svg"||t==="svgz")&&!/[^a-z\d-]/u.test(i);case"alt":case"class":case"manualthumb":return!0;case"page":return(t==="djvu"||t==="djv"||t==="pdf")&&Number(i)>0;default:return!!i&&!isNaN(i)}}var kg,vg,Ag,Sg,ja,Ne,ei,Oa,ts,Cg,_t,qa=w(()=>{"use strict";ze();ae();z();Nn();Se();xe();D();G();kg=Be(o=>new RegExp(String.raw`^(?:${o}|//|\0\d+m\x7F)`,"iu")),vg=Be(o=>new RegExp(String.raw`^(?:(?:${o}|//)${De}|\0\d+m\x7F)${Me}$`,"iu")),Ag=Be(o=>new RegExp(String.raw`^(\s*(?!\s))${o.replace("$1","(.*)")}${o.endsWith("$1")?`(?=$|
|
|
13
|
+
)`:""}(\s*)$`,"u")),Sg=o=>{if(o)o.startsWith("//")&&(o=`https:${o}`);else return o;return new URL(o).href};ja=[Q];_t=class extends(Cg=L){constructor(e,t,n,i,s){var r=(...hm)=>(super(...hm),S(this,ei),S(this,Ne,""),this);let a,l=Object.entries(i.img).map(([g,d])=>[g,d,Ag(g)]),u=l.find(([,g,d])=>(a=d.exec(e),a&&(a.length!==4||es(g,a[2],i,g==="link"?n:t,!0)!==!1)));if(u&&a){a.length===3?(r(void 0,i,s),C(this,Ne,e)):(r(a[2],i,s,{}),C(this,Ne,a[1]+u[0]+a[3])),this.setAttribute("name",u[1]),u[1]==="alt"&&this.setAttribute("stage",10);return}r(e,i.excludes.includes("list")?i:ge(V({},i),{excludes:[...i.excludes,"list"]}),s),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;let e=super.text().trim();return oe.run(()=>{var s;let t=this.getAttribute("config"),n=new L(e,t);if(n.parseOnce(0,this.getAttribute("include")).parseOnce(),/^\0\d+m\x7F/u.test(n.firstChild.toString()))return e;let i=es("link",e,t,(s=this.parentNode)==null?void 0:s.type);return i===!0?void 0:i},v)}}afterBuild(){var e;(e=this.parentNode)!=null&&e.is("gallery-image")&&!fo.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(e){return m(this,Ne)?m(this,Ne).replace("$1",super.toString(e)):super.toString(e)}text(){return m(this,Ne)?m(this,Ne).replace("$1",super.text()).trim():super.text().trim()}isPlain(){return this.name==="caption"||this.name==="alt"}getAttribute(e){return e==="invalid"?this.name==="invalid":e==="padding"?Math.max(0,m(this,Ne).indexOf("$1")):super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){var n;{let i=super.lint(e,t),{lintConfig:s}=v,{computeEditInfo:a,fix:l}=s,{link:u,name:g}=this,d=g==="width"&&this.getValue();if(g==="invalid"||d&&d.endsWith("px")){let p="invalid-gallery",c=s.getSeverity(p,"parameter");if(c){let f=F(this,{start:e},p,"invalid-image-parameter",c);(a||l)&&(f.fix=d?O(f,0,d):O(f,-1)),i.push(f)}}else if(g==="link"){if(u===void 0){let p="invalid-gallery",c=s.getSeverity(p,"link");if(c){let f=F(this,{start:e},p,"invalid-gallery-link",c);if(a){let h=super.toString(),x=h.indexOf("|"),T=h.slice(0,x).trim();x!==-1&&!/[<{]/u.test(T)&&typeof es("link",T,this.getAttribute("config"),(n=this.parentNode)==null?void 0:n.type)=="string"&&(f.suggestions=[st(e+this.getRelativeIndex(0)+x)])}i.push(f)}}else if(typeof u=="string"){let p="invalid-url",c=s.getSeverity(p);if(c&&!this.querySelector("magic-word"))try{Sg(u)}catch(f){i.push(F(this,{start:e},p,"invalid-url",c))}}else if(u.encoded){let p="url-encoding",c=s.getSeverity(p,"file");if(c){let f=F(this,{start:e},p,"unnecessary-encoding",c);(a||l)&&(f.fix=Fn(f,this)),i.push(f)}}}else if(g==="manualthumb"){let p="invalid-gallery",c=s.getSeverity(p,"thumb");if(c&&!this.querySelector("arg,magic-word,template")){let{valid:f,ns:h,extension:x}=this.thumb;(!f||h!==6||!Or.has(x))&&i.push(F(this,{start:e},p,"invalid-thumb",c))}}return i}}getValue(){return this.name==="invalid"?this.text():I(this,ei,Oa).call(this)||super.text()}print(){}};ts=B(Cg),Ne=new WeakMap,ei=new WeakSet,Oa=function(){return m(this,Ne)&&!m(this,Ne).includes("$1")},_t=P(ts,0,"ImageParameterToken",ja,_t),R(ts,1,_t)});var _a,wg,Eg,Wa,Da,Lg,Ma,hr,rs=w(()=>{"use strict";z();Nn();se();D();lr();qa();_a=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),wg=new Set(["arg"]),Eg=new Set(["template","magic-word"]),Wa=new Set(["left","right","center","none"]),Da=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),Lg=o=>{if(o===void 0)return[];let r=/-\{|\}-|\|/gu,e=[],t=r.exec(o),n=0,i=0;for(;t;){let{0:s,index:a}=t;s!=="|"?n+=s==="-{"?1:-1:n===0&&(e.push(o.slice(i,a)),{lastIndex:i}=r),t=r.exec(o)}return e.push(o.slice(i)),e},Ma=(o,r)=>o.filter(({childNodes:e})=>!e.some(t=>t.text().trim()&&r.has(t.type))),hr=class extends ye{get type(){return"file"}get extension(){}constructor(r,e,t,n=[],i="|",s){super(r,void 0,t,n,i);let{extension:a}=this.getTitle(!0,!0);this.safeAppend(Lg(e).map(l=>new _t(l,a,s,t,n)))}lint(r=this.getAbsoluteIndex(),e){var t;{let n=super.lint(r,e),i=Ma(this.getAllArgs(),wg),s=[...new Set(i.map(({name:E})=>E))],a=s.filter(E=>_a.has(E)),l=s.filter(E=>Wa.has(E)),u=s.filter(E=>Da.has(E)),[g]=a,d=g==="framed"||g==="manualthumb",p=new W(this,r),{lintConfig:c}=v,{computeEditInfo:f,fix:h}=c,{ns:x,extension:T}=this.getAttribute("title"),{firstChild:b}=this,y="nested-link",k=c.getSeverity(y,"file");if(k&&Or.has(T)&&this.isInside("ext-link-text")&&((t=this.getValue("link"))==null?void 0:t.trim())!==""){let E=F(this,p,y,"link-in-extlink",k);if(f||h){let $=this.getArg("link");if($){let H=r+$.getRelativeIndex();E.fix={desc:v.msg("delink"),range:[H,H+$.toString().length],text:"link="}}else E.fix=er(E.endIndex-2,"delink","|link=")}n.push(E)}if(y="invalid-gallery",k=c.getSeverity(y,"extension"),k&&x===6&&!T&&!b.querySelector("arg,magic-word,template")&&n.push(F(this,p,y,"missing-extension",k)),k=c.getSeverity(y,"parameter"),k&&d)for(let E of i.filter(({name:$})=>$==="width")){let $=j(E,p,y,"invalid-image-parameter",k);(f||h)&&($.fix=O($,-1)),n.push($)}if(i.length===s.length&&a.length<2&&l.length<2&&u.length<2)return n;y="no-duplicate";let A=["unknownImageParameter","imageParameter"].map(E=>c.getSeverity(y,E)),N=(E,$,H,q=!0)=>E.map(K=>{if(k=A[Number(typeof q=="function"?q(K):q)],!k)return!1;let _=j(K,p,y,v.msg(`${$}-image-parameter`,H),k);return f&&(_.suggestions=[O(_,-1)]),_}).filter(K=>K!==!1);for(let E of s){if(E==="invalid"||E==="width"&&d)continue;let $=E==="caption",H=i.filter(({name:q})=>q===E);if($&&(H=[...H.slice(0,-1).filter(q=>q.text()),...H.slice(-1)]),H.length>1){let q=!$||!T||Or.has(T);if($&&q){let K=Ma(H,Eg);q=K.length>1&&(_=>K.includes(_))}Array.prototype.push.apply(n,N(H,"duplicate",E,q))}}return a.length>1&&Array.prototype.push.apply(n,N(i.filter(({name:E})=>_a.has(E)),"conflicting","frame")),l.length>1&&Array.prototype.push.apply(n,N(i.filter(({name:E})=>Wa.has(E)),"conflicting","horizontal-alignment")),u.length>1&&Array.prototype.push.apply(n,N(i.filter(({name:E})=>Da.has(E)),"conflicting","vertical-alignment")),n}}getAllArgs(){return this.childNodes.slice(1)}getArgs(r){return this.getAllArgs().filter(({name:e})=>r===e)}getArg(r){{let e=this.getArgs(r);return e[r==="manualthumb"?0:e.length-1]}}getValue(r){var e;return(e=this.getArg(r))==null?void 0:e.getValue()}json(r,e,t=this.getAbsoluteIndex()){}}});var Ua,sn,is,ns,Ng,Je,ss=w(()=>{"use strict";z();qe();D();G();rs();Ua=[ue("")];Je=class extends(Ng=hr){constructor(e,t,n,i,s=[]){let a;if(n!==void 0){let{length:u}=s;a=new L(n,i,s);for(let g=0;g<10;g++)a.parseOnce();s.splice(u,1)}let l=`${e}-image`;super(t,a==null?void 0:a.firstChild.toString(),i,s,void 0,l);S(this,sn);ce(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=l,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(e){let t=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),t?0:6,{halfParsed:!0,temporary:e,decode:!t,page:""})}lint(e=this.getAbsoluteIndex(),t){{let n=super.lint(e,t),i="invalid-gallery",{lintConfig:s}=v,a=s.getSeverity(i,"image");if(a&&I(this,sn,is).call(this)){let l=F(this,{start:e},i,"invalid-gallery",a);s.computeEditInfo&&(l.suggestions=[er(e,"prefix","File:")]),n.push(l)}return n}}getAttribute(e){return e==="invalid"?I(this,sn,is).call(this):super.getAttribute(e)}};ns=B(Ng),sn=new WeakSet,is=function(){return this.getAttribute("title").ns!==6},Je=P(ns,0,"GalleryImageToken",Ua,Je),R(ns,1,Je)});var Wt,os=w(()=>{"use strict";Ct();Wt=class extends de{}});var Ga={};Z(Ga,{GalleryToken:()=>as});var on,za,$g,as,Ha=w(()=>{"use strict";z();D();Qn();ss();os();as=class extends ct{constructor(e,t,n=[]){var i;super(void 0,t,n,{});S(this,on);for(let s of(i=e==null?void 0:e.split(`
|
|
14
|
+
`))!=null?i:[]){let a=/^([^|]+)(?:\|(.*))?/u.exec(s);if(!a){super.insertAt(s.trim()?new Wt(s,t,n):s);continue}let[,l,u]=a;I(this,on,za).call(this,l)?super.insertAt(new Je("gallery",l,u,t,n)):super.insertAt(new Wt(s,t,n))}}get widths(){}get heights(){}lint(e=this.getAbsoluteIndex(),t){{let{top:n,left:i}=this.getRootNode().posFromIndex(e),s=[],a="no-ignored",{lintConfig:l}=v,u=["Image","NoImage","Comment"].map(g=>l.getSeverity(a,`gallery${g}`));for(let g=0;g<this.length;g++){let d=this.childNodes[g],p=d.toString(),{length:c}=p,f=p.trim(),{type:h}=d,x=n+g,T=g?0:i;if(d.setAttribute("aIndex",e),h==="noinclude"&&f&&!/^<!--.*-->$/u.test(f)){let[b]=u;if(f.startsWith("|")?[,b]=u:(f.startsWith("<!--")||f.endsWith("-->"))&&([,,b]=u),b){let y=e+c,k={rule:a,message:v.msg("invalid-content","gallery"),severity:b,startIndex:e,endIndex:y,startLine:x,endLine:x,startCol:T,endCol:T+c};l.computeEditInfo&&(k.suggestions=[O(k),Pn(k,p)]),s.push(k)}}else if(h!=="noinclude"&&h!=="text"){let b=d.lint(e,t);b.length>0&&Array.prototype.push.apply(s,b)}e+=c+1}return s}}json(e,t,n=this.getAbsoluteIndex()){}};on=new WeakSet,za=function(e){return this.normalizeTitle(e,6,{halfParsed:!0,temporary:!0,decode:!0,page:""}).valid},$g=function(e){}});var br,ls=w(()=>{"use strict";ze();z();D();lr();br=class extends ye{get type(){return"link"}get innerText(){return this.length>1?this.lastChild.text():At(this.firstChild.text().replace(/^\s*:?/u,""))}lint(r=this.getAbsoluteIndex(),e){{let t=super.lint(r,e),n="nested-link",{lintConfig:i}=v,s=i.getSeverity(n);if(s&&this.isInside("ext-link-text")){let a=F(this,{start:r},n,"link-in-extlink",s);(i.computeEditInfo||i.fix)&&(a.fix=me(a,"delink",this.innerText)),t.push(a)}return t}}}});var Ig,Fg,an,ln,ds,Ke,ti=w(()=>{"use strict";z();ae();se();D();G();Ig=String.raw`(?:[${Ie}\t]| |�*160;|&#[xX]0*[aA]0;)`,Fg=new RegExp(`${Ig}+`,"gu"),Ke=class extends L{constructor(e,t="free-ext-link",n=v.getConfig(),i){super(e,n,i,{});S(this,ln);S(this,an);C(this,an,t)}get type(){return m(this,an)}get innerText(){let e=new Map([["!","|"],["=","="]]),t=Ee(this.childNodes.map(n=>{let{type:i}=n,s=String(n.name);return i==="magic-word"&&e.has(s)?e.get(s):n}));return this.type==="magic-link"&&(t=t.replace(Fg," ")),t}get link(){let{innerText:e}=this;return this.type==="magic-link"?e.startsWith("ISBN")?`ISBN ${e.slice(5).replace(/[- ]/gu,"").replace(/x$/u,"X")}`:e:uo(e).replace(/\n/gu,"%0A")}lint(e=this.getAbsoluteIndex(),t){{let n=super.lint(e,t),i=new W(this,e),{lintConfig:s}=v,{type:a,childNodes:l}=this;if(a==="magic-link"){let p="invalid-isbn",c=s.getSeverity(p);return c&&I(this,ln,ds).call(this)&&n.push(F(this,i,p,"invalid-isbn",c)),n}let u="invalid-url",g=s.getSeverity(u);if(g&&!this.querySelector("magic-word"))try{this.getUrl()}catch(p){n.push(F(this,i,u,"invalid-url",g))}let d=a==="ext-link-url";if(u="unterminated-url",g=s.getSeverity(u,d?"pipe":"punctuation"),g){let p=d?/\|/u:/[,;。:!?()]+/u,c=l.find(f=>f.type==="text"&&p.test(f.data));if(c){let{data:f}=c,h=j(c,i,u,v.msg("in-url",d?'"|"':"full-width-punctuation"),g);if(s.computeEditInfo){let{index:x,0:T}=p.exec(f),b=h.startIndex+x;h.suggestions=d?[st(b,1)]:[st(b),{desc:v.msg("encode"),range:[b,b+T.length],text:encodeURI(T)}]}n.push(h)}}return n}}getUrl(e){this.lspError("MagicLinkToken.getUrl")}getAttribute(e){return e==="invalid"?I(this,ln,ds).call(this):super.getAttribute(e)}};an=new WeakMap,ln=new WeakSet,ds=function(){if(this.type==="magic-link"){let{link:e}=this;if(e.startsWith("ISBN")){let t=[...e.slice(5)].map(n=>n==="X"?10:Number(n));return t.length===10?t.reduce((n,i,s)=>n+i*(10-s),0)%11!==0:t.length===13&&(t[12]===10||t.reduce((n,i,s)=>n+i*(s%2?3:1),0)%10!==0)}}return!1}});var Va,Dt,gs,Rg,Ye,us=w(()=>{"use strict";z();qe();D();G();ti();Va=[ue("[")];Ye=class extends(Rg=L){constructor(e,t="",n="",i,s=[]){super(void 0,i,s,{});S(this,Dt);let a=e&&/^\0\d+f\x7F$/u.test(e)?s[Number(e.slice(1,-2))]:new Ke(e,"ext-link-url",i,s);if(this.insertAt(a),C(this,Dt,t),n){let l=new L(n,i,s,{});l.type="ext-link-text",l.setAttribute("stage",10),this.insertAt(l)}}get type(){return"ext-link"}toString(e){return this.length===1?`[${super.toString(e)}${m(this,Dt)}]`:`[${super.toString(e,m(this,Dt))}]`}text(){return`[${super.text(" ")}]`}getGaps(){return m(this,Dt).length}lint(e=this.getAbsoluteIndex(),t){{let n=super.lint(e,t),i="var-anchor",s=v.lintConfig.getSeverity(i,"extLink");return s&&this.length===1&&this.isInside("heading-title")&&n.push(F(this,{start:e},i,"variable-anchor",s)),n}}print(){}};gs=B(Rg),Dt=new WeakMap,Ye=P(gs,0,"ExtLinkToken",Va,Ye),R(gs,1,Ye)});var dn,Qa=w(()=>{"use strict";G();Ct();ls();us();dn=class extends L{get type(){return"imagemap-link"}constructor(r,e,t,n,i=[]){super(void 0,n,i),this.append(r,e.length===2?new br(...e,n,i):new Ye(...e,n,i),new de(t,n,i))}}});var Xa={};Z(Xa,{ImagemapToken:()=>ps});var ps,Ja=w(()=>{"use strict";z();Se();se();D();Qn();os();ss();Qa();ps=class extends ct{get image(){return this.childNodes.find(pr("imagemap-image"))}constructor(r,e=v.getConfig(),t=[]){if(super(void 0,e,t,{}),!r)return;let n=r.split(`
|
|
15
|
+
`),i=new Set(e.protocol.split("|")),s=!0,a=!1;for(let l of n){let u=l.trim();if(!(a||!u||u.startsWith("#"))){if(s){let g=l.indexOf("|"),d=g===-1?l:l.slice(0,g),p=this.normalizeTitle(d,0,{halfParsed:!0,temporary:!0,page:""});if(p.valid&&p.ns===6){let c=new Je("imagemap",d,g===-1?void 0:l.slice(g+1),e,t);super.insertAt(c),s=!1;continue}else a=!0}else if(l.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(l);continue}else if(l.includes("[")){let g=l.indexOf("["),d=l.slice(g),p=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(d);if(p){if(this.normalizeTitle(p[1],0,{halfParsed:!0,temporary:!0,selfLink:!0,page:""}).valid){super.insertAt(new dn(l.slice(0,g),p.slice(1),d.slice(d.indexOf("]]")+2),e,t));continue}}else if(d.startsWith("[//")||i.has(d.slice(1,d.indexOf(":")+1))||i.has(d.slice(1,d.indexOf("//")+2))){let c=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(d);if(c){super.insertAt(new dn(l.slice(0,g),c.slice(1),d.slice(d.indexOf("]")+1),e,t));continue}}}}super.insertAt(new Wt(l,e,t))}}lint(r=this.getAbsoluteIndex(),e){{let t=super.lint(r,e),n=new W(this,r),{childNodes:i,image:s}=this,a="invalid-imagemap",{lintConfig:l}=v,u=l.getSeverity(a,s?"link":"image");return u&&(s?Array.prototype.push.apply(t,i.filter(g=>{let d=g.toString().trim();return g.is("noinclude")&&d&&!d.startsWith("#")}).map(g=>{let d=j(g,n,a,"invalid-imagemap-link",u);return l.computeEditInfo&&(d.suggestions=[O(d,-1),me(d,"comment","# ")]),d})):t.push(F(this,n,a,"imagemap-without-image",u))),t}}getAttribute(r){return r==="invalid"?!this.image:super.getAttribute(r)}}});var Ka,fs,Pg,Ze,cs=w(()=>{"use strict";z();ot();qe();D();gt();Ka=[ve(!1),ue("<!--")];Ze=class extends(Pg=le){constructor(e,t,n,i){super(e,n,i);ce(this,"closed");this.closed=t}get type(){return"comment"}lint(e=this.getAbsoluteIndex()){{if(this.closed)return[];let t="unclosed-comment",{lintConfig:n}=v,i=n.getSeverity(t);if(!i)return[];let s=F(this,{start:e},t,"unclosed-comment",i);return n.computeEditInfo&&(s.suggestions=[Le(s.endIndex,"-->")]),[s]}}toString(e){return e?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){}};fs=B(Pg),Ze=P(fs,0,"CommentToken",Ka,Ze),R(fs,1,Ze)});var Ya={};Z(Ya,{CommentedToken:()=>ms});var ms,Za=w(()=>{"use strict";G();cs();ms=class extends L{get type(){return"ext-inner"}constructor(r,e,t=[]){if(super(void 0,e,t,{AstText:":",CommentToken:":"}),r){let n=r.indexOf("<!--"),i=n!==-1&&r.indexOf("-->",n+4),s=0;for(;i!==!1&&i!==-1;)n>s&&this.insertAt(r.slice(s,n)),this.insertAt(new Ze(r.slice(n+4,i),!0,e,t)),s=i+3,n=r.indexOf("<!--",s),i=n!==-1&&r.indexOf("-->",n+4);s<r.length&&this.insertAt(r.slice(s))}}lint(r=this.getAbsoluteIndex()){return super.lint(r,new RegExp(String.raw`<\s*(?:\/\s*)?(${this.name})\b`,"giu"))}}});var tl={};Z(tl,{CategorytreeToken:()=>xr});var el,hs,Bg,xr,rl=w(()=>{"use strict";z();qe();D();lr();el=[ue("")];xr=class extends(Bg=ye){get type(){return"ext-inner"}constructor(r,e,t,n=[]){super(r,e,t,n),this.setAttribute("bracket",!1)}getTitle(){let r=this.firstChild.toString().trim(),e={halfParsed:!0},t=this.normalizeTitle(r,14,e);return t.valid&&t.ns===14?t:this.normalizeTitle(`Category:${r}`,0,e)}lint(r=this.getAbsoluteIndex()){{let e="no-ignored",t=v.lintConfig.getSeverity(e,"categorytree");if(t){let{link:n}=this;if(!n.valid||n.ns!==14)return[F(this,{start:r},e,"invalid-category",t)]}return super.lint(r,!1)}}};hs=B(Bg),xr=P(hs,0,"CategorytreeToken",el,xr),R(hs,1,xr)});var nl={};Z(nl,{NowikiToken:()=>bs});var jg,Og,gn,xs,bs,il=w(()=>{"use strict";ze();z();se();D();gt();jg=Be(o=>new RegExp(String.raw`<\s*(?:/\s*)${o==="nowiki"?"":"?"}(${o})\b`,"giu")),Og=new Set(["languages","section","templatestyles"]),bs=class extends le{constructor(){super(...arguments);S(this,gn)}get type(){return"ext-inner"}lint(e=this.getAbsoluteIndex()){{let{name:t,innerText:n}=this,{lintConfig:i}=v,s="void-ext",a=i.getSeverity(s,t);if(a&&I(this,gn,xs).call(this)){let l=F(this,{start:e},s,v.msg("nothing-in",t),a);return i.computeEditInfo&&(l.suggestions=[O(l)]),[l]}{s="invalid-json";let l=i.getSeverity(s);if(t==="templatedata"&&l)return co(n).map(({message:u,from:g,to:d=g,line:p,endLine:c=p,column:f,endColumn:h=f})=>{a=l;let x=new W(this,e);return{rule:s,message:u,severity:a,startIndex:e+g,endIndex:e+d,startLine:x.top+p-1,endLine:x.top+c-1,startCol:(p>1?0:x.left)+f-1,endCol:(c>1?0:x.left)+h-1}}).filter(u=>u!==!1)}return super.lint(e,jg(t))}}getAttribute(e){return e==="invalid"?I(this,gn,xs).call(this):super.getAttribute(e)}};gn=new WeakSet,xs=function(){let{name:e,firstChild:{data:t}}=this;return Og.has(e)&&!!t}});var sl,ys,qg,Xe,Zi=w(()=>{"use strict";z();se();D();zn();G();Un();Vn();sl=[dr()];Xe=class extends(qg=Fe){get type(){return"ext"}constructor(r,e,t,n,i=v.getConfig(),s=!1,a=[]){let l=r.toLowerCase(),u=new ft(!e||/^\s/u.test(e)?e:` ${e}`,"ext-attrs",l,i,a),g=ge(V({},i),{ext:i.ext.filter(p=>p!==l),excludes:[...i.excludes],inExt:!0}),d;switch(l){case"pre":if(u.getAttr("format")!=="wikitext"){let{PreToken:p}=(ca(),X(fa));d=new p(t,g,a);break}case"indicator":case"poem":case"ref":case"option":case"combooption":case"tab":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":l==="poem"?g.excludes.push("heading"):l==="tab"&&(g.ext=g.ext.filter(p=>p!=="tabs")),d=new L(t,g,a);break;case"dynamicpagelist":{let{ParamTagToken:p}=(Di(),X(ha));d=new p(l,s,t,g,a);break}case"inputbox":{let{InputboxToken:p}=(Ba(),X(Pa));d=new p(l,s,t,g,a);break}case"references":{let{NestedToken:p}=(Zn(),X(Yn));g.excludes.push("heading"),d=new p(t,s,["ref"],g,a);break}case"choose":{let{NestedToken:p}=(Zn(),X(Yn));d=new p(t,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],g,a);break}case"combobox":{let{NestedToken:p}=(Zn(),X(Yn));d=new p(t,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],g,a);break}case"gallery":{let{GalleryToken:p}=(Ha(),X(Ga));d=new p(t,g,a);break}case"imagemap":{let{ImagemapToken:p}=(Ja(),X(Xa));d=new p(t,g,a);break}case"hiero":{let{CommentedToken:p}=(Za(),X(Ya));d=new p(t,g,a);break}case"categorytree":{let{CategorytreeToken:p}=(rl(),X(tl));d=new p(t,void 0,g,a);break}default:{let{NowikiToken:p}=(il(),X(nl));d=new p(t,g,a)}}d.setAttribute("name",l),d.type==="plain"&&(d.type="ext-inner"),super(r,u,d,n,i,a),this.seal("closed",!0)}lint(r=this.getAbsoluteIndex(),e){{let t=super.lint(r,e),{lintConfig:n}=v,i=new W(this,r);if(this.name!=="nowiki"){let s=this.inHtmlAttrs(),a="parsing-order",l=s&&n.getSeverity(a,s===2?"ext":"templateInTable");l&&t.push(F(this,i,a,"ext-in-html",l))}if(this.name==="ref"){let s="var-anchor",a=n.getSeverity(s,"ref");a&&this.closest("heading-title")&&t.push(F(this,i,s,"variable-anchor",a)),s="nested-link",a=n.getSeverity(s,"ref"),a&&this.closest("link-text,ext-link-text")&&t.push(F(this,i,s,"ref-in-link",a))}return t}}};ys=B(qg),Xe=P(ys,0,"ExtToken",sl,Xe),R(ys,1,Xe)});var ht,Mt,et,yr,Ts=w(()=>{"use strict";z();Se();G();D();yr=class extends L{constructor(e,t,n,i,s){super(void 0,i,s);S(this,ht);S(this,Mt);S(this,et);this.insertAt(t),C(this,ht,n),C(this,Mt,e)}get closing(){return m(this,ht)}toString(e){return`<${m(this,ht)?"/":""}${m(this,Mt)}${super.toString(e)}${this.selfClosing?"/":""}>`}text(e=""){let{closing:t}=this;return`<${t&&!e?"/":""}${m(this,Mt)}${t?"":super.text()}${e}>`}getAttribute(e){return e==="padding"?m(this,Mt).length+(m(this,ht)?2:1):super.getAttribute(e)}findMatchingTag(){return je(m(this,et),()=>{let{type:e,name:t,parentNode:n,closing:i,selfClosing:s}=this,a=!1,l=!1;if(e==="html"){let[,f,h]=this.getAttribute("config").html;a=h.includes(t),l=f.includes(t)}if(a||l&&s)return this;if(!n)return;let{childNodes:u}=n,g=u.indexOf(this),d=i?u.slice(0,g).reverse():u.slice(g+1),p=[this],{rev:c}=oe;for(let f of d)if(!(!f.is(e)||e==="html"&&(f.name!==t||l&&f.selfClosing)))if(m(f,ht)===i){if(e==="tvar")return;p.push(f)}else{let h=p.pop();if(h===this)return f;v.viewOnly&&(C(h,et,[c,f]),C(f,et,[c,h]))}if(v.viewOnly)for(let f of p)C(f,et,[c,void 0])},e=>{C(this,et,e),e[1]&&e[1]!==this&&C(e[1],et,[oe.rev,this])})}print(){}json(e,t,n=this.getAbsoluteIndex()){}};ht=new WeakMap,Mt=new WeakMap,et=new WeakMap});var ol,ks,_g,_e,al=w(()=>{"use strict";ot();xe();Ts();at();ol=[ve(),Q];_e=class extends(_g=yr){get type(){return"tvar"}constructor(r,e,t,n,i){let s=new he(e,"tvar-name",n,i);super(r,s,t,n,i)}};ks=B(_g),_e=P(ks,0,"TvarToken",ol,_e),R(ks,1,_e)});var ll={};Z(ll,{TranslateToken:()=>vs});var As,Wg,vs,dl=w(()=>{"use strict";G();Un();at();al();vs=class extends Fe{constructor(e,t,n,i=[]){let s=new he(e,"translate-attr",n,i);t=t==null?void 0:t.replace(/<tvar(\|[^>]+)>([\s\S]*?)<\/>/gu,(l,u,g)=>(new _e("tvar",u,!1,n,i),new _e("","",!0,n,i),`\0${i.length-2}n${g}\0${i.length}n`)).replace(/<(tvar)(\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\3|[^"'\s>]+))?\s*)>([\s\S]*?)<\/(tvar)(\s*)>/giu,(l,u,g,d,p,c,f)=>(new _e(u,g,!1,n,i),new _e(c,f,!0,n,i),`\0${i.length-2}n${p}\0${i.length}n`));let a=new L(t,n,i);a.type="translate-inner";super("translate",s,a,"translate",n,i);S(this,As);this.seal("closed",!0)}get type(){return"translate"}get selfClosing(){return!1}toString(e){return e?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){}};As=new WeakSet,Wg=function(){}});var pl={};Z(pl,{parseCommentAndExt:()=>Rt});var ul,Dg,Ss,Mg,gl,Rt,Yr=w(()=>{"use strict";ze();ae();Go();Ct();Qo();Zi();cs();ul="<onlyinclude>",Dg="</onlyinclude>",{length:Ss}=ul,Mg=[!1,!0].map(o=>{let r=o?"includeonly":"(?:no|only)include",e=o?"noinclude":"includeonly";return Be(t=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${r}(?:\s[^>]*)?/?>|</${r}\s*>|<(${t})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(${"\\1"}\s*)>)|<(${e})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${e}\s*)>|$))`,"giu"))}),gl=o=>{let r=o.indexOf(ul);return{i:r,j:o.indexOf(Dg,r+Ss)}},Rt=(o,r,e,t)=>{if(t){let{i:l,j:u}=gl(o);if(l!==-1&&u!==-1){let g="",d=p=>{new de(p,r,e),g+=`\0${e.length-1}n`};for(;l!==-1&&u!==-1;){let p=`\0${e.length}g`;new Lt(o.slice(l+Ss,u),r,e),l>0&&d(o.slice(0,l)),g+=p,o=o.slice(u+Ss+1),{i:l,j:u}=gl(o)}return o&&d(o),g}}let{ext:n}=r,i=n,s=r;if(n.includes("translate")){let{TranslateToken:l}=(dl(),X(ll)),u=[];i=n.filter(g=>g!=="translate"&&g!=="tvar"),s=ge(V({},r),{ext:i}),o=o.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,g=>(u.push(g),`\0${u.length-1}`)).replace(/<translate( nowrap)?>([\s\S]*?)<\/translate>/gu,(g,d,p)=>{let c=e.length;return new l(d,p&&ke(p,u),s,e),`\0${c}g`}),o=ke(o,u)}let a=Mg[t?1:0](i.join("|"));return a.lastIndex=0,a.test(o)?o.replace(a,(l,u,g,d,p,c,f,h,x)=>{let T=e.length,b="n";if(u)b="e",new Xe(u,g,d,p,s,c,e);else if(l.startsWith("<!--")){b="c";let y=l.endsWith("-->");new Ze(ke(l,e,1).slice(4,y?-3:void 0),y,r,e)}else c?new $t(c,f&&ke(f,e,1),h&&ke(h,e,1),x,r,e):new de(l,r,e,!0);return`\0${T}${b}`}):o}});var Ug,zg,Gg,fl,un,Cs,Hg,Ut,cl=w(()=>{"use strict";z();se();zn();D();Ts();Ug=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),zg=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"]),Gg=new Set(["strike","big","center","font","tt"]);fl=[dr()];Ut=class extends(Hg=yr){constructor(e,t,n,i,s,a){super(e,t,n,s,a);S(this,un);this.setAttribute("name",e.toLowerCase()),C(this,un,i)}get type(){return"html"}get selfClosing(){return m(this,un)}text(){let{closing:e,selfClosing:t,name:n}=this,[,,i]=this.getAttribute("config").html;return i.includes(n)?e&&n!=="br"?"":super.text("/"):super.text(t&&!e?"/":"")}lint(e=this.getAbsoluteIndex(),t){{let n=super.lint(e,t),{name:i,parentNode:s,closing:a,selfClosing:l}=this,u=new W(this,e),{lintConfig:g}=v,{computeEditInfo:d,fix:p}=g,c=this.inTableAttrs(),f="h1",h=g.getSeverity(f,"html");if(h&&i==="h1"&&!a){let A=F(this,u,f,"<h1>",h);d&&(A.suggestions=[{desc:"h2",range:[e+2,e+3],text:"2"}]),n.push(A)}if(f="parsing-order",h=c&&g.getSeverity(f,c===2?"html":"templateInTable"),h){let A=F(this,u,f,"html-in-table",h);d&&c===2&&(A.suggestions=[O(A)]),n.push(A)}if(f="obsolete-tag",h=g.getSeverity(f,i),h&&Gg.has(i)&&n.push(F(this,u,f,"obsolete-tag",h)),f="bold-header",h=g.getSeverity(f,i),h&&(i==="b"||i==="strong")&&this.isInside("heading-title")){let A=F(this,u,f,"bold-in-header",h);d&&(A.suggestions=[O(A)]),n.push(A)}let[,x,T]=this.getAttribute("config").html,b=T.includes(i),y=x.includes(i),k=!b&&!y;if(f="unmatched-tag",a&&(l||b)||l&&k){if(h=g.getSeverity(f,a?"both":"selfClosing"),h){let A=F(this,u,f,a?"closing-and-self-closing":"invalid-self-closing",h);if(d||p){let N=Rn(e),E={desc:v.msg("no-self-closing"),range:[A.endIndex-2,A.endIndex-1],text:""};y?d&&(A.suggestions=[N,E]):a?A.fix=b?N:E:d&&(A.suggestions=[E,Le(A.endIndex,`></${i}>`,-2)])}n.push(A)}}else if(!this.findMatchingTag()){let A=F(this,u,f,a?"unmatched-closing":"unclosed-tag"),N=this.closest("magic-word");if(N&&Ug.has(N.name))h=g.getSeverity(f,"conditional");else if(a)h=g.getSeverity(f,"closing"),A.suggestions=[O(A)];else{h=g.getSeverity(f,"opening");let E=s==null?void 0:s.childNodes;zg.has(i)&&(E!=null&&E.slice(0,E.indexOf(this)).some($=>$.is("html")&&$.name===i&&!$.findMatchingTag())&&(A.suggestions=[Le(e+1,"/")]),this.isInside("heading-title")&&(A.rule="format-leakage",h=g.getSeverity("format-leakage",i)))}h&&(A.severity=h,n.push(A))}return n}}getAttribute(e){return e==="invalid"?this.inTableAttrs()===2:super.getAttribute(e)}json(e,t,n=this.getAbsoluteIndex()){}};Cs=B(Hg),un=new WeakMap,Ut=P(Cs,0,"HtmlToken",fl,Ut),R(Cs,1,Ut)});var ml={};Z(ml,{parseHtml:()=>Qg});var Vg,Qg,hl=w(()=>{"use strict";Vn();cl();Vg=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,Qg=(o,r,e)=>{var s;let{html:t}=r;(s=r.htmlElements)!=null||(r.htmlElements=new Set([...t[0],...t[1],...t[2]]));let n=o.split("<"),i=n.shift();for(let a of n){let l=Vg.exec(a),u=l==null?void 0:l[2],g=u==null?void 0:u.toLowerCase();if(!l||!r.htmlElements.has(g)){i+=`<${a}`;continue}let[,d,,p="",c,f]=l,{length:h}=e,x=new ft(p,"html-attrs",g,r,e),T=x.hasAttr("itemprop");if(g==="meta"&&!(T&&x.hasAttr("content"))||g==="link"&&!(T&&x.hasAttr("href"))){i+=`<${a}`,e.length=h;continue}i+=`\0${e.length}x${f}`,new Ut(u,x,d==="/",c==="/>",r,e)}return i}});var bl,ws,Xg,tt,Es=w(()=>{"use strict";zn();G();at();Vn();bl=[dr(1)];tt=class extends(Xg=L){constructor(r,e,t,n,i,s=[],a){super(void 0,i,s,a),this.append(new he(e,"table-syntax",i,s),new ft(n,"table-attrs",t,i,s))}escape(){}};ws=B(Xg),tt=P(ws,0,"TableBaseToken",bl,tt),R(ws,1,tt)});var xl,yl,Re,Ls,Tr,pn,zt,Ns=w(()=>{"use strict";z();se();qn();D();G();Es();zt=class extends(yl=tt,xl=[tr(!1)],yl){constructor(e,t,n,i=[]){var u;let s=/\||\0\d+!\x7F/u.exec(t!=null?t:""),a=s?t.slice(0,s.index):"";/\[\[|-\{/u.test(a)&&(s=null,a="");super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",a,n,i);R(Ls,5,this);S(this,Tr);S(this,Re,"");s&&([En(this,Re)._]=s);let l=new L(t==null?void 0:t.slice(((u=s==null?void 0:s.index)!=null?u:NaN)+m(this,Re).length),n,i);l.type="td-inner",l.setAttribute("stage",4),this.insertAt(l)}get type(){return"td"}get rowspan(){return this.getAttr("rowspan")}get colspan(){return this.getAttr("colspan")}get subtype(){return I(this,Tr,pn).call(this).subtype}afterBuild(){m(this,Re).includes("\0")&&C(this,Re,this.buildFromStr(m(this,Re),0)),super.afterBuild()}toString(e){let[t,n,i]=this.childNodes;return t.toString(e)+n.toString(e)+m(this,Re)+i.toString(e)}text(){let[e,t,n]=this.childNodes;return e.text()+t.text()+m(this,Re)+n.text()}getGaps(e){return e===1?m(this,Re).length:0}lint(e=this.getAbsoluteIndex(),t){{let n=super.lint(e,t),i=new W(this,e+this.getRelativeIndex(this.length-1)),s="pipe-like",{lintConfig:a}=v,{computeEditInfo:l,fix:u}=a,g=["td","double"].map(d=>a.getSeverity(s,d));for(let d of this.lastChild.childNodes)if(d.type==="text"){let{data:p}=d;if(p.includes("|")){let c=p.includes("||"),f=g[c?1:0];if(f){let h=j(d,i,s,"pipe-in-table",f);if(l||u)if(c){let x={caption:"|+",td:"|",th:"!"}[this.subtype];h.fix=me(h,"newline",p.replace(/\|\|/gu,`
|
|
16
|
+
${x}`))}else l&&(h.suggestions=[jn(h.startIndex,p)]);n.push(h)}}}return n}}isIndependent(){return this.firstChild.text().startsWith(`
|
|
17
|
+
`)}getAttr(e){{let t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}}escape(){}print(){}json(e,t,n=this.getAbsoluteIndex()){}};Ls=B(yl),Re=new WeakMap,Tr=new WeakSet,pn=function(){var a;let e=this.firstChild.text(),t=e.slice(-1),n="td";if(t==="!"?n="th":t==="+"&&(n="caption"),this.isIndependent())return{subtype:n};let{previousSibling:i}=this;return V({},I(a=i,Tr,pn).call(a))},pn=P(Ls,17,"#getSyntax",xl,Tr,pn),Rr(Ls,zt)});var kr,$s=w(()=>{"use strict";z();D();Es();Ns();kr=class extends tt{lint(r=this.getAbsoluteIndex(),e){{let t=super.lint(r,e),n=this.childNodes.find(({type:l})=>l==="table-inter");if(!n)return t;let i=In(n),s="fostered-content",a=i&&v.lintConfig.getSeverity(s,i===2?void 0:"transclusion");if(a){let l=j(n,{start:r},s,"content-outside-table",a);l.startIndex++,l.startLine++,l.startCol=0,t.push(l)}return t}}getRowCount(){return Number(this.childNodes.some(r=>r instanceof zt&&r.isIndependent()&&!r.firstChild.text().endsWith("+")))}}});var Fs,Tl,kl,Is,vr,vl=w(()=>{"use strict";z();Se();se();qn();D();$s();at();Fs=class extends Array{},vr=class extends(kl=kr,Tl=[tr(!1)],kl){constructor(e,t,n,i){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,"table",t,n,i,{});R(Is,5,this)}get type(){return"table"}get closed(){return this.lastChild.is("table-syntax")}lint(e=this.getAbsoluteIndex(),t){{let n=super.lint(e,t),i=new W(this,e),s=["unclosed-table","table-layout"],a=s.map(l=>v.lintConfig.getSeverity(l));if(a[0]&&!this.closed&&n.push(j(this.firstChild,i,s[0],"unclosed-table",a[0])),a[1]){let l=this.getLayout(),{length:u}=l;if(u>1){let g=1,d=1/0,p=0;for(;p<u;p++){let c=l[p],f=c.length;if(f<g)break;f<d&&(d=f);let h=c.indexOf(c[f-1])+1;if(h>d)break;h>g&&(g=h)}if(p<u){let c=this.getNthRow(p),f=j(c,i,s[1],"inconsistent-table",a[1]);f.startIndex++,f.startLine++,f.startCol=0,n.push(f)}}}return n}}close(e=`
|
|
18
|
+
|}`,t){oe.run(()=>{let n=new he(t?e:void 0,"table-syntax",this.getAttribute("config"),this.getAttribute("accum"));super.insertAt(n)})}getLayout(e){{let t=this.getAllRows(),{length:n}=t,i=Fs.from(Sl(n,()=>[]));for(let s=0;s<i.length;s++){let a=i[s],l=0,u=0,g;for(let d of t[s].childNodes.slice(2))if(d.is("td")){if(d.isIndependent()&&(g=d.subtype!=="caption"),g){let p={row:s,column:l},{rowspan:c,colspan:f}=d;for(l++;a[u];)u++;for(let h=s;h<Math.min(s+c,n);h++)for(let x=u;x<u+f;x++)i[h][x]=p;u+=f}}else if(Al(d))break}return i}}getAllRows(){return[...super.getRowCount()?[this]:[],...this.childNodes.slice(1).filter(e=>e.is("tr")&&e.getRowCount()>0)]}getNthRow(e,t,n){{let i=super.getRowCount();if(e===0&&i)return this;i&&e--;for(let s of this.childNodes.slice(2)){let{type:a}=s;if(a==="tr"&&s.getRowCount()&&(e--,e<0))return s}return}}json(e,t,n=this.getAbsoluteIndex()){}};Is=B(kl),P(Is,1,"getLayout",Tl,vr),Rr(Is,vr)});var ri,Cl=w(()=>{"use strict";$s();ri=class extends kr{get type(){return"tr"}constructor(r,e,t,n){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,r,"tr",e,t,n)}}});var Ar,Rs=w(()=>{"use strict";gt();Ar=class extends le{get indent(){}json(r,e,t=this.getAbsoluteIndex()){}}});var Sr,Ps=w(()=>{"use strict";Rs();Sr=class extends Ar{get type(){return"dd"}}});var El={};Z(El,{parseTable:()=>Kg});var Jg,wl,Kg,Ll=w(()=>{"use strict";G();vl();Cl();Ns();Ps();Jg=o=>o.lastChild.constructor!==L,wl=(o,r)=>o.is("td")?r.pop():o,Kg=({firstChild:{data:o},type:r,name:e},t,n)=>{let i=[],s=o.split(`
|
|
19
|
+
`),a=r==="root"||r==="parameter-value"||r==="ext-inner"&&e==="poem"?"":`
|
|
20
|
+
${s.shift()}`,l,u=(g,d)=>{if(!d){a+=g;return}let{lastChild:p}=d;if(Jg(d)){let c=new L(g,t,n);c.type="table-inter",c.setAttribute("stage",3),d.insertAt(c)}else p.setText(p.toString()+g)};for(let g of s){l=i.pop();let[d]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(g),p=g.slice(d.length),c=/^(:*)((?:\s|\0\d+[cn]\x7F)*)(\{\||\{(?:\0\d+[cn]\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(p);if(c){for(;l&&!l.is("td");)l=i.pop();let[,y,k,A,N]=c;y&&new Sr(y,t,n),u(`
|
|
21
|
+
${d}${y&&`\0${n.length-1}d`}${k}\0${n.length}b`,l),i.push(...l?[l]:[],new vr(A,N,t,n));continue}else if(!l){a+=`
|
|
22
|
+
${g}`;continue}let f=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(p);if(!f){u(`
|
|
23
|
+
${g}`,l),i.push(l);continue}let[,h,x,T,b]=f;if(h){for(;!l.is("table");)l=i.pop();l.close(`
|
|
24
|
+
${d}${h}`,!0),u(b,i[i.length-1])}else if(x){l=wl(l,i),l.is("tr")&&(l=i.pop());let y=new ri(`
|
|
25
|
+
${d}${x}`,b,t,n);i.push(l,y),l.insertAt(y)}else{l=wl(l,i);let y=T==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu,k=y.exec(b),A=0,N=`
|
|
26
|
+
${d}${T}`,E=$=>{let H=new zt(N,b.slice(A,k==null?void 0:k.index),t,n);return $.insertAt(H),H};for(;k;)E(l),{lastIndex:A}=y,[N]=k,k=y.exec(b);i.push(l,E(l))}}return a.slice(1)}});var fn,Nl=w(()=>{"use strict";fn=o=>!/^_{2}.+_{2}$/u.test(o)});var ni,$l=w(()=>{"use strict";gt();ni=class extends le{get type(){return"hr"}}});var Il,cn,Bs,Yg,Gt,Fl=w(()=>{"use strict";ot();qe();gt();Il=[ve(),ue("__")];Gt=class extends(Yg=le){constructor(e,t,n,i,s){var g,d;super(e,i,s);S(this,cn);let a=e.toLowerCase(),[,,l,u]=i.doubleUnderscore;this.setAttribute("name",(d=t?(g=u==null?void 0:u[e])==null?void 0:g.toLowerCase():l==null?void 0:l[a])!=null?d:a),C(this,cn,n)}get type(){return"double-underscore"}toString(){let e=m(this,cn)?"__":"__";return e+this.innerText+e}print(){}};Bs=B(Yg),cn=new WeakMap,Gt=P(Bs,0,"DoubleUnderscoreToken",Il,Gt),R(Bs,1,Gt)});var Rl={};Z(Rl,{parseHrAndDoubleUnderscore:()=>Zg});var Zg,Pl=w(()=>{"use strict";Nl();$l();Fl();zi();Zg=({firstChild:{data:o},type:r,name:e},t,n)=>{var u,g,d;let[i,s,a]=t.doubleUnderscore,l=[...i,...s];return(u=t.insensitiveDoubleUnderscore)!=null||(t.insensitiveDoubleUnderscore=new Set(i.filter(fn))),(g=t.sensitiveDoubleUnderscore)!=null||(t.sensitiveDoubleUnderscore=new Set(s.filter(fn))),(d=t.regexHrAndDoubleUnderscore)!=null||(t.regexHrAndDoubleUnderscore=new RegExp(String.raw`^((?:\0\d+[cno]\x7F)*)(-{4,})|__(${l.filter(fn).join("|")})__|_{2}(${l.filter(p=>!fn(p)).map(p=>p.slice(2,-2)).join("|")})_{2}`,"gimu")),r!=="root"&&(r!=="ext-inner"||e!=="poem")&&(o=`\0${o}`),o=o.replace(t.regexHrAndDoubleUnderscore,(p,c,f,h,x)=>{var A;if(f)return new ni(f,t,n),`${c}\0${n.length-1}r`;let T=h!=null?h:x,b=t.sensitiveDoubleUnderscore.has(T),y=T.toLowerCase(),k=t.insensitiveDoubleUnderscore.has(y);return b||k?(new Gt(T,b,!!x,t,n),`\0${n.length-1}${k&&((A=a==null?void 0:a[y])!=null?A:y)==="toc"?"u":"n"}`):p}),t.excludes.includes("heading")||(o=o.replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(p,c,f,h,x)=>{let T=`${c}\0${n.length}h`;return new Qe(f.length,[h,x],t,n),T})),r==="root"||r==="ext-inner"&&e==="poem"?o:o.slice(1)}});var Cr,ii,Bl=w(()=>{"use strict";z();se();D();gt();ii=class extends le{constructor(e,t,n,i){super(e,n,i);S(this,Cr);C(this,Cr,t)}get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}get closing(){return V(V({},this.bold?{bold:m(this,Cr).bold}:void 0),this.italic?{italic:m(this,Cr).italic}:void 0)}text(){let{parentNode:e,innerText:t}=this;return e!=null&&e.is("image-parameter")&&e.name!=="caption"?"":t}lint(e=this.getAbsoluteIndex()){{let{previousSibling:t,bold:n,closing:i}=this,s=(t==null?void 0:t.type)==="text"?t.data:void 0,a=[],l=new W(this,e),u=["lonely-apos","bold-header"],{lintConfig:g}=v,{computeEditInfo:d}=g,p=[void 0,"word"].map(f=>g.getSeverity(u[0],f)),c=g.getSeverity(u[1]);if(s!=null&&s.endsWith("'")){let f=p[(i.bold||i.italic)&&/[a-z\d]'$/iu.test(s)?1:0];if(f){let h=F(this,l,u[0],v.msg("lonely","'"),f),{startLine:x,startCol:T}=h,[,{length:b}]=/(?:^|[^'])('+)$/u.exec(s),y=e-b,k=ge(V({},h),{startIndex:y,endIndex:e,endLine:x,startCol:T-b,endCol:T});d&&n&&(k.suggestions=[Ge(y,"'",b),O(k)]),a.push(k)}}if(c&&n&&this.isInside("heading-title")){let f=F(this,l,u[1],"bold-in-header",c);d&&(f.suggestions=[O(f)]),a.push(f)}return a}}json(e,t,n=this.getAbsoluteIndex()){}};Cr=new WeakMap});var jl={};Z(jl,{parseQuotes:()=>js});var js,Os=w(()=>{"use strict";Bl();js=(o,r,e,t)=>{var c;let n=o.split(/('{2,})/u),{length:i}=n;if(i===1)return o;let s=0,a=0,l,u,g;for(let f=1;f<i;f+=2){let h=n[f].length;switch(h){case 2:a++;break;case 4:n[f-1]+="'",n[f]="'''";case 3:if(s++,l!==void 0)break;n[f-1].endsWith(" ")?u===void 0&&g===void 0&&(g=f):n[f-1].slice(-2,-1)===" "?l=f:u!=null||(u=f);break;default:n[f-1]+="'".repeat(h-5),n[f]="'''''",a++,s++}}if(a%2===1&&s%2===1){let f=(c=l!=null?l:u)!=null?c:g;f!==void 0&&(n[f]="''",n[f-1]+="'")}let d=!1,p=!1;for(let f=1;f<i;f+=2){let h=n[f].length,x=h!==2,T=h!==3,b=new ii(n[f],{bold:x&&!!d,italic:T&&!!p},r,e);x&&(d=!d&&b),T&&(p=!p&&b),n[f]=`\0${e.length-1}q`}return n.join("")}});var Ol={};Z(Ol,{parseExternalLinks:()=>qs});var qs,_s=w(()=>{"use strict";ae();us();ti();qs=(o,r,e,t)=>{var n;return(n=r.regexExternalLinks)!=null||(r.regexExternalLinks=new RegExp(String.raw`\[((?:\0\d+[cn]\x7F)*(?:\0\d+f\x7F|(?:(?:${r.protocol}|//)${De}|\0\d+m\x7F)${Me}(?=[[\]<>"\t${Ie}]|\0\d)))([${Ie}]*(?![${Ie}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),o.replace(r.regexExternalLinks,(i,s,a,l)=>{let{length:u}=e,g=/&[lg]t;/u.exec(s);return g&&(a="",l=s.slice(g.index)+a+l,s=s.slice(0,g.index)),t?(new Ke(s,"ext-link-url",r,e),`[\0${u}f${a}${l}]`):(new Ye(s,a,l,r,e),`\0${u}w`)})}});var si,ql=w(()=>{"use strict";lr();si=class extends ye{get type(){return"category"}get sortkey(){}json(r,e,t=this.getAbsoluteIndex()){}}});var Wl={};Z(Wl,{parseLinks:()=>_l});var eu,_l,Dl=w(()=>{"use strict";ae();D();Os();_s();ls();rs();ql();eu=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,_l=(o,r,e,t,n)=>{var l;(l=r.regexLinks)!=null||(r.regexLinks=new RegExp(String.raw`^\s*(?:${r.protocol}|//)`,"iu"));let i=r.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,s=o.split("[["),a=s.shift();for(let u=0;u<s.length;u++){let g=!1,d,p,c,f,h=s[u],x=i.exec(h);if(x)[,d,p,c,f]=x,f.startsWith("]")&&(c!=null&&c.includes("["))&&(c+="]",f=f.slice(1));else{let N=eu.exec(h);N&&(g=!0,[,d,p,c]=N)}if(d===void 0||r.regexLinks.test(d)||/\0\d+[exhbru]\x7F/u.test(d)){a+=`[[${h}`;continue}let T=re(d).trim(),b=T.startsWith(":");if(b&&g){a+=`[[${h}`;continue}else!T&&c&&!c.includes(`
|
|
27
|
+
`)&&(T=re(c).trim());let{ns:y,valid:k}=v.normalizeTitle(T,0,!1,r,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0,page:t});if(k){if(g){if(y!==6){a+=`[[${h}`;continue}let N=!1;for(u++;u<s.length;u++){let E=s[u],$=E.split("]]");if($.length>2){N=!0,c+=`[[${$[0]}]]${$[1]}`,f=$.slice(2).join("]]");break}else if($.length===2)c+=`[[${$[0]}]]${$[1]}`;else{c+=`[[${E}`;break}}if(c=_l(c,r,e,t,n),!N){a+=`[[${d}${p}${c}`;continue}}}else{a+=`[[${h}`;continue}c&&(c=js(c,r,e,n));let A=br;b||(y===6?(c&&(c=qs(c,r,e,!0)),A=hr):y===14&&(A=si)),c===void 0&&p&&(c=""),a+=`\0${e.length}l${f}`,new A(d,c,r,e,p)}return a}});var Hl={};Z(Hl,{parseMagicLinks:()=>tu});var Gl,Ml,Ul,zl,tu,Vl=w(()=>{"use strict";ae();ti();Gl=String.raw`[${Ie}\t]| |�*160;|�*a0;`,Ml=`(?:${Gl})+`,Ul=`(?:${Gl}|-)`,zl=String.raw`(?:RFC|PMID)${Ml}\d+\b|ISBN${Ml}(?:97[89]${Ul}?)?(?:\d${Ul}?){9}[\dx]\b`,tu=(o,r,e)=>{if(!r.regexMagicLinks)try{r.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${r.protocol})(${De}${Me})|${zl})`,"giu")}catch(t){r.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${r.protocol})(${De}${Me})|${zl})`,"giu")}return o.replace(r.regexMagicLinks,(t,n,i)=>{let s=n?t.slice(n.length):t;if(i){let a="",l=/&(?:[lg]t|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(s);l&&(a=s.slice(l.index),s=s.slice(0,l.index));let u=s.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,g=u.exec(s);if(g){let d=1;g[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(s.slice(0,g.index))&&(d=2),a=s.slice(g.index+d)+a,s=s.slice(0,g.index+d)}return a.length>=i.length?t:(new Ke(s,void 0,r,e),`${n}\0${e.length-1}w${a}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(s))return t;return new Ke(s,"magic-link",r,e),`${n}\0${e.length-1}i`})}});var Ql,Xl=w(()=>{"use strict";Ql=(o,r)=>o.startsWith(r)?r.length:[...r].findIndex((e,t)=>e!==o[t])});var ru,oi,Jl=w(()=>{"use strict";z();D();Rs();ru=new Set(["link","category","file"]),oi=class extends Ar{get type(){return"list"}lint(r=this.getAbsoluteIndex()){var e;{let t="syntax-like",n=v.lintConfig.getSeverity(t,"redirect"),{innerText:i}=this;if(n&&i==="#"){let{nextSibling:s}=this;if((s==null?void 0:s.type)==="text"&&ru.has((e=s.nextSibling)==null?void 0:e.type)&&new RegExp(String.raw`^(?:${this.getAttribute("config").redirection.join("|")})\s*(?::\s*)?$`,"iu").test(`#${s.data}`)){let l=F(s,{start:r+1},t,"redirect-like",n);return l.startIndex--,l.startCol--,l.endIndex+=2,l.endCol+=2,[l]}}return[]}}}});var Kl={};Z(Kl,{parseList:()=>nu});var nu,Yl=w(()=>{"use strict";Xl();Jl();Ps();nu=(o,r,e,t)=>{let n=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(o);if(!n)return r.lastPrefix="",o;let[i,s,a,l]=n,u=a.replace(/;/gu,":"),g=Ql(u,r.lastPrefix),d=((g>1?a.slice(g-1):a)+l).split(/(?=;)/u),p=d[0].startsWith(";"),c=d.length-(p?0:1);if(g>1){let q=a.slice(0,g-1);if(p){let K=q.split(/(?=;)/u);d.unshift(...K),c+=q.includes(";")?K.length:0}else d[0]=q+d[0]}r.lastPrefix=u;let f=s+d.map((q,K)=>`\0${t.length+K}d`).join("")+o.slice(i.length);for(let q of d)new oi(q,e,t);if(!c)return f;let[h,,x]=e.html,T=/:+|-\{|\0\d+[xq]\x7F/gu,b=T,y=b.exec(f),k=0,A=!1,N=!1,E=0,$=(q,K)=>(new Sr(q,e,t),`${f.slice(0,K)}\0${t.length-1}d${f.slice(K+q.length)}`),H=q=>{q?k&&k--:k++};for(;y&&c;){let{0:q,index:K}=y;if(q==="-{"){if(!E){let{lastIndex:_}=b;b=/-\{|\}-/gu,b.lastIndex=_}E++}else if(q==="}-"){if(E--,!E){let{lastIndex:_}=b;b=T,b.lastIndex=_}}else if(q.endsWith("x")){let{name:_,closing:U,selfClosing:M}=t[Number(q.slice(1,-2))];(h.includes(_)||!M&&!x.includes(_))&&H(U)}else if(q.endsWith("q")){let{bold:_,italic:U}=t[Number(q.slice(1,-2))];_&&(H(A),A=!A),U&&(H(N),N=!N)}else if(k===0){if(q.length>=c)return $(q.slice(0,c),K);c-=q.length,b.lastIndex=K+4+String(t.length).length,f=$(q,K)}y=b.exec(f)}return f}});var Zl,ed,rt,Ws,iu,Ht,td=w(()=>{"use strict";z();se();Vr();xe();D();G();lt();Zl=new Set(["A","T","R","D","-","H","N"]);ed=[ut(),Q];Ht=class extends(iu=L){constructor(e,t,n=[]){super(void 0,t,n,{});S(this,rt);this.safeAppend(e.map(i=>new pe(i,"converter-flag",t,n)))}get type(){return"converter-flags"}afterBuild(){C(this,rt,this.childNodes.map(e=>e.text().trim())),super.afterBuild()}toString(e){return super.toString(e,";")}text(){return super.text(";")}getUnknownFlags(){return new Set(m(this,rt).filter(e=>/\{{3}[^{}]+\}{3}/u.test(e)))}getVariantFlags(){let e=new Set(this.getAttribute("config").variants);return new Set(m(this,rt).filter(t=>e.has(t)))}isInvalidFlag(e,t,n,i){return!!e&&!t.has(e)&&!n.has(e)&&(t.size>0||!i.has(e))}lint(e=this.getAbsoluteIndex(),t){{let n=this.getVariantFlags(),i=this.getUnknownFlags(),s=new Set(m(this,rt).filter(h=>Zl.has(h))),a=m(this,rt).filter(h=>!h).length,l=m(this,rt).length-i.size-a,{lintConfig:u}=v,{computeEditInfo:g,fix:d}=u,p=super.lint(e,t);if(n.size===l||s.size===l)return p;let c="no-ignored",f=u.getSeverity(c,"conversionFlag");if(f){let h=new W(this,e);for(let x=0;x<this.length;x++){let T=this.childNodes[x],b=T.text().trim();if(this.isInvalidFlag(b,n,i,s)){let y=j(T,h,c,"invalid-conversion-flag",f);(g||d)&&(n.size===0&&Zl.has(b.toUpperCase())?y.fix=Bn(y,b):g&&(y.suggestions=[O(y,x&&-1)])),p.push(y)}}}return p}}print(){}};Ws=B(iu),rt=new WeakMap,Ht=P(Ws,0,"ConverterFlagsToken",ed,Ht),R(Ws,1,Ht)});var Ds,rd,Ms,su,nt,nd=w(()=>{"use strict";xe();D();G();lt();Ds=(o,r,e,t)=>{let n=new L(o,e,t);return n.type=`converter-rule-${r}`,n.setAttribute("stage",11),n};rd=[Q];nt=class extends(su=L){get type(){return"converter-rule"}get variant(){}constructor(r,e=!0,t=v.getConfig(),n=[]){super(void 0,t,n,{});let i=r.indexOf(":"),s=r.slice(0,i).indexOf("=>"),a=s===-1?r.slice(0,i):r.slice(s+2,i);e&&t.variants.includes(a.trim().toLowerCase())?(super.insertAt(new pe(a,"converter-rule-variant",t,n)),super.insertAt(Ds(r.slice(i+1),"to",t,n)),s!==-1&&super.insertAt(Ds(r.slice(0,s),"from",t,n),0)):super.insertAt(Ds(r,"to",t,n))}toString(r){let{childNodes:e,firstChild:t,lastChild:n}=this;return e.length===3?`${t.toString(r)}=>${e[1].toString(r)}:${n.toString(r)}`:super.toString(r,":")}text(){let{childNodes:r,firstChild:e,lastChild:t}=this;return r.length===3?`${e.text()}=>${r[1].text()}:${t.text()}`:super.text(":")}getGaps(r){return r===0&&this.length===3?2:1}print(){}json(r,e,t=this.getAbsoluteIndex()){}};Ms=B(su),nt=P(Ms,0,"ConverterRuleToken",rd,nt),R(Ms,1,nt)});var id,Us,ou,Vt,sd=w(()=>{"use strict";ae();qe();xe();G();td();nd();id=[Q,ue("-{")];Vt=class extends(ou=L){get type(){return"converter"}constructor(r,e,t,n=[]){super(void 0,t,n),this.insertAt(new Ht(r,t,n));let[i]=e,s=i.includes(":"),a=new nt(i,s,t,n);(s?a.length===1:e.length===2&&!re(e[1]).trim())?this.insertAt(new nt(e.join(";"),!1,t,n)):this.safeAppend([a,...e.slice(1).map(l=>new nt(l,!0,t,n))])}toString(r){let[e,...t]=this.childNodes;return`-{${e.toString(r)}${e.length>0?"|":""}${t.map(n=>n.toString(r)).join(";")}}-`}text(){let[r,...e]=this.childNodes;return`-{${r.text()}|${Ee(e,";")}}-`}getGaps(r){return r||this.firstChild.length>0?1:0}print(){}};Us=B(ou),Vt=P(Us,0,"ConverterToken",id,Vt),R(Us,1,Vt)});var od={};Z(od,{parseConverter:()=>au});var au,ad=w(()=>{"use strict";sd();au=(o,r,e)=>{var l;(l=r.regexConverter)!=null||(r.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${r.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"iu"));let t=/-\{/gu,n=/-\{|\}-/gu,i=[],s=t,a=s.exec(o);for(;a;){let{0:u,index:g}=a;if(u==="}-"){let d=i.pop(),{length:p}=e,c=o.slice(d.index+2,g),f=c.indexOf("|"),[h,x]=f===-1?[[],c]:[c.slice(0,f).split(";"),c.slice(f+1)],T=x.replace(/(&[#a-z\d]+);/giu,"$1"),b=T.split(r.regexConverter).map(y=>y.replace(/\x01/gu,";"));new Vt(h,b,r,e),o=`${o.slice(0,d.index)}\0${p}v${o.slice(g+2)}`,i.length===0&&(s=t),s.lastIndex=d.index+3+String(p).length}else i.push(a),s=n,s.lastIndex=g+2;a=s.exec(o)}return o}});var ai={};Z(ai,{Token:()=>L});var lu,mn,Ce,ee,te,wr,Er,hn,Lr,J,ld,dd,gd,ud,pd,fd,cd,md,hd,bd,xd,yd,zs,L,G=w(()=>{"use strict";ae();z();Se();D();No();Ro();lu=["category","html-attr#id,ext-attr#id,table-attr#id"],zs=class zs extends St{constructor(e,t=v.getConfig(),n=[],i){super();S(this,J);S(this,mn,"plain");S(this,Ce,0);S(this,ee);S(this,te);S(this,wr);S(this,Er,!1);S(this,hn);S(this,Lr);typeof e=="string"&&this.insertAt(e),C(this,ee,t),C(this,te,n),n.push(this)}get type(){return m(this,mn)}set type(e){C(this,mn,e)}get pageName(){return m(this.getRootNode(),Lr)}set pageName(e){if(e){let t=this.normalizeTitle(e,0,{temporary:!0,page:""});C(this,Lr,t.valid?t.title:void 0)}else C(this,Lr,e===""?"":void 0)}parseOnce(e=m(this,Ce),t=!1,n){if(e<m(this,Ce)||this.length!==1||!this.isPlain())return this;if(m(this,Ce)>=11)return this;switch(e){case 0:if(this.type==="root"){m(this,te).pop();let i=I(this,J,ld).call(this);t&&(t=!i)}C(this,wr,t),I(this,J,dd).call(this,t);break;case 1:I(this,J,gd).call(this);break;case 2:I(this,J,ud).call(this);break;case 3:I(this,J,pd).call(this);break;case 4:I(this,J,fd).call(this);break;case 5:I(this,J,cd).call(this,n);break;case 6:I(this,J,md).call(this,n);break;case 7:I(this,J,hd).call(this);break;case 8:I(this,J,bd).call(this);break;case 9:I(this,J,xd).call(this);break;case 10:I(this,J,yd).call(this)}if(this.type==="root")for(let i of m(this,te))i==null||i.parseOnce(e,t,n);return En(this,Ce)._++,this}buildFromStr(e,t){let n=e.split(/[\0\x7F]/u).map((i,s)=>{if(s%2===0)return i&&new zr(i);let a=Number(i.slice(0,-1));return m(this,te)[a]}).filter(i=>i!=="");return t===0?n.map(String).join(""):t===1?Ee(n):n}build(){C(this,Ce,11);let{length:e,firstChild:t}=this,n=t==null?void 0:t.toString();if(e===1&&t.type==="text"&&n.includes("\0")&&(_n(this,0,1,this.buildFromStr(n)),this.type==="root"))for(let i of m(this,te))i==null||i.build()}afterBuild(){if(this.type==="root")for(let e of m(this,te))e==null||e.afterBuild();C(this,Er,!0)}parse(e=11,t,n){for(e=Math.min(e,11);m(this,Ce)<e;)this.parseOnce(m(this,Ce),t,n);return e&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===zs}getAttribute(e){var t;switch(e){case"config":return m(this,ee);case"include":return(t=m(this,wr))!=null?t:!!m(this.getRootNode(),wr);case"accum":return m(this,te);case"built":return m(this,Er);case"stage":return m(this,Ce);default:return super.getAttribute(e)}}setAttribute(e,t){e==="stage"?(m(this,Ce)===0&&this.type==="root"&&m(this,te).shift(),C(this,Ce,t)):super.setAttribute(e,t)}insertAt(e,t=this.length){let n=typeof e=="string"?new zr(e):e,{length:i}=this;t+=t<0?i:0,super.insertAt(n,t);let{type:s}=n;return s==="root"&&(n.type="plain"),n}normalizeTitle(e,t=0,n){return v.normalizeTitle(e,t,this.getAttribute("include"),m(this,ee),V({page:this.pageName},n))}inTableAttrs(){var e;return this.isInside("table-attrs")&&((e=this.closest("table-attrs,arg,parameter"))!=null&&e.is("table-attrs")?2:1)}inHtmlAttrs(){return this.isInside("html-attrs")?2:this.inTableAttrs()}lint(e=this.getAbsoluteIndex(),t){var n;{let{lintConfig:i}=v,{computeEditInfo:s,fix:a,ignoreDisables:l,configurationComment:u}=i,g=super.lint(e,t);if(this.type==="root"){let d=new Map,p="no-duplicate",c=["category","id"].map(x=>i.getSeverity(p,x)),f=this.toString(),h=lu.filter((x,T)=>c[T]).join();if(h){for(let x of this.querySelectorAll(h)){let T;if(x.is("category"))T=x.name;else{let b=x.getValue();b&&b!==!0&&(T=`#${b}`)}if(T){let b=d.get(T);b?b.add(x):d.set(T,new Set([x]))}}for(let[x,T]of d)if(T.size>1&&!x.startsWith("#mw-customcollapsible-")){let b=!x.startsWith("#"),y=`duplicate-${b?"category":"id"}`,k=c[b?0:1];g.push(...[...T].map(A=>{let N=F(A,{start:A.getAbsoluteIndex()},p,y,k);return s&&b&&(N.suggestions=[O(N)]),N}))}}if(!l){let x=new RegExp(String.raw`<!--\s*${u}-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->`,"gu"),T=[],b=x.exec(f);for(;b;){let{1:y,index:k}=b,A=(n=b[2])==null?void 0:n.trim(),N;(y==="disable-line"||y==="disable-next-line")&&(N=this.posFromIndex(k).top+(y==="disable-line"?0:1)),T.push({line:N,from:y==="disable"?x.lastIndex:void 0,to:y==="enable"?x.lastIndex:void 0,rules:A?new Set(A.split(",").map(E=>E.trim())):void 0}),b=x.exec(f)}g=g.filter(({rule:y,startLine:k,startIndex:A})=>{let N={pos:0};for(let{line:E,from:$,to:H,rules:q}of T){if(E&&E>k+1)break;if(q&&!q.has(y))continue;if(E===k)return!1;$<=A&&$>N.pos?(N.pos=$,N.type="from"):H<=A&&H>N.pos&&(N.pos=H,N.type="to")}return N.type!=="from"})}if(a&&g.some(({fix:x})=>x)){let x=g.map(({fix:y})=>y).filter(y=>y!==void 0).sort(({range:[y,k]},{range:[A,N]})=>k===N?A-y:N-k),T=1/0,b=f;for(let{range:[y,k],text:A}of x)k<=T&&(b=b.slice(0,y)+A+b.slice(k),T=y);Object.assign(g,{output:b})}if(!s)for(let x of g)delete x.fix,delete x.suggestions}return g}}toString(e,t){return e?super.toString(!0,t):je(m(this,hn),()=>super.toString(!1,t),n=>{let i=this.getRootNode();i.type==="root"&&m(i,Er)&&C(this,hn,n)})}};mn=new WeakMap,Ce=new WeakMap,ee=new WeakMap,te=new WeakMap,wr=new WeakMap,Er=new WeakMap,hn=new WeakMap,Lr=new WeakMap,J=new WeakSet,ld=function(){let{parseRedirect:e}=(Uo(),X(Mo)),t=this.firstChild.toString(),n=e(t,m(this,ee),m(this,te));return n!==!1&&this.setText(n),!!n},dd=function(e){let{parseCommentAndExt:t}=(Yr(),X(pl));this.setText(t(this.firstChild.toString(),m(this,ee),m(this,te),e))},gd=function(){let{parseBraces:e}=(Kn(),X(Ra)),t=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,n=e(t,m(this,ee),m(this,te));this.setText(this.type==="root"?n:n.slice(1))},ud=function(){if(m(this,ee).excludes.includes("html"))return;let{parseHtml:e}=(hl(),X(ml));this.setText(e(this.firstChild.toString(),m(this,ee),m(this,te)))},pd=function(){if(m(this,ee).excludes.includes("table"))return;let{parseTable:e}=(Ll(),X(El));this.setText(e(this,m(this,ee),m(this,te)))},fd=function(){if(m(this,ee).excludes.includes("hr"))return;let{parseHrAndDoubleUnderscore:e}=(Pl(),X(Rl));this.setText(e(this,m(this,ee),m(this,te)))},cd=function(e){let{parseLinks:t}=(Dl(),X(Wl));this.setText(t(this.firstChild.toString(),m(this,ee),m(this,te),this.pageName,e))},md=function(e){let{parseQuotes:t}=(Os(),X(jl)),n=this.firstChild.toString().split(`
|
|
28
|
+
`);for(let i=0;i<n.length;i++)n[i]=t(n[i],m(this,ee),m(this,te),e);this.setText(n.join(`
|
|
29
|
+
`))},hd=function(){let{parseExternalLinks:e}=(_s(),X(Ol));this.setText(e(this.firstChild.toString(),m(this,ee),m(this,te)))},bd=function(){let{parseMagicLinks:e}=(Vl(),X(Hl));this.setText(e(this.firstChild.toString(),m(this,ee),m(this,te)))},xd=function(){if(m(this,ee).excludes.includes("list"))return;let{parseList:e}=(Yl(),X(Kl)),{firstChild:t,type:n,name:i}=this,s=t.toString().split(`
|
|
30
|
+
`),a={lastPrefix:""},l=n==="root"||n==="ext-inner"&&i==="poem"?0:1;for(;l<s.length;l++)s[l]=e(s[l],a,m(this,ee),m(this,te));this.setText(s.join(`
|
|
31
|
+
`))},yd=function(){if(m(this,ee).variants.length>0){let{parseConverter:e}=(ad(),X(od));this.setText(e(this.firstChild.toString(),m(this,ee),m(this,te)))}};L=zs});var oe,pr,Al,jo,_n,va,Sl,Se=w(()=>{"use strict";oe={running:!1,run(o,r){let{running:e}=this;this.running=!0;let t=r==null?void 0:r.internal;r&&(r.internal=!0);let n=()=>{this.running=e,r&&(r.internal=t)};try{let{Token:i}=(G(),X(ai)),s=o();return s instanceof i&&!s.getAttribute("built")&&s.afterBuild(),n(),s}catch(i){throw n(),i}},internal(o,r){let{internal:e}=r;r.internal=!0;let t=o();return r.internal=e,t},rev:0},pr=o=>r=>r.type===o,Al=({type:o})=>o==="tr"||o==="table-syntax",jo=o=>o==="redirect-target"||o==="link",_n=(o,r,e,t=[])=>{var s,a;let n=o.getChildNodes(),i;n.length===e?(i=n,n=t):i=Array.prototype.splice.apply(n,[r,e,...t]);for(let l=0;l<t.length;l++){let u=t[l];u.setAttribute("parentNode",o),u.setAttribute("nextSibling",n[r+l+1]),u.setAttribute("previousSibling",n[r+l-1])}return(s=n[r-1])==null||s.setAttribute("nextSibling",n[r]),(a=n[r+t.length])==null||a.setAttribute("previousSibling",n[r+t.length-1]),n===t&&o.setAttribute("childNodes",n),i},va=(o,r)=>{let e=o.toLowerCase(),[t,n]=r,i=Object.prototype.hasOwnProperty.call(n,o);return[e,i,i?n[o]:Object.prototype.hasOwnProperty.call(t,e)&&t[e]]},Sl=(o,r)=>Array.from({length:o},(e,t)=>r(t))});var bn,kd,Gs,Td,du,vd,gu,Hs,Nr,xn,Ad=w(()=>{"use strict";xi();bn=new Map([[0,!1],[1,"warning"],[2,"error"],[!1,!1],["off",!1],["warning","warning"],["error","error"]]),kd={"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(kd);Gs={configurationComment:"lint",ignoreDisables:!1,fix:!0,computeEditInfo:!0};Object.freeze(Gs);Td=o=>bn.has(o),du=o=>Td(o)||Array.isArray(o)&&Td(o[0])&&(o.length===1||typeof o[1]=="object"),vd=(o,r,e)=>{if(!Pr.includes(r))throw new RangeError(`Unknown lint rule: ${r}`);if(e===void 0)return!1;if(du(e))return o[r]=e,!0;throw new RangeError(`Invalid lint config for ${r}: ${JSON.stringify(e)}`)},gu=typeof structuredClone=="function"?structuredClone:o=>JSON.parse(JSON.stringify(o)),Hs=class{constructor(r){if(Object.assign(this,gu(kd)),!!r)for(let[e,t]of Object.entries(r))vd(this,e,t)}getSeverity(r,e){var n,i;let t=this[r];return typeof t!="object"?bn.get(t):e&&(i=bn.get((n=t[1])==null?void 0:n[e]))!=null?i:bn.get(t[0])}},xn=class{constructor(r){S(this,Nr);if(Object.assign(this,Gs),r&&!("rules"in r)&&Object.keys(r).some(t=>Pr.includes(t)))this.rules=r;else{let e=r!=null?r:{},{rules:t}=e,n=hi(e,["rules"]);this.rules=t;for(let[i,s]of Object.entries(n))s!==void 0&&Object.prototype.hasOwnProperty.call(Gs,i)&&(this[i]=s)}}get rules(){return m(this,Nr)}set rules(r){C(this,Nr,new Proxy(new Hs(r),{set:vd,deleteProperty(){return!1}}))}getSeverity(r,e){return m(this,Nr).getSeverity(r,e)}};Nr=new WeakMap});var Sd,Tn,kn,Qt,$r,Xt,li,Cd,yn,wd=w(()=>{"use strict";ze();ae();Sd=o=>{let[,{length:r},e]=/^((?:\.\.\/)*)([\s\S]*)/u.exec(o);return[r/3,e]},yn=class{constructor(r,e,t,{temporary:n,decode:i,selfLink:s,page:a}={}){S(this,li);S(this,Tn);S(this,kn);S(this,Qt);S(this,$r);S(this,Xt);ce(this,"page");ce(this,"valid");ce(this,"encoded",!1);this.page=a;let l=r.trim(),u=l.startsWith("../");if(i&&r.includes("%"))try{let c=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(r);r=At(r),this.encoded=c}catch(c){}if(r=jr(r).replace(/[_ ]+/gu," ").trim(),u||a&&l.startsWith("/"))C(this,$r,0);else{let c=e;r.startsWith(":")&&(c=0,r=r.slice(1).trim());let f=r.split(":");if(f.length>1){let h=Ue(f[0]),x=Object.prototype.hasOwnProperty.call(t.nsid,h)&&t.nsid[h];x&&(c=x,r=f.slice(1).join(":").trim())}C(this,$r,c)}let g=r.indexOf("#");if(g!==-1){let c=r.slice(g).trim().slice(1);if(c.includes("%"))try{c=At(c)}catch(f){}C(this,Xt,c.replace(/ /gu,"_")),r=r.slice(0,g).trim()}let[d,p]=u?Sd(r):[0,r];this.valid=!!(r||s&&this.ns===0&&m(this,Xt)!==void 0)&&jr(r)===r&&(d===0||a===void 0||a.split("/",d+1).length>d)&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(p),this.main=r,C(this,kn,t.namespaces),C(this,Qt,t.articlePath||"/wiki/$1"),m(this,Qt).includes("$1")||C(this,Qt,m(this,Qt)+`${m(this,Qt).endsWith("/")?"":"/"}$1`)}get ns(){return m(this,$r)}get fragment(){return m(this,Xt)}get main(){return m(this,Tn)}set main(r){r=r.replace(/_/gu," ").trim(),C(this,Tn,r&&r[0].toUpperCase()+r.slice(1))}get prefix(){let r=m(this,kn)[this.ns];return r+(r&&":")}get title(){return this.getRedirection()[1]}get extension(){let{main:r}=this,e=r.lastIndexOf(".");return e===-1?void 0:r.slice(e+1).toLowerCase()}getRedirection(){let{prefix:r}=this,e=r;return I(this,li,Cd).call(this,e)}setFragment(r){C(this,Xt,r)}getUrl(r){throw new Error("Title.getUrl method is only available in the LSP version!")}};Tn=new WeakMap,kn=new WeakMap,Qt=new WeakMap,$r=new WeakMap,Xt=new WeakMap,li=new WeakSet,Cd=function(r){var t,n;let e=(r+this.main).replace(/ /gu,"_");if(e.startsWith("/"))e=((t=this.page)!=null?t:"")+e.replace(/(.)\/$/u,"$1");else if(e.startsWith("../")&&((n=this.page)!=null&&n.includes("/"))){let[i,s]=Sd(e),a=this.page.split("/");a.length>i&&(e=a.slice(0,-i).join("/")+(s&&"/")+s)}return[!1,e]}});var Vs,Ed,Ld,pu,vn,Nd,fu,v,D=w(()=>{xi();Se();Nn();ae();Ad();wd();Vs=!0,Ed=new xn,pu=(o,r,e)=>typeof o=="string"?[!!r,e,o]:[!!o,r,e],vn={config:yi,get rules(){return Pr},get i18n(){return V(V({},void 0),Ld)},set i18n(o){Ld=o},get lintConfig(){return Ed},set lintConfig(o){Ed=new xn(o)},get viewOnly(){return Vs},set viewOnly(o){Vs&&!o&&oe.rev++,Vs=o},internal:!1,getConfig(o){let r=o!=null?o:this.config,{doubleUnderscore:e,ext:t,parserFunction:n,variable:i}=r;for(let s=0;s<2;s++)e.length>s+2&&e[s].length===0&&(e[s]=Object.keys(e[s+2]));return t.includes("translate")&&!i.includes("translationlanguage")&&(i.push("translationlanguage"),n[1].TRANSLATIONLANGUAGE="translationlanguage"),ge(V(V({},yi),r),{excludes:[]})},msg(o,r=""){var e;return o&&((e=this.i18n[o])!=null?e:o).replace("$1",this.msg(r))},normalizeTitle(o,r=0,e,t=vn.getConfig(),n){let i;if(n!=null&&n.halfParsed)i=new yn(o,r,t,n);else{let{Token:s}=(G(),X(ai));i=oe.run(()=>{let a=new s(o,t);a.type="root",a.pageName=n==null?void 0:n.page,a.parseOnce(0,e).parseOnce();let l=new yn(a.firstChild.toString(),r,t,n);a.build();for(let u of["main","fragment"]){let g=l[u];if(g!=null&&g.includes("\0")){let d=a.buildFromStr(g,1);u==="main"?l.main=d:l.setFragment(d)}}return l},this)}return i},parse(o,r,e,t,n){o=go(o);let i,s,a,l;typeof r=="string"?(i=!!e,s=t,a=n,l=r):(i=!!r,s=e,a=t,l=n),s!=null||(s=11),a!=null||(a=this.getConfig());let u;typeof s!="number"&&(u=Array.isArray(s)?s:[s],s=Math.max(...u.map(p=>ao[p]||11)));let{Token:g}=(G(),X(ai));return oe.run(()=>{let p=new g(o,a);return p.type="root",p.pageName=l,p.parse(s,i)})},parseWithRef(o,r,e,t=r.getAttribute("include")){return this.parse(o,t,e,r.getAttribute("config"),r.pageName)},createLanguageService(o={}){},lint(o,r,e,t){{let[n,i,s]=pu(r,e,t);return oe.internal(()=>this.parse(o,n,void 0,i,s).lint(),this)}},print(o,r,e,t){}},Nd={},fu=new Set(["lintConfig","normalizeTitle","parse","createLanguageService"]);for(let o of Object.keys(vn))fu.has(o)||(Nd[o]={enumerable:!1});Object.defineProperties(vn,Nd);Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:vn});v=vn});D();})();
|