wikiparser-node 1.20.2 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/bundle-es8.min.js +28 -0
- package/bundle/bundle-lsp.min.js +22 -22
- package/bundle/bundle.min.js +22 -22
- package/config/enwiki.json +114 -112
- package/config/jawiki.json +9 -2
- package/config/llwiki.json +199 -199
- package/config/zhwiki.json +361 -359
- package/dist/bin/config.js +3 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -1
- package/dist/lib/node.d.ts +3 -1
- package/dist/lib/text.js +28 -7
- package/dist/lib/title.js +2 -1
- package/dist/src/arg.js +7 -7
- package/dist/src/heading.js +6 -3
- package/dist/src/index.js +13 -0
- package/dist/src/link/base.js +1 -1
- package/dist/src/transclude.d.ts +2 -0
- package/dist/src/transclude.js +5 -1
- package/extensions/dist/base.js +63 -28
- package/extensions/dist/codejar.js +1 -1
- package/extensions/dist/lsp.js +14 -14
- package/extensions/typings.d.ts +3 -3
- package/i18n/zh-hans.json +2 -2
- package/package.json +5 -3
- package/bundle/bundle-es7.min.js +0 -28
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";(()=>{var Ra=Object.create;var Ot=Object.defineProperty,Pa=Object.defineProperties,Wi=Object.getOwnPropertyDescriptor,ja=Object.getOwnPropertyDescriptors,Ba=Object.getOwnPropertyNames,zi=Object.getOwnPropertySymbols;var Ui=Object.prototype.hasOwnProperty,Oa=Object.prototype.propertyIsEnumerable;var Hi=(a,n)=>(n=Symbol[a])?n:Symbol.for("Symbol."+a),qt=a=>{throw TypeError(a)};var Xr=(a,n,e)=>n in a?Ot(a,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[n]=e,X=(a,n)=>{for(var e in n||(n={}))Ui.call(n,e)&&Xr(a,e,n[e]);if(zi)for(var e of zi(n))Oa.call(n,e)&&Xr(a,e,n[e]);return a},se=(a,n)=>Pa(a,ja(n)),Di=(a,n)=>Ot(a,"name",{value:n,configurable:!0});var k=(a,n)=>()=>(a&&(n=a(a=0)),n);var qa=(a,n)=>()=>(n||a((n={exports:{}}).exports,n),n.exports),Y=(a,n)=>{for(var e in n)Ot(a,e,{get:n[e],enumerable:!0})},_a=(a,n,e,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of Ba(n))!Ui.call(a,r)&&r!==e&&Ot(a,r,{get:()=>n[r],enumerable:!(t=Wi(n,r))||t.enumerable});return a};var W=a=>_a(Ot({},"__esModule",{value:!0}),a);var R=a=>{var n;return[,,,Ra((n=a==null?void 0:a[Hi("metadata")])!=null?n:null)]},Gi=["class","method","getter","setter","accessor","field","value","get","set"],Tr=a=>a!==void 0&&typeof a!="function"?qt("Function expected"):a,Ma=(a,n,e,t,r)=>({kind:Gi[a],name:n,metadata:t,addInitializer:i=>e._?qt("Already initialized"):r.push(Tr(i||null))}),za=(a,n)=>Xr(n,Hi("metadata"),a[3]),P=(a,n,e,t)=>{for(var r=0,i=a[n>>1],s=i&&i.length;r<s;r++)n&1?i[r].call(e):t=i[r].call(e,t);return t},j=(a,n,e,t,r,i)=>{var s,o,l,g,u,d=n&7,p=!!(n&8),m=!!(n&16),f=d>3?a.length+1:d?p?1:2:0,h=Gi[d+5],x=d>3&&(a[f-1]=[]),b=a[f]||(a[f]=[]),w=d&&(!m&&!p&&(r=r.prototype),d<5&&(d>3||!m)&&Wi(d<4?r:{get[e](){return c(this,i)},set[e](A){return y(this,i,A)}},e));d?m&&d<4&&Di(i,(d>2?"set ":d>1?"get ":"")+e):Di(r,e);for(var C=t.length-1;C>=0;C--)g=Ma(d,e,l={},a[3],b),d&&(g.static=p,g.private=m,u=g.access={has:m?A=>Da(r,A):A=>e in A},d^3&&(u.get=m?A=>(d^1?c:N)(A,r,d^4?i:w.get):A=>A[e]),d>2&&(u.set=m?(A,I)=>y(A,r,I,d^4?i:w.set):(A,I)=>A[e]=I)),o=(0,t[C])(d?d<4?m?i:w[h]:d>4?void 0:{get:w.get,set:w.set}:r,g),l._=1,d^4||o===void 0?Tr(o)&&(d>4?x.unshift(o):d?m?i=o:w[h]=o:r=o):typeof o!="object"||o===null?qt("Object expected"):(Tr(s=o.get)&&(w.get=s),Tr(s=o.set)&&(w.set=s),Tr(s=o.init)&&x.unshift(s));return d||za(a,r),w&&Ot(r,e,w),m?d^4?i:w:r},ge=(a,n,e)=>Xr(a,typeof n!="symbol"?n+"":n,e),Sn=(a,n,e)=>n.has(a)||qt("Cannot "+e),Da=(a,n)=>Object(n)!==n?qt('Cannot use the "in" operator on this value'):a.has(n),c=(a,n,e)=>(Sn(a,n,"read from private field"),e?e.call(a):n.get(a)),T=(a,n,e)=>n.has(a)?qt("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(a):n.set(a,e),y=(a,n,e,t)=>(Sn(a,n,"write to private field"),t?t.call(a,e):n.set(a,e),e),N=(a,n,e)=>(Sn(a,n,"access private method"),e);var Qr=(a,n,e,t)=>({set _(r){y(a,n,r,e)},get _(){return c(a,n,t)}});var Vi,Xi,Qi=k(()=>{"use strict";Vi=(()=>{let a={redirect:1,onlyinclude:1,noinclude:1,include:1,comment:1,ext:1,arg:2,"magic-word":2,template:2,heading:2,html:3,table:4,hr:5,"double-underscore":5,link:6,category:6,file:6,quote:7,"ext-link":8,"free-ext-link":9,"magic-link":9,list:10,dd:10,converter:11,"list-range":11};return Object.setPrototypeOf(a,null),a})(),Xi=(()=>{let a=["bold-header","format-leakage","fostered-content","h1","illegal-attr","insecure-style","invalid-gallery","invalid-imagemap","invalid-invoke","invalid-isbn","lonely-apos","lonely-bracket","lonely-http","nested-link","no-arg","no-duplicate","no-ignored","obsolete-attr","obsolete-tag","parsing-order","pipe-like","table-layout","tag-like","unbalanced-header","unclosed-comment","unclosed-quote","unclosed-table","unescaped","unknown-page","unmatched-tag","unterminated-url","url-encoding","var-anchor","void-ext"];return Object.freeze(a),a})()});function Ee(a){return n=>{let e=new(typeof n=="string"?Map:WeakMap);if(e.has(n)){let r=e.get(n);return r.lastIndex=0,r}let t=a(n);return e.set(n,t),t}}var et,_t=k(()=>{"use strict";et=a=>decodeURIComponent(a.replace(/%(?![\da-f]{2})/giu,"%25"))});var Se,Ki,Be,Oe,qe,Le,ct,Ji,ae,pd,ke,Wa,Ua,ht,Yi,ud,Ha,Ga,Mt,_e,re=k(()=>{"use strict";_t();Se=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Ki=String.raw`[^[\]<>"\0-\x1F\x7F${Se}\uFFFD]`,Be=String.raw`(?:\[[\da-f:.]+\]|${Ki})`,Oe=String.raw`(?:${Ki}|\0\d+[cn!~]\x7F)*`,qe=a=>a.trim().toLowerCase(),Le=(a,n)=>a.replace(/\0(\d+)\x7F/gu,(e,t)=>n[t]),ct=(a,n)=>e=>e.replace(a,n),Ji=ct(/[\0\x7F]|\r$/gmu,""),ae=ct(/\0\d+[cn]\x7F/gu,""),pd=ct(/[\\{}()|.?*+^$[\]]/gu,String.raw`\$&`),ke=(a,n="")=>a.map(e=>typeof e=="string"?e:e.text()).join(n),Wa={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},Ua=ct(/&(?:#(\d+|[Xx][\da-fA-F]+)|([lg]t|[LG]T|[lr]brac[ke]|nbsp|amp|AMP|quot|QUOT));/gu,(a,n,e)=>n?String.fromCodePoint(+((/^x/iu.test(n)?"0":"")+n)):Wa[e.toLowerCase()]),ht=a=>Ua(a),Yi=ct(/&#(\d+|x[\da-f]+);/giu,(a,n)=>String.fromCodePoint(+((/^x/iu.test(n)?"0":"")+n))),ud=ct(/\n/gu,String.raw`\n`),Ha={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},Ga=a=>ct(a,n=>`&${Ha[n]};`),Mt=Ga(/[&<>]/gu),_e=(a,n={})=>{let{pre:e="",post:t="",sep:r=""}=n;return e+a.map(i=>i.print()).join(r)+t}});var Zi=qa((md,Va)=>{Va.exports={ext:[],html:[["b","bdi","del","i","ins","u","font","big","small","sub","sup","h1","h2","h3","h4","h5","h6","cite","code","em","s","strike","strong","tt","var","div","center","blockquote","ol","ul","dl","table","caption","pre","ruby","rb","rp","rt","rtc","p","span","abbr","dfn","kbd","samp","data","time","mark","tr","td","th","q","bdo"],["li","dt","dd"],["br","wbr","hr","meta","link"]],namespaces:{"0":"","6":"File","10":"Template","14":"Category","828":"Module"},nsid:{"":0,file:6,template:10,category:14,module:828},functionHook:["msgnw"],variable:["!","=","pageid","articlepath","server","servername","scriptpath","stylepath"],parserFunction:[{msgnw:"msgnw",pageid:"pageid",articlepath:"articlepath",server:"server",servername:"servername",scriptpath:"scriptpath",stylepath:"stylepath","#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"formatdate","#dateformat":"formatdate","#invoke":"invoke","#while":"while","#dowhile":"dowhile","#loop":"loop","#forargs":"forargs","#fornumargs":"fornumargs","#if":"if","#ifeq":"ifeq","#switch":"switch","#ifexist":"ifexist","#ifexpr":"ifexpr","#iferror":"iferror","#time":"time","#timel":"timel","#expr":"expr","#rel2abs":"rel2abs","#titleparts":"titleparts","#categorytree":"categorytree","#urldecode":"urldecode","#choose":"choose","#var":"var","#varexists":"varexists","#var_final":"var_final","#vardefine":"vardefine","#vardefineecho":"vardefineecho","#widget":"widget","#related":"related","#cscore":"cscore","#regex":"regex","#regex_var":"regex_var","#regexquote":"regexquote","#regexall":"regexall","#len":"len","#pos":"pos","#rpos":"rpos","#sub":"sub","#count":"count","#rmatch":"rmatch","#rreplace":"rreplace","#replace":"replace","#rsplit":"rsplit","#explode":"explode","#tab":"tab","#seo":"seo","#babel":"babel","#translation":"translation","#commaseparatedlist":"commaseparatedlist","#coordinates":"coordinates","#lst":"lst","#lsth":"lsth","#lstx":"lstx","#assessment":"assessment","#mentor":"mentor","#property":"property","#target":"target","#section":"lst","#section-x":"lstx","#section-h":"lsth","#statements":"statements","#useliquidthreads":"useliquidthreads","#lqtpagelimit":"lqtpagelimit","#chart":"chart"},{"!":"!","=":"=","#FORMAL":"formal","#bcp47":"bcp47","#dir":"dir","#interwikilink":"interwikilink","#interlanguagelink":"interlanguagelink","#timef":"timef","#timefl":"timefl"},["msg","raw"],["subst","safesubst"]],doubleUnderscore:[[],[]],protocol:"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|matrix:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|worldwind://|xmpp:",interwiki:[],img:{},redirection:["#redirect"],variants:[]}});var Cn,es=k(()=>{"use strict";Cn=Zi()});var yr,zt,kr,vr,$n,F,ne=k(()=>{"use strict";F=class{constructor(n,e){T(this,vr);T(this,yr);T(this,zt);T(this,kr);y(this,yr,n),y(this,zt,e)}get start(){return c(this,zt)}get top(){return N(this,vr,$n).call(this).top}get left(){return N(this,vr,$n).call(this).left}};yr=new WeakMap,zt=new WeakMap,kr=new WeakMap,vr=new WeakSet,$n=function(){var n;return(n=c(this,kr))!=null||y(this,kr,c(this,yr).getRootNode().posFromIndex(c(this,zt))),c(this,kr)}});var Nn,ts,$,E,Ce,rs,M=k(()=>{"use strict";pe();ne();U();Nn=(a,n,e,t)=>({line:a+e-1,character:(e===1?n:0)+t}),ts=a=>(n,e,t,r,i="error")=>{let{start:s}=e,{top:o,left:l}=e instanceof F?e:new F(n,s),{offsetHeight:g,offsetWidth:u}=n,{startIndex:d,startLine:p,startCol:m}=a(n,s,o,l),{line:f,character:h}=Nn(p,m,g,u);return{rule:t,message:S.msg(r),severity:i,startIndex:d,endIndex:d+n.toString().length,startLine:p,endLine:f,startCol:m,endCol:h}},$=ts((a,n,e,t)=>{let r=a.getRelativeIndex(),{top:i,left:s}=a.parentNode.posFromIndex(r);return{startIndex:n+r,startLine:e+i,startCol:i?s:t+s}}),E=ts((a,n,e,t)=>({startIndex:n,startLine:e,startCol:t})),Ce=(a,n,e)=>{if(a&&S.viewOnly&&a[0]===le.rev)return a[1];let t=n();return S.viewOnly&&e([le.rev,t]),t},rs=(a,n)=>a==="ol"&&n==="type"?["1","a","A","i","I"]:a==="th"&&n==="scope"?["row","col","rowgroup","colgroup"]:n==="dir"?["ltr","rtl","auto"]:n==="aria-hidden"?["true","false"]:[]});var Xa,Kr,ns=k(()=>{"use strict";Xa=(a,n,e)=>{if(a.includes("#")){let[t,...r]=a.split("#");return(!t||t===n)&&r.every(i=>i===e)}return!a||a===n},Kr=(a,n,e)=>({type:t,name:r})=>a.split(",").some(i=>Xa(i.trim(),t,r))});var Ar,Dt,Wt,wr,Sr,Ut,Ht,Cr,In,Gt,En=k(()=>{"use strict";M();pe();U();Gt=class{constructor(){T(this,Cr);ge(this,"childNodes",[]);T(this,Ar);T(this,Dt);T(this,Wt);T(this,wr);T(this,Sr);T(this,Ut);T(this,Ht,{})}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get parentNode(){return c(this,Ar)}get nextSibling(){return c(this,Dt)}get previousSibling(){return c(this,Wt)}get offsetHeight(){return N(this,Cr,In).call(this).height}get offsetWidth(){return N(this,Cr,In).call(this).width}getChildNodes(){let{childNodes:n}=this;return Object.isFrozen(n)?[...n]:n}getAttribute(n){return n==="padding"?0:this[n]}setAttribute(n,e){switch(n){case"parentNode":y(this,Ar,e),e||(y(this,Dt,void 0),y(this,Wt,void 0));break;case"nextSibling":y(this,Dt,e);break;case"previousSibling":y(this,Wt,e);break;case"aIndex":S.viewOnly&&y(this,Ut,[le.rev,e]);break;default:this[n]=e}}getRootNode(){return Ce(c(this,Sr),()=>{var n,e;return(e=(n=this.parentNode)==null?void 0:n.getRootNode())!=null?e:this},n=>{let[,e]=n;e.type==="root"&&y(this,Sr,n)})}indexFromPos(n,e){}posFromIndex(n){let{length:e}=String(this);if(n+=n<0?e:0,n>=0&&n<=e){let t=this.getLines(),r=t.findIndex(([,,i])=>n<=i);return{top:r,left:n-t[r][1]}}}getGaps(n){return 0}getRelativeIndex(n){if(n===void 0){let{parentNode:e}=this;return e?e.getRelativeIndex(e.childNodes.indexOf(this)):0}return Ce(c(this,Ht)[n],()=>{let{childNodes:e}=this,t=n+(n<0?e.length:0),r=this.getAttribute("padding");for(let i=0;i<t;i++)S.viewOnly&&(c(this,Ht)[i]=[le.rev,r]),r+=e[i].toString().length+this.getGaps(i);return r},e=>{c(this,Ht)[n]=e})}getAbsoluteIndex(){return Ce(c(this,Ut),()=>{let{parentNode:n}=this;return n?n.getAbsoluteIndex()+this.getRelativeIndex():0},n=>{y(this,Ut,n)})}getBoundingClientRect(){}is(n){return this.type===n}getLines(){return Ce(c(this,wr),()=>{let n=[],e=0;for(let t of String(this).split(`
|
|
2
|
+
`)){let r=e+t.length;n.push([t,e,r]),e=r+1}return n},n=>{y(this,wr,n)})}seal(n,e){Object.defineProperty(this,n,{enumerable:!e&&!!this[n],configurable:!0})}};Ar=new WeakMap,Dt=new WeakMap,Wt=new WeakMap,wr=new WeakMap,Sr=new WeakMap,Ut=new WeakMap,Ht=new WeakMap,Cr=new WeakSet,In=function(){let n=this.getLines(),e=n[n.length-1];return{height:n.length,width:e[2]-e[1]}}});var tt,Ln,Fn,Jr,is=k(()=>{"use strict";re();pe();ns();En();Jr=class extends Gt{constructor(){super(...arguments);T(this,tt)}get length(){return this.childNodes.length}text(e){return ke(this.childNodes,e)}normalize(){let e=this.getChildNodes(),t=r=>{var i,s;e.splice(r,1),(i=e[r-1])==null||i.setAttribute("nextSibling",e[r]),(s=e[r])==null||s.setAttribute("previousSibling",e[r-1])};for(let r=e.length-1;r>=0;r--){let{type:i,data:s}=e[r];i!=="text"||e.length===1||this.getGaps(r-(r&&1))||s===""&&t(r)}this.setAttribute("childNodes",e)}removeAt(e){return $r(this,e,1)[0]}insertAt(e,t=this.length){return $r(this,t,0,[e]),e}closest(e){let t=Kr(e,this),{parentNode:r}=this;for(;r;){if(t(r))return r;({parentNode:r}=r)}}querySelector(e){let t=Kr(e,this);return N(this,tt,Ln).call(this,t)}querySelectorAll(e){let t=Kr(e,this);return N(this,tt,Fn).call(this,t)}append(...e){this.safeAppend(e)}safeAppend(e){for(let t of e)this.insertAt(t)}replaceChildren(...e){this.safeReplaceChildren(e)}safeReplaceChildren(e){for(let t=this.length-1;t>=0;t--)this.removeAt(t);this.safeAppend(e)}setText(e,t=0){t+=t<0?this.length:0;let r=this.childNodes[t],{data:i}=r;return r.replaceData(e),i}toString(e,t=""){return this.childNodes.map(r=>r.toString(e)).join(t)}caretPositionFromIndex(e){}elementFromIndex(e){}elementFromPoint(e,t){}lint(e=this.getAbsoluteIndex(),t){let r=[];for(let i=0,s=e+this.getAttribute("padding");i<this.length;i++){let o=this.childNodes[i];o.setAttribute("aIndex",s);let l=o.lint(s,t);l.length>0&&r.push(...l),s+=o.toString().length+this.getGaps(i)}return r}print(e={}){let t=e.class;return this.toString()?(t===""?"":`<span class="wpb-${t!=null?t:this.type}">`)+_e(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){let r=se(X({},this),{type:this.type,range:[t,t+this.toString().length],childNodes:[]});for(let i=0,s=t+this.getAttribute("padding");i<this.length;i++){let o=this.childNodes[i],{length:l}=o.toString();o.setAttribute("aIndex",s),r.childNodes.push(o.type==="text"?{data:o.data,range:[s,s+l]}:o.json(void 0,s)),s+=l+this.getGaps(i)}return r}};tt=new WeakSet,Ln=function(e){var t;for(let r of this.childNodes){if(r.type==="text")continue;if(e(r))return r;let i=N(t=r,tt,Ln).call(t,e);if(i)return i}},Fn=function(e){var r;let t=[];for(let i of this.childNodes)i.type!=="text"&&(e(i)&&t.push(i),t=[...t,...N(r=i,tt,Fn).call(r,e)]);return t}});var Rn,os,Qa,Ka,Ja,Ya,Za,ss,Pn,Yr,as,Nr,ls=k(()=>{"use strict";re();M();U();En();Rn=String.raw`[${Se}\t]*`,os=String.raw`<\s*(?:/\s*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${Rn}\d)|isbn(?=[-::]?${Rn}(?:\d(?:${Rn}|-)){6})`,Qa=new RegExp(String.raw`${os}|https?[:/]/+`,"giu"),Ka=new RegExp(os,"giu"),Ja=new Set(["attr-value","ext-link-text","link-text"]),Ya={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},Za={"<":"tag-like","[":"lonely-bracket","{":"lonely-bracket","]":"lonely-bracket","}":"lonely-bracket",h:"lonely-http",r:"lonely-http",p:"lonely-http",i:"lonely-http"},ss=new Set(["html","head","style","title","body","a","audio","img","video","embed","iframe","object","canvas","script","col","colgroup","tbody","tfoot","thead","button","input","label","option","select","textarea"]);try{Pn=new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch(a){Pn=/\w/u}Nr=class extends Gt{constructor(e){super();T(this,Yr);ge(this,"data","");this.data=e}get type(){return"text"}toString(e){var t;return e&&!((t=this.parentNode)!=null&&t.getAttribute("built"))?ae(this.data):this.data}text(){return this.data}lint(e=this.getAbsoluteIndex(),t){var L,V,ie;if(t===!1)return[];let{data:r,parentNode:i,nextSibling:s,previousSibling:o}=this;if(!i)throw new Error("An isolated text node cannot be linted!");let{type:l,name:g,parentNode:u}=i,d=!1;if(l==="attr-value"){let{type:oe,name:Z,tag:te}=u;if(oe!=="ext-attr")d=!0;else if(te==="ref"&&(Z==="name"||Z==="extends"||Z==="follow")||Z==="group"&&(te==="ref"||te==="references")||te==="choose"&&(Z==="before"||Z==="after"))return[]}if(t!=null||(t=l==="free-ext-link"||l==="ext-link-url"||l==="ext-link-text"||l==="image-parameter"&&g==="link"||d?Ka:Qa),r.search(t)===-1)return[];t.lastIndex=0;let p=[],m=s==null?void 0:s.type,f=s==null?void 0:s.name,h=o==null?void 0:o.type,x=this.getRootNode(),b=x.toString(),{ext:w,html:C,variants:A}=x.getAttribute("config"),{top:I,left:B}=x.posFromIndex(e),z=new Set(["onlyinclude","noinclude","includeonly",...w,...C[0],...C[1],...C[2],...ss]);for(let oe=t.exec(r);oe;oe=t.exec(r)){let[,Z,te]=oe,{index:K,0:_}=oe;if(te&&te!=="]"){let{length:be}=te;K+=be,_=_.slice(be)}_=_.toLowerCase();let[q]=_,we=q==="r"||q==="p"||q==="i",{length:he}=_;if(q==="<"&&!z.has(Z.toLowerCase())||q==="["&&l==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(r.slice(K+1))||s!=null&&s.is("ext")&&f==="nowiki"&&((L=s.innerText)!=null&&L.includes("]")))||we&&(!i.isPlain()||Ja.has(l)))continue;q==="]"&&(K||he>1)&&t.lastIndex--;let xe=e+K,Ye=xe+he,Ze=b[Ye],Vr=b[xe-1],pt=he>1&&!(q==="<"&&(/^<\s/u.test(_)||!/[\s/>]/u.test(Ze!=null?Ze:"")||ss.has(Z))||d&&(q==="["||q==="]")||we&&l==="parameter-value"||/^(?:rfc|pmid|isbn)$/iu.test(_))||q==="{"&&(Ze===q||Vr==="-"&&A.length>0)||q==="}"&&(Vr===q||Ze==="-"&&A.length>0)||q==="["&&(l==="ext-link-text"||m==="free-ext-link"&&!r.slice(K+1).trim())||q==="]"&&h==="free-ext-link"&&!r.slice(0,K).includes("]")?"error":"warning",An=q==="{"||q==="[";if(pt==="warning"&&(An||(q==="]"||q==="}"))){let be=Ya[q],wn=An?r.slice(K+1):r.slice(0,K);if(q==="{"&&((V=be.exec(wn))==null?void 0:V[0])==="}"||q==="}"&&((ie=be.exec(wn))==null?void 0:ie[0])==="{")continue;if(!wn.includes(q)){let Mi=An?"nextSibling":"previousSibling",ut=this[Mi];for(;ut&&(ut.type!=="text"||!be.test(ut.data));)ut=ut[Mi];if(ut&&be.exec(ut.data)[0]!==q)continue}}we?_=_.toUpperCase():_==="{"&&Vr==="-"&&pt==="error"?(pt="warning",K>0&&(_="-{",K--,xe--,he=2)):_==="}"&&Ze==="-"&&pt==="error"&&(pt="warning",K<r.length-1&&(_="}-",Ye++,he=2));let Oi=this.posFromIndex(K),{line:qi,character:_i}=Nn(I,B,Oi.top+1,Oi.left),Bt={rule:Za[q],message:S.msg('lonely "$1"',we||q==="h"||_==="-{"||_==="}-"?_:q),severity:pt,startIndex:xe,endIndex:Ye,startLine:qi,endLine:qi,startCol:_i,endCol:_i+he};if(q==="<")Bt.suggestions=[{desc:"escape",range:[xe,xe+1],text:"<"}];else if(q==="h"&&l!=="link-text"&&Pn.test(Vr||""))Bt.suggestions=[{desc:"whitespace",range:[xe,xe],text:" "}];else if(q==="["&&l==="ext-link-text"){let be=i.getAbsoluteIndex()+i.toString().length;Bt.suggestions=[{desc:"escape",range:[be,be+1],text:"]"}]}else if(q==="]"&&h==="free-ext-link"&&pt==="error"){let be=e-o.toString().length;Bt.suggestions=[{desc:"left bracket",range:[be,be],text:"["}]}else we&&(Bt.suggestions=[...oe[0]===_?[]:[{desc:"uppercase",range:[xe,Ye],text:_}],...Ze===":"||Ze===":"?[{desc:"whitespace",range:[Ye,Ye+1],text:" "}]:[]]);p.push(Bt)}return p}replaceData(e){N(this,Yr,as).call(this,e)}print(){return Mt(this.data)}};Yr=new WeakSet,as=function(e){this.setAttribute("data",e)}});var ve,mt=k(()=>{"use strict";pe();ve=(a=!0,n=!0)=>e=>{class t extends e{text(){return""}lint(i){return a?[]:super.lint(i)}}return Fe(t,e),t}});var Ir,me,ft=k(()=>{"use strict";O();me=class extends v{constructor(e,t,r,i,s){super(e,r,i,s);T(this,Ir);y(this,Ir,t)}get type(){return c(this,Ir)}lint(e=this.getAbsoluteIndex()){return super.lint(e,!1)}};Ir=new WeakMap});var ue,Me=k(()=>{"use strict";pe();ue=({length:a})=>n=>{class e extends n{getAttribute(r){return r==="padding"?a:super.getAttribute(r)}}return Fe(e,n),e}});var Vt,Q,ze=k(()=>{"use strict";O();Q=class extends v{constructor(e,t,r,i,s){super(e,r,i,s);T(this,Vt);y(this,Vt,t)}get type(){return c(this,Vt)}set type(e){y(this,Vt,e)}};Vt=new WeakMap});var el,ds,xt,$e,De,jn,tl,Te,Er=k(()=>{"use strict";M();re();ne();Me();O();ze();el=a=>a==="redirect-target"||a==="link";ds=[ue("[[")];Te=class extends(tl=v){constructor(e,t,r,i=[],s="|"){super(void 0,r,i,{});T(this,xt,!0);T(this,$e);T(this,De);if(this.insertAt(new Q(e,"link-target",r,i,{})),t!==void 0){let o=new v(t,r,i,{});o.type="link-text",o.setAttribute("stage",10),this.insertAt(o)}y(this,$e,s)}get link(){}get fragment(){return c(this,De).fragment}afterBuild(){y(this,De,this.getTitle()),c(this,$e).includes("\0")&&y(this,$e,this.buildFromStr(c(this,$e),0)),this.setAttribute("name",c(this,De).title),super.afterBuild()}setAttribute(e,t){e==="bracket"?y(this,xt,t):e==="title"?y(this,De,t):super.setAttribute(e,t)}toString(e){let t=super.toString(e,c(this,$e));return c(this,xt)?`[[${t}]]`:t}text(){let e=super.text("|");return c(this,xt)?`[[${e}]]`:e}getAttribute(e){return e==="title"?c(this,De):super.getAttribute(e)}getGaps(e){return e===0?c(this,$e).length:1}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{childNodes:[i,s],type:o}=this,{encoded:l,fragment:g}=c(this,De),u=new F(this,e);if(i.childNodes.some(({type:d})=>d==="template")&&r.push($(i,u,"unknown-page","template in an internal link target","warning")),l){let d=$(i,u,"url-encoding","unnecessary URL encoding in an internal link");d.suggestions=[{desc:"decode",range:[d.startIndex,d.endIndex],text:et(i.text())}],r.push(d)}if(o==="link"||o==="category"){let d=s==null?void 0:s.childNodes.findIndex(m=>m.type==="text"&&m.data.includes("|")),p=s==null?void 0:s.childNodes[d];if(p){let m=$(s,u,"pipe-like",'additional "|" in the link text',"warning"),f=m.startIndex+s.getRelativeIndex(d);m.suggestions=[{desc:"escape",range:[f,f+p.data.length],text:p.data.replace(/\|/gu,"|")}],r.push(m)}}if(g!==void 0&&!el(o)){let d=$(i,u,"no-ignored","useless fragment","warning"),p=i.childNodes.findIndex(f=>f.type==="text"&&f.data.includes("#")),m=i.childNodes[p];m&&(d.fix={range:[d.startIndex+i.getRelativeIndex(p)+m.data.indexOf("#"),d.endIndex],text:"",desc:"remove"}),r.push(d)}return r}getTitle(e,t){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:t,temporary:e,decode:!0,selfLink:!0})}print(){return super.print(c(this,xt)?{pre:"[[",post:"]]",sep:c(this,$e)}:{sep:c(this,$e)})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t),{type:i,fragment:s}=this;return s!==void 0&&(i==="link"||i==="redirect-target")&&(r.fragment=s),r}};jn=R(tl),xt=new WeakMap,$e=new WeakMap,De=new WeakMap,Te=j(jn,0,"LinkBaseToken",ds,Te),P(jn,1,Te)});var ce,rt=k(()=>{"use strict";O();ce=class extends v{get innerText(){return this.firstChild.data}constructor(n="",e,t){super(n,e,t)}}});var gs,Bn,rl,D,We=k(()=>{"use strict";mt();rt();gs=[ve()];D=class extends(rl=ce){get type(){return"noinclude"}toString(n){return n?"":super.toString()}};Bn=R(rl),D=j(Bn,0,"NoincludeToken",gs,D),P(Bn,1,D)});var Zr,ps=k(()=>{"use strict";M();Er();We();Zr=class extends Te{get type(){return"redirect-target"}constructor(n,e,t,r){super(n,void 0,t,r),e!==void 0&&this.insertAt(new D(e,t,r))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,{halfParsed:!0,decode:!0})}lint(n=this.getAbsoluteIndex()){let e=super.lint(n,!1);if(this.length===2){let t=$(this.lastChild,{start:n},"no-ignored","useless link text","warning");t.startIndex--,t.startCol--,t.fix={range:[t.startIndex,t.endIndex],text:"",desc:"remove"},e.push(t)}return e}}});var us,nt,Xt,On,nl,bt,cs=k(()=>{"use strict";mt();O();ft();ps();us=[ve(!1,!1)];bt=class extends(nl=v){constructor(e,t,r,i,s,o,l=[]){super(void 0,o,l);T(this,nt);T(this,Xt);y(this,nt,e),y(this,Xt,s),this.append(new me(t,"redirect-syntax",o,l),new Zr(r,i==null?void 0:i.slice(1),o,l))}get type(){return"redirect"}getAttribute(e){return e==="padding"?c(this,nt).length:super.getAttribute(e)}toString(e){return c(this,nt)+super.toString(e)+c(this,Xt)}lint(e=this.getAbsoluteIndex()){let t=e+c(this,nt).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",t),this.lastChild.lint(t)}print(){return super.print({pre:c(this,nt),post:c(this,Xt)})}};On=R(nl),nt=new WeakMap,Xt=new WeakMap,bt=j(On,0,"RedirectToken",us,bt),P(On,1,bt)});var hs={};Y(hs,{parseRedirect:()=>il});var il,ms=k(()=>{"use strict";U();cs();il=(a,n,e)=>{var r;(r=n.regexRedirect)!=null||(n.regexRedirect=new RegExp(String.raw`^(\s*)((?:${n.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));let t=n.regexRedirect.exec(a);return t&&S.normalizeTitle(t[3],0,!1,n,{halfParsed:!0,temporary:!0,decode:!0}).valid?(a=`\0${e.length}o${a.slice(t[0].length)}`,new bt(...t.slice(1),n,e),a):!1}});var fs,qn,sl,Tt,xs=k(()=>{"use strict";Me();O();fs=[ue("<onlyinclude>")];Tt=class extends(sl=v){get type(){return"onlyinclude"}toString(n){return`<onlyinclude>${super.toString(n)}</onlyinclude>`}isPlain(){return!0}print(){return super.print({pre:'<span class="wpb-ext"><onlyinclude></span>',post:'<span class="wpb-ext"></onlyinclude></span>'})}};qn=R(sl),Tt=j(qn,0,"OnlyincludeToken",fs,Tt),P(qn,1,Tt)});var it,Lr=k(()=>{"use strict";pe();it=(a=1)=>n=>{class e extends n{getGaps(){return a}}return Fe(e,n),e}});var bs,st,_n,ol,Ie,en=k(()=>{"use strict";Lr();O();bs=[it()];Ie=class extends(ol=v){constructor(e,t,r,i,s,o=[]){super(void 0,s);T(this,st);ge(this,"closed");ge(this,"selfClosing");this.setAttribute("name",e.toLowerCase()),y(this,st,[e,i||e]),this.closed=i!=="",this.selfClosing=i===void 0,this.append(t,r);let l=typeof t=="string"?-1:o.indexOf(t);o.splice(l===-1?1/0:l,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(e){let{selfClosing:t,firstChild:r,lastChild:i}=this,[s,o]=c(this,st);return t?`<${s}${r.toString(e)}/>`:`<${s}${r.toString(e)}>${i.toString(e)}${this.closed?`</${o}>`:""}`}text(){let[e,t]=c(this,st);return this.selfClosing?`<${e}${this.firstChild.text()}/>`:`<${e}${super.text(">")}${this.closed?`</${t}>`:""}`}getAttribute(e){return e==="padding"?c(this,st)[0].length+1:super.getAttribute(e)}print(){let[e,t]=c(this,st);return super.print(this.selfClosing?{pre:`<${e}`,post:"/>"}:{pre:`<${e}`,sep:">",post:this.closed?`</${t}>`:""})}};_n=R(ol),st=new WeakMap,Ie=j(_n,0,"TagPairToken",bs,Ie),P(_n,1,Ie)});var rn,Ts,tn,ys=k(()=>{"use strict";O();en();ft();We();tn=class extends Ie{constructor(e,t,r,i=[]){let s=new me(e,"translate-attr",r,i);t=t==null?void 0:t.replace(/(<tvar\|[^>]+>)([\s\S]*?)(<\/>)/gu,(l,g,u,d)=>(new D(g,r,i),new D(d,r,i),`\0${i.length-1}n${u}\0${i.length}n`)).replace(/(<tvar\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\2|[^"'\s>]+))?\s*>)([\s\S]*?)(<\/tvar\s*>)/giu,(l,g,u,d,p)=>(new D(g,r,i),new D(p,r,i),`\0${i.length-1}n${d}\0${i.length}n`));let o=new v(t,r,i);o.type="translate-inner";super("translate",s,o,"translate",r,i);T(this,rn);this.seal("closed",!0),this.seal("selfClosing",!0)}get type(){return"translate"}toString(e){return e?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){return`<span class="wpb-ext"><translate${N(this,rn,Ts).call(this)?'<span class="wpb-ext-attrs"> <span class="wpb-ext-attr"><span class="wpb-attr-key">nowrap</span></span></span>':""}>${this.lastChild.print({class:"ext-inner"})}</translate></span>`}};rn=new WeakSet,Ts=function(){return this.firstChild.toString()===" nowrap"}});var ks,Mn,al,yt,vs=k(()=>{"use strict";M();ne();mt();U();en();ks=[ve(!1)];yt=class extends(al=Ie){get type(){return"include"}constructor(n,e="",t,r,i,s){super(n,e,t!=null?t:"",t===void 0||r!=null?r:"",i,s)}toString(n){return n?"":super.toString()}lint(n=this.getAbsoluteIndex()){let e=[],{firstChild:t,closed:r,name:i}=this,s=new F(this,n);if(t.data.trim()){let o=$(t,s,"no-ignored","useless attribute","warning");o.suggestions=[{desc:"remove",range:[o.startIndex,o.endIndex],text:""}],e.push(o)}if(!r){let o=E(this,s,"unclosed-comment",S.msg("unclosed $1",`<${i}>`));o.suggestions=[{desc:"close",range:[o.endIndex,o.endIndex],text:`</${i}>`}],e.push(o)}return e}};Mn=R(al),yt=j(Mn,0,"IncludeToken",ks,yt),P(Mn,1,yt)});var Qt,nn=k(()=>{"use strict";pe();Qt=(a=0)=>n=>{var t,As;class e extends n{constructor(){super(...arguments);T(this,t)}getAttr(o){return N(this,t,As).call(this).getAttr(o)}}return t=new WeakSet,As=function(){return this.childNodes[a]},Fe(e,n),e}});var ee,ws,Ss,sn,Dn,Cs,Kt,Ns,Is,Es,zn,$s,Re,Ls,Fs,Rs,Ps,js=k(()=>{"use strict";ee=new Set(["align"]),ws=new Set(["cite"]),Ss=new Set(["cite","datetime"]),sn=new Set(["width"]),Dn=new Set(["axis","align","bgcolor","height","width","valign"]),Cs=new Set([...Dn,"abbr","headers","scope","rowspan","colspan"]),Kt=new Set(["type"]),Ns=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),Is=new Set(["clear"]),Es=new Set(["bgcolor","align","valign"]),zn=new Set(["qid","forcemathmode","type","display"]),$s=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),Re=new Set,Ls=new Set(["id","class","style","lang","dir","title","tabindex","aria-describedby","aria-flowto","aria-hidden","aria-label","aria-labelledby","aria-level","aria-owns","role","about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),Fs={div:ee,h1:ee,h2:ee,h3:ee,h4:ee,h5:ee,h6:ee,blockquote:ws,q:ws,p:ee,br:Is,pre:sn,ins:Ss,del:Ss,ul:Kt,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...Ns,"border"]),caption:ee,tr:Es,td:Cs,th:Cs,img:new Set(["alt","src","width","height","srcset"]),font:new Set(["size","color","face"]),hr:sn,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Kt,poem:ee,categorytree:ee,combooption:ee,math:Re,chem:Re,ce:Re},Rs={gallery:new Set(["mode","showfilename","caption","perrow","widths","heights","showthumbnails"]),poem:new Set(["compact"]),categorytree:new Set(["hideroot","onlyroot","depth","mode","hideprefix","namespaces","showcount","notranslations"]),combooption:new Set(["name","for","inline"]),nowiki:Re,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:Re,inputbox:Re,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:Re,poll:new Set(["id","show-results-before-voting"]),sm2:Kt,flashmp3:Kt,score:new Set(["line_width_inches","lang","override_midi","raw","note-language","override_audio","override_ogg","sound","vorbis"]),seo:new Set(["title","title_mode","title_separator","keywords","description","robots","google_bot","image","image_width","image_height","image_alt","type","site_name","locale","section","author","published_time","twitter_site"]),tab:new Set(["nested","name","index","class","block","inline","openname","closename","collapsed","dropdown","style","bgcolor","container","id","title"]),tabs:new Set(["plain","class","container","id","title","style"]),combobox:new Set(["placeholder","value","id","class","text","dropdown","style"]),math:new Set([...zn,"chem"]),chem:zn,ce:zn,hiero:Re,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:$s,syntaxhighlight:$s,templatedata:Re,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:Re},Ps={table:Ns,td:new Set([...Dn,"scope"]),th:Dn,br:Is,caption:ee,div:ee,hr:sn,h1:ee,h2:ee,h3:ee,h4:ee,h5:ee,h6:ee,li:Kt,p:ee,pre:sn,tr:Es,ul:Kt}});var ll,dl,Fr,Jt,de,Pe,Yt,Bs=k(()=>{"use strict";M();re();js();ne();U();O();ze();ll=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,dl=new Set(["ext","arg","magic-word","template"]),Yt=class extends v{constructor(e,t,r,i="",s,o=[],l=S.getConfig(),g=[]){let u=new Q(r,"attr-key",l,g),d;if(r==="title"||t==="img"&&r==="alt")d=new v(s,l,g,{}),d.type="attr-value",d.setAttribute("stage",10);else if(t==="gallery"&&r==="caption"||t==="choose"&&(r==="before"||r==="after")){let p=se(X({},l),{excludes:[...l.excludes,"heading","html","table","hr","list"]});d=new v(s,p,g,{}),d.type="attr-value",d.setAttribute("stage",1)}else d=new Q(s,"attr-value",l,g,{});super(void 0,l,g);T(this,Fr);T(this,Jt);T(this,de);T(this,Pe);y(this,Fr,e),this.append(u,d),y(this,de,i),y(this,Pe,[...o]),y(this,Jt,t),this.setAttribute("name",qe(ae(r)))}get type(){return c(this,Fr)}get tag(){return c(this,Jt)}get balanced(){return!c(this,de)||c(this,Pe)[0]===c(this,Pe)[1]}afterBuild(){c(this,de).includes("\0")&&y(this,de,this.buildFromStr(c(this,de),0)),this.parentNode&&y(this,Jt,this.parentNode.name),this.setAttribute("name",qe(this.firstChild.text())),super.afterBuild()}toString(e){let[t="",r=""]=c(this,Pe);return c(this,de)?super.toString(e,c(this,de)+t)+r:this.firstChild.toString(e)}text(){return c(this,de)?`${super.text(`${c(this,de).trim()}"`)}"`:this.firstChild.text()}getGaps(){var e,t;return c(this,de)?c(this,de).length+((t=(e=c(this,Pe)[0])==null?void 0:e.length)!=null?t:0):0}lint(e=this.getAbsoluteIndex(),t){var x;let r=super.lint(e,t),{balanced:i,firstChild:s,lastChild:o,type:l,name:g,tag:u}=this,d=this.getValue(),p=new F(this,e);if(!i){let b=$(o,p,"unclosed-quote",S.msg("unclosed $1","quotes"),"warning");b.startIndex--,b.startCol--,b.suggestions=[{range:[b.endIndex,b.endIndex],text:c(this,Pe)[0],desc:"close"}],r.push(b)}let m=Rs[u],f=Fs[u],{length:h}=this.toString();if(!(m!=null&&m.has(g))&&!(f!=null&&f.has(g))&&(l==="ext-attr"?m||f:!/\{\{[^{]+\}\}/u.test(g))&&(l==="ext-attr"&&!f||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(g)&&(u==="meta"||u==="link"||!Ls.has(g)))){let b=$(s,p,"illegal-attr","illegal attribute name");b.suggestions=[{desc:"remove",range:[e,e+h],text:""}],r.push(b)}else if(g==="style"&&typeof d=="string"&&ll.test(d))r.push($(o,p,"insecure-style","insecure style"));else if(g==="tabindex"&&typeof d=="string"&&d!=="0"){let b=$(o,p,"illegal-attr","nonzero tabindex");b.suggestions=[{desc:"remove",range:[e,e+h],text:""},{desc:"0 tabindex",range:[b.startIndex,b.endIndex],text:"0"}],r.push(b)}else if(l!=="ext-attr"&&!o.childNodes.some(({type:b})=>dl.has(b))){let b=rs(u,g),w=String(d).toLowerCase();b.length>0&&b.every(C=>C!==w)&&r.push($(o,p,"illegal-attr","illegal attribute value","warning"))}return(x=Ps[u])!=null&&x.has(g)&&r.push($(s,p,"obsolete-attr","obsolete attribute","warning")),r}getValue(){return c(this,de)?this.lastChild.text().trim():this.type==="ext-attr"||""}print(){let[e="",t=""]=c(this,Pe);return c(this,de)?super.print({sep:Mt(c(this,de))+e,post:t}):super.print()}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return r.tag=this.tag,r}};Fr=new WeakMap,Jt=new WeakMap,de=new WeakMap,Pe=new WeakMap});var Os,gl,Wn,Rr,ot,on=k(()=>{"use strict";M();re();ne();U();O();ze();Bs();Os=a=>a.slice(0,-1),gl=a=>`${Os(a)}-dirty`;try{Wn=new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch(a){Wn=/[^\W_]/u}ot=class extends v{constructor(e,t,r,i,s=[]){super(void 0,i,s,{});T(this,Rr);if(y(this,Rr,t),this.setAttribute("name",r),e){let o=/([^\s/](?:(?!\0\d+~\x7F)[^\s/=])*)(?:((?:\s(?:\s|\0\d+[cn]\x7F)*)?(?:=|\0\d+~\x7F)(?:\s|\0\d+[cn]\x7F)*)(?:(["'])([\s\S]*?)(\3|$)|(\S*)))?/gu,l="",g=o.exec(e),u=0,d=()=>{l&&(super.insertAt(new Q(l,gl(t),i,s,{})),l="")};for(;g;){let{index:p,0:m,1:f,2:h,3:x,4:b,5:w,6:C}=g;if(l+=e.slice(u,p),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(ae(f).trim())){let A=b!=null?b:C,I=[x,w],B=new Yt(Os(t),r,f,h,A,I,i,s);d(),super.insertAt(B)}else l+=m;({lastIndex:u}=o),g=o.exec(e)}l+=e.slice(u),d()}}get type(){return c(this,Rr)}afterBuild(){let{parentNode:e}=this;(e==null?void 0:e.type)==="td"&&this.setAttribute("name",e.subtype),super.afterBuild()}getAttrTokens(e){return this.childNodes.filter(t=>t instanceof Yt&&(!e||t.name===qe(e)))}getAttrToken(e){let t=this.getAttrTokens(e);return t[t.length-1]}getAttr(e){var t;return(t=this.getAttrToken(e))==null?void 0:t.getValue()}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{parentNode:i,childNodes:s}=this,o=new Map,l=new Set,g=new F(this,e);if((i==null?void 0:i.type)==="html"&&i.closing&&this.text().trim()){let u=E(this,g,"no-ignored","attributes of a closing tag"),d=i.getAbsoluteIndex();u.suggestions=[{desc:"remove",range:[e,u.endIndex],text:""},{desc:"open",range:[d+1,d+2],text:""}],r.push(u)}for(let u of s)if(u instanceof Yt){let{name:d}=u;o.has(d)?(l.add(d),o.get(d).push(u)):o.set(d,[u])}else{let d=u.text().trim();if(d){let p=$(u,g,"no-ignored","containing invalid attribute",Wn.test(d)?"error":"warning");p.suggestions=[{desc:"remove",range:[p.startIndex,p.endIndex],text:" "}],r.push(p)}}if(l.size>0)for(let u of l){let d=o.get(u).map(p=>{let m=p.getValue();return[p,m===!0?"":m]});r.push(...d.map(([p,m],f)=>{let h=$(p,g,"no-duplicate",S.msg("duplicated $1 attribute",u)),x={desc:"remove",range:[h.startIndex,h.endIndex],text:""};return!m||d.slice(0,f).some(([,b])=>b===m)?h.fix=x:h.suggestions=[x],h}))}return r}print(){return this.toString()?`<span class="wpb-${this.type}">${this.childNodes.map(e=>e.print(e instanceof Q?{class:e.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}};Rr=new WeakMap});var qs={};Y(qs,{PreToken:()=>Un});var Un,_s=k(()=>{"use strict";O();We();Un=class extends v{get type(){return"ext-inner"}constructor(n,e,t=[]){if(n){let r=/<nowiki>/giu,i=/<\/nowiki>/giu,{length:s}=r.source,o=r.exec(n);o&&(i.lastIndex=o.index+s);let l=i.exec(n),g=0,u="";for(;o&&l;)new D(o[0],e,t),new D(l[0],e,t),u+=`${n.slice(g,o.index)}\0${t.length-1}n${n.slice(o.index+s,l.index)}\0${t.length}n`,g=l.index+s+1,r.lastIndex=g,o=r.exec(n),o&&(i.lastIndex=o.index+s),l=i.exec(n);n=u+n.slice(g)}super(n,e,t,{}),this.setAttribute("stage",10)}isPlain(){return!0}lint(n=this.getAbsoluteIndex()){return super.lint(n,/<\s*\/\s*(pre)\b/giu)}}});var Zt,an=k(()=>{"use strict";pe();Zt=a=>{class n extends a{toString(t){return super.toString(t,`
|
|
3
|
+
`)}text(){return super.text(`
|
|
4
|
+
`).replace(/\n\s*\n/gu,`
|
|
5
|
+
`)}getGaps(){return 1}print(){return super.print({sep:`
|
|
6
|
+
`})}}return Fe(n,a),n}});var zs={};Y(zs,{ParamTagToken:()=>at});var Ms,Hn,pl,at,Gn=k(()=>{"use strict";M();ne();Pr();an();U();O();ze();Ms=[Zt];at=class extends(pl=v){get type(){return"ext-inner"}constructor(n,e,t=S.getConfig(),r=[],i){if(super(void 0,t,r,{}),e){let s=Q;this.append(...e.split(`
|
|
7
|
+
`).map(o=>i?o:kt(o,t,r,n)).map(o=>new s(o,"param-line",t,r,{})))}r.splice(r.indexOf(this),1),r.push(this)}lint(n=this.getAbsoluteIndex()){let e=new F(this,n),t=S.msg("invalid parameter of <$1>",this.name),r=[];for(let i of this.childNodes){i.setAttribute("aIndex",n);let s=i.childNodes.filter(({type:o})=>o!=="comment"&&o!=="include"&&o!=="noinclude");if(s.some(({type:o})=>o==="ext"))r.push($(i,e,"no-ignored",t));else{let o=s.findIndex(({type:g})=>g!=="text"),l=s.slice(0,o===-1?void 0:o).map(String).join("");if(l&&!(o===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(l)){let g=$(i,e,"no-ignored",t);g.suggestions=[{desc:"remove",range:[g.startIndex,g.endIndex],text:""}],r.push(g)}else{let g=i.lint(n,!1);g.length>0&&r.push(...g)}}n+=i.toString().length+1}return r}};Hn=R(pl),at=j(Hn,0,"ParamTagToken",Ms,at),P(Hn,1,at)});var jr,er,ln,tr,Vn=k(()=>{"use strict";M();pe();ne();U();O();ft();tr=class extends v{constructor(e,t,r,i=[]){super(void 0,r,i);T(this,er);T(this,jr);y(this,jr,e);let s=new v(t[0],r,i);s.type="heading-title",s.setAttribute("stage",2);let o=new me(t[1],"heading-trail",r,i);this.append(s,o)}get type(){return"heading"}get level(){return c(this,jr)}toString(e){let t=N(this,er,ln).call(this);return t+this.firstChild.toString(e)+t+this.lastChild.toString(e)}text(){let e=N(this,er,ln).call(this);return e+this.firstChild.text()+e}getAttribute(e){return e==="padding"?this.level:super.getAttribute(e)}getGaps(){return this.level}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{firstChild:i,level:s}=this,o=i.toString(),l=o.startsWith("="),g=l||o.endsWith("="),u=i.childNodes.filter(rr("quote")),d=u.filter(({bold:h})=>h),p=u.filter(({italic:h})=>h),m=new F(this,e);if(this.level===1){let h=$(i,m,"h1","<h1>");g||(h.suggestions=[{desc:"h2",range:[h.startIndex,h.endIndex],text:`=${o}=`}]),r.push(h)}if(g){let h=$(i,m,"unbalanced-header",S.msg("unbalanced $1 in a section header",'"="'));if(o!=="=")if(l){let[x]=/^=+/u.exec(o),b=s+x.length;h.suggestions=[{desc:`h${s}`,range:[h.startIndex,h.startIndex+x.length],text:""}],b<7&&h.suggestions.push({desc:`h${b}`,range:[h.endIndex,h.endIndex],text:x})}else{let x=/[^=](=+)$/u.exec(o)[1],b=s+x.length;h.suggestions=[{desc:`h${s}`,range:[h.endIndex-x.length,h.endIndex],text:""}],b<7&&h.suggestions.push({desc:`h${b}`,range:[h.startIndex,h.startIndex],text:x})}r.push(h)}this.closest("html-attrs,table-attrs")&&r.push(E(this,m,"parsing-order","section header in an HTML tag"));let f=this.getRootNode().toString();if(d.length%2){let h=$(d[d.length-1],se(X({},m),{start:e+s,left:m.left+s}),"format-leakage",S.msg("unbalanced $1 in a section header","bold apostrophes")),x=e+s+o.length;f.slice(h.endIndex,x).trim()?h.suggestions=[{desc:"close",range:[x,x],text:"'''"}]:h.fix={desc:"remove",range:[h.startIndex,h.endIndex],text:""},r.push(h)}if(p.length%2){let h=$(p[p.length-1],{start:e+s},"format-leakage",S.msg("unbalanced $1 in a section header","italic apostrophes")),x=e+s+o.length;f.slice(h.endIndex,x).trim()?h.suggestions=[{desc:"close",range:[x,x],text:"''"}]:h.fix={desc:"remove",range:[h.startIndex,h.endIndex],text:""},r.push(h)}return r}print(){let e=N(this,er,ln).call(this);return super.print({pre:e,sep:e})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return r.level=this.level,r}};jr=new WeakMap,er=new WeakSet,ln=function(){return"=".repeat(this.level)}});var ul,dn,Ds=k(()=>{"use strict";re();M();O();ul=new RegExp(`https?://${Be}${Oe}$`,"iu"),dn=class extends v{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){var n;try{return!!((n=this.parentNode)!=null&&n.getDuplicatedArgs().some(([e])=>e===this.name))}catch(e){return!1}}constructor(n,e,t,r=[]){super(void 0,t,r);let i=new v(typeof n=="number"?void 0:n,t,r,{}),s=new v(e,t,r);i.type="parameter-key",i.setAttribute("stage",2),s.type="parameter-value",s.setAttribute("stage",2),this.append(i,s)}trimName(n,e=!0){let t=(typeof n=="string"?n:n.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",t),t}afterBuild(){if(!this.anon){let{parentNode:n,firstChild:e}=this,t=this.trimName(e);n&&n.getArgs(t,!1,!1).add(this)}super.afterBuild()}toString(n){return this.anon?this.lastChild.toString(n):super.toString(n,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(n=this.getAbsoluteIndex(),e){var s;let t=super.lint(n,e),{firstChild:r}=this,i=(s=ul.exec(r.text()))==null?void 0:s[0];if(i&&new URL(i).search){let o=$(r,{start:n},"unescaped","unescaped query string in an anonymous parameter");o.startIndex=o.endIndex,o.startLine=o.endLine,o.startCol=o.endCol,o.endIndex++,o.endCol++,o.fix={range:[o.startIndex,o.endIndex],text:"{{=}}",desc:"escape"},t.push(o)}return t}print(){return super.print({sep:this.anon?"":"="})}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e);return Object.assign(t,{anon:this.anon},this.duplicated&&{duplicated:!0}),t}}});var Ws,Br,dt,vt,At,nr,wt,Qn,Us,Xn,cl,lt,Hs=k(()=>{"use strict";re();M();pe();ne();Lr();O();Ds();ze();ft();Ws=[it()];lt=class extends(cl=v){constructor(e,t,r,i=[]){var w,C;let s,o=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(e);o&&(s=Number(o[1]),e=e.replace(`\0${s}h`,i[s].toString().replace(/^\n/u,"")));super(void 0,r,i,{});T(this,wt);ge(this,"modifier","");T(this,Br,"template");T(this,dt,":");T(this,vt,!1);T(this,At,new Map);T(this,nr);let{parserFunction:[l,g],variable:u,functionHook:d}=r,p=(w=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(e))==null?void 0:w[0];if(p)this.setAttribute("modifier",p),e=e.slice(p.length);else if(e.includes(":")){let[A,...I]=e.split(":"),[B]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((C=I[0])!=null?C:"");this.setModifier(`${A}:${B}`)&&(e=I.join(":").slice(B.length))}let m=e.search(/[::]/u),f=e[m]===":",h=m!==-1;if(h||t.length===0&&!c(this,vt)){let A=h?e.slice(0,m):e,I=h&&e.slice(m+1),B=ae(A),z=h?B.slice(B.search(/\S/u))+(f?":":""):B.trim(),L=z.toLowerCase(),V=Array.isArray(g),ie=V?g.includes(z):Object.prototype.hasOwnProperty.call(g,z),oe=!V&&ie?g[z]:Object.prototype.hasOwnProperty.call(l,L)&&l[L],Z=V&&ie||!("functionHook"in r)||d.includes(oe),te=V&&ie||u.includes(oe);if(h?oe&&Z:te){this.setAttribute("name",oe||L.replace(/^#|:$/u,"")),y(this,Br,"magic-word"),f&&y(this,dt,":");let K=new me(A,"magic-word-name",r,i);if(super.insertAt(K),I!==!1&&t.unshift([I]),this.name==="invoke")for(let _=0;_<2;_++){let q=t.shift();if(!q)break;let we=new Q(q.join("="),`invoke-${_?"function":"module"}`,r,i);super.insertAt(we)}}}if(this.type==="template"){let A=ae(e).trim();if(!this.normalizeTitle(A,10,{halfParsed:!0,temporary:!0}).valid)throw i.pop(),new SyntaxError("Invalid template name");let I=new Q(e,"template-name",r,i,{});super.insertAt(I)}typeof s=="number"&&(i[s]=void 0);let x=this.isTemplate(),b=1;for(let A=0;A<t.length;A++){let I=t[A];x||this.name==="switch"&&A>0||this.name==="tag"&&A>1||(I[0]=I.join("="),I.length=1),I.length===1&&(I.unshift(b),b++),this.insertAt(new dn(...I,r,i))}this.seal("modifier")}get type(){return c(this,Br)}setModifier(e){let{parserFunction:[,,t,r]}=this.getAttribute("config"),i=ae(e).trim();if(e&&!i.endsWith(":"))return!1;let s=i.slice(0,-1).toLowerCase(),o=t.includes(s),l=r.includes(s);return c(this,vt)&&o||!c(this,vt)&&(l||!e)||(le.running||this.length>1)&&(o||l||!e)?(this.setAttribute("modifier",e),y(this,vt,o),!!e):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}getModule(){}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0)),super.afterBuild(),this.isTemplate()&&this.type==="template"&&(y(this,nr,N(this,wt,Qn).call(this)),this.setAttribute("name",c(this,nr).title))}toString(e){return`{{${this.modifier}${this.type==="magic-word"?this.firstChild.toString(e)+(this.length===1?"":c(this,dt))+this.childNodes.slice(1).map(t=>t.toString(e)).join("|"):super.toString(e,"|")}}}`}text(){let{childNodes:e,length:t,firstChild:r,modifier:i,type:s,name:o}=this;return s==="magic-word"&&o==="vardefine"?"":`{{${i}${s==="magic-word"?r.text()+(t===1?"":c(this,dt))+ke(e.slice(1),"|"):super.text("|")}}}`}getAttribute(e){switch(e){case"padding":return this.modifier.length+2;case"title":return c(this,nr);case"colon":return c(this,dt);default:return super.getAttribute(e)}}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t);if(!this.isTemplate())return r;let{type:i,childNodes:s,length:o}=this,l=new F(this,e),g=i==="magic-word";if(g&&!N(this,wt,Qn).call(this).valid)r.push($(s[1],l,"invalid-invoke","illegal module name"));else{let d=s[g?1:0],p=d.childNodes.findIndex(f=>f.type==="text"&&ht(f.data).includes("#")),m=d.childNodes[p];if(m){let f=$(d,l,"no-ignored","useless fragment","warning");f.fix={range:[f.startIndex+d.getRelativeIndex(p)+m.data.indexOf("#"),f.endIndex],text:"",desc:"remove"},r.push(f)}}if(g&&o===2)return r.push(E(this,l,"invalid-invoke","missing module function")),r;let u=this.getDuplicatedArgs().filter(([,d])=>!d[0].querySelector("ext"));if(u.length>0)for(let[,d]of u)r.push(...d.map(p=>{let m=$(p,l,"no-duplicate","duplicated parameter");return m.suggestions=[{desc:"remove",range:[m.startIndex-1,m.endIndex],text:""}],m}));return r}insertAt(e,t=this.length){return super.insertAt(e,t),e.anon?N(this,wt,Us).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getAllArgs(){return this.childNodes.filter(rr("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:e})=>e)}getArgs(e,t,r=!0){let i=String(e).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),s;return c(this,At).has(i)?s=c(this,At).get(i):(s=new Set(this.getAllArgs().filter(({name:o})=>i===o)),c(this,At).set(i,s)),s}getDuplicatedArgs(){return[...c(this,At)].filter(([,{size:e}])=>e>1).map(([e,t])=>[e,[...t]])}getPossibleValues(){let{type:e,name:t,childNodes:r}=this;if(e==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let i,s;switch(t){case"if":case"ifexist":case"ifexpr":case"iferror":i=2;break;case"ifeq":i=3;break;case"switch":{let o=r.slice(2),l=o[o.length-1];s=[...o.filter(({anon:g})=>!g),...l!=null&&l.anon?[l]:[]].map(({lastChild:g})=>g);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}s!=null||(s=r.slice(i,i+2).map(({lastChild:o})=>o));for(let o=0;o<s.length;){let{length:l,0:g}=s[o].childNodes.filter(u=>u.text().trim());if(l===0)s.splice(o,1);else if(l>1||g.type!=="magic-word")o++;else try{let u=g.getPossibleValues();s.splice(o,1,...u),o+=u.length}catch(u){o++}}return s}print(){let{childNodes:e,length:t,firstChild:r,modifier:i,type:s}=this;return`<span class="wpb-${s}">{{${Mt(i)}${s==="magic-word"?r.print()+(t===1?"":c(this,dt))+_e(e.slice(1),{sep:"|"}):_e(e,{sep:"|"})}}}</span>`}};Xn=R(cl),Br=new WeakMap,dt=new WeakMap,vt=new WeakMap,At=new WeakMap,nr=new WeakMap,wt=new WeakSet,Qn=function(){let e=this.type==="template";return this.normalizeTitle(this.childNodes[e?0:1].text(),e?10:828,{temporary:!0})},Us=function(e){let t=this.getAnonArgs(),r=typeof e!="number";for(let i=r?t.indexOf(e):e-1;i<t.length;i++){let s=t[i],{name:o}=s,l=String(i+1);(o!==l||s===e)&&(s.setAttribute("name",l),this.getArgs(l,!1,!1).add(s))}},lt=j(Xn,0,"TranscludeToken",Ws,lt),P(Xn,1,lt)});var Gs,Kn,hl,St,Vs=k(()=>{"use strict";mt();O();Gs=[ve()];St=class extends(hl=v){get type(){return"hidden"}};Kn=R(hl),St=j(Kn,0,"HiddenToken",Gs,St),P(Kn,1,St)});var Xs,Yn,ml,Jn,fl,Ct,Qs=k(()=>{"use strict";re();M();ne();Me();Lr();O();ze();Vs();Xs=[ue("{{{"),it()];Ct=class extends(fl=v){constructor(e,t,r=[]){super(void 0,t,r,{});T(this,Yn);for(let i=0;i<e.length;i++){let s=e[i];if(i===0){let o=new Q(s,"arg-name",t,r,{});super.insertAt(o)}else if(i>1){let o=new St(s,t,r);super.insertAt(o)}else{let o=new v(s,t,r);o.type="arg-default",o.setAttribute("stage",2),super.insertAt(o)}}}get type(){return"arg"}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`{{{${ke(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){super.afterBuild()}lint(e=this.getAbsoluteIndex(),t){let{childNodes:[r,i,...s]}=this;r.setAttribute("aIndex",e+3);let o=r.lint(e+3,t);if(i){let l=e+4+r.toString().length;i.setAttribute("aIndex",l);let g=i.lint(l,t);g.length>0&&o.push(...g)}if(s.length>0){let l=new F(this,e);o.push(...s.map(g=>{let u=$(g,l,"no-ignored","invisible content inside triple braces");return u.startIndex--,u.startCol--,u.suggestions=[{desc:"remove",range:[u.startIndex,u.endIndex],text:""},{desc:"escape",range:[u.startIndex,u.startIndex+1],text:"{{!}}"}],u}))}if(!this.getAttribute("include")){let l=E(this,{start:e},"no-arg","unexpected template argument","warning");i&&(l.suggestions=[{range:[e,l.endIndex],text:i.text(),desc:"expand"}]),o.push(l)}return o}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return r.default=this.default,r}};Jn=R(fl),Yn=new WeakSet,ml=function(){},Ct=j(Jn,0,"ArgToken",Xs,Ct),P(Jn,1,Ct)});var ro={};Y(ro,{parseBraces:()=>Or});var xl,Ks,Zn,Js,Ys,Zs,to,eo,Or,gn=k(()=>{"use strict";_t();re();Vn();Hs();Qs();xl={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},Ks=String.raw`\[(?!\[)`,Zn=String.raw`\n(?![=\0])`,Js=String.raw`|\{{2,}`,Ys=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),Zs=Ee(a=>new RegExp(a,"gmu"));to=new RegExp(String.raw`\{\{((?:[^\n{}[]|${Ks}|${Zn})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${Zn})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${Ks}|${Zn})*\}-`,"gu");eo=a=>{let n=qe(ae(a));return Ys.has(n)?Ys.get(n):/^(?:filepath|(?:full|canonical)urle?):./u.test(n)?"m":/^#vardefine:./u.test(n)?"n":"t"},Or=(a,n,e)=>{var f,h,x,b,w;let t=String.raw`${n.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,r]}=n,i=[],s=[],o=(C,A,I,B)=>{A[A.length-1].push(Le(C.slice(I,B),s))},l;do l!==void 0&&(a=l),l=a.replace(to,(C,A,I)=>{if(A!==void 0||typeof I=="string")try{let{length:B}=e,z=(A!=null?A:I).split("|");return new lt(Le(z[0],s),z.slice(1).map(L=>{let V=L.indexOf("=");return(V===-1?[L]:[L.slice(0,V),L.slice(V+1)]).map(ie=>Le(ie,s))}),n,e),`\0${B}${eo(z[0])}`}catch(B){if(!(B instanceof SyntaxError)||B.message!=="Invalid template name")throw B}return s.push(Le(C,s)),`\0${s.length-1}`});while(l!==a);a=l;let g=a.lastIndexOf("}}")-a.length,u=g+a.length!==-1,d=Zs(t+(u?Js:"")),p=d.exec(a),m;for(;p||m!==void 0&&m<=a.length&&((h=(f=i[i.length-1])==null?void 0:f[0])!=null&&h.startsWith("="));){if(p!=null&&p[1]){let[,{length:te}]=p;p[0]=p[0].slice(te),p.index+=te}let{0:C,index:A}=p!=null?p:{0:`
|
|
8
|
+
`,index:a.length},I=(x=i.pop())!=null?x:{},{0:B,index:z,parts:L,findEqual:V,pos:ie}=I,oe=C==="="&&V;if(C==="]]"||C==="}-")m=A+2;else if(C===`
|
|
9
|
+
`){m=A+1;let{pos:te,findEqual:K}=(b=i[i.length-1])!=null?b:{};if(te===void 0||K||ae(a.slice(te,z))!==""){let _=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(a.slice(z,A));_&&(_[2]=Le(_[2],s),_[2].includes(`
|
|
10
|
+
`)||(a=`${a.slice(0,z)}\0${e.length}h${a.slice(A)}`,m=z+4+String(e.length).length,new tr(_[1].length,_.slice(2),n,e)))}}else if(C==="|"||oe)m=A+1,o(a,L,ie,A),C==="|"&&L.push([]),I.pos=m,I.findEqual=C==="|",i.push(I);else if(C.startsWith("}}")){let te=C.slice(0,Math.min(B.length,3)),K=B.length-te.length,{length:_}=e;m=A+te.length,o(a,L,ie,A);let q=!1,we="t";if(te.length===3){let he=L.map(Ye=>Ye.join("=")),xe=he.length>1&&ae(he[1]).trim();new Ct(he,n,e),xe&&xe.endsWith(":")&&r.includes(xe.slice(0,-1).toLowerCase())&&(we="s")}else try{new lt(L[0][0],L.slice(1),n,e),we=eo(L[0][0])}catch(he){if(he instanceof SyntaxError&&he.message==="Invalid template name")q=!0;else throw he}q||(a=`${a.slice(0,z+K)}\0${_}${we}${a.slice(m)}`,m=z+K+3+String(_).length,K>1?i.push({0:B.slice(0,K),index:z,pos:z+K,parts:[[]]}):K===1&&a[z-1]==="-"&&i.push({0:"-{",index:z-1,pos:z+1,parts:[[]]}))}else m=A+C.length,C.startsWith("{")&&(p.pos=m,p.parts=[[]]),i.push(..."0"in I?[I]:[],p);let Z=i[i.length-1];if(u&&g+a.length<m)for(u=!1;(w=Z==null?void 0:Z[0])!=null&&w.startsWith("{");)i.pop(),Z=i[i.length-1];d=Zs(t+(u?Js:"")+(Z?`|${xl[Z[0][0]]}${Z.findEqual?"|=":""}`:"")),d.lastIndex=m,p=d.exec(a)}return Le(a,s)}});var no={};Y(no,{InputboxToken:()=>ei});var ei,io=k(()=>{"use strict";Pr();gn();U();Gn();ei=class extends at{constructor(n,e,t=S.getConfig(),r=[]){let i=Symbol("InputboxToken"),s=t.excludes.includes("heading")?t:se(X({},t),{excludes:[...t.excludes,"heading"]}),{length:o}=r;r.push(i),e&&(e=kt(e,s,r,n)),e&&(e=Or(e,s,r)),r.splice(o,1),super(n,e,s,r,{})}}});var pn={};Y(pn,{NestedToken:()=>ti});var bl,Tl,qr,ir,ti,un=k(()=>{"use strict";M();ne();Pr();gn();U();O();ri();We();bl=new Set(["comment","include","arg","template","magic-word"]),Tl=[!1,!0].map(a=>{let n=a?"includeonly":"noinclude";return new RegExp(String.raw`^(?:<${n}(?:\s[^>]*)?/?>|</${n}\s*>)$`,"iu")}),ti=class extends v{constructor(e,t,r,i,s=[]){if(typeof t=="boolean"){let o=Symbol("InputboxToken"),{length:l}=s;s.push(o),e&&(e=kt(e,i,s,t)),e&&(e=Or(e,i,s)),s.splice(l,1)}else e&&(e=e.replace(t,(o,l,g,u,d)=>{let p=`\0${s.length+1}e`;return new Ue(l,g,u,d,i,!1,s),p}));e&&(e=e.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(o,l,g)=>(new D(g,i,s),`${l}\0${s.length}n`)));super(e,i,s);T(this,qr);T(this,ir);y(this,qr,[...r]),y(this,ir,t)}get type(){return"ext-inner"}lint(e=this.getAbsoluteIndex(),t){let r=new F(this,e),i=typeof c(this,ir)=="boolean"?Tl[c(this,ir)?1:0]:/^<!--[\s\S]*-->$/u;return[...super.lint(e,t),...this.childNodes.filter(s=>{let{type:o,name:l}=s;if(o==="ext")return!c(this,qr).includes(l);if(bl.has(o))return!1;let g=s.toString().trim();return g&&!i.test(g)}).map(s=>{let o=$(s,r,"no-ignored",S.msg("invalid content in <$1>",this.name));return o.suggestions=[{desc:"remove",range:[o.startIndex,o.endIndex],text:""},{desc:"comment",range:[o.startIndex,o.endIndex],text:`<!--${s.toString()}-->`}],o})]}};qr=new WeakMap,ir=new WeakMap});function so(a,n,e,t,r){n=ae(n).trim();let i=n.replace(a==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(a){case"width":return!i&&!!n||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(i);case"link":{if(i){if(yl(e.protocol).test(i))return kl(e.protocol).test(i)&&n;i.startsWith("[[")&&i.endsWith("]]")&&(i=i.slice(2,-2))}else return n;let s=S.normalizeTitle(i,0,!1,e,{halfParsed:t,decode:!0,selfLink:!0});return s.valid&&s}case"lang":return(r==="svg"||r==="svgz")&&!/[^a-z\d-]/u.test(i);case"alt":case"class":case"manualthumb":return!0;case"page":return(r==="djvu"||r==="djv"||r==="pdf")&&Number(i)>0;default:return!!i&&!isNaN(i)}}var yl,kl,vl,Al,fe,hn,oo,cn,ao=k(()=>{"use strict";_t();re();M();U();O();yl=Ee(a=>new RegExp(String.raw`^(?:${a}|//|\0\d+m\x7F)`,"iu")),kl=Ee(a=>new RegExp(String.raw`^(?:(?:${a}|//)${Be}|\0\d+m\x7F)${Oe}$`,"iu")),vl=Ee(a=>new RegExp(String.raw`^(\s*(?!\s))${a.replace("$1","(.*)")}${a.endsWith("$1")?`(?=$|
|
|
11
|
+
)`:""}(\s*)$`,"u")),Al=new Set(["alt","link","lang","page","caption"]);cn=class extends v{constructor(e,t,r,i){var n=(...Pu)=>(super(...Pu),T(this,hn),T(this,fe,""),this);let s,o=Object.entries(r.img).map(([g,u])=>[g,u,vl(g)]),l=o.find(([,g,u])=>(s=u.exec(e),s&&(s.length!==4||so(g,s[2],r,!0,t)!==!1)));if(l&&s){s.length===3?(n(void 0,r,i),y(this,fe,e)):(n(s[2],r,i,{}),y(this,fe,s[1]+l[0]+s[3])),this.setAttribute("name",l[1]);return}n(e,r.excludes.includes("list")?r:se(X({},r),{excludes:[...r.excludes,"list"]}),i),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get type(){return"image-parameter"}get link(){return this.name==="link"?so("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var e;((e=this.parentNode)==null?void 0:e.type)==="gallery-image"&&!Al.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(e){return c(this,fe)?c(this,fe).replace("$1",super.toString(e)):super.toString(e)}text(){return c(this,fe)?c(this,fe).replace("$1",super.text()).trim():super.text().trim()}isPlain(){return this.name==="caption"}getAttribute(e){return e==="padding"?Math.max(0,c(this,fe).indexOf("$1")):super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{link:i,name:s}=this;if(s==="invalid"){let o=E(this,{start:e},"invalid-gallery","invalid image parameter");o.fix={range:[e-1,o.endIndex],text:"",desc:"remove"},r.push(o)}else if(typeof i=="object"&&i.encoded){let o=E(this,{start:e},"url-encoding","unnecessary URL encoding in an internal link");o.suggestions=[{desc:"decode",range:[e,o.endIndex],text:et(this.text())}],r.push(o)}return r}getValue(){return this.name==="invalid"?this.text():N(this,hn,oo).call(this)||super.text()}print(){return c(this,fe)?`<span class="wpb-image-parameter">${c(this,fe).replace("$1",`<span class="wpb-image-caption">${_e(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}};fe=new WeakMap,hn=new WeakSet,oo=function(){return c(this,fe)&&!c(this,fe).includes("$1")}});var lo,wl,Sl,go,po,Cl,$l,uo,sr,ni=k(()=>{"use strict";M();ne();U();Er();ao();lo=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),wl=new Set(["arg"]),Sl=new Set(["template","magic-word"]),go=new Set(["left","right","center","none"]),po=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),Cl=new Set(["tiff","tif","png","gif","jpg","jpeg","webp","xcf","pdf","svg","djvu"]),$l=a=>{if(a===void 0)return[];let n=/-\{|\}-|\|/gu,e=[],t=n.exec(a),r=0,i=0;for(;t;){let{0:s,index:o}=t;s!=="|"?r+=s==="-{"?1:-1:r===0&&(e.push(a.slice(i,o)),{lastIndex:i}=n),t=n.exec(a)}return e.push(a.slice(i)),e},uo=(a,n)=>a.filter(({childNodes:e})=>{let t=e.filter(r=>r.text().trim());return t.length!==1||!n.has(t[0].type)}),sr=class extends Te{get type(){return"file"}get extension(){return this.getAttribute("title").extension}constructor(n,e,t,r=[],i="|"){super(n,void 0,t,r,i);let{extension:s}=this.getTitle(!0,!0);this.safeAppend($l(e).map(o=>new cn(o,s,t,r)))}lint(n=this.getAbsoluteIndex(),e){var f;let t=super.lint(n,e),r=uo(this.getAllArgs(),wl),i=[...new Set(r.map(({name:h})=>h))],s=i.filter(h=>lo.has(h)),o=i.filter(h=>go.has(h)),l=i.filter(h=>po.has(h)),[g]=s,u=g==="framed"||g==="manualthumb",d=new F(this,n);if(this.closest("ext-link-text")&&((f=this.getValue("link"))==null?void 0:f.trim())!==""&&t.push(E(this,d,"nested-link","internal link in an external link")),u)for(let h of r.filter(({name:x})=>x==="width")){let x=$(h,d,"invalid-gallery","invalid image parameter");x.fix={range:[x.startIndex-1,x.endIndex],text:"",desc:"remove"},t.push(x)}if(r.length===i.length&&s.length<2&&o.length<2&&l.length<2)return t;let p=(h,x,b=!0)=>w=>{let C=typeof b=="function"?b(w):b,A=$(w,d,"no-duplicate",S.msg(`${h} image $1 parameter`,x),C?"error":"warning");return A.suggestions=[{desc:"remove",range:[A.startIndex-1,A.endIndex],text:""}],A},{extension:m}=this;for(let h of i){if(h==="invalid"||h==="width"&&u)continue;let x=h==="caption",b=r.filter(({name:w})=>w===h);if(x&&(b=[...b.slice(0,-1).filter(w=>w.text()),...b.slice(-1)]),b.length>1){let w=!x||!m||Cl.has(m);if(x&&w){let C=uo(b,Sl);w=C.length>1&&(A=>C.includes(A))}t.push(...b.map(p("duplicated",h,w)))}}return s.length>1&&t.push(...r.filter(({name:h})=>lo.has(h)).map(p("conflicting","frame"))),o.length>1&&t.push(...r.filter(({name:h})=>go.has(h)).map(p("conflicting","horizontal-alignment"))),l.length>1&&t.push(...r.filter(({name:h})=>po.has(h)).map(p("conflicting","vertical-alignment"))),t}getAllArgs(){return this.childNodes.slice(1)}getArgs(n){return this.getAllArgs().filter(({name:e})=>n===e)}getArg(n){let e=this.getArgs(n);return e[n==="manualthumb"?0:e.length-1]}getValue(n){var e;return(e=this.getArg(n))==null?void 0:e.getValue()}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e),{extension:r}=this;return r&&(t.extension=r),t}}});var co,ii,Nl,He,si=k(()=>{"use strict";M();Me();O();ni();co=[ue("")];He=class extends(Nl=sr){constructor(e,t,r,i,s=[]){let o;if(r!==void 0){let{length:l}=s;o=new v(r,i,s);for(let g=1;g<11;g++)o.parseOnce();s.splice(l,1)}super(t,o==null?void 0:o.toString(),i,s);ge(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=`${e}-image`,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(e){let t=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),t?0:6,{halfParsed:!0,temporary:e,decode:!t})}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{ns:i}=this.getAttribute("title");if(i!==6){let s=E(this,{start:e},"invalid-gallery","invalid gallery image");s.suggestions=[{desc:"prefix",range:[e,e],text:"File:"}],r.push(s)}return r}};ii=R(Nl),He=j(ii,0,"GalleryImageToken",co,He),P(ii,1,He)});var fo={};Y(fo,{GalleryToken:()=>or});var ho,$t,mo,ai,oi,Il,or,xo=k(()=>{"use strict";an();U();O();si();We();ho=[Zt];or=class extends(Il=v){constructor(e,t,r=[]){var i;super(void 0,t,r,{});T(this,$t);for(let s of(i=e==null?void 0:e.split(`
|
|
12
|
+
`))!=null?i:[]){let o=/^([^|]+)(?:\|(.*))?/u.exec(s);if(!o){super.insertAt(s.trim()?new D(s,t,r):s);continue}let[,l,g]=o;N(this,$t,mo).call(this,l)?super.insertAt(new He("gallery",l,g,t,r)):super.insertAt(new D(s,t,r))}}get type(){return"ext-inner"}get widths(){return N(this,$t,ai).call(this,"widths")}get heights(){return N(this,$t,ai).call(this,"heights")}lint(e=this.getAbsoluteIndex(),t){let{top:r,left:i}=this.getRootNode().posFromIndex(e),s=[];for(let o=0;o<this.length;o++){let l=this.childNodes[o],g=l.toString(),{length:u}=g,d=g.trim(),{type:p}=l,m=r+o,f=o?0:i;if(l.setAttribute("aIndex",e),p==="noinclude"&&d&&!/^<!--.*-->$/u.test(d)){let h=e+u;s.push({rule:"no-ignored",message:S.msg("invalid content in <$1>","gallery"),severity:d.endsWith("-->")||/^(?:\||<!--)/u.test(d)?"warning":"error",startIndex:e,endIndex:h,startLine:m,endLine:m,startCol:f,endCol:f+u,suggestions:[{desc:"remove",range:[e,h],text:""},{desc:"comment",range:[e,h],text:`<!--${g}-->`}]})}else if(p!=="noinclude"&&p!=="text"){let h=l.lint(e,t);h.length>0&&s.push(...h)}e+=u+1}return s}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return Object.assign(r,{widths:this.widths,heights:this.heights}),r}};oi=R(Il),$t=new WeakSet,mo=function(e){return this.normalizeTitle(e,6,{halfParsed:!0,temporary:!0,decode:!0}).valid},ai=function(e){var i,s;let t=(i=this.parentNode)==null?void 0:i.getAttr(e),r=typeof t=="string"&&((s=/^(\d+)\s*(?:px)?$/u.exec(t))==null?void 0:s[1]);return r&&Number(r)||120},or=j(oi,0,"GalleryToken",ho,or),P(oi,1,or)});var ar,li=k(()=>{"use strict";M();Er();ar=class extends Te{get type(){return"link"}lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e);return this.closest("ext-link-text")&&t.push(E(this,{start:n},"nested-link","internal link in an external link")),t}}});var El,Ll,_r,Ge,mn=k(()=>{"use strict";M();re();ne();U();O();El=String.raw`(?:[${Se}\t]| |�*160;|&#[xX]0*[aA]0;)`,Ll=new RegExp(`${El}+`,"gu"),Ge=class extends v{constructor(e,t="free-ext-link",r=S.getConfig(),i){super(e,r,i,{});T(this,_r);y(this,_r,t)}get type(){return c(this,_r)}get innerText(){let e=new Map([["!","|"],["=","="]]),t=ke(this.childNodes.map(r=>{let{type:i}=r,s=String(r.name);return i==="magic-word"&&e.has(s)?e.get(s):r}));return this.type==="magic-link"&&(t=t.replace(Ll," ")),t}get link(){let{innerText:e}=this;return this.type==="magic-link"?e.startsWith("ISBN")?`ISBN ${e.slice(5).replace(/[- ]/gu,"").replace(/x$/u,"X")}`:e:Yi(e)}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),i=new F(this,e),{type:s,childNodes:o}=this;if(s==="magic-link"){let{link:d}=this;if(d.startsWith("ISBN")){let p=[...d.slice(5)].map(m=>m==="X"?10:Number(m));(p.length===10&&p.reduce((m,f,h)=>m+f*(10-h),0)%11||p.length===13&&(p[12]===10||p.reduce((m,f,h)=>m+f*(h%2?3:1),0)%10))&&r.push(E(this,i,"invalid-isbn","invalid ISBN"))}return r}let l=s==="ext-link-url",g=l?/\|/u:/[,;。:!?()]+/u,u=o.find(d=>d.type==="text"&&g.test(d.data));if(u){let{data:d}=u,p=$(u,i,"unterminated-url",S.msg("$1 in URL",l?'"|"':"full-width punctuation"),"warning"),{index:m,0:f}=g.exec(d),h=p.startIndex+m;p.suggestions=l?[{desc:"whitespace",range:[h,h+1],text:" "}]:[{desc:"whitespace",range:[h,h],text:" "},{desc:"escape",range:[h,h+f.length],text:encodeURI(f)}],r.push(p)}return r}getUrl(e){}};_r=new WeakMap});var bo,Ve,di,Fl,Xe,gi=k(()=>{"use strict";M();Me();O();mn();bo=[ue("[")];Xe=class extends(Fl=v){constructor(e,t="",r="",i,s=[]){super(void 0,i,s,{});T(this,Ve);let o=e&&/^\0\d+f\x7F$/u.test(e)?s[Number(e.slice(1,-2))]:new Ge(e,"ext-link-url",i,s);if(this.insertAt(o),y(this,Ve,t),r){let l=new v(r,i,s,{});l.type="ext-link-text",l.setAttribute("stage",10),this.insertAt(l)}}get type(){return"ext-link"}toString(e){return this.length===1?`[${super.toString(e)}${c(this,Ve)}]`:`[${super.toString(e,c(this,Ve))}]`}text(){return`[${super.text(" ")}]`}getGaps(){return c(this,Ve).length}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t);return this.length===1&&this.closest("heading-title")&&r.push(E(this,{start:e},"var-anchor","variable anchor in a section header")),r}print(){return super.print(this.length===1?{pre:"[",post:`${c(this,Ve)}]`}:{pre:"[",sep:c(this,Ve),post:"]"})}};di=R(Fl),Ve=new WeakMap,Xe=j(di,0,"ExtLinkToken",bo,Xe),P(di,1,Xe)});var Mr,To=k(()=>{"use strict";O();We();li();gi();Mr=class extends v{get type(){return"imagemap-link"}constructor(n,e,t,r,i=[]){super(void 0,r,i),this.append(n,e.length===2?new ar(...e,r,i):new Xe(...e,r,i),new D(t,r,i))}}});var ko={};Y(ko,{ImagemapToken:()=>lr});var yo,pi,Rl,lr,vo=k(()=>{"use strict";M();pe();ne();an();U();O();We();si();To();yo=[Zt];lr=class extends(Rl=v){get type(){return"ext-inner"}get image(){return this.childNodes.find(rr("imagemap-image"))}constructor(n,e=S.getConfig(),t=[]){if(super(void 0,e,t,{}),!n)return;let r=n.split(`
|
|
13
|
+
`),i=new Set(e.protocol.split("|")),s=D,o=!0,l=!1;for(let g of r){let u=g.trim();if(!(l||!u||u.startsWith("#"))){if(o){let d=g.indexOf("|"),p=d===-1?g:g.slice(0,d),{valid:m,ns:f}=this.normalizeTitle(p,0,{halfParsed:!0,temporary:!0});if(m&&f===6){let h=new He("imagemap",p,d===-1?void 0:g.slice(d+1),e,t);super.insertAt(h),o=!1;continue}else l=!0}else if(g.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(g);continue}else if(g.includes("[")){let d=g.indexOf("["),p=g.slice(d),m=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(p);if(m){if(this.normalizeTitle(m[1],0,{halfParsed:!0,temporary:!0,selfLink:!0}).valid){super.insertAt(new Mr(g.slice(0,d),m.slice(1),p.slice(p.indexOf("]]")+2),e,t));continue}}else if(p.startsWith("[//")||i.has(p.slice(1,p.indexOf(":")+1))||i.has(p.slice(1,p.indexOf("//")+2))){let f=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(p);if(f){super.insertAt(new Mr(g.slice(0,d),f.slice(1),p.slice(p.indexOf("]")+1),e,t));continue}}}}super.insertAt(new s(g,e,t))}}lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e),r=new F(this,n);return this.image?t.push(...this.childNodes.filter(i=>{let s=i.toString().trim();return i.type==="noinclude"&&s&&!s.startsWith("#")}).map(i=>{let s=$(i,r,"invalid-imagemap","invalid link in <imagemap>");return s.suggestions=[{desc:"remove",range:[s.startIndex-1,s.endIndex],text:""},{desc:"comment",range:[s.startIndex,s.startIndex],text:"# "}],s})):t.push(E(this,r,"invalid-imagemap","<imagemap> without an image")),t}};pi=R(Rl),lr=j(pi,0,"ImagemapToken",yo,lr),P(pi,1,lr)});var Ao,ui,Pl,Qe,ci=k(()=>{"use strict";M();mt();Me();U();rt();Ao=[ve(!1),ue("<!--")];Qe=class extends(Pl=ce){constructor(e,t,r,i){super(e,r,i);ge(this,"closed");this.closed=t}get type(){return"comment"}lint(e=this.getAbsoluteIndex()){if(this.closed)return[];let t=E(this,{start:e},"unclosed-comment",S.msg("unclosed $1","HTML comment"));return t.suggestions=[{range:[t.endIndex,t.endIndex],text:"-->",desc:"close"}],[t]}toString(e){return e?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}};ui=R(Pl),Qe=j(ui,0,"CommentToken",Ao,Qe),P(ui,1,Qe)});var wo={};Y(wo,{CommentedToken:()=>hi});var hi,So=k(()=>{"use strict";O();ci();hi=class extends v{get type(){return"ext-inner"}constructor(n,e,t=[]){if(super(void 0,e,t,{AstText:":",CommentToken:":"}),n){let r=n.indexOf("<!--"),i=r!==-1&&n.indexOf("-->",r+4),s=0;for(;i!==!1&&i!==-1;)r>s&&this.insertAt(n.slice(s,r)),this.insertAt(new Qe(n.slice(r+4,i),!0,e,t)),s=i+3,r=n.indexOf("<!--",s),i=r!==-1&&n.indexOf("-->",r+4);s<n.length&&this.insertAt(n.slice(s))}}lint(n=this.getAbsoluteIndex()){return super.lint(n,/<\s*(?:\/\s*)?(hiero)\b/giu)}}});var Co={};Y(Co,{NowikiToken:()=>mi});var jl,Bl,mi,$o=k(()=>{"use strict";_t();M();U();rt();jl=Ee(a=>new RegExp(String.raw`<\s*(?:/\s*)${a==="nowiki"?"":"?"}(${a})\b`,"giu")),Bl=new Set(["templatestyles","section","languages"]),mi=class extends ce{get type(){return"ext-inner"}lint(n=this.getAbsoluteIndex()){let{name:e,firstChild:{data:t}}=this;if(Bl.has(e)&&t){let r=E(this,{start:n},"void-ext",S.msg("nothing should be in <$1>",e));return r.fix={range:[n,r.endIndex],text:"",desc:"empty"},[r]}return super.lint(n,jl(e))}}});var No,fi,Ol,Ue,ri=k(()=>{"use strict";M();ne();U();nn();O();en();on();No=[Qt()];Ue=class extends(Ol=Ie){get type(){return"ext"}constructor(n,e,t,r,i=S.getConfig(),s=!1,o=[]){let l=n.toLowerCase(),g=new ot(!e||/^\s/u.test(e)?e:` ${e}`,"ext-attrs",l,i,o),u=se(X({},i),{ext:i.ext.filter(p=>p!==l),excludes:[...i.excludes]}),d;switch(u.inExt=!0,l){case"tab":u.ext=u.ext.filter(p=>p!=="tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":l==="poem"&&u.excludes.push("heading"),d=new v(t,u,o);break;case"pre":{let{PreToken:p}=(_s(),W(qs));d=new p(t,u,o);break}case"dynamicpagelist":{let{ParamTagToken:p}=(Gn(),W(zs));d=new p(s,t,u,o);break}case"inputbox":{let{InputboxToken:p}=(io(),W(no));d=new p(s,t,u,o);break}case"references":{let{NestedToken:p}=(un(),W(pn));u.excludes.push("heading"),d=new p(t,s,["ref"],u,o);break}case"choose":{let{NestedToken:p}=(un(),W(pn));d=new p(t,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],u,o);break}case"combobox":{let{NestedToken:p}=(un(),W(pn));d=new p(t,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],u,o);break}case"gallery":{let{GalleryToken:p}=(xo(),W(fo));d=new p(t,u,o);break}case"imagemap":{let{ImagemapToken:p}=(vo(),W(ko));d=new p(t,u,o);break}case"hiero":{let{CommentedToken:p}=(So(),W(wo));d=new p(t,u,o);break}default:{let{NowikiToken:p}=($o(),W(Co));d=new p(t,u,o)}}d.setAttribute("name",l),d.type==="plain"&&(d.type="ext-inner"),super(n,g,d,r,i,o),this.seal("closed",!0)}lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e),r=new F(this,n);return this.name!=="nowiki"&&this.closest("html-attrs,table-attrs")&&t.push(E(this,r,"parsing-order","extension tag in HTML tag attributes")),this.name==="ref"&&this.closest("heading-title")&&t.push(E(this,r,"var-anchor","variable anchor in a section header")),t}};fi=R(Ol),Ue=j(fi,0,"ExtToken",No,Ue),P(fi,1,Ue)});var Lo={};Y(Lo,{parseCommentAndExt:()=>kt});var Eo,ql,xi,_l,Io,kt,Pr=k(()=>{"use strict";_t();re();xs();We();ys();vs();ri();ci();Eo="<onlyinclude>",ql="</onlyinclude>",{length:xi}=Eo,_l=[!1,!0].map(a=>{let n=a?"includeonly":"(?:no|only)include",e=a?"noinclude":"includeonly";return Ee(t=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${n}(?:\s[^>]*)?/?>|</${n}\s*>|<(${t.join("|")})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(\1\s*)>)|<(${e})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${e}\s*)>|$))`,"giu"))}),Io=a=>{let n=a.indexOf(Eo);return{i:n,j:a.indexOf(ql,n+xi)}},kt=(a,n,e,t)=>{if(t){let{i:o,j:l}=Io(a);if(o!==-1&&l!==-1){let g="",u=d=>{new D(d,n,e),g+=`\0${e.length-1}n`};for(;o!==-1&&l!==-1;){let d=`\0${e.length}e`;new Tt(a.slice(o+xi,l),n,e),o>0&&u(a.slice(0,o)),g+=d,a=a.slice(l+xi+1),{i:o,j:l}=Io(a)}return a&&u(a),g}}let{ext:r}=n,i=r.filter(o=>o!=="translate"&&o!=="tvar"),s=se(X({},n),{ext:i});if(r.includes("translate")){let o=[];a=a.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,l=>(o.push(l),`\0${o.length-1}`)).replace(/<translate( nowrap)?>([\s\S]+?)?<\/translate>/gu,(l,g,u)=>{let d=e.length;return new tn(g,u&&Le(u,o),s,e),`\0${d}g`}),a=Le(a,o)}return a.replace(_l[t?1:0](i),(o,l,g,u,d,p,m,f,h)=>{let x=e.length,b="n";if(l)b="e",new Ue(l,g,u,d,s,p,e);else if(o.startsWith("<!--")){b="c";let w=o.endsWith("-->");new Qe(o.slice(4,w?-3:void 0),w,n,e)}else p?new yt(p,m,f,h,n,e):new D(o,n,e);return`\0${x}${b}`})}});var Ml,zl,Dl,Fo,dr,je,gt,Ke,bi,Wl,Nt,Ro=k(()=>{"use strict";M();pe();ne();nn();O();U();Ml=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),zl=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"]),Dl=new Set(["strike","big","center","font","tt"]);Fo=[Qt()];Nt=class extends(Wl=v){constructor(e,t,r,i,s,o){super(void 0,s,o);T(this,dr);T(this,je);T(this,gt);T(this,Ke);this.insertAt(t),this.setAttribute("name",e.toLowerCase()),y(this,dr,r),y(this,je,i),y(this,gt,e)}get type(){return"html"}get selfClosing(){return c(this,je)}get closing(){return c(this,dr)}toString(e){return`<${this.closing?"/":""}${c(this,gt)}${super.toString(e)}${c(this,je)?"/":""}>`}text(){let{closing:e}=this,t=c(this,gt)+(e?"":super.text());return`<${e?"/":""}${t}${c(this,je)?"/":""}>`}getAttribute(e){return e==="padding"?c(this,gt).length+(this.closing?2:1):super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{name:i,parentNode:s,closing:o,selfClosing:l}=this,g=new F(this,e);if(i==="h1"&&!o){let h=E(this,g,"h1","<h1>");h.suggestions=[{desc:"h2",range:[e+2,e+3],text:"2"}],r.push(h)}if(this.closest("table-attrs")){let h=E(this,g,"parsing-order","HTML tag in table attributes");h.fix={desc:"remove",range:[e,h.endIndex],text:""},r.push(h)}Dl.has(i)&&r.push(E(this,g,"obsolete-tag","obsolete HTML tag","warning")),(i==="b"||i==="strong")&&this.closest("heading-title")&&r.push(E(this,g,"bold-header","bold in section header","warning"));let{html:[,u,d]}=this.getAttribute("config"),p=d.includes(i),m=u.includes(i);if(o&&(l||p)||l&&(!p&&!m)){let h=E(this,g,"unmatched-tag",o?"tag that is both closing and self-closing":"invalid self-closing tag"),x={desc:"open",range:[e+1,e+2],text:""},b={desc:"no self-closing",range:[h.endIndex-2,h.endIndex-1],text:""};m?h.suggestions=[x,b]:o?h.fix=p?x:b:h.suggestions=[b,{desc:"close",range:[h.endIndex-2,h.endIndex],text:`></${i}>`}],r.push(h)}else if(!this.findMatchingTag()){let h=E(this,g,"unmatched-tag",o?"unmatched closing tag":"unclosed tag");if(o){let x=this.closest("magic-word");x&&Ml.has(x.name)?h.severity="warning":h.suggestions=[{desc:"remove",range:[e,h.endIndex],text:""}]}else{let x=s==null?void 0:s.childNodes;zl.has(i)&&(x!=null&&x.slice(0,x.indexOf(this)).some(({type:b,name:w})=>b==="html"&&w===i))?h.suggestions=[{desc:"close",range:[e+1,e+1],text:"/"}]:this.closest("heading-title")||(h.severity="warning")}r.push(h)}return r}findMatchingTag(){return Ce(c(this,Ke),()=>{let{name:e,parentNode:t,closing:r,selfClosing:i}=this,{html:[,s,o]}=this.getAttribute("config"),l=o.includes(e),g=s.includes(e);if(l||g&&i)return this;if(!t)return;let{childNodes:u}=t,d=u.indexOf(this),p=r?u.slice(0,d).reverse():u.slice(d+1),m=[this],{rev:f}=le;for(let h of p)if(!(!h.is("html")||h.name!==e||g&&c(h,je)))if(c(h,dr)===r)m.push(h);else{let x=m.pop();if(x===this)return h;S.viewOnly&&(y(x,Ke,[f,h]),y(h,Ke,[f,x]))}if(S.viewOnly)for(let h of m)y(h,Ke,[f,void 0])},e=>{y(this,Ke,e),e[1]&&e[1]!==this&&y(e[1],Ke,[le.rev,this])})}print(){return super.print({pre:`<${this.closing?"/":""}${c(this,gt)}`,post:`${c(this,je)?"/":""}>`})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return Object.assign(r,{closing:this.closing,selfClosing:c(this,je)}),r}};bi=R(Wl),dr=new WeakMap,je=new WeakMap,gt=new WeakMap,Ke=new WeakMap,Nt=j(bi,0,"HtmlToken",Fo,Nt),P(bi,1,Nt)});var Po={};Y(Po,{parseHtml:()=>Hl});var Ul,Hl,jo=k(()=>{"use strict";on();Ro();Ul=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,Hl=(a,n,e)=>{var s;let{html:t}=n;(s=n.htmlElements)!=null||(n.htmlElements=new Set([...t[0],...t[1],...t[2]]));let r=a.split("<"),i=r.shift();for(let o of r){let l=Ul.exec(o),g=l==null?void 0:l[2],u=g==null?void 0:g.toLowerCase();if(!l||!n.htmlElements.has(u)){i+=`<${o}`;continue}let[,d,,p="",m,f]=l,{length:h}=e,x=new ot(p,"html-attrs",u,n,e),b=x.getAttr("itemprop");if(u==="meta"&&(b===void 0||x.getAttr("content")===void 0)||u==="link"&&(b===void 0||x.getAttr("href")===void 0)){i+=`<${o}`,e.length=h;continue}i+=`\0${e.length}x${f}`,new Nt(g,x,d==="/",m==="/>",n,e)}return i}});var gr,Ti=k(()=>{"use strict";nn();O();ft();on();gr=class extends Qt(1)(v){constructor(n,e,t,r,i,s=[],o){super(void 0,i,s,o),this.append(new me(e,"table-syntax",i,s),new ot(r,"table-attrs",t,i,s))}}});var Ae,zr,Dr,yi,pr,ki=k(()=>{"use strict";M();ne();O();Ti();pr=class extends gr{constructor(e,t,r,i=[]){var g;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,"td",o,r,i);T(this,Dr);T(this,Ae,"");T(this,zr);s&&([Qr(this,Ae)._]=s);let l=new v(t==null?void 0:t.slice(((g=s==null?void 0:s.index)!=null?g:NaN)+c(this,Ae).length),r,i);l.type="td-inner",l.setAttribute("stage",4),this.insertAt(l)}get type(){return"td"}get rowspan(){return this.getAttr("rowspan")}get colspan(){return this.getAttr("colspan")}get subtype(){return N(this,Dr,yi).call(this).subtype}afterBuild(){c(this,Ae).includes("\0")&&y(this,Ae,this.buildFromStr(c(this,Ae),0)),super.afterBuild()}toString(e){let{childNodes:[t,r,i]}=this;return t.toString(e)+r.toString(e)+c(this,Ae)+i.toString(e)}text(){let{childNodes:[e,t,r]}=this;return e.text()+t.text()+c(this,Ae)+r.text()}getGaps(e){return e===1?c(this,Ae).length:0}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),i=new F(this,e+this.getRelativeIndex(this.length-1));for(let s of this.lastChild.childNodes)if(s.type==="text"){let{data:o}=s;if(o.includes("|")){let l=o.includes("||"),g=$(s,i,"pipe-like",'additional "|" in a table cell',l?"error":"warning");if(l){let u={caption:"|+",td:"|",th:"!"}[this.subtype];g.fix={range:[g.startIndex,g.endIndex],text:o.replace(/\|\|/gu,`
|
|
14
|
+
${u}`),desc:"newline"}}else g.suggestions=[{desc:"escape",range:[g.startIndex,g.endIndex],text:o.replace(/\|/gu,"|")}];r.push(g)}}return r}isIndependent(){return this.firstChild.text().startsWith(`
|
|
15
|
+
`)}getAttr(e){let t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}print(){let{childNodes:[e,t,r]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${c(this,Ae)}${r.print()}</span>`}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t),{rowspan:i,colspan:s}=this;return Object.assign(r,{subtype:this.subtype},i!==1&&{rowspan:i},s!==1&&{colspan:s}),r}};Ae=new WeakMap,zr=new WeakMap,Dr=new WeakSet,yi=function(){return Ce(c(this,zr),()=>{var o;let e=this.firstChild.text(),t=e.slice(-1),r="td";if(t==="!"?r="th":t==="+"&&(r="caption"),this.isIndependent())return{subtype:r};let{previousSibling:i}=this;return X({},N(o=i,Dr,yi).call(o))},e=>{y(this,zr,e)})}});var Gl,Vl,vi,ur,Ai=k(()=>{"use strict";M();Ti();ki();Gl=new Set(["tr","td","th","caption"]),Vl=new Set(["Template:!!","Template:!-"]),vi=a=>{let n=a.childNodes.find(e=>e.text().trim());if(!n||n.type==="text"&&n.data.trim().startsWith("!")||n.type==="magic-word"&&n.name==="!"||n.type==="template"&&Vl.has(n.name)||n.is("html")&&Gl.has(n.name))return!1;if(n.is("arg"))return n.length>1&&vi(n.childNodes[1]);if(n.is("magic-word"))try{let e=n.getPossibleValues().map(vi);return e.includes("error")?"error":e.includes("warning")&&"warning"}catch(e){}return n.type==="template"||n.type==="magic-word"&&n.name==="invoke"?"warning":"error"},ur=class extends gr{lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e),r=this.childNodes.find(({type:o})=>o==="table-inter");if(!r)return t;let i=vi(r);if(!i)return t;let s=$(r,{start:n},"fostered-content","content to be moved out from the table",i);return s.startIndex++,s.startLine++,s.startCol=0,t.push(s),t}getRowCount(){return Number(this.childNodes.some(n=>n instanceof pr&&n.isIndependent()&&!n.firstChild.text().endsWith("+")))}}});var Xl,Ql,wi,fn,Bo=k(()=>{"use strict";M();pe();ne();U();Ai();ft();Xl=(a,n)=>new Array(a).fill(void 0).map((e,t)=>n(t)),Ql=({type:a})=>a==="tr"||a==="table-syntax",wi=class extends Array{},fn=class extends ur{get type(){return"table"}get closed(){return this.lastChild.type==="table-syntax"}constructor(n,e,t,r){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,n,"table",e,t,r,{})}lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e),r=new F(this,n);this.closed||t.push($(this.firstChild,r,"unclosed-table",S.msg("unclosed $1","table")));let i=this.getLayout(),{length:s}=i;if(s>1){let o=1,l=1/0,g=0;for(;g<s;g++){let u=i[g],d=u.length;if(d<o)break;d<l&&(l=d);let p=u.indexOf(u[d-1])+1;if(p>l)break;p>o&&(o=p)}if(g<s){let u=$(this.getNthRow(g),r,"table-layout","inconsistent table layout","warning");u.startIndex++,u.startLine++,u.startCol=0,t.push(u)}}return t}close(n=`
|
|
16
|
+
|}`,e){let t=this.getAttribute("config"),r=this.getAttribute("accum"),i=[n];le.run(()=>{let s=new me(void 0,"table-syntax",t,r);super.insertAt(s)}),this.lastChild.safeReplaceChildren(i)}getLayout(n){let e=this.getAllRows(),{length:t}=e,r=wi.from(Xl(t,()=>[]));for(let i=0;i<r.length;i++){let s=r[i],o=0,l=0,g;for(let u of e[i].childNodes.slice(2))if(u.type==="td"){if(u.isIndependent()&&(g=u.subtype!=="caption"),g){let d={row:i,column:o},{rowspan:p,colspan:m}=u;for(o++;s[l];)l++;for(let f=i;f<Math.min(i+p,t);f++)for(let h=l;h<l+m;h++)r[f][h]=d;l+=m}}else if(Ql(u))break}return r}getAllRows(){return[...super.getRowCount()?[this]:[],...this.childNodes.slice(1).filter(n=>n.type==="tr"&&n.getRowCount()>0)]}getNthRow(n,e,t){let r=super.getRowCount();if(n===0&&r)return this;r&&n--;for(let i of this.childNodes.slice(2)){let{type:s}=i;if(s==="tr"&&i.getRowCount()&&(n--,n<0))return i}}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e);return t.closed=this.closed,t}}});var xn,Oo=k(()=>{"use strict";Ai();xn=class extends ur{get type(){return"tr"}constructor(n,e,t,r){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,n,"tr",e,t,r)}}});var cr,Si=k(()=>{"use strict";rt();cr=class extends ce{get indent(){return this.innerText.split(":").length-1}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e),{indent:r}=this;return r&&(t.indent=r),t}}});var hr,Ci=k(()=>{"use strict";Si();hr=class extends cr{get type(){return"dd"}}});var _o={};Y(_o,{parseTable:()=>Jl});var Kl,qo,Jl,Mo=k(()=>{"use strict";O();Bo();Oo();ki();Ci();Kl=a=>a.lastChild.constructor!==v,qo=(a,n)=>a.type==="td"?n.pop():a,Jl=({firstChild:{data:a},type:n,name:e},t,r)=>{let i=[],s=a.split(`
|
|
17
|
+
`),o=n==="root"||n==="parameter-value"||n==="ext-inner"&&e==="poem"?"":`
|
|
18
|
+
${s.shift()}`,l,g=(u,d)=>{if(!d){o+=u;return}let{lastChild:p}=d;if(Kl(d)){let m=new v(u,t,r);m.type="table-inter",m.setAttribute("stage",3),d.insertAt(m)}else p.setText(p.toString()+u)};for(let u of s){l=i.pop();let[d]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(u),p=u.slice(d.length),m=/^(:*)((?:\s|\0\d+[cn]\x7F)*)(\{\||\{(?:\0\d+[cn]\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(p);if(m){for(;l&&l.type!=="td";)l=i.pop();let[,C,A,I,B]=m;C&&new hr(C,t,r),g(`
|
|
19
|
+
${d}${C&&`\0${r.length-1}d`}${A}\0${r.length}b`,l),i.push(...l?[l]:[],new fn(I,B,t,r));continue}else if(!l){o+=`
|
|
20
|
+
${u}`;continue}let f=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(p);if(!f){g(`
|
|
21
|
+
${u}`,l),i.push(l);continue}let[,h,x,b,w]=f;if(h){for(;l.type!=="table";)l=i.pop();l.close(`
|
|
22
|
+
${d}${h}`,!0),g(w,i[i.length-1])}else if(x){l=qo(l,i),l.type==="tr"&&(l=i.pop());let C=new xn(`
|
|
23
|
+
${d}${x}`,w,t,r);i.push(l,C),l.insertAt(C)}else{l=qo(l,i);let C=b==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu,A=C.exec(w),I=0,B=`
|
|
24
|
+
${d}${b}`,z=L=>{let V=new pr(B,w.slice(I,A==null?void 0:A.index),t,r);return L.insertAt(V),V};for(;A;)z(l),{lastIndex:I}=C,[B]=A,A=C.exec(w);i.push(l,z(l))}}return o.slice(1)}});var bn,zo=k(()=>{"use strict";rt();bn=class extends ce{get type(){return"hr"}}});var Do,$i,Yl,It,Wo=k(()=>{"use strict";mt();Me();rt();Do=[ve(),ue("__")];It=class extends(Yl=ce){get type(){return"double-underscore"}constructor(n,e,t,r){var l,g;super(n,t,r);let i=n.toLowerCase(),{doubleUnderscore:[,,s,o]}=t;this.setAttribute("name",(g=e?(l=o==null?void 0:o[n])==null?void 0:l.toLowerCase():s==null?void 0:s[i])!=null?g:i)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}};$i=R(Yl),It=j($i,0,"DoubleUnderscoreToken",Do,It),P($i,1,It)});var Uo={};Y(Uo,{parseHrAndDoubleUnderscore:()=>Zl});var Zl,Ho=k(()=>{"use strict";zo();Wo();Vn();Zl=({firstChild:{data:a},type:n,name:e},t,r)=>{var l,g,u;let{doubleUnderscore:[i,s,o]}=t;return(l=t.insensitiveDoubleUnderscore)!=null||(t.insensitiveDoubleUnderscore=new Set(i)),(g=t.sensitiveDoubleUnderscore)!=null||(t.sensitiveDoubleUnderscore=new Set(s)),(u=t.regexHrAndDoubleUnderscore)!=null||(t.regexHrAndDoubleUnderscore=new RegExp(`__(${[...i,...s].join("|")})__`,"giu")),n!=="root"&&(n!=="ext-inner"||e!=="poem")&&(a=`\0${a}`),a=a.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(d,p,m)=>(new bn(m,t,r),`${p}\0${r.length-1}r`)).replace(t.regexHrAndDoubleUnderscore,(d,p)=>{var x;let m=t.sensitiveDoubleUnderscore.has(p),f=p.toLowerCase(),h=t.insensitiveDoubleUnderscore.has(f);return m||h?(new It(p,m,t,r),`\0${r.length-1}${h&&((x=o==null?void 0:o[f])!=null?x:f)==="toc"?"u":"n"}`):d}).replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(d,p,m,f,h)=>{let x=`${p}\0${r.length}h`;return new tr(m.length,[f,h],t,r),x}),n==="root"||n==="ext-inner"&&e==="poem"?a:a.slice(1)}});var mr,Tn,Go=k(()=>{"use strict";M();ne();U();rt();Tn=class extends ce{constructor(e,t,r,i){super(e,r,i);T(this,mr);y(this,mr,t)}get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}get closing(){return X(X({},this.bold?{bold:c(this,mr).bold}:void 0),this.italic?{italic:c(this,mr).italic}:void 0)}text(){let{parentNode:e,innerText:t}=this;return(e==null?void 0:e.type)==="image-parameter"&&e.name!=="caption"?"":t}lint(e=this.getAbsoluteIndex()){let{previousSibling:t,nextSibling:r,bold:i,closing:s}=this,o=(t==null?void 0:t.type)==="text"?t.data:void 0,l=(r==null?void 0:r.type)==="text"?r.data:void 0,g=S.msg('lonely "$1"',"'"),u=[],d=new F(this,e),p=(m,f,h)=>[{desc:"escape",range:[m,f],text:"'".repeat(h)},{desc:"remove",range:[m,f],text:""}];if(o!=null&&o.endsWith("'")){let m=E(this,d,"lonely-apos",g,(s.bold||s.italic)&&(/[a-z\d]'$/iu.test(o)||l&&/^[a-z\d]/iu.test(l))?"warning":"error"),{startIndex:f,startLine:h,startCol:x}=m,[,{length:b}]=/(?:^|[^'])('+)$/u.exec(o),w=e-b;u.push(se(X({},m),{startIndex:w,endIndex:f,endLine:h,startCol:x-b,endCol:x,suggestions:p(w,f,b)}))}if(l!=null&&l.startsWith("'")){let m=E(this,d,"lonely-apos",g),{endIndex:f,endLine:h,endCol:x}=m,[{length:b}]=/^'+/u.exec(l),w=f+b;u.push(se(X({},m),{startIndex:f,endIndex:w,startLine:h,startCol:x,endCol:x+b,suggestions:p(f,w,b)}))}if(i&&this.closest("heading-title")){let m=E(this,d,"bold-header","bold in section header","warning");m.suggestions=[{desc:"remove",range:[e,e+3],text:""}],u.push(m)}return u}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return Object.assign(r,{bold:this.bold,italic:this.italic}),r}};mr=new WeakMap});var Vo={};Y(Vo,{parseQuotes:()=>Ni});var Ni,Ii=k(()=>{"use strict";Go();Ni=(a,n,e,t)=>{var m;let r=a.split(/('{2,})/u),{length:i}=r;if(i===1)return a;let s=0,o=0,l,g,u;for(let f=1;f<i;f+=2){let h=r[f].length;switch(h){case 2:o++;break;case 4:r[f-1]+="'",r[f]="'''";case 3:if(s++,l!==void 0)break;r[f-1].endsWith(" ")?g===void 0&&u===void 0&&(u=f):r[f-1].slice(-2,-1)===" "?l=f:g!=null||(g=f);break;default:r[f-1]+="'".repeat(h-5),r[f]="'''''",o++,s++}}if(o%2===1&&s%2===1){let f=(m=l!=null?l:g)!=null?m:u;f!==void 0&&(r[f]="''",r[f-1]+="'")}let d=!0,p=!0;for(let f=1;f<i;f+=2){let h=r[f].length,x=h!==2,b=h!==3;x&&(d=!d),b&&(p=!p),new Tn(r[f],{bold:x&&d,italic:b&&p},n,e),r[f]=`\0${e.length-1}q`}return r.join("")}});var Xo={};Y(Xo,{parseExternalLinks:()=>Ei});var Ei,Li=k(()=>{"use strict";re();gi();mn();Ei=(a,n,e,t)=>{var r;return(r=n.regexExternalLinks)!=null||(n.regexExternalLinks=new RegExp(String.raw`\[(\0\d+f\x7F|(?:(?:${n.protocol}|//)${Be}|\0\d+m\x7F)${Oe}(?=[[\]<>"\t${Se}]|\0\d))([${Se}]*(?![${Se}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),a.replace(n.regexExternalLinks,(i,s,o,l)=>{let{length:g}=e,u=/&[lg]t;/u.exec(s);return u&&(o="",l=s.slice(u.index)+o+l,s=s.slice(0,u.index)),t?(new Ge(s,"ext-link-url",n,e),`[\0${g}f${o}${l}]`):(new Xe(s,o,l,n,e),`\0${g}w`)})}});var yn,Qo=k(()=>{"use strict";re();Er();yn=class extends Te{get type(){return"category"}get sortkey(){let{childNodes:[,n]}=this;return n&&ht(n.text())}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e),{sortkey:r}=this;return r&&(t.sortkey=r),t}}});var Jo={};Y(Jo,{parseLinks:()=>Ko});var ed,Ko,Yo=k(()=>{"use strict";U();Ii();Li();li();ni();Qo();ed=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,Ko=(a,n,e,t)=>{var o;(o=n.regexLinks)!=null||(n.regexLinks=new RegExp(String.raw`^\s*(?:${n.protocol}|//)`,"iu"));let r=n.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]]))?\]\]([\s\S]*)$/u:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]])?)?\]\]([\s\S]*)$/u,i=a.split("[["),s=i.shift();for(let l=0;l<i.length;l++){let g=!1,u,d,p,m,f=i[l],h=r.exec(f);if(h)[,u,d,p,m]=h,m.startsWith("]")&&(p!=null&&p.includes("["))&&(p+="]",m=m.slice(1));else{let A=ed.exec(f);A&&(g=!0,[,u,d,p]=A)}if(u===void 0||n.regexLinks.test(u)||/\0\d+[exhbru]\x7F/u.test(u)){s+=`[[${f}`;continue}let x=u.trim().startsWith(":");if(x&&g){s+=`[[${f}`;continue}let{ns:b,valid:w}=S.normalizeTitle(u,0,!1,n,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0});if(w){if(g){if(b!==6){s+=`[[${f}`;continue}let A=!1;for(l++;l<i.length;l++){let I=i[l],B=I.split("]]");if(B.length>2){A=!0,p+=`[[${B[0]}]]${B[1]}`,m=B.slice(2).join("]]");break}else if(B.length===2)p+=`[[${B[0]}]]${B[1]}`;else{p+=`[[${I}`;break}}if(p=Ko(p,n,e,t),!A){s+=`[[${u}${d}${p}`;continue}}}else{s+=`[[${f}`;continue}p&&(p=Ni(p,n,e,t));let C=ar;x||(b===6?(p&&(p=Ei(p,n,e,!0)),C=sr):b===14&&(C=yn)),p===void 0&&d&&(p=""),s+=`\0${e.length}l${m}`,new C(u,p,n,e,d)}return s}});var na={};Y(na,{parseMagicLinks:()=>td});var ra,Zo,ea,ta,td,ia=k(()=>{"use strict";re();mn();ra=String.raw`[${Se}\t]| |�*160;|�*a0;`,Zo=`(?:${ra})+`,ea=`(?:${ra}|-)`,ta=String.raw`(?:RFC|PMID)${Zo}\d+\b|ISBN${Zo}(?:97[89]${ea}?)?(?:\d${ea}?){9}[\dx]\b`,td=(a,n,e)=>{if(!n.regexMagicLinks)try{n.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${n.protocol})(${Be}${Oe})|${ta})`,"giu")}catch(t){n.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${n.protocol})(${Be}${Oe})|${ta})`,"giu")}return a.replace(n.regexMagicLinks,(t,r,i)=>{let s=r?t.slice(r.length):t;if(i){let o="",l=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(s);l&&(o=s.slice(l.index),s=s.slice(0,l.index));let g=s.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,u=g.exec(s);if(u){let d=1;u[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(s.slice(0,u.index))&&(d=2),o=s.slice(u.index+d)+o,s=s.slice(0,u.index+d)}return o.length>=i.length?t:(new Ge(s,void 0,n,e),`${r}\0${e.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(s))return t;return new Ge(s,"magic-link",n,e),`${r}\0${e.length-1}i`})}});var sa,oa=k(()=>{"use strict";sa=(a,n)=>a.startsWith(n)?n.length:[...n].findIndex((e,t)=>e!==a[t])});var kn,aa=k(()=>{"use strict";Si();kn=class extends cr{get type(){return"list"}}});var la={};Y(la,{parseList:()=>rd});var rd,da=k(()=>{"use strict";oa();aa();Ci();rd=(a,n,e,t)=>{let r=/^((?:\0\d+[cno]\x7F)*)([;:*#]+\s*)/u.exec(a);if(!r)return n.lastPrefix="",a;let[i,s,o]=r,l=o.replace(/;/gu,":"),g=sa(l,n.lastPrefix),u=(g>1?o.slice(g-1):o).split(/(?=;)/u),d=u[0].startsWith(";"),p=u.length-(d?0:1);if(g>1){let L=o.slice(0,g-1);d?u.unshift(L):u[0]=L+u[0]}n.lastPrefix=l;let m=s+u.map((L,V)=>`\0${t.length+V}d`).join("")+a.slice(i.length);for(let L of u)new kn(L,e,t);if(!p)return m;let{html:[f]}=e,h=/:+|-\{|\0\d+[xq]\x7F/gu,x=h,b=x.exec(m),w=0,C=!1,A=!1,I=0,B=(L,V)=>(new hr(L,e,t),`${m.slice(0,V)}\0${t.length-1}d${m.slice(V+L.length)}`),z=L=>{L?w&&w--:w++};for(;b&&p;){let{0:L,index:V}=b;if(L==="-{"){if(!I){let{lastIndex:ie}=x;x=/-\{|\}-/gu,x.lastIndex=ie}I++}else if(L==="}-"){if(I--,!I){let{lastIndex:ie}=x;x=h,x.lastIndex=ie}}else if(L.endsWith("x")){let{name:ie,closing:oe,selfClosing:Z}=t[Number(L.slice(1,-2))];(!Z||f.includes(ie))&&z(oe)}else if(L.endsWith("q")){let{bold:ie,italic:oe}=t[Number(L.slice(1,-2))];ie&&(z(C),C=!C),oe&&(z(A),A=!A)}else if(w===0){if(L.length>=p)return B(L.slice(0,p),V);p-=L.length,x.lastIndex=V+4+String(t.length).length,m=B(L,V)}b=x.exec(m)}return m}});var ga,pa,Je,Fi,nd,Et,ua=k(()=>{"use strict";M();ne();Lr();O();ze();ga=new Set(["A","T","R","D","-","H","N"]);pa=[it()];Et=class extends(nd=v){constructor(e,t,r=[]){super(void 0,t,r,{});T(this,Je);this.safeAppend(e.map(i=>new Q(i,"converter-flag",t,r)))}get type(){return"converter-flags"}afterBuild(){y(this,Je,this.childNodes.map(e=>e.text().trim())),super.afterBuild()}toString(e){return super.toString(e,";")}text(){return super.text(";")}getUnknownFlags(){return new Set(c(this,Je).filter(e=>/\{{3}[^{}]+\}{3}/u.test(e)))}getVariantFlags(){let e=new Set(this.getAttribute("config").variants);return new Set(c(this,Je).filter(t=>e.has(t)))}lint(e=this.getAbsoluteIndex(),t){let r=this.getVariantFlags(),i=this.getUnknownFlags(),s=new Set(c(this,Je).filter(d=>ga.has(d))),o=c(this,Je).filter(d=>!d).length,l=c(this,Je).length-i.size-o,g=super.lint(e,t);if(r.size===l||s.size===l)return g;let u=new F(this,e);for(let d=0;d<this.length;d++){let p=this.childNodes[d],m=p.text().trim();if(m&&!r.has(m)&&!i.has(m)&&(r.size>0||!s.has(m))){let f=$(p,u,"no-ignored","invalid conversion flag");r.size===0&&ga.has(m.toUpperCase())?f.fix={range:[f.startIndex,f.endIndex],text:m.toUpperCase(),desc:"uppercase"}:f.suggestions=[{desc:"remove",range:[f.startIndex-(d&&1),f.endIndex],text:""}],g.push(f)}}return g}print(){return super.print({sep:";"})}};Fi=R(nd),Je=new WeakMap,Et=j(Fi,0,"ConverterFlagsToken",pa,Et),P(Fi,1,Et)});var fr,ca=k(()=>{"use strict";U();O();ze();fr=class extends v{get type(){return"converter-rule"}get variant(){var n,e;return(e=(n=this.childNodes[this.length-2])==null?void 0:n.text().trim())!=null?e:""}constructor(n,e=!0,t=S.getConfig(),r=[]){super(void 0,t,r);let i=n.indexOf(":"),s=n.slice(0,i).indexOf("=>"),o=s===-1?n.slice(0,i):n.slice(s+2,i);e&&t.variants.includes(o.trim())?(super.insertAt(new Q(o,"converter-rule-variant",t,r)),super.insertAt(new Q(n.slice(i+1),"converter-rule-to",t,r)),s!==-1&&super.insertAt(new Q(n.slice(0,s),"converter-rule-from",t,r),0)):super.insertAt(new Q(n,"converter-rule-to",t,r))}toString(n){let{childNodes:e,firstChild:t,lastChild:r}=this;return e.length===3?`${t.toString(n)}=>${e[1].toString(n)}:${r.toString(n)}`:super.toString(n,":")}text(){let{childNodes:n,firstChild:e,lastChild:t}=this;return n.length===3?`${e.text()}=>${n[1].text()}:${t.text()}`:super.text(":")}getGaps(n){return n===0&&this.length===3?2:1}print(){let{childNodes:n}=this;if(n.length===3){let[e,t,r]=n;return`<span class="wpb-converter-rule">${e.print()}=>${t.print()}:${r.print()}</span>`}return super.print({sep:":"})}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e);return t.variant=this.variant,t}}});var ha,Ri,id,Lt,ma=k(()=>{"use strict";re();Me();O();ua();ca();ha=[ue("-{")];Lt=class extends(id=v){get type(){return"converter"}constructor(n,e,t,r=[]){super(void 0,t,r),this.insertAt(new Et(n,t,r));let[i]=e,s=i.includes(":"),o=new fr(i,s,t,r);s&&o.length===1||!s&&e.length===2&&!ae(e[1]).trim()?this.insertAt(new fr(e.join(";"),!1,t,r)):this.append(o,...e.slice(1).map(l=>new fr(l,!0,t,r)))}toString(n){let{childNodes:[e,...t]}=this;return`-{${e.toString(n)}${e.length>0?"|":""}${t.map(r=>r.toString(n)).join(";")}}-`}text(){let{childNodes:[n,...e]}=this;return`-{${n.text()}|${ke(e,";")}}-`}getGaps(n){return n||this.firstChild.length>0?1:0}print(){let{childNodes:[n,...e]}=this;return`<span class="wpb-converter">-{${n.print()}${n.length>0?"|":""}${_e(e,{sep:";"})}}-</span>`}};Ri=R(id),Lt=j(Ri,0,"ConverterToken",ha,Lt),P(Ri,1,Lt)});var fa={};Y(fa,{parseConverter:()=>sd});var sd,xa=k(()=>{"use strict";ma();sd=(a,n,e)=>{var l;(l=n.regexConverter)!=null||(n.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${n.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"u"));let t=/-\{/gu,r=/-\{|\}-/gu,i=[],s=t,o=s.exec(a);for(;o;){let{0:g,index:u}=o;if(g==="}-"){let d=i.pop(),{length:p}=e,m=a.slice(d.index+2,u),f=m.indexOf("|"),[h,x]=f===-1?[[],m]:[m.slice(0,f).split(";"),m.slice(f+1)],b=x.replace(/(&[#a-z\d]+);/giu,"$1"),w=b.split(n.regexConverter).map(C=>C.replace(/\x01/gu,";"));new Lt(h,w,n,e),a=`${a.slice(0,d.index)}\0${p}v${a.slice(u+2)}`,i.length===0&&(s=t),s.lastIndex=d.index+3+String(p).length}else i.push(o),s=r,s.lastIndex=u+2;o=s.exec(a)}return a}});var vn={};Y(vn,{Token:()=>v});var Wr,ye,H,J,Ft,xr,Ur,G,ba,Ta,ya,ka,va,Aa,wa,Sa,Ca,$a,Na,Ia,Pi,v,O=k(()=>{"use strict";re();M();pe();U();is();ls();Pi=class Pi extends Jr{constructor(e,t=S.getConfig(),r=[],i){super();T(this,G);T(this,Wr,"plain");T(this,ye,0);T(this,H);T(this,J);T(this,Ft);T(this,xr,!1);T(this,Ur);typeof e=="string"&&this.insertAt(e),y(this,H,t),y(this,J,r),r.push(this)}get type(){return c(this,Wr)}set type(e){y(this,Wr,e)}parseOnce(e=c(this,ye),t=!1,r){if(e<c(this,ye)||this.length===0||!this.isPlain())return this;if(c(this,ye)>=11)return this;switch(e){case 0:if(this.type==="root"){c(this,J).pop();let i=N(this,G,ba).call(this);t&&(t=!i)}y(this,Ft,t),N(this,G,Ta).call(this,t);break;case 1:N(this,G,ya).call(this);break;case 2:N(this,G,ka).call(this);break;case 3:N(this,G,va).call(this);break;case 4:N(this,G,Aa).call(this);break;case 5:N(this,G,wa).call(this,r);break;case 6:N(this,G,Sa).call(this,r);break;case 7:N(this,G,Ca).call(this);break;case 8:N(this,G,$a).call(this);break;case 9:N(this,G,Na).call(this);break;case 10:N(this,G,Ia).call(this)}if(this.type==="root")for(let i of c(this,J))i==null||i.parseOnce(e,t,r);return Qr(this,ye)._++,this}buildFromStr(e,t){let r=e.split(/[\0\x7F]/u).map((i,s)=>{if(s%2===0)return new Nr(i);if(isNaN(i.slice(-1)))return c(this,J)[Number(i.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${i}`)});return t===0?r.map(String).join(""):t===1?ke(r):r}build(){y(this,ye,11);let{length:e,firstChild:t}=this,r=t==null?void 0:t.toString();if(e===1&&t.type==="text"&&r.includes("\0")&&($r(this,0,1,this.buildFromStr(r)),this.normalize(),this.type==="root"))for(let i of c(this,J))i==null||i.build()}afterBuild(){if(this.type==="root")for(let e of c(this,J))e==null||e.afterBuild();y(this,xr,!0)}parse(e=11,t,r){for(e=Math.min(e,11);c(this,ye)<e;)this.parseOnce(c(this,ye),t,r);return e&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===Pi}getAttribute(e){var t;switch(e){case"config":return c(this,H);case"include":return(t=c(this,Ft))!=null?t:!!c(this.getRootNode(),Ft);case"accum":return c(this,J);case"built":return c(this,xr);case"stage":return c(this,ye);default:return super.getAttribute(e)}}setAttribute(e,t){switch(e){case"stage":c(this,ye)===0&&this.type==="root"&&c(this,J).shift(),y(this,ye,t);break;default:super.setAttribute(e,t)}}insertAt(e,t=this.length){let r=typeof e=="string"?new Nr(e):e;super.insertAt(r,t);let{type:i}=r;return i==="root"&&(r.type="plain"),r}normalizeTitle(e,t=0,r){return S.normalizeTitle(e,t,c(this,Ft),c(this,H),r)}lint(e=this.getAbsoluteIndex(),t){var i;let r=super.lint(e,t);if(this.type==="root"){let s=new Map,o="category,html-attr#id,ext-attr#id,table-attr#id";for(let p of this.querySelectorAll(o)){let m;if(p.type==="category")m=p.name;else{let f=p.getValue();f&&f!==!0&&(m=`#${f}`)}if(m){let f=s.get(m);f?f.add(p):s.set(m,new Set([p]))}}for(let[p,m]of s)if(m.size>1&&!p.startsWith("#mw-customcollapsible-")){let f=!p.startsWith("#"),h=`duplicated ${f?"category":"id"}`,x=f?"error":"warning";r.push(...[...m].map(b=>{let w=E(b,{start:b.getAbsoluteIndex()},"no-duplicate",h,x);return f&&(w.suggestions=[{desc:"remove",range:[w.startIndex,w.endIndex],text:""}]),w}))}let l=/<!--\s*lint-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->/gu,g=this.toString(),u=[],d=l.exec(g);for(;d;){let{1:p,index:m}=d,f=(i=d[2])==null?void 0:i.trim();u.push({line:this.posFromIndex(m).top+(p==="disable-line"?0:1),from:p==="disable"?l.lastIndex:void 0,to:p==="enable"?l.lastIndex:void 0,rules:f?new Set(f.split(",").map(h=>h.trim())):void 0}),d=l.exec(g)}if(r=r.filter(({rule:p,startLine:m,startIndex:f})=>{let h={pos:0};for(let{line:x,from:b,to:w,rules:C}of u){if(x>m+1)break;if(C&&!C.has(p))continue;if(x===m&&b===void 0&&w===void 0)return!1;b<=f&&b>h.pos?(h.pos=b,h.type="from"):w<=f&&w>h.pos&&(h.pos=w,h.type="to")}return h.type!=="from"}),r.some(({fix:p})=>p)){let p=r.map(({fix:h})=>h).filter(Boolean).sort(({range:[h,x]},{range:[b,w]})=>x===w?b-h:w-x),m=1/0,f=g;for(let{range:[h,x],text:b}of p)x<=m&&(f=f.slice(0,h)+b+f.slice(x),m=h);Object.assign(r,{output:f})}}return r}toString(e,t){return e?super.toString(!0,t):Ce(c(this,Ur),()=>super.toString(!1,t),r=>{let i=this.getRootNode();i.type==="root"&&c(i,xr)&&y(this,Ur,r)})}};Wr=new WeakMap,ye=new WeakMap,H=new WeakMap,J=new WeakMap,Ft=new WeakMap,xr=new WeakMap,Ur=new WeakMap,G=new WeakSet,ba=function(){let{parseRedirect:e}=(ms(),W(hs)),t=this.firstChild.toString(),r=e(t,c(this,H),c(this,J));return r&&this.setText(r),!!r},Ta=function(e){let{parseCommentAndExt:t}=(Pr(),W(Lo));this.setText(t(this.firstChild.toString(),c(this,H),c(this,J),e))},ya=function(){let{parseBraces:e}=(gn(),W(ro)),t=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,r=e(t,c(this,H),c(this,J));this.setText(this.type==="root"?r:r.slice(1))},ka=function(){if(c(this,H).excludes.includes("html"))return;let{parseHtml:e}=(jo(),W(Po));this.setText(e(this.firstChild.toString(),c(this,H),c(this,J)))},va=function(){if(c(this,H).excludes.includes("table"))return;let{parseTable:e}=(Mo(),W(_o));this.setText(e(this,c(this,H),c(this,J)))},Aa=function(){if(c(this,H).excludes.includes("hr"))return;let{parseHrAndDoubleUnderscore:e}=(Ho(),W(Uo));this.setText(e(this,c(this,H),c(this,J)))},wa=function(e){let{parseLinks:t}=(Yo(),W(Jo));this.setText(t(this.firstChild.toString(),c(this,H),c(this,J),e))},Sa=function(e){if(c(this,H).excludes.includes("quote"))return;let{parseQuotes:t}=(Ii(),W(Vo)),r=this.firstChild.toString().split(`
|
|
25
|
+
`);for(let i=0;i<r.length;i++)r[i]=t(r[i],c(this,H),c(this,J),e);this.setText(r.join(`
|
|
26
|
+
`))},Ca=function(){if(c(this,H).excludes.includes("extLink"))return;let{parseExternalLinks:e}=(Li(),W(Xo));this.setText(e(this.firstChild.toString(),c(this,H),c(this,J)))},$a=function(){if(c(this,H).excludes.includes("magicLink"))return;let{parseMagicLinks:e}=(ia(),W(na));this.setText(e(this.firstChild.toString(),c(this,H),c(this,J)))},Na=function(){if(c(this,H).excludes.includes("list"))return;let{parseList:e}=(da(),W(la)),{firstChild:t,type:r,name:i}=this,s=t.toString().split(`
|
|
27
|
+
`),o={lastPrefix:""},l=r==="root"||r==="ext-inner"&&i==="poem"?0:1;for(;l<s.length;l++)s[l]=e(s[l],o,c(this,H),c(this,J));this.setText(s.join(`
|
|
28
|
+
`))},Ia=function(){if(c(this,H).variants.length>0){let{parseConverter:e}=(xa(),W(fa));this.setText(e(this.firstChild.toString(),c(this,H),c(this,J)))}};v=Pi});var le,rr,$r,Fe,pe=k(()=>{"use strict";le={running:!1,run(a){let{running:n}=this;this.running=!0;try{let{Token:e}=(O(),W(vn)),t=a();return t instanceof e&&!t.getAttribute("built")&&t.afterBuild(),this.running=n,t}catch(e){throw this.running=n,e}},rev:0},rr=a=>n=>n.type===a,$r=(a,n,e,t=[])=>{var s,o;let r=a.getChildNodes(),i;r.length===e?(i=r,r=t):i=r.splice(n,e,...t);for(let l=0;l<t.length;l++){let g=t[l];g.setAttribute("parentNode",a),g.setAttribute("nextSibling",r[n+l+1]),g.setAttribute("previousSibling",r[n+l-1])}return(s=r[n-1])==null||s.setAttribute("nextSibling",r[n]),(o=r[n+t.length])==null||o.setAttribute("previousSibling",r[n+t.length-1]),r===t&&a.setAttribute("childNodes",r),i},Fe=(a,n)=>{Object.defineProperty(a,"name",{value:n.name})}});var Ea={};Y(Ea,{Title:()=>ji});var Hr,Gr,Rt,br,Pt,ji,La=k(()=>{"use strict";re();ji=class{constructor(n,e,t,{temporary:r,decode:i,selfLink:s}={}){T(this,Hr);T(this,Gr);T(this,Rt);T(this,br);T(this,Pt);ge(this,"valid");ge(this,"encoded",!1);let o=n.trim().startsWith("../");if(i&&n.includes("%"))try{let g=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(n);n=et(n),this.encoded=g}catch(g){}if(n=ht(n).replace(/[_ ]+/gu," ").trim(),o)y(this,br,0);else{let g=e;n.startsWith(":")&&(g=0,n=n.slice(1).trim());let u=n.split(":");if(u.length>1){let d=qe(u[0]),p=Object.prototype.hasOwnProperty.call(t.nsid,d)&&t.nsid[d];p&&(g=p,n=u.slice(1).join(":").trim())}y(this,br,g)}let l=n.indexOf("#");if(l!==-1){let g=n.slice(l).trim().slice(1);if(g.includes("%"))try{g=et(g)}catch(u){}y(this,Pt,g.replace(/ /gu,"_")),n=n.slice(0,l).trim()}this.valid=!!(n||s&&this.ns===0&&c(this,Pt)!==void 0)&&ht(n)===n&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(o?/^(?:\.\.\/)+(.*)/u.exec(n)[1]:n),this.main=n,y(this,Gr,t.namespaces),y(this,Rt,t.articlePath||"/wiki/$1"),c(this,Rt).includes("$1")||y(this,Rt,c(this,Rt)+`${c(this,Rt).endsWith("/")?"":"/"}$1`),r||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return c(this,br)}get fragment(){return c(this,Pt)}get main(){return c(this,Hr)}set main(n){n=n.replace(/_/gu," ").trim(),y(this,Hr,n&&n[0].toUpperCase()+n.slice(1))}get prefix(){let n=c(this,Gr)[this.ns];return n+(n&&":")}get title(){return this.getRedirection()[1]}get extension(){let{main:n}=this,e=n.lastIndexOf(".");return e===-1?void 0:n.slice(e+1).toLowerCase()}getRedirection(){return[!1,(this.prefix+this.main).replace(/ /gu,"_")]}setFragment(n){y(this,Pt,n)}getUrl(n){}};Hr=new WeakMap,Gr=new WeakMap,Rt=new WeakMap,br=new WeakMap,Pt=new WeakMap});var Bi,jt,Fa,od,S,U=k(()=>{Qi();pe();es();re();Bi=!0,jt={config:Cn,i18n:void 0,rules:Xi,get viewOnly(){return Bi},set viewOnly(a){Bi&&!a&&le.rev++,Bi=a},getConfig(a){let n=a!=null?a:this.config,{doubleUnderscore:e,ext:t,parserFunction:r,variable:i}=n;for(let s=0;s<2;s++)e.length>s+2&&e[s].length===0&&(e[s]=Object.keys(e[s+2]));return t.includes("translate")&&!i.includes("translationlanguage")&&(i.push("translationlanguage"),Array.isArray(r[1])?r[1].push("TRANSLATIONLANGUAGE"):r[1].TRANSLATIONLANGUAGE="translationlanguage"),se(X(X({},Cn),n),{excludes:[]})},msg(a,n=""){var e,t;return a&&((t=(e=this.i18n)==null?void 0:e[a])!=null?t:a).replace("$1",this.msg(n))},normalizeTitle(a,n=0,e,t=jt.getConfig(),r){let{Title:i}=(La(),W(Ea)),s;if(r!=null&&r.halfParsed)s=new i(a,n,t,r);else{let{Token:o}=(O(),W(vn));s=le.run(()=>{let l=new o(a,t);l.type="root",l.parseOnce(0,e).parseOnce();let g=new i(l.toString(),n,t,r);for(let u of["main","fragment"]){let d=g[u];if(d!=null&&d.includes("\0")){let p=l.buildFromStr(d,1);u==="main"?g.main=p:g.setFragment(p)}}return g})}return s},parse(a,n,e=11,t=jt.getConfig()){a=Ji(a);let r;typeof e!="number"&&(r=Array.isArray(e)?e:[e],e=Math.max(...r.map(o=>Vi[o]||11)));let{Token:i}=(O(),W(vn));return le.run(()=>{let o=new i(a,t);return o.type="root",o.parse(e,n)})},async partialParse(a,n,e,t=jt.getConfig()){},createLanguageService(a){}},Fa={},od=new Set(["normalizeTitle","parse","createLanguageService"]);for(let a in jt)od.has(a)||(Fa[a]={enumerable:!1});Object.defineProperties(jt,Fa);Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:jt});S=jt});U();})();
|