wikiparser-node 1.30.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 +9 -4
- package/bundle/bundle-es8.min.js +28 -29
- package/bundle/bundle-lsp.min.js +34 -34
- 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 -316
- package/dist/addon/transclude.js +11 -8
- package/dist/base.d.mts +13 -4
- package/dist/base.d.ts +13 -4
- package/dist/base.js +2 -0
- package/dist/base.mjs +2 -0
- package/dist/bin/config.js +1 -1
- package/dist/index.d.ts +34 -5
- package/dist/index.js +100 -88
- package/dist/internal.d.ts +6 -1
- package/dist/lib/document.d.ts +9 -7
- package/dist/lib/document.js +91 -66
- package/dist/lib/element.d.ts +8 -8
- package/dist/lib/element.js +52 -50
- package/dist/lib/lintConfig.js +6 -2
- package/dist/lib/lsp.js +120 -56
- package/dist/lib/node.js +21 -15
- package/dist/lib/redirectMap.js +1 -1
- package/dist/lib/text.js +17 -14
- 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 +4 -4
- package/dist/parser/hrAndDoubleUnderscore.js +11 -9
- 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/render/magicWords.js +768 -0
- package/dist/render/syntaxhighlight.js +415 -0
- package/dist/src/arg.js +8 -1
- package/dist/src/atom.js +2 -0
- package/dist/src/attribute.d.ts +5 -0
- package/dist/src/attribute.js +59 -104
- package/dist/src/attributes.d.ts +5 -0
- package/dist/src/attributes.js +17 -51
- 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 +2 -2
- 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 +34 -24
- package/dist/src/index.d.ts +5 -5
- package/dist/src/index.js +37 -27
- package/dist/src/link/base.js +26 -36
- package/dist/src/link/category.d.ts +8 -1
- package/dist/src/link/category.js +104 -38
- package/dist/src/link/file.js +21 -8
- package/dist/src/link/galleryImage.js +2 -3
- package/dist/src/link/index.d.ts +1 -1
- package/dist/src/link/index.js +12 -33
- 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/list.js +3 -1
- 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 +3 -3
- package/dist/src/onlyinclude.js +1 -1
- package/dist/src/paramLine.js +2 -0
- package/dist/src/parameter.js +1 -1
- package/dist/src/redirect.js +1 -1
- package/dist/src/table/base.js +5 -4
- package/dist/src/table/index.d.ts +1 -6
- package/dist/src/table/index.js +7 -16
- package/dist/src/table/td.js +12 -9
- package/dist/src/tag/html.js +2 -3
- package/dist/src/tag/index.js +8 -6
- package/dist/src/tagPair/ext.js +18 -41
- package/dist/src/tagPair/index.js +6 -4
- package/dist/src/tagPair/translate.d.ts +1 -0
- package/dist/src/tagPair/translate.js +10 -3
- package/dist/src/transclude.js +18 -21
- package/dist/util/constants.js +9 -3
- package/dist/util/debug.js +72 -5
- package/dist/util/diff.js +17 -15
- package/dist/util/html.js +14 -5
- 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 +51 -20
- package/extensions/dist/base.js +2 -2
- package/extensions/editor.css +1 -1
- package/i18n/en.json +1 -0
- package/i18n/zh-hans.json +30 -29
- package/i18n/zh-hant.json +31 -30
- package/package.json +23 -16
- package/dist/addon/magicWords.js +0 -132
package/bundle/bundle-es8.min.js
CHANGED
|
@@ -1,32 +1,31 @@
|
|
|
1
|
-
"use strict";(()=>{var qa=Object.defineProperty,Wa=Object.defineProperties;var za=Object.getOwnPropertyDescriptors;var Yt=Object.getOwnPropertySymbols;var jr=Object.prototype.hasOwnProperty,Br=Object.prototype.propertyIsEnumerable;var qr=e=>{throw TypeError(e)};var qs=(e,t,s)=>t in e?qa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,ge=(e,t)=>{for(var s in t||(t={}))jr.call(t,s)&&qs(e,s,t[s]);if(Yt)for(var s of Yt(t))Br.call(t,s)&&qs(e,s,t[s]);return e},je=(e,t)=>Wa(e,za(t));var Wr=(e,t)=>{var s={};for(var i in e)jr.call(e,i)&&t.indexOf(i)<0&&(s[i]=e[i]);if(e!=null&&Yt)for(var i of Yt(e))t.indexOf(i)<0&&Br.call(e,i)&&(s[i]=e[i]);return s};var Ma=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Le=(e,t,s)=>qs(e,typeof t!="symbol"?t+"":t,s),Ws=(e,t,s)=>t.has(e)||qr("Cannot "+s);var f=(e,t,s)=>(Ws(e,t,"read from private field"),s?s.call(e):t.get(e)),N=(e,t,s)=>t.has(e)?qr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),L=(e,t,s,i)=>(Ws(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),P=(e,t,s)=>(Ws(e,t,"access private method"),s);var zr=(e,t,s,i)=>({set _(n){L(e,t,n,s)},get _(){return f(e,t,i)}});var Ju=Ma((Ku,Ba)=>{var jl=Object.create,et=Object.defineProperty,Bl=Object.getOwnPropertyDescriptor,or=Object.getOwnPropertyNames,Ua=Object.getPrototypeOf,Da=Object.prototype.hasOwnProperty,ql=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),St=e=>{throw TypeError(e)},Wl=(e,t,s)=>t in e?et(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Mr=(e,t)=>et(e,"name",{value:t,configurable:!0}),C=(e,t)=>function(){return e&&(t=(0,e[or(e)[0]])(e=0)),t},zl=(e,t)=>function(){return t||(0,e[or(e)[0]])((t={exports:{}}).exports,t),t.exports},ie=(e,t)=>{for(var s in t)et(e,s,{get:t[s],enumerable:!0})},Ml=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of or(t))!Da.call(e,n)&&n!==s&&et(e,n,{get:()=>t[n],enumerable:!(i=Bl(t,n))||i.enumerable});return e},Ha=(e,t,s)=>(s=e!=null?jl(Ua(e)):{},Ml(t||!e||!e.__esModule?et(s,"default",{value:e,enumerable:!0}):s,e)),K=e=>Ml(et({},"__esModule",{value:!0}),e),se=e=>{var t;return[,,,jl((t=e==null?void 0:e[ql("metadata")])!=null?t:null)]},Ul=["class","method","getter","setter","accessor","field","value","get","set"],Ft=e=>e!==void 0&&typeof e!="function"?St("Function expected"):e,Ga=(e,t,s,i,n)=>({kind:Ul[e],name:t,metadata:i,addInitializer:r=>s._?St("Already initialized"):n.push(Ft(r||null))}),ar=(e,t)=>Wl(t,ql("metadata"),e[3]),Z=(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},ee=(e,t,s,i,n,r)=>{var l,o,a,u,h,d=t&7,g=!!(t&8),c=!!(t&16),p=d>3?e.length+1:d?g?1:2:0,x=Ul[d+5],m=d>3&&(e[p-1]=[]),v=e[p]||(e[p]=[]),w=d&&(!c&&!g&&(n=n.prototype),d<5&&(d>3||!c)&&Bl(d<4?n:{get[s](){return de(this,r)},set[s](y){return be(this,r,y)}},s));d?c&&d<4&&Mr(r,(d>2?"set ":d>1?"get ":"")+s):Mr(n,s);for(var S=i.length-1;S>=0;S--)u=Ga(d,s,a={},e[3],v),d&&(u.static=g,u.private=c,h=u.access={has:c?y=>Qa(n,y):y=>s in y},d^3&&(h.get=c?y=>(d^1?de:Qi)(y,n,d^4?r:w.get):y=>y[s]),d>2&&(h.set=c?(y,A)=>be(y,n,A,d^4?r:w.set):(y,A)=>y[s]=A)),o=(0,i[S])(d?d<4?c?r:w[x]:d>4?void 0:{get:w.get,set:w.set}:n,u),a._=1,d^4||o===void 0?Ft(o)&&(d>4?m.unshift(o):d?c?r=o:w[x]=o:n=o):typeof o!="object"||o===null?St("Object expected"):(Ft(l=o.get)&&(w.get=l),Ft(l=o.set)&&(w.set=l),Ft(l=o.init)&&m.unshift(l));return d||ar(e,n),w&&et(n,s,w),c?d^4?r:w:n},Va=(e,t,s)=>Wl(e,typeof t!="symbol"?t+"":t,s),ur=(e,t,s)=>t.has(e)||St("Cannot "+s),Qa=(e,t)=>Object(t)!==t?St('Cannot use the "in" operator on this value'):e.has(t),de=(e,t,s)=>(ur(e,t,"read from private field"),s?s.call(e):t.get(e)),ze=(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),be=(e,t,s,i)=>(ur(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),Qi=(e,t,s)=>(ur(e,t,"access private method"),s),Ja=(e,t,s,i)=>({set _(n){be(e,t,n,s)},get _(){return de(e,t,i)}}),Dl,bs,Hl=C({"base.ts"(){"use strict";Dl=(()=>{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,"list-range":11};return Object.setPrototypeOf(e,null),e})(),bs=(()=>{const e=["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 ye(e,t,s){return s===1?e.replace(/\0(\d+)g\x7F/gu,(i,n)=>ye(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,zs,xt,vt,bt,ot,Gl,fe,tt,Ur,Dr,ys,Vl,Hr,Gr,Gt,yt,ce=C({"util/string.ts"(){"use strict";De=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,zs=String.raw`[^[\]<>"\0-\x1F\x7F${De}\uFFFD]`,xt=String.raw`(?:\[[\da-f:.]+\]|${zs})`,vt=String.raw`(?:${zs}|\0\d+[cn!~]\x7F)*`,bt=e=>e.trim().toLowerCase(),ot=(e,t)=>s=>s.replace(e,t),Gl=ot(/[\0\x7F]|\r$/gmu,""),fe=ot(/\0\d+[cn]\x7F/gu,""),tt=(e,t="")=>e.map(s=>typeof s=="string"?s:s.text()).join(t),Ur={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},Dr=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)):Ur[s.toLowerCase()]),ys=e=>Dr(e),Vl=ot(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),Hr={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},Gr=e=>ot(e,t=>`&${Hr[t]};`),Gt=Gr(/[&<>]/gu),yt=(e,t={})=>{const{pre:s="",post:i="",sep:n=""}=t;return s+e.map(r=>r.print()).join(n)+i}}}),Xa=zl({"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:[]}}}),pe,Ql,Ji,Be=C({"util/constants.ts"(){"use strict";pe=11,Ql=void 0,Ji=Xa()}});function mt(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 Vt,st=C({"../common/dist/index.mjs"(){"use strict";Vt=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25"))}}),ne,he=C({"lib/rect.ts"(){"use strict";var e,t,s,i,Xi,r;ne=(r=class{constructor(l,o){N(this,i);N(this,e);N(this,t);N(this,s);L(this,e,l),L(this,t,o)}get start(){return f(this,t)}get top(){return P(this,i,Xi).call(this).top}get left(){return P(this,i,Xi).call(this).left}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakSet,Xi=function(){var l;return(l=f(this,s))!=null||L(this,s,f(this,e).getRootNode().posFromIndex(f(this,t))),f(this,s)},r)}}),Vr,Qr,Ht,Ki,Ms,B,M,$e,_s,G,hr,He,dr,cr,gr,Qt,wt,pr,Ze,Jl,W=C({"util/lint.ts"(){"use strict";st(),Ie(),he(),O(),Vr=new Set(["tr","td","th","caption"]),Qr=new Set(["Template:!!","Template:!-"]),Ht=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")&&Qr.has(t.name)||t.is("html")&&Vr.has(t.name))return!1;if(t.is("arg"))return t.length>1&&Ht(t.childNodes[1]);if(t.is("magic-word"))try{const s=t.getPossibleValues().map(Ht);return s.includes(2)?2:s.includes(1)&&1}catch(s){}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?1:2},Ki=(e,t,s,i)=>({line:e+s-1,character:(s===1?t:0)+i}),Ms=e=>(t,s,i,n,r="error")=>{const{start:l}=s,{top:o,left:a}=s instanceof ne?s:new ne(t,l),{offsetHeight:u,offsetWidth:h}=t,{startIndex:d,startLine:g,startCol:c}=e(t,l,o,a),{line:p,character:x}=Ki(g,c,u,h);return{rule:i,message:I.msg(n),severity:r,startIndex:d,endIndex:d+t.toString().length,startLine:g,endLine:p,startCol:c,endCol:x}},B=Ms((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}}),M=Ms((e,t,s,i)=>({startIndex:t,startLine:s,startCol:i})),$e=(e,t,s,i=0)=>({desc:I.msg(t),range:[e.startIndex+i,e.endIndex],text:s}),_s=(e,t,s)=>({desc:I.msg(t),range:[e,e],text:s}),G=(e,t=0,s="")=>typeof e=="number"?{desc:I.msg("remove"),range:[e,e+t],text:s}:$e(e,"remove",s,t),hr=(e,t)=>$e(e,"decode",Vt(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}),dr=e=>({desc:I.msg("open"),range:[e+1,e+2],text:""}),cr=(e,t)=>$e(e,"comment",`<!--${t}-->`),gr=(e,t)=>$e(e,"uppercase",t.toUpperCase()),Qt=(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)}),pr=(e,t)=>({desc:I.msg("escape"),range:[e,e+t.length],text:t.replace(/\|/gu,"|")}),Ze=(e,t,s,i)=>{if(e&&(i||I.viewOnly&&e[0]===xe.rev))return e[1];const n=t();return(i||I.viewOnly)&&s([xe.rev,n]),n},Jl=(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"]:[]}}),Jr,fr,Xl=C({"parser/selector.ts"(){"use strict";Jr=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},fr=(e,t,s)=>{const i=e.split(",").map(n=>Jr(n.trim()));return(({type:n,name:r})=>i.some(l=>l(n,r)))}}}),Ka=zl({"../node_modules/binary-search/index.js"(e,t){t.exports=function(s,i,n,r,l){var o,a;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(o=r+(l-r>>>1),a=+n(s[o],i,o,s),a<0)r=o+1;else if(a>0)l=o-1;else return o;return~r}}}),Xr,Kl,Ya=C({"util/search.ts"(){"use strict";Xr=Ha(Ka()),Kl=(e,t,s)=>{const i=(0,Xr.default)(e,t,s);return i<0?~i:i}}}),$s,mr=C({"mixin/cached.ts"(){"use strict";W(),$s=(e=!0)=>t=>{const s=new WeakMap;return function(...i){return Ze(s.get(this),()=>t.apply(this,i),n=>{s.set(this,n)},e)}}}}),Yl,Za=C({"mixin/nodeLike.ts"(){"use strict";Yl=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}}}),Kr,Yr,Zt,kt,_t,es,$t,Tt,Ct,Ke,Zl=C({"lib/node.ts"(){"use strict";Ya(),W(),Ie(),mr(),Za(),O(),Yr=[Yl],Kr=[$s(!1)],Ke=class{constructor(){Z(Ct,5,this),Va(this,"childNodes",[]),ze(this,Zt),ze(this,kt),ze(this,_t),ze(this,es),ze(this,$t),ze(this,Tt,{})}get parentNode(){return de(this,Zt)}get nextSibling(){return de(this,kt)}get previousSibling(){return de(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":be(this,Zt,t),t||(be(this,kt,void 0),be(this,_t,void 0));break;case"nextSibling":be(this,kt,t);break;case"previousSibling":be(this,_t,t);break;case"aIndex":I.viewOnly&&be(this,$t,[xe.rev,t]);break;default:this[e]=t}}getRootNode(){return Ze(de(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"&&be(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(),i=Kl(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 Ze(de(this,Tt)[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&&(de(this,Tt)[n]=[xe.rev,i]),i+=t[n].toString().length+this.getGaps(n);return i},t=>{de(this,Tt)[e]=t})}getAbsoluteIndex(){return Ze(de(this,$t),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{be(this,$t,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
|
-
`),Ae!==-1));)ve=ve.nextSibling;if(!ve)continue;Oe=ve.data.slice(0,Ae)}else Oe=u.slice(Q+te,oe);if(!/(?:^|[^=])=+\s*(?:\S\s*)?$/u.test(Oe))continue;oe===-1?(le=ve.getAbsoluteIndex()+Oe.length,{top:Re,left:Pe}=S.posFromIndex(le)):(le+=Oe.length,te+=Oe.length)}const Je={rule:H,message:I.msg(D==="="?"header-like":"lonely",Se||D==="h"||js||Bs?U:D),severity:me,startIndex:ue,endIndex:le,startLine:Pr,endLine:Re!=null?Re:Pr,startCol:Or,endCol:Pe!=null?Pe:Or+te};if(T.computeEditInfo)if(D==="<")Je.suggestions=[wt(ue,"<")];else if(D==="h"&&c!=="link-text"&&ln.test(Ps||""))Je.suggestions=[Qt(ue)];else if(Y&&c==="ext-link-text"){const oe=h.getAbsoluteIndex()+h.toString().length;Je.suggestions=[wt(oe,"]")]}else if(J&&Fr){const oe=n-g.toString().length;Je.suggestions=[_s(oe,"left-bracket","[")]}else Se&&(Je.suggestions=[...j[0]===U?[]:[gr(Je,U)],...Ne===":"||Ne===":"?[Qt(le,1)]:[]]);x.push(Je)}return x}}replaceData(n){P(this,e,to).call(this,n)}splitText(n){this.lspError("AstText.splitText")}escape(){}print(){return Gt(this.data)}},e=new WeakSet,to=function(n){this.setAttribute("data",n)},s)}}),Ge,it=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}}}),Ee,qe=C({"mixin/noEscape.ts"(){"use strict";Ee=e=>{}}}),Ve,rt=C({"src/syntax.ts"(){"use strict";var e,t;q(),Ve=(t=class extends F{constructor(i,n,r,l,o){super(i,r,l,o);N(this,e);L(this,e,n)}get type(){return f(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}}}),Ce,nt=C({"src/atom.ts"(){"use strict";var e,t;q(),Ce=(t=class extends F{constructor(i,n,r,l,o){super(i,r,l,o);N(this,e);L(this,e,n)}get type(){return f(this,e)}set type(i){L(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)}}),on,an,Gs,un,Me,Ts=C({"src/link/base.ts"(){"use strict";var e,t,s,i;W(),Be(),he(),Qe(),qe(),O(),q(),nt(),on=n=>n==="redirect-target"||n==="link",an=[Ee,We("[[")],Me=(i=class extends(un=F){constructor(r,l,o,a=[],u="|"){super(void 0,o,a,{});N(this,e,!0);N(this,t);N(this,s);if(this.insertAt(new Ce(r,"link-target",o,a,{})),l!==void 0){const h=new F(l,o,a,{});h.type="link-text",h.setAttribute("stage",pe-1),this.insertAt(h)}L(this,t,u)}get link(){}get fragment(){}afterBuild(){L(this,s,this.getTitle()),f(this,t).includes("\0")&&L(this,t,this.buildFromStr(f(this,t),0)),this.setAttribute("name",f(this,s).title),super.afterBuild()}setAttribute(r,l){r==="bracket"?L(this,e,l):r==="title"?L(this,s,l):super.setAttribute(r,l)}toString(r){const l=super.toString(r,f(this,t));return f(this,e)?`[[${l}]]`:l}text(){const r=super.text("|");return f(this,e)?`[[${r}]]`:r}getAttribute(r){return r==="title"?f(this,s):super.getAttribute(r)}getGaps(r){return r===0?f(this,t).length:1}lint(r=this.getAbsoluteIndex(),l){{const o=super.lint(r,l),{childNodes:[a,u],type:h}=this,{encoded:d,fragment:g}=f(this,s),{lintConfig:c}=I,{computeEditInfo:p,fix:x}=c,m=new ne(this,r);let v="unknown-page",w=c.getSeverity(v);if(w&&a.childNodes.some(({type:S})=>S==="template")&&o.push(B(a,m,v,"template-in-link",w)),v="url-encoding",w=c.getSeverity(v),w&&d){const S=B(a,m,v,"unnecessary-encoding",w);(p||x)&&(S.fix=hr(S,a)),o.push(S)}if(v="pipe-like",w=c.getSeverity(v,"link"),w&&(h==="link"||h==="category")){const S=u==null?void 0:u.childNodes.findIndex(A=>A.type==="text"&&A.data.includes("|")),y=u==null?void 0:u.childNodes[S];if(y){const A=B(u,m,v,"pipe-in-link",w);if(p){const k=A.startIndex+u.getRelativeIndex(S);A.suggestions=[pr(k,y.data)]}o.push(A)}}if(v="no-ignored",w=c.getSeverity(v,"fragment"),w&&g!==void 0&&!on(h)){const S=B(a,m,v,"useless-fragment",w);if(p||x){const y=a.childNodes.findIndex(k=>k.type==="text"&&k.data.includes("#")),A=a.childNodes[y];A&&(S.fix=G(S,a.getRelativeIndex(y)+A.data.indexOf("#")))}o.push(S)}return o}}getTitle(r,l){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:l,temporary:r,decode:!0,selfLink:!0})}print(){return super.print(f(this,e)?{pre:"[[",post:"]]",sep:f(this,t)}:{sep:f(this,t)})}json(r,l=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i),Gs=se(un),Me=ee(Gs,0,"LinkBaseToken",an,Me),Z(Gs,1,Me)}}),hn,Vs,dn,Te,lt=C({"src/nowiki/base.ts"(){"use strict";qe(),q(),hn=[Ee],Te=class extends(dn=F){get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}},Vs=se(dn),Te=ee(Vs,0,"NowikiBaseToken",hn,Te),Z(Vs,1,Te)}}),cn,Qs,gn,we,At=C({"src/nowiki/noinclude.ts"(){"use strict";W(),it(),O(),lt(),cn=[Ge(!1)],we=class extends(gn=Te){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=M(this,{start:e},s,"useless-attribute",i),{computeEditInfo:o}=t,a=r[1].length+1,u=n.endsWith("/>")?2:1;return l.startIndex+=a,l.startCol+=a,l.endIndex-=u,l.endCol-=u,o&&(l.suggestions=[G(l)]),[l]}}return[]}}},Qs=se(gn),we=ee(Qs,0,"NoincludeToken",cn,we),Z(Qs,1,we)}}),so,iu=C({"src/link/redirectTarget.ts"(){"use strict";W(),O(),Ts(),At(),so=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 we(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=B(this.lastChild,{start:e},s,"useless-link-text",n);r.startIndex--,r.startCol--,(i.computeEditInfo||i.fix)&&(r.fix=G(r)),t.push(r)}return t}}}}}),pn,Js,fn,Pt,ru=C({"src/redirect.ts"(){"use strict";var e,t,s;it(),qe(),q(),rt(),iu(),pn=[Ge(!1,!1),Ee],Pt=(s=class extends(fn=F){constructor(n,r,l,o,a,u,h=[]){super(void 0,u,h);N(this,e);N(this,t);L(this,e,n),L(this,t,a),this.append(new Ve(r,"redirect-syntax",u,h),new so(l,o==null?void 0:o.slice(1),u,h))}get type(){return"redirect"}getAttribute(n){return n==="padding"?f(this,e).length:super.getAttribute(n)}toString(n){return f(this,e)+super.toString(n)+f(this,t)}lint(n=this.getAbsoluteIndex()){{const r=n+f(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",r),this.lastChild.lint(r)}}print(){return super.print({pre:f(this,e),post:f(this,t)})}},e=new WeakMap,t=new WeakMap,s),Js=se(fn),Pt=ee(Js,0,"RedirectToken",pn,Pt),Z(Js,1,Pt)}}),io={};ie(io,{parseRedirect:()=>ro});var ro,nu=C({"parser/redirect.ts"(){"use strict";O(),ru(),ro=(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 Pt(...i.slice(1),t,s),e):!1}}}),mn,Xs,xn,Ot,lu=C({"src/onlyinclude.ts"(){"use strict";Qe(),qe(),q(),mn=[Ee,We("<onlyinclude>")],Ot=class extends(xn=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>'})}},Xs=se(xn),Ot=ee(Xs,0,"OnlyincludeToken",mn,Ot),Z(Xs,1,Ot)}}),Xt,Cs=C({"mixin/gapped.ts"(){"use strict";Xt=(e=1)=>t=>{class s extends t{getGaps(){return e}}return s}}}),vn,Ks,bn,Ye,xr=C({"src/tagPair/index.ts"(){"use strict";var e,t;Cs(),qe(),q(),vn=[Xt(),Ee],Ye=(t=class extends(bn=F){constructor(i,n,r,l,o,a=[]){super(void 0,o);N(this,e);Le(this,"closed");Le(this,"selfClosing");this.setAttribute("name",i.toLowerCase()),L(this,e,[i,l||i]),this.closed=l!=="",this.selfClosing=l===void 0,this.append(n,r);const u=typeof n=="string"?-1:a.indexOf(n);a.splice(u===-1?1/0:u,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(i){const{selfClosing:n,firstChild:r,lastChild:l}=this,[o,a]=f(this,e);return n?`<${o}${r.toString(i)}/>`:`<${o}${r.toString(i)}>${l.toString(i)}${this.closed?`</${a}>`:""}`}text(){const[i,n]=f(this,e);return this.selfClosing?`<${i}${this.firstChild.text()}/>`:`<${i}${super.text(">")}${this.closed?`</${n}>`:""}`}getAttribute(i){return i==="padding"?f(this,e)[0].length+1:super.getAttribute(i)}print(){const[i,n]=f(this,e);return super.print(this.selfClosing?{pre:`<${i}`,post:"/>"}:{pre:`<${i}`,sep:">",post:this.closed?`</${n}>`:""})}},e=new WeakMap,t),Ks=se(bn),Ye=ee(Ks,0,"TagPairToken",vn,Ye),Z(Ks,1,Ye)}}),vr,no=C({"src/tag/index.ts"(){"use strict";var e,t,s,i;W(),Ie(),O(),q(),vr=(i=class extends F{constructor(r,l,o,a,u){super(void 0,a,u);N(this,e);N(this,t);N(this,s);this.insertAt(l),L(this,e,o),L(this,t,r)}get closing(){return f(this,e)}toString(r){return`<${f(this,e)?"/":""}${f(this,t)}${super.toString(r)}${this.selfClosing?"/":""}>`}text(r=""){const{closing:l}=this;return`<${l&&!r?"/":""}${f(this,t)}${l?"":super.text()}${r}>`}getAttribute(r){return r==="padding"?f(this,t).length+(f(this,e)?2:1):super.getAttribute(r)}findMatchingTag(){return Ze(f(this,s),()=>{const{type:r,name:l,parentNode:o,closing:a,selfClosing:u}=this;let h=!1,d=!1;if(r==="html"){const{html:[,v,w]}=this.getAttribute("config");h=w.includes(l),d=v.includes(l)}if(h||d&&u)return this;if(!o)return;const{childNodes:g}=o,c=g.indexOf(this),p=a?g.slice(0,c).reverse():g.slice(c+1),x=[this],{rev:m}=xe;for(const v of p)if(!(!v.is(r)||r==="html"&&(v.name!==l||d&&v.selfClosing)))if(f(v,e)===a){if(r==="tvar")return;x.push(v)}else{const w=x.pop();if(w===this)return v;I.viewOnly&&(L(w,s,[m,v]),L(v,s,[m,w]))}if(I.viewOnly)for(const v of x)L(v,s,[m,void 0])},r=>{L(this,s,r),r[1]&&r[1]!==this&&L(r[1],s,[xe.rev,this])})}print(){return super.print({pre:`<${f(this,e)?"/":""}${f(this,t)}`,post:`${this.selfClosing?"/":""}>`})}json(r,l=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i)}}),yn,Ys,wn,Ue,ou=C({"src/tag/tvar.ts"(){"use strict";it(),no(),rt(),yn=[Ge()],Ue=class extends(wn=vr){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)}},Ys=se(wn),Ue=ee(Ys,0,"TvarToken",yn,Ue),Z(Ys,1,Ue)}}),lo,au=C({"src/tagPair/translate.ts"(){"use strict";var e,oo,s;q(),xr(),rt(),ou(),lo=(s=class extends Ye{constructor(n,r,l,o=[]){const a=new Ve(n,"translate-attr",l,o);r=r==null?void 0:r.replace(/<tvar(\|[^>]+)>([\s\S]*?)<\/>/gu,(h,d,g)=>(new Ue("tvar",d,!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,(h,d,g,c,p,x,m)=>(new Ue(d,g,!1,l,o),new Ue(x,m,!0,l,o),`\0${o.length-2}n${p}\0${o.length}n`));const u=new F(r,l,o);u.type="translate-inner";super("translate",a,u,"translate",l,o);N(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,oo).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,oo=function(){return this.firstChild.toString()===" nowrap"},s)}}),Sn,Zs,An,jt,uu=C({"src/tagPair/include.ts"(){"use strict";W(),he(),it(),O(),xr(),Sn=[Ge(!1)],jt=class extends(An=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:o}=I,{computeEditInfo:a}=o,u=l.map(h=>o.getSeverity(h,"include"));if(u[0]&&s.data.trim()){const h=B(s,r,l[0],"useless-attribute",u[0]);a&&(h.suggestions=[G(h)]),t.push(h)}if(u[1]&&!i){const h=M(this,r,l[1],I.msg("unclosed",`<${n}>`),u[1]);a&&(h.suggestions=[He(h.endIndex,`</${n}>`)]),t.push(h)}return t}}},Zs=se(An),jt=ee(Zs,0,"IncludeToken",Sn,jt),Z(Zs,1,jt)}}),Is,br=C({"mixin/attributesParent.ts"(){"use strict";Is=(e=0)=>t=>{var s,ao;{class n extends t{constructor(){super(...arguments);N(this,s)}hasAttr(o){this.lspError("AttributesParent.hasAttr")}getAttr(o){return P(this,s,ao).call(this).getAttr(o)}}return s=new WeakSet,ao=function(){return this.childNodes[e]},n}}}}),re,ei,ti,It,ss,si,Nt,ii,ri,ni,is,li,oi,ai,ke,uo,ho,co,go,hu=C({"util/sharable.ts"(){"use strict";re=new Set(["align"]),ei=new Set(["cite"]),ti=new Set(["cite","datetime"]),It=new Set(["width"]),ss=new Set(["axis","align","bgcolor","height","width","valign"]),si=new Set([...ss,"abbr","headers","scope","rowspan","colspan"]),Nt=new Set(["type"]),ii=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),ri=new Set(["clear"]),ni=new Set(["bgcolor","align","valign"]),is=new Set(["qid","forcemathmode","type","display"]),li=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),oi=new Set(["weight"]),ai=new Set(["width","height","zoom","latitude","longitude","align","mapstyle","lang","alt","text"]),ke=new Set,uo=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"]),ho={div:re,h1:re,h2:re,h3:re,h4:re,h5:re,h6:re,blockquote:ei,q:ei,p:re,br:ri,pre:It,ins:ti,del:ti,ul:Nt,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...ii,"border"]),caption:re,tr:ni,td:si,th:si,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:re,categorytree:re,combooption:re,math:ke,chem:ke,ce:ke,img:new Set(["alt","src","width","height","loading","srcset"])},co={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:ke,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:oi,choicetemplate:oi,imagemap:ke,inputbox:ke,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:ke,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:ke,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:li,syntaxhighlight:li,templatedata:ke,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:ke,mapframe:new Set([...ai,"frameless"]),maplink:new Set([...ai,"class"]),rss:new Set(["template","templatename","max","highlight","filter","filterout","reverse","date","item-max-length"]),"page-collection":new Set(["lang","name","description","end-date"])},go={table:ii,td:new Set([...ss,"scope"]),th:ss,br:ri,caption:re,div:re,hr:It,h1:re,h2:re,h3:re,h4:re,h5:re,h6:re,li:Nt,p:re,pre:It,tr:ni,ul:Nt}}}),kn,_n,$n,Tn,cs,du=C({"src/attribute.ts"(){"use strict";var e,t,s,i,n,po,er,o;W(),ce(),Be(),hu(),he(),O(),q(),nt(),kn=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,_n=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,$n=new Set(["ext","arg","magic-word","template"]),Tn=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),cs=(o=class extends F{constructor(u,h,d,g="",c,p=[],x=I.getConfig(),m=[]){const v=new Ce(d,"attr-key",x,m);let w;if(d==="title"||h==="img"&&d==="alt")w=new F(c,x,m,{}),w.type="attr-value",w.setAttribute("stage",pe-1);else if(h==="gallery"&&d==="caption"||h==="ref"&&d==="details"||(h==="mapframe"||h==="maplink")&&d==="text"||h==="choose"&&(d==="before"||d==="after")){const S=je(ge({},x),{excludes:[...x.excludes,"heading","html","table","hr","list"]});w=new F(c,S,m,{}),w.type="attr-value",w.setAttribute("stage",1)}else w=new Ce(c,"attr-value",x,m,{});super(void 0,x,m);N(this,n);N(this,e);N(this,t);N(this,s);N(this,i);L(this,e,u),this.append(v,w),L(this,s,g),L(this,i,[...p]),L(this,t,h),this.setAttribute("name",bt(fe(d)))}get type(){return f(this,e)}get tag(){return f(this,t)}get balanced(){return!f(this,s)||f(this,i)[0]===f(this,i)[1]}afterBuild(){f(this,s).includes("\0")&&L(this,s,this.buildFromStr(f(this,s),0)),this.parentNode&&L(this,t,this.parentNode.name),P(this,n,po).call(this),super.afterBuild()}toString(u){const[h="",d=""]=f(this,i);return f(this,s)?super.toString(u,f(this,s)+h)+d:this.firstChild.toString(u)}text(){return f(this,s)?`${super.text(`${f(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var u,h;return f(this,s)?f(this,s).length+((h=(u=f(this,i)[0])==null?void 0:u.length)!=null?h:0):0}lint(u=this.getAbsoluteIndex(),h){var d;{const g=super.lint(u,h),{balanced:c,firstChild:p,lastChild:x,name:m,tag:v}=this,w=new ne(this,u),S=["unclosed-quote","obsolete-attr"],{lintConfig:y}=I,A=S.map($=>y.getSeverity($,m));if(A[0]&&!c){const $=B(x,w,S[0],"unclosed-quotes",A[0]);$.startIndex--,$.startCol--,y.computeEditInfo&&($.suggestions=[He($.endIndex,f(this,i)[0])]),g.push($)}const k=P(this,n,er).call(this,u,w);return k&&g.push(k),A[1]&&((d=go[v])!=null&&d.has(m))&&g.push(B(p,w,S[1],"obsolete-attribute",A[1])),g}}getValue(){return f(this,s)?this.lastChild.text().trim():this.type==="ext-attr"||""}escape(){}getAttribute(u){return u==="invalid"?P(this,n,er).call(this):super.getAttribute(u)}print(){const[u="",h=""]=f(this,i);return f(this,s)?super.print({sep:Gt(f(this,s))+u,post:h}):super.print()}json(u,h=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n=new WeakSet,po=function(){this.setAttribute("name",bt(this.firstChild.text()))},er=function(u,h){const{firstChild:d,lastChild:g,type:c,name:p,tag:x,parentNode:m}=this,v=!g.childNodes.some(({type:_})=>$n.has(_)),w=this.getValue(),S=co[x],y=ho[x],{length:A}=this.toString();let k="illegal-attr",$,b;if({lintConfig:$}=I,{computeEditInfo:b}=$,!(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)&&(x==="meta"||x==="link"||!uo.has(p)))||(p==="itemtype"||p==="itemid"||p==="itemref")&&!(m!=null&&m.hasAttr("itemscope"))){if(u===void 0)return!0;{const _=$.getSeverity(k,"unknown");if(_){const T=B(d,h,k,"illegal-attribute-name",_);return b&&(T.suggestions=[G(u,A)]),T}}}else if(p==="style"&&typeof w=="string"&&kn.test(w)){if(u===void 0)return!0;{k="insecure-style";const _=$.getSeverity(k);return _&&B(g,h,k,"insecure-style",_)}}else if(p==="tabindex"&&typeof w=="string"&&w!=="0"){if(u===void 0)return!0;{const _=$.getSeverity(k,"tabindex");if(_){const T=B(g,h,k,"nonzero-tabindex",_);return b&&(T.suggestions=[G(u,A),$e(T,"0 tabindex","0")]),T}}}else if(typeof w=="string"&&((/^xmlns:[\w:.-]+$/u.test(p)||Tn.has(p))&&_n.test(w)||v&&(p==="href"||x==="img"&&p==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(w))){if(u===void 0)return!0;{const _=$.getSeverity(k,"value");return _&&B(g,h,k,"illegal-attribute-value",_)}}else if(v&&c!=="ext-attr"){const _=Jl(x,p),T=String(w).toLowerCase();if(_.length>0&&_.every(E=>E!==T)){if(u===void 0)return!0;{const E=$.getSeverity(k,"value");return E&&B(g,h,k,"illegal-attribute-value",E)}}}return!1},o)}}),ui,Cn,In,Ns,yr=C({"src/attributes.ts"(){"use strict";var e,t,gs,i;W(),ce(),he(),O(),q(),nt(),du(),ui=n=>n.slice(0,-1),Cn=n=>`${ui(n)}-dirty`,In=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch(n){return/[^\W_]/u}})(),Ns=(i=class extends F{constructor(r,l,o,a,u=[]){super(void 0,a,u,{});N(this,t);N(this,e);if(L(this,e,l),this.setAttribute("name",o),r){const h=/([^\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 d="",g=h.exec(r),c=0;const p=(()=>{d&&(super.insertAt(new Ce(d,Cn(l),a,u,{})),d="")});for(;g;){const{index:x,0:m,1:v,2:w,3:S,4:y,5:A,6:k}=g;if(d+=r.slice(c,x),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(fe(v).trim())){const $=y!=null?y:k,b=[S,A],_=new cs(ui(l),o,v,w,$,b,a,u);p(),super.insertAt(_)}else d+=m;({lastIndex:c}=h),g=h.exec(r)}d+=r.slice(c),p()}}get type(){return f(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 cs&&(!r||l.name===bt(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 o=super.lint(r,l),{parentNode:a,childNodes:u}=this,h=new Map,d=new Set,g=new ne(this,r),c=["no-ignored","no-duplicate"],{lintConfig:p}=I,{computeEditInfo:x,fix:m}=p,v=["closingTag","invalidAttributes","nonWordAttributes"].map(S=>p.getSeverity(c[0],S));if(v[0]&&P(this,t,gs).call(this)){const S=M(this,g,c[0],"attributes-of-closing-tag",v[0]);if(x){const y=a.getAbsoluteIndex();S.suggestions=[G(S),dr(y)]}o.push(S)}for(const S of u)if(S instanceof cs){const{name:y}=S;h.has(y)?(d.add(y),h.get(y).push(S)):h.set(y,[S])}else{const y=S.text().trim(),A=v[In.test(y)?1:2];if(y&&A){const k=B(S,g,c[0],"invalid-attribute",A);x&&(k.suggestions=[G(k,0," ")]),o.push(k)}}const w=p.getSeverity(c[1],"attribute");if(w&&d.size>0)for(const S of d){const y=h.get(S).map(A=>{const k=A.getValue();return[A,k===!0?"":k]});Array.prototype.push.apply(o,y.map(([A,k],$)=>{const b=B(A,g,c[1],I.msg("duplicate-attribute",S),w);if(x||m){const _=G(b);!k||y.slice(0,$).some(([,T])=>T===k)?b.fix=_:x&&(b.suggestions=[_])}return b}))}return o}}escape(){}getAttribute(r){return r==="invalid"?P(this,t,gs).call(this):super.getAttribute(r)}print(){return this.toString()?`<span class="wpb-${this.type}${P(this,t,gs).call(this)?" wpb-invalid":""}">${this.childNodes.map(r=>r.print(r instanceof Ce?{class:r.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,gs=function(){const{parentNode:r}=this;return(r==null?void 0:r.type)==="html"&&r.closing&&this.text().trim()!==""},i)}}),fo={};ie(fo,{PreToken:()=>mo});var mo,cu=C({"src/pre.ts"(){"use strict";Be(),q(),At(),mo=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 o=n.exec(e),a=0,u="";for(;l&&o;)new we(l[0],t,s,!0),new we(o[0],t,s,!0),u+=`${e.slice(a,l.index)}\0${s.length-1}n${e.slice(l.index+r,o.index)}\0${s.length}n`,a=o.index+r+1,i.lastIndex=a,l=i.exec(e),l&&(n.lastIndex=l.index+r),o=n.exec(e);e=u+e.slice(a)}super(e,t,s,{}),this.setAttribute("stage",pe-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),Ls,wr=C({"src/multiLine/index.ts"(){"use strict";q(),Ls=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
|
-
`})}}}}),xo,gu=C({"src/paramLine.ts"(){"use strict";q(),xo=class extends F{get type(){return"param-line"}}}}),vo={};ie(vo,{ParamTagToken:()=>Sr});var Sr,bo=C({"src/multiLine/paramTag.ts"(){"use strict";W(),he(),Fs(),O(),wr(),gu(),Sr=class extends Ls{constructor(e,t,s=I.getConfig(),i=[],n){super(void 0,s,i,{}),t&&this.safeAppend(t.split(`
|
|
10
|
-
`).map(r=>n?r:Kt(r,s,i,e)).map(r=>new xo(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 o of this.childNodes){o.setAttribute("aIndex",e);const a=o.childNodes.filter(({type:u})=>u!=="comment"&&u!=="include"&&u!=="noinclude");if(a.some(({type:u})=>u==="ext"))l.push(B(o,n,t,r,i));else{const u=a.findIndex(({type:d})=>d!=="text"),h=a.slice(0,u===-1?void 0:u).map(String).join("");if(h&&!(u===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(h)){const d=B(o,n,t,r,i);s.computeEditInfo&&(d.suggestions=[G(d)]),l.push(d)}else{const d=o.lint(e,!1);d.length>0&&Array.prototype.push.apply(l,d)}}e+=o.toString().length+1}return l}}}}}),Nn,hi,Ln,ut,yo=C({"src/heading.ts"(){"use strict";var e,t,ps,i;W(),Ie(),he(),qe(),O(),q(),rt(),Nn=[Ee],ut=(i=class extends(Ln=F){constructor(r,l,o,a=[]){super(void 0,o,a);N(this,t);N(this,e);L(this,e,r);const u=new F(l[0],o,a);u.type="heading-title",u.setAttribute("stage",2);const h=new Ve(l[1],"heading-trail",o,a);this.append(u,h)}get type(){return"heading"}get level(){return f(this,e)}toString(r){const l=P(this,t,ps).call(this);return l+this.firstChild.toString(r)+l+this.lastChild.toString(r)}text(){const r=P(this,t,ps).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 o=super.lint(r,l),{firstChild:a,level:u}=this,h=a.toString(),d=h.startsWith("="),g=d||h.endsWith("="),c=new ne(this,r),p=this.inHtmlAttrs(),x=["h1","unbalanced-header","format-leakage"],{lintConfig:m}=I,{computeEditInfo:v,fix:w}=m,S=x.map(y=>m.getSeverity(y,"apostrophe"));if(S[0]&&this.level===1){const y=B(a,c,x[0],"<h1>",S[0]);v&&!g&&(y.suggestions=[$e(y,"h2",`=${h}=`)]),o.push(y)}if(S[1]&&g){const y=I.msg("unbalanced-in-section-header",'"="'),A=B(a,c,x[1],y,S[1]);if(!(!v||h==="="))if(d){const[k]=/^=+/u.exec(h),$=u+k.length;A.suggestions=[{desc:`h${u}`,range:[A.startIndex,A.startIndex+k.length],text:""}],$<7&&A.suggestions.push({desc:`h${$}`,range:[A.endIndex,A.endIndex],text:k})}else{const k=/[^=](=+)$/u.exec(h)[1],$=u+k.length;A.suggestions=[{desc:`h${u}`,range:[A.endIndex-k.length,A.endIndex],text:""}],$<7&&A.suggestions.push({desc:`h${$}`,range:[A.startIndex,A.startIndex],text:k})}o.push(A)}if(p){const y="parsing-order",A=m.getSeverity(y,p===2?"heading":"templateInTable");A&&o.push(M(this,c,y,"header-in-html",A))}if(S[2]){const y=this.getRootNode().toString(),A=a.childNodes.filter(Rs("quote")),k=A.filter(({bold:b})=>b),$=A.filter(({italic:b})=>b);if(k.length%2){const b=B(k[k.length-1],je(ge({},c),{start:r+u,left:c.left+u}),x[2],I.msg("unbalanced-in-section-header","bold-apostrophes"),S[2]);if(v||w){const _=r+u+h.length,T=G(b);y.slice(b.endIndex,_).trim()?v&&(b.suggestions=[T,He(_,"'''")]):k.length===1&&$.length===0?b.fix=T:v&&(b.suggestions=[T])}o.push(b)}if($.length%2){const b=B($[$.length-1],{start:r+u},x[2],I.msg("unbalanced-in-section-header","italic-apostrophes"),S[2]);if(v||w){const _=r+u+h.length;y.slice(b.endIndex,_).trim()?v&&(b.suggestions=[He(_,"''")]):$.length===1&&k.length===0?b.fix=G(b):v&&(b.suggestions=[G(b)])}o.push(b)}}return o}}print(){const r=P(this,t,ps).call(this);return super.print({pre:r,sep:r})}json(r,l=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakSet,ps=function(){return"=".repeat(this.level)},i),hi=se(Ln),ut=ee(hi,0,"HeadingToken",Nn,ut),Z(hi,1,ut)}}),En,wo,pu=C({"src/parameter.ts"(){"use strict";ce(),W(),O(),q(),En=new RegExp(`https?://${xt}${vt}$`,"iu"),wo=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:o}=this,a=(s=En.exec(o.text()))==null?void 0:s[0];try{if(a&&new URL(a).search){const u=B(o,{start:e},n,"unescaped-query",l);u.startIndex=u.endIndex,u.startLine=u.endLine,u.startCol=u.endCol,u.endIndex++,u.endCol++,(r.computeEditInfo||r.fix)&&(u.fix=wt(u.startIndex,"{{=}}")),i.push(u)}}catch(u){}}return i}}print(){return super.print({sep:this.anon?"":"="})}json(e,t=this.getAbsoluteIndex()){}}}}),Fn,di,Rn,ht,fu=C({"src/transclude.ts"(){"use strict";var e,t,s,i,n,r,fs,So,a;ce(),W(),Ie(),he(),Cs(),qe(),O(),q(),pu(),nt(),rt(),Fn=[Ee,Xt()],ht=(a=class extends(Rn=F){constructor(h,d,g,c=[]){var T,E;let p;const x=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(h);x&&(p=Number(x[1]),h=h.replace(`\0${p}h`,c[p].toString().replace(/^\n/u,"")));super(void 0,g,c,{});N(this,r);Le(this,"modifier","");N(this,e,"template");N(this,t,":");N(this,s,!1);N(this,i,new Map);N(this,n);const{parserFunction:[m,v],variable:w,functionHook:S}=g,y=(T=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(h))==null?void 0:T[0];if(y)this.setAttribute("modifier",y),h=h.slice(y.length);else if(h.includes(":")){const[R,...z]=h.split(":"),[j]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((E=z[0])!=null?E:"");this.setModifier(`${R}:${j}`)&&(h=z.join(":").slice(j.length))}const A=h.search(/[::]/u),k=h[A]===":",$=A!==-1;if($||d.length===0&&!f(this,s)){const R=$?h.slice(0,A):h,z=$&&h.slice(A+1),j=fe(R),X=$?j.slice(j.search(/\S/u))+(k?":":""):j.trim(),ae=X.toLowerCase(),Q=Array.isArray(v),U=Q?v.includes(X):Object.prototype.hasOwnProperty.call(v,X),D=!Q&&U?v[X]:Object.prototype.hasOwnProperty.call(m,ae)&&m[ae],Se=Q&&U||!("functionHook"in g)||S.includes(D),Fe=Q&&U||w.includes(D);if($?D&&Se:Fe){this.setAttribute("name",D||ae.replace(/^#|:$/u,"")),L(this,e,"magic-word"),k&&L(this,t,":");const V=new Ve(R,"magic-word-name",g,c);if(super.insertAt(V),z!==!1&&d.unshift([z]),this.name==="invoke")for(let Y=0;Y<2;Y++){const J=d.shift();if(!J)break;const te=new Ce(J.join("="),`invoke-${Y?"function":"module"}`,g,c);super.insertAt(te)}}}if(this.type==="template"){const R=fe(h).trim();if(!this.normalizeTitle(R,10,{halfParsed:!0,temporary:!0}).valid)throw c.pop(),new SyntaxError("Invalid template name");const z=new Ce(h,"template-name",g,c,{});super.insertAt(z)}typeof p=="number"&&(c[p]=void 0);const b=this.isTemplate();let _=1;for(let R=0;R<d.length;R++){const z=d[R];b||this.name==="switch"&&R>0||this.name==="tag"&&R>1||(z[0]=z.join("="),z.length=1),z.length===1&&(z.unshift(_),_++),this.insertAt(new wo(...z,g,c))}this.seal("modifier")}get type(){return f(this,e)}get module(){}get function(){}setModifier(h){const{parserFunction:[,,d,g]}=this.getAttribute("config"),c=fe(h).trim();if(h&&!c.endsWith(":"))return!1;const p=c.slice(0,-1).toLowerCase(),x=d.includes(p),m=g.includes(p);return(f(this,s)?x:m||!h)||(xe.running||this.length>1)&&(x||m||!h)?(this.setAttribute("modifier",h),L(this,s,x),!!h):!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"&&(L(this,n,P(this,r,fs).call(this)),this.setAttribute("name",f(this,n).title))}toString(h){const{childNodes:d,length:g,firstChild:c,modifier:p,type:x}=this;return`{{${p}${x==="magic-word"?c.toString(h)+(g===1?"":f(this,t))+d.slice(1).map(m=>m.toString(h)).join("|"):super.toString(h,"|")}}}`}text(){const{childNodes:h,length:d,firstChild:g,modifier:c,type:p,name:x}=this;return p==="magic-word"&&x==="vardefine"?"":`{{${c}${p==="magic-word"?g.text()+(d===1?"":f(this,t))+tt(h.slice(1),"|"):super.text("|")}}}`}getAttribute(h){switch(h){case"padding":return this.modifier.length+2;case"title":return f(this,n);case"colon":return f(this,t);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!P(this,r,fs).call(this).valid);default:return super.getAttribute(h)}}lint(h=this.getAbsoluteIndex(),d){{const g=super.lint(h,d);if(!this.isTemplate())return g;const{type:c,childNodes:p,length:x}=this,m=new ne(this,h),{lintConfig:v}=I,{computeEditInfo:w}=v,S=c==="magic-word";let y="no-ignored",A=v.getSeverity(y,"fragment");if(S&&!P(this,r,fs).call(this).valid)y="invalid-invoke",A=v.getSeverity(y,"name"),A&&g.push(B(p[1],m,y,"illegal-module",A));else if(A){const k=p[S?1:0],$=k.childNodes.findIndex(_=>_.type==="text"&&ys(_.data).includes("#")),b=k.childNodes[$];if(b){const _=B(k,m,y,"useless-fragment",A);w&&(_.suggestions=[G(_,k.getRelativeIndex($)+b.data.indexOf("#"))]),g.push(_)}}if(y="invalid-invoke",A=v.getSeverity(y,"function"),A&&S&&x===2)return g.push(M(this,m,y,"missing-function",A)),g;if(y="no-duplicate",A=v.getSeverity(y,"parameter"),A){const k=this.getDuplicatedArgs().filter(([,b])=>!b[0].querySelector("ext")),$="duplicate-parameter";for(const[,b]of k)Array.prototype.push.apply(g,b.map(_=>{const T=B(_,m,y,$,A);return w&&(T.suggestions=[G(T,-1)]),T}))}return g}}insertAt(h,d=this.length){return super.insertAt(h,d),h.anon?P(this,r,So).call(this,h):h.name&&this.getArgs(h.name,!1,!1).add(h),h}getAllArgs(){return this.childNodes.filter(Rs("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:h})=>h)}getArgs(h,d,g=!0){const c=String(h).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");let p;return f(this,i).has(c)?p=f(this,i).get(c):(p=new Set(this.getAllArgs().filter(({name:x})=>c===x)),f(this,i).set(c,p)),p}getDuplicatedArgs(){return[...f(this,i)].filter(([,{size:h}])=>h>1).map(([h,d])=>[h,[...d]])}getPossibleValues(){const{type:h,name:d,childNodes:g}=this;if(h==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let c,p;switch(d){case"if":case"ifexist":case"ifexpr":case"iferror":c=2;break;case"ifeq":c=3;break;case"switch":{const x=g.slice(2),m=x[x.length-1];p=[...x.filter(({anon:v})=>!v),...m!=null&&m.anon?[m]:[]].map(({lastChild:v})=>v);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}p!=null||(p=g.slice(c,c+2).map(({lastChild:x})=>x));for(let x=0;x<p.length;){const{length:m,0:v}=p[x].childNodes.filter(w=>w.text().trim());if(m===0)p.splice(x,1);else if(m>1||v.type!=="magic-word")x++;else try{const w=v.getPossibleValues();Array.prototype.splice.apply(p,[x,1,...w]),x+=w.length}catch(w){x++}}return p}print(){const{childNodes:h,length:d,firstChild:g,modifier:c,type:p}=this;return`<span class="wpb-${p}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${p==="magic-word"?Gt(c)+g.print()+(d===1?"":f(this,t))+yt(h.slice(1),{sep:"|"}):(c?`<span class="wpb-magic-word">${Gt(c)}</span>`:"")+yt(h,{sep:"|"})}}}</span>`}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakSet,fs=function(){const h=this.type==="template";return this.normalizeTitle((h?"":"Module:")+this.childNodes[h?0:1].text(),10,ge({temporary:!0},!h&&{page:""}))},So=function(h){const d=this.getAnonArgs(),g=typeof h!="number";for(let c=g?d.indexOf(h):h-1;c<d.length;c++){const p=d[c],{name:x}=p,m=String(c+1);(x!==m||p===h)&&(p.setAttribute("name",m),this.getArgs(m,!1,!1).add(p))}},a),di=se(Rn),ht=ee(di,0,"TranscludeToken",Fn,ht),Z(di,1,ht)}}),Pn,ci,On,Bt,mu=C({"src/hidden.ts"(){"use strict";it(),q(),Pn=[Ge()],Bt=class extends(On=F){get type(){return"hidden"}getAttribute(e){return e==="invalid"||super.getAttribute(e)}},ci=se(On),Bt=ee(ci,0,"HiddenToken",Pn,Bt),Z(ci,1,Bt)}}),jn,gi,Bn,qt,xu=C({"src/arg.ts"(){"use strict";var e,vu,s;ce(),W(),he(),Qe(),Cs(),qe(),O(),q(),nt(),mu(),jn=[Ee,We("{{{"),Xt()],qt=(s=class extends(Bn=F){constructor(n,r,l=[]){super(void 0,r,l,{});N(this,e);for(let o=0;o<n.length;o++){const a=n[o];if(o===0){const u=new Ce(a,"arg-name",r,l,{});super.insertAt(u)}else if(o>1){const u=new Bt(a,r,l);super.insertAt(u)}else{const u=new F(a,r,l);u.type="arg-default",u.setAttribute("stage",2),super.insertAt(u)}}}get type(){return"arg"}get default(){}toString(n){return`{{{${super.toString(n,"|")}}}}`}text(){return`{{{${tt(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){super.afterBuild()}lint(n=this.getAbsoluteIndex(),r){{const{childNodes:[l,o,...a]}=this;l.setAttribute("aIndex",n+3);const u=l.lint(n+3,r);if(o){const x=n+4+l.toString().length;o.setAttribute("aIndex",x);const m=o.lint(x,r);m.length>0&&Array.prototype.push.apply(u,m)}const h=["no-ignored","no-arg"],{lintConfig:d}=I,{computeEditInfo:g}=d,c=new ne(this,n),p=h.map(x=>d.getSeverity(x,"arg"));if(p[0]&&a.length>0&&Array.prototype.push.apply(u,a.map(x=>{const m=B(x,c,h[0],"invisible-triple-braces",p[0]);return m.startIndex--,m.startCol--,g&&(m.suggestions=[G(m),wt(m.startIndex,"{{!}}")]),m})),p[1]&&!this.getAttribute("include")){const x=M(this,c,h[1],"unexpected-argument",p[1]);g&&o&&(x.suggestions=[$e(x,"expand",o.text())]),u.push(x)}return u}}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(n,r=this.getAbsoluteIndex()){}},e=new WeakSet,vu=function(){},s),gi=se(Bn),qt=ee(gi,0,"ArgToken",jn,qt),Z(gi,1,qt)}}),Ao={};ie(Ao,{parseBraces:()=>Es});var qn,pi,rs,fi,mi,xi,Wn,vi,Es,Ar=C({"parser/braces.ts"(){"use strict";st(),ce(),yo(),fu(),xu(),qn={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},pi=String.raw`\[(?!\[)`,rs=String.raw`\n(?![=\0])`,fi=String.raw`|\{{2,}`,mi=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),xi=mt(e=>new RegExp(e,"gmu")),Wn=new RegExp(String.raw`\{\{((?:[^\n{}[]|${pi}|${rs})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${rs})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${pi}|${rs})*\}-`,"gu"),vi=e=>{const t=bt(fe(e));return mi.has(t)?mi.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},Es=(e,t,s)=>{var p,x,m,v,w;const i=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,n]}=t,r=[],l=[],o=(S,y,A,k)=>{y[y.length-1].push(ye(S.slice(A,k),l))};let a;do a!==void 0&&(e=a),a=e.replace(Wn,(S,y,A)=>{if(y!==void 0||typeof A=="string")try{const{length:k}=s,$=(y!=null?y:A).split("|");return new ht(ye($[0],l),$.slice(1).map(b=>{const _=b.indexOf("=");return(_===-1?[b]:[b.slice(0,_),b.slice(_+1)]).map(T=>ye(T,l))}),t,s),`\0${k}${vi($[0])}`}catch(k){if(!(k instanceof SyntaxError)||k.message!=="Invalid template name")throw k}return l.push(ye(S,l)),`\0${l.length-1}`});while(a!==e);e=a;const u=e.lastIndexOf("}}")-e.length;let h=u+e.length!==-1,d=xi(i+(h?fi:"")),g=d.exec(e),c;for(;g||c!==void 0&&c<=e.length&&((x=(p=r[r.length-1])==null?void 0:p[0])!=null&&x.startsWith("="));){if(g!=null&&g[1]){const[,{length:z}]=g;g[0]=g[0].slice(z),g.index+=z}const{0:S,index:y}=g!=null?g:{0:`
|
|
11
|
-
|
|
12
|
-
`){c=y+1;const{pos:
|
|
13
|
-
|
|
14
|
-
)
|
|
15
|
-
`))!=null?a:[]){const h=/^([^|]+)(?:\|(.*))?/u.exec(u);if(!h){super.insertAt(u.trim()?new Ss(u,l,o):u);continue}const[,d,g]=h;P(this,e,Oo).call(this,d)?super.insertAt(new dt("gallery",d,g,l,o)):super.insertAt(new Ss(u,l,o))}}get widths(){}get heights(){}lint(r=this.getAbsoluteIndex(),l){{const{top:o,left:a}=this.getRootNode().posFromIndex(r),u=[],h="no-ignored",{lintConfig:d}=I,g=["Image","NoImage","Comment"].map(c=>d.getSeverity(h,`gallery${c}`));for(let c=0;c<this.length;c++){const p=this.childNodes[c],x=p.toString(),{length:m}=x,v=x.trim(),{type:w}=p,S=o+c,y=c?0:a;if(p.setAttribute("aIndex",r),w==="noinclude"&&v&&!/^<!--.*-->$/u.test(v)){let[A]=g;if(v.startsWith("|")?[,A]=g:(v.startsWith("<!--")||v.endsWith("-->"))&&([,,A]=g),A){const k=r+m,$={rule:h,message:I.msg("invalid-content","gallery"),severity:A,startIndex:r,endIndex:k,startLine:S,endLine:S,startCol:y,endCol:y+m};d.computeEditInfo&&($.suggestions=[G($),cr($,x)]),u.push($)}}else if(w!=="noinclude"&&w!=="text"){const A=p.lint(r,l);A.length>0&&Array.prototype.push.apply(u,A)}r+=m+1}return u}}json(r,l=this.getAbsoluteIndex()){}},e=new WeakSet,Oo=function(r){return this.normalizeTitle(r,6,{halfParsed:!0,temporary:!0,decode:!0,page:""}).valid},Su=function(r){},i)}}),_r,jo=C({"src/link/index.ts"(){"use strict";st(),W(),O(),Ts(),_r=class extends Me{get type(){return"link"}get innerText(){return this.length>1?this.lastChild.text():Vt(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.closest("ext-link-text")){const l=M(this,{start:e},i,"link-in-extlink",r);(n.computeEditInfo||n.fix)&&(l.fix=$e(l,"delink",this.innerText)),s.push(l)}return s}}}}}),Yn,Zn,Jt,$r=C({"src/magicLink.ts"(){"use strict";var e,t,sr,i;W(),ce(),he(),O(),q(),Yn=String.raw`(?:[${De}\t]| |�*160;|&#[xX]0*[aA]0;)`,Zn=new RegExp(`${Yn}+`,"gu"),Jt=(i=class extends F{constructor(r,l="free-ext-link",o=I.getConfig(),a){super(r,o,a,{});N(this,t);N(this,e);L(this,e,l)}get type(){return f(this,e)}get innerText(){const r=new Map([["!","|"],["=","="]]);let l=tt(this.childNodes.map(o=>{const{type:a}=o,u=String(o.name);return a==="magic-word"&&r.has(u)?r.get(u):o}));return this.type==="magic-link"&&(l=l.replace(Zn," ")),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:Vl(r).replace(/\n/gu,"%0A")}lint(r=this.getAbsoluteIndex(),l){{const o=super.lint(r,l),a=new ne(this,r),{lintConfig:u}=I,{type:h,childNodes:d}=this;if(h==="magic-link"){const x="invalid-isbn",m=u.getSeverity(x);return m&&P(this,t,sr).call(this)&&o.push(M(this,a,x,"invalid-isbn",m)),o}let g="invalid-url",c=u.getSeverity(g);if(c&&!this.querySelector("magic-word"))try{this.getUrl()}catch(x){o.push(M(this,a,g,"invalid-url",c))}const p=h==="ext-link-url";if(g="unterminated-url",c=u.getSeverity(g,p?"pipe":"punctuation"),c){const x=p?/\|/u:/[,;。:!?()]+/u,m=d.find(v=>v.type==="text"&&x.test(v.data));if(m){const{data:v}=m,w=B(m,a,g,I.msg("in-url",p?'"|"':"full-width-punctuation"),c);if(u.computeEditInfo){const{index:S,0:y}=x.exec(v),A=w.startIndex+S;w.suggestions=p?[Qt(A,1)]:[Qt(A),{desc:I.msg("encode"),range:[A,A+y.length],text:encodeURI(y)}]}o.push(w)}}return o}}getUrl(r){this.lspError("MagicLinkToken.getUrl")}getAttribute(r){return r==="invalid"?P(this,t,sr).call(this):super.getAttribute(r)}},e=new WeakMap,t=new WeakSet,sr=function(){if(this.type==="magic-link"){const{link:r}=this;if(r.startsWith("ISBN")){const l=[...r.slice(5)].map(o=>o==="X"?10:Number(o));return l.length===10?l.reduce((o,a,u)=>o+a*(10-u),0)%11!==0:l.length===13&&(l[12]===10||l.reduce((o,a,u)=>o+a*(u%2?3:1),0)%10!==0)}}return!1},i)}}),el,_i,tl,ct,Bo=C({"src/extLink.ts"(){"use strict";var e,t;Be(),W(),Qe(),O(),q(),$r(),el=[We("[")],ct=(t=class extends(tl=F){constructor(i,n="",r="",l,o=[]){super(void 0,l,o,{});N(this,e);const a=i&&/^\0\d+f\x7F$/u.test(i)?o[Number(i.slice(1,-2))]:new Jt(i,"ext-link-url",l,o);if(this.insertAt(a),L(this,e,n),r){const u=new F(r,l,o,{});u.type="ext-link-text",u.setAttribute("stage",pe-1),this.insertAt(u)}}get type(){return"ext-link"}toString(i){return this.length===1?`[${super.toString(i)}${f(this,e)}]`:`[${super.toString(i,f(this,e))}]`}text(){return`[${super.text(" ")}]`}getGaps(){return f(this,e).length}lint(i=this.getAbsoluteIndex(),n){{const r=super.lint(i,n),l="var-anchor",o=I.lintConfig.getSeverity(l,"extLink");return o&&this.length===1&&this.closest("heading-title")&&r.push(M(this,{start:i},l,"variable-anchor",o)),r}}print(){return super.print(this.length===1?{pre:"[",post:`${f(this,e)}]`}:{pre:"[",sep:f(this,e),post:"]"})}},e=new WeakMap,t),_i=se(tl),ct=ee(_i,0,"ExtLinkToken",el,ct),Z(_i,1,ct)}}),ir,Au=C({"src/imagemapLink.ts"(){"use strict";q(),At(),jo(),Bo(),ir=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 _r(...t,i,n):new ct(...t,i,n),new we(s,i,n))}}}}),qo={};ie(qo,{ImagemapToken:()=>Wo});var Wo,ku=C({"src/multiLine/imagemap.ts"(){"use strict";W(),Ie(),he(),O(),wr(),Fo(),Eo(),Au(),Wo=class extends Ls{get image(){return this.childNodes.find(Rs("imagemap-image"))}constructor(e,t=I.getConfig(),s=[]){if(super(void 0,t,s,{}),!e)return;const i=e.split(`
|
|
16
|
-
`),n=new Set(t.protocol.split("|"));let r=!0,l=!1;for(const o of i){const a=o.trim();if(!(l||!a||a.startsWith("#"))){if(r){const u=o.indexOf("|"),h=u===-1?o:o.slice(0,u),{valid:d,ns:g}=this.normalizeTitle(h,0,{halfParsed:!0,temporary:!0,page:""});if(d&&g===6){const c=new dt("imagemap",h,u===-1?void 0:o.slice(u+1),t,s);super.insertAt(c),r=!1;continue}else l=!0}else if(o.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(o);continue}else if(o.includes("[")){const u=o.indexOf("["),h=o.slice(u),d=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(h);if(d){if(this.normalizeTitle(d[1],0,{halfParsed:!0,temporary:!0,selfLink:!0,page:""}).valid){super.insertAt(new ir(o.slice(0,u),d.slice(1),h.slice(h.indexOf("]]")+2),t,s));continue}}else if(h.startsWith("[//")||n.has(h.slice(1,h.indexOf(":")+1))||n.has(h.slice(1,h.indexOf("//")+2))){const g=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(h);if(g){super.insertAt(new ir(o.slice(0,u),g.slice(1),h.slice(h.indexOf("]")+1),t,s));continue}}}}super.insertAt(new Ss(o,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:o}=I,a=o.getSeverity(l,r?"link":"image");return a&&(r?Array.prototype.push.apply(s,n.filter(u=>{const h=u.toString().trim();return u.is("noinclude")&&h&&!h.startsWith("#")}).map(u=>{const h=B(u,i,l,"invalid-imagemap-link",a);return o.computeEditInfo&&(h.suggestions=[G(h,-1),$e(h,"comment","# ")]),h})):s.push(M(this,i,l,"imagemap-without-image",a))),s}}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}}}}),sl,$i,il,gt,zo=C({"src/nowiki/comment.ts"(){"use strict";W(),it(),Qe(),O(),lt(),sl=[Ge(!1),We("<!--")],gt=class extends(il=Te){constructor(t,s,i,n){super(t,i,n);Le(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=M(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?"-->":""})}},$i=se(il),gt=ee($i,0,"CommentToken",sl,gt),Z($i,1,gt)}}),Mo={};ie(Mo,{CommentedToken:()=>Uo});var Uo,_u=C({"src/commented.ts"(){"use strict";q(),zo(),Uo=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 gt(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"))}}}}),Do={};ie(Do,{NowikiToken:()=>Ho});var rl,nl,Ho,$u=C({"src/nowiki/index.ts"(){"use strict";var e,rr,s;st(),W(),O(),lt(),rl=mt(i=>new RegExp(String.raw`<\s*(?:/\s*)${i==="nowiki"?"":"?"}(${i})\b`,"giu")),nl=new Set(["languages","section","templatestyles"]),Ho=(s=class extends Te{constructor(){super(...arguments);N(this,e)}get type(){return"ext-inner"}lint(n=this.getAbsoluteIndex()){{const{name:r}=this,{lintConfig:l}=I;let o="void-ext",a=l.getSeverity(o,r);if(a&&P(this,e,rr).call(this)){const h=M(this,{start:n},o,I.msg("nothing-in",r),a);return l.computeEditInfo&&(h.suggestions=[G(h)]),[h]}return super.lint(n,rl(r))}}getAttribute(n){return n==="invalid"?P(this,e,rr).call(this):super.getAttribute(n)}},e=new WeakSet,rr=function(){const{name:n,firstChild:{data:r}}=this;return nl.has(n)&&!!r},s)}}),ll,Ti,ol,pt,Go=C({"src/tagPair/ext.ts"(){"use strict";W(),he(),O(),br(),q(),xr(),yr(),ll=[Is()],pt=class extends(ol=Ye){get type(){return"ext"}constructor(e,t,s,i,n=I.getConfig(),r=!1,l=[]){const o=e.toLowerCase(),a=new Ns(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",o,n,l),u=je(ge({},n),{ext:n.ext.filter(d=>d!==o),excludes:[...n.excludes],inExt:!0});let h;switch(o){case"tab":u.ext=u.ext.filter(d=>d!=="tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":o==="poem"&&u.excludes.push("heading"),h=new F(s,u,l);break;case"pre":{const{PreToken:d}=(cu(),K(fo));h=new d(s,u,l);break}case"dynamicpagelist":{const{ParamTagToken:d}=(bo(),K(vo));h=new d(r,s,u,l);break}case"inputbox":{const{InputboxToken:d}=(bu(),K(ko));h=new d(r,s,u,l);break}case"references":{const{NestedToken:d}=(bi(),K(ms));u.excludes.push("heading"),h=new d(s,r,["ref"],u,l);break}case"choose":{const{NestedToken:d}=(bi(),K(ms));h=new d(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],u,l);break}case"combobox":{const{NestedToken:d}=(bi(),K(ms));h=new d(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],u,l);break}case"gallery":{const{GalleryToken:d}=(wu(),K(Ro));h=new d(s,u,l);break}case"imagemap":{const{ImagemapToken:d}=(ku(),K(qo));h=new d(s,u,l);break}case"hiero":{const{CommentedToken:d}=(_u(),K(Mo));h=new d(s,u,l);break}default:{const{NowikiToken:d}=($u(),K(Do));h=new d(s,u,l)}}h.setAttribute("name",o),h.type==="plain"&&(h.type="ext-inner"),super(e,a,h,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",o=r&&i.getSeverity(l,r===2?"ext":"templateInTable");o&&s.push(M(this,n,l,"ext-in-html",o))}if(this.name==="ref"){let r="var-anchor",l=i.getSeverity(r,"ref");l&&this.closest("heading-title")&&s.push(M(this,n,r,"variable-anchor",l)),r="nested-link",l=i.getSeverity(r,"ref"),l&&this.closest("link,ext-link-text")&&s.push(M(this,n,r,"ref-in-link",l))}return s}}},Ti=se(ol),pt=ee(Ti,0,"ExtToken",ll,pt),Z(Ti,1,pt)}}),Vo={};ie(Vo,{parseCommentAndExt:()=>Kt});var Ci,al,ns,ul,Ii,Kt,Fs=C({"parser/commentAndExt.ts"(){"use strict";st(),ce(),lu(),At(),au(),uu(),Go(),zo(),Ci="<onlyinclude>",al="</onlyinclude>",{length:ns}=Ci,ul=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",s=e?"noinclude":"includeonly";return mt(i=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${i})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(${"\\1"}\s*)>)|<(${s})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${s}\s*)>|$))`,"giu"))}),Ii=e=>{const t=e.indexOf(Ci);return{i:t,j:e.indexOf(al,t+ns)}},Kt=(e,t,s,i)=>{if(i){let{i:a,j:u}=Ii(e);if(a!==-1&&u!==-1){let h="";const d=g=>{new we(g,t,s),h+=`\0${s.length-1}n`};for(;a!==-1&&u!==-1;){const g=`\0${s.length}e`;new Ot(e.slice(a+ns,u),t,s),a>0&&d(e.slice(0,a)),h+=g,e=e.slice(u+ns+1),{i:a,j:u}=Ii(e)}return e&&d(e),h}}const{ext:n}=t;let r=n,l=t;if(n.includes("translate")){r=n.filter(u=>u!=="translate"&&u!=="tvar"),l=je(ge({},t),{ext:r});const a=[];e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,u=>(a.push(u),`\0${a.length-1}`)).replace(/<translate( nowrap)?>([\s\S]*?)<\/translate>/gu,(u,h,d)=>{const g=s.length;return new lo(h,d&&ye(d,a),l,s),`\0${g}g`}),e=ye(e,a)}const o=ul[i?1:0](r.join("|"));return o.lastIndex=0,o.test(e)?e.replace(o,(a,u,h,d,g,c,p,x,m)=>{const v=s.length;let w="n";if(u)w="e",new pt(u,h,d,g,l,c,s);else if(a.startsWith("<!--")){w="c";const S=a.endsWith("-->");new gt(ye(a,s,1).slice(4,S?-3:void 0),S,t,s)}else c?new jt(c,p&&ye(p,s,1),x&&ye(x,s,1),m,t,s):new we(a,t,s,!0);return`\0${v}${w}`}):e}}}),hl,dl,cl,gl,Ni,pl,Wt,Tu=C({"src/tag/html.ts"(){"use strict";var e,t;W(),he(),br(),O(),no(),hl=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),dl=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"]),cl=new Set(["strike","big","center","font","tt"]),gl=[Is()],Wt=(t=class extends(pl=vr){constructor(i,n,r,l,o,a){super(i,n,r,o,a);N(this,e);this.setAttribute("name",i.toLowerCase()),L(this,e,l)}get type(){return"html"}get selfClosing(){return f(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){var r;{const l=super.lint(i,n),{name:o,parentNode:a,closing:u,selfClosing:h}=this,d=new ne(this,i),{lintConfig:g}=I,{computeEditInfo:c,fix:p}=g,x=this.inTableAttrs();let m="h1",v=g.getSeverity(m,"html");if(v&&o==="h1"&&!u){const $=M(this,d,m,"<h1>",v);c&&($.suggestions=[{desc:"h2",range:[i+2,i+3],text:"2"}]),l.push($)}if(m="parsing-order",v=x&&g.getSeverity(m,x===2?"html":"templateInTable"),v){const $=M(this,d,m,"html-in-table",v);c&&x===2&&($.suggestions=[G($)]),l.push($)}if(m="obsolete-tag",v=g.getSeverity(m,o),v&&cl.has(o)&&l.push(M(this,d,m,"obsolete-tag",v)),m="bold-header",v=g.getSeverity(m,o),v&&(o==="b"||o==="strong")&&((r=this.closest("heading-title,ext"))==null?void 0:r.type)==="heading-title"){const $=M(this,d,m,"bold-in-header",v);c&&($.suggestions=[G($)]),l.push($)}const{html:[,w,S]}=this.getAttribute("config"),y=S.includes(o),A=w.includes(o),k=!y&&!A;if(m="unmatched-tag",u&&(h||y)||h&&k){if(v=g.getSeverity(m,u?"both":"selfClosing"),v){const $=M(this,d,m,u?"closing-and-self-closing":"invalid-self-closing",v);if(c||p){const b=dr(i),_={desc:I.msg("no-self-closing"),range:[$.endIndex-2,$.endIndex-1],text:""};A?c&&($.suggestions=[b,_]):u?$.fix=y?b:_:c&&($.suggestions=[_,He($.endIndex,`></${o}>`,-2)])}l.push($)}}else if(!this.findMatchingTag()){const $=M(this,d,m,u?"unmatched-closing":"unclosed-tag"),b=this.closest("magic-word");if(b&&hl.has(b.name))v=g.getSeverity(m,"conditional");else if(u)v=g.getSeverity(m,"closing"),$.suggestions=[G($)];else{v=g.getSeverity(m,"opening");const _=a==null?void 0:a.childNodes;dl.has(o)&&(_!=null&&_.slice(0,_.indexOf(this)).some(T=>T.is("html")&&T.name===o&&!T.findMatchingTag())&&($.suggestions=[He(i+1,"/")]),this.closest("heading-title")&&($.rule="format-leakage",v=g.getSeverity("format-leakage",o)))}v&&($.severity=v,l.push($))}return l}}getAttribute(i){return i==="invalid"?this.inTableAttrs()===2:super.getAttribute(i)}json(i,n=this.getAbsoluteIndex()){}},e=new WeakMap,t),Ni=se(pl),Wt=ee(Ni,0,"HtmlToken",gl,Wt),Z(Ni,1,Wt)}}),Qo={};ie(Qo,{parseHtml:()=>Jo});var fl,Jo,Cu=C({"parser/html.ts"(){"use strict";yr(),Tu(),fl=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,Jo=(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 o of n){const a=fl.exec(o),u=a==null?void 0:a[2],h=u==null?void 0:u.toLowerCase();if(!a||!t.htmlElements.has(h)){r+=`<${o}`;continue}const[,d,,g="",c,p]=a,{length:x}=s,m=new Ns(g,"html-attrs",h,t,s),v=m.hasAttr("itemprop");if(h==="meta"&&!(v&&m.hasAttr("content"))||h==="link"&&!(v&&m.hasAttr("href"))){r+=`<${o}`,s.length=x;continue}r+=`\0${s.length}x${p}`,new Wt(u,m,d==="/",c==="/>",t,s)}return r}}}),ml,Li,xl,ft,Xo=C({"src/table/base.ts"(){"use strict";br(),q(),rt(),yr(),ml=[Is(1)],ft=class extends(xl=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 Ns(i,"table-attrs",s,n,r))}escape(){}},Li=se(xl),ft=ee(Li,0,"TableBaseToken",ml,ft),Z(Li,1,ft)}}),vl,Ei,_e,ls,Lt,Et,As,Ko=C({"src/table/td.ts"(){"use strict";W(),he(),mr(),O(),q(),Xo(),As=class extends(Ei=ft,vl=[$s(!1)],Ei){constructor(e,t,s,i=[]){var o;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),Z(ls,5,this),ze(this,Lt),ze(this,_e,""),n&&([Ja(this,_e)._]=n);const l=new F(t==null?void 0:t.slice(((o=n==null?void 0:n.index)!=null?o:NaN)+de(this,_e).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 Qi(this,Lt,Et).call(this).subtype}afterBuild(){de(this,_e).includes("\0")&&be(this,_e,this.buildFromStr(de(this,_e),0)),super.afterBuild()}toString(e){const{childNodes:[t,s,i]}=this;return t.toString(e)+s.toString(e)+de(this,_e)+i.toString(e)}text(){const{childNodes:[e,t,s]}=this;return e.text()+t.text()+de(this,_e)+s.text()}getGaps(e){return e===1?de(this,_e).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:o}=r,a=["td","double"].map(u=>r.getSeverity(n,u));for(const u of this.lastChild.childNodes)if(u.type==="text"){const{data:h}=u;if(h.includes("|")){const d=h.includes("||"),g=a[d?1:0];if(g){const c=B(u,i,n,"pipe-in-table",g);if(l||o)if(d){const p={caption:"|+",td:"|",th:"!"}[this.subtype];c.fix=$e(c,"newline",h.replace(/\|\|/gu,`
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|}`,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,i=wl.from(bl(s,()=>[]));for(let n=0;n<i.length;n++){const r=i[n];let l=0,o=0,a;for(const u of t[n].childNodes.slice(2))if(u.is("td")){if(u.isIndependent()&&(a=u.subtype!=="caption"),a){const h={row:n,column:l},{rowspan:d,colspan:g}=u;for(l++;r[o];)o++;for(let c=n;c<Math.min(n+d,s);c++)for(let p=o;p<o+g;p++)i[c][p]=h;o+=g}}else if(yl(u))break}return i}}getAllRows(){return[...super.getRowCount()?[this]:[],...this.childNodes.slice(1).filter(e=>e.is("tr")&&e.getRowCount()>0)]}getNthRow(e,t,s){{const i=super.getRowCount();if(e===0&&i)return this;i&&e--;for(const n of this.childNodes.slice(2)){const{type:r}=n;if(r==="tr"&&n.getRowCount()&&(e--,e<0))return n}return}}json(e,t=this.getAbsoluteIndex()){}},os=se(Fi),ee(os,1,"getLayout",Sl,xs),ar(os,xs)}}),Zo,Nu=C({"src/table/tr.ts"(){"use strict";Yo(),Zo=class extends Tr{get type(){return"tr"}constructor(e,t,s,i){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,e,"tr",t,s,i)}}}}),Cr,ea=C({"src/nowiki/listBase.ts"(){"use strict";lt(),Cr=class extends Te{get indent(){}json(e,t=this.getAbsoluteIndex()){}}}}),Ir,ta=C({"src/nowiki/dd.ts"(){"use strict";ea(),Ir=class extends Cr{get type(){return"dd"}}}}),sa={};ie(sa,{parseTable:()=>ia});var Al,Ri,ia,Lu=C({"parser/table.ts"(){"use strict";q(),Iu(),Nu(),Ko(),ta(),Al=e=>e.lastChild.constructor!==F,Ri=(e,t)=>e.is("td")?t.pop():e,ia=({firstChild:{data:e},type:t,name:s},i,n)=>{const r=[],l=e.split(`
|
|
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(`
|
|
20
19
|
`);let o=t==="root"||t==="parameter-value"||t==="ext-inner"&&s==="poem"?"":`
|
|
21
|
-
${l.shift()}`,a;const
|
|
22
|
-
${
|
|
23
|
-
${
|
|
24
|
-
${
|
|
25
|
-
${
|
|
26
|
-
${
|
|
27
|
-
${
|
|
28
|
-
`)&&(v=fe(c).trim());const{ns:S,valid:y}=I.normalizeTitle(v,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0,page:i});if(y){if(h){if(S!==6){o+=`[[${x}`;continue}let k=!1;for(u++;u<l.length;u++){const $=l[u],b=$.split("]]");if(b.length>2){k=!0,c+=`[[${b[0]}]]${b[1]}`,p=b.slice(2).join("]]");break}else if(b.length===2)c+=`[[${b[0]}]]${b[1]}`;else{c+=`[[${$}`;break}}if(c=nr(c,t,s,i,n),!k){o+=`[[${d}${g}${c}`;continue}}}else{o+=`[[${x}`;continue}c&&(c=Nr(c,t,s,n));let A=_r;w||(S===6?(c&&(c=Lr(c,t,s,!0)),A=kr):S===14&&(A=ca)),c===void 0&&g&&(c=""),o+=`\0${s.length}l${p}`,new A(d,c,t,s,g)}return o}}}),pa={};ie(pa,{parseMagicLinks:()=>fa});var Oi,ji,Bi,qi,fa,qu=C({"parser/magicLinks.ts"(){"use strict";ce(),$r(),Oi=String.raw`[${De}\t]| |�*160;|�*a0;`,ji=`(?:${Oi})+`,Bi=`(?:${Oi}|-)`,qi=String.raw`(?:RFC|PMID)${ji}\d+\b|ISBN${ji}(?:97[89]${Bi}?)?(?:\d${Bi}?){9}[\dx]\b`,fa=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${xt}${vt})|${qi})`,"giu")}catch(i){t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${xt}${vt})|${qi})`,"giu")}return e.replace(t.regexMagicLinks,(i,n,r)=>{let l=n?i.slice(n.length):i;if(r){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 u=l.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,h=u.exec(l);if(h){let d=1;h[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(l.slice(0,h.index))&&(d=2),o=l.slice(h.index+d)+o,l=l.slice(0,h.index+d)}return o.length>=r.length?i:(new Jt(l,void 0,t,s),`${n}\0${s.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(l))return i;return new Jt(l,"magic-link",t,s),`${n}\0${s.length-1}i`})}}}),ma,Wu=C({"util/html.ts"(){"use strict";ma=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,i)=>s!==e[i])}}),Tl,xa,zu=C({"src/nowiki/list.ts"(){"use strict";W(),O(),ea(),Tl=new Set(["link","category","file"]),xa=class extends Cr{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)==="list-range"&&(r=r.firstChild),(r==null?void 0:r.type)==="text"&&Tl.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 o=M(r,{start:e+1},s,"redirect-like",i);return o.startIndex--,o.startCol--,o.endIndex+=2,o.endCol+=2,[o]}}return[]}}}}}),va={};ie(va,{parseList:()=>ba});var ba,Mu=C({"parser/list.ts"(){"use strict";Wu(),zu(),ta(),ba=(e,t,s,i)=>{const n=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!n)return t.lastPrefix="",e;const[r,l,o,a]=n,u=o.replace(/;/gu,":"),h=ma(u,t.lastPrefix),d=((h>1?o.slice(h-1):o)+a).split(/(?=;)/u),g=d[0].startsWith(";");let c=d.length-(g?0:1);if(h>1){const T=o.slice(0,h-1);if(g){const E=T.split(/(?=;)/u);d.unshift(...E),c+=T.includes(";")?E.length:0}else d[0]=T+d[0]}t.lastPrefix=u;let p=l+d.map((T,E)=>`\0${i.length+E}d`).join("")+e.slice(r.length);for(const T of d)new xa(T,s,i);if(!c)return p;const{html:[x,,m]}=s,v=/:+|-\{|\0\d+[xq]\x7F/gu;let w=v,S=w.exec(p),y=0,A=!1,k=!1,$=0;const b=(T,E)=>(new Ir(T,s,i),`${p.slice(0,E)}\0${i.length-1}d${p.slice(E+T.length)}`),_=T=>{T?y&&y--:y++};for(;S&&c;){const{0:T,index:E}=S;if(T==="-{"){if(!$){const{lastIndex:R}=w;w=/-\{|\}-/gu,w.lastIndex=R}$++}else if(T==="}-"){if($--,!$){const{lastIndex:R}=w;w=v,w.lastIndex=R}}else if(T.endsWith("x")){const{name:R,closing:z,selfClosing:j}=i[Number(T.slice(1,-2))];(x.includes(R)||!j&&!m.includes(R))&&_(z)}else if(T.endsWith("q")){const{bold:R,italic:z}=i[Number(T.slice(1,-2))];R&&(_(A),A=!A),z&&(_(k),k=!k)}else if(y===0){if(T.length>=c)return b(T.slice(0,c),E);c-=T.length,w.lastIndex=E+4+String(i.length).length,p=b(T,E)}S=w.exec(p)}return p}}}),as,Cl,Wi,Il,Ut,Uu=C({"src/converterFlags.ts"(){"use strict";var e,t;W(),he(),Cs(),O(),q(),nt(),as=new Set(["A","T","R","D","-","H","N"]),Cl=[Xt()],Ut=(t=class extends(Il=F){constructor(i,n,r=[]){super(void 0,n,r,{});N(this,e);this.safeAppend(i.map(l=>new Ce(l,"converter-flag",n,r)))}get type(){return"converter-flags"}afterBuild(){L(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(f(this,e).filter(i=>/\{{3}[^{}]+\}{3}/u.test(i)))}getVariantFlags(){const i=new Set(this.getAttribute("config").variants);return new Set(f(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(f(this,e).filter(o=>as.has(o)))),!!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(),o=new Set(f(this,e).filter(m=>as.has(m))),a=f(this,e).filter(m=>!m).length,u=f(this,e).length-l.size-a,{lintConfig:h}=I,{computeEditInfo:d,fix:g}=h,c=super.lint(i,n);if(r.size===u||o.size===u)return c;const p="no-ignored",x=h.getSeverity(p,"conversionFlag");if(x){const m=new ne(this,i);for(let v=0;v<this.length;v++){const w=this.childNodes[v],S=w.text().trim();if(this.isInvalidFlag(S,r,l,o)){const y=B(w,m,p,"invalid-conversion-flag",x);(d||g)&&(r.size===0&&as.has(S.toUpperCase())?y.fix=gr(y,S):d&&(y.suggestions=[G(y,v&&-1)])),c.push(y)}}}return c}}print(){return super.print({sep:";"})}},e=new WeakMap,t),Wi=se(Il),Ut=ee(Wi,0,"ConverterFlagsToken",Cl,Ut),Z(Wi,1,Ut)}}),us,vs,Du=C({"src/converterRule.ts"(){"use strict";Be(),O(),q(),nt(),us=(e,t,s,i)=>{const n=new F(e,s,i);return n.type=`converter-rule-${t}`,n.setAttribute("stage",pe),n},vs=class extends 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 Ce(l,"converter-rule-variant",s,i)),super.insertAt(us(e.slice(n+1),"to",s,i)),r!==-1&&super.insertAt(us(e.slice(0,r),"from",s,i),0)):super.insertAt(us(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()){}}}}),Nl,zi,Ll,Dt,Hu=C({"src/converter.ts"(){"use strict";ce(),Qe(),qe(),q(),Uu(),Du(),Nl=[Ee,We("-{")],Dt=class extends(Ll=F){get type(){return"converter"}constructor(e,t,s,i=[]){super(void 0,s,i),this.insertAt(new Ut(e,s,i));const[n]=t,r=n.includes(":"),l=new vs(n,r,s,i);(r?l.length===1:t.length===2&&!fe(t[1]).trim())?this.insertAt(new vs(t.join(";"),!1,s,i)):this.safeAppend([l,...t.slice(1).map(o=>new vs(o,!0,s,i))])}toString(e){const{childNodes:[t,...s]}=this;return`-{${t.toString(e)}${t.length>0?"|":""}${s.map(i=>i.toString(e)).join(";")}}-`}text(){const{childNodes:[e,...t]}=this;return`-{${e.text()}|${tt(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?"|":""}${yt(t,{sep:";"})}}-</span>`}},zi=se(Ll),Dt=ee(zi,0,"ConverterToken",Nl,Dt),Z(zi,1,Dt)}}),ya={};ie(ya,{parseConverter:()=>wa});var wa,Gu=C({"parser/converter.ts"(){"use strict";Hu(),wa=(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 i=/-\{/gu,n=/-\{|\}-/gu,r=[];let l=i,o=l.exec(e);for(;o;){const{0:u,index:h}=o;if(u==="}-"){const d=r.pop(),{length:g}=s,c=e.slice(d.index+2,h),p=c.indexOf("|"),[x,m]=p===-1?[[],c]:[c.slice(0,p).split(";"),c.slice(p+1)],v=m.replace(/(&[#a-z\d]+);/giu,"$1"),w=v.split(t.regexConverter).map(S=>S.replace(/\x01/gu,";"));new Dt(x,w,t,s),e=`${e.slice(0,d.index)}\0${g}v${e.slice(h+2)}`,r.length===0&&(l=i),l.lastIndex=d.index+3+String(g).length}else r.push(o),l=n,l.lastIndex=h+2;o=l.exec(e)}return e}}}),ks={};ie(ks,{Token:()=>F});var El,F,q=C({"src/index.ts"(){"use strict";var e,t,s,i,n,r,l,o,a,Sa,Aa,ka,_a,$a,Ta,Ca,Ia,Na,La,Ea,Fa,A;ce(),Be(),W(),Ie(),O(),tu(),su(),El=["category","html-attr#id,ext-attr#id,table-attr#id"],F=(A=class extends Rt{constructor(b,_=I.getConfig(),T=[],E){super();N(this,a);N(this,e,"plain");N(this,t,0);N(this,s);N(this,i);N(this,n);N(this,r,!1);N(this,l);N(this,o);typeof b=="string"&&this.insertAt(b),L(this,s,_),L(this,i,T),T.push(this)}get type(){return f(this,e)}set type(b){L(this,e,b)}get pageName(){return f(this.getRootNode(),o)}set pageName(b){if(b){const _=this.normalizeTitle(b,0,{temporary:!0,page:""});L(this,o,_.valid?_.title:void 0)}else L(this,o,b===""?"":void 0)}parseOnce(b=f(this,t),_=!1,T){if(b<f(this,t)||this.length===0||!this.isPlain())return this;if(f(this,t)>=pe)return this;switch(b){case 0:if(this.type==="root"){f(this,i).pop();const E=P(this,a,Sa).call(this);_&&(_=!E)}L(this,n,_),P(this,a,Aa).call(this,_);break;case 1:P(this,a,ka).call(this);break;case 2:P(this,a,_a).call(this);break;case 3:P(this,a,$a).call(this);break;case 4:P(this,a,Ta).call(this);break;case 5:P(this,a,Ca).call(this,T);break;case 6:P(this,a,Ia).call(this,T);break;case 7:P(this,a,Na).call(this);break;case 8:P(this,a,La).call(this);break;case 9:P(this,a,Ea).call(this);break;case 10:P(this,a,Fa).call(this)}if(this.type==="root")for(const E of f(this,i))E==null||E.parseOnce(b,_,T);return zr(this,t)._++,this}buildFromStr(b,_){const T=b.split(/[\0\x7F]/u).map((E,R)=>{if(R%2===0)return new Zi(E);if(isNaN(E.slice(-1)))return f(this,i)[Number(E.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${E}`)});return _===0?T.map(String).join(""):_===1?tt(T):T}build(){L(this,t,pe);const{length:b,firstChild:_}=this,T=_==null?void 0:_.toString();if(b===1&&_.type==="text"&&T.includes("\0")&&(Er(this,0,1,this.buildFromStr(T)),this.normalize(),this.type==="root"))for(const E of f(this,i))E==null||E.build()}afterBuild(){if(this.type==="root")for(const b of f(this,i))b==null||b.afterBuild();L(this,r,!0)}parse(b=pe,_,T){for(b=Math.min(b,pe);f(this,t)<b;)this.parseOnce(f(this,t),_,T);return b&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===A}getAttribute(b){var _;switch(b){case"config":return f(this,s);case"include":return(_=f(this,n))!=null?_:!!f(this.getRootNode(),n);case"accum":return f(this,i);case"built":return f(this,r);case"stage":return f(this,t);case"invalid":return this.type==="table-inter"&&Ht(this)===2;default:return super.getAttribute(b)}}setAttribute(b,_){switch(b){case"stage":f(this,t)===0&&this.type==="root"&&f(this,i).shift(),L(this,t,_);break;default:super.setAttribute(b,_)}}insertAt(b,_=this.length){const T=typeof b=="string"?new Zi(b):b;super.insertAt(T,_);const{type:E}=T;return E==="root"&&(T.type="plain"),T}normalizeTitle(b,_=0,T){return I.normalizeTitle(b,_,this.getAttribute("include"),f(this,s),ge({page:this.pageName},T))}inTableAttrs(){var b,_;return((b=this.closest("table-attrs,ext"))==null?void 0:b.type)==="table-attrs"&&((_=this.closest("table-attrs,arg,magic-word,template"))!=null&&_.is("table-attrs")?2:1)}inHtmlAttrs(){var b;return(b=this.closest("html-attrs,ext"))!=null&&b.is("html-attrs")?2:this.inTableAttrs()}lint(b=this.getAbsoluteIndex(),_){var T;{const{lintConfig:E}=I,{computeEditInfo:R,fix:z,ignoreDisables:j,configurationComment:X}=E;let ae=super.lint(b,_);if(this.type==="root"){const Q=new Map,U="no-duplicate",D=["category","id"].map(V=>E.getSeverity(U,V)),Se=this.toString(),Fe=El.filter((V,Y)=>D[Y]).join();if(Fe){for(const V of this.querySelectorAll(Fe)){let Y;if(V.is("category"))Y=V.name;else{const J=V.getValue();J&&J!==!0&&(Y=`#${J}`)}if(Y){const J=Q.get(Y);J?J.add(V):Q.set(Y,new Set([V]))}}for(const[V,Y]of Q)if(Y.size>1&&!V.startsWith("#mw-customcollapsible-")){const J=!V.startsWith("#"),te=`duplicate-${J?"category":"id"}`,ue=D[J?0:1];ae.push(...[...Y].map(le=>{const H=M(le,{start:le.getAbsoluteIndex()},U,te,ue);return R&&J&&(H.suggestions=[G(H)]),H}))}}if(!j){const V=new RegExp(String.raw`<!--\s*${X}-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->`,"gu"),Y=[];let J=V.exec(Se);for(;J;){const{1:te,index:ue}=J,le=(T=J[2])==null?void 0:T.trim();Y.push({line:this.posFromIndex(ue).top+(te==="disable-line"?0:1),from:te==="disable"?V.lastIndex:void 0,to:te==="enable"?V.lastIndex:void 0,rules:le?new Set(le.split(",").map(H=>H.trim())):void 0}),J=V.exec(Se)}ae=ae.filter(({rule:te,startLine:ue,startIndex:le})=>{const H={pos:0};for(const{line:me,from:Re,to:Pe,rules:Ne}of Y){if(me>ue+1)break;if(Ne&&!Ne.has(te))continue;if(me===ue&&Re===void 0&&Pe===void 0)return!1;Re<=le&&Re>H.pos?(H.pos=Re,H.type="from"):Pe<=le&&Pe>H.pos&&(H.pos=Pe,H.type="to")}return H.type!=="from"})}if(z&&ae.some(({fix:V})=>V)){const V=ae.map(({fix:te})=>te).filter(Boolean).sort(({range:[te,ue]},{range:[le,H]})=>ue===H?le-te:H-ue);let Y=1/0,J=Se;for(const{range:[te,ue],text:le}of V)ue<=Y&&(J=J.slice(0,te)+le+J.slice(ue),Y=te);Object.assign(ae,{output:J})}if(!R)for(const V of ae)delete V.fix,delete V.suggestions}return ae}}toString(b,_){return b?super.toString(!0,_):Ze(f(this,l),()=>super.toString(!1,_),T=>{const E=this.getRootNode();E.type==="root"&&f(E,r)&&L(this,l,T)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakMap,l=new WeakMap,o=new WeakMap,a=new WeakSet,Sa=function(){const{parseRedirect:b}=(nu(),K(io)),_=this.firstChild.toString(),T=b(_,f(this,s),f(this,i));return T&&this.setText(T),!!T},Aa=function(b){const{parseCommentAndExt:_}=(Fs(),K(Vo));this.setText(_(this.firstChild.toString(),f(this,s),f(this,i),b))},ka=function(){const{parseBraces:b}=(Ar(),K(Ao)),_=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,T=b(_,f(this,s),f(this,i));this.setText(this.type==="root"?T:T.slice(1))},_a=function(){if(f(this,s).excludes.includes("html"))return;const{parseHtml:b}=(Cu(),K(Qo));this.setText(b(this.firstChild.toString(),f(this,s),f(this,i)))},$a=function(){if(f(this,s).excludes.includes("table"))return;const{parseTable:b}=(Lu(),K(sa));this.setText(b(this,f(this,s),f(this,i)))},Ta=function(){if(f(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:b}=(Pu(),K(na));this.setText(b(this,f(this,s),f(this,i)))},Ca=function(b){const{parseLinks:_}=(Bu(),K(ga));this.setText(_(this.firstChild.toString(),f(this,s),f(this,i),this.pageName,b))},Ia=function(b){if(f(this,s).excludes.includes("quote"))return;const{parseQuotes:_}=(ua(),K(aa)),T=this.firstChild.toString().split(`
|
|
29
|
-
`);for(let
|
|
30
|
-
`))},
|
|
31
|
-
`),
|
|
32
|
-
`))},
|
|
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();})();
|