wikiparser-node 1.29.0 → 1.29.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/bundle-es8.min.js +24 -24
- package/bundle/bundle-lsp.min.js +19 -19
- package/bundle/bundle.min.js +20 -20
- package/dist/bin/config.js +1 -1
- package/dist/lib/document.js +16 -12
- package/dist/lib/lsp.js +81 -79
- package/dist/lib/text.js +7 -14
- package/dist/mixin/elementLike.d.ts +1 -1
- package/dist/src/atom.d.ts +1 -1
- package/dist/src/atom.js +0 -2
- package/dist/src/attribute.js +4 -2
- package/dist/src/attributes.d.ts +1 -0
- package/dist/src/attributes.js +8 -1
- package/dist/src/converterFlags.js +2 -1
- package/dist/src/converterRule.d.ts +8 -8
- package/dist/src/converterRule.js +34 -9
- package/dist/src/hidden.js +2 -1
- package/dist/src/imageParameter.d.ts +6 -1
- package/dist/src/imageParameter.js +308 -252
- package/dist/src/index.js +10 -8
- package/dist/src/link/base.js +1 -1
- package/dist/src/nowiki/index.js +35 -33
- package/dist/src/table/index.js +1 -1
- package/dist/src/tag/html.js +1 -1
- package/dist/src/tag/tvar.js +2 -1
- package/dist/util/html.js +2 -4
- package/extensions/dist/base.js +1 -1
- package/package.json +2 -2
package/bundle/bundle-es8.min.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
"use strict";(()=>{var jo=Object.defineProperty,Bo=Object.defineProperties;var qo=Object.getOwnPropertyDescriptors;var Xt=Object.getOwnPropertySymbols;var Bn=Object.prototype.hasOwnProperty,qn=Object.prototype.propertyIsEnumerable;var Wn=e=>{throw TypeError(e)};var Os=(e,t,s)=>t in e?jo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,ge=(e,t)=>{for(var s in t||(t={}))Bn.call(t,s)&&Os(e,s,t[s]);if(Xt)for(var s of Xt(t))qn.call(t,s)&&Os(e,s,t[s]);return e},Ee=(e,t)=>Bo(e,qo(t));var Mn=(e,t)=>{var s={};for(var i in e)Bn.call(e,i)&&t.indexOf(i)<0&&(s[i]=e[i]);if(e!=null&&Xt)for(var i of Xt(e))t.indexOf(i)<0&&qn.call(e,i)&&(s[i]=e[i]);return s};var Wo=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ne=(e,t,s)=>Os(e,typeof t!="symbol"?t+"":t,s),js=(e,t,s)=>t.has(e)||Wn("Cannot "+s);var f=(e,t,s)=>(js(e,t,"read from private field"),s?s.call(e):t.get(e)),L=(e,t,s)=>t.has(e)?Wn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),F=(e,t,s,i)=>(js(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),P=(e,t,s)=>(js(e,t,"access private method"),s);var zn=(e,t,s,i)=>({set _(r){F(e,t,r,s)},get _(){return f(e,t,i)}});var Qu=Wo((Xu,Oo)=>{var Ol=Object.create,Ke=Object.defineProperty,jl=Object.getOwnPropertyDescriptor,ln=Object.getOwnPropertyNames,Mo=Object.getPrototypeOf,zo=Object.prototype.hasOwnProperty,Bl=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),yt=e=>{throw TypeError(e)},ql=(e,t,s)=>t in e?Ke(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Un=(e,t)=>Ke(e,"name",{value:t,configurable:!0}),C=(e,t)=>function(){return e&&(t=(0,e[ln(e)[0]])(e=0)),t},an=(e,t)=>function(){return t||(0,e[ln(e)[0]])((t={exports:{}}).exports,t),t.exports},se=(e,t)=>{for(var s in t)Ke(e,s,{get:t[s],enumerable:!0})},Wl=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of ln(t))!zo.call(e,r)&&r!==s&&Ke(e,r,{get:()=>t[r],enumerable:!(i=jl(t,r))||i.enumerable});return e},Uo=(e,t,s)=>(s=e!=null?Ol(Mo(e)):{},Wl(t||!e||!e.__esModule?Ke(s,"default",{value:e,enumerable:!0}):s,e)),Q=e=>Wl(Ke({},"__esModule",{value:!0}),e),te=e=>{var t;return[,,,Ol((t=e==null?void 0:e[Bl("metadata")])!=null?t:null)]},Ml=["class","method","getter","setter","accessor","field","value","get","set"],Lt=e=>e!==void 0&&typeof e!="function"?yt("Function expected"):e,Ho=(e,t,s,i,r)=>({kind:Ml[e],name:t,metadata:i,addInitializer:n=>s._?yt("Already initialized"):r.push(Lt(n||null))}),on=(e,t)=>ql(t,Bl("metadata"),e[3]),Y=(e,t,s,i)=>{for(var r=0,n=e[t>>1],l=n&&n.length;r<l;r++)t&1?n[r].call(s):i=n[r].call(s,i);return i},Z=(e,t,s,i,r,n)=>{var l,o,a,u,d,h=t&7,g=!!(t&8),c=!!(t&16),p=h>3?e.length+1:h?g?1:2:0,x=Ml[h+5],m=h>3&&(e[p-1]=[]),v=e[p]||(e[p]=[]),w=h&&(!c&&!g&&(r=r.prototype),h<5&&(h>3||!c)&&jl(h<4?r:{get[s](){return de(this,n)},set[s](y){return Se(this,n,y)}},s));h?c&&h<4&&Un(n,(h>2?"set ":h>1?"get ":"")+s):Un(r,s);for(var S=i.length-1;S>=0;S--)u=Ho(h,s,a={},e[3],v),h&&(u.static=g,u.private=c,d=u.access={has:c?y=>Go(r,y):y=>s in y},h^3&&(d.get=c?y=>(h^1?de:Gi)(y,r,h^4?n:w.get):y=>y[s]),h>2&&(d.set=c?(y,A)=>Se(y,r,A,h^4?n:w.set):(y,A)=>y[s]=A)),o=(0,i[S])(h?h<4?c?n:w[x]:h>4?void 0:{get:w.get,set:w.set}:r,u),a._=1,h^4||o===void 0?Lt(o)&&(h>4?m.unshift(o):h?c?n=o:w[x]=o:r=o):typeof o!="object"||o===null?yt("Object expected"):(Lt(l=o.get)&&(w.get=l),Lt(l=o.set)&&(w.set=l),Lt(l=o.init)&&m.unshift(l));return h||on(e,r),w&&Ke(r,s,w),c?h^4?n:w:r},Do=(e,t,s)=>ql(e,typeof t!="symbol"?t+"":t,s),un=(e,t,s)=>t.has(e)||yt("Cannot "+s),Go=(e,t)=>Object(t)!==t?yt('Cannot use the "in" operator on this value'):e.has(t),de=(e,t,s)=>(un(e,t,"read from private field"),s?s.call(e):t.get(e)),Oe=(e,t,s)=>t.has(e)?yt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),Se=(e,t,s,i)=>(un(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),Gi=(e,t,s)=>(un(e,t,"access private method"),s),Vo=(e,t,s,i)=>({set _(r){Se(e,t,r,s)},get _(){return de(e,t,i)}}),zl,ms,Ul=C({"base.ts"(){"use strict";zl=(()=>{const e={redirect:1,onlyinclude:1,noinclude:1,include:1,comment:1,ext:1,arg:2,"magic-word":2,template:2,heading:2,html:3,table:4,hr:5,"double-underscore":5,link:6,category:6,file:6,quote:7,"ext-link":8,"free-ext-link":9,"magic-link":9,list:10,dd:10,converter:11,"list-range":11};return Object.setPrototypeOf(e,null),e})(),ms=(()=>{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","table-layout","tag-like","unbalanced-header","unclosed-comment","unclosed-quote","unclosed-table","unescaped","unknown-page","unmatched-tag","unterminated-url","url-encoding","var-anchor","void-ext"];return Object.freeze(e),e})()}});function Ae(e,t,s){return s===1?e.replace(/\0(\d+)g\x7F/gu,(i,r)=>Ae(String(t[r]),t,2)):s===2?e.replace(/\0(\d+)n\x7F/gu,(i,r)=>String(t[r])):e.replace(/\0(\d+)\x7F/gu,(i,r)=>t[r])}var qe,Bs,ft,mt,xt,rt,Hl,ve,Ye,Hn,Dn,xs,Dl,Gn,Vn,Ht,vt,he=C({"util/string.ts"(){"use strict";qe=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Bs=String.raw`[^[\]<>"\0-\x1F\x7F${qe}\uFFFD]`,ft=String.raw`(?:\[[\da-f:.]+\]|${Bs})`,mt=String.raw`(?:${Bs}|\0\d+[cn!~]\x7F)*`,xt=e=>e.trim().toLowerCase(),rt=(e,t)=>s=>s.replace(e,t),Hl=rt(/[\0\x7F]|\r$/gmu,""),ve=rt(/\0\d+[cn]\x7F/gu,""),Ye=(e,t="")=>e.map(s=>typeof s=="string"?s:s.text()).join(t),Hn={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},Dn=rt(/&(?:#(\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)):Hn[s.toLowerCase()]),xs=e=>Dn(e),Dl=rt(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),Gn={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},Vn=e=>rt(e,t=>`&${Gn[t]};`),Ht=Vn(/[&<>]/gu),vt=(e,t={})=>{const{pre:s="",post:i="",sep:r=""}=t;return s+e.map(n=>n.print()).join(r)+i}}}),Qo=an({"i18n/en.json"(e,t){t.exports={"attributes-of-closing-tag":"attributes of a closing tag","bold-apostrophes":"bold apostrophes","bold-in-header":"bold text in a section header",close:null,"closing-and-self-closing":"tag that is both closing and self-closing",comment:null,"conflicting-image-parameter":"conflicting image $1 parameter","content-outside-table":"content to be moved outside the table",decode:null,delink:null,"duplicate-attribute":"duplicate $1 attribute","duplicate-category":"duplicate category","duplicate-id":"duplicate HTML id","duplicate-image-parameter":"duplicate image $1 parameter","duplicate-parameter":"duplicate template parameter",encode:null,escape:null,expand:null,"ext-in-html":"extension tag in HTML tag attributes",frame:null,"full-width-punctuation":"full-width punctuation","header-in-html":"section header in HTML tag attributes","horizontal-alignment":null,"html-in-table":"HTML tag in table attributes","illegal-attribute-name":"invalid attribute name","illegal-attribute-value":"invalid attribute value","illegal-module":"invalid Scribunto module name","imagemap-without-image":"<imagemap> without an image","in-url":"$1 in URL","inconsistent-table":"inconsistent table layout","insecure-style":"insecure style","invalid-attribute":"element containing an invalid attribute name","invalid-content":"invalid content in <$1>","invalid-conversion-flag":"invalid conversion flag","invalid-gallery":"invalid gallery image","invalid-image-parameter":"invalid image parameter","invalid-imagemap-link":"invalid link in <imagemap>","invalid-isbn":"invalid ISBN","invalid-parameter":"invalid parameter of <$1>","invalid-self-closing":"invalid self-closing tag","invalid-thumb":"invalid thumbnail filename","invalid-url":"invalid URL","invisible-triple-braces":"invisible content inside triple braces","italic-apostrophes":"italic apostrophes","left-bracket":"opening bracket","link-in-extlink":"internal link in an external link",lonely:'lonely "$1"',"missing-extension":"missing file extension","missing-function":"missing Scribunto module function name",newline:null,"no-self-closing":"no self-closing","nonzero-tabindex":"nonzero tabindex","nothing-in":"nothing should be in <$1>","obsolete-attribute":"obsolete attribute","obsolete-tag":"obsolete HTML tag",open:null,prefix:null,"pipe-in-link":'additional "|" in the link text',"pipe-in-table":'additional "|" in a table cell',"ref-in-link":"<ref> in an internal or external link",remove:null,"template-in-link":"template in an internal link target","unbalanced-in-section-header":"unbalanced $1 in a section header",unclosed:"unclosed $1","unclosed-comment":"unclosed HTML comment","unclosed-quotes":"unclosed quotes","unclosed-table":"unclosed table","unclosed-tag":"unclosed tag","unescaped-query":"unescaped query string in an anonymous parameter","unexpected-argument":"unexpected template argument","unmatched-closing":"unmatched closing tag","unnecessary-encoding":"unnecessary percent-encoding in an internal link",uppercase:null,"useless-attribute":"useless attribute","useless-fragment":"useless fragment","useless-link-text":"useless link text","variable-anchor":"variable anchor in a section header","vertical-alignment":null,whitespace:null}}}),Jo=an({"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:[]}}}),be,Gl,Vi,Me=C({"util/constants.ts"(){"use strict";be=11,Gl=Qo(),Vi=Jo()}});function pt(e){const t=new Map,s=new WeakMap;return i=>{const r=typeof i=="string"?t:s;if(r.has(i)){const l=r.get(i);return l.lastIndex=0,l}const n=e(i);return r.set(i,n),n}}var Dt,Ze=C({"../common/dist/index.mjs"(){"use strict";Dt=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25"))}}),le,ue=C({"lib/rect.ts"(){"use strict";var e,t,s,i,Qi,n;le=(n=class{constructor(l,o){L(this,i);L(this,e);L(this,t);L(this,s);F(this,e,l),F(this,t,o)}get start(){return f(this,t)}get top(){return P(this,i,Qi).call(this).top}get left(){return P(this,i,Qi).call(this).left}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakSet,Qi=function(){var l;return(l=f(this,s))!=null||F(this,s,f(this,e).getRootNode().posFromIndex(f(this,t))),f(this,s)},n)}}),Qn,Jn,Ut,Ji,qs,j,M,Te,Ss,U,dn,We,hn,cn,gn,Gt,bt,pn,Xe,Vl,W=C({"util/lint.ts"(){"use strict";Ze(),Ie(),ue(),O(),Qn=new Set(["tr","td","th","caption"]),Jn=new Set(["Template:!!","Template:!-"]),Ut=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")&&Jn.has(t.name)||t.is("html")&&Qn.has(t.name))return!1;if(t.is("arg"))return t.length>1&&Ut(t.childNodes[1]);if(t.is("magic-word"))try{const s=t.getPossibleValues().map(Ut);return s.includes(2)?2:s.includes(1)&&1}catch(s){}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?1:2},Ji=(e,t,s,i)=>({line:e+s-1,character:(s===1?t:0)+i}),qs=e=>(t,s,i,r,n="error")=>{const{start:l}=s,{top:o,left:a}=s instanceof le?s:new le(t,l),{offsetHeight:u,offsetWidth:d}=t,{startIndex:h,startLine:g,startCol:c}=e(t,l,o,a),{line:p,character:x}=Ji(g,c,u,d);return{rule:i,message:I.msg(r),severity:n,startIndex:h,endIndex:h+t.toString().length,startLine:g,endLine:p,startCol:c,endCol:x}},j=qs((e,t,s,i)=>{const r=e.getRelativeIndex(),{top:n,left:l}=e.parentNode.posFromIndex(r);return{startIndex:t+r,startLine:s+n,startCol:n?l:i+l}}),M=qs((e,t,s,i)=>({startIndex:t,startLine:s,startCol:i})),Te=(e,t,s,i=0)=>({desc:I.msg(t),range:[e.startIndex+i,e.endIndex],text:s}),Ss=(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}:Te(e,"remove",s,t),dn=(e,t)=>Te(e,"decode",Dt(t.text().replace(/%(?=21|3[ce]|5[bd]|7[b-d])/giu,"%25"))),We=(e,t,s=0)=>({desc:I.msg("close"),range:[e+s,e],text:t}),hn=e=>({desc:I.msg("open"),range:[e+1,e+2],text:""}),cn=(e,t)=>Te(e,"comment",`<!--${t}-->`),gn=(e,t)=>Te(e,"uppercase",t.toUpperCase()),Gt=(e,t=0)=>({desc:I.msg("whitespace"),range:[e,e+t],text:" "}),bt=(e,t,s=1)=>({desc:I.msg("escape"),range:[e,e+s],text:t.repeat(s)}),pn=(e,t)=>({desc:I.msg("escape"),range:[e,e+t.length],text:t.replace(/\|/gu,"|")}),Xe=(e,t,s,i)=>{if(e&&(i||I.viewOnly&&e[0]===ye.rev))return e[1];const r=t();return(i||I.viewOnly)&&s([ye.rev,r]),r},Vl=(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"]:[]}}),Xn,fn,Ql=C({"parser/selector.ts"(){"use strict";Xn=e=>{if(e.includes("#")){const t=e.indexOf("#"),s=e.slice(0,t),i=e.slice(t+1);return(r,n)=>(t===0||r===s)&&n===i}return e?t=>t===e:()=>!0},fn=(e,t,s)=>{const i=e.split(",").map(r=>Xn(r.trim()));return(({type:r,name:n})=>i.some(l=>l(r,n)))}}}),Xo=an({"../node_modules/binary-search/index.js"(e,t){t.exports=function(s,i,r,n,l){var o,a;if(n===void 0)n=0;else if(n=n|0,n<0||n>=s.length)throw new RangeError("invalid lower bound");if(l===void 0)l=s.length-1;else if(l=l|0,l<n||l>=s.length)throw new RangeError("invalid upper bound");for(;n<=l;)if(o=n+(l-n>>>1),a=+r(s[o],i,o,s),a<0)n=o+1;else if(a>0)l=o-1;else return o;return~n}}}),Kn,Jl,Ko=C({"util/search.ts"(){"use strict";Kn=Uo(Xo()),Jl=(e,t,s)=>{const i=(0,Kn.default)(e,t,s);return i<0?~i:i}}}),As,mn=C({"mixin/cached.ts"(){"use strict";W(),As=(e=!0)=>t=>{const s=new WeakMap;return function(...i){return Xe(s.get(this),()=>t.apply(this,i),r=>{s.set(this,r)},e)}}}}),Xl,Yo=C({"mixin/nodeLike.ts"(){"use strict";Xl=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}}}),Yn,Zn,Kt,St,At,Yt,kt,_t,$t,Qe,Kl=C({"lib/node.ts"(){"use strict";Ko(),W(),Ie(),mn(),Yo(),O(),Zn=[Xl],Yn=[As(!1)],Qe=class{constructor(){Y($t,5,this),Do(this,"childNodes",[]),Oe(this,Kt),Oe(this,St),Oe(this,At),Oe(this,Yt),Oe(this,kt),Oe(this,_t,{})}get parentNode(){return de(this,Kt)}get nextSibling(){return de(this,St)}get previousSibling(){return de(this,At)}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,Kt,t),t||(Se(this,St,void 0),Se(this,At,void 0));break;case"nextSibling":Se(this,St,t);break;case"previousSibling":Se(this,At,t);break;case"aIndex":I.viewOnly&&Se(this,kt,[ye.rev,t]);break;default:this[e]=t}}getRootNode(){return Xe(de(this,Yt),()=>{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,Yt,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=Jl(s,e,([,,r],n)=>r-n);return{top:i,left:e-s[i][1]}}return}}getDimension(){{const e=this.getLines(),t=e[e.length-1];return{height:e.length,width:t[2]-t[1]}}}getGaps(e){return 0}getRelativeIndex(e){if(e===void 0){const{parentNode:t}=this;return t?t.getRelativeIndex(t.childNodes.indexOf(this)):0}return Xe(de(this,_t)[e],()=>{const{childNodes:t}=this,s=e+(e<0?t.length:0);let i=this.getAttribute("padding");for(let r=0;r<s;r++)I.viewOnly&&(de(this,_t)[r]=[ye.rev,i]),i+=t[r].toString().length+this.getGaps(r);return i},t=>{de(this,_t)[e]=t})}getAbsoluteIndex(){return Xe(de(this,kt),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{Se(this,kt,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 i=t+s.length;e.push([s,t,i]),t=i+1}return e}}seal(e,t){const s=!t&&!!this[e];Object.defineProperty(this,e,{enumerable:s,configurable:!0})}lspError(e){throw new Error(`${e} method is only available in the LSP version!`)}},$t=te(null),Kt=new WeakMap,St=new WeakMap,At=new WeakMap,Yt=new WeakMap,kt=new WeakMap,_t=new WeakMap,Z($t,1,"getLines",Yn,Qe),Qe=Z($t,0,"AstNode",Zn,Qe),Y($t,1,Qe)}}),Yl,Zo=C({"mixin/elementLike.ts"(){"use strict";Ql(),Yl=e=>{var t,Xi;{class i extends e{constructor(){super(...arguments);L(this,t)}getElementBy(l){const o=[...this.childNodes].reverse();for(;o.length>0;){const a=o.pop(),{type:u,childNodes:d}=a;if(u!=="text"){if(l(a))return a;for(let h=d.length-1;h>=0;h--)o.push(d[h])}}}querySelector(l){return this.getElementBy(P(this,t,Xi).call(this,l))}getElementsBy(l){const o=[...this.childNodes].reverse(),a=[];for(;o.length>0;){const u=o.pop(),{type:d,childNodes:h}=u;if(d!=="text"){l(u)&&a.push(u);for(let g=h.length-1;g>=0;g--)o.push(h[g])}}return a}querySelectorAll(l){return this.getElementsBy(P(this,t,Xi).call(this,l))}escape(){}}return t=new WeakSet,Xi=function(l){return fn(l,this)},i}}}}),er,Ws,tr,Ft,eu=C({"lib/element.ts"(){"use strict";he(),Ie(),Ql(),Kl(),Zo(),er=[Yl],Ft=class extends(tr=Qe){get length(){return this.childNodes.length}text(e){return Ye(this.childNodes,e)}normalize(){const e=this.getChildNodes(),t=s=>{var i,r;e.splice(s,1),(i=e[s-1])==null||i.setAttribute("nextSibling",e[s]),(r=e[s])==null||r.setAttribute("previousSibling",e[s-1])};for(let s=e.length-1;s>=0;s--){const{type:i,data:r}=e[s];i!=="text"||e.length===1||this.getGaps(s-(s&&1))||r===""&&t(s)}this.setAttribute("childNodes",e)}removeAt(e){this.lspError("AstElement.removeAt")}insertAt(e,t=this.length){return Fn(this,t,0,[e]),e}closest(e){const t=fn(e,this);let{parentNode:s}=this;for(;s;){if(t(s))return s;({parentNode:s}=s)}}append(...e){this.safeAppend(e)}safeAppend(e){for(const t of e)this.insertAt(t)}safeReplaceChildren(e){}setText(e,t=0){t+=t<0?this.length:0;const s=this.childNodes[t],{data:i}=s;return s.replaceData(e),i}toString(e,t=""){return this.childNodes.map(s=>s.toString(e)).join(t)}caretPositionFromIndex(e){this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(e){this.lspError("AstElement.elementFromIndex")}elementFromPoint(e,t){this.lspError("AstElement.elementFromPoint")}lint(e=this.getAbsoluteIndex(),t){{const s=[];for(let i=0,r=e+this.getAttribute("padding");i<this.length;i++){const n=this.childNodes[i];n.setAttribute("aIndex",r);const l=n.lint(r,t);l.length>0&&Array.prototype.push.apply(s,l),r+=n.toString().length+this.getGaps(i)}return s}}print(e={}){const t=e.class;return this.toString()?(t===""?"":`<span class="wpb-${t!=null?t:this.type}${this.getAttribute("invalid")?" wpb-invalid":""}">`)+vt(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){}},Ws=te(tr),Ft=Z(Ws,0,"AstElement",er,Ft),Y(Ws,1,Ft)}}),Zt,Ms,zs,sr,ir,nr,rr,Us,lr,Ki,tu=C({"lib/text.ts"(){"use strict";var e,Zl,s;he(),W(),O(),Kl(),Zt=String.raw`[${qe}\t]*`,Ms=String.raw`[^\S\n]*`,zs=String.raw`<${Ms}(?:/${Ms})?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${Zt}\d)|isbn(?=[-::]?${Zt}(?:\d(?:${Zt}|-)){6})`,sr=new RegExp(String.raw`${zs}|https?[:/]/+`,"giu"),ir=new RegExp(zs,"giu"),nr=new Set(["attr-value","ext-link-text","link-text"]),rr={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},Us=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"]),lr=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch(i){return/\w/u}})(),Ki=(s=class extends Qe{constructor(r){super();L(this,e);Ne(this,"data","");this.data=r}get type(){return"text"}toString(r){var n;return r&&!((n=this.parentNode)!=null&&n.getAttribute("built"))?ve(this.data):this.data}text(){return this.data}lint(r=this.getAbsoluteIndex(),n){var l,o,a;{if(n===!1)return[];const{data:u,parentNode:d,nextSibling:h,previousSibling:g}=this;if(!d)throw new Error("An isolated text node cannot be linted!");const{type:c,name:p,parentNode:x}=d;if(c==="attr-value"){const{name:z,tag:X}=x;if(X==="ref"&&(z==="name"||z==="follow")||z==="group"&&(X==="ref"||X==="references")||X==="choose"&&(z==="before"||z==="after"))return[]}if(n!=null||(n=c==="free-ext-link"||c==="ext-link-url"||c==="ext-link-text"||c==="image-parameter"&&p==="link"||c==="attr-value"?ir:sr),u.search(n)===-1)return[];n.lastIndex=0;const m=[],v=h==null?void 0:h.type,w=h==null?void 0:h.name,S=g==null?void 0:g.type,y=this.getRootNode(),A=y.toString(),{ext:k,html:$,variants:b}=y.getAttribute("config"),{top:_,left:T}=y.posFromIndex(r),{lintConfig:N}=I,R=N.rules["tag-like"],q=typeof R=="object"&&R[1]?new Set(Object.keys(R[1]).filter(z=>z!=="invalid"&&z!=="disallowed")):new Set,J=new Set(["onlyinclude","noinclude","includeonly",...k,...$[0],...$[1],...$[2],...q,...N.getSeverity("tag-like","disallowed")?Us:[]]);for(let z=n.exec(u);z;z=n.exec(u)){const[,X,pe]=z;let{index:G,0:V}=z;if(pe&&pe!=="]"){const{length:fe}=pe;G+=fe,V=V.slice(fe)}V=V.toLowerCase();const[K]=V,Fe=K==="r"||K==="p"||K==="i",H=K==="{",ee=K==="}",D=K==="[",ne=K==="]";let{length:ae}=V;if(K==="<"&&!J.has(X.toLowerCase())||D&&c==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(u.slice(G+1))||h!=null&&h.is("ext")&&w==="nowiki"&&((l=h.innerText)!=null&&l.includes("]")))||Fe&&(!d.isPlain()||nr.has(c)))continue;ne&&(G||ae>1)&&n.lastIndex--;let oe=r+G,re=oe+ae,ce,me;const we=A[re],nt=A[oe-1],Fs=H||D,Es=H&&nt==="-"&&b.length>0,Rs=ee&&we==="-"&&b.length>0,En=D&&v==="free-ext-link"&&!u.slice(G+1).trim()||ne&&S==="free-ext-link"&&!u.slice(0,G).includes("]");if(Fe)ce="lonely-http",V=V.toUpperCase(),me=N.getSeverity(ce,V);else if(K==="<"){ce="tag-like";let fe;/^<\/?\s/u.test(V)||!/[\s/>]/u.test(we!=null?we:"")?fe="invalid":q.has(X)?fe=X:Us.has(X)&&!k.includes(X)&&(fe="disallowed"),me=N.getSeverity(ce,fe)}else if(Es||Rs)ce="lonely-bracket",me=N.getSeverity(ce,"converter"),Es&&G>0?(V="-{",G--,oe--,ae=2):Rs&&G<u.length-1&&(V="}-",re++,ae=2);else if(En)ce="lonely-bracket",me=N.getSeverity(ce,"extLink");else if(Fs||ee||ne)if(ce="lonely-bracket",ae>1||H&&we===K||ee&&nt===K)me=N.getSeverity(ce,"double");else{if(!D||c!=="ext-link-text"){const fe=rr[K],Ps=Fs?u.slice(G+1):u.slice(0,G);if(H&&((o=fe.exec(Ps))==null?void 0:o[0])==="}"||ee&&((a=fe.exec(Ps))==null?void 0:a[0])==="{")continue;if(!Ps.includes(K)){const jn=Fs?"nextSibling":"previousSibling";let Ge=this[jn];for(;Ge&&(Ge.type!=="text"||!fe.test(Ge.data));)Ge=Ge[jn];if(Ge&&fe.exec(Ge.data)[0]!==K)continue}}me=N.getSeverity(ce,"single")}else ce="lonely-http",me=N.getSeverity(ce);if(!me)continue;const Rn=this.posFromIndex(G),{line:Pn,character:On}=Ji(_,T,Rn.top+1,Rn.left),De={rule:ce,message:I.msg("lonely",Fe||K==="h"||Es||Rs?V:K),severity:me,startIndex:oe,endIndex:re,startLine:Pn,endLine:Pn,startCol:On,endCol:On+ae};if(N.computeEditInfo)if(K==="<")De.suggestions=[bt(oe,"<")];else if(K==="h"&&c!=="link-text"&&lr.test(nt||""))De.suggestions=[Gt(oe)];else if(D&&c==="ext-link-text"){const fe=d.getAbsoluteIndex()+d.toString().length;De.suggestions=[bt(fe,"]")]}else if(ne&&En){const fe=r-g.toString().length;De.suggestions=[Ss(fe,"left-bracket","[")]}else Fe&&(De.suggestions=[...z[0]===V?[]:[gn(De,V)],...we===":"||we===":"?[Gt(re,1)]:[]]);m.push(De)}return m}}replaceData(r){P(this,e,Zl).call(this,r)}splitText(r){this.lspError("AstText.splitText")}escape(){}print(){return Ht(this.data)}},e=new WeakSet,Zl=function(r){this.setAttribute("data",r)},s)}}),ze,et=C({"mixin/hidden.ts"(){"use strict";ze=(e=!0,t=!0)=>s=>{class i extends s{text(){return""}lint(n){return e?[]:super.lint(n)}}return i}}}),Le,Re=C({"mixin/noEscape.ts"(){"use strict";Le=e=>{}}}),Ue,tt=C({"src/syntax.ts"(){"use strict";var e,t;B(),Ue=(t=class extends E{constructor(i,r,n,l,o){super(i,n,l,o);L(this,e);F(this,e,r)}get type(){return f(this,e)}lint(i=this.getAbsoluteIndex()){return super.lint(i,!1)}},e=new WeakMap,t)}}),Pe,He=C({"mixin/padded.ts"(){"use strict";Pe=({length:e})=>t=>{{class s extends t{getAttribute(r){return r==="padding"?e:super.getAttribute(r)}}return s}}}}),xe,st=C({"src/atom.ts"(){"use strict";var e,t;B(),xe=(t=class extends E{constructor(i,r,n,l,o){super(i,n,l,o);L(this,e);F(this,e,r)}get type(){return f(this,e)}set type(i){F(this,e,i)}getAttribute(i){var r;return i==="invalid"?this.type==="converter-flag"&&!!((r=this.parentNode)!=null&&r.isInvalidFlag(this)):super.getAttribute(i)}},e=new WeakMap,t)}}),ar,or,Hs,ur,je,ks=C({"src/link/base.ts"(){"use strict";var e,t,s,i;W(),Me(),ue(),He(),Re(),O(),B(),st(),ar=r=>r==="redirect-target"||r==="link",or=[Le,Pe("[[")],je=(i=class extends(ur=E){constructor(n,l,o,a=[],u="|"){super(void 0,o,a,{});L(this,e,!0);L(this,t);L(this,s);if(this.insertAt(new xe(n,"link-target",o,a,{})),l!==void 0){const d=new E(l,o,a,{});d.type="link-text",d.setAttribute("stage",be-1),this.insertAt(d)}F(this,t,u)}get link(){}get fragment(){}afterBuild(){F(this,s,this.getTitle()),f(this,t).includes("\0")&&F(this,t,this.buildFromStr(f(this,t),0)),this.setAttribute("name",f(this,s).title),super.afterBuild()}setAttribute(n,l){n==="bracket"?F(this,e,l):n==="title"?F(this,s,l):super.setAttribute(n,l)}toString(n){const l=super.toString(n,f(this,t));return f(this,e)?`[[${l}]]`:l}text(){const n=super.text("|");return f(this,e)?`[[${n}]]`:n}getAttribute(n){return n==="title"?f(this,s):super.getAttribute(n)}getGaps(n){return n===0?f(this,t).length:1}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),{childNodes:[a,u],type:d}=this,{encoded:h,fragment:g}=f(this,s),{lintConfig:c}=I,{computeEditInfo:p,fix:x}=c,m=new le(this,n);let v="unknown-page",w=c.getSeverity(v);if(w&&a.childNodes.some(({type:S})=>S==="template")&&o.push(j(a,m,v,"template-in-link",w)),v="url-encoding",w=c.getSeverity(v),w&&h){const S=j(a,m,v,"unnecessary-encoding",w);(p||x)&&(S.fix=dn(S,a)),o.push(S)}if(v="pipe-like",w=c.getSeverity(v,"link"),w&&(d==="link"||d==="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=j(u,m,v,"pipe-in-link",w);if(p){const k=A.startIndex+u.getRelativeIndex(S);A.suggestions=[pn(k,y.data)]}o.push(A)}}if(v="no-ignored",w=c.getSeverity(v,"fragment"),w&&g!==void 0&&!ar(d)){const S=j(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=U(S,a.getRelativeIndex(y)+A.data.indexOf("#")))}o.push(S)}return o}}getTitle(n,l){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:l,temporary:n,decode:!0,selfLink:!0})}print(){return super.print(f(this,e)?{pre:"[[",post:"]]",sep:f(this,t)}:{sep:f(this,t)})}json(n,l=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i),Hs=te(ur),je=Z(Hs,0,"LinkBaseToken",or,je),Y(Hs,1,je)}}),dr,Ds,hr,Ce,it=C({"src/nowiki/base.ts"(){"use strict";Re(),B(),dr=[Le],Ce=class extends(hr=E){get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}},Ds=te(hr),Ce=Z(Ds,0,"NowikiBaseToken",dr,Ce),Y(Ds,1,Ce)}}),cr,Gs,gr,ke,wt=C({"src/nowiki/noinclude.ts"(){"use strict";et(),it(),cr=[ze()],ke=class extends(gr=Ce){get type(){return"noinclude"}toString(e){return e?"":super.toString()}},Gs=te(gr),ke=Z(Gs,0,"NoincludeToken",cr,ke),Y(Gs,1,ke)}}),ea,su=C({"src/link/redirectTarget.ts"(){"use strict";W(),O(),ks(),wt(),ea=class extends je{get type(){return"redirect-target"}constructor(e,t,s,i){super(e,void 0,s,i),t!==void 0&&this.insertAt(new ke(t,s,i))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,{halfParsed:!0,decode:!0,page:""})}lint(e=this.getAbsoluteIndex()){{const t=super.lint(e,!1),s="no-ignored",{lintConfig:i}=I,r=i.getSeverity(s,"redirect");if(r&&this.length===2){const n=j(this.lastChild,{start:e},s,"useless-link-text",r);n.startIndex--,n.startCol--,(i.computeEditInfo||i.fix)&&(n.fix=U(n)),t.push(n)}return t}}}}}),pr,Vs,fr,Et,iu=C({"src/redirect.ts"(){"use strict";var e,t,s;et(),Re(),B(),tt(),su(),pr=[ze(!1,!1),Le],Et=(s=class extends(fr=E){constructor(r,n,l,o,a,u,d=[]){super(void 0,u,d);L(this,e);L(this,t);F(this,e,r),F(this,t,a),this.append(new Ue(n,"redirect-syntax",u,d),new ea(l,o==null?void 0:o.slice(1),u,d))}get type(){return"redirect"}getAttribute(r){return r==="padding"?f(this,e).length:super.getAttribute(r)}toString(r){return f(this,e)+super.toString(r)+f(this,t)}lint(r=this.getAbsoluteIndex()){{const n=r+f(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",n),this.lastChild.lint(n)}}print(){return super.print({pre:f(this,e),post:f(this,t)})}},e=new WeakMap,t=new WeakMap,s),Vs=te(fr),Et=Z(Vs,0,"RedirectToken",pr,Et),Y(Vs,1,Et)}}),ta={};se(ta,{parseRedirect:()=>sa});var sa,nu=C({"parser/redirect.ts"(){"use strict";O(),iu(),sa=(e,t,s)=>{var r;(r=t.regexRedirect)!=null||(t.regexRedirect=new RegExp(String.raw`^(\s*)((?:${t.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));const i=t.regexRedirect.exec(e);return i&&I.normalizeTitle(i[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,page:""}).valid?(e=`\0${s.length}o${e.slice(i[0].length)}`,new Et(...i.slice(1),t,s),e):!1}}}),mr,Qs,xr,Rt,ru=C({"src/onlyinclude.ts"(){"use strict";He(),Re(),B(),mr=[Le,Pe("<onlyinclude>")],Rt=class extends(xr=E){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>'})}},Qs=te(xr),Rt=Z(Qs,0,"OnlyincludeToken",mr,Rt),Y(Qs,1,Rt)}}),Qt,_s=C({"mixin/gapped.ts"(){"use strict";Qt=(e=1)=>t=>{class s extends t{getGaps(){return e}}return s}}}),vr,Js,br,Je,xn=C({"src/tagPair/index.ts"(){"use strict";var e,t;_s(),Re(),B(),vr=[Qt(),Le],Je=(t=class extends(br=E){constructor(i,r,n,l,o,a=[]){super(void 0,o);L(this,e);Ne(this,"closed");Ne(this,"selfClosing");this.setAttribute("name",i.toLowerCase()),F(this,e,[i,l||i]),this.closed=l!=="",this.selfClosing=l===void 0,this.append(r,n);const u=typeof r=="string"?-1:a.indexOf(r);a.splice(u===-1?1/0:u,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(i){const{selfClosing:r,firstChild:n,lastChild:l}=this,[o,a]=f(this,e);return r?`<${o}${n.toString(i)}/>`:`<${o}${n.toString(i)}>${l.toString(i)}${this.closed?`</${a}>`:""}`}text(){const[i,r]=f(this,e);return this.selfClosing?`<${i}${this.firstChild.text()}/>`:`<${i}${super.text(">")}${this.closed?`</${r}>`:""}`}getAttribute(i){return i==="padding"?f(this,e)[0].length+1:super.getAttribute(i)}print(){const[i,r]=f(this,e);return super.print(this.selfClosing?{pre:`<${i}`,post:"/>"}:{pre:`<${i}`,sep:">",post:this.closed?`</${r}>`:""})}},e=new WeakMap,t),Js=te(br),Je=Z(Js,0,"TagPairToken",vr,Je),Y(Js,1,Je)}}),vn,ia=C({"src/tag/index.ts"(){"use strict";var e,t,s,i;W(),Ie(),O(),B(),vn=(i=class extends E{constructor(n,l,o,a,u){super(void 0,a,u);L(this,e);L(this,t);L(this,s);this.insertAt(l),F(this,e,o),F(this,t,n)}get closing(){return f(this,e)}toString(n){return`<${f(this,e)?"/":""}${f(this,t)}${super.toString(n)}${this.selfClosing?"/":""}>`}text(n=""){const{closing:l}=this;return`<${l&&!n?"/":""}${f(this,t)}${l?"":super.text()}${n}>`}getAttribute(n){return n==="padding"?f(this,t).length+(f(this,e)?2:1):super.getAttribute(n)}findMatchingTag(){return Xe(f(this,s),()=>{const{type:n,name:l,parentNode:o,closing:a,selfClosing:u}=this;let d=!1,h=!1;if(n==="html"){const{html:[,v,w]}=this.getAttribute("config");d=w.includes(l),h=v.includes(l)}if(d||h&&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}=ye;for(const v of p)if(!(!v.is(n)||n==="html"&&(v.name!==l||h&&v.selfClosing)))if(f(v,e)===a){if(n==="tvar")return;x.push(v)}else{const w=x.pop();if(w===this)return v;I.viewOnly&&(F(w,s,[m,v]),F(v,s,[m,w]))}if(I.viewOnly)for(const v of x)F(v,s,[m,void 0])},n=>{F(this,s,n),n[1]&&n[1]!==this&&F(n[1],s,[ye.rev,this])})}print(){return super.print({pre:`<${f(this,e)?"/":""}${f(this,t)}`,post:`${this.selfClosing?"/":""}>`})}json(n,l=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i)}}),yr,Xs,wr,Be,lu=C({"src/tag/tvar.ts"(){"use strict";et(),ia(),tt(),yr=[ze()],Be=class extends(wr=vn){get type(){return"tvar"}constructor(e,t,s,i,r){const n=new Ue(t,"tvar-name",i,r);super(e,n,s,i,r)}},Xs=te(wr),Be=Z(Xs,0,"TvarToken",yr,Be),Y(Xs,1,Be)}}),na,au=C({"src/tagPair/translate.ts"(){"use strict";var e,ra,s;B(),xn(),tt(),lu(),na=(s=class extends Je{constructor(r,n,l,o=[]){const a=new Ue(r,"translate-attr",l,o);n=n==null?void 0:n.replace(/<tvar(\|[^>]+)>([\s\S]*?)<\/>/gu,(d,h,g)=>(new Be("tvar",h,!1,l,o),new Be("","",!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,(d,h,g,c,p,x,m)=>(new Be(h,g,!1,l,o),new Be(x,m,!0,l,o),`\0${o.length-2}n${p}\0${o.length}n`));const u=new E(n,l,o);u.type="translate-inner";super("translate",a,u,"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(){return`<span class="wpb-ext"><translate${P(this,e,ra).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,ra=function(){return this.firstChild.toString()===" nowrap"},s)}}),Sr,Ks,Ar,Pt,ou=C({"src/tagPair/include.ts"(){"use strict";W(),ue(),et(),O(),xn(),Sr=[ze(!1)],Pt=class extends(Ar=Je){get type(){return"include"}constructor(e,t="",s,i,r,n){super(e,t,s!=null?s:"",s===void 0||i!=null?i:"",r,n)}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){{const t=[],{firstChild:s,closed:i,name:r}=this,n=new le(this,e),l=["no-ignored","unclosed-comment"],{lintConfig:o}=I,{computeEditInfo:a}=o,u=l.map(d=>o.getSeverity(d,"include"));if(u[0]&&s.data.trim()){const d=j(s,n,l[0],"useless-attribute",u[0]);a&&(d.suggestions=[U(d)]),t.push(d)}if(u[1]&&!i){const d=M(this,n,l[1],I.msg("unclosed",`<${r}>`),u[1]);a&&(d.suggestions=[We(d.endIndex,`</${r}>`)]),t.push(d)}return t}}},Ks=te(Ar),Pt=Z(Ks,0,"IncludeToken",Sr,Pt),Y(Ks,1,Pt)}}),$s,bn=C({"mixin/attributesParent.ts"(){"use strict";$s=(e=0)=>t=>{var s,la;{class r extends t{constructor(){super(...arguments);L(this,s)}hasAttr(o){this.lspError("AttributesParent.hasAttr")}getAttr(o){return P(this,s,la).call(this).getAttr(o)}}return s=new WeakSet,la=function(){return this.childNodes[e]},r}}}}),ie,Ys,Zs,Tt,es,ei,Ct,ti,si,ii,ts,ni,ri,li,_e,aa,oa,ua,da,uu=C({"util/sharable.ts"(){"use strict";ie=new Set(["align"]),Ys=new Set(["cite"]),Zs=new Set(["cite","datetime"]),Tt=new Set(["width"]),es=new Set(["axis","align","bgcolor","height","width","valign"]),ei=new Set([...es,"abbr","headers","scope","rowspan","colspan"]),Ct=new Set(["type"]),ti=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),si=new Set(["clear"]),ii=new Set(["bgcolor","align","valign"]),ts=new Set(["qid","forcemathmode","type","display"]),ni=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),ri=new Set(["weight"]),li=new Set(["width","height","zoom","latitude","longitude","align","mapstyle","lang","alt","text"]),_e=new Set,aa=new Set(["id","class","style","lang","dir","title","tabindex","aria-describedby","aria-flowto","aria-hidden","aria-label","aria-labelledby","aria-level","aria-owns","role","about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),oa={div:ie,h1:ie,h2:ie,h3:ie,h4:ie,h5:ie,h6:ie,blockquote:Ys,q:Ys,p:ie,br:si,pre:Tt,ins:Zs,del:Zs,ul:Ct,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...ti,"border"]),caption:ie,tr:ii,td:ei,th:ei,font:new Set(["size","color","face"]),hr:Tt,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Ct,poem:ie,categorytree:ie,combooption:ie,math:_e,chem:_e,ce:_e,img:new Set(["alt","src","width","height","loading","srcset"])},ua={gallery:new Set(["mode","showfilename","caption","perrow","widths","heights","showthumbnails"]),poem:new Set(["compact"]),categorytree:new Set(["hideroot","onlyroot","depth","mode","hideprefix","namespaces","showcount","notranslations"]),combooption:new Set(["name","for","inline"]),nowiki:_e,indicator:new Set(["name"]),langconvert:new Set(["from","to"]),ref:new Set(["group","name","follow","dir","details"]),references:new Set(["group","responsive"]),charinsert:new Set(["label"]),choose:new Set(["uncached","before","after"]),option:ri,choicetemplate:ri,imagemap:_e,inputbox:_e,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:_e,poll:new Set(["id","show-results-before-voting"]),score:new Set(["line_width_inches","lang","override_midi","raw","note-language","override_audio","override_ogg","sound","vorbis"]),seo:new Set(["title","title_mode","title_separator","keywords","description","robots","google_bot","image","image_width","image_height","image_alt","type","site_name","locale","section","author","published_time","twitter_site"]),tab:new Set(["nested","name","index","class","block","inline","openname","closename","collapsed","dropdown","style","bgcolor","container","id","title"]),tabs:new Set(["plain","class","container","id","title","style"]),combobox:new Set(["placeholder","value","id","class","text","dropdown","style"]),math:new Set([...ts,"chem"]),chem:ts,ce:ts,hiero:_e,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:ni,syntaxhighlight:ni,templatedata:_e,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:_e,mapframe:new Set([...li,"frameless"]),maplink:new Set([...li,"class"]),rss:new Set(["template","templatename","max","highlight","filter","filterout","reverse","date","item-max-length"]),"page-collection":new Set(["lang","name","description","end-date"])},da={table:ti,td:new Set([...es,"scope"]),th:es,br:si,caption:ie,div:ie,hr:Tt,h1:ie,h2:ie,h3:ie,h4:ie,h5:ie,h6:ie,li:Ct,p:ie,pre:Tt,tr:ii,ul:Ct}}}),kr,_r,$r,Tr,us,du=C({"src/attribute.ts"(){"use strict";var e,t,s,i,r,ha,Yi,o;W(),he(),Me(),uu(),ue(),O(),B(),st(),kr=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,_r=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,$r=new Set(["ext","arg","magic-word","template"]),Tr=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),us=(o=class extends E{constructor(u,d,h,g="",c,p=[],x=I.getConfig(),m=[]){const v=new xe(h,"attr-key",x,m);let w;if(h==="title"||d==="img"&&h==="alt")w=new E(c,x,m,{}),w.type="attr-value",w.setAttribute("stage",be-1);else if(d==="gallery"&&h==="caption"||d==="ref"&&h==="details"||(d==="mapframe"||d==="maplink")&&h==="text"||d==="choose"&&(h==="before"||h==="after")){const S=Ee(ge({},x),{excludes:[...x.excludes,"heading","html","table","hr","list"]});w=new E(c,S,m,{}),w.type="attr-value",w.setAttribute("stage",1)}else w=new xe(c,"attr-value",x,m,{});super(void 0,x,m);L(this,r);L(this,e);L(this,t);L(this,s);L(this,i);F(this,e,u),this.append(v,w),F(this,s,g),F(this,i,[...p]),F(this,t,d),this.setAttribute("name",xt(ve(h)))}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")&&F(this,s,this.buildFromStr(f(this,s),0)),this.parentNode&&F(this,t,this.parentNode.name),P(this,r,ha).call(this),super.afterBuild()}toString(u){const[d="",h=""]=f(this,i);return f(this,s)?super.toString(u,f(this,s)+d)+h:this.firstChild.toString(u)}text(){return f(this,s)?`${super.text(`${f(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var u,d;return f(this,s)?f(this,s).length+((d=(u=f(this,i)[0])==null?void 0:u.length)!=null?d:0):0}lint(u=this.getAbsoluteIndex(),d){var h;{const g=super.lint(u,d),{balanced:c,firstChild:p,lastChild:x,name:m,tag:v}=this,w=new le(this,u),S=["unclosed-quote","obsolete-attr"],{lintConfig:y}=I,A=S.map($=>y.getSeverity($,m));if(A[0]&&!c){const $=j(x,w,S[0],"unclosed-quotes",A[0]);$.startIndex--,$.startCol--,y.computeEditInfo&&($.suggestions=[We($.endIndex,f(this,i)[0])]),g.push($)}const k=P(this,r,Yi).call(this,u,w);return k&&g.push(k),A[1]&&((h=da[v])!=null&&h.has(m))&&g.push(j(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,r,Yi).call(this):super.getAttribute(u)}print(){const[u="",d=""]=f(this,i);return f(this,s)?super.print({sep:Ht(f(this,s))+u,post:d}):super.print()}json(u,d=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakSet,ha=function(){this.setAttribute("name",xt(this.firstChild.text()))},Yi=function(u,d){const{firstChild:h,lastChild:g,type:c,name:p,tag:x,parentNode:m}=this,v=!g.childNodes.some(({type:_})=>$r.has(_)),w=this.getValue(),S=ua[x],y=oa[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"||!aa.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=j(h,d,k,"illegal-attribute-name",_);return b&&(T.suggestions=[U(u,A)]),T}}}else if(p==="style"&&typeof w=="string"&&kr.test(w)){if(u===void 0)return!0;{k="insecure-style";const _=$.getSeverity(k);return _&&j(g,d,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=j(g,d,k,"nonzero-tabindex",_);return b&&(T.suggestions=[U(u,A),Te(T,"0 tabindex","0")]),T}}}else if(typeof w=="string"&&((/^xmlns:[\w:.-]+$/u.test(p)||Tr.has(p))&&_r.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 _&&j(g,d,k,"illegal-attribute-value",_)}}else if(v&&c!=="ext-attr"){const _=Vl(x,p),T=String(w).toLowerCase();if(_.length>0&&_.every(N=>N!==T)){if(u===void 0)return!0;{const N=$.getSeverity(k,"value");return N&&j(g,d,k,"illegal-attribute-value",N)}}}return!1},o)}}),ai,Cr,Ir,Ts,yn=C({"src/attributes.ts"(){"use strict";var e,t,ds,i;W(),he(),ue(),O(),B(),st(),du(),ai=r=>r.slice(0,-1),Cr=r=>`${ai(r)}-dirty`,Ir=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch(r){return/[^\W_]/u}})(),Ts=(i=class extends E{constructor(n,l,o,a,u=[]){super(void 0,a,u,{});L(this,t);L(this,e);if(F(this,e,l),this.setAttribute("name",o),n){const d=/([^\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=d.exec(n),c=0;const p=(()=>{h&&(super.insertAt(new xe(h,Cr(l),a,u,{})),h="")});for(;g;){const{index:x,0:m,1:v,2:w,3:S,4:y,5:A,6:k}=g;if(h+=n.slice(c,x),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(ve(v).trim())){const $=y!=null?y:k,b=[S,A],_=new us(ai(l),o,v,w,$,b,a,u);p(),super.insertAt(_)}else h+=m;({lastIndex:c}=d),g=d.exec(n)}h+=n.slice(c),p()}}get type(){return f(this,e)}afterBuild(){const{parentNode:n}=this;n!=null&&n.is("td")&&this.setAttribute("name",n.subtype),super.afterBuild()}getAttrTokens(n){return this.childNodes.filter(l=>l instanceof us&&(!n||l.name===xt(n)))}hasAttr(n){return this.getAttrTokens(n).length>0}getAttrToken(n){{const l=this.getAttrTokens(n);return l[l.length-1]}}getAttr(n){var l;return(l=this.getAttrToken(n))==null?void 0:l.getValue()}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),{parentNode:a,childNodes:u}=this,d=new Map,h=new Set,g=new le(this,n),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,ds).call(this)){const S=M(this,g,c[0],"attributes-of-closing-tag",v[0]);if(x){const y=a.getAbsoluteIndex();S.suggestions=[U(S),hn(y)]}o.push(S)}for(const S of u)if(S instanceof us){const{name:y}=S;d.has(y)?(h.add(y),d.get(y).push(S)):d.set(y,[S])}else{const y=S.text().trim(),A=v[Ir.test(y)?1:2];if(y&&A){const k=j(S,g,c[0],"invalid-attribute",A);x&&(k.suggestions=[U(k,0," ")]),o.push(k)}}const w=p.getSeverity(c[1],"attribute");if(w&&h.size>0)for(const S of h){const y=d.get(S).map(A=>{const k=A.getValue();return[A,k===!0?"":k]});Array.prototype.push.apply(o,y.map(([A,k],$)=>{const b=j(A,g,c[1],I.msg("duplicate-attribute",S),w);if(x||m){const _=U(b);!k||y.slice(0,$).some(([,T])=>T===k)?b.fix=_:x&&(b.suggestions=[_])}return b}))}return o}}getAttribute(n){return n==="invalid"?P(this,t,ds).call(this):super.getAttribute(n)}print(){return this.toString()?`<span class="wpb-${this.type}${P(this,t,ds).call(this)?" wpb-invalid":""}">${this.childNodes.map(n=>n.print(n instanceof xe?{class:n.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,ds=function(){const{parentNode:n}=this;return(n==null?void 0:n.type)==="html"&&n.closing&&this.text().trim()!==""},i)}}),ca={};se(ca,{PreToken:()=>ga});var ga,hu=C({"src/pre.ts"(){"use strict";Me(),B(),wt(),ga=class extends E{get type(){return"ext-inner"}constructor(e,t,s=[]){if(e){const i=/<nowiki>/giu,r=/<\/nowiki>/giu,{length:n}=i.source;let l=i.exec(e);l&&(r.lastIndex=l.index+n);let o=r.exec(e),a=0,u="";for(;l&&o;)new ke(l[0],t,s,!0),new ke(o[0],t,s,!0),u+=`${e.slice(a,l.index)}\0${s.length-1}n${e.slice(l.index+n,o.index)}\0${s.length}n`,a=o.index+n+1,i.lastIndex=a,l=i.exec(e),l&&(r.lastIndex=l.index+n),o=r.exec(e);e=u+e.slice(a)}super(e,t,s,{}),this.setAttribute("stage",be-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),Cs,wn=C({"src/multiLine/index.ts"(){"use strict";B(),Cs=class extends E{get type(){return"ext-inner"}toString(e){return super.toString(e,`
|
|
1
|
+
"use strict";(()=>{var ja=Object.defineProperty,Ba=Object.defineProperties;var qa=Object.getOwnPropertyDescriptors;var Xt=Object.getOwnPropertySymbols;var Bn=Object.prototype.hasOwnProperty,qn=Object.prototype.propertyIsEnumerable;var Wn=e=>{throw TypeError(e)};var Os=(e,t,s)=>t in e?ja(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,ce=(e,t)=>{for(var s in t||(t={}))Bn.call(t,s)&&Os(e,s,t[s]);if(Xt)for(var s of Xt(t))qn.call(t,s)&&Os(e,s,t[s]);return e},Fe=(e,t)=>Ba(e,qa(t));var Mn=(e,t)=>{var s={};for(var i in e)Bn.call(e,i)&&t.indexOf(i)<0&&(s[i]=e[i]);if(e!=null&&Xt)for(var i of Xt(e))t.indexOf(i)<0&&qn.call(e,i)&&(s[i]=e[i]);return s};var Wa=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ie=(e,t,s)=>Os(e,typeof t!="symbol"?t+"":t,s),js=(e,t,s)=>t.has(e)||Wn("Cannot "+s);var f=(e,t,s)=>(js(e,t,"read from private field"),s?s.call(e):t.get(e)),N=(e,t,s)=>t.has(e)?Wn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),L=(e,t,s,i)=>(js(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),P=(e,t,s)=>(js(e,t,"access private method"),s);var zn=(e,t,s,i)=>({set _(r){L(e,t,r,s)},get _(){return f(e,t,i)}});var Qu=Wa((Xu,Oa)=>{var Ol=Object.create,Ke=Object.defineProperty,jl=Object.getOwnPropertyDescriptor,ln=Object.getOwnPropertyNames,Ma=Object.getPrototypeOf,za=Object.prototype.hasOwnProperty,Bl=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),yt=e=>{throw TypeError(e)},ql=(e,t,s)=>t in e?Ke(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Un=(e,t)=>Ke(e,"name",{value:t,configurable:!0}),C=(e,t)=>function(){return e&&(t=(0,e[ln(e)[0]])(e=0)),t},on=(e,t)=>function(){return t||(0,e[ln(e)[0]])((t={exports:{}}).exports,t),t.exports},ie=(e,t)=>{for(var s in t)Ke(e,s,{get:t[s],enumerable:!0})},Wl=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of ln(t))!za.call(e,r)&&r!==s&&Ke(e,r,{get:()=>t[r],enumerable:!(i=jl(t,r))||i.enumerable});return e},Ua=(e,t,s)=>(s=e!=null?Ol(Ma(e)):{},Wl(t||!e||!e.__esModule?Ke(s,"default",{value:e,enumerable:!0}):s,e)),X=e=>Wl(Ke({},"__esModule",{value:!0}),e),te=e=>{var t;return[,,,Ol((t=e==null?void 0:e[Bl("metadata")])!=null?t:null)]},Ml=["class","method","getter","setter","accessor","field","value","get","set"],Lt=e=>e!==void 0&&typeof e!="function"?yt("Function expected"):e,Ha=(e,t,s,i,r)=>({kind:Ml[e],name:t,metadata:i,addInitializer:n=>s._?yt("Already initialized"):r.push(Lt(n||null))}),an=(e,t)=>ql(t,Bl("metadata"),e[3]),Y=(e,t,s,i)=>{for(var r=0,n=e[t>>1],l=n&&n.length;r<l;r++)t&1?n[r].call(s):i=n[r].call(s,i);return i},Z=(e,t,s,i,r,n)=>{var l,a,o,u,d,h=t&7,g=!!(t&8),c=!!(t&16),p=h>3?e.length+1:h?g?1:2:0,x=Ml[h+5],m=h>3&&(e[p-1]=[]),v=e[p]||(e[p]=[]),S=h&&(!c&&!g&&(r=r.prototype),h<5&&(h>3||!c)&&jl(h<4?r:{get[s](){return ue(this,n)},set[s](y){return be(this,n,y)}},s));h?c&&h<4&&Un(n,(h>2?"set ":h>1?"get ":"")+s):Un(r,s);for(var w=i.length-1;w>=0;w--)u=Ha(h,s,o={},e[3],v),h&&(u.static=g,u.private=c,d=u.access={has:c?y=>Ga(r,y):y=>s in y},h^3&&(d.get=c?y=>(h^1?ue:Gi)(y,r,h^4?n:S.get):y=>y[s]),h>2&&(d.set=c?(y,A)=>be(y,r,A,h^4?n:S.set):(y,A)=>y[s]=A)),a=(0,i[w])(h?h<4?c?n:S[x]:h>4?void 0:{get:S.get,set:S.set}:r,u),o._=1,h^4||a===void 0?Lt(a)&&(h>4?m.unshift(a):h?c?n=a:S[x]=a:r=a):typeof a!="object"||a===null?yt("Object expected"):(Lt(l=a.get)&&(S.get=l),Lt(l=a.set)&&(S.set=l),Lt(l=a.init)&&m.unshift(l));return h||an(e,r),S&&Ke(r,s,S),c?h^4?n:S:r},Da=(e,t,s)=>ql(e,typeof t!="symbol"?t+"":t,s),un=(e,t,s)=>t.has(e)||yt("Cannot "+s),Ga=(e,t)=>Object(t)!==t?yt('Cannot use the "in" operator on this value'):e.has(t),ue=(e,t,s)=>(un(e,t,"read from private field"),s?s.call(e):t.get(e)),je=(e,t,s)=>t.has(e)?yt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),be=(e,t,s,i)=>(un(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),Gi=(e,t,s)=>(un(e,t,"access private method"),s),Va=(e,t,s,i)=>({set _(r){be(e,t,r,s)},get _(){return ue(e,t,i)}}),zl,xs,Ul=C({"base.ts"(){"use strict";zl=(()=>{const e={redirect:1,onlyinclude:1,noinclude:1,include:1,comment:1,ext:1,arg:2,"magic-word":2,template:2,heading:2,html:3,table:4,hr:5,"double-underscore":5,link:6,category:6,file:6,quote:7,"ext-link":8,"free-ext-link":9,"magic-link":9,list:10,dd:10,converter:11,"list-range":11};return Object.setPrototypeOf(e,null),e})(),xs=(()=>{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","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,r)=>ye(String(t[r]),t,2)):s===2?e.replace(/\0(\d+)n\x7F/gu,(i,r)=>String(t[r])):e.replace(/\0(\d+)\x7F/gu,(i,r)=>t[r])}var We,Bs,ft,mt,xt,rt,Hl,fe,Ye,Hn,Dn,vs,Dl,Gn,Vn,Ht,vt,de=C({"util/string.ts"(){"use strict";We=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Bs=String.raw`[^[\]<>"\0-\x1F\x7F${We}\uFFFD]`,ft=String.raw`(?:\[[\da-f:.]+\]|${Bs})`,mt=String.raw`(?:${Bs}|\0\d+[cn!~]\x7F)*`,xt=e=>e.trim().toLowerCase(),rt=(e,t)=>s=>s.replace(e,t),Hl=rt(/[\0\x7F]|\r$/gmu,""),fe=rt(/\0\d+[cn]\x7F/gu,""),Ye=(e,t="")=>e.map(s=>typeof s=="string"?s:s.text()).join(t),Hn={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},Dn=rt(/&(?:#(\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)):Hn[s.toLowerCase()]),vs=e=>Dn(e),Dl=rt(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),Gn={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},Vn=e=>rt(e,t=>`&${Gn[t]};`),Ht=Vn(/[&<>]/gu),vt=(e,t={})=>{const{pre:s="",post:i="",sep:r=""}=t;return s+e.map(n=>n.print()).join(r)+i}}}),Qa=on({"i18n/en.json"(e,t){t.exports={"attributes-of-closing-tag":"attributes of a closing tag","bold-apostrophes":"bold apostrophes","bold-in-header":"bold text in a section header",close:null,"closing-and-self-closing":"tag that is both closing and self-closing",comment:null,"conflicting-image-parameter":"conflicting image $1 parameter","content-outside-table":"content to be moved outside the table",decode:null,delink:null,"duplicate-attribute":"duplicate $1 attribute","duplicate-category":"duplicate category","duplicate-id":"duplicate HTML id","duplicate-image-parameter":"duplicate image $1 parameter","duplicate-parameter":"duplicate template parameter",encode:null,escape:null,expand:null,"ext-in-html":"extension tag in HTML tag attributes",frame:null,"full-width-punctuation":"full-width punctuation","header-in-html":"section header in HTML tag attributes","horizontal-alignment":null,"html-in-table":"HTML tag in table attributes","illegal-attribute-name":"invalid attribute name","illegal-attribute-value":"invalid attribute value","illegal-module":"invalid Scribunto module name","imagemap-without-image":"<imagemap> without an image","in-url":"$1 in URL","inconsistent-table":"inconsistent table layout","insecure-style":"insecure style","invalid-attribute":"element containing an invalid attribute name","invalid-content":"invalid content in <$1>","invalid-conversion-flag":"invalid conversion flag","invalid-gallery":"invalid gallery image","invalid-image-parameter":"invalid image parameter","invalid-imagemap-link":"invalid link in <imagemap>","invalid-isbn":"invalid ISBN","invalid-parameter":"invalid parameter of <$1>","invalid-self-closing":"invalid self-closing tag","invalid-thumb":"invalid thumbnail filename","invalid-url":"invalid URL","invisible-triple-braces":"invisible content inside triple braces","italic-apostrophes":"italic apostrophes","left-bracket":"opening bracket","link-in-extlink":"internal link in an external link",lonely:'lonely "$1"',"missing-extension":"missing file extension","missing-function":"missing Scribunto module function name",newline:null,"no-self-closing":"no self-closing","nonzero-tabindex":"nonzero tabindex","nothing-in":"nothing should be in <$1>","obsolete-attribute":"obsolete attribute","obsolete-tag":"obsolete HTML tag",open:null,prefix:null,"pipe-in-link":'additional "|" in the link text',"pipe-in-table":'additional "|" in a table cell',"ref-in-link":"<ref> in an internal or external link",remove:null,"template-in-link":"template in an internal link target","unbalanced-in-section-header":"unbalanced $1 in a section header",unclosed:"unclosed $1","unclosed-comment":"unclosed HTML comment","unclosed-quotes":"unclosed quotes","unclosed-table":"unclosed table","unclosed-tag":"unclosed tag","unescaped-query":"unescaped query string in an anonymous parameter","unexpected-argument":"unexpected template argument","unmatched-closing":"unmatched closing tag","unnecessary-encoding":"unnecessary percent-encoding in an internal link",uppercase:null,"useless-attribute":"useless attribute","useless-fragment":"useless fragment","useless-link-text":"useless link text","variable-anchor":"variable anchor in a section header","vertical-alignment":null,whitespace:null}}}),Ja=on({"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,Gl,Vi,Ee=C({"util/constants.ts"(){"use strict";pe=11,Gl=Qa(),Vi=Ja()}});function pt(e){const t=new Map,s=new WeakMap;return i=>{const r=typeof i=="string"?t:s;if(r.has(i)){const l=r.get(i);return l.lastIndex=0,l}const n=e(i);return r.set(i,n),n}}var Dt,Ze=C({"../common/dist/index.mjs"(){"use strict";Dt=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25"))}}),re,ae=C({"lib/rect.ts"(){"use strict";var e,t,s,i,Qi,n;re=(n=class{constructor(l,a){N(this,i);N(this,e);N(this,t);N(this,s);L(this,e,l),L(this,t,a)}get start(){return f(this,t)}get top(){return P(this,i,Qi).call(this).top}get left(){return P(this,i,Qi).call(this).left}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakSet,Qi=function(){var l;return(l=f(this,s))!=null||L(this,s,f(this,e).getRootNode().posFromIndex(f(this,t))),f(this,s)},n)}}),Qn,Jn,Ut,Ji,qs,B,z,_e,As,H,dn,Me,hn,cn,gn,Gt,bt,pn,Xe,Vl,M=C({"util/lint.ts"(){"use strict";Ze(),Ce(),ae(),j(),Qn=new Set(["tr","td","th","caption"]),Jn=new Set(["Template:!!","Template:!-"]),Ut=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")&&Jn.has(t.name)||t.is("html")&&Qn.has(t.name))return!1;if(t.is("arg"))return t.length>1&&Ut(t.childNodes[1]);if(t.is("magic-word"))try{const s=t.getPossibleValues().map(Ut);return s.includes(2)?2:s.includes(1)&&1}catch(s){}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?1:2},Ji=(e,t,s,i)=>({line:e+s-1,character:(s===1?t:0)+i}),qs=e=>(t,s,i,r,n="error")=>{const{start:l}=s,{top:a,left:o}=s instanceof re?s:new re(t,l),{offsetHeight:u,offsetWidth:d}=t,{startIndex:h,startLine:g,startCol:c}=e(t,l,a,o),{line:p,character:x}=Ji(g,c,u,d);return{rule:i,message:I.msg(r),severity:n,startIndex:h,endIndex:h+t.toString().length,startLine:g,endLine:p,startCol:c,endCol:x}},B=qs((e,t,s,i)=>{const r=e.getRelativeIndex(),{top:n,left:l}=e.parentNode.posFromIndex(r);return{startIndex:t+r,startLine:s+n,startCol:n?l:i+l}}),z=qs((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}),As=(e,t,s)=>({desc:I.msg(t),range:[e,e],text:s}),H=(e,t=0,s="")=>typeof e=="number"?{desc:I.msg("remove"),range:[e,e+t],text:s}:_e(e,"remove",s,t),dn=(e,t)=>_e(e,"decode",Dt(t.text().replace(/%(?=21|3[ce]|5[bd]|7[b-d])/giu,"%25"))),Me=(e,t,s=0)=>({desc:I.msg("close"),range:[e+s,e],text:t}),hn=e=>({desc:I.msg("open"),range:[e+1,e+2],text:""}),cn=(e,t)=>_e(e,"comment",`<!--${t}-->`),gn=(e,t)=>_e(e,"uppercase",t.toUpperCase()),Gt=(e,t=0)=>({desc:I.msg("whitespace"),range:[e,e+t],text:" "}),bt=(e,t,s=1)=>({desc:I.msg("escape"),range:[e,e+s],text:t.repeat(s)}),pn=(e,t)=>({desc:I.msg("escape"),range:[e,e+t.length],text:t.replace(/\|/gu,"|")}),Xe=(e,t,s,i)=>{if(e&&(i||I.viewOnly&&e[0]===me.rev))return e[1];const r=t();return(i||I.viewOnly)&&s([me.rev,r]),r},Vl=(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"]:[]}}),Xn,fn,Ql=C({"parser/selector.ts"(){"use strict";Xn=e=>{if(e.includes("#")){const t=e.indexOf("#"),s=e.slice(0,t),i=e.slice(t+1);return(r,n)=>(t===0||r===s)&&n===i}return e?t=>t===e:()=>!0},fn=(e,t,s)=>{const i=e.split(",").map(r=>Xn(r.trim()));return(({type:r,name:n})=>i.some(l=>l(r,n)))}}}),Xa=on({"../node_modules/binary-search/index.js"(e,t){t.exports=function(s,i,r,n,l){var a,o;if(n===void 0)n=0;else if(n=n|0,n<0||n>=s.length)throw new RangeError("invalid lower bound");if(l===void 0)l=s.length-1;else if(l=l|0,l<n||l>=s.length)throw new RangeError("invalid upper bound");for(;n<=l;)if(a=n+(l-n>>>1),o=+r(s[a],i,a,s),o<0)n=a+1;else if(o>0)l=a-1;else return a;return~n}}}),Kn,Jl,Ka=C({"util/search.ts"(){"use strict";Kn=Ua(Xa()),Jl=(e,t,s)=>{const i=(0,Kn.default)(e,t,s);return i<0?~i:i}}}),ks,mn=C({"mixin/cached.ts"(){"use strict";M(),ks=(e=!0)=>t=>{const s=new WeakMap;return function(...i){return Xe(s.get(this),()=>t.apply(this,i),r=>{s.set(this,r)},e)}}}}),Xl,Ya=C({"mixin/nodeLike.ts"(){"use strict";Xl=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}}}),Yn,Zn,Kt,St,At,Yt,kt,_t,$t,Qe,Kl=C({"lib/node.ts"(){"use strict";Ka(),M(),Ce(),mn(),Ya(),j(),Zn=[Xl],Yn=[ks(!1)],Qe=class{constructor(){Y($t,5,this),Da(this,"childNodes",[]),je(this,Kt),je(this,St),je(this,At),je(this,Yt),je(this,kt),je(this,_t,{})}get parentNode(){return ue(this,Kt)}get nextSibling(){return ue(this,St)}get previousSibling(){return ue(this,At)}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,Kt,t),t||(be(this,St,void 0),be(this,At,void 0));break;case"nextSibling":be(this,St,t);break;case"previousSibling":be(this,At,t);break;case"aIndex":I.viewOnly&&be(this,kt,[me.rev,t]);break;default:this[e]=t}}getRootNode(){return Xe(ue(this,Yt),()=>{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,Yt,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=Jl(s,e,([,,r],n)=>r-n);return{top:i,left:e-s[i][1]}}return}}getDimension(){{const e=this.getLines(),t=e[e.length-1];return{height:e.length,width:t[2]-t[1]}}}getGaps(e){return 0}getRelativeIndex(e){if(e===void 0){const{parentNode:t}=this;return t?t.getRelativeIndex(t.childNodes.indexOf(this)):0}return Xe(ue(this,_t)[e],()=>{const{childNodes:t}=this,s=e+(e<0?t.length:0);let i=this.getAttribute("padding");for(let r=0;r<s;r++)I.viewOnly&&(ue(this,_t)[r]=[me.rev,i]),i+=t[r].toString().length+this.getGaps(r);return i},t=>{ue(this,_t)[e]=t})}getAbsoluteIndex(){return Xe(ue(this,kt),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{be(this,kt,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 i=t+s.length;e.push([s,t,i]),t=i+1}return e}}seal(e,t){const s=!t&&!!this[e];Object.defineProperty(this,e,{enumerable:s,configurable:!0})}lspError(e){throw new Error(`${e} method is only available in the LSP version!`)}},$t=te(null),Kt=new WeakMap,St=new WeakMap,At=new WeakMap,Yt=new WeakMap,kt=new WeakMap,_t=new WeakMap,Z($t,1,"getLines",Yn,Qe),Qe=Z($t,0,"AstNode",Zn,Qe),Y($t,1,Qe)}}),Yl,Za=C({"mixin/elementLike.ts"(){"use strict";Ql(),Yl=e=>{var t,Xi;{class i extends e{constructor(){super(...arguments);N(this,t)}getElementBy(l){const a=[...this.childNodes].reverse();for(;a.length>0;){const o=a.pop(),{type:u,childNodes:d}=o;if(u!=="text"){if(l(o))return o;for(let h=d.length-1;h>=0;h--)a.push(d[h])}}}querySelector(l){return this.getElementBy(P(this,t,Xi).call(this,l))}getElementsBy(l){const a=[...this.childNodes].reverse(),o=[];for(;a.length>0;){const u=a.pop(),{type:d,childNodes:h}=u;if(d!=="text"){l(u)&&o.push(u);for(let g=h.length-1;g>=0;g--)a.push(h[g])}}return o}querySelectorAll(l){return this.getElementsBy(P(this,t,Xi).call(this,l))}escape(){}}return t=new WeakSet,Xi=function(l){return fn(l,this)},i}}}}),er,Ws,tr,Ft,eu=C({"lib/element.ts"(){"use strict";de(),Ce(),Ql(),Kl(),Za(),er=[Yl],Ft=class extends(tr=Qe){get length(){return this.childNodes.length}text(e){return Ye(this.childNodes,e)}normalize(){const e=this.getChildNodes(),t=s=>{var i,r;e.splice(s,1),(i=e[s-1])==null||i.setAttribute("nextSibling",e[s]),(r=e[s])==null||r.setAttribute("previousSibling",e[s-1])};for(let s=e.length-1;s>=0;s--){const{type:i,data:r}=e[s];i!=="text"||e.length===1||this.getGaps(s-(s&&1))||r===""&&t(s)}this.setAttribute("childNodes",e)}removeAt(e){this.lspError("AstElement.removeAt")}insertAt(e,t=this.length){return Fn(this,t,0,[e]),e}closest(e){const t=fn(e,this);let{parentNode:s}=this;for(;s;){if(t(s))return s;({parentNode:s}=s)}}append(...e){this.safeAppend(e)}safeAppend(e){for(const t of e)this.insertAt(t)}safeReplaceChildren(e){}setText(e,t=0){t+=t<0?this.length:0;const s=this.childNodes[t],{data:i}=s;return s.replaceData(e),i}toString(e,t=""){return this.childNodes.map(s=>s.toString(e)).join(t)}caretPositionFromIndex(e){this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(e){this.lspError("AstElement.elementFromIndex")}elementFromPoint(e,t){this.lspError("AstElement.elementFromPoint")}lint(e=this.getAbsoluteIndex(),t){{const s=[];for(let i=0,r=e+this.getAttribute("padding");i<this.length;i++){const n=this.childNodes[i];n.setAttribute("aIndex",r);const l=n.lint(r,t);l.length>0&&Array.prototype.push.apply(s,l),r+=n.toString().length+this.getGaps(i)}return s}}print(e={}){const t=e.class;return this.toString()?(t===""?"":`<span class="wpb-${t!=null?t:this.type}${this.getAttribute("invalid")?" wpb-invalid":""}">`)+vt(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){}},Ws=te(tr),Ft=Z(Ws,0,"AstElement",er,Ft),Y(Ws,1,Ft)}}),Zt,Ms,zs,sr,ir,nr,rr,Us,lr,Ki,tu=C({"lib/text.ts"(){"use strict";var e,Zl,s;de(),M(),j(),Kl(),Zt=String.raw`[${We}\t]*`,Ms=String.raw`[^\S\n]*`,zs=String.raw`<${Ms}(?:/${Ms})?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+`,sr=new RegExp(String.raw`${zs}|https?[:/]/+|(?:rfc|pmid)(?=[-::]?${Zt}\d)|isbn(?=[-::]?${Zt}(?:\d(?:${Zt}|-)){6})`,"giu"),ir=new RegExp(zs,"giu"),nr=new Set(["attr-value","ext-link-text","link-text"]),rr={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},Us=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"]),lr=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch(i){return/\w/u}})(),Ki=(s=class extends Qe{constructor(r){super();N(this,e);Ie(this,"data","");this.data=r}get type(){return"text"}toString(r){var n;return r&&!((n=this.parentNode)!=null&&n.getAttribute("built"))?fe(this.data):this.data}text(){return this.data}lint(r=this.getAbsoluteIndex(),n){var l,a,o;{if(n===!1)return[];const{data:u,parentNode:d,nextSibling:h,previousSibling:g}=this;if(!d)throw new Error("An isolated text node cannot be linted!");const{type:c,parentNode:p}=d;if(c==="attr-value"){const{name:O,tag:J}=p;if(J==="ref"&&(O==="name"||O==="follow")||O==="group"&&(J==="ref"||J==="references")||J==="choose"&&(O==="before"||O==="after"))return[]}if(n!=null||(n=d.isPlain()&&!nr.has(c)?sr:ir),u.search(n)===-1)return[];n.lastIndex=0;const x=[],m=h==null?void 0:h.type,v=h==null?void 0:h.name,S=g==null?void 0:g.type,w=this.getRootNode(),y=w.toString(),{ext:A,html:k,variants:$}=w.getAttribute("config"),{top:b,left:_}=w.posFromIndex(r),{lintConfig:T}=I,F=T.rules["tag-like"],R=typeof F=="object"&&F[1]?new Set(Object.keys(F[1]).filter(O=>O!=="invalid"&&O!=="disallowed")):new Set,W=new Set(["onlyinclude","noinclude","includeonly",...A,...k[0],...k[1],...k[2],...R,...T.getSeverity("tag-like","disallowed")?Us:[]]);for(let O=n.exec(u);O;O=n.exec(u)){const[,J,le]=O;let{index:ee,0:D}=O;if(le&&le!=="]"){const{length:ge}=le;ee+=ge,D=D.slice(ge)}D=D.toLowerCase();const[G]=D,Se=G==="r"||G==="p"||G==="i",Le=G==="{",V=G==="}",K=G==="[",Q=G==="]";let{length:se}=D;if(G==="<"&&!W.has(J.toLowerCase())||K&&c==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(u.slice(ee+1))||h!=null&&h.is("ext")&&v==="nowiki"&&((l=h.innerText)!=null&&l.includes("]"))))continue;Q&&(ee||se>1)&&n.lastIndex--;let oe=r+ee,he=oe+se,U,xe;const ve=y[he],Oe=y[oe-1],nt=Le||K,Es=Le&&Oe==="-"&&$.length>0,Rs=V&&ve==="-"&&$.length>0,En=K&&m==="free-ext-link"&&!u.slice(ee+1).trim()||Q&&S==="free-ext-link"&&!u.slice(0,ee).includes("]");if(Se)U="lonely-http",D=D.toUpperCase(),xe=T.getSeverity(U,D);else if(G==="<"){U="tag-like";let ge;/^<\/?\s/u.test(D)||!/[\s/>]/u.test(ve!=null?ve:"")?ge="invalid":R.has(J)?ge=J:Us.has(J)&&!A.includes(J)&&(ge="disallowed"),xe=T.getSeverity(U,ge)}else if(Es||Rs)U="lonely-bracket",xe=T.getSeverity(U,"converter"),Es&&ee>0?(D="-{",ee--,oe--,se=2):Rs&&ee<u.length-1&&(D="}-",he++,se=2);else if(En)U="lonely-bracket",xe=T.getSeverity(U,"extLink");else if(nt||V||Q)if(U="lonely-bracket",se>1||Le&&ve===G||V&&Oe===G)xe=T.getSeverity(U,"double");else{if(!K||c!=="ext-link-text"){const ge=rr[G],Ps=nt?u.slice(ee+1):u.slice(0,ee);if(Le&&((a=ge.exec(Ps))==null?void 0:a[0])==="}"||V&&((o=ge.exec(Ps))==null?void 0:o[0])==="{")continue;if(!Ps.includes(G)){const jn=nt?"nextSibling":"previousSibling";let Ge=this[jn];for(;Ge&&(Ge.type!=="text"||!ge.test(Ge.data));)Ge=Ge[jn];if(Ge&&ge.exec(Ge.data)[0]!==G)continue}}xe=T.getSeverity(U,"single")}else U="lonely-http",xe=T.getSeverity(U);if(!xe)continue;const Rn=this.posFromIndex(ee),{line:Pn,character:On}=Ji(b,_,Rn.top+1,Rn.left),De={rule:U,message:I.msg("lonely",Se||G==="h"||Es||Rs?D:G),severity:xe,startIndex:oe,endIndex:he,startLine:Pn,endLine:Pn,startCol:On,endCol:On+se};if(T.computeEditInfo)if(G==="<")De.suggestions=[bt(oe,"<")];else if(G==="h"&&c!=="link-text"&&lr.test(Oe||""))De.suggestions=[Gt(oe)];else if(K&&c==="ext-link-text"){const ge=d.getAbsoluteIndex()+d.toString().length;De.suggestions=[bt(ge,"]")]}else if(Q&&En){const ge=r-g.toString().length;De.suggestions=[As(ge,"left-bracket","[")]}else Se&&(De.suggestions=[...O[0]===D?[]:[gn(De,D)],...ve===":"||ve===":"?[Gt(he,1)]:[]]);x.push(De)}return x}}replaceData(r){P(this,e,Zl).call(this,r)}splitText(r){this.lspError("AstText.splitText")}escape(){}print(){return Ht(this.data)}},e=new WeakSet,Zl=function(r){this.setAttribute("data",r)},s)}}),ze,et=C({"mixin/hidden.ts"(){"use strict";ze=(e=!0,t=!0)=>s=>{class i extends s{text(){return""}lint(n){return e?[]:super.lint(n)}}return i}}}),Ne,Re=C({"mixin/noEscape.ts"(){"use strict";Ne=e=>{}}}),Ue,tt=C({"src/syntax.ts"(){"use strict";var e,t;q(),Ue=(t=class extends E{constructor(i,r,n,l,a){super(i,n,l,a);N(this,e);L(this,e,r)}get type(){return f(this,e)}lint(i=this.getAbsoluteIndex()){return super.lint(i,!1)}},e=new WeakMap,t)}}),Pe,He=C({"mixin/padded.ts"(){"use strict";Pe=({length:e})=>t=>{{class s extends t{getAttribute(r){return r==="padding"?e:super.getAttribute(r)}}return s}}}}),Te,st=C({"src/atom.ts"(){"use strict";var e,t;q(),Te=(t=class extends E{constructor(i,r,n,l,a){super(i,n,l,a);N(this,e);L(this,e,r)}get type(){return f(this,e)}set type(i){L(this,e,i)}getAttribute(i){var r;return i==="invalid"?this.type==="converter-flag"&&!!((r=this.parentNode)!=null&&r.isInvalidFlag(this)):super.getAttribute(i)}},e=new WeakMap,t)}}),or,ar,Hs,ur,Be,_s=C({"src/link/base.ts"(){"use strict";var e,t,s,i;M(),Ee(),ae(),He(),Re(),j(),q(),st(),or=r=>r==="redirect-target"||r==="link",ar=[Ne,Pe("[[")],Be=(i=class extends(ur=E){constructor(n,l,a,o=[],u="|"){super(void 0,a,o,{});N(this,e,!0);N(this,t);N(this,s);if(this.insertAt(new Te(n,"link-target",a,o,{})),l!==void 0){const d=new E(l,a,o,{});d.type="link-text",d.setAttribute("stage",pe-1),this.insertAt(d)}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(n,l){n==="bracket"?L(this,e,l):n==="title"?L(this,s,l):super.setAttribute(n,l)}toString(n){const l=super.toString(n,f(this,t));return f(this,e)?`[[${l}]]`:l}text(){const n=super.text("|");return f(this,e)?`[[${n}]]`:n}getAttribute(n){return n==="title"?f(this,s):super.getAttribute(n)}getGaps(n){return n===0?f(this,t).length:1}lint(n=this.getAbsoluteIndex(),l){{const a=super.lint(n,l),{childNodes:[o,u],type:d}=this,{encoded:h,fragment:g}=f(this,s),{lintConfig:c}=I,{computeEditInfo:p,fix:x}=c,m=new re(this,n);let v="unknown-page",S=c.getSeverity(v);if(S&&o.childNodes.some(({type:w})=>w==="template")&&a.push(B(o,m,v,"template-in-link",S)),v="url-encoding",S=c.getSeverity(v),S&&h){const w=B(o,m,v,"unnecessary-encoding",S);(p||x)&&(w.fix=dn(w,o)),a.push(w)}if(v="pipe-like",S=c.getSeverity(v,"link"),S&&(d==="link"||d==="category")){const w=u==null?void 0:u.childNodes.findIndex(A=>A.type==="text"&&A.data.includes("|")),y=u==null?void 0:u.childNodes[w];if(y){const A=B(u,m,v,"pipe-in-link",S);if(p){const k=A.startIndex+u.getRelativeIndex(w);A.suggestions=[pn(k,y.data)]}a.push(A)}}if(v="no-ignored",S=c.getSeverity(v,"fragment"),S&&g!==void 0&&!or(d)){const w=B(o,m,v,"useless-fragment",S);if(p||x){const y=o.childNodes.findIndex(k=>k.type==="text"&&k.data.includes("#")),A=o.childNodes[y];A&&(w.fix=H(w,o.getRelativeIndex(y)+A.data.indexOf("#")))}a.push(w)}return a}}getTitle(n,l){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:l,temporary:n,decode:!0,selfLink:!0})}print(){return super.print(f(this,e)?{pre:"[[",post:"]]",sep:f(this,t)}:{sep:f(this,t)})}json(n,l=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i),Hs=te(ur),Be=Z(Hs,0,"LinkBaseToken",ar,Be),Y(Hs,1,Be)}}),dr,Ds,hr,$e,it=C({"src/nowiki/base.ts"(){"use strict";Re(),q(),dr=[Ne],$e=class extends(hr=E){get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}},Ds=te(hr),$e=Z(Ds,0,"NowikiBaseToken",dr,$e),Y(Ds,1,$e)}}),cr,Gs,gr,we,wt=C({"src/nowiki/noinclude.ts"(){"use strict";et(),it(),cr=[ze()],we=class extends(gr=$e){get type(){return"noinclude"}toString(e){return e?"":super.toString()}},Gs=te(gr),we=Z(Gs,0,"NoincludeToken",cr,we),Y(Gs,1,we)}}),eo,su=C({"src/link/redirectTarget.ts"(){"use strict";M(),j(),_s(),wt(),eo=class extends Be{get type(){return"redirect-target"}constructor(e,t,s,i){super(e,void 0,s,i),t!==void 0&&this.insertAt(new 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,r=i.getSeverity(s,"redirect");if(r&&this.length===2){const n=B(this.lastChild,{start:e},s,"useless-link-text",r);n.startIndex--,n.startCol--,(i.computeEditInfo||i.fix)&&(n.fix=H(n)),t.push(n)}return t}}}}}),pr,Vs,fr,Et,iu=C({"src/redirect.ts"(){"use strict";var e,t,s;et(),Re(),q(),tt(),su(),pr=[ze(!1,!1),Ne],Et=(s=class extends(fr=E){constructor(r,n,l,a,o,u,d=[]){super(void 0,u,d);N(this,e);N(this,t);L(this,e,r),L(this,t,o),this.append(new Ue(n,"redirect-syntax",u,d),new eo(l,a==null?void 0:a.slice(1),u,d))}get type(){return"redirect"}getAttribute(r){return r==="padding"?f(this,e).length:super.getAttribute(r)}toString(r){return f(this,e)+super.toString(r)+f(this,t)}lint(r=this.getAbsoluteIndex()){{const n=r+f(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",n),this.lastChild.lint(n)}}print(){return super.print({pre:f(this,e),post:f(this,t)})}},e=new WeakMap,t=new WeakMap,s),Vs=te(fr),Et=Z(Vs,0,"RedirectToken",pr,Et),Y(Vs,1,Et)}}),to={};ie(to,{parseRedirect:()=>so});var so,nu=C({"parser/redirect.ts"(){"use strict";j(),iu(),so=(e,t,s)=>{var r;(r=t.regexRedirect)!=null||(t.regexRedirect=new RegExp(String.raw`^(\s*)((?:${t.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));const i=t.regexRedirect.exec(e);return i&&I.normalizeTitle(i[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,page:""}).valid?(e=`\0${s.length}o${e.slice(i[0].length)}`,new Et(...i.slice(1),t,s),e):!1}}}),mr,Qs,xr,Rt,ru=C({"src/onlyinclude.ts"(){"use strict";He(),Re(),q(),mr=[Ne,Pe("<onlyinclude>")],Rt=class extends(xr=E){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>'})}},Qs=te(xr),Rt=Z(Qs,0,"OnlyincludeToken",mr,Rt),Y(Qs,1,Rt)}}),Qt,$s=C({"mixin/gapped.ts"(){"use strict";Qt=(e=1)=>t=>{class s extends t{getGaps(){return e}}return s}}}),vr,Js,br,Je,xn=C({"src/tagPair/index.ts"(){"use strict";var e,t;$s(),Re(),q(),vr=[Qt(),Ne],Je=(t=class extends(br=E){constructor(i,r,n,l,a,o=[]){super(void 0,a);N(this,e);Ie(this,"closed");Ie(this,"selfClosing");this.setAttribute("name",i.toLowerCase()),L(this,e,[i,l||i]),this.closed=l!=="",this.selfClosing=l===void 0,this.append(r,n);const u=typeof r=="string"?-1:o.indexOf(r);o.splice(u===-1?1/0:u,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(i){const{selfClosing:r,firstChild:n,lastChild:l}=this,[a,o]=f(this,e);return r?`<${a}${n.toString(i)}/>`:`<${a}${n.toString(i)}>${l.toString(i)}${this.closed?`</${o}>`:""}`}text(){const[i,r]=f(this,e);return this.selfClosing?`<${i}${this.firstChild.text()}/>`:`<${i}${super.text(">")}${this.closed?`</${r}>`:""}`}getAttribute(i){return i==="padding"?f(this,e)[0].length+1:super.getAttribute(i)}print(){const[i,r]=f(this,e);return super.print(this.selfClosing?{pre:`<${i}`,post:"/>"}:{pre:`<${i}`,sep:">",post:this.closed?`</${r}>`:""})}},e=new WeakMap,t),Js=te(br),Je=Z(Js,0,"TagPairToken",vr,Je),Y(Js,1,Je)}}),vn,io=C({"src/tag/index.ts"(){"use strict";var e,t,s,i;M(),Ce(),j(),q(),vn=(i=class extends E{constructor(n,l,a,o,u){super(void 0,o,u);N(this,e);N(this,t);N(this,s);this.insertAt(l),L(this,e,a),L(this,t,n)}get closing(){return f(this,e)}toString(n){return`<${f(this,e)?"/":""}${f(this,t)}${super.toString(n)}${this.selfClosing?"/":""}>`}text(n=""){const{closing:l}=this;return`<${l&&!n?"/":""}${f(this,t)}${l?"":super.text()}${n}>`}getAttribute(n){return n==="padding"?f(this,t).length+(f(this,e)?2:1):super.getAttribute(n)}findMatchingTag(){return Xe(f(this,s),()=>{const{type:n,name:l,parentNode:a,closing:o,selfClosing:u}=this;let d=!1,h=!1;if(n==="html"){const{html:[,v,S]}=this.getAttribute("config");d=S.includes(l),h=v.includes(l)}if(d||h&&u)return this;if(!a)return;const{childNodes:g}=a,c=g.indexOf(this),p=o?g.slice(0,c).reverse():g.slice(c+1),x=[this],{rev:m}=me;for(const v of p)if(!(!v.is(n)||n==="html"&&(v.name!==l||h&&v.selfClosing)))if(f(v,e)===o){if(n==="tvar")return;x.push(v)}else{const S=x.pop();if(S===this)return v;I.viewOnly&&(L(S,s,[m,v]),L(v,s,[m,S]))}if(I.viewOnly)for(const v of x)L(v,s,[m,void 0])},n=>{L(this,s,n),n[1]&&n[1]!==this&&L(n[1],s,[me.rev,this])})}print(){return super.print({pre:`<${f(this,e)?"/":""}${f(this,t)}`,post:`${this.selfClosing?"/":""}>`})}json(n,l=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i)}}),yr,Xs,wr,qe,lu=C({"src/tag/tvar.ts"(){"use strict";et(),io(),tt(),yr=[ze()],qe=class extends(wr=vn){get type(){return"tvar"}constructor(e,t,s,i,r){const n=new Ue(t,"tvar-name",i,r);super(e,n,s,i,r)}},Xs=te(wr),qe=Z(Xs,0,"TvarToken",yr,qe),Y(Xs,1,qe)}}),no,ou=C({"src/tagPair/translate.ts"(){"use strict";var e,ro,s;q(),xn(),tt(),lu(),no=(s=class extends Je{constructor(r,n,l,a=[]){const o=new Ue(r,"translate-attr",l,a);n=n==null?void 0:n.replace(/<tvar(\|[^>]+)>([\s\S]*?)<\/>/gu,(d,h,g)=>(new qe("tvar",h,!1,l,a),new qe("","",!0,l,a),`\0${a.length-2}n${g}\0${a.length}n`)).replace(/<(tvar)(\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\3|[^"'\s>]+))?\s*)>([\s\S]*?)<\/(tvar)(\s*)>/giu,(d,h,g,c,p,x,m)=>(new qe(h,g,!1,l,a),new qe(x,m,!0,l,a),`\0${a.length-2}n${p}\0${a.length}n`));const u=new E(n,l,a);u.type="translate-inner";super("translate",o,u,"translate",l,a);N(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(){return`<span class="wpb-ext"><translate${P(this,e,ro).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,ro=function(){return this.firstChild.toString()===" nowrap"},s)}}),Sr,Ks,Ar,Pt,au=C({"src/tagPair/include.ts"(){"use strict";M(),ae(),et(),j(),xn(),Sr=[ze(!1)],Pt=class extends(Ar=Je){get type(){return"include"}constructor(e,t="",s,i,r,n){super(e,t,s!=null?s:"",s===void 0||i!=null?i:"",r,n)}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){{const t=[],{firstChild:s,closed:i,name:r}=this,n=new re(this,e),l=["no-ignored","unclosed-comment"],{lintConfig:a}=I,{computeEditInfo:o}=a,u=l.map(d=>a.getSeverity(d,"include"));if(u[0]&&s.data.trim()){const d=B(s,n,l[0],"useless-attribute",u[0]);o&&(d.suggestions=[H(d)]),t.push(d)}if(u[1]&&!i){const d=z(this,n,l[1],I.msg("unclosed",`<${r}>`),u[1]);o&&(d.suggestions=[Me(d.endIndex,`</${r}>`)]),t.push(d)}return t}}},Ks=te(Ar),Pt=Z(Ks,0,"IncludeToken",Sr,Pt),Y(Ks,1,Pt)}}),Ts,bn=C({"mixin/attributesParent.ts"(){"use strict";Ts=(e=0)=>t=>{var s,lo;{class r extends t{constructor(){super(...arguments);N(this,s)}hasAttr(a){this.lspError("AttributesParent.hasAttr")}getAttr(a){return P(this,s,lo).call(this).getAttr(a)}}return s=new WeakSet,lo=function(){return this.childNodes[e]},r}}}}),ne,Ys,Zs,Tt,es,ei,Ct,ti,si,ii,ts,ni,ri,li,Ae,oo,ao,uo,ho,uu=C({"util/sharable.ts"(){"use strict";ne=new Set(["align"]),Ys=new Set(["cite"]),Zs=new Set(["cite","datetime"]),Tt=new Set(["width"]),es=new Set(["axis","align","bgcolor","height","width","valign"]),ei=new Set([...es,"abbr","headers","scope","rowspan","colspan"]),Ct=new Set(["type"]),ti=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),si=new Set(["clear"]),ii=new Set(["bgcolor","align","valign"]),ts=new Set(["qid","forcemathmode","type","display"]),ni=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),ri=new Set(["weight"]),li=new Set(["width","height","zoom","latitude","longitude","align","mapstyle","lang","alt","text"]),Ae=new Set,oo=new Set(["id","class","style","lang","dir","title","tabindex","aria-describedby","aria-flowto","aria-hidden","aria-label","aria-labelledby","aria-level","aria-owns","role","about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),ao={div:ne,h1:ne,h2:ne,h3:ne,h4:ne,h5:ne,h6:ne,blockquote:Ys,q:Ys,p:ne,br:si,pre:Tt,ins:Zs,del:Zs,ul:Ct,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...ti,"border"]),caption:ne,tr:ii,td:ei,th:ei,font:new Set(["size","color","face"]),hr:Tt,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Ct,poem:ne,categorytree:ne,combooption:ne,math:Ae,chem:Ae,ce:Ae,img:new Set(["alt","src","width","height","loading","srcset"])},uo={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:Ae,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:ri,choicetemplate:ri,imagemap:Ae,inputbox:Ae,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:Ae,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([...ts,"chem"]),chem:ts,ce:ts,hiero:Ae,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:ni,syntaxhighlight:ni,templatedata:Ae,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:Ae,mapframe:new Set([...li,"frameless"]),maplink:new Set([...li,"class"]),rss:new Set(["template","templatename","max","highlight","filter","filterout","reverse","date","item-max-length"]),"page-collection":new Set(["lang","name","description","end-date"])},ho={table:ti,td:new Set([...es,"scope"]),th:es,br:si,caption:ne,div:ne,hr:Tt,h1:ne,h2:ne,h3:ne,h4:ne,h5:ne,h6:ne,li:Ct,p:ne,pre:Tt,tr:ii,ul:Ct}}}),kr,_r,$r,Tr,ds,du=C({"src/attribute.ts"(){"use strict";var e,t,s,i,r,co,Yi,a;M(),de(),Ee(),uu(),ae(),j(),q(),st(),kr=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,_r=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,$r=new Set(["ext","arg","magic-word","template"]),Tr=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),ds=(a=class extends E{constructor(u,d,h,g="",c,p=[],x=I.getConfig(),m=[]){const v=new Te(h,"attr-key",x,m);let S;if(h==="title"||d==="img"&&h==="alt")S=new E(c,x,m,{}),S.type="attr-value",S.setAttribute("stage",pe-1);else if(d==="gallery"&&h==="caption"||d==="ref"&&h==="details"||(d==="mapframe"||d==="maplink")&&h==="text"||d==="choose"&&(h==="before"||h==="after")){const w=Fe(ce({},x),{excludes:[...x.excludes,"heading","html","table","hr","list"]});S=new E(c,w,m,{}),S.type="attr-value",S.setAttribute("stage",1)}else S=new Te(c,"attr-value",x,m,{});super(void 0,x,m);N(this,r);N(this,e);N(this,t);N(this,s);N(this,i);L(this,e,u),this.append(v,S),L(this,s,g),L(this,i,[...p]),L(this,t,d),this.setAttribute("name",xt(fe(h)))}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,r,co).call(this),super.afterBuild()}toString(u){const[d="",h=""]=f(this,i);return f(this,s)?super.toString(u,f(this,s)+d)+h:this.firstChild.toString(u)}text(){return f(this,s)?`${super.text(`${f(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var u,d;return f(this,s)?f(this,s).length+((d=(u=f(this,i)[0])==null?void 0:u.length)!=null?d:0):0}lint(u=this.getAbsoluteIndex(),d){var h;{const g=super.lint(u,d),{balanced:c,firstChild:p,lastChild:x,name:m,tag:v}=this,S=new re(this,u),w=["unclosed-quote","obsolete-attr"],{lintConfig:y}=I,A=w.map($=>y.getSeverity($,m));if(A[0]&&!c){const $=B(x,S,w[0],"unclosed-quotes",A[0]);$.startIndex--,$.startCol--,y.computeEditInfo&&($.suggestions=[Me($.endIndex,f(this,i)[0])]),g.push($)}const k=P(this,r,Yi).call(this,u,S);return k&&g.push(k),A[1]&&((h=ho[v])!=null&&h.has(m))&&g.push(B(p,S,w[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,r,Yi).call(this):super.getAttribute(u)}print(){const[u="",d=""]=f(this,i);return f(this,s)?super.print({sep:Ht(f(this,s))+u,post:d}):super.print()}json(u,d=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakSet,co=function(){this.setAttribute("name",xt(this.firstChild.text()))},Yi=function(u,d){const{firstChild:h,lastChild:g,type:c,name:p,tag:x,parentNode:m}=this,v=!g.childNodes.some(({type:_})=>$r.has(_)),S=this.getValue(),w=uo[x],y=ao[x],{length:A}=this.toString();let k="illegal-attr",$,b;if({lintConfig:$}=I,{computeEditInfo:b}=$,!(w!=null&&w.has(p))&&!(y!=null&&y.has(p))&&(c==="ext-attr"?w||y:!/\{\{[^{]+\}\}/u.test(p))&&(c==="ext-attr"&&!y||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(p)&&(x==="meta"||x==="link"||!oo.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(h,d,k,"illegal-attribute-name",_);return b&&(T.suggestions=[H(u,A)]),T}}}else if(p==="style"&&typeof S=="string"&&kr.test(S)){if(u===void 0)return!0;{k="insecure-style";const _=$.getSeverity(k);return _&&B(g,d,k,"insecure-style",_)}}else if(p==="tabindex"&&typeof S=="string"&&S!=="0"){if(u===void 0)return!0;{const _=$.getSeverity(k,"tabindex");if(_){const T=B(g,d,k,"nonzero-tabindex",_);return b&&(T.suggestions=[H(u,A),_e(T,"0 tabindex","0")]),T}}}else if(typeof S=="string"&&((/^xmlns:[\w:.-]+$/u.test(p)||Tr.has(p))&&_r.test(S)||v&&(p==="href"||x==="img"&&p==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(S))){if(u===void 0)return!0;{const _=$.getSeverity(k,"value");return _&&B(g,d,k,"illegal-attribute-value",_)}}else if(v&&c!=="ext-attr"){const _=Vl(x,p),T=String(S).toLowerCase();if(_.length>0&&_.every(F=>F!==T)){if(u===void 0)return!0;{const F=$.getSeverity(k,"value");return F&&B(g,d,k,"illegal-attribute-value",F)}}}return!1},a)}}),oi,Cr,Ir,Cs,yn=C({"src/attributes.ts"(){"use strict";var e,t,hs,i;M(),de(),ae(),j(),q(),st(),du(),oi=r=>r.slice(0,-1),Cr=r=>`${oi(r)}-dirty`,Ir=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch(r){return/[^\W_]/u}})(),Cs=(i=class extends E{constructor(n,l,a,o,u=[]){super(void 0,o,u,{});N(this,t);N(this,e);if(L(this,e,l),this.setAttribute("name",a),n){const d=/([^\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=d.exec(n),c=0;const p=(()=>{h&&(super.insertAt(new Te(h,Cr(l),o,u,{})),h="")});for(;g;){const{index:x,0:m,1:v,2:S,3:w,4:y,5:A,6:k}=g;if(h+=n.slice(c,x),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(fe(v).trim())){const $=y!=null?y:k,b=[w,A],_=new ds(oi(l),a,v,S,$,b,o,u);p(),super.insertAt(_)}else h+=m;({lastIndex:c}=d),g=d.exec(n)}h+=n.slice(c),p()}}get type(){return f(this,e)}afterBuild(){const{parentNode:n}=this;n!=null&&n.is("td")&&this.setAttribute("name",n.subtype),super.afterBuild()}getAttrTokens(n){return this.childNodes.filter(l=>l instanceof ds&&(!n||l.name===xt(n)))}hasAttr(n){return this.getAttrTokens(n).length>0}getAttrToken(n){{const l=this.getAttrTokens(n);return l[l.length-1]}}getAttr(n){var l;return(l=this.getAttrToken(n))==null?void 0:l.getValue()}lint(n=this.getAbsoluteIndex(),l){{const a=super.lint(n,l),{parentNode:o,childNodes:u}=this,d=new Map,h=new Set,g=new re(this,n),c=["no-ignored","no-duplicate"],{lintConfig:p}=I,{computeEditInfo:x,fix:m}=p,v=["closingTag","invalidAttributes","nonWordAttributes"].map(w=>p.getSeverity(c[0],w));if(v[0]&&P(this,t,hs).call(this)){const w=z(this,g,c[0],"attributes-of-closing-tag",v[0]);if(x){const y=o.getAbsoluteIndex();w.suggestions=[H(w),hn(y)]}a.push(w)}for(const w of u)if(w instanceof ds){const{name:y}=w;d.has(y)?(h.add(y),d.get(y).push(w)):d.set(y,[w])}else{const y=w.text().trim(),A=v[Ir.test(y)?1:2];if(y&&A){const k=B(w,g,c[0],"invalid-attribute",A);x&&(k.suggestions=[H(k,0," ")]),a.push(k)}}const S=p.getSeverity(c[1],"attribute");if(S&&h.size>0)for(const w of h){const y=d.get(w).map(A=>{const k=A.getValue();return[A,k===!0?"":k]});Array.prototype.push.apply(a,y.map(([A,k],$)=>{const b=B(A,g,c[1],I.msg("duplicate-attribute",w),S);if(x||m){const _=H(b);!k||y.slice(0,$).some(([,T])=>T===k)?b.fix=_:x&&(b.suggestions=[_])}return b}))}return a}}getAttribute(n){return n==="invalid"?P(this,t,hs).call(this):super.getAttribute(n)}print(){return this.toString()?`<span class="wpb-${this.type}${P(this,t,hs).call(this)?" wpb-invalid":""}">${this.childNodes.map(n=>n.print(n instanceof Te?{class:n.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,hs=function(){const{parentNode:n}=this;return(n==null?void 0:n.type)==="html"&&n.closing&&this.text().trim()!==""},i)}}),go={};ie(go,{PreToken:()=>po});var po,hu=C({"src/pre.ts"(){"use strict";Ee(),q(),wt(),po=class extends E{get type(){return"ext-inner"}constructor(e,t,s=[]){if(e){const i=/<nowiki>/giu,r=/<\/nowiki>/giu,{length:n}=i.source;let l=i.exec(e);l&&(r.lastIndex=l.index+n);let a=r.exec(e),o=0,u="";for(;l&&a;)new we(l[0],t,s,!0),new we(a[0],t,s,!0),u+=`${e.slice(o,l.index)}\0${s.length-1}n${e.slice(l.index+n,a.index)}\0${s.length}n`,o=a.index+n+1,i.lastIndex=o,l=i.exec(e),l&&(r.lastIndex=l.index+n),a=r.exec(e);e=u+e.slice(o)}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)}}}}),Is,wn=C({"src/multiLine/index.ts"(){"use strict";q(),Is=class extends E{get type(){return"ext-inner"}toString(e){return super.toString(e,`
|
|
3
3
|
`)}text(){return super.text(`
|
|
4
4
|
`).replace(/\n\s*\n/gu,`
|
|
5
5
|
`)}getGaps(){return 1}print(){return super.print({sep:`
|
|
6
|
-
`})}}}}),
|
|
7
|
-
`).map(n=>r?n:Jt(n,s,i,e)).map(n=>new pa(n,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 r=new le(this,e),n=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(j(o,r,t,n,i));else{const u=a.findIndex(({type:h})=>h!=="text"),d=a.slice(0,u===-1?void 0:u).map(String).join("");if(d&&!(u===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(d)){const h=j(o,r,t,n,i);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,oi,Lr,at,xa=C({"src/heading.ts"(){"use strict";var e,t,hs,i;W(),Ie(),ue(),Re(),O(),B(),tt(),Nr=[Le],at=(i=class extends(Lr=E){constructor(n,l,o,a=[]){super(void 0,o,a);L(this,t);L(this,e);F(this,e,n);const u=new E(l[0],o,a);u.type="heading-title",u.setAttribute("stage",2);const d=new Ue(l[1],"heading-trail",o,a);this.append(u,d)}get type(){return"heading"}get level(){return f(this,e)}toString(n){const l=P(this,t,hs).call(this);return l+this.firstChild.toString(n)+l+this.lastChild.toString(n)}text(){const n=P(this,t,hs).call(this);return n+this.firstChild.text()+n}getAttribute(n){return n==="invalid"?this.inHtmlAttrs()===2:n==="padding"?this.level:super.getAttribute(n)}getGaps(){return this.level}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),{firstChild:a,level:u}=this,d=a.toString(),h=d.startsWith("="),g=h||d.endsWith("="),c=new le(this,n),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=j(a,c,x[0],"<h1>",S[0]);v&&!g&&(y.suggestions=[Te(y,"h2",`=${d}=`)]),o.push(y)}if(S[1]&&g){const y=I.msg("unbalanced-in-section-header",'"="'),A=j(a,c,x[1],y,S[1]);if(!(!v||d==="="))if(h){const[k]=/^=+/u.exec(d),$=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(d)[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(Ls("quote")),k=A.filter(({bold:b})=>b),$=A.filter(({italic:b})=>b);if(k.length%2){const b=j(k[k.length-1],Ee(ge({},c),{start:n+u,left:c.left+u}),x[2],I.msg("unbalanced-in-section-header","bold-apostrophes"),S[2]);if(v||w){const _=n+u+d.length,T=U(b);y.slice(b.endIndex,_).trim()?v&&(b.suggestions=[T,We(_,"'''")]):k.length===1&&$.length===0?b.fix=T:v&&(b.suggestions=[T])}o.push(b)}if($.length%2){const b=j($[$.length-1],{start:n+u},x[2],I.msg("unbalanced-in-section-header","italic-apostrophes"),S[2]);if(v||w){const _=n+u+d.length;y.slice(b.endIndex,_).trim()?v&&(b.suggestions=[We(_,"''")]):$.length===1&&k.length===0?b.fix=U(b):v&&(b.suggestions=[U(b)])}o.push(b)}}return o}}print(){const n=P(this,t,hs).call(this);return super.print({pre:n,sep:n})}json(n,l=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakSet,hs=function(){return"=".repeat(this.level)},i),oi=te(Lr),at=Z(oi,0,"HeadingToken",Nr,at),Y(oi,1,at)}}),Fr,va,gu=C({"src/parameter.ts"(){"use strict";he(),W(),O(),B(),Fr=new RegExp(`https?://${ft}${mt}$`,"iu"),va=class extends E{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){}constructor(e,t,s,i=[]){super(void 0,s,i);const r=new E(typeof e=="number"?void 0:e,s,i,{}),n=new E(t,s,i);r.type="parameter-key",r.setAttribute("stage",2),n.type="parameter-value",n.setAttribute("stage",2),this.append(r,n)}trimName(e,t=!0){const s=(typeof e=="string"?e:e.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",s),s}afterBuild(){if(!this.anon){const{parentNode:e,firstChild:t}=this,s=this.trimName(t);e&&e.getArgs(s,!1,!1).add(this)}super.afterBuild()}toString(e){return this.anon?this.lastChild.toString(e):super.toString(e,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(e=this.getAbsoluteIndex(),t){var s;{const i=super.lint(e,t),r="unescaped",{lintConfig:n}=I,l=n.getSeverity(r);if(l){const{firstChild:o}=this,a=(s=Fr.exec(o.text()))==null?void 0:s[0];try{if(a&&new URL(a).search){const u=j(o,{start:e},r,"unescaped-query",l);u.startIndex=u.endIndex,u.startLine=u.endLine,u.startCol=u.endCol,u.endIndex++,u.endCol++,(n.computeEditInfo||n.fix)&&(u.fix=bt(u.startIndex,"{{=}}")),i.push(u)}}catch(u){}}return i}}print(){return super.print({sep:this.anon?"":"="})}json(e,t=this.getAbsoluteIndex()){}}}}),Er,ui,Rr,ot,pu=C({"src/transclude.ts"(){"use strict";var e,t,s,i,r,n,cs,ba,a;he(),W(),Ie(),ue(),_s(),Re(),O(),B(),gu(),st(),tt(),Er=[Le,Qt()],ot=(a=class extends(Rr=E){constructor(d,h,g,c=[]){var T,N;let p;const x=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(d);x&&(p=Number(x[1]),d=d.replace(`\0${p}h`,c[p].toString().replace(/^\n/u,"")));super(void 0,g,c,{});L(this,n);Ne(this,"modifier","");L(this,e,"template");L(this,t,":");L(this,s,!1);L(this,i,new Map);L(this,r);const{parserFunction:[m,v],variable:w,functionHook:S}=g,y=(T=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(d))==null?void 0:T[0];if(y)this.setAttribute("modifier",y),d=d.slice(y.length);else if(d.includes(":")){const[R,...q]=d.split(":"),[J]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((N=q[0])!=null?N:"");this.setModifier(`${R}:${J}`)&&(d=q.join(":").slice(J.length))}const A=d.search(/[::]/u),k=d[A]===":",$=A!==-1;if($||h.length===0&&!f(this,s)){const R=$?d.slice(0,A):d,q=$&&d.slice(A+1),J=ve(R),z=$?J.slice(J.search(/\S/u))+(k?":":""):J.trim(),X=z.toLowerCase(),pe=Array.isArray(v),G=pe?v.includes(z):Object.prototype.hasOwnProperty.call(v,z),V=!pe&&G?v[z]:Object.prototype.hasOwnProperty.call(m,X)&&m[X],K=pe&&G||!("functionHook"in g)||S.includes(V),Fe=pe&&G||w.includes(V);if($?V&&K:Fe){this.setAttribute("name",V||X.replace(/^#|:$/u,"")),F(this,e,"magic-word"),k&&F(this,t,":");const H=new Ue(R,"magic-word-name",g,c);if(super.insertAt(H),q!==!1&&h.unshift([q]),this.name==="invoke")for(let ee=0;ee<2;ee++){const D=h.shift();if(!D)break;const ne=new xe(D.join("="),`invoke-${ee?"function":"module"}`,g,c);super.insertAt(ne)}}}if(this.type==="template"){const R=ve(d).trim();if(!this.normalizeTitle(R,10,{halfParsed:!0,temporary:!0}).valid)throw c.pop(),new SyntaxError("Invalid template name");const q=new xe(d,"template-name",g,c,{});super.insertAt(q)}typeof p=="number"&&(c[p]=void 0);const b=this.isTemplate();let _=1;for(let R=0;R<h.length;R++){const q=h[R];b||this.name==="switch"&&R>0||this.name==="tag"&&R>1||(q[0]=q.join("="),q.length=1),q.length===1&&(q.unshift(_),_++),this.insertAt(new va(...q,g,c))}this.seal("modifier")}get type(){return f(this,e)}get module(){}get function(){}setModifier(d){const{parserFunction:[,,h,g]}=this.getAttribute("config"),c=ve(d).trim();if(d&&!c.endsWith(":"))return!1;const p=c.slice(0,-1).toLowerCase(),x=h.includes(p),m=g.includes(p);return f(this,s)&&x||!f(this,s)&&(m||!d)||(ye.running||this.length>1)&&(x||m||!d)?(this.setAttribute("modifier",d),F(this,s,x),!!d):!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,P(this,n,cs).call(this)),this.setAttribute("name",f(this,r).title))}toString(d){const{childNodes:h,length:g,firstChild:c,modifier:p,type:x}=this;return`{{${p}${x==="magic-word"?c.toString(d)+(g===1?"":f(this,t))+h.slice(1).map(m=>m.toString(d)).join("|"):super.toString(d,"|")}}}`}text(){const{childNodes:d,length:h,firstChild:g,modifier:c,type:p,name:x}=this;return p==="magic-word"&&x==="vardefine"?"":`{{${c}${p==="magic-word"?g.text()+(h===1?"":f(this,t))+Ye(d.slice(1),"|"):super.text("|")}}}`}getAttribute(d){switch(d){case"padding":return this.modifier.length+2;case"title":return f(this,r);case"colon":return f(this,t);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!P(this,n,cs).call(this).valid);default:return super.getAttribute(d)}}lint(d=this.getAbsoluteIndex(),h){{const g=super.lint(d,h);if(!this.isTemplate())return g;const{type:c,childNodes:p,length:x}=this,m=new le(this,d),{lintConfig:v}=I,{computeEditInfo:w}=v,S=c==="magic-word";let y="no-ignored",A=v.getSeverity(y,"fragment");if(S&&!P(this,n,cs).call(this).valid)y="invalid-invoke",A=v.getSeverity(y,"name"),A&&g.push(j(p[1],m,y,"illegal-module",A));else if(A){const k=p[S?1:0],$=k.childNodes.findIndex(_=>_.type==="text"&&xs(_.data).includes("#")),b=k.childNodes[$];if(b){const _=j(k,m,y,"useless-fragment",A);w&&(_.suggestions=[U(_,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=j(_,m,y,$,A);return w&&(T.suggestions=[U(T,-1)]),T}))}return g}}insertAt(d,h=this.length){return super.insertAt(d,h),d.anon?P(this,n,ba).call(this,d):d.name&&this.getArgs(d.name,!1,!1).add(d),d}getAllArgs(){return this.childNodes.filter(Ls("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:d})=>d)}getArgs(d,h,g=!0){const c=String(d).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:d}])=>d>1).map(([d,h])=>[d,[...h]])}getPossibleValues(){const{type:d,name:h,childNodes:g}=this;if(d==="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 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:d,length:h,firstChild:g,modifier:c,type:p}=this;return`<span class="wpb-${p}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${p==="magic-word"?Ht(c)+g.print()+(h===1?"":f(this,t))+vt(d.slice(1),{sep:"|"}):(c?`<span class="wpb-magic-word">${Ht(c)}</span>`:"")+vt(d,{sep:"|"})}}}</span>`}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakSet,cs=function(){const d=this.type==="template";return this.normalizeTitle((d?"":"Module:")+this.childNodes[d?0:1].text(),10,ge({temporary:!0},!d&&{page:""}))},ba=function(d){const h=this.getAnonArgs(),g=typeof d!="number";for(let c=g?h.indexOf(d):d-1;c<h.length;c++){const p=h[c],{name:x}=p,m=String(c+1);(x!==m||p===d)&&(p.setAttribute("name",m),this.getArgs(m,!1,!1).add(p))}},a),ui=te(Rr),ot=Z(ui,0,"TranscludeToken",Er,ot),Y(ui,1,ot)}}),Pr,di,Or,Ot,fu=C({"src/hidden.ts"(){"use strict";et(),B(),Pr=[ze()],Ot=class extends(Or=E){get type(){return"hidden"}getAttribute(e){return e==="invalid"||super.getAttribute(e)}},di=te(Or),Ot=Z(di,0,"HiddenToken",Pr,Ot),Y(di,1,Ot)}}),jr,hi,Br,jt,mu=C({"src/arg.ts"(){"use strict";var e,xu,s;he(),W(),ue(),He(),_s(),Re(),O(),B(),st(),fu(),jr=[Le,Pe("{{{"),Qt()],jt=(s=class extends(Br=E){constructor(r,n,l=[]){super(void 0,n,l,{});L(this,e);for(let o=0;o<r.length;o++){const a=r[o];if(o===0){const u=new xe(a,"arg-name",n,l,{});super.insertAt(u)}else if(o>1){const u=new Ot(a,n,l);super.insertAt(u)}else{const u=new E(a,n,l);u.type="arg-default",u.setAttribute("stage",2),super.insertAt(u)}}}get type(){return"arg"}get default(){}toString(r){return`{{{${super.toString(r,"|")}}}}`}text(){return`{{{${Ye(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){super.afterBuild()}lint(r=this.getAbsoluteIndex(),n){{const{childNodes:[l,o,...a]}=this;l.setAttribute("aIndex",r+3);const u=l.lint(r+3,n);if(o){const x=r+4+l.toString().length;o.setAttribute("aIndex",x);const m=o.lint(x,n);m.length>0&&Array.prototype.push.apply(u,m)}const d=["no-ignored","no-arg"],{lintConfig:h}=I,{computeEditInfo:g}=h,c=new le(this,r),p=d.map(x=>h.getSeverity(x,"arg"));if(p[0]&&a.length>0&&Array.prototype.push.apply(u,a.map(x=>{const m=j(x,c,d[0],"invisible-triple-braces",p[0]);return m.startIndex--,m.startCol--,g&&(m.suggestions=[U(m),bt(m.startIndex,"{{!}}")]),m})),p[1]&&!this.getAttribute("include")){const x=M(this,c,d[1],"unexpected-argument",p[1]);g&&o&&(x.suggestions=[Te(x,"expand",o.text())]),u.push(x)}return u}}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(r,n=this.getAbsoluteIndex()){}},e=new WeakSet,xu=function(){},s),hi=te(Br),jt=Z(hi,0,"ArgToken",jr,jt),Y(hi,1,jt)}}),ya={};se(ya,{parseBraces:()=>Is});var qr,ci,ss,gi,pi,fi,Wr,mi,Is,An=C({"parser/braces.ts"(){"use strict";Ze(),he(),xa(),pu(),mu(),qr={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},ci=String.raw`\[(?!\[)`,ss=String.raw`\n(?![=\0])`,gi=String.raw`|\{{2,}`,pi=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),fi=pt(e=>new RegExp(e,"gmu")),Wr=new RegExp(String.raw`\{\{((?:[^\n{}[]|${ci}|${ss})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${ss})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${ci}|${ss})*\}-`,"gu"),mi=e=>{const t=xt(ve(e));return pi.has(t)?pi.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},Is=(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:[,,,r]}=t,n=[],l=[],o=(S,y,A,k)=>{y[y.length-1].push(Ae(S.slice(A,k),l))};let a;do a!==void 0&&(e=a),a=e.replace(Wr,(S,y,A)=>{if(y!==void 0||typeof A=="string")try{const{length:k}=s,$=(y!=null?y:A).split("|");return new ot(Ae($[0],l),$.slice(1).map(b=>{const _=b.indexOf("=");return(_===-1?[b]:[b.slice(0,_),b.slice(_+1)]).map(T=>Ae(T,l))}),t,s),`\0${k}${mi($[0])}`}catch(k){if(!(k instanceof SyntaxError)||k.message!=="Invalid template name")throw k}return l.push(Ae(S,l)),`\0${l.length-1}`});while(a!==e);e=a;const u=e.lastIndexOf("}}")-e.length;let d=u+e.length!==-1,h=fi(i+(d?gi:"")),g=h.exec(e),c;for(;g||c!==void 0&&c<=e.length&&((x=(p=n[n.length-1])==null?void 0:p[0])!=null&&x.startsWith("="));){if(g!=null&&g[1]){const[,{length:q}]=g;g[0]=g[0].slice(q),g.index+=q}const{0:S,index:y}=g!=null?g:{0:`
|
|
8
|
-
`,index:e.length},A=(m=n.pop())!=null?m:{},{0:k,index:$,parts:b,findEqual:_,pos:T}=A,
|
|
9
|
-
`){c=y+1;const{pos:
|
|
10
|
-
`)||(e=`${e.slice(0,$)}\0${s.length}h${e.slice(y)}`,c=$+4+String(s.length).length,new
|
|
11
|
-
)`:""}(\s*)$`,"u")),Dr=new Set(["alt","link","lang","page","caption"]),
|
|
12
|
-
`))!=null?
|
|
13
|
-
`),r=new Set(t.protocol.split("|"));let n=!0,l=!1;for(const o of i){const a=o.trim();if(!(l||!a||a.startsWith("#"))){if(n){const u=o.indexOf("|"),d=u===-1?o:o.slice(0,u),{valid:h,ns:g}=this.normalizeTitle(d,0,{halfParsed:!0,temporary:!0,page:""});if(h&&g===6){const c=new ut("imagemap",d,u===-1?void 0:o.slice(u+1),t,s);super.insertAt(c),n=!1;continue}else l=!0}else if(o.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(o);continue}else if(o.includes("[")){const u=o.indexOf("["),d=o.slice(u),h=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(d);if(h){if(this.normalizeTitle(h[1],0,{halfParsed:!0,temporary:!0,selfLink:!0,page:""}).valid){super.insertAt(new tn(o.slice(0,u),h.slice(1),d.slice(d.indexOf("]]")+2),t,s));continue}}else if(d.startsWith("[//")||r.has(d.slice(1,d.indexOf(":")+1))||r.has(d.slice(1,d.indexOf("//")+2))){const g=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(d);if(g){super.insertAt(new tn(o.slice(0,u),g.slice(1),d.slice(d.indexOf("]")+1),t,s));continue}}}}super.insertAt(new bs(o,t,s))}}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new le(this,e),{childNodes:r,image:n}=this,l="invalid-imagemap",{lintConfig:o}=I,a=o.getSeverity(l,n?"link":"image");return a&&(n?Array.prototype.push.apply(s,r.filter(u=>{const d=u.toString().trim();return u.is("noinclude")&&d&&!d.startsWith("#")}).map(u=>{const d=j(u,i,l,"invalid-imagemap-link",a);return o.computeEditInfo&&(d.suggestions=[U(d,-1),Te(d,"comment","# ")]),d})):s.push(M(this,i,l,"imagemap-without-image",a))),s}}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}}}}),sl,ki,il,ht,Ba=C({"src/nowiki/comment.ts"(){"use strict";W(),et(),He(),O(),it(),sl=[ze(!1),Pe("<!--")],ht=class extends(il=Ce){constructor(t,s,i,r){super(t,i,r);Ne(this,"closed");this.closed=s}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){{if(this.closed)return[];const s="unclosed-comment",{lintConfig:i}=I,r=i.getSeverity(s);if(!r)return[];const n=M(this,{start:t},s,"unclosed-comment",r);return i.computeEditInfo&&(n.suggestions=[We(n.endIndex,"-->")]),[n]}}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}},ki=te(il),ht=Z(ki,0,"CommentToken",sl,ht),Y(ki,1,ht)}}),qa={};se(qa,{CommentedToken:()=>Wa});var Wa,ku=C({"src/commented.ts"(){"use strict";B(),Ba(),Wa=class extends E{get type(){return"ext-inner"}constructor(e,t,s=[]){if(super(void 0,t,s,{AstText:":",CommentToken:":"}),e){let i=e.indexOf("<!--"),r=i!==-1&&e.indexOf("-->",i+4),n=0;for(;r!==!1&&r!==-1;)i>n&&this.insertAt(e.slice(n,i)),this.insertAt(new ht(e.slice(i+4,r),!0,t,s)),n=r+3,i=e.indexOf("<!--",n),r=i!==-1&&e.indexOf("-->",i+4);n<e.length&&this.insertAt(e.slice(n))}}lint(e=this.getAbsoluteIndex()){return super.lint(e,new RegExp(String.raw`<\s*(?:\/\s*)?(${this.name})\b`,"giu"))}}}}),Ma={};se(Ma,{NowikiToken:()=>za});var nl,rl,za,_u=C({"src/nowiki/index.ts"(){"use strict";var e,sn,s;Ze(),W(),O(),it(),nl=pt(i=>new RegExp(String.raw`<\s*(?:/\s*)${i==="nowiki"?"":"?"}(${i})\b`,"giu")),rl=new Set(["languages","section","templatestyles"]),za=(s=class extends Ce{constructor(){super(...arguments);L(this,e)}get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex()){{const{name:n}=this,{lintConfig:l}=I;let o="void-ext",a=l.getSeverity(o,n);if(a&&P(this,e,sn).call(this)){const d=M(this,{start:r},o,I.msg("nothing-in",n),a);return l.computeEditInfo&&(d.suggestions=[U(d)]),[d]}return super.lint(r,nl(n))}}getAttribute(r){return r==="invalid"?P(this,e,sn).call(this):super.getAttribute(r)}},e=new WeakSet,sn=function(){const{name:r,firstChild:{data:n}}=this;return rl.has(r)&&!!n},s)}}),ll,_i,al,ct,Ua=C({"src/tagPair/ext.ts"(){"use strict";W(),ue(),O(),bn(),B(),xn(),yn(),ll=[$s()],ct=class extends(al=Je){get type(){return"ext"}constructor(e,t,s,i,r=I.getConfig(),n=!1,l=[]){const o=e.toLowerCase(),a=new Ts(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",o,r,l),u=Ee(ge({},r),{ext:r.ext.filter(h=>h!==o),excludes:[...r.excludes],inExt:!0});let d;switch(o){case"tab":u.ext=u.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"&&u.excludes.push("heading"),d=new E(s,u,l);break;case"pre":{const{PreToken:h}=(hu(),Q(ca));d=new h(s,u,l);break}case"dynamicpagelist":{const{ParamTagToken:h}=(ma(),Q(fa));d=new h(n,s,u,l);break}case"inputbox":{const{InputboxToken:h}=(vu(),Q(wa));d=new h(n,s,u,l);break}case"references":{const{NestedToken:h}=(xi(),Q(gs));u.excludes.push("heading"),d=new h(s,n,["ref"],u,l);break}case"choose":{const{NestedToken:h}=(xi(),Q(gs));d=new h(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],u,l);break}case"combobox":{const{NestedToken:h}=(xi(),Q(gs));d=new h(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],u,l);break}case"gallery":{const{GalleryToken:h}=(yu(),Q(La));d=new h(s,u,l);break}case"imagemap":{const{ImagemapToken:h}=(Au(),Q(Oa));d=new h(s,u,l);break}case"hiero":{const{CommentedToken:h}=(ku(),Q(qa));d=new h(s,u,l);break}default:{const{NowikiToken:h}=(_u(),Q(Ma));d=new h(s,u,l)}}d.setAttribute("name",o),d.type==="plain"&&(d.type="ext-inner"),super(e,a,d,i,r,l),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),{lintConfig:i}=I,r=new le(this,e);if(this.name!=="nowiki"){const n=this.inHtmlAttrs(),l="parsing-order",o=n&&i.getSeverity(l,n===2?"ext":"templateInTable");o&&s.push(M(this,r,l,"ext-in-html",o))}if(this.name==="ref"){let n="var-anchor",l=i.getSeverity(n,"ref");l&&this.closest("heading-title")&&s.push(M(this,r,n,"variable-anchor",l)),n="nested-link",l=i.getSeverity(n,"ref"),l&&this.closest("link,ext-link-text")&&s.push(M(this,r,n,"ref-in-link",l))}return s}}},_i=te(al),ct=Z(_i,0,"ExtToken",ll,ct),Y(_i,1,ct)}}),Ha={};se(Ha,{parseCommentAndExt:()=>Jt});var $i,ol,is,ul,Ti,Jt,Ns=C({"parser/commentAndExt.ts"(){"use strict";Ze(),he(),ru(),wt(),au(),ou(),Ua(),Ba(),$i="<onlyinclude>",ol="</onlyinclude>",{length:is}=$i,ul=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",s=e?"noinclude":"includeonly";return pt(i=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${i})(\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(ol,t+is)}},Jt=(e,t,s,i)=>{if(i){let{i:a,j:u}=Ti(e);if(a!==-1&&u!==-1){let d="";const h=g=>{new ke(g,t,s),d+=`\0${s.length-1}n`};for(;a!==-1&&u!==-1;){const g=`\0${s.length}e`;new Rt(e.slice(a+is,u),t,s),a>0&&h(e.slice(0,a)),d+=g,e=e.slice(u+is+1),{i:a,j:u}=Ti(e)}return e&&h(e),d}}const{ext:r}=t;let n=r,l=t;if(r.includes("translate")){n=r.filter(u=>u!=="translate"&&u!=="tvar"),l=Ee(ge({},t),{ext:n});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,d,h)=>{const g=s.length;return new na(d,h&&Ae(h,a),l,s),`\0${g}g`}),e=Ae(e,a)}const o=ul[i?1:0](n.join("|"));return o.lastIndex=0,o.test(e)?e.replace(o,(a,u,d,h,g,c,p,x,m)=>{const v=s.length;let w="n";if(u)w="e",new ct(u,d,h,g,l,c,s);else if(a.startsWith("<!--")){w="c";const S=a.endsWith("-->");new ht(Ae(a,s,1).slice(4,S?-3:void 0),S,t,s)}else c?new Pt(c,p&&Ae(p,s,1),x&&Ae(x,s,1),m,t,s):new ke(a,t,s,!0);return`\0${v}${w}`}):e}}}),dl,hl,cl,gl,Ci,pl,Bt,$u=C({"src/tag/html.ts"(){"use strict";var e,t;W(),ue(),bn(),O(),ia(),dl=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),hl=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=[$s()],Bt=(t=class extends(pl=vn){constructor(i,r,n,l,o,a){super(i,r,n,o,a);L(this,e);this.setAttribute("name",i.toLowerCase()),F(this,e,l)}get type(){return"html"}get selfClosing(){return f(this,e)}text(){const{closing:i,selfClosing:r,name:n}=this,{html:[,,l]}=this.getAttribute("config");return l.includes(n)?i&&n!=="br"?"":super.text("/"):super.text(r&&!i?"/":"")}lint(i=this.getAbsoluteIndex(),r){var n;{const l=super.lint(i,r),{name:o,parentNode:a,closing:u,selfClosing:d}=this,h=new le(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,h,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,h,m,"html-in-table",v);c&&x===2&&($.suggestions=[U($)]),l.push($)}if(m="obsolete-tag",v=g.getSeverity(m,o),v&&cl.has(o)&&l.push(M(this,h,m,"obsolete-tag",v)),m="bold-header",v=g.getSeverity(m,o),v&&(o==="b"||o==="strong")&&((n=this.closest("heading-title,ext"))==null?void 0:n.type)==="heading-title"){const $=M(this,h,m,"bold-in-header",v);c&&($.suggestions=[U($)]),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&&(d||y)||d&&k){if(v=g.getSeverity(m,u?"both":"selfClosing"),v){const $=M(this,h,m,u?"closing-and-self-closing":"invalid-self-closing",v);if(c||p){const b=hn(i),_={desc:I.msg("no-self-closing"),range:[$.endIndex-2,$.endIndex-1],text:""};A?c&&($.suggestions=[b,_]):u?$.fix=y?b:_:c&&($.suggestions=[_,We($.endIndex,`></${o}>`,-2)])}l.push($)}}else if(!this.findMatchingTag()){const $=M(this,h,m,u?"unmatched-closing":"unclosed-tag"),b=this.closest("magic-word");if(b&&dl.has(b.name))v=g.getSeverity(m,"conditional");else if(u)v=g.getSeverity(m,"closing"),$.suggestions=[U($)];else{v=g.getSeverity(m,"opening");const _=a==null?void 0:a.childNodes;hl.has(o)&&(_!=null&&_.slice(0,_.indexOf(this)).some(T=>T.type==="html"&&T.name===o&&!T.findMatchingTag())&&($.suggestions=[We(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,r=this.getAbsoluteIndex()){}},e=new WeakMap,t),Ci=te(pl),Bt=Z(Ci,0,"HtmlToken",gl,Bt),Y(Ci,1,Bt)}}),Da={};se(Da,{parseHtml:()=>Ga});var fl,Ga,Tu=C({"parser/html.ts"(){"use strict";yn(),$u(),fl=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,Ga=(e,t,s)=>{var l;const{html:i}=t;(l=t.htmlElements)!=null||(t.htmlElements=new Set([...i[0],...i[1],...i[2]]));const r=e.split("<");let n=r.shift();for(const o of r){const a=fl.exec(o),u=a==null?void 0:a[2],d=u==null?void 0:u.toLowerCase();if(!a||!t.htmlElements.has(d)){n+=`<${o}`;continue}const[,h,,g="",c,p]=a,{length:x}=s,m=new Ts(g,"html-attrs",d,t,s),v=m.hasAttr("itemprop");if(d==="meta"&&!(v&&m.hasAttr("content"))||d==="link"&&!(v&&m.hasAttr("href"))){n+=`<${o}`,s.length=x;continue}n+=`\0${s.length}x${p}`,new Bt(u,m,h==="/",c==="/>",t,s)}return n}}}),ml,Ii,xl,gt,Va=C({"src/table/base.ts"(){"use strict";bn(),B(),tt(),yn(),ml=[$s(1)],gt=class extends(xl=E){constructor(e,t,s,i,r,n=[],l){super(void 0,r,n,l),this.append(new Ue(t,"table-syntax",r,n),new Ts(i,"table-attrs",s,r,n))}escape(){}},Ii=te(xl),gt=Z(Ii,0,"TableBaseToken",ml,gt),Y(Ii,1,gt)}}),vl,Ni,$e,ns,It,Nt,ys,Qa=C({"src/table/td.ts"(){"use strict";W(),ue(),mn(),O(),B(),Va(),ys=class extends(Ni=gt,vl=[As(!1)],Ni){constructor(e,t,s,i=[]){var o;let r=/\||\0\d+!\x7F/u.exec(t!=null?t:""),n=r?t.slice(0,r.index):"";/\[\[|-\{/u.test(n)&&(r=null,n=""),super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",n,s,i),Y(ns,5,this),Oe(this,It),Oe(this,$e,""),r&&([Vo(this,$e)._]=r);const l=new E(t==null?void 0:t.slice(((o=r==null?void 0:r.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 Gi(this,It,Nt).call(this).subtype}afterBuild(){de(this,$e).includes("\0")&&Se(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 le(this,e+this.getRelativeIndex(this.length-1)),r="pipe-like",{lintConfig:n}=I,{computeEditInfo:l,fix:o}=n,a=["td","double"].map(u=>n.getSeverity(r,u));for(const u of this.lastChild.childNodes)if(u.type==="text"){const{data:d}=u;if(d.includes("|")){const h=d.includes("||"),g=a[h?1:0];if(g){const c=j(u,i,r,"pipe-in-table",g);if(l||o)if(h){const p={caption:"|+",td:"|",th:"!"}[this.subtype];c.fix=Te(c,"newline",d.replace(/\|\|/gu,`
|
|
6
|
+
`})}}}}),fo,cu=C({"src/paramLine.ts"(){"use strict";q(),fo=class extends E{get type(){return"param-line"}}}}),mo={};ie(mo,{ParamTagToken:()=>Sn});var Sn,xo=C({"src/multiLine/paramTag.ts"(){"use strict";M(),ae(),Ls(),j(),wn(),cu(),Sn=class extends Is{constructor(e,t,s=I.getConfig(),i=[],r){super(void 0,s,i,{}),t&&this.safeAppend(t.split(`
|
|
7
|
+
`).map(n=>r?n:Jt(n,s,i,e)).map(n=>new fo(n,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 r=new re(this,e),n=I.msg("invalid-parameter",this.name),l=[];for(const a of this.childNodes){a.setAttribute("aIndex",e);const o=a.childNodes.filter(({type:u})=>u!=="comment"&&u!=="include"&&u!=="noinclude");if(o.some(({type:u})=>u==="ext"))l.push(B(a,r,t,n,i));else{const u=o.findIndex(({type:h})=>h!=="text"),d=o.slice(0,u===-1?void 0:u).map(String).join("");if(d&&!(u===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(d)){const h=B(a,r,t,n,i);s.computeEditInfo&&(h.suggestions=[H(h)]),l.push(h)}else{const h=a.lint(e,!1);h.length>0&&Array.prototype.push.apply(l,h)}}e+=a.toString().length+1}return l}}}}}),Nr,ai,Lr,ot,vo=C({"src/heading.ts"(){"use strict";var e,t,cs,i;M(),Ce(),ae(),Re(),j(),q(),tt(),Nr=[Ne],ot=(i=class extends(Lr=E){constructor(n,l,a,o=[]){super(void 0,a,o);N(this,t);N(this,e);L(this,e,n);const u=new E(l[0],a,o);u.type="heading-title",u.setAttribute("stage",2);const d=new Ue(l[1],"heading-trail",a,o);this.append(u,d)}get type(){return"heading"}get level(){return f(this,e)}toString(n){const l=P(this,t,cs).call(this);return l+this.firstChild.toString(n)+l+this.lastChild.toString(n)}text(){const n=P(this,t,cs).call(this);return n+this.firstChild.text()+n}getAttribute(n){return n==="invalid"?this.inHtmlAttrs()===2:n==="padding"?this.level:super.getAttribute(n)}getGaps(){return this.level}lint(n=this.getAbsoluteIndex(),l){{const a=super.lint(n,l),{firstChild:o,level:u}=this,d=o.toString(),h=d.startsWith("="),g=h||d.endsWith("="),c=new re(this,n),p=this.inHtmlAttrs(),x=["h1","unbalanced-header","format-leakage"],{lintConfig:m}=I,{computeEditInfo:v,fix:S}=m,w=x.map(y=>m.getSeverity(y,"apostrophe"));if(w[0]&&this.level===1){const y=B(o,c,x[0],"<h1>",w[0]);v&&!g&&(y.suggestions=[_e(y,"h2",`=${d}=`)]),a.push(y)}if(w[1]&&g){const y=I.msg("unbalanced-in-section-header",'"="'),A=B(o,c,x[1],y,w[1]);if(!(!v||d==="="))if(h){const[k]=/^=+/u.exec(d),$=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(d)[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})}a.push(A)}if(p){const y="parsing-order",A=m.getSeverity(y,p===2?"heading":"templateInTable");A&&a.push(z(this,c,y,"header-in-html",A))}if(w[2]){const y=this.getRootNode().toString(),A=o.childNodes.filter(Fs("quote")),k=A.filter(({bold:b})=>b),$=A.filter(({italic:b})=>b);if(k.length%2){const b=B(k[k.length-1],Fe(ce({},c),{start:n+u,left:c.left+u}),x[2],I.msg("unbalanced-in-section-header","bold-apostrophes"),w[2]);if(v||S){const _=n+u+d.length,T=H(b);y.slice(b.endIndex,_).trim()?v&&(b.suggestions=[T,Me(_,"'''")]):k.length===1&&$.length===0?b.fix=T:v&&(b.suggestions=[T])}a.push(b)}if($.length%2){const b=B($[$.length-1],{start:n+u},x[2],I.msg("unbalanced-in-section-header","italic-apostrophes"),w[2]);if(v||S){const _=n+u+d.length;y.slice(b.endIndex,_).trim()?v&&(b.suggestions=[Me(_,"''")]):$.length===1&&k.length===0?b.fix=H(b):v&&(b.suggestions=[H(b)])}a.push(b)}}return a}}print(){const n=P(this,t,cs).call(this);return super.print({pre:n,sep:n})}json(n,l=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakSet,cs=function(){return"=".repeat(this.level)},i),ai=te(Lr),ot=Z(ai,0,"HeadingToken",Nr,ot),Y(ai,1,ot)}}),Fr,bo,gu=C({"src/parameter.ts"(){"use strict";de(),M(),j(),q(),Fr=new RegExp(`https?://${ft}${mt}$`,"iu"),bo=class extends E{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){}constructor(e,t,s,i=[]){super(void 0,s,i);const r=new E(typeof e=="number"?void 0:e,s,i,{}),n=new E(t,s,i);r.type="parameter-key",r.setAttribute("stage",2),n.type="parameter-value",n.setAttribute("stage",2),this.append(r,n)}trimName(e,t=!0){const s=(typeof e=="string"?e:e.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",s),s}afterBuild(){if(!this.anon){const{parentNode:e,firstChild:t}=this,s=this.trimName(t);e&&e.getArgs(s,!1,!1).add(this)}super.afterBuild()}toString(e){return this.anon?this.lastChild.toString(e):super.toString(e,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(e=this.getAbsoluteIndex(),t){var s;{const i=super.lint(e,t),r="unescaped",{lintConfig:n}=I,l=n.getSeverity(r);if(l){const{firstChild:a}=this,o=(s=Fr.exec(a.text()))==null?void 0:s[0];try{if(o&&new URL(o).search){const u=B(a,{start:e},r,"unescaped-query",l);u.startIndex=u.endIndex,u.startLine=u.endLine,u.startCol=u.endCol,u.endIndex++,u.endCol++,(n.computeEditInfo||n.fix)&&(u.fix=bt(u.startIndex,"{{=}}")),i.push(u)}}catch(u){}}return i}}print(){return super.print({sep:this.anon?"":"="})}json(e,t=this.getAbsoluteIndex()){}}}}),Er,ui,Rr,at,pu=C({"src/transclude.ts"(){"use strict";var e,t,s,i,r,n,gs,yo,o;de(),M(),Ce(),ae(),$s(),Re(),j(),q(),gu(),st(),tt(),Er=[Ne,Qt()],at=(o=class extends(Rr=E){constructor(d,h,g,c=[]){var T,F;let p;const x=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(d);x&&(p=Number(x[1]),d=d.replace(`\0${p}h`,c[p].toString().replace(/^\n/u,"")));super(void 0,g,c,{});N(this,n);Ie(this,"modifier","");N(this,e,"template");N(this,t,":");N(this,s,!1);N(this,i,new Map);N(this,r);const{parserFunction:[m,v],variable:S,functionHook:w}=g,y=(T=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(d))==null?void 0:T[0];if(y)this.setAttribute("modifier",y),d=d.slice(y.length);else if(d.includes(":")){const[R,...W]=d.split(":"),[O]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((F=W[0])!=null?F:"");this.setModifier(`${R}:${O}`)&&(d=W.join(":").slice(O.length))}const A=d.search(/[::]/u),k=d[A]===":",$=A!==-1;if($||h.length===0&&!f(this,s)){const R=$?d.slice(0,A):d,W=$&&d.slice(A+1),O=fe(R),J=$?O.slice(O.search(/\S/u))+(k?":":""):O.trim(),le=J.toLowerCase(),ee=Array.isArray(v),D=ee?v.includes(J):Object.prototype.hasOwnProperty.call(v,J),G=!ee&&D?v[J]:Object.prototype.hasOwnProperty.call(m,le)&&m[le],Se=ee&&D||!("functionHook"in g)||w.includes(G),Le=ee&&D||S.includes(G);if($?G&&Se:Le){this.setAttribute("name",G||le.replace(/^#|:$/u,"")),L(this,e,"magic-word"),k&&L(this,t,":");const V=new Ue(R,"magic-word-name",g,c);if(super.insertAt(V),W!==!1&&h.unshift([W]),this.name==="invoke")for(let K=0;K<2;K++){const Q=h.shift();if(!Q)break;const se=new Te(Q.join("="),`invoke-${K?"function":"module"}`,g,c);super.insertAt(se)}}}if(this.type==="template"){const R=fe(d).trim();if(!this.normalizeTitle(R,10,{halfParsed:!0,temporary:!0}).valid)throw c.pop(),new SyntaxError("Invalid template name");const W=new Te(d,"template-name",g,c,{});super.insertAt(W)}typeof p=="number"&&(c[p]=void 0);const b=this.isTemplate();let _=1;for(let R=0;R<h.length;R++){const W=h[R];b||this.name==="switch"&&R>0||this.name==="tag"&&R>1||(W[0]=W.join("="),W.length=1),W.length===1&&(W.unshift(_),_++),this.insertAt(new bo(...W,g,c))}this.seal("modifier")}get type(){return f(this,e)}get module(){}get function(){}setModifier(d){const{parserFunction:[,,h,g]}=this.getAttribute("config"),c=fe(d).trim();if(d&&!c.endsWith(":"))return!1;const p=c.slice(0,-1).toLowerCase(),x=h.includes(p),m=g.includes(p);return f(this,s)&&x||!f(this,s)&&(m||!d)||(me.running||this.length>1)&&(x||m||!d)?(this.setAttribute("modifier",d),L(this,s,x),!!d):!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,r,P(this,n,gs).call(this)),this.setAttribute("name",f(this,r).title))}toString(d){const{childNodes:h,length:g,firstChild:c,modifier:p,type:x}=this;return`{{${p}${x==="magic-word"?c.toString(d)+(g===1?"":f(this,t))+h.slice(1).map(m=>m.toString(d)).join("|"):super.toString(d,"|")}}}`}text(){const{childNodes:d,length:h,firstChild:g,modifier:c,type:p,name:x}=this;return p==="magic-word"&&x==="vardefine"?"":`{{${c}${p==="magic-word"?g.text()+(h===1?"":f(this,t))+Ye(d.slice(1),"|"):super.text("|")}}}`}getAttribute(d){switch(d){case"padding":return this.modifier.length+2;case"title":return f(this,r);case"colon":return f(this,t);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!P(this,n,gs).call(this).valid);default:return super.getAttribute(d)}}lint(d=this.getAbsoluteIndex(),h){{const g=super.lint(d,h);if(!this.isTemplate())return g;const{type:c,childNodes:p,length:x}=this,m=new re(this,d),{lintConfig:v}=I,{computeEditInfo:S}=v,w=c==="magic-word";let y="no-ignored",A=v.getSeverity(y,"fragment");if(w&&!P(this,n,gs).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[w?1:0],$=k.childNodes.findIndex(_=>_.type==="text"&&vs(_.data).includes("#")),b=k.childNodes[$];if(b){const _=B(k,m,y,"useless-fragment",A);S&&(_.suggestions=[H(_,k.getRelativeIndex($)+b.data.indexOf("#"))]),g.push(_)}}if(y="invalid-invoke",A=v.getSeverity(y,"function"),A&&w&&x===2)return g.push(z(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 S&&(T.suggestions=[H(T,-1)]),T}))}return g}}insertAt(d,h=this.length){return super.insertAt(d,h),d.anon?P(this,n,yo).call(this,d):d.name&&this.getArgs(d.name,!1,!1).add(d),d}getAllArgs(){return this.childNodes.filter(Fs("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:d})=>d)}getArgs(d,h,g=!0){const c=String(d).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:d}])=>d>1).map(([d,h])=>[d,[...h]])}getPossibleValues(){const{type:d,name:h,childNodes:g}=this;if(d==="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 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(S=>S.text().trim());if(m===0)p.splice(x,1);else if(m>1||v.type!=="magic-word")x++;else try{const S=v.getPossibleValues();Array.prototype.splice.apply(p,[x,1,...S]),x+=S.length}catch(S){x++}}return p}print(){const{childNodes:d,length:h,firstChild:g,modifier:c,type:p}=this;return`<span class="wpb-${p}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${p==="magic-word"?Ht(c)+g.print()+(h===1?"":f(this,t))+vt(d.slice(1),{sep:"|"}):(c?`<span class="wpb-magic-word">${Ht(c)}</span>`:"")+vt(d,{sep:"|"})}}}</span>`}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakSet,gs=function(){const d=this.type==="template";return this.normalizeTitle((d?"":"Module:")+this.childNodes[d?0:1].text(),10,ce({temporary:!0},!d&&{page:""}))},yo=function(d){const h=this.getAnonArgs(),g=typeof d!="number";for(let c=g?h.indexOf(d):d-1;c<h.length;c++){const p=h[c],{name:x}=p,m=String(c+1);(x!==m||p===d)&&(p.setAttribute("name",m),this.getArgs(m,!1,!1).add(p))}},o),ui=te(Rr),at=Z(ui,0,"TranscludeToken",Er,at),Y(ui,1,at)}}),Pr,di,Or,Ot,fu=C({"src/hidden.ts"(){"use strict";et(),q(),Pr=[ze()],Ot=class extends(Or=E){get type(){return"hidden"}getAttribute(e){return e==="invalid"||super.getAttribute(e)}},di=te(Or),Ot=Z(di,0,"HiddenToken",Pr,Ot),Y(di,1,Ot)}}),jr,hi,Br,jt,mu=C({"src/arg.ts"(){"use strict";var e,xu,s;de(),M(),ae(),He(),$s(),Re(),j(),q(),st(),fu(),jr=[Ne,Pe("{{{"),Qt()],jt=(s=class extends(Br=E){constructor(r,n,l=[]){super(void 0,n,l,{});N(this,e);for(let a=0;a<r.length;a++){const o=r[a];if(a===0){const u=new Te(o,"arg-name",n,l,{});super.insertAt(u)}else if(a>1){const u=new Ot(o,n,l);super.insertAt(u)}else{const u=new E(o,n,l);u.type="arg-default",u.setAttribute("stage",2),super.insertAt(u)}}}get type(){return"arg"}get default(){}toString(r){return`{{{${super.toString(r,"|")}}}}`}text(){return`{{{${Ye(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){super.afterBuild()}lint(r=this.getAbsoluteIndex(),n){{const{childNodes:[l,a,...o]}=this;l.setAttribute("aIndex",r+3);const u=l.lint(r+3,n);if(a){const x=r+4+l.toString().length;a.setAttribute("aIndex",x);const m=a.lint(x,n);m.length>0&&Array.prototype.push.apply(u,m)}const d=["no-ignored","no-arg"],{lintConfig:h}=I,{computeEditInfo:g}=h,c=new re(this,r),p=d.map(x=>h.getSeverity(x,"arg"));if(p[0]&&o.length>0&&Array.prototype.push.apply(u,o.map(x=>{const m=B(x,c,d[0],"invisible-triple-braces",p[0]);return m.startIndex--,m.startCol--,g&&(m.suggestions=[H(m),bt(m.startIndex,"{{!}}")]),m})),p[1]&&!this.getAttribute("include")){const x=z(this,c,d[1],"unexpected-argument",p[1]);g&&a&&(x.suggestions=[_e(x,"expand",a.text())]),u.push(x)}return u}}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(r,n=this.getAbsoluteIndex()){}},e=new WeakSet,xu=function(){},s),hi=te(Br),jt=Z(hi,0,"ArgToken",jr,jt),Y(hi,1,jt)}}),wo={};ie(wo,{parseBraces:()=>Ns});var qr,ci,ss,gi,pi,fi,Wr,mi,Ns,An=C({"parser/braces.ts"(){"use strict";Ze(),de(),vo(),pu(),mu(),qr={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},ci=String.raw`\[(?!\[)`,ss=String.raw`\n(?![=\0])`,gi=String.raw`|\{{2,}`,pi=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),fi=pt(e=>new RegExp(e,"gmu")),Wr=new RegExp(String.raw`\{\{((?:[^\n{}[]|${ci}|${ss})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${ss})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${ci}|${ss})*\}-`,"gu"),mi=e=>{const t=xt(fe(e));return pi.has(t)?pi.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},Ns=(e,t,s)=>{var p,x,m,v,S;const i=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,r]}=t,n=[],l=[],a=(w,y,A,k)=>{y[y.length-1].push(ye(w.slice(A,k),l))};let o;do o!==void 0&&(e=o),o=e.replace(Wr,(w,y,A)=>{if(y!==void 0||typeof A=="string")try{const{length:k}=s,$=(y!=null?y:A).split("|");return new at(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}${mi($[0])}`}catch(k){if(!(k instanceof SyntaxError)||k.message!=="Invalid template name")throw k}return l.push(ye(w,l)),`\0${l.length-1}`});while(o!==e);e=o;const u=e.lastIndexOf("}}")-e.length;let d=u+e.length!==-1,h=fi(i+(d?gi:"")),g=h.exec(e),c;for(;g||c!==void 0&&c<=e.length&&((x=(p=n[n.length-1])==null?void 0:p[0])!=null&&x.startsWith("="));){if(g!=null&&g[1]){const[,{length:W}]=g;g[0]=g[0].slice(W),g.index+=W}const{0:w,index:y}=g!=null?g:{0:`
|
|
8
|
+
`,index:e.length},A=(m=n.pop())!=null?m:{},{0:k,index:$,parts:b,findEqual:_,pos:T}=A,F=w==="="&&_;if(w==="]]"||w==="}-")c=y+2;else if(w===`
|
|
9
|
+
`){c=y+1;const{pos:W,findEqual:O}=(v=n[n.length-1])!=null?v:{};if(W===void 0||O||fe(e.slice(W,$))!==""){const J=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(e.slice($,y));J&&(J[2]=ye(J[2],l),J[2].includes(`
|
|
10
|
+
`)||(e=`${e.slice(0,$)}\0${s.length}h${e.slice(y)}`,c=$+4+String(s.length).length,new ot(J[1].length,J.slice(2),t,s)))}}else if(w==="|"||F)c=y+1,a(e,b,T,y),w==="|"&&b.push([]),A.pos=c,A.findEqual=w==="|",n.push(A);else if(w.startsWith("}}")){const W=w.slice(0,Math.min(k.length,3)),O=k.length-W.length,{length:J}=s;c=y+W.length,a(e,b,T,y);let le=!1,ee="t";if(W.length===3){const D=b.map(Se=>Se.join("=")),G=D.length>1&&fe(D[1]).trim();new jt(D,t,s),G&&G.endsWith(":")&&r.includes(G.slice(0,-1).toLowerCase())&&(ee="s")}else try{new at(b[0][0],b.slice(1),t,s),ee=mi(b[0][0])}catch(D){if(D instanceof SyntaxError&&D.message==="Invalid template name")le=!0;else throw D}le||(e=`${e.slice(0,$+O)}\0${J}${ee}${e.slice(c)}`,c=$+O+3+String(J).length,O>1?n.push({0:k.slice(0,O),index:$,pos:$+O,parts:[[]]}):O===1&&e[$-1]==="-"&&n.push({0:"-{",index:$-1,pos:$+1,parts:[[]]}))}else c=y+w.length,w.startsWith("{")&&(g.pos=c,g.parts=[[]]),n.push(..."0"in A?[A]:[],g);let R=n[n.length-1];if(d&&u+e.length<c)for(d=!1;(S=R==null?void 0:R[0])!=null&&S.startsWith("{");)n.pop(),R=n[n.length-1];h=fi(i+(d?gi:"")+(R?`|${qr[R[0][0]]}${R.findEqual?"|=":""}`:"")),h.lastIndex=c,g=h.exec(e)}return ye(e,l)}}}),So={};ie(So,{InputboxToken:()=>Ao});var Ao,vu=C({"src/multiLine/inputbox.ts"(){"use strict";Ls(),An(),j(),xo(),Ao=class extends Sn{constructor(e,t,s=I.getConfig(),i=[]){const r=Symbol("InputboxToken"),n=s.excludes.includes("heading")?s:Fe(ce({},s),{excludes:[...s.excludes,"heading"]}),{length:l}=i;i.push(r),t&&(t=Jt(t,n,i,e)),t&&(t=Ns(t,n,i)),i.splice(l,1),super(e,t,n,i,{})}}}}),ps={};ie(ps,{NestedToken:()=>ko});var Mr,zr,ko,xi=C({"src/nested.ts"(){"use strict";var e,t,s;M(),ae(),Ls(),An(),j(),q(),Ho(),wt(),Mr=new Set(["comment","include","arg","template","magic-word"]),zr=[!1,!0].map(i=>{const r=i?"includeonly":"noinclude";return new RegExp(String.raw`^(?:<${r}(?:\s[^>]*)?/?>|</${r}\s*>)$`,"iu")}),ko=(s=class extends E{constructor(r,n,l,a,o=[]){if(typeof n=="boolean"){const u=Symbol("NestedToken"),{length:d}=o;o.push(u),r&&(r=Jt(r,a,o,n)),r&&(r=Ns(r,a,o)),o.splice(d,1)}else r&&(r=r.replace(n,(u,d,h,g,c)=>{const p=`\0${o.length+1}e`;return new ct(d,h,g,c,a,!1,o),p}));r&&(r=r.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(u,d,h)=>(new we(h,a,o),`${d}\0${o.length}n`)));super(r,a,o);N(this,e);N(this,t);L(this,e,[...l]),L(this,t,n)}get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex(),n){{const l=super.lint(r,n),a="no-ignored",{lintConfig:o}=I,u=o.getSeverity(a,this.name);if(!u)return l;const d=new re(this,r),h=typeof f(this,t)=="boolean"?zr[f(this,t)?1:0]:/^<!--[\s\S]*-->$/u;return[...l,...this.childNodes.filter(g=>{const{type:c,name:p}=g;if(c==="ext")return!f(this,e).includes(p);if(Mr.has(c))return!1;const x=g.toString().trim();return x&&!h.test(x)}).map(g=>{const c=B(g,d,a,I.msg("invalid-content",this.name),u);return o.computeEditInfo&&(c.suggestions=[H(c),cn(c,g.toString())]),c})]}}},e=new WeakMap,t=new WeakMap,s)}});function Ur(e,t,s,i,r){t=fe(t).trim();let n=t.replace(e==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(e){case"width":return!n&&!!t||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(n);case"link":{if(n){if(_o(s.protocol).test(n))return $o(s.protocol).test(n)&&t;n.startsWith("[[")&&n.endsWith("]]")&&(n=n.slice(2,-2))}else return t;const l=I.normalizeTitle(n,0,!1,s,{halfParsed:i,decode:!0,selfLink:!0,page:""});return l.valid&&l}case"lang":return(r==="svg"||r==="svgz")&&!/[^a-z\d-]/u.test(n);case"alt":case"class":case"manualthumb":return!0;case"page":return(r==="djvu"||r==="djv"||r==="pdf")&&Number(n)>0;default:return!!n&&!isNaN(n)}}var _o,$o,Hr,Dr,bs,Gr,To,bu=C({"src/imageParameter.ts"(){"use strict";var e,t,Co,r;Ze(),de(),M(),Ee(),Ce(),j(),q(),_o=pt(n=>new RegExp(String.raw`^(?:${n}|//|\0\d+m\x7F)`,"iu")),$o=pt(n=>new RegExp(String.raw`^(?:(?:${n}|//)${ft}|\0\d+m\x7F)${mt}$`,"iu")),Hr=pt(n=>new RegExp(String.raw`^(\s*(?!\s))${n.replace("$1","(.*)")}${n.endsWith("$1")?`(?=$|
|
|
11
|
+
)`:""}(\s*)$`,"u")),Dr=new Set(["alt","link","lang","page","caption"]),bs=new Set(["tiff","tif","png","gif","jpg","jpeg","webp","xcf","pdf","svg","djvu"]),Gr=n=>{if(n)n.startsWith("//")&&(n=`https:${n}`);else return n;return new URL(n).href},To=(r=class extends E{constructor(l,a,o,u){var n=(...i)=>(super(...i),N(this,t),N(this,e,""),this);let d;const h=Object.entries(o.img).map(([c,p])=>[c,p,Hr(c)]),g=h.find(([,c,p])=>(d=p.exec(l),d&&(d.length!==4||Ur(c,d[2],o,!0,a)!==!1)));if(g&&d){d.length===3?(n(void 0,o,u),L(this,e,l)):(n(d[2],o,u,{}),L(this,e,d[1]+g[0]+d[3])),this.setAttribute("name",g[1]),g[1]==="alt"&&this.setAttribute("stage",pe-1);return}n(l,o.excludes.includes("list")?o:Fe(ce({},o),{excludes:[...o.excludes,"list"]}),u),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 me.run(()=>{const a=new E(l,this.getAttribute("config"));return a.parseOnce(0,this.getAttribute("include")).parseOnce(),/^\0\d+m\x7F/u.test(a.toString())?l:Ur("link",l,this.getAttribute("config"))})}}afterBuild(){var l;(l=this.parentNode)!=null&&l.is("gallery-image")&&!Dr.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(l){return f(this,e)?f(this,e).replace("$1",super.toString(l)):super.toString(l)}text(){return f(this,e)?f(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,f(this,e).indexOf("$1")):super.getAttribute(l)}lint(l=this.getAbsoluteIndex(),a){{const o=super.lint(l,a),{lintConfig:u}=I,{computeEditInfo:d,fix:h}=u,{link:g,name:c}=this,p=c==="width"&&this.getValue();if(c==="invalid"||p&&p.endsWith("px")){const x="invalid-gallery",m=u.getSeverity(x,"parameter");if(m){const v=z(this,{start:l},x,"invalid-image-parameter",m);(d||h)&&(v.fix=p?H(v,0,p):H(v,-1)),o.push(v)}}else if(c==="link"){if(typeof g=="string"){const x="invalid-url",m=u.getSeverity(x);if(m&&!this.querySelector("magic-word"))try{Gr(g)}catch(v){o.push(z(this,{start:l},x,"invalid-url",m))}}else if(g.encoded){const x="url-encoding",m=u.getSeverity(x,"file");if(m){const v=z(this,{start:l},x,"unnecessary-encoding",m);(d||h)&&(v.fix=dn(v,this)),o.push(v)}}}else if(c==="manualthumb"){const x="invalid-gallery",m=u.getSeverity(x,"thumb");if(m&&!this.querySelector("arg,magic-word,template")){const{valid:v,ns:S,extension:w}=this.thumb;(!v||S!==6||!bs.has(w))&&o.push(z(this,{start:l},x,"invalid-thumb",m))}}return o}}getValue(){return this.name==="invalid"?this.text():P(this,t,Co).call(this)||super.text()}print(){return f(this,e)?`<span class="wpb-image-parameter${this.name==="invalid"?" wpb-invalid":""}">${f(this,e).replace("$1",`<span class="wpb-image-caption">${vt(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}},e=new WeakMap,t=new WeakSet,Co=function(){return f(this,e)&&!f(this,e).includes("$1")},r)}}),vi,Vr,Qr,bi,yi,Jr,wi,kn,Io=C({"src/link/file.ts"(){"use strict";M(),ae(),j(),_s(),bu(),vi=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),Vr=new Set(["arg"]),Qr=new Set(["template","magic-word"]),bi=new Set(["left","right","center","none"]),yi=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),Jr=e=>{if(e===void 0)return[];const t=/-\{|\}-|\|/gu,s=[];let i=t.exec(e),r=0,n=0;for(;i;){const{0:l,index:a}=i;l!=="|"?r+=l==="-{"?1:-1:r===0&&(s.push(e.slice(n,a)),{lastIndex:n}=t),i=t.exec(e)}return s.push(e.slice(n)),s},wi=(e,t)=>e.filter(({childNodes:s})=>!s.some(i=>i.text().trim()&&t.has(i.type))),kn=class extends Be{get type(){return"file"}get extension(){}constructor(e,t,s,i=[],r="|"){super(e,void 0,s,i,r);const{extension:n}=this.getTitle(!0,!0);this.safeAppend(Jr(t).map(l=>new To(l,n,s,i)))}lint(e=this.getAbsoluteIndex(),t){var s;{const i=super.lint(e,t),r=wi(this.getAllArgs(),Vr),n=[...new Set(r.map(({name:k})=>k))],l=n.filter(k=>vi.has(k)),a=n.filter(k=>bi.has(k)),o=n.filter(k=>yi.has(k)),[u]=l,d=u==="framed"||u==="manualthumb",h=new re(this,e),{lintConfig:g}=I,{computeEditInfo:c,fix:p}=g,{ns:x,extension:m}=this.getAttribute("title"),{firstChild:v}=this;let S="nested-link",w=g.getSeverity(S,"file");if(w&&bs.has(m)&&this.closest("ext-link-text")&&((s=this.getValue("link"))==null?void 0:s.trim())!==""){const k=z(this,h,S,"link-in-extlink",w);if(c||p){const $=this.getArg("link");if($){const b=e+$.getRelativeIndex();k.fix={desc:I.msg("delink"),range:[b,b+$.toString().length],text:"link="}}else k.fix=As(k.endIndex-2,"delink","|link=")}i.push(k)}if(S="invalid-gallery",w=g.getSeverity(S,"extension"),w&&x===6&&!m&&!v.querySelector("arg,magic-word,template")&&i.push(z(this,h,S,"missing-extension",w)),w=g.getSeverity(S,"parameter"),w&&d)for(const k of r.filter(({name:$})=>$==="width")){const $=B(k,h,S,"invalid-image-parameter",w);(c||p)&&($.fix=H($,-1)),i.push($)}if(r.length===n.length&&l.length<2&&a.length<2&&o.length<2)return i;S="no-duplicate";const y=["unknownImageParameter","imageParameter"].map(k=>g.getSeverity(S,k)),A=(k,$,b,_=!0)=>k.map(T=>{if(w=y[Number(typeof _=="function"?_(T):_)],!w)return!1;const F=B(T,h,S,I.msg(`${$}-image-parameter`,b),w);return c&&(F.suggestions=[H(F,-1)]),F}).filter(T=>T!==!1);for(const k of n){if(k==="invalid"||k==="width"&&d)continue;const $=k==="caption";let b=r.filter(({name:_})=>_===k);if($&&(b=[...b.slice(0,-1).filter(_=>_.text()),...b.slice(-1)]),b.length>1){let _=!$||!m||bs.has(m);if($&&_){const T=wi(b,Qr);_=T.length>1&&(F=>T.includes(F))}Array.prototype.push.apply(i,A(b,"duplicate",k,_))}}return l.length>1&&Array.prototype.push.apply(i,A(r.filter(({name:k})=>vi.has(k)),"conflicting","frame")),a.length>1&&Array.prototype.push.apply(i,A(r.filter(({name:k})=>bi.has(k)),"conflicting","horizontal-alignment")),o.length>1&&Array.prototype.push.apply(i,A(r.filter(({name:k})=>yi.has(k)),"conflicting","vertical-alignment")),i}}getAllArgs(){return this.childNodes.slice(1)}getArgs(e){return this.getAllArgs().filter(({name:t})=>e===t)}getArg(e){{const t=this.getArgs(e);return t[e==="manualthumb"?0:t.length-1]}}getValue(e){var t;return(t=this.getArg(e))==null?void 0:t.getValue()}json(e,t=this.getAbsoluteIndex()){}}}}),Xr,Si,Kr,ut,No=C({"src/link/galleryImage.ts"(){"use strict";var e,Zi,s;M(),Ee(),He(),j(),q(),Io(),Xr=[Pe("")],ut=(s=class extends(Kr=kn){constructor(r,n,l,a,o=[]){let u;if(l!==void 0){const{length:d}=o;u=new E(l,a,o);for(let h=0;h<pe-1;h++)u.parseOnce();o.splice(d,1)}super(n,u==null?void 0:u.toString(),a,o);N(this,e);Ie(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=`${r}-image`,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(r){const n=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),n?0:6,{halfParsed:!0,temporary:r,decode:!n,page:""})}lint(r=this.getAbsoluteIndex(),n){{const l=super.lint(r,n),a="invalid-gallery",{lintConfig:o}=I,u=o.getSeverity(a,"image");if(u&&P(this,e,Zi).call(this)){const d=z(this,{start:r},a,"invalid-gallery",u);o.computeEditInfo&&(d.suggestions=[As(r,"prefix","File:")]),l.push(d)}return l}}getAttribute(r){return r==="invalid"?P(this,e,Zi).call(this):super.getAttribute(r)}},e=new WeakSet,Zi=function(){const{ns:r}=this.getAttribute("title");return r!==6},s),Si=te(Kr),ut=Z(Si,0,"GalleryImageToken",Xr,ut),Y(Si,1,ut)}}),ys,Lo=C({"src/nowiki/commentLine.ts"(){"use strict";wt(),ys=class extends we{}}}),Fo={};ie(Fo,{GalleryToken:()=>Eo});var Eo,yu=C({"src/multiLine/gallery.ts"(){"use strict";var e,Ro,wu,i;M(),j(),wn(),No(),Lo(),Eo=(i=class extends Is{constructor(n,l,a=[]){var o;super(void 0,l,a,{});N(this,e);for(const u of(o=n==null?void 0:n.split(`
|
|
12
|
+
`))!=null?o:[]){const d=/^([^|]+)(?:\|(.*))?/u.exec(u);if(!d){super.insertAt(u.trim()?new ys(u,l,a):u);continue}const[,h,g]=d;P(this,e,Ro).call(this,h)?super.insertAt(new ut("gallery",h,g,l,a)):super.insertAt(new ys(u,l,a))}}get widths(){}get heights(){}lint(n=this.getAbsoluteIndex(),l){{const{top:a,left:o}=this.getRootNode().posFromIndex(n),u=[],d="no-ignored",{lintConfig:h}=I,g=["Image","NoImage","Comment"].map(c=>h.getSeverity(d,`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:S}=p,w=a+c,y=c?0:o;if(p.setAttribute("aIndex",n),S==="noinclude"&&v&&!/^<!--.*-->$/u.test(v)){let[A]=g;if(v.startsWith("|")?[,A]=g:(v.startsWith("<!--")||v.endsWith("-->"))&&([,,A]=g),A){const k=n+m,$={rule:d,message:I.msg("invalid-content","gallery"),severity:A,startIndex:n,endIndex:k,startLine:w,endLine:w,startCol:y,endCol:y+m};h.computeEditInfo&&($.suggestions=[H($),cn($,x)]),u.push($)}}else if(S!=="noinclude"&&S!=="text"){const A=p.lint(n,l);A.length>0&&Array.prototype.push.apply(u,A)}n+=m+1}return u}}json(n,l=this.getAbsoluteIndex()){}},e=new WeakSet,Ro=function(n){return this.normalizeTitle(n,6,{halfParsed:!0,temporary:!0,decode:!0,page:""}).valid},wu=function(n){},i)}}),_n,Po=C({"src/link/index.ts"(){"use strict";Ze(),M(),j(),_s(),_n=class extends Be{get type(){return"link"}get innerText(){return this.length>1?this.lastChild.text():Dt(this.firstChild.text().replace(/^\s*:?/u,""))}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i="nested-link",{lintConfig:r}=I,n=r.getSeverity(i);if(n&&this.closest("ext-link-text")){const l=z(this,{start:e},i,"link-in-extlink",n);(r.computeEditInfo||r.fix)&&(l.fix=_e(l,"delink",this.innerText)),s.push(l)}return s}}}}}),Yr,Zr,Vt,$n=C({"src/magicLink.ts"(){"use strict";var e,t,en,i;M(),de(),ae(),j(),q(),Yr=String.raw`(?:[${We}\t]| |�*160;|&#[xX]0*[aA]0;)`,Zr=new RegExp(`${Yr}+`,"gu"),Vt=(i=class extends E{constructor(n,l="free-ext-link",a=I.getConfig(),o){super(n,a,o,{});N(this,t);N(this,e);L(this,e,l)}get type(){return f(this,e)}get innerText(){const n=new Map([["!","|"],["=","="]]);let l=Ye(this.childNodes.map(a=>{const{type:o}=a,u=String(a.name);return o==="magic-word"&&n.has(u)?n.get(u):a}));return this.type==="magic-link"&&(l=l.replace(Zr," ")),l}get link(){const{innerText:n}=this;return this.type==="magic-link"?n.startsWith("ISBN")?`ISBN ${n.slice(5).replace(/[- ]/gu,"").replace(/x$/u,"X")}`:n:Dl(n).replace(/\n/gu,"%0A")}lint(n=this.getAbsoluteIndex(),l){{const a=super.lint(n,l),o=new re(this,n),{lintConfig:u}=I,{type:d,childNodes:h}=this;if(d==="magic-link"){const x="invalid-isbn",m=u.getSeverity(x);return m&&P(this,t,en).call(this)&&a.push(z(this,o,x,"invalid-isbn",m)),a}let g="invalid-url",c=u.getSeverity(g);if(c&&!this.querySelector("magic-word"))try{this.getUrl()}catch(x){a.push(z(this,o,g,"invalid-url",c))}const p=d==="ext-link-url";if(g="unterminated-url",c=u.getSeverity(g,p?"pipe":"punctuation"),c){const x=p?/\|/u:/[,;。:!?()]+/u,m=h.find(v=>v.type==="text"&&x.test(v.data));if(m){const{data:v}=m,S=B(m,o,g,I.msg("in-url",p?'"|"':"full-width-punctuation"),c);if(u.computeEditInfo){const{index:w,0:y}=x.exec(v),A=S.startIndex+w;S.suggestions=p?[Gt(A,1)]:[Gt(A),{desc:I.msg("encode"),range:[A,A+y.length],text:encodeURI(y)}]}a.push(S)}}return a}}getUrl(n){this.lspError("MagicLinkToken.getUrl")}getAttribute(n){return n==="invalid"?P(this,t,en).call(this):super.getAttribute(n)}},e=new WeakMap,t=new WeakSet,en=function(){if(this.type==="magic-link"){const{link:n}=this;if(n.startsWith("ISBN")){const l=[...n.slice(5)].map(a=>a==="X"?10:Number(a));return l.length===10?l.reduce((a,o,u)=>a+o*(10-u),0)%11!==0:l.length===13&&(l[12]===10||l.reduce((a,o,u)=>a+o*(u%2?3:1),0)%10!==0)}}return!1},i)}}),el,Ai,tl,dt,Oo=C({"src/extLink.ts"(){"use strict";var e,t;Ee(),M(),He(),j(),q(),$n(),el=[Pe("[")],dt=(t=class extends(tl=E){constructor(i,r="",n="",l,a=[]){super(void 0,l,a,{});N(this,e);const o=i&&/^\0\d+f\x7F$/u.test(i)?a[Number(i.slice(1,-2))]:new Vt(i,"ext-link-url",l,a);if(this.insertAt(o),L(this,e,r),n){const u=new E(n,l,a,{});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(),r){{const n=super.lint(i,r),l="var-anchor",a=I.lintConfig.getSeverity(l,"extLink");return a&&this.length===1&&this.closest("heading-title")&&n.push(z(this,{start:i},l,"variable-anchor",a)),n}}print(){return super.print(this.length===1?{pre:"[",post:`${f(this,e)}]`}:{pre:"[",sep:f(this,e),post:"]"})}},e=new WeakMap,t),Ai=te(tl),dt=Z(Ai,0,"ExtLinkToken",el,dt),Y(Ai,1,dt)}}),tn,Su=C({"src/imagemapLink.ts"(){"use strict";q(),wt(),Po(),Oo(),tn=class extends E{get type(){return"imagemap-link"}constructor(e,t,s,i,r=[]){super(void 0,i,r),this.append(e,t.length===2?new _n(...t,i,r):new dt(...t,i,r),new we(s,i,r))}}}}),jo={};ie(jo,{ImagemapToken:()=>Bo});var Bo,Au=C({"src/multiLine/imagemap.ts"(){"use strict";M(),Ce(),ae(),j(),wn(),Lo(),No(),Su(),Bo=class extends Is{get image(){return this.childNodes.find(Fs("imagemap-image"))}constructor(e,t=I.getConfig(),s=[]){if(super(void 0,t,s,{}),!e)return;const i=e.split(`
|
|
13
|
+
`),r=new Set(t.protocol.split("|"));let n=!0,l=!1;for(const a of i){const o=a.trim();if(!(l||!o||o.startsWith("#"))){if(n){const u=a.indexOf("|"),d=u===-1?a:a.slice(0,u),{valid:h,ns:g}=this.normalizeTitle(d,0,{halfParsed:!0,temporary:!0,page:""});if(h&&g===6){const c=new ut("imagemap",d,u===-1?void 0:a.slice(u+1),t,s);super.insertAt(c),n=!1;continue}else l=!0}else if(a.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(a);continue}else if(a.includes("[")){const u=a.indexOf("["),d=a.slice(u),h=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(d);if(h){if(this.normalizeTitle(h[1],0,{halfParsed:!0,temporary:!0,selfLink:!0,page:""}).valid){super.insertAt(new tn(a.slice(0,u),h.slice(1),d.slice(d.indexOf("]]")+2),t,s));continue}}else if(d.startsWith("[//")||r.has(d.slice(1,d.indexOf(":")+1))||r.has(d.slice(1,d.indexOf("//")+2))){const g=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(d);if(g){super.insertAt(new tn(a.slice(0,u),g.slice(1),d.slice(d.indexOf("]")+1),t,s));continue}}}}super.insertAt(new ys(a,t,s))}}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new re(this,e),{childNodes:r,image:n}=this,l="invalid-imagemap",{lintConfig:a}=I,o=a.getSeverity(l,n?"link":"image");return o&&(n?Array.prototype.push.apply(s,r.filter(u=>{const d=u.toString().trim();return u.is("noinclude")&&d&&!d.startsWith("#")}).map(u=>{const d=B(u,i,l,"invalid-imagemap-link",o);return a.computeEditInfo&&(d.suggestions=[H(d,-1),_e(d,"comment","# ")]),d})):s.push(z(this,i,l,"imagemap-without-image",o))),s}}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}}}}),sl,ki,il,ht,qo=C({"src/nowiki/comment.ts"(){"use strict";M(),et(),He(),j(),it(),sl=[ze(!1),Pe("<!--")],ht=class extends(il=$e){constructor(t,s,i,r){super(t,i,r);Ie(this,"closed");this.closed=s}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){{if(this.closed)return[];const s="unclosed-comment",{lintConfig:i}=I,r=i.getSeverity(s);if(!r)return[];const n=z(this,{start:t},s,"unclosed-comment",r);return i.computeEditInfo&&(n.suggestions=[Me(n.endIndex,"-->")]),[n]}}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}},ki=te(il),ht=Z(ki,0,"CommentToken",sl,ht),Y(ki,1,ht)}}),Wo={};ie(Wo,{CommentedToken:()=>Mo});var Mo,ku=C({"src/commented.ts"(){"use strict";q(),qo(),Mo=class extends E{get type(){return"ext-inner"}constructor(e,t,s=[]){if(super(void 0,t,s,{AstText:":",CommentToken:":"}),e){let i=e.indexOf("<!--"),r=i!==-1&&e.indexOf("-->",i+4),n=0;for(;r!==!1&&r!==-1;)i>n&&this.insertAt(e.slice(n,i)),this.insertAt(new ht(e.slice(i+4,r),!0,t,s)),n=r+3,i=e.indexOf("<!--",n),r=i!==-1&&e.indexOf("-->",i+4);n<e.length&&this.insertAt(e.slice(n))}}lint(e=this.getAbsoluteIndex()){return super.lint(e,new RegExp(String.raw`<\s*(?:\/\s*)?(${this.name})\b`,"giu"))}}}}),zo={};ie(zo,{NowikiToken:()=>Uo});var nl,rl,Uo,_u=C({"src/nowiki/index.ts"(){"use strict";var e,sn,s;Ze(),M(),j(),it(),nl=pt(i=>new RegExp(String.raw`<\s*(?:/\s*)${i==="nowiki"?"":"?"}(${i})\b`,"giu")),rl=new Set(["languages","section","templatestyles"]),Uo=(s=class extends $e{constructor(){super(...arguments);N(this,e)}get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex()){{const{name:n}=this,{lintConfig:l}=I;let a="void-ext",o=l.getSeverity(a,n);if(o&&P(this,e,sn).call(this)){const d=z(this,{start:r},a,I.msg("nothing-in",n),o);return l.computeEditInfo&&(d.suggestions=[H(d)]),[d]}return super.lint(r,nl(n))}}getAttribute(r){return r==="invalid"?P(this,e,sn).call(this):super.getAttribute(r)}},e=new WeakSet,sn=function(){const{name:r,firstChild:{data:n}}=this;return rl.has(r)&&!!n},s)}}),ll,_i,ol,ct,Ho=C({"src/tagPair/ext.ts"(){"use strict";M(),ae(),j(),bn(),q(),xn(),yn(),ll=[Ts()],ct=class extends(ol=Je){get type(){return"ext"}constructor(e,t,s,i,r=I.getConfig(),n=!1,l=[]){const a=e.toLowerCase(),o=new Cs(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",a,r,l),u=Fe(ce({},r),{ext:r.ext.filter(h=>h!==a),excludes:[...r.excludes],inExt:!0});let d;switch(a){case"tab":u.ext=u.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":a==="poem"&&u.excludes.push("heading"),d=new E(s,u,l);break;case"pre":{const{PreToken:h}=(hu(),X(go));d=new h(s,u,l);break}case"dynamicpagelist":{const{ParamTagToken:h}=(xo(),X(mo));d=new h(n,s,u,l);break}case"inputbox":{const{InputboxToken:h}=(vu(),X(So));d=new h(n,s,u,l);break}case"references":{const{NestedToken:h}=(xi(),X(ps));u.excludes.push("heading"),d=new h(s,n,["ref"],u,l);break}case"choose":{const{NestedToken:h}=(xi(),X(ps));d=new h(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],u,l);break}case"combobox":{const{NestedToken:h}=(xi(),X(ps));d=new h(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],u,l);break}case"gallery":{const{GalleryToken:h}=(yu(),X(Fo));d=new h(s,u,l);break}case"imagemap":{const{ImagemapToken:h}=(Au(),X(jo));d=new h(s,u,l);break}case"hiero":{const{CommentedToken:h}=(ku(),X(Wo));d=new h(s,u,l);break}default:{const{NowikiToken:h}=(_u(),X(zo));d=new h(s,u,l)}}d.setAttribute("name",a),d.type==="plain"&&(d.type="ext-inner"),super(e,o,d,i,r,l),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),{lintConfig:i}=I,r=new re(this,e);if(this.name!=="nowiki"){const n=this.inHtmlAttrs(),l="parsing-order",a=n&&i.getSeverity(l,n===2?"ext":"templateInTable");a&&s.push(z(this,r,l,"ext-in-html",a))}if(this.name==="ref"){let n="var-anchor",l=i.getSeverity(n,"ref");l&&this.closest("heading-title")&&s.push(z(this,r,n,"variable-anchor",l)),n="nested-link",l=i.getSeverity(n,"ref"),l&&this.closest("link,ext-link-text")&&s.push(z(this,r,n,"ref-in-link",l))}return s}}},_i=te(ol),ct=Z(_i,0,"ExtToken",ll,ct),Y(_i,1,ct)}}),Do={};ie(Do,{parseCommentAndExt:()=>Jt});var $i,al,is,ul,Ti,Jt,Ls=C({"parser/commentAndExt.ts"(){"use strict";Ze(),de(),ru(),wt(),ou(),au(),Ho(),qo(),$i="<onlyinclude>",al="</onlyinclude>",{length:is}=$i,ul=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",s=e?"noinclude":"includeonly";return pt(i=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${i})(\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(al,t+is)}},Jt=(e,t,s,i)=>{if(i){let{i:o,j:u}=Ti(e);if(o!==-1&&u!==-1){let d="";const h=g=>{new we(g,t,s),d+=`\0${s.length-1}n`};for(;o!==-1&&u!==-1;){const g=`\0${s.length}e`;new Rt(e.slice(o+is,u),t,s),o>0&&h(e.slice(0,o)),d+=g,e=e.slice(u+is+1),{i:o,j:u}=Ti(e)}return e&&h(e),d}}const{ext:r}=t;let n=r,l=t;if(r.includes("translate")){n=r.filter(u=>u!=="translate"&&u!=="tvar"),l=Fe(ce({},t),{ext:n});const o=[];e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,u=>(o.push(u),`\0${o.length-1}`)).replace(/<translate( nowrap)?>([\s\S]+?)?<\/translate>/gu,(u,d,h)=>{const g=s.length;return new no(d,h&&ye(h,o),l,s),`\0${g}g`}),e=ye(e,o)}const a=ul[i?1:0](n.join("|"));return a.lastIndex=0,a.test(e)?e.replace(a,(o,u,d,h,g,c,p,x,m)=>{const v=s.length;let S="n";if(u)S="e",new ct(u,d,h,g,l,c,s);else if(o.startsWith("<!--")){S="c";const w=o.endsWith("-->");new ht(ye(o,s,1).slice(4,w?-3:void 0),w,t,s)}else c?new Pt(c,p&&ye(p,s,1),x&&ye(x,s,1),m,t,s):new we(o,t,s,!0);return`\0${v}${S}`}):e}}}),dl,hl,cl,gl,Ci,pl,Bt,$u=C({"src/tag/html.ts"(){"use strict";var e,t;M(),ae(),bn(),j(),io(),dl=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),hl=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=[Ts()],Bt=(t=class extends(pl=vn){constructor(i,r,n,l,a,o){super(i,r,n,a,o);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:r,name:n}=this,{html:[,,l]}=this.getAttribute("config");return l.includes(n)?i&&n!=="br"?"":super.text("/"):super.text(r&&!i?"/":"")}lint(i=this.getAbsoluteIndex(),r){var n;{const l=super.lint(i,r),{name:a,parentNode:o,closing:u,selfClosing:d}=this,h=new re(this,i),{lintConfig:g}=I,{computeEditInfo:c,fix:p}=g,x=this.inTableAttrs();let m="h1",v=g.getSeverity(m,"html");if(v&&a==="h1"&&!u){const $=z(this,h,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 $=z(this,h,m,"html-in-table",v);c&&x===2&&($.suggestions=[H($)]),l.push($)}if(m="obsolete-tag",v=g.getSeverity(m,a),v&&cl.has(a)&&l.push(z(this,h,m,"obsolete-tag",v)),m="bold-header",v=g.getSeverity(m,a),v&&(a==="b"||a==="strong")&&((n=this.closest("heading-title,ext"))==null?void 0:n.type)==="heading-title"){const $=z(this,h,m,"bold-in-header",v);c&&($.suggestions=[H($)]),l.push($)}const{html:[,S,w]}=this.getAttribute("config"),y=w.includes(a),A=S.includes(a),k=!y&&!A;if(m="unmatched-tag",u&&(d||y)||d&&k){if(v=g.getSeverity(m,u?"both":"selfClosing"),v){const $=z(this,h,m,u?"closing-and-self-closing":"invalid-self-closing",v);if(c||p){const b=hn(i),_={desc:I.msg("no-self-closing"),range:[$.endIndex-2,$.endIndex-1],text:""};A?c&&($.suggestions=[b,_]):u?$.fix=y?b:_:c&&($.suggestions=[_,Me($.endIndex,`></${a}>`,-2)])}l.push($)}}else if(!this.findMatchingTag()){const $=z(this,h,m,u?"unmatched-closing":"unclosed-tag"),b=this.closest("magic-word");if(b&&dl.has(b.name))v=g.getSeverity(m,"conditional");else if(u)v=g.getSeverity(m,"closing"),$.suggestions=[H($)];else{v=g.getSeverity(m,"opening");const _=o==null?void 0:o.childNodes;hl.has(a)&&(_!=null&&_.slice(0,_.indexOf(this)).some(T=>T.is("html")&&T.name===a&&!T.findMatchingTag())&&($.suggestions=[Me(i+1,"/")]),this.closest("heading-title")&&($.rule="format-leakage",v=g.getSeverity("format-leakage",a)))}v&&($.severity=v,l.push($))}return l}}getAttribute(i){return i==="invalid"?this.inTableAttrs()===2:super.getAttribute(i)}json(i,r=this.getAbsoluteIndex()){}},e=new WeakMap,t),Ci=te(pl),Bt=Z(Ci,0,"HtmlToken",gl,Bt),Y(Ci,1,Bt)}}),Go={};ie(Go,{parseHtml:()=>Vo});var fl,Vo,Tu=C({"parser/html.ts"(){"use strict";yn(),$u(),fl=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,Vo=(e,t,s)=>{var l;const{html:i}=t;(l=t.htmlElements)!=null||(t.htmlElements=new Set([...i[0],...i[1],...i[2]]));const r=e.split("<");let n=r.shift();for(const a of r){const o=fl.exec(a),u=o==null?void 0:o[2],d=u==null?void 0:u.toLowerCase();if(!o||!t.htmlElements.has(d)){n+=`<${a}`;continue}const[,h,,g="",c,p]=o,{length:x}=s,m=new Cs(g,"html-attrs",d,t,s),v=m.hasAttr("itemprop");if(d==="meta"&&!(v&&m.hasAttr("content"))||d==="link"&&!(v&&m.hasAttr("href"))){n+=`<${a}`,s.length=x;continue}n+=`\0${s.length}x${p}`,new Bt(u,m,h==="/",c==="/>",t,s)}return n}}}),ml,Ii,xl,gt,Qo=C({"src/table/base.ts"(){"use strict";bn(),q(),tt(),yn(),ml=[Ts(1)],gt=class extends(xl=E){constructor(e,t,s,i,r,n=[],l){super(void 0,r,n,l),this.append(new Ue(t,"table-syntax",r,n),new Cs(i,"table-attrs",s,r,n))}escape(){}},Ii=te(xl),gt=Z(Ii,0,"TableBaseToken",ml,gt),Y(Ii,1,gt)}}),vl,Ni,ke,ns,It,Nt,ws,Jo=C({"src/table/td.ts"(){"use strict";M(),ae(),mn(),j(),q(),Qo(),ws=class extends(Ni=gt,vl=[ks(!1)],Ni){constructor(e,t,s,i=[]){var a;let r=/\||\0\d+!\x7F/u.exec(t!=null?t:""),n=r?t.slice(0,r.index):"";/\[\[|-\{/u.test(n)&&(r=null,n=""),super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",n,s,i),Y(ns,5,this),je(this,It),je(this,ke,""),r&&([Va(this,ke)._]=r);const l=new E(t==null?void 0:t.slice(((a=r==null?void 0:r.index)!=null?a:NaN)+ue(this,ke).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 Gi(this,It,Nt).call(this).subtype}afterBuild(){ue(this,ke).includes("\0")&&be(this,ke,this.buildFromStr(ue(this,ke),0)),super.afterBuild()}toString(e){const{childNodes:[t,s,i]}=this;return t.toString(e)+s.toString(e)+ue(this,ke)+i.toString(e)}text(){const{childNodes:[e,t,s]}=this;return e.text()+t.text()+ue(this,ke)+s.text()}getGaps(e){return e===1?ue(this,ke).length:0}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new re(this,e+this.getRelativeIndex(this.length-1)),r="pipe-like",{lintConfig:n}=I,{computeEditInfo:l,fix:a}=n,o=["td","double"].map(u=>n.getSeverity(r,u));for(const u of this.lastChild.childNodes)if(u.type==="text"){const{data:d}=u;if(d.includes("|")){const h=d.includes("||"),g=o[h?1:0];if(g){const c=B(u,i,r,"pipe-in-table",g);if(l||a)if(h){const p={caption:"|+",td:"|",th:"!"}[this.subtype];c.fix=_e(c,"newline",d.replace(/\|\|/gu,`
|
|
14
14
|
${p}`))}else l&&(c.suggestions=[pn(c.startIndex,d)]);s.push(c)}}}return s}}isIndependent(){return this.firstChild.text().startsWith(`
|
|
15
|
-
`)}getAttr(e){{const t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}}escape(){}print(){const{childNodes:[e,t,s]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${
|
|
16
|
-
|}`,t){
|
|
17
|
-
`);let
|
|
18
|
-
${l.shift()}`,
|
|
19
|
-
${h}${
|
|
15
|
+
`)}getAttr(e){{const t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}}escape(){}print(){const{childNodes:[e,t,s]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${ue(this,ke)}${s.print()}</span>`}json(e,t=this.getAbsoluteIndex()){}},ns=te(Ni),ke=new WeakMap,It=new WeakSet,Nt=function(){var e;const t=this.firstChild.text(),s=t.slice(-1);let i="td";if(s==="!"?i="th":s==="+"&&(i="caption"),this.isIndependent())return{subtype:i};const{previousSibling:r}=this;return ce({},Gi(e=r,It,Nt).call(e))},Nt=Z(ns,17,"#getSyntax",vl,It,Nt),an(ns,ws)}}),Tn,Xo=C({"src/table/trBase.ts"(){"use strict";M(),j(),Qo(),Jo(),Tn=class extends gt{lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=this.childNodes.find(({type:a})=>a==="table-inter");if(!i)return s;const r=Ut(i),n="fostered-content",l=r&&I.lintConfig.getSeverity(n,r===2?void 0:"transclusion");if(l){const a=B(i,{start:e},n,"content-outside-table",l);a.startIndex++,a.startLine++,a.startCol=0,s.push(a)}return s}}getRowCount(){return Number(this.childNodes.some(e=>e instanceof ws&&e.isIndependent()&&!e.firstChild.text().endsWith("+")))}}}}),bl,yl,wl,Sl,Li,rs,fs,Cu=C({"src/table/index.ts"(){"use strict";M(),Ce(),ae(),mn(),j(),Xo(),tt(),bl=(e,t)=>new Array(e).fill(void 0).map((s,i)=>t(i)),yl=({type:e})=>e==="tr"||e==="table-syntax",wl=class extends Array{},fs=class extends(Li=Tn,Sl=[ks(!1)],Li){constructor(e,t,s,i){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,"table",t,s,i,{}),Y(rs,5,this)}get type(){return"table"}get closed(){return this.lastChild.is("table-syntax")}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new re(this,e),r=["unclosed-table","table-layout"],n=r.map(l=>I.lintConfig.getSeverity(l));if(n[0]&&!this.closed&&s.push(B(this.firstChild,i,r[0],"unclosed-table",n[0])),n[1]){const l=this.getLayout(),{length:a}=l;if(a>1){let o=1,u=1/0,d=0;for(;d<a;d++){const h=l[d],g=h.length;if(g<o)break;g<u&&(u=g);const c=h.indexOf(h[g-1])+1;if(c>u)break;c>o&&(o=c)}if(d<a){const h=this.getNthRow(d),g=B(h,i,r[1],"inconsistent-table",n[1]);g.startIndex++,g.startLine++,g.startCol=0,s.push(g)}}}return s}}close(e=`
|
|
16
|
+
|}`,t){me.run(()=>{const s=new Ue(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 r=0;r<i.length;r++){const n=i[r];let l=0,a=0,o;for(const u of t[r].childNodes.slice(2))if(u.is("td")){if(u.isIndependent()&&(o=u.subtype!=="caption"),o){const d={row:r,column:l},{rowspan:h,colspan:g}=u;for(l++;n[a];)a++;for(let c=r;c<Math.min(r+h,s);c++)for(let p=a;p<a+g;p++)i[c][p]=d;a+=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 r of this.childNodes.slice(2)){const{type:n}=r;if(n==="tr"&&r.getRowCount()&&(e--,e<0))return r}return}}json(e,t=this.getAbsoluteIndex()){}},rs=te(Li),Z(rs,1,"getLayout",Sl,fs),an(rs,fs)}}),Ko,Iu=C({"src/table/tr.ts"(){"use strict";Xo(),Ko=class extends Tn{get type(){return"tr"}constructor(e,t,s,i){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,e,"tr",t,s,i)}}}}),Cn,Yo=C({"src/nowiki/listBase.ts"(){"use strict";it(),Cn=class extends $e{get indent(){}json(e,t=this.getAbsoluteIndex()){}}}}),In,Zo=C({"src/nowiki/dd.ts"(){"use strict";Yo(),In=class extends Cn{get type(){return"dd"}}}}),ea={};ie(ea,{parseTable:()=>ta});var Al,Fi,ta,Nu=C({"parser/table.ts"(){"use strict";q(),Cu(),Iu(),Jo(),Zo(),Al=e=>e.lastChild.constructor!==E,Fi=(e,t)=>e.is("td")?t.pop():e,ta=({firstChild:{data:e},type:t,name:s},i,r)=>{const n=[],l=e.split(`
|
|
17
|
+
`);let a=t==="root"||t==="parameter-value"||t==="ext-inner"&&s==="poem"?"":`
|
|
18
|
+
${l.shift()}`,o;const u=(d,h)=>{if(!h){a+=d;return}const{lastChild:g}=h;if(Al(h)){const c=new E(d,i,r);c.type="table-inter",c.setAttribute("stage",3),h.insertAt(c)}else g.setText(g.toString()+d)};for(const d of l){o=n.pop();const[h]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(d),g=d.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(;o&&!o.is("td");)o=n.pop();const[,w,y,A,k]=c;w&&new In(w,i,r),u(`
|
|
19
|
+
${h}${w&&`\0${r.length-1}d`}${y}\0${r.length}b`,o),n.push(...o?[o]:[],new fs(A,k,i,r));continue}else if(!o){a+=`
|
|
20
20
|
${d}`;continue}const p=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(g);if(!p){u(`
|
|
21
|
-
${d}`,
|
|
22
|
-
${h}${x}`,!0),u(
|
|
23
|
-
${h}${m}`,
|
|
24
|
-
${h}${v}`;const $=b=>{const _=new
|
|
25
|
-
`)&&(v=ve(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(d){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=nn(c,t,s,i,r),!k){o+=`[[${h}${g}${c}`;continue}}}else{o+=`[[${x}`;continue}c&&(c=Nn(c,t,s,r));let A=_n;w||(S===6?(c&&(c=Ln(c,t,s,!0)),A=kn):S===14&&(A=uo)),c===void 0&&g&&(c=""),o+=`\0${s.length}l${p}`,new A(h,c,t,s,g)}return o}}}),co={};se(co,{parseMagicLinks:()=>go});var Ri,Pi,Oi,ji,go,Bu=C({"parser/magicLinks.ts"(){"use strict";he(),$n(),Ri=String.raw`[${qe}\t]| |�*160;|�*a0;`,Pi=`(?:${Ri})+`,Oi=`(?:${Ri}|-)`,ji=String.raw`(?:RFC|PMID)${Pi}\d+\b|ISBN${Pi}(?:97[89]${Oi}?)?(?:\d${Oi}?){9}[\dx]\b`,go=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${ft}${mt})|${ji})`,"giu")}catch(i){t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${ft}${mt})|${ji})`,"giu")}return e.replace(t.regexMagicLinks,(i,r,n)=>{let l=r?i.slice(r.length):i;if(n){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,d=u.exec(l);if(d){let h=1;d[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(l.slice(0,d.index))&&(h=2),o=l.slice(d.index+h)+o,l=l.slice(0,d.index+h)}return o.length>=n.length?i:(new Vt(l,void 0,t,s),`${r}\0${s.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(l))return i;return new Vt(l,"magic-link",t,s),`${r}\0${s.length-1}i`})}}}),po,qu=C({"util/html.ts"(){"use strict";po=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,i)=>s!==e[i])}}),fo,Wu=C({"src/nowiki/list.ts"(){"use strict";Ka(),fo=class extends Cn{get type(){return"list"}}}}),mo={};se(mo,{parseList:()=>xo});var xo,Mu=C({"parser/list.ts"(){"use strict";qu(),Wu(),Ya(),xo=(e,t,s,i)=>{const r=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!r)return t.lastPrefix="",e;const[n,l,o,a]=r,u=o.replace(/;/gu,":"),d=po(u,t.lastPrefix),h=((d>1?o.slice(d-1):o)+a).split(/(?=;)/u),g=h[0].startsWith(";");let c=h.length-(g?0:1);if(d>1){const T=o.slice(0,d-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=u;let p=l+h.map((T,N)=>`\0${i.length+N}d`).join("")+e.slice(n.length);for(const T of h)new fo(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,N)=>(new In(T,s,i),`${p.slice(0,N)}\0${i.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}=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:q,selfClosing:J}=i[Number(T.slice(1,-2))];(x.includes(R)||!J&&!m.includes(R))&&_(q)}else if(T.endsWith("q")){const{bold:R,italic:q}=i[Number(T.slice(1,-2))];R&&(_(A),A=!A),q&&(_(k),k=!k)}else if(y===0){if(T.length>=c)return b(T.slice(0,c),N);c-=T.length,w.lastIndex=N+4+String(i.length).length,p=b(T,N)}S=w.exec(p)}return p}}}),ls,Tl,Bi,Cl,Mt,zu=C({"src/converterFlags.ts"(){"use strict";var e,t;W(),ue(),_s(),O(),B(),st(),ls=new Set(["A","T","R","D","-","H","N"]),Tl=[Qt()],Mt=(t=class extends(Cl=E){constructor(i,r,n=[]){super(void 0,r,n,{});L(this,e);this.safeAppend(i.map(l=>new xe(l,"converter-flag",r,n)))}get type(){return"converter-flags"}afterBuild(){F(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(r=>i.has(r)))}isInvalidFlag(i,r,n,l){return typeof i=="object"&&(i=i.text().trim(),r=this.getVariantFlags(),n=this.getUnknownFlags(),l=new Set(f(this,e).filter(o=>ls.has(o)))),!!i&&!r.has(i)&&!n.has(i)&&(r.size>0||!l.has(i))}lint(i=this.getAbsoluteIndex(),r){{const n=this.getVariantFlags(),l=this.getUnknownFlags(),o=new Set(f(this,e).filter(m=>ls.has(m))),a=f(this,e).filter(m=>!m).length,u=f(this,e).length-l.size-a,{lintConfig:d}=I,{computeEditInfo:h,fix:g}=d,c=super.lint(i,r);if(n.size===u||o.size===u)return c;const p="no-ignored",x=d.getSeverity(p,"conversionFlag");if(x){const m=new le(this,i);for(let v=0;v<this.length;v++){const w=this.childNodes[v],S=w.text().trim();if(this.isInvalidFlag(S,n,l,o)){const y=j(w,m,p,"invalid-conversion-flag",x);(h||g)&&(n.size===0&&ls.has(S.toUpperCase())?y.fix=gn(y,S):h&&(y.suggestions=[U(y,v&&-1)])),c.push(y)}}}return c}}print(){return super.print({sep:";"})}},e=new WeakMap,t),Bi=te(Cl),Mt=Z(Bi,0,"ConverterFlagsToken",Tl,Mt),Y(Bi,1,Mt)}}),fs,Uu=C({"src/converterRule.ts"(){"use strict";O(),B(),st(),fs=class extends E{get type(){return"converter-rule"}get variant(){}constructor(e,t=!0,s=I.getConfig(),i=[]){super(void 0,s,i);const r=e.indexOf(":"),n=e.slice(0,r).indexOf("=>"),l=n===-1?e.slice(0,r):e.slice(n+2,r);t&&s.variants.includes(l.trim().toLowerCase())?(super.insertAt(new xe(l,"converter-rule-variant",s,i)),super.insertAt(new xe(e.slice(r+1),"converter-rule-to",s,i)),n!==-1&&super.insertAt(new xe(e.slice(0,n),"converter-rule-from",s,i),0)):super.insertAt(new xe(e,"converter-rule-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()){}}}}),Il,qi,Nl,zt,Hu=C({"src/converter.ts"(){"use strict";he(),He(),Re(),B(),zu(),Uu(),Il=[Le,Pe("-{")],zt=class extends(Nl=E){get type(){return"converter"}constructor(e,t,s,i=[]){super(void 0,s,i),this.insertAt(new Mt(e,s,i));const[r]=t,n=r.includes(":"),l=new fs(r,n,s,i);n&&l.length===1||!n&&t.length===2&&!ve(t[1]).trim()?this.insertAt(new fs(t.join(";"),!1,s,i)):this.safeAppend([l,...t.slice(1).map(o=>new fs(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()}|${Ye(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?"|":""}${vt(t,{sep:";"})}}-</span>`}},qi=te(Nl),zt=Z(qi,0,"ConverterToken",Il,zt),Y(qi,1,zt)}}),vo={};se(vo,{parseConverter:()=>bo});var bo,Du=C({"parser/converter.ts"(){"use strict";Hu(),bo=(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,r=/-\{|\}-/gu,n=[];let l=i,o=l.exec(e);for(;o;){const{0:u,index:d}=o;if(u==="}-"){const h=n.pop(),{length:g}=s,c=e.slice(h.index+2,d),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 zt(x,w,t,s),e=`${e.slice(0,h.index)}\0${g}v${e.slice(d+2)}`,n.length===0&&(l=i),l.lastIndex=h.index+3+String(g).length}else n.push(o),l=r,l.lastIndex=d+2;o=l.exec(e)}return e}}}),ws={};se(ws,{Token:()=>E});var Ll,E,B=C({"src/index.ts"(){"use strict";var e,t,s,i,r,n,l,o,a,yo,wo,So,Ao,ko,_o,$o,To,Co,Io,No,Lo,A;he(),Me(),W(),Ie(),O(),eu(),tu(),Ll=["category","html-attr#id,ext-attr#id,table-attr#id"],E=(A=class extends Ft{constructor(b,_=I.getConfig(),T=[],N){super();L(this,a);L(this,e,"plain");L(this,t,0);L(this,s);L(this,i);L(this,r);L(this,n,!1);L(this,l);L(this,o);typeof b=="string"&&this.insertAt(b),F(this,s,_),F(this,i,T),T.push(this)}get type(){return f(this,e)}set type(b){F(this,e,b)}get pageName(){return f(this.getRootNode(),o)}set pageName(b){if(b){const _=this.normalizeTitle(b,0,{temporary:!0,page:""});F(this,o,_.valid?_.title:void 0)}else F(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)>=be)return this;switch(b){case 0:if(this.type==="root"){f(this,i).pop();const N=P(this,a,yo).call(this);_&&(_=!N)}F(this,r,_),P(this,a,wo).call(this,_);break;case 1:P(this,a,So).call(this);break;case 2:P(this,a,Ao).call(this);break;case 3:P(this,a,ko).call(this);break;case 4:P(this,a,_o).call(this);break;case 5:P(this,a,$o).call(this,T);break;case 6:P(this,a,To).call(this,T);break;case 7:P(this,a,Co).call(this);break;case 8:P(this,a,Io).call(this);break;case 9:P(this,a,No).call(this);break;case 10:P(this,a,Lo).call(this)}if(this.type==="root")for(const N of f(this,i))N==null||N.parseOnce(b,_,T);return zn(this,t)._++,this}buildFromStr(b,_){const T=b.split(/[\0\x7F]/u).map((N,R)=>{if(R%2===0)return new Ki(N);if(isNaN(N.slice(-1)))return f(this,i)[Number(N.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${N}`)});return _===0?T.map(String).join(""):_===1?Ye(T):T}build(){F(this,t,be);const{length:b,firstChild:_}=this,T=_==null?void 0:_.toString();if(b===1&&_.type==="text"&&T.includes("\0")&&(Fn(this,0,1,this.buildFromStr(T)),this.normalize(),this.type==="root"))for(const N of f(this,i))N==null||N.build()}afterBuild(){if(this.type==="root")for(const b of f(this,i))b==null||b.afterBuild();F(this,n,!0)}parse(b=be,_,T){for(b=Math.min(b,be);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,r))!=null?_:!!f(this.getRootNode(),r);case"accum":return f(this,i);case"built":return f(this,n);case"stage":return f(this,t);case"invalid":return this.type==="table-inter"&&Ut(this)===2;default:return super.getAttribute(b)}}setAttribute(b,_){switch(b){case"stage":f(this,t)===0&&this.type==="root"&&f(this,i).shift(),F(this,t,_);break;default:super.setAttribute(b,_)}}insertAt(b,_=this.length){const T=typeof b=="string"?new Ki(b):b;super.insertAt(T,_);const{type:N}=T;return N==="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:N}=I,{computeEditInfo:R,fix:q,ignoreDisables:J,configurationComment:z}=N;let X=super.lint(b,_);if(this.type==="root"){const pe=new Map,G="no-duplicate",V=["category","id"].map(H=>N.getSeverity(G,H)),K=this.toString(),Fe=Ll.filter((H,ee)=>V[ee]).join();if(Fe){for(const H of this.querySelectorAll(Fe)){let ee;if(H.is("category"))ee=H.name;else{const D=H.getValue();D&&D!==!0&&(ee=`#${D}`)}if(ee){const D=pe.get(ee);D?D.add(H):pe.set(ee,new Set([H]))}}for(const[H,ee]of pe)if(ee.size>1&&!H.startsWith("#mw-customcollapsible-")){const D=!H.startsWith("#"),ne=`duplicate-${D?"category":"id"}`,ae=V[D?0:1];X.push(...[...ee].map(oe=>{const re=M(oe,{start:oe.getAbsoluteIndex()},G,ne,ae);return R&&D&&(re.suggestions=[U(re)]),re}))}}if(!J){const H=new RegExp(String.raw`<!--\s*${z}-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->`,"gu"),ee=[];let D=H.exec(K);for(;D;){const{1:ne,index:ae}=D,oe=(T=D[2])==null?void 0:T.trim();ee.push({line:this.posFromIndex(ae).top+(ne==="disable-line"?0:1),from:ne==="disable"?H.lastIndex:void 0,to:ne==="enable"?H.lastIndex:void 0,rules:oe?new Set(oe.split(",").map(re=>re.trim())):void 0}),D=H.exec(K)}X=X.filter(({rule:ne,startLine:ae,startIndex:oe})=>{const re={pos:0};for(const{line:ce,from:me,to:we,rules:nt}of ee){if(ce>ae+1)break;if(nt&&!nt.has(ne))continue;if(ce===ae&&me===void 0&&we===void 0)return!1;me<=oe&&me>re.pos?(re.pos=me,re.type="from"):we<=oe&&we>re.pos&&(re.pos=we,re.type="to")}return re.type!=="from"})}if(q&&X.some(({fix:H})=>H)){const H=X.map(({fix:ne})=>ne).filter(Boolean).sort(({range:[ne,ae]},{range:[oe,re]})=>ae===re?oe-ne:re-ae);let ee=1/0,D=K;for(const{range:[ne,ae],text:oe}of H)ae<=ee&&(D=D.slice(0,ne)+oe+D.slice(ae),ee=ne);Object.assign(X,{output:D})}if(!R)for(const H of X)delete H.fix,delete H.suggestions}return X}}toString(b,_){return b?super.toString(!0,_):Xe(f(this,l),()=>super.toString(!1,_),T=>{const N=this.getRootNode();N.type==="root"&&f(N,n)&&F(this,l,T)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakMap,l=new WeakMap,o=new WeakMap,a=new WeakSet,yo=function(){const{parseRedirect:b}=(nu(),Q(ta)),_=this.firstChild.toString(),T=b(_,f(this,s),f(this,i));return T&&this.setText(T),!!T},wo=function(b){const{parseCommentAndExt:_}=(Ns(),Q(Ha));this.setText(_(this.firstChild.toString(),f(this,s),f(this,i),b))},So=function(){const{parseBraces:b}=(An(),Q(ya)),_=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))},Ao=function(){if(f(this,s).excludes.includes("html"))return;const{parseHtml:b}=(Tu(),Q(Da));this.setText(b(this.firstChild.toString(),f(this,s),f(this,i)))},ko=function(){if(f(this,s).excludes.includes("table"))return;const{parseTable:b}=(Nu(),Q(Za));this.setText(b(this,f(this,s),f(this,i)))},_o=function(){if(f(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:b}=(Ru(),Q(so));this.setText(b(this,f(this,s),f(this,i)))},$o=function(b){const{parseLinks:_}=(ju(),Q(ho));this.setText(_(this.firstChild.toString(),f(this,s),f(this,i),this.pageName,b))},To=function(b){if(f(this,s).excludes.includes("quote"))return;const{parseQuotes:_}=(lo(),Q(ro)),T=this.firstChild.toString().split(`
|
|
26
|
-
`);for(let
|
|
27
|
-
`))},
|
|
28
|
-
`),
|
|
29
|
-
`))},
|
|
21
|
+
${d}`,o),n.push(o);continue}const[,x,m,v,S]=p;if(x){for(;!o.is("table");)o=n.pop();o.close(`
|
|
22
|
+
${h}${x}`,!0),u(S,n[n.length-1])}else if(m){o=Fi(o,n),o.is("tr")&&(o=n.pop());const w=new Ko(`
|
|
23
|
+
${h}${m}`,S,i,r);n.push(o,w),o.insertAt(w)}else{o=Fi(o,n);const w=v==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu;let y=w.exec(S),A=0,k=`
|
|
24
|
+
${h}${v}`;const $=b=>{const _=new ws(k,S.slice(A,y==null?void 0:y.index),i,r);return b.insertAt(_),_};for(;y;)$(o),{lastIndex:A}=w,[k]=y,y=w.exec(S);n.push(o,$(o))}}return a.slice(1)}}}),qt,Lu=C({"../cm-util/dist/index.mjs"(){"use strict";qt=e=>!/^_{2}.+_{2}$/u.test(e)}}),sa,Fu=C({"src/nowiki/hr.ts"(){"use strict";it(),sa=class extends $e{get type(){return"hr"}}}}),kl,Ei,_l,Wt,Eu=C({"src/nowiki/doubleUnderscore.ts"(){"use strict";var e,t;et(),He(),it(),kl=[ze(),Pe("__")],Wt=(t=class extends(_l=$e){constructor(i,r,n,l,a){var h,g;super(i,l,a);N(this,e);const o=i.toLowerCase(),{doubleUnderscore:[,,u,d]}=l;this.setAttribute("name",(g=r?(h=d==null?void 0:d[i])==null?void 0:h.toLowerCase():u==null?void 0:u[o])!=null?g:o),L(this,e,n)}get type(){return"double-underscore"}toString(){const i=f(this,e)?"__":"__";return i+this.innerText+i}print(){const i=f(this,e)?"__":"__";return super.print({pre:i,post:i})}},e=new WeakMap,t),Ei=te(_l),Wt=Z(Ei,0,"DoubleUnderscoreToken",kl,Wt),Y(Ei,1,Wt)}}),ia={};ie(ia,{parseHrAndDoubleUnderscore:()=>na});var na,Ru=C({"parser/hrAndDoubleUnderscore.ts"(){"use strict";Lu(),Fu(),Eu(),vo(),na=({firstChild:{data:e},type:t,name:s},i,r)=>{var u,d,h;const{doubleUnderscore:[n,l,a]}=i,o=[...n,...l];return(u=i.insensitiveDoubleUnderscore)!=null||(i.insensitiveDoubleUnderscore=new Set(n.filter(qt))),(d=i.sensitiveDoubleUnderscore)!=null||(i.sensitiveDoubleUnderscore=new Set(l.filter(qt))),(h=i.regexHrAndDoubleUnderscore)!=null||(i.regexHrAndDoubleUnderscore=new RegExp(`__(${o.filter(qt).join("|")})__|_{2}(${o.filter(g=>!qt(g)).map(g=>g.slice(2,-2)).join("|")})_{2}`,"giu")),t!=="root"&&(t!=="ext-inner"||s!=="poem")&&(e=`\0${e}`),e=e.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(g,c,p)=>(new sa(p,i,r),`${c}\0${r.length-1}r`)).replace(i.regexHrAndDoubleUnderscore,(g,c,p)=>{var w;const x=c!=null?c:p,m=i.sensitiveDoubleUnderscore.has(x),v=x.toLowerCase(),S=i.insensitiveDoubleUnderscore.has(v);return m||S?(new Wt(x,m,!!p,i,r),`\0${r.length-1}${S&&((w=a==null?void 0:a[v])!=null?w:v)==="toc"?"u":"n"}`):g}),i.excludes.includes("heading")||(e=e.replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(g,c,p,x,m)=>{const v=`${c}\0${r.length}h`;return new ot(p.length,[x,m],i,r),v})),t==="root"||t==="ext-inner"&&s==="poem"?e:e.slice(1)}}}),ra,Pu=C({"src/nowiki/quote.ts"(){"use strict";var e,t;M(),ae(),j(),it(),ra=(t=class extends $e{constructor(i,r,n,l){super(i,n,l);N(this,e);L(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:f(this,e).bold}:void 0),this.italic?{italic:f(this,e).italic}:void 0)}text(){const{parentNode:i,innerText:r}=this;return i!=null&&i.is("image-parameter")&&i.name!=="caption"?"":r}lint(i=this.getAbsoluteIndex()){var r;{const{previousSibling:n,bold:l,closing:a}=this,o=(n==null?void 0:n.type)==="text"?n.data:void 0,u=[],d=new re(this,i),h=["lonely-apos","bold-header"],{lintConfig:g}=I,{computeEditInfo:c}=g,p=[void 0,"word"].map(m=>g.getSeverity(h[0],m)),x=g.getSeverity(h[1]);if(o!=null&&o.endsWith("'")){const m=p[(a.bold||a.italic)&&/[a-z\d]'$/iu.test(o)?1:0];if(m){const v=z(this,d,h[0],I.msg("lonely","'"),m),{startLine:S,startCol:w}=v,[,{length:y}]=/(?:^|[^'])('+)$/u.exec(o),A=i-y,k=Fe(ce({},v),{startIndex:A,endIndex:i,endLine:S,startCol:w-y,endCol:w});c&&(k.suggestions=[bt(A,"'",y),H(k)]),u.push(k)}}if(x&&l&&((r=this.closest("heading-title,ext"))==null?void 0:r.type)==="heading-title"){const m=z(this,d,h[1],"bold-in-header",x);c&&(m.suggestions=[H(m)]),u.push(m)}return u}}json(i,r=this.getAbsoluteIndex()){}},e=new WeakMap,t)}}),la={};ie(la,{parseQuotes:()=>Nn});var Nn,oa=C({"parser/quotes.ts"(){"use strict";Pu(),Nn=(e,t,s,i)=>{var c;const r=e.split(/('{2,})/u),{length:n}=r;if(n===1)return e;let l=0,a=0,o,u,d;for(let p=1;p<n;p+=2){const x=r[p].length;switch(x){case 2:a++;break;case 4:r[p-1]+="'",r[p]="'''";case 3:if(l++,o!==void 0)break;r[p-1].endsWith(" ")?u===void 0&&d===void 0&&(d=p):r[p-1].slice(-2,-1)===" "?o=p:u!=null||(u=p);break;default:r[p-1]+="'".repeat(x-5),r[p]="'''''",a++,l++}}if(a%2===1&&l%2===1){const p=(c=o!=null?o:u)!=null?c:d;p!==void 0&&(r[p]="''",r[p-1]+="'")}let h=!0,g=!0;for(let p=1;p<n;p+=2){const x=r[p].length,m=x!==2,v=x!==3;m&&(h=!h),v&&(g=!g),new ra(r[p],{bold:m&&h,italic:v&&g},t,s),r[p]=`\0${s.length-1}q`}return r.join("")}}}),aa={};ie(aa,{parseExternalLinks:()=>Ln});var Ln,ua=C({"parser/externalLinks.ts"(){"use strict";de(),Oo(),$n(),Ln=(e,t,s,i)=>{var r;return(r=t.regexExternalLinks)!=null||(t.regexExternalLinks=new RegExp(String.raw`\[((?:\0\d+[cn]\x7F)*(?:\0\d+f\x7F|(?:(?:${t.protocol}|//)${ft}|\0\d+m\x7F)${mt}(?=[[\]<>"\t${We}]|\0\d)))([${We}]*(?![${We}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),e.replace(t.regexExternalLinks,(n,l,a,o)=>{const{length:u}=s,d=/&[lg]t;/u.exec(l);return d&&(a="",o=l.slice(d.index)+a+o,l=l.slice(0,d.index)),i?(new Vt(l,"ext-link-url",t,s),`[\0${u}f${a}${o}]`):(new dt(l,a,o,t,s),`\0${u}w`)})}}}),da,Ou=C({"src/link/category.ts"(){"use strict";_s(),da=class extends Be{get type(){return"category"}get sortkey(){}json(e,t=this.getAbsoluteIndex()){}}}}),ha={};ie(ha,{parseLinks:()=>nn});var $l,nn,ju=C({"parser/links.ts"(){"use strict";de(),j(),oa(),ua(),Po(),Io(),Ou(),$l=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,nn=(e,t,s,i,r)=>{var o;(o=t.regexLinks)!=null||(t.regexLinks=new RegExp(String.raw`^\s*(?:${t.protocol}|//)`,"iu"));const n=t.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]]))?\]\]([\s\S]*)$/u:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])*)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]])?)?\]\]([\s\S]*)$/u,l=e.split("[[");let a=l.shift();for(let u=0;u<l.length;u++){let d=!1,h,g,c,p;const x=l[u],m=n.exec(x);if(m)[,h,g,c,p]=m,p.startsWith("]")&&(c!=null&&c.includes("["))&&(c+="]",p=p.slice(1));else{const k=$l.exec(x);k&&(d=!0,[,h,g,c]=k)}if(h===void 0||t.regexLinks.test(h)||/\0\d+[exhbru]\x7F/u.test(h)){a+=`[[${x}`;continue}let v=fe(h).trim();const S=v.startsWith(":");if(S&&d){a+=`[[${x}`;continue}else!v&&c&&!c.includes(`
|
|
25
|
+
`)&&(v=fe(c).trim());const{ns:w,valid:y}=I.normalizeTitle(v,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0,page:i});if(y){if(d){if(w!==6){a+=`[[${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=nn(c,t,s,i,r),!k){a+=`[[${h}${g}${c}`;continue}}}else{a+=`[[${x}`;continue}c&&(c=Nn(c,t,s,r));let A=_n;S||(w===6?(c&&(c=Ln(c,t,s,!0)),A=kn):w===14&&(A=da)),c===void 0&&g&&(c=""),a+=`\0${s.length}l${p}`,new A(h,c,t,s,g)}return a}}}),ca={};ie(ca,{parseMagicLinks:()=>ga});var Ri,Pi,Oi,ji,ga,Bu=C({"parser/magicLinks.ts"(){"use strict";de(),$n(),Ri=String.raw`[${We}\t]| |�*160;|�*a0;`,Pi=`(?:${Ri})+`,Oi=`(?:${Ri}|-)`,ji=String.raw`(?:RFC|PMID)${Pi}\d+\b|ISBN${Pi}(?:97[89]${Oi}?)?(?:\d${Oi}?){9}[\dx]\b`,ga=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${ft}${mt})|${ji})`,"giu")}catch(i){t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${ft}${mt})|${ji})`,"giu")}return e.replace(t.regexMagicLinks,(i,r,n)=>{let l=r?i.slice(r.length):i;if(n){let a="";const o=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(l);o&&(a=l.slice(o.index),l=l.slice(0,o.index));const u=l.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,d=u.exec(l);if(d){let h=1;d[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(l.slice(0,d.index))&&(h=2),a=l.slice(d.index+h)+a,l=l.slice(0,d.index+h)}return a.length>=n.length?i:(new Vt(l,void 0,t,s),`${r}\0${s.length-1}w${a}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(l))return i;return new Vt(l,"magic-link",t,s),`${r}\0${s.length-1}i`})}}}),pa,qu=C({"util/html.ts"(){"use strict";pa=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,i)=>s!==e[i])}}),fa,Wu=C({"src/nowiki/list.ts"(){"use strict";Yo(),fa=class extends Cn{get type(){return"list"}}}}),ma={};ie(ma,{parseList:()=>xa});var xa,Mu=C({"parser/list.ts"(){"use strict";qu(),Wu(),Zo(),xa=(e,t,s,i)=>{const r=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!r)return t.lastPrefix="",e;const[n,l,a,o]=r,u=a.replace(/;/gu,":"),d=pa(u,t.lastPrefix),h=((d>1?a.slice(d-1):a)+o).split(/(?=;)/u),g=h[0].startsWith(";");let c=h.length-(g?0:1);if(d>1){const T=a.slice(0,d-1);if(g){const F=T.split(/(?=;)/u);h.unshift(...F),c+=T.includes(";")?F.length:0}else h[0]=T+h[0]}t.lastPrefix=u;let p=l+h.map((T,F)=>`\0${i.length+F}d`).join("")+e.slice(n.length);for(const T of h)new fa(T,s,i);if(!c)return p;const{html:[x,,m]}=s,v=/:+|-\{|\0\d+[xq]\x7F/gu;let S=v,w=S.exec(p),y=0,A=!1,k=!1,$=0;const b=(T,F)=>(new In(T,s,i),`${p.slice(0,F)}\0${i.length-1}d${p.slice(F+T.length)}`),_=T=>{T?y&&y--:y++};for(;w&&c;){const{0:T,index:F}=w;if(T==="-{"){if(!$){const{lastIndex:R}=S;S=/-\{|\}-/gu,S.lastIndex=R}$++}else if(T==="}-"){if($--,!$){const{lastIndex:R}=S;S=v,S.lastIndex=R}}else if(T.endsWith("x")){const{name:R,closing:W,selfClosing:O}=i[Number(T.slice(1,-2))];(x.includes(R)||!O&&!m.includes(R))&&_(W)}else if(T.endsWith("q")){const{bold:R,italic:W}=i[Number(T.slice(1,-2))];R&&(_(A),A=!A),W&&(_(k),k=!k)}else if(y===0){if(T.length>=c)return b(T.slice(0,c),F);c-=T.length,S.lastIndex=F+4+String(i.length).length,p=b(T,F)}w=S.exec(p)}return p}}}),ls,Tl,Bi,Cl,Mt,zu=C({"src/converterFlags.ts"(){"use strict";var e,t;M(),ae(),$s(),j(),q(),st(),ls=new Set(["A","T","R","D","-","H","N"]),Tl=[Qt()],Mt=(t=class extends(Cl=E){constructor(i,r,n=[]){super(void 0,r,n,{});N(this,e);this.safeAppend(i.map(l=>new Te(l,"converter-flag",r,n)))}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(r=>i.has(r)))}isInvalidFlag(i,r,n,l){return typeof i=="object"&&(i=i.text().trim(),r=this.getVariantFlags(),n=this.getUnknownFlags(),l=new Set(f(this,e).filter(a=>ls.has(a)))),!!i&&!r.has(i)&&!n.has(i)&&(r.size>0||!l.has(i))}lint(i=this.getAbsoluteIndex(),r){{const n=this.getVariantFlags(),l=this.getUnknownFlags(),a=new Set(f(this,e).filter(m=>ls.has(m))),o=f(this,e).filter(m=>!m).length,u=f(this,e).length-l.size-o,{lintConfig:d}=I,{computeEditInfo:h,fix:g}=d,c=super.lint(i,r);if(n.size===u||a.size===u)return c;const p="no-ignored",x=d.getSeverity(p,"conversionFlag");if(x){const m=new re(this,i);for(let v=0;v<this.length;v++){const S=this.childNodes[v],w=S.text().trim();if(this.isInvalidFlag(w,n,l,a)){const y=B(S,m,p,"invalid-conversion-flag",x);(h||g)&&(n.size===0&&ls.has(w.toUpperCase())?y.fix=gn(y,w):h&&(y.suggestions=[H(y,v&&-1)])),c.push(y)}}}return c}}print(){return super.print({sep:";"})}},e=new WeakMap,t),Bi=te(Cl),Mt=Z(Bi,0,"ConverterFlagsToken",Tl,Mt),Y(Bi,1,Mt)}}),os,ms,Uu=C({"src/converterRule.ts"(){"use strict";Ee(),j(),q(),st(),os=(e,t,s,i)=>{const r=new E(e,s,i);return r.type=`converter-rule-${t}`,r.setAttribute("stage",pe),r},ms=class extends E{get type(){return"converter-rule"}get variant(){}constructor(e,t=!0,s=I.getConfig(),i=[]){super(void 0,s,i,{});const r=e.indexOf(":"),n=e.slice(0,r).indexOf("=>"),l=n===-1?e.slice(0,r):e.slice(n+2,r);t&&s.variants.includes(l.trim().toLowerCase())?(super.insertAt(new Te(l,"converter-rule-variant",s,i)),super.insertAt(os(e.slice(r+1),"to",s,i)),n!==-1&&super.insertAt(os(e.slice(0,n),"from",s,i),0)):super.insertAt(os(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()){}}}}),Il,qi,Nl,zt,Hu=C({"src/converter.ts"(){"use strict";de(),He(),Re(),q(),zu(),Uu(),Il=[Ne,Pe("-{")],zt=class extends(Nl=E){get type(){return"converter"}constructor(e,t,s,i=[]){super(void 0,s,i),this.insertAt(new Mt(e,s,i));const[r]=t,n=r.includes(":"),l=new ms(r,n,s,i);n&&l.length===1||!n&&t.length===2&&!fe(t[1]).trim()?this.insertAt(new ms(t.join(";"),!1,s,i)):this.safeAppend([l,...t.slice(1).map(a=>new ms(a,!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()}|${Ye(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?"|":""}${vt(t,{sep:";"})}}-</span>`}},qi=te(Nl),zt=Z(qi,0,"ConverterToken",Il,zt),Y(qi,1,zt)}}),va={};ie(va,{parseConverter:()=>ba});var ba,Du=C({"parser/converter.ts"(){"use strict";Hu(),ba=(e,t,s)=>{var o;(o=t.regexConverter)!=null||(t.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${t.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"iu"));const i=/-\{/gu,r=/-\{|\}-/gu,n=[];let l=i,a=l.exec(e);for(;a;){const{0:u,index:d}=a;if(u==="}-"){const h=n.pop(),{length:g}=s,c=e.slice(h.index+2,d),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"),S=v.split(t.regexConverter).map(w=>w.replace(/\x01/gu,";"));new zt(x,S,t,s),e=`${e.slice(0,h.index)}\0${g}v${e.slice(d+2)}`,n.length===0&&(l=i),l.lastIndex=h.index+3+String(g).length}else n.push(a),l=r,l.lastIndex=d+2;a=l.exec(e)}return e}}}),Ss={};ie(Ss,{Token:()=>E});var Ll,E,q=C({"src/index.ts"(){"use strict";var e,t,s,i,r,n,l,a,o,ya,wa,Sa,Aa,ka,_a,$a,Ta,Ca,Ia,Na,La,A;de(),Ee(),M(),Ce(),j(),eu(),tu(),Ll=["category","html-attr#id,ext-attr#id,table-attr#id"],E=(A=class extends Ft{constructor(b,_=I.getConfig(),T=[],F){super();N(this,o);N(this,e,"plain");N(this,t,0);N(this,s);N(this,i);N(this,r);N(this,n,!1);N(this,l);N(this,a);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(),a)}set pageName(b){if(b){const _=this.normalizeTitle(b,0,{temporary:!0,page:""});L(this,a,_.valid?_.title:void 0)}else L(this,a,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 F=P(this,o,ya).call(this);_&&(_=!F)}L(this,r,_),P(this,o,wa).call(this,_);break;case 1:P(this,o,Sa).call(this);break;case 2:P(this,o,Aa).call(this);break;case 3:P(this,o,ka).call(this);break;case 4:P(this,o,_a).call(this);break;case 5:P(this,o,$a).call(this,T);break;case 6:P(this,o,Ta).call(this,T);break;case 7:P(this,o,Ca).call(this);break;case 8:P(this,o,Ia).call(this);break;case 9:P(this,o,Na).call(this);break;case 10:P(this,o,La).call(this)}if(this.type==="root")for(const F of f(this,i))F==null||F.parseOnce(b,_,T);return zn(this,t)._++,this}buildFromStr(b,_){const T=b.split(/[\0\x7F]/u).map((F,R)=>{if(R%2===0)return new Ki(F);if(isNaN(F.slice(-1)))return f(this,i)[Number(F.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${F}`)});return _===0?T.map(String).join(""):_===1?Ye(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")&&(Fn(this,0,1,this.buildFromStr(T)),this.normalize(),this.type==="root"))for(const F of f(this,i))F==null||F.build()}afterBuild(){if(this.type==="root")for(const b of f(this,i))b==null||b.afterBuild();L(this,n,!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,r))!=null?_:!!f(this.getRootNode(),r);case"accum":return f(this,i);case"built":return f(this,n);case"stage":return f(this,t);case"invalid":return this.type==="table-inter"&&Ut(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 Ki(b):b;super.insertAt(T,_);const{type:F}=T;return F==="root"&&(T.type="plain"),T}normalizeTitle(b,_=0,T){return I.normalizeTitle(b,_,this.getAttribute("include"),f(this,s),ce({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:F}=I,{computeEditInfo:R,fix:W,ignoreDisables:O,configurationComment:J}=F;let le=super.lint(b,_);if(this.type==="root"){const ee=new Map,D="no-duplicate",G=["category","id"].map(V=>F.getSeverity(D,V)),Se=this.toString(),Le=Ll.filter((V,K)=>G[K]).join();if(Le){for(const V of this.querySelectorAll(Le)){let K;if(V.is("category"))K=V.name;else{const Q=V.getValue();Q&&Q!==!0&&(K=`#${Q}`)}if(K){const Q=ee.get(K);Q?Q.add(V):ee.set(K,new Set([V]))}}for(const[V,K]of ee)if(K.size>1&&!V.startsWith("#mw-customcollapsible-")){const Q=!V.startsWith("#"),se=`duplicate-${Q?"category":"id"}`,oe=G[Q?0:1];le.push(...[...K].map(he=>{const U=z(he,{start:he.getAbsoluteIndex()},D,se,oe);return R&&Q&&(U.suggestions=[H(U)]),U}))}}if(!O){const V=new RegExp(String.raw`<!--\s*${J}-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->`,"gu"),K=[];let Q=V.exec(Se);for(;Q;){const{1:se,index:oe}=Q,he=(T=Q[2])==null?void 0:T.trim();K.push({line:this.posFromIndex(oe).top+(se==="disable-line"?0:1),from:se==="disable"?V.lastIndex:void 0,to:se==="enable"?V.lastIndex:void 0,rules:he?new Set(he.split(",").map(U=>U.trim())):void 0}),Q=V.exec(Se)}le=le.filter(({rule:se,startLine:oe,startIndex:he})=>{const U={pos:0};for(const{line:xe,from:ve,to:Oe,rules:nt}of K){if(xe>oe+1)break;if(nt&&!nt.has(se))continue;if(xe===oe&&ve===void 0&&Oe===void 0)return!1;ve<=he&&ve>U.pos?(U.pos=ve,U.type="from"):Oe<=he&&Oe>U.pos&&(U.pos=Oe,U.type="to")}return U.type!=="from"})}if(W&&le.some(({fix:V})=>V)){const V=le.map(({fix:se})=>se).filter(Boolean).sort(({range:[se,oe]},{range:[he,U]})=>oe===U?he-se:U-oe);let K=1/0,Q=Se;for(const{range:[se,oe],text:he}of V)oe<=K&&(Q=Q.slice(0,se)+he+Q.slice(oe),K=se);Object.assign(le,{output:Q})}if(!R)for(const V of le)delete V.fix,delete V.suggestions}return le}}toString(b,_){return b?super.toString(!0,_):Xe(f(this,l),()=>super.toString(!1,_),T=>{const F=this.getRootNode();F.type==="root"&&f(F,n)&&L(this,l,T)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakMap,l=new WeakMap,a=new WeakMap,o=new WeakSet,ya=function(){const{parseRedirect:b}=(nu(),X(to)),_=this.firstChild.toString(),T=b(_,f(this,s),f(this,i));return T&&this.setText(T),!!T},wa=function(b){const{parseCommentAndExt:_}=(Ls(),X(Do));this.setText(_(this.firstChild.toString(),f(this,s),f(this,i),b))},Sa=function(){const{parseBraces:b}=(An(),X(wo)),_=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))},Aa=function(){if(f(this,s).excludes.includes("html"))return;const{parseHtml:b}=(Tu(),X(Go));this.setText(b(this.firstChild.toString(),f(this,s),f(this,i)))},ka=function(){if(f(this,s).excludes.includes("table"))return;const{parseTable:b}=(Nu(),X(ea));this.setText(b(this,f(this,s),f(this,i)))},_a=function(){if(f(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:b}=(Ru(),X(ia));this.setText(b(this,f(this,s),f(this,i)))},$a=function(b){const{parseLinks:_}=(ju(),X(ha));this.setText(_(this.firstChild.toString(),f(this,s),f(this,i),this.pageName,b))},Ta=function(b){if(f(this,s).excludes.includes("quote"))return;const{parseQuotes:_}=(oa(),X(la)),T=this.firstChild.toString().split(`
|
|
26
|
+
`);for(let F=0;F<T.length;F++)T[F]=_(T[F],f(this,s),f(this,i),b);this.setText(T.join(`
|
|
27
|
+
`))},Ca=function(){if(f(this,s).excludes.includes("extLink"))return;const{parseExternalLinks:b}=(ua(),X(aa));this.setText(b(this.firstChild.toString(),f(this,s),f(this,i)))},Ia=function(){if(f(this,s).excludes.includes("magicLink"))return;const{parseMagicLinks:b}=(Bu(),X(ca));this.setText(b(this.firstChild.toString(),f(this,s),f(this,i)))},Na=function(){if(f(this,s).excludes.includes("list"))return;const{parseList:b}=(Mu(),X(ma)),{firstChild:_,type:T,name:F}=this,R=_.toString().split(`
|
|
28
|
+
`),W={lastPrefix:""};let O=T==="root"||T==="ext-inner"&&F==="poem"?0:1;for(;O<R.length;O++)R[O]=b(R[O],W,f(this,s),f(this,i));this.setText(R.join(`
|
|
29
|
+
`))},La=function(){if(f(this,s).variants.length>0){const{parseConverter:b}=(Du(),X(va));this.setText(b(this.firstChild.toString(),f(this,s),f(this,i)))}},A)}}),me,Fs,Fn,Ce=C({"util/debug.ts"(){"use strict";me={running:!1,run(e){const{running:t}=this;this.running=!0;try{const{Token:s}=(q(),X(Ss)),i=e();return i instanceof s&&!i.getAttribute("built")&&i.afterBuild(),this.running=t,i}catch(s){throw this.running=t,s}},rev:0},Fs=e=>t=>t.type===e,Fn=(e,t,s,i=[])=>{var l,a;let r=e.getChildNodes(),n;r.length===s?(n=r,r=i):n=Array.prototype.splice.apply(r,[t,s,...i]);for(let o=0;o<i.length;o++){const u=i[o];u.setAttribute("parentNode",e),u.setAttribute("nextSibling",r[t+o+1]),u.setAttribute("previousSibling",r[t+o-1])}return(l=r[t-1])==null||l.setAttribute("nextSibling",r[t]),(a=r[t+i.length])==null||a.setAttribute("previousSibling",r[t+i.length-1]),r===i&&e.setAttribute("childNodes",r),n}}}),lt,Wi,as,Mi,Fl,zi,El,rn,Gu=C({"lib/lintConfig.ts"(){"use strict";var e,t;Ul(),lt=new Map([[0,!1],[1,"warning"],[2,"error"],[!1,!1],["off",!1],["warning","warning"],["error","error"]]),Wi={"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}],"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(Wi),as={configurationComment:"lint",ignoreDisables:!1,fix:!0,computeEditInfo:!0},Object.freeze(as),Mi=s=>lt.has(s),Fl=s=>Mi(s)||Array.isArray(s)&&Mi(s[0])&&(s.length===1||typeof s[1]=="object"),zi=(s,i,r)=>{if(xs.includes(i)){if(r===void 0)return!1;if(Fl(r))return s[i]=r,!0}else throw new RangeError(`Unknown lint rule: ${i}`);throw new RangeError(`Invalid lint config for ${i}: ${JSON.stringify(r)}`)},El=class{constructor(s){if(Object.assign(this,JSON.parse(JSON.stringify(Wi))),!!s)for(const[i,r]of Object.entries(s))zi(this,i,r)}getSeverity(s,i){var n,l;const r=this[s];return typeof r!="object"?lt.get(r):i&&(l=lt.get((n=r[1])==null?void 0:n[i]))!=null?l:lt.get(r[0])}},rn=(t=class{constructor(s){N(this,e);if(Object.assign(this,as),s&&!("rules"in s)&&Object.keys(s).some(r=>xs.includes(r)))this.rules=s;else{const i=s!=null?s:{},{rules:r}=i,n=Mn(i,["rules"]);this.rules=r;for(const[l,a]of Object.entries(n))a!==void 0&&Object.prototype.hasOwnProperty.call(as,l)&&(this[l]=a)}}get rules(){return f(this,e)}set rules(s){L(this,e,new Proxy(new El(s),{set:zi,deleteProperty(){return!1}}))}getSeverity(s,i){return f(this,e).getSeverity(s,i)}},e=new WeakMap,t)}}),Fa={};ie(Fa,{Title:()=>Ea});var Ui,Ea,Vu=C({"lib/title.ts"(){"use strict";var e,t,s,i,r,n,Ra,a;Ze(),de(),Ui=o=>{const[,{length:u},d]=/^((?:\.\.\/)*)([\s\S]*)/u.exec(o);return[u/3,d]},Ea=(a=class{constructor(o,u,d,{temporary:h,decode:g,selfLink:c,page:p}={}){N(this,n);N(this,e);N(this,t);N(this,s);N(this,i);N(this,r);Ie(this,"page");Ie(this,"valid");Ie(this,"encoded",!1);this.page=p;const x=o.trim(),m=x.startsWith("../");if(g&&o.includes("%"))try{const y=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(o);o=Dt(o),this.encoded=y}catch(y){}if(o=vs(o).replace(/[_ ]+/gu," ").trim(),m||p&&x.startsWith("/"))L(this,i,0);else{let y=u;o.startsWith(":")&&(y=0,o=o.slice(1).trim());const A=o.split(":");if(A.length>1){const k=xt(A[0]),$=Object.prototype.hasOwnProperty.call(d.nsid,k)&&d.nsid[k];$&&(y=$,o=A.slice(1).join(":").trim())}L(this,i,y)}const v=o.indexOf("#");if(v!==-1){let y=o.slice(v).trim().slice(1);if(y.includes("%"))try{y=Dt(y)}catch(A){}L(this,r,y.replace(/ /gu,"_")),o=o.slice(0,v).trim()}const[S,w]=m?Ui(o):[0,o];this.valid=!!(o||c&&this.ns===0&&f(this,r)!==void 0)&&vs(o)===o&&(S===0||p===void 0||p.split("/",S+1).length>S)&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(w),this.main=o,L(this,t,d.namespaces),L(this,s,d.articlePath||"/wiki/$1"),f(this,s).includes("$1")||L(this,s,f(this,s)+`${f(this,s).endsWith("/")?"":"/"}$1`),h||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return f(this,i)}get fragment(){return f(this,r)}get main(){return f(this,e)}set main(o){o=o.replace(/_/gu," ").trim(),L(this,e,o&&o[0].toUpperCase()+o.slice(1))}get prefix(){const o=f(this,t)[this.ns];return o+(o&&":")}get title(){return this.getRedirection()[1]}get extension(){const{main:o}=this,u=o.lastIndexOf(".");return u===-1?void 0:o.slice(u+1).toLowerCase()}getRedirection(){const{prefix:o}=this,u=o;return P(this,n,Ra).call(this,u)}setFragment(o){L(this,r,o)}getUrl(o){throw new Error("Title.getUrl method is only available in the LSP version!")}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakSet,Ra=function(o){var d,h;let u=(o+this.main).replace(/ /gu,"_");if(u.startsWith("/"))u=((d=this.page)!=null?d:"")+u.replace(/(.)\/$/u,"$1");else if(u.startsWith("../")&&((h=this.page)!=null&&h.includes("/"))){const[g,c]=Ui(u),p=this.page.split("/");p.length>g&&(u=p.slice(0,-g).join("/")+(c&&"/")+c)}return[!1,u]},a)}}),Pa={};ie(Pa,{default:()=>I});Oa.exports=X(Pa);var us,Hi,Rl,Ve,Di,Pl,I,j=C({"index.ts"(){Ul(),Ce(),Ee(),de(),Gu(),us=!0,Hi=new rn,Ve={config:Vi,get rules(){return xs},get i18n(){return ce(ce({},Gl),Rl)},set i18n(e){Rl=e},get lintConfig(){return Hi},set lintConfig(e){Hi=new rn(e)},get viewOnly(){return us},set viewOnly(e){us&&!e&&me.rev++,us=e},getConfig(e){const t=e!=null?e:this.config,{doubleUnderscore:s,ext:i,parserFunction:r,variable:n}=t;for(let l=0;l<2;l++)s.length>l+2&&s[l].length===0&&(s[l]=Object.keys(s[l+2]));return i.includes("translate")&&!n.includes("translationlanguage")&&(n.push("translationlanguage"),Array.isArray(r[1])?r[1].push("TRANSLATIONLANGUAGE"):r[1].TRANSLATIONLANGUAGE="translationlanguage"),Fe(ce(ce({},Vi),t),{excludes:[]})},msg(e,t=""){var s;return e&&((s=this.i18n[e])!=null?s:e).replace("$1",this.msg(t))},normalizeTitle(e,t=0,s,i=Ve.getConfig(),r){const{Title:n}=(Vu(),X(Fa));let l;if(r!=null&&r.halfParsed)l=new n(e,t,i,r);else{const{Token:a}=(q(),X(Ss));l=me.run(()=>{const o=new a(e,i);o.type="root",o.pageName=r==null?void 0:r.page,o.parseOnce(0,s).parseOnce();const u=new n(o.toString(),t,i,r);o.build();for(const d of["main","fragment"]){const h=u[d];if(h!=null&&h.includes("\0")){const g=o.buildFromStr(h,1);d==="main"?u.main=g:u.setFragment(g)}}return u})}return l},parse(e,t,s,i,r){e=Hl(e);let n,l,a,o;typeof t=="string"?(n=!!s,l=i,a=r,o=t):(n=!!t,l=s,a=i,o=r),l!=null||(l=pe),a!=null||(a=this.getConfig());let u;typeof l!="number"&&(u=Array.isArray(l)?l:[l],l=Math.max(...u.map(g=>zl[g]||pe)));const{Token:d}=(q(),X(Ss));return me.run(()=>{const g=new d(e,a);return g.type="root",g.pageName=o,g.parse(l,n)})},parseWithRef(e,t,s,i=t.getAttribute("include")){return this.parse(e,i,s,t.getAttribute("config"),t.pageName)},async partialParse(e,t,s,i=Ve.getConfig()){},createLanguageService(e={}){throw new Error("Parser.createLanguageService method is only available in the LSP version!")}},Di={},Pl=new Set(["lintConfig","normalizeTitle","parse","createLanguageService"]);for(const e in Ve)Pl.has(e)||(Di[e]={enumerable:!1});Object.defineProperties(Ve,Di),Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:Ve}),I=Ve}});j()});Qu();})();
|