wikiparser-node 1.3.8-b → 1.3.9-b

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,36 +1,36 @@
1
- "use strict";(()=>{var ut=Object.defineProperty;var Fi=Object.getOwnPropertyDescriptor;var Ei=Object.getOwnPropertyNames;var Li=Object.prototype.hasOwnProperty;var Ii=(l,i,e)=>i in l?ut(l,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):l[i]=e;var b=(l,i)=>()=>(l&&(i=l(l=0)),i);var Pi=(l,i)=>()=>(i||l((i={exports:{}}).exports,i),i.exports),_=(l,i)=>{for(var e in i)ut(l,e,{get:i[e],enumerable:!0})},Ri=(l,i,e,t)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of Ei(i))!Li.call(l,r)&&r!==e&&ut(l,r,{get:()=>i[r],enumerable:!(t=Fi(i,r))||t.enumerable});return l};var P=l=>Ri(ut({},"__esModule",{value:!0}),l);var f=(l,i,e)=>(Ii(l,typeof i!="symbol"?i+"":i,e),e),lr=(l,i,e)=>{if(!i.has(l))throw TypeError("Cannot "+e)};var u=(l,i,e)=>(lr(l,i,"read from private field"),e?e.call(l):i.get(l)),k=(l,i,e)=>{if(i.has(l))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(l):i.set(l,e)},S=(l,i,e,t)=>(lr(l,i,"write to private field"),t?t.call(l,e):i.set(l,e),e);var ht=(l,i,e,t)=>({set _(r){S(l,i,r,e)},get _(){return u(l,i,t)}}),N=(l,i,e)=>(lr(l,i,"access private method"),e);var nt,Ce,dr,we=b(()=>{"use strict";nt={run(l){return l()}},Ce=l=>i=>i.type===l,dr=(l,i,e,t=[])=>{let r=[...l.childNodes],n=r.splice(i,e,...t);l.setAttribute("childNodes",r);for(let s of t)s.setAttribute("parentNode",l);return n}});var Zr=Pi((ds,Gi)=>{Gi.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","img"]],namespaces:{},nsid:{file:6,category:14},parserFunction:[{"#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"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","#regex":"regex","#related":"related","#cscore":"cscore"},["!","="],["msg","\u539F\u59CB","raw"],["\u66FF\u4EE3","subst","\u5B89\u5168\u66FF\u4EE3","safesubst"]],doubleUnderscore:[[],[]],protocol:"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|worldwind://|xmpp:",interwiki:[],img:{},variants:[]}});var Vr,le=b(()=>{"use strict";Vr=Zr()});var xe,be,mt,J,Xr,de,ct,ft,pe,Z=b(()=>{"use strict";xe='(?:\\[[\\da-f:.]+\\]|[^[\\]<>"\0-\x7F\\p{Zs}\uFFFD])',be='(?:[^[\\]<>"\0-\x7F\\p{Zs}\uFFFD]|\0\\d+[c!~]\x7F)*',mt=(l,i)=>e=>e.replace(l,i),J=mt(/\0\d+c\x7F/gu,""),Xr=mt(/[\\{}()|.?*+^$[\]]/gu,"\\$&"),de=(l,i="")=>l.map(e=>typeof e=="string"?e:e.text()).join(i),ct=mt(/&#(\d+|x[\da-f]+);/giu,(l,i)=>String.fromCodePoint(+`${i.toLowerCase().startsWith("x")?"0":""}${i}`)),ft=mt(/\n/gu,"\\n"),pe=(l,i={})=>{let{pre:e="",post:t="",sep:r=""}=i;return`${e}${l.map(n=>n.print()).join(r)}${t}`}});var Qr={};_(Qr,{Title:()=>pr});var pr,Kr=b(()=>{"use strict";Z();A();pr=class{constructor(i,e=0,t=h.getConfig(),r=!1,n=!1){f(this,"valid");f(this,"ns");f(this,"fragment");f(this,"encoded",!1);let{nsid:s}=t;if(i=ct(i),r&&i.includes("%"))try{let g=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(i);i=decodeURIComponent(i),this.encoded=g}catch(g){}i=i.replace(/_/gu," ").trim();let o=e;i.startsWith(":")&&(o=0,i=i.slice(1).trim());let a=i.split(":");if(a.length>1){let g=s[a[0].trim().toLowerCase()];g!==void 0&&(o=g,i=a.slice(1).join(":").trim())}this.ns=o;let d=i.indexOf("#");if(d!==-1){let g=i.slice(d+1).trimEnd();this.fragment=g,i=i.slice(0,d).trim()}this.valid=!!(i||n&&this.fragment!==void 0)&&!/\0\d+[eh!+-]\x7F|[<>[\]{}|]|%[\da-f]{2}/iu.test(i)}}});var it,st,gr,Ge,ur=b(()=>{"use strict";Ge=class{constructor(){k(this,st);f(this,"childNodes",[]);k(this,it,void 0)}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get parentNode(){return u(this,it)}get nextSibling(){var e;let i=(e=this.parentNode)==null?void 0:e.childNodes;return i&&i[i.indexOf(this)+1]}get previousSibling(){var e;let i=(e=this.parentNode)==null?void 0:e.childNodes;return i&&i[i.indexOf(this)-1]}get offsetHeight(){return N(this,st,gr).call(this).height}get offsetWidth(){return N(this,st,gr).call(this).width}getAttribute(i){return i==="padding"?0:i in this?String(this[i]):void 0}setAttribute(i,e){i==="parentNode"?S(this,it,e):this[i]=e}getRootNode(){let{parentNode:i}=this;for(;i!=null&&i.parentNode;)({parentNode:i}=i);return i!=null?i:this}posFromIndex(i){let e=String(this);if(i>=-e.length&&i<=e.length){let t=e.slice(0,i).split(`
2
- `),r=t.length-1;return{top:r,left:t[r].length}}}getGaps(i){return 0}getRelativeIndex(i){let e,t=(r,n)=>e.slice(0,r).reduce((s,o,a)=>s+String(o).length+n.getGaps(a),0)+n.getAttribute("padding");if(i===void 0){let{parentNode:r}=this;return r?({childNodes:e}=r,t(e.indexOf(this),r)):0}return{childNodes:e}=this,t(i,this)}getAbsoluteIndex(){let{parentNode:i}=this;return i?i.getAbsoluteIndex()+this.getRelativeIndex():0}};it=new WeakMap,st=new WeakSet,gr=function(){let i=String(this).split(`
3
- `),e=i.length;return{height:e,width:i[e-1].length}}});var Tt,Jr=b(()=>{"use strict";Z();we();ur();Tt=class extends Ge{get length(){return this.childNodes.length}text(i){return de(this.childNodes,i)}normalize(){let i=[...this.childNodes];for(let e=i.length-1;e>=0;e--){let{type:t,data:r}=i[e],n=i[e-1];t!=="text"||this.getGaps(e-1)||(r===""?i.splice(e,1):(n==null?void 0:n.type)==="text"&&(n.setAttribute("data",n.data+r),i.splice(e,1)))}this.setAttribute("childNodes",i)}removeAt(i){return dr(this,i,1)[0]}insertAt(i,e=this.length){return dr(this,e,0,[i]),i}closest(i){let{parentNode:e}=this,t,r=new Set(i.split(",").map(n=>n.trim()));for(t=n=>r.has(n.type);e;){if(t(e))return e;({parentNode:e}=e)}}append(...i){for(let e of i)this.insertAt(e)}replaceChildren(...i){for(let e=this.length-1;e>=0;e--)this.removeAt(e);this.append(...i)}setText(i,e=0){e+=e<0?this.length:0;let t=this.childNodes[e],{data:r}=t;return t.replaceData(i),r}toString(i,e=""){return this.childNodes.map(t=>t.toString()).join(e)}lint(i=this.getAbsoluteIndex()){let e=[];for(let t=0,r=i+this.getAttribute("padding");t<this.length;t++){let n=this.childNodes[t];e.push(...n.lint(r)),r+=String(n).length+this.getGaps(t)}return e}print(i={}){var e;return String(this)?`<span class="wpb-${(e=i.class)!=null?e:this.type}">${pe(this.childNodes,i)}</span>`:""}json(i){return{...this,childNodes:this.childNodes.map(t=>t.type==="text"?{data:t.data}:t.json())}}}});var Yr,v,I,R=b(()=>{"use strict";A();Yr=l=>(i,e,t,r="error")=>{let{start:n}=e,{top:s,left:o}="top"in e?e:i.getRootNode().posFromIndex(n),{offsetHeight:a,offsetWidth:d}=i,{startIndex:g,startLine:p,startCol:m}=l(i,n,s,o);return{message:h.msg(t),severity:r,startIndex:g,endIndex:g+String(i).length,startLine:p,endLine:p+a-1,startCol:m,endCol:a===1?m+d:d}},v=Yr((l,i,e,t)=>{let r=l.getRelativeIndex(),{top:n,left:s}=l.parentNode.posFromIndex(r);return{startIndex:i+r,startLine:e+n,startCol:n?s:t+s}}),I=Yr((l,i,e,t)=>({startIndex:i,startLine:e,startCol:t}))});var V,ke=b(()=>{"use strict";A();w();V=class extends T{get innerText(){return this.firstChild.data}constructor(i="",e=h.getConfig(),t=[]){super(i,e,t)}}});var mr={};_(mr,{NowikiToken:()=>hr});var hr,cr=b(()=>{"use strict";R();A();ke();hr=class extends V{constructor(){super(...arguments);f(this,"type","ext-inner")}lint(e=this.getAbsoluteIndex()){let{name:t,firstChild:{data:r}}=this;return(t==="templatestyles"||t==="section")&&r?[I(this,{start:e},h.msg("nothing should be in <$1>",t))]:super.lint(e)}}});var ji,qi,Bi,xt,en,ot,tn=b(()=>{"use strict";A();ur();ji=/<\s*\/?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*\])|((?:^|\])[^[]*?)\]+|https?[:/]\/+/giu,qi=/<\s*\/?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*\])|((?:^|\])[^[]*?)\]+/giu,Bi=["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"],ot=class extends Ge{constructor(e){super();k(this,xt);f(this,"type","text");f(this,"data","");Object.defineProperties(this,{data:{value:e}})}toString(){return this.data}text(){return this.data}lint(e=this.getAbsoluteIndex()){let{data:t,parentNode:r,nextSibling:n,previousSibling:s}=this,{NowikiToken:o}=(cr(),P(mr)),{type:a,name:d}=r,g=n==null?void 0:n.type,p=s==null?void 0:s.type,m;a==="ext-inner"&&(d==="pre"||r instanceof o)?m=new RegExp(`<\\s*\\/?(${d})\\b`,"giu"):a==="free-ext-link"||a==="ext-link-url"||a==="image-parameter"&&d==="link"||a==="attr-value"?m=qi:m=ji;let c=[],{ext:x,html:y}=this.getRootNode().getAttribute("config");if(t.search(m)!==-1){m.lastIndex=0;let C=this.getRootNode(),{top:q,left:L}=C.posFromIndex(e),$=new Set(["onlyinclude","noinclude","includeonly",x,y,Bi].flat(2));for(let F=m.exec(t);F;F=m.exec(t)){let[,B,E]=F,{0:O,index:M}=F;if(E&&E!=="]"){let{length:Hr}=E;M+=Hr,O=O.slice(Hr)}let se=e+M,te=t.slice(0,M).split(`
4
- `),tt=te.length+q-1,oe=te[te.length-1],Q=te.length===1?L+oe.length:oe.length,{0:W,length:ae}=O,rt=se+ae,Te=String(C),U=Te[rt],$e=Te[se-1],ar=ae>1&&(W!=="<"||/[\s/>]/u.test(U!=null?U:""))||W==="{"&&(U===W||$e==="-")||W==="}"&&($e===W||U==="-")||W==="["&&(U===W||a==="ext-link-text"||!t.slice(M+1).trim()&&g==="free-ext-link")||W==="]"&&($e===W||!t.slice(0,M).trim()&&p==="free-ext-link")?"error":"warning";(W!=="<"||$.has(B.toLowerCase()))&&c.push({message:h.msg('lonely "$1"',W==="h"?O:W),severity:ar,startIndex:se,endIndex:rt,startLine:tt,endLine:tt,startCol:Q,endCol:Q+ae})}return c}return[]}replaceData(e){N(this,xt,en).call(this,e)}print(){let e={"&":"amp","<":"lt",">":"gt"};return this.data.replace(/[&<>]/gu,t=>`&${e[t]};`)}};xt=new WeakSet,en=function(e){this.setAttribute("data",e)}});var bt,rn=b(()=>{"use strict";w();bt=class extends T{constructor(){super(...arguments);f(this,"type","onlyinclude")}toString(e){return`<onlyinclude>${super.toString()}</onlyinclude>`}getAttribute(e){return e==="padding"?13:e==="plain"||super.getAttribute(e)}print(){return super.print({pre:'<span class="wpb-ext">&lt;onlyinclude&gt;</span>',post:'<span class="wpb-ext">&lt;/onlyinclude&gt;</span>'})}}});var ge,je=b(()=>{"use strict";ge=l=>{class i extends l{text(){return""}lint(){return[]}}return f(i,"hidden",!0),i}});var D,Ne=b(()=>{"use strict";je();ke();D=class extends ge(V){constructor(){super(...arguments);f(this,"type","noinclude")}}});var ye,qe,fr=b(()=>{"use strict";A();w();qe=class extends T{constructor(e,t,r,n,s=h.getConfig(),o=[]){super(void 0,s);k(this,ye,void 0);f(this,"closed");f(this,"selfClosing");this.setAttribute("name",e.toLowerCase()),S(this,ye,[e,n||e]),this.closed=n!=="",this.selfClosing=n===void 0,this.append(t,r);let a=typeof t=="string"?-1:o.indexOf(t);o.splice(a===-1?1/0:a,0,this),Object.defineProperty(this,"closed",{enumerable:!1})}toString(e){let{selfClosing:t,firstChild:r,lastChild:n}=this,[s,o]=u(this,ye);return t?`<${s}${r.toString(e)}/>`:`<${s}${r.toString(e)}>${n.toString(e)}${this.closed?`</${o}>`:""}`}text(){let[e,t]=u(this,ye);return this.selfClosing?`<${e}${this.firstChild.text()}/>`:`<${e}${super.text(">")}${this.closed?`</${t}>`:""}`}getAttribute(e){return e==="padding"?u(this,ye)[0].length+1:super.getAttribute(e)}getGaps(){return 1}print(){let[e,t]=u(this,ye);return super.print(this.selfClosing?{pre:`&lt;${e}`,post:"/&gt;"}:{pre:`&lt;${e}`,sep:"&gt;",post:this.closed?`&lt;/${t}&gt;`:""})}};ye=new WeakMap});var kt,nn=b(()=>{"use strict";R();je();A();fr();kt=class extends ge(qe){constructor(e,t="",r,n,s=h.getConfig(),o=[]){super(e,t,r!=null?r:"",r===void 0||n!=null?n:"",s,o);f(this,"type","include")}lint(e=this.getAbsoluteIndex()){return this.closed?[]:[I(this,{start:e},h.msg("unclosed $1",`<${this.name}>`))]}json(){return{...super.json(),closed:this.closed}}}});var G,he=b(()=>{"use strict";A();w();G=class extends T{constructor(i,e,t=h.getConfig(),r=[],n){super(i,t,r,n),this.type=e}}});var Oi,me,sn,on,an,ln,Tr,dn,yt,pn,Mi,H,re,Be,gn=b(()=>{"use strict";R();Z();le();A();w();he();Oi=new Set(["id","class","style","lang","dir","title","tabindex","aria-describedby","aria-flowto","aria-hidden","aria-label","aria-labelledby","aria-owns","role","about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),me=new Set(["align"]),sn=new Set(["cite"]),on=new Set(["cite","datetime"]),an=new Set(["width"]),ln=new Set(["align","valign","abbr","axis","headers","scope","rowspan","colspan","width","height","bgcolor"]),Tr=new Set(["type"]),dn={div:me,h1:me,h2:me,h3:me,h4:me,h5:me,h6:me,blockquote:sn,q:sn,p:me,br:new Set(["clear"]),pre:an,ins:on,del:on,ul:Tr,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set(["summary","width","border","frame","rules","cellspacing","cellpadding","align","bgcolor"]),caption:me,tr:new Set(["bgcolor","align","valign"]),td:ln,th:ln,img:new Set(["alt","src","width","height","srcset"]),font:new Set(["size","color","face"]),hr:an,rt:new Set(["rbspan"]),data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:new Set(["mode","showfilename","caption","perrow","widths","heights","showthumbnails","type"]),poem:new Set(["compact","align"]),categorytree:new Set(["align","hideroot","onlyroot","depth","mode","hideprefix","namespaces","showcount","notranslations"]),combooption:new Set(["name","for","inline","align"])},yt=new Set,pn={nowiki:yt,indicator:new Set(["name"]),langconvert:new Set(["from","to"]),ref:new Set(["group","name","extends","follow","dir"]),references:new Set(["group","responsive"]),charinsert:new Set(["label"]),choose:new Set(["uncached","before","after"]),option:new Set(["weight"]),imagemap:yt,inputbox:yt,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:yt,poll:new Set(["id","show-results-before-voting"]),sm2:Tr,flashmp3:Tr,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"])},Mi=new RegExp("expression|(?:filter|accelerator|-o-link(?:-source)?|-o-replace)\\s*:|(?:url|image(?:-set)?)\\s*\\(|attr\\s*\\([^)]+[\\s,]url","u"),Be=class extends T{constructor(e,t,r,n="",s,o=[],a=h.getConfig(),d=[]){let g=new G(r,"attr-key",a,d,{}),p;if(r==="title"||t==="img"&&r==="alt")p=new T(s,a,d,{}),p.type="attr-value",p.setAttribute("stage",10);else if(t==="gallery"&&r==="caption"){let m={...a,excludes:[...a.excludes,"quote","extLink","magicLink","list"]};p=new T(s,m,d,{}),p.type="attr-value",p.setAttribute("stage",5)}else if(t==="choose"&&(r==="before"||r==="after")){let m={...a,excludes:[...a.excludes,"heading","html","table","hr","list"]};p=new T(s,m,d,{}),p.type="attr-value",p.setAttribute("stage",1)}else p=new G(s,"attr-value",a,d,{});super(void 0,a,d);f(this,"tag");k(this,H,void 0);k(this,re,void 0);this.type=e,this.append(g,p),S(this,H,n),S(this,re,[...o]),this.tag=t,Object.defineProperty(this,"tag",{enumerable:!1}),this.setAttribute("name",J(r).trim().toLowerCase())}get balanced(){return!u(this,H)||u(this,re)[0]===u(this,re)[1]}afterBuild(){u(this,H).includes("\0")&&S(this,H,this.buildFromStr(u(this,H),0)),this.parentNode&&this.setAttribute("tag",this.parentNode.name),this.setAttribute("name",this.firstChild.text().trim().toLowerCase())}toString(e){let[t="",r=""]=u(this,re);return u(this,H)?`${super.toString(e,`${u(this,H)}${t}`)}${r}`:this.firstChild.toString(e)}text(){return u(this,H)?`${super.text(`${u(this,H).trim()}"`)}"`:this.firstChild.text()}getGaps(){var e,t;return u(this,H)?u(this,H).length+((t=(e=u(this,re)[0])==null?void 0:e.length)!=null?t:0):0}lint(e=this.getAbsoluteIndex()){var m;let t=super.lint(e),{balanced:r,firstChild:n,lastChild:s,type:o,name:a,tag:d}=this,g=this.getValue(),p;if(!r){let c=this.getRootNode();p={start:e,...c.posFromIndex(e)};let x=v(s,p,h.msg("unclosed $1","quotes"),"warning");t.push({...x,startIndex:x.startIndex-1,startCol:x.startCol-1})}return pn[d]&&!pn[d].has(a)||(o==="ext-attr"?d in dn:!/\{\{[^{]+\}\}/u.test(a))&&!((m=dn[d])!=null&&m.has(a))&&!/^(?:xmlns:[\w:.-]+|data-[^:]*)$/u.test(a)&&(d==="meta"||d==="link"||!Oi.has(a))?(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(n,p,"illegal attribute name"))):a==="style"&&typeof g=="string"&&Mi.test(g)?(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(s,p,"insecure style"))):a==="tabindex"&&typeof g=="string"&&g.trim()!=="0"&&(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(s,p,"nonzero tabindex"))),t}getValue(){if(u(this,H)){let e=this.lastChild.text();return u(this,re)[1]?e:e[u(this,re)[0]?"trimEnd":"trim"]()}return this.type==="ext-attr"||""}print(){let[e="",t=""]=u(this,re);return u(this,H)?super.print({sep:`${u(this,H)}${e}`,post:t}):super.print()}};H=new WeakMap,re=new WeakMap});var un,zi,Ae,vt=b(()=>{"use strict";R();Z();A();w();he();gn();un=l=>l.slice(0,-1),zi=l=>`${un(l)}-dirty`,Ae=class extends T{constructor(i,e,t,r=h.getConfig(),n=[]){if(super(void 0,r,n,{}),this.type=e,this.setAttribute("name",t),i){let s=new RegExp(`([^\\s/](?:(?!\0\\d+~\x7F)[^\\s/=])*)(?:((?:\\s|\0\\d+c\x7F)*(?:=|\0\\d+~\x7F)(?:\\s|\0\\d+c\x7F)*)(?:(["'])(.*?)(\\3|$)|(\\S*)))?`,"gsu"),o="",a=s.exec(i),d=0,g=()=>{o&&(super.insertAt(new G(o,zi(e),r,n,{})),o="")};for(;a;){let{index:p,0:m,1:c,2:x,3:y,4:C,5:q,6:L}=a;if(o+=i.slice(d,p),/^(?:[\w:]|\0\d+[t!~{}+-]\x7F)(?:[\w:.-]|\0\d+[t!~{}+-]\x7F)*$/u.test(J(c).trim())){let $=C!=null?C:L,F=[y,q],B=new Be(un(e),t,c,x,$,F,r,n);g(),super.insertAt(B)}else o+=m;({lastIndex:d}=s),a=s.exec(i)}o+=i.slice(d),g()}}afterBuild(){if(this.type==="table-attrs"){let{parentNode:i}=this;this.setAttribute("name",(i==null?void 0:i.type)==="td"&&i.subtype==="caption"?"caption":i==null?void 0:i.type)}}getAttrTokens(i){return this.childNodes.filter(e=>e instanceof Be&&(!i||e.name===i.toLowerCase().trim()))}getAttrToken(i){let e=this.getAttrTokens(i);return e[e.length-1]}getAttr(i){var e;return(e=this.getAttrToken(i))==null?void 0:e.getValue()}lint(i=this.getAbsoluteIndex()){let e=super.lint(i),{parentNode:t,length:r,childNodes:n}=this,s=new Map,o=new Set,a;(t==null?void 0:t.type)==="html"&&t.closing&&this.text().trim()&&(a={start:i,...this.getRootNode().posFromIndex(i)},e.push(I(this,a,"attributes of a closing tag")));for(let d=0;d<r;d++){let g=n[d];if(g instanceof G&&g.text().trim())a!=null||(a={start:i,...this.getRootNode().posFromIndex(i)}),e.push(v(g,a,"containing invalid attribute"));else if(g instanceof Be){let{name:p}=g;s.has(p)?(o.add(p),s.get(p).push(g)):p!=="class"&&s.set(p,[g])}}if(o.size>0){a!=null||(a={start:i,...this.getRootNode().posFromIndex(i)});for(let d of o)e.push(...s.get(d).map(g=>v(g,a,h.msg("duplicated $1 attribute",d))))}return e}print(){return String(this)?`<span class="wpb-${this.type}">${this.childNodes.map(i=>i.print(i instanceof G&&i.text().trim()?{class:"attr-dirty"}:void 0)).join("")}</span>`:""}}});var hn={};_(hn,{PreToken:()=>xr});var xr,mn=b(()=>{"use strict";le();A();w();Ne();xr=class extends T{constructor(e,t=h.getConfig(),r=[]){if(e){let n="<nowiki>",s="</nowiki>",{length:o}=n,a=e.indexOf(n),d=e.indexOf(s,a+o),g="";for(;a!==-1&&d!==-1;)new D(n,t,r),new D(s,t,r),g+=`${e.slice(0,a)}\0${r.length-1}c\x7F${e.slice(a+o,d)}\0${r.length}c\x7F`,e=e.slice(d+o+1),a=e.indexOf(n),d=e.indexOf(s,a+o);e=`${g}${e}`}super(e,t,r,{});f(this,"type","ext-inner");this.setAttribute("stage",10)}getAttribute(e){return e==="plain"||super.getAttribute(e)}}});var cn={};_(cn,{ParamTagToken:()=>at});var at,br=b(()=>{"use strict";R();A();w();he();at=class extends T{constructor(e,t=h.getConfig(),r=[],n={}){super(void 0,t,r,{});f(this,"type","ext-inner");if(e){let s=G;this.append(...e.split(`
1
+ "use strict";(()=>{var ht=Object.defineProperty;var Pi=Object.getOwnPropertyDescriptor;var Ri=Object.getOwnPropertyNames;var Gi=Object.prototype.hasOwnProperty;var ji=(l,i,e)=>i in l?ht(l,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):l[i]=e;var b=(l,i)=>()=>(l&&(i=l(l=0)),i);var qi=(l,i)=>()=>(i||l((i={exports:{}}).exports,i),i.exports),_=(l,i)=>{for(var e in i)ht(l,e,{get:i[e],enumerable:!0})},Bi=(l,i,e,t)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of Ri(i))!Gi.call(l,r)&&r!==e&&ht(l,r,{get:()=>i[r],enumerable:!(t=Pi(i,r))||t.enumerable});return l};var P=l=>Bi(ht({},"__esModule",{value:!0}),l);var f=(l,i,e)=>(ji(l,typeof i!="symbol"?i+"":i,e),e),dr=(l,i,e)=>{if(!i.has(l))throw TypeError("Cannot "+e)};var u=(l,i,e)=>(dr(l,i,"read from private field"),e?e.call(l):i.get(l)),y=(l,i,e)=>{if(i.has(l))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(l):i.set(l,e)},S=(l,i,e,t)=>(dr(l,i,"write to private field"),t?t.call(l,e):i.set(l,e),e);var mt=(l,i,e,t)=>({set _(r){S(l,i,r,e)},get _(){return u(l,i,t)}}),F=(l,i,e)=>(dr(l,i,"access private method"),e);var nt,we,pr,Ce=b(()=>{"use strict";nt={run(l){return l()}},we=l=>i=>i.type===l,pr=(l,i,e,t=[])=>{let r=[...l.childNodes],n=r.splice(i,e,...t);l.setAttribute("childNodes",r);for(let s of t)s.setAttribute("parentNode",l);return n}});var Vr=qi((fs,Oi)=>{Oi.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","img"]],namespaces:{},nsid:{file:6,category:14},parserFunction:[{"#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"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","#regex":"regex","#related":"related","#cscore":"cscore"},["!","="],["msg","\u539F\u59CB","raw"],["\u66FF\u4EE3","subst","\u5B89\u5168\u66FF\u4EE3","safesubst"]],doubleUnderscore:[[],[]],protocol:"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|worldwind://|xmpp:",interwiki:[],img:{},variants:[]}});var Qr,de=b(()=>{"use strict";Qr=Vr()});var xe,be,ct,Y,Xr,pe,ft,Kr,ge,V=b(()=>{"use strict";xe='(?:\\[[\\da-f:.]+\\]|[^[\\]<>"\0-\x7F\\p{Zs}\uFFFD])',be='(?:[^[\\]<>"\0-\x7F\\p{Zs}\uFFFD]|\0\\d+[c!~]\x7F)*',ct=(l,i)=>e=>e.replace(l,i),Y=ct(/\0\d+c\x7F/gu,""),Xr=ct(/[\\{}()|.?*+^$[\]]/gu,"\\$&"),pe=(l,i="")=>l.map(e=>typeof e=="string"?e:e.text()).join(i),ft=ct(/&#(\d+|x[\da-f]+);/giu,(l,i)=>String.fromCodePoint(+`${i.toLowerCase().startsWith("x")?"0":""}${i}`)),Kr=ct(/\n/gu,"\\n"),ge=(l,i={})=>{let{pre:e="",post:t="",sep:r=""}=i;return`${e}${l.map(n=>n.print()).join(r)}${t}`}});var Jr={};_(Jr,{Title:()=>gr});var gr,Yr=b(()=>{"use strict";V();A();gr=class{constructor(i,e=0,t=h.getConfig(),r=!1,n=!1){f(this,"valid");f(this,"ns");f(this,"fragment");f(this,"encoded",!1);let{nsid:s}=t;if(i=ft(i),r&&i.includes("%"))try{let g=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(i);i=decodeURIComponent(i),this.encoded=g}catch(g){}i=i.replace(/_/gu," ").trim();let o=e;i.startsWith(":")&&(o=0,i=i.slice(1).trim());let a=i.split(":");if(a.length>1){let g=s[a[0].trim().toLowerCase()];g&&(o=g,i=a.slice(1).join(":").trim())}this.ns=o;let d=i.indexOf("#");if(d!==-1){let g=i.slice(d+1).trimEnd();this.fragment=g,i=i.slice(0,d).trim()}this.valid=!!(i||n&&this.fragment!==void 0)&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|]|%[\da-f]{2}/iu.test(i)}}});var it,st,ur,Ge,hr=b(()=>{"use strict";Ge=class{constructor(){y(this,st);f(this,"childNodes",[]);y(this,it,void 0)}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get parentNode(){return u(this,it)}get nextSibling(){var e;let i=(e=this.parentNode)==null?void 0:e.childNodes;return i&&i[i.indexOf(this)+1]}get previousSibling(){var e;let i=(e=this.parentNode)==null?void 0:e.childNodes;return i&&i[i.indexOf(this)-1]}get offsetHeight(){return F(this,st,ur).call(this).height}get offsetWidth(){return F(this,st,ur).call(this).width}getAttribute(i){return i==="padding"?0:i in this?String(this[i]):void 0}setAttribute(i,e){i==="parentNode"?S(this,it,e):this[i]=e}getRootNode(){let{parentNode:i}=this;for(;i!=null&&i.parentNode;)({parentNode:i}=i);return i!=null?i:this}posFromIndex(i){let e=String(this);if(i>=-e.length&&i<=e.length){let t=e.slice(0,i).split(`
2
+ `),r=t.length-1;return{top:r,left:t[r].length}}}getGaps(i){return 0}getRelativeIndex(i){let e,t=(r,n)=>e.slice(0,r).reduce((s,o,a)=>s+String(o).length+n.getGaps(a),0)+n.getAttribute("padding");if(i===void 0){let{parentNode:r}=this;return r?({childNodes:e}=r,t(e.indexOf(this),r)):0}return{childNodes:e}=this,t(i,this)}getAbsoluteIndex(){let{parentNode:i}=this;return i?i.getAbsoluteIndex()+this.getRelativeIndex():0}};it=new WeakMap,st=new WeakSet,ur=function(){let i=String(this).split(`
3
+ `),e=i.length;return{height:e,width:i[e-1].length}}});var Tt,en=b(()=>{"use strict";V();Ce();hr();Tt=class extends Ge{get length(){return this.childNodes.length}text(i){return pe(this.childNodes,i)}normalize(){let i=[...this.childNodes];for(let e=i.length-1;e>=0;e--){let{type:t,data:r}=i[e],n=i[e-1];t!=="text"||this.getGaps(e-1)||(r===""?i.splice(e,1):(n==null?void 0:n.type)==="text"&&(n.setAttribute("data",n.data+r),i.splice(e,1)))}this.setAttribute("childNodes",i)}removeAt(i){return pr(this,i,1)[0]}insertAt(i,e=this.length){return pr(this,e,0,[i]),i}closest(i){let{parentNode:e}=this,t,r=new Set(i.split(",").map(n=>n.trim()));for(t=n=>r.has(n.type);e;){if(t(e))return e;({parentNode:e}=e)}}append(...i){for(let e of i)this.insertAt(e)}replaceChildren(...i){for(let e=this.length-1;e>=0;e--)this.removeAt(e);this.append(...i)}setText(i,e=0){e+=e<0?this.length:0;let t=this.childNodes[e],{data:r}=t;return t.replaceData(i),r}toString(i,e=""){return this.childNodes.map(t=>t.toString()).join(e)}lint(i=this.getAbsoluteIndex()){let e=[];for(let t=0,r=i+this.getAttribute("padding");t<this.length;t++){let n=this.childNodes[t];e.push(...n.lint(r)),r+=String(n).length+this.getGaps(t)}return e}print(i={}){var e;return String(this)?`<span class="wpb-${(e=i.class)!=null?e:this.type}">${ge(this.childNodes,i)}</span>`:""}json(i){return{...this,childNodes:this.childNodes.map(t=>t.type==="text"?{data:t.data}:t.json())}}}});var tn,v,N,R=b(()=>{"use strict";A();tn=l=>(i,e,t,r="error")=>{let{start:n}=e,{top:s,left:o}="top"in e?e:i.getRootNode().posFromIndex(n),{offsetHeight:a,offsetWidth:d}=i,{startIndex:g,startLine:p,startCol:m}=l(i,n,s,o);return{message:h.msg(t),severity:r,startIndex:g,endIndex:g+String(i).length,startLine:p,endLine:p+a-1,startCol:m,endCol:a===1?m+d:d}},v=tn((l,i,e,t)=>{let r=l.getRelativeIndex(),{top:n,left:s}=l.parentNode.posFromIndex(r);return{startIndex:i+r,startLine:e+n,startCol:n?s:t+s}}),N=tn((l,i,e,t)=>({startIndex:i,startLine:e,startCol:t}))});var Q,ke=b(()=>{"use strict";A();C();Q=class extends T{get innerText(){return this.firstChild.data}constructor(i="",e=h.getConfig(),t=[]){super(i,e,t)}}});var cr={};_(cr,{NowikiToken:()=>mr});var mr,fr=b(()=>{"use strict";R();A();ke();mr=class extends Q{constructor(){super(...arguments);f(this,"type","ext-inner")}lint(e=this.getAbsoluteIndex()){let{name:t,firstChild:{data:r}}=this;return(t==="templatestyles"||t==="section")&&r?[N(this,{start:e},h.msg("nothing should be in <$1>",t))]:super.lint(e)}}});var Mi,zi,Wi,xt,rn,ot,nn=b(()=>{"use strict";A();hr();Mi=/<\s*\/?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*\])|((?:^|\])[^[]*?)\]+|https?[:/]\/+/giu,zi=/<\s*\/?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*\])|((?:^|\])[^[]*?)\]+/giu,Wi=["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"],ot=class extends Ge{constructor(e){super();y(this,xt);f(this,"type","text");f(this,"data","");Object.defineProperties(this,{data:{value:e}})}toString(){return this.data}text(){return this.data}lint(e=this.getAbsoluteIndex()){let{data:t,parentNode:r,nextSibling:n,previousSibling:s}=this,{NowikiToken:o}=(fr(),P(cr)),{type:a,name:d}=r,g=n==null?void 0:n.type,p=s==null?void 0:s.type,m;a==="ext-inner"&&(d==="pre"||r instanceof o)?m=new RegExp(`<\\s*\\/?(${d})\\b`,"giu"):a==="free-ext-link"||a==="ext-link-url"||a==="image-parameter"&&d==="link"||a==="attr-value"?m=zi:m=Mi;let c=[],{ext:x,html:k}=this.getRootNode().getAttribute("config");if(t.search(m)!==-1){m.lastIndex=0;let w=this.getRootNode(),{top:q,left:I}=w.posFromIndex(e),$=new Set(["onlyinclude","noinclude","includeonly",x,k,Wi].flat(2));for(let E=m.exec(t);E;E=m.exec(t)){let[,B,L]=E,{0:O,index:M}=E;if(L&&L!=="]"){let{length:Zr}=L;M+=Zr,O=O.slice(Zr)}let oe=e+M,re=t.slice(0,M).split(`
4
+ `),tt=re.length+q-1,ae=re[re.length-1],K=re.length===1?I+ae.length:ae.length,{0:W,length:le}=O,rt=oe+le,Te=String(w),U=Te[rt],$e=Te[oe-1],lr=le>1&&(W!=="<"||/[\s/>]/u.test(U!=null?U:""))||W==="{"&&(U===W||$e==="-")||W==="}"&&($e===W||U==="-")||W==="["&&(U===W||a==="ext-link-text"||!t.slice(M+1).trim()&&g==="free-ext-link")||W==="]"&&($e===W||!t.slice(0,M).trim()&&p==="free-ext-link")?"error":"warning";(W!=="<"||$.has(B.toLowerCase()))&&c.push({message:h.msg('lonely "$1"',W==="h"?O:W),severity:lr,startIndex:oe,endIndex:rt,startLine:tt,endLine:tt,startCol:K,endCol:K+le})}return c}return[]}replaceData(e){F(this,xt,rn).call(this,e)}print(){let e={"&":"amp","<":"lt",">":"gt"};return this.data.replace(/[&<>]/gu,t=>`&${e[t]};`)}};xt=new WeakSet,rn=function(e){this.setAttribute("data",e)}});var bt,sn=b(()=>{"use strict";C();bt=class extends T{constructor(){super(...arguments);f(this,"type","onlyinclude")}toString(e){return`<onlyinclude>${super.toString()}</onlyinclude>`}getAttribute(e){return e==="padding"?13:e==="plain"||super.getAttribute(e)}print(){return super.print({pre:'<span class="wpb-ext">&lt;onlyinclude&gt;</span>',post:'<span class="wpb-ext">&lt;/onlyinclude&gt;</span>'})}}});var ue,je=b(()=>{"use strict";ue=l=>{class i extends l{text(){return""}lint(){return[]}}return f(i,"hidden",!0),i}});var H,Ne=b(()=>{"use strict";je();ke();H=class extends ue(Q){constructor(){super(...arguments);f(this,"type","noinclude")}}});var ye,qe,Tr=b(()=>{"use strict";A();C();qe=class extends T{constructor(e,t,r,n,s=h.getConfig(),o=[]){super(void 0,s);y(this,ye,void 0);f(this,"closed");f(this,"selfClosing");this.setAttribute("name",e.toLowerCase()),S(this,ye,[e,n||e]),this.closed=n!=="",this.selfClosing=n===void 0,this.append(t,r);let a=typeof t=="string"?-1:o.indexOf(t);o.splice(a===-1?1/0:a,0,this),Object.defineProperty(this,"closed",{enumerable:!1})}toString(e){let{selfClosing:t,firstChild:r,lastChild:n}=this,[s,o]=u(this,ye);return t?`<${s}${r.toString(e)}/>`:`<${s}${r.toString(e)}>${n.toString(e)}${this.closed?`</${o}>`:""}`}text(){let[e,t]=u(this,ye);return this.selfClosing?`<${e}${this.firstChild.text()}/>`:`<${e}${super.text(">")}${this.closed?`</${t}>`:""}`}getAttribute(e){return e==="padding"?u(this,ye)[0].length+1:super.getAttribute(e)}getGaps(){return 1}print(){let[e,t]=u(this,ye);return super.print(this.selfClosing?{pre:`&lt;${e}`,post:"/&gt;"}:{pre:`&lt;${e}`,sep:"&gt;",post:this.closed?`&lt;/${t}&gt;`:""})}};ye=new WeakMap});var kt,on=b(()=>{"use strict";R();je();A();Tr();kt=class extends ue(qe){constructor(e,t="",r,n,s=h.getConfig(),o=[]){super(e,t,r!=null?r:"",r===void 0||n!=null?n:"",s,o);f(this,"type","include")}lint(e=this.getAbsoluteIndex()){return this.closed?[]:[N(this,{start:e},h.msg("unclosed $1",`<${this.name}>`))]}json(){return{...super.json(),closed:this.closed}}}});var G,me=b(()=>{"use strict";A();C();G=class extends T{constructor(i,e,t=h.getConfig(),r=[],n){super(i,t,r,n),this.type=e}}});var _i,D,an,ln,At,xr,dn,at,un,hn,mn,pn,yt,gn,Ui,Di,Z,ne,Be,cn=b(()=>{"use strict";R();V();de();A();C();me();_i=new Set(["id","class","style","lang","dir","title","tabindex","aria-describedby","aria-flowto","aria-hidden","aria-label","aria-labelledby","aria-owns","role","about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),D=new Set(["align"]),an=new Set(["cite"]),ln=new Set(["cite","datetime"]),At=new Set(["width"]),xr=new Set(["axis","align","bgcolor","height","width","valign"]),dn=new Set([...xr,"abbr","headers","scope","rowspan","colspan"]),at=new Set(["type"]),un=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),hn=new Set(["clear"]),mn=new Set(["bgcolor","align","valign"]),pn={div:D,h1:D,h2:D,h3:D,h4:D,h5:D,h6:D,blockquote:an,q:an,p:D,br:hn,pre:At,ins:ln,del:ln,ul:at,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...un,"border"]),caption:D,tr:mn,td:dn,th:dn,img:new Set(["alt","src","width","height","srcset"]),font:new Set(["size","color","face"]),hr:At,rt:new Set(["rbspan"]),data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:new Set(["mode","showfilename","caption","perrow","widths","heights","showthumbnails","type"]),poem:new Set(["compact","align"]),categorytree:new Set(["align","hideroot","onlyroot","depth","mode","hideprefix","namespaces","showcount","notranslations"]),combooption:new Set(["name","for","inline","align"])},yt=new Set,gn={nowiki:yt,indicator:new Set(["name"]),langconvert:new Set(["from","to"]),ref:new Set(["group","name","extends","follow","dir"]),references:new Set(["group","responsive"]),charinsert:new Set(["label"]),choose:new Set(["uncached","before","after"]),option:new Set(["weight"]),imagemap:yt,inputbox:yt,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:yt,poll:new Set(["id","show-results-before-voting"]),sm2:at,flashmp3:at,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"])},Ui=new RegExp("expression|(?:filter|accelerator|-o-link(?:-source)?|-o-replace)\\s*:|(?:url|image(?:-set)?)\\s*\\(|attr\\s*\\([^)]+[\\s,]url","u"),Di={table:un,td:new Set([...xr,"scope"]),th:xr,br:hn,caption:D,div:D,hr:At,h1:D,h2:D,h3:D,h4:D,h5:D,h6:D,li:at,p:D,pre:At,tr:mn,ul:at},Be=class extends T{constructor(e,t,r,n="",s,o=[],a=h.getConfig(),d=[]){let g=new G(r,"attr-key",a,d,{}),p;if(r==="title"||t==="img"&&r==="alt")p=new T(s,a,d,{}),p.type="attr-value",p.setAttribute("stage",10);else if(t==="gallery"&&r==="caption"){let m={...a,excludes:[...a.excludes,"quote","extLink","magicLink","list"]};p=new T(s,m,d,{}),p.type="attr-value",p.setAttribute("stage",5)}else if(t==="choose"&&(r==="before"||r==="after")){let m={...a,excludes:[...a.excludes,"heading","html","table","hr","list"]};p=new T(s,m,d,{}),p.type="attr-value",p.setAttribute("stage",1)}else p=new G(s,"attr-value",a,d,{});super(void 0,a,d);f(this,"tag");y(this,Z,void 0);y(this,ne,void 0);this.type=e,this.append(g,p),S(this,Z,n),S(this,ne,[...o]),this.tag=t,Object.defineProperty(this,"tag",{enumerable:!1}),this.setAttribute("name",Y(r).trim().toLowerCase())}get balanced(){return!u(this,Z)||u(this,ne)[0]===u(this,ne)[1]}afterBuild(){u(this,Z).includes("\0")&&S(this,Z,this.buildFromStr(u(this,Z),0)),this.parentNode&&this.setAttribute("tag",this.parentNode.name),this.setAttribute("name",this.firstChild.text().trim().toLowerCase())}toString(e){let[t="",r=""]=u(this,ne);return u(this,Z)?`${super.toString(e,`${u(this,Z)}${t}`)}${r}`:this.firstChild.toString(e)}text(){return u(this,Z)?`${super.text(`${u(this,Z).trim()}"`)}"`:this.firstChild.text()}getGaps(){var e,t;return u(this,Z)?u(this,Z).length+((t=(e=u(this,ne)[0])==null?void 0:e.length)!=null?t:0):0}lint(e=this.getAbsoluteIndex()){var m,c;let t=super.lint(e),{balanced:r,firstChild:n,lastChild:s,type:o,name:a,tag:d}=this,g=this.getValue(),p;if(!r){let x=this.getRootNode();p={start:e,...x.posFromIndex(e)};let k=v(s,p,h.msg("unclosed $1","quotes"),"warning");t.push({...k,startIndex:k.startIndex-1,startCol:k.startCol-1})}return gn[d]&&!gn[d].has(a)||(o==="ext-attr"?d in pn:!/\{\{[^{]+\}\}/u.test(a))&&!((m=pn[d])!=null&&m.has(a))&&!/^(?:xmlns:[\w:.-]+|data-[^:]*)$/u.test(a)&&(d==="meta"||d==="link"||!_i.has(a))?(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(n,p,"illegal attribute name"))):(c=Di[d])!=null&&c.has(a)?(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(n,p,"obsolete attribute","warning"))):a==="style"&&typeof g=="string"&&Ui.test(g)?(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(s,p,"insecure style"))):a==="tabindex"&&typeof g=="string"&&g.trim()!=="0"&&(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(s,p,"nonzero tabindex"))),t}getValue(){if(u(this,Z)){let e=this.lastChild.text();return u(this,ne)[1]?e:e[u(this,ne)[0]?"trimEnd":"trim"]()}return this.type==="ext-attr"||""}print(){let[e="",t=""]=u(this,ne);return u(this,Z)?super.print({sep:`${u(this,Z)}${e}`,post:t}):super.print()}};Z=new WeakMap,ne=new WeakMap});var fn,Hi,Ae,St=b(()=>{"use strict";R();V();A();C();me();cn();fn=l=>l.slice(0,-1),Hi=l=>`${fn(l)}-dirty`,Ae=class extends T{constructor(i,e,t,r=h.getConfig(),n=[]){if(super(void 0,r,n,{}),this.type=e,this.setAttribute("name",t),i){let s=new RegExp(`([^\\s/](?:(?!\0\\d+~\x7F)[^\\s/=])*)(?:((?:\\s|\0\\d+c\x7F)*(?:=|\0\\d+~\x7F)(?:\\s|\0\\d+c\x7F)*)(?:(["'])(.*?)(\\3|$)|(\\S*)))?`,"gsu"),o="",a=s.exec(i),d=0,g=()=>{o&&(super.insertAt(new G(o,Hi(e),r,n,{})),o="")};for(;a;){let{index:p,0:m,1:c,2:x,3:k,4:w,5:q,6:I}=a;if(o+=i.slice(d,p),/^(?:[\w:]|\0\d+[t!~{}+-]\x7F)(?:[\w:.-]|\0\d+[t!~{}+-]\x7F)*$/u.test(Y(c).trim())){let $=w!=null?w:I,E=[k,q],B=new Be(fn(e),t,c,x,$,E,r,n);g(),super.insertAt(B)}else o+=m;({lastIndex:d}=s),a=s.exec(i)}o+=i.slice(d),g()}}afterBuild(){if(this.type==="table-attrs"){let{parentNode:i}=this;this.setAttribute("name",(i==null?void 0:i.type)==="td"&&i.subtype==="caption"?"caption":i==null?void 0:i.type)}}getAttrTokens(i){return this.childNodes.filter(e=>e instanceof Be&&(!i||e.name===i.toLowerCase().trim()))}getAttrToken(i){let e=this.getAttrTokens(i);return e[e.length-1]}getAttr(i){var e;return(e=this.getAttrToken(i))==null?void 0:e.getValue()}lint(i=this.getAbsoluteIndex()){let e=super.lint(i),{parentNode:t,length:r,childNodes:n}=this,s=new Map,o=new Set,a;(t==null?void 0:t.type)==="html"&&t.closing&&this.text().trim()&&(a={start:i,...this.getRootNode().posFromIndex(i)},e.push(N(this,a,"attributes of a closing tag")));for(let d=0;d<r;d++){let g=n[d];if(g instanceof G&&g.text().trim())a!=null||(a={start:i,...this.getRootNode().posFromIndex(i)}),e.push(v(g,a,"containing invalid attribute"));else if(g instanceof Be){let{name:p}=g;s.has(p)?(o.add(p),s.get(p).push(g)):p!=="class"&&s.set(p,[g])}}if(o.size>0){a!=null||(a={start:i,...this.getRootNode().posFromIndex(i)});for(let d of o)e.push(...s.get(d).map(g=>v(g,a,h.msg("duplicated $1 attribute",d))))}return e}print(){return String(this)?`<span class="wpb-${this.type}">${this.childNodes.map(i=>i.print(i instanceof G&&i.text().trim()?{class:"attr-dirty"}:void 0)).join("")}</span>`:""}}});var Tn={};_(Tn,{PreToken:()=>br});var br,xn=b(()=>{"use strict";de();A();C();Ne();br=class extends T{constructor(e,t=h.getConfig(),r=[]){if(e){let n="<nowiki>",s="</nowiki>",{length:o}=n,a=e.indexOf(n),d=e.indexOf(s,a+o),g="";for(;a!==-1&&d!==-1;)new H(n,t,r),new H(s,t,r),g+=`${e.slice(0,a)}\0${r.length-1}c\x7F${e.slice(a+o,d)}\0${r.length}c\x7F`,e=e.slice(d+o+1),a=e.indexOf(n),d=e.indexOf(s,a+o);e=`${g}${e}`}super(e,t,r,{});f(this,"type","ext-inner");this.setAttribute("stage",10)}getAttribute(e){return e==="plain"||super.getAttribute(e)}}});var bn={};_(bn,{ParamTagToken:()=>lt});var lt,kr=b(()=>{"use strict";R();A();C();me();lt=class extends T{constructor(e,t=h.getConfig(),r=[],n={}){super(void 0,t,r,{});f(this,"type","ext-inner");if(e){let s=G;this.append(...e.split(`
5
5
  `).map(o=>new s(o,"param-line",t,r,{})))}}toString(e){return super.toString(e,`
6
6
  `)}text(){return super.text(`
7
7
  `)}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){let t;return this.childNodes.filter(r=>{let{childNodes:n}=r,s=n.findIndex(({type:a})=>a!=="text"),o=(s>=0?n.slice(0,s).map(String).join(""):String(r)).trim();return o&&!(s>=0?/^[a-z]+(?:\[\])?\s*(?:=|$)/iu:/^[a-z]+(?:\[\])?\s*=/iu).test(o)}).map(r=>(t!=null||(t={start:e,...this.getRootNode().posFromIndex(e)}),v(r,t,h.msg("invalid parameter of $1",this.name))))}print(){return super.print({sep:`
8
- `})}}});var ue,lt=b(()=>{"use strict";A();w();ue=class extends T{constructor(i,e,t="plain",r=h.getConfig(),n=[],s){super(i,r,n,s),this.type=t}lint(){return[]}}});var dt,Oe,St,Me,kr=b(()=>{"use strict";R();A();w();lt();Me=class extends T{constructor(e,t,r=h.getConfig(),n=[]){super(void 0,r,n);k(this,Oe);f(this,"type","heading");k(this,dt,void 0);S(this,dt,e);let s=new T(t[0],r,n);s.type="heading-title",s.setAttribute("stage",2);let o=new ue(t[1],/^[^\S\n]*$/u,"heading-trail",r,n,{});this.append(s,o)}get level(){return u(this,dt)}toString(e){let t=u(this,Oe,St);return`${t}${this.firstChild.toString()}${t}${this.lastChild.toString()}`}text(){let e=u(this,Oe,St);return`${e}${this.firstChild.text()}${e}`}getAttribute(e){return e==="padding"?super.getAttribute("padding")+this.level:super.getAttribute(e)}getGaps(){return this.level}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{firstChild:r}=this,n=String(r),s;return this.level===1&&(s=v(r,{start:e},"<h1>"),t.push(s)),(n.startsWith("=")||n.endsWith("="))&&(s!=null||(s=v(r,{start:e},"")),t.push({...s,message:h.msg('unbalanced "=" in a section header')})),this.closest("html-attrs, table-attrs")&&t.push({...I(this,{start:e},""),message:h.msg("section header in a HTML tag")}),t}print(){let e=u(this,Oe,St);return super.print({pre:e,sep:e})}json(){return{...super.json(),level:this.level}}};dt=new WeakMap,Oe=new WeakSet,St=function(){return"=".repeat(this.level)}});var Wi,$t,fn=b(()=>{"use strict";Z();R();A();w();Wi=l=>l.toString(new Set(["comment","noinclude","include"])).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),$t=class extends T{constructor(e,t,r=h.getConfig(),n=[]){super(void 0,r,n);f(this,"type","parameter");let s=new T(typeof e=="number"?void 0:e,r,n,{}),o=new T(t,r,n);s.type="parameter-key",o.type="parameter-value",o.setAttribute("stage",2),this.append(s,o)}get anon(){return this.firstChild.length===0}afterBuild(){if(!this.anon){let{parentNode:e,firstChild:t}=this,r=Wi(t);this.setAttribute("name",r),e&&e.getArgs(r,!1,!1).add(this)}}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()){var s;let t=super.lint(e),{firstChild:r}=this,n=(s=new RegExp(`https?://${xe}${be}$`,"iu").exec(r.toString(new Set(["comment","noinclude","include"]))))==null?void 0:s[0];if(n&&new URL(n).search){let o=v(r,{start:e},"unescaped query string in an anonymous parameter");t.push({...o,startIndex:o.endIndex,endIndex:o.endIndex+1,startLine:o.endLine,startCol:o.endCol,endCol:o.endCol+1})}return t}print(){return super.print({sep:this.anon?"":"="})}json(){return{...super.json(),anon:this.anon}}}});var _i,Fe,Ee,wt,Tn,Nt,xn,Ct,bn=b(()=>{"use strict";Z();R();we();le();A();w();fn();he();lt();_i=new Set(["pageid","articlepath","server","servername","scriptpath","stylepath"]),Ct=class extends T{constructor(e,t,r=h.getConfig(),n=[]){var m,c;super(void 0,r,n,{});k(this,wt);k(this,Nt);f(this,"type","template");f(this,"modifier","");k(this,Fe,!1);k(this,Ee,new Map);let{parserFunction:[s,o]}=r,a=(m=/^(?:\s|\0\d+c\x7F)*\0\d+s\x7F/u.exec(e))==null?void 0:m[0];if(a)this.setAttribute("modifier",a),e=e.slice(a.length);else if(e.includes(":")){let[x,...y]=e.split(":"),[C]=/^(?:\s|\0\d+c\x7F)*/u.exec((c=y[0])!=null?c:"");this.setModifier(`${x}:${C}`)&&(e=y.join(":").slice(C.length))}let d=e.includes(":");if(d||t.length===0&&!u(this,Fe)){let[x,...y]=e.split(":"),C=J(x),q=C[y.length>0?"trimStart":"trim"](),L=q.toLowerCase(),$=s[L],F=o.includes(q);if(F||_i.has($)||d&&$){this.setAttribute("name",$!=null?$:L),this.type="magic-word";let E=new RegExp(`^\\s*${q}\\s*$`,F?"u":"iu"),O=new ue(x,E,"magic-word-name",r,n,{});if(super.insertAt(O),y.length>0&&t.unshift([y.join(":")]),this.name==="invoke")for(let M=0;M<2;M++){let se=t.shift();if(!se)break;let te=new G(se.join("="),`invoke-${M?"function":"module"}`,r,n);super.insertAt(te)}}}if(this.type==="template"){let x=J(ct(e)).split("#")[0].trim();if(!x||/\0\d+[eh!+-]\x7F|[<>[\]{}\n]|%[\da-f]{2}/u.test(x))throw n.pop(),new SyntaxError(`\u975E\u6CD5\u7684\u6A21\u677F\u540D\u79F0\uFF1A${ft(x)}`);let y=new G(e,"template-name",r,n,{});super.insertAt(y)}let g=this.isTemplate(),p=1;for(let x=0;x<t.length;x++){let y=t[x];!g&&!(this.name==="switch"&&x>0)&&(y[0]=y.join("="),y.length=1),y.length===1&&(y.unshift(p),p++),this.insertAt(new $t(...y,r,n))}}setModifier(e){let{parserFunction:[,,t,r]}=this.getAttribute("config"),n=J(e).trim();if(e&&!n.endsWith(":"))return!1;let s=n.slice(0,-1).toLowerCase(),o=t.includes(s),a=r.includes(s);return u(this,Fe)&&o||!u(this,Fe)&&(a||e==="")||this.length>1&&(o||a||e==="")?(this.setAttribute("modifier",e),S(this,Fe,o),!!e):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0))}toString(e){return`{{${this.modifier}${this.type==="magic-word"?`${this.firstChild.toString(e)}${this.length===1?"":":"}${this.childNodes.slice(1).map(t=>t.toString(e)).join("|")}`:super.toString(e,"|")}}}`}text(){let{childNodes:e,length:t,firstChild:r,modifier:n,type:s,name:o}=this;return s==="magic-word"&&o==="vardefine"?"":`{{${n}${s==="magic-word"?`${r.text()}${t===1?"":":"}${de(e.slice(1),"|")}`:super.text("|")}}}`}getAttribute(e){switch(e){case"padding":return this.modifier.length+2;default:return super.getAttribute(e)}}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{type:r,childNodes:n,length:s}=this,o;if(!this.isTemplate())return t;let a=N(this,wt,Tn).call(this);if(a.fragment!==void 0&&(o={start:e,...this.getRootNode().posFromIndex(e)},t.push(v(n[r==="template"?0:1],o,"useless fragment"))),a.valid||(o!=null||(o={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(n[1],o,"illegal module name"))),r==="magic-word"&&s===2)return o!=null||(o={start:e,...this.getRootNode().posFromIndex(e)}),t.push(I(this,o,"missing module function")),t;let d=this.getDuplicatedArgs();return d.length>0&&(o!=null||(o={start:e,...this.getRootNode().posFromIndex(e)}),t.push(...d.flatMap(([,g])=>g).map(g=>v(g,o,"duplicated parameter")))),t}insertAt(e,t=this.length){return super.insertAt(e,t),e.anon?N(this,Nt,xn).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getAllArgs(){return this.childNodes.filter(Ce("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:e})=>e)}getArgs(e,t=!1,r=!0){let n=String(e).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),s;return u(this,Ee).has(n)?s=u(this,Ee).get(n):(s=new Set(this.getAllArgs().filter(({name:o})=>n===o)),u(this,Ee).set(n,s)),s}getDuplicatedArgs(){return this.isTemplate()?[...u(this,Ee)].filter(([,{size:e}])=>e>1).map(([e,t])=>[e,[...t]]):[]}getPossibleValues(){let{type:e,name:t,childNodes:r,constructor:{name:n}}=this;if(e==="template")throw new Error(`${n}.getPossibleValues \u65B9\u6CD5\u4EC5\u4F9B\u7279\u5B9A\u9B54\u672F\u5B57\u4F7F\u7528\uFF01`);let s;switch(t){case"if":case"ifexist":case"ifexpr":case"iferror":s=2;break;case"ifeq":s=3;break;default:throw new Error(`${n}.getPossibleValues \u65B9\u6CD5\u4EC5\u4F9B\u7279\u5B9A\u9B54\u672F\u5B57\u4F7F\u7528\uFF01`)}let o=r.slice(s,s+2).map(({childNodes:[,a]})=>a);for(let a=0;a<o.length;){let{length:d,0:g}=o[a].childNodes.filter(p=>p.text().trim());if(d===0)o.splice(a,1);else if(d>1||g.type!=="magic-word")a++;else try{let p=g.getPossibleValues();o.splice(a,1,...p),a+=p.length}catch(p){a++}}return o}print(){let{childNodes:e,length:t,firstChild:r,modifier:n,type:s}=this;return`<span class="wpb-${s}">{{${n}${s==="magic-word"?`${r.print()}${t===1?"":":"}${pe(e.slice(1),{sep:"|"})}`:pe(e,{sep:"|"})}}}</span>`}json(){return{...super.json(),modifier:this.modifier||void 0}}};Fe=new WeakMap,Ee=new WeakMap,wt=new WeakSet,Tn=function(){let e=this.type==="template",t=this.childNodes[e?0:1];return this.normalizeTitle(t.text(),e?10:828)},Nt=new WeakSet,xn=function(e){let t=this.getAnonArgs(),r=typeof e!="number";for(let n=r?t.indexOf(e):e-1;n<t.length;n++){let s=t[n],{name:o}=s,a=String(n+1);o!==a&&(s.setAttribute("name",a),this.getArgs(a,!1,!1).add(s))}}});var Ft,kn=b(()=>{"use strict";je();w();Ft=class extends ge(T){constructor(){super(...arguments);f(this,"type","hidden")}}});var Et,yn=b(()=>{"use strict";Z();R();A();w();he();kn();Et=class extends T{constructor(e,t=h.getConfig(),r=[]){super(void 0,t,r,{});f(this,"type","arg");for(let n=0;n<e.length;n++)if(n===0){let s=new G(e[n],"arg-name",t,r,{});super.insertAt(s)}else if(n>1){let s=new Ft(e[n],t,r,{});super.insertAt(s)}else{let s=new T(e[n],t,r);s.type="arg-default",s.setAttribute("stage",2),super.insertAt(s)}}get default(){var e,t;return(t=(e=this.childNodes[1])==null?void 0:e.text())!=null?t:!1}toString(e){return`{{{${super.toString(e,"|")}}}}`}text(){return`{{{${de(this.childNodes.slice(0,2),"|")}}}}`}getAttribute(e){return e==="padding"?3:super.getAttribute(e)}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){if(!this.getAttribute("include"))return[I(this,{start:e},"unexpected template argument")];let{childNodes:[t,r,...n]}=this,s=t.lint(e+3);if(r&&s.push(...r.lint(e+4+String(t).length)),n.length>0){let o={start:e,...this.getRootNode().posFromIndex(e)};s.push(...n.map(a=>{let d=v(a,o,"invisible content inside triple braces");return{...d,startIndex:d.startIndex-1,startCol:d.startCol-1}}))}return s}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(){return{...super.json(),default:this.default}}}});var An={};_(An,{parseBraces:()=>yr});var yr,Ar=b(()=>{"use strict";Z();A();kr();bn();yn();yr=(l,i=h.getConfig(),e=[])=>{var m,c,x,y,C,q;let t=`${(m=i.excludes)!=null&&m.includes("heading")?"":"^(\0\\d+c\x7F)*={1,6}|"}\\[\\[|\\{{2,}|-\\{(?!\\{)`,{parserFunction:[,,,r]}=i,n=[],s={"=":`
9
- `,"{":"\\}{2,}|\\|","-":"\\}-","[":"\\]\\]"},o=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"]]),a=new RegExp(t,"gmu"),d=a.exec(l),g=l.includes("}}"),p;for(;d||p!==void 0&&p<=l.length&&((x=(c=n[n.length-1])==null?void 0:c[0])!=null&&x.startsWith("="));){if(d!=null&&d[1]){let[,{length:Q}]=d;d[0]=d[0].slice(Q),d.index+=Q}let{0:L,index:$}=d!=null?d:{0:`
10
- `,index:l.length},F=(y=n.pop())!=null?y:{},{0:B,index:E,parts:O,findEqual:M,pos:se}=F,te=L==="="&&M,tt=Q=>{O[O.length-1].push(Q.slice(se,$))};if(L==="]]"||L==="}-")p=$+2;else if(L===`
11
- `){p=$+1;let{pos:Q,findEqual:W}=(C=n[n.length-1])!=null?C:{};if(Q===void 0||W||J(l.slice(Q,E))!==""){let ae=/^(={1,6})(.+)\1((?:\s|\0\d+c\x7F)*)$/u.exec(l.slice(E,$));ae&&(l=`${l.slice(0,E)}\0${e.length}h\x7F${l.slice($)}`,p=E+4+String(e.length).length,new Me(ae[1].length,ae.slice(2),i,e))}}else if(L==="|"||te)p=$+1,tt(l),L==="|"&&O.push([]),F.pos=p,F.findEqual=L==="|",n.push(F);else if(L.startsWith("}}")){let Q=L.slice(0,Math.min(B.length,3)),W=B.length-Q.length,{length:ae}=e;p=$+Q.length,tt(l);let rt=!1,Te="t";if(Q.length===3){let U=O.map(ar=>ar.join("=")),$e=U.length>1&&J(U[1]).trim();new Et(U,i,e),$e&&$e.endsWith(":")&&r.includes($e.slice(0,-1).toLowerCase())&&(Te="s")}else try{new Ct(O[0][0],O.slice(1),i,e);let U=J(O[0][0]).trim();o.has(U)?Te=o.get(U):/^(?:filepath|(?:full|canonical)urle?):.|^server$/iu.test(U)?Te="m":/^#vardefine:./iu.test(U)&&(Te="c")}catch(U){if(U instanceof SyntaxError&&U.message.startsWith("\u975E\u6CD5\u7684\u6A21\u677F\u540D\u79F0\uFF1A"))rt=!0;else throw U}rt||(l=`${l.slice(0,E+W)}\0${ae}${Te}\x7F${l.slice(p)}`,p=E+W+3+String(ae).length,W>1?n.push({0:B.slice(0,W),index:E,pos:E+W,parts:[[]]}):W===1&&l[E-1]==="-"&&n.push({0:"-{",index:E-1,pos:E+1,parts:[[]]}))}else p=$+L.length,L.startsWith("{")&&(d.pos=p,d.parts=[[]]),n.push(..."0"in F?[F]:[],d);g&&(g=l.slice(p).includes("}}"));let oe=n[n.length-1];!g&&((q=oe==null?void 0:oe[0])!=null&&q.startsWith("{"))&&(n.pop(),oe=n[n.length-1]),a=new RegExp(t+(oe?`|${s[oe[0][0]]}${oe.findEqual?"|=":""}`:""),"gmu"),a.lastIndex=p,d=a.exec(l)}return l}});var vn={};_(vn,{InputboxToken:()=>vr});var vr,Sn=b(()=>{"use strict";Ar();A();br();vr=class extends at{constructor(i,e=h.getConfig(),t=[]){let r=Symbol("InputboxToken");t.push(r),i&&(i=yr(i,e,t)),t.splice(t.indexOf(r),1),super(i,e,t,{})}}});var ze,Sr=b(()=>{"use strict";R();je();A();ke();ze=class extends ge(V){constructor(e,t=!0,r=h.getConfig(),n=[]){super(e,r,n);f(this,"type","comment");f(this,"closed");this.closed=t}getAttribute(e){return e==="padding"?4:super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){return this.closed?[]:[I(this,{start:e},h.msg("unclosed $1","HTML comment"))]}toString(e){return`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"&lt;!--",post:this.closed?"--&gt;":""})}}});var Lt={};_(Lt,{NestedToken:()=>$r});var $r,It=b(()=>{"use strict";R();A();w();Cr();Ne();Sr();$r=class extends T{constructor(e,t,r,n=h.getConfig(),s=[]){var o;e=(o=e==null?void 0:e.replace(t,(a,d,g,p,m)=>{let c=`\0${s.length+1}${d?"e":"c"}\x7F`;if(d)new We(d,g,p,m,n,s);else{let x=a.endsWith("-->");new ze(a.slice(4,x?-3:void 0),x,n,s)}return c}))==null?void 0:o.replace(/(^|\0\d+[ce]\x7F)([^\0]+)(?=$|\0\d+[ce]\x7F)/gu,(a,d,g)=>(new D(g,n,s),`${d}\0${s.length}c\x7F`));super(e,n,s,{});f(this,"type","ext-inner")}lint(e=this.getAbsoluteIndex()){let t;return[...super.lint(e),...this.childNodes.filter(r=>{if(r.type==="ext"||r.type==="comment")return!1;let n=String(r).trim();return n&&!/^<!--.*-->$/su.test(n)}).map(r=>(t!=null||(t={start:e,...this.getRootNode().posFromIndex(e)}),v(r,t,h.msg("invalid content in <$1>",this.name))))]}}});var Le,ne,Ie,ve,Pt=b(()=>{"use strict";R();le();A();w();he();ve=class extends T{constructor(e,t,r=h.getConfig(),n=[],s="|"){super(void 0,r,n,{});k(this,Le,!0);k(this,ne,void 0);k(this,Ie,void 0);if(this.insertAt(new G(e,"link-target",r,n,{})),t!==void 0){let o=new T(t,r,n,{});o.type="link-text",o.setAttribute("stage",10),this.insertAt(o)}S(this,ne,s)}afterBuild(){S(this,Ie,this.getTitle()),u(this,ne).includes("\0")&&S(this,ne,this.buildFromStr(u(this,ne),0))}setAttribute(e,t){e==="bracket"?S(this,Le,!!t):e==="title"?S(this,Ie,t):super.setAttribute(e,t)}toString(e){let t=super.toString(e,u(this,ne));return u(this,Le)?`[[${t}]]`:t}text(){let e=super.text("|");return u(this,Le)?`[[${e}]]`:e}getAttribute(e){return e==="title"?u(this,Ie):e==="padding"?2:super.getAttribute(e)}getGaps(e){return e===0?u(this,ne).length:1}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{childNodes:[r,n],type:s}=this,{encoded:o,fragment:a}=u(this,Ie),d;return s==="link"&&r.childNodes.some(({type:g})=>g==="template")&&(d={start:e,...this.getRootNode().posFromIndex(e)},t.push(v(r,d,"template in an internal link target","warning"))),o&&(d!=null||(d={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(r,d,"unnecessary URL encoding in an internal link"))),s==="link"&&(n!=null&&n.childNodes.some(({type:g,data:p})=>g==="text"&&p.includes("|")))?(d!=null||(d={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(n,d,'additional "|" in the link text',"warning"))):s!=="link"&&a!==void 0&&(d!=null||(d={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(r,d,"useless fragment"))),t}getTitle(){return this.normalizeTitle(this.firstChild.text(),0,!1,!0,!0)}print(){return super.print(u(this,Le)?{pre:"[[",post:"]]",sep:u(this,ne)}:{sep:u(this,ne)})}};Le=new WeakMap,ne=new WeakMap,Ie=new WeakMap});function $n(l,i,e=h.getConfig(),t=!1){i=i.trim();let r=i.replace(/\0\d+t\x7F/gu,"").trim();switch(l){case"width":return!r||/^(?:\d+x?|\d*x\d+)$/u.test(r);case"link":{if(!r||new RegExp(`^(?:(?:${e.protocol}|//)${xe}|\0\\d+m\x7F)${be}$`,"iu").test(r))return i;r.startsWith("[[")&&r.endsWith("]]")&&(r=r.slice(2,-2));let s=h.normalizeTitle(r,0,!1,e,t,!0,!0);return s.valid&&s}case"lang":return!r||e.variants.includes(r);case"alt":case"class":case"manualthumb":return!0;default:return!Number.isNaN(Number(r))}}var Ui,K,Rt,Cn=b(()=>{"use strict";Z();R();A();w();Ui=new Set(["alt","link","lang","page","caption"]);Rt=class extends T{constructor(e,t=h.getConfig(),r=[]){var i=(...args)=>{super(...args);f(this,"type","image-parameter");k(this,K,"")};var a;let n,s=Object.entries(t.img).map(([d,g])=>[d,g,new RegExp(`^(\\s*)${d.replace("$1","(.*)")}(\\s*)$`,"u")]),o=s.find(([,d,g])=>(n=g.exec(e),n&&(n.length!==4||$n(d,n[2],t,!0)!==!1)));if(o&&n){n.length===3?(i(void 0,t,r),S(this,K,e)):(i(n[2],t,r,{}),S(this,K,`${n[1]}${o[0]}${n[3]}`)),this.setAttribute("name",o[1]);return}i(e,{...t,excludes:[...(a=t.excludes)!=null?a:[],"list"]},r),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get link(){return this.name==="link"?$n("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var e;((e=this.parentNode)==null?void 0:e.type)==="gallery-image"&&!Ui.has(this.name)&&this.setAttribute("name","invalid")}toString(e){return u(this,K)?u(this,K).replace("$1",super.toString(e)):super.toString(e)}text(){return u(this,K)?u(this,K).replace("$1",super.text()).trim():super.text().trim()}getAttribute(e){return e==="plain"?this.name==="caption":e==="padding"?Math.max(0,u(this,K).indexOf("$1")):super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{link:r,name:n}=this;return n==="invalid"?t.push(I(this,{start:e},"invalid gallery image parameter")):typeof r=="object"&&r.encoded&&t.push(I(this,{start:e},"unnecessary URL encoding in an internal link")),t}print(){return u(this,K)?this.name==="invalid"?`<span class="wpb-image-invalid">${u(this,K).replace("$1",pe(this.childNodes))}</span>`:`<span class="wpb-image-parameter">${u(this,K).replace("$1",`<span class="wpb-image-caption">${pe(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}};K=new WeakMap});var wr,Nr,Fr,Di,_e,Gt,Ue,Er=b(()=>{"use strict";Z();R();A();Pt();Cn();wr=new Set(["manualthumb","frameless","framed","thumbnail"]),Nr=new Set(["left","right","center","none"]),Fr=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),Di=(l,i,e,t)=>{if(t===void 0)return[];let r=new RegExp(`${[l,i,e].map(Xr).join("|")}`,"gu"),n=[],s=r.exec(t),o=0,a=0;for(;s;){let{0:d,index:g}=s;d!==e?o+=d===l?1:-1:o===0&&(n.push(t.slice(a,g)),{lastIndex:a}=r),s=r.exec(t)}return n.push(t.slice(a)),n},Ue=class extends ve{constructor(e,t,r=h.getConfig(),n=[],s="|"){super(e,void 0,r,n,s);k(this,_e);f(this,"type","file");this.append(...Di("-{","}-","|",t).map(o=>new Rt(o,r,n)))}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),r=this.getAllArgs().filter(({childNodes:p})=>{let m=p.filter(c=>c.text().trim());return m.length!==1||m[0].type!=="arg"}),n=[...new Set(r.map(({name:p})=>p))].filter(p=>p!=="invalid"),s=n.filter(p=>wr.has(p)),o=n.filter(p=>Nr.has(p)),a=n.filter(p=>Fr.has(p));if(r.length===n.length&&s.length<2&&o.length<2&&a.length<2)return t;let d={start:e,...this.getRootNode().posFromIndex(e)},g=(p,m)=>c=>v(c,d,h.msg(`${p} image $1 parameter`,m));for(let p of n){let m=r.filter(({name:c})=>c===p);p==="caption"&&(m=[...m.slice(0,-1).filter(c=>c.text()),...m.slice(-1)]),m.length>1&&t.push(...m.map(g("duplicated",p)))}return s.length>1&&t.push(...r.filter(({name:p})=>wr.has(p)).map(g("conflicting","frame"))),o.length>1&&t.push(...r.filter(({name:p})=>Nr.has(p)).map(g("conflicting","horizontal-alignment"))),a.length>1&&t.push(...r.filter(({name:p})=>Fr.has(p)).map(g("conflicting","vertical-alignment"))),t}getAllArgs(){return this.childNodes.slice(1)}getArgs(e){return this.getAllArgs().filter(({name:t})=>e===t)}getFrameArgs(){return N(this,_e,Gt).call(this,wr,"\u6846\u67B6")}getHorizAlignArgs(){return N(this,_e,Gt).call(this,Nr,"\u6C34\u5E73\u5BF9\u9F50")}getVertAlignArgs(){return N(this,_e,Gt).call(this,Fr,"\u5782\u76F4\u5BF9\u9F50")}};_e=new WeakSet,Gt=function(e,t){return this.getAllArgs().filter(({name:n})=>e.has(n))}});var jt,wn,De,Lr=b(()=>{"use strict";R();le();A();w();Er();De=class extends Ue{constructor(e,t,r,n=h.getConfig(),s=[]){let o;if(r!==void 0){o=new T(r,n,s),o.type="plain";for(let a=1;a<11;a++)o.parseOnce();s.splice(s.indexOf(o),1)}super(t,o==null?void 0:o.toString(),n,s);k(this,jt);this.setAttribute("bracket",!1),this.type=`${e}-image`}getTitle(){let e=this.type==="imagemap-image";return this.normalizeTitle(String(this.firstChild),e?0:6,!0,!e)}getAttribute(e){return e==="padding"?0:super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{ns:r}=this.getAttribute("title");return r!==6&&t.push(I(this,{start:e},"invalid gallery image")),t}afterBuild(){N(this,jt,wn).call(this,this.getTitle())}};jt=new WeakSet,wn=function(e){this.setAttribute("title",e)}});var Fn={};_(Fn,{GalleryToken:()=>Ir});var qt,Nn,Ir,En=b(()=>{"use strict";A();w();Lr();Ne();Ir=class extends T{constructor(e,t=h.getConfig(),r=[]){var n;super(void 0,t,r,{});k(this,qt);f(this,"type","ext-inner");for(let s of(n=e==null?void 0:e.split(`
12
- `))!=null?n:[]){let o=/^([^|]+)(?:\|(.*))?/u.exec(s);if(!o){super.insertAt(s.trim()?new D(s,t):s);continue}let[,a,d]=o;N(this,qt,Nn).call(this,a)?super.insertAt(new De("gallery",a,d,t,r)):super.insertAt(new D(s,t))}}toString(e){return super.toString(e,`
8
+ `})}}});var he,dt=b(()=>{"use strict";A();C();he=class extends T{constructor(i,e,t="plain",r=h.getConfig(),n=[],s){super(i,r,n,s),this.type=t}lint(){return[]}}});var pt,Oe,$t,Me,yr=b(()=>{"use strict";R();A();C();dt();Me=class extends T{constructor(e,t,r=h.getConfig(),n=[]){super(void 0,r,n);y(this,Oe);f(this,"type","heading");y(this,pt,void 0);S(this,pt,e);let s=new T(t[0],r,n);s.type="heading-title",s.setAttribute("stage",2);let o=new he(t[1],/^[^\S\n]*$/u,"heading-trail",r,n,{});this.append(s,o)}get level(){return u(this,pt)}toString(e){let t=u(this,Oe,$t);return`${t}${this.firstChild.toString()}${t}${this.lastChild.toString()}`}text(){let e=u(this,Oe,$t);return`${e}${this.firstChild.text()}${e}`}getAttribute(e){return e==="padding"?super.getAttribute("padding")+this.level:super.getAttribute(e)}getGaps(){return this.level}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{firstChild:r,level:n}=this,s=String(r),o=r.childNodes.filter(p=>p.type==="quote"),a=o.filter(({bold:p})=>p),d=o.filter(({italic:p})=>p),g;return this.level===1&&(g={start:e,...this.getRootNode().posFromIndex(e)},t.push(v(r,g,"<h1>"))),(s.startsWith("=")||s.endsWith("="))&&(g!=null||(g={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(r,g,h.msg("unbalanced $1 in a section header",'"="')))),this.closest("html-attrs, table-attrs")&&(g!=null||(g={start:e,...this.getRootNode().posFromIndex(e)}),t.push(N(this,g,"section header in a HTML tag"))),a.length%2&&(g!=null||(g={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(a[a.length-1],{...g,start:e+n,left:g.left+n},h.msg("unbalanced $1 in a section header","bold apostrophes")))),d.length%2&&(g!=null||(g={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(d[d.length-1],{start:e+n},h.msg("unbalanced $1 in a section header","italic apostrophes")))),t}print(){let e=u(this,Oe,$t);return super.print({pre:e,sep:e})}json(){return{...super.json(),level:this.level}}};pt=new WeakMap,Oe=new WeakSet,$t=function(){return"=".repeat(this.level)}});var Zi,wt,kn=b(()=>{"use strict";V();R();A();C();Zi=l=>l.toString(new Set(["comment","noinclude","include"])).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),wt=class extends T{constructor(e,t,r=h.getConfig(),n=[]){super(void 0,r,n);f(this,"type","parameter");let s=new T(typeof e=="number"?void 0:e,r,n,{}),o=new T(t,r,n);s.type="parameter-key",o.type="parameter-value",o.setAttribute("stage",2),this.append(s,o)}get anon(){return this.firstChild.length===0}afterBuild(){if(!this.anon){let{parentNode:e,firstChild:t}=this,r=Zi(t);this.setAttribute("name",r),e&&e.getArgs(r,!1,!1).add(this)}}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()){var s;let t=super.lint(e),{firstChild:r}=this,n=(s=new RegExp(`https?://${xe}${be}$`,"iu").exec(r.toString(new Set(["comment","noinclude","include"]))))==null?void 0:s[0];if(n&&new URL(n).search){let o=v(r,{start:e},"unescaped query string in an anonymous parameter");t.push({...o,startIndex:o.endIndex,endIndex:o.endIndex+1,startLine:o.endLine,startCol:o.endCol,endCol:o.endCol+1})}return t}print(){return super.print({sep:this.anon?"":"="})}json(){return{...super.json(),anon:this.anon}}}});var Vi,Fe,Ee,Nt,yn,Ft,An,Ct,vn=b(()=>{"use strict";V();R();Ce();de();A();C();kn();me();dt();Vi=new Set(["pageid","articlepath","server","servername","scriptpath","stylepath"]),Ct=class extends T{constructor(e,t,r=h.getConfig(),n=[]){var m,c;super(void 0,r,n,{});y(this,Nt);y(this,Ft);f(this,"type","template");f(this,"modifier","");y(this,Fe,!1);y(this,Ee,new Map);let{parserFunction:[s,o]}=r,a=(m=/^(?:\s|\0\d+c\x7F)*\0\d+s\x7F/u.exec(e))==null?void 0:m[0];if(a)this.setAttribute("modifier",a),e=e.slice(a.length);else if(e.includes(":")){let[x,...k]=e.split(":"),[w]=/^(?:\s|\0\d+c\x7F)*/u.exec((c=k[0])!=null?c:"");this.setModifier(`${x}:${w}`)&&(e=k.join(":").slice(w.length))}let d=e.includes(":");if(d||t.length===0&&!u(this,Fe)){let[x,...k]=e.split(":"),w=Y(x),q=w[k.length>0?"trimStart":"trim"](),I=q.toLowerCase(),$=s[I],E=o.includes(q);if(E||Vi.has($)||d&&$){this.setAttribute("name",$!=null?$:I),this.type="magic-word";let L=new RegExp(`^\\s*${q}\\s*$`,E?"u":"iu"),O=new he(x,L,"magic-word-name",r,n,{});if(super.insertAt(O),k.length>0&&t.unshift([k.join(":")]),this.name==="invoke")for(let M=0;M<2;M++){let oe=t.shift();if(!oe)break;let re=new G(oe.join("="),`invoke-${M?"function":"module"}`,r,n);super.insertAt(re)}}}if(this.type==="template"){let x=Y(ft(e)).split("#")[0].trim();if(!x||/^:[\s_]*:|\0\d+[eh!+-]\x7F|[<>[\]{}\n]|%[\da-f]{2}/iu.test(x))throw n.pop(),new SyntaxError("\u975E\u6CD5\u7684\u6A21\u677F\u540D\u79F0");let k=new G(e,"template-name",r,n,{});super.insertAt(k)}let g=this.isTemplate(),p=1;for(let x=0;x<t.length;x++){let k=t[x];!g&&!(this.name==="switch"&&x>0)&&(k[0]=k.join("="),k.length=1),k.length===1&&(k.unshift(p),p++),this.insertAt(new wt(...k,r,n))}}setModifier(e){let{parserFunction:[,,t,r]}=this.getAttribute("config"),n=Y(e).trim();if(e&&!n.endsWith(":"))return!1;let s=n.slice(0,-1).toLowerCase(),o=t.includes(s),a=r.includes(s);return u(this,Fe)&&o||!u(this,Fe)&&(a||e==="")||this.length>1&&(o||a||e==="")?(this.setAttribute("modifier",e),S(this,Fe,o),!!e):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0))}toString(e){return`{{${this.modifier}${this.type==="magic-word"?`${this.firstChild.toString(e)}${this.length===1?"":":"}${this.childNodes.slice(1).map(t=>t.toString(e)).join("|")}`:super.toString(e,"|")}}}`}text(){let{childNodes:e,length:t,firstChild:r,modifier:n,type:s,name:o}=this;return s==="magic-word"&&o==="vardefine"?"":`{{${n}${s==="magic-word"?`${r.text()}${t===1?"":":"}${pe(e.slice(1),"|")}`:super.text("|")}}}`}getAttribute(e){switch(e){case"padding":return this.modifier.length+2;default:return super.getAttribute(e)}}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{type:r,childNodes:n,length:s}=this,o;if(!this.isTemplate())return t;let a=F(this,Nt,yn).call(this);if(a.fragment!==void 0&&(o={start:e,...this.getRootNode().posFromIndex(e)},t.push(v(n[r==="template"?0:1],o,"useless fragment"))),a.valid||(o!=null||(o={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(n[1],o,"illegal module name"))),r==="magic-word"&&s===2)return o!=null||(o={start:e,...this.getRootNode().posFromIndex(e)}),t.push(N(this,o,"missing module function")),t;let d=this.getDuplicatedArgs();return d.length>0&&(o!=null||(o={start:e,...this.getRootNode().posFromIndex(e)}),t.push(...d.flatMap(([,g])=>g).map(g=>v(g,o,"duplicated parameter")))),t}insertAt(e,t=this.length){return super.insertAt(e,t),e.anon?F(this,Ft,An).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getAllArgs(){return this.childNodes.filter(we("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:e})=>e)}getArgs(e,t=!1,r=!0){let n=String(e).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),s;return u(this,Ee).has(n)?s=u(this,Ee).get(n):(s=new Set(this.getAllArgs().filter(({name:o})=>n===o)),u(this,Ee).set(n,s)),s}getDuplicatedArgs(){return this.isTemplate()?[...u(this,Ee)].filter(([,{size:e}])=>e>1).map(([e,t])=>[e,[...t]]):[]}getPossibleValues(){let{type:e,name:t,childNodes:r,constructor:{name:n}}=this;if(e==="template")throw new Error(`${n}.getPossibleValues \u65B9\u6CD5\u4EC5\u4F9B\u7279\u5B9A\u9B54\u672F\u5B57\u4F7F\u7528\uFF01`);let s;switch(t){case"if":case"ifexist":case"ifexpr":case"iferror":s=2;break;case"ifeq":s=3;break;default:throw new Error(`${n}.getPossibleValues \u65B9\u6CD5\u4EC5\u4F9B\u7279\u5B9A\u9B54\u672F\u5B57\u4F7F\u7528\uFF01`)}let o=r.slice(s,s+2).map(({childNodes:[,a]})=>a);for(let a=0;a<o.length;){let{length:d,0:g}=o[a].childNodes.filter(p=>p.text().trim());if(d===0)o.splice(a,1);else if(d>1||g.type!=="magic-word")a++;else try{let p=g.getPossibleValues();o.splice(a,1,...p),a+=p.length}catch(p){a++}}return o}print(){let{childNodes:e,length:t,firstChild:r,modifier:n,type:s}=this;return`<span class="wpb-${s}">{{${n}${s==="magic-word"?`${r.print()}${t===1?"":":"}${ge(e.slice(1),{sep:"|"})}`:ge(e,{sep:"|"})}}}</span>`}json(){return{...super.json(),modifier:this.modifier||void 0}}};Fe=new WeakMap,Ee=new WeakMap,Nt=new WeakSet,yn=function(){let e=this.type==="template",t=this.childNodes[e?0:1];return this.normalizeTitle(t.text(),e?10:828)},Ft=new WeakSet,An=function(e){let t=this.getAnonArgs(),r=typeof e!="number";for(let n=r?t.indexOf(e):e-1;n<t.length;n++){let s=t[n],{name:o}=s,a=String(n+1);o!==a&&(s.setAttribute("name",a),this.getArgs(a,!1,!1).add(s))}}});var Et,Sn=b(()=>{"use strict";je();C();Et=class extends ue(T){constructor(){super(...arguments);f(this,"type","hidden")}}});var Lt,$n=b(()=>{"use strict";V();R();A();C();me();Sn();Lt=class extends T{constructor(e,t=h.getConfig(),r=[]){super(void 0,t,r,{});f(this,"type","arg");for(let n=0;n<e.length;n++)if(n===0){let s=new G(e[n],"arg-name",t,r,{});super.insertAt(s)}else if(n>1){let s=new Et(e[n],t,r,{});super.insertAt(s)}else{let s=new T(e[n],t,r);s.type="arg-default",s.setAttribute("stage",2),super.insertAt(s)}}get default(){var e,t;return(t=(e=this.childNodes[1])==null?void 0:e.text())!=null?t:!1}toString(e){return`{{{${super.toString(e,"|")}}}}`}text(){return`{{{${pe(this.childNodes.slice(0,2),"|")}}}}`}getAttribute(e){return e==="padding"?3:super.getAttribute(e)}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){if(!this.getAttribute("include"))return[N(this,{start:e},"unexpected template argument")];let{childNodes:[t,r,...n]}=this,s=t.lint(e+3);if(r&&s.push(...r.lint(e+4+String(t).length)),n.length>0){let o={start:e,...this.getRootNode().posFromIndex(e)};s.push(...n.map(a=>{let d=v(a,o,"invisible content inside triple braces");return{...d,startIndex:d.startIndex-1,startCol:d.startCol-1}}))}return s}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(){return{...super.json(),default:this.default}}}});var wn={};_(wn,{parseBraces:()=>Ar});var Ar,vr=b(()=>{"use strict";V();A();yr();vn();$n();Ar=(l,i=h.getConfig(),e=[])=>{var m,c,x,k,w,q;let t=`${(m=i.excludes)!=null&&m.includes("heading")?"":"^(\0\\d+c\x7F)*={1,6}|"}\\[\\[|\\{{2,}|-\\{(?!\\{)`,{parserFunction:[,,,r]}=i,n=[],s={"=":`
9
+ `,"{":"\\}{2,}|\\|","-":"\\}-","[":"\\]\\]"},o=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"]]),a=new RegExp(t,"gmu"),d=a.exec(l),g=l.includes("}}"),p;for(;d||p!==void 0&&p<=l.length&&((x=(c=n[n.length-1])==null?void 0:c[0])!=null&&x.startsWith("="));){if(d!=null&&d[1]){let[,{length:K}]=d;d[0]=d[0].slice(K),d.index+=K}let{0:I,index:$}=d!=null?d:{0:`
10
+ `,index:l.length},E=(k=n.pop())!=null?k:{},{0:B,index:L,parts:O,findEqual:M,pos:oe}=E,re=I==="="&&M,tt=K=>{O[O.length-1].push(K.slice(oe,$))};if(I==="]]"||I==="}-")p=$+2;else if(I===`
11
+ `){p=$+1;let{pos:K,findEqual:W}=(w=n[n.length-1])!=null?w:{};if(K===void 0||W||Y(l.slice(K,L))!==""){let le=/^(={1,6})(.+)\1((?:\s|\0\d+c\x7F)*)$/u.exec(l.slice(L,$));le&&(l=`${l.slice(0,L)}\0${e.length}h\x7F${l.slice($)}`,p=L+4+String(e.length).length,new Me(le[1].length,le.slice(2),i,e))}}else if(I==="|"||re)p=$+1,tt(l),I==="|"&&O.push([]),E.pos=p,E.findEqual=I==="|",n.push(E);else if(I.startsWith("}}")){let K=I.slice(0,Math.min(B.length,3)),W=B.length-K.length,{length:le}=e;p=$+K.length,tt(l);let rt=!1,Te="t";if(K.length===3){let U=O.map(lr=>lr.join("=")),$e=U.length>1&&Y(U[1]).trim();new Lt(U,i,e),$e&&$e.endsWith(":")&&r.includes($e.slice(0,-1).toLowerCase())&&(Te="s")}else try{new Ct(O[0][0],O.slice(1),i,e);let U=Y(O[0][0]).trim();o.has(U)?Te=o.get(U):/^(?:filepath|(?:full|canonical)urle?):.|^server$/iu.test(U)?Te="m":/^#vardefine:./iu.test(U)&&(Te="c")}catch(U){if(U instanceof SyntaxError&&U.message==="\u975E\u6CD5\u7684\u6A21\u677F\u540D\u79F0")rt=!0;else throw U}rt||(l=`${l.slice(0,L+W)}\0${le}${Te}\x7F${l.slice(p)}`,p=L+W+3+String(le).length,W>1?n.push({0:B.slice(0,W),index:L,pos:L+W,parts:[[]]}):W===1&&l[L-1]==="-"&&n.push({0:"-{",index:L-1,pos:L+1,parts:[[]]}))}else p=$+I.length,I.startsWith("{")&&(d.pos=p,d.parts=[[]]),n.push(..."0"in E?[E]:[],d);g&&(g=l.slice(p).includes("}}"));let ae=n[n.length-1];!g&&((q=ae==null?void 0:ae[0])!=null&&q.startsWith("{"))&&(n.pop(),ae=n[n.length-1]),a=new RegExp(t+(ae?`|${s[ae[0][0]]}${ae.findEqual?"|=":""}`:""),"gmu"),a.lastIndex=p,d=a.exec(l)}return l}});var Cn={};_(Cn,{InputboxToken:()=>Sr});var Sr,Nn=b(()=>{"use strict";vr();A();kr();Sr=class extends lt{constructor(i,e=h.getConfig(),t=[]){let r=Symbol("InputboxToken");t.push(r),i&&(i=Ar(i,e,t)),t.splice(t.indexOf(r),1),super(i,e,t,{})}}});var ze,$r=b(()=>{"use strict";R();je();A();ke();ze=class extends ue(Q){constructor(e,t=!0,r=h.getConfig(),n=[]){super(e,r,n);f(this,"type","comment");f(this,"closed");this.closed=t}getAttribute(e){return e==="padding"?4:super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){return this.closed?[]:[N(this,{start:e},h.msg("unclosed $1","HTML comment"))]}toString(e){return`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"&lt;!--",post:this.closed?"--&gt;":""})}}});var It={};_(It,{NestedToken:()=>wr});var wr,Pt=b(()=>{"use strict";R();A();C();Cr();Ne();$r();wr=class extends T{constructor(e,t,r,n=h.getConfig(),s=[]){var o;e=(o=e==null?void 0:e.replace(t,(a,d,g,p,m)=>{let c=`\0${s.length+1}${d?"e":"c"}\x7F`;if(d)new We(d,g,p,m,n,s);else{let x=a.endsWith("-->");new ze(a.slice(4,x?-3:void 0),x,n,s)}return c}))==null?void 0:o.replace(/(^|\0\d+[ce]\x7F)([^\0]+)(?=$|\0\d+[ce]\x7F)/gu,(a,d,g)=>(new H(g,n,s),`${d}\0${s.length}c\x7F`));super(e,n,s,{});f(this,"type","ext-inner")}lint(e=this.getAbsoluteIndex()){let t;return[...super.lint(e),...this.childNodes.filter(r=>{if(r.type==="ext"||r.type==="comment")return!1;let n=String(r).trim();return n&&!/^<!--.*-->$/su.test(n)}).map(r=>(t!=null||(t={start:e,...this.getRootNode().posFromIndex(e)}),v(r,t,h.msg("invalid content in <$1>",this.name))))]}}});var Le,ie,Ie,ve,Rt=b(()=>{"use strict";R();de();A();C();me();ve=class extends T{constructor(e,t,r=h.getConfig(),n=[],s="|"){super(void 0,r,n,{});y(this,Le,!0);y(this,ie,void 0);y(this,Ie,void 0);if(this.insertAt(new G(e,"link-target",r,n,{})),t!==void 0){let o=new T(t,r,n,{});o.type="link-text",o.setAttribute("stage",10),this.insertAt(o)}S(this,ie,s)}afterBuild(){S(this,Ie,this.getTitle()),u(this,ie).includes("\0")&&S(this,ie,this.buildFromStr(u(this,ie),0))}setAttribute(e,t){e==="bracket"?S(this,Le,!!t):e==="title"?S(this,Ie,t):super.setAttribute(e,t)}toString(e){let t=super.toString(e,u(this,ie));return u(this,Le)?`[[${t}]]`:t}text(){let e=super.text("|");return u(this,Le)?`[[${e}]]`:e}getAttribute(e){return e==="title"?u(this,Ie):e==="padding"?2:super.getAttribute(e)}getGaps(e){return e===0?u(this,ie).length:1}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{childNodes:[r,n],type:s}=this,{encoded:o,fragment:a}=u(this,Ie),d;return s==="link"&&r.childNodes.some(({type:g})=>g==="template")&&(d={start:e,...this.getRootNode().posFromIndex(e)},t.push(v(r,d,"template in an internal link target","warning"))),o&&(d!=null||(d={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(r,d,"unnecessary URL encoding in an internal link"))),s==="link"&&(n!=null&&n.childNodes.some(({type:g,data:p})=>g==="text"&&p.includes("|")))?(d!=null||(d={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(n,d,'additional "|" in the link text',"warning"))):s!=="link"&&a!==void 0&&(d!=null||(d={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(r,d,"useless fragment"))),s==="link"&&this.closest("ext-link-text")&&(d!=null||(d={start:e,...this.getRootNode().posFromIndex(e)}),t.push(N(this,d,"internal link in an external link"))),t}getTitle(){return this.normalizeTitle(this.firstChild.text(),0,!1,!0,!0)}print(){return super.print(u(this,Le)?{pre:"[[",post:"]]",sep:u(this,ie)}:{sep:u(this,ie)})}};Le=new WeakMap,ie=new WeakMap,Ie=new WeakMap});function Fn(l,i,e=h.getConfig(),t=!1){i=i.trim();let r=i.replace(/\0\d+t\x7F/gu,"").trim();switch(l){case"width":return!r||/^(?:\d+x?|\d*x\d+)$/u.test(r);case"link":{if(!r||new RegExp(`^(?:(?:${e.protocol}|//)${xe}|\0\\d+m\x7F)${be}$`,"iu").test(r))return i;r.startsWith("[[")&&r.endsWith("]]")&&(r=r.slice(2,-2));let s=h.normalizeTitle(r,0,!1,e,t,!0,!0);return s.valid&&s}case"lang":return!r||e.variants.includes(r);case"alt":case"class":case"manualthumb":return!0;default:return!Number.isNaN(Number(r))}}var Qi,J,Gt,En=b(()=>{"use strict";V();R();A();C();Qi=new Set(["alt","link","lang","page","caption"]);Gt=class extends T{constructor(e,t=h.getConfig(),r=[]){var i=(...args)=>{super(...args);f(this,"type","image-parameter");y(this,J,"")};var a;let n,s=Object.entries(t.img).map(([d,g])=>[d,g,new RegExp(`^(\\s*)${d.replace("$1","(.*)")}(\\s*)$`,"u")]),o=s.find(([,d,g])=>(n=g.exec(e),n&&(n.length!==4||Fn(d,n[2],t,!0)!==!1)));if(o&&n){n.length===3?(i(void 0,t,r),S(this,J,e)):(i(n[2],t,r,{}),S(this,J,`${n[1]}${o[0]}${n[3]}`)),this.setAttribute("name",o[1]);return}i(e,{...t,excludes:[...(a=t.excludes)!=null?a:[],"list"]},r),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get link(){return this.name==="link"?Fn("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var e;((e=this.parentNode)==null?void 0:e.type)==="gallery-image"&&!Qi.has(this.name)&&this.setAttribute("name","invalid")}toString(e){return u(this,J)?u(this,J).replace("$1",super.toString(e)):super.toString(e)}text(){return u(this,J)?u(this,J).replace("$1",super.text()).trim():super.text().trim()}getAttribute(e){return e==="plain"?this.name==="caption":e==="padding"?Math.max(0,u(this,J).indexOf("$1")):super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{link:r,name:n}=this;return n==="invalid"?t.push(N(this,{start:e},"invalid gallery image parameter")):typeof r=="object"&&r.encoded&&t.push(N(this,{start:e},"unnecessary URL encoding in an internal link")),t}print(){return u(this,J)?this.name==="invalid"?`<span class="wpb-image-invalid">${u(this,J).replace("$1",ge(this.childNodes))}</span>`:`<span class="wpb-image-parameter">${u(this,J).replace("$1",`<span class="wpb-image-caption">${ge(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}};J=new WeakMap});var Nr,Fr,Er,Xi,_e,jt,Ue,Lr=b(()=>{"use strict";V();R();A();Rt();En();Nr=new Set(["manualthumb","frameless","framed","thumbnail"]),Fr=new Set(["left","right","center","none"]),Er=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),Xi=(l,i,e,t)=>{if(t===void 0)return[];let r=new RegExp(`${[l,i,e].map(Xr).join("|")}`,"gu"),n=[],s=r.exec(t),o=0,a=0;for(;s;){let{0:d,index:g}=s;d!==e?o+=d===l?1:-1:o===0&&(n.push(t.slice(a,g)),{lastIndex:a}=r),s=r.exec(t)}return n.push(t.slice(a)),n},Ue=class extends ve{constructor(e,t,r=h.getConfig(),n=[],s="|"){super(e,void 0,r,n,s);y(this,_e);f(this,"type","file");this.append(...Xi("-{","}-","|",t).map(o=>new Gt(o,r,n)))}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),r=this.getAllArgs().filter(({childNodes:p})=>{let m=p.filter(c=>c.text().trim());return m.length!==1||m[0].type!=="arg"}),n=[...new Set(r.map(({name:p})=>p))].filter(p=>p!=="invalid"),s=n.filter(p=>Nr.has(p)),o=n.filter(p=>Fr.has(p)),a=n.filter(p=>Er.has(p));if(r.length===n.length&&s.length<2&&o.length<2&&a.length<2)return t;let d={start:e,...this.getRootNode().posFromIndex(e)},g=(p,m)=>c=>v(c,d,h.msg(`${p} image $1 parameter`,m));for(let p of n){let m=r.filter(({name:c})=>c===p);p==="caption"&&(m=[...m.slice(0,-1).filter(c=>c.text()),...m.slice(-1)]),m.length>1&&t.push(...m.map(g("duplicated",p)))}return s.length>1&&t.push(...r.filter(({name:p})=>Nr.has(p)).map(g("conflicting","frame"))),o.length>1&&t.push(...r.filter(({name:p})=>Fr.has(p)).map(g("conflicting","horizontal-alignment"))),a.length>1&&t.push(...r.filter(({name:p})=>Er.has(p)).map(g("conflicting","vertical-alignment"))),t}getAllArgs(){return this.childNodes.slice(1)}getArgs(e){return this.getAllArgs().filter(({name:t})=>e===t)}getFrameArgs(){return F(this,_e,jt).call(this,Nr,"\u6846\u67B6")}getHorizAlignArgs(){return F(this,_e,jt).call(this,Fr,"\u6C34\u5E73\u5BF9\u9F50")}getVertAlignArgs(){return F(this,_e,jt).call(this,Er,"\u5782\u76F4\u5BF9\u9F50")}};_e=new WeakSet,jt=function(e,t){return this.getAllArgs().filter(({name:n})=>e.has(n))}});var qt,Ln,De,Ir=b(()=>{"use strict";R();de();A();C();Lr();De=class extends Ue{constructor(e,t,r,n=h.getConfig(),s=[]){let o;if(r!==void 0){o=new T(r,n,s),o.type="plain";for(let a=1;a<11;a++)o.parseOnce();s.splice(s.indexOf(o),1)}super(t,o==null?void 0:o.toString(),n,s);y(this,qt);this.setAttribute("bracket",!1),this.type=`${e}-image`}getTitle(){let e=this.type==="imagemap-image";return this.normalizeTitle(String(this.firstChild),e?0:6,!0,!e)}getAttribute(e){return e==="padding"?0:super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{ns:r}=this.getAttribute("title");return r!==6&&t.push(N(this,{start:e},"invalid gallery image")),t}afterBuild(){F(this,qt,Ln).call(this,this.getTitle())}};qt=new WeakSet,Ln=function(e){this.setAttribute("title",e)}});var Pn={};_(Pn,{GalleryToken:()=>Pr});var Bt,In,Pr,Rn=b(()=>{"use strict";A();C();Ir();Ne();Pr=class extends T{constructor(e,t=h.getConfig(),r=[]){var n;super(void 0,t,r,{});y(this,Bt);f(this,"type","ext-inner");for(let s of(n=e==null?void 0:e.split(`
12
+ `))!=null?n:[]){let o=/^([^|]+)(?:\|(.*))?/u.exec(s);if(!o){super.insertAt(s.trim()?new H(s,t):s);continue}let[,a,d]=o;F(this,Bt,In).call(this,a)?super.insertAt(new De("gallery",a,d,t,r)):super.insertAt(new H(s,t))}}toString(e){return super.toString(e,`
13
13
  `)}text(){return super.text(`
14
14
  `).replace(/\n\s*\n/gu,`
15
15
  `)}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){let{top:t,left:r}=this.getRootNode().posFromIndex(e),n=[];for(let s=0;s<this.length;s++){let o=this.childNodes[s],a=String(o),{length:d}=a,g=a.trim(),p=t+s,m=s?0:r;o.type==="noinclude"&&g&&!/^<!--.*-->$/u.test(g)?n.push({message:h.msg("invalid content in <$1>","gallery"),severity:"error",startIndex:e,endIndex:e+d,startLine:p,endLine:p,startCol:m,endCol:m+d}):o.type!=="noinclude"&&o.type!=="text"&&n.push(...o.lint(e)),e+=d+1}return n}print(){return super.print({sep:`
16
- `})}};qt=new WeakSet,Nn=function(e){return this.normalizeTitle(e,6,!0,!0).valid}});var He,Pr=b(()=>{"use strict";Pt();He=class extends ve{constructor(){super(...arguments);f(this,"type","link")}}});var Ln,In=b(()=>{"use strict";Ln=l=>{class i extends l{}return i}});var Ze,Rr=b(()=>{"use strict";R();A();w();Ze=class extends T{constructor(i,e=!1,t=h.getConfig(),r=[]){super(i,t,r,{}),this.type=e?"ext-link-url":"free-ext-link"}lint(i=this.getAbsoluteIndex()){let e=super.lint(i),t=`[\uFF0C\uFF1B\u3002\uFF1A\uFF01\uFF1F\uFF08\uFF09]+${this.type==="ext-link-url"?"|\\|+":""}`,r=new RegExp(t,"u"),n=new RegExp(t,"gu"),s;for(let o of this.childNodes){let{type:a,data:d}=o;if(a!=="text"||!r.test(d))continue;s!=null||(s={start:i,...this.getRootNode().posFromIndex(i)});let g=v(o,s,"","warning");n.lastIndex=0;for(let p=n.exec(d);p;p=n.exec(d)){let{index:m,0:c}=p,x=d.slice(0,m).split(`
17
- `),{length:y}=x,{length:C}=x[x.length-1],q=g.startIndex+m,L=g.startLine+y-1,$=y===1?g.startCol+C:C;e.push({...g,message:h.msg("$1 in URL",c.startsWith("|")?'"|"':h.msg("full-width punctuation")),startIndex:q,endIndex:q+c.length,startLine:L,endLine:L,startCol:$,endCol:$+c.length})}}return e}}});var ce,Ve,Gr=b(()=>{"use strict";le();In();A();w();Rr();Ve=class extends Ln(T){constructor(e,t="",r="",n=h.getConfig(),s=[]){super(void 0,n,s,{});f(this,"type","ext-link");k(this,ce,void 0);if(this.insertAt(new Ze(e,!0,n,s)),S(this,ce,t),r){let o=new T(r,n,s,{});o.type="ext-link-text",o.setAttribute("stage",10),this.insertAt(o)}}toString(e){return this.length===1?`[${super.toString(e)}${u(this,ce)}]`:`[${super.toString(e,u(this,ce))}]`}text(){return`[${super.text(" ")}]`}getAttribute(e){return e==="padding"?1:super.getAttribute(e)}getGaps(){return u(this,ce).length}print(){return super.print(this.length===1?{pre:"[",post:`${u(this,ce)}]`}:{pre:"[",sep:u(this,ce),post:"]"})}};ce=new WeakMap});var pt,Pn=b(()=>{"use strict";A();w();Ne();Pr();Gr();pt=class extends T{constructor(e,t,r,n=h.getConfig(),s=[]){super(void 0,n,s);f(this,"type","imagemap-link");this.append(e,t.length===2?new He(...t,n,s):new Ve(...t,n,s),new D(r,n,s))}}});var Rn={};_(Rn,{ImagemapToken:()=>jr});var jr,Gn=b(()=>{"use strict";R();we();A();w();Ne();Lr();Pn();jr=class extends T{constructor(e,t=h.getConfig(),r=[]){super(void 0,t,r,{});f(this,"type","ext-inner");if(!e)return;let n=e.split(`
18
- `),s=new Set(t.protocol.split("|")),o=D,a=!0,d=!1;for(let g of n){let p=g.trim();if(!(d||!p||p.startsWith("#"))){if(a){let[m,...c]=g.split("|"),x=this.normalizeTitle(m,0,!0);if(x.valid&&x.ns===6){let y=new De("imagemap",m,c.length>0?c.join("|"):void 0,t,r);super.insertAt(y),a=!1;continue}else d=!0}else if(g.trim().split(/[\t ]/u)[0]==="desc"){super.insertAt(g);continue}else if(g.includes("[")){let m=g.indexOf("["),c=g.slice(m),x=/^\[{2}([^|]+)(?:\|([^\]]+))?\]{2}[\w\s]*$/u.exec(c);if(x){if(this.normalizeTitle(x[1],0,!0,!1,!0).valid){super.insertAt(new pt(g.slice(0,m),x.slice(1),c.slice(c.indexOf("]]")+2),t,r));continue}}else if(s.has(c.slice(1,c.indexOf(":")+1))||s.has(c.slice(1,c.indexOf("//")+2))){let y=/^\[([^\]\s]+)(?:(\s+(?=\S))([^\]]*))?\][\w\s]*$/u.exec(c);if(y){super.insertAt(new pt(g.slice(0,m),y.slice(1),c.slice(c.indexOf("]")+1),t,r));continue}}}}super.insertAt(new o(g,t,r))}}get image(){return this.childNodes.find(Ce("imagemap-image"))}toString(e){return super.toString(e,`
16
+ `})}};Bt=new WeakSet,In=function(e){return this.normalizeTitle(e,6,!0,!0).valid}});var He,Rr=b(()=>{"use strict";Rt();He=class extends ve{constructor(){super(...arguments);f(this,"type","link")}}});var Gn,jn=b(()=>{"use strict";Gn=l=>{class i extends l{}return i}});var Ze,Gr=b(()=>{"use strict";R();A();C();Ze=class extends T{constructor(i,e=!1,t=h.getConfig(),r=[]){super(i,t,r,{}),this.type=e?"ext-link-url":"free-ext-link"}lint(i=this.getAbsoluteIndex()){let e=super.lint(i),t=`[\uFF0C\uFF1B\u3002\uFF1A\uFF01\uFF1F\uFF08\uFF09]+${this.type==="ext-link-url"?"|\\|+":""}`,r=new RegExp(t,"u"),n=new RegExp(t,"gu"),s;for(let o of this.childNodes){let{type:a,data:d}=o;if(a!=="text"||!r.test(d))continue;s!=null||(s={start:i,...this.getRootNode().posFromIndex(i)});let g=v(o,s,"","warning");n.lastIndex=0;for(let p=n.exec(d);p;p=n.exec(d)){let{index:m,0:c}=p,x=d.slice(0,m).split(`
17
+ `),{length:k}=x,{length:w}=x[x.length-1],q=g.startIndex+m,I=g.startLine+k-1,$=k===1?g.startCol+w:w;e.push({...g,message:h.msg("$1 in URL",c.startsWith("|")?'"|"':h.msg("full-width punctuation")),startIndex:q,endIndex:q+c.length,startLine:I,endLine:I,startCol:$,endCol:$+c.length})}}return e}}});var ce,Ve,jr=b(()=>{"use strict";de();jn();A();C();Gr();Ve=class extends Gn(T){constructor(e,t="",r="",n=h.getConfig(),s=[]){super(void 0,n,s,{});f(this,"type","ext-link");y(this,ce,void 0);if(this.insertAt(new Ze(e,!0,n,s)),S(this,ce,t),r){let o=new T(r,n,s,{});o.type="ext-link-text",o.setAttribute("stage",10),this.insertAt(o)}}toString(e){return this.length===1?`[${super.toString(e)}${u(this,ce)}]`:`[${super.toString(e,u(this,ce))}]`}text(){return`[${super.text(" ")}]`}getAttribute(e){return e==="padding"?1:super.getAttribute(e)}getGaps(){return u(this,ce).length}print(){return super.print(this.length===1?{pre:"[",post:`${u(this,ce)}]`}:{pre:"[",sep:u(this,ce),post:"]"})}};ce=new WeakMap});var gt,qn=b(()=>{"use strict";A();C();Ne();Rr();jr();gt=class extends T{constructor(e,t,r,n=h.getConfig(),s=[]){super(void 0,n,s);f(this,"type","imagemap-link");this.append(e,t.length===2?new He(...t,n,s):new Ve(...t,n,s),new H(r,n,s))}}});var Bn={};_(Bn,{ImagemapToken:()=>qr});var qr,On=b(()=>{"use strict";R();Ce();A();C();Ne();Ir();qn();qr=class extends T{constructor(e,t=h.getConfig(),r=[]){super(void 0,t,r,{});f(this,"type","ext-inner");if(!e)return;let n=e.split(`
18
+ `),s=new Set(t.protocol.split("|")),o=H,a=!0,d=!1;for(let g of n){let p=g.trim();if(!(d||!p||p.startsWith("#"))){if(a){let[m,...c]=g.split("|"),x=this.normalizeTitle(m,0,!0);if(x.valid&&x.ns===6){let k=new De("imagemap",m,c.length>0?c.join("|"):void 0,t,r);super.insertAt(k),a=!1;continue}else d=!0}else if(g.trim().split(/[\t ]/u)[0]==="desc"){super.insertAt(g);continue}else if(g.includes("[")){let m=g.indexOf("["),c=g.slice(m),x=/^\[{2}([^|]+)(?:\|([^\]]+))?\]{2}[\w\s]*$/u.exec(c);if(x){if(this.normalizeTitle(x[1],0,!0,!1,!0).valid){super.insertAt(new gt(g.slice(0,m),x.slice(1),c.slice(c.indexOf("]]")+2),t,r));continue}}else if(s.has(c.slice(1,c.indexOf(":")+1))||s.has(c.slice(1,c.indexOf("//")+2))){let k=/^\[([^\]\s]+)(?:(\s+(?=\S))([^\]]*))?\][\w\s]*$/u.exec(c);if(k){super.insertAt(new gt(g.slice(0,m),k.slice(1),c.slice(c.indexOf("]")+1),t,r));continue}}}}super.insertAt(new o(g,t,r))}}get image(){return this.childNodes.find(we("imagemap-image"))}toString(e){return super.toString(e,`
19
19
  `)}text(){return super.text(`
20
20
  `).replace(/\n{2,}/gu,`
21
- `)}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),r={start:e,...this.getRootNode().posFromIndex(e)};return this.image?t.push(...this.childNodes.filter(n=>{let s=String(n).trim();return n.type==="noinclude"&&s&&!s.startsWith("#")}).map(n=>v(n,r,"invalid link in <imagemap>"))):t.push(I(this,r,"<imagemap> without an image")),t}print(){return super.print({sep:`
22
- `})}}});var jn,We,Cr=b(()=>{"use strict";R();A();w();fr();vt();jn=(l,i)=>{let e=new Set(l);return e.delete(i),[...e]},We=class extends qe{constructor(e,t,r,n,s=h.getConfig(),o=[]){var m;let a=e.toLowerCase(),d=new Ae(!t||t.trimStart()!==t?t:` ${t}`,"ext-attrs",a,s,o),g={...s,ext:jn(s.ext,a),excludes:[...(m=s.excludes)!=null?m:[]]},p;switch(g.inExt=!0,a){case"tab":g.ext=jn(g.ext,"tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":a==="poem"&&g.excludes.push("heading"),p=new T(r,g,o);break;case"pre":{let{PreToken:c}=(mn(),P(hn));p=new c(r,g,o);break}case"dynamicpagelist":{let{ParamTagToken:c}=(br(),P(cn));p=new c(r,g,o);break}case"inputbox":{g.excludes.push("heading");let{InputboxToken:c}=(Sn(),P(vn));p=new c(r,g,o);break}case"references":{let{NestedToken:c}=(It(),P(Lt));p=new c(r,/<!--.*?(?:-->|$)|<(ref)(\s[^>]*)?>(.*?)<\/(ref\s*)>/gisu,["ref"],g,o);break}case"choose":{let{NestedToken:c}=(It(),P(Lt));p=new c(r,/<(option|choicetemplate)(\s[^>]*)?>(.*?)<\/(\1)>/gsu,["option","choicetemplate"],g,o);break}case"combobox":{let{NestedToken:c}=(It(),P(Lt));p=new c(r,/<(combooption)(\s[^>]*)?>(.*?)<\/(combooption\s*)>/gisu,["combooption"],g,o);break}case"gallery":{let{GalleryToken:c}=(En(),P(Fn));p=new c(r,g,o);break}case"imagemap":{let{ImagemapToken:c}=(Gn(),P(Rn));p=new c(r,g,o);break}default:{let{NowikiToken:c}=(cr(),P(mr));p=new c(r,g)}}p.setAttribute("name",a),p.type="ext-inner";super(e,d,p,n,s,o);f(this,"type","ext")}lint(e=this.getAbsoluteIndex()){let t=super.lint(e);if(this.name!=="nowiki"&&this.closest("html-attrs, table-attrs")){let r={start:e,...this.getRootNode().posFromIndex(e)};t.push(I(this,r,"extension tag in HTML tag attributes"))}return t}}});var qn={};_(qn,{parseCommentAndExt:()=>Hi});var Hi,Bn=b(()=>{"use strict";A();rn();Ne();nn();Cr();Sr();Hi=(l,i=h.getConfig(),e=[],t=!1)=>{let r="<onlyinclude>",n="</onlyinclude>",{length:s}=r,o=()=>{let m=l.indexOf(r);return{i:m,j:l.indexOf(n,m+s)}};if(t){let{i:m,j:c}=o();if(m!==-1&&c!==-1){let x="",y=C=>{new D(C,i,e),x+=`\0${e.length-1}c\x7F`};for(;m!==-1&&c!==-1;){let C=`\0${e.length}e\x7F`;new bt(l.slice(m+s,c),i,e),m>0&&y(l.slice(0,m)),x+=C,l=l.slice(c+s+1),{i:m,j:c}=o()}return l&&y(l),x}}let a=i.ext.join("|"),d=t?"includeonly":"(?:no|only)include",g=t?"noinclude":"includeonly",p=new RegExp(`<!--.*?(?:-->|$)|<${d}(?:\\s[^>]*)?>|</${d}\\s*>|<(${a})(\\s[^>]*?)?(?:/>|>(.*?)</(\\1\\s*)>)|<(${g})(\\s[^>]*?)?(?:/>|>(.*?)(?:</(${g}\\s*)>|$))`,"gisu");return l.replace(p,(m,c,x,y,C,q,L,$,F)=>{let B=`\0${e.length}${c?"e":"c"}\x7F`;if(c)new We(c,x,y,C,i,e);else if(m.startsWith("<!--")){let E=m.endsWith("-->");new ze(m.slice(4,E?-3:void 0),E,i,e)}else q?new kt(q,L,$,F,i,e):new D(m,i,e);return B})}});var Zi,Xe,ie,Se,Bt,On=b(()=>{"use strict";R();Z();A();w();Zi=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),Bt=class extends T{constructor(e,t,r,n,s=h.getConfig(),o=[]){super(void 0,s,o);f(this,"type","html");k(this,Xe,void 0);k(this,ie,void 0);k(this,Se,void 0);this.insertAt(t),this.setAttribute("name",e.toLowerCase()),S(this,Xe,r),S(this,ie,n),S(this,Se,e)}get closing(){return u(this,Xe)}toString(e){return`<${this.closing?"/":""}${u(this,Se)}${super.toString()}${u(this,ie)?"/":""}>`}text(){let{closing:e,name:t}=this,r=`${u(this,Se)}${e?"":super.text()}`,{html:n}=this.getAttribute("config");return n[2].includes(t)?e&&t!=="br"?"":`<${r}>`:`<${e?"/":""}${r}${u(this,ie)&&n[1].includes(t)?"/":""}>`}getAttribute(e){return e==="padding"?u(this,Se).length+(this.closing?2:1):super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),r;this.name==="h1"&&!this.closing&&(r=I(this,{start:e},"<h1>"),t.push(r)),this.closest("table-attrs")&&(r!=null||(r=I(this,{start:e},"")),t.push({...r,message:h.msg("HTML tag in table attributes")}));try{this.findMatchingTag()}catch(n){if(n instanceof SyntaxError){let{message:s}=n;r!=null||(r=I(this,{start:e},""));let[o]=s.split(":"),a={...r,message:h.msg(o)};if(o==="unclosed tag")a.severity="warning";else if(o==="unmatched closing tag"){let d=this.closest("magic-word");d&&Zi.has(d.name)&&(a.severity="warning")}t.push(a)}}return t}findMatchingTag(){let{html:e}=this.getAttribute("config"),{name:t,parentNode:r,closing:n}=this,s=ft(String(this));if(n&&(u(this,ie)||e[2].includes(t)))throw new SyntaxError(`tag that is both closing and self-closing: ${s}`);if(e[2].includes(t)||u(this,ie)&&e[1].includes(t))return this;if(u(this,ie)&&e[0].includes(t))throw new SyntaxError(`invalid self-closing tag: ${s}`);if(!r)return;let{childNodes:o}=r,a=o.indexOf(this),d=(n?o.slice(0,a).reverse():o.slice(a+1)).filter(p=>p.type==="html"&&p.name===t),g=n?-1:1;for(let p of d)if(u(p,Xe)?g--:g++,g===0)return p;throw new SyntaxError(`${n?"unmatched closing":"unclosed"} tag: ${s}`)}print(){let{closing:e,name:t}=this,{html:r}=this.getAttribute("config");return super.print({pre:`&lt;${this.closing?"/":""}${u(this,Se)}`,post:`${u(this,ie)?"/":""}&gt;`,class:e&&r[2].includes(t)&&t!=="br"?"html-invalid":"html"})}json(){return{...super.json(),closing:this.closing,selfClosing:u(this,ie)}}};Xe=new WeakMap,ie=new WeakMap,Se=new WeakMap});var Mn={};_(Mn,{parseHtml:()=>Vi});var Vi,zn=b(()=>{"use strict";A();vt();On();Vi=(l,i=h.getConfig(),e=[])=>{let t=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,r=new Set(i.html.flat()),n=l.split("<"),s=n.shift();for(let o of n){let a=t.exec(o),d=a==null?void 0:a[2],g=d==null?void 0:d.toLowerCase();if(!a||!r.has(g)){s+=`<${o}`;continue}let[,p,,m="",c,x]=a,y=new Ae(m,"html-attrs",g,i,e),C=y.getAttr("itemprop");if(g==="meta"&&(C===void 0||y.getAttr("content")===void 0)||g==="link"&&(C===void 0||y.getAttr("href")===void 0)){s+=`<${o}`,e.pop();continue}s+=`\0${e.length}x\x7F${x}`,new Bt(d,y,p==="/",c==="/>",i,e)}return s}});var Qe,qr=b(()=>{"use strict";A();w();lt();vt();Qe=class extends T{constructor(i,e,t,r=h.getConfig(),n=[],s={}){super(void 0,r,n,s),this.append(new ue(e,i,"table-syntax",r,n,{}),new Ae(t,"table-attrs",this.type,r,n))}}});var Ke,Br=b(()=>{"use strict";R();we();qr();Ke=class extends Qe{lint(i=this.getAbsoluteIndex()){let e=super.lint(i),t=this.childNodes.find(({type:d})=>d==="table-inter");if(!t)return e;let r=t.childNodes.find(d=>d.text().trim()),n=/^\s*(?:!|\{\{\s*![!-]?\s*\}\})/u,s=Ce("arg"),o=Ce("magic-word");if(!r||n.test(String(r))||s(r)&&n.test(r.default||""))return e;if(o(r))try{if(r.getPossibleValues().every(d=>n.test(d.text())))return e}catch(d){}let a=v(t,{start:i},"content to be moved out from the table");return e.push({...a,startIndex:a.startIndex+1,startLine:a.startLine+1,startCol:0}),e}}});var Xi,Ot,Wn=b(()=>{"use strict";R();we();A();Br();lt();Xi=/^\n[^\S\n]*(?:\|\}|\{\{\s*!\s*\}\}\}|\{\{\s*!\)\s*\}\})$/u,Ot=class extends Ke{constructor(e,t,r=h.getConfig(),n=[]){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,t,r,n,{});f(this,"type","table")}get closed(){return this.lastChild.type==="table-syntax"}lint(e=this.getAbsoluteIndex()){let t=super.lint(e);return this.closed||t.push(v(this.firstChild,{start:e},h.msg("unclosed $1","table"))),t}close(e=`
23
- |}`,t=!1){let r=this.getAttribute("config"),n=this.getAttribute("accum"),s=[e],o=nt.run(()=>super.insertAt(new ue(void 0,Xi,"table-syntax",r,n,{})));this.lastChild.replaceChildren(...s)}json(){return{...super.json(),closed:this.closed}}}});var Mt,_n=b(()=>{"use strict";A();Br();Mt=class extends Ke{constructor(e,t,r=h.getConfig(),n=[]){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,e,t,r,n,{});f(this,"type","tr")}}});var Y,Wt,Un,zt,Dn=b(()=>{"use strict";R();le();A();w();qr();zt=class extends Qe{constructor(e,t,r=h.getConfig(),n=[]){var d;let s=/\||\0\d+!\x7F/u.exec(t!=null?t:""),o=s?t.slice(0,s.index):"";/\[\[|-\{/u.test(o)&&(s=null,o="");super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,o,r,n);k(this,Wt);f(this,"type","td");k(this,Y,"");s&&([ht(this,Y)._]=s);let a=new T(t==null?void 0:t.slice(((d=s==null?void 0:s.index)!=null?d:NaN)+u(this,Y).length),r,n);a.type="td-inner",a.setAttribute("stage",4),this.insertAt(a)}get subtype(){return N(this,Wt,Un).call(this).subtype}afterBuild(){u(this,Y).includes("\0")&&S(this,Y,this.buildFromStr(u(this,Y),0))}toString(e){let{childNodes:[t,r,n]}=this;return`${t.toString()}${r.toString()}${u(this,Y)}${n.toString()}`}text(){let{childNodes:[e,t,r]}=this;return`${e.text()}${t.text()}${u(this,Y)}${r.text()}`}getGaps(e){return e===1?u(this,Y).length:0}lint(e=this.getAbsoluteIndex()){let t=super.lint(e);e+=this.getRelativeIndex(this.length-1);for(let r of this.lastChild.childNodes)if(r.type==="text"){let{data:n}=r;n.includes("|")&&t.push(v(r,{start:e},'additional "|" in a table cell',n.includes("||")?"error":"warning"))}return t}print(){let{childNodes:[e,t,r]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${u(this,Y)}${r.print()}</span>`}json(){return{...super.json(),subtype:this.subtype}}};Y=new WeakMap,Wt=new WeakSet,Un=function(){let e=this.firstChild.text(),t=e.slice(-1),r="td";return t==="!"?r="th":t==="+"&&(r="caption"),{subtype:r}}});var Je,Or=b(()=>{"use strict";ke();Je=class extends V{}});var Ye,Mr=b(()=>{"use strict";Or();Ye=class extends Je{constructor(){super(...arguments);f(this,"type","dd")}}});var Hn={};_(Hn,{parseTable:()=>Ki});var Qi,Ki,Zn=b(()=>{"use strict";A();w();Wn();_n();Dn();Mr();Qi=l=>l.lastChild.constructor!==T,Ki=({firstChild:{data:l},type:i,name:e},t=h.getConfig(),r=[])=>{let n=[],s=l.split(`
21
+ `)}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),r={start:e,...this.getRootNode().posFromIndex(e)};return this.image?t.push(...this.childNodes.filter(n=>{let s=String(n).trim();return n.type==="noinclude"&&s&&!s.startsWith("#")}).map(n=>v(n,r,"invalid link in <imagemap>"))):t.push(N(this,r,"<imagemap> without an image")),t}print(){return super.print({sep:`
22
+ `})}}});var Mn,We,Cr=b(()=>{"use strict";R();A();C();Tr();St();Mn=(l,i)=>{let e=new Set(l);return e.delete(i),[...e]},We=class extends qe{constructor(e,t,r,n,s=h.getConfig(),o=[]){var m;let a=e.toLowerCase(),d=new Ae(!t||t.trimStart()!==t?t:` ${t}`,"ext-attrs",a,s,o),g={...s,ext:Mn(s.ext,a),excludes:[...(m=s.excludes)!=null?m:[]]},p;switch(g.inExt=!0,a){case"tab":g.ext=Mn(g.ext,"tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":a==="poem"&&g.excludes.push("heading"),p=new T(r,g,o);break;case"pre":{let{PreToken:c}=(xn(),P(Tn));p=new c(r,g,o);break}case"dynamicpagelist":{let{ParamTagToken:c}=(kr(),P(bn));p=new c(r,g,o);break}case"inputbox":{g.excludes.push("heading");let{InputboxToken:c}=(Nn(),P(Cn));p=new c(r,g,o);break}case"references":{let{NestedToken:c}=(Pt(),P(It));p=new c(r,/<!--.*?(?:-->|$)|<(ref)(\s[^>]*)?>(.*?)<\/(ref\s*)>/gisu,["ref"],g,o);break}case"choose":{let{NestedToken:c}=(Pt(),P(It));p=new c(r,/<(option|choicetemplate)(\s[^>]*)?>(.*?)<\/(\1)>/gsu,["option","choicetemplate"],g,o);break}case"combobox":{let{NestedToken:c}=(Pt(),P(It));p=new c(r,/<(combooption)(\s[^>]*)?>(.*?)<\/(combooption\s*)>/gisu,["combooption"],g,o);break}case"gallery":{let{GalleryToken:c}=(Rn(),P(Pn));p=new c(r,g,o);break}case"imagemap":{let{ImagemapToken:c}=(On(),P(Bn));p=new c(r,g,o);break}default:{let{NowikiToken:c}=(fr(),P(cr));p=new c(r,g)}}p.setAttribute("name",a),p.type="ext-inner";super(e,d,p,n,s,o);f(this,"type","ext")}lint(e=this.getAbsoluteIndex()){let t=super.lint(e);if(this.name!=="nowiki"&&this.closest("html-attrs, table-attrs")){let r={start:e,...this.getRootNode().posFromIndex(e)};t.push(N(this,r,"extension tag in HTML tag attributes"))}return t}}});var zn={};_(zn,{parseCommentAndExt:()=>Ki});var Ki,Wn=b(()=>{"use strict";A();sn();Ne();on();Cr();$r();Ki=(l,i=h.getConfig(),e=[],t=!1)=>{let r="<onlyinclude>",n="</onlyinclude>",{length:s}=r,o=()=>{let m=l.indexOf(r);return{i:m,j:l.indexOf(n,m+s)}};if(t){let{i:m,j:c}=o();if(m!==-1&&c!==-1){let x="",k=w=>{new H(w,i,e),x+=`\0${e.length-1}c\x7F`};for(;m!==-1&&c!==-1;){let w=`\0${e.length}e\x7F`;new bt(l.slice(m+s,c),i,e),m>0&&k(l.slice(0,m)),x+=w,l=l.slice(c+s+1),{i:m,j:c}=o()}return l&&k(l),x}}let a=i.ext.join("|"),d=t?"includeonly":"(?:no|only)include",g=t?"noinclude":"includeonly",p=new RegExp(`<!--.*?(?:-->|$)|<${d}(?:\\s[^>]*)?>|</${d}\\s*>|<(${a})(\\s[^>]*?)?(?:/>|>(.*?)</(\\1\\s*)>)|<(${g})(\\s[^>]*?)?(?:/>|>(.*?)(?:</(${g}\\s*)>|$))`,"gisu");return l.replace(p,(m,c,x,k,w,q,I,$,E)=>{let B=`\0${e.length}${c?"e":"c"}\x7F`;if(c)new We(c,x,k,w,i,e);else if(m.startsWith("<!--")){let L=m.endsWith("-->");new ze(m.slice(4,L?-3:void 0),L,i,e)}else q?new kt(q,I,$,E,i,e):new H(m,i,e);return B})}});var Ji,Yi,es,Qe,se,Se,Ot,_n=b(()=>{"use strict";R();V();A();C();Ji=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),Yi=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"]),es=new Set(["strike","big","center","font","tt"]),Ot=class extends T{constructor(e,t,r,n,s=h.getConfig(),o=[]){super(void 0,s,o);f(this,"type","html");y(this,Qe,void 0);y(this,se,void 0);y(this,Se,void 0);this.insertAt(t),this.setAttribute("name",e.toLowerCase()),S(this,Qe,r),S(this,se,n),S(this,Se,e)}get closing(){return u(this,Qe)}toString(e){return`<${this.closing?"/":""}${u(this,Se)}${super.toString()}${u(this,se)?"/":""}>`}text(){let{closing:e,name:t}=this,r=`${u(this,Se)}${e?"":super.text()}`,{html:n}=this.getAttribute("config");return n[2].includes(t)?e&&t!=="br"?"":`<${r}>`:`<${e?"/":""}${r}${u(this,se)&&n[1].includes(t)?"/":""}>`}getAttribute(e){return e==="padding"?u(this,Se).length+(this.closing?2:1):super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),r;this.name==="h1"&&!this.closing&&(r=N(this,{start:e},"<h1>"),t.push(r)),this.closest("table-attrs")&&(r!=null||(r=N(this,{start:e},"")),t.push({...r,message:h.msg("HTML tag in table attributes")}));try{this.findMatchingTag()}catch(n){if(n instanceof SyntaxError){let{message:s}=n;r!=null||(r=N(this,{start:e},""));let[o]=s.split(":"),a={...r,message:h.msg(o)};if(o==="unclosed tag"&&!Yi.has(this.name))a.severity="warning";else if(o==="unmatched closing tag"){let d=this.closest("magic-word");d&&Ji.has(d.name)&&(a.severity="warning")}t.push(a)}}return es.has(this.name)&&(r!=null||(r=N(this,{start:e},"")),t.push({...r,message:h.msg("obsolete HTML tag"),severity:"warning"})),t}findMatchingTag(){let{html:e}=this.getAttribute("config"),{name:t,parentNode:r,closing:n}=this,s=Kr(String(this));if(n&&(u(this,se)||e[2].includes(t)))throw new SyntaxError(`tag that is both closing and self-closing: ${s}`);if(e[2].includes(t)||u(this,se)&&e[1].includes(t))return this;if(u(this,se)&&e[0].includes(t))throw new SyntaxError(`invalid self-closing tag: ${s}`);if(!r)return;let{childNodes:o}=r,a=o.indexOf(this),d=(n?o.slice(0,a).reverse():o.slice(a+1)).filter(p=>p.type==="html"&&p.name===t),g=n?-1:1;for(let p of d)if(u(p,Qe)?g--:g++,g===0)return p;throw new SyntaxError(`${n?"unmatched closing":"unclosed"} tag: ${s}`)}print(){let{closing:e,name:t}=this,{html:r}=this.getAttribute("config");return super.print({pre:`&lt;${this.closing?"/":""}${u(this,Se)}`,post:`${u(this,se)?"/":""}&gt;`,class:e&&r[2].includes(t)&&t!=="br"?"html-invalid":"html"})}json(){return{...super.json(),closing:this.closing,selfClosing:u(this,se)}}};Qe=new WeakMap,se=new WeakMap,Se=new WeakMap});var Un={};_(Un,{parseHtml:()=>ts});var ts,Dn=b(()=>{"use strict";A();St();_n();ts=(l,i=h.getConfig(),e=[])=>{let t=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,r=new Set(i.html.flat()),n=l.split("<"),s=n.shift();for(let o of n){let a=t.exec(o),d=a==null?void 0:a[2],g=d==null?void 0:d.toLowerCase();if(!a||!r.has(g)){s+=`<${o}`;continue}let[,p,,m="",c,x]=a,k=new Ae(m,"html-attrs",g,i,e),w=k.getAttr("itemprop");if(g==="meta"&&(w===void 0||k.getAttr("content")===void 0)||g==="link"&&(w===void 0||k.getAttr("href")===void 0)){s+=`<${o}`,e.pop();continue}s+=`\0${e.length}x\x7F${x}`,new Ot(d,k,p==="/",c==="/>",i,e)}return s}});var Xe,Br=b(()=>{"use strict";A();C();dt();St();Xe=class extends T{constructor(i,e,t,r=h.getConfig(),n=[],s={}){super(void 0,r,n,s),this.append(new he(e,i,"table-syntax",r,n,{}),new Ae(t,"table-attrs",this.type,r,n))}}});var Ke,Or=b(()=>{"use strict";R();Ce();Br();Ke=class extends Xe{lint(i=this.getAbsoluteIndex()){let e=super.lint(i),t=this.childNodes.find(({type:d})=>d==="table-inter");if(!t)return e;let r=t.childNodes.find(d=>d.text().trim()),n=/^\s*(?:!|\{\{\s*![!-]?\s*\}\})/u,s=we("arg"),o=we("magic-word");if(!r||n.test(String(r))||s(r)&&n.test(r.default||""))return e;if(o(r))try{if(r.getPossibleValues().every(d=>n.test(d.text())))return e}catch(d){}let a=v(t,{start:i},"content to be moved out from the table");return e.push({...a,startIndex:a.startIndex+1,startLine:a.startLine+1,startCol:0}),e}}});var rs,Mt,Hn=b(()=>{"use strict";R();Ce();A();Or();dt();rs=/^\n[^\S\n]*(?:\|\}|\{\{\s*!\s*\}\}\}|\{\{\s*!\)\s*\}\})$/u,Mt=class extends Ke{constructor(e,t,r=h.getConfig(),n=[]){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,t,r,n,{});f(this,"type","table")}get closed(){return this.lastChild.type==="table-syntax"}lint(e=this.getAbsoluteIndex()){let t=super.lint(e);return this.closed||t.push(v(this.firstChild,{start:e},h.msg("unclosed $1","table"))),t}close(e=`
23
+ |}`,t=!1){let r=this.getAttribute("config"),n=this.getAttribute("accum"),s=[e],o=nt.run(()=>super.insertAt(new he(void 0,rs,"table-syntax",r,n,{})));this.lastChild.replaceChildren(...s)}json(){return{...super.json(),closed:this.closed}}}});var zt,Zn=b(()=>{"use strict";A();Or();zt=class extends Ke{constructor(e,t,r=h.getConfig(),n=[]){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,e,t,r,n,{});f(this,"type","tr")}}});var ee,_t,Vn,Wt,Qn=b(()=>{"use strict";R();de();A();C();Br();Wt=class extends Xe{constructor(e,t,r=h.getConfig(),n=[]){var d;let s=/\||\0\d+!\x7F/u.exec(t!=null?t:""),o=s?t.slice(0,s.index):"";/\[\[|-\{/u.test(o)&&(s=null,o="");super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,o,r,n);y(this,_t);f(this,"type","td");y(this,ee,"");s&&([mt(this,ee)._]=s);let a=new T(t==null?void 0:t.slice(((d=s==null?void 0:s.index)!=null?d:NaN)+u(this,ee).length),r,n);a.type="td-inner",a.setAttribute("stage",4),this.insertAt(a)}get subtype(){return F(this,_t,Vn).call(this).subtype}afterBuild(){u(this,ee).includes("\0")&&S(this,ee,this.buildFromStr(u(this,ee),0))}toString(e){let{childNodes:[t,r,n]}=this;return`${t.toString()}${r.toString()}${u(this,ee)}${n.toString()}`}text(){let{childNodes:[e,t,r]}=this;return`${e.text()}${t.text()}${u(this,ee)}${r.text()}`}getGaps(e){return e===1?u(this,ee).length:0}lint(e=this.getAbsoluteIndex()){let t=super.lint(e);e+=this.getRelativeIndex(this.length-1);for(let r of this.lastChild.childNodes)if(r.type==="text"){let{data:n}=r;n.includes("|")&&t.push(v(r,{start:e},'additional "|" in a table cell',n.includes("||")?"error":"warning"))}return t}print(){let{childNodes:[e,t,r]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${u(this,ee)}${r.print()}</span>`}json(){return{...super.json(),subtype:this.subtype}}};ee=new WeakMap,_t=new WeakSet,Vn=function(){let e=this.firstChild.text(),t=e.slice(-1),r="td";return t==="!"?r="th":t==="+"&&(r="caption"),{subtype:r}}});var Je,Mr=b(()=>{"use strict";ke();Je=class extends Q{}});var Ye,zr=b(()=>{"use strict";Mr();Ye=class extends Je{constructor(){super(...arguments);f(this,"type","dd")}}});var Xn={};_(Xn,{parseTable:()=>is});var ns,is,Kn=b(()=>{"use strict";A();C();Hn();Zn();Qn();zr();ns=l=>l.lastChild.constructor!==T,is=({firstChild:{data:l},type:i,name:e},t=h.getConfig(),r=[])=>{let n=[],s=l.split(`
24
24
  `),o=i==="root"||i==="parameter-value"||i==="ext-inner"&&e==="poem"?"":`
25
- ${s.shift()}`,a,d=(p,m)=>{if(!m){o+=p;return}let{lastChild:c}=m;if(Qi(m)){let x=new T(p,t,r);x.type="table-inter",x.setAttribute("stage",3),m.insertAt(x)}else c.setText(String(c)+p)},g=()=>a.type==="td"?n.pop():a;for(let p of s){a=n.pop();let[m]=/^(?:\s|\0\d+c\x7F)*/u.exec(p),c=p.slice(m.length),x=/^(:*)((?:\s|\0\d+c\x7F)*)(\{\||\{(?:\0\d+c\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(c);if(x){for(;a&&a.type!=="td";)a=n.pop();let[,F,B,E,O]=x;F&&new Ye(F,t,r),d(`
26
- ${m}${F&&`\0${r.length-1}d\x7F`}${B}\0${r.length}b\x7F`,a),n.push(...a?[a]:[],new Ot(E,O,t,r));continue}else if(!a){o+=`
27
- ${p}`;continue}let y=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(c);if(!y){d(`
28
- ${p}`,a),n.push(a);continue}let[,C,q,L,$]=y;if(C){for(;a.type!=="table";)a=n.pop();a.close(`
29
- ${m}${C}`,!0),d($,n[n.length-1])}else if(q){a=g(),a.type==="tr"&&(a=n.pop());let F=new Mt(`
30
- ${m}${q}`,$,t,r);n.push(a,F),a.insertAt(F)}else{a=g();let F=L==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu,B=F.exec($),E=0,O=`
31
- ${m}${L}`,M=se=>{let te=new zt(O,$.slice(E,B==null?void 0:B.index),t,r);return se.insertAt(te),te};for(;B;)M(a),{lastIndex:E}=F,[O]=B,B=F.exec($);n.push(a,M(a))}}return o.slice(1)}});var _t,Vn=b(()=>{"use strict";ke();_t=class extends V{constructor(){super(...arguments);f(this,"type","hr")}}});var Ut,Xn=b(()=>{"use strict";je();A();ke();Ut=class extends ge(V){constructor(e,t,r=h.getConfig(),n=[]){super(e,r,n);f(this,"type","double-underscore")}getAttribute(e){return e==="padding"?2:super.getAttribute(e)}toString(e){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}}});var Qn={};_(Qn,{parseHrAndDoubleUnderscore:()=>Ji});var Ji,Kn=b(()=>{"use strict";A();Vn();Xn();kr();Ji=({firstChild:{data:l},type:i,name:e},t=h.getConfig(),r=[])=>{let{doubleUnderscore:n}=t,s=new Set(n[0]),o=new Set(n[1]);return i!=="root"&&(i!=="ext-inner"||e!=="poem")&&(l=`\0${l}`),l=l.replace(/^((?:\0\d+c\x7F)*)(-{4,})/gmu,(a,d,g)=>(new _t(g,t,r),`${d}\0${r.length-1}r\x7F`)).replace(new RegExp(`__(${n.flat().join("|")})__`,"giu"),(a,d)=>{let g=o.has(d);return g||s.has(d.toLowerCase())?(new Ut(d,g,t,r),`\0${r.length-1}u\x7F`):a}).replace(/^((?:\0\d+c\x7F)*)(={1,6})(.+)\2((?:[^\S\n]|\0\d+c\x7F)*)$/gmu,(a,d,g,p,m)=>{let c=`${d}\0${r.length}h\x7F`;return new Me(g.length,[p,m],t,r),c}),i==="root"||i==="ext-inner"&&e==="poem"?l:l.slice(1)}});var Dt,Jn=b(()=>{"use strict";Pt();Dt=class extends ve{constructor(){super(...arguments);f(this,"type","category")}}});var Ht,Yn=b(()=>{"use strict";R();A();ke();Ht=class extends V{constructor(){super(...arguments);f(this,"type","quote")}lint(e=this.getAbsoluteIndex()){let{previousSibling:t,nextSibling:r}=this,n=h.msg('lonely "$1"',"'"),s=[],o;if((t==null?void 0:t.type)==="text"&&t.data.endsWith("'")){o=I(this,{start:e},n);let{startIndex:a,startLine:d,startCol:g}=o,[,{length:p}]=/(?:^|[^'])('+)$/u.exec(t.data),m=e-p;s.push({...o,startIndex:m,endIndex:a,startCol:g-p,endLine:d,endCol:g})}if((r==null?void 0:r.type)==="text"&&r.data.startsWith("'")){o!=null||(o=I(this,{start:e},n));let{endIndex:a,endLine:d,endCol:g}=o,[{length:p}]=/^'+/u.exec(r.data),m=a+p;s.push({...o,startIndex:a,endIndex:m,startLine:d,startCol:g,endCol:g+p})}return s}}});var zr={};_(zr,{parseQuotes:()=>Yi});var Yi,Wr=b(()=>{"use strict";A();Yn();Yi=(l,i=h.getConfig(),e=[])=>{var g;let t=l.split(/('{2,})/u),{length:r}=t;if(r===1)return l;let n=0,s=0,o,a,d;for(let p=1;p<r;p+=2){let{length:m}=t[p];switch(m){case 2:s++;break;case 4:t[p-1]+="'",t[p]="'''";case 3:if(n++,o!==void 0)break;t[p-1].endsWith(" ")?a===void 0&&d===void 0&&(d=p):t[p-1].slice(-2,-1)===" "?o=p:a!=null||(a=p);break;default:t[p-1]+="'".repeat(m-5),t[p]="'''''",s++,n++}}if(s%2===1&&n%2===1){let p=(g=o!=null?o:a)!=null?g:d;p!==void 0&&(t[p]="''",t[p-1]+="'")}for(let p=1;p<r;p+=2)new Ht(t[p],i,e),t[p]=`\0${e.length-1}q\x7F`;return t.join("")}});var ti={};_(ti,{parseLinks:()=>ei});var ei,ri=b(()=>{"use strict";A();Pr();Er();Jn();ei=(l,i=h.getConfig(),e=[])=>{let{parseQuotes:t}=(Wr(),P(zr)),r=i.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)(.*?[^\]]))?\]\](.*)$/su:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)(.*?[^\]])?)?\]\](.*)$/su,n=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)(.*)$/su,s=new RegExp(`^\\s*(?:${i.protocol}|//)`,"iu"),o=l.split("[["),a=o.shift();for(let d=0;d<o.length;d++){let g=!1,p,m,c,x,y=o[d],C=r.exec(y);if(C)[,p,m,c,x]=C,x.startsWith("]")&&(c!=null&&c.includes("["))&&(c+="]",x=x.slice(1));else{let E=n.exec(y);E&&(g=!0,[,p,m,c]=E)}if(p===void 0||s.test(p)||/\0\d+[exhbru]\x7F/u.test(p)){a+=`[[${y}`;continue}let q=p.trim().startsWith(":");if(q&&g){a+=`[[${y}`;continue}let L=h.normalizeTitle(p,0,!1,i,!0,!0,!0),{ns:$,valid:F}=L;if(F){if(g){if($!==6){a+=`[[${y}`;continue}let E=!1;for(d++;d<o.length;d++){let O=o[d],M=O.split("]]");if(M.length>2){E=!0,c+=`[[${M[0]}]]${M[1]}`,x=M.slice(2).join("]]");break}else if(M.length===2)c+=`[[${M[0]}]]${M[1]}`;else{c+=`[[${O}`;break}}if(c=ei(c,i,e),!E){a+=`[[${p}${m}${c}`;continue}}}else{a+=`[[${y}`;continue}c&&(c=t(c,i,e)),a+=`\0${e.length}l\x7F${x}`;let B=He;q||($===6?B=Ue:$===14&&(B=Dt)),c===void 0&&m&&(c=""),new B(p,c,i,e,m)}return a}});var ni={};_(ni,{parseExternalLinks:()=>es});var es,ii=b(()=>{"use strict";Z();A();Gr();es=(l,i=h.getConfig(),e=[])=>{let t=new RegExp(`\\[((?:(?:${i.protocol}|//)${xe}|\0\\d+m\x7F)${be}(?=[[\\]<>"\\t\\p{Zs}]|\0\\d))(\\p{Zs}*(?=\\P{Zs}))([^\\]-\b
32
- -\uFFFD]*)\\]`,"giu");return l.replace(t,(r,n,s,o)=>{let{length:a}=e,d=/&[lg]t;/u.exec(n);return d&&(n=n.slice(0,d.index),s="",o=`${n.slice(d.index)}${s}${o}`),new Ve(n,s,o,i,e),`\0${a}w\x7F`})}});var si={};_(si,{parseMagicLinks:()=>ts});var ts,oi=b(()=>{"use strict";Z();A();Rr();ts=(l,i=h.getConfig(),e=[])=>{let t=new RegExp(`(^|[^\\p{L}\\d_])(?:${i.protocol})(${xe}${be})`,"giu");return l.replace(t,(r,n,s)=>{let o="",a=n?r.slice(1):r,d=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(a);d&&(o=a.slice(d.index),a=a.slice(0,d.index));let g=new RegExp(`[,;.:!?${a.includes("(")?"":")"}]+$`,"u"),p=g.exec(a);if(p){let m=0;p[0].startsWith(";")&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(a.slice(0,p.index))&&(m=1),o=`${a.slice(p.index+m)}${o}`,a=a.slice(0,p.index+m)}return o.length>=s.length?r:(new Ze(a,!1,i,e),`${n}\0${e.length-1}w\x7F${o}`)})}});var Zt,ai=b(()=>{"use strict";Or();Zt=class extends Je{constructor(){super(...arguments);f(this,"type","list")}}});var li={};_(li,{parseList:()=>rs});var rs,di=b(()=>{"use strict";A();ai();Mr();rs=(l,i=h.getConfig(),e=[])=>{let t=/^((?:\0\d+c\x7F)*)([;:*#]+)/u.exec(l);if(!t)return l;let[r,n,s]=t,o=`${n}\0${e.length}d\x7F${l.slice(r.length)}`,a=s.split(";").length-1;if(new Zt(s,i,e),!a)return o;let d=/:+|-\{/gu,g=d.exec(o),p=0,m=(c,x)=>(new Ye(c,i,e),`${o.slice(0,x)}\0${e.length-1}d\x7F${o.slice(x+c.length)}`);for(;g&&a;){let{0:c,index:x}=g;if(c.startsWith(":")){if(c.length>=a)return m(c.slice(0,a),x);a-=c.length,d.lastIndex=x+4+String(e.length).length,o=m(c,x)}else if(c==="-{"){if(!p){let{lastIndex:y}=d;d=/-\{|\}-/gu,d.lastIndex=y}p++}else if(p--,!p){let{lastIndex:y}=d;d=/:+|-\{/gu,d.lastIndex=y}g=d.exec(o)}return o}});var pi,gi=b(()=>{"use strict";pi=l=>{class i extends l{}return i}});var ns,fe,Vt,ui=b(()=>{"use strict";R();A();w();he();ns=new Set(["A","T","R","D","-","H","N"]),Vt=class extends T{constructor(e,t=h.getConfig(),r=[]){super(void 0,t,r,{});f(this,"type","converter-flags");k(this,fe,void 0);this.append(...e.map(n=>new G(n,"converter-flag",t,r)))}afterBuild(){S(this,fe,this.childNodes.map(e=>e.text().trim()))}toString(e){return super.toString(e,";")}text(){return super.text(";")}getGaps(){return 1}getUnknownFlags(){return new Set(u(this,fe).filter(e=>/\{{3}[^{}]+\}{3}/u.test(e)))}getVariantFlags(){let e=new Set(this.getAttribute("config").variants);return new Set(u(this,fe).filter(t=>e.has(t)))}lint(e=this.getAbsoluteIndex()){let t=this.getVariantFlags(),r=this.getUnknownFlags(),n=new Set(u(this,fe).filter(m=>ns.has(m))),{length:s}=u(this,fe).filter(m=>!m),o=u(this,fe).length-r.size-s,a=super.lint(e);if(t.size===o||n.size===o)return a;let d={start:e,...this.getRootNode().posFromIndex(e)},{childNodes:g,length:p}=this;for(let m=0;m<p;m++){let c=g[m],x=c.text().trim();x&&!t.has(x)&&!r.has(x)&&(t.size>0||!n.has(x))&&a.push(v(c,d,"invalid conversion flag"))}return a}print(){return super.print({sep:";"})}};fe=new WeakMap});var et,hi=b(()=>{"use strict";A();w();he();et=class extends T{constructor(e,t=!0,r=h.getConfig(),n=[]){super(void 0,r,n);f(this,"type","converter-rule");let s=e.indexOf(":"),o=e.slice(0,s).indexOf("=>"),a=o===-1?e.slice(0,s):e.slice(o+2,s);t&&r.variants.includes(a.trim())?(super.insertAt(new G(a,"converter-rule-variant",r,n)),super.insertAt(new G(e.slice(s+1),"converter-rule-to",r,n)),o!==-1&&super.insertAt(new G(e.slice(0,o),"converter-rule-from",r,n),0)):super.insertAt(new G(e,"converter-rule-to",r,n))}toString(e){let{childNodes:t}=this;if(t.length===3){let[r,n,s]=t;return`${r.toString(e)}=>${n.toString(e)}:${s.toString(e)}`}return super.toString(e,":")}text(){let{childNodes:e}=this;if(e.length===3){let[t,r,n]=e;return`${t.text()}=>${r.text()}:${n.text()}`}return super.text(":")}getGaps(e){return e===0&&this.length===3?2:1}print(){let{childNodes:e}=this;if(e.length===3){let[t,r,n]=e;return`<span class="wpb-converter-rule">${t.print()}=>${r.print()}:${n.print()}</span>`}return super.print({sep:":"})}}});var Xt,mi=b(()=>{"use strict";Z();gi();A();w();ui();hi();Xt=class extends pi(T){constructor(e,t,r=h.getConfig(),n=[]){super(void 0,r,n);f(this,"type","converter");this.append(new Vt(e,r,n));let[s]=t,o=s.includes(":"),a=new et(s,o,r,n);o&&a.length===1?this.insertAt(new et(t.join(";"),!1,r,n)):this.append(a,...t.slice(1).map(d=>new et(d,!0,r,n)))}toString(e){let{childNodes:[t,...r]}=this;return`-{${t.toString()}${t.length>0?"|":""}${r.map(n=>n.toString()).join(";")}}-`}text(){let{childNodes:[e,...t]}=this;return`-{${e.text()}|${de(t,";")}}-`}getAttribute(e){return e==="padding"?2:super.getAttribute(e)}getGaps(e){return e||this.firstChild.length>0?1:0}print(){let{childNodes:[e,...t]}=this;return`<span class="wpb-converter">-{${e.print()}${e.length>0?"|":""}${pe(t,{sep:";"})}}-</span>`}}});var ci={};_(ci,{parseConverter:()=>is});var is,fi=b(()=>{"use strict";A();mi();is=(l,i=h.getConfig(),e=[])=>{let t=/-\{/gu,r=/-\{|\}-/gu,n=[],s=t,o=s.exec(l);for(;o;){let{0:a,index:d}=o;if(a==="}-"){let g=n.pop(),{length:p}=e,m=l.slice(g.index+2,d),c=m.indexOf("|"),[x,y]=c===-1?[[],m]:[m.slice(0,c).split(";"),m.slice(c+1)],C=y.replace(/(&[#a-z\d]+);/giu,"$1"),q=`(?:${i.variants.join("|")})`,L=C.split(new RegExp(`;(?=(?:[^;]*?=>)?\\s*${q}\\s*:|(?:\\s|\0\\d+c\x7F)*$)`,"u")).map($=>$.replace(/\x01/gu,";"));new Xt(x,L,i,e),l=`${l.slice(0,g.index)}\0${p}v\x7F${l.slice(d+2)}`,n.length===0&&(s=t),s.lastIndex=g.index+3+String(p).length}else n.push(o),s=r,s.lastIndex=d+2;o=s.exec(l)}return l}});var Ur={};_(Ur,{Token:()=>T});var ee,j,z,Pe,gt,_r,Qt,Ti,Kt,xi,Jt,bi,Yt,ki,er,yi,tr,Ai,rr,vi,nr,Si,ir,$i,sr,Ci,or,wi,Dr,T,w=b(()=>{"use strict";Z();le();A();Jr();tn();Dr=class Dr extends Tt{constructor(e,t=h.getConfig(),r=[],n){super();k(this,gt);k(this,Qt);k(this,Kt);k(this,Jt);k(this,Yt);k(this,er);k(this,tr);k(this,rr);k(this,nr);k(this,ir);k(this,sr);k(this,or);f(this,"type","root");k(this,ee,0);k(this,j,void 0);k(this,z,void 0);k(this,Pe,void 0);typeof e=="string"&&this.insertAt(e),S(this,j,t),S(this,z,r),r.push(this)}parseOnce(e=u(this,ee),t=!1){if(e<u(this,ee)||!this.getAttribute("plain")||this.length===0)return this;if(u(this,ee)>=11)return this;switch(e){case 0:this.type==="root"&&u(this,z).shift(),S(this,Pe,t),N(this,Qt,Ti).call(this,t);break;case 1:N(this,Kt,xi).call(this);break;case 2:N(this,Jt,bi).call(this);break;case 3:N(this,Yt,ki).call(this);break;case 4:N(this,er,yi).call(this);break;case 5:N(this,tr,Ai).call(this);break;case 6:N(this,rr,vi).call(this);break;case 7:N(this,nr,Si).call(this);break;case 8:N(this,ir,$i).call(this);break;case 9:N(this,sr,Ci).call(this);break;case 10:N(this,or,wi).call(this)}if(this.type==="root")for(let r of u(this,z))r.parseOnce(e,t);return ht(this,ee)._++,this}buildFromStr(e,t){let r=e.split(/[\0\x7F]/u).map((n,s)=>{if(s%2===0)return new ot(n);if(Number.isNaN(Number(n.slice(-1))))return u(this,z)[Number(n.slice(0,-1))];throw new Error(`\u89E3\u6790\u9519\u8BEF\uFF01\u672A\u6B63\u786E\u6807\u8BB0\u7684 Token\uFF1A${n}`)});return t===0?r.map(String).join(""):t===1?de(r):r}afterBuild(){if(this.type==="root")for(let e of u(this,z))e.afterBuild()}parse(e=11,t=!1){for(e=Math.min(e,11);u(this,ee)<e;)this.parseOnce(u(this,ee),t);return e&&(N(this,gt,_r).call(this),this.afterBuild()),this}getAttribute(e){switch(e){case"plain":return this.constructor===Dr;case"config":return JSON.parse(JSON.stringify(u(this,j)));case"accum":return u(this,z);case"include":{if(u(this,Pe)!==void 0)return u(this,Pe);let t=this.getRootNode();return t!==this&&t.getAttribute("include")}default:return super.getAttribute(e)}}setAttribute(e,t){switch(e){case"stage":u(this,ee)===0&&this.type==="root"&&u(this,z).shift(),S(this,ee,t);break;default:super.setAttribute(e,t)}}insertAt(e,t=this.length){let r=typeof e=="string"?new ot(e):e;return super.insertAt(r,t),r.type==="root"&&(r.type="plain"),r}normalizeTitle(e,t=0,r=!1,n=!1,s=!1){return h.normalizeTitle(e,t,u(this,Pe),u(this,j),r,n,s)}};ee=new WeakMap,j=new WeakMap,z=new WeakMap,Pe=new WeakMap,gt=new WeakSet,_r=function(){var n;S(this,ee,11);let{length:e,firstChild:t}=this,r=String(t);if(e===1&&t.type==="text"&&r.includes("\0")&&(this.replaceChildren(...this.buildFromStr(r)),this.normalize(),this.type==="root"))for(let s of u(this,z))N(n=s,gt,_r).call(n)},Qt=new WeakSet,Ti=function(e){let{parseCommentAndExt:t}=(Bn(),P(qn));this.setText(t(String(this.firstChild),u(this,j),u(this,z),e))},Kt=new WeakSet,xi=function(){let{parseBraces:e}=(Ar(),P(An)),t=this.type==="root"?String(this.firstChild):`\0${String(this.firstChild)}`,r=e(t,u(this,j),u(this,z));this.setText(this.type==="root"?r:r.slice(1))},Jt=new WeakSet,bi=function(){var t;if((t=u(this,j).excludes)!=null&&t.includes("html"))return;let{parseHtml:e}=(zn(),P(Mn));this.setText(e(String(this.firstChild),u(this,j),u(this,z)))},Yt=new WeakSet,ki=function(){var t;if((t=u(this,j).excludes)!=null&&t.includes("table"))return;let{parseTable:e}=(Zn(),P(Hn));this.setText(e(this,u(this,j),u(this,z)))},er=new WeakSet,yi=function(){var t;if((t=u(this,j).excludes)!=null&&t.includes("hr"))return;let{parseHrAndDoubleUnderscore:e}=(Kn(),P(Qn));this.setText(e(this,u(this,j),u(this,z)))},tr=new WeakSet,Ai=function(){let{parseLinks:e}=(ri(),P(ti));this.setText(e(String(this.firstChild),u(this,j),u(this,z)))},rr=new WeakSet,vi=function(){var r;if((r=u(this,j).excludes)!=null&&r.includes("quote"))return;let{parseQuotes:e}=(Wr(),P(zr)),t=String(this.firstChild).split(`
25
+ ${s.shift()}`,a,d=(p,m)=>{if(!m){o+=p;return}let{lastChild:c}=m;if(ns(m)){let x=new T(p,t,r);x.type="table-inter",x.setAttribute("stage",3),m.insertAt(x)}else c.setText(String(c)+p)},g=()=>a.type==="td"?n.pop():a;for(let p of s){a=n.pop();let[m]=/^(?:\s|\0\d+c\x7F)*/u.exec(p),c=p.slice(m.length),x=/^(:*)((?:\s|\0\d+c\x7F)*)(\{\||\{(?:\0\d+c\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(c);if(x){for(;a&&a.type!=="td";)a=n.pop();let[,E,B,L,O]=x;E&&new Ye(E,t,r),d(`
26
+ ${m}${E&&`\0${r.length-1}d\x7F`}${B}\0${r.length}b\x7F`,a),n.push(...a?[a]:[],new Mt(L,O,t,r));continue}else if(!a){o+=`
27
+ ${p}`;continue}let k=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(c);if(!k){d(`
28
+ ${p}`,a),n.push(a);continue}let[,w,q,I,$]=k;if(w){for(;a.type!=="table";)a=n.pop();a.close(`
29
+ ${m}${w}`,!0),d($,n[n.length-1])}else if(q){a=g(),a.type==="tr"&&(a=n.pop());let E=new zt(`
30
+ ${m}${q}`,$,t,r);n.push(a,E),a.insertAt(E)}else{a=g();let E=I==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu,B=E.exec($),L=0,O=`
31
+ ${m}${I}`,M=oe=>{let re=new Wt(O,$.slice(L,B==null?void 0:B.index),t,r);return oe.insertAt(re),re};for(;B;)M(a),{lastIndex:L}=E,[O]=B,B=E.exec($);n.push(a,M(a))}}return o.slice(1)}});var Ut,Jn=b(()=>{"use strict";ke();Ut=class extends Q{constructor(){super(...arguments);f(this,"type","hr")}}});var Dt,Yn=b(()=>{"use strict";je();A();ke();Dt=class extends ue(Q){constructor(e,t,r=h.getConfig(),n=[]){super(e,r,n);f(this,"type","double-underscore")}getAttribute(e){return e==="padding"?2:super.getAttribute(e)}toString(e){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}}});var ei={};_(ei,{parseHrAndDoubleUnderscore:()=>ss});var ss,ti=b(()=>{"use strict";A();Jn();Yn();yr();ss=({firstChild:{data:l},type:i,name:e},t=h.getConfig(),r=[])=>{let{doubleUnderscore:n}=t,s=new Set(n[0]),o=new Set(n[1]);return i!=="root"&&(i!=="ext-inner"||e!=="poem")&&(l=`\0${l}`),l=l.replace(/^((?:\0\d+c\x7F)*)(-{4,})/gmu,(a,d,g)=>(new Ut(g,t,r),`${d}\0${r.length-1}r\x7F`)).replace(new RegExp(`__(${n.flat().join("|")})__`,"giu"),(a,d)=>{let g=o.has(d);return g||s.has(d.toLowerCase())?(new Dt(d,g,t,r),`\0${r.length-1}u\x7F`):a}).replace(/^((?:\0\d+c\x7F)*)(={1,6})(.+)\2((?:[^\S\n]|\0\d+c\x7F)*)$/gmu,(a,d,g,p,m)=>{let c=`${d}\0${r.length}h\x7F`;return new Me(g.length,[p,m],t,r),c}),i==="root"||i==="ext-inner"&&e==="poem"?l:l.slice(1)}});var Ht,ri=b(()=>{"use strict";Rt();Ht=class extends ve{constructor(){super(...arguments);f(this,"type","category")}}});var Zt,ni=b(()=>{"use strict";R();A();ke();Zt=class extends Q{constructor(){super(...arguments);f(this,"type","quote")}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}lint(e=this.getAbsoluteIndex()){let{previousSibling:t,nextSibling:r}=this,n=h.msg('lonely "$1"',"'"),s=[],o;if((t==null?void 0:t.type)==="text"&&t.data.endsWith("'")){o=N(this,{start:e},n);let{startIndex:a,startLine:d,startCol:g}=o,[,{length:p}]=/(?:^|[^'])('+)$/u.exec(t.data),m=e-p;s.push({...o,startIndex:m,endIndex:a,startCol:g-p,endLine:d,endCol:g})}if((r==null?void 0:r.type)==="text"&&r.data.startsWith("'")){o!=null||(o=N(this,{start:e},n));let{endIndex:a,endLine:d,endCol:g}=o,[{length:p}]=/^'+/u.exec(r.data),m=a+p;s.push({...o,startIndex:a,endIndex:m,startLine:d,startCol:g,endCol:g+p})}return s}json(){return{...super.json(),bold:this.bold,italic:this.italic}}}});var Wr={};_(Wr,{parseQuotes:()=>os});var os,_r=b(()=>{"use strict";A();ni();os=(l,i=h.getConfig(),e=[])=>{var g;let t=l.split(/('{2,})/u),{length:r}=t;if(r===1)return l;let n=0,s=0,o,a,d;for(let p=1;p<r;p+=2){let{length:m}=t[p];switch(m){case 2:s++;break;case 4:t[p-1]+="'",t[p]="'''";case 3:if(n++,o!==void 0)break;t[p-1].endsWith(" ")?a===void 0&&d===void 0&&(d=p):t[p-1].slice(-2,-1)===" "?o=p:a!=null||(a=p);break;default:t[p-1]+="'".repeat(m-5),t[p]="'''''",s++,n++}}if(s%2===1&&n%2===1){let p=(g=o!=null?o:a)!=null?g:d;p!==void 0&&(t[p]="''",t[p-1]+="'")}for(let p=1;p<r;p+=2)new Zt(t[p],i,e),t[p]=`\0${e.length-1}q\x7F`;return t.join("")}});var si={};_(si,{parseLinks:()=>ii});var ii,oi=b(()=>{"use strict";A();Rr();Lr();ri();ii=(l,i=h.getConfig(),e=[])=>{let{parseQuotes:t}=(_r(),P(Wr)),r=i.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)(.*?[^\]]))?\]\](.*)$/su:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)(.*?[^\]])?)?\]\](.*)$/su,n=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)(.*)$/su,s=new RegExp(`^\\s*(?:${i.protocol}|//)`,"iu"),o=l.split("[["),a=o.shift();for(let d=0;d<o.length;d++){let g=!1,p,m,c,x,k=o[d],w=r.exec(k);if(w)[,p,m,c,x]=w,x.startsWith("]")&&(c!=null&&c.includes("["))&&(c+="]",x=x.slice(1));else{let L=n.exec(k);L&&(g=!0,[,p,m,c]=L)}if(p===void 0||s.test(p)||/\0\d+[exhbru]\x7F/u.test(p)){a+=`[[${k}`;continue}let q=p.trim().startsWith(":");if(q&&g){a+=`[[${k}`;continue}let I=h.normalizeTitle(p,0,!1,i,!0,!0,!0),{ns:$,valid:E}=I;if(E){if(g){if($!==6){a+=`[[${k}`;continue}let L=!1;for(d++;d<o.length;d++){let O=o[d],M=O.split("]]");if(M.length>2){L=!0,c+=`[[${M[0]}]]${M[1]}`,x=M.slice(2).join("]]");break}else if(M.length===2)c+=`[[${M[0]}]]${M[1]}`;else{c+=`[[${O}`;break}}if(c=ii(c,i,e),!L){a+=`[[${p}${m}${c}`;continue}}}else{a+=`[[${k}`;continue}c&&(c=t(c,i,e)),a+=`\0${e.length}l\x7F${x}`;let B=He;q||($===6?B=Ue:$===14&&(B=Ht)),c===void 0&&m&&(c=""),new B(p,c,i,e,m)}return a}});var ai={};_(ai,{parseExternalLinks:()=>as});var as,li=b(()=>{"use strict";V();A();jr();as=(l,i=h.getConfig(),e=[])=>{let t=new RegExp(`\\[((?:(?:${i.protocol}|//)${xe}|\0\\d+m\x7F)${be}(?=[[\\]<>"\\t\\p{Zs}]|\0\\d))(\\p{Zs}*(?=\\P{Zs}))([^\\]-\b
32
+ -\uFFFD]*)\\]`,"giu");return l.replace(t,(r,n,s,o)=>{let{length:a}=e,d=/&[lg]t;/u.exec(n);return d&&(n=n.slice(0,d.index),s="",o=`${n.slice(d.index)}${s}${o}`),new Ve(n,s,o,i,e),`\0${a}w\x7F`})}});var di={};_(di,{parseMagicLinks:()=>ls});var ls,pi=b(()=>{"use strict";V();A();Gr();ls=(l,i=h.getConfig(),e=[])=>{let t=new RegExp(`(^|[^\\p{L}\\d_])(?:${i.protocol})(${xe}${be})`,"giu");return l.replace(t,(r,n,s)=>{let o="",a=n?r.slice(1):r,d=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(a);d&&(o=a.slice(d.index),a=a.slice(0,d.index));let g=new RegExp(`[,;.:!?${a.includes("(")?"":")"}]+$`,"u"),p=g.exec(a);if(p){let m=0;p[0].startsWith(";")&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(a.slice(0,p.index))&&(m=1),o=`${a.slice(p.index+m)}${o}`,a=a.slice(0,p.index+m)}return o.length>=s.length?r:(new Ze(a,!1,i,e),`${n}\0${e.length-1}w\x7F${o}`)})}});var Vt,gi=b(()=>{"use strict";Mr();Vt=class extends Je{constructor(){super(...arguments);f(this,"type","list")}}});var ui={};_(ui,{parseList:()=>ds});var ds,hi=b(()=>{"use strict";A();gi();zr();ds=(l,i=h.getConfig(),e=[])=>{let t=/^((?:\0\d+c\x7F)*)([;:*#]+)/u.exec(l);if(!t)return l;let[r,n,s]=t,o=`${n}\0${e.length}d\x7F${l.slice(r.length)}`,a=s.split(";").length-1;if(new Vt(s,i,e),!a)return o;let d=/:+|-\{/gu,g=d.exec(o),p=0,m=(c,x)=>(new Ye(c,i,e),`${o.slice(0,x)}\0${e.length-1}d\x7F${o.slice(x+c.length)}`);for(;g&&a;){let{0:c,index:x}=g;if(c.startsWith(":")){if(c.length>=a)return m(c.slice(0,a),x);a-=c.length,d.lastIndex=x+4+String(e.length).length,o=m(c,x)}else if(c==="-{"){if(!p){let{lastIndex:k}=d;d=/-\{|\}-/gu,d.lastIndex=k}p++}else if(p--,!p){let{lastIndex:k}=d;d=/:+|-\{/gu,d.lastIndex=k}g=d.exec(o)}return o}});var mi,ci=b(()=>{"use strict";mi=l=>{class i extends l{}return i}});var ps,fe,Qt,fi=b(()=>{"use strict";R();A();C();me();ps=new Set(["A","T","R","D","-","H","N"]),Qt=class extends T{constructor(e,t=h.getConfig(),r=[]){super(void 0,t,r,{});f(this,"type","converter-flags");y(this,fe,void 0);this.append(...e.map(n=>new G(n,"converter-flag",t,r)))}afterBuild(){S(this,fe,this.childNodes.map(e=>e.text().trim()))}toString(e){return super.toString(e,";")}text(){return super.text(";")}getGaps(){return 1}getUnknownFlags(){return new Set(u(this,fe).filter(e=>/\{{3}[^{}]+\}{3}/u.test(e)))}getVariantFlags(){let e=new Set(this.getAttribute("config").variants);return new Set(u(this,fe).filter(t=>e.has(t)))}lint(e=this.getAbsoluteIndex()){let t=this.getVariantFlags(),r=this.getUnknownFlags(),n=new Set(u(this,fe).filter(m=>ps.has(m))),{length:s}=u(this,fe).filter(m=>!m),o=u(this,fe).length-r.size-s,a=super.lint(e);if(t.size===o||n.size===o)return a;let d={start:e,...this.getRootNode().posFromIndex(e)},{childNodes:g,length:p}=this;for(let m=0;m<p;m++){let c=g[m],x=c.text().trim();x&&!t.has(x)&&!r.has(x)&&(t.size>0||!n.has(x))&&a.push(v(c,d,"invalid conversion flag"))}return a}print(){return super.print({sep:";"})}};fe=new WeakMap});var et,Ti=b(()=>{"use strict";A();C();me();et=class extends T{constructor(e,t=!0,r=h.getConfig(),n=[]){super(void 0,r,n);f(this,"type","converter-rule");let s=e.indexOf(":"),o=e.slice(0,s).indexOf("=>"),a=o===-1?e.slice(0,s):e.slice(o+2,s);t&&r.variants.includes(a.trim())?(super.insertAt(new G(a,"converter-rule-variant",r,n)),super.insertAt(new G(e.slice(s+1),"converter-rule-to",r,n)),o!==-1&&super.insertAt(new G(e.slice(0,o),"converter-rule-from",r,n),0)):super.insertAt(new G(e,"converter-rule-to",r,n))}toString(e){let{childNodes:t}=this;if(t.length===3){let[r,n,s]=t;return`${r.toString(e)}=>${n.toString(e)}:${s.toString(e)}`}return super.toString(e,":")}text(){let{childNodes:e}=this;if(e.length===3){let[t,r,n]=e;return`${t.text()}=>${r.text()}:${n.text()}`}return super.text(":")}getGaps(e){return e===0&&this.length===3?2:1}print(){let{childNodes:e}=this;if(e.length===3){let[t,r,n]=e;return`<span class="wpb-converter-rule">${t.print()}=>${r.print()}:${n.print()}</span>`}return super.print({sep:":"})}}});var Xt,xi=b(()=>{"use strict";V();ci();A();C();fi();Ti();Xt=class extends mi(T){constructor(e,t,r=h.getConfig(),n=[]){super(void 0,r,n);f(this,"type","converter");this.append(new Qt(e,r,n));let[s]=t,o=s.includes(":"),a=new et(s,o,r,n);o&&a.length===1?this.insertAt(new et(t.join(";"),!1,r,n)):this.append(a,...t.slice(1).map(d=>new et(d,!0,r,n)))}toString(e){let{childNodes:[t,...r]}=this;return`-{${t.toString()}${t.length>0?"|":""}${r.map(n=>n.toString()).join(";")}}-`}text(){let{childNodes:[e,...t]}=this;return`-{${e.text()}|${pe(t,";")}}-`}getAttribute(e){return e==="padding"?2:super.getAttribute(e)}getGaps(e){return e||this.firstChild.length>0?1:0}print(){let{childNodes:[e,...t]}=this;return`<span class="wpb-converter">-{${e.print()}${e.length>0?"|":""}${ge(t,{sep:";"})}}-</span>`}}});var bi={};_(bi,{parseConverter:()=>gs});var gs,ki=b(()=>{"use strict";A();xi();gs=(l,i=h.getConfig(),e=[])=>{let t=/-\{/gu,r=/-\{|\}-/gu,n=[],s=t,o=s.exec(l);for(;o;){let{0:a,index:d}=o;if(a==="}-"){let g=n.pop(),{length:p}=e,m=l.slice(g.index+2,d),c=m.indexOf("|"),[x,k]=c===-1?[[],m]:[m.slice(0,c).split(";"),m.slice(c+1)],w=k.replace(/(&[#a-z\d]+);/giu,"$1"),q=`(?:${i.variants.join("|")})`,I=w.split(new RegExp(`;(?=(?:[^;]*?=>)?\\s*${q}\\s*:|(?:\\s|\0\\d+c\x7F)*$)`,"u")).map($=>$.replace(/\x01/gu,";"));new Xt(x,I,i,e),l=`${l.slice(0,g.index)}\0${p}v\x7F${l.slice(d+2)}`,n.length===0&&(s=t),s.lastIndex=g.index+3+String(p).length}else n.push(o),s=r,s.lastIndex=d+2;o=s.exec(l)}return l}});var Dr={};_(Dr,{Token:()=>T});var te,j,z,Pe,ut,Ur,Kt,yi,Jt,Ai,Yt,vi,er,Si,tr,$i,rr,wi,nr,Ci,ir,Ni,sr,Fi,or,Ei,ar,Li,Hr,T,C=b(()=>{"use strict";V();de();A();en();nn();Hr=class Hr extends Tt{constructor(e,t=h.getConfig(),r=[],n){super();y(this,ut);y(this,Kt);y(this,Jt);y(this,Yt);y(this,er);y(this,tr);y(this,rr);y(this,nr);y(this,ir);y(this,sr);y(this,or);y(this,ar);f(this,"type","root");y(this,te,0);y(this,j,void 0);y(this,z,void 0);y(this,Pe,void 0);typeof e=="string"&&this.insertAt(e),S(this,j,t),S(this,z,r),r.push(this)}parseOnce(e=u(this,te),t=!1){if(e<u(this,te)||!this.getAttribute("plain")||this.length===0)return this;if(u(this,te)>=11)return this;switch(e){case 0:this.type==="root"&&u(this,z).shift(),S(this,Pe,t),F(this,Kt,yi).call(this,t);break;case 1:F(this,Jt,Ai).call(this);break;case 2:F(this,Yt,vi).call(this);break;case 3:F(this,er,Si).call(this);break;case 4:F(this,tr,$i).call(this);break;case 5:F(this,rr,wi).call(this);break;case 6:F(this,nr,Ci).call(this);break;case 7:F(this,ir,Ni).call(this);break;case 8:F(this,sr,Fi).call(this);break;case 9:F(this,or,Ei).call(this);break;case 10:F(this,ar,Li).call(this)}if(this.type==="root")for(let r of u(this,z))r.parseOnce(e,t);return mt(this,te)._++,this}buildFromStr(e,t){let r=e.split(/[\0\x7F]/u).map((n,s)=>{if(s%2===0)return new ot(n);if(Number.isNaN(Number(n.slice(-1))))return u(this,z)[Number(n.slice(0,-1))];throw new Error(`\u89E3\u6790\u9519\u8BEF\uFF01\u672A\u6B63\u786E\u6807\u8BB0\u7684 Token\uFF1A${n}`)});return t===0?r.map(String).join(""):t===1?pe(r):r}afterBuild(){if(this.type==="root")for(let e of u(this,z))e.afterBuild()}parse(e=11,t=!1){for(e=Math.min(e,11);u(this,te)<e;)this.parseOnce(u(this,te),t);return e&&(F(this,ut,Ur).call(this),this.afterBuild()),this}getAttribute(e){switch(e){case"plain":return this.constructor===Hr;case"config":return JSON.parse(JSON.stringify(u(this,j)));case"accum":return u(this,z);case"include":{if(u(this,Pe)!==void 0)return u(this,Pe);let t=this.getRootNode();return t!==this&&t.getAttribute("include")}default:return super.getAttribute(e)}}setAttribute(e,t){switch(e){case"stage":u(this,te)===0&&this.type==="root"&&u(this,z).shift(),S(this,te,t);break;default:super.setAttribute(e,t)}}insertAt(e,t=this.length){let r=typeof e=="string"?new ot(e):e;return super.insertAt(r,t),r.type==="root"&&(r.type="plain"),r}normalizeTitle(e,t=0,r=!1,n=!1,s=!1){return h.normalizeTitle(e,t,u(this,Pe),u(this,j),r,n,s)}};te=new WeakMap,j=new WeakMap,z=new WeakMap,Pe=new WeakMap,ut=new WeakSet,Ur=function(){var n;S(this,te,11);let{length:e,firstChild:t}=this,r=String(t);if(e===1&&t.type==="text"&&r.includes("\0")&&(this.replaceChildren(...this.buildFromStr(r)),this.normalize(),this.type==="root"))for(let s of u(this,z))F(n=s,ut,Ur).call(n)},Kt=new WeakSet,yi=function(e){let{parseCommentAndExt:t}=(Wn(),P(zn));this.setText(t(String(this.firstChild),u(this,j),u(this,z),e))},Jt=new WeakSet,Ai=function(){let{parseBraces:e}=(vr(),P(wn)),t=this.type==="root"?String(this.firstChild):`\0${String(this.firstChild)}`,r=e(t,u(this,j),u(this,z));this.setText(this.type==="root"?r:r.slice(1))},Yt=new WeakSet,vi=function(){var t;if((t=u(this,j).excludes)!=null&&t.includes("html"))return;let{parseHtml:e}=(Dn(),P(Un));this.setText(e(String(this.firstChild),u(this,j),u(this,z)))},er=new WeakSet,Si=function(){var t;if((t=u(this,j).excludes)!=null&&t.includes("table"))return;let{parseTable:e}=(Kn(),P(Xn));this.setText(e(this,u(this,j),u(this,z)))},tr=new WeakSet,$i=function(){var t;if((t=u(this,j).excludes)!=null&&t.includes("hr"))return;let{parseHrAndDoubleUnderscore:e}=(ti(),P(ei));this.setText(e(this,u(this,j),u(this,z)))},rr=new WeakSet,wi=function(){let{parseLinks:e}=(oi(),P(si));this.setText(e(String(this.firstChild),u(this,j),u(this,z)))},nr=new WeakSet,Ci=function(){var r;if((r=u(this,j).excludes)!=null&&r.includes("quote"))return;let{parseQuotes:e}=(_r(),P(Wr)),t=String(this.firstChild).split(`
33
33
  `);for(let n=0;n<t.length;n++)t[n]=e(t[n],u(this,j),u(this,z));this.setText(t.join(`
34
- `))},nr=new WeakSet,Si=function(){var t;if((t=u(this,j).excludes)!=null&&t.includes("extLink"))return;let{parseExternalLinks:e}=(ii(),P(ni));this.setText(e(String(this.firstChild),u(this,j),u(this,z)))},ir=new WeakSet,$i=function(){var t;if((t=u(this,j).excludes)!=null&&t.includes("magicLink"))return;let{parseMagicLinks:e}=(oi(),P(si));this.setText(e(String(this.firstChild),u(this,j),u(this,z)))},sr=new WeakSet,Ci=function(){var n;if((n=u(this,j).excludes)!=null&&n.includes("list"))return;let{parseList:e}=(di(),P(li)),t=String(this.firstChild).split(`
34
+ `))},ir=new WeakSet,Ni=function(){var t;if((t=u(this,j).excludes)!=null&&t.includes("extLink"))return;let{parseExternalLinks:e}=(li(),P(ai));this.setText(e(String(this.firstChild),u(this,j),u(this,z)))},sr=new WeakSet,Fi=function(){var t;if((t=u(this,j).excludes)!=null&&t.includes("magicLink"))return;let{parseMagicLinks:e}=(pi(),P(di));this.setText(e(String(this.firstChild),u(this,j),u(this,z)))},or=new WeakSet,Ei=function(){var n;if((n=u(this,j).excludes)!=null&&n.includes("list"))return;let{parseList:e}=(hi(),P(ui)),t=String(this.firstChild).split(`
35
35
  `),r=this.type==="root"||this.type==="ext-inner"&&this.name==="poem"?0:1;for(;r<t.length;r++)t[r]=e(t[r],u(this,j),u(this,z));this.setText(t.join(`
36
- `))},or=new WeakSet,wi=function(){if(u(this,j).variants.length>0){let{parseConverter:e}=(fi(),P(ci));this.setText(e(String(this.firstChild),u(this,j),u(this,z)))}};T=Dr});var ss,Re,Ni,os,h,A=b(()=>{we();le();ss=l=>l.replace(/[\0\x7F]/gu,""),Re={i18n:void 0,getConfig(){return{...Vr,...this.config,excludes:[]}},msg(l,i=""){var e,t;return l&&((t=(e=this.i18n)==null?void 0:e[l])!=null?t:l).replace("$1",this.msg(i))},normalizeTitle(l,i=0,e=!1,t=Re.getConfig(),r=!1,n=!1,s=!1){let{Title:o}=(Kr(),P(Qr));if(r)return new o(l,i,t,n,s);let{Token:a}=(w(),P(Ur)),d=nt.run(()=>new a(l,t).parseOnce(0,e).parseOnce());return new o(String(d),i,t,n,s)},parse(l,i,e=11,t=Re.getConfig()){let{Token:r}=(w(),P(Ur));return nt.run(()=>new r(ss(l),t).parse(e,i))}},Ni={},os=new Set(["normalizeTitle","parse"]);for(let l in Re)os.has(l)||(Ni[l]={enumerable:!1});Object.defineProperties(Re,Ni);typeof self=="object"?Object.assign(self,{Parser:Re}):typeof globalThis=="object"&&Object.assign(globalThis,{Parser:Re});h=Re});A();})();
36
+ `))},ar=new WeakSet,Li=function(){if(u(this,j).variants.length>0){let{parseConverter:e}=(ki(),P(bi));this.setText(e(String(this.firstChild),u(this,j),u(this,z)))}};T=Hr});var us,Re,Ii,hs,h,A=b(()=>{Ce();de();us=l=>l.replace(/[\0\x7F]/gu,""),Re={i18n:void 0,getConfig(){return{...Qr,...this.config,excludes:[]}},msg(l,i=""){var e,t;return l&&((t=(e=this.i18n)==null?void 0:e[l])!=null?t:l).replace("$1",this.msg(i))},normalizeTitle(l,i=0,e=!1,t=Re.getConfig(),r=!1,n=!1,s=!1){let{Title:o}=(Yr(),P(Jr));if(r)return new o(l,i,t,n,s);let{Token:a}=(C(),P(Dr)),d=nt.run(()=>new a(l,t).parseOnce(0,e).parseOnce());return new o(String(d),i,t,n,s)},parse(l,i,e=11,t=Re.getConfig()){let{Token:r}=(C(),P(Dr));return nt.run(()=>new r(us(l),t).parse(e,i))}},Ii={},hs=new Set(["normalizeTitle","parse"]);for(let l in Re)hs.has(l)||(Ii[l]={enumerable:!1});Object.defineProperties(Re,Ii);typeof self=="object"?Object.assign(self,{Parser:Re}):typeof globalThis=="object"&&Object.assign(globalThis,{Parser:Re});h=Re});A();})();
@@ -1,6 +1,6 @@
1
1
  (() => {
2
2
  const workerJS = () => {
3
- importScripts('https://testingcf.jsdelivr.net/npm/wikiparser-node@1.3.8-b/bundle/bundle.min.js');
3
+ importScripts('https://testingcf.jsdelivr.net/npm/wikiparser-node@1.3.9-b/bundle/bundle.min.js');
4
4
  const entities = { '&': 'amp', '<': 'lt', '>': 'gt' };
5
5
  self.onmessage = ({ data }) => {
6
6
  const [command, qid, wikitext, include, stage] = data;
@@ -15,7 +15,7 @@ const workerJS = () => {
15
15
  postMessage([qid, Parser.getConfig()]);
16
16
  break;
17
17
  case 'json':
18
- postMessage([qid, JSON.parse(JSON.stringify(Parser.parse(wikitext, include)))]);
18
+ postMessage([qid, Parser.parse(wikitext, include).json()]);
19
19
  break;
20
20
  case 'lint':
21
21
  postMessage([qid, Parser.parse(wikitext, include).lint(), wikitext]);
package/i18n/zh-hans.json CHANGED
@@ -4,6 +4,7 @@
4
4
  "additional \"|\" in a table cell": "表格单元格中多余的\"|\"",
5
5
  "additional \"|\" in the link text": "链接文本中多余的\"|\"",
6
6
  "attributes of a closing tag": "位于闭合标签的属性",
7
+ "bold": "粗体单引号",
7
8
  "conflicting image $1 parameter": "冲突的图片$1参数",
8
9
  "containing invalid attribute": "包含无效属性",
9
10
  "content to be moved out from the table": "将被移出表格的内容",
@@ -19,6 +20,7 @@
19
20
  "illegal attribute name": "非法的属性名",
20
21
  "illegal module name": "非法的模块名称",
21
22
  "insecure style": "不安全的样式",
23
+ "internal link in an external link": "外链中的内链",
22
24
  "invalid content in <$1>": "<$1>内的无效内容",
23
25
  "invalid conversion flag": "无效的转换标记",
24
26
  "invalid gallery image": "无效的图库图片",
@@ -27,17 +29,20 @@
27
29
  "invalid parameter of $1": "$1的无效参数",
28
30
  "invalid self-closing tag": "无效自封闭标签",
29
31
  "invisible content inside triple brackets": "三重括号内的不可见部分",
32
+ "italic": "斜体单引号",
30
33
  "lonely \"$1\"": "孤立的\"$1\"",
31
34
  "missing module function": "缺少模块函数",
32
35
  "missing module name": "缺少模块名称",
33
36
  "nonzero tabindex": "不为0的tabindex",
34
37
  "nothing should be in <$1>": "<$1>标签内不应有任何内容",
38
+ "obsolete attribute": "过时的属性",
39
+ "obsolete HTML tag": "过时的HTML标签",
35
40
  "quotes": "引号",
36
41
  "section header in a HTML tag": "HTML标签属性中的段落标题",
37
42
  "table": "表格",
38
43
  "tag that is both closing and self-closing": "同时闭合和自封闭的标签",
39
44
  "template in an internal link target": "内链目标包含模板",
40
- "unbalanced \"=\" in a section header": "段落标题中不平衡的\"=\"",
45
+ "unbalanced $1 in a section header": "段落标题中不平衡的$1",
41
46
  "unclosed $1": "未闭合的$1",
42
47
  "unclosed tag": "未闭合的标签",
43
48
  "unescaped query string in an anonymous parameter": "匿名参数中未转义的查询参数",
package/i18n/zh-hant.json CHANGED
@@ -4,6 +4,7 @@
4
4
  "additional \"|\" in a table cell": "表哥單元格中多餘的\"|\"",
5
5
  "additional \"|\" in the link text": "連結文本中多餘的\"|\"",
6
6
  "attributes of a closing tag": "位於閉合標籤的屬性",
7
+ "bold apostrophes": "粗體撇號",
7
8
  "conflicting image $1 parameter": "衝突的圖片$1參數",
8
9
  "containing invalid attribute": "包含無效屬性",
9
10
  "content to be moved out from the table": "將被移出表格的內容",
@@ -19,6 +20,7 @@
19
20
  "illegal attribute name": "非法的屬性名",
20
21
  "illegal module name": "非法的模組名稱",
21
22
  "insecure style": "不安全的樣式",
23
+ "internal link in an external link": "外部連結中的內部連結",
22
24
  "invalid content in <$1>": "<$1>內的無效內容",
23
25
  "invalid conversion flag": "無效的轉換標記",
24
26
  "invalid gallery image": "無效的圖庫圖片",
@@ -27,17 +29,20 @@
27
29
  "invalid parameter of $1": "$1的無效參數",
28
30
  "invalid self-closing tag": "無效自封閉標籤",
29
31
  "invisible content inside triple brackets": "三重括號內的不可見部分",
32
+ "italic apostrophes": "斜體撇號",
30
33
  "lonely \"$1\"": "孤立的\"$1\"",
31
34
  "missing module function": "缺少模組函式",
32
35
  "missing module name": "缺少模組名稱",
33
36
  "nonzero tabindex": "不為0的tabindex",
34
37
  "nothing should be in <$1>": "<$1>標籤內不應有任何內容",
38
+ "obsolete attribute": "過時的屬性",
39
+ "obsolete HTML tag": "過時的HTML標籤",
35
40
  "quotes": "引號",
36
41
  "section header in a HTML tag": "HTML標籤屬性中的段落標題",
37
42
  "table": "表格",
38
43
  "tag that is both closing and self-closing": "同時閉合和自封閉的標籤",
39
44
  "template in an internal link target": "內部連結目標包含模板",
40
- "unbalanced \"=\" in a section header": "段落標題中不平衡的\"=\"",
45
+ "unbalanced $1 in a section header": "段落標題中不平衡的$1",
41
46
  "unclosed $1": "未閉合的$1",
42
47
  "unclosed tag": "未閉合的標籤",
43
48
  "unescaped query string in an anonymous parameter": "匿名參數中未轉義的查詢參數",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wikiparser-node",
3
- "version": "1.3.8-b",
3
+ "version": "1.3.9-b",
4
4
  "description": "A Node.js parser for MediaWiki markup with AST",
5
5
  "keywords": [
6
6
  "mediawiki",