wikiparser-node 1.29.1 → 1.29.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  "use strict";(()=>{var Su=Object.defineProperty;var hr=e=>{throw TypeError(e)};var Au=(e,t,s)=>t in e?Su(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var ku=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ne=(e,t,s)=>Au(e,typeof t!="symbol"?t+"":t,s),Ks=(e,t,s)=>t.has(e)||hr("Cannot "+s);var b=(e,t,s)=>(Ks(e,t,"read from private field"),s?s.call(e):t.get(e)),R=(e,t,s)=>t.has(e)?hr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),E=(e,t,s,i)=>(Ks(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),j=(e,t,s)=>(Ks(e,t,"access private method"),s);var gr=(e,t,s,i)=>({set _(r){E(e,t,r,s)},get _(){return b(e,t,i)}});var Cd=ku((Nd,wu)=>{var ba=Object.create,dt=Object.defineProperty,ya=Object.getOwnPropertyDescriptor,jn=Object.getOwnPropertyNames,$u=Object.getPrototypeOf,_u=Object.prototype.hasOwnProperty,wa=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),jt=e=>{throw TypeError(e)},Sa=(e,t,s)=>t in e?dt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,pr=(e,t)=>dt(e,"name",{value:t,configurable:!0}),I=(e,t)=>function(){return e&&(t=(0,e[jn(e)[0]])(e=0)),t},Rn=(e,t)=>function(){return t||(0,e[jn(e)[0]])((t={exports:{}}).exports,t),t.exports},le=(e,t)=>{for(var s in t)dt(e,s,{get:t[s],enumerable:!0})},Aa=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of jn(t))!_u.call(e,r)&&r!==s&&dt(e,r,{get:()=>t[r],enumerable:!(i=ya(t,r))||i.enumerable});return e},Tu=(e,t,s)=>(s=e!=null?ba($u(e)):{},Aa(t||!e||!e.__esModule?dt(s,"default",{value:e,enumerable:!0}):s,e)),se=e=>Aa(dt({},"__esModule",{value:!0}),e),ae=e=>{var t;return[,,,ba((t=e==null?void 0:e[wa("metadata")])!=null?t:null)]},ka=["class","method","getter","setter","accessor","field","value","get","set"],Gt=e=>e!==void 0&&typeof e!="function"?jt("Function expected"):e,Cu=(e,t,s,i,r)=>({kind:ka[e],name:t,metadata:i,addInitializer:n=>s._?jt("Already initialized"):r.push(Gt(n||null))}),Pn=(e,t)=>Sa(t,wa("metadata"),e[3]),ne=(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},re=(e,t,s,i,r,n)=>{var l,o,u,a,d,c=t&7,f=!!(t&8),g=!!(t&16),y=c>3?e.length+1:c?f?1:2:0,$=ka[c+5],k=c>3&&(e[y-1]=[]),_=e[y]||(e[y]=[]),T=c&&(!g&&!f&&(r=r.prototype),c<5&&(c>3||!g)&&ya(c<4?r:{get[s](){return fe(this,n)},set[s](h){return Te(this,n,h)}},s));c?g&&c<4&&pr(n,(c>2?"set ":c>1?"get ":"")+s):pr(r,s);for(var p=i.length-1;p>=0;p--)a=Cu(c,s,u={},e[3],_),c&&(a.static=f,a.private=g,d=a.access={has:g?h=>Nu(r,h):h=>s in h},c^3&&(d.get=g?h=>(c^1?fe:pn)(h,r,c^4?n:T.get):h=>h[s]),c>2&&(d.set=g?(h,m)=>Te(h,r,m,c^4?n:T.set):(h,m)=>h[s]=m)),o=(0,i[p])(c?c<4?g?n:T[$]:c>4?void 0:{get:T.get,set:T.set}:r,a),u._=1,c^4||o===void 0?Gt(o)&&(c>4?k.unshift(o):c?g?n=o:T[$]=o:r=o):typeof o!="object"||o===null?jt("Object expected"):(Gt(l=o.get)&&(T.get=l),Gt(l=o.set)&&(T.set=l),Gt(l=o.init)&&k.unshift(l));return c||Pn(e,r),T&&dt(r,s,T),g?c^4?n:T:r},Iu=(e,t,s)=>Sa(e,typeof t!="symbol"?t+"":t,s),On=(e,t,s)=>t.has(e)||jt("Cannot "+s),Nu=(e,t)=>Object(t)!==t?jt('Cannot use the "in" operator on this value'):e.has(t),fe=(e,t,s)=>(On(e,t,"read from private field"),s?s.call(e):t.get(e)),Ge=(e,t,s)=>t.has(e)?jt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),Te=(e,t,s,i)=>(On(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),pn=(e,t,s)=>(On(e,t,"access private method"),s),Lu=(e,t,s,i)=>({set _(r){Te(e,t,r,s)},get _(){return fe(e,t,i)}}),$a,as,Bn=I({"base.ts"(){"use strict";$a=(()=>{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})(),as=(()=>{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 Ee(e,t,s){return s===1?e.replace(/\0(\d+)g\x7F/gu,(i,r)=>Ee(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 Je,Ys,It,Nt,Lt,xt,os,Ce,ct,fr,mr,us,_a,xr,vr,ds,Ft,me=I({"util/string.ts"(){"use strict";Je=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Ys=String.raw`[^[\]<>"\0-\x1F\x7F${Je}\uFFFD]`,It=String.raw`(?:\[[\da-f:.]+\]|${Ys})`,Nt=String.raw`(?:${Ys}|\0\d+[cn!~]\x7F)*`,Lt=e=>e.trim().toLowerCase(),xt=(e,t)=>s=>s.replace(e,t),os=xt(/[\0\x7F]|\r$/gmu,""),Ce=xt(/\0\d+[cn]\x7F/gu,""),ct=(e,t="")=>e.map(s=>typeof s=="string"?s:s.text()).join(t),fr={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},mr=xt(/&(?:#(\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)):fr[s.toLowerCase()]),us=e=>mr(e),_a=xt(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),xr={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},vr=e=>xt(e,t=>`&${xr[t]};`),ds=vr(/[&<>]/gu),Ft=(e,t={})=>{const{pre:s="",post:i="",sep:r=""}=t;return s+e.map(n=>n.print()).join(r)+i}}}),Fu=Rn({"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}}}),Eu=Rn({"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:[]}}}),ke,Ta,fn,Me=I({"util/constants.ts"(){"use strict";ke=11,Ta=Fu(),fn=Eu()}});function ot(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 cs,Ca,br,Ia,Ke=I({"../common/dist/index.mjs"(){"use strict";cs=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25")),Ca=e=>Math.round(e*255).toString(16).padStart(2,"0"),br=(()=>{const e=String.raw`#(?:[\da-f]{3,4}|(?:[\da-f]{2}){3,4})(?![\p{L}\p{N}_])`,t=String.raw`(?:\d*\.)?\d+%?`,s=String.raw`(?:\d*\.)?\d+(?:deg|grad|rad|turn)?`,i=String.raw`rgba?\(\s*(?:${String.raw`${new Array(3).fill(t).join(String.raw`\s+`)}(?:\s*\/\s*${t})?`}|${String.raw`${new Array(3).fill(t).join(String.raw`\s*,\s*`)}(?:\s*,\s*${t})?`})\s*\)`,r=String.raw`hsla?\(\s*(?:${String.raw`${s}\s+${t}\s+${t}(?:\s*\/\s*${t})?`}|${String.raw`${s}${String.raw`\s*,\s*(?:\d*\.)?\d+%`.repeat(2)}(?:\s*,\s*${t})?`})\s*\)`;return{full:new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${e}|${i}|${r})`,"giu"),rgb:new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${e}|${i})`,"giu")}})(),Ia=(e,t=!0)=>{const s=[],i=br[t?"full":"rgb"];i.lastIndex=0;let r=i.exec(e),n=0;for(;r;){const l=r.index+r[1].length;l>n&&s.push([e.slice(n,l),n,l,!1]),{lastIndex:n}=i,s.push([r[2],l,n,e[l-1]!=="&"||!/^#\d+$/u.test(r[2])]),r=i.exec(e)}return e.length>n&&s.push([e.slice(n),n,e.length,!1]),s}}}),ge,ve=I({"lib/rect.ts"(){"use strict";var e,t,s,i,mn,n;ge=(n=class{constructor(l,o){R(this,i);R(this,e);R(this,t);R(this,s);E(this,e,l),E(this,t,o)}get start(){return b(this,t)}get top(){return j(this,i,mn).call(this).top}get left(){return j(this,i,mn).call(this).left}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakSet,mn=function(){var l;return(l=b(this,s))!=null||E(this,s,b(this,e).getRootNode().posFromIndex(b(this,t))),b(this,s)},n)}}),yr,wr,rs,hs,Zs,Q,Z,Oe,Ws,ee,qn,Xe,Wn,Un,Mn,gs,Et,zn,ut,Hn,Y=I({"util/lint.ts"(){"use strict";Ke(),Re(),ve(),G(),yr=new Set(["tr","td","th","caption"]),wr=new Set(["Template:!!","Template:!-"]),rs=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")&&wr.has(t.name)||t.is("html")&&yr.has(t.name))return!1;if(t.is("arg"))return t.length>1&&rs(t.childNodes[1]);if(t.is("magic-word"))try{const s=t.getPossibleValues().map(rs);return s.includes(2)?2:s.includes(1)&&1}catch{}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?1:2},hs=(e,t,s,i)=>({line:e+s-1,character:(s===1?t:0)+i}),Zs=e=>(t,s,i,r,n="error")=>{const{start:l}=s,{top:o,left:u}=s instanceof ge?s:new ge(t,l),{offsetHeight:a,offsetWidth:d}=t,{startIndex:c,startLine:f,startCol:g}=e(t,l,o,u),{line:y,character:$}=hs(f,g,a,d);return{rule:i,message:N.msg(r),severity:n,startIndex:c,endIndex:c+t.toString().length,startLine:f,endLine:y,startCol:g,endCol:$}},Q=Zs((e,t,s,i)=>{const r=e.getRelativeIndex(),{top:n,left:l}=e.parentNode.posFromIndex(r);return{startIndex:t+r,startLine:s+n,startCol:n?l:i+l}}),Z=Zs((e,t,s,i)=>({startIndex:t,startLine:s,startCol:i})),Oe=(e,t,s,i=0)=>({desc:N.msg(t),range:[e.startIndex+i,e.endIndex],text:s}),Ws=(e,t,s)=>({desc:N.msg(t),range:[e,e],text:s}),ee=(e,t=0,s="")=>typeof e=="number"?{desc:N.msg("remove"),range:[e,e+t],text:s}:Oe(e,"remove",s,t),qn=(e,t)=>Oe(e,"decode",cs(t.text().replace(/%(?=21|3[ce]|5[bd]|7[b-d])/giu,"%25"))),Xe=(e,t,s=0)=>({desc:N.msg("close"),range:[e+s,e],text:t}),Wn=e=>({desc:N.msg("open"),range:[e+1,e+2],text:""}),Un=(e,t)=>Oe(e,"comment",`<!--${t}-->`),Mn=(e,t)=>Oe(e,"uppercase",t.toUpperCase()),gs=(e,t=0)=>({desc:N.msg("whitespace"),range:[e,e+t],text:" "}),Et=(e,t,s=1)=>({desc:N.msg("escape"),range:[e,e+s],text:t.repeat(s)}),zn=(e,t)=>({desc:N.msg("escape"),range:[e,e+t.length],text:t.replace(/\|/gu,"&#124;")}),ut=(e,t,s,i)=>{if(e&&(i||N.viewOnly&&e[0]===be.rev))return e[1];const r=t();return(i||N.viewOnly)&&s([be.rev,r]),r},Hn=(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"]:[]}}),Sr,Dn,Na=I({"parser/selector.ts"(){"use strict";Sr=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},Dn=(e,t,s)=>{const i=e.split(",").map(r=>Sr(r.trim()));return(({type:r,name:n})=>i.some(l=>l(r,n)))}}}),ju=Rn({"../node_modules/binary-search/index.js"(e,t){t.exports=function(s,i,r,n,l){var o,u;if(n===void 0)n=0;else if(n=n|0,n<0||n>=s.length)throw new RangeError("invalid lower bound");if(l===void 0)l=s.length-1;else if(l=l|0,l<n||l>=s.length)throw new RangeError("invalid upper bound");for(;n<=l;)if(o=n+(l-n>>>1),u=+r(s[o],i,o,s),u<0)n=o+1;else if(u>0)l=o-1;else return o;return~n}}}),Ar,La,Ru=I({"util/search.ts"(){"use strict";Ar=Tu(ju()),La=(e,t,s)=>{const i=(0,Ar.default)(e,t,s);return i<0?~i:i}}}),Us,Gn=I({"mixin/cached.ts"(){"use strict";Y(),Us=(e=!0)=>t=>{const s=new WeakMap;return function(...i){return ut(s.get(this),()=>t.apply(this,i),r=>{s.set(this,r)},e)}}}}),Fa,Pu=I({"mixin/nodeLike.ts"(){"use strict";Fa=e=>{class t extends e{get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get offsetHeight(){return this.getDimension().height}get offsetWidth(){return this.getDimension().width}}return t}}}),kr,$r,vs,Pt,Ot,bs,Bt,qt,Wt,nt,Ea=I({"lib/node.ts"(){"use strict";Ru(),Y(),Re(),Gn(),Pu(),G(),$r=[Fa],kr=[Us(!1)],nt=class{constructor(){ne(Wt,5,this),Iu(this,"childNodes",[]),Ge(this,vs),Ge(this,Pt),Ge(this,Ot),Ge(this,bs),Ge(this,Bt),Ge(this,qt,{})}get parentNode(){return fe(this,vs)}get nextSibling(){return fe(this,Pt)}get previousSibling(){return fe(this,Ot)}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":Te(this,vs,t),t||(Te(this,Pt,void 0),Te(this,Ot,void 0));break;case"nextSibling":Te(this,Pt,t);break;case"previousSibling":Te(this,Ot,t);break;case"aIndex":N.viewOnly&&Te(this,Bt,[be.rev,t]);break;default:this[e]=t}}getRootNode(){return ut(fe(this,bs),()=>{var e,t;return(t=(e=this.parentNode)==null?void 0:e.getRootNode())!=null?t:this},e=>{const[,t]=e;t.type==="root"&&Te(this,bs,e)})}indexFromPos(e,t){{if(e<0||t<0)return;const s=this.getLines();if(e>=s.length)return;const[,i,r]=s[e],n=i+t;return n>r?void 0:n}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=La(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 ut(fe(this,qt)[e],()=>{const{childNodes:t}=this,s=e+(e<0?t.length:0);let i=this.getAttribute("padding");for(let r=0;r<s;r++)N.viewOnly&&(fe(this,qt)[r]=[be.rev,i]),i+=t[r].toString().length+this.getGaps(r);return i},t=>{fe(this,qt)[e]=t})}getAbsoluteIndex(){return ut(fe(this,Bt),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{Te(this,Bt,e)})}getBoundingClientRect(){return{...this.getDimension(),...this.getRootNode().posFromIndex(this.getAbsoluteIndex())}}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!`)}},Wt=ae(null),vs=new WeakMap,Pt=new WeakMap,Ot=new WeakMap,bs=new WeakMap,Bt=new WeakMap,qt=new WeakMap,re(Wt,1,"getLines",kr,nt),nt=re(Wt,0,"AstNode",$r,nt),ne(Wt,1,nt)}}),ja,Ou=I({"mixin/elementLike.ts"(){"use strict";Na(),ja=e=>{var t,xn;{class i extends e{constructor(){super(...arguments);R(this,t)}getElementBy(l){const o=[...this.childNodes].reverse();for(;o.length>0;){const u=o.pop(),{type:a,childNodes:d}=u;if(a!=="text"){if(l(u))return u;for(let c=d.length-1;c>=0;c--)o.push(d[c])}}}querySelector(l){return this.getElementBy(j(this,t,xn).call(this,l))}getElementsBy(l){const o=[...this.childNodes].reverse(),u=[];for(;o.length>0;){const a=o.pop(),{type:d,childNodes:c}=a;if(d!=="text"){l(a)&&u.push(a);for(let f=c.length-1;f>=0;f--)o.push(c[f])}}return u}querySelectorAll(l){return this.getElementsBy(j(this,t,xn).call(this,l))}escape(){for(const l of this.childNodes)l.escape()}}return t=new WeakSet,xn=function(l){return Dn(l,this)},i}}}}),_r,ei,Tr,Vt,Bu=I({"lib/element.ts"(){"use strict";me(),Re(),Na(),Ea(),Ou(),_r=[ja],Vt=class extends(Tr=nt){get length(){return this.childNodes.length}text(e){return ct(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){return fs(this,e,1)[0]}insertAt(e,t=this.length){return fs(this,t,0,[e]),e}closest(e){const t=Dn(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){for(let t=this.length-1;t>=0;t--)this.removeAt(t);this.safeAppend(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){{if(e===void 0)return;const{length:t}=this.toString();if(e>t||e<-t)return;e+=e<0?t:0;let s=this,i=0,r=0;for(;s.type!=="text";){const{childNodes:n}=s;i+=s.getAttribute("padding");for(let l=0;i<=e&&l<n.length;l++){const o=n[l],{nextSibling:u}=o,a=o.toString(),d=a.length;if(o.setAttribute("aIndex",i),i+=d,i>e||i===e&&d>0&&(!u||u.type==="text"||o.type!=="text"&&(a.trim()||!u.toString().trim()))){s=o,i-=d,r=i;break}i+=s.getGaps(l)}if(s.childNodes===n)return{offsetNode:s,offset:e-r}}return{offsetNode:s,offset:e-r}}this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(e){var t;{const s=(t=this.caretPositionFromIndex(e))==null?void 0:t.offsetNode;return(s==null?void 0:s.type)==="text"?s.parentNode:s}this.lspError("AstElement.elementFromIndex")}elementFromPoint(e,t){return this.elementFromIndex(this.indexFromPos(t,e))}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":""}">`)+Ft(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){{const s={...this,type:this.type,range:[t,t+this.toString().length],childNodes:[]};for(let i=0,r=t+this.getAttribute("padding");i<this.length;i++){const n=this.childNodes[i],{length:l}=n.toString();n.setAttribute("aIndex",r),s.childNodes.push(n.type==="text"?{data:n.data,range:[r,r+l]}:n.json(void 0,r)),r+=l+this.getGaps(i)}return s}}},ei=ae(Tr),Vt=re(ei,0,"AstElement",_r,Vt),ne(ei,1,Vt)}}),ms,Ms=I({"mixin/gapped.ts"(){"use strict";ms=(e=1)=>t=>{class s extends t{getGaps(){return e}}return s}}}),We,ze=I({"mixin/noEscape.ts"(){"use strict";We=e=>{{class t extends e{escape(){}}return t}}}}),Cr,Ra,qu=I({"src/parameter.ts"(){"use strict";me(),Y(),G(),J(),Cr=new RegExp(`https?://${It}${Nt}$`,"iu"),Ra=class extends z{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){var e;try{return!!((e=this.parentNode)!=null&&e.getDuplicatedArgs().some(([t])=>t===this.name))}catch{return!1}}constructor(e,t,s,i=[]){super(void 0,s,i);const r=new z(typeof e=="number"?void 0:e,s,i,{}),n=new z(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}=N,l=n.getSeverity(r);if(l){const{firstChild:o}=this,u=(s=Cr.exec(o.text()))==null?void 0:s[0];try{if(u&&new URL(u).search){const a=Q(o,{start:e},r,"unescaped-query",l);a.startIndex=a.endIndex,a.startLine=a.endLine,a.startCol=a.endCol,a.endIndex++,a.endCol++,(n.computeEditInfo||n.fix)&&(a.fix=Et(a.startIndex,"{{=}}")),i.push(a)}}catch{}}return i}}print(){return super.print({sep:this.anon?"":"="})}json(e,t=this.getAbsoluteIndex()){{const s=super.json(void 0,t);return Object.assign(s,{anon:this.anon},this.duplicated&&{duplicated:!0}),s}}}}}),qe,ht=I({"src/atom.ts"(){"use strict";var e,t;J(),qe=(t=class extends z{constructor(i,r,n,l,o){super(i,n,l,o);R(this,e);E(this,e,r)}get type(){return b(this,e)}set type(i){E(this,e,i)}getAttribute(i){var r;return i==="invalid"?this.type==="converter-flag"&&!!((r=this.parentNode)!=null&&r.isInvalidFlag(this)):super.getAttribute(i)}},e=new WeakMap,t)}}),Ue,gt=I({"src/syntax.ts"(){"use strict";var e,t;J(),Ue=(t=class extends z{constructor(i,r,n,l,o){super(i,n,l,o);R(this,e);E(this,e,r)}get type(){return b(this,e)}lint(i=this.getAbsoluteIndex()){return super.lint(i,!1)}},e=new WeakMap,t)}}),Pa={};le(Pa,{TranscludeToken:()=>rt});var Ir,ti,Nr,rt,Oa=I({"src/transclude.ts"(){"use strict";var e,t,s,i,r,n,Qt,Ba,u;me(),Y(),Re(),ve(),Ms(),ze(),G(),J(),qu(),ht(),gt(),Ir=[We,ms()],rt=(u=class extends(Nr=z){constructor(d,c,f,g=[]){var A,C;let y;const $=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(d);$&&(y=Number($[1]),d=d.replace(`\0${y}h`,g[y].toString().replace(/^\n/u,"")));super(void 0,f,g,{});R(this,n);Ne(this,"modifier","");R(this,e,"template");R(this,t,":");R(this,s,!1);R(this,i,new Map);R(this,r);const{parserFunction:[k,_],variable:T,functionHook:p}=f,h=(A=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(d))==null?void 0:A[0];if(h)this.setAttribute("modifier",h),d=d.slice(h.length);else if(d.includes(":")){const[L,...B]=d.split(":"),[q]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((C=B[0])!=null?C:"");this.setModifier(`${L}:${q}`)&&(d=B.join(":").slice(q.length))}const m=d.search(/[::]/u),x=d[m]===":",S=m!==-1;if(S||c.length===0&&!b(this,s)){const L=S?d.slice(0,m):d,B=S&&d.slice(m+1),q=Ce(L),O=S?q.slice(q.search(/\S/u))+(x?":":""):q.trim(),W=O.toLowerCase(),F=Array.isArray(_),P=F?_.includes(O):Object.prototype.hasOwnProperty.call(_,O),U=!F&&P?_[O]:Object.prototype.hasOwnProperty.call(k,W)&&k[W],M=F&&P||!("functionHook"in f)||p.includes(U),ie=F&&P||T.includes(U);if(S?U&&M:ie){this.setAttribute("name",U||W.replace(/^#|:$/u,"")),E(this,e,"magic-word"),x&&E(this,t,":");const H=new Ue(L,"magic-word-name",f,g);if(super.insertAt(H),B!==!1&&c.unshift([B]),this.name==="invoke")for(let V=0;V<2;V++){const X=c.shift();if(!X)break;const oe=new qe(X.join("="),`invoke-${V?"function":"module"}`,f,g);super.insertAt(oe)}}}if(this.type==="template"){const L=Ce(d).trim();if(!this.normalizeTitle(L,10,{halfParsed:!0,temporary:!0}).valid)throw g.pop(),new SyntaxError("Invalid template name");const B=new qe(d,"template-name",f,g,{});super.insertAt(B)}typeof y=="number"&&(g[y]=void 0);const v=this.isTemplate();let w=1;for(let L=0;L<c.length;L++){const B=c[L];v||this.name==="switch"&&L>0||this.name==="tag"&&L>1||(B[0]=B.join("="),B.length=1),B.length===1&&(B.unshift(w),w++),this.insertAt(new Ra(...B,f,g))}this.seal("modifier")}get type(){return b(this,e)}get module(){return this.type==="magic-word"&&this.name==="invoke"?j(this,n,Qt).call(this).title:void 0}get function(){var d;return this.type==="magic-word"&&this.name==="invoke"?(d=this.childNodes[2])==null?void 0:d.text().trim():void 0}setModifier(d){const{parserFunction:[,,c,f]}=this.getAttribute("config"),g=Ce(d).trim();if(d&&!g.endsWith(":"))return!1;const y=g.slice(0,-1).toLowerCase(),$=c.includes(y),k=f.includes(y);return b(this,s)&&$||!b(this,s)&&(k||!d)||(be.running||this.length>1)&&($||k||!d)?(this.setAttribute("modifier",d),E(this,s,$),!!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"&&(E(this,r,j(this,n,Qt).call(this)),this.setAttribute("name",b(this,r).title))}toString(d){const{childNodes:c,length:f,firstChild:g,modifier:y,type:$}=this;return`{{${y}${$==="magic-word"?g.toString(d)+(f===1?"":b(this,t))+c.slice(1).map(k=>k.toString(d)).join("|"):super.toString(d,"|")}}}`}text(){const{childNodes:d,length:c,firstChild:f,modifier:g,type:y,name:$}=this;return y==="magic-word"&&$==="vardefine"?"":`{{${g}${y==="magic-word"?f.text()+(c===1?"":b(this,t))+ct(d.slice(1),"|"):super.text("|")}}}`}getAttribute(d){switch(d){case"padding":return this.modifier.length+2;case"title":return b(this,r);case"colon":return b(this,t);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!j(this,n,Qt).call(this).valid);default:return super.getAttribute(d)}}lint(d=this.getAbsoluteIndex(),c){{const f=super.lint(d,c);if(!this.isTemplate())return f;const{type:g,childNodes:y,length:$}=this,k=new ge(this,d),{lintConfig:_}=N,{computeEditInfo:T}=_,p=g==="magic-word";let h="no-ignored",m=_.getSeverity(h,"fragment");if(p&&!j(this,n,Qt).call(this).valid)h="invalid-invoke",m=_.getSeverity(h,"name"),m&&f.push(Q(y[1],k,h,"illegal-module",m));else if(m){const x=y[p?1:0],S=x.childNodes.findIndex(w=>w.type==="text"&&us(w.data).includes("#")),v=x.childNodes[S];if(v){const w=Q(x,k,h,"useless-fragment",m);T&&(w.suggestions=[ee(w,x.getRelativeIndex(S)+v.data.indexOf("#"))]),f.push(w)}}if(h="invalid-invoke",m=_.getSeverity(h,"function"),m&&p&&$===2)return f.push(Z(this,k,h,"missing-function",m)),f;if(h="no-duplicate",m=_.getSeverity(h,"parameter"),m){const x=this.getDuplicatedArgs().filter(([,v])=>!v[0].querySelector("ext")),S="duplicate-parameter";for(const[,v]of x)Array.prototype.push.apply(f,v.map(w=>{const A=Q(w,k,h,S,m);return T&&(A.suggestions=[ee(A,-1)]),A}))}return f}}insertAt(d,c=this.length){return super.insertAt(d,c),d.anon?j(this,n,Ba).call(this,d):d.name&&this.getArgs(d.name,!1,!1).add(d),d}getAllArgs(){return this.childNodes.filter(Js("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:d})=>d)}getArgs(d,c,f=!0){const g=String(d).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");let y;return b(this,i).has(g)?y=b(this,i).get(g):(y=new Set(this.getAllArgs().filter(({name:$})=>g===$)),b(this,i).set(g,y)),y}getDuplicatedArgs(){return[...b(this,i)].filter(([,{size:d}])=>d>1).map(([d,c])=>[d,[...c]])}getPossibleValues(){const{type:d,name:c,childNodes:f}=this;if(d==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let g,y;switch(c){case"if":case"ifexist":case"ifexpr":case"iferror":g=2;break;case"ifeq":g=3;break;case"switch":{const $=f.slice(2),k=$[$.length-1];y=[...$.filter(({anon:_})=>!_),...k!=null&&k.anon?[k]:[]].map(({lastChild:_})=>_);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}y!=null||(y=f.slice(g,g+2).map(({lastChild:$})=>$));for(let $=0;$<y.length;){const{length:k,0:_}=y[$].childNodes.filter(T=>T.text().trim());if(k===0)y.splice($,1);else if(k>1||_.type!=="magic-word")$++;else try{const T=_.getPossibleValues();Array.prototype.splice.apply(y,[$,1,...T]),$+=T.length}catch{$++}}return y}print(){const{childNodes:d,length:c,firstChild:f,modifier:g,type:y}=this;return`<span class="wpb-${y}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${y==="magic-word"?ds(g)+f.print()+(c===1?"":b(this,t))+Ft(d.slice(1),{sep:"|"}):(g?`<span class="wpb-magic-word">${ds(g)}</span>`:"")+Ft(d,{sep:"|"})}}}</span>`}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakSet,Qt=function(){const d=this.type==="template";return this.normalizeTitle((d?"":"Module:")+this.childNodes[d?0:1].text(),10,{temporary:!0,...!d&&{page:""}})},Ba=function(d){const c=this.getAnonArgs(),f=typeof d!="number";for(let g=f?c.indexOf(d):d-1;g<c.length;g++){const y=c[g],{name:$}=y,k=String(g+1);($!==k||y===d)&&(y.setAttribute("name",k),this.getArgs(k,!1,!1).add(y))}},u),ti=ae(Nr),rt=re(ti,0,"TranscludeToken",Ir,rt),ne(ti,1,rt)}}),ys,si,ii,Lr,Fr,Er,jr,ni,Rr,vn,Wu=I({"lib/text.ts"(){"use strict";var e,bn,s;me(),Y(),Re(),G(),Ea(),ys=String.raw`[${Je}\t]*`,si=String.raw`[^\S\n]*`,ii=String.raw`<${si}(?:/${si})?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+`,Lr=new RegExp(String.raw`${ii}|https?[:/]/+|(?:rfc|pmid)(?=[-::]?${ys}\d)|isbn(?=[-::]?${ys}(?:\d(?:${ys}|-)){6})`,"giu"),Fr=new RegExp(ii,"giu"),Er=new Set(["attr-value","ext-link-text","link-text"]),jr={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},ni=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"]),Rr=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch{return/\w/u}})(),vn=(s=class extends nt{constructor(n){super();R(this,e);Ne(this,"data","");this.data=n}get type(){return"text"}toString(n){var l;return n&&!((l=this.parentNode)!=null&&l.getAttribute("built"))?Ce(this.data):this.data}text(){return this.data}lint(n=this.getAbsoluteIndex(),l){var o,u,a;{if(l===!1)return[];const{data:d,parentNode:c,nextSibling:f,previousSibling:g}=this;if(!c)throw new Error("An isolated text node cannot be linted!");const{type:y,parentNode:$}=c;if(y==="attr-value"){const{name:O,tag:W}=$;if(W==="ref"&&(O==="name"||O==="follow")||O==="group"&&(W==="ref"||W==="references")||W==="choose"&&(O==="before"||O==="after"))return[]}if(l!=null||(l=c.isPlain()&&!Er.has(y)?Lr:Fr),d.search(l)===-1)return[];l.lastIndex=0;const k=[],_=f==null?void 0:f.type,T=f==null?void 0:f.name,p=g==null?void 0:g.type,h=this.getRootNode(),m=h.toString(),{ext:x,html:S,variants:v}=h.getAttribute("config"),{top:w,left:A}=h.posFromIndex(n),{lintConfig:C}=N,L=C.rules["tag-like"],B=typeof L=="object"&&L[1]?new Set(Object.keys(L[1]).filter(O=>O!=="invalid"&&O!=="disallowed")):new Set,q=new Set(["onlyinclude","noinclude","includeonly",...x,...S[0],...S[1],...S[2],...B,...C.getSeverity("tag-like","disallowed")?ni:[]]);for(let O=l.exec(d);O;O=l.exec(d)){const[,W,F]=O;let{index:P,0:U}=O;if(F&&F!=="]"){const{length:xe}=F;P+=xe,U=U.slice(xe)}U=U.toLowerCase();const[M]=U,ie=M==="r"||M==="p"||M==="i",H=M==="{",V=M==="}",X=M==="[",oe=M==="]";let{length:de}=U;if(M==="<"&&!q.has(W.toLowerCase())||X&&y==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(d.slice(P+1))||f!=null&&f.is("ext")&&T==="nowiki"&&((o=f.innerText)!=null&&o.includes("]"))))continue;oe&&(P||de>1)&&l.lastIndex--;let ce=n+P,ue=ce+de,pe,ye;const D=m[ue],K=m[ce-1],Ae=H||X,we=H&&K==="-"&&v.length>0,Ie=V&&D==="-"&&v.length>0,et=X&&_==="free-ext-link"&&!d.slice(P+1).trim()||oe&&p==="free-ext-link"&&!d.slice(0,P).includes("]");if(ie)pe="lonely-http",U=U.toUpperCase(),ye=C.getSeverity(pe,U);else if(M==="<"){pe="tag-like";let xe;/^<\/?\s/u.test(U)||!/[\s/>]/u.test(D!=null?D:"")?xe="invalid":B.has(W)?xe=W:ni.has(W)&&!x.includes(W)&&(xe="disallowed"),ye=C.getSeverity(pe,xe)}else if(we||Ie)pe="lonely-bracket",ye=C.getSeverity(pe,"converter"),we&&P>0?(U="-{",P--,ce--,de=2):Ie&&P<d.length-1&&(U="}-",ue++,de=2);else if(et)pe="lonely-bracket",ye=C.getSeverity(pe,"extLink");else if(Ae||V||oe)if(pe="lonely-bracket",de>1||H&&D===M||V&&K===M)ye=C.getSeverity(pe,"double");else{if(!X||y!=="ext-link-text"){const xe=jr[M],Xs=Ae?d.slice(P+1):d.slice(0,P);if(H&&((u=xe.exec(Xs))==null?void 0:u[0])==="}"||V&&((a=xe.exec(Xs))==null?void 0:a[0])==="{")continue;if(!Xs.includes(M)){const cr=Ae?"nextSibling":"previousSibling";let tt=this[cr];for(;tt&&(tt.type!=="text"||!xe.test(tt.data));)tt=tt[cr];if(tt&&xe.exec(tt.data)[0]!==M)continue}}ye=C.getSeverity(pe,"single")}else pe="lonely-http",ye=C.getSeverity(pe);if(!ye)continue;const _e=this.posFromIndex(P),{line:mt,character:te}=hs(w,A,_e.top+1,_e.left),Le={rule:pe,message:N.msg("lonely",ie||M==="h"||we||Ie?U:M),severity:ye,startIndex:ce,endIndex:ue,startLine:mt,endLine:mt,startCol:te,endCol:te+de};if(C.computeEditInfo)if(M==="<")Le.suggestions=[Et(ce,"&lt;")];else if(M==="h"&&y!=="link-text"&&Rr.test(K||""))Le.suggestions=[gs(ce)];else if(X&&y==="ext-link-text"){const xe=c.getAbsoluteIndex()+c.toString().length;Le.suggestions=[Et(xe,"&#93;")]}else if(oe&&et){const xe=n-g.toString().length;Le.suggestions=[Ws(xe,"left-bracket","[")]}else ie&&(Le.suggestions=[...O[0]===U?[]:[Mn(Le,U)],...D===":"||D===":"?[gs(ue,1)]:[]]);k.push(Le)}return k}}replaceData(n){j(this,e,bn).call(this,n)}splitText(n){{const{parentNode:l,data:o}=this;if(!l)throw new Error("The text node to be split has no parent node!");const u=new s(o.slice(n));return fs(l,l.childNodes.indexOf(this)+1,0,[u]),this.setAttribute("data",o.slice(0,n)),u}this.lspError("AstText.splitText")}escape(){{const{parentNode:n}=this;if(!n)throw new Error("The text node to be escaped has no parent node!");const{TranscludeToken:l}=(Oa(),se(Pa)),o=n.getAttribute("config"),u=n.childNodes.indexOf(this)+1,a=f=>Math.max(this.data.lastIndexOf("=",f),this.data.lastIndexOf("|",f));let d=a();const c=(()=>new l(this.data[d]==="="?"=":"!",[],o));for(;d>=0;d=a(d-1))d<this.data.length-1&&this.splitText(d+1),n.insertAt(be.run(c),u),j(this,e,bn).call(this,this.data.slice(0,d))}}print(){return ds(this.data)}},e=new WeakSet,bn=function(n){this.setAttribute("data",n)},s)}}),Ye,pt=I({"mixin/hidden.ts"(){"use strict";Ye=(e=!0,t=!0)=>s=>{class i extends s{text(){return""}lint(n){return e?[]:super.lint(n)}}return i}}}),He,Ze=I({"mixin/padded.ts"(){"use strict";He=({length:e})=>t=>{{class s extends t{getAttribute(r){return r==="padding"?e:super.getAttribute(r)}}return s}}}}),Pr,Or,ri,Br,Ve,zs=I({"src/link/base.ts"(){"use strict";var e,t,s,i;Y(),Me(),ve(),Ze(),ze(),G(),J(),ht(),Pr=r=>r==="redirect-target"||r==="link",Or=[We,He("[[")],Ve=(i=class extends(Br=z){constructor(n,l,o,u=[],a="|"){super(void 0,o,u,{});R(this,e,!0);R(this,t);R(this,s);if(this.insertAt(new qe(n,"link-target",o,u,{})),l!==void 0){const d=new z(l,o,u,{});d.type="link-text",d.setAttribute("stage",ke-1),this.insertAt(d)}E(this,t,a)}get link(){return b(this,s)}get fragment(){return b(this,s).fragment}afterBuild(){E(this,s,this.getTitle()),b(this,t).includes("\0")&&E(this,t,this.buildFromStr(b(this,t),0)),this.setAttribute("name",b(this,s).title),super.afterBuild()}setAttribute(n,l){n==="bracket"?E(this,e,l):n==="title"?E(this,s,l):super.setAttribute(n,l)}toString(n){const l=super.toString(n,b(this,t));return b(this,e)?`[[${l}]]`:l}text(){const n=super.text("|");return b(this,e)?`[[${n}]]`:n}getAttribute(n){return n==="title"?b(this,s):super.getAttribute(n)}getGaps(n){return n===0?b(this,t).length:1}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),{childNodes:[u,a],type:d}=this,{encoded:c,fragment:f}=b(this,s),{lintConfig:g}=N,{computeEditInfo:y,fix:$}=g,k=new ge(this,n);let _="unknown-page",T=g.getSeverity(_);if(T&&u.childNodes.some(({type:p})=>p==="template")&&o.push(Q(u,k,_,"template-in-link",T)),_="url-encoding",T=g.getSeverity(_),T&&c){const p=Q(u,k,_,"unnecessary-encoding",T);(y||$)&&(p.fix=qn(p,u)),o.push(p)}if(_="pipe-like",T=g.getSeverity(_,"link"),T&&(d==="link"||d==="category")){const p=a==null?void 0:a.childNodes.findIndex(m=>m.type==="text"&&m.data.includes("|")),h=a==null?void 0:a.childNodes[p];if(h){const m=Q(a,k,_,"pipe-in-link",T);if(y){const x=m.startIndex+a.getRelativeIndex(p);m.suggestions=[zn(x,h.data)]}o.push(m)}}if(_="no-ignored",T=g.getSeverity(_,"fragment"),T&&f!==void 0&&!Pr(d)){const p=Q(u,k,_,"useless-fragment",T);if(y||$){const h=u.childNodes.findIndex(x=>x.type==="text"&&x.data.includes("#")),m=u.childNodes[h];m&&(p.fix=ee(p,u.getRelativeIndex(h)+m.data.indexOf("#")))}o.push(p)}return o}}getTitle(n,l){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:l,temporary:n,decode:!0,selfLink:!0})}print(){return super.print(b(this,e)?{pre:"[[",post:"]]",sep:b(this,t)}:{sep:b(this,t)})}json(n,l=this.getAbsoluteIndex()){{const o=super.json(void 0,l),{type:u,fragment:a}=this;return a!==void 0&&(u==="link"||u==="redirect-target")&&(o.fragment=a),o}}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i),ri=ae(Br),Ve=re(ri,0,"LinkBaseToken",Or,Ve),ne(ri,1,Ve)}}),qr,li,Wr,Be,ft=I({"src/nowiki/base.ts"(){"use strict";ze(),J(),qr=[We],Be=class extends(Wr=z){get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}},li=ae(Wr),Be=re(li,0,"NowikiBaseToken",qr,Be),ne(li,1,Be)}}),Ur,ai,Mr,je,Rt=I({"src/nowiki/noinclude.ts"(){"use strict";pt(),ft(),Ur=[Ye()],je=class extends(Mr=Be){get type(){return"noinclude"}toString(e){return e?"":super.toString()}},ai=ae(Mr),je=re(ai,0,"NoincludeToken",Ur,je),ne(ai,1,je)}}),qa,Uu=I({"src/link/redirectTarget.ts"(){"use strict";Y(),G(),zs(),Rt(),qa=class extends Ve{get type(){return"redirect-target"}constructor(e,t,s,i){super(e,void 0,s,i),t!==void 0&&this.insertAt(new je(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}=N,r=i.getSeverity(s,"redirect");if(r&&this.length===2){const n=Q(this.lastChild,{start:e},s,"useless-link-text",r);n.startIndex--,n.startCol--,(i.computeEditInfo||i.fix)&&(n.fix=ee(n)),t.push(n)}return t}}}}}),zr,oi,Hr,Jt,Mu=I({"src/redirect.ts"(){"use strict";var e,t,s;pt(),ze(),J(),gt(),Uu(),zr=[Ye(!1,!1),We],Jt=(s=class extends(Hr=z){constructor(r,n,l,o,u,a,d=[]){super(void 0,a,d);R(this,e);R(this,t);E(this,e,r),E(this,t,u),this.append(new Ue(n,"redirect-syntax",a,d),new qa(l,o==null?void 0:o.slice(1),a,d))}get type(){return"redirect"}getAttribute(r){return r==="padding"?b(this,e).length:super.getAttribute(r)}toString(r){return b(this,e)+super.toString(r)+b(this,t)}lint(r=this.getAbsoluteIndex()){{const n=r+b(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",n),this.lastChild.lint(n)}}print(){return super.print({pre:b(this,e),post:b(this,t)})}},e=new WeakMap,t=new WeakMap,s),oi=ae(Hr),Jt=re(oi,0,"RedirectToken",zr,Jt),ne(oi,1,Jt)}}),Wa={};le(Wa,{parseRedirect:()=>Ua});var Ua,zu=I({"parser/redirect.ts"(){"use strict";G(),Mu(),Ua=(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&&N.normalizeTitle(i[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,page:""}).valid?(e=`\0${s.length}o${e.slice(i[0].length)}`,new Jt(...i.slice(1),t,s),e):!1}}}),Dr,ui,Gr,Xt,Hu=I({"src/onlyinclude.ts"(){"use strict";Ze(),ze(),J(),Dr=[We,He("<onlyinclude>")],Xt=class extends(Gr=z){get type(){return"onlyinclude"}toString(e){return`<onlyinclude>${super.toString(e)}</onlyinclude>`}isPlain(){return!0}print(){return super.print({pre:'<span class="wpb-ext">&lt;onlyinclude&gt;</span>',post:'<span class="wpb-ext">&lt;/onlyinclude&gt;</span>'})}},ui=ae(Gr),Xt=re(ui,0,"OnlyincludeToken",Dr,Xt),ne(ui,1,Xt)}}),Vr,di,Qr,lt,Vn=I({"src/tagPair/index.ts"(){"use strict";var e,t;Ms(),ze(),J(),Vr=[ms(),We],lt=(t=class extends(Qr=z){constructor(i,r,n,l,o,u=[]){super(void 0,o);R(this,e);Ne(this,"closed");Ne(this,"selfClosing");this.setAttribute("name",i.toLowerCase()),E(this,e,[i,l||i]),this.closed=l!=="",this.selfClosing=l===void 0,this.append(r,n);const a=typeof r=="string"?-1:u.indexOf(r);u.splice(a===-1?1/0:a,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(i){const{selfClosing:r,firstChild:n,lastChild:l}=this,[o,u]=b(this,e);return r?`<${o}${n.toString(i)}/>`:`<${o}${n.toString(i)}>${l.toString(i)}${this.closed?`</${u}>`:""}`}text(){const[i,r]=b(this,e);return this.selfClosing?`<${i}${this.firstChild.text()}/>`:`<${i}${super.text(">")}${this.closed?`</${r}>`:""}`}getAttribute(i){return i==="padding"?b(this,e)[0].length+1:super.getAttribute(i)}print(){const[i,r]=b(this,e);return super.print(this.selfClosing?{pre:`&lt;${i}`,post:"/&gt;"}:{pre:`&lt;${i}`,sep:"&gt;",post:this.closed?`&lt;/${r}&gt;`:""})}},e=new WeakMap,t),di=ae(Qr),lt=re(di,0,"TagPairToken",Vr,lt),ne(di,1,lt)}}),Qn,Ma=I({"src/tag/index.ts"(){"use strict";var e,t,s,i;Y(),Re(),G(),J(),Qn=(i=class extends z{constructor(n,l,o,u,a){super(void 0,u,a);R(this,e);R(this,t);R(this,s);this.insertAt(l),E(this,e,o),E(this,t,n)}get closing(){return b(this,e)}toString(n){return`<${b(this,e)?"/":""}${b(this,t)}${super.toString(n)}${this.selfClosing?"/":""}>`}text(n=""){const{closing:l}=this;return`<${l&&!n?"/":""}${b(this,t)}${l?"":super.text()}${n}>`}getAttribute(n){return n==="padding"?b(this,t).length+(b(this,e)?2:1):super.getAttribute(n)}findMatchingTag(){return ut(b(this,s),()=>{const{type:n,name:l,parentNode:o,closing:u,selfClosing:a}=this;let d=!1,c=!1;if(n==="html"){const{html:[,_,T]}=this.getAttribute("config");d=T.includes(l),c=_.includes(l)}if(d||c&&a)return this;if(!o)return;const{childNodes:f}=o,g=f.indexOf(this),y=u?f.slice(0,g).reverse():f.slice(g+1),$=[this],{rev:k}=be;for(const _ of y)if(!(!_.is(n)||n==="html"&&(_.name!==l||c&&_.selfClosing)))if(b(_,e)===u){if(n==="tvar")return;$.push(_)}else{const T=$.pop();if(T===this)return _;N.viewOnly&&(E(T,s,[k,_]),E(_,s,[k,T]))}if(N.viewOnly)for(const _ of $)E(_,s,[k,void 0])},n=>{E(this,s,n),n[1]&&n[1]!==this&&E(n[1],s,[be.rev,this])})}print(){return super.print({pre:`&lt;${b(this,e)?"/":""}${b(this,t)}`,post:`${this.selfClosing?"/":""}&gt;`})}json(n,l=this.getAbsoluteIndex()){{const o=super.json(void 0,l);return o.closing=b(this,e),o}}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i)}}),Jr,ci,Xr,Qe,Du=I({"src/tag/tvar.ts"(){"use strict";pt(),Ma(),gt(),Jr=[Ye()],Qe=class extends(Xr=Qn){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)}},ci=ae(Xr),Qe=re(ci,0,"TvarToken",Jr,Qe),ne(ci,1,Qe)}}),za,Gu=I({"src/tagPair/translate.ts"(){"use strict";var e,Ha,s;J(),Vn(),gt(),Du(),za=(s=class extends lt{constructor(r,n,l,o=[]){const u=new Ue(r,"translate-attr",l,o);n=n==null?void 0:n.replace(/<tvar(\|[^>]+)>([\s\S]*?)<\/>/gu,(d,c,f)=>(new Qe("tvar",c,!1,l,o),new Qe("","",!0,l,o),`\0${o.length-2}n${f}\0${o.length}n`)).replace(/<(tvar)(\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\3|[^"'\s>]+))?\s*)>([\s\S]*?)<\/(tvar)(\s*)>/giu,(d,c,f,g,y,$,k)=>(new Qe(c,f,!1,l,o),new Qe($,k,!0,l,o),`\0${o.length-2}n${y}\0${o.length}n`));const a=new z(n,l,o);a.type="translate-inner";super("translate",u,a,"translate",l,o);R(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">&lt;translate${j(this,e,Ha).call(this)?'<span class="wpb-ext-attrs"> <span class="wpb-ext-attr"><span class="wpb-attr-key">nowrap</span></span></span>':""}&gt;${this.lastChild.print({class:"ext-inner"})}&lt;/translate&gt;</span>`}},e=new WeakSet,Ha=function(){return this.firstChild.toString()===" nowrap"},s)}}),Kr,hi,Yr,Kt,Vu=I({"src/tagPair/include.ts"(){"use strict";Y(),ve(),pt(),G(),Vn(),Kr=[Ye(!1)],Kt=class extends(Yr=lt){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 ge(this,e),l=["no-ignored","unclosed-comment"],{lintConfig:o}=N,{computeEditInfo:u}=o,a=l.map(d=>o.getSeverity(d,"include"));if(a[0]&&s.data.trim()){const d=Q(s,n,l[0],"useless-attribute",a[0]);u&&(d.suggestions=[ee(d)]),t.push(d)}if(a[1]&&!i){const d=Z(this,n,l[1],N.msg("unclosed",`<${r}>`),a[1]);u&&(d.suggestions=[Xe(d.endIndex,`</${r}>`)]),t.push(d)}return t}}},hi=ae(Yr),Kt=re(hi,0,"IncludeToken",Kr,Kt),ne(hi,1,Kt)}}),Hs,Jn=I({"mixin/attributesParent.ts"(){"use strict";Hs=(e=0)=>t=>{var s,yn;{class r extends t{constructor(){super(...arguments);R(this,s)}hasAttr(o){return j(this,s,yn).call(this).hasAttr(o)}getAttr(o){return j(this,s,yn).call(this).getAttr(o)}}return s=new WeakSet,yn=function(){return this.childNodes[e]},r}}}}),he,gi,pi,Ut,ws,fi,Mt,mi,xi,vi,Ss,bi,yi,wi,Pe,Xn,Kn,Yn,Da,Ga=I({"util/sharable.ts"(){"use strict";he=new Set(["align"]),gi=new Set(["cite"]),pi=new Set(["cite","datetime"]),Ut=new Set(["width"]),ws=new Set(["axis","align","bgcolor","height","width","valign"]),fi=new Set([...ws,"abbr","headers","scope","rowspan","colspan"]),Mt=new Set(["type"]),mi=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),xi=new Set(["clear"]),vi=new Set(["bgcolor","align","valign"]),Ss=new Set(["qid","forcemathmode","type","display"]),bi=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),yi=new Set(["weight"]),wi=new Set(["width","height","zoom","latitude","longitude","align","mapstyle","lang","alt","text"]),Pe=new Set,Xn=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"]),Kn={div:he,h1:he,h2:he,h3:he,h4:he,h5:he,h6:he,blockquote:gi,q:gi,p:he,br:xi,pre:Ut,ins:pi,del:pi,ul:Mt,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...mi,"border"]),caption:he,tr:vi,td:fi,th:fi,font:new Set(["size","color","face"]),hr:Ut,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Mt,poem:he,categorytree:he,combooption:he,math:Pe,chem:Pe,ce:Pe,img:new Set(["alt","src","width","height","loading","srcset"])},Yn={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:Pe,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:yi,choicetemplate:yi,imagemap:Pe,inputbox:Pe,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:Pe,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([...Ss,"chem"]),chem:Ss,ce:Ss,hiero:Pe,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:bi,syntaxhighlight:bi,templatedata:Pe,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:Pe,mapframe:new Set([...wi,"frameless"]),maplink:new Set([...wi,"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:mi,td:new Set([...ws,"scope"]),th:ws,br:xi,caption:he,div:he,hr:Ut,h1:he,h2:he,h3:he,h4:he,h5:he,h6:he,li:Mt,p:he,pre:Ut,tr:vi,ul:Mt}}}),Zr,el,tl,sl,Ls,Qu=I({"src/attribute.ts"(){"use strict";var e,t,s,i,r,Va,wn,o;Y(),me(),Me(),Ga(),ve(),G(),J(),ht(),Zr=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,el=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,tl=new Set(["ext","arg","magic-word","template"]),sl=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),Ls=(o=class extends z{constructor(a,d,c,f="",g,y=[],$=N.getConfig(),k=[]){const _=new qe(c,"attr-key",$,k);let T;if(c==="title"||d==="img"&&c==="alt")T=new z(g,$,k,{}),T.type="attr-value",T.setAttribute("stage",ke-1);else if(d==="gallery"&&c==="caption"||d==="ref"&&c==="details"||(d==="mapframe"||d==="maplink")&&c==="text"||d==="choose"&&(c==="before"||c==="after")){const p={...$,excludes:[...$.excludes,"heading","html","table","hr","list"]};T=new z(g,p,k,{}),T.type="attr-value",T.setAttribute("stage",1)}else T=new qe(g,"attr-value",$,k,{});super(void 0,$,k);R(this,r);R(this,e);R(this,t);R(this,s);R(this,i);E(this,e,a),this.append(_,T),E(this,s,f),E(this,i,[...y]),E(this,t,d),this.setAttribute("name",Lt(Ce(c)))}get type(){return b(this,e)}get tag(){return b(this,t)}get balanced(){return!b(this,s)||b(this,i)[0]===b(this,i)[1]}afterBuild(){b(this,s).includes("\0")&&E(this,s,this.buildFromStr(b(this,s),0)),this.parentNode&&E(this,t,this.parentNode.name),j(this,r,Va).call(this),super.afterBuild()}toString(a){const[d="",c=""]=b(this,i);return b(this,s)?super.toString(a,b(this,s)+d)+c:this.firstChild.toString(a)}text(){return b(this,s)?`${super.text(`${b(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var a,d;return b(this,s)?b(this,s).length+((d=(a=b(this,i)[0])==null?void 0:a.length)!=null?d:0):0}lint(a=this.getAbsoluteIndex(),d){var c;{const f=super.lint(a,d),{balanced:g,firstChild:y,lastChild:$,name:k,tag:_}=this,T=new ge(this,a),p=["unclosed-quote","obsolete-attr"],{lintConfig:h}=N,m=p.map(S=>h.getSeverity(S,k));if(m[0]&&!g){const S=Q($,T,p[0],"unclosed-quotes",m[0]);S.startIndex--,S.startCol--,h.computeEditInfo&&(S.suggestions=[Xe(S.endIndex,b(this,i)[0])]),f.push(S)}const x=j(this,r,wn).call(this,a,T);return x&&f.push(x),m[1]&&((c=Da[_])!=null&&c.has(k))&&f.push(Q(y,T,p[1],"obsolete-attribute",m[1])),f}}getValue(){return b(this,s)?this.lastChild.text().trim():this.type==="ext-attr"||""}escape(){this.type!=="ext-attr"&&(E(this,s,"{{=}}"),this.lastChild.escape())}getAttribute(a){return a==="invalid"?j(this,r,wn).call(this):super.getAttribute(a)}print(){const[a="",d=""]=b(this,i);return b(this,s)?super.print({sep:ds(b(this,s))+a,post:d}):super.print()}json(a,d=this.getAbsoluteIndex()){{const c=super.json(void 0,d);return c.tag=this.tag,c}}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakSet,Va=function(){this.setAttribute("name",Lt(this.firstChild.text()))},wn=function(a,d){const{firstChild:c,lastChild:f,type:g,name:y,tag:$,parentNode:k}=this,_=!f.childNodes.some(({type:w})=>tl.has(w)),T=this.getValue(),p=Yn[$],h=Kn[$],{length:m}=this.toString();let x="illegal-attr",S,v;if({lintConfig:S}=N,{computeEditInfo:v}=S,!(p!=null&&p.has(y))&&!(h!=null&&h.has(y))&&(g==="ext-attr"?p||h:!/\{\{[^{]+\}\}/u.test(y))&&(g==="ext-attr"&&!h||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(y)&&($==="meta"||$==="link"||!Xn.has(y)))||(y==="itemtype"||y==="itemid"||y==="itemref")&&!(k!=null&&k.hasAttr("itemscope"))){if(a===void 0)return!0;{const w=S.getSeverity(x,"unknown");if(w){const A=Q(c,d,x,"illegal-attribute-name",w);return v&&(A.suggestions=[ee(a,m)]),A}}}else if(y==="style"&&typeof T=="string"&&Zr.test(T)){if(a===void 0)return!0;{x="insecure-style";const w=S.getSeverity(x);return w&&Q(f,d,x,"insecure-style",w)}}else if(y==="tabindex"&&typeof T=="string"&&T!=="0"){if(a===void 0)return!0;{const w=S.getSeverity(x,"tabindex");if(w){const A=Q(f,d,x,"nonzero-tabindex",w);return v&&(A.suggestions=[ee(a,m),Oe(A,"0 tabindex","0")]),A}}}else if(typeof T=="string"&&((/^xmlns:[\w:.-]+$/u.test(y)||sl.has(y))&&el.test(T)||_&&(y==="href"||$==="img"&&y==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(T))){if(a===void 0)return!0;{const w=S.getSeverity(x,"value");return w&&Q(f,d,x,"illegal-attribute-value",w)}}else if(_&&g!=="ext-attr"){const w=Hn($,y),A=String(T).toLowerCase();if(w.length>0&&w.every(C=>C!==A)){if(a===void 0)return!0;{const C=S.getSeverity(x,"value");return C&&Q(f,d,x,"illegal-attribute-value",C)}}}return!1},o)}}),Si,il,nl,Ds,Zn=I({"src/attributes.ts"(){"use strict";var e,t,Fs,i;Y(),me(),ve(),G(),J(),ht(),Qu(),Si=r=>r.slice(0,-1),il=r=>`${Si(r)}-dirty`,nl=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch{return/[^\W_]/u}})(),Ds=(i=class extends z{constructor(n,l,o,u,a=[]){super(void 0,u,a,{});R(this,t);R(this,e);if(E(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 c="",f=d.exec(n),g=0;const y=(()=>{c&&(super.insertAt(new qe(c,il(l),u,a,{})),c="")});for(;f;){const{index:$,0:k,1:_,2:T,3:p,4:h,5:m,6:x}=f;if(c+=n.slice(g,$),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(Ce(_).trim())){const S=h!=null?h:x,v=[p,m],w=new Ls(Si(l),o,_,T,S,v,u,a);y(),super.insertAt(w)}else c+=k;({lastIndex:g}=d),f=d.exec(n)}c+=n.slice(g),y()}}get type(){return b(this,e)}afterBuild(){const{parentNode:n}=this;n!=null&&n.is("td")&&this.setAttribute("name",n.subtype),super.afterBuild()}getAttrTokens(n){return this.childNodes.filter(l=>l instanceof Ls&&(!n||l.name===Lt(n)))}hasAttr(n){return this.getAttrTokens(n).length>0}getAttrToken(n){{const l=this.getAttrTokens(n);return l[l.length-1]}}getAttr(n){var l;return(l=this.getAttrToken(n))==null?void 0:l.getValue()}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),{parentNode:u,childNodes:a}=this,d=new Map,c=new Set,f=new ge(this,n),g=["no-ignored","no-duplicate"],{lintConfig:y}=N,{computeEditInfo:$,fix:k}=y,_=["closingTag","invalidAttributes","nonWordAttributes"].map(p=>y.getSeverity(g[0],p));if(_[0]&&j(this,t,Fs).call(this)){const p=Z(this,f,g[0],"attributes-of-closing-tag",_[0]);if($){const h=u.getAbsoluteIndex();p.suggestions=[ee(p),Wn(h)]}o.push(p)}for(const p of a)if(p instanceof Ls){const{name:h}=p;d.has(h)?(c.add(h),d.get(h).push(p)):d.set(h,[p])}else{const h=p.text().trim(),m=_[nl.test(h)?1:2];if(h&&m){const x=Q(p,f,g[0],"invalid-attribute",m);$&&(x.suggestions=[ee(x,0," ")]),o.push(x)}}const T=y.getSeverity(g[1],"attribute");if(T&&c.size>0)for(const p of c){const h=d.get(p).map(m=>{const x=m.getValue();return[m,x===!0?"":x]});Array.prototype.push.apply(o,h.map(([m,x],S)=>{const v=Q(m,f,g[1],N.msg("duplicate-attribute",p),T);if($||k){const w=ee(v);!x||h.slice(0,S).some(([,A])=>A===x)?v.fix=w:$&&(v.suggestions=[w])}return v}))}return o}}getAttribute(n){return n==="invalid"?j(this,t,Fs).call(this):super.getAttribute(n)}print(){return this.toString()?`<span class="wpb-${this.type}${j(this,t,Fs).call(this)?" wpb-invalid":""}">${this.childNodes.map(n=>n.print(n instanceof qe?{class:n.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,Fs=function(){const{parentNode:n}=this;return(n==null?void 0:n.type)==="html"&&n.closing&&this.text().trim()!==""},i)}}),Qa={};le(Qa,{PreToken:()=>Ja});var Ja,Ju=I({"src/pre.ts"(){"use strict";Me(),J(),Rt(),Ja=class extends z{get type(){return"ext-inner"}constructor(e,t,s=[]){if(e){const i=/<nowiki>/giu,r=/<\/nowiki>/giu,{length:n}=i.source;let l=i.exec(e);l&&(r.lastIndex=l.index+n);let o=r.exec(e),u=0,a="";for(;l&&o;)new je(l[0],t,s,!0),new je(o[0],t,s,!0),a+=`${e.slice(u,l.index)}\0${s.length-1}n${e.slice(l.index+n,o.index)}\0${s.length}n`,u=o.index+n+1,i.lastIndex=u,l=i.exec(e),l&&(r.lastIndex=l.index+n),o=r.exec(e);e=a+e.slice(u)}super(e,t,s,{}),this.setAttribute("stage",ke-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),Gs,er=I({"src/multiLine/index.ts"(){"use strict";J(),Gs=class extends z{get type(){return"ext-inner"}toString(e){return super.toString(e,`
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!`)}},Wt=ae(null),vs=new WeakMap,Pt=new WeakMap,Ot=new WeakMap,bs=new WeakMap,Bt=new WeakMap,qt=new WeakMap,re(Wt,1,"getLines",kr,nt),nt=re(Wt,0,"AstNode",$r,nt),ne(Wt,1,nt)}}),ja,Ou=I({"mixin/elementLike.ts"(){"use strict";Na(),ja=e=>{var t,xn;{class i extends e{constructor(){super(...arguments);R(this,t)}getElementBy(l){const o=[...this.childNodes].reverse();for(;o.length>0;){const u=o.pop(),{type:a,childNodes:d}=u;if(a!=="text"){if(l(u))return u;for(let c=d.length-1;c>=0;c--)o.push(d[c])}}}querySelector(l){return this.getElementBy(j(this,t,xn).call(this,l))}getElementsBy(l){const o=[...this.childNodes].reverse(),u=[];for(;o.length>0;){const a=o.pop(),{type:d,childNodes:c}=a;if(d!=="text"){l(a)&&u.push(a);for(let f=c.length-1;f>=0;f--)o.push(c[f])}}return u}querySelectorAll(l){return this.getElementsBy(j(this,t,xn).call(this,l))}escape(){for(const l of this.childNodes)l.escape()}}return t=new WeakSet,xn=function(l){return Dn(l,this)},i}}}}),_r,ei,Tr,Vt,Bu=I({"lib/element.ts"(){"use strict";me(),Re(),Na(),Ea(),Ou(),_r=[ja],Vt=class extends(Tr=nt){get length(){return this.childNodes.length}text(e){return ct(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){return fs(this,e,1)[0]}insertAt(e,t=this.length){return fs(this,t,0,[e]),e}closest(e){const t=Dn(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){for(let t=this.length-1;t>=0;t--)this.removeAt(t);this.safeAppend(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){{if(e===void 0)return;const{length:t}=this.toString();if(e>t||e<-t)return;e+=e<0?t:0;let s=this,i=0,r=0;for(;s.type!=="text";){const{childNodes:n}=s;i+=s.getAttribute("padding");for(let l=0;i<=e&&l<n.length;l++){const o=n[l],{nextSibling:u}=o,a=o.toString(),d=a.length;if(o.setAttribute("aIndex",i),i+=d,i>e||i===e&&d>0&&(!u||u.type==="text"||o.type!=="text"&&(a.trim()||!u.toString().trim()))){s=o,i-=d,r=i;break}i+=s.getGaps(l)}if(s.childNodes===n)return{offsetNode:s,offset:e-r}}return{offsetNode:s,offset:e-r}}this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(e){var t;{const s=(t=this.caretPositionFromIndex(e))==null?void 0:t.offsetNode;return(s==null?void 0:s.type)==="text"?s.parentNode:s}this.lspError("AstElement.elementFromIndex")}elementFromPoint(e,t){return this.elementFromIndex(this.indexFromPos(t,e))}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":""}">`)+Ft(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){{const s={...this,type:this.type,range:[t,t+this.toString().length],childNodes:[]};for(let i=0,r=t+this.getAttribute("padding");i<this.length;i++){const n=this.childNodes[i],{length:l}=n.toString();n.setAttribute("aIndex",r),s.childNodes.push(n.type==="text"?{data:n.data,range:[r,r+l]}:n.json(void 0,r)),r+=l+this.getGaps(i)}return s}}},ei=ae(Tr),Vt=re(ei,0,"AstElement",_r,Vt),ne(ei,1,Vt)}}),ms,Ms=I({"mixin/gapped.ts"(){"use strict";ms=(e=1)=>t=>{class s extends t{getGaps(){return e}}return s}}}),We,ze=I({"mixin/noEscape.ts"(){"use strict";We=e=>{{class t extends e{escape(){}}return t}}}}),Cr,Ra,qu=I({"src/parameter.ts"(){"use strict";me(),Y(),G(),J(),Cr=new RegExp(`https?://${It}${Nt}$`,"iu"),Ra=class extends z{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){var e;try{return!!((e=this.parentNode)!=null&&e.getDuplicatedArgs().some(([t])=>t===this.name))}catch{return!1}}constructor(e,t,s,i=[]){super(void 0,s,i);const r=new z(typeof e=="number"?void 0:e,s,i,{}),n=new z(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}=N,l=n.getSeverity(r);if(l){const{firstChild:o}=this,u=(s=Cr.exec(o.text()))==null?void 0:s[0];try{if(u&&new URL(u).search){const a=Q(o,{start:e},r,"unescaped-query",l);a.startIndex=a.endIndex,a.startLine=a.endLine,a.startCol=a.endCol,a.endIndex++,a.endCol++,(n.computeEditInfo||n.fix)&&(a.fix=Et(a.startIndex,"{{=}}")),i.push(a)}}catch{}}return i}}print(){return super.print({sep:this.anon?"":"="})}json(e,t=this.getAbsoluteIndex()){{const s=super.json(void 0,t);return Object.assign(s,{anon:this.anon},this.duplicated&&{duplicated:!0}),s}}}}}),qe,ht=I({"src/atom.ts"(){"use strict";var e,t;J(),qe=(t=class extends z{constructor(i,r,n,l,o){super(i,n,l,o);R(this,e);E(this,e,r)}get type(){return b(this,e)}set type(i){E(this,e,i)}getAttribute(i){var r;return i==="invalid"?this.type==="converter-flag"&&!!((r=this.parentNode)!=null&&r.isInvalidFlag(this)):super.getAttribute(i)}},e=new WeakMap,t)}}),Ue,gt=I({"src/syntax.ts"(){"use strict";var e,t;J(),Ue=(t=class extends z{constructor(i,r,n,l,o){super(i,n,l,o);R(this,e);E(this,e,r)}get type(){return b(this,e)}lint(i=this.getAbsoluteIndex()){return super.lint(i,!1)}},e=new WeakMap,t)}}),Pa={};le(Pa,{TranscludeToken:()=>rt});var Ir,ti,Nr,rt,Oa=I({"src/transclude.ts"(){"use strict";var e,t,s,i,r,n,Qt,Ba,u;me(),Y(),Re(),ve(),Ms(),ze(),G(),J(),qu(),ht(),gt(),Ir=[We,ms()],rt=(u=class extends(Nr=z){constructor(d,c,f,g=[]){var A,C;let y;const $=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(d);$&&(y=Number($[1]),d=d.replace(`\0${y}h`,g[y].toString().replace(/^\n/u,"")));super(void 0,f,g,{});R(this,n);Ne(this,"modifier","");R(this,e,"template");R(this,t,":");R(this,s,!1);R(this,i,new Map);R(this,r);const{parserFunction:[k,_],variable:T,functionHook:p}=f,h=(A=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(d))==null?void 0:A[0];if(h)this.setAttribute("modifier",h),d=d.slice(h.length);else if(d.includes(":")){const[L,...B]=d.split(":"),[q]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((C=B[0])!=null?C:"");this.setModifier(`${L}:${q}`)&&(d=B.join(":").slice(q.length))}const m=d.search(/[::]/u),x=d[m]===":",S=m!==-1;if(S||c.length===0&&!b(this,s)){const L=S?d.slice(0,m):d,B=S&&d.slice(m+1),q=Ce(L),O=S?q.slice(q.search(/\S/u))+(x?":":""):q.trim(),W=O.toLowerCase(),F=Array.isArray(_),P=F?_.includes(O):Object.prototype.hasOwnProperty.call(_,O),U=!F&&P?_[O]:Object.prototype.hasOwnProperty.call(k,W)&&k[W],M=F&&P||!("functionHook"in f)||p.includes(U),ie=F&&P||T.includes(U);if(S?U&&M:ie){this.setAttribute("name",U||W.replace(/^#|:$/u,"")),E(this,e,"magic-word"),x&&E(this,t,":");const H=new Ue(L,"magic-word-name",f,g);if(super.insertAt(H),B!==!1&&c.unshift([B]),this.name==="invoke")for(let V=0;V<2;V++){const X=c.shift();if(!X)break;const oe=new qe(X.join("="),`invoke-${V?"function":"module"}`,f,g);super.insertAt(oe)}}}if(this.type==="template"){const L=Ce(d).trim();if(!this.normalizeTitle(L,10,{halfParsed:!0,temporary:!0}).valid)throw g.pop(),new SyntaxError("Invalid template name");const B=new qe(d,"template-name",f,g,{});super.insertAt(B)}typeof y=="number"&&(g[y]=void 0);const v=this.isTemplate();let w=1;for(let L=0;L<c.length;L++){const B=c[L];v||this.name==="switch"&&L>0||this.name==="tag"&&L>1||(B[0]=B.join("="),B.length=1),B.length===1&&(B.unshift(w),w++),this.insertAt(new Ra(...B,f,g))}this.seal("modifier")}get type(){return b(this,e)}get module(){return this.type==="magic-word"&&this.name==="invoke"?j(this,n,Qt).call(this).title:void 0}get function(){var d;return this.type==="magic-word"&&this.name==="invoke"?(d=this.childNodes[2])==null?void 0:d.text().trim():void 0}setModifier(d){const{parserFunction:[,,c,f]}=this.getAttribute("config"),g=Ce(d).trim();if(d&&!g.endsWith(":"))return!1;const y=g.slice(0,-1).toLowerCase(),$=c.includes(y),k=f.includes(y);return(b(this,s)?$:k||!d)||(be.running||this.length>1)&&($||k||!d)?(this.setAttribute("modifier",d),E(this,s,$),!!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"&&(E(this,r,j(this,n,Qt).call(this)),this.setAttribute("name",b(this,r).title))}toString(d){const{childNodes:c,length:f,firstChild:g,modifier:y,type:$}=this;return`{{${y}${$==="magic-word"?g.toString(d)+(f===1?"":b(this,t))+c.slice(1).map(k=>k.toString(d)).join("|"):super.toString(d,"|")}}}`}text(){const{childNodes:d,length:c,firstChild:f,modifier:g,type:y,name:$}=this;return y==="magic-word"&&$==="vardefine"?"":`{{${g}${y==="magic-word"?f.text()+(c===1?"":b(this,t))+ct(d.slice(1),"|"):super.text("|")}}}`}getAttribute(d){switch(d){case"padding":return this.modifier.length+2;case"title":return b(this,r);case"colon":return b(this,t);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!j(this,n,Qt).call(this).valid);default:return super.getAttribute(d)}}lint(d=this.getAbsoluteIndex(),c){{const f=super.lint(d,c);if(!this.isTemplate())return f;const{type:g,childNodes:y,length:$}=this,k=new ge(this,d),{lintConfig:_}=N,{computeEditInfo:T}=_,p=g==="magic-word";let h="no-ignored",m=_.getSeverity(h,"fragment");if(p&&!j(this,n,Qt).call(this).valid)h="invalid-invoke",m=_.getSeverity(h,"name"),m&&f.push(Q(y[1],k,h,"illegal-module",m));else if(m){const x=y[p?1:0],S=x.childNodes.findIndex(w=>w.type==="text"&&us(w.data).includes("#")),v=x.childNodes[S];if(v){const w=Q(x,k,h,"useless-fragment",m);T&&(w.suggestions=[ee(w,x.getRelativeIndex(S)+v.data.indexOf("#"))]),f.push(w)}}if(h="invalid-invoke",m=_.getSeverity(h,"function"),m&&p&&$===2)return f.push(Z(this,k,h,"missing-function",m)),f;if(h="no-duplicate",m=_.getSeverity(h,"parameter"),m){const x=this.getDuplicatedArgs().filter(([,v])=>!v[0].querySelector("ext")),S="duplicate-parameter";for(const[,v]of x)Array.prototype.push.apply(f,v.map(w=>{const A=Q(w,k,h,S,m);return T&&(A.suggestions=[ee(A,-1)]),A}))}return f}}insertAt(d,c=this.length){return super.insertAt(d,c),d.anon?j(this,n,Ba).call(this,d):d.name&&this.getArgs(d.name,!1,!1).add(d),d}getAllArgs(){return this.childNodes.filter(Js("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:d})=>d)}getArgs(d,c,f=!0){const g=String(d).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");let y;return b(this,i).has(g)?y=b(this,i).get(g):(y=new Set(this.getAllArgs().filter(({name:$})=>g===$)),b(this,i).set(g,y)),y}getDuplicatedArgs(){return[...b(this,i)].filter(([,{size:d}])=>d>1).map(([d,c])=>[d,[...c]])}getPossibleValues(){const{type:d,name:c,childNodes:f}=this;if(d==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let g,y;switch(c){case"if":case"ifexist":case"ifexpr":case"iferror":g=2;break;case"ifeq":g=3;break;case"switch":{const $=f.slice(2),k=$[$.length-1];y=[...$.filter(({anon:_})=>!_),...k!=null&&k.anon?[k]:[]].map(({lastChild:_})=>_);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}y!=null||(y=f.slice(g,g+2).map(({lastChild:$})=>$));for(let $=0;$<y.length;){const{length:k,0:_}=y[$].childNodes.filter(T=>T.text().trim());if(k===0)y.splice($,1);else if(k>1||_.type!=="magic-word")$++;else try{const T=_.getPossibleValues();Array.prototype.splice.apply(y,[$,1,...T]),$+=T.length}catch{$++}}return y}print(){const{childNodes:d,length:c,firstChild:f,modifier:g,type:y}=this;return`<span class="wpb-${y}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${y==="magic-word"?ds(g)+f.print()+(c===1?"":b(this,t))+Ft(d.slice(1),{sep:"|"}):(g?`<span class="wpb-magic-word">${ds(g)}</span>`:"")+Ft(d,{sep:"|"})}}}</span>`}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakSet,Qt=function(){const d=this.type==="template";return this.normalizeTitle((d?"":"Module:")+this.childNodes[d?0:1].text(),10,{temporary:!0,...!d&&{page:""}})},Ba=function(d){const c=this.getAnonArgs(),f=typeof d!="number";for(let g=f?c.indexOf(d):d-1;g<c.length;g++){const y=c[g],{name:$}=y,k=String(g+1);($!==k||y===d)&&(y.setAttribute("name",k),this.getArgs(k,!1,!1).add(y))}},u),ti=ae(Nr),rt=re(ti,0,"TranscludeToken",Ir,rt),ne(ti,1,rt)}}),ys,si,ii,Lr,Fr,Er,jr,ni,Rr,vn,Wu=I({"lib/text.ts"(){"use strict";var e,bn,s;me(),Y(),Re(),G(),Ea(),ys=String.raw`[${Je}\t]*`,si=String.raw`[^\S\n]*`,ii=String.raw`<${si}(?:/${si})?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+`,Lr=new RegExp(String.raw`${ii}|https?[:/]/+|(?:rfc|pmid)(?=[-::]?${ys}\d)|isbn(?=[-::]?${ys}(?:\d(?:${ys}|-)){6})`,"giu"),Fr=new RegExp(ii,"giu"),Er=new Set(["attr-value","ext-link-text","link-text"]),jr={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},ni=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"]),Rr=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch{return/\w/u}})(),vn=(s=class extends nt{constructor(n){super();R(this,e);Ne(this,"data","");this.data=n}get type(){return"text"}toString(n){var l;return n&&!((l=this.parentNode)!=null&&l.getAttribute("built"))?Ce(this.data):this.data}text(){return this.data}lint(n=this.getAbsoluteIndex(),l){var o,u,a;{if(l===!1)return[];const{data:d,parentNode:c,nextSibling:f,previousSibling:g}=this;if(!c)throw new Error("An isolated text node cannot be linted!");const{type:y,parentNode:$}=c;if(y==="attr-value"){const{name:O,tag:W}=$;if(W==="ref"&&(O==="name"||O==="follow")||O==="group"&&(W==="ref"||W==="references")||W==="choose"&&(O==="before"||O==="after"))return[]}if(l!=null||(l=c.isPlain()&&!Er.has(y)?Lr:Fr),d.search(l)===-1)return[];l.lastIndex=0;const k=[],_=f==null?void 0:f.type,T=f==null?void 0:f.name,p=g==null?void 0:g.type,h=this.getRootNode(),m=h.toString(),{ext:x,html:S,variants:v}=h.getAttribute("config"),{top:w,left:A}=h.posFromIndex(n),{lintConfig:C}=N,L=C.rules["tag-like"],B=typeof L=="object"&&L[1]?new Set(Object.keys(L[1]).filter(O=>O!=="invalid"&&O!=="disallowed")):new Set,q=new Set(["onlyinclude","noinclude","includeonly",...x,...S[0],...S[1],...S[2],...B,...C.getSeverity("tag-like","disallowed")?ni:[]]);for(let O=l.exec(d);O;O=l.exec(d)){const[,W,F]=O;let{index:P,0:U}=O;if(F&&F!=="]"){const{length:xe}=F;P+=xe,U=U.slice(xe)}U=U.toLowerCase();const[M]=U,ie=M==="r"||M==="p"||M==="i",H=M==="{",V=M==="}",X=M==="[",oe=M==="]";let{length:de}=U;if(M==="<"&&!q.has(W.toLowerCase())||X&&y==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(d.slice(P+1))||f!=null&&f.is("ext")&&T==="nowiki"&&((o=f.innerText)!=null&&o.includes("]"))))continue;oe&&(P||de>1)&&l.lastIndex--;let ce=n+P,ue=ce+de,pe,ye;const D=m[ue],K=m[ce-1],Ae=H||X,we=H&&K==="-"&&v.length>0,Ie=V&&D==="-"&&v.length>0,et=X&&_==="free-ext-link"&&!d.slice(P+1).trim()||oe&&p==="free-ext-link"&&!d.slice(0,P).includes("]");if(ie)pe="lonely-http",U=U.toUpperCase(),ye=C.getSeverity(pe,U);else if(M==="<"){pe="tag-like";let xe;/^<\/?\s/u.test(U)||!/[\s/>]/u.test(D!=null?D:"")?xe="invalid":B.has(W)?xe=W:ni.has(W)&&!x.includes(W)&&(xe="disallowed"),ye=C.getSeverity(pe,xe)}else if(we||Ie)pe="lonely-bracket",ye=C.getSeverity(pe,"converter"),we&&P>0?(U="-{",P--,ce--,de=2):Ie&&P<d.length-1&&(U="}-",ue++,de=2);else if(et)pe="lonely-bracket",ye=C.getSeverity(pe,"extLink");else if(Ae||V||oe)if(pe="lonely-bracket",de>1||H&&D===M||V&&K===M)ye=C.getSeverity(pe,"double");else{if(!X||y!=="ext-link-text"){const xe=jr[M],Xs=Ae?d.slice(P+1):d.slice(0,P);if(H&&((u=xe.exec(Xs))==null?void 0:u[0])==="}"||V&&((a=xe.exec(Xs))==null?void 0:a[0])==="{")continue;if(!Xs.includes(M)){const cr=Ae?"nextSibling":"previousSibling";let tt=this[cr];for(;tt&&(tt.type!=="text"||!xe.test(tt.data));)tt=tt[cr];if(tt&&xe.exec(tt.data)[0]!==M)continue}}ye=C.getSeverity(pe,"single")}else pe="lonely-http",ye=C.getSeverity(pe);if(!ye)continue;const _e=this.posFromIndex(P),{line:mt,character:te}=hs(w,A,_e.top+1,_e.left),Le={rule:pe,message:N.msg("lonely",ie||M==="h"||we||Ie?U:M),severity:ye,startIndex:ce,endIndex:ue,startLine:mt,endLine:mt,startCol:te,endCol:te+de};if(C.computeEditInfo)if(M==="<")Le.suggestions=[Et(ce,"&lt;")];else if(M==="h"&&y!=="link-text"&&Rr.test(K||""))Le.suggestions=[gs(ce)];else if(X&&y==="ext-link-text"){const xe=c.getAbsoluteIndex()+c.toString().length;Le.suggestions=[Et(xe,"&#93;")]}else if(oe&&et){const xe=n-g.toString().length;Le.suggestions=[Ws(xe,"left-bracket","[")]}else ie&&(Le.suggestions=[...O[0]===U?[]:[Mn(Le,U)],...D===":"||D===":"?[gs(ue,1)]:[]]);k.push(Le)}return k}}replaceData(n){j(this,e,bn).call(this,n)}splitText(n){{const{parentNode:l,data:o}=this;if(!l)throw new Error("The text node to be split has no parent node!");const u=new s(o.slice(n));return fs(l,l.childNodes.indexOf(this)+1,0,[u]),this.setAttribute("data",o.slice(0,n)),u}this.lspError("AstText.splitText")}escape(){{const{parentNode:n}=this;if(!n)throw new Error("The text node to be escaped has no parent node!");const{TranscludeToken:l}=(Oa(),se(Pa)),o=n.getAttribute("config"),u=n.childNodes.indexOf(this)+1,a=f=>Math.max(this.data.lastIndexOf("=",f),this.data.lastIndexOf("|",f));let d=a();const c=(()=>new l(this.data[d]==="="?"=":"!",[],o));for(;d>=0;d=a(d-1))d<this.data.length-1&&this.splitText(d+1),n.insertAt(be.run(c),u),j(this,e,bn).call(this,this.data.slice(0,d))}}print(){return ds(this.data)}},e=new WeakSet,bn=function(n){this.setAttribute("data",n)},s)}}),Ye,pt=I({"mixin/hidden.ts"(){"use strict";Ye=(e=!0,t=!0)=>s=>{class i extends s{text(){return""}lint(n){return e?[]:super.lint(n)}}return i}}}),He,Ze=I({"mixin/padded.ts"(){"use strict";He=({length:e})=>t=>{class s extends t{getAttribute(r){return r==="padding"?e:super.getAttribute(r)}}return s}}}),Pr,Or,ri,Br,Ve,zs=I({"src/link/base.ts"(){"use strict";var e,t,s,i;Y(),Me(),ve(),Ze(),ze(),G(),J(),ht(),Pr=r=>r==="redirect-target"||r==="link",Or=[We,He("[[")],Ve=(i=class extends(Br=z){constructor(n,l,o,u=[],a="|"){super(void 0,o,u,{});R(this,e,!0);R(this,t);R(this,s);if(this.insertAt(new qe(n,"link-target",o,u,{})),l!==void 0){const d=new z(l,o,u,{});d.type="link-text",d.setAttribute("stage",ke-1),this.insertAt(d)}E(this,t,a)}get link(){return b(this,s)}get fragment(){return b(this,s).fragment}afterBuild(){E(this,s,this.getTitle()),b(this,t).includes("\0")&&E(this,t,this.buildFromStr(b(this,t),0)),this.setAttribute("name",b(this,s).title),super.afterBuild()}setAttribute(n,l){n==="bracket"?E(this,e,l):n==="title"?E(this,s,l):super.setAttribute(n,l)}toString(n){const l=super.toString(n,b(this,t));return b(this,e)?`[[${l}]]`:l}text(){const n=super.text("|");return b(this,e)?`[[${n}]]`:n}getAttribute(n){return n==="title"?b(this,s):super.getAttribute(n)}getGaps(n){return n===0?b(this,t).length:1}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),{childNodes:[u,a],type:d}=this,{encoded:c,fragment:f}=b(this,s),{lintConfig:g}=N,{computeEditInfo:y,fix:$}=g,k=new ge(this,n);let _="unknown-page",T=g.getSeverity(_);if(T&&u.childNodes.some(({type:p})=>p==="template")&&o.push(Q(u,k,_,"template-in-link",T)),_="url-encoding",T=g.getSeverity(_),T&&c){const p=Q(u,k,_,"unnecessary-encoding",T);(y||$)&&(p.fix=qn(p,u)),o.push(p)}if(_="pipe-like",T=g.getSeverity(_,"link"),T&&(d==="link"||d==="category")){const p=a==null?void 0:a.childNodes.findIndex(m=>m.type==="text"&&m.data.includes("|")),h=a==null?void 0:a.childNodes[p];if(h){const m=Q(a,k,_,"pipe-in-link",T);if(y){const x=m.startIndex+a.getRelativeIndex(p);m.suggestions=[zn(x,h.data)]}o.push(m)}}if(_="no-ignored",T=g.getSeverity(_,"fragment"),T&&f!==void 0&&!Pr(d)){const p=Q(u,k,_,"useless-fragment",T);if(y||$){const h=u.childNodes.findIndex(x=>x.type==="text"&&x.data.includes("#")),m=u.childNodes[h];m&&(p.fix=ee(p,u.getRelativeIndex(h)+m.data.indexOf("#")))}o.push(p)}return o}}getTitle(n,l){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:l,temporary:n,decode:!0,selfLink:!0})}print(){return super.print(b(this,e)?{pre:"[[",post:"]]",sep:b(this,t)}:{sep:b(this,t)})}json(n,l=this.getAbsoluteIndex()){{const o=super.json(void 0,l),{type:u,fragment:a}=this;return a!==void 0&&(u==="link"||u==="redirect-target")&&(o.fragment=a),o}}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i),ri=ae(Br),Ve=re(ri,0,"LinkBaseToken",Or,Ve),ne(ri,1,Ve)}}),qr,li,Wr,Be,ft=I({"src/nowiki/base.ts"(){"use strict";ze(),J(),qr=[We],Be=class extends(Wr=z){get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}},li=ae(Wr),Be=re(li,0,"NowikiBaseToken",qr,Be),ne(li,1,Be)}}),Ur,ai,Mr,je,Rt=I({"src/nowiki/noinclude.ts"(){"use strict";pt(),ft(),Ur=[Ye()],je=class extends(Mr=Be){get type(){return"noinclude"}toString(e){return e?"":super.toString()}},ai=ae(Mr),je=re(ai,0,"NoincludeToken",Ur,je),ne(ai,1,je)}}),qa,Uu=I({"src/link/redirectTarget.ts"(){"use strict";Y(),G(),zs(),Rt(),qa=class extends Ve{get type(){return"redirect-target"}constructor(e,t,s,i){super(e,void 0,s,i),t!==void 0&&this.insertAt(new je(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}=N,r=i.getSeverity(s,"redirect");if(r&&this.length===2){const n=Q(this.lastChild,{start:e},s,"useless-link-text",r);n.startIndex--,n.startCol--,(i.computeEditInfo||i.fix)&&(n.fix=ee(n)),t.push(n)}return t}}}}}),zr,oi,Hr,Jt,Mu=I({"src/redirect.ts"(){"use strict";var e,t,s;pt(),ze(),J(),gt(),Uu(),zr=[Ye(!1,!1),We],Jt=(s=class extends(Hr=z){constructor(r,n,l,o,u,a,d=[]){super(void 0,a,d);R(this,e);R(this,t);E(this,e,r),E(this,t,u),this.append(new Ue(n,"redirect-syntax",a,d),new qa(l,o==null?void 0:o.slice(1),a,d))}get type(){return"redirect"}getAttribute(r){return r==="padding"?b(this,e).length:super.getAttribute(r)}toString(r){return b(this,e)+super.toString(r)+b(this,t)}lint(r=this.getAbsoluteIndex()){{const n=r+b(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",n),this.lastChild.lint(n)}}print(){return super.print({pre:b(this,e),post:b(this,t)})}},e=new WeakMap,t=new WeakMap,s),oi=ae(Hr),Jt=re(oi,0,"RedirectToken",zr,Jt),ne(oi,1,Jt)}}),Wa={};le(Wa,{parseRedirect:()=>Ua});var Ua,zu=I({"parser/redirect.ts"(){"use strict";G(),Mu(),Ua=(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&&N.normalizeTitle(i[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,page:""}).valid?(e=`\0${s.length}o${e.slice(i[0].length)}`,new Jt(...i.slice(1),t,s),e):!1}}}),Dr,ui,Gr,Xt,Hu=I({"src/onlyinclude.ts"(){"use strict";Ze(),ze(),J(),Dr=[We,He("<onlyinclude>")],Xt=class extends(Gr=z){get type(){return"onlyinclude"}toString(e){return`<onlyinclude>${super.toString(e)}</onlyinclude>`}isPlain(){return!0}print(){return super.print({pre:'<span class="wpb-ext">&lt;onlyinclude&gt;</span>',post:'<span class="wpb-ext">&lt;/onlyinclude&gt;</span>'})}},ui=ae(Gr),Xt=re(ui,0,"OnlyincludeToken",Dr,Xt),ne(ui,1,Xt)}}),Vr,di,Qr,lt,Vn=I({"src/tagPair/index.ts"(){"use strict";var e,t;Ms(),ze(),J(),Vr=[ms(),We],lt=(t=class extends(Qr=z){constructor(i,r,n,l,o,u=[]){super(void 0,o);R(this,e);Ne(this,"closed");Ne(this,"selfClosing");this.setAttribute("name",i.toLowerCase()),E(this,e,[i,l||i]),this.closed=l!=="",this.selfClosing=l===void 0,this.append(r,n);const a=typeof r=="string"?-1:u.indexOf(r);u.splice(a===-1?1/0:a,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(i){const{selfClosing:r,firstChild:n,lastChild:l}=this,[o,u]=b(this,e);return r?`<${o}${n.toString(i)}/>`:`<${o}${n.toString(i)}>${l.toString(i)}${this.closed?`</${u}>`:""}`}text(){const[i,r]=b(this,e);return this.selfClosing?`<${i}${this.firstChild.text()}/>`:`<${i}${super.text(">")}${this.closed?`</${r}>`:""}`}getAttribute(i){return i==="padding"?b(this,e)[0].length+1:super.getAttribute(i)}print(){const[i,r]=b(this,e);return super.print(this.selfClosing?{pre:`&lt;${i}`,post:"/&gt;"}:{pre:`&lt;${i}`,sep:"&gt;",post:this.closed?`&lt;/${r}&gt;`:""})}},e=new WeakMap,t),di=ae(Qr),lt=re(di,0,"TagPairToken",Vr,lt),ne(di,1,lt)}}),Qn,Ma=I({"src/tag/index.ts"(){"use strict";var e,t,s,i;Y(),Re(),G(),J(),Qn=(i=class extends z{constructor(n,l,o,u,a){super(void 0,u,a);R(this,e);R(this,t);R(this,s);this.insertAt(l),E(this,e,o),E(this,t,n)}get closing(){return b(this,e)}toString(n){return`<${b(this,e)?"/":""}${b(this,t)}${super.toString(n)}${this.selfClosing?"/":""}>`}text(n=""){const{closing:l}=this;return`<${l&&!n?"/":""}${b(this,t)}${l?"":super.text()}${n}>`}getAttribute(n){return n==="padding"?b(this,t).length+(b(this,e)?2:1):super.getAttribute(n)}findMatchingTag(){return ut(b(this,s),()=>{const{type:n,name:l,parentNode:o,closing:u,selfClosing:a}=this;let d=!1,c=!1;if(n==="html"){const{html:[,_,T]}=this.getAttribute("config");d=T.includes(l),c=_.includes(l)}if(d||c&&a)return this;if(!o)return;const{childNodes:f}=o,g=f.indexOf(this),y=u?f.slice(0,g).reverse():f.slice(g+1),$=[this],{rev:k}=be;for(const _ of y)if(!(!_.is(n)||n==="html"&&(_.name!==l||c&&_.selfClosing)))if(b(_,e)===u){if(n==="tvar")return;$.push(_)}else{const T=$.pop();if(T===this)return _;N.viewOnly&&(E(T,s,[k,_]),E(_,s,[k,T]))}if(N.viewOnly)for(const _ of $)E(_,s,[k,void 0])},n=>{E(this,s,n),n[1]&&n[1]!==this&&E(n[1],s,[be.rev,this])})}print(){return super.print({pre:`&lt;${b(this,e)?"/":""}${b(this,t)}`,post:`${this.selfClosing?"/":""}&gt;`})}json(n,l=this.getAbsoluteIndex()){{const o=super.json(void 0,l);return o.closing=b(this,e),o}}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i)}}),Jr,ci,Xr,Qe,Du=I({"src/tag/tvar.ts"(){"use strict";pt(),Ma(),gt(),Jr=[Ye()],Qe=class extends(Xr=Qn){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)}},ci=ae(Xr),Qe=re(ci,0,"TvarToken",Jr,Qe),ne(ci,1,Qe)}}),za,Gu=I({"src/tagPair/translate.ts"(){"use strict";var e,Ha,s;J(),Vn(),gt(),Du(),za=(s=class extends lt{constructor(r,n,l,o=[]){const u=new Ue(r,"translate-attr",l,o);n=n==null?void 0:n.replace(/<tvar(\|[^>]+)>([\s\S]*?)<\/>/gu,(d,c,f)=>(new Qe("tvar",c,!1,l,o),new Qe("","",!0,l,o),`\0${o.length-2}n${f}\0${o.length}n`)).replace(/<(tvar)(\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\3|[^"'\s>]+))?\s*)>([\s\S]*?)<\/(tvar)(\s*)>/giu,(d,c,f,g,y,$,k)=>(new Qe(c,f,!1,l,o),new Qe($,k,!0,l,o),`\0${o.length-2}n${y}\0${o.length}n`));const a=new z(n,l,o);a.type="translate-inner";super("translate",u,a,"translate",l,o);R(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">&lt;translate${j(this,e,Ha).call(this)?'<span class="wpb-ext-attrs"> <span class="wpb-ext-attr"><span class="wpb-attr-key">nowrap</span></span></span>':""}&gt;${this.lastChild.print({class:"ext-inner"})}&lt;/translate&gt;</span>`}},e=new WeakSet,Ha=function(){return this.firstChild.toString()===" nowrap"},s)}}),Kr,hi,Yr,Kt,Vu=I({"src/tagPair/include.ts"(){"use strict";Y(),ve(),pt(),G(),Vn(),Kr=[Ye(!1)],Kt=class extends(Yr=lt){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 ge(this,e),l=["no-ignored","unclosed-comment"],{lintConfig:o}=N,{computeEditInfo:u}=o,a=l.map(d=>o.getSeverity(d,"include"));if(a[0]&&s.data.trim()){const d=Q(s,n,l[0],"useless-attribute",a[0]);u&&(d.suggestions=[ee(d)]),t.push(d)}if(a[1]&&!i){const d=Z(this,n,l[1],N.msg("unclosed",`<${r}>`),a[1]);u&&(d.suggestions=[Xe(d.endIndex,`</${r}>`)]),t.push(d)}return t}}},hi=ae(Yr),Kt=re(hi,0,"IncludeToken",Kr,Kt),ne(hi,1,Kt)}}),Hs,Jn=I({"mixin/attributesParent.ts"(){"use strict";Hs=(e=0)=>t=>{var s,yn;{class r extends t{constructor(){super(...arguments);R(this,s)}hasAttr(o){return j(this,s,yn).call(this).hasAttr(o)}getAttr(o){return j(this,s,yn).call(this).getAttr(o)}}return s=new WeakSet,yn=function(){return this.childNodes[e]},r}}}}),he,gi,pi,Ut,ws,fi,Mt,mi,xi,vi,Ss,bi,yi,wi,Pe,Xn,Kn,Yn,Da,Ga=I({"util/sharable.ts"(){"use strict";he=new Set(["align"]),gi=new Set(["cite"]),pi=new Set(["cite","datetime"]),Ut=new Set(["width"]),ws=new Set(["axis","align","bgcolor","height","width","valign"]),fi=new Set([...ws,"abbr","headers","scope","rowspan","colspan"]),Mt=new Set(["type"]),mi=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),xi=new Set(["clear"]),vi=new Set(["bgcolor","align","valign"]),Ss=new Set(["qid","forcemathmode","type","display"]),bi=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),yi=new Set(["weight"]),wi=new Set(["width","height","zoom","latitude","longitude","align","mapstyle","lang","alt","text"]),Pe=new Set,Xn=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"]),Kn={div:he,h1:he,h2:he,h3:he,h4:he,h5:he,h6:he,blockquote:gi,q:gi,p:he,br:xi,pre:Ut,ins:pi,del:pi,ul:Mt,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...mi,"border"]),caption:he,tr:vi,td:fi,th:fi,font:new Set(["size","color","face"]),hr:Ut,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Mt,poem:he,categorytree:he,combooption:he,math:Pe,chem:Pe,ce:Pe,img:new Set(["alt","src","width","height","loading","srcset"])},Yn={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:Pe,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:yi,choicetemplate:yi,imagemap:Pe,inputbox:Pe,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:Pe,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([...Ss,"chem"]),chem:Ss,ce:Ss,hiero:Pe,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:bi,syntaxhighlight:bi,templatedata:Pe,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:Pe,mapframe:new Set([...wi,"frameless"]),maplink:new Set([...wi,"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:mi,td:new Set([...ws,"scope"]),th:ws,br:xi,caption:he,div:he,hr:Ut,h1:he,h2:he,h3:he,h4:he,h5:he,h6:he,li:Mt,p:he,pre:Ut,tr:vi,ul:Mt}}}),Zr,el,tl,sl,Ls,Qu=I({"src/attribute.ts"(){"use strict";var e,t,s,i,r,Va,wn,o;Y(),me(),Me(),Ga(),ve(),G(),J(),ht(),Zr=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,el=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,tl=new Set(["ext","arg","magic-word","template"]),sl=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),Ls=(o=class extends z{constructor(a,d,c,f="",g,y=[],$=N.getConfig(),k=[]){const _=new qe(c,"attr-key",$,k);let T;if(c==="title"||d==="img"&&c==="alt")T=new z(g,$,k,{}),T.type="attr-value",T.setAttribute("stage",ke-1);else if(d==="gallery"&&c==="caption"||d==="ref"&&c==="details"||(d==="mapframe"||d==="maplink")&&c==="text"||d==="choose"&&(c==="before"||c==="after")){const p={...$,excludes:[...$.excludes,"heading","html","table","hr","list"]};T=new z(g,p,k,{}),T.type="attr-value",T.setAttribute("stage",1)}else T=new qe(g,"attr-value",$,k,{});super(void 0,$,k);R(this,r);R(this,e);R(this,t);R(this,s);R(this,i);E(this,e,a),this.append(_,T),E(this,s,f),E(this,i,[...y]),E(this,t,d),this.setAttribute("name",Lt(Ce(c)))}get type(){return b(this,e)}get tag(){return b(this,t)}get balanced(){return!b(this,s)||b(this,i)[0]===b(this,i)[1]}afterBuild(){b(this,s).includes("\0")&&E(this,s,this.buildFromStr(b(this,s),0)),this.parentNode&&E(this,t,this.parentNode.name),j(this,r,Va).call(this),super.afterBuild()}toString(a){const[d="",c=""]=b(this,i);return b(this,s)?super.toString(a,b(this,s)+d)+c:this.firstChild.toString(a)}text(){return b(this,s)?`${super.text(`${b(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var a,d;return b(this,s)?b(this,s).length+((d=(a=b(this,i)[0])==null?void 0:a.length)!=null?d:0):0}lint(a=this.getAbsoluteIndex(),d){var c;{const f=super.lint(a,d),{balanced:g,firstChild:y,lastChild:$,name:k,tag:_}=this,T=new ge(this,a),p=["unclosed-quote","obsolete-attr"],{lintConfig:h}=N,m=p.map(S=>h.getSeverity(S,k));if(m[0]&&!g){const S=Q($,T,p[0],"unclosed-quotes",m[0]);S.startIndex--,S.startCol--,h.computeEditInfo&&(S.suggestions=[Xe(S.endIndex,b(this,i)[0])]),f.push(S)}const x=j(this,r,wn).call(this,a,T);return x&&f.push(x),m[1]&&((c=Da[_])!=null&&c.has(k))&&f.push(Q(y,T,p[1],"obsolete-attribute",m[1])),f}}getValue(){return b(this,s)?this.lastChild.text().trim():this.type==="ext-attr"||""}escape(){this.type!=="ext-attr"&&(E(this,s,"{{=}}"),this.lastChild.escape())}getAttribute(a){return a==="invalid"?j(this,r,wn).call(this):super.getAttribute(a)}print(){const[a="",d=""]=b(this,i);return b(this,s)?super.print({sep:ds(b(this,s))+a,post:d}):super.print()}json(a,d=this.getAbsoluteIndex()){{const c=super.json(void 0,d);return c.tag=this.tag,c}}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakSet,Va=function(){this.setAttribute("name",Lt(this.firstChild.text()))},wn=function(a,d){const{firstChild:c,lastChild:f,type:g,name:y,tag:$,parentNode:k}=this,_=!f.childNodes.some(({type:w})=>tl.has(w)),T=this.getValue(),p=Yn[$],h=Kn[$],{length:m}=this.toString();let x="illegal-attr",S,v;if({lintConfig:S}=N,{computeEditInfo:v}=S,!(p!=null&&p.has(y))&&!(h!=null&&h.has(y))&&(g==="ext-attr"?p||h:!/\{\{[^{]+\}\}/u.test(y))&&(g==="ext-attr"&&!h||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(y)&&($==="meta"||$==="link"||!Xn.has(y)))||(y==="itemtype"||y==="itemid"||y==="itemref")&&!(k!=null&&k.hasAttr("itemscope"))){if(a===void 0)return!0;{const w=S.getSeverity(x,"unknown");if(w){const A=Q(c,d,x,"illegal-attribute-name",w);return v&&(A.suggestions=[ee(a,m)]),A}}}else if(y==="style"&&typeof T=="string"&&Zr.test(T)){if(a===void 0)return!0;{x="insecure-style";const w=S.getSeverity(x);return w&&Q(f,d,x,"insecure-style",w)}}else if(y==="tabindex"&&typeof T=="string"&&T!=="0"){if(a===void 0)return!0;{const w=S.getSeverity(x,"tabindex");if(w){const A=Q(f,d,x,"nonzero-tabindex",w);return v&&(A.suggestions=[ee(a,m),Oe(A,"0 tabindex","0")]),A}}}else if(typeof T=="string"&&((/^xmlns:[\w:.-]+$/u.test(y)||sl.has(y))&&el.test(T)||_&&(y==="href"||$==="img"&&y==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(T))){if(a===void 0)return!0;{const w=S.getSeverity(x,"value");return w&&Q(f,d,x,"illegal-attribute-value",w)}}else if(_&&g!=="ext-attr"){const w=Hn($,y),A=String(T).toLowerCase();if(w.length>0&&w.every(C=>C!==A)){if(a===void 0)return!0;{const C=S.getSeverity(x,"value");return C&&Q(f,d,x,"illegal-attribute-value",C)}}}return!1},o)}}),Si,il,nl,Ds,Zn=I({"src/attributes.ts"(){"use strict";var e,t,Fs,i;Y(),me(),ve(),G(),J(),ht(),Qu(),Si=r=>r.slice(0,-1),il=r=>`${Si(r)}-dirty`,nl=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch{return/[^\W_]/u}})(),Ds=(i=class extends z{constructor(n,l,o,u,a=[]){super(void 0,u,a,{});R(this,t);R(this,e);if(E(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 c="",f=d.exec(n),g=0;const y=(()=>{c&&(super.insertAt(new qe(c,il(l),u,a,{})),c="")});for(;f;){const{index:$,0:k,1:_,2:T,3:p,4:h,5:m,6:x}=f;if(c+=n.slice(g,$),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(Ce(_).trim())){const S=h!=null?h:x,v=[p,m],w=new Ls(Si(l),o,_,T,S,v,u,a);y(),super.insertAt(w)}else c+=k;({lastIndex:g}=d),f=d.exec(n)}c+=n.slice(g),y()}}get type(){return b(this,e)}afterBuild(){const{parentNode:n}=this;n!=null&&n.is("td")&&this.setAttribute("name",n.subtype),super.afterBuild()}getAttrTokens(n){return this.childNodes.filter(l=>l instanceof Ls&&(!n||l.name===Lt(n)))}hasAttr(n){return this.getAttrTokens(n).length>0}getAttrToken(n){{const l=this.getAttrTokens(n);return l[l.length-1]}}getAttr(n){var l;return(l=this.getAttrToken(n))==null?void 0:l.getValue()}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),{parentNode:u,childNodes:a}=this,d=new Map,c=new Set,f=new ge(this,n),g=["no-ignored","no-duplicate"],{lintConfig:y}=N,{computeEditInfo:$,fix:k}=y,_=["closingTag","invalidAttributes","nonWordAttributes"].map(p=>y.getSeverity(g[0],p));if(_[0]&&j(this,t,Fs).call(this)){const p=Z(this,f,g[0],"attributes-of-closing-tag",_[0]);if($){const h=u.getAbsoluteIndex();p.suggestions=[ee(p),Wn(h)]}o.push(p)}for(const p of a)if(p instanceof Ls){const{name:h}=p;d.has(h)?(c.add(h),d.get(h).push(p)):d.set(h,[p])}else{const h=p.text().trim(),m=_[nl.test(h)?1:2];if(h&&m){const x=Q(p,f,g[0],"invalid-attribute",m);$&&(x.suggestions=[ee(x,0," ")]),o.push(x)}}const T=y.getSeverity(g[1],"attribute");if(T&&c.size>0)for(const p of c){const h=d.get(p).map(m=>{const x=m.getValue();return[m,x===!0?"":x]});Array.prototype.push.apply(o,h.map(([m,x],S)=>{const v=Q(m,f,g[1],N.msg("duplicate-attribute",p),T);if($||k){const w=ee(v);!x||h.slice(0,S).some(([,A])=>A===x)?v.fix=w:$&&(v.suggestions=[w])}return v}))}return o}}getAttribute(n){return n==="invalid"?j(this,t,Fs).call(this):super.getAttribute(n)}print(){return this.toString()?`<span class="wpb-${this.type}${j(this,t,Fs).call(this)?" wpb-invalid":""}">${this.childNodes.map(n=>n.print(n instanceof qe?{class:n.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,Fs=function(){const{parentNode:n}=this;return(n==null?void 0:n.type)==="html"&&n.closing&&this.text().trim()!==""},i)}}),Qa={};le(Qa,{PreToken:()=>Ja});var Ja,Ju=I({"src/pre.ts"(){"use strict";Me(),J(),Rt(),Ja=class extends z{get type(){return"ext-inner"}constructor(e,t,s=[]){if(e){const i=/<nowiki>/giu,r=/<\/nowiki>/giu,{length:n}=i.source;let l=i.exec(e);l&&(r.lastIndex=l.index+n);let o=r.exec(e),u=0,a="";for(;l&&o;)new je(l[0],t,s,!0),new je(o[0],t,s,!0),a+=`${e.slice(u,l.index)}\0${s.length-1}n${e.slice(l.index+n,o.index)}\0${s.length}n`,u=o.index+n+1,i.lastIndex=u,l=i.exec(e),l&&(r.lastIndex=l.index+n),o=r.exec(e);e=a+e.slice(u)}super(e,t,s,{}),this.setAttribute("stage",ke-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),Gs,er=I({"src/multiLine/index.ts"(){"use strict";J(),Gs=class extends z{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:`
@@ -10,7 +10,7 @@
10
10
  `)||(e=`${e.slice(0,S)}\0${s.length}h${e.slice(h)}`,g=S+4+String(s.length).length,new At(O[1].length,O.slice(2),t,s)))}}else if(p==="|"||C)g=h+1,o(e,v,A,h),p==="|"&&v.push([]),m.pos=g,m.findEqual=p==="|",n.push(m);else if(p.startsWith("}}")){const B=p.slice(0,Math.min(x.length,3)),q=x.length-B.length,{length:O}=s;g=h+B.length,o(e,v,A,h);let W=!1,F="t";if(B.length===3){const P=v.map(M=>M.join("=")),U=P.length>1&&Ce(P[1]).trim();new Zt(P,t,s),U&&U.endsWith(":")&&r.includes(U.slice(0,-1).toLowerCase())&&(F="s")}else try{new rt(v[0][0],v.slice(1),t,s),F=Ni(v[0][0])}catch(P){if(P instanceof SyntaxError&&P.message==="Invalid template name")W=!0;else throw P}W||(e=`${e.slice(0,S+q)}\0${O}${F}${e.slice(g)}`,g=S+q+3+String(O).length,q>1?n.push({0:x.slice(0,q),index:S,pos:S+q,parts:[[]]}):q===1&&e[S-1]==="-"&&n.push({0:"-{",index:S-1,pos:S+1,parts:[[]]}))}else g=h+p.length,p.startsWith("{")&&(f.pos=g,f.parts=[[]]),n.push(..."0"in m?[m]:[],f);let L=n[n.length-1];if(d&&a+e.length<g)for(d=!1;(T=L==null?void 0:L[0])!=null&&T.startsWith("{");)n.pop(),L=n[n.length-1];c=Ii(i+(d?Ti:"")+(L?`|${cl[L[0][0]]}${L.findEqual?"|=":""}`:"")),c.lastIndex=g,f=c.exec(e)}return Ee(e,l)}}}),so={};le(so,{InputboxToken:()=>io});var io,Zu=I({"src/multiLine/inputbox.ts"(){"use strict";Qs(),sr(),G(),Ya(),io=class extends tr{constructor(e,t,s=N.getConfig(),i=[]){const r=Symbol("InputboxToken"),n=s.excludes.includes("heading")?s:{...s,excludes:[...s.excludes,"heading"]},{length:l}=i;i.push(r),t&&(t=xs(t,n,i,e)),t&&(t=Vs(t,n,i)),i.splice(l,1),super(e,t,n,i,{})}}}}),js={};le(js,{NestedToken:()=>no});var gl,pl,no,Li=I({"src/nested.ts"(){"use strict";var e,t,s;Y(),ve(),Qs(),sr(),G(),J(),$o(),Rt(),gl=new Set(["comment","include","arg","template","magic-word"]),pl=[!1,!0].map(i=>{const r=i?"includeonly":"noinclude";return new RegExp(String.raw`^(?:<${r}(?:\s[^>]*)?/?>|</${r}\s*>)$`,"iu")}),no=(s=class extends z{constructor(r,n,l,o,u=[]){if(typeof n=="boolean"){const a=Symbol("NestedToken"),{length:d}=u;u.push(a),r&&(r=xs(r,o,u,n)),r&&(r=Vs(r,o,u)),u.splice(d,1)}else r&&(r=r.replace(n,(a,d,c,f,g)=>{const y=`\0${u.length+1}e`;return new Tt(d,c,f,g,o,!1,u),y}));r&&(r=r.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(a,d,c)=>(new je(c,o,u),`${d}\0${u.length}n`)));super(r,o,u);R(this,e);R(this,t);E(this,e,[...l]),E(this,t,n)}get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex(),n){{const l=super.lint(r,n),o="no-ignored",{lintConfig:u}=N,a=u.getSeverity(o,this.name);if(!a)return l;const d=new ge(this,r),c=typeof b(this,t)=="boolean"?pl[b(this,t)?1:0]:/^<!--[\s\S]*-->$/u;return[...l,...this.childNodes.filter(f=>{const{type:g,name:y}=f;if(g==="ext")return!b(this,e).includes(y);if(gl.has(g))return!1;const $=f.toString().trim();return $&&!c.test($)}).map(f=>{const g=Q(f,d,o,N.msg("invalid-content",this.name),a);return u.computeEditInfo&&(g.suggestions=[ee(g),Un(g,f.toString())]),g})]}}},e=new WeakMap,t=new WeakMap,s)}});function fl(e,t,s,i,r){t=Ce(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(ro(s.protocol).test(n))return lo(s.protocol).test(n)&&t;n.startsWith("[[")&&n.endsWith("]]")&&(n=n.slice(2,-2))}else return t;const l=N.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 ro,lo,ml,xl,Os,vl,ao,ed=I({"src/imageParameter.ts"(){"use strict";var e,t,oo,r;Ke(),me(),Y(),Me(),Re(),G(),J(),ro=ot(n=>new RegExp(String.raw`^(?:${n}|//|\0\d+m\x7F)`,"iu")),lo=ot(n=>new RegExp(String.raw`^(?:(?:${n}|//)${It}|\0\d+m\x7F)${Nt}$`,"iu")),ml=ot(n=>new RegExp(String.raw`^(\s*(?!\s))${n.replace("$1","(.*)")}${n.endsWith("$1")?`(?=$|
11
11
  )`:""}(\s*)$`,"u")),xl=new Set(["alt","link","lang","page","caption"]),Os=new Set(["tiff","tif","png","gif","jpg","jpeg","webp","xcf","pdf","svg","djvu"]),vl=n=>{if(n)n.startsWith("//")&&(n=`https:${n}`);else return n;return new URL(n).href},ao=(r=class extends z{constructor(l,o,u,a){var n=(...i)=>(super(...i),R(this,t),R(this,e,""),this);let d;const c=Object.entries(u.img).map(([g,y])=>[g,y,ml(g)]),f=c.find(([,g,y])=>(d=y.exec(l),d&&(d.length!==4||fl(g,d[2],u,!0,o)!==!1)));if(f&&d){d.length===3?(n(void 0,u,a),E(this,e,l)):(n(d[2],u,a,{}),E(this,e,d[1]+f[0]+d[3])),this.setAttribute("name",f[1]),f[1]==="alt"&&this.setAttribute("stage",ke-1);return}n(l,u.excludes.includes("list")?u:{...u,excludes:[...u.excludes,"list"]},a),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get type(){return"image-parameter"}get thumb(){return this.name==="manualthumb"?this.normalizeTitle(`File:${super.text().trim()}`,6,{page:""}):void 0}get link(){{if(this.name!=="link")return;const l=super.text().trim();return be.run(()=>{const o=new z(l,this.getAttribute("config"));return o.parseOnce(0,this.getAttribute("include")).parseOnce(),/^\0\d+m\x7F/u.test(o.toString())?l:fl("link",l,this.getAttribute("config"))})}}afterBuild(){var l;(l=this.parentNode)!=null&&l.is("gallery-image")&&!xl.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(l){return b(this,e)?b(this,e).replace("$1",super.toString(l)):super.toString(l)}text(){return b(this,e)?b(this,e).replace("$1",super.text()).trim():super.text().trim()}isPlain(){return this.name==="caption"||this.name==="alt"}getAttribute(l){return l==="invalid"?this.name==="invalid":l==="padding"?Math.max(0,b(this,e).indexOf("$1")):super.getAttribute(l)}lint(l=this.getAbsoluteIndex(),o){{const u=super.lint(l,o),{lintConfig:a}=N,{computeEditInfo:d,fix:c}=a,{link:f,name:g}=this,y=g==="width"&&this.getValue();if(g==="invalid"||y&&y.endsWith("px")){const $="invalid-gallery",k=a.getSeverity($,"parameter");if(k){const _=Z(this,{start:l},$,"invalid-image-parameter",k);(d||c)&&(_.fix=y?ee(_,0,y):ee(_,-1)),u.push(_)}}else if(g==="link"){if(typeof f=="string"){const $="invalid-url",k=a.getSeverity($);if(k&&!this.querySelector("magic-word"))try{vl(f)}catch{u.push(Z(this,{start:l},$,"invalid-url",k))}}else if(f.encoded){const $="url-encoding",k=a.getSeverity($,"file");if(k){const _=Z(this,{start:l},$,"unnecessary-encoding",k);(d||c)&&(_.fix=qn(_,this)),u.push(_)}}}else if(g==="manualthumb"){const $="invalid-gallery",k=a.getSeverity($,"thumb");if(k&&!this.querySelector("arg,magic-word,template")){const{valid:_,ns:T,extension:p}=this.thumb;(!_||T!==6||!Os.has(p))&&u.push(Z(this,{start:l},$,"invalid-thumb",k))}}return u}}getValue(){return this.name==="invalid"?this.text():j(this,t,oo).call(this)||super.text()}print(){return b(this,e)?`<span class="wpb-image-parameter${this.name==="invalid"?" wpb-invalid":""}">${b(this,e).replace("$1",`<span class="wpb-image-caption">${Ft(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}},e=new WeakMap,t=new WeakSet,oo=function(){return b(this,e)&&!b(this,e).includes("$1")},r)}}),Fi,bl,yl,Ei,ji,wl,Ri,ir,uo=I({"src/link/file.ts"(){"use strict";Y(),ve(),G(),zs(),ed(),Fi=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),bl=new Set(["arg"]),yl=new Set(["template","magic-word"]),Ei=new Set(["left","right","center","none"]),ji=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),wl=e=>{if(e===void 0)return[];const t=/-\{|\}-|\|/gu,s=[];let i=t.exec(e),r=0,n=0;for(;i;){const{0:l,index:o}=i;l!=="|"?r+=l==="-{"?1:-1:r===0&&(s.push(e.slice(n,o)),{lastIndex:n}=t),i=t.exec(e)}return s.push(e.slice(n)),s},Ri=(e,t)=>e.filter(({childNodes:s})=>!s.some(i=>i.text().trim()&&t.has(i.type))),ir=class extends Ve{get type(){return"file"}get extension(){return this.getAttribute("title").extension}constructor(e,t,s,i=[],r="|"){super(e,void 0,s,i,r);const{extension:n}=this.getTitle(!0,!0);this.safeAppend(wl(t).map(l=>new ao(l,n,s,i)))}lint(e=this.getAbsoluteIndex(),t){var s;{const i=super.lint(e,t),r=Ri(this.getAllArgs(),bl),n=[...new Set(r.map(({name:x})=>x))],l=n.filter(x=>Fi.has(x)),o=n.filter(x=>Ei.has(x)),u=n.filter(x=>ji.has(x)),[a]=l,d=a==="framed"||a==="manualthumb",c=new ge(this,e),{lintConfig:f}=N,{computeEditInfo:g,fix:y}=f,{ns:$,extension:k}=this.getAttribute("title"),{firstChild:_}=this;let T="nested-link",p=f.getSeverity(T,"file");if(p&&Os.has(k)&&this.closest("ext-link-text")&&((s=this.getValue("link"))==null?void 0:s.trim())!==""){const x=Z(this,c,T,"link-in-extlink",p);if(g||y){const S=this.getArg("link");if(S){const v=e+S.getRelativeIndex();x.fix={desc:N.msg("delink"),range:[v,v+S.toString().length],text:"link="}}else x.fix=Ws(x.endIndex-2,"delink","|link=")}i.push(x)}if(T="invalid-gallery",p=f.getSeverity(T,"extension"),p&&$===6&&!k&&!_.querySelector("arg,magic-word,template")&&i.push(Z(this,c,T,"missing-extension",p)),p=f.getSeverity(T,"parameter"),p&&d)for(const x of r.filter(({name:S})=>S==="width")){const S=Q(x,c,T,"invalid-image-parameter",p);(g||y)&&(S.fix=ee(S,-1)),i.push(S)}if(r.length===n.length&&l.length<2&&o.length<2&&u.length<2)return i;T="no-duplicate";const h=["unknownImageParameter","imageParameter"].map(x=>f.getSeverity(T,x)),m=(x,S,v,w=!0)=>x.map(A=>{if(p=h[Number(typeof w=="function"?w(A):w)],!p)return!1;const C=Q(A,c,T,N.msg(`${S}-image-parameter`,v),p);return g&&(C.suggestions=[ee(C,-1)]),C}).filter(A=>A!==!1);for(const x of n){if(x==="invalid"||x==="width"&&d)continue;const S=x==="caption";let v=r.filter(({name:w})=>w===x);if(S&&(v=[...v.slice(0,-1).filter(w=>w.text()),...v.slice(-1)]),v.length>1){let w=!S||!k||Os.has(k);if(S&&w){const A=Ri(v,yl);w=A.length>1&&(C=>A.includes(C))}Array.prototype.push.apply(i,m(v,"duplicate",x,w))}}return l.length>1&&Array.prototype.push.apply(i,m(r.filter(({name:x})=>Fi.has(x)),"conflicting","frame")),o.length>1&&Array.prototype.push.apply(i,m(r.filter(({name:x})=>Ei.has(x)),"conflicting","horizontal-alignment")),u.length>1&&Array.prototype.push.apply(i,m(r.filter(({name:x})=>ji.has(x)),"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()){{const s=super.json(void 0,t),{extension:i}=this;return i&&(s.extension=i),s}}}}}),Sl,Pi,Al,kt,co=I({"src/link/galleryImage.ts"(){"use strict";var e,Sn,s;Y(),Me(),Ze(),G(),J(),uo(),Sl=[He("")],kt=(s=class extends(Al=ir){constructor(r,n,l,o,u=[]){let a;if(l!==void 0){const{length:d}=u;a=new z(l,o,u);for(let c=0;c<ke-1;c++)a.parseOnce();u.splice(d,1)}super(n,a==null?void 0:a.toString(),o,u);R(this,e);Ne(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),o="invalid-gallery",{lintConfig:u}=N,a=u.getSeverity(o,"image");if(a&&j(this,e,Sn).call(this)){const d=Z(this,{start:r},o,"invalid-gallery",a);u.computeEditInfo&&(d.suggestions=[Ws(r,"prefix","File:")]),l.push(d)}return l}}getAttribute(r){return r==="invalid"?j(this,e,Sn).call(this):super.getAttribute(r)}},e=new WeakSet,Sn=function(){const{ns:r}=this.getAttribute("title");return r!==6},s),Pi=ae(Al),kt=re(Pi,0,"GalleryImageToken",Sl,kt),ne(Pi,1,kt)}}),Bs,ho=I({"src/nowiki/commentLine.ts"(){"use strict";Rt(),Bs=class extends je{}}}),go={};le(go,{GalleryToken:()=>po});var po,td=I({"src/multiLine/gallery.ts"(){"use strict";var e,fo,An,i;Y(),G(),er(),co(),ho(),po=(i=class extends Gs{constructor(n,l,o=[]){var u;super(void 0,l,o,{});R(this,e);for(const a of(u=n==null?void 0:n.split(`
12
12
  `))!=null?u:[]){const d=/^([^|]+)(?:\|(.*))?/u.exec(a);if(!d){super.insertAt(a.trim()?new Bs(a,l,o):a);continue}const[,c,f]=d;j(this,e,fo).call(this,c)?super.insertAt(new kt("gallery",c,f,l,o)):super.insertAt(new Bs(a,l,o))}}get widths(){return j(this,e,An).call(this,"widths")}get heights(){return j(this,e,An).call(this,"heights")}lint(n=this.getAbsoluteIndex(),l){{const{top:o,left:u}=this.getRootNode().posFromIndex(n),a=[],d="no-ignored",{lintConfig:c}=N,f=["Image","NoImage","Comment"].map(g=>c.getSeverity(d,`gallery${g}`));for(let g=0;g<this.length;g++){const y=this.childNodes[g],$=y.toString(),{length:k}=$,_=$.trim(),{type:T}=y,p=o+g,h=g?0:u;if(y.setAttribute("aIndex",n),T==="noinclude"&&_&&!/^<!--.*-->$/u.test(_)){let[m]=f;if(_.startsWith("|")?[,m]=f:(_.startsWith("<!--")||_.endsWith("-->"))&&([,,m]=f),m){const x=n+k,S={rule:d,message:N.msg("invalid-content","gallery"),severity:m,startIndex:n,endIndex:x,startLine:p,endLine:p,startCol:h,endCol:h+k};c.computeEditInfo&&(S.suggestions=[ee(S),Un(S,$)]),a.push(S)}}else if(T!=="noinclude"&&T!=="text"){const m=y.lint(n,l);m.length>0&&Array.prototype.push.apply(a,m)}n+=k+1}return a}}json(n,l=this.getAbsoluteIndex()){{const o=super.json(void 0,l);return Object.assign(o,{widths:this.widths,heights:this.heights}),o}}},e=new WeakSet,fo=function(n){return this.normalizeTitle(n,6,{halfParsed:!0,temporary:!0,decode:!0,page:""}).valid},An=function(n){var l,o;{const u=(l=this.parentNode)==null?void 0:l.getAttr(n),a=typeof u=="string"&&((o=/^(\d+)\s*(?:px)?$/u.exec(u))==null?void 0:o[1]);return a&&Number(a)||120}},i)}}),nr,mo=I({"src/link/index.ts"(){"use strict";Ke(),Y(),G(),zs(),nr=class extends Ve{get type(){return"link"}get innerText(){return this.length>1?this.lastChild.text():cs(this.firstChild.text().replace(/^\s*:?/u,""))}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i="nested-link",{lintConfig:r}=N,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=Oe(l,"delink",this.innerText)),s.push(l)}return s}}}}}),kl,$l,ps,rr=I({"src/magicLink.ts"(){"use strict";var e,t,kn,i;Y(),me(),ve(),G(),J(),kl=String.raw`(?:[${Je}\t]|&nbsp;|&#0*160;|&#[xX]0*[aA]0;)`,$l=new RegExp(`${kl}+`,"gu"),ps=(i=class extends z{constructor(n,l="free-ext-link",o=N.getConfig(),u){super(n,o,u,{});R(this,t);R(this,e);E(this,e,l)}get type(){return b(this,e)}get innerText(){const n=new Map([["!","|"],["=","="]]);let l=ct(this.childNodes.map(o=>{const{type:u}=o,a=String(o.name);return u==="magic-word"&&n.has(a)?n.get(a):o}));return this.type==="magic-link"&&(l=l.replace($l," ")),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:_a(n).replace(/\n/gu,"%0A")}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),u=new ge(this,n),{lintConfig:a}=N,{type:d,childNodes:c}=this;if(d==="magic-link"){const $="invalid-isbn",k=a.getSeverity($);return k&&j(this,t,kn).call(this)&&o.push(Z(this,u,$,"invalid-isbn",k)),o}let f="invalid-url",g=a.getSeverity(f);if(g&&!this.querySelector("magic-word"))try{this.getUrl()}catch{o.push(Z(this,u,f,"invalid-url",g))}const y=d==="ext-link-url";if(f="unterminated-url",g=a.getSeverity(f,y?"pipe":"punctuation"),g){const $=y?/\|/u:/[,;。:!?()]+/u,k=c.find(_=>_.type==="text"&&$.test(_.data));if(k){const{data:_}=k,T=Q(k,u,f,N.msg("in-url",y?'"|"':"full-width-punctuation"),g);if(a.computeEditInfo){const{index:p,0:h}=$.exec(_),m=T.startIndex+p;T.suggestions=y?[gs(m,1)]:[gs(m),{desc:N.msg("encode"),range:[m,m+h.length],text:encodeURI(h)}]}o.push(T)}}return o}}getUrl(n){{const{type:l}=this;let{link:o}=this;if(l==="magic-link"){if(o.startsWith("ISBN"))return this.normalizeTitle(`BookSources/${o.slice(5)}`,-1,{temporary:!0}).getUrl(n);o=o.startsWith("RFC")?`https://datatracker.ietf.org/doc/html/rfc${o.slice(4)}`:`https://pubmed.ncbi.nlm.nih.gov/${o.slice(5)}`}else o.startsWith("//")&&(o=`https:${o}`);return new URL(o)}this.lspError("MagicLinkToken.getUrl")}getAttribute(n){return n==="invalid"?j(this,t,kn).call(this):super.getAttribute(n)}},e=new WeakMap,t=new WeakSet,kn=function(){if(this.type==="magic-link"){const{link:n}=this;if(n.startsWith("ISBN")){const l=[...n.slice(5)].map(o=>o==="X"?10:Number(o));return l.length===10?l.reduce((o,u,a)=>o+u*(10-a),0)%11!==0:l.length===13&&(l[12]===10||l.reduce((o,u,a)=>o+u*(a%2?3:1),0)%10!==0)}}return!1},i)}}),_l,Oi,Tl,$t,xo=I({"src/extLink.ts"(){"use strict";var e,t;Me(),Y(),Ze(),G(),J(),rr(),_l=[He("[")],$t=(t=class extends(Tl=z){constructor(i,r="",n="",l,o=[]){super(void 0,l,o,{});R(this,e);const u=i&&/^\0\d+f\x7F$/u.test(i)?o[Number(i.slice(1,-2))]:new ps(i,"ext-link-url",l,o);if(this.insertAt(u),E(this,e,r),n){const a=new z(n,l,o,{});a.type="ext-link-text",a.setAttribute("stage",ke-1),this.insertAt(a)}}get type(){return"ext-link"}toString(i){return this.length===1?`[${super.toString(i)}${b(this,e)}]`:`[${super.toString(i,b(this,e))}]`}text(){return`[${super.text(" ")}]`}getGaps(){return b(this,e).length}lint(i=this.getAbsoluteIndex(),r){{const n=super.lint(i,r),l="var-anchor",o=N.lintConfig.getSeverity(l,"extLink");return o&&this.length===1&&this.closest("heading-title")&&n.push(Z(this,{start:i},l,"variable-anchor",o)),n}}print(){return super.print(this.length===1?{pre:"[",post:`${b(this,e)}]`}:{pre:"[",sep:b(this,e),post:"]"})}},e=new WeakMap,t),Oi=ae(Tl),$t=re(Oi,0,"ExtLinkToken",_l,$t),ne(Oi,1,$t)}}),$n,sd=I({"src/imagemapLink.ts"(){"use strict";J(),Rt(),mo(),xo(),$n=class extends z{get type(){return"imagemap-link"}constructor(e,t,s,i,r=[]){super(void 0,i,r),this.append(e,t.length===2?new nr(...t,i,r):new $t(...t,i,r),new je(s,i,r))}}}}),vo={};le(vo,{ImagemapToken:()=>bo});var bo,id=I({"src/multiLine/imagemap.ts"(){"use strict";Y(),Re(),ve(),G(),er(),ho(),co(),sd(),bo=class extends Gs{get image(){return this.childNodes.find(Js("imagemap-image"))}constructor(e,t=N.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 o of i){const u=o.trim();if(!(l||!u||u.startsWith("#"))){if(n){const a=o.indexOf("|"),d=a===-1?o:o.slice(0,a),{valid:c,ns:f}=this.normalizeTitle(d,0,{halfParsed:!0,temporary:!0,page:""});if(c&&f===6){const g=new kt("imagemap",d,a===-1?void 0:o.slice(a+1),t,s);super.insertAt(g),n=!1;continue}else l=!0}else if(o.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(o);continue}else if(o.includes("[")){const a=o.indexOf("["),d=o.slice(a),c=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(d);if(c){if(this.normalizeTitle(c[1],0,{halfParsed:!0,temporary:!0,selfLink:!0,page:""}).valid){super.insertAt(new $n(o.slice(0,a),c.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 f=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(d);if(f){super.insertAt(new $n(o.slice(0,a),f.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 ge(this,e),{childNodes:r,image:n}=this,l="invalid-imagemap",{lintConfig:o}=N,u=o.getSeverity(l,n?"link":"image");return u&&(n?Array.prototype.push.apply(s,r.filter(a=>{const d=a.toString().trim();return a.is("noinclude")&&d&&!d.startsWith("#")}).map(a=>{const d=Q(a,i,l,"invalid-imagemap-link",u);return o.computeEditInfo&&(d.suggestions=[ee(d,-1),Oe(d,"comment","# ")]),d})):s.push(Z(this,i,l,"imagemap-without-image",u))),s}}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}}}}),Cl,Bi,Il,_t,yo=I({"src/nowiki/comment.ts"(){"use strict";Y(),pt(),Ze(),G(),ft(),Cl=[Ye(!1),He("<!--")],_t=class extends(Il=Be){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}=N,r=i.getSeverity(s);if(!r)return[];const n=Z(this,{start:t},s,"unclosed-comment",r);return i.computeEditInfo&&(n.suggestions=[Xe(n.endIndex,"-->")]),[n]}}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"&lt;!--",post:this.closed?"--&gt;":""})}},Bi=ae(Il),_t=re(Bi,0,"CommentToken",Cl,_t),ne(Bi,1,_t)}}),wo={};le(wo,{CommentedToken:()=>So});var So,nd=I({"src/commented.ts"(){"use strict";J(),yo(),So=class extends z{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 _t(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"))}}}}),Ao={};le(Ao,{NowikiToken:()=>ko});var Nl,Ll,ko,rd=I({"src/nowiki/index.ts"(){"use strict";var e,_n,s;Ke(),Y(),G(),ft(),Nl=ot(i=>new RegExp(String.raw`<\s*(?:/\s*)${i==="nowiki"?"":"?"}(${i})\b`,"giu")),Ll=new Set(["languages","section","templatestyles"]),ko=(s=class extends Be{constructor(){super(...arguments);R(this,e)}get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex()){{const{name:n}=this,{lintConfig:l}=N;let o="void-ext",u=l.getSeverity(o,n);if(u&&j(this,e,_n).call(this)){const d=Z(this,{start:r},o,N.msg("nothing-in",n),u);return l.computeEditInfo&&(d.suggestions=[ee(d)]),[d]}return super.lint(r,Nl(n))}}getAttribute(r){return r==="invalid"?j(this,e,_n).call(this):super.getAttribute(r)}},e=new WeakSet,_n=function(){const{name:r,firstChild:{data:n}}=this;return Ll.has(r)&&!!n},s)}}),Fl,qi,El,Tt,$o=I({"src/tagPair/ext.ts"(){"use strict";Y(),ve(),G(),Jn(),J(),Vn(),Zn(),Fl=[Hs()],Tt=class extends(El=lt){get type(){return"ext"}constructor(e,t,s,i,r=N.getConfig(),n=!1,l=[]){const o=e.toLowerCase(),u=new Ds(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",o,r,l),a={...r,ext:r.ext.filter(c=>c!==o),excludes:[...r.excludes],inExt:!0};let d;switch(o){case"tab":a.ext=a.ext.filter(c=>c!=="tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":o==="poem"&&a.excludes.push("heading"),d=new z(s,a,l);break;case"pre":{const{PreToken:c}=(Ju(),se(Qa));d=new c(s,a,l);break}case"dynamicpagelist":{const{ParamTagToken:c}=(Ya(),se(Ka));d=new c(n,s,a,l);break}case"inputbox":{const{InputboxToken:c}=(Zu(),se(so));d=new c(n,s,a,l);break}case"references":{const{NestedToken:c}=(Li(),se(js));a.excludes.push("heading"),d=new c(s,n,["ref"],a,l);break}case"choose":{const{NestedToken:c}=(Li(),se(js));d=new c(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],a,l);break}case"combobox":{const{NestedToken:c}=(Li(),se(js));d=new c(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],a,l);break}case"gallery":{const{GalleryToken:c}=(td(),se(go));d=new c(s,a,l);break}case"imagemap":{const{ImagemapToken:c}=(id(),se(vo));d=new c(s,a,l);break}case"hiero":{const{CommentedToken:c}=(nd(),se(wo));d=new c(s,a,l);break}default:{const{NowikiToken:c}=(rd(),se(Ao));d=new c(s,a,l)}}d.setAttribute("name",o),d.type==="plain"&&(d.type="ext-inner"),super(e,u,d,i,r,l),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),{lintConfig:i}=N,r=new ge(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(Z(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(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}}},qi=ae(El),Tt=re(qi,0,"ExtToken",Fl,Tt),ne(qi,1,Tt)}}),_o={};le(_o,{parseCommentAndExt:()=>xs});var Wi,jl,ks,Rl,Ui,xs,Qs=I({"parser/commentAndExt.ts"(){"use strict";Ke(),me(),Hu(),Rt(),Gu(),Vu(),$o(),yo(),Wi="<onlyinclude>",jl="</onlyinclude>",{length:ks}=Wi,Rl=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",s=e?"noinclude":"includeonly";return ot(i=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${i})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(${"\\1"}\s*)>)|<(${s})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${s}\s*)>|$))`,"giu"))}),Ui=e=>{const t=e.indexOf(Wi);return{i:t,j:e.indexOf(jl,t+ks)}},xs=(e,t,s,i)=>{if(i){let{i:u,j:a}=Ui(e);if(u!==-1&&a!==-1){let d="";const c=f=>{new je(f,t,s),d+=`\0${s.length-1}n`};for(;u!==-1&&a!==-1;){const f=`\0${s.length}e`;new Xt(e.slice(u+ks,a),t,s),u>0&&c(e.slice(0,u)),d+=f,e=e.slice(a+ks+1),{i:u,j:a}=Ui(e)}return e&&c(e),d}}const{ext:r}=t;let n=r,l=t;if(r.includes("translate")){n=r.filter(a=>a!=="translate"&&a!=="tvar"),l={...t,ext:n};const u=[];e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,a=>(u.push(a),`\0${u.length-1}`)).replace(/<translate( nowrap)?>([\s\S]+?)?<\/translate>/gu,(a,d,c)=>{const f=s.length;return new za(d,c&&Ee(c,u),l,s),`\0${f}g`}),e=Ee(e,u)}const o=Rl[i?1:0](n.join("|"));return o.lastIndex=0,o.test(e)?e.replace(o,(u,a,d,c,f,g,y,$,k)=>{const _=s.length;let T="n";if(a)T="e",new Tt(a,d,c,f,l,g,s);else if(u.startsWith("<!--")){T="c";const p=u.endsWith("-->");new _t(Ee(u,s,1).slice(4,p?-3:void 0),p,t,s)}else g?new Kt(g,y&&Ee(y,s,1),$&&Ee($,s,1),k,t,s):new je(u,t,s,!0);return`\0${_}${T}`}):e}}}),Pl,Ol,Bl,ql,Mi,Wl,es,ld=I({"src/tag/html.ts"(){"use strict";var e,t;Y(),ve(),Jn(),G(),Ma(),Pl=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),Ol=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"]),Bl=new Set(["strike","big","center","font","tt"]),ql=[Hs()],es=(t=class extends(Wl=Qn){constructor(i,r,n,l,o,u){super(i,r,n,o,u);R(this,e);this.setAttribute("name",i.toLowerCase()),E(this,e,l)}get type(){return"html"}get selfClosing(){return b(this,e)}text(){const{closing:i,selfClosing:r,name:n}=this,{html:[,,l]}=this.getAttribute("config");return l.includes(n)?i&&n!=="br"?"":super.text("/"):super.text(r&&!i?"/":"")}lint(i=this.getAbsoluteIndex(),r){var n;{const l=super.lint(i,r),{name:o,parentNode:u,closing:a,selfClosing:d}=this,c=new ge(this,i),{lintConfig:f}=N,{computeEditInfo:g,fix:y}=f,$=this.inTableAttrs();let k="h1",_=f.getSeverity(k,"html");if(_&&o==="h1"&&!a){const S=Z(this,c,k,"<h1>",_);g&&(S.suggestions=[{desc:"h2",range:[i+2,i+3],text:"2"}]),l.push(S)}if(k="parsing-order",_=$&&f.getSeverity(k,$===2?"html":"templateInTable"),_){const S=Z(this,c,k,"html-in-table",_);g&&$===2&&(S.suggestions=[ee(S)]),l.push(S)}if(k="obsolete-tag",_=f.getSeverity(k,o),_&&Bl.has(o)&&l.push(Z(this,c,k,"obsolete-tag",_)),k="bold-header",_=f.getSeverity(k,o),_&&(o==="b"||o==="strong")&&((n=this.closest("heading-title,ext"))==null?void 0:n.type)==="heading-title"){const S=Z(this,c,k,"bold-in-header",_);g&&(S.suggestions=[ee(S)]),l.push(S)}const{html:[,T,p]}=this.getAttribute("config"),h=p.includes(o),m=T.includes(o),x=!h&&!m;if(k="unmatched-tag",a&&(d||h)||d&&x){if(_=f.getSeverity(k,a?"both":"selfClosing"),_){const S=Z(this,c,k,a?"closing-and-self-closing":"invalid-self-closing",_);if(g||y){const v=Wn(i),w={desc:N.msg("no-self-closing"),range:[S.endIndex-2,S.endIndex-1],text:""};m?g&&(S.suggestions=[v,w]):a?S.fix=h?v:w:g&&(S.suggestions=[w,Xe(S.endIndex,`></${o}>`,-2)])}l.push(S)}}else if(!this.findMatchingTag()){const S=Z(this,c,k,a?"unmatched-closing":"unclosed-tag"),v=this.closest("magic-word");if(v&&Pl.has(v.name))_=f.getSeverity(k,"conditional");else if(a)_=f.getSeverity(k,"closing"),S.suggestions=[ee(S)];else{_=f.getSeverity(k,"opening");const w=u==null?void 0:u.childNodes;Ol.has(o)&&(w!=null&&w.slice(0,w.indexOf(this)).some(A=>A.is("html")&&A.name===o&&!A.findMatchingTag())&&(S.suggestions=[Xe(i+1,"/")]),this.closest("heading-title")&&(S.rule="format-leakage",_=f.getSeverity("format-leakage",o)))}_&&(S.severity=_,l.push(S))}return l}}getAttribute(i){return i==="invalid"?this.inTableAttrs()===2:super.getAttribute(i)}json(i,r=this.getAbsoluteIndex()){{const n=super.json(void 0,r);return n.selfClosing=b(this,e),n}}},e=new WeakMap,t),Mi=ae(Wl),es=re(Mi,0,"HtmlToken",ql,es),ne(Mi,1,es)}}),To={};le(To,{parseHtml:()=>Co});var Ul,Co,ad=I({"parser/html.ts"(){"use strict";Zn(),ld(),Ul=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,Co=(e,t,s)=>{var l;const{html:i}=t;(l=t.htmlElements)!=null||(t.htmlElements=new Set([...i[0],...i[1],...i[2]]));const r=e.split("<");let n=r.shift();for(const o of r){const u=Ul.exec(o),a=u==null?void 0:u[2],d=a==null?void 0:a.toLowerCase();if(!u||!t.htmlElements.has(d)){n+=`<${o}`;continue}const[,c,,f="",g,y]=u,{length:$}=s,k=new Ds(f,"html-attrs",d,t,s),_=k.hasAttr("itemprop");if(d==="meta"&&!(_&&k.hasAttr("content"))||d==="link"&&!(_&&k.hasAttr("href"))){n+=`<${o}`,s.length=$;continue}n+=`\0${s.length}x${y}`,new es(a,k,c==="/",g==="/>",t,s)}return n}}}),Ml,zl,zi,Hl,Ct,Io=I({"src/table/base.ts"(){"use strict";Jn(),G(),J(),gt(),Zn(),Ml=e=>{const t=e.childNodes.map(i=>i.type==="text"?i.data.replace(/\|\|/gu,"{{!!}}").replace(/\|/gu,"{{!}}"):i.toString()).join(""),{childNodes:s}=N.parseWithRef(t,e,2);e.safeReplaceChildren(s)},zl=[Hs(1)],Ct=class extends(Hl=z){constructor(e,t,s,i,r,n=[],l){super(void 0,r,n,l),this.append(new Ue(t,"table-syntax",r,n),new Ds(i,"table-attrs",s,r,n))}escape(){for(const e of this.childNodes)e instanceof Ue?Ml(e):e.escape()}},zi=ae(Hl),Ct=re(zi,0,"TableBaseToken",zl,Ct),ne(zi,1,Ct)}}),Dl,Hi,$e,$s,zt,Ht,qs,No=I({"src/table/td.ts"(){"use strict";Y(),ve(),Gn(),G(),J(),Io(),qs=class extends(Hi=Ct,Dl=[Us(!1)],Hi){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),ne($s,5,this),Ge(this,zt),Ge(this,$e,""),r&&([Lu(this,$e)._]=r);const l=new z(t==null?void 0:t.slice(((o=r==null?void 0:r.index)!=null?o:NaN)+fe(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 pn(this,zt,Ht).call(this).subtype}afterBuild(){fe(this,$e).includes("\0")&&Te(this,$e,this.buildFromStr(fe(this,$e),0)),super.afterBuild()}toString(e){const{childNodes:[t,s,i]}=this;return t.toString(e)+s.toString(e)+fe(this,$e)+i.toString(e)}text(){const{childNodes:[e,t,s]}=this;return e.text()+t.text()+fe(this,$e)+s.text()}getGaps(e){return e===1?fe(this,$e).length:0}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new ge(this,e+this.getRelativeIndex(this.length-1)),r="pipe-like",{lintConfig:n}=N,{computeEditInfo:l,fix:o}=n,u=["td","double"].map(a=>n.getSeverity(r,a));for(const a of this.lastChild.childNodes)if(a.type==="text"){const{data:d}=a;if(d.includes("|")){const c=d.includes("||"),f=u[c?1:0];if(f){const g=Q(a,i,r,"pipe-in-table",f);if(l||o)if(c){const y={caption:"|+",td:"|",th:"!"}[this.subtype];g.fix=Oe(g,"newline",d.replace(/\|\|/gu,`
13
+ `),r=new Set(t.protocol.split("|"));let n=!0,l=!1;for(const o of i){const u=o.trim();if(!(l||!u||u.startsWith("#"))){if(n){const a=o.indexOf("|"),d=a===-1?o:o.slice(0,a),{valid:c,ns:f}=this.normalizeTitle(d,0,{halfParsed:!0,temporary:!0,page:""});if(c&&f===6){const g=new kt("imagemap",d,a===-1?void 0:o.slice(a+1),t,s);super.insertAt(g),n=!1;continue}else l=!0}else if(o.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(o);continue}else if(o.includes("[")){const a=o.indexOf("["),d=o.slice(a),c=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(d);if(c){if(this.normalizeTitle(c[1],0,{halfParsed:!0,temporary:!0,selfLink:!0,page:""}).valid){super.insertAt(new $n(o.slice(0,a),c.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 f=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(d);if(f){super.insertAt(new $n(o.slice(0,a),f.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 ge(this,e),{childNodes:r,image:n}=this,l="invalid-imagemap",{lintConfig:o}=N,u=o.getSeverity(l,n?"link":"image");return u&&(n?Array.prototype.push.apply(s,r.filter(a=>{const d=a.toString().trim();return a.is("noinclude")&&d&&!d.startsWith("#")}).map(a=>{const d=Q(a,i,l,"invalid-imagemap-link",u);return o.computeEditInfo&&(d.suggestions=[ee(d,-1),Oe(d,"comment","# ")]),d})):s.push(Z(this,i,l,"imagemap-without-image",u))),s}}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}}}}),Cl,Bi,Il,_t,yo=I({"src/nowiki/comment.ts"(){"use strict";Y(),pt(),Ze(),G(),ft(),Cl=[Ye(!1),He("<!--")],_t=class extends(Il=Be){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}=N,r=i.getSeverity(s);if(!r)return[];const n=Z(this,{start:t},s,"unclosed-comment",r);return i.computeEditInfo&&(n.suggestions=[Xe(n.endIndex,"-->")]),[n]}}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"&lt;!--",post:this.closed?"--&gt;":""})}},Bi=ae(Il),_t=re(Bi,0,"CommentToken",Cl,_t),ne(Bi,1,_t)}}),wo={};le(wo,{CommentedToken:()=>So});var So,nd=I({"src/commented.ts"(){"use strict";J(),yo(),So=class extends z{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 _t(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"))}}}}),Ao={};le(Ao,{NowikiToken:()=>ko});var Nl,Ll,ko,rd=I({"src/nowiki/index.ts"(){"use strict";var e,_n,s;Ke(),Y(),G(),ft(),Nl=ot(i=>new RegExp(String.raw`<\s*(?:/\s*)${i==="nowiki"?"":"?"}(${i})\b`,"giu")),Ll=new Set(["languages","section","templatestyles"]),ko=(s=class extends Be{constructor(){super(...arguments);R(this,e)}get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex()){{const{name:n}=this,{lintConfig:l}=N;let o="void-ext",u=l.getSeverity(o,n);if(u&&j(this,e,_n).call(this)){const d=Z(this,{start:r},o,N.msg("nothing-in",n),u);return l.computeEditInfo&&(d.suggestions=[ee(d)]),[d]}return super.lint(r,Nl(n))}}getAttribute(r){return r==="invalid"?j(this,e,_n).call(this):super.getAttribute(r)}},e=new WeakSet,_n=function(){const{name:r,firstChild:{data:n}}=this;return Ll.has(r)&&!!n},s)}}),Fl,qi,El,Tt,$o=I({"src/tagPair/ext.ts"(){"use strict";Y(),ve(),G(),Jn(),J(),Vn(),Zn(),Fl=[Hs()],Tt=class extends(El=lt){get type(){return"ext"}constructor(e,t,s,i,r=N.getConfig(),n=!1,l=[]){const o=e.toLowerCase(),u=new Ds(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",o,r,l),a={...r,ext:r.ext.filter(c=>c!==o),excludes:[...r.excludes],inExt:!0};let d;switch(o){case"tab":a.ext=a.ext.filter(c=>c!=="tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":o==="poem"&&a.excludes.push("heading"),d=new z(s,a,l);break;case"pre":{const{PreToken:c}=(Ju(),se(Qa));d=new c(s,a,l);break}case"dynamicpagelist":{const{ParamTagToken:c}=(Ya(),se(Ka));d=new c(n,s,a,l);break}case"inputbox":{const{InputboxToken:c}=(Zu(),se(so));d=new c(n,s,a,l);break}case"references":{const{NestedToken:c}=(Li(),se(js));a.excludes.push("heading"),d=new c(s,n,["ref"],a,l);break}case"choose":{const{NestedToken:c}=(Li(),se(js));d=new c(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],a,l);break}case"combobox":{const{NestedToken:c}=(Li(),se(js));d=new c(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],a,l);break}case"gallery":{const{GalleryToken:c}=(td(),se(go));d=new c(s,a,l);break}case"imagemap":{const{ImagemapToken:c}=(id(),se(vo));d=new c(s,a,l);break}case"hiero":{const{CommentedToken:c}=(nd(),se(wo));d=new c(s,a,l);break}default:{const{NowikiToken:c}=(rd(),se(Ao));d=new c(s,a,l)}}d.setAttribute("name",o),d.type==="plain"&&(d.type="ext-inner"),super(e,u,d,i,r,l),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),{lintConfig:i}=N,r=new ge(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(Z(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(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}}},qi=ae(El),Tt=re(qi,0,"ExtToken",Fl,Tt),ne(qi,1,Tt)}}),_o={};le(_o,{parseCommentAndExt:()=>xs});var Wi,jl,ks,Rl,Ui,xs,Qs=I({"parser/commentAndExt.ts"(){"use strict";Ke(),me(),Hu(),Rt(),Gu(),Vu(),$o(),yo(),Wi="<onlyinclude>",jl="</onlyinclude>",{length:ks}=Wi,Rl=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",s=e?"noinclude":"includeonly";return ot(i=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${i})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(${"\\1"}\s*)>)|<(${s})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${s}\s*)>|$))`,"giu"))}),Ui=e=>{const t=e.indexOf(Wi);return{i:t,j:e.indexOf(jl,t+ks)}},xs=(e,t,s,i)=>{if(i){let{i:u,j:a}=Ui(e);if(u!==-1&&a!==-1){let d="";const c=f=>{new je(f,t,s),d+=`\0${s.length-1}n`};for(;u!==-1&&a!==-1;){const f=`\0${s.length}e`;new Xt(e.slice(u+ks,a),t,s),u>0&&c(e.slice(0,u)),d+=f,e=e.slice(a+ks+1),{i:u,j:a}=Ui(e)}return e&&c(e),d}}const{ext:r}=t;let n=r,l=t;if(r.includes("translate")){n=r.filter(a=>a!=="translate"&&a!=="tvar"),l={...t,ext:n};const u=[];e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,a=>(u.push(a),`\0${u.length-1}`)).replace(/<translate( nowrap)?>([\s\S]*?)<\/translate>/gu,(a,d,c)=>{const f=s.length;return new za(d,c&&Ee(c,u),l,s),`\0${f}g`}),e=Ee(e,u)}const o=Rl[i?1:0](n.join("|"));return o.lastIndex=0,o.test(e)?e.replace(o,(u,a,d,c,f,g,y,$,k)=>{const _=s.length;let T="n";if(a)T="e",new Tt(a,d,c,f,l,g,s);else if(u.startsWith("<!--")){T="c";const p=u.endsWith("-->");new _t(Ee(u,s,1).slice(4,p?-3:void 0),p,t,s)}else g?new Kt(g,y&&Ee(y,s,1),$&&Ee($,s,1),k,t,s):new je(u,t,s,!0);return`\0${_}${T}`}):e}}}),Pl,Ol,Bl,ql,Mi,Wl,es,ld=I({"src/tag/html.ts"(){"use strict";var e,t;Y(),ve(),Jn(),G(),Ma(),Pl=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),Ol=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"]),Bl=new Set(["strike","big","center","font","tt"]),ql=[Hs()],es=(t=class extends(Wl=Qn){constructor(i,r,n,l,o,u){super(i,r,n,o,u);R(this,e);this.setAttribute("name",i.toLowerCase()),E(this,e,l)}get type(){return"html"}get selfClosing(){return b(this,e)}text(){const{closing:i,selfClosing:r,name:n}=this,{html:[,,l]}=this.getAttribute("config");return l.includes(n)?i&&n!=="br"?"":super.text("/"):super.text(r&&!i?"/":"")}lint(i=this.getAbsoluteIndex(),r){var n;{const l=super.lint(i,r),{name:o,parentNode:u,closing:a,selfClosing:d}=this,c=new ge(this,i),{lintConfig:f}=N,{computeEditInfo:g,fix:y}=f,$=this.inTableAttrs();let k="h1",_=f.getSeverity(k,"html");if(_&&o==="h1"&&!a){const S=Z(this,c,k,"<h1>",_);g&&(S.suggestions=[{desc:"h2",range:[i+2,i+3],text:"2"}]),l.push(S)}if(k="parsing-order",_=$&&f.getSeverity(k,$===2?"html":"templateInTable"),_){const S=Z(this,c,k,"html-in-table",_);g&&$===2&&(S.suggestions=[ee(S)]),l.push(S)}if(k="obsolete-tag",_=f.getSeverity(k,o),_&&Bl.has(o)&&l.push(Z(this,c,k,"obsolete-tag",_)),k="bold-header",_=f.getSeverity(k,o),_&&(o==="b"||o==="strong")&&((n=this.closest("heading-title,ext"))==null?void 0:n.type)==="heading-title"){const S=Z(this,c,k,"bold-in-header",_);g&&(S.suggestions=[ee(S)]),l.push(S)}const{html:[,T,p]}=this.getAttribute("config"),h=p.includes(o),m=T.includes(o),x=!h&&!m;if(k="unmatched-tag",a&&(d||h)||d&&x){if(_=f.getSeverity(k,a?"both":"selfClosing"),_){const S=Z(this,c,k,a?"closing-and-self-closing":"invalid-self-closing",_);if(g||y){const v=Wn(i),w={desc:N.msg("no-self-closing"),range:[S.endIndex-2,S.endIndex-1],text:""};m?g&&(S.suggestions=[v,w]):a?S.fix=h?v:w:g&&(S.suggestions=[w,Xe(S.endIndex,`></${o}>`,-2)])}l.push(S)}}else if(!this.findMatchingTag()){const S=Z(this,c,k,a?"unmatched-closing":"unclosed-tag"),v=this.closest("magic-word");if(v&&Pl.has(v.name))_=f.getSeverity(k,"conditional");else if(a)_=f.getSeverity(k,"closing"),S.suggestions=[ee(S)];else{_=f.getSeverity(k,"opening");const w=u==null?void 0:u.childNodes;Ol.has(o)&&(w!=null&&w.slice(0,w.indexOf(this)).some(A=>A.is("html")&&A.name===o&&!A.findMatchingTag())&&(S.suggestions=[Xe(i+1,"/")]),this.closest("heading-title")&&(S.rule="format-leakage",_=f.getSeverity("format-leakage",o)))}_&&(S.severity=_,l.push(S))}return l}}getAttribute(i){return i==="invalid"?this.inTableAttrs()===2:super.getAttribute(i)}json(i,r=this.getAbsoluteIndex()){{const n=super.json(void 0,r);return n.selfClosing=b(this,e),n}}},e=new WeakMap,t),Mi=ae(Wl),es=re(Mi,0,"HtmlToken",ql,es),ne(Mi,1,es)}}),To={};le(To,{parseHtml:()=>Co});var Ul,Co,ad=I({"parser/html.ts"(){"use strict";Zn(),ld(),Ul=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,Co=(e,t,s)=>{var l;const{html:i}=t;(l=t.htmlElements)!=null||(t.htmlElements=new Set([...i[0],...i[1],...i[2]]));const r=e.split("<");let n=r.shift();for(const o of r){const u=Ul.exec(o),a=u==null?void 0:u[2],d=a==null?void 0:a.toLowerCase();if(!u||!t.htmlElements.has(d)){n+=`<${o}`;continue}const[,c,,f="",g,y]=u,{length:$}=s,k=new Ds(f,"html-attrs",d,t,s),_=k.hasAttr("itemprop");if(d==="meta"&&!(_&&k.hasAttr("content"))||d==="link"&&!(_&&k.hasAttr("href"))){n+=`<${o}`,s.length=$;continue}n+=`\0${s.length}x${y}`,new es(a,k,c==="/",g==="/>",t,s)}return n}}}),Ml,zl,zi,Hl,Ct,Io=I({"src/table/base.ts"(){"use strict";Jn(),G(),J(),gt(),Zn(),Ml=e=>{const t=e.childNodes.map(i=>i.type==="text"?i.data.replace(/\|\|/gu,"{{!!}}").replace(/\|/gu,"{{!}}"):i.toString()).join(""),{childNodes:s}=N.parseWithRef(t,e,2);e.safeReplaceChildren(s)},zl=[Hs(1)],Ct=class extends(Hl=z){constructor(e,t,s,i,r,n=[],l){super(void 0,r,n,l),this.append(new Ue(t,"table-syntax",r,n),new Ds(i,"table-attrs",s,r,n))}escape(){for(const e of this.childNodes)e instanceof Ue?Ml(e):e.escape()}},zi=ae(Hl),Ct=re(zi,0,"TableBaseToken",zl,Ct),ne(zi,1,Ct)}}),Dl,Hi,$e,$s,zt,Ht,qs,No=I({"src/table/td.ts"(){"use strict";Y(),ve(),Gn(),G(),J(),Io(),qs=class extends(Hi=Ct,Dl=[Us(!1)],Hi){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),ne($s,5,this),Ge(this,zt),Ge(this,$e,""),r&&([Lu(this,$e)._]=r);const l=new z(t==null?void 0:t.slice(((o=r==null?void 0:r.index)!=null?o:NaN)+fe(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 pn(this,zt,Ht).call(this).subtype}afterBuild(){fe(this,$e).includes("\0")&&Te(this,$e,this.buildFromStr(fe(this,$e),0)),super.afterBuild()}toString(e){const{childNodes:[t,s,i]}=this;return t.toString(e)+s.toString(e)+fe(this,$e)+i.toString(e)}text(){const{childNodes:[e,t,s]}=this;return e.text()+t.text()+fe(this,$e)+s.text()}getGaps(e){return e===1?fe(this,$e).length:0}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new ge(this,e+this.getRelativeIndex(this.length-1)),r="pipe-like",{lintConfig:n}=N,{computeEditInfo:l,fix:o}=n,u=["td","double"].map(a=>n.getSeverity(r,a));for(const a of this.lastChild.childNodes)if(a.type==="text"){const{data:d}=a;if(d.includes("|")){const c=d.includes("||"),f=u[c?1:0];if(f){const g=Q(a,i,r,"pipe-in-table",f);if(l||o)if(c){const y={caption:"|+",td:"|",th:"!"}[this.subtype];g.fix=Oe(g,"newline",d.replace(/\|\|/gu,`
14
14
  ${y}`))}else l&&(g.suggestions=[zn(g.startIndex,d)]);s.push(g)}}}return s}}isIndependent(){return this.firstChild.text().startsWith(`
15
15
  `)}getAttr(e){{const t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}}escape(){super.escape(),this.childNodes[1].toString()&&(fe(this,$e)||Te(this,$e,"{{!}}")),fe(this,$e)==="|"&&Te(this,$e,"{{!}}")}print(){const{childNodes:[e,t,s]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${fe(this,$e)}${s.print()}</span>`}json(e,t=this.getAbsoluteIndex()){{const s=super.json(void 0,t),{rowspan:i,colspan:r}=this;return Object.assign(s,{subtype:this.subtype},i!==1&&{rowspan:i},r!==1&&{colspan:r}),s}}},$s=ae(Hi),$e=new WeakMap,zt=new WeakSet,Ht=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{...pn(e=r,zt,Ht).call(e)}},Ht=re($s,17,"#getSyntax",Dl,zt,Ht),Pn($s,qs)}}),lr,Lo=I({"src/table/trBase.ts"(){"use strict";Y(),G(),Io(),No(),lr=class extends Ct{lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=this.childNodes.find(({type:o})=>o==="table-inter");if(!i)return s;const r=rs(i),n="fostered-content",l=r&&N.lintConfig.getSeverity(n,r===2?void 0:"transclusion");if(l){const o=Q(i,{start:e},n,"content-outside-table",l);o.startIndex++,o.startLine++,o.startCol=0,s.push(o)}return s}}getRowCount(){return Number(this.childNodes.some(e=>e instanceof qs&&e.isIndependent()&&!e.firstChild.text().endsWith("+")))}}}}),Gl,Vl,Ql,Jl,Di,_s,Rs,od=I({"src/table/index.ts"(){"use strict";Y(),Re(),ve(),Gn(),G(),Lo(),gt(),Gl=(e,t)=>new Array(e).fill(void 0).map((s,i)=>t(i)),Vl=({type:e})=>e==="tr"||e==="table-syntax",Ql=class extends Array{},Rs=class extends(Di=lr,Jl=[Us(!1)],Di){constructor(e,t,s,i){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,"table",t,s,i,{}),ne(_s,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 ge(this,e),r=["unclosed-table","table-layout"],n=r.map(l=>N.lintConfig.getSeverity(l));if(n[0]&&!this.closed&&s.push(Q(this.firstChild,i,r[0],"unclosed-table",n[0])),n[1]){const l=this.getLayout(),{length:o}=l;if(o>1){let u=1,a=1/0,d=0;for(;d<o;d++){const c=l[d],f=c.length;if(f<u)break;f<a&&(a=f);const g=c.indexOf(c[f-1])+1;if(g>a)break;g>u&&(u=g)}if(d<o){const c=this.getNthRow(d),f=Q(c,i,r[1],"inconsistent-table",n[1]);f.startIndex++,f.startLine++,f.startCol=0,s.push(f)}}}return s}}close(e=`
16
16
  |}`,t){be.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=Ql.from(Gl(s,()=>[]));for(let r=0;r<i.length;r++){const n=i[r];let l=0,o=0,u;for(const a of t[r].childNodes.slice(2))if(a.is("td")){if(a.isIndependent()&&(u=a.subtype!=="caption"),u){const d={row:r,column:l},{rowspan:c,colspan:f}=a;for(l++;n[o];)o++;for(let g=r;g<Math.min(r+c,s);g++)for(let y=o;y<o+f;y++)i[g][y]=d;o+=f}}else if(Vl(a))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()){{const s=super.json(void 0,t);return s.closed=this.closed,s}}},_s=ae(Di),re(_s,1,"getLayout",Jl,Rs),Pn(_s,Rs)}}),Fo,ud=I({"src/table/tr.ts"(){"use strict";Lo(),Fo=class extends lr{get type(){return"tr"}constructor(e,t,s,i){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,e,"tr",t,s,i)}}}}),ar,Eo=I({"src/nowiki/listBase.ts"(){"use strict";ft(),ar=class extends Be{get indent(){return this.innerText.split(":").length-1}json(e,t=this.getAbsoluteIndex()){{const s=super.json(void 0,t),{indent:i}=this;return i&&(s.indent=i),s}}}}}),or,jo=I({"src/nowiki/dd.ts"(){"use strict";Eo(),or=class extends ar{get type(){return"dd"}}}}),Ro={};le(Ro,{parseTable:()=>Po});var Xl,Gi,Po,dd=I({"parser/table.ts"(){"use strict";J(),od(),ud(),No(),jo(),Xl=e=>e.lastChild.constructor!==z,Gi=(e,t)=>e.is("td")?t.pop():e,Po=({firstChild:{data:e},type:t,name:s},i,r)=>{const n=[],l=e.split(`
@@ -22,7 +22,7 @@ ${d}`,u),n.push(u);continue}const[,$,k,_,T]=y;if($){for(;!u.is("table");)u=n.pop
22
22
  ${c}${$}`,!0),a(T,n[n.length-1])}else if(k){u=Gi(u,n),u.is("tr")&&(u=n.pop());const p=new Fo(`
23
23
  ${c}${k}`,T,i,r);n.push(u,p),u.insertAt(p)}else{u=Gi(u,n);const p=_==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu;let h=p.exec(T),m=0,x=`
24
24
  ${c}${_}`;const S=v=>{const w=new qs(x,T.slice(m,h==null?void 0:h.index),i,r);return v.insertAt(w),w};for(;h;)S(u),{lastIndex:m}=p,[x]=h,h=p.exec(T);n.push(u,S(u))}}return o.slice(1)}}}),at,Oo=I({"../cm-util/dist/index.mjs"(){"use strict";at=e=>!/^_{2}.+_{2}$/u.test(e)}}),Bo,cd=I({"src/nowiki/hr.ts"(){"use strict";ft(),Bo=class extends Be{get type(){return"hr"}}}}),Kl,Vi,Yl,ts,hd=I({"src/nowiki/doubleUnderscore.ts"(){"use strict";var e,t;pt(),Ze(),ft(),Kl=[Ye(),He("__")],ts=(t=class extends(Yl=Be){constructor(i,r,n,l,o){var c,f;super(i,l,o);R(this,e);const u=i.toLowerCase(),{doubleUnderscore:[,,a,d]}=l;this.setAttribute("name",(f=r?(c=d==null?void 0:d[i])==null?void 0:c.toLowerCase():a==null?void 0:a[u])!=null?f:u),E(this,e,n)}get type(){return"double-underscore"}toString(){const i=b(this,e)?"__":"__";return i+this.innerText+i}print(){const i=b(this,e)?"__":"__";return super.print({pre:i,post:i})}},e=new WeakMap,t),Vi=ae(Yl),ts=re(Vi,0,"DoubleUnderscoreToken",Kl,ts),ne(Vi,1,ts)}}),qo={};le(qo,{parseHrAndDoubleUnderscore:()=>Wo});var Wo,gd=I({"parser/hrAndDoubleUnderscore.ts"(){"use strict";Oo(),cd(),hd(),Za(),Wo=({firstChild:{data:e},type:t,name:s},i,r)=>{var a,d,c;const{doubleUnderscore:[n,l,o]}=i,u=[...n,...l];return(a=i.insensitiveDoubleUnderscore)!=null||(i.insensitiveDoubleUnderscore=new Set(n.filter(at))),(d=i.sensitiveDoubleUnderscore)!=null||(i.sensitiveDoubleUnderscore=new Set(l.filter(at))),(c=i.regexHrAndDoubleUnderscore)!=null||(i.regexHrAndDoubleUnderscore=new RegExp(`__(${u.filter(at).join("|")})__|_{2}(${u.filter(f=>!at(f)).map(f=>f.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,(f,g,y)=>(new Bo(y,i,r),`${g}\0${r.length-1}r`)).replace(i.regexHrAndDoubleUnderscore,(f,g,y)=>{var p;const $=g!=null?g:y,k=i.sensitiveDoubleUnderscore.has($),_=$.toLowerCase(),T=i.insensitiveDoubleUnderscore.has(_);return k||T?(new ts($,k,!!y,i,r),`\0${r.length-1}${T&&((p=o==null?void 0:o[_])!=null?p:_)==="toc"?"u":"n"}`):f}),i.excludes.includes("heading")||(e=e.replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(f,g,y,$,k)=>{const _=`${g}\0${r.length}h`;return new At(y.length,[$,k],i,r),_})),t==="root"||t==="ext-inner"&&s==="poem"?e:e.slice(1)}}}),Uo,pd=I({"src/nowiki/quote.ts"(){"use strict";var e,t;Y(),ve(),G(),ft(),Uo=(t=class extends Be{constructor(i,r,n,l){super(i,n,l);R(this,e);E(this,e,r)}get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}get closing(){return{...this.bold?{bold:b(this,e).bold}:void 0,...this.italic?{italic:b(this,e).italic}:void 0}}text(){const{parentNode:i,innerText:r}=this;return i!=null&&i.is("image-parameter")&&i.name!=="caption"?"":r}lint(i=this.getAbsoluteIndex()){var r;{const{previousSibling:n,bold:l,closing:o}=this,u=(n==null?void 0:n.type)==="text"?n.data:void 0,a=[],d=new ge(this,i),c=["lonely-apos","bold-header"],{lintConfig:f}=N,{computeEditInfo:g}=f,y=[void 0,"word"].map(k=>f.getSeverity(c[0],k)),$=f.getSeverity(c[1]);if(u!=null&&u.endsWith("'")){const k=y[(o.bold||o.italic)&&/[a-z\d]'$/iu.test(u)?1:0];if(k){const _=Z(this,d,c[0],N.msg("lonely","'"),k),{startLine:T,startCol:p}=_,[,{length:h}]=/(?:^|[^'])('+)$/u.exec(u),m=i-h,x={..._,startIndex:m,endIndex:i,endLine:T,startCol:p-h,endCol:p};g&&(x.suggestions=[Et(m,"&apos;",h),ee(x)]),a.push(x)}}if($&&l&&((r=this.closest("heading-title,ext"))==null?void 0:r.type)==="heading-title"){const k=Z(this,d,c[1],"bold-in-header",$);g&&(k.suggestions=[ee(k)]),a.push(k)}return a}}json(i,r=this.getAbsoluteIndex()){{const n=super.json(void 0,r);return Object.assign(n,{bold:this.bold,italic:this.italic}),n}}},e=new WeakMap,t)}}),Mo={};le(Mo,{parseQuotes:()=>ur});var ur,zo=I({"parser/quotes.ts"(){"use strict";pd(),ur=(e,t,s,i)=>{var g;const r=e.split(/('{2,})/u),{length:n}=r;if(n===1)return e;let l=0,o=0,u,a,d;for(let y=1;y<n;y+=2){const $=r[y].length;switch($){case 2:o++;break;case 4:r[y-1]+="'",r[y]="'''";case 3:if(l++,u!==void 0)break;r[y-1].endsWith(" ")?a===void 0&&d===void 0&&(d=y):r[y-1].slice(-2,-1)===" "?u=y:a!=null||(a=y);break;default:r[y-1]+="'".repeat($-5),r[y]="'''''",o++,l++}}if(o%2===1&&l%2===1){const y=(g=u!=null?u:a)!=null?g:d;y!==void 0&&(r[y]="''",r[y-1]+="'")}let c=!0,f=!0;for(let y=1;y<n;y+=2){const $=r[y].length,k=$!==2,_=$!==3;k&&(c=!c),_&&(f=!f),new Uo(r[y],{bold:k&&c,italic:_&&f},t,s),r[y]=`\0${s.length-1}q`}return r.join("")}}}),Ho={};le(Ho,{parseExternalLinks:()=>dr});var dr,Do=I({"parser/externalLinks.ts"(){"use strict";me(),xo(),rr(),dr=(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}|//)${It}|\0\d+m\x7F)${Nt}(?=[[\]<>"\t${Je}]|\0\d)))([${Je}]*(?![${Je}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),e.replace(t.regexExternalLinks,(n,l,o,u)=>{const{length:a}=s,d=/&[lg]t;/u.exec(l);return d&&(o="",u=l.slice(d.index)+o+u,l=l.slice(0,d.index)),i?(new ps(l,"ext-link-url",t,s),`[\0${a}f${o}${u}]`):(new $t(l,o,u,t,s),`\0${a}w`)})}}}),Go,fd=I({"src/link/category.ts"(){"use strict";me(),zs(),Go=class extends Ve{get type(){return"category"}get sortkey(){{const{childNodes:[,e]}=this;return e&&us(e.text())}}json(e,t=this.getAbsoluteIndex()){{const s=super.json(void 0,t),{sortkey:i}=this;return i&&(s.sortkey=i),s}}}}}),Vo={};le(Vo,{parseLinks:()=>Tn});var Zl,Tn,md=I({"parser/links.ts"(){"use strict";me(),G(),zo(),Do(),mo(),uo(),fd(),Zl=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,Tn=(e,t,s,i,r)=>{var u;(u=t.regexLinks)!=null||(t.regexLinks=new RegExp(String.raw`^\s*(?:${t.protocol}|//)`,"iu"));const n=t.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]]))?\]\]([\s\S]*)$/u:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])*)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]])?)?\]\]([\s\S]*)$/u,l=e.split("[[");let o=l.shift();for(let a=0;a<l.length;a++){let d=!1,c,f,g,y;const $=l[a],k=n.exec($);if(k)[,c,f,g,y]=k,y.startsWith("]")&&(g!=null&&g.includes("["))&&(g+="]",y=y.slice(1));else{const x=Zl.exec($);x&&(d=!0,[,c,f,g]=x)}if(c===void 0||t.regexLinks.test(c)||/\0\d+[exhbru]\x7F/u.test(c)){o+=`[[${$}`;continue}let _=Ce(c).trim();const T=_.startsWith(":");if(T&&d){o+=`[[${$}`;continue}else!_&&g&&!g.includes(`
25
- `)&&(_=Ce(g).trim());const{ns:p,valid:h}=N.normalizeTitle(_,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0,page:i});if(h){if(d){if(p!==6){o+=`[[${$}`;continue}let x=!1;for(a++;a<l.length;a++){const S=l[a],v=S.split("]]");if(v.length>2){x=!0,g+=`[[${v[0]}]]${v[1]}`,y=v.slice(2).join("]]");break}else if(v.length===2)g+=`[[${v[0]}]]${v[1]}`;else{g+=`[[${S}`;break}}if(g=Tn(g,t,s,i,r),!x){o+=`[[${c}${f}${g}`;continue}}}else{o+=`[[${$}`;continue}g&&(g=ur(g,t,s,r));let m=nr;T||(p===6?(g&&(g=dr(g,t,s,!0)),m=ir):p===14&&(m=Go)),g===void 0&&f&&(g=""),o+=`\0${s.length}l${y}`,new m(c,g,t,s,f)}return o}}}),Qo={};le(Qo,{parseMagicLinks:()=>Jo});var Qi,Ji,Xi,Ki,Jo,xd=I({"parser/magicLinks.ts"(){"use strict";me(),rr(),Qi=String.raw`[${Je}\t]|&nbsp;|&#0*160;|&#x0*a0;`,Ji=`(?:${Qi})+`,Xi=`(?:${Qi}|-)`,Ki=String.raw`(?:RFC|PMID)${Ji}\d+\b|ISBN${Ji}(?:97[89]${Xi}?)?(?:\d${Xi}?){9}[\dx]\b`,Jo=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${It}${Nt})|${Ki})`,"giu")}catch{t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${It}${Nt})|${Ki})`,"giu")}return e.replace(t.regexMagicLinks,(i,r,n)=>{let l=r?i.slice(r.length):i;if(n){let o="";const u=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(l);u&&(o=l.slice(u.index),l=l.slice(0,u.index));const a=l.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,d=a.exec(l);if(d){let c=1;d[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(l.slice(0,d.index))&&(c=2),o=l.slice(d.index+c)+o,l=l.slice(0,d.index+c)}return o.length>=n.length?i:(new ps(l,void 0,t,s),`${r}\0${s.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(l))return i;return new ps(l,"magic-link",t,s),`${r}\0${s.length-1}i`})}}}),Xo,vd=I({"util/html.ts"(){"use strict";Xo=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,i)=>s!==e[i])}}),Ko,bd=I({"src/nowiki/list.ts"(){"use strict";Eo(),Ko=class extends ar{get type(){return"list"}}}}),Yo={};le(Yo,{parseList:()=>Zo});var Zo,yd=I({"parser/list.ts"(){"use strict";vd(),bd(),jo(),Zo=(e,t,s,i)=>{const r=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!r)return t.lastPrefix="",e;const[n,l,o,u]=r,a=o.replace(/;/gu,":"),d=Xo(a,t.lastPrefix),c=((d>1?o.slice(d-1):o)+u).split(/(?=;)/u),f=c[0].startsWith(";");let g=c.length-(f?0:1);if(d>1){const A=o.slice(0,d-1);if(f){const C=A.split(/(?=;)/u);c.unshift(...C),g+=A.includes(";")?C.length:0}else c[0]=A+c[0]}t.lastPrefix=a;let y=l+c.map((A,C)=>`\0${i.length+C}d`).join("")+e.slice(n.length);for(const A of c)new Ko(A,s,i);if(!g)return y;const{html:[$,,k]}=s,_=/:+|-\{|\0\d+[xq]\x7F/gu;let T=_,p=T.exec(y),h=0,m=!1,x=!1,S=0;const v=(A,C)=>(new or(A,s,i),`${y.slice(0,C)}\0${i.length-1}d${y.slice(C+A.length)}`),w=A=>{A?h&&h--:h++};for(;p&&g;){const{0:A,index:C}=p;if(A==="-{"){if(!S){const{lastIndex:L}=T;T=/-\{|\}-/gu,T.lastIndex=L}S++}else if(A==="}-"){if(S--,!S){const{lastIndex:L}=T;T=_,T.lastIndex=L}}else if(A.endsWith("x")){const{name:L,closing:B,selfClosing:q}=i[Number(A.slice(1,-2))];($.includes(L)||!q&&!k.includes(L))&&w(B)}else if(A.endsWith("q")){const{bold:L,italic:B}=i[Number(A.slice(1,-2))];L&&(w(m),m=!m),B&&(w(x),x=!x)}else if(h===0){if(A.length>=g)return v(A.slice(0,g),C);g-=A.length,T.lastIndex=C+4+String(i.length).length,y=v(A,C)}p=T.exec(y)}return y}}}),Ts,ea,Yi,ta,ss,wd=I({"src/converterFlags.ts"(){"use strict";var e,t;Y(),ve(),Ms(),G(),J(),ht(),Ts=new Set(["A","T","R","D","-","H","N"]),ea=[ms()],ss=(t=class extends(ta=z){constructor(i,r,n=[]){super(void 0,r,n,{});R(this,e);this.safeAppend(i.map(l=>new qe(l,"converter-flag",r,n)))}get type(){return"converter-flags"}afterBuild(){E(this,e,this.childNodes.map(i=>i.text().trim())),super.afterBuild()}toString(i){return super.toString(i,";")}text(){return super.text(";")}getUnknownFlags(){return new Set(b(this,e).filter(i=>/\{{3}[^{}]+\}{3}/u.test(i)))}getVariantFlags(){const i=new Set(this.getAttribute("config").variants);return new Set(b(this,e).filter(r=>i.has(r)))}isInvalidFlag(i,r,n,l){return typeof i=="object"&&(i=i.text().trim(),r=this.getVariantFlags(),n=this.getUnknownFlags(),l=new Set(b(this,e).filter(o=>Ts.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(b(this,e).filter(k=>Ts.has(k))),u=b(this,e).filter(k=>!k).length,a=b(this,e).length-l.size-u,{lintConfig:d}=N,{computeEditInfo:c,fix:f}=d,g=super.lint(i,r);if(n.size===a||o.size===a)return g;const y="no-ignored",$=d.getSeverity(y,"conversionFlag");if($){const k=new ge(this,i);for(let _=0;_<this.length;_++){const T=this.childNodes[_],p=T.text().trim();if(this.isInvalidFlag(p,n,l,o)){const h=Q(T,k,y,"invalid-conversion-flag",$);(c||f)&&(n.size===0&&Ts.has(p.toUpperCase())?h.fix=Mn(h,p):c&&(h.suggestions=[ee(h,_&&-1)])),g.push(h)}}}return g}}print(){return super.print({sep:";"})}},e=new WeakMap,t),Yi=ae(ta),ss=re(Yi,0,"ConverterFlagsToken",ea,ss),ne(Yi,1,ss)}}),Cs,Ps,Sd=I({"src/converterRule.ts"(){"use strict";Me(),G(),J(),ht(),Cs=(e,t,s,i)=>{const r=new z(e,s,i);return r.type=`converter-rule-${t}`,r.setAttribute("stage",ke),r},Ps=class extends z{get type(){return"converter-rule"}get variant(){var e,t;return(t=(e=this.childNodes[this.length-2])==null?void 0:e.text().trim().toLowerCase())!=null?t:""}constructor(e,t=!0,s=N.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 qe(l,"converter-rule-variant",s,i)),super.insertAt(Cs(e.slice(r+1),"to",s,i)),n!==-1&&super.insertAt(Cs(e.slice(0,n),"from",s,i),0)):super.insertAt(Cs(e,"to",s,i))}toString(e){const{childNodes:t,firstChild:s,lastChild:i}=this;return t.length===3?`${s.toString(e)}=>${t[1].toString(e)}:${i.toString(e)}`:super.toString(e,":")}text(){const{childNodes:e,firstChild:t,lastChild:s}=this;return e.length===3?`${t.text()}=>${e[1].text()}:${s.text()}`:super.text(":")}getGaps(e){return e===0&&this.length===3?2:1}print(){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()){{const s=super.json(void 0,t);return s.variant=this.variant,s}}}}}),sa,Zi,ia,is,Ad=I({"src/converter.ts"(){"use strict";me(),Ze(),ze(),J(),wd(),Sd(),sa=[We,He("-{")],is=class extends(ia=z){get type(){return"converter"}constructor(e,t,s,i=[]){super(void 0,s,i),this.insertAt(new ss(e,s,i));const[r]=t,n=r.includes(":"),l=new Ps(r,n,s,i);n&&l.length===1||!n&&t.length===2&&!Ce(t[1]).trim()?this.insertAt(new Ps(t.join(";"),!1,s,i)):this.safeAppend([l,...t.slice(1).map(o=>new Ps(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()}|${ct(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?"|":""}${Ft(t,{sep:";"})}}-</span>`}},Zi=ae(ia),is=re(Zi,0,"ConverterToken",sa,is),ne(Zi,1,is)}}),eu={};le(eu,{parseConverter:()=>tu});var tu,kd=I({"parser/converter.ts"(){"use strict";Ad(),tu=(e,t,s)=>{var u;(u=t.regexConverter)!=null||(t.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${t.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"iu"));const i=/-\{/gu,r=/-\{|\}-/gu,n=[];let l=i,o=l.exec(e);for(;o;){const{0:a,index:d}=o;if(a==="}-"){const c=n.pop(),{length:f}=s,g=e.slice(c.index+2,d),y=g.indexOf("|"),[$,k]=y===-1?[[],g]:[g.slice(0,y).split(";"),g.slice(y+1)],_=k.replace(/(&[#a-z\d]+);/giu,"$1"),T=_.split(t.regexConverter).map(p=>p.replace(/\x01/gu,";"));new is($,T,t,s),e=`${e.slice(0,c.index)}\0${f}v${e.slice(d+2)}`,n.length===0&&(l=i),l.lastIndex=c.index+3+String(f).length}else n.push(o),l=r,l.lastIndex=d+2;o=l.exec(e)}return e}}}),ls={};le(ls,{Token:()=>z});var na,z,J=I({"src/index.ts"(){"use strict";var e,t,s,i,r,n,l,o,u,su,iu,nu,ru,lu,au,ou,uu,du,cu,hu,gu,m;me(),Me(),Y(),Re(),G(),Bu(),Wu(),na=["category","html-attr#id,ext-attr#id,table-attr#id"],z=(m=class extends Vt{constructor(v,w=N.getConfig(),A=[],C){super();R(this,u);R(this,e,"plain");R(this,t,0);R(this,s);R(this,i);R(this,r);R(this,n,!1);R(this,l);R(this,o);typeof v=="string"&&this.insertAt(v),E(this,s,w),E(this,i,A),A.push(this)}get type(){return b(this,e)}set type(v){E(this,e,v)}get pageName(){return b(this.getRootNode(),o)}set pageName(v){if(v){const w=this.normalizeTitle(v,0,{temporary:!0,page:""});E(this,o,w.valid?w.title:void 0)}else E(this,o,v===""?"":void 0)}parseOnce(v=b(this,t),w=!1,A){if(v<b(this,t)||this.length===0||!this.isPlain())return this;if(b(this,t)>=ke)return this;switch(v){case 0:if(this.type==="root"){b(this,i).pop();const C=j(this,u,su).call(this);w&&(w=!C)}E(this,r,w),j(this,u,iu).call(this,w);break;case 1:j(this,u,nu).call(this);break;case 2:j(this,u,ru).call(this);break;case 3:j(this,u,lu).call(this);break;case 4:j(this,u,au).call(this);break;case 5:j(this,u,ou).call(this,A);break;case 6:j(this,u,uu).call(this,A);break;case 7:j(this,u,du).call(this);break;case 8:j(this,u,cu).call(this);break;case 9:j(this,u,hu).call(this);break;case 10:j(this,u,gu).call(this)}if(this.type==="root")for(const C of b(this,i))C==null||C.parseOnce(v,w,A);return gr(this,t)._++,this}buildFromStr(v,w){const A=v.split(/[\0\x7F]/u).map((C,L)=>{if(L%2===0)return new vn(C);if(isNaN(C.slice(-1)))return b(this,i)[Number(C.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${C}`)});return w===0?A.map(String).join(""):w===1?ct(A):A}build(){E(this,t,ke);const{length:v,firstChild:w}=this,A=w==null?void 0:w.toString();if(v===1&&w.type==="text"&&A.includes("\0")&&(fs(this,0,1,this.buildFromStr(A)),this.normalize(),this.type==="root"))for(const C of b(this,i))C==null||C.build()}afterBuild(){if(this.type==="root")for(const v of b(this,i))v==null||v.afterBuild();E(this,n,!0)}parse(v=ke,w,A){for(v=Math.min(v,ke);b(this,t)<v;)this.parseOnce(b(this,t),w,A);return v&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===m}getAttribute(v){var w;switch(v){case"config":return b(this,s);case"include":return(w=b(this,r))!=null?w:!!b(this.getRootNode(),r);case"accum":return b(this,i);case"built":return b(this,n);case"stage":return b(this,t);case"invalid":return this.type==="table-inter"&&rs(this)===2;default:return super.getAttribute(v)}}setAttribute(v,w){switch(v){case"stage":b(this,t)===0&&this.type==="root"&&b(this,i).shift(),E(this,t,w);break;default:super.setAttribute(v,w)}}insertAt(v,w=this.length){const A=typeof v=="string"?new vn(v):v;super.insertAt(A,w);const{type:C}=A;return C==="root"&&(A.type="plain"),A}normalizeTitle(v,w=0,A){return N.normalizeTitle(v,w,this.getAttribute("include"),b(this,s),{page:this.pageName,...A})}inTableAttrs(){var v,w;return((v=this.closest("table-attrs,ext"))==null?void 0:v.type)==="table-attrs"&&((w=this.closest("table-attrs,arg,magic-word,template"))!=null&&w.is("table-attrs")?2:1)}inHtmlAttrs(){var v;return(v=this.closest("html-attrs,ext"))!=null&&v.is("html-attrs")?2:this.inTableAttrs()}lint(v=this.getAbsoluteIndex(),w){var A;{const{lintConfig:C}=N,{computeEditInfo:L,fix:B,ignoreDisables:q,configurationComment:O}=C;let W=super.lint(v,w);if(this.type==="root"){const F=new Map,P="no-duplicate",U=["category","id"].map(H=>C.getSeverity(P,H)),M=this.toString(),ie=na.filter((H,V)=>U[V]).join();if(ie){for(const H of this.querySelectorAll(ie)){let V;if(H.is("category"))V=H.name;else{const X=H.getValue();X&&X!==!0&&(V=`#${X}`)}if(V){const X=F.get(V);X?X.add(H):F.set(V,new Set([H]))}}for(const[H,V]of F)if(V.size>1&&!H.startsWith("#mw-customcollapsible-")){const X=!H.startsWith("#"),oe=`duplicate-${X?"category":"id"}`,de=U[X?0:1];W.push(...[...V].map(ce=>{const ue=Z(ce,{start:ce.getAbsoluteIndex()},P,oe,de);return L&&X&&(ue.suggestions=[ee(ue)]),ue}))}}if(!q){const H=new RegExp(String.raw`<!--\s*${O}-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->`,"gu"),V=[];let X=H.exec(M);for(;X;){const{1:oe,index:de}=X,ce=(A=X[2])==null?void 0:A.trim();V.push({line:this.posFromIndex(de).top+(oe==="disable-line"?0:1),from:oe==="disable"?H.lastIndex:void 0,to:oe==="enable"?H.lastIndex:void 0,rules:ce?new Set(ce.split(",").map(ue=>ue.trim())):void 0}),X=H.exec(M)}W=W.filter(({rule:oe,startLine:de,startIndex:ce})=>{const ue={pos:0};for(const{line:pe,from:ye,to:D,rules:K}of V){if(pe>de+1)break;if(K&&!K.has(oe))continue;if(pe===de&&ye===void 0&&D===void 0)return!1;ye<=ce&&ye>ue.pos?(ue.pos=ye,ue.type="from"):D<=ce&&D>ue.pos&&(ue.pos=D,ue.type="to")}return ue.type!=="from"})}if(B&&W.some(({fix:H})=>H)){const H=W.map(({fix:oe})=>oe).filter(Boolean).sort(({range:[oe,de]},{range:[ce,ue]})=>de===ue?ce-oe:ue-de);let V=1/0,X=M;for(const{range:[oe,de],text:ce}of H)de<=V&&(X=X.slice(0,oe)+ce+X.slice(de),V=oe);Object.assign(W,{output:X})}if(!L)for(const H of W)delete H.fix,delete H.suggestions}return W}}toString(v,w){return v?super.toString(!0,w):ut(b(this,l),()=>super.toString(!1,w),A=>{const C=this.getRootNode();C.type==="root"&&b(C,n)&&E(this,l,A)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakMap,l=new WeakMap,o=new WeakMap,u=new WeakSet,su=function(){const{parseRedirect:v}=(zu(),se(Wa)),w=this.firstChild.toString(),A=v(w,b(this,s),b(this,i));return A&&this.setText(A),!!A},iu=function(v){const{parseCommentAndExt:w}=(Qs(),se(_o));this.setText(w(this.firstChild.toString(),b(this,s),b(this,i),v))},nu=function(){const{parseBraces:v}=(sr(),se(to)),w=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,A=v(w,b(this,s),b(this,i));this.setText(this.type==="root"?A:A.slice(1))},ru=function(){if(b(this,s).excludes.includes("html"))return;const{parseHtml:v}=(ad(),se(To));this.setText(v(this.firstChild.toString(),b(this,s),b(this,i)))},lu=function(){if(b(this,s).excludes.includes("table"))return;const{parseTable:v}=(dd(),se(Ro));this.setText(v(this,b(this,s),b(this,i)))},au=function(){if(b(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:v}=(gd(),se(qo));this.setText(v(this,b(this,s),b(this,i)))},ou=function(v){const{parseLinks:w}=(md(),se(Vo));this.setText(w(this.firstChild.toString(),b(this,s),b(this,i),this.pageName,v))},uu=function(v){if(b(this,s).excludes.includes("quote"))return;const{parseQuotes:w}=(zo(),se(Mo)),A=this.firstChild.toString().split(`
25
+ `)&&(_=Ce(g).trim());const{ns:p,valid:h}=N.normalizeTitle(_,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0,page:i});if(h){if(d){if(p!==6){o+=`[[${$}`;continue}let x=!1;for(a++;a<l.length;a++){const S=l[a],v=S.split("]]");if(v.length>2){x=!0,g+=`[[${v[0]}]]${v[1]}`,y=v.slice(2).join("]]");break}else if(v.length===2)g+=`[[${v[0]}]]${v[1]}`;else{g+=`[[${S}`;break}}if(g=Tn(g,t,s,i,r),!x){o+=`[[${c}${f}${g}`;continue}}}else{o+=`[[${$}`;continue}g&&(g=ur(g,t,s,r));let m=nr;T||(p===6?(g&&(g=dr(g,t,s,!0)),m=ir):p===14&&(m=Go)),g===void 0&&f&&(g=""),o+=`\0${s.length}l${y}`,new m(c,g,t,s,f)}return o}}}),Qo={};le(Qo,{parseMagicLinks:()=>Jo});var Qi,Ji,Xi,Ki,Jo,xd=I({"parser/magicLinks.ts"(){"use strict";me(),rr(),Qi=String.raw`[${Je}\t]|&nbsp;|&#0*160;|&#x0*a0;`,Ji=`(?:${Qi})+`,Xi=`(?:${Qi}|-)`,Ki=String.raw`(?:RFC|PMID)${Ji}\d+\b|ISBN${Ji}(?:97[89]${Xi}?)?(?:\d${Xi}?){9}[\dx]\b`,Jo=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${It}${Nt})|${Ki})`,"giu")}catch{t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${It}${Nt})|${Ki})`,"giu")}return e.replace(t.regexMagicLinks,(i,r,n)=>{let l=r?i.slice(r.length):i;if(n){let o="";const u=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(l);u&&(o=l.slice(u.index),l=l.slice(0,u.index));const a=l.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,d=a.exec(l);if(d){let c=1;d[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(l.slice(0,d.index))&&(c=2),o=l.slice(d.index+c)+o,l=l.slice(0,d.index+c)}return o.length>=n.length?i:(new ps(l,void 0,t,s),`${r}\0${s.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(l))return i;return new ps(l,"magic-link",t,s),`${r}\0${s.length-1}i`})}}}),Xo,vd=I({"util/html.ts"(){"use strict";Xo=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,i)=>s!==e[i])}}),Ko,bd=I({"src/nowiki/list.ts"(){"use strict";Eo(),Ko=class extends ar{get type(){return"list"}}}}),Yo={};le(Yo,{parseList:()=>Zo});var Zo,yd=I({"parser/list.ts"(){"use strict";vd(),bd(),jo(),Zo=(e,t,s,i)=>{const r=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!r)return t.lastPrefix="",e;const[n,l,o,u]=r,a=o.replace(/;/gu,":"),d=Xo(a,t.lastPrefix),c=((d>1?o.slice(d-1):o)+u).split(/(?=;)/u),f=c[0].startsWith(";");let g=c.length-(f?0:1);if(d>1){const A=o.slice(0,d-1);if(f){const C=A.split(/(?=;)/u);c.unshift(...C),g+=A.includes(";")?C.length:0}else c[0]=A+c[0]}t.lastPrefix=a;let y=l+c.map((A,C)=>`\0${i.length+C}d`).join("")+e.slice(n.length);for(const A of c)new Ko(A,s,i);if(!g)return y;const{html:[$,,k]}=s,_=/:+|-\{|\0\d+[xq]\x7F/gu;let T=_,p=T.exec(y),h=0,m=!1,x=!1,S=0;const v=(A,C)=>(new or(A,s,i),`${y.slice(0,C)}\0${i.length-1}d${y.slice(C+A.length)}`),w=A=>{A?h&&h--:h++};for(;p&&g;){const{0:A,index:C}=p;if(A==="-{"){if(!S){const{lastIndex:L}=T;T=/-\{|\}-/gu,T.lastIndex=L}S++}else if(A==="}-"){if(S--,!S){const{lastIndex:L}=T;T=_,T.lastIndex=L}}else if(A.endsWith("x")){const{name:L,closing:B,selfClosing:q}=i[Number(A.slice(1,-2))];($.includes(L)||!q&&!k.includes(L))&&w(B)}else if(A.endsWith("q")){const{bold:L,italic:B}=i[Number(A.slice(1,-2))];L&&(w(m),m=!m),B&&(w(x),x=!x)}else if(h===0){if(A.length>=g)return v(A.slice(0,g),C);g-=A.length,T.lastIndex=C+4+String(i.length).length,y=v(A,C)}p=T.exec(y)}return y}}}),Ts,ea,Yi,ta,ss,wd=I({"src/converterFlags.ts"(){"use strict";var e,t;Y(),ve(),Ms(),G(),J(),ht(),Ts=new Set(["A","T","R","D","-","H","N"]),ea=[ms()],ss=(t=class extends(ta=z){constructor(i,r,n=[]){super(void 0,r,n,{});R(this,e);this.safeAppend(i.map(l=>new qe(l,"converter-flag",r,n)))}get type(){return"converter-flags"}afterBuild(){E(this,e,this.childNodes.map(i=>i.text().trim())),super.afterBuild()}toString(i){return super.toString(i,";")}text(){return super.text(";")}getUnknownFlags(){return new Set(b(this,e).filter(i=>/\{{3}[^{}]+\}{3}/u.test(i)))}getVariantFlags(){const i=new Set(this.getAttribute("config").variants);return new Set(b(this,e).filter(r=>i.has(r)))}isInvalidFlag(i,r,n,l){return typeof i=="object"&&(i=i.text().trim(),r=this.getVariantFlags(),n=this.getUnknownFlags(),l=new Set(b(this,e).filter(o=>Ts.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(b(this,e).filter(k=>Ts.has(k))),u=b(this,e).filter(k=>!k).length,a=b(this,e).length-l.size-u,{lintConfig:d}=N,{computeEditInfo:c,fix:f}=d,g=super.lint(i,r);if(n.size===a||o.size===a)return g;const y="no-ignored",$=d.getSeverity(y,"conversionFlag");if($){const k=new ge(this,i);for(let _=0;_<this.length;_++){const T=this.childNodes[_],p=T.text().trim();if(this.isInvalidFlag(p,n,l,o)){const h=Q(T,k,y,"invalid-conversion-flag",$);(c||f)&&(n.size===0&&Ts.has(p.toUpperCase())?h.fix=Mn(h,p):c&&(h.suggestions=[ee(h,_&&-1)])),g.push(h)}}}return g}}print(){return super.print({sep:";"})}},e=new WeakMap,t),Yi=ae(ta),ss=re(Yi,0,"ConverterFlagsToken",ea,ss),ne(Yi,1,ss)}}),Cs,Ps,Sd=I({"src/converterRule.ts"(){"use strict";Me(),G(),J(),ht(),Cs=(e,t,s,i)=>{const r=new z(e,s,i);return r.type=`converter-rule-${t}`,r.setAttribute("stage",ke),r},Ps=class extends z{get type(){return"converter-rule"}get variant(){var e,t;return(t=(e=this.childNodes[this.length-2])==null?void 0:e.text().trim().toLowerCase())!=null?t:""}constructor(e,t=!0,s=N.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 qe(l,"converter-rule-variant",s,i)),super.insertAt(Cs(e.slice(r+1),"to",s,i)),n!==-1&&super.insertAt(Cs(e.slice(0,n),"from",s,i),0)):super.insertAt(Cs(e,"to",s,i))}toString(e){const{childNodes:t,firstChild:s,lastChild:i}=this;return t.length===3?`${s.toString(e)}=>${t[1].toString(e)}:${i.toString(e)}`:super.toString(e,":")}text(){const{childNodes:e,firstChild:t,lastChild:s}=this;return e.length===3?`${t.text()}=>${e[1].text()}:${s.text()}`:super.text(":")}getGaps(e){return e===0&&this.length===3?2:1}print(){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()){{const s=super.json(void 0,t);return s.variant=this.variant,s}}}}}),sa,Zi,ia,is,Ad=I({"src/converter.ts"(){"use strict";me(),Ze(),ze(),J(),wd(),Sd(),sa=[We,He("-{")],is=class extends(ia=z){get type(){return"converter"}constructor(e,t,s,i=[]){super(void 0,s,i),this.insertAt(new ss(e,s,i));const[r]=t,n=r.includes(":"),l=new Ps(r,n,s,i);(n?l.length===1:t.length===2&&!Ce(t[1]).trim())?this.insertAt(new Ps(t.join(";"),!1,s,i)):this.safeAppend([l,...t.slice(1).map(o=>new Ps(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()}|${ct(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?"|":""}${Ft(t,{sep:";"})}}-</span>`}},Zi=ae(ia),is=re(Zi,0,"ConverterToken",sa,is),ne(Zi,1,is)}}),eu={};le(eu,{parseConverter:()=>tu});var tu,kd=I({"parser/converter.ts"(){"use strict";Ad(),tu=(e,t,s)=>{var u;(u=t.regexConverter)!=null||(t.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${t.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"iu"));const i=/-\{/gu,r=/-\{|\}-/gu,n=[];let l=i,o=l.exec(e);for(;o;){const{0:a,index:d}=o;if(a==="}-"){const c=n.pop(),{length:f}=s,g=e.slice(c.index+2,d),y=g.indexOf("|"),[$,k]=y===-1?[[],g]:[g.slice(0,y).split(";"),g.slice(y+1)],_=k.replace(/(&[#a-z\d]+);/giu,"$1"),T=_.split(t.regexConverter).map(p=>p.replace(/\x01/gu,";"));new is($,T,t,s),e=`${e.slice(0,c.index)}\0${f}v${e.slice(d+2)}`,n.length===0&&(l=i),l.lastIndex=c.index+3+String(f).length}else n.push(o),l=r,l.lastIndex=d+2;o=l.exec(e)}return e}}}),ls={};le(ls,{Token:()=>z});var na,z,J=I({"src/index.ts"(){"use strict";var e,t,s,i,r,n,l,o,u,su,iu,nu,ru,lu,au,ou,uu,du,cu,hu,gu,m;me(),Me(),Y(),Re(),G(),Bu(),Wu(),na=["category","html-attr#id,ext-attr#id,table-attr#id"],z=(m=class extends Vt{constructor(v,w=N.getConfig(),A=[],C){super();R(this,u);R(this,e,"plain");R(this,t,0);R(this,s);R(this,i);R(this,r);R(this,n,!1);R(this,l);R(this,o);typeof v=="string"&&this.insertAt(v),E(this,s,w),E(this,i,A),A.push(this)}get type(){return b(this,e)}set type(v){E(this,e,v)}get pageName(){return b(this.getRootNode(),o)}set pageName(v){if(v){const w=this.normalizeTitle(v,0,{temporary:!0,page:""});E(this,o,w.valid?w.title:void 0)}else E(this,o,v===""?"":void 0)}parseOnce(v=b(this,t),w=!1,A){if(v<b(this,t)||this.length===0||!this.isPlain())return this;if(b(this,t)>=ke)return this;switch(v){case 0:if(this.type==="root"){b(this,i).pop();const C=j(this,u,su).call(this);w&&(w=!C)}E(this,r,w),j(this,u,iu).call(this,w);break;case 1:j(this,u,nu).call(this);break;case 2:j(this,u,ru).call(this);break;case 3:j(this,u,lu).call(this);break;case 4:j(this,u,au).call(this);break;case 5:j(this,u,ou).call(this,A);break;case 6:j(this,u,uu).call(this,A);break;case 7:j(this,u,du).call(this);break;case 8:j(this,u,cu).call(this);break;case 9:j(this,u,hu).call(this);break;case 10:j(this,u,gu).call(this)}if(this.type==="root")for(const C of b(this,i))C==null||C.parseOnce(v,w,A);return gr(this,t)._++,this}buildFromStr(v,w){const A=v.split(/[\0\x7F]/u).map((C,L)=>{if(L%2===0)return new vn(C);if(isNaN(C.slice(-1)))return b(this,i)[Number(C.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${C}`)});return w===0?A.map(String).join(""):w===1?ct(A):A}build(){E(this,t,ke);const{length:v,firstChild:w}=this,A=w==null?void 0:w.toString();if(v===1&&w.type==="text"&&A.includes("\0")&&(fs(this,0,1,this.buildFromStr(A)),this.normalize(),this.type==="root"))for(const C of b(this,i))C==null||C.build()}afterBuild(){if(this.type==="root")for(const v of b(this,i))v==null||v.afterBuild();E(this,n,!0)}parse(v=ke,w,A){for(v=Math.min(v,ke);b(this,t)<v;)this.parseOnce(b(this,t),w,A);return v&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===m}getAttribute(v){var w;switch(v){case"config":return b(this,s);case"include":return(w=b(this,r))!=null?w:!!b(this.getRootNode(),r);case"accum":return b(this,i);case"built":return b(this,n);case"stage":return b(this,t);case"invalid":return this.type==="table-inter"&&rs(this)===2;default:return super.getAttribute(v)}}setAttribute(v,w){switch(v){case"stage":b(this,t)===0&&this.type==="root"&&b(this,i).shift(),E(this,t,w);break;default:super.setAttribute(v,w)}}insertAt(v,w=this.length){const A=typeof v=="string"?new vn(v):v;super.insertAt(A,w);const{type:C}=A;return C==="root"&&(A.type="plain"),A}normalizeTitle(v,w=0,A){return N.normalizeTitle(v,w,this.getAttribute("include"),b(this,s),{page:this.pageName,...A})}inTableAttrs(){var v,w;return((v=this.closest("table-attrs,ext"))==null?void 0:v.type)==="table-attrs"&&((w=this.closest("table-attrs,arg,magic-word,template"))!=null&&w.is("table-attrs")?2:1)}inHtmlAttrs(){var v;return(v=this.closest("html-attrs,ext"))!=null&&v.is("html-attrs")?2:this.inTableAttrs()}lint(v=this.getAbsoluteIndex(),w){var A;{const{lintConfig:C}=N,{computeEditInfo:L,fix:B,ignoreDisables:q,configurationComment:O}=C;let W=super.lint(v,w);if(this.type==="root"){const F=new Map,P="no-duplicate",U=["category","id"].map(H=>C.getSeverity(P,H)),M=this.toString(),ie=na.filter((H,V)=>U[V]).join();if(ie){for(const H of this.querySelectorAll(ie)){let V;if(H.is("category"))V=H.name;else{const X=H.getValue();X&&X!==!0&&(V=`#${X}`)}if(V){const X=F.get(V);X?X.add(H):F.set(V,new Set([H]))}}for(const[H,V]of F)if(V.size>1&&!H.startsWith("#mw-customcollapsible-")){const X=!H.startsWith("#"),oe=`duplicate-${X?"category":"id"}`,de=U[X?0:1];W.push(...[...V].map(ce=>{const ue=Z(ce,{start:ce.getAbsoluteIndex()},P,oe,de);return L&&X&&(ue.suggestions=[ee(ue)]),ue}))}}if(!q){const H=new RegExp(String.raw`<!--\s*${O}-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->`,"gu"),V=[];let X=H.exec(M);for(;X;){const{1:oe,index:de}=X,ce=(A=X[2])==null?void 0:A.trim();V.push({line:this.posFromIndex(de).top+(oe==="disable-line"?0:1),from:oe==="disable"?H.lastIndex:void 0,to:oe==="enable"?H.lastIndex:void 0,rules:ce?new Set(ce.split(",").map(ue=>ue.trim())):void 0}),X=H.exec(M)}W=W.filter(({rule:oe,startLine:de,startIndex:ce})=>{const ue={pos:0};for(const{line:pe,from:ye,to:D,rules:K}of V){if(pe>de+1)break;if(K&&!K.has(oe))continue;if(pe===de&&ye===void 0&&D===void 0)return!1;ye<=ce&&ye>ue.pos?(ue.pos=ye,ue.type="from"):D<=ce&&D>ue.pos&&(ue.pos=D,ue.type="to")}return ue.type!=="from"})}if(B&&W.some(({fix:H})=>H)){const H=W.map(({fix:oe})=>oe).filter(Boolean).sort(({range:[oe,de]},{range:[ce,ue]})=>de===ue?ce-oe:ue-de);let V=1/0,X=M;for(const{range:[oe,de],text:ce}of H)de<=V&&(X=X.slice(0,oe)+ce+X.slice(de),V=oe);Object.assign(W,{output:X})}if(!L)for(const H of W)delete H.fix,delete H.suggestions}return W}}toString(v,w){return v?super.toString(!0,w):ut(b(this,l),()=>super.toString(!1,w),A=>{const C=this.getRootNode();C.type==="root"&&b(C,n)&&E(this,l,A)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakMap,l=new WeakMap,o=new WeakMap,u=new WeakSet,su=function(){const{parseRedirect:v}=(zu(),se(Wa)),w=this.firstChild.toString(),A=v(w,b(this,s),b(this,i));return A&&this.setText(A),!!A},iu=function(v){const{parseCommentAndExt:w}=(Qs(),se(_o));this.setText(w(this.firstChild.toString(),b(this,s),b(this,i),v))},nu=function(){const{parseBraces:v}=(sr(),se(to)),w=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,A=v(w,b(this,s),b(this,i));this.setText(this.type==="root"?A:A.slice(1))},ru=function(){if(b(this,s).excludes.includes("html"))return;const{parseHtml:v}=(ad(),se(To));this.setText(v(this.firstChild.toString(),b(this,s),b(this,i)))},lu=function(){if(b(this,s).excludes.includes("table"))return;const{parseTable:v}=(dd(),se(Ro));this.setText(v(this,b(this,s),b(this,i)))},au=function(){if(b(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:v}=(gd(),se(qo));this.setText(v(this,b(this,s),b(this,i)))},ou=function(v){const{parseLinks:w}=(md(),se(Vo));this.setText(w(this.firstChild.toString(),b(this,s),b(this,i),this.pageName,v))},uu=function(v){if(b(this,s).excludes.includes("quote"))return;const{parseQuotes:w}=(zo(),se(Mo)),A=this.firstChild.toString().split(`
26
26
  `);for(let C=0;C<A.length;C++)A[C]=w(A[C],b(this,s),b(this,i),v);this.setText(A.join(`
27
27
  `))},du=function(){if(b(this,s).excludes.includes("extLink"))return;const{parseExternalLinks:v}=(Do(),se(Ho));this.setText(v(this.firstChild.toString(),b(this,s),b(this,i)))},cu=function(){if(b(this,s).excludes.includes("magicLink"))return;const{parseMagicLinks:v}=(xd(),se(Qo));this.setText(v(this.firstChild.toString(),b(this,s),b(this,i)))},hu=function(){if(b(this,s).excludes.includes("list"))return;const{parseList:v}=(yd(),se(Yo)),{firstChild:w,type:A,name:C}=this,L=w.toString().split(`
28
28
  `),B={lastPrefix:""};let q=A==="root"||A==="ext-inner"&&C==="poem"?0:1;for(;q<L.length;q++)L[q]=v(L[q],B,b(this,s),b(this,i));this.setText(L.join(`