wikiparser-node 1.31.0 → 1.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/bundle/bundle-es8.min.js +29 -30
- package/bundle/bundle-lsp.min.js +29 -29
- package/bundle/bundle.min.js +23 -23
- package/dist/addon/attribute.js +166 -0
- package/dist/addon/link.js +92 -0
- package/dist/addon/table.js +12 -3
- package/dist/addon/token.js +5 -303
- package/dist/addon/transclude.js +9 -6
- package/dist/base.d.mts +9 -1
- package/dist/base.d.ts +9 -1
- package/dist/bin/config.js +1 -1
- package/dist/index.d.ts +24 -5
- package/dist/index.js +69 -89
- package/dist/internal.d.ts +4 -0
- package/dist/lib/document.d.ts +9 -7
- package/dist/lib/document.js +91 -66
- package/dist/lib/element.d.ts +7 -7
- package/dist/lib/element.js +48 -50
- package/dist/lib/lintConfig.js +1 -1
- package/dist/lib/lsp.js +120 -56
- package/dist/lib/node.js +20 -14
- package/dist/lib/text.js +2 -2
- package/dist/lib/title.d.ts +11 -0
- package/dist/lib/title.js +37 -13
- package/dist/mixin/elementLike.js +2 -3
- package/dist/mixin/syntax.js +13 -7
- package/dist/parser/commentAndExt.js +3 -3
- package/dist/parser/selector.js +16 -41
- package/dist/render/expand.js +216 -0
- package/dist/render/extension.js +141 -0
- package/dist/render/html.js +91 -0
- package/dist/{addon → render}/magicWords.js +35 -1
- package/dist/render/syntaxhighlight.js +415 -0
- package/dist/src/arg.js +1 -1
- package/dist/src/attribute.d.ts +5 -0
- package/dist/src/attribute.js +58 -103
- package/dist/src/attributes.d.ts +5 -0
- package/dist/src/attributes.js +15 -50
- package/dist/src/converter.js +4 -2
- package/dist/src/converterFlags.js +8 -6
- package/dist/src/converterRule.js +19 -15
- package/dist/src/extLink.js +1 -1
- package/dist/src/heading.d.ts +1 -1
- package/dist/src/heading.js +5 -3
- package/dist/src/imageParameter.d.ts +0 -1
- package/dist/src/imageParameter.js +33 -24
- package/dist/src/index.d.ts +5 -5
- package/dist/src/index.js +33 -21
- package/dist/src/link/base.js +16 -34
- package/dist/src/link/category.d.ts +7 -0
- package/dist/src/link/category.js +101 -37
- package/dist/src/link/file.js +19 -6
- package/dist/src/link/galleryImage.js +1 -2
- package/dist/src/link/index.d.ts +1 -1
- package/dist/src/link/index.js +10 -31
- package/dist/src/multiLine/index.js +1 -1
- package/dist/src/nowiki/comment.js +1 -1
- package/dist/src/nowiki/doubleUnderscore.js +4 -2
- package/dist/src/nowiki/index.js +34 -31
- package/dist/src/nowiki/listBase.d.ts +2 -1
- package/dist/src/nowiki/listBase.js +22 -8
- package/dist/src/nowiki/quote.d.ts +1 -1
- package/dist/src/nowiki/quote.js +1 -1
- package/dist/src/onlyinclude.js +1 -1
- package/dist/src/parameter.js +1 -1
- package/dist/src/redirect.js +1 -1
- package/dist/src/table/base.js +4 -2
- package/dist/src/table/index.d.ts +0 -5
- package/dist/src/table/index.js +6 -15
- package/dist/src/table/td.js +9 -5
- package/dist/src/tag/index.js +1 -1
- package/dist/src/tagPair/ext.js +14 -38
- package/dist/src/tagPair/index.js +6 -4
- package/dist/src/tagPair/translate.js +2 -2
- package/dist/src/transclude.d.ts +0 -6
- package/dist/src/transclude.js +16 -33
- package/dist/util/constants.js +5 -1
- package/dist/util/debug.js +72 -5
- package/dist/util/diff.js +17 -15
- package/dist/util/html.js +4 -3
- package/dist/util/selector.js +37 -0
- package/dist/util/sharable.d.mts +4 -1
- package/dist/util/sharable.js +7 -7
- package/dist/util/sharable.mjs +7 -7
- package/dist/util/string.js +31 -12
- package/extensions/dist/base.js +1 -1
- package/i18n/zh-hans.json +29 -29
- package/i18n/zh-hant.json +30 -30
- package/package.json +16 -13
package/bundle/bundle-es8.min.js
CHANGED
|
@@ -1,32 +1,31 @@
|
|
|
1
|
-
"use strict";(()=>{var Va=Object.defineProperty,Qa=Object.defineProperties;var Ja=Object.getOwnPropertyDescriptors;var es=Object.getOwnPropertySymbols;var Wr=Object.prototype.hasOwnProperty,zr=Object.prototype.propertyIsEnumerable;var Mr=e=>{throw TypeError(e)};var Ws=(e,t,s)=>t in e?Va(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,ge=(e,t)=>{for(var s in t||(t={}))Wr.call(t,s)&&Ws(e,s,t[s]);if(es)for(var s of es(t))zr.call(t,s)&&Ws(e,s,t[s]);return e},Be=(e,t)=>Qa(e,Ja(t));var Ur=(e,t)=>{var s={};for(var i in e)Wr.call(e,i)&&t.indexOf(i)<0&&(s[i]=e[i]);if(e!=null&&es)for(var i of es(e))t.indexOf(i)<0&&zr.call(e,i)&&(s[i]=e[i]);return s};var Xa=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Fe=(e,t,s)=>Ws(e,typeof t!="symbol"?t+"":t,s),zs=(e,t,s)=>t.has(e)||Mr("Cannot "+s);var m=(e,t,s)=>(zs(e,t,"read from private field"),s?s.call(e):t.get(e)),L=(e,t,s)=>t.has(e)?Mr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),E=(e,t,s,i)=>(zs(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),P=(e,t,s)=>(zs(e,t,"access private method"),s);var Dr=(e,t,s,i)=>({set _(n){E(e,t,n,s)},get _(){return m(e,t,i)}});var id=Xa((nd,Ga)=>{var Gl=Object.create,tt=Object.defineProperty,Vl=Object.getOwnPropertyDescriptor,dr=Object.getOwnPropertyNames,Ka=Object.getPrototypeOf,Ya=Object.prototype.hasOwnProperty,Ql=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),At=e=>{throw TypeError(e)},Jl=(e,t,s)=>t in e?tt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Hr=(e,t)=>tt(e,"name",{value:t,configurable:!0}),C=(e,t)=>function(){return e&&(t=(0,e[dr(e)[0]])(e=0)),t},Xl=(e,t)=>function(){return t||(0,e[dr(e)[0]])((t={exports:{}}).exports,t),t.exports},ie=(e,t)=>{for(var s in t)tt(e,s,{get:t[s],enumerable:!0})},Kl=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of dr(t))!Ya.call(e,n)&&n!==s&&tt(e,n,{get:()=>t[n],enumerable:!(i=Vl(t,n))||i.enumerable});return e},Za=(e,t,s)=>(s=e!=null?Gl(Ka(e)):{},Kl(t||!e||!e.__esModule?tt(s,"default",{value:e,enumerable:!0}):s,e)),X=e=>Kl(tt({},"__esModule",{value:!0}),e),K=e=>{var t;return[,,,Gl((t=e==null?void 0:e[Ql("metadata")])!=null?t:null)]},Yl=["class","method","getter","setter","accessor","field","value","get","set"],Rt=e=>e!==void 0&&typeof e!="function"?At("Function expected"):e,eu=(e,t,s,i,n)=>({kind:Yl[e],name:t,metadata:i,addInitializer:r=>s._?At("Already initialized"):n.push(Rt(r||null))}),hr=(e,t)=>Jl(t,Ql("metadata"),e[3]),V=(e,t,s,i)=>{for(var n=0,r=e[t>>1],l=r&&r.length;n<l;n++)t&1?r[n].call(s):i=r[n].call(s,i);return i},Q=(e,t,s,i,n,r)=>{var l,u,o,d,a,h=t&7,g=!!(t&8),c=!!(t&16),p=h>3?e.length+1:h?g?1:2:0,f=Yl[h+5],x=h>3&&(e[p-1]=[]),w=e[p]||(e[p]=[]),A=h&&(!c&&!g&&(n=n.prototype),h<5&&(h>3||!c)&&Vl(h<4?n:{get[s](){return he(this,r)},set[s](y){return we(this,r,y)}},s));h?c&&h<4&&Hr(r,(h>2?"set ":h>1?"get ":"")+s):Hr(n,s);for(var S=i.length-1;S>=0;S--)d=eu(h,s,o={},e[3],w),h&&(d.static=g,d.private=c,a=d.access={has:c?y=>su(n,y):y=>s in y},h^3&&(a.get=c?y=>(h^1?he:Ki)(y,n,h^4?r:A.get):y=>y[s]),h>2&&(a.set=c?(y,k)=>we(y,n,k,h^4?r:A.set):(y,k)=>y[s]=k)),u=(0,i[S])(h?h<4?c?r:A[f]:h>4?void 0:{get:A.get,set:A.set}:n,d),o._=1,h^4||u===void 0?Rt(u)&&(h>4?x.unshift(u):h?c?r=u:A[f]=u:n=u):typeof u!="object"||u===null?At("Object expected"):(Rt(l=u.get)&&(A.get=l),Rt(l=u.set)&&(A.set=l),Rt(l=u.init)&&x.unshift(l));return h||hr(e,n),A&&tt(n,s,A),c?h^4?r:A:n},tu=(e,t,s)=>Jl(e,typeof t!="symbol"?t+"":t,s),cr=(e,t,s)=>t.has(e)||At("Cannot "+s),su=(e,t)=>Object(t)!==t?At('Cannot use the "in" operator on this value'):e.has(t),he=(e,t,s)=>(cr(e,t,"read from private field"),s?s.call(e):t.get(e)),ze=(e,t,s)=>t.has(e)?At("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),we=(e,t,s,i)=>(cr(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),Ki=(e,t,s)=>(cr(e,t,"access private method"),s),iu=(e,t,s,i)=>({set _(n){we(e,t,n,s)},get _(){return he(e,t,i)}}),Zl,ys,eo=C({"base.ts"(){"use strict";Zl=(()=>{const e={redirect:1,onlyinclude:1,noinclude:1,include:1,comment:1,ext:1,arg:2,"magic-word":2,template:2,heading:2,html:3,table:4,hr:5,"double-underscore":5,link:6,category:6,file:6,quote:7,"ext-link":8,"free-ext-link":9,"magic-link":9,list:10,dd:10,converter:11};return Object.setPrototypeOf(e,null),e})(),ys=(()=>{const e=["arg-in-ext","bold-header","format-leakage","fostered-content","h1","illegal-attr","insecure-style","invalid-gallery","invalid-imagemap","invalid-invoke","invalid-isbn","invalid-url","lonely-apos","lonely-bracket","lonely-http","nested-link","no-arg","no-duplicate","no-ignored","obsolete-attr","obsolete-tag","parsing-order","pipe-like","syntax-like","table-layout","tag-like","unbalanced-header","unclosed-comment","unclosed-quote","unclosed-table","unescaped","unknown-page","unmatched-tag","unterminated-url","url-encoding","var-anchor","void-ext"];return Object.freeze(e),e})()}});function Se(e,t,s){return s===1?e.replace(/\0(\d+)g\x7F/gu,(i,n)=>Se(String(t[n]),t,2)):s===2?e.replace(/\0(\d+)n\x7F/gu,(i,n)=>String(t[n])):e.replace(/\0(\d+)\x7F/gu,(i,n)=>t[n])}var De,Ms,vt,bt,yt,at,to,me,st,Gr,Vr,ws,so,Qr,Jr,Qt,wt,ce=C({"util/string.ts"(){"use strict";De=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Ms=String.raw`[^[\]<>"\0-\x1F\x7F${De}\uFFFD]`,vt=String.raw`(?:\[[\da-f:.]+\]|${Ms})`,bt=String.raw`(?:${Ms}|\0\d+[cn!~]\x7F)*`,yt=e=>e.trim().toLowerCase(),at=(e,t)=>s=>s.replace(e,t),to=at(/[\0\x7F]|\r$/gmu,""),me=at(/\0\d+[cn]\x7F/gu,""),st=(e,t="")=>e.map(s=>typeof s=="string"?s:s.text()).join(t),Gr={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},Vr=at(/&(?:#(\d+|[Xx][\da-fA-F]+)|([lg]t|[LG]T|[lr]brac[ke]|nbsp|amp|AMP|quot|QUOT));/gu,(e,t,s)=>t?String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t)):Gr[s.toLowerCase()]),ws=e=>Vr(e),so=at(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),Qr={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},Jr=(e=/[&<>"{}[\]|]/gu)=>at(e,t=>`&${Qr[t]};`),Qt=Jr(/[&<>]/gu),wt=(e,t={})=>{const{pre:s="",post:i="",sep:n=""}=t;return s+e.map(r=>r.print()).join(n)+i}}}),ru=Xl({"config/minimum.json"(e,t){t.exports={ext:[],html:[["b","bdi","del","i","ins","u","font","big","small","sub","sup","h1","h2","h3","h4","h5","h6","cite","code","em","s","strike","strong","tt","var","div","center","blockquote","ol","ul","dl","table","caption","pre","ruby","rb","rp","rt","rtc","p","span","abbr","dfn","kbd","samp","data","time","mark","tr","td","th","q","bdo"],["li","dt","dd"],["br","wbr","hr","meta","link"]],namespaces:{0:"",6:"File",10:"Template",14:"Category",828:"Module"},nsid:{"":0,file:6,template:10,category:14,module:828},functionHook:["msgnw"],variable:["!","=","pageid","articlepath","server","servername","scriptpath","stylepath"],parserFunction:[{msgnw:"msgnw",pageid:"pageid",articlepath:"articlepath",server:"server",servername:"servername",scriptpath:"scriptpath",stylepath:"stylepath","#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"formatdate","#dateformat":"formatdate","#invoke":"invoke","#while":"while","#dowhile":"dowhile","#loop":"loop","#forargs":"forargs","#fornumargs":"fornumargs","#if":"if","#ifeq":"ifeq","#switch":"switch","#ifexist":"ifexist","#ifexpr":"ifexpr","#iferror":"iferror","#time":"time","#timel":"timel","#expr":"expr","#rel2abs":"rel2abs","#titleparts":"titleparts","#categorytree":"categorytree","#urldecode":"urldecode","#choose":"choose","#var":"var","#varexists":"varexists","#var_final":"var_final","#vardefine":"vardefine","#vardefineecho":"vardefineecho","#widget":"widget","#related":"related","#regex":"regex","#regex_var":"regex_var","#regexquote":"regexquote","#regexall":"regexall","#len":"len","#pos":"pos","#rpos":"rpos","#sub":"sub","#count":"count","#rmatch":"rmatch","#rreplace":"rreplace","#replace":"replace","#rsplit":"rsplit","#explode":"explode","#tab":"tab","#seo":"seo","#babel":"babel","#translation":"translation","#commaseparatedlist":"commaseparatedlist","#coordinates":"coordinates","#lst":"lst","#lsth":"lsth","#lstx":"lstx","#assessment":"assessment","#mentor":"mentor","#property":"property","#target":"target","#section":"lst","#section-x":"lstx","#section-h":"lsth","#statements":"statements","#useliquidthreads":"useliquidthreads","#lqtpagelimit":"lqtpagelimit","#avatar":"avatar","#img":"img","#chart":"chart"},{"!":"!","=":"=","#FORMAL":"formal","#bcp47":"bcp47","#dir":"dir","#interwikilink":"interwikilink","#interlanguagelink":"interlanguagelink","#contentmodel":"contentmodel","#timef":"timef","#timefl":"timefl"},["msg","raw"],["subst","safesubst"]],doubleUnderscore:[[],[]],protocol:"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|matrix:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|wikipedia://|worldwind://|xmpp:",interwiki:[],img:{},redirection:["#redirect"],variants:[]}}}),fe,io,Yi,qe=C({"util/constants.ts"(){"use strict";fe=11,io=void 0,Yi=ru()}});function xt(e){const t=new Map,s=new WeakMap;return i=>{const n=typeof i=="string"?t:s;if(n.has(i)){const l=n.get(i);return l.lastIndex=0,l}const r=e(i);return n.set(i,r),r}}var Jt,it=C({"../common/dist/index.mjs"(){"use strict";Jt=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25"))}}),ne,ue=C({"lib/rect.ts"(){"use strict";var e,t,s,i,Zi,r;ne=(r=class{constructor(l,u){L(this,i);L(this,e);L(this,t);L(this,s);E(this,e,l),E(this,t,u)}get start(){return m(this,t)}get top(){return P(this,i,Zi).call(this).top}get left(){return P(this,i,Zi).call(this).left}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakSet,Zi=function(){var l;return(l=m(this,s))!=null||E(this,s,m(this,e).getRootNode().posFromIndex(m(this,t))),m(this,s)},r)}}),Xr,Kr,Vt,er,Us,j,q,Ce,$s,H,gr,He,pr,fr,mr,Xt,St,xr,et,ro,W=C({"util/lint.ts"(){"use strict";it(),Le(),ue(),O(),Xr=new Set(["tr","td","th","caption"]),Kr=new Set(["Template:!!","Template:!-"]),Vt=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")&&Kr.has(t.name)||t.is("html")&&Xr.has(t.name))return!1;if(t.is("arg"))return t.length>1&&Vt(t.childNodes[1]);if(t.is("magic-word"))try{const s=t.getPossibleValues().map(Vt);return s.includes(2)?2:s.includes(1)&&1}catch(s){}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?1:2},er=(e,t,s,i)=>({line:e+s-1,character:(s===1?t:0)+i}),Us=e=>(t,s,i,n,r="error")=>{const{start:l}=s,{top:u,left:o}=s instanceof ne?s:new ne(t,l),{offsetHeight:d,offsetWidth:a}=t,{startIndex:h,startLine:g,startCol:c}=e(t,l,u,o),{line:p,character:f}=er(g,c,d,a);return{rule:i,message:I.msg(n),severity:r,startIndex:h,endIndex:h+t.toString().length,startLine:g,endLine:p,startCol:c,endCol:f}},j=Us((e,t,s,i)=>{const n=e.getRelativeIndex(),{top:r,left:l}=e.parentNode.posFromIndex(n);return{startIndex:t+n,startLine:s+r,startCol:r?l:i+l}}),q=Us((e,t,s,i)=>({startIndex:t,startLine:s,startCol:i})),Ce=(e,t,s,i=0)=>({desc:I.msg(t),range:[e.startIndex+i,e.endIndex],text:s}),$s=(e,t,s)=>({desc:I.msg(t),range:[e,e],text:s}),H=(e,t=0,s="")=>typeof e=="number"?{desc:I.msg("remove"),range:[e,e+t],text:s}:Ce(e,"remove",s,t),gr=(e,t)=>Ce(e,"decode",Jt(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}),pr=e=>({desc:I.msg("open"),range:[e+1,e+2],text:""}),fr=(e,t)=>Ce(e,"comment",`<!--${t}-->`),mr=(e,t)=>Ce(e,"uppercase",t.toUpperCase()),Xt=(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)}),xr=(e,t)=>({desc:I.msg("escape"),range:[e,e+t.length],text:t.replace(/\|/gu,"|")}),et=(e,t,s,i)=>{if(e&&(i||I.viewOnly&&e[0]===be.rev))return e[1];const n=t();return(i||I.viewOnly)&&s([be.rev,n]),n},ro=(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"]:[]}}),Yr,vr,no=C({"parser/selector.ts"(){"use strict";Yr=e=>{if(e.includes("#")){const t=e.indexOf("#"),s=e.slice(0,t),i=e.slice(t+1);return(n,r)=>(t===0||n===s)&&r===i}return e?t=>t===e:()=>!0},vr=(e,t,s)=>{const i=e.split(",").map(n=>Yr(n.trim()));return(({type:n,name:r})=>i.some(l=>l(n,r)))}}}),nu=Xl({"../node_modules/binary-search/index.js"(e,t){t.exports=function(s,i,n,r,l){var u,o;if(r===void 0)r=0;else if(r=r|0,r<0||r>=s.length)throw new RangeError("invalid lower bound");if(l===void 0)l=s.length-1;else if(l=l|0,l<r||l>=s.length)throw new RangeError("invalid upper bound");for(;r<=l;)if(u=r+(l-r>>>1),o=+n(s[u],i,u,s),o<0)r=u+1;else if(o>0)l=u-1;else return u;return~r}}}),Zr,lo,lu=C({"util/search.ts"(){"use strict";Zr=Za(nu()),lo=(e,t,s)=>{const i=(0,Zr.default)(e,t,s);return i<0?~i:i}}}),Ts,br=C({"mixin/cached.ts"(){"use strict";W(),Ts=(e=!0)=>t=>{const s=new WeakMap;return function(...i){return et(s.get(this),()=>t.apply(this,i),n=>{s.set(this,n)},e)}}}}),oo,ou=C({"mixin/nodeLike.ts"(){"use strict";oo=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}}}),en,tn,ts,_t,$t,ss,Tt,Ct,It,Ke,ao=C({"lib/node.ts"(){"use strict";lu(),W(),Le(),br(),ou(),O(),tn=[oo],en=[Ts(!1)],Ke=class{constructor(){V(It,5,this),tu(this,"childNodes",[]),ze(this,ts),ze(this,_t),ze(this,$t),ze(this,ss),ze(this,Tt),ze(this,Ct,{})}get parentNode(){return he(this,ts)}get nextSibling(){return he(this,_t)}get previousSibling(){return he(this,$t)}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":we(this,ts,t),t||(we(this,_t,void 0),we(this,$t,void 0));break;case"nextSibling":we(this,_t,t);break;case"previousSibling":we(this,$t,t);break;case"aIndex":I.viewOnly&&we(this,Tt,[be.rev,t]);break;default:this[e]=t}}getRootNode(){return et(he(this,ss),()=>{var e,t;return(t=(e=this.parentNode)==null?void 0:e.getRootNode())!=null?t:this},e=>{const[,t]=e;t.type==="root"&&we(this,ss,e)})}indexFromPos(e,t){this.lspError("AstNode.indexFromPos")}posFromIndex(e){{const{length:t}=String(this);if(e+=e<0?t:0,e>=0&&e<=t){const s=this.getLines(),i=lo(s,e,([,,n],r)=>n-r);return{top:i,left:e-s[i][1]}}return}}getDimension(){{const e=this.getLines(),t=e[e.length-1];return{height:e.length,width:t[2]-t[1]}}}getGaps(e){return 0}getRelativeIndex(e){if(e===void 0){const{parentNode:t}=this;return t?t.getRelativeIndex(t.childNodes.indexOf(this)):0}return et(he(this,Ct)[e],()=>{const{childNodes:t}=this,s=e+(e<0?t.length:0);let i=this.getAttribute("padding");for(let n=0;n<s;n++)I.viewOnly&&(he(this,Ct)[n]=[be.rev,i]),i+=t[n].toString().length+this.getGaps(n);return i},t=>{he(this,Ct)[e]=t})}getAbsoluteIndex(){return et(he(this,Tt),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{we(this,Tt,e)})}getBoundingClientRect(){this.lspError("AstNode.getBoundingClientRect")}is(e){return this.type===e}getLines(){{const e=[];let t=0;for(const s of String(this).split(`
|
|
2
|
-
`)){const
|
|
3
|
-
==`)&&(
|
|
4
|
-
`,
|
|
5
|
-
`),_e!==-1));)ye=ye.nextSibling;if(!ye)continue;je=ye.data.slice(0,_e)}else je=d.slice(Z+se,oe);if(!/(?:^|[^=])=+\s*(?:\S\s*)?$/u.test(je))continue;oe===-1?(le=ye.getAbsoluteIndex()+je.length,{top:Pe,left:Oe}=S.posFromIndex(le)):(le+=je.length,se+=je.length)}const Je={rule:U,message:I.msg(G==="="?"header-like":"lonely",ke||G==="h"||Bs||qs?M:G),severity:ve,startIndex:ae,endIndex:le,startLine:Br,endLine:Pe!=null?Pe:Br,startCol:qr,endCol:Oe!=null?Oe:qr+se};if($.computeEditInfo)if(G==="<")Je.suggestions=[St(ae,"<")];else if(G==="h"&&c!=="link-text"&&un.test(Os||""))Je.suggestions=[Xt(ae)];else if(ee&&c==="ext-link-text"){const oe=a.getAbsoluteIndex()+a.toString().length;Je.suggestions=[St(oe,"]")]}else if(J&&Or){const oe=n-g.toString().length;Je.suggestions=[$s(oe,"left-bracket","[")]}else ke&&(Je.suggestions=[...z[0]===M?[]:[mr(Je,M)],...Ee===":"||Ee===":"?[Xt(le,1)]:[]]);f.push(Je)}return f}}replaceData(n){P(this,e,ho).call(this,n)}splitText(n){this.lspError("AstText.splitText")}escape(){}print(){return Qt(this.data)}},e=new WeakSet,ho=function(n){this.setAttribute("data",n)},s)}}),Ge,rt=C({"mixin/hidden.ts"(){"use strict";Ge=(e=!0,t=!0)=>s=>{class i extends s{text(){return""}lint(r){return e?[]:super.lint(r)}}return i}}}),pe,xe=C({"mixin/noEscape.ts"(){"use strict";pe=e=>{}}}),Ve,nt=C({"src/syntax.ts"(){"use strict";var e,t;B(),Ve=(t=class extends F{constructor(i,n,r,l,u){super(i,r,l,u);L(this,e);E(this,e,n)}get type(){return m(this,e)}lint(i=this.getAbsoluteIndex()){return super.lint(i,!1)}},e=new WeakMap,t)}}),We,Qe=C({"mixin/padded.ts"(){"use strict";We=({length:e})=>t=>{class s extends t{getAttribute(n){return n==="padding"?e:super.getAttribute(n)}}return s}}}),Ne,lt=C({"src/atom.ts"(){"use strict";var e,t;B(),Ne=(t=class extends F{constructor(i,n,r,l,u){super(i,r,l,u);L(this,e);E(this,e,n)}get type(){return m(this,e)}set type(i){E(this,e,i)}getAttribute(i){var n;return i==="invalid"?this.type==="converter-flag"&&!!((n=this.parentNode)!=null&&n.isInvalidFlag(this)):super.getAttribute(i)}},e=new WeakMap,t)}}),dn,hn,Vs,cn,Me,Cs=C({"src/link/base.ts"(){"use strict";var e,t,s,i;W(),qe(),ue(),Qe(),xe(),O(),B(),lt(),dn=n=>n==="redirect-target"||n==="link",hn=[pe,We("[[")],Me=(i=class extends(cn=F){constructor(r,l,u,o=[],d="|"){super(void 0,u,o,{});L(this,e,!0);L(this,t);L(this,s);if(this.insertAt(new Ne(r,"link-target",u,o,{})),l!==void 0){const a=new F(l,u,o,{});a.type="link-text",a.setAttribute("stage",fe-1),this.insertAt(a)}E(this,t,d)}get link(){}get fragment(){}afterBuild(){E(this,s,this.getTitle()),m(this,t).includes("\0")&&E(this,t,this.buildFromStr(m(this,t),0)),this.setAttribute("name",m(this,s).title),super.afterBuild()}setAttribute(r,l){r==="bracket"?E(this,e,l):r==="title"?E(this,s,l):super.setAttribute(r,l)}toString(r){const l=super.toString(r,m(this,t));return m(this,e)?`[[${l}]]`:l}text(){const r=super.text("|");return m(this,e)?`[[${r}]]`:r}getAttribute(r){return r==="title"?m(this,s):super.getAttribute(r)}getGaps(r){return r===0?m(this,t).length:1}lint(r=this.getAbsoluteIndex(),l){{const u=super.lint(r,l),{childNodes:[o,d],type:a}=this,{encoded:h,fragment:g}=m(this,s),{lintConfig:c}=I,{computeEditInfo:p,fix:f}=c,x=new ne(this,r);let w="unknown-page",A=c.getSeverity(w);if(A&&o.childNodes.some(({type:S})=>S==="template")&&u.push(j(o,x,w,"template-in-link",A)),w="url-encoding",A=c.getSeverity(w),A&&h){const S=j(o,x,w,"unnecessary-encoding",A);(p||f)&&(S.fix=gr(S,o)),u.push(S)}if(w="pipe-like",A=c.getSeverity(w,"link"),A&&(a==="link"||a==="category")){const S=d==null?void 0:d.childNodes.findIndex(k=>k.type==="text"&&k.data.includes("|")),y=d==null?void 0:d.childNodes[S];if(y){const k=j(d,x,w,"pipe-in-link",A);if(p){const b=k.startIndex+d.getRelativeIndex(S);k.suggestions=[xr(b,y.data)]}u.push(k)}}if(w="no-ignored",A=c.getSeverity(w,"fragment"),A&&g!==void 0&&!dn(a)){const S=j(o,x,w,"useless-fragment",A);if(p||f){const y=o.childNodes.findIndex(b=>b.type==="text"&&b.data.includes("#")),k=o.childNodes[y];k&&(S.fix=H(S,o.getRelativeIndex(y)+k.data.indexOf("#")))}u.push(S)}return u}}getTitle(r,l){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:l,temporary:r,decode:!0,selfLink:!0})}print(){return super.print(m(this,e)?{pre:"[[",post:"]]",sep:m(this,t)}:{sep:m(this,t)})}json(r,l=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i),Vs=K(cn),Me=Q(Vs,0,"LinkBaseToken",hn,Me),V(Vs,1,Me)}}),gn,Qs,pn,Ie,ot=C({"src/nowiki/base.ts"(){"use strict";xe(),B(),gn=[pe],Ie=class extends(pn=F){get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}},Qs=K(pn),Ie=Q(Qs,0,"NowikiBaseToken",gn,Ie),V(Qs,1,Ie)}}),fn,Js,mn,Ae,kt=C({"src/nowiki/noinclude.ts"(){"use strict";W(),rt(),O(),ot(),fn=[Ge(!1)],Ae=class extends(mn=Ie){get type(){return"noinclude"}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){{const{lintConfig:t}=I,s="no-ignored",i=t.getSeverity(s,"include");if(i){const{innerText:n}=this,r=/^<(noinclude|includeonly|onlyinclude)\s+(?:[^\s>/]|\/(?!>))[^>]*>$/iu.exec(n);if(r){const l=q(this,{start:e},s,"useless-attribute",i),{computeEditInfo:u}=t,o=r[1].length+1,d=n.endsWith("/>")?2:1;return l.startIndex+=o,l.startCol+=o,l.endIndex-=d,l.endCol-=d,u&&(l.suggestions=[H(l)]),[l]}}return[]}}},Js=K(mn),Ae=Q(Js,0,"NoincludeToken",fn,Ae),V(Js,1,Ae)}}),co,hu=C({"src/link/redirectTarget.ts"(){"use strict";W(),O(),Cs(),kt(),co=class extends Me{get type(){return"redirect-target"}constructor(e,t,s,i){super(e,void 0,s,i),t!==void 0&&this.insertAt(new Ae(t,s,i))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,{halfParsed:!0,decode:!0,page:""})}lint(e=this.getAbsoluteIndex()){{const t=super.lint(e,!1),s="no-ignored",{lintConfig:i}=I,n=i.getSeverity(s,"redirect");if(n&&this.length===2){const r=j(this.lastChild,{start:e},s,"useless-link-text",n);r.startIndex--,r.startCol--,(i.computeEditInfo||i.fix)&&(r.fix=H(r)),t.push(r)}return t}}}}}),xn,Xs,vn,Ot,cu=C({"src/redirect.ts"(){"use strict";var e,t,s;rt(),xe(),B(),nt(),hu(),xn=[Ge(!1,!1),pe],Ot=(s=class extends(vn=F){constructor(n,r,l,u,o,d,a=[]){super(void 0,d,a);L(this,e);L(this,t);E(this,e,n),E(this,t,o),this.append(new Ve(r,"redirect-syntax",d,a),new co(l,u==null?void 0:u.slice(1),d,a))}get type(){return"redirect"}getAttribute(n){return n==="padding"?m(this,e).length:super.getAttribute(n)}toString(n){return m(this,e)+super.toString(n)+m(this,t)}lint(n=this.getAbsoluteIndex()){{const r=n+m(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",r),this.lastChild.lint(r)}}print(){return super.print({pre:m(this,e),post:m(this,t)})}},e=new WeakMap,t=new WeakMap,s),Xs=K(vn),Ot=Q(Xs,0,"RedirectToken",xn,Ot),V(Xs,1,Ot)}}),go={};ie(go,{parseRedirect:()=>po});var po,gu=C({"parser/redirect.ts"(){"use strict";O(),cu(),po=(e,t,s)=>{var n;(n=t.regexRedirect)!=null||(t.regexRedirect=new RegExp(String.raw`^(\s*)((?:${t.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));const i=t.regexRedirect.exec(e);return i&&I.normalizeTitle(i[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,page:""}).valid?(e=`\0${s.length}o${e.slice(i[0].length)}`,new Ot(...i.slice(1),t,s),e):!1}}}),bn,Ks,yn,jt,pu=C({"src/onlyinclude.ts"(){"use strict";Qe(),xe(),B(),bn=[pe,We("<onlyinclude>")],jt=class extends(yn=F){get type(){return"onlyinclude"}toString(e){return`<onlyinclude>${super.toString(e)}</onlyinclude>`}isPlain(){return!0}print(){return super.print({pre:'<span class="wpb-ext"><onlyinclude></span>',post:'<span class="wpb-ext"></onlyinclude></span>'})}},Ks=K(yn),jt=Q(Ks,0,"OnlyincludeToken",bn,jt),V(Ks,1,jt)}}),Yt,Is=C({"mixin/gapped.ts"(){"use strict";Yt=(e=1)=>t=>{class s extends t{getGaps(){return e}}return s}}}),wn,Ys,Sn,Ye,yr=C({"src/tagPair/index.ts"(){"use strict";var e,t;Is(),xe(),B(),wn=[Yt(),pe],Ye=(t=class extends(Sn=F){constructor(i,n,r,l,u,o=[]){super(void 0,u);L(this,e);Fe(this,"closed");Fe(this,"selfClosing");this.setAttribute("name",i.toLowerCase()),E(this,e,[i,l||i]),this.closed=l!=="",this.selfClosing=l===void 0,this.append(n,r);const d=typeof n=="string"?-1:o.indexOf(n);o.splice(d===-1?1/0:d,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(i){const{selfClosing:n,firstChild:r,lastChild:l}=this,[u,o]=m(this,e);return n?`<${u}${r.toString(i)}/>`:`<${u}${r.toString(i)}>${l.toString(i)}${this.closed?`</${o}>`:""}`}text(){const[i,n]=m(this,e);return this.selfClosing?`<${i}${this.firstChild.text()}/>`:`<${i}${super.text(">")}${this.closed?`</${n}>`:""}`}getAttribute(i){return i==="padding"?m(this,e)[0].length+1:super.getAttribute(i)}print(){const[i,n]=m(this,e);return super.print(this.selfClosing?{pre:`<${i}`,post:"/>"}:{pre:`<${i}`,sep:">",post:this.closed?`</${n}>`:""})}},e=new WeakMap,t),Ys=K(Sn),Ye=Q(Ys,0,"TagPairToken",wn,Ye),V(Ys,1,Ye)}}),wr,fo=C({"src/tag/index.ts"(){"use strict";var e,t,s,i;W(),Le(),B(),O(),wr=(i=class extends F{constructor(r,l,u,o,d){super(void 0,o,d);L(this,e);L(this,t);L(this,s);this.insertAt(l),E(this,e,u),E(this,t,r)}get closing(){return m(this,e)}toString(r){return`<${m(this,e)?"/":""}${m(this,t)}${super.toString(r)}${this.selfClosing?"/":""}>`}text(r=""){const{closing:l}=this;return`<${l&&!r?"/":""}${m(this,t)}${l?"":super.text()}${r}>`}getAttribute(r){return r==="padding"?m(this,t).length+(m(this,e)?2:1):super.getAttribute(r)}findMatchingTag(){return et(m(this,s),()=>{const{type:r,name:l,parentNode:u,closing:o,selfClosing:d}=this;let a=!1,h=!1;if(r==="html"){const{html:[,w,A]}=this.getAttribute("config");a=A.includes(l),h=w.includes(l)}if(a||h&&d)return this;if(!u)return;const{childNodes:g}=u,c=g.indexOf(this),p=o?g.slice(0,c).reverse():g.slice(c+1),f=[this],{rev:x}=be;for(const w of p)if(!(!w.is(r)||r==="html"&&(w.name!==l||h&&w.selfClosing)))if(m(w,e)===o){if(r==="tvar")return;f.push(w)}else{const A=f.pop();if(A===this)return w;I.viewOnly&&(E(A,s,[x,w]),E(w,s,[x,A]))}if(I.viewOnly)for(const w of f)E(w,s,[x,void 0])},r=>{E(this,s,r),r[1]&&r[1]!==this&&E(r[1],s,[be.rev,this])})}print(){return super.print({pre:`<${m(this,e)?"/":""}${m(this,t)}`,post:`${this.selfClosing?"/":""}>`})}json(r,l=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i)}}),An,Zs,kn,Ue,fu=C({"src/tag/tvar.ts"(){"use strict";rt(),xe(),fo(),nt(),An=[Ge(),pe],Ue=class extends(kn=wr){get type(){return"tvar"}constructor(e,t,s,i,n){const r=new Ve(t,"tvar-name",i,n);super(e,r,s,i,n)}},Zs=K(kn),Ue=Q(Zs,0,"TvarToken",An,Ue),V(Zs,1,Ue)}}),mo,mu=C({"src/tagPair/translate.ts"(){"use strict";var e,xo,s;B(),yr(),nt(),fu(),mo=(s=class extends Ye{constructor(n,r,l,u=[]){const o=new Ve(n,"translate-attr",l,u);r=r==null?void 0:r.replace(/<tvar(\|[^>]+)>([\s\S]*?)<\/>/gu,(a,h,g)=>(new Ue("tvar",h,!1,l,u),new Ue("","",!0,l,u),`\0${u.length-2}n${g}\0${u.length}n`)).replace(/<(tvar)(\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\3|[^"'\s>]+))?\s*)>([\s\S]*?)<\/(tvar)(\s*)>/giu,(a,h,g,c,p,f,x)=>(new Ue(h,g,!1,l,u),new Ue(f,x,!0,l,u),`\0${u.length-2}n${p}\0${u.length}n`));const d=new F(r,l,u);d.type="translate-inner";super("translate",o,d,"translate",l,u);L(this,e);this.seal("closed",!0),this.seal("selfClosing",!0)}get type(){return"translate"}toString(n){return n?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){return`<span class="wpb-ext"><translate${P(this,e,xo).call(this)?'<span class="wpb-ext-attrs"> <span class="wpb-ext-attr"><span class="wpb-attr-key">nowrap</span></span></span>':""}>${this.lastChild.print({class:"ext-inner"})}</translate></span>`}},e=new WeakSet,xo=function(){return this.firstChild.toString()===" nowrap"},s)}}),_n,ei,$n,Bt,xu=C({"src/tagPair/include.ts"(){"use strict";W(),ue(),rt(),O(),yr(),_n=[Ge(!1)],Bt=class extends($n=Ye){get type(){return"include"}constructor(e,t="",s,i,n,r){super(e,t,s!=null?s:"",s===void 0||i!=null?i:"",n,r)}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){{const t=[],{firstChild:s,closed:i,name:n}=this,r=new ne(this,e),l=["no-ignored","unclosed-comment"],{lintConfig:u}=I,{computeEditInfo:o}=u,d=l.map(a=>u.getSeverity(a,"include"));if(d[0]&&s.data.trim()){const a=j(s,r,l[0],"useless-attribute",d[0]);o&&(a.suggestions=[H(a)]),t.push(a)}if(d[1]&&!i){const a=q(this,r,l[1],I.msg("unclosed",`<${n}>`),d[1]);o&&(a.suggestions=[He(a.endIndex,`</${n}>`)]),t.push(a)}return t}}},ei=K($n),Bt=Q(ei,0,"IncludeToken",_n,Bt),V(ei,1,Bt)}}),Ns,Sr=C({"mixin/attributesParent.ts"(){"use strict";Ns=(e=0)=>t=>{var s,vo;{class n extends t{constructor(){super(...arguments);L(this,s)}hasAttr(u){this.lspError("AttributesParent.hasAttr")}getAttr(u){return P(this,s,vo).call(this).getAttr(u)}}return s=new WeakSet,vo=function(){return this.childNodes[e]},n}}}}),re,ti,si,Nt,rs,ii,Lt,ri,ni,li,ns,oi,ai,ui,$e,bo,yo,wo,So,vu=C({"util/sharable.ts"(){"use strict";re=new Set(["align"]),ti=new Set(["cite"]),si=new Set(["cite","datetime"]),Nt=new Set(["width"]),rs=new Set(["axis","align","bgcolor","height","width","valign"]),ii=new Set([...rs,"abbr","headers","scope","rowspan","colspan"]),Lt=new Set(["type"]),ri=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),ni=new Set(["clear"]),li=new Set(["bgcolor","align","valign"]),ns=new Set(["qid","forcemathmode","type","display"]),oi=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),ai=new Set(["weight"]),ui=new Set(["width","height","zoom","latitude","longitude","align","mapstyle","lang","alt","text"]),$e=new Set,bo=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"]),yo={div:re,h1:re,h2:re,h3:re,h4:re,h5:re,h6:re,blockquote:ti,q:ti,p:re,br:ni,pre:Nt,ins:si,del:si,ul:Lt,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...ri,"border"]),caption:re,tr:li,td:ii,th:ii,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:re,categorytree:re,combooption:re,math:$e,chem:$e,ce:$e,img:new Set(["alt","src","width","height","loading","srcset"])},wo={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:$e,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:ai,choicetemplate:ai,imagemap:$e,inputbox:$e,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:$e,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([...ns,"chem"]),chem:ns,ce:ns,hiero:$e,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:oi,syntaxhighlight:oi,templatedata:$e,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:$e,mapframe:new Set([...ui,"frameless"]),maplink:new Set([...ui,"class"]),rss:new Set(["template","templatename","max","highlight","filter","filterout","reverse","date","item-max-length"]),"page-collection":new Set(["lang","name","description","end-date"])},So={table:ri,td:new Set([...rs,"scope"]),th:rs,br:ni,caption:re,div:re,hr:Nt,h1:re,h2:re,h3:re,h4:re,h5:re,h6:re,li:Lt,p:re,pre:Nt,tr:li,ul:Lt}}}),Tn,Cn,In,Nn,ps,bu=C({"src/attribute.ts"(){"use strict";var e,t,s,i,n,Ao,ir,u;W(),ce(),qe(),vu(),ue(),O(),B(),lt(),Tn=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,Cn=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,In=new Set(["ext","arg","magic-word","template"]),Nn=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),ps=(u=class extends F{constructor(d,a,h,g="",c,p=[],f=I.getConfig(),x=[]){const w=new Ne(h,"attr-key",f,x);let A;if(h==="title"||a==="img"&&h==="alt")A=new F(c,f,x,{}),A.type="attr-value",A.setAttribute("stage",fe-1);else if(a==="gallery"&&h==="caption"||a==="ref"&&h==="details"||(a==="mapframe"||a==="maplink")&&h==="text"||a==="choose"&&(h==="before"||h==="after")){const S=Be(ge({},f),{excludes:[...f.excludes,"heading","html","table","hr","list"]});A=new F(c,S,x,{}),A.type="attr-value",A.setAttribute("stage",1)}else A=new Ne(c,"attr-value",f,x,{});super(void 0,f,x);L(this,n);L(this,e);L(this,t);L(this,s);L(this,i);E(this,e,d),this.append(w,A),E(this,s,g),E(this,i,[...p]),E(this,t,a),this.setAttribute("name",yt(me(h)))}get type(){return m(this,e)}get tag(){return m(this,t)}get balanced(){return!m(this,s)||m(this,i)[0]===m(this,i)[1]}afterBuild(){m(this,s).includes("\0")&&E(this,s,this.buildFromStr(m(this,s),0)),this.parentNode&&E(this,t,this.parentNode.name),P(this,n,Ao).call(this),super.afterBuild()}toString(d){const[a="",h=""]=m(this,i);return m(this,s)?super.toString(d,m(this,s)+a)+h:this.firstChild.toString(d)}text(){return m(this,s)?`${super.text(`${m(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var d,a;return m(this,s)?m(this,s).length+((a=(d=m(this,i)[0])==null?void 0:d.length)!=null?a:0):0}lint(d=this.getAbsoluteIndex(),a){var h;{const g=super.lint(d,a),{balanced:c,firstChild:p,lastChild:f,name:x,tag:w}=this,A=new ne(this,d),S=["unclosed-quote","obsolete-attr"],{lintConfig:y}=I,k=S.map(T=>y.getSeverity(T,x));if(k[0]&&!c){const T=j(f,A,S[0],"unclosed-quotes",k[0]);T.startIndex--,T.startCol--,y.computeEditInfo&&(T.suggestions=[He(T.endIndex,m(this,i)[0])]),g.push(T)}const b=P(this,n,ir).call(this,d,A);return b&&g.push(b),k[1]&&((h=So[w])!=null&&h.has(x))&&g.push(j(p,A,S[1],"obsolete-attribute",k[1])),g}}getValue(){return m(this,s)?this.lastChild.text().trim():this.type==="ext-attr"||""}escape(){}getAttribute(d){return d==="invalid"?P(this,n,ir).call(this):super.getAttribute(d)}print(){const[d="",a=""]=m(this,i);return m(this,s)?super.print({sep:Qt(m(this,s))+d,post:a}):super.print()}json(d,a=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n=new WeakSet,Ao=function(){this.setAttribute("name",yt(this.firstChild.text()))},ir=function(d,a){const{firstChild:h,lastChild:g,type:c,name:p,tag:f,parentNode:x}=this,w=!g.childNodes.some(({type:_})=>In.has(_)),A=this.getValue(),S=wo[f],y=yo[f],{length:k}=this.toString();let b="illegal-attr",T,v;if({lintConfig:T}=I,{computeEditInfo:v}=T,!(S!=null&&S.has(p))&&!(y!=null&&y.has(p))&&(c==="ext-attr"?S||y:!/\{\{[^{]+\}\}/u.test(p))&&(c==="ext-attr"&&!y||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(p)&&(f==="meta"||f==="link"||!bo.has(p)))||(p==="itemtype"||p==="itemid"||p==="itemref")&&!(x!=null&&x.hasAttr("itemscope"))){if(d===void 0)return!0;{const _=T.getSeverity(b,"unknown");if(_){const $=j(h,a,b,"illegal-attribute-name",_);return v&&($.suggestions=[H(d,k)]),$}}}else if(p==="style"&&typeof A=="string"&&Tn.test(A)){if(d===void 0)return!0;{b="insecure-style";const _=T.getSeverity(b);return _&&j(g,a,b,"insecure-style",_)}}else if(p==="tabindex"&&typeof A=="string"&&A!=="0"){if(d===void 0)return!0;{const _=T.getSeverity(b,"tabindex");if(_){const $=j(g,a,b,"nonzero-tabindex",_);return v&&($.suggestions=[H(d,k),Ce($,"0 tabindex","0")]),$}}}else if(typeof A=="string"&&((/^xmlns:[\w:.-]+$/u.test(p)||Nn.has(p))&&Cn.test(A)||w&&(p==="href"||f==="img"&&p==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(A))){if(d===void 0)return!0;{const _=T.getSeverity(b,"value");return _&&j(g,a,b,"illegal-attribute-value",_)}}else if(w&&c!=="ext-attr"){const _=ro(f,p),$=String(A).toLowerCase();if(_.length>0&&_.every(N=>N!==$)){if(d===void 0)return!0;{const N=T.getSeverity(b,"value");return N&&j(g,a,b,"illegal-attribute-value",N)}}}return!1},u)}}),di,Ln,En,Ls,Ar=C({"src/attributes.ts"(){"use strict";var e,t,fs,i;W(),ce(),ue(),O(),B(),lt(),bu(),di=n=>n.slice(0,-1),Ln=n=>`${di(n)}-dirty`,En=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch(n){return/[^\W_]/u}})(),Ls=(i=class extends F{constructor(r,l,u,o,d=[]){super(void 0,o,d,{});L(this,t);L(this,e);if(E(this,e,l),this.setAttribute("name",u),r){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(r),c=0;const p=(()=>{h&&(super.insertAt(new Ne(h,Ln(l),o,d,{})),h="")});for(;g;){const{index:f,0:x,1:w,2:A,3:S,4:y,5:k,6:b}=g;if(h+=r.slice(c,f),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(me(w).trim())){const T=y!=null?y:b,v=[S,k],_=new ps(di(l),u,w,A,T,v,o,d);p(),super.insertAt(_)}else h+=x;({lastIndex:c}=a),g=a.exec(r)}h+=r.slice(c),p()}}get type(){return m(this,e)}afterBuild(){const{parentNode:r}=this;r!=null&&r.is("td")&&this.setAttribute("name",r.subtype),super.afterBuild()}getAttrTokens(r){return this.childNodes.filter(l=>l instanceof ps&&(!r||l.name===yt(r)))}hasAttr(r){return this.getAttrTokens(r).length>0}getAttrToken(r){{const l=this.getAttrTokens(r);return l[l.length-1]}}getAttr(r){var l;return(l=this.getAttrToken(r))==null?void 0:l.getValue()}lint(r=this.getAbsoluteIndex(),l){{const u=super.lint(r,l),{parentNode:o,childNodes:d}=this,a=new Map,h=new Set,g=new ne(this,r),c=["no-ignored","no-duplicate"],{lintConfig:p}=I,{computeEditInfo:f,fix:x}=p,w=["closingTag","invalidAttributes","nonWordAttributes"].map(S=>p.getSeverity(c[0],S));if(w[0]&&P(this,t,fs).call(this)){const S=q(this,g,c[0],"attributes-of-closing-tag",w[0]);if(f){const y=o.getAbsoluteIndex();S.suggestions=[H(S),pr(y)]}u.push(S)}for(const S of d)if(S instanceof ps){const{name:y}=S;a.has(y)?(h.add(y),a.get(y).push(S)):a.set(y,[S])}else{const y=S.text().trim(),k=w[En.test(y)?1:2];if(y&&k){const b=j(S,g,c[0],"invalid-attribute",k);f&&(b.suggestions=[H(b,0," ")]),u.push(b)}}const A=p.getSeverity(c[1],"attribute");if(A&&h.size>0)for(const S of h){const y=a.get(S).map(k=>{const b=k.getValue();return[k,b===!0?"":b]});Array.prototype.push.apply(u,y.map(([k,b],T)=>{const v=j(k,g,c[1],I.msg("duplicate-attribute",S),A);if(f||x){const _=H(v);!b||y.slice(0,T).some(([,$])=>$===b)?v.fix=_:f&&(v.suggestions=[_])}return v}))}return u}}escape(){}getAttribute(r){return r==="invalid"?P(this,t,fs).call(this):super.getAttribute(r)}print(){return this.toString()?`<span class="wpb-${this.type}${P(this,t,fs).call(this)?" wpb-invalid":""}">${this.childNodes.map(r=>r.print(r instanceof Ne?{class:r.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,fs=function(){const{parentNode:r}=this;return(r==null?void 0:r.type)==="html"&&r.closing&&this.text().trim()!==""},i)}}),ko={};ie(ko,{PreToken:()=>_o});var _o,yu=C({"src/pre.ts"(){"use strict";qe(),B(),kt(),_o=class extends F{get type(){return"ext-inner"}constructor(e,t,s=[]){if(e){const i=/<nowiki>/giu,n=/<\/nowiki>/giu,{length:r}=i.source;let l=i.exec(e);l&&(n.lastIndex=l.index+r);let u=n.exec(e),o=0,d="";for(;l&&u;)new Ae(l[0],t,s,!0),new Ae(u[0],t,s,!0),d+=`${e.slice(o,l.index)}\0${s.length-1}n${e.slice(l.index+r,u.index)}\0${s.length}n`,o=u.index+r+1,i.lastIndex=o,l=i.exec(e),l&&(n.lastIndex=l.index+r),u=n.exec(e);e=d+e.slice(o)}super(e,t,s,{}),this.setAttribute("stage",fe-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),Es,kr=C({"src/multiLine/index.ts"(){"use strict";B(),Es=class extends F{get type(){return"ext-inner"}toString(e){return super.toString(e,`
|
|
1
|
+
"use strict";(()=>{var Ga=Object.defineProperty,Va=Object.defineProperties;var Qa=Object.getOwnPropertyDescriptors;var Kt=Object.getOwnPropertySymbols;var Mn=Object.prototype.hasOwnProperty,zn=Object.prototype.propertyIsEnumerable;var Un=e=>{throw TypeError(e)};var Bs=(e,t,s)=>t in e?Ga(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,ce=(e,t)=>{for(var s in t||(t={}))Mn.call(t,s)&&Bs(e,s,t[s]);if(Kt)for(var s of Kt(t))zn.call(t,s)&&Bs(e,s,t[s]);return e},je=(e,t)=>Va(e,Qa(t));var Dn=(e,t)=>{var s={};for(var n in e)Mn.call(e,n)&&t.indexOf(n)<0&&(s[n]=e[n]);if(e!=null&&Kt)for(var n of Kt(e))t.indexOf(n)<0&&zn.call(e,n)&&(s[n]=e[n]);return s};var Ja=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Le=(e,t,s)=>Bs(e,typeof t!="symbol"?t+"":t,s),Os=(e,t,s)=>t.has(e)||Un("Cannot "+s);var v=(e,t,s)=>(Os(e,t,"read from private field"),s?s.call(e):t.get(e)),L=(e,t,s)=>t.has(e)?Un("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),F=(e,t,s,n)=>(Os(e,t,"write to private field"),n?n.call(e,s):t.set(e,s),s),O=(e,t,s)=>(Os(e,t,"access private method"),s);var Hn=(e,t,s,n)=>({set _(r){F(e,t,r,s)},get _(){return v(e,t,n)}});var nd=Ja((ld,Ha)=>{var Ul=Object.create,et=Object.defineProperty,Dl=Object.getOwnPropertyDescriptor,hn=Object.getOwnPropertyNames,Xa=Object.getPrototypeOf,Ka=Object.prototype.hasOwnProperty,Hl=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),St=e=>{throw TypeError(e)},Gl=(e,t,s)=>t in e?et(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Gn=(e,t)=>et(e,"name",{value:t,configurable:!0}),C=(e,t)=>function(){return e&&(t=(0,e[hn(e)[0]])(e=0)),t},Vl=(e,t)=>function(){return t||(0,e[hn(e)[0]])((t={exports:{}}).exports,t),t.exports},se=(e,t)=>{for(var s in t)et(e,s,{get:t[s],enumerable:!0})},Ql=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of hn(t))!Ka.call(e,r)&&r!==s&&et(e,r,{get:()=>t[r],enumerable:!(n=Dl(t,r))||n.enumerable});return e},Ya=(e,t,s)=>(s=e!=null?Ul(Xa(e)):{},Ql(t||!e||!e.__esModule?et(s,"default",{value:e,enumerable:!0}):s,e)),J=e=>Ql(et({},"__esModule",{value:!0}),e),X=e=>{var t;return[,,,Ul((t=e==null?void 0:e[Hl("metadata")])!=null?t:null)]},Jl=["class","method","getter","setter","accessor","field","value","get","set"],Et=e=>e!==void 0&&typeof e!="function"?St("Function expected"):e,Za=(e,t,s,n,r)=>({kind:Jl[e],name:t,metadata:n,addInitializer:i=>s._?St("Already initialized"):r.push(Et(i||null))}),cn=(e,t)=>Gl(t,Hl("metadata"),e[3]),V=(e,t,s,n)=>{for(var r=0,i=e[t>>1],l=i&&i.length;r<l;r++)t&1?i[r].call(s):n=i[r].call(s,n);return n},Q=(e,t,s,n,r,i)=>{var l,o,a,d,u,h=t&7,g=!!(t&8),c=!!(t&16),p=h>3?e.length+1:h?g?1:2:0,f=Jl[h+5],m=h>3&&(e[p-1]=[]),w=e[p]||(e[p]=[]),k=h&&(!c&&!g&&(r=r.prototype),h<5&&(h>3||!c)&&Dl(h<4?r:{get[s](){return ge(this,i)},set[s](y){return Se(this,i,y)}},s));h?c&&h<4&&Gn(i,(h>2?"set ":h>1?"get ":"")+s):Gn(r,s);for(var S=n.length-1;S>=0;S--)d=Za(h,s,a={},e[3],w),h&&(d.static=g,d.private=c,u=d.access={has:c?y=>tu(r,y):y=>s in y},h^3&&(u.get=c?y=>(h^1?ge:Vi)(y,r,h^4?i:k.get):y=>y[s]),h>2&&(u.set=c?(y,A)=>Se(y,r,A,h^4?i:k.set):(y,A)=>y[s]=A)),o=(0,n[S])(h?h<4?c?i:k[f]:h>4?void 0:{get:k.get,set:k.set}:r,d),a._=1,h^4||o===void 0?Et(o)&&(h>4?m.unshift(o):h?c?i=o:k[f]=o:r=o):typeof o!="object"||o===null?St("Object expected"):(Et(l=o.get)&&(k.get=l),Et(l=o.set)&&(k.set=l),Et(l=o.init)&&m.unshift(l));return h||cn(e,r),k&&et(r,s,k),c?h^4?i:k:r},eu=(e,t,s)=>Gl(e,typeof t!="symbol"?t+"":t,s),gn=(e,t,s)=>t.has(e)||St("Cannot "+s),tu=(e,t)=>Object(t)!==t?St('Cannot use the "in" operator on this value'):e.has(t),ge=(e,t,s)=>(gn(e,t,"read from private field"),s?s.call(e):t.get(e)),Me=(e,t,s)=>t.has(e)?St("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),Se=(e,t,s,n)=>(gn(e,t,"write to private field"),n?n.call(e,s):t.set(e,s),s),Vi=(e,t,s)=>(gn(e,t,"access private method"),s),su=(e,t,s,n)=>({set _(r){Se(e,t,r,s)},get _(){return ge(e,t,n)}}),Xl,fs,Kl=C({"base.ts"(){"use strict";Xl=(()=>{const e={redirect:1,onlyinclude:1,noinclude:1,include:1,comment:1,ext:1,arg:2,"magic-word":2,template:2,heading:2,html:3,table:4,hr:5,"double-underscore":5,link:6,category:6,file:6,quote:7,"ext-link":8,"free-ext-link":9,"magic-link":9,list:10,dd:10,converter:11};return Object.setPrototypeOf(e,null),e})(),fs=(()=>{const e=["arg-in-ext","bold-header","format-leakage","fostered-content","h1","illegal-attr","insecure-style","invalid-gallery","invalid-imagemap","invalid-invoke","invalid-isbn","invalid-url","lonely-apos","lonely-bracket","lonely-http","nested-link","no-arg","no-duplicate","no-ignored","obsolete-attr","obsolete-tag","parsing-order","pipe-like","syntax-like","table-layout","tag-like","unbalanced-header","unclosed-comment","unclosed-quote","unclosed-table","unescaped","unknown-page","unmatched-tag","unterminated-url","url-encoding","var-anchor","void-ext"];return Object.freeze(e),e})()}});function ke(e,t,s){return s===1?e.replace(/\0(\d+)g\x7F/gu,(n,r)=>ke(String(t[r]),t,2)):s===2?e.replace(/\0(\d+)n\x7F/gu,(n,r)=>String(t[r])):e.replace(/\0(\d+)\x7F/gu,(n,r)=>t[r])}var De,Ps,vt,bt,yt,ot,Yl,pe,tt,Vn,Qn,Yt,ms,Zl,Jn,Xn,iu,he=C({"util/string.ts"(){"use strict";De=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Ps=String.raw`[^[\]<>"\0-\x1F\x7F${De}\uFFFD]`,vt=String.raw`(?:\[[\da-f:.]+\]|${Ps})`,bt=String.raw`(?:${Ps}|\0\d+[cn!~]\x7F)*`,yt=e=>e.trim().toLowerCase(),ot=(e,t)=>s=>s.replace(e,t),Yl=ot(/[\0\x7F]|\r$/gmu,""),pe=ot(/\0\d+[cn]\x7F/gu,""),tt=(e,t="")=>e.map(s=>typeof s=="string"?s:s.text()).join(t),Vn={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},Qn=ot(/&(?:#(\d+|[Xx][\da-fA-F]+)|([lg]t|[LG]T|[lr]brac[ke]|nbsp|amp|AMP|quot|QUOT));/gu,(e,t,s)=>t?String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t)):Vn[s.toLowerCase()]),ms=e=>(Yt!=null||(Yt=Qn),Yt(e)),Zl=ot(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),Jn={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},Xn=(e=/[&<>"{}[\]|]/gu)=>ot(e,t=>`&${Jn[t]};`),iu=Xn(/[&<>]/gu)}}),nu=Vl({"config/minimum.json"(e,t){t.exports={ext:[],html:[["b","bdi","del","i","ins","u","font","big","small","sub","sup","h1","h2","h3","h4","h5","h6","cite","code","em","s","strike","strong","tt","var","div","center","blockquote","ol","ul","dl","table","caption","pre","ruby","rb","rp","rt","rtc","p","span","abbr","dfn","kbd","samp","data","time","mark","tr","td","th","q","bdo"],["li","dt","dd"],["br","wbr","hr","meta","link"]],namespaces:{0:"",6:"File",10:"Template",14:"Category",828:"Module"},nsid:{"":0,file:6,template:10,category:14,module:828},functionHook:["msgnw"],variable:["!","=","pageid","articlepath","server","servername","scriptpath","stylepath"],parserFunction:[{msgnw:"msgnw",pageid:"pageid",articlepath:"articlepath",server:"server",servername:"servername",scriptpath:"scriptpath",stylepath:"stylepath","#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"formatdate","#dateformat":"formatdate","#invoke":"invoke","#while":"while","#dowhile":"dowhile","#loop":"loop","#forargs":"forargs","#fornumargs":"fornumargs","#if":"if","#ifeq":"ifeq","#switch":"switch","#ifexist":"ifexist","#ifexpr":"ifexpr","#iferror":"iferror","#time":"time","#timel":"timel","#expr":"expr","#rel2abs":"rel2abs","#titleparts":"titleparts","#categorytree":"categorytree","#urldecode":"urldecode","#choose":"choose","#var":"var","#varexists":"varexists","#var_final":"var_final","#vardefine":"vardefine","#vardefineecho":"vardefineecho","#widget":"widget","#related":"related","#regex":"regex","#regex_var":"regex_var","#regexquote":"regexquote","#regexall":"regexall","#len":"len","#pos":"pos","#rpos":"rpos","#sub":"sub","#count":"count","#rmatch":"rmatch","#rreplace":"rreplace","#replace":"replace","#rsplit":"rsplit","#explode":"explode","#tab":"tab","#seo":"seo","#babel":"babel","#translation":"translation","#commaseparatedlist":"commaseparatedlist","#coordinates":"coordinates","#lst":"lst","#lsth":"lsth","#lstx":"lstx","#assessment":"assessment","#mentor":"mentor","#property":"property","#target":"target","#section":"lst","#section-x":"lstx","#section-h":"lsth","#statements":"statements","#useliquidthreads":"useliquidthreads","#lqtpagelimit":"lqtpagelimit","#avatar":"avatar","#img":"img","#chart":"chart"},{"!":"!","=":"=","#FORMAL":"formal","#bcp47":"bcp47","#dir":"dir","#interwikilink":"interwikilink","#interlanguagelink":"interlanguagelink","#contentmodel":"contentmodel","#timef":"timef","#timefl":"timefl"},["msg","raw"],["subst","safesubst"]],doubleUnderscore:[[],[]],protocol:"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|matrix:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|wikipedia://|worldwind://|xmpp:",interwiki:[],img:{},redirection:["#redirect"],variants:[]}}}),me,eo,to,xs,Qi,Re=C({"util/constants.ts"(){"use strict";me=11,eo=void 0,to=new Set(["alt","link","lang","page","caption"]),xs=new Set(["tiff","tif","png","gif","jpg","jpeg","webp","xcf","pdf","svg","djvu"]),Qi=nu()}});function xt(e){const t=new Map,s=new WeakMap;return n=>{const r=typeof n=="string"?t:s;if(r.has(n)){const l=r.get(n);return l.lastIndex=0,l}const i=e(n);return r.set(n,i),i}}var Gt,st=C({"../common/dist/index.mjs"(){"use strict";Gt=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25"))}}),re,de=C({"lib/rect.ts"(){"use strict";var e,t,s,n,Ji,i;re=(i=class{constructor(l,o){L(this,n);L(this,e);L(this,t);L(this,s);F(this,e,l),F(this,t,o)}get start(){return v(this,t)}get top(){return O(this,n,Ji).call(this).top}get left(){return O(this,n,Ji).call(this).left}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n=new WeakSet,Ji=function(){var l;return(l=v(this,s))!=null||F(this,s,v(this,e).getRootNode().posFromIndex(v(this,t))),v(this,s)},i)}}),Kn,Yn,hs,Xi,js,P,W,$e,ws,U,pn,He,fn,mn,xn,Vt,wt,vn,Ze,so,q=C({"util/lint.ts"(){"use strict";st(),_e(),de(),B(),Kn=new Set(["tr","td","th","caption"]),Yn=new Set(["Template:!!","Template:!-"]),hs=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")&&Yn.has(t.name)||t.is("html")&&Kn.has(t.name))return!1;if(t.is("arg"))return t.length>1&&hs(t.childNodes[1]);if(t.is("magic-word"))try{const s=t.getPossibleValues().map(hs);return s.includes(2)?2:s.includes(1)&&1}catch(s){}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?1:2},Xi=(e,t,s,n)=>({line:e+s-1,character:(s===1?t:0)+n}),js=e=>(t,s,n,r,i="error")=>{const{start:l}=s,{top:o,left:a}=s instanceof re?s:new re(t,l),{offsetHeight:d,offsetWidth:u}=t,{startIndex:h,startLine:g,startCol:c}=e(t,l,o,a),{line:p,character:f}=Xi(g,c,d,u);return{rule:n,message:I.msg(r),severity:i,startIndex:h,endIndex:h+t.toString().length,startLine:g,endLine:p,startCol:c,endCol:f}},P=js((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}}),W=js((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}),ws=(e,t,s)=>({desc:I.msg(t),range:[e,e],text:s}),U=(e,t=0,s="")=>typeof e=="number"?{desc:I.msg("remove"),range:[e,e+t],text:s}:$e(e,"remove",s,t),pn=(e,t)=>$e(e,"decode",Gt(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}),fn=e=>({desc:I.msg("open"),range:[e+1,e+2],text:""}),mn=(e,t)=>$e(e,"comment",`<!--${t}-->`),xn=(e,t)=>$e(e,"uppercase",t.toUpperCase()),Vt=(e,t=0)=>({desc:I.msg("whitespace"),range:[e,e+t],text:" "}),wt=(e,t,s=1)=>({desc:I.msg("escape"),range:[e,e+s],text:t.repeat(s)}),vn=(e,t)=>({desc:I.msg("escape"),range:[e,e+t.length],text:t.replace(/\|/gu,"|")}),Ze=(e,t,s,n)=>{if(e&&(n||I.viewOnly&&e[0]===xe.rev))return e[1];const r=t();return(n||I.viewOnly)&&s([xe.rev,r]),r},so=(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"]:[]}}),Zn,bn,io=C({"util/selector.ts"(){"use strict";Zn=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},bn=(e,t,s)=>{if(e=e.trim(),!e)return(()=>!0);const n=e.split(",").map(r=>r.trim()).filter(r=>r!=="").map(Zn);return(({type:r,name:i})=>n.some(l=>l(r,i)))}}}),ru=Vl({"../node_modules/binary-search/index.js"(e,t){t.exports=function(s,n,r,i,l){var o,a;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),a=+r(s[o],n,o,s),a<0)i=o+1;else if(a>0)l=o-1;else return o;return~i}}}),er,no,lu=C({"util/search.ts"(){"use strict";er=Ya(ru()),no=(e,t,s)=>{const n=(0,er.default)(e,t,s);return n<0?~n:n}}}),Ss,yn=C({"mixin/cached.ts"(){"use strict";q(),Ss=(e=!0)=>t=>{const s=new WeakMap;return function(...n){return Ze(s.get(this),()=>t.apply(this,n),r=>{s.set(this,r)},e)}}}}),ro,ou=C({"mixin/nodeLike.ts"(){"use strict";ro=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}}}),tr,sr,Zt,At,_t,es,Tt,$t,Ct,Xe,lo=C({"lib/node.ts"(){"use strict";lu(),q(),_e(),yn(),ou(),B(),sr=[ro],tr=[Ss(!1)],Xe=class{constructor(){V(Ct,5,this),eu(this,"childNodes",[]),Me(this,Zt),Me(this,At),Me(this,_t),Me(this,es),Me(this,Tt),Me(this,$t,{})}get parentNode(){return ge(this,Zt)}get nextSibling(){return ge(this,At)}get previousSibling(){return ge(this,_t)}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":Se(this,Zt,t),t||(Se(this,At,void 0),Se(this,_t,void 0));break;case"nextSibling":Se(this,At,t);break;case"previousSibling":Se(this,_t,t);break;case"aIndex":I.viewOnly&&Se(this,Tt,[xe.rev,t]);break;default:this[e]=t}}getRootNode(){return Ze(ge(this,es),()=>{var e,t;return(t=(e=this.parentNode)==null?void 0:e.getRootNode())!=null?t:this},e=>{const[,t]=e;t.type==="root"&&Se(this,es,e)})}indexFromPos(e,t){this.lspError("AstNode.indexFromPos")}posFromIndex(e){{const{length:t}=String(this);if(e+=e<0?t:0,e>=0&&e<=t){const s=this.getLines(),n=no(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 Ze(ge(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&&(ge(this,$t)[r]=[xe.rev,n]),n+=t[r].toString().length+this.getGaps(r);return n},t=>{ge(this,$t)[e]=t})}getAbsoluteIndex(){return Ze(ge(this,Tt),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{Se(this,Tt,e)})}getBoundingClientRect(){this.lspError("AstNode.getBoundingClientRect")}is(e){return this.type===e}getLines(){{const e=[];let t=0;for(const s of String(this).split(`
|
|
2
|
+
`)){const n=t+s.length;e.push([s,t,n]),t=n+1}return e}}seal(e,t){}lspError(e){throw new Error(`${e} method is only available in the LSP version!`)}},Ct=X(null),Zt=new WeakMap,At=new WeakMap,_t=new WeakMap,es=new WeakMap,Tt=new WeakMap,$t=new WeakMap,Q(Ct,1,"getLines",tr,Xe),Xe=Q(Ct,0,"AstNode",sr,Xe),V(Ct,1,Xe)}}),oo,au=C({"mixin/elementLike.ts"(){"use strict";io(),oo=e=>{var t,Ki;{class n extends e{constructor(){super(...arguments);L(this,t)}getElementBy(l){const o=[...this.childNodes].reverse();for(;o.length>0;){const a=o.pop(),{type:d,childNodes:u}=a;if(d!=="text"){if(l(a))return a;for(let h=u.length-1;h>=0;h--)o.push(u[h])}}}querySelector(l){return this.getElementBy(O(this,t,Ki).call(this,l))}getElementsBy(l){const o=[...this.childNodes].reverse(),a=[];for(;o.length>0;){const d=o.pop(),{type:u,childNodes:h}=d;if(u!=="text"){l(d)&&a.push(d);for(let g=h.length-1;g>=0;g--)o.push(h[g])}}return a}querySelectorAll(l){return this.getElementsBy(O(this,t,Ki).call(this,l))}escape(){}}return t=new WeakSet,Ki=function(l){return bn(l,this)},n}}}}),ir,Ws,nr,Rt,uu=C({"lib/element.ts"(){"use strict";he(),_e(),io(),lo(),au(),ir=[oo],Rt=class extends(nr=Xe){get length(){return this.childNodes.length}text(e){return tt(this.childNodes,e)}removeAt(e){this.lspError("AstElement.removeAt")}insertAt(e,t=this.length){return On(this,t,0,[e]),e}closest(e){const t=bn(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()){}},Ws=X(nr),Rt=Q(Ws,0,"AstElement",ir,Rt),V(Ws,1,Rt)}}),ts,qs,rr,lr,or,ar,Ms,ur,Yi,du=C({"lib/text.ts"(){"use strict";var e,ao,s;he(),q(),B(),lo(),ts=String.raw`[${De}\t]*`,qs=String.raw`<(?:/[^\S\n]*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|\n={2,}`,rr=new RegExp(String.raw`${qs}|https?[:/]/+|(?:rfc|pmid)(?=[-::]?${ts}\d)|isbn(?=[-::]?${ts}(?:\d(?:${ts}|-)){6})`,"giu"),lr=new RegExp(qs,"giu"),or=new Set(["attr-value","ext-link-text","link-text"]),ar={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},Ms=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"]),ur=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch(n){return/\w/u}})(),Yi=(s=class extends Xe{constructor(r){super();L(this,e);Le(this,"data","");this.data=r}get type(){return"text"}toString(r){var i;return r&&!((i=this.parentNode)!=null&&i.getAttribute("built"))?pe(this.data):this.data}text(){return this.data}lint(r=this.getAbsoluteIndex(),i){var l,o,a;{if(i===!1)return[];const{data:d,parentNode:u,nextSibling:h,previousSibling:g}=this;if(!u)throw new Error("An isolated text node cannot be linted!");const{type:c,parentNode:p}=u;if(c==="attr-value"){const{name:M,tag:te}=p;if(te==="ref"&&(M==="name"||M==="follow")||M==="group"&&(te==="ref"||te==="references")||te==="choose"&&(M==="before"||M==="after"))return[]}if(i!=null||(i=u.isPlain()&&!or.has(c)?rr:lr),d.search(i)===-1)return[];i.lastIndex=0;const f=[],m=h==null?void 0:h.type,w=h==null?void 0:h.name,k=g==null?void 0:g.type,S=this.getRootNode(),y=S.toString(),{ext:A,html:b,variants:$}=S.getAttribute("config"),{top:x,left:_}=S.posFromIndex(r),{lintConfig:T}=I,N=T.rules["tag-like"],R=typeof N=="object"&&N[1]?new Set(Object.keys(N[1]).filter(M=>M!=="invalid"&&M!=="disallowed")):new Set,K=new Set(["onlyinclude","noinclude","includeonly",...A,...b[0],...b[1],...b[2],...R,...T.getSeverity("tag-like","disallowed")?Ms:[]]);for(let M=i.exec(d);M;M=i.exec(d)){const[,te,le]=M;let{index:Y,0:D}=M;if(le&&le!=="]"){const{length:ae}=le;Y+=ae,D=D.slice(ae)}else D.startsWith(`
|
|
3
|
+
==`)&&(Y++,D=D.slice(1));D=D.toLowerCase();const[H]=D,be=H==="r"||H==="p"||H==="i",Ie=H==="{",G=H==="}",ie=H==="[",Z=H==="]";let{length:ee}=D;if(H==="<"&&!K.has(te.toLowerCase())||ie&&c==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(d.slice(Y+1))||h!=null&&h.is("ext")&&w==="nowiki"&&((l=h.innerText)!=null&&l.includes("]"))))continue;Z&&(Y||ee>1)&&i.lastIndex--;let ue=r+Y,oe=ue+ee,z,ye,Be,Oe;const Ne=y[oe],Ls=y[ue-1],Fs=Ie||ie,Es=Ie&&Ls==="-"&&$.length>0,Rs=G&&Ne==="-"&&$.length>0,Pn=ie&&m==="free-ext-link"&&!d.slice(Y+1).trim()||Z&&k==="free-ext-link"&&!d.slice(0,Y).includes("]");if(be)z="lonely-http",D=D.toUpperCase(),ye=T.getSeverity(z,D);else if(H==="<"){z="tag-like";let ae;/^<\/?\s/u.test(D)||!/[\s/>]/u.test(Ne!=null?Ne:"")?ae="invalid":R.has(te)?ae=te:Ms.has(te)&&!A.includes(te)&&(ae="disallowed"),ye=T.getSeverity(z,ae)}else if(H==="=")z="syntax-like",ye=T.getSeverity(z,"heading");else if(Es||Rs)z="lonely-bracket",ye=T.getSeverity(z,"converter"),Es&&Y>0?(D="-{",Y--,ue--,ee=2):Rs&&Y<d.length-1&&(D="}-",oe++,ee=2);else if(Pn)z="lonely-bracket",ye=T.getSeverity(z,"extLink");else if(Fs||G||Z)if(z="lonely-bracket",ee>1||Ie&&Ne===H||G&&Ls===H)ye=T.getSeverity(z,"double");else{if(!ie||c!=="ext-link-text"){const ae=ar[H],we=Fs?d.slice(Y+1):d.slice(0,Y);if(Ie&&((o=ae.exec(we))==null?void 0:o[0])==="}"||G&&((a=ae.exec(we))==null?void 0:a[0])==="{")continue;if(!we.includes(H)){const Pe=Fs?"nextSibling":"previousSibling";let Te=this[Pe];for(;Te&&(Te.type!=="text"||!ae.test(Te.data));)Te=Te[Pe];if(Te&&ae.exec(Te.data)[0]!==H)continue}}ye=T.getSeverity(z,"single")}else z="lonely-http",ye=T.getSeverity(z);if(!ye)continue;const jn=this.posFromIndex(Y),{line:Wn,character:qn}=Xi(x,_,jn.top+1,jn.left);if(H==="="){const ae=d.indexOf(`
|
|
4
|
+
`,Y);let we=h,Pe;if(ae===-1){let Te=0;for(;we&&!(we.type==="text"&&(Te=we.data.indexOf(`
|
|
5
|
+
`),Te!==-1));)we=we.nextSibling;if(!we)continue;Pe=we.data.slice(0,Te)}else Pe=d.slice(Y+ee,ae);if(!/(?:^|[^=])=+\s*(?:\S\s*)?$/u.test(Pe))continue;ae===-1?(oe=we.getAbsoluteIndex()+Pe.length,{top:Be,left:Oe}=S.posFromIndex(oe)):(oe+=Pe.length,ee+=Pe.length)}const Je={rule:z,message:I.msg(H==="="?"header-like":"lonely",be||H==="h"||Es||Rs?D:H),severity:ye,startIndex:ue,endIndex:oe,startLine:Wn,endLine:Be!=null?Be:Wn,startCol:qn,endCol:Oe!=null?Oe:qn+ee};if(T.computeEditInfo)if(H==="<")Je.suggestions=[wt(ue,"<")];else if(H==="h"&&c!=="link-text"&&ur.test(Ls||""))Je.suggestions=[Vt(ue)];else if(ie&&c==="ext-link-text"){const ae=u.getAbsoluteIndex()+u.toString().length;Je.suggestions=[wt(ae,"]")]}else if(Z&&Pn){const ae=r-g.toString().length;Je.suggestions=[ws(ae,"left-bracket","[")]}else be&&(Je.suggestions=[...M[0]===D?[]:[xn(Je,D)],...Ne===":"||Ne===":"?[Vt(oe,1)]:[]]);f.push(Je)}return f}}replaceData(r){O(this,e,ao).call(this,r)}splitText(r){this.lspError("AstText.splitText")}escape(){}print(){}},e=new WeakSet,ao=function(r){this.setAttribute("data",r)},s)}}),Ge,it=C({"mixin/hidden.ts"(){"use strict";Ge=(e=!0,t=!0)=>s=>{class n extends s{text(){return""}lint(i){return e?[]:super.lint(i)}}return n}}}),fe,ve=C({"mixin/noEscape.ts"(){"use strict";fe=e=>{}}}),Ve,nt=C({"src/syntax.ts"(){"use strict";var e,t;j(),Ve=(t=class extends E{constructor(n,r,i,l,o){super(n,i,l,o);L(this,e);F(this,e,r)}get type(){return v(this,e)}lint(n=this.getAbsoluteIndex()){return super.lint(n,!1)}},e=new WeakMap,t)}}),We,Qe=C({"mixin/padded.ts"(){"use strict";We=({length:e})=>t=>{class s extends t{getAttribute(r){return r==="padding"?e:super.getAttribute(r)}}return s}}}),Ee,rt=C({"src/atom.ts"(){"use strict";var e,t;j(),Ee=(t=class extends E{constructor(n,r,i,l,o){super(n,i,l,o);L(this,e);F(this,e,r)}get type(){return v(this,e)}set type(n){F(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)}}),dr,zs,hr,ze,ks=C({"src/link/base.ts"(){"use strict";var e,t,s,n;q(),Re(),_e(),de(),Qe(),ve(),B(),j(),rt(),dr=[fe,We("[[")],ze=(n=class extends(hr=E){constructor(i,l,o,a=[],d="|"){super(void 0,o,a,{});L(this,e,!0);L(this,t);L(this,s);if(this.insertAt(new Ee(i,"link-target",o,a,{})),l!==void 0){const u=new E(l,o,a,{});u.type="link-text",u.setAttribute("stage",me-1),this.insertAt(u)}F(this,t,d)}get link(){}get fragment(){}afterBuild(){F(this,s,this.getTitle()),v(this,t).includes("\0")&&F(this,t,this.buildFromStr(v(this,t),0)),this.setAttribute("name",v(this,s).title),super.afterBuild()}setAttribute(i,l){i==="bracket"?F(this,e,l):i==="title"?F(this,s,l):super.setAttribute(i,l)}toString(i){const l=super.toString(i,v(this,t));return v(this,e)?`[[${l}]]`:l}text(){const i=super.text("|");return v(this,e)?`[[${i}]]`:i}getAttribute(i){return i==="title"?v(this,s):super.getAttribute(i)}getGaps(i){return i===0?v(this,t).length:1}lint(i=this.getAbsoluteIndex(),l){{const o=super.lint(i,l),{childNodes:[a,d],type:u}=this,{encoded:h,fragment:g}=v(this,s),{lintConfig:c}=I,{computeEditInfo:p,fix:f}=c,m=new re(this,i);let w="unknown-page",k=c.getSeverity(w);if(k&&a.childNodes.some(({type:S})=>S==="template")&&o.push(P(a,m,w,"template-in-link",k)),w="url-encoding",k=c.getSeverity(w),k&&h){const S=P(a,m,w,"unnecessary-encoding",k);(p||f)&&(S.fix=pn(S,a)),o.push(S)}if(w="pipe-like",k=c.getSeverity(w,"link"),k&&(u==="link"||u==="category")){const S=d==null?void 0:d.childNodes.findIndex(A=>A.type==="text"&&A.data.includes("|")),y=d==null?void 0:d.childNodes[S];if(y){const A=P(d,m,w,"pipe-in-link",k);if(p){const b=A.startIndex+d.getRelativeIndex(S);A.suggestions=[vn(b,y.data)]}o.push(A)}}if(w="no-ignored",k=c.getSeverity(w,"fragment"),k&&g!==void 0&&!Ma(u)){const S=P(a,m,w,"useless-fragment",k);if(p||f){const y=a.childNodes.findIndex(b=>b.type==="text"&&b.data.includes("#")),A=a.childNodes[y];A&&(S.fix=U(S,a.getRelativeIndex(y)+A.data.indexOf("#")))}o.push(S)}return o}}getTitle(i,l){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:l,temporary:i,decode:!0,selfLink:!0})}print(){}json(i,l=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n),zs=X(hr),ze=Q(zs,0,"LinkBaseToken",dr,ze),V(zs,1,ze)}}),cr,Us,gr,Ce,lt=C({"src/nowiki/base.ts"(){"use strict";ve(),j(),cr=[fe],Ce=class extends(gr=E){get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}},Us=X(gr),Ce=Q(Us,0,"NowikiBaseToken",cr,Ce),V(Us,1,Ce)}}),pr,Ds,fr,Ae,kt=C({"src/nowiki/noinclude.ts"(){"use strict";q(),it(),B(),lt(),pr=[Ge(!1)],Ae=class extends(fr=Ce){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=/^<(noinclude|includeonly|onlyinclude)\s+(?:[^\s>/]|\/(?!>))[^>]*>$/iu.exec(r);if(i){const l=W(this,{start:e},s,"useless-attribute",n),{computeEditInfo:o}=t,a=i[1].length+1,d=r.endsWith("/>")?2:1;return l.startIndex+=a,l.startCol+=a,l.endIndex-=d,l.endCol-=d,o&&(l.suggestions=[U(l)]),[l]}}return[]}}},Ds=X(fr),Ae=Q(Ds,0,"NoincludeToken",pr,Ae),V(Ds,1,Ae)}}),uo,hu=C({"src/link/redirectTarget.ts"(){"use strict";q(),B(),ks(),kt(),uo=class extends ze{get type(){return"redirect-target"}constructor(e,t,s,n){super(e,void 0,s,n),t!==void 0&&this.insertAt(new Ae(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=P(this.lastChild,{start:e},s,"useless-link-text",r);i.startIndex--,i.startCol--,(n.computeEditInfo||n.fix)&&(i.fix=U(i)),t.push(i)}return t}}}}}),mr,Hs,xr,Bt,cu=C({"src/redirect.ts"(){"use strict";var e,t,s;it(),ve(),j(),nt(),hu(),mr=[Ge(!1,!1),fe],Bt=(s=class extends(xr=E){constructor(r,i,l,o,a,d,u=[]){super(void 0,d,u);L(this,e);L(this,t);F(this,e,r),F(this,t,a),this.append(new Ve(i,"redirect-syntax",d,u),new uo(l,o==null?void 0:o.slice(1),d,u))}get type(){return"redirect"}getAttribute(r){return r==="padding"?v(this,e).length:super.getAttribute(r)}toString(r){return v(this,e)+super.toString(r)+v(this,t)}lint(r=this.getAbsoluteIndex()){{const i=r+v(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),Hs=X(xr),Bt=Q(Hs,0,"RedirectToken",mr,Bt),V(Hs,1,Bt)}}),ho={};se(ho,{parseRedirect:()=>co});var co,gu=C({"parser/redirect.ts"(){"use strict";B(),cu(),co=(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 Bt(...n.slice(1),t,s),e):!1}}}),vr,Gs,br,Ot,pu=C({"src/onlyinclude.ts"(){"use strict";Qe(),ve(),j(),vr=[fe,We("<onlyinclude>")],Ot=class extends(br=E){get type(){return"onlyinclude"}toString(e){return`<onlyinclude>${super.toString(e)}</onlyinclude>`}isPlain(){return!0}print(){}},Gs=X(br),Ot=Q(Gs,0,"OnlyincludeToken",vr,Ot),V(Gs,1,Ot)}}),Jt,As=C({"mixin/gapped.ts"(){"use strict";Jt=(e=1)=>t=>{class s extends t{getGaps(){return e}}return s}}}),yr,Vs,wr,Ke,wn=C({"src/tagPair/index.ts"(){"use strict";var e,t;As(),ve(),j(),yr=[Jt(),fe],Ke=(t=class extends(wr=E){constructor(n,r,i,l,o,a=[]){super(void 0,o);L(this,e);Le(this,"closed");Le(this,"selfClosing");this.setAttribute("name",n.toLowerCase()),F(this,e,[n,l||n]),this.closed=l!=="",this.selfClosing=l===void 0,this.append(r,i);const d=typeof r=="string"?-1:a.indexOf(r);a.splice(d===-1?1/0:d,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(n){const{selfClosing:r,firstChild:i,lastChild:l}=this,[o,a]=v(this,e);return r?`<${o}${i.toString(n)}/>`:`<${o}${i.toString(n)}>${l.toString(n)}${this.closed?`</${a}>`:""}`}text(){const[n,r]=v(this,e);return this.selfClosing?`<${n}${this.firstChild.text()}/>`:`<${n}${super.text(">")}${this.closed?`</${r}>`:""}`}getAttribute(n){return n==="padding"?v(this,e)[0].length+1:super.getAttribute(n)}print(){}},e=new WeakMap,t),Vs=X(wr),Ke=Q(Vs,0,"TagPairToken",yr,Ke),V(Vs,1,Ke)}}),Sr,Qs,kr,Pt,fu=C({"src/tagPair/include.ts"(){"use strict";q(),de(),it(),B(),wn(),Sr=[Ge(!1)],Pt=class extends(kr=Ke){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:a}=o,d=l.map(u=>o.getSeverity(u,"include"));if(d[0]&&s.data.trim()){const u=P(s,i,l[0],"useless-attribute",d[0]);a&&(u.suggestions=[U(u)]),t.push(u)}if(d[1]&&!n){const u=W(this,i,l[1],I.msg("unclosed",`<${r}>`),d[1]);a&&(u.suggestions=[He(u.endIndex,`</${r}>`)]),t.push(u)}return t}}},Qs=X(kr),Pt=Q(Qs,0,"IncludeToken",Sr,Pt),V(Qs,1,Pt)}}),_s,Sn=C({"mixin/attributesParent.ts"(){"use strict";_s=(e=0)=>t=>{var s,go;{class r extends t{constructor(){super(...arguments);L(this,s)}hasAttr(o){this.lspError("AttributesParent.hasAttr")}getAttr(o){return O(this,s,go).call(this).getAttr(o)}}return s=new WeakSet,go=function(){return this.childNodes[e]},r}}}}),ne,Js,Xs,It,ss,Ks,Nt,Ys,Zs,ei,is,ti,si,ii,qe,po,fo,mo,xo,mu=C({"util/sharable.ts"(){"use strict";ne=new Set(["align"]),Js=new Set(["cite"]),Xs=new Set(["cite","datetime"]),It=new Set(["width"]),ss=new Set(["axis","align","bgcolor","height","width","valign"]),Ks=new Set([...ss,"abbr","headers","scope","rowspan","colspan"]),Nt=new Set(["type"]),Ys=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),Zs=new Set(["clear"]),ei=new Set(["bgcolor","align","valign"]),is=new Set(["id","qid","forcemathmode","type","display"]),ti=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),si=new Set(["weight"]),ii=new Set(["width","height","zoom","latitude","longitude","align","mapstyle","lang","alt","text"]),qe=new Set,po=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"]),fo={div:ne,h1:ne,h2:ne,h3:ne,h4:ne,h5:ne,h6:ne,blockquote:Js,q:Js,p:ne,br:Zs,pre:It,ins:Xs,del:Xs,ul:Nt,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...Ys,"border"]),caption:ne,tr:ei,td:Ks,th:Ks,font:new Set(["size","color","face"]),hr:It,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Nt,poem:ne,categorytree:ne,combooption:ne,img:new Set(["alt","src","width","height","loading","srcset"])},mo={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:qe,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:si,choicetemplate:si,imagemap:qe,inputbox:qe,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:qe,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([...is,"chem"]),chem:is,ce:is,hiero:qe,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:ti,syntaxhighlight:ti,templatedata:qe,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:qe,mapframe:new Set([...ii,"frameless"]),maplink:new Set([...ii,"class"]),rss:new Set(["template","templatename","max","highlight","filter","filterout","reverse","date","item-max-length"]),"page-collection":new Set(["lang","name","description","end-date"])},xo={table:Ys,td:new Set([...ss,"scope"]),th:ss,br:Zs,caption:ne,div:ne,hr:It,h1:ne,h2:ne,h3:ne,h4:ne,h5:ne,h6:ne,li:Nt,p:ne,pre:It,tr:ei,ul:Nt}}}),Ar,_r,Tr,$r,cs,xu=C({"src/attribute.ts"(){"use strict";var e,t,s,n,r,vo,Zi,o;q(),he(),Re(),mu(),de(),B(),j(),rt(),Ar=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,_r=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,Tr=new Set(["ext","arg","magic-word","template"]),$r=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),cs=(o=class extends E{constructor(d,u,h,g="",c,p=[],f=I.getConfig(),m=[]){const w=new Ee(h,"attr-key",f,m);let k;if(h==="title"||u==="img"&&h==="alt")k=new E(c,f,m,{}),k.type="attr-value",k.setAttribute("stage",me-1);else if(u==="gallery"&&h==="caption"||u==="ref"&&h==="details"||(u==="mapframe"||u==="maplink")&&h==="text"||u==="choose"&&(h==="before"||h==="after")){const S=je(ce({},f),{excludes:[...f.excludes,"heading","html","table","hr","list"]});k=new E(c,S,m,{}),k.type="attr-value",k.setAttribute("stage",1)}else k=new Ee(c,"attr-value",f,m,{});super(void 0,f,m);L(this,r);L(this,e);L(this,t);L(this,s);L(this,n);F(this,e,d),this.append(w,k),F(this,s,g),F(this,n,[...p]),F(this,t,u),this.setAttribute("name",yt(pe(h)))}get type(){return v(this,e)}get tag(){return v(this,t)}get balanced(){return!v(this,s)||v(this,n)[0]===v(this,n)[1]}afterBuild(){v(this,s).includes("\0")&&F(this,s,this.buildFromStr(v(this,s),0)),this.parentNode&&F(this,t,this.parentNode.name),O(this,r,vo).call(this),super.afterBuild()}toString(d){const[u="",h=""]=v(this,n);return v(this,s)?super.toString(d,v(this,s)+u)+h:this.firstChild.toString(d)}text(){return v(this,s)?`${super.text(`${v(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var d,u;return v(this,s)?v(this,s).length+((u=(d=v(this,n)[0])==null?void 0:d.length)!=null?u:0):0}lint(d=this.getAbsoluteIndex(),u){var h;{const g=super.lint(d,u),{balanced:c,firstChild:p,lastChild:f,name:m,tag:w}=this,k=new re(this,d),S=["unclosed-quote","obsolete-attr"],{lintConfig:y}=I,A=S.map($=>y.getSeverity($,m));if(A[0]&&!c){const $=P(f,k,S[0],"unclosed-quotes",A[0]);$.startIndex--,$.startCol--,y.computeEditInfo&&($.suggestions=[He($.endIndex,v(this,n)[0])]),g.push($)}const b=O(this,r,Zi).call(this,d,k);return b&&g.push(b),A[1]&&((h=xo[w])!=null&&h.has(m))&&g.push(P(p,k,S[1],"obsolete-attribute",A[1])),g}}getValue(){return v(this,s)?this.lastChild.text().trim():this.type==="ext-attr"||""}escape(){}getAttribute(d){return d==="invalid"?O(this,r,Zi).call(this):super.getAttribute(d)}print(){}json(d,u=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n=new WeakMap,r=new WeakSet,vo=function(){this.setAttribute("name",yt(this.firstChild.text()))},Zi=function(d,u){const{firstChild:h,lastChild:g,type:c,name:p,tag:f,parentNode:m}=this,w=!g.childNodes.some(({type:_})=>Tr.has(_)),k=this.getValue(),S=mo[f],y=fo[f],{length:A}=this.toString();let b="illegal-attr",$,x;if({lintConfig:$}=I,{computeEditInfo:x}=$,!(S!=null&&S.has(p))&&!(y!=null&&y.has(p))&&(c==="ext-attr"?S||y:!/\{\{[^{]+\}\}/u.test(p))&&(c==="ext-attr"&&!y||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(p)&&(f==="meta"||f==="link"||!po.has(p)))||(p==="itemtype"||p==="itemid"||p==="itemref")&&!(m!=null&&m.hasAttr("itemscope"))){if(d===void 0)return!0;{const _=$.getSeverity(b,"unknown");if(_){const T=P(h,u,b,"illegal-attribute-name",_);return x&&(T.suggestions=[U(d,A)]),T}}}else if(p==="style"&&typeof k=="string"&&Ar.test(k)){if(d===void 0)return!0;{b="insecure-style";const _=$.getSeverity(b);return _&&P(g,u,b,"insecure-style",_)}}else if(p==="tabindex"&&typeof k=="string"&&k!=="0"){if(d===void 0)return!0;{const _=$.getSeverity(b,"tabindex");if(_){const T=P(g,u,b,"nonzero-tabindex",_);return x&&(T.suggestions=[U(d,A),$e(T,"0 tabindex","0")]),T}}}else if(typeof k=="string"&&((/^xmlns:[\w:.-]+$/u.test(p)||$r.has(p))&&_r.test(k)||w&&(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 _=$.getSeverity(b,"value");return _&&P(g,u,b,"illegal-attribute-value",_)}}else if(w&&c!=="ext-attr"){const _=so(f,p),T=String(k).toLowerCase();if(_.length>0&&_.every(N=>N!==T)){if(d===void 0)return!0;{const N=$.getSeverity(b,"value");return N&&P(g,u,b,"illegal-attribute-value",N)}}}return!1},o)}}),ni,Cr,Ir,Ts,kn=C({"src/attributes.ts"(){"use strict";var e,t,en,n;q(),he(),de(),B(),j(),rt(),xu(),ni=r=>r.slice(0,-1),Cr=r=>`${ni(r)}-dirty`,Ir=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch(r){return/[^\W_]/u}})(),Ts=(n=class extends E{constructor(i,l,o,a,d=[]){super(void 0,a,d,{});L(this,t);L(this,e);if(F(this,e,l),this.setAttribute("name",o),i){const u=/([^\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=u.exec(i),c=0;const p=(()=>{h&&(super.insertAt(new Ee(h,Cr(l),a,d,{})),h="")});for(;g;){const{index:f,0:m,1:w,2:k,3:S,4:y,5:A,6:b}=g;if(h+=i.slice(c,f),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(pe(w).trim())){const $=y!=null?y:b,x=[S,A],_=new cs(ni(l),o,w,k,$,x,a,d);p(),super.insertAt(_)}else h+=m;({lastIndex:c}=u),g=u.exec(i)}h+=i.slice(c),p()}}get type(){return v(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 cs&&(!i||l.name===yt(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:a,childNodes:d}=this,u=new Map,h=new Set,g=new re(this,i),c=["no-ignored","no-duplicate"],{lintConfig:p}=I,{computeEditInfo:f,fix:m}=p,w=["closingTag","invalidAttributes","nonWordAttributes"].map(S=>p.getSeverity(c[0],S));if(w[0]&&O(this,t,en).call(this)){const S=W(this,g,c[0],"attributes-of-closing-tag",w[0]);if(f){const y=a.getAbsoluteIndex();S.suggestions=[U(S),fn(y)]}o.push(S)}for(const S of d)if(S instanceof cs){const{name:y}=S;u.has(y)?(h.add(y),u.get(y).push(S)):u.set(y,[S])}else{const y=S.text().trim(),A=w[Ir.test(y)?1:2];if(y&&A){const b=P(S,g,c[0],"invalid-attribute",A);f&&(b.suggestions=[U(b,0," ")]),o.push(b)}}const k=p.getSeverity(c[1],"attribute");if(k&&h.size>0)for(const S of h){const y=u.get(S).map(A=>{const b=A.getValue();return[A,b===!0?"":b]});Array.prototype.push.apply(o,y.map(([A,b],$)=>{const x=P(A,g,c[1],I.msg("duplicate-attribute",S),k);if(f||m){const _=U(x);!b||y.slice(0,$).some(([,T])=>T===b)?x.fix=_:f&&(x.suggestions=[_])}return x}))}return o}}escape(){}getAttribute(i){return i==="invalid"?O(this,t,en).call(this):super.getAttribute(i)}print(){}},e=new WeakMap,t=new WeakSet,en=function(){const{parentNode:i}=this;return(i==null?void 0:i.type)==="html"&&i.closing&&this.text().trim()!==""},n)}}),bo={};se(bo,{PreToken:()=>yo});var yo,vu=C({"src/pre.ts"(){"use strict";Re(),j(),kt(),yo=class extends E{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),a=0,d="";for(;l&&o;)new Ae(l[0],t,s,!0),new Ae(o[0],t,s,!0),d+=`${e.slice(a,l.index)}\0${s.length-1}n${e.slice(l.index+i,o.index)}\0${s.length}n`,a=o.index+i+1,n.lastIndex=a,l=n.exec(e),l&&(r.lastIndex=l.index+i),o=r.exec(e);e=d+e.slice(a)}super(e,t,s,{}),this.setAttribute("stage",me-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),$s,An=C({"src/multiLine/index.ts"(){"use strict";j(),$s=class extends E{get type(){return"ext-inner"}toString(e){return super.toString(e,`
|
|
6
6
|
`)}text(){return super.text(`
|
|
7
7
|
`).replace(/\n\s*\n/gu,`
|
|
8
|
-
`)}getGaps(){return 1}print(){return super.
|
|
9
|
-
`})}}}}),$o,wu=C({"src/paramLine.ts"(){"use strict";B(),$o=class extends F{get type(){return"param-line"}}}}),To={};ie(To,{ParamTagToken:()=>_r});var _r,Co=C({"src/multiLine/paramTag.ts"(){"use strict";W(),ue(),Rs(),O(),kr(),wu(),_r=class extends Es{constructor(e,t,s=I.getConfig(),i=[],n){super(void 0,s,i,{}),t&&this.safeAppend(t.split(`
|
|
10
|
-
`).map(r=>n?r:Zt(r,s,i,e)).map(r=>new $o(r,s,i,{}))),i.splice(i.indexOf(this),1),i.push(this)}lint(e=this.getAbsoluteIndex()){{const t="no-ignored",{lintConfig:s}=I,i=s.getSeverity(t,this.name);if(!i)return[];const n=new ne(this,e),r=I.msg("invalid-parameter",this.name),l=[];for(const u of this.childNodes){u.setAttribute("aIndex",e);const o=u.childNodes.filter(({type:d})=>d!=="comment"&&d!=="include"&&d!=="noinclude");if(o.some(({type:d})=>d==="ext"))l.push(j(u,n,t,r,i));else{const d=o.findIndex(({type:h})=>h!=="text"),a=o.slice(0,d===-1?void 0:d).map(String).join("");if(a&&!(d===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(a)){const h=j(u,n,t,r,i);s.computeEditInfo&&(h.suggestions=[H(h)]),l.push(h)}else{const h=u.lint(e,!1);h.length>0&&Array.prototype.push.apply(l,h)}}e+=u.toString().length+1}return l}}}}}),Fn,hi,Rn,dt,Io=C({"src/heading.ts"(){"use strict";var e,t,ms,i;W(),Le(),ue(),xe(),O(),B(),nt(),Fn=[pe],dt=(i=class extends(Rn=F){constructor(r,l,u,o=[]){super(void 0,u,o);L(this,t);L(this,e);E(this,e,r);const d=new F(l[0],u,o);d.type="heading-title",d.setAttribute("stage",2);const a=new Ve(l[1],"heading-trail",u,o);this.append(d,a)}get type(){return"heading"}get level(){return m(this,e)}toString(r){const l=P(this,t,ms).call(this);return l+this.firstChild.toString(r)+l+this.lastChild.toString(r)}text(){const r=P(this,t,ms).call(this);return r+this.firstChild.text()+r}getAttribute(r){return r==="invalid"?this.inHtmlAttrs()===2:r==="padding"?this.level:super.getAttribute(r)}getGaps(){return this.level}lint(r=this.getAbsoluteIndex(),l){{const u=super.lint(r,l),{firstChild:o,level:d}=this,a=o.toString(),h=a.startsWith("="),g=h||a.endsWith("="),c=new ne(this,r),p=this.inHtmlAttrs(),f=["h1","unbalanced-header","format-leakage"],{lintConfig:x}=I,{computeEditInfo:w,fix:A}=x,S=f.map(y=>x.getSeverity(y,"apostrophe"));if(S[0]&&this.level===1){const y=j(o,c,f[0],"<h1>",S[0]);w&&!g&&(y.suggestions=[Ce(y,"h2",`=${a}=`)]),u.push(y)}if(S[1]&&g){const y=I.msg("unbalanced-in-section-header",'"="'),k=j(o,c,f[1],y,S[1]);if(!(!w||a==="="))if(h){const[b]=/^=+/u.exec(a),T=d+b.length;k.suggestions=[{desc:`h${d}`,range:[k.startIndex,k.startIndex+b.length],text:""}],T<7&&k.suggestions.push({desc:`h${T}`,range:[k.endIndex,k.endIndex],text:b})}else{const b=/[^=](=+)$/u.exec(a)[1],T=d+b.length;k.suggestions=[{desc:`h${d}`,range:[k.endIndex-b.length,k.endIndex],text:""}],T<7&&k.suggestions.push({desc:`h${T}`,range:[k.startIndex,k.startIndex],text:b})}u.push(k)}if(p){const y="parsing-order",k=x.getSeverity(y,p===2?"heading":"templateInTable");k&&u.push(q(this,c,y,"header-in-html",k))}if(S[2]){const y=this.getRootNode().toString(),k=o.childNodes.filter(Ps("quote")),b=k.filter(({bold:v})=>v),T=k.filter(({italic:v})=>v);if(b.length%2){const v=j(b[b.length-1],Be(ge({},c),{start:r+d,left:c.left+d}),f[2],I.msg("unbalanced-in-section-header","bold-apostrophes"),S[2]);if(w||A){const _=r+d+a.length,$=H(v);y.slice(v.endIndex,_).trim()?w&&(v.suggestions=[$,He(_,"'''")]):b.length===1&&T.length===0?v.fix=$:w&&(v.suggestions=[$])}u.push(v)}if(T.length%2){const v=j(T[T.length-1],{start:r+d},f[2],I.msg("unbalanced-in-section-header","italic-apostrophes"),S[2]);if(w||A){const _=r+d+a.length;y.slice(v.endIndex,_).trim()?w&&(v.suggestions=[He(_,"''")]):T.length===1&&b.length===0?v.fix=H(v):w&&(v.suggestions=[H(v)])}u.push(v)}}return u}}print(){const r=P(this,t,ms).call(this);return super.print({pre:r,sep:r})}json(r,l=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakSet,ms=function(){return"=".repeat(this.level)},i),hi=K(Rn),dt=Q(hi,0,"HeadingToken",Fn,dt),V(hi,1,dt)}}),Pn,No,Su=C({"src/parameter.ts"(){"use strict";ce(),W(),O(),B(),Pn=new RegExp(`https?://${vt}${bt}$`,"iu"),No=class extends F{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){}constructor(e,t,s,i=[]){super(void 0,s,i);const n=new F(typeof e=="number"?void 0:e,s,i,{}),r=new F(t,s,i);n.type="parameter-key",n.setAttribute("stage",2),r.type="parameter-value",r.setAttribute("stage",2),this.append(n,r)}trimName(e,t=!0){const s=(typeof e=="string"?e:e.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",s),s}afterBuild(){if(!this.anon){const{parentNode:e,firstChild:t}=this,s=this.trimName(t);e&&e.getArgs(s,!1,!1).add(this)}super.afterBuild()}toString(e){return this.anon?this.lastChild.toString(e):super.toString(e,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(e=this.getAbsoluteIndex(),t){var s;{const i=super.lint(e,t),n="unescaped",{lintConfig:r}=I,l=r.getSeverity(n);if(l){const{firstChild:u}=this,o=(s=Pn.exec(u.text()))==null?void 0:s[0];try{if(o&&new URL(o).search){const d=j(u,{start:e},n,"unescaped-query",l);d.startIndex=d.endIndex,d.startLine=d.endLine,d.startCol=d.endCol,d.endIndex++,d.endCol++,(r.computeEditInfo||r.fix)&&(d.fix=St(d.startIndex,"{{=}}")),i.push(d)}}catch(d){}}return i}}print(){return super.print({sep:this.anon?"":"="})}json(e,t=this.getAbsoluteIndex()){}}}}),On,jn,ci,Bn,ht,Au=C({"src/transclude.ts"(){"use strict";var e,t,s,i,n,r,xs,Lo,o;ce(),W(),Le(),ue(),Is(),xe(),O(),B(),Su(),lt(),nt(),On=(d,a)=>{const h=d.toLowerCase(),[g,c]=a,p=Array.isArray(c),f=p?c.includes(d):Object.prototype.hasOwnProperty.call(c,d);return[h,p,f,!p&&f?c[d]:Object.prototype.hasOwnProperty.call(g,h)&&g[h]]},jn=[pe,Yt()],ht=(o=class extends(Bn=F){constructor(a,h,g,c=[]){var _,$;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,r);Fe(this,"modifier","");L(this,e,"template");L(this,t,":");L(this,s,!1);L(this,i,new Map);L(this,n);const{parserFunction:x,variable:w,functionHook:A}=g,S=(_=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(a))==null?void 0:_[0];if(S)this.setAttribute("modifier",S),a=a.slice(S.length);else if(a.includes(":")){const[N,...R]=a.split(":"),[Y]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec(($=R[0])!=null?$:"");this.setModifier(`${N}:${Y}`)&&(a=R.join(":").slice(Y.length))}const y=a.search(/[::]/u),k=a[y]===":",b=y!==-1;if(b||h.length===0&&!m(this,s)){const N=b?a.slice(0,y):a,R=b&&a.slice(y+1),Y=me(N),z=b?Y.slice(Y.search(/\S/u))+(k?":":""):Y.trim(),[te,de,Z,M]=On(z,x),G=de&&Z||!("functionHook"in g)||A.includes(M),ke=de&&Z||w.includes(M);if(b?M&&G:ke){this.setAttribute("name",M||te.replace(/^#|:$/u,"")),E(this,e,"magic-word"),k&&E(this,t,":");const Re=new Ve(N,"magic-word-name",g,c);if(super.insertAt(Re),R!==!1&&h.unshift([R]),this.name==="invoke")for(let D=0;D<2;D++){const ee=h.shift();if(!ee)break;const J=new Ne(ee.join("="),`invoke-${D?"function":"module"}`,g,c);super.insertAt(J)}}}if(this.type==="template"){const N=me(a).trim();if(!this.normalizeTitle(N,10,{halfParsed:!0,temporary:!0}).valid)throw c.pop(),new SyntaxError("Invalid template name");const R=new Ne(a,"template-name",g,c,{});super.insertAt(R)}typeof p=="number"&&(c[p]=void 0);const T=this.isTemplate();let v=1;for(let N=0;N<h.length;N++){const R=h[N];T||this.name==="switch"&&N>0||this.name==="tag"&&N>1||(R[0]=R.join("="),R.length=1),R.length===1&&(R.unshift(v),v++),this.insertAt(new No(...R,g,c))}this.seal("modifier")}get type(){return m(this,e)}get module(){}get function(){}setModifier(a){const{parserFunction:[,,h,g]}=this.getAttribute("config"),c=me(a).trim();if(a&&!c.endsWith(":"))return!1;const p=c.slice(0,-1).toLowerCase(),f=h.includes(p),x=g.includes(p);return(m(this,s)?f:x||!a)||(be.running||this.length>1)&&(f||x||!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,n,P(this,r,xs).call(this)),this.setAttribute("name",m(this,n).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?"":m(this,t))+h.slice(1).map(x=>x.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?"":m(this,t))+st(a.slice(1),"|"):super.text("|")}}}`}getAttribute(a){switch(a){case"padding":return this.modifier.length+2;case"title":return m(this,n);case"colon":return m(this,t);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!P(this,r,xs).call(this).valid);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,x=new ne(this,a),{lintConfig:w}=I,{computeEditInfo:A}=w,S=c==="magic-word";let y="no-ignored",k=w.getSeverity(y,"fragment");if(S&&!P(this,r,xs).call(this).valid)y="invalid-invoke",k=w.getSeverity(y,"name"),k&&g.push(j(p[1],x,y,"illegal-module",k));else if(k){const b=p[S?1:0],T=b.childNodes.findIndex(_=>_.type==="text"&&ws(_.data).includes("#")),v=b.childNodes[T];if(v){const _=j(b,x,y,"useless-fragment",k);A&&(_.suggestions=[H(_,b.getRelativeIndex(T)+v.data.indexOf("#"))]),g.push(_)}}if(y="invalid-invoke",k=w.getSeverity(y,"function"),k&&S&&f===2)return g.push(q(this,x,y,"missing-function",k)),g;if(y="no-duplicate",k=w.getSeverity(y,"parameter"),k){const b=this.getDuplicatedArgs().filter(([,v])=>!v[0].querySelector("ext")),T="duplicate-parameter";for(const[,v]of b)Array.prototype.push.apply(g,v.map(_=>{const $=j(_,x,y,T,k);return A&&($.suggestions=[H($,-1)]),$}))}return g}}insertAt(a,h=this.length){return super.insertAt(a,h),a.anon?P(this,r,Lo).call(this,a):a.name&&this.getArgs(a.name,!1,!1).add(a),a}getAllArgs(){return this.childNodes.filter(Ps("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 m(this,i).has(c)?p=m(this,i).get(c):(p=new Set(this.getAllArgs().filter(({name:f})=>c===f)),m(this,i).set(c,p)),p}getDuplicatedArgs(){return[...m(this,i)].filter(([,{size:a}])=>a>1).map(([a,h])=>[a,[...h]])}getPossibleValues(){const{type:a,name:h,childNodes:g}=this;if(a==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let c,p;switch(h){case"if":case"ifexist":case"ifexpr":case"iferror":c=2;break;case"ifeq":c=3;break;case"switch":{const f=g.slice(2),x=f[f.length-1];p=[...f.filter(({anon:w})=>!w),...x!=null&&x.anon?[x]:[]].map(({lastChild:w})=>w);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:x,0:w}=p[f].childNodes.filter(A=>A.text().trim());if(x===0)p.splice(f,1);else if(x>1||!w.is("magic-word"))f++;else try{const A=w.getPossibleValues();Array.prototype.splice.apply(p,[f,1,...A]),f+=A.length}catch(A){f++}}return p}print(){const{childNodes:a,length:h,firstChild:g,modifier:c,type:p}=this;return`<span class="wpb-${p}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${p==="magic-word"?Qt(c)+g.print()+(h===1?"":m(this,t))+wt(a.slice(1),{sep:"|"}):(c?`<span class="wpb-magic-word">${Qt(c)}</span>`:"")+wt(a,{sep:"|"})}}}</span>`}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakSet,xs=function(){const a=this.type==="template";return this.normalizeTitle((a?"":"Module:")+this.childNodes[a?0:1].text(),10,ge({temporary:!0},!a&&{page:""}))},Lo=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,x=String(c+1);(f!==x||p===a)&&(p.setAttribute("name",x),this.getArgs(x,!1,!1).add(p))}},o),ci=K(Bn),ht=Q(ci,0,"TranscludeToken",jn,ht),V(ci,1,ht)}}),qn,gi,Wn,qt,ku=C({"src/hidden.ts"(){"use strict";rt(),xe(),B(),qn=[Ge(),pe],qt=class extends(Wn=F){get type(){return"hidden"}getAttribute(e){return e==="invalid"||super.getAttribute(e)}},gi=K(Wn),qt=Q(gi,0,"HiddenToken",qn,qt),V(gi,1,qt)}}),zn,pi,Mn,Wt,_u=C({"src/arg.ts"(){"use strict";var e,$u,s;ce(),W(),ue(),Qe(),Is(),xe(),O(),B(),lt(),ku(),zn=[pe,We("{{{"),Yt()],Wt=(s=class extends(Mn=F){constructor(n,r,l=[]){super(void 0,r,l,{});L(this,e);for(let u=0;u<n.length;u++){const o=n[u];if(u===0){const d=new Ne(o,"arg-name",r,l,{});super.insertAt(d)}else if(u>1){const d=new qt(o,r,l);super.insertAt(d)}else{const d=new F(o,r,l);d.type="arg-default",d.setAttribute("stage",2),super.insertAt(d)}}}get type(){return"arg"}get default(){}toString(n){return`{{{${super.toString(n,"|")}}}}`}text(){return`{{{${st(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){super.afterBuild()}lint(n=this.getAbsoluteIndex(),r){{const{childNodes:[l,u,...o]}=this;l.setAttribute("aIndex",n+3);const d=l.lint(n+3,r);if(u){const x=n+4+l.toString().length;u.setAttribute("aIndex",x);const w=u.lint(x,r);w.length>0&&Array.prototype.push.apply(d,w)}const a=["no-ignored","no-arg"],{lintConfig:h}=I,{computeEditInfo:g}=h,c=new ne(this,n),p=a.map(x=>h.getSeverity(x,"arg"));if(p[0]&&o.length>0&&Array.prototype.push.apply(d,o.map(x=>{const w=j(x,c,a[0],"invisible-triple-braces",p[0]);return w.startIndex--,w.startCol--,g&&(w.suggestions=[H(w),St(w.startIndex,"{{!}}")]),w})),p[1]&&!this.getAttribute("include")){const x=q(this,c,a[1],"unexpected-argument",p[1]);g&&u&&(x.suggestions=[Ce(x,"expand",u.text())]),d.push(x)}const f=this.closest("ext");if(f){const x="arg-in-ext",w=h.getSeverity(x,f.name);w&&d.push(q(this,c,x,"argument-in-ext",w))}return d}}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(n,r=this.getAbsoluteIndex()){}},e=new WeakSet,$u=function(){},s),pi=K(Mn),Wt=Q(pi,0,"ArgToken",zn,Wt),V(pi,1,Wt)}}),Eo={};ie(Eo,{parseBraces:()=>Fs});var Un,fi,ls,mi,xi,vi,Dn,bi,Fs,$r=C({"parser/braces.ts"(){"use strict";it(),ce(),Io(),Au(),_u(),Un={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},fi=String.raw`\[(?!\[)`,ls=String.raw`\n(?![=\0])`,mi=String.raw`|\{{2,}`,xi=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),vi=xt(e=>new RegExp(e,"gmu")),Dn=new RegExp(String.raw`\{\{((?:[^\n{}[]|${fi}|${ls})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${ls})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${fi}|${ls})*\}-`,"gu"),bi=e=>{const t=yt(me(e));return xi.has(t)?xi.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},Fs=(e,t,s)=>{var p,f,x,w,A;const i=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,n]}=t,r=[],l=[],u=(S,y,k,b)=>{y[y.length-1].push(Se(S.slice(k,b),l))};let o;do o!==void 0&&(e=o),o=e.replace(Dn,(S,y,k)=>{if(y!==void 0||typeof k=="string")try{const{length:b}=s,T=(y!=null?y:k).split("|");return new ht(Se(T[0],l),T.slice(1).map(v=>{const _=v.indexOf("=");return(_===-1?[v]:[v.slice(0,_),v.slice(_+1)]).map($=>Se($,l))}),t,s),`\0${b}${bi(T[0])}`}catch(b){if(!(b instanceof SyntaxError)||b.message!=="Invalid template name")throw b}return l.push(Se(S,l)),`\0${l.length-1}`});while(o!==e);e=o;const d=e.lastIndexOf("}}")-e.length;let a=d+e.length!==-1,h=vi(i+(a?mi:"")),g=h.exec(e),c;for(;g||c!==void 0&&c<=e.length&&((f=(p=r[r.length-1])==null?void 0:p[0])!=null&&f.startsWith("="));){if(g!=null&&g[1]){const[,{length:Y}]=g;g[0]=g[0].slice(Y),g.index+=Y}const{0:S,index:y}=g!=null?g:{0:`
|
|
11
|
-
|
|
12
|
-
`){c=y+1;const{
|
|
13
|
-
|
|
14
|
-
)
|
|
15
|
-
`))!=null?o:[]){const a=/^([^|]+)(?:\|(.*))?/u.exec(d);if(!a){super.insertAt(d.trim()?new As(d,l,u):d);continue}const[,h,g]=a;P(this,e,Do).call(this,h)?super.insertAt(new ct("gallery",h,g,l,u)):super.insertAt(new As(d,l,u))}}get widths(){}get heights(){}lint(r=this.getAbsoluteIndex(),l){{const{top:u,left:o}=this.getRootNode().posFromIndex(r),d=[],a="no-ignored",{lintConfig:h}=I,g=["Image","NoImage","Comment"].map(c=>h.getSeverity(a,`gallery${c}`));for(let c=0;c<this.length;c++){const p=this.childNodes[c],f=p.toString(),{length:x}=f,w=f.trim(),{type:A}=p,S=u+c,y=c?0:o;if(p.setAttribute("aIndex",r),A==="noinclude"&&w&&!/^<!--.*-->$/u.test(w)){let[k]=g;if(w.startsWith("|")?[,k]=g:(w.startsWith("<!--")||w.endsWith("-->"))&&([,,k]=g),k){const b=r+x,T={rule:a,message:I.msg("invalid-content","gallery"),severity:k,startIndex:r,endIndex:b,startLine:S,endLine:S,startCol:y,endCol:y+x};h.computeEditInfo&&(T.suggestions=[H(T),fr(T,f)]),d.push(T)}}else if(A!=="noinclude"&&A!=="text"){const k=p.lint(r,l);k.length>0&&Array.prototype.push.apply(d,k)}r+=x+1}return d}}json(r,l=this.getAbsoluteIndex()){}},e=new WeakSet,Do=function(r){return this.normalizeTitle(r,6,{halfParsed:!0,temporary:!0,decode:!0,page:""}).valid},Nu=function(r){},i)}}),Cr,Ho=C({"src/link/index.ts"(){"use strict";it(),W(),O(),Cs(),Cr=class extends Me{get type(){return"link"}get innerText(){return this.length>1?this.lastChild.text():Jt(this.firstChild.text().replace(/^\s*:?/u,""))}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i="nested-link",{lintConfig:n}=I,r=n.getSeverity(i);if(r&&this.isInside("ext-link-text")){const l=q(this,{start:e},i,"link-in-extlink",r);(n.computeEditInfo||n.fix)&&(l.fix=Ce(l,"delink",this.innerText)),s.push(l)}return s}}}}}),rl,nl,Kt,Ir=C({"src/magicLink.ts"(){"use strict";var e,t,nr,i;W(),ce(),ue(),O(),B(),rl=String.raw`(?:[${De}\t]| |�*160;|&#[xX]0*[aA]0;)`,nl=new RegExp(`${rl}+`,"gu"),Kt=(i=class extends F{constructor(r,l="free-ext-link",u=I.getConfig(),o){super(r,u,o,{});L(this,t);L(this,e);E(this,e,l)}get type(){return m(this,e)}get innerText(){const r=new Map([["!","|"],["=","="]]);let l=st(this.childNodes.map(u=>{const{type:o}=u,d=String(u.name);return o==="magic-word"&&r.has(d)?r.get(d):u}));return this.type==="magic-link"&&(l=l.replace(nl," ")),l}get link(){const{innerText:r}=this;return this.type==="magic-link"?r.startsWith("ISBN")?`ISBN ${r.slice(5).replace(/[- ]/gu,"").replace(/x$/u,"X")}`:r:so(r).replace(/\n/gu,"%0A")}lint(r=this.getAbsoluteIndex(),l){{const u=super.lint(r,l),o=new ne(this,r),{lintConfig:d}=I,{type:a,childNodes:h}=this;if(a==="magic-link"){const f="invalid-isbn",x=d.getSeverity(f);return x&&P(this,t,nr).call(this)&&u.push(q(this,o,f,"invalid-isbn",x)),u}let g="invalid-url",c=d.getSeverity(g);if(c&&!this.querySelector("magic-word"))try{this.getUrl()}catch(f){u.push(q(this,o,g,"invalid-url",c))}const p=a==="ext-link-url";if(g="unterminated-url",c=d.getSeverity(g,p?"pipe":"punctuation"),c){const f=p?/\|/u:/[,;。:!?()]+/u,x=h.find(w=>w.type==="text"&&f.test(w.data));if(x){const{data:w}=x,A=j(x,o,g,I.msg("in-url",p?'"|"':"full-width-punctuation"),c);if(d.computeEditInfo){const{index:S,0:y}=f.exec(w),k=A.startIndex+S;A.suggestions=p?[Xt(k,1)]:[Xt(k),{desc:I.msg("encode"),range:[k,k+y.length],text:encodeURI(y)}]}u.push(A)}}return u}}getUrl(r){this.lspError("MagicLinkToken.getUrl")}getAttribute(r){return r==="invalid"?P(this,t,nr).call(this):super.getAttribute(r)}},e=new WeakMap,t=new WeakSet,nr=function(){if(this.type==="magic-link"){const{link:r}=this;if(r.startsWith("ISBN")){const l=[...r.slice(5)].map(u=>u==="X"?10:Number(u));return l.length===10?l.reduce((u,o,d)=>u+o*(10-d),0)%11!==0:l.length===13&&(l[12]===10||l.reduce((u,o,d)=>u+o*(d%2?3:1),0)%10!==0)}}return!1},i)}}),ll,Ti,ol,gt,Go=C({"src/extLink.ts"(){"use strict";var e,t;qe(),W(),Qe(),O(),B(),Ir(),ll=[We("[")],gt=(t=class extends(ol=F){constructor(i,n="",r="",l,u=[]){super(void 0,l,u,{});L(this,e);const o=i&&/^\0\d+f\x7F$/u.test(i)?u[Number(i.slice(1,-2))]:new Kt(i,"ext-link-url",l,u);if(this.insertAt(o),E(this,e,n),r){const d=new F(r,l,u,{});d.type="ext-link-text",d.setAttribute("stage",fe-1),this.insertAt(d)}}get type(){return"ext-link"}toString(i){return this.length===1?`[${super.toString(i)}${m(this,e)}]`:`[${super.toString(i,m(this,e))}]`}text(){return`[${super.text(" ")}]`}getGaps(){return m(this,e).length}lint(i=this.getAbsoluteIndex(),n){{const r=super.lint(i,n),l="var-anchor",u=I.lintConfig.getSeverity(l,"extLink");return u&&this.length===1&&this.isInside("heading-title")&&r.push(q(this,{start:i},l,"variable-anchor",u)),r}}print(){return super.print(this.length===1?{pre:"[",post:`${m(this,e)}]`}:{pre:"[",sep:m(this,e),post:"]"})}},e=new WeakMap,t),Ti=K(ol),gt=Q(Ti,0,"ExtLinkToken",ll,gt),V(Ti,1,gt)}}),lr,Lu=C({"src/imagemapLink.ts"(){"use strict";B(),kt(),Ho(),Go(),lr=class extends F{get type(){return"imagemap-link"}constructor(e,t,s,i,n=[]){super(void 0,i,n),this.append(e,t.length===2?new Cr(...t,i,n):new gt(...t,i,n),new Ae(s,i,n))}}}}),Vo={};ie(Vo,{ImagemapToken:()=>Qo});var Qo,Eu=C({"src/multiLine/imagemap.ts"(){"use strict";W(),Le(),ue(),O(),kr(),zo(),Wo(),Lu(),Qo=class extends Es{get image(){return this.childNodes.find(Ps("imagemap-image"))}constructor(e,t=I.getConfig(),s=[]){if(super(void 0,t,s,{}),!e)return;const i=e.split(`
|
|
16
|
-
`),n=new Set(t.protocol.split("|"));let r=!0,l=!1;for(const u of i){const o=u.trim();if(!(l||!o||o.startsWith("#"))){if(r){const d=u.indexOf("|"),a=d===-1?u:u.slice(0,d),{valid:h,ns:g}=this.normalizeTitle(a,0,{halfParsed:!0,temporary:!0,page:""});if(h&&g===6){const c=new ct("imagemap",a,d===-1?void 0:u.slice(d+1),t,s);super.insertAt(c),r=!1;continue}else l=!0}else if(u.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(u);continue}else if(u.includes("[")){const d=u.indexOf("["),a=u.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 lr(u.slice(0,d),h.slice(1),a.slice(a.indexOf("]]")+2),t,s));continue}}else if(a.startsWith("[//")||n.has(a.slice(1,a.indexOf(":")+1))||n.has(a.slice(1,a.indexOf("//")+2))){const g=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(a);if(g){super.insertAt(new lr(u.slice(0,d),g.slice(1),a.slice(a.indexOf("]")+1),t,s));continue}}}}super.insertAt(new As(u,t,s))}}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new ne(this,e),{childNodes:n,image:r}=this,l="invalid-imagemap",{lintConfig:u}=I,o=u.getSeverity(l,r?"link":"image");return o&&(r?Array.prototype.push.apply(s,n.filter(d=>{const a=d.toString().trim();return d.is("noinclude")&&a&&!a.startsWith("#")}).map(d=>{const a=j(d,i,l,"invalid-imagemap-link",o);return u.computeEditInfo&&(a.suggestions=[H(a,-1),Ce(a,"comment","# ")]),a})):s.push(q(this,i,l,"imagemap-without-image",o))),s}}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}}}}),al,Ci,ul,pt,Jo=C({"src/nowiki/comment.ts"(){"use strict";W(),rt(),Qe(),O(),ot(),al=[Ge(!1),We("<!--")],pt=class extends(ul=Ie){constructor(t,s,i,n){super(t,i,n);Fe(this,"closed");this.closed=s}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){{if(this.closed)return[];const s="unclosed-comment",{lintConfig:i}=I,n=i.getSeverity(s);if(!n)return[];const r=q(this,{start:t},s,"unclosed-comment",n);return i.computeEditInfo&&(r.suggestions=[He(r.endIndex,"-->")]),[r]}}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}},Ci=K(ul),pt=Q(Ci,0,"CommentToken",al,pt),V(Ci,1,pt)}}),Xo={};ie(Xo,{CommentedToken:()=>Ko});var Ko,Fu=C({"src/commented.ts"(){"use strict";B(),Jo(),Ko=class extends F{get type(){return"ext-inner"}constructor(e,t,s=[]){if(super(void 0,t,s,{AstText:":",CommentToken:":"}),e){let i=e.indexOf("<!--"),n=i!==-1&&e.indexOf("-->",i+4),r=0;for(;n!==!1&&n!==-1;)i>r&&this.insertAt(e.slice(r,i)),this.insertAt(new pt(e.slice(i+4,n),!0,t,s)),r=n+3,i=e.indexOf("<!--",r),n=i!==-1&&e.indexOf("-->",i+4);r<e.length&&this.insertAt(e.slice(r))}}lint(e=this.getAbsoluteIndex()){return super.lint(e,new RegExp(String.raw`<\s*(?:\/\s*)?(${this.name})\b`,"giu"))}}}}),Yo={};ie(Yo,{NowikiToken:()=>Zo});var dl,hl,Zo,Ru=C({"src/nowiki/index.ts"(){"use strict";var e,or,s;it(),W(),O(),ot(),dl=xt(i=>new RegExp(String.raw`<\s*(?:/\s*)${i==="nowiki"?"":"?"}(${i})\b`,"giu")),hl=new Set(["languages","section","templatestyles"]),Zo=(s=class extends Ie{constructor(){super(...arguments);L(this,e)}get type(){return"ext-inner"}lint(n=this.getAbsoluteIndex()){{const{name:r}=this,{lintConfig:l}=I;let u="void-ext",o=l.getSeverity(u,r);if(o&&P(this,e,or).call(this)){const a=q(this,{start:n},u,I.msg("nothing-in",r),o);return l.computeEditInfo&&(a.suggestions=[H(a)]),[a]}return super.lint(n,dl(r))}}getAttribute(n){return n==="invalid"?P(this,e,or).call(this):super.getAttribute(n)}},e=new WeakSet,or=function(){const{name:n,firstChild:{data:r}}=this;return hl.has(n)&&!!r},s)}}),cl,Ii,gl,ft,ea=C({"src/tagPair/ext.ts"(){"use strict";W(),ue(),O(),Sr(),B(),yr(),Ar(),cl=[Ns()],ft=class extends(gl=Ye){get type(){return"ext"}constructor(e,t,s,i,n=I.getConfig(),r=!1,l=[]){const u=e.toLowerCase(),o=new Ls(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",u,n,l),d=Be(ge({},n),{ext:n.ext.filter(h=>h!==u),excludes:[...n.excludes],inExt:!0});let a;switch(u){case"tab":d.ext=d.ext.filter(h=>h!=="tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":u==="poem"&&d.excludes.push("heading"),a=new F(s,d,l);break;case"pre":{const{PreToken:h}=(yu(),X(ko));a=new h(s,d,l);break}case"dynamicpagelist":{const{ParamTagToken:h}=(Co(),X(To));a=new h(r,s,d,l);break}case"inputbox":{const{InputboxToken:h}=(Tu(),X(Fo));a=new h(r,s,d,l);break}case"references":{const{NestedToken:h}=(yi(),X(vs));d.excludes.push("heading"),a=new h(s,r,["ref"],d,l);break}case"choose":{const{NestedToken:h}=(yi(),X(vs));a=new h(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],d,l);break}case"combobox":{const{NestedToken:h}=(yi(),X(vs));a=new h(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],d,l);break}case"gallery":{const{GalleryToken:h}=(Iu(),X(Mo));a=new h(s,d,l);break}case"imagemap":{const{ImagemapToken:h}=(Eu(),X(Vo));a=new h(s,d,l);break}case"hiero":{const{CommentedToken:h}=(Fu(),X(Xo));a=new h(s,d,l);break}default:{const{NowikiToken:h}=(Ru(),X(Yo));a=new h(s,d,l)}}a.setAttribute("name",u),a.type==="plain"&&(a.type="ext-inner"),super(e,o,a,i,n,l),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),{lintConfig:i}=I,n=new ne(this,e);if(this.name!=="nowiki"){const r=this.inHtmlAttrs(),l="parsing-order",u=r&&i.getSeverity(l,r===2?"ext":"templateInTable");u&&s.push(q(this,n,l,"ext-in-html",u))}if(this.name==="ref"){let r="var-anchor",l=i.getSeverity(r,"ref");l&&this.closest("heading-title")&&s.push(q(this,n,r,"variable-anchor",l)),r="nested-link",l=i.getSeverity(r,"ref"),l&&this.closest("link-text,ext-link-text")&&s.push(q(this,n,r,"ref-in-link",l))}return s}}},Ii=K(gl),ft=Q(Ii,0,"ExtToken",cl,ft),V(Ii,1,ft)}}),ta={};ie(ta,{parseCommentAndExt:()=>Zt});var Ni,pl,os,fl,Li,Zt,Rs=C({"parser/commentAndExt.ts"(){"use strict";it(),ce(),pu(),kt(),mu(),xu(),ea(),Jo(),Ni="<onlyinclude>",pl="</onlyinclude>",{length:os}=Ni,fl=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",s=e?"noinclude":"includeonly";return xt(i=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${i})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(${"\\1"}\s*)>)|<(${s})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${s}\s*)>|$))`,"giu"))}),Li=e=>{const t=e.indexOf(Ni);return{i:t,j:e.indexOf(pl,t+os)}},Zt=(e,t,s,i)=>{if(i){let{i:o,j:d}=Li(e);if(o!==-1&&d!==-1){let a="";const h=g=>{new Ae(g,t,s),a+=`\0${s.length-1}n`};for(;o!==-1&&d!==-1;){const g=`\0${s.length}g`;new jt(e.slice(o+os,d),t,s),o>0&&h(e.slice(0,o)),a+=g,e=e.slice(d+os+1),{i:o,j:d}=Li(e)}return e&&h(e),a}}const{ext:n}=t;let r=n,l=t;if(n.includes("translate")){r=n.filter(d=>d!=="translate"&&d!=="tvar"),l=Be(ge({},t),{ext:r});const o=[];e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,d=>(o.push(d),`\0${o.length-1}`)).replace(/<translate( nowrap)?>([\s\S]*?)<\/translate>/gu,(d,a,h)=>{const g=s.length;return new mo(a,h&&Se(h,o),l,s),`\0${g}g`}),e=Se(e,o)}const u=fl[i?1:0](r.join("|"));return u.lastIndex=0,u.test(e)?e.replace(u,(o,d,a,h,g,c,p,f,x)=>{const w=s.length;let A="n";if(d)A="e",new ft(d,a,h,g,l,c,s);else if(o.startsWith("<!--")){A="c";const S=o.endsWith("-->");new pt(Se(o,s,1).slice(4,S?-3:void 0),S,t,s)}else c?new Bt(c,p&&Se(p,s,1),f&&Se(f,s,1),x,t,s):new Ae(o,t,s,!0);return`\0${w}${A}`}):e}}}),ml,xl,vl,bl,Ei,yl,Mt,Pu=C({"src/tag/html.ts"(){"use strict";var e,t;W(),ue(),Sr(),O(),fo(),ml=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),xl=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"]),vl=new Set(["strike","big","center","font","tt"]),bl=[Ns()],Mt=(t=class extends(yl=wr){constructor(i,n,r,l,u,o){super(i,n,r,u,o);L(this,e);this.setAttribute("name",i.toLowerCase()),E(this,e,l)}get type(){return"html"}get selfClosing(){return m(this,e)}text(){const{closing:i,selfClosing:n,name:r}=this,{html:[,,l]}=this.getAttribute("config");return l.includes(r)?i&&r!=="br"?"":super.text("/"):super.text(n&&!i?"/":"")}lint(i=this.getAbsoluteIndex(),n){{const r=super.lint(i,n),{name:l,parentNode:u,closing:o,selfClosing:d}=this,a=new ne(this,i),{lintConfig:h}=I,{computeEditInfo:g,fix:c}=h,p=this.inTableAttrs();let f="h1",x=h.getSeverity(f,"html");if(x&&l==="h1"&&!o){const b=q(this,a,f,"<h1>",x);g&&(b.suggestions=[{desc:"h2",range:[i+2,i+3],text:"2"}]),r.push(b)}if(f="parsing-order",x=p&&h.getSeverity(f,p===2?"html":"templateInTable"),x){const b=q(this,a,f,"html-in-table",x);g&&p===2&&(b.suggestions=[H(b)]),r.push(b)}if(f="obsolete-tag",x=h.getSeverity(f,l),x&&vl.has(l)&&r.push(q(this,a,f,"obsolete-tag",x)),f="bold-header",x=h.getSeverity(f,l),x&&(l==="b"||l==="strong")&&this.isInside("heading-title")){const b=q(this,a,f,"bold-in-header",x);g&&(b.suggestions=[H(b)]),r.push(b)}const{html:[,w,A]}=this.getAttribute("config"),S=A.includes(l),y=w.includes(l),k=!S&&!y;if(f="unmatched-tag",o&&(d||S)||d&&k){if(x=h.getSeverity(f,o?"both":"selfClosing"),x){const b=q(this,a,f,o?"closing-and-self-closing":"invalid-self-closing",x);if(g||c){const T=pr(i),v={desc:I.msg("no-self-closing"),range:[b.endIndex-2,b.endIndex-1],text:""};y?g&&(b.suggestions=[T,v]):o?b.fix=S?T:v:g&&(b.suggestions=[v,He(b.endIndex,`></${l}>`,-2)])}r.push(b)}}else if(!this.findMatchingTag()){const b=q(this,a,f,o?"unmatched-closing":"unclosed-tag"),T=this.closest("magic-word");if(T&&ml.has(T.name))x=h.getSeverity(f,"conditional");else if(o)x=h.getSeverity(f,"closing"),b.suggestions=[H(b)];else{x=h.getSeverity(f,"opening");const v=u==null?void 0:u.childNodes;xl.has(l)&&(v!=null&&v.slice(0,v.indexOf(this)).some(_=>_.is("html")&&_.name===l&&!_.findMatchingTag())&&(b.suggestions=[He(i+1,"/")]),this.isInside("heading-title")&&(b.rule="format-leakage",x=h.getSeverity("format-leakage",l)))}x&&(b.severity=x,r.push(b))}return r}}getAttribute(i){return i==="invalid"?this.inTableAttrs()===2:super.getAttribute(i)}json(i,n=this.getAbsoluteIndex()){}},e=new WeakMap,t),Ei=K(yl),Mt=Q(Ei,0,"HtmlToken",bl,Mt),V(Ei,1,Mt)}}),sa={};ie(sa,{parseHtml:()=>ia});var wl,ia,Ou=C({"parser/html.ts"(){"use strict";Ar(),Pu(),wl=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,ia=(e,t,s)=>{var l;const{html:i}=t;(l=t.htmlElements)!=null||(t.htmlElements=new Set([...i[0],...i[1],...i[2]]));const n=e.split("<");let r=n.shift();for(const u of n){const o=wl.exec(u),d=o==null?void 0:o[2],a=d==null?void 0:d.toLowerCase();if(!o||!t.htmlElements.has(a)){r+=`<${u}`;continue}const[,h,,g="",c,p]=o,{length:f}=s,x=new Ls(g,"html-attrs",a,t,s),w=x.hasAttr("itemprop");if(a==="meta"&&!(w&&x.hasAttr("content"))||a==="link"&&!(w&&x.hasAttr("href"))){r+=`<${u}`,s.length=f;continue}r+=`\0${s.length}x${p}`,new Mt(d,x,h==="/",c==="/>",t,s)}return r}}}),Sl,Fi,Al,mt,ra=C({"src/table/base.ts"(){"use strict";Sr(),B(),nt(),Ar(),Sl=[Ns(1)],mt=class extends(Al=F){constructor(e,t,s,i,n,r=[],l){super(void 0,n,r,l),this.append(new Ve(t,"table-syntax",n,r),new Ls(i,"table-attrs",s,n,r))}escape(){}},Fi=K(Al),mt=Q(Fi,0,"TableBaseToken",Sl,mt),V(Fi,1,mt)}}),kl,Ri,Te,as,Et,Ft,ks,na=C({"src/table/td.ts"(){"use strict";W(),ue(),br(),O(),B(),ra(),ks=class extends(Ri=mt,kl=[Ts(!1)],Ri){constructor(e,t,s,i=[]){var u;let n=/\||\0\d+!\x7F/u.exec(t!=null?t:""),r=n?t.slice(0,n.index):"";/\[\[|-\{/u.test(r)&&(n=null,r=""),super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",r,s,i),V(as,5,this),ze(this,Et),ze(this,Te,""),n&&([iu(this,Te)._]=n);const l=new F(t==null?void 0:t.slice(((u=n==null?void 0:n.index)!=null?u:NaN)+he(this,Te).length),s,i);l.type="td-inner",l.setAttribute("stage",4),this.insertAt(l)}get type(){return"td"}get rowspan(){return this.getAttr("rowspan")}get colspan(){return this.getAttr("colspan")}get subtype(){return Ki(this,Et,Ft).call(this).subtype}afterBuild(){he(this,Te).includes("\0")&&we(this,Te,this.buildFromStr(he(this,Te),0)),super.afterBuild()}toString(e){const{childNodes:[t,s,i]}=this;return t.toString(e)+s.toString(e)+he(this,Te)+i.toString(e)}text(){const{childNodes:[e,t,s]}=this;return e.text()+t.text()+he(this,Te)+s.text()}getGaps(e){return e===1?he(this,Te).length:0}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new ne(this,e+this.getRelativeIndex(this.length-1)),n="pipe-like",{lintConfig:r}=I,{computeEditInfo:l,fix:u}=r,o=["td","double"].map(d=>r.getSeverity(n,d));for(const d of this.lastChild.childNodes)if(d.type==="text"){const{data:a}=d;if(a.includes("|")){const h=a.includes("||"),g=o[h?1:0];if(g){const c=j(d,i,n,"pipe-in-table",g);if(l||u)if(h){const p={caption:"|+",td:"|",th:"!"}[this.subtype];c.fix=Ce(c,"newline",a.replace(/\|\|/gu,`
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
${
|
|
22
|
-
${
|
|
23
|
-
${a
|
|
24
|
-
${
|
|
25
|
-
${h}${
|
|
26
|
-
${h}${x}
|
|
27
|
-
${h}${w}`;const T=v=>{const _=new ks(b,A.slice(k,y==null?void 0:y.index),i,n);return v.insertAt(_),_};for(;y;)T(o),{lastIndex:k}=S,[b]=y,y=S.exec(A);r.push(o,T(o))}}return u.slice(1)}}}),Ut,Wu=C({"../cm-util/dist/index.mjs"(){"use strict";Ut=e=>!/^_{2}.+_{2}$/u.test(e)}}),ca,zu=C({"src/nowiki/hr.ts"(){"use strict";ot(),ca=class extends Ie{get type(){return"hr"}}}}),Nl,ji,Ll,Dt,Mu=C({"src/nowiki/doubleUnderscore.ts"(){"use strict";var e,t;rt(),Qe(),ot(),Nl=[Ge(),We("__")],Dt=(t=class extends(Ll=Ie){constructor(i,n,r,l,u){var h,g;super(i,l,u);L(this,e);const o=i.toLowerCase(),{doubleUnderscore:[,,d,a]}=l;this.setAttribute("name",(g=n?(h=a==null?void 0:a[i])==null?void 0:h.toLowerCase():d==null?void 0:d[o])!=null?g:o),E(this,e,r)}get type(){return"double-underscore"}toString(){const i=m(this,e)?"__":"__";return i+this.innerText+i}print(){const i=m(this,e)?"__":"__";return super.print({pre:i,post:i})}},e=new WeakMap,t),ji=K(Ll),Dt=Q(ji,0,"DoubleUnderscoreToken",Nl,Dt),V(ji,1,Dt)}}),ga={};ie(ga,{parseHrAndDoubleUnderscore:()=>pa});var pa,Uu=C({"parser/hrAndDoubleUnderscore.ts"(){"use strict";Wu(),zu(),Mu(),Io(),pa=({firstChild:{data:e},type:t,name:s},i,n)=>{var d,a,h;const{doubleUnderscore:[r,l,u]}=i,o=[...r,...l];return(d=i.insensitiveDoubleUnderscore)!=null||(i.insensitiveDoubleUnderscore=new Set(r.filter(Ut))),(a=i.sensitiveDoubleUnderscore)!=null||(i.sensitiveDoubleUnderscore=new Set(l.filter(Ut))),(h=i.regexHrAndDoubleUnderscore)!=null||(i.regexHrAndDoubleUnderscore=new RegExp(String.raw`^((?:\0\d+[cno]\x7F)*)(-{4,})|__(${o.filter(Ut).join("|")})__|_{2}(${o.filter(g=>!Ut(g)).map(g=>g.slice(2,-2)).join("|")})_{2}`,"gimu")),t!=="root"&&(t!=="ext-inner"||s!=="poem")&&(e=`\0${e}`),e=e.replace(i.regexHrAndDoubleUnderscore,(g,c,p,f,x)=>{var k;if(p)return new ca(p,i,n),`${c}\0${n.length-1}r`;const w=f!=null?f:x,A=i.sensitiveDoubleUnderscore.has(w),S=w.toLowerCase(),y=i.insensitiveDoubleUnderscore.has(S);return A||y?(new Dt(w,A,!!x,i,n),`\0${n.length-1}${y&&((k=u==null?void 0:u[S])!=null?k:S)==="toc"?"u":"n"}`):g}),i.excludes.includes("heading")||(e=e.replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(g,c,p,f,x)=>{const w=`${c}\0${n.length}h`;return new dt(p.length,[f,x],i,n),w})),t==="root"||t==="ext-inner"&&s==="poem"?e:e.slice(1)}}}),fa,Du=C({"src/nowiki/quote.ts"(){"use strict";var e,t;W(),ue(),O(),ot(),fa=(t=class extends Ie{constructor(i,n,r,l){super(i,r,l);L(this,e);E(this,e,n)}get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}get closing(){return ge(ge({},this.bold?{bold:m(this,e).bold}:void 0),this.italic?{italic:m(this,e).italic}:void 0)}text(){const{parentNode:i,innerText:n}=this;return i!=null&&i.is("image-parameter")&&i.name!=="caption"?"":n}lint(i=this.getAbsoluteIndex()){{const{previousSibling:n,bold:r,closing:l}=this,u=(n==null?void 0:n.type)==="text"?n.data:void 0,o=[],d=new ne(this,i),a=["lonely-apos","bold-header"],{lintConfig:h}=I,{computeEditInfo:g}=h,c=[void 0,"word"].map(f=>h.getSeverity(a[0],f)),p=h.getSeverity(a[1]);if(u!=null&&u.endsWith("'")){const f=c[(l.bold||l.italic)&&/[a-z\d]'$/iu.test(u)?1:0];if(f){const x=q(this,d,a[0],I.msg("lonely","'"),f),{startLine:w,startCol:A}=x,[,{length:S}]=/(?:^|[^'])('+)$/u.exec(u),y=i-S,k=Be(ge({},x),{startIndex:y,endIndex:i,endLine:w,startCol:A-S,endCol:A});g&&(k.suggestions=[St(y,"'",S),H(k)]),o.push(k)}}if(p&&r&&this.isInside("heading-title")){const f=q(this,d,a[1],"bold-in-header",p);g&&(f.suggestions=[H(f)]),o.push(f)}return o}}json(i,n=this.getAbsoluteIndex()){}},e=new WeakMap,t)}}),ma={};ie(ma,{parseQuotes:()=>Fr});var Fr,xa=C({"parser/quotes.ts"(){"use strict";Du(),Fr=(e,t,s,i)=>{var c;const n=e.split(/('{2,})/u),{length:r}=n;if(r===1)return e;let l=0,u=0,o,d,a;for(let p=1;p<r;p+=2){const f=n[p].length;switch(f){case 2:u++;break;case 4:n[p-1]+="'",n[p]="'''";case 3:if(l++,o!==void 0)break;n[p-1].endsWith(" ")?d===void 0&&a===void 0&&(a=p):n[p-1].slice(-2,-1)===" "?o=p:d!=null||(d=p);break;default:n[p-1]+="'".repeat(f-5),n[p]="'''''",u++,l++}}if(u%2===1&&l%2===1){const p=(c=o!=null?o:d)!=null?c:a;p!==void 0&&(n[p]="''",n[p-1]+="'")}let h=!1,g=!1;for(let p=1;p<r;p+=2){const f=n[p].length,x=f!==2,w=f!==3,A=new fa(n[p],{bold:x&&!!h,italic:w&&!!g},t,s);x&&(h=!h&&A),w&&(g=!g&&A),n[p]=`\0${s.length-1}q`}return n.join("")}}}),va={};ie(va,{parseExternalLinks:()=>Rr});var Rr,ba=C({"parser/externalLinks.ts"(){"use strict";ce(),Go(),Ir(),Rr=(e,t,s,i)=>{var n;return(n=t.regexExternalLinks)!=null||(t.regexExternalLinks=new RegExp(String.raw`\[((?:\0\d+[cn]\x7F)*(?:\0\d+f\x7F|(?:(?:${t.protocol}|//)${vt}|\0\d+m\x7F)${bt}(?=[[\]<>"\t${De}]|\0\d)))([${De}]*(?![${De}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),e.replace(t.regexExternalLinks,(r,l,u,o)=>{const{length:d}=s,a=/&[lg]t;/u.exec(l);return a&&(u="",o=l.slice(a.index)+u+o,l=l.slice(0,a.index)),i?(new Kt(l,"ext-link-url",t,s),`[\0${d}f${u}${o}]`):(new gt(l,u,o,t,s),`\0${d}w`)})}}}),ya,Hu=C({"src/link/category.ts"(){"use strict";Cs(),ya=class extends Me{get type(){return"category"}get sortkey(){}json(e,t=this.getAbsoluteIndex()){}}}}),wa={};ie(wa,{parseLinks:()=>ar});var El,ar,Gu=C({"parser/links.ts"(){"use strict";ce(),O(),xa(),ba(),Ho(),qo(),Hu(),El=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,ar=(e,t,s,i,n)=>{var o;(o=t.regexLinks)!=null||(t.regexLinks=new RegExp(String.raw`^\s*(?:${t.protocol}|//)`,"iu"));const r=t.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]]))?\]\]([\s\S]*)$/u:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])*)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]])?)?\]\]([\s\S]*)$/u,l=e.split("[[");let u=l.shift();for(let d=0;d<l.length;d++){let a=!1,h,g,c,p;const f=l[d],x=r.exec(f);if(x)[,h,g,c,p]=x,p.startsWith("]")&&(c!=null&&c.includes("["))&&(c+="]",p=p.slice(1));else{const b=El.exec(f);b&&(a=!0,[,h,g,c]=b)}if(h===void 0||t.regexLinks.test(h)||/\0\d+[exhbru]\x7F/u.test(h)){u+=`[[${f}`;continue}let w=me(h).trim();const A=w.startsWith(":");if(A&&a){u+=`[[${f}`;continue}else!w&&c&&!c.includes(`
|
|
28
|
-
`)&&(w=me(c).trim());const{ns:S,valid:y}=I.normalizeTitle(w,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0,page:i});if(y){if(a){if(S!==6){u+=`[[${f}`;continue}let b=!1;for(d++;d<l.length;d++){const T=l[d],v=T.split("]]");if(v.length>2){b=!0,c+=`[[${v[0]}]]${v[1]}`,p=v.slice(2).join("]]");break}else if(v.length===2)c+=`[[${v[0]}]]${v[1]}`;else{c+=`[[${T}`;break}}if(c=ar(c,t,s,i,n),!b){u+=`[[${h}${g}${c}`;continue}}}else{u+=`[[${f}`;continue}c&&(c=Fr(c,t,s,n));let k=Cr;A||(S===6?(c&&(c=Rr(c,t,s,!0)),k=Tr):S===14&&(k=ya)),c===void 0&&g&&(c=""),u+=`\0${s.length}l${p}`,new k(h,c,t,s,g)}return u}}}),Sa={};ie(Sa,{parseMagicLinks:()=>Aa});var Bi,qi,Wi,zi,Aa,Vu=C({"parser/magicLinks.ts"(){"use strict";ce(),Ir(),Bi=String.raw`[${De}\t]| |�*160;|�*a0;`,qi=`(?:${Bi})+`,Wi=`(?:${Bi}|-)`,zi=String.raw`(?:RFC|PMID)${qi}\d+\b|ISBN${qi}(?:97[89]${Wi}?)?(?:\d${Wi}?){9}[\dx]\b`,Aa=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${vt}${bt})|${zi})`,"giu")}catch(i){t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${vt}${bt})|${zi})`,"giu")}return e.replace(t.regexMagicLinks,(i,n,r)=>{let l=n?i.slice(n.length):i;if(r){let u="";const o=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(l);o&&(u=l.slice(o.index),l=l.slice(0,o.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),u=l.slice(a.index+h)+u,l=l.slice(0,a.index+h)}return u.length>=r.length?i:(new Kt(l,void 0,t,s),`${n}\0${s.length-1}w${u}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(l))return i;return new Kt(l,"magic-link",t,s),`${n}\0${s.length-1}i`})}}}),ka,Qu=C({"util/html.ts"(){"use strict";ka=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,i)=>s!==e[i])}}),Fl,_a,Ju=C({"src/nowiki/list.ts"(){"use strict";W(),O(),aa(),Fl=new Set(["link","category","file"]),_a=class extends Lr{get type(){return"list"}lint(e=this.getAbsoluteIndex()){var t;{const s="syntax-like",i=I.lintConfig.getSeverity(s,"redirect"),{innerText:n}=this;if(i&&n==="#"){let{nextSibling:r}=this;if((r==null?void 0:r.type)==="text"&&Fl.has((t=r.nextSibling)==null?void 0:t.type)&&new RegExp(String.raw`^(?:${this.getAttribute("config").redirection.join("|")})\s*(?::\s*)?$`,"iu").test(`#${r.data}`)){const u=q(r,{start:e+1},s,"redirect-like",i);return u.startIndex--,u.startCol--,u.endIndex+=2,u.endCol+=2,[u]}}return[]}}}}}),$a={};ie($a,{parseList:()=>Ta});var Ta,Xu=C({"parser/list.ts"(){"use strict";Qu(),Ju(),ua(),Ta=(e,t,s,i)=>{const n=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!n)return t.lastPrefix="",e;const[r,l,u,o]=n,d=u.replace(/;/gu,":"),a=ka(d,t.lastPrefix),h=((a>1?u.slice(a-1):u)+o).split(/(?=;)/u),g=h[0].startsWith(";");let c=h.length-(g?0:1);if(a>1){const $=u.slice(0,a-1);if(g){const N=$.split(/(?=;)/u);h.unshift(...N),c+=$.includes(";")?N.length:0}else h[0]=$+h[0]}t.lastPrefix=d;let p=l+h.map(($,N)=>`\0${i.length+N}d`).join("")+e.slice(r.length);for(const $ of h)new _a($,s,i);if(!c)return p;const{html:[f,,x]}=s,w=/:+|-\{|\0\d+[xq]\x7F/gu;let A=w,S=A.exec(p),y=0,k=!1,b=!1,T=0;const v=($,N)=>(new Er($,s,i),`${p.slice(0,N)}\0${i.length-1}d${p.slice(N+$.length)}`),_=$=>{$?y&&y--:y++};for(;S&&c;){const{0:$,index:N}=S;if($==="-{"){if(!T){const{lastIndex:R}=A;A=/-\{|\}-/gu,A.lastIndex=R}T++}else if($==="}-"){if(T--,!T){const{lastIndex:R}=A;A=w,A.lastIndex=R}}else if($.endsWith("x")){const{name:R,closing:Y,selfClosing:z}=i[Number($.slice(1,-2))];(f.includes(R)||!z&&!x.includes(R))&&_(Y)}else if($.endsWith("q")){const{bold:R,italic:Y}=i[Number($.slice(1,-2))];R&&(_(k),k=!k),Y&&(_(b),b=!b)}else if(y===0){if($.length>=c)return v($.slice(0,c),N);c-=$.length,A.lastIndex=N+4+String(i.length).length,p=v($,N)}S=A.exec(p)}return p}}}),ds,Rl,Mi,Pl,Ht,Ku=C({"src/converterFlags.ts"(){"use strict";var e,t;W(),ue(),Is(),xe(),O(),B(),lt(),ds=new Set(["A","T","R","D","-","H","N"]),Rl=[Yt(),pe],Ht=(t=class extends(Pl=F){constructor(i,n,r=[]){super(void 0,n,r,{});L(this,e);this.safeAppend(i.map(l=>new Ne(l,"converter-flag",n,r)))}get type(){return"converter-flags"}afterBuild(){E(this,e,this.childNodes.map(i=>i.text().trim())),super.afterBuild()}toString(i){return super.toString(i,";")}text(){return super.text(";")}getUnknownFlags(){return new Set(m(this,e).filter(i=>/\{{3}[^{}]+\}{3}/u.test(i)))}getVariantFlags(){const i=new Set(this.getAttribute("config").variants);return new Set(m(this,e).filter(n=>i.has(n)))}isInvalidFlag(i,n,r,l){return typeof i=="object"&&(i=i.text().trim(),n=this.getVariantFlags(),r=this.getUnknownFlags(),l=new Set(m(this,e).filter(u=>ds.has(u)))),!!i&&!n.has(i)&&!r.has(i)&&(n.size>0||!l.has(i))}lint(i=this.getAbsoluteIndex(),n){{const r=this.getVariantFlags(),l=this.getUnknownFlags(),u=new Set(m(this,e).filter(x=>ds.has(x))),o=m(this,e).filter(x=>!x).length,d=m(this,e).length-l.size-o,{lintConfig:a}=I,{computeEditInfo:h,fix:g}=a,c=super.lint(i,n);if(r.size===d||u.size===d)return c;const p="no-ignored",f=a.getSeverity(p,"conversionFlag");if(f){const x=new ne(this,i);for(let w=0;w<this.length;w++){const A=this.childNodes[w],S=A.text().trim();if(this.isInvalidFlag(S,r,l,u)){const y=j(A,x,p,"invalid-conversion-flag",f);(h||g)&&(r.size===0&&ds.has(S.toUpperCase())?y.fix=mr(y,S):h&&(y.suggestions=[H(y,w&&-1)])),c.push(y)}}}return c}}print(){return super.print({sep:";"})}},e=new WeakMap,t),Mi=K(Pl),Ht=Q(Mi,0,"ConverterFlagsToken",Rl,Ht),V(Mi,1,Ht)}}),hs,Ol,Ui,jl,Ze,Yu=C({"src/converterRule.ts"(){"use strict";qe(),xe(),O(),B(),lt(),hs=(e,t,s,i)=>{const n=new F(e,s,i);return n.type=`converter-rule-${t}`,n.setAttribute("stage",fe),n},Ol=[pe],Ze=class extends(jl=F){get type(){return"converter-rule"}get variant(){}constructor(e,t=!0,s=I.getConfig(),i=[]){super(void 0,s,i,{});const n=e.indexOf(":"),r=e.slice(0,n).indexOf("=>"),l=r===-1?e.slice(0,n):e.slice(r+2,n);t&&s.variants.includes(l.trim().toLowerCase())?(super.insertAt(new Ne(l,"converter-rule-variant",s,i)),super.insertAt(hs(e.slice(n+1),"to",s,i)),r!==-1&&super.insertAt(hs(e.slice(0,r),"from",s,i),0)):super.insertAt(hs(e,"to",s,i))}toString(e){const{childNodes:t,firstChild:s,lastChild:i}=this;return t.length===3?`${s.toString(e)}=>${t[1].toString(e)}:${i.toString(e)}`:super.toString(e,":")}text(){const{childNodes:e,firstChild:t,lastChild:s}=this;return e.length===3?`${t.text()}=>${e[1].text()}:${s.text()}`:super.text(":")}getGaps(e){return e===0&&this.length===3?2:1}print(){const{childNodes:e}=this;if(e.length===3){const[t,s,i]=e;return`<span class="wpb-converter-rule">${t.print()}=>${s.print()}:${i.print()}</span>`}return super.print({sep:":"})}json(e,t=this.getAbsoluteIndex()){}},Ui=K(jl),Ze=Q(Ui,0,"ConverterRuleToken",Ol,Ze),V(Ui,1,Ze)}}),Bl,Di,ql,Gt,Zu=C({"src/converter.ts"(){"use strict";ce(),Qe(),xe(),B(),Ku(),Yu(),Bl=[pe,We("-{")],Gt=class extends(ql=F){get type(){return"converter"}constructor(e,t,s,i=[]){super(void 0,s,i),this.insertAt(new Ht(e,s,i));const[n]=t,r=n.includes(":"),l=new Ze(n,r,s,i);(r?l.length===1:t.length===2&&!me(t[1]).trim())?this.insertAt(new Ze(t.join(";"),!1,s,i)):this.safeAppend([l,...t.slice(1).map(u=>new Ze(u,!0,s,i))])}toString(e){const{childNodes:[t,...s]}=this;return`-{${t.toString(e)}${t.length>0?"|":""}${s.map(i=>i.toString(e)).join(";")}}-`}text(){const{childNodes:[e,...t]}=this;return`-{${e.text()}|${st(t,";")}}-`}getGaps(e){return e||this.firstChild.length>0?1:0}print(){const{childNodes:[e,...t]}=this;return`<span class="wpb-converter">-{${e.print()}${e.length>0?"|":""}${wt(t,{sep:";"})}}-</span>`}},Di=K(ql),Gt=Q(Di,0,"ConverterToken",Bl,Gt),V(Di,1,Gt)}}),Ca={};ie(Ca,{parseConverter:()=>Ia});var Ia,ed=C({"parser/converter.ts"(){"use strict";Zu(),Ia=(e,t,s)=>{var o;(o=t.regexConverter)!=null||(t.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${t.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"iu"));const i=/-\{/gu,n=/-\{|\}-/gu,r=[];let l=i,u=l.exec(e);for(;u;){const{0:d,index:a}=u;if(d==="}-"){const h=r.pop(),{length:g}=s,c=e.slice(h.index+2,a),p=c.indexOf("|"),[f,x]=p===-1?[[],c]:[c.slice(0,p).split(";"),c.slice(p+1)],w=x.replace(/(&[#a-z\d]+);/giu,"$1"),A=w.split(t.regexConverter).map(S=>S.replace(/\x01/gu,";"));new Gt(f,A,t,s),e=`${e.slice(0,h.index)}\0${g}v${e.slice(a+2)}`,r.length===0&&(l=i),l.lastIndex=h.index+3+String(g).length}else r.push(u),l=n,l.lastIndex=a+2;u=l.exec(e)}return e}}}),_s={};ie(_s,{Token:()=>F});var Wl,F,B=C({"src/index.ts"(){"use strict";var e,t,s,i,n,r,l,u,o,Na,La,Ea,Fa,Ra,Pa,Oa,ja,Ba,qa,Wa,za,k;ce(),qe(),W(),Le(),O(),uu(),du(),Wl=["category","html-attr#id,ext-attr#id,table-attr#id"],F=(k=class extends Pt{constructor(v,_=I.getConfig(),$=[],N){super();L(this,o);L(this,e,"plain");L(this,t,0);L(this,s);L(this,i);L(this,n);L(this,r,!1);L(this,l);L(this,u);typeof v=="string"&&this.insertAt(v),E(this,s,_),E(this,i,$),$.push(this)}get type(){return m(this,e)}set type(v){E(this,e,v)}get pageName(){return m(this.getRootNode(),u)}set pageName(v){if(v){const _=this.normalizeTitle(v,0,{temporary:!0,page:""});E(this,u,_.valid?_.title:void 0)}else E(this,u,v===""?"":void 0)}parseOnce(v=m(this,t),_=!1,$){if(v<m(this,t)||this.length===0||!this.isPlain())return this;if(m(this,t)>=fe)return this;switch(v){case 0:if(this.type==="root"){m(this,i).pop();const N=P(this,o,Na).call(this);_&&(_=!N)}E(this,n,_),P(this,o,La).call(this,_);break;case 1:P(this,o,Ea).call(this);break;case 2:P(this,o,Fa).call(this);break;case 3:P(this,o,Ra).call(this);break;case 4:P(this,o,Pa).call(this);break;case 5:P(this,o,Oa).call(this,$);break;case 6:P(this,o,ja).call(this,$);break;case 7:P(this,o,Ba).call(this);break;case 8:P(this,o,qa).call(this);break;case 9:P(this,o,Wa).call(this);break;case 10:P(this,o,za).call(this)}if(this.type==="root")for(const N of m(this,i))N==null||N.parseOnce(v,_,$);return Dr(this,t)._++,this}buildFromStr(v,_){const $=v.split(/[\0\x7F]/u).map((N,R)=>{if(R%2===0)return new sr(N);if(isNaN(N.slice(-1)))return m(this,i)[Number(N.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${N}`)});return _===0?$.map(String).join(""):_===1?st($):$}build(){E(this,t,fe);const{length:v,firstChild:_}=this,$=_==null?void 0:_.toString();if(v===1&&_.type==="text"&&$.includes("\0")&&(Pr(this,0,1,this.buildFromStr($)),this.normalize(),this.type==="root"))for(const N of m(this,i))N==null||N.build()}afterBuild(){if(this.type==="root")for(const v of m(this,i))v==null||v.afterBuild();E(this,r,!0)}parse(v=fe,_,$){for(v=Math.min(v,fe);m(this,t)<v;)this.parseOnce(m(this,t),_,$);return v&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===k}getAttribute(v){var _;switch(v){case"config":return m(this,s);case"include":return(_=m(this,n))!=null?_:!!m(this.getRootNode(),n);case"accum":return m(this,i);case"built":return m(this,r);case"stage":return m(this,t);case"invalid":return this.type==="table-inter"&&Vt(this)===2;default:return super.getAttribute(v)}}setAttribute(v,_){switch(v){case"stage":m(this,t)===0&&this.type==="root"&&m(this,i).shift(),E(this,t,_);break;default:super.setAttribute(v,_)}}insertAt(v,_=this.length){const $=typeof v=="string"?new sr(v):v;super.insertAt($,_);const{type:N}=$;return N==="root"&&($.type="plain"),$}normalizeTitle(v,_=0,$){return I.normalizeTitle(v,_,this.getAttribute("include"),m(this,s),ge({page:this.pageName},$))}inTableAttrs(){var v;return this.isInside("table-attrs")&&((v=this.closest("table-attrs,arg,parameter"))!=null&&v.is("table-attrs")?2:1)}inHtmlAttrs(){return this.isInside("html-attrs")?2:this.inTableAttrs()}lint(v=this.getAbsoluteIndex(),_){var $;{const{lintConfig:N}=I,{computeEditInfo:R,fix:Y,ignoreDisables:z,configurationComment:te}=N;let de=super.lint(v,_);if(this.type==="root"){const Z=new Map,M="no-duplicate",G=["category","id"].map(D=>N.getSeverity(M,D)),ke=this.toString(),Re=Wl.filter((D,ee)=>G[ee]).join();if(Re){for(const D of this.querySelectorAll(Re)){let ee;if(D.is("category"))ee=D.name;else{const J=D.getValue();J&&J!==!0&&(ee=`#${J}`)}if(ee){const J=Z.get(ee);J?J.add(D):Z.set(ee,new Set([D]))}}for(const[D,ee]of Z)if(ee.size>1&&!D.startsWith("#mw-customcollapsible-")){const J=!D.startsWith("#"),se=`duplicate-${J?"category":"id"}`,ae=G[J?0:1];de.push(...[...ee].map(le=>{const U=q(le,{start:le.getAbsoluteIndex()},M,se,ae);return R&&J&&(U.suggestions=[H(U)]),U}))}}if(!z){const D=new RegExp(String.raw`<!--\s*${te}-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->`,"gu"),ee=[];let J=D.exec(ke);for(;J;){const{1:se,index:ae}=J,le=($=J[2])==null?void 0:$.trim();ee.push({line:this.posFromIndex(ae).top+(se==="disable-line"?0:1),from:se==="disable"?D.lastIndex:void 0,to:se==="enable"?D.lastIndex:void 0,rules:le?new Set(le.split(",").map(U=>U.trim())):void 0}),J=D.exec(ke)}de=de.filter(({rule:se,startLine:ae,startIndex:le})=>{const U={pos:0};for(const{line:ve,from:Pe,to:Oe,rules:Ee}of ee){if(ve>ae+1)break;if(Ee&&!Ee.has(se))continue;if(ve===ae&&Pe===void 0&&Oe===void 0)return!1;Pe<=le&&Pe>U.pos?(U.pos=Pe,U.type="from"):Oe<=le&&Oe>U.pos&&(U.pos=Oe,U.type="to")}return U.type!=="from"})}if(Y&&de.some(({fix:D})=>D)){const D=de.map(({fix:se})=>se).filter(Boolean).sort(({range:[se,ae]},{range:[le,U]})=>ae===U?le-se:U-ae);let ee=1/0,J=ke;for(const{range:[se,ae],text:le}of D)ae<=ee&&(J=J.slice(0,se)+le+J.slice(ae),ee=se);Object.assign(de,{output:J})}if(!R)for(const D of de)delete D.fix,delete D.suggestions}return de}}toString(v,_){return v?super.toString(!0,_):et(m(this,l),()=>super.toString(!1,_),$=>{const N=this.getRootNode();N.type==="root"&&m(N,r)&&E(this,l,$)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakMap,l=new WeakMap,u=new WeakMap,o=new WeakSet,Na=function(){const{parseRedirect:v}=(gu(),X(go)),_=this.firstChild.toString(),$=v(_,m(this,s),m(this,i));return $&&this.setText($),!!$},La=function(v){const{parseCommentAndExt:_}=(Rs(),X(ta));this.setText(_(this.firstChild.toString(),m(this,s),m(this,i),v))},Ea=function(){const{parseBraces:v}=($r(),X(Eo)),_=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,$=v(_,m(this,s),m(this,i));this.setText(this.type==="root"?$:$.slice(1))},Fa=function(){if(m(this,s).excludes.includes("html"))return;const{parseHtml:v}=(Ou(),X(sa));this.setText(v(this.firstChild.toString(),m(this,s),m(this,i)))},Ra=function(){if(m(this,s).excludes.includes("table"))return;const{parseTable:v}=(qu(),X(da));this.setText(v(this,m(this,s),m(this,i)))},Pa=function(){if(m(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:v}=(Uu(),X(ga));this.setText(v(this,m(this,s),m(this,i)))},Oa=function(v){const{parseLinks:_}=(Gu(),X(wa));this.setText(_(this.firstChild.toString(),m(this,s),m(this,i),this.pageName,v))},ja=function(v){if(m(this,s).excludes.includes("quote"))return;const{parseQuotes:_}=(xa(),X(ma)),$=this.firstChild.toString().split(`
|
|
29
|
-
`);
|
|
30
|
-
`)
|
|
31
|
-
`),
|
|
32
|
-
`))},za=function(){if(m(this,s).variants.length>0){const{parseConverter:v}=(ed(),X(Ca));this.setText(v(this.firstChild.toString(),m(this,s),m(this,i)))}},k)}}),be,Ps,Pr,Le=C({"util/debug.ts"(){"use strict";be={running:!1,run(e){const{running:t}=this;this.running=!0;try{const{Token:s}=(B(),X(_s)),i=e();return i instanceof s&&!i.getAttribute("built")&&i.afterBuild(),this.running=t,i}catch(s){throw this.running=t,s}},rev:0},Ps=e=>t=>t.type===e,Pr=(e,t,s,i=[])=>{var l,u;let n=e.getChildNodes(),r;n.length===s?(r=n,n=i):r=Array.prototype.splice.apply(n,[t,s,...i]);for(let o=0;o<i.length;o++){const d=i[o];d.setAttribute("parentNode",e),d.setAttribute("nextSibling",n[t+o+1]),d.setAttribute("previousSibling",n[t+o-1])}return(l=n[t-1])==null||l.setAttribute("nextSibling",n[t]),(u=n[t+i.length])==null||u.setAttribute("previousSibling",n[t+i.length-1]),n===i&&e.setAttribute("childNodes",n),r}}}),ut,Hi,cs,Gi,zl,Vi,Ml,Ul,ur,td=C({"lib/lintConfig.ts"(){"use strict";var e,t;eo(),ut=new Map([[0,!1],[1,"warning"],[2,"error"],[!1,!1],["off",!1],["warning","warning"],["error","error"]]),Hi={"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-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(Hi),cs={configurationComment:"lint",ignoreDisables:!1,fix:!0,computeEditInfo:!0},Object.freeze(cs),Gi=s=>ut.has(s),zl=s=>Gi(s)||Array.isArray(s)&&Gi(s[0])&&(s.length===1||typeof s[1]=="object"),Vi=(s,i,n)=>{if(ys.includes(i)){if(n===void 0)return!1;if(zl(n))return s[i]=n,!0}else throw new RangeError(`Unknown lint rule: ${i}`);throw new RangeError(`Invalid lint config for ${i}: ${JSON.stringify(n)}`)},Ml=typeof structuredClone=="function"?structuredClone:(s=>JSON.parse(JSON.stringify(s))),Ul=class{constructor(s){if(Object.assign(this,Ml(Hi)),!!s)for(const[i,n]of Object.entries(s))Vi(this,i,n)}getSeverity(s,i){var r,l;const n=this[s];return typeof n!="object"?ut.get(n):i&&(l=ut.get((r=n[1])==null?void 0:r[i]))!=null?l:ut.get(n[0])}},ur=(t=class{constructor(s){L(this,e);if(Object.assign(this,cs),s&&!("rules"in s)&&Object.keys(s).some(n=>ys.includes(n)))this.rules=s;else{const i=s!=null?s:{},{rules:n}=i,r=Ur(i,["rules"]);this.rules=n;for(const[l,u]of Object.entries(r))u!==void 0&&Object.prototype.hasOwnProperty.call(cs,l)&&(this[l]=u)}}get rules(){return m(this,e)}set rules(s){E(this,e,new Proxy(new Ul(s),{set:Vi,deleteProperty(){return!1}}))}getSeverity(s,i){return m(this,e).getSeverity(s,i)}},e=new WeakMap,t)}}),Ma={};ie(Ma,{Title:()=>Ua});var Qi,Ua,sd=C({"lib/title.ts"(){"use strict";var e,t,s,i,n,r,Da,u;it(),ce(),Qi=o=>{const[,{length:d},a]=/^((?:\.\.\/)*)([\s\S]*)/u.exec(o);return[d/3,a]},Ua=(u=class{constructor(o,d,a,{temporary:h,decode:g,selfLink:c,page:p}={}){L(this,r);L(this,e);L(this,t);L(this,s);L(this,i);L(this,n);Fe(this,"page");Fe(this,"valid");Fe(this,"encoded",!1);this.page=p;const f=o.trim(),x=f.startsWith("../");if(g&&o.includes("%"))try{const y=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(o);o=Jt(o),this.encoded=y}catch(y){}if(o=ws(o).replace(/[_ ]+/gu," ").trim(),x||p&&f.startsWith("/"))E(this,i,0);else{let y=d;o.startsWith(":")&&(y=0,o=o.slice(1).trim());const k=o.split(":");if(k.length>1){const b=yt(k[0]),T=Object.prototype.hasOwnProperty.call(a.nsid,b)&&a.nsid[b];T&&(y=T,o=k.slice(1).join(":").trim())}E(this,i,y)}const w=o.indexOf("#");if(w!==-1){let y=o.slice(w).trim().slice(1);if(y.includes("%"))try{y=Jt(y)}catch(k){}E(this,n,y.replace(/ /gu,"_")),o=o.slice(0,w).trim()}const[A,S]=x?Qi(o):[0,o];this.valid=!!(o||c&&this.ns===0&&m(this,n)!==void 0)&&ws(o)===o&&(A===0||p===void 0||p.split("/",A+1).length>A)&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(S),this.main=o,E(this,t,a.namespaces),E(this,s,a.articlePath||"/wiki/$1"),m(this,s).includes("$1")||E(this,s,m(this,s)+`${m(this,s).endsWith("/")?"":"/"}$1`),h||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return m(this,i)}get fragment(){return m(this,n)}get main(){return m(this,e)}set main(o){o=o.replace(/_/gu," ").trim(),E(this,e,o&&o[0].toUpperCase()+o.slice(1))}get prefix(){const o=m(this,t)[this.ns];return o+(o&&":")}get title(){return this.getRedirection()[1]}get extension(){const{main:o}=this,d=o.lastIndexOf(".");return d===-1?void 0:o.slice(d+1).toLowerCase()}getRedirection(){const{prefix:o}=this,d=o;return P(this,r,Da).call(this,d)}setFragment(o){E(this,n,o)}getUrl(o){throw new Error("Title.getUrl method is only available in the LSP version!")}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakSet,Da=function(o){var a,h;let d=(o+this.main).replace(/ /gu,"_");if(d.startsWith("/"))d=((a=this.page)!=null?a:"")+d.replace(/(.)\/$/u,"$1");else if(d.startsWith("../")&&((h=this.page)!=null&&h.includes("/"))){const[g,c]=Qi(d),p=this.page.split("/");p.length>g&&(d=p.slice(0,-g).join("/")+(c&&"/")+c)}return[!1,d]},u)}}),Ha={};ie(Ha,{default:()=>I});Ga.exports=X(Ha);var gs,Ji,Dl,Xe,Xi,Hl,I,O=C({"index.ts"(){eo(),Le(),qe(),ce(),td(),gs=!0,Ji=new ur,Xe={config:Yi,get rules(){return ys},get i18n(){return ge(ge({},io),Dl)},set i18n(e){Dl=e},get lintConfig(){return Ji},set lintConfig(e){Ji=new ur(e)},get viewOnly(){return gs},set viewOnly(e){gs&&!e&&be.rev++,gs=e},getConfig(e){const t=e!=null?e:this.config,{doubleUnderscore:s,ext:i,parserFunction:n,variable:r}=t;for(let l=0;l<2;l++)s.length>l+2&&s[l].length===0&&(s[l]=Object.keys(s[l+2]));return i.includes("translate")&&!r.includes("translationlanguage")&&(r.push("translationlanguage"),Array.isArray(n[1])?n[1].push("TRANSLATIONLANGUAGE"):n[1].TRANSLATIONLANGUAGE="translationlanguage"),Be(ge(ge({},Yi),t),{excludes:[]})},msg(e,t=""){var s;return e&&((s=this.i18n[e])!=null?s:e).replace("$1",this.msg(t))},normalizeTitle(e,t=0,s,i=Xe.getConfig(),n){const{Title:r}=(sd(),X(Ma));let l;if(n!=null&&n.halfParsed)l=new r(e,t,i,n);else{const{Token:u}=(B(),X(_s));l=be.run(()=>{const o=new u(e,i);o.type="root",o.pageName=n==null?void 0:n.page,o.parseOnce(0,s).parseOnce();const d=new r(o.firstChild.toString(),t,i,n);o.build();for(const a of["main","fragment"]){const h=d[a];if(h!=null&&h.includes("\0")){const g=o.buildFromStr(h,1);a==="main"?d.main=g:d.setFragment(g)}}return d})}return l},parse(e,t,s,i,n){e=to(e);let r,l,u,o;typeof t=="string"?(r=!!s,l=i,u=n,o=t):(r=!!t,l=s,u=i,o=n),l!=null||(l=fe),u!=null||(u=this.getConfig());let d;typeof l!="number"&&(d=Array.isArray(l)?l:[l],l=Math.max(...d.map(g=>Zl[g]||fe)));const{Token:a}=(B(),X(_s));return be.run(()=>{const g=new a(e,u);return g.type="root",g.pageName=o,g.parse(l,r)})},parseWithRef(e,t,s,i=t.getAttribute("include")){return this.parse(e,i,s,t.getAttribute("config"),t.pageName)},async partialParse(e,t,s,i=Xe.getConfig()){},createLanguageService(e={}){throw new Error("Parser.createLanguageService method is only available in the LSP version!")}},Xi={},Hl=new Set(["lintConfig","normalizeTitle","parse","createLanguageService"]);for(const e of Object.keys(Xe))Hl.has(e)||(Xi[e]={enumerable:!1});Object.defineProperties(Xe,Xi),Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:Xe}),I=Xe}});O()});id();})();
|
|
8
|
+
`)}getGaps(){return 1}print(){}}}}),wo,bu=C({"src/paramLine.ts"(){"use strict";j(),wo=class extends E{get type(){return"param-line"}}}}),So={};se(So,{ParamTagToken:()=>_n});var _n,ko=C({"src/multiLine/paramTag.ts"(){"use strict";q(),de(),Is(),B(),An(),bu(),_n=class extends $s{constructor(e,t,s=I.getConfig(),n=[],r){super(void 0,s,n,{}),t&&this.safeAppend(t.split(`
|
|
9
|
+
`).map(i=>r?i:Xt(i,s,n,e)).map(i=>new wo(i,s,n,{}))),n.splice(n.indexOf(this),1),n.push(this)}lint(e=this.getAbsoluteIndex()){{const t="no-ignored",{lintConfig:s}=I,n=s.getSeverity(t,this.name);if(!n)return[];const r=new re(this,e),i=I.msg("invalid-parameter",this.name),l=[];for(const o of this.childNodes){o.setAttribute("aIndex",e);const a=o.childNodes.filter(({type:d})=>d!=="comment"&&d!=="include"&&d!=="noinclude");if(a.some(({type:d})=>d==="ext"))l.push(P(o,r,t,i,n));else{const d=a.findIndex(({type:h})=>h!=="text"),u=a.slice(0,d===-1?void 0:d).map(String).join("");if(u&&!(d===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(u)){const h=P(o,r,t,i,n);s.computeEditInfo&&(h.suggestions=[U(h)]),l.push(h)}else{const h=o.lint(e,!1);h.length>0&&Array.prototype.push.apply(l,h)}}e+=o.toString().length+1}return l}}}}}),Nr,ri,Lr,dt,Ao=C({"src/heading.ts"(){"use strict";var e,t,tn,n;q(),_e(),de(),ve(),B(),j(),nt(),Nr=[fe],dt=(n=class extends(Lr=E){constructor(i,l,o,a=[]){super(void 0,o,a);L(this,t);L(this,e);F(this,e,i);const d=new E(l[0],o,a);d.type="heading-title",d.setAttribute("stage",2);const u=new Ve(l[1],"heading-trail",o,a);this.append(d,u)}get type(){return"heading"}get level(){return v(this,e)}toString(i){const l=O(this,t,tn).call(this);return l+this.firstChild.toString(i)+l+this.lastChild.toString(i)}text(){const i=O(this,t,tn).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:a,level:d}=this,u=a.toString(),h=u.startsWith("="),g=h||u.endsWith("="),c=new re(this,i),p=this.inHtmlAttrs(),f=["h1","unbalanced-header","format-leakage"],{lintConfig:m}=I,{computeEditInfo:w,fix:k}=m,S=f.map(y=>m.getSeverity(y,"apostrophe"));if(S[0]&&this.level===1){const y=P(a,c,f[0],"<h1>",S[0]);w&&!g&&(y.suggestions=[$e(y,"h2",`=${u}=`)]),o.push(y)}if(S[1]&&g){const y=I.msg("unbalanced-in-section-header",'"="'),A=P(a,c,f[1],y,S[1]);if(!(!w||u==="="))if(h){const[b]=/^=+/u.exec(u),$=d+b.length;A.suggestions=[{desc:`h${d}`,range:[A.startIndex,A.startIndex+b.length],text:""}],$<7&&A.suggestions.push({desc:`h${$}`,range:[A.endIndex,A.endIndex],text:b})}else{const b=/[^=](=+)$/u.exec(u)[1],$=d+b.length;A.suggestions=[{desc:`h${d}`,range:[A.endIndex-b.length,A.endIndex],text:""}],$<7&&A.suggestions.push({desc:`h${$}`,range:[A.startIndex,A.startIndex],text:b})}o.push(A)}if(p){const y="parsing-order",A=m.getSeverity(y,p===2?"heading":"templateInTable");A&&o.push(W(this,c,y,"header-in-html",A))}if(S[2]){const y=this.getRootNode().toString(),A=a.childNodes.filter(Ns("quote")),b=A.filter(({bold:x})=>x),$=A.filter(({italic:x})=>x);if(b.length%2){const x=P(b[b.length-1],je(ce({},c),{start:i+d,left:c.left+d}),f[2],I.msg("unbalanced-in-section-header","bold-apostrophes"),S[2]);if(w||k){const _=i+d+u.length,T=U(x);y.slice(x.endIndex,_).trim()?w&&(x.suggestions=[T,He(_,"'''")]):b.length===1&&$.length===0?x.fix=T:w&&(x.suggestions=[T])}o.push(x)}if($.length%2){const x=P($[$.length-1],{start:i+d},f[2],I.msg("unbalanced-in-section-header","italic-apostrophes"),S[2]);if(w||k){const _=i+d+u.length;y.slice(x.endIndex,_).trim()?w&&(x.suggestions=[He(_,"''")]):$.length===1&&b.length===0?x.fix=U(x):w&&(x.suggestions=[U(x)])}o.push(x)}}return o}}print(){}json(i,l=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakSet,tn=function(){return"=".repeat(this.level)},n),ri=X(Lr),dt=Q(ri,0,"HeadingToken",Nr,dt),V(ri,1,dt)}}),Fr,_o,yu=C({"src/parameter.ts"(){"use strict";he(),q(),B(),j(),Fr=new RegExp(`https?://${vt}${bt}$`,"iu"),_o=class extends E{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 E(typeof e=="number"?void 0:e,s,n,{}),i=new E(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,a=(s=Fr.exec(o.text()))==null?void 0:s[0];try{if(a&&new URL(a).search){const d=P(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=wt(d.startIndex,"{{=}}")),n.push(d)}}catch(d){}}return n}}print(){}json(e,t=this.getAbsoluteIndex()){}}}}),Er,li,Rr,ht,wu=C({"src/transclude.ts"(){"use strict";var e,t,s,n,r,i,sn,To,a;he(),q(),_e(),de(),As(),ve(),B(),j(),yu(),rt(),nt(),Er=[fe,Jt()],ht=(a=class extends(Rr=E){constructor(u,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(u);f&&(p=Number(f[1]),u=u.replace(`\0${p}h`,c[p].toString().replace(/^\n/u,"")));super(void 0,g,c,{});L(this,i);Le(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:w,functionHook:k}=g,S=(_=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(u))==null?void 0:_[0];if(S)this.setAttribute("modifier",S),u=u.slice(S.length);else if(u.includes(":")){const[N,...R]=u.split(":"),[K]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((T=R[0])!=null?T:"");this.setModifier(`${N}:${K}`)&&(u=R.join(":").slice(K.length))}const y=u.search(/[::]/u),A=u[y]===":",b=y!==-1;if(b||h.length===0&&!v(this,s)){const N=b?u.slice(0,y):u,R=b&&u.slice(y+1),K=pe(N),M=b?K.slice(K.search(/\S/u))+(A?":":""):K.trim(),[,te,le]=za(M,m),Y=!("functionHook"in g)||k.includes(le),D=w.includes(le);if(b?le&&Y:D){this.setAttribute("name",le),F(this,e,"magic-word"),A&&F(this,t,":");const H=new Ve(N,"magic-word-name",g,c);if(super.insertAt(H),R!==!1&&h.unshift([R]),this.name==="invoke")for(let be=0;be<2;be++){const Ie=h.shift();if(!Ie)break;const G=new Ee(Ie.join("="),`invoke-${be?"function":"module"}`,g,c);super.insertAt(G)}}}if(this.type==="template"){const N=pe(u).trim();if(!this.normalizeTitle(N,10,{halfParsed:!0,temporary:!0}).valid)throw c.pop(),new SyntaxError("Invalid template name");const R=new Ee(u,"template-name",g,c,{});super.insertAt(R)}typeof p=="number"&&(c[p]=void 0);const $=this.isTemplate();let x=1;for(let N=0;N<h.length;N++){const R=h[N];$||this.name==="switch"&&N>0||this.name==="tag"&&N>1||(R[0]=R.join("="),R.length=1),R.length===1&&(R.unshift(x),x++),this.insertAt(new _o(...R,g,c))}this.seal("modifier")}get type(){return v(this,e)}get module(){}get function(){}setModifier(u){const{parserFunction:[,,h,g]}=this.getAttribute("config"),c=pe(u).trim();if(u&&!c.endsWith(":"))return!1;const p=c.slice(0,-1).toLowerCase(),f=h.includes(p),m=g.includes(p);return(v(this,s)?f:m||!u)||(xe.running||this.length>1)&&(f||m||!u)?(this.setAttribute("modifier",u),F(this,s,f),!!u):!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"&&(F(this,r,O(this,i,sn).call(this)),this.setAttribute("name",v(this,r).title))}toString(u){const{childNodes:h,length:g,firstChild:c,modifier:p,type:f}=this;return`{{${p}${f==="magic-word"?c.toString(u)+(g===1?"":v(this,t))+h.slice(1).map(m=>m.toString(u)).join("|"):super.toString(u,"|")}}}`}text(){const{childNodes:u,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?"":v(this,t))+tt(u.slice(1),"|"):super.text("|")}}}`}getAttribute(u){switch(u){case"padding":return this.modifier.length+2;case"title":return v(this,r);case"colon":return v(this,t);case"invalid":default:return super.getAttribute(u)}}lint(u=this.getAbsoluteIndex(),h){{const g=super.lint(u,h);if(!this.isTemplate())return g;const{type:c,childNodes:p,length:f}=this,m=new re(this,u),{lintConfig:w}=I,{computeEditInfo:k}=w,S=c==="magic-word";let y="no-ignored",A=w.getSeverity(y,"fragment");if(S&&!O(this,i,sn).call(this).valid)y="invalid-invoke",A=w.getSeverity(y,"name"),A&&g.push(P(p[1],m,y,"illegal-module",A));else if(A){const b=p[S?1:0],$=b.childNodes.findIndex(_=>_.type==="text"&&ms(_.data).includes("#")),x=b.childNodes[$];if(x){const _=P(b,m,y,"useless-fragment",A);k&&(_.suggestions=[U(_,b.getRelativeIndex($)+x.data.indexOf("#"))]),g.push(_)}}if(y="invalid-invoke",A=w.getSeverity(y,"function"),A&&S&&f===2)return g.push(W(this,m,y,"missing-function",A)),g;if(y="no-duplicate",A=w.getSeverity(y,"parameter"),A){const b=this.getDuplicatedArgs().filter(([,x])=>!x[0].querySelector("ext")),$="duplicate-parameter";for(const[,x]of b)Array.prototype.push.apply(g,x.map(_=>{const T=P(_,m,y,$,A);return k&&(T.suggestions=[U(T,-1)]),T}))}return g}}insertAt(u,h=this.length){return super.insertAt(u,h),u.anon?O(this,i,To).call(this,u):u.name&&this.getArgs(u.name,!1,!1).add(u),u}getAllArgs(){return this.childNodes.filter(Ns("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:u})=>u)}getArgs(u,h,g=!0){const c=String(u).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");let p;return v(this,n).has(c)?p=v(this,n).get(c):(p=new Set(this.getAllArgs().filter(({name:f})=>c===f)),v(this,n).set(c,p)),p}getDuplicatedArgs(){return[...v(this,n)].filter(([,{size:u}])=>u>1).map(([u,h])=>[u,[...h]])}getPossibleValues(){const{type:u,name:h,childNodes:g}=this;if(u==="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:w})=>!w),...m!=null&&m.anon?[m]:[]].map(({lastChild:w})=>w);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:w}=p[f].childNodes.filter(k=>k.text().trim());if(m===0)p.splice(f,1);else if(m>1||!w.is("magic-word"))f++;else try{const k=w.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,sn=function(){const u=this.type==="template";return this.normalizeTitle((u?"":"Module:")+pe(this.childNodes[u?0:1].text()),10,ce({temporary:!0},!u&&{page:""}))},To=function(u){const h=this.getAnonArgs(),g=typeof u!="number";for(let c=g?h.indexOf(u):u-1;c<h.length;c++){const p=h[c],{name:f}=p,m=String(c+1);(f!==m||p===u)&&(p.setAttribute("name",m),this.getArgs(m,!1,!1).add(p))}},a),li=X(Rr),ht=Q(li,0,"TranscludeToken",Er,ht),V(li,1,ht)}}),Br,oi,Or,jt,Su=C({"src/hidden.ts"(){"use strict";it(),ve(),j(),Br=[Ge(),fe],jt=class extends(Or=E){get type(){return"hidden"}getAttribute(e){return e==="invalid"||super.getAttribute(e)}},oi=X(Or),jt=Q(oi,0,"HiddenToken",Br,jt),V(oi,1,jt)}}),Pr,ai,jr,Wt,ku=C({"src/arg.ts"(){"use strict";var e,Au,s;he(),q(),de(),Qe(),As(),ve(),B(),j(),rt(),Su(),Pr=[fe,We("{{{"),Jt()],Wt=(s=class extends(jr=E){constructor(r,i,l=[]){super(void 0,i,l,{});L(this,e);for(let o=0;o<r.length;o++){const a=r[o];if(o===0){const d=new Ee(a,"arg-name",i,l,{});super.insertAt(d)}else if(o>1){const d=new jt(a,i,l);super.insertAt(d)}else{const d=new E(a,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`{{{${tt(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){super.afterBuild()}lint(r=this.getAbsoluteIndex(),i){{const{childNodes:[l,o,...a]}=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 w=o.lint(m,i);w.length>0&&Array.prototype.push.apply(d,w)}const u=["no-ignored","no-arg"],{lintConfig:h}=I,{computeEditInfo:g}=h,c=new re(this,r),p=u.map(m=>h.getSeverity(m,"arg"));if(p[0]&&a.length>0&&Array.prototype.push.apply(d,a.map(m=>{const w=P(m,c,u[0],"invisible-triple-braces",p[0]);return w.startIndex--,w.startCol--,g&&(w.suggestions=[U(w),wt(w.startIndex,"{{!}}")]),w})),p[1]&&!this.getAttribute("include")){const m=W(this,c,u[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",w=h.getSeverity(m,f.name);w&&d.push(W(this,c,m,"argument-in-ext",w))}return d}}print(){}json(r,i=this.getAbsoluteIndex()){}},e=new WeakSet,Au=function(){},s),ai=X(jr),Wt=Q(ai,0,"ArgToken",Pr,Wt),V(ai,1,Wt)}}),$o={};se($o,{parseBraces:()=>Cs});var Wr,ui,ns,di,hi,ci,qr,gi,Cs,Tn=C({"parser/braces.ts"(){"use strict";st(),he(),Ao(),wu(),ku(),Wr={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},ui=String.raw`\[(?!\[)`,ns=String.raw`\n(?![=\0])`,di=String.raw`|\{{2,}`,hi=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),ci=xt(e=>new RegExp(e,"gmu")),qr=new RegExp(String.raw`\{\{((?:[^\n{}[]|${ui}|${ns})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${ns})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${ui}|${ns})*\}-`,"gu"),gi=e=>{const t=yt(pe(e));return hi.has(t)?hi.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},Cs=(e,t,s)=>{var p,f,m,w,k;const n=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,r]}=t,i=[],l=[],o=(S,y,A,b)=>{y[y.length-1].push(ke(S.slice(A,b),l))};let a;do a!==void 0&&(e=a),a=e.replace(qr,(S,y,A)=>{if(y!==void 0||typeof A=="string")try{const{length:b}=s,$=(y!=null?y:A).split("|");return new ht(ke($[0],l),$.slice(1).map(x=>{const _=x.indexOf("=");return(_===-1?[x]:[x.slice(0,_),x.slice(_+1)]).map(T=>ke(T,l))}),t,s),`\0${b}${gi($[0])}`}catch(b){if(!(b instanceof SyntaxError)||b.message!=="Invalid template name")throw b}return l.push(ke(S,l)),`\0${l.length-1}`});while(a!==e);e=a;const d=e.lastIndexOf("}}")-e.length;let u=d+e.length!==-1,h=ci(n+(u?di:"")),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:K}]=g;g[0]=g[0].slice(K),g.index+=K}const{0:S,index:y}=g!=null?g:{0:`
|
|
10
|
+
`,index:e.length},A=(m=i.pop())!=null?m:{},{0:b,index:$,parts:x,findEqual:_,pos:T}=A,N=S==="="&&_;if(S==="]]"||S==="}-")c=y+2;else if(S===`
|
|
11
|
+
`){c=y+1;const{pos:K,findEqual:M}=(w=i[i.length-1])!=null?w:{};if(K===void 0||M||pe(e.slice(K,$))!==""){const te=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(e.slice($,y));te&&(te[2]=ke(te[2],l),te[2].includes(`
|
|
12
|
+
`)||(e=`${e.slice(0,$)}\0${s.length}h${e.slice(y)}`,c=$+4+String(s.length).length,new dt(te[1].length,te.slice(2),t,s)))}}else if(S==="|"||N)c=y+1,o(e,x,T,y),S==="|"&&x.push([]),A.pos=c,A.findEqual=S==="|",i.push(A);else if(S.startsWith("}}")){const K=S.slice(0,Math.min(b.length,3)),M=b.length-K.length,{length:te}=s;c=y+K.length,o(e,x,T,y);let le=!1,Y="t";if(K.length===3){const D=x.map(be=>be.join("=")),H=D.length>1&&pe(D[1]).trim();new Wt(D,t,s),H&&H.endsWith(":")&&r.includes(H.slice(0,-1).toLowerCase())&&(Y="s")}else try{new ht(x[0][0],x.slice(1),t,s),Y=gi(x[0][0])}catch(D){if(D instanceof SyntaxError&&D.message==="Invalid template name")le=!0;else throw D}le||(e=`${e.slice(0,$+M)}\0${te}${Y}${e.slice(c)}`,c=$+M+3+String(te).length,M>1?i.push({0:b.slice(0,M),index:$,pos:$+M,parts:[[]]}):M===1&&e[$-1]==="-"&&i.push({0:"-{",index:$-1,pos:$+1,parts:[[]]}))}else c=y+S.length,S.startsWith("{")&&(g.pos=c,g.parts=[[]]),i.push(..."0"in A?[A]:[],g);let R=i[i.length-1];if(u&&d+e.length<c)for(u=!1;(k=R==null?void 0:R[0])!=null&&k.startsWith("{");)i.pop(),R=i[i.length-1];h=ci(n+(u?di:"")+(R?`|${Wr[R[0][0]]}${R.findEqual?"|=":""}`:"")),h.lastIndex=c,g=h.exec(e)}return ke(e,l)}}}),Co={};se(Co,{InputboxToken:()=>Io});var Io,_u=C({"src/multiLine/inputbox.ts"(){"use strict";Is(),Tn(),B(),ko(),Io=class extends _n{constructor(e,t,s=I.getConfig(),n=[]){const r=Symbol("InputboxToken"),i=s.excludes.includes("heading")?s:je(ce({},s),{excludes:[...s.excludes,"heading"]}),{length:l}=n;n.push(r),t&&(t=Xt(t,i,n,e)),t&&(t=Cs(t,i,n)),n.splice(l,1),super(e,t,i,n,{})}}}}),gs={};se(gs,{NestedToken:()=>No});var Mr,zr,No,pi=C({"src/nested.ts"(){"use strict";var e,t,s;q(),de(),Is(),Tn(),B(),j(),Jo(),kt(),Mr=new Set(["comment","include","arg","template","magic-word"]),zr=[!1,!0].map(n=>{const r=n?"includeonly":"noinclude";return new RegExp(String.raw`^(?:<${r}(?:\s[^>]*)?/?>|</${r}\s*>)$`,"iu")}),No=(s=class extends E{constructor(r,i,l,o,a=[]){if(typeof i=="boolean"){const d=Symbol("NestedToken"),{length:u}=a;a.push(d),r&&(r=Xt(r,o,a,i)),r&&(r=Cs(r,o,a)),a.splice(u,1)}else r&&(r=r.replace(i,(d,u,h,g,c)=>{const p=`\0${a.length+1}e`;return new ft(u,h,g,c,o,!1,a),p}));r&&(r=r.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(d,u,h)=>(new Ae(h,o,a),`${u}\0${a.length}n`)));super(r,o,a);L(this,e);L(this,t);F(this,e,[...l]),F(this,t,i)}get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex(),i){{const l=super.lint(r,i),o="no-ignored",{lintConfig:a}=I,d=a.getSeverity(o,this.name);if(!d)return l;const u=new re(this,r),h=typeof v(this,t)=="boolean"?zr[v(this,t)?1:0]:/^<!--[\s\S]*-->$/u;return[...l,...this.childNodes.filter(g=>{const{type:c,name:p}=g;if(c==="ext")return!v(this,e).includes(p);if(Mr.has(c))return!1;const f=g.toString().trim();return f&&!h.test(f)}).map(g=>{const c=P(g,u,o,I.msg("invalid-content",this.name),d);return a.computeEditInfo&&(c.suggestions=[U(c),mn(c,g.toString())]),c})]}}},e=new WeakMap,t=new WeakMap,s)}});function Ur(e,t,s,n,r){t=pe(t).trim();let i=t.replace(e==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(e){case"width":return!i&&!!t||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(i);case"link":{const l=n==="gallery-image";if(i){if(Lo(s.protocol).test(i))return Fo(s.protocol).test(i)?t:l;i.startsWith("[[")&&i.endsWith("]]")&&(i=i.slice(2,-2))}else return t;const o=I.normalizeTitle(i,0,!1,s,{halfParsed:r,decode:!0,selfLink:!0,page:""});return o.valid?o:l}case"lang":return(n==="svg"||n==="svgz")&&!/[^a-z\d-]/u.test(i);case"alt":case"class":case"manualthumb":return!0;case"page":return(n==="djvu"||n==="djv"||n==="pdf")&&Number(i)>0;default:return!!i&&!isNaN(i)}}var Lo,Fo,Dr,Hr,Gr,fi,Vr,qt,Tu=C({"src/imageParameter.ts"(){"use strict";var e,t,Eo,r;st(),he(),q(),Re(),_e(),ve(),B(),j(),Lo=xt(i=>new RegExp(String.raw`^(?:${i}|//|\0\d+m\x7F)`,"iu")),Fo=xt(i=>new RegExp(String.raw`^(?:(?:${i}|//)${vt}|\0\d+m\x7F)${bt}$`,"iu")),Dr=xt(i=>new RegExp(String.raw`^(\s*(?!\s))${i.replace("$1","(.*)")}${i.endsWith("$1")?`(?=$|
|
|
13
|
+
)`:""}(\s*)$`,"u")),Hr=i=>{if(i)i.startsWith("//")&&(i=`https:${i}`);else return i;return new URL(i).href},Gr=[fe],qt=(r=class extends(Vr=E){constructor(l,o,a,d){var i=(...n)=>(super(...n),L(this,t),L(this,e,""),this);let u;const h=Object.entries(a.img).map(([c,p])=>[c,p,Dr(c)]),g=h.find(([,c,p])=>(u=p.exec(l),u&&(u.length!==4||Ur(c,u[2],a,o,!0)!==!1)));if(g&&u){u.length===3?(i(void 0,a,d),F(this,e,l)):(i(u[2],a,d,{}),F(this,e,u[1]+g[0]+u[3])),this.setAttribute("name",g[1]),g[1]==="alt"&&this.setAttribute("stage",me-1);return}i(l,a.excludes.includes("list")?a:je(ce({},a),{excludes:[...a.excludes,"list"]}),d),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get type(){return"image-parameter"}get thumb(){return this.name==="manualthumb"?this.normalizeTitle(`File:${super.text().trim()}`,6,{page:""}):void 0}get link(){{if(this.name!=="link")return;const l=super.text().trim();return xe.run(()=>{var d;const o=new E(l,this.getAttribute("config"));if(o.parseOnce(0,this.getAttribute("include")).parseOnce(),/^\0\d+m\x7F/u.test(o.firstChild.toString()))return l;const a=Ur("link",l,this.getAttribute("config"),(d=this.parentNode)==null?void 0:d.type);return a===!0?void 0:a},I)}}afterBuild(){var l;(l=this.parentNode)!=null&&l.is("gallery-image")&&!to.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(l){return v(this,e)?v(this,e).replace("$1",super.toString(l)):super.toString(l)}text(){return v(this,e)?v(this,e).replace("$1",super.text()).trim():super.text().trim()}isPlain(){return this.name==="caption"||this.name==="alt"}getAttribute(l){return l==="invalid"?this.name==="invalid":l==="padding"?Math.max(0,v(this,e).indexOf("$1")):super.getAttribute(l)}lint(l=this.getAbsoluteIndex(),o){{const a=super.lint(l,o),{lintConfig:d}=I,{computeEditInfo:u,fix:h}=d,{link:g,name:c}=this,p=c==="width"&&this.getValue();if(c==="invalid"||p&&p.endsWith("px")){const f="invalid-gallery",m=d.getSeverity(f,"parameter");if(m){const w=W(this,{start:l},f,"invalid-image-parameter",m);(u||h)&&(w.fix=p?U(w,0,p):U(w,-1)),a.push(w)}}else if(c==="link"){if(typeof g=="string"){const f="invalid-url",m=d.getSeverity(f);if(m&&!this.querySelector("magic-word"))try{Hr(g)}catch(w){a.push(W(this,{start:l},f,"invalid-url",m))}}else if(g.encoded){const f="url-encoding",m=d.getSeverity(f,"file");if(m){const w=W(this,{start:l},f,"unnecessary-encoding",m);(u||h)&&(w.fix=pn(w,this)),a.push(w)}}}else if(c==="manualthumb"){const f="invalid-gallery",m=d.getSeverity(f,"thumb");if(m&&!this.querySelector("arg,magic-word,template")){const{valid:w,ns:k,extension:S}=this.thumb;(!w||k!==6||!xs.has(S))&&a.push(W(this,{start:l},f,"invalid-thumb",m))}}return a}}getValue(){return this.name==="invalid"?this.text():O(this,t,Eo).call(this)||super.text()}print(){}},e=new WeakMap,t=new WeakSet,Eo=function(){return v(this,e)&&!v(this,e).includes("$1")},r),fi=X(Vr),qt=Q(fi,0,"ImageParameterToken",Gr,qt),V(fi,1,qt)}}),mi,Qr,Jr,xi,vi,Xr,bi,$n,Ro=C({"src/link/file.ts"(){"use strict";q(),Re(),de(),B(),ks(),Tu(),mi=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),Qr=new Set(["arg"]),Jr=new Set(["template","magic-word"]),xi=new Set(["left","right","center","none"]),vi=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),Xr=e=>{if(e===void 0)return[];const t=/-\{|\}-|\|/gu,s=[];let n=t.exec(e),r=0,i=0;for(;n;){const{0:l,index:o}=n;l!=="|"?r+=l==="-{"?1:-1:r===0&&(s.push(e.slice(i,o)),{lastIndex:i}=t),n=t.exec(e)}return s.push(e.slice(i)),s},bi=(e,t)=>e.filter(({childNodes:s})=>!s.some(n=>n.text().trim()&&t.has(n.type))),$n=class extends ze{get type(){return"file"}get extension(){}constructor(e,t,s,n=[],r="|"){super(e,void 0,s,n,r);const{extension:i}=this.getTitle(!0,!0);this.safeAppend(Xr(t).map(l=>new qt(l,i,s,n)))}lint(e=this.getAbsoluteIndex(),t){var s;{const n=super.lint(e,t),r=bi(this.getAllArgs(),Qr),i=[...new Set(r.map(({name:b})=>b))],l=i.filter(b=>mi.has(b)),o=i.filter(b=>xi.has(b)),a=i.filter(b=>vi.has(b)),[d]=l,u=d==="framed"||d==="manualthumb",h=new re(this,e),{lintConfig:g}=I,{computeEditInfo:c,fix:p}=g,{ns:f,extension:m}=this.getAttribute("title"),{firstChild:w}=this;let k="nested-link",S=g.getSeverity(k,"file");if(S&&xs.has(m)&&this.isInside("ext-link-text")&&((s=this.getValue("link"))==null?void 0:s.trim())!==""){const b=W(this,h,k,"link-in-extlink",S);if(c||p){const $=this.getArg("link");if($){const x=e+$.getRelativeIndex();b.fix={desc:I.msg("delink"),range:[x,x+$.toString().length],text:"link="}}else b.fix=ws(b.endIndex-2,"delink","|link=")}n.push(b)}if(k="invalid-gallery",S=g.getSeverity(k,"extension"),S&&f===6&&!m&&!w.querySelector("arg,magic-word,template")&&n.push(W(this,h,k,"missing-extension",S)),S=g.getSeverity(k,"parameter"),S&&u)for(const b of r.filter(({name:$})=>$==="width")){const $=P(b,h,k,"invalid-image-parameter",S);(c||p)&&($.fix=U($,-1)),n.push($)}if(r.length===i.length&&l.length<2&&o.length<2&&a.length<2)return n;k="no-duplicate";const y=["unknownImageParameter","imageParameter"].map(b=>g.getSeverity(k,b)),A=(b,$,x,_=!0)=>b.map(T=>{if(S=y[Number(typeof _=="function"?_(T):_)],!S)return!1;const N=P(T,h,k,I.msg(`${$}-image-parameter`,x),S);return c&&(N.suggestions=[U(N,-1)]),N}).filter(T=>T!==!1);for(const b of i){if(b==="invalid"||b==="width"&&u)continue;const $=b==="caption";let x=r.filter(({name:_})=>_===b);if($&&(x=[...x.slice(0,-1).filter(_=>_.text()),...x.slice(-1)]),x.length>1){let _=!$||!m||xs.has(m);if($&&_){const T=bi(x,Jr);_=T.length>1&&(N=>T.includes(N))}Array.prototype.push.apply(n,A(x,"duplicate",b,_))}}return l.length>1&&Array.prototype.push.apply(n,A(r.filter(({name:b})=>mi.has(b)),"conflicting","frame")),o.length>1&&Array.prototype.push.apply(n,A(r.filter(({name:b})=>xi.has(b)),"conflicting","horizontal-alignment")),a.length>1&&Array.prototype.push.apply(n,A(r.filter(({name:b})=>vi.has(b)),"conflicting","vertical-alignment")),n}}getAllArgs(){return this.childNodes.slice(1)}getArgs(e){return this.getAllArgs().filter(({name:t})=>e===t)}getArg(e){{const t=this.getArgs(e);return t[e==="manualthumb"?0:t.length-1]}}getValue(e){var t;return(t=this.getArg(e))==null?void 0:t.getValue()}json(e,t=this.getAbsoluteIndex()){}}}}),Kr,yi,Yr,ct,Bo=C({"src/link/galleryImage.ts"(){"use strict";var e,nn,s;q(),Re(),Qe(),B(),j(),Ro(),Kr=[We("")],ct=(s=class extends(Yr=$n){constructor(r,i,l,o,a=[]){let d;if(l!==void 0){const{length:u}=a;d=new E(l,o,a);for(let h=0;h<me-1;h++)d.parseOnce();a.splice(u,1)}super(i,d==null?void 0:d.firstChild.toString(),o,a);L(this,e);Le(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=`${r}-image`,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(r){const i=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),i?0:6,{halfParsed:!0,temporary:r,decode:!i,page:""})}lint(r=this.getAbsoluteIndex(),i){{const l=super.lint(r,i),o="invalid-gallery",{lintConfig:a}=I,d=a.getSeverity(o,"image");if(d&&O(this,e,nn).call(this)){const u=W(this,{start:r},o,"invalid-gallery",d);a.computeEditInfo&&(u.suggestions=[ws(r,"prefix","File:")]),l.push(u)}return l}}getAttribute(r){return r==="invalid"?O(this,e,nn).call(this):super.getAttribute(r)}},e=new WeakSet,nn=function(){const{ns:r}=this.getAttribute("title");return r!==6},s),yi=X(Yr),ct=Q(yi,0,"GalleryImageToken",Kr,ct),V(yi,1,ct)}}),vs,Oo=C({"src/nowiki/commentLine.ts"(){"use strict";kt(),vs=class extends Ae{}}}),Po={};se(Po,{GalleryToken:()=>jo});var jo,$u=C({"src/multiLine/gallery.ts"(){"use strict";var e,Wo,Cu,n;q(),B(),An(),Bo(),Oo(),jo=(n=class extends $s{constructor(i,l,o=[]){var a;super(void 0,l,o,{});L(this,e);for(const d of(a=i==null?void 0:i.split(`
|
|
14
|
+
`))!=null?a:[]){const u=/^([^|]+)(?:\|(.*))?/u.exec(d);if(!u){super.insertAt(d.trim()?new vs(d,l,o):d);continue}const[,h,g]=u;O(this,e,Wo).call(this,h)?super.insertAt(new ct("gallery",h,g,l,o)):super.insertAt(new vs(d,l,o))}}get widths(){}get heights(){}lint(i=this.getAbsoluteIndex(),l){{const{top:o,left:a}=this.getRootNode().posFromIndex(i),d=[],u="no-ignored",{lintConfig:h}=I,g=["Image","NoImage","Comment"].map(c=>h.getSeverity(u,`gallery${c}`));for(let c=0;c<this.length;c++){const p=this.childNodes[c],f=p.toString(),{length:m}=f,w=f.trim(),{type:k}=p,S=o+c,y=c?0:a;if(p.setAttribute("aIndex",i),k==="noinclude"&&w&&!/^<!--.*-->$/u.test(w)){let[A]=g;if(w.startsWith("|")?[,A]=g:(w.startsWith("<!--")||w.endsWith("-->"))&&([,,A]=g),A){const b=i+m,$={rule:u,message:I.msg("invalid-content","gallery"),severity:A,startIndex:i,endIndex:b,startLine:S,endLine:S,startCol:y,endCol:y+m};h.computeEditInfo&&($.suggestions=[U($),mn($,f)]),d.push($)}}else if(k!=="noinclude"&&k!=="text"){const A=p.lint(i,l);A.length>0&&Array.prototype.push.apply(d,A)}i+=m+1}return d}}json(i,l=this.getAbsoluteIndex()){}},e=new WeakSet,Wo=function(i){return this.normalizeTitle(i,6,{halfParsed:!0,temporary:!0,decode:!0,page:""}).valid},Cu=function(i){},n)}}),Cn,qo=C({"src/link/index.ts"(){"use strict";st(),q(),B(),ks(),Cn=class extends ze{get type(){return"link"}get innerText(){return this.length>1?this.lastChild.text():Gt(this.firstChild.text().replace(/^\s*:?/u,""))}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),n="nested-link",{lintConfig:r}=I,i=r.getSeverity(n);if(i&&this.isInside("ext-link-text")){const l=W(this,{start:e},n,"link-in-extlink",i);(r.computeEditInfo||r.fix)&&(l.fix=$e(l,"delink",this.innerText)),s.push(l)}return s}}}}}),Zr,el,Qt,In=C({"src/magicLink.ts"(){"use strict";var e,t,rn,n;q(),he(),de(),B(),j(),Zr=String.raw`(?:[${De}\t]| |�*160;|&#[xX]0*[aA]0;)`,el=new RegExp(`${Zr}+`,"gu"),Qt=(n=class extends E{constructor(i,l="free-ext-link",o=I.getConfig(),a){super(i,o,a,{});L(this,t);L(this,e);F(this,e,l)}get type(){return v(this,e)}get innerText(){const i=new Map([["!","|"],["=","="]]);let l=tt(this.childNodes.map(o=>{const{type:a}=o,d=String(o.name);return a==="magic-word"&&i.has(d)?i.get(d):o}));return this.type==="magic-link"&&(l=l.replace(el," ")),l}get link(){const{innerText:i}=this;return this.type==="magic-link"?i.startsWith("ISBN")?`ISBN ${i.slice(5).replace(/[- ]/gu,"").replace(/x$/u,"X")}`:i:Zl(i).replace(/\n/gu,"%0A")}lint(i=this.getAbsoluteIndex(),l){{const o=super.lint(i,l),a=new re(this,i),{lintConfig:d}=I,{type:u,childNodes:h}=this;if(u==="magic-link"){const f="invalid-isbn",m=d.getSeverity(f);return m&&O(this,t,rn).call(this)&&o.push(W(this,a,f,"invalid-isbn",m)),o}let g="invalid-url",c=d.getSeverity(g);if(c&&!this.querySelector("magic-word"))try{this.getUrl()}catch(f){o.push(W(this,a,g,"invalid-url",c))}const p=u==="ext-link-url";if(g="unterminated-url",c=d.getSeverity(g,p?"pipe":"punctuation"),c){const f=p?/\|/u:/[,;。:!?()]+/u,m=h.find(w=>w.type==="text"&&f.test(w.data));if(m){const{data:w}=m,k=P(m,a,g,I.msg("in-url",p?'"|"':"full-width-punctuation"),c);if(d.computeEditInfo){const{index:S,0:y}=f.exec(w),A=k.startIndex+S;k.suggestions=p?[Vt(A,1)]:[Vt(A),{desc:I.msg("encode"),range:[A,A+y.length],text:encodeURI(y)}]}o.push(k)}}return o}}getUrl(i){this.lspError("MagicLinkToken.getUrl")}getAttribute(i){return i==="invalid"?O(this,t,rn).call(this):super.getAttribute(i)}},e=new WeakMap,t=new WeakSet,rn=function(){if(this.type==="magic-link"){const{link:i}=this;if(i.startsWith("ISBN")){const l=[...i.slice(5)].map(o=>o==="X"?10:Number(o));return l.length===10?l.reduce((o,a,d)=>o+a*(10-d),0)%11!==0:l.length===13&&(l[12]===10||l.reduce((o,a,d)=>o+a*(d%2?3:1),0)%10!==0)}}return!1},n)}}),tl,wi,sl,gt,Mo=C({"src/extLink.ts"(){"use strict";var e,t;Re(),q(),Qe(),B(),j(),In(),tl=[We("[")],gt=(t=class extends(sl=E){constructor(n,r="",i="",l,o=[]){super(void 0,l,o,{});L(this,e);const a=n&&/^\0\d+f\x7F$/u.test(n)?o[Number(n.slice(1,-2))]:new Qt(n,"ext-link-url",l,o);if(this.insertAt(a),F(this,e,r),i){const d=new E(i,l,o,{});d.type="ext-link-text",d.setAttribute("stage",me-1),this.insertAt(d)}}get type(){return"ext-link"}toString(n){return this.length===1?`[${super.toString(n)}${v(this,e)}]`:`[${super.toString(n,v(this,e))}]`}text(){return`[${super.text(" ")}]`}getGaps(){return v(this,e).length}lint(n=this.getAbsoluteIndex(),r){{const i=super.lint(n,r),l="var-anchor",o=I.lintConfig.getSeverity(l,"extLink");return o&&this.length===1&&this.isInside("heading-title")&&i.push(W(this,{start:n},l,"variable-anchor",o)),i}}print(){}},e=new WeakMap,t),wi=X(sl),gt=Q(wi,0,"ExtLinkToken",tl,gt),V(wi,1,gt)}}),ln,Iu=C({"src/imagemapLink.ts"(){"use strict";j(),kt(),qo(),Mo(),ln=class extends E{get type(){return"imagemap-link"}constructor(e,t,s,n,r=[]){super(void 0,n,r),this.append(e,t.length===2?new Cn(...t,n,r):new gt(...t,n,r),new Ae(s,n,r))}}}}),zo={};se(zo,{ImagemapToken:()=>Uo});var Uo,Nu=C({"src/multiLine/imagemap.ts"(){"use strict";q(),_e(),de(),B(),An(),Oo(),Bo(),Iu(),Uo=class extends $s{get image(){return this.childNodes.find(Ns("imagemap-image"))}constructor(e,t=I.getConfig(),s=[]){if(super(void 0,t,s,{}),!e)return;const n=e.split(`
|
|
15
|
+
`),r=new Set(t.protocol.split("|"));let i=!0,l=!1;for(const o of n){const a=o.trim();if(!(l||!a||a.startsWith("#"))){if(i){const d=o.indexOf("|"),u=d===-1?o:o.slice(0,d),{valid:h,ns:g}=this.normalizeTitle(u,0,{halfParsed:!0,temporary:!0,page:""});if(h&&g===6){const c=new ct("imagemap",u,d===-1?void 0:o.slice(d+1),t,s);super.insertAt(c),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("["),u=o.slice(d),h=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(u);if(h){if(this.normalizeTitle(h[1],0,{halfParsed:!0,temporary:!0,selfLink:!0,page:""}).valid){super.insertAt(new ln(o.slice(0,d),h.slice(1),u.slice(u.indexOf("]]")+2),t,s));continue}}else if(u.startsWith("[//")||r.has(u.slice(1,u.indexOf(":")+1))||r.has(u.slice(1,u.indexOf("//")+2))){const g=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(u);if(g){super.insertAt(new ln(o.slice(0,d),g.slice(1),u.slice(u.indexOf("]")+1),t,s));continue}}}}super.insertAt(new vs(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,a=o.getSeverity(l,i?"link":"image");return a&&(i?Array.prototype.push.apply(s,r.filter(d=>{const u=d.toString().trim();return d.is("noinclude")&&u&&!u.startsWith("#")}).map(d=>{const u=P(d,n,l,"invalid-imagemap-link",a);return o.computeEditInfo&&(u.suggestions=[U(u,-1),$e(u,"comment","# ")]),u})):s.push(W(this,n,l,"imagemap-without-image",a))),s}}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}}}}),il,Si,nl,pt,Do=C({"src/nowiki/comment.ts"(){"use strict";q(),it(),Qe(),B(),lt(),il=[Ge(!1),We("<!--")],pt=class extends(nl=Ce){constructor(t,s,n,r){super(t,n,r);Le(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=W(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(){}},Si=X(nl),pt=Q(Si,0,"CommentToken",il,pt),V(Si,1,pt)}}),Ho={};se(Ho,{CommentedToken:()=>Go});var Go,Lu=C({"src/commented.ts"(){"use strict";j(),Do(),Go=class extends E{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 pt(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"))}}}}),Vo={};se(Vo,{NowikiToken:()=>Qo});var rl,ll,Qo,Fu=C({"src/nowiki/index.ts"(){"use strict";var e,on,s;st(),q(),B(),lt(),rl=xt(n=>new RegExp(String.raw`<\s*(?:/\s*)${n==="nowiki"?"":"?"}(${n})\b`,"giu")),ll=new Set(["languages","section","templatestyles"]),Qo=(s=class extends Ce{constructor(){super(...arguments);L(this,e)}get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex()){{const{name:i}=this,{lintConfig:l}=I;let o="void-ext",a=l.getSeverity(o,i);if(a&&O(this,e,on).call(this)){const u=W(this,{start:r},o,I.msg("nothing-in",i),a);return l.computeEditInfo&&(u.suggestions=[U(u)]),[u]}return super.lint(r,rl(i))}}getAttribute(r){return r==="invalid"?O(this,e,on).call(this):super.getAttribute(r)}},e=new WeakSet,on=function(){const{name:r,firstChild:{data:i}}=this;return ll.has(r)&&!!i},s)}}),ol,ki,al,ft,Jo=C({"src/tagPair/ext.ts"(){"use strict";q(),de(),B(),Sn(),j(),wn(),kn(),ol=[_s()],ft=class extends(al=Ke){get type(){return"ext"}constructor(e,t,s,n,r=I.getConfig(),i=!1,l=[]){const o=e.toLowerCase(),a=new Ts(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",o,r,l),d=je(ce({},r),{ext:r.ext.filter(h=>h!==o),excludes:[...r.excludes],inExt:!0});let u;switch(o){case"tab":d.ext=d.ext.filter(h=>h!=="tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":o==="poem"&&d.excludes.push("heading"),u=new E(s,d,l);break;case"pre":{const{PreToken:h}=(vu(),J(bo));u=new h(s,d,l);break}case"dynamicpagelist":{const{ParamTagToken:h}=(ko(),J(So));u=new h(i,s,d,l);break}case"inputbox":{const{InputboxToken:h}=(_u(),J(Co));u=new h(i,s,d,l);break}case"references":{const{NestedToken:h}=(pi(),J(gs));d.excludes.push("heading"),u=new h(s,i,["ref"],d,l);break}case"choose":{const{NestedToken:h}=(pi(),J(gs));u=new h(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],d,l);break}case"combobox":{const{NestedToken:h}=(pi(),J(gs));u=new h(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],d,l);break}case"gallery":{const{GalleryToken:h}=($u(),J(Po));u=new h(s,d,l);break}case"imagemap":{const{ImagemapToken:h}=(Nu(),J(zo));u=new h(s,d,l);break}case"hiero":{const{CommentedToken:h}=(Lu(),J(Ho));u=new h(s,d,l);break}default:{const{NowikiToken:h}=(Fu(),J(Vo));u=new h(s,d,l)}}u.setAttribute("name",o),u.type==="plain"&&(u.type="ext-inner"),super(e,a,u,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(W(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(W(this,r,i,"variable-anchor",l)),i="nested-link",l=n.getSeverity(i,"ref"),l&&this.closest("link-text,ext-link-text")&&s.push(W(this,r,i,"ref-in-link",l))}return s}}},ki=X(al),ft=Q(ki,0,"ExtToken",ol,ft),V(ki,1,ft)}}),Nn,Xo=C({"src/tag/index.ts"(){"use strict";var e,t,s,n;q(),_e(),j(),B(),Nn=(n=class extends E{constructor(i,l,o,a,d){super(void 0,a,d);L(this,e);L(this,t);L(this,s);this.insertAt(l),F(this,e,o),F(this,t,i)}get closing(){return v(this,e)}toString(i){return`<${v(this,e)?"/":""}${v(this,t)}${super.toString(i)}${this.selfClosing?"/":""}>`}text(i=""){const{closing:l}=this;return`<${l&&!i?"/":""}${v(this,t)}${l?"":super.text()}${i}>`}getAttribute(i){return i==="padding"?v(this,t).length+(v(this,e)?2:1):super.getAttribute(i)}findMatchingTag(){return Ze(v(this,s),()=>{const{type:i,name:l,parentNode:o,closing:a,selfClosing:d}=this;let u=!1,h=!1;if(i==="html"){const{html:[,w,k]}=this.getAttribute("config");u=k.includes(l),h=w.includes(l)}if(u||h&&d)return this;if(!o)return;const{childNodes:g}=o,c=g.indexOf(this),p=a?g.slice(0,c).reverse():g.slice(c+1),f=[this],{rev:m}=xe;for(const w of p)if(!(!w.is(i)||i==="html"&&(w.name!==l||h&&w.selfClosing)))if(v(w,e)===a){if(i==="tvar")return;f.push(w)}else{const k=f.pop();if(k===this)return w;I.viewOnly&&(F(k,s,[m,w]),F(w,s,[m,k]))}if(I.viewOnly)for(const w of f)F(w,s,[m,void 0])},i=>{F(this,s,i),i[1]&&i[1]!==this&&F(i[1],s,[xe.rev,this])})}print(){}json(i,l=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n)}}),ul,Ai,dl,Ue,Eu=C({"src/tag/tvar.ts"(){"use strict";it(),ve(),Xo(),nt(),ul=[Ge(),fe],Ue=class extends(dl=Nn){get type(){return"tvar"}constructor(e,t,s,n,r){const i=new Ve(t,"tvar-name",n,r);super(e,i,s,n,r)}},Ai=X(dl),Ue=Q(Ai,0,"TvarToken",ul,Ue),V(Ai,1,Ue)}}),Ko={};se(Ko,{TranslateToken:()=>Yo});var Yo,Ru=C({"src/tagPair/translate.ts"(){"use strict";var e,Bu,s;j(),wn(),nt(),Eu(),Yo=(s=class extends Ke{constructor(r,i,l,o=[]){const a=new Ve(r,"translate-attr",l,o);i=i==null?void 0:i.replace(/<tvar(\|[^>]+)>([\s\S]*?)<\/>/gu,(u,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,(u,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 E(i,l,o);d.type="translate-inner";super("translate",a,d,"translate",l,o);L(this,e);this.seal("closed",!0),this.seal("selfClosing",!0)}get type(){return"translate"}toString(r){return r?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){}},e=new WeakSet,Bu=function(){},s)}}),Zo={};se(Zo,{parseCommentAndExt:()=>Xt});var _i,hl,rs,cl,Ti,Xt,Is=C({"parser/commentAndExt.ts"(){"use strict";st(),he(),pu(),kt(),fu(),Jo(),Do(),_i="<onlyinclude>",hl="</onlyinclude>",{length:rs}=_i,cl=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",s=e?"noinclude":"includeonly";return xt(n=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${n})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(${"\\1"}\s*)>)|<(${s})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${s}\s*)>|$))`,"giu"))}),Ti=e=>{const t=e.indexOf(_i);return{i:t,j:e.indexOf(hl,t+rs)}},Xt=(e,t,s,n)=>{if(n){let{i:a,j:d}=Ti(e);if(a!==-1&&d!==-1){let u="";const h=g=>{new Ae(g,t,s),u+=`\0${s.length-1}n`};for(;a!==-1&&d!==-1;){const g=`\0${s.length}g`;new Ot(e.slice(a+rs,d),t,s),a>0&&h(e.slice(0,a)),u+=g,e=e.slice(d+rs+1),{i:a,j:d}=Ti(e)}return e&&h(e),u}}const{ext:r}=t;let i=r,l=t;if(r.includes("translate")){const{TranslateToken:a}=(Ru(),J(Ko)),d=[];i=r.filter(u=>u!=="translate"&&u!=="tvar"),l=je(ce({},t),{ext:i}),e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,u=>(d.push(u),`\0${d.length-1}`)).replace(/<translate( nowrap)?>([\s\S]*?)<\/translate>/gu,(u,h,g)=>{const c=s.length;return new a(h,g&&ke(g,d),l,s),`\0${c}g`}),e=ke(e,d)}const o=cl[n?1:0](i.join("|"));return o.lastIndex=0,o.test(e)?e.replace(o,(a,d,u,h,g,c,p,f,m)=>{const w=s.length;let k="n";if(d)k="e",new ft(d,u,h,g,l,c,s);else if(a.startsWith("<!--")){k="c";const S=a.endsWith("-->");new pt(ke(a,s,1).slice(4,S?-3:void 0),S,t,s)}else c?new Pt(c,p&&ke(p,s,1),f&&ke(f,s,1),m,t,s):new Ae(a,t,s,!0);return`\0${w}${k}`}):e}}}),gl,pl,fl,ml,$i,xl,Mt,Ou=C({"src/tag/html.ts"(){"use strict";var e,t;q(),de(),Sn(),B(),Xo(),gl=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),pl=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"]),fl=new Set(["strike","big","center","font","tt"]),ml=[_s()],Mt=(t=class extends(xl=Nn){constructor(n,r,i,l,o,a){super(n,r,i,o,a);L(this,e);this.setAttribute("name",n.toLowerCase()),F(this,e,l)}get type(){return"html"}get selfClosing(){return v(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:a,selfClosing:d}=this,u=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"&&!a){const b=W(this,u,f,"<h1>",m);g&&(b.suggestions=[{desc:"h2",range:[n+2,n+3],text:"2"}]),i.push(b)}if(f="parsing-order",m=p&&h.getSeverity(f,p===2?"html":"templateInTable"),m){const b=W(this,u,f,"html-in-table",m);g&&p===2&&(b.suggestions=[U(b)]),i.push(b)}if(f="obsolete-tag",m=h.getSeverity(f,l),m&&fl.has(l)&&i.push(W(this,u,f,"obsolete-tag",m)),f="bold-header",m=h.getSeverity(f,l),m&&(l==="b"||l==="strong")&&this.isInside("heading-title")){const b=W(this,u,f,"bold-in-header",m);g&&(b.suggestions=[U(b)]),i.push(b)}const{html:[,w,k]}=this.getAttribute("config"),S=k.includes(l),y=w.includes(l),A=!S&&!y;if(f="unmatched-tag",a&&(d||S)||d&&A){if(m=h.getSeverity(f,a?"both":"selfClosing"),m){const b=W(this,u,f,a?"closing-and-self-closing":"invalid-self-closing",m);if(g||c){const $=fn(n),x={desc:I.msg("no-self-closing"),range:[b.endIndex-2,b.endIndex-1],text:""};y?g&&(b.suggestions=[$,x]):a?b.fix=S?$:x:g&&(b.suggestions=[x,He(b.endIndex,`></${l}>`,-2)])}i.push(b)}}else if(!this.findMatchingTag()){const b=W(this,u,f,a?"unmatched-closing":"unclosed-tag"),$=this.closest("magic-word");if($&&gl.has($.name))m=h.getSeverity(f,"conditional");else if(a)m=h.getSeverity(f,"closing"),b.suggestions=[U(b)];else{m=h.getSeverity(f,"opening");const x=o==null?void 0:o.childNodes;pl.has(l)&&(x!=null&&x.slice(0,x.indexOf(this)).some(_=>_.is("html")&&_.name===l&&!_.findMatchingTag())&&(b.suggestions=[He(n+1,"/")]),this.isInside("heading-title")&&(b.rule="format-leakage",m=h.getSeverity("format-leakage",l)))}m&&(b.severity=m,i.push(b))}return i}}getAttribute(n){return n==="invalid"?this.inTableAttrs()===2:super.getAttribute(n)}json(n,r=this.getAbsoluteIndex()){}},e=new WeakMap,t),$i=X(xl),Mt=Q($i,0,"HtmlToken",ml,Mt),V($i,1,Mt)}}),ea={};se(ea,{parseHtml:()=>ta});var vl,ta,Pu=C({"parser/html.ts"(){"use strict";kn(),Ou(),vl=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,ta=(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 a=vl.exec(o),d=a==null?void 0:a[2],u=d==null?void 0:d.toLowerCase();if(!a||!t.htmlElements.has(u)){i+=`<${o}`;continue}const[,h,,g="",c,p]=a,{length:f}=s,m=new Ts(g,"html-attrs",u,t,s),w=m.hasAttr("itemprop");if(u==="meta"&&!(w&&m.hasAttr("content"))||u==="link"&&!(w&&m.hasAttr("href"))){i+=`<${o}`,s.length=f;continue}i+=`\0${s.length}x${p}`,new Mt(d,m,h==="/",c==="/>",t,s)}return i}}}),bl,Ci,yl,mt,sa=C({"src/table/base.ts"(){"use strict";Sn(),j(),nt(),kn(),bl=[_s(1)],mt=class extends(yl=E){constructor(e,t,s,n,r,i=[],l){super(void 0,r,i,l),this.append(new Ve(t,"table-syntax",r,i),new Ts(n,"table-attrs",s,r,i))}escape(){}},Ci=X(yl),mt=Q(Ci,0,"TableBaseToken",bl,mt),V(Ci,1,mt)}}),wl,Ii,Fe,ls,Lt,Ft,bs,ia=C({"src/table/td.ts"(){"use strict";q(),de(),yn(),B(),j(),sa(),bs=class extends(Ii=mt,wl=[Ss(!1)],Ii){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),V(ls,5,this),Me(this,Lt),Me(this,Fe,""),r&&([su(this,Fe)._]=r);const l=new E(t==null?void 0:t.slice(((o=r==null?void 0:r.index)!=null?o:NaN)+ge(this,Fe).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 Vi(this,Lt,Ft).call(this).subtype}afterBuild(){ge(this,Fe).includes("\0")&&Se(this,Fe,this.buildFromStr(ge(this,Fe),0)),super.afterBuild()}toString(e){const{childNodes:[t,s,n]}=this;return t.toString(e)+s.toString(e)+ge(this,Fe)+n.toString(e)}text(){const{childNodes:[e,t,s]}=this;return e.text()+t.text()+ge(this,Fe)+s.text()}getGaps(e){return e===1?ge(this,Fe).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,a=["td","double"].map(d=>i.getSeverity(r,d));for(const d of this.lastChild.childNodes)if(d.type==="text"){const{data:u}=d;if(u.includes("|")){const h=u.includes("||"),g=a[h?1:0];if(g){const c=P(d,n,r,"pipe-in-table",g);if(l||o)if(h){const p={caption:"|+",td:"|",th:"!"}[this.subtype];c.fix=$e(c,"newline",u.replace(/\|\|/gu,`
|
|
16
|
+
${p}`))}else l&&(c.suggestions=[vn(c.startIndex,u)]);s.push(c)}}}return s}}isIndependent(){return this.firstChild.text().startsWith(`
|
|
17
|
+
`)}getAttr(e){{const t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}}escape(){}print(){}json(e,t=this.getAbsoluteIndex()){}},ls=X(Ii),Fe=new WeakMap,Lt=new WeakSet,Ft=function(){var e;const t=this.firstChild.text(),s=t.slice(-1);let n="td";if(s==="!"?n="th":s==="+"&&(n="caption"),this.isIndependent())return{subtype:n};const{previousSibling:r}=this;return ce({},Vi(e=r,Lt,Ft).call(e))},Ft=Q(ls,17,"#getSyntax",wl,Lt,Ft),cn(ls,bs)}}),Ln,na=C({"src/table/trBase.ts"(){"use strict";q(),B(),sa(),ia(),Ln=class extends mt{lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),n=this.childNodes.find(({type:o})=>o==="table-inter");if(!n)return s;const r=hs(n),i="fostered-content",l=r&&I.lintConfig.getSeverity(i,r===2?void 0:"transclusion");if(l){const o=P(n,{start:e},i,"content-outside-table",l);o.startIndex++,o.startLine++,o.startCol=0,s.push(o)}return s}}getRowCount(){return Number(this.childNodes.some(e=>e instanceof bs&&e.isIndependent()&&!e.firstChild.text().endsWith("+")))}}}}),Sl,kl,Al,Ni,os,ps,ju=C({"src/table/index.ts"(){"use strict";q(),_e(),de(),yn(),B(),na(),nt(),Sl=(e,t)=>Array.from({length:e},(s,n)=>t(n)),kl=class extends Array{},ps=class extends(Ni=Ln,Al=[Ss(!1)],Ni){constructor(e,t,s,n){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,"table",t,s,n,{}),V(os,5,this)}get type(){return"table"}get closed(){return this.lastChild.is("table-syntax")}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),n=new re(this,e),r=["unclosed-table","table-layout"],i=r.map(l=>I.lintConfig.getSeverity(l));if(i[0]&&!this.closed&&s.push(P(this.firstChild,n,r[0],"unclosed-table",i[0])),i[1]){const l=this.getLayout(),{length:o}=l;if(o>1){let a=1,d=1/0,u=0;for(;u<o;u++){const h=l[u],g=h.length;if(g<a)break;g<d&&(d=g);const c=h.indexOf(h[g-1])+1;if(c>d)break;c>a&&(a=c)}if(u<o){const h=this.getNthRow(u),g=P(h,n,r[1],"inconsistent-table",i[1]);g.startIndex++,g.startLine++,g.startCol=0,s.push(g)}}}return s}}close(e=`
|
|
18
|
+
|}`,t){xe.run(()=>{const s=new Ve(t?e:void 0,"table-syntax",this.getAttribute("config"),this.getAttribute("accum"));super.insertAt(s)})}getLayout(e){{const t=this.getAllRows(),{length:s}=t,n=kl.from(Sl(s,()=>[]));for(let r=0;r<n.length;r++){const i=n[r];let l=0,o=0,a;for(const d of t[r].childNodes.slice(2))if(d.is("td")){if(d.isIndependent()&&(a=d.subtype!=="caption"),a){const u={row:r,column:l},{rowspan:h,colspan:g}=d;for(l++;i[o];)o++;for(let c=r;c<Math.min(r+h,s);c++)for(let p=o;p<o+g;p++)n[c][p]=u;o+=g}}else if(qa(d))break}return n}}getAllRows(){return[...super.getRowCount()?[this]:[],...this.childNodes.slice(1).filter(e=>e.is("tr")&&e.getRowCount()>0)]}getNthRow(e,t,s){{const n=super.getRowCount();if(e===0&&n)return this;n&&e--;for(const r of this.childNodes.slice(2)){const{type:i}=r;if(i==="tr"&&r.getRowCount()&&(e--,e<0))return r}return}}json(e,t=this.getAbsoluteIndex()){}},os=X(Ni),Q(os,1,"getLayout",Al,ps),cn(os,ps)}}),ra,Wu=C({"src/table/tr.ts"(){"use strict";na(),ra=class extends Ln{get type(){return"tr"}constructor(e,t,s,n){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,e,"tr",t,s,n)}}}}),Fn,la=C({"src/nowiki/listBase.ts"(){"use strict";lt(),Fn=class extends Ce{get indent(){}json(e,t=this.getAbsoluteIndex()){}}}}),En,oa=C({"src/nowiki/dd.ts"(){"use strict";la(),En=class extends Fn{get type(){return"dd"}}}}),aa={};se(aa,{parseTable:()=>ua});var _l,Li,ua,qu=C({"parser/table.ts"(){"use strict";j(),ju(),Wu(),ia(),oa(),_l=e=>e.lastChild.constructor!==E,Li=(e,t)=>e.is("td")?t.pop():e,ua=({firstChild:{data:e},type:t,name:s},n,r)=>{const i=[],l=e.split(`
|
|
19
|
+
`);let o=t==="root"||t==="parameter-value"||t==="ext-inner"&&s==="poem"?"":`
|
|
20
|
+
${l.shift()}`,a;const d=(u,h)=>{if(!h){o+=u;return}const{lastChild:g}=h;if(_l(h)){const c=new E(u,n,r);c.type="table-inter",c.setAttribute("stage",3),h.insertAt(c)}else g.setText(g.toString()+u)};for(const u of l){a=i.pop();const[h]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(u),g=u.slice(h.length),c=/^(:*)((?:\s|\0\d+[cn]\x7F)*)(\{\||\{(?:\0\d+[cn]\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(g);if(c){for(;a&&!a.is("td");)a=i.pop();const[,S,y,A,b]=c;S&&new En(S,n,r),d(`
|
|
21
|
+
${h}${S&&`\0${r.length-1}d`}${y}\0${r.length}b`,a),i.push(...a?[a]:[],new ps(A,b,n,r));continue}else if(!a){o+=`
|
|
22
|
+
${u}`;continue}const p=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(g);if(!p){d(`
|
|
23
|
+
${u}`,a),i.push(a);continue}const[,f,m,w,k]=p;if(f){for(;!a.is("table");)a=i.pop();a.close(`
|
|
24
|
+
${h}${f}`,!0),d(k,i[i.length-1])}else if(m){a=Li(a,i),a.is("tr")&&(a=i.pop());const S=new ra(`
|
|
25
|
+
${h}${m}`,k,n,r);i.push(a,S),a.insertAt(S)}else{a=Li(a,i);const S=w==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu;let y=S.exec(k),A=0,b=`
|
|
26
|
+
${h}${w}`;const $=x=>{const _=new bs(b,k.slice(A,y==null?void 0:y.index),n,r);return x.insertAt(_),_};for(;y;)$(a),{lastIndex:A}=S,[b]=y,y=S.exec(k);i.push(a,$(a))}}return o.slice(1)}}}),zt,Mu=C({"../cm-util/dist/index.mjs"(){"use strict";zt=e=>!/^_{2}.+_{2}$/u.test(e)}}),da,zu=C({"src/nowiki/hr.ts"(){"use strict";lt(),da=class extends Ce{get type(){return"hr"}}}}),Tl,Fi,$l,Ut,Uu=C({"src/nowiki/doubleUnderscore.ts"(){"use strict";var e,t;it(),Qe(),lt(),Tl=[Ge(),We("__")],Ut=(t=class extends($l=Ce){constructor(n,r,i,l,o){var h,g;super(n,l,o);L(this,e);const a=n.toLowerCase(),{doubleUnderscore:[,,d,u]}=l;this.setAttribute("name",(g=r?(h=u==null?void 0:u[n])==null?void 0:h.toLowerCase():d==null?void 0:d[a])!=null?g:a),F(this,e,i)}get type(){return"double-underscore"}toString(){const n=v(this,e)?"__":"__";return n+this.innerText+n}print(){}},e=new WeakMap,t),Fi=X($l),Ut=Q(Fi,0,"DoubleUnderscoreToken",Tl,Ut),V(Fi,1,Ut)}}),ha={};se(ha,{parseHrAndDoubleUnderscore:()=>ca});var ca,Du=C({"parser/hrAndDoubleUnderscore.ts"(){"use strict";Mu(),zu(),Uu(),Ao(),ca=({firstChild:{data:e},type:t,name:s},n,r)=>{var d,u,h;const{doubleUnderscore:[i,l,o]}=n,a=[...i,...l];return(d=n.insensitiveDoubleUnderscore)!=null||(n.insensitiveDoubleUnderscore=new Set(i.filter(zt))),(u=n.sensitiveDoubleUnderscore)!=null||(n.sensitiveDoubleUnderscore=new Set(l.filter(zt))),(h=n.regexHrAndDoubleUnderscore)!=null||(n.regexHrAndDoubleUnderscore=new RegExp(String.raw`^((?:\0\d+[cno]\x7F)*)(-{4,})|__(${a.filter(zt).join("|")})__|_{2}(${a.filter(g=>!zt(g)).map(g=>g.slice(2,-2)).join("|")})_{2}`,"gimu")),t!=="root"&&(t!=="ext-inner"||s!=="poem")&&(e=`\0${e}`),e=e.replace(n.regexHrAndDoubleUnderscore,(g,c,p,f,m)=>{var A;if(p)return new da(p,n,r),`${c}\0${r.length-1}r`;const w=f!=null?f:m,k=n.sensitiveDoubleUnderscore.has(w),S=w.toLowerCase(),y=n.insensitiveDoubleUnderscore.has(S);return k||y?(new Ut(w,k,!!m,n,r),`\0${r.length-1}${y&&((A=o==null?void 0:o[S])!=null?A:S)==="toc"?"u":"n"}`):g}),n.excludes.includes("heading")||(e=e.replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(g,c,p,f,m)=>{const w=`${c}\0${r.length}h`;return new dt(p.length,[f,m],n,r),w})),t==="root"||t==="ext-inner"&&s==="poem"?e:e.slice(1)}}}),ga,Hu=C({"src/nowiki/quote.ts"(){"use strict";var e,t;q(),de(),B(),lt(),ga=(t=class extends Ce{constructor(n,r,i,l){super(n,i,l);L(this,e);F(this,e,r)}get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}get closing(){return ce(ce({},this.bold?{bold:v(this,e).bold}:void 0),this.italic?{italic:v(this,e).italic}:void 0)}text(){const{parentNode:n,innerText:r}=this;return n!=null&&n.is("image-parameter")&&n.name!=="caption"?"":r}lint(n=this.getAbsoluteIndex()){{const{previousSibling:r,bold:i,closing:l}=this,o=(r==null?void 0:r.type)==="text"?r.data:void 0,a=[],d=new re(this,n),u=["lonely-apos","bold-header"],{lintConfig:h}=I,{computeEditInfo:g}=h,c=[void 0,"word"].map(f=>h.getSeverity(u[0],f)),p=h.getSeverity(u[1]);if(o!=null&&o.endsWith("'")){const f=c[(l.bold||l.italic)&&/[a-z\d]'$/iu.test(o)?1:0];if(f){const m=W(this,d,u[0],I.msg("lonely","'"),f),{startLine:w,startCol:k}=m,[,{length:S}]=/(?:^|[^'])('+)$/u.exec(o),y=n-S,A=je(ce({},m),{startIndex:y,endIndex:n,endLine:w,startCol:k-S,endCol:k});g&&(A.suggestions=[wt(y,"'",S),U(A)]),a.push(A)}}if(p&&i&&this.isInside("heading-title")){const f=W(this,d,u[1],"bold-in-header",p);g&&(f.suggestions=[U(f)]),a.push(f)}return a}}json(n,r=this.getAbsoluteIndex()){}},e=new WeakMap,t)}}),pa={};se(pa,{parseQuotes:()=>Rn});var Rn,fa=C({"parser/quotes.ts"(){"use strict";Hu(),Rn=(e,t,s,n)=>{var c;const r=e.split(/('{2,})/u),{length:i}=r;if(i===1)return e;let l=0,o=0,a,d,u;for(let p=1;p<i;p+=2){const f=r[p].length;switch(f){case 2:o++;break;case 4:r[p-1]+="'",r[p]="'''";case 3:if(l++,a!==void 0)break;r[p-1].endsWith(" ")?d===void 0&&u===void 0&&(u=p):r[p-1].slice(-2,-1)===" "?a=p:d!=null||(d=p);break;default:r[p-1]+="'".repeat(f-5),r[p]="'''''",o++,l++}}if(o%2===1&&l%2===1){const p=(c=a!=null?a:d)!=null?c:u;p!==void 0&&(r[p]="''",r[p-1]+="'")}let h=!1,g=!1;for(let p=1;p<i;p+=2){const f=r[p].length,m=f!==2,w=f!==3,k=new ga(r[p],{bold:m&&!!h,italic:w&&!!g},t,s);m&&(h=!h&&k),w&&(g=!g&&k),r[p]=`\0${s.length-1}q`}return r.join("")}}}),ma={};se(ma,{parseExternalLinks:()=>Bn});var Bn,xa=C({"parser/externalLinks.ts"(){"use strict";he(),Mo(),In(),Bn=(e,t,s,n)=>{var r;return(r=t.regexExternalLinks)!=null||(t.regexExternalLinks=new RegExp(String.raw`\[((?:\0\d+[cn]\x7F)*(?:\0\d+f\x7F|(?:(?:${t.protocol}|//)${vt}|\0\d+m\x7F)${bt}(?=[[\]<>"\t${De}]|\0\d)))([${De}]*(?![${De}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),e.replace(t.regexExternalLinks,(i,l,o,a)=>{const{length:d}=s,u=/&[lg]t;/u.exec(l);return u&&(o="",a=l.slice(u.index)+o+a,l=l.slice(0,u.index)),n?(new Qt(l,"ext-link-url",t,s),`[\0${d}f${o}${a}]`):(new gt(l,o,a,t,s),`\0${d}w`)})}}}),va,Gu=C({"src/link/category.ts"(){"use strict";ks(),va=class extends ze{get type(){return"category"}get sortkey(){}json(e,t=this.getAbsoluteIndex()){}}}}),ba={};se(ba,{parseLinks:()=>an});var Cl,an,Vu=C({"parser/links.ts"(){"use strict";he(),B(),fa(),xa(),qo(),Ro(),Gu(),Cl=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,an=(e,t,s,n,r)=>{var a;(a=t.regexLinks)!=null||(t.regexLinks=new RegExp(String.raw`^\s*(?:${t.protocol}|//)`,"iu"));const i=t.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]]))?\]\]([\s\S]*)$/u:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])*)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]])?)?\]\]([\s\S]*)$/u,l=e.split("[[");let o=l.shift();for(let d=0;d<l.length;d++){let u=!1,h,g,c,p;const f=l[d],m=i.exec(f);if(m)[,h,g,c,p]=m,p.startsWith("]")&&(c!=null&&c.includes("["))&&(c+="]",p=p.slice(1));else{const b=Cl.exec(f);b&&(u=!0,[,h,g,c]=b)}if(h===void 0||t.regexLinks.test(h)||/\0\d+[exhbru]\x7F/u.test(h)){o+=`[[${f}`;continue}let w=pe(h).trim();const k=w.startsWith(":");if(k&&u){o+=`[[${f}`;continue}else!w&&c&&!c.includes(`
|
|
27
|
+
`)&&(w=pe(c).trim());const{ns:S,valid:y}=I.normalizeTitle(w,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0,page:n});if(y){if(u){if(S!==6){o+=`[[${f}`;continue}let b=!1;for(d++;d<l.length;d++){const $=l[d],x=$.split("]]");if(x.length>2){b=!0,c+=`[[${x[0]}]]${x[1]}`,p=x.slice(2).join("]]");break}else if(x.length===2)c+=`[[${x[0]}]]${x[1]}`;else{c+=`[[${$}`;break}}if(c=an(c,t,s,n,r),!b){o+=`[[${h}${g}${c}`;continue}}}else{o+=`[[${f}`;continue}c&&(c=Rn(c,t,s,r));let A=Cn;k||(S===6?(c&&(c=Bn(c,t,s,!0)),A=$n):S===14&&(A=va)),c===void 0&&g&&(c=""),o+=`\0${s.length}l${p}`,new A(h,c,t,s,g)}return o}}}),ya={};se(ya,{parseMagicLinks:()=>wa});var Ei,Ri,Bi,Oi,wa,Qu=C({"parser/magicLinks.ts"(){"use strict";he(),In(),Ei=String.raw`[${De}\t]| |�*160;|�*a0;`,Ri=`(?:${Ei})+`,Bi=`(?:${Ei}|-)`,Oi=String.raw`(?:RFC|PMID)${Ri}\d+\b|ISBN${Ri}(?:97[89]${Bi}?)?(?:\d${Bi}?){9}[\dx]\b`,wa=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${vt}${bt})|${Oi})`,"giu")}catch(n){t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${vt}${bt})|${Oi})`,"giu")}return e.replace(t.regexMagicLinks,(n,r,i)=>{let l=r?n.slice(r.length):n;if(i){let o="";const a=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(l);a&&(o=l.slice(a.index),l=l.slice(0,a.index));const d=l.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,u=d.exec(l);if(u){let h=1;u[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(l.slice(0,u.index))&&(h=2),o=l.slice(u.index+h)+o,l=l.slice(0,u.index+h)}return o.length>=i.length?n:(new Qt(l,void 0,t,s),`${r}\0${s.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(l))return n;return new Qt(l,"magic-link",t,s),`${r}\0${s.length-1}i`})}}}),Sa,Ju=C({"util/html.ts"(){"use strict";Sa=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,n)=>s!==e[n])}}),Il,ka,Xu=C({"src/nowiki/list.ts"(){"use strict";q(),B(),la(),Il=new Set(["link","category","file"]),ka=class extends Fn{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"&&Il.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=W(i,{start:e+1},s,"redirect-like",n);return o.startIndex--,o.startCol--,o.endIndex+=2,o.endCol+=2,[o]}}return[]}}}}}),Aa={};se(Aa,{parseList:()=>_a});var _a,Ku=C({"parser/list.ts"(){"use strict";Ju(),Xu(),oa(),_a=(e,t,s,n)=>{const r=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!r)return t.lastPrefix="",e;const[i,l,o,a]=r,d=o.replace(/;/gu,":"),u=Sa(d,t.lastPrefix),h=((u>1?o.slice(u-1):o)+a).split(/(?=;)/u),g=h[0].startsWith(";");let c=h.length-(g?0:1);if(u>1){const T=o.slice(0,u-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 ka(T,s,n);if(!c)return p;const{html:[f,,m]}=s,w=/:+|-\{|\0\d+[xq]\x7F/gu;let k=w,S=k.exec(p),y=0,A=!1,b=!1,$=0;const x=(T,N)=>(new En(T,s,n),`${p.slice(0,N)}\0${n.length-1}d${p.slice(N+T.length)}`),_=T=>{T?y&&y--:y++};for(;S&&c;){const{0:T,index:N}=S;if(T==="-{"){if(!$){const{lastIndex:R}=k;k=/-\{|\}-/gu,k.lastIndex=R}$++}else if(T==="}-"){if($--,!$){const{lastIndex:R}=k;k=w,k.lastIndex=R}}else if(T.endsWith("x")){const{name:R,closing:K,selfClosing:M}=n[Number(T.slice(1,-2))];(f.includes(R)||!M&&!m.includes(R))&&_(K)}else if(T.endsWith("q")){const{bold:R,italic:K}=n[Number(T.slice(1,-2))];R&&(_(A),A=!A),K&&(_(b),b=!b)}else if(y===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)}S=k.exec(p)}return p}}}),Pi,Nl,ji,Ll,Dt,Yu=C({"src/converterFlags.ts"(){"use strict";var e,t;q(),de(),As(),ve(),B(),j(),rt(),Pi=new Set(["A","T","R","D","-","H","N"]),Nl=[Jt(),fe],Dt=(t=class extends(Ll=E){constructor(n,r,i=[]){super(void 0,r,i,{});L(this,e);this.safeAppend(n.map(l=>new Ee(l,"converter-flag",r,i)))}get type(){return"converter-flags"}afterBuild(){F(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(v(this,e).filter(n=>/\{{3}[^{}]+\}{3}/u.test(n)))}getVariantFlags(){const n=new Set(this.getAttribute("config").variants);return new Set(v(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(v(this,e).filter(m=>Pi.has(m))),a=v(this,e).filter(m=>!m).length,d=v(this,e).length-l.size-a,{lintConfig:u}=I,{computeEditInfo:h,fix:g}=u,c=super.lint(n,r);if(i.size===d||o.size===d)return c;const p="no-ignored",f=u.getSeverity(p,"conversionFlag");if(f){const m=new re(this,n);for(let w=0;w<this.length;w++){const k=this.childNodes[w],S=k.text().trim();if(this.isInvalidFlag(S,i,l,o)){const y=P(k,m,p,"invalid-conversion-flag",f);(h||g)&&(i.size===0&&Pi.has(S.toUpperCase())?y.fix=xn(y,S):h&&(y.suggestions=[U(y,w&&-1)])),c.push(y)}}}return c}}print(){}},e=new WeakMap,t),ji=X(Ll),Dt=Q(ji,0,"ConverterFlagsToken",Nl,Dt),V(ji,1,Dt)}}),as,Fl,Wi,El,Ye,Zu=C({"src/converterRule.ts"(){"use strict";Re(),ve(),B(),j(),rt(),as=(e,t,s,n)=>{const r=new E(e,s,n);return r.type=`converter-rule-${t}`,r.setAttribute("stage",me),r},Fl=[fe],Ye=class extends(El=E){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 Ee(l,"converter-rule-variant",s,n)),super.insertAt(as(e.slice(r+1),"to",s,n)),i!==-1&&super.insertAt(as(e.slice(0,i),"from",s,n),0)):super.insertAt(as(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()){}},Wi=X(El),Ye=Q(Wi,0,"ConverterRuleToken",Fl,Ye),V(Wi,1,Ye)}}),Rl,qi,Bl,Ht,ed=C({"src/converter.ts"(){"use strict";he(),Qe(),ve(),j(),Yu(),Zu(),Rl=[fe,We("-{")],Ht=class extends(Bl=E){get type(){return"converter"}constructor(e,t,s,n=[]){super(void 0,s,n),this.insertAt(new Dt(e,s,n));const[r]=t,i=r.includes(":"),l=new Ye(r,i,s,n);(i?l.length===1:t.length===2&&!pe(t[1]).trim())?this.insertAt(new Ye(t.join(";"),!1,s,n)):this.safeAppend([l,...t.slice(1).map(o=>new Ye(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()}|${tt(t,";")}}-`}getGaps(e){return e||this.firstChild.length>0?1:0}print(){}},qi=X(Bl),Ht=Q(qi,0,"ConverterToken",Rl,Ht),V(qi,1,Ht)}}),Ta={};se(Ta,{parseConverter:()=>$a});var $a,td=C({"parser/converter.ts"(){"use strict";ed(),$a=(e,t,s)=>{var a;(a=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:u}=o;if(d==="}-"){const h=i.pop(),{length:g}=s,c=e.slice(h.index+2,u),p=c.indexOf("|"),[f,m]=p===-1?[[],c]:[c.slice(0,p).split(";"),c.slice(p+1)],w=m.replace(/(&[#a-z\d]+);/giu,"$1"),k=w.split(t.regexConverter).map(S=>S.replace(/\x01/gu,";"));new Ht(f,k,t,s),e=`${e.slice(0,h.index)}\0${g}v${e.slice(u+2)}`,i.length===0&&(l=n),l.lastIndex=h.index+3+String(g).length}else i.push(o),l=r,l.lastIndex=u+2;o=l.exec(e)}return e}}}),ys={};se(ys,{Token:()=>E});var Ol,E,j=C({"src/index.ts"(){"use strict";var e,t,s,n,r,i,l,o,a,Ca,Ia,Na,La,Fa,Ea,Ra,Ba,Oa,Pa,ja,Wa,A;he(),Re(),q(),_e(),B(),uu(),du(),Ol=["category","html-attr#id,ext-attr#id,table-attr#id"],E=(A=class extends Rt{constructor(x,_=I.getConfig(),T=[],N){super();L(this,a);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),F(this,s,_),F(this,n,T),T.push(this)}get type(){return v(this,e)}set type(x){F(this,e,x)}get pageName(){return v(this.getRootNode(),o)}set pageName(x){if(x){const _=this.normalizeTitle(x,0,{temporary:!0,page:""});F(this,o,_.valid?_.title:void 0)}else F(this,o,x===""?"":void 0)}parseOnce(x=v(this,t),_=!1,T){if(x<v(this,t)||this.length!==1||!this.isPlain())return this;if(v(this,t)>=me)return this;switch(x){case 0:if(this.type==="root"){v(this,n).pop();const N=O(this,a,Ca).call(this);_&&(_=!N)}F(this,r,_),O(this,a,Ia).call(this,_);break;case 1:O(this,a,Na).call(this);break;case 2:O(this,a,La).call(this);break;case 3:O(this,a,Fa).call(this);break;case 4:O(this,a,Ea).call(this);break;case 5:O(this,a,Ra).call(this,T);break;case 6:O(this,a,Ba).call(this,T);break;case 7:O(this,a,Oa).call(this);break;case 8:O(this,a,Pa).call(this);break;case 9:O(this,a,ja).call(this);break;case 10:O(this,a,Wa).call(this)}if(this.type==="root")for(const N of v(this,n))N==null||N.parseOnce(x,_,T);return Hn(this,t)._++,this}buildFromStr(x,_){const T=x.split(/[\0\x7F]/u).map((N,R)=>{if(R%2===0)return N&&new Yi(N);if(isNaN(N.slice(-1)))return v(this,n)[Number(N.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${N}`)}).filter(N=>N!=="");return _===0?T.map(String).join(""):_===1?tt(T):T}build(){F(this,t,me);const{length:x,firstChild:_}=this,T=_==null?void 0:_.toString();if(x===1&&_.type==="text"&&T.includes("\0")&&(On(this,0,1,this.buildFromStr(T)),this.type==="root"))for(const N of v(this,n))N==null||N.build()}afterBuild(){if(this.type==="root")for(const x of v(this,n))x==null||x.afterBuild();F(this,i,!0)}parse(x=me,_,T){for(x=Math.min(x,me);v(this,t)<x;)this.parseOnce(v(this,t),_,T);return x&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===A}getAttribute(x){var _;switch(x){case"config":return v(this,s);case"include":return(_=v(this,r))!=null?_:!!v(this.getRootNode(),r);case"accum":return v(this,n);case"built":return v(this,i);case"stage":return v(this,t);case"invalid":default:return super.getAttribute(x)}}setAttribute(x,_){switch(x){case"stage":v(this,t)===0&&this.type==="root"&&v(this,n).shift(),F(this,t,_);break;default:super.setAttribute(x,_)}}insertAt(x,_=this.length){const T=typeof x=="string"?new Yi(x):x;super.insertAt(T,_);const{type:N}=T;return N==="root"&&(T.type="plain"),T}normalizeTitle(x,_=0,T){return I.normalizeTitle(x,_,this.getAttribute("include"),v(this,s),ce({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:R,fix:K,ignoreDisables:M,configurationComment:te}=N;let le=super.lint(x,_);if(this.type==="root"){const Y=new Map,D="no-duplicate",H=["category","id"].map(G=>N.getSeverity(D,G)),be=this.toString(),Ie=Ol.filter((G,ie)=>H[ie]).join();if(Ie){for(const G of this.querySelectorAll(Ie)){let ie;if(G.is("category"))ie=G.name;else{const Z=G.getValue();Z&&Z!==!0&&(ie=`#${Z}`)}if(ie){const Z=Y.get(ie);Z?Z.add(G):Y.set(ie,new Set([G]))}}for(const[G,ie]of Y)if(ie.size>1&&!G.startsWith("#mw-customcollapsible-")){const Z=!G.startsWith("#"),ee=`duplicate-${Z?"category":"id"}`,ue=H[Z?0:1];le.push(...[...ie].map(oe=>{const z=W(oe,{start:oe.getAbsoluteIndex()},D,ee,ue);return R&&Z&&(z.suggestions=[U(z)]),z}))}}if(!M){const G=new RegExp(String.raw`<!--\s*${te}-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->`,"gu"),ie=[];let Z=G.exec(be);for(;Z;){const{1:ee,index:ue}=Z,oe=(T=Z[2])==null?void 0:T.trim();ie.push({line:this.posFromIndex(ue).top+(ee==="disable-line"?0:1),from:ee==="disable"?G.lastIndex:void 0,to:ee==="enable"?G.lastIndex:void 0,rules:oe?new Set(oe.split(",").map(z=>z.trim())):void 0}),Z=G.exec(be)}le=le.filter(({rule:ee,startLine:ue,startIndex:oe})=>{const z={pos:0};for(const{line:ye,from:Be,to:Oe,rules:Ne}of ie){if(ye>ue+1)break;if(Ne&&!Ne.has(ee))continue;if(ye===ue&&Be===void 0&&Oe===void 0)return!1;Be<=oe&&Be>z.pos?(z.pos=Be,z.type="from"):Oe<=oe&&Oe>z.pos&&(z.pos=Oe,z.type="to")}return z.type!=="from"})}if(K&&le.some(({fix:G})=>G)){const G=le.map(({fix:ee})=>ee).filter(ee=>ee!==void 0).sort(({range:[ee,ue]},{range:[oe,z]})=>ue===z?oe-ee:z-ue);let ie=1/0,Z=be;for(const{range:[ee,ue],text:oe}of G)ue<=ie&&(Z=Z.slice(0,ee)+oe+Z.slice(ue),ie=ee);Object.assign(le,{output:Z})}if(!R)for(const G of le)delete G.fix,delete G.suggestions}return le}}toString(x,_){return x?super.toString(!0,_):Ze(v(this,l),()=>super.toString(!1,_),T=>{const N=this.getRootNode();N.type==="root"&&v(N,i)&&F(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,a=new WeakSet,Ca=function(){const{parseRedirect:x}=(gu(),J(ho)),_=this.firstChild.toString(),T=x(_,v(this,s),v(this,n));return T&&this.setText(T),!!T},Ia=function(x){const{parseCommentAndExt:_}=(Is(),J(Zo));this.setText(_(this.firstChild.toString(),v(this,s),v(this,n),x))},Na=function(){const{parseBraces:x}=(Tn(),J($o)),_=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,T=x(_,v(this,s),v(this,n));this.setText(this.type==="root"?T:T.slice(1))},La=function(){if(v(this,s).excludes.includes("html"))return;const{parseHtml:x}=(Pu(),J(ea));this.setText(x(this.firstChild.toString(),v(this,s),v(this,n)))},Fa=function(){if(v(this,s).excludes.includes("table"))return;const{parseTable:x}=(qu(),J(aa));this.setText(x(this,v(this,s),v(this,n)))},Ea=function(){if(v(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:x}=(Du(),J(ha));this.setText(x(this,v(this,s),v(this,n)))},Ra=function(x){const{parseLinks:_}=(Vu(),J(ba));this.setText(_(this.firstChild.toString(),v(this,s),v(this,n),this.pageName,x))},Ba=function(x){if(v(this,s).excludes.includes("quote"))return;const{parseQuotes:_}=(fa(),J(pa)),T=this.firstChild.toString().split(`
|
|
28
|
+
`);for(let N=0;N<T.length;N++)T[N]=_(T[N],v(this,s),v(this,n),x);this.setText(T.join(`
|
|
29
|
+
`))},Oa=function(){if(v(this,s).excludes.includes("extLink"))return;const{parseExternalLinks:x}=(xa(),J(ma));this.setText(x(this.firstChild.toString(),v(this,s),v(this,n)))},Pa=function(){if(v(this,s).excludes.includes("magicLink"))return;const{parseMagicLinks:x}=(Qu(),J(ya));this.setText(x(this.firstChild.toString(),v(this,s),v(this,n)))},ja=function(){if(v(this,s).excludes.includes("list"))return;const{parseList:x}=(Ku(),J(Aa)),{firstChild:_,type:T,name:N}=this,R=_.toString().split(`
|
|
30
|
+
`),K={lastPrefix:""};let M=T==="root"||T==="ext-inner"&&N==="poem"?0:1;for(;M<R.length;M++)R[M]=x(R[M],K,v(this,s),v(this,n));this.setText(R.join(`
|
|
31
|
+
`))},Wa=function(){if(v(this,s).variants.length>0){const{parseConverter:x}=(td(),J(Ta));this.setText(x(this.firstChild.toString(),v(this,s),v(this,n)))}},A)}}),xe,Ns,qa,Ma,On,za,_e=C({"util/debug.ts"(){"use strict";xe={running:!1,run(e,t){const{running:s}=this;this.running=!0;const n=t==null?void 0:t.internal;t&&(t.internal=!0);const r=()=>{this.running=s,t&&(t.internal=n)};try{const{Token:i}=(j(),J(ys)),l=e();return l instanceof i&&!l.getAttribute("built")&&l.afterBuild(),r(),l}catch(i){throw r(),i}},internal(e,t){const{internal:s}=t;t.internal=!0;const n=e();return t.internal=s,n},rev:0},Ns=e=>t=>t.type===e,qa=({type:e})=>e==="tr"||e==="table-syntax",Ma=e=>e==="redirect-target"||e==="link",On=(e,t,s,n=[])=>{var l,o;let r=e.getChildNodes(),i;r.length===s?(i=r,r=n):i=Array.prototype.splice.apply(r,[t,s,...n]);for(let a=0;a<n.length;a++){const d=n[a];d.setAttribute("parentNode",e),d.setAttribute("nextSibling",r[t+a+1]),d.setAttribute("previousSibling",r[t+a-1])}return(l=r[t-1])==null||l.setAttribute("nextSibling",r[t]),(o=r[t+n.length])==null||o.setAttribute("previousSibling",r[t+n.length-1]),r===n&&e.setAttribute("childNodes",r),i},za=(e,t)=>{const s=e.toLowerCase(),[n,r]=t,i=Object.prototype.hasOwnProperty.call(r,e);return[s,i,i?r[e]:Object.prototype.hasOwnProperty.call(n,s)&&n[s]]}}}),at,Mi,us,zi,Pl,Ui,jl,Wl,un,sd=C({"lib/lintConfig.ts"(){"use strict";var e,t;Kl(),at=new Map([[0,!1],[1,"warning"],[2,"error"],[!1,!1],["off",!1],["warning","warning"],["error","error"]]),Mi={"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-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(Mi),us={configurationComment:"lint",ignoreDisables:!1,fix:!0,computeEditInfo:!0},Object.freeze(us),zi=s=>at.has(s),Pl=s=>zi(s)||Array.isArray(s)&&zi(s[0])&&(s.length===1||typeof s[1]=="object"),Ui=(s,n,r)=>{if(fs.includes(n)){if(r===void 0)return!1;if(Pl(r))return s[n]=r,!0}else throw new RangeError(`Unknown lint rule: ${n}`);throw new RangeError(`Invalid lint config for ${n}: ${JSON.stringify(r)}`)},jl=typeof structuredClone=="function"?structuredClone:(s=>JSON.parse(JSON.stringify(s))),Wl=class{constructor(s){if(Object.assign(this,jl(Mi)),!!s)for(const[n,r]of Object.entries(s))Ui(this,n,r)}getSeverity(s,n){var i,l;const r=this[s];return typeof r!="object"?at.get(r):n&&(l=at.get((i=r[1])==null?void 0:i[n]))!=null?l:at.get(r[0])}},un=(t=class{constructor(s){L(this,e);if(Object.assign(this,us),s&&!("rules"in s)&&Object.keys(s).some(r=>fs.includes(r)))this.rules=s;else{const n=s!=null?s:{},{rules:r}=n,i=Dn(n,["rules"]);this.rules=r;for(const[l,o]of Object.entries(i))o!==void 0&&Object.prototype.hasOwnProperty.call(us,l)&&(this[l]=o)}}get rules(){return v(this,e)}set rules(s){F(this,e,new Proxy(new Wl(s),{set:Ui,deleteProperty(){return!1}}))}getSeverity(s,n){return v(this,e).getSeverity(s,n)}},e=new WeakMap,t)}}),Di,dn,id=C({"lib/title.ts"(){"use strict";var e,t,s,n,r,i,Ua,o;st(),he(),Di=a=>{const[,{length:d},u]=/^((?:\.\.\/)*)([\s\S]*)/u.exec(a);return[d/3,u]},dn=(o=class{constructor(a,d,u,{temporary:h,decode:g,selfLink:c,page:p}={}){L(this,i);L(this,e);L(this,t);L(this,s);L(this,n);L(this,r);Le(this,"page");Le(this,"valid");Le(this,"encoded",!1);this.page=p;const f=a.trim(),m=f.startsWith("../");if(g&&a.includes("%"))try{const y=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(a);a=Gt(a),this.encoded=y}catch(y){}if(a=ms(a).replace(/[_ ]+/gu," ").trim(),m||p&&f.startsWith("/"))F(this,n,0);else{let y=d;a.startsWith(":")&&(y=0,a=a.slice(1).trim());const A=a.split(":");if(A.length>1){const b=yt(A[0]),$=Object.prototype.hasOwnProperty.call(u.nsid,b)&&u.nsid[b];$&&(y=$,a=A.slice(1).join(":").trim())}F(this,n,y)}const w=a.indexOf("#");if(w!==-1){let y=a.slice(w).trim().slice(1);if(y.includes("%"))try{y=Gt(y)}catch(A){}F(this,r,y.replace(/ /gu,"_")),a=a.slice(0,w).trim()}const[k,S]=m?Di(a):[0,a];this.valid=!!(a||c&&this.ns===0&&v(this,r)!==void 0)&&ms(a)===a&&(k===0||p===void 0||p.split("/",k+1).length>k)&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(S),this.main=a,F(this,t,u.namespaces),F(this,s,u.articlePath||"/wiki/$1"),v(this,s).includes("$1")||F(this,s,v(this,s)+`${v(this,s).endsWith("/")?"":"/"}$1`)}get ns(){return v(this,n)}get fragment(){return v(this,r)}get main(){return v(this,e)}set main(a){a=a.replace(/_/gu," ").trim(),F(this,e,a&&a[0].toUpperCase()+a.slice(1))}get prefix(){const a=v(this,t)[this.ns];return a+(a&&":")}get title(){return this.getRedirection()[1]}get extension(){const{main:a}=this,d=a.lastIndexOf(".");return d===-1?void 0:a.slice(d+1).toLowerCase()}getRedirection(){const{prefix:a}=this,d=a;return O(this,i,Ua).call(this,d)}setFragment(a){F(this,r,a)}getUrl(a){throw new Error("Title.getUrl method is only available in the LSP version!")}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n=new WeakMap,r=new WeakMap,i=new WeakSet,Ua=function(a){var u,h;let d=(a+this.main).replace(/ /gu,"_");if(d.startsWith("/"))d=((u=this.page)!=null?u:"")+d.replace(/(.)\/$/u,"$1");else if(d.startsWith("../")&&((h=this.page)!=null&&h.includes("/"))){const[g,c]=Di(d),p=this.page.split("/");p.length>g&&(d=p.slice(0,-g).join("/")+(c&&"/")+c)}return[!1,d]},o)}}),Da={};se(Da,{default:()=>I});Ha.exports=J(Da);var ds,Hi,ql,Ml,ut,Gi,zl,I,B=C({"index.ts"(){Kl(),_e(),Re(),he(),sd(),id(),ds=!0,Hi=new un,Ml=(e,t,s)=>typeof e=="string"?[!!t,s,e]:[!!e,t,s],ut={config:Qi,get rules(){return fs},get i18n(){return ce(ce({},eo),ql)},set i18n(e){ql=e},get lintConfig(){return Hi},set lintConfig(e){Hi=new un(e)},get viewOnly(){return ds},set viewOnly(e){ds&&!e&&xe.rev++,ds=e},internal:!1,getConfig(e){const t=e!=null?e:this.config,{doubleUnderscore:s,ext:n,parserFunction:r,variable:i}=t;for(let l=0;l<2;l++)s.length>l+2&&s[l].length===0&&(s[l]=Object.keys(s[l+2]));return n.includes("translate")&&!i.includes("translationlanguage")&&(i.push("translationlanguage"),r[1].TRANSLATIONLANGUAGE="translationlanguage"),je(ce(ce({},Qi),t),{excludes:[]})},msg(e,t=""){var s;return e&&((s=this.i18n[e])!=null?s:e).replace("$1",this.msg(t))},normalizeTitle(e,t=0,s,n=ut.getConfig(),r){let i;if(r!=null&&r.halfParsed)i=new dn(e,t,n,r);else{const{Token:l}=(j(),J(ys));i=xe.run(()=>{const o=new l(e,n);o.type="root",o.pageName=r==null?void 0:r.page,o.parseOnce(0,s).parseOnce();const a=new dn(o.firstChild.toString(),t,n,r);o.build();for(const d of["main","fragment"]){const u=a[d];if(u!=null&&u.includes("\0")){const h=o.buildFromStr(u,1);d==="main"?a.main=h:a.setFragment(h)}}return a},this)}return i},parse(e,t,s,n,r){e=Yl(e);let i,l,o,a;typeof t=="string"?(i=!!s,l=n,o=r,a=t):(i=!!t,l=s,o=n,a=r),l!=null||(l=me),o!=null||(o=this.getConfig());let d;typeof l!="number"&&(d=Array.isArray(l)?l:[l],l=Math.max(...d.map(g=>Xl[g]||me)));const{Token:u}=(j(),J(ys));return xe.run(()=>{const g=new u(e,o);return g.type="root",g.pageName=a,g.parse(l,i)})},parseWithRef(e,t,s,n=t.getAttribute("include")){return this.parse(e,n,s,t.getAttribute("config"),t.pageName)},createLanguageService(e={}){},lint(e,t,s,n){{const[r,i,l]=Ml(t,s,n);return xe.internal(()=>this.parse(e,r,void 0,i,l).lint(),this)}},print(e,t,s,n){}},Gi={},zl=new Set(["lintConfig","normalizeTitle","parse","createLanguageService"]);for(const e of Object.keys(ut))zl.has(e)||(Gi[e]={enumerable:!1});Object.defineProperties(ut,Gi),Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:ut}),I=ut}});B()});nd();})();
|