wikiparser-node 1.13.3 → 1.13.5
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.min.js +27 -26
- package/config/default.json +1 -1
- package/config/zhwiki.json +1 -1
- package/dist/lib/node.d.ts +6 -6
- package/dist/lib/node.js +11 -11
- package/dist/src/transclude.js +1 -1
- package/dist/util/sharable.d.ts +1 -0
- package/dist/util/string.js +3 -7
- package/extensions/dist/base.js +1 -1
- package/extensions/dist/codejar.js +4 -1
- package/package.json +22 -3
package/bundle/bundle.min.js
CHANGED
|
@@ -1,37 +1,38 @@
|
|
|
1
|
-
"use strict";(()=>{var
|
|
2
|
-
`),e=r.length;return{height:e,width:r[e-1].length}},
|
|
3
|
-
`),Pn=ar.length+$-1,Bn=ar[ar.length-1],jn=ar.length===1?w+Bn.length:Bn.length,qt={rule:mo[I],message:f.msg('lonely "$1"',I==="h"?ee:I),severity:Ur,startIndex:ke,endIndex:Pe,startLine:Pn,endLine:Pn,startCol:jn,endCol:jn+xe};if(I==="<")qt.suggestions=[{desc:"escape",range:[ke,ke+1],text:"<"}];else if(I==="h"&&!(a==="ext-link-text"||a==="link-text")&&/[\p{L}\d_]/u.test(ot||""))qt.suggestions=[{desc:"whitespace",range:[ke,ke],text:" "}];else if(I==="["&&a==="ext-link-text"){let ae=i.getAbsoluteIndex()+i.toString().length;qt.suggestions=[{desc:"escape",range:[ae,ae+1],text:"]"}]}else if(I==="]"&&k==="free-ext-link"&&Ur==="error"){let ae=e-o.toString().length;qt.fix={range:[ae,ae],text:"["}}c.push(qt)}return c}replaceData(e){R(this,pr,ri).call(this,e)}print(){return dt(this.data)}};pr=new WeakSet,ri=function(e){this.setAttribute("data",e)}});var ue,He=b(()=>{"use strict";be();ue=(d=!0,r=!0)=>(e,t)=>{class n extends e{text(){return""}lint(s){return d?[]:super.lint(s)}}return ur(n,e),n}});var Wt,ce,pt=b(()=>{"use strict";P();ce=class extends y{constructor(e,t,n,i,s,o){super(e,i,s,o);T(this,Wt);v(this,Wt,n)}get type(){return u(this,Wt)}lint(e=this.getAbsoluteIndex()){return super.lint(e,!1)}};Wt=new WeakMap});var ut,G,Ee=b(()=>{"use strict";P();G=class extends y{constructor(e,t,n,i,s){super(e,n,i,s);T(this,ut);v(this,ut,t)}get type(){return u(this,ut)}set type(e){v(this,ut,e)}};ut=new WeakMap});var xo,Ve,Te,je,Ce,Dt=b(()=>{"use strict";_();Se();Q();F();P();Ee();xo=d=>d==="redirect-target"||d==="link",Ce=class extends y{constructor(e,t,n=f.getConfig(),i=[],s="|"){super(void 0,n,i,{});T(this,Ve,!0);T(this,Te);T(this,je);if(this.insertAt(new G(e,"link-target",n,i,{})),t!==void 0){let o=new y(t,n,i,{});o.type="link-text",o.setAttribute("stage",10),this.insertAt(o)}v(this,Te,s)}afterBuild(){v(this,je,this.getTitle()),u(this,Te).includes("\0")&&v(this,Te,this.buildFromStr(u(this,Te),0)),this.setAttribute("name",u(this,je).title),super.afterBuild()}setAttribute(e,t){e==="bracket"?v(this,Ve,t):e==="title"?v(this,je,t):super.setAttribute(e,t)}toString(e){let t=super.toString(e,u(this,Te));return u(this,Ve)?`[[${t}]]`:t}text(){let e=super.text("|");return u(this,Ve)?`[[${e}]]`:e}getAttribute(e){return e==="title"?u(this,je):e==="padding"?2:super.getAttribute(e)}getGaps(e){return e===0?u(this,Te).length:1}lint(e=this.getAbsoluteIndex(),t){let n=super.lint(e,t),{childNodes:[i,s],type:o}=this,{encoded:a,fragment:p}=u(this,je),g=new E(this,e);if(i.childNodes.some(({type:l})=>l==="template")&&n.push(C(i,g,"unknown-page","template in an internal link target","warning")),a&&n.push(C(i,g,"url-encoding","unnecessary URL encoding in an internal link")),o==="link"||o==="category"){let l=s==null?void 0:s.childNodes.find(c=>c.type==="text"&&c.data.includes("|"));if(l){let c=C(s,g,"pipe-like",'additional "|" in the link text',"warning"),h=c.startIndex+l.getRelativeIndex();c.suggestions=[{desc:"escape",range:[h,h+l.data.length],text:l.data.replace(/\|/gu,"|")}],n.push(c)}}if(p!==void 0&&!xo(o)){let l=C(i,g,"no-ignored","useless fragment"),c=i.childNodes.find(h=>h.type==="text"&&h.data.includes("#"));c&&(l.fix={range:[l.startIndex+c.getRelativeIndex()+c.data.indexOf("#"),l.endIndex],text:""}),n.push(l)}return n}getTitle(e){return this.normalizeTitle(this.firstChild.toString(!0),0,e,!0,!0)}print(){return super.print(u(this,Ve)?{pre:"[[",post:"]]",sep:u(this,Te)}:{sep:u(this,Te)})}};Ve=new WeakMap,Te=new WeakMap,je=new WeakMap});var re,qe=b(()=>{"use strict";P();re=class extends y{get innerText(){return this.firstChild.data}constructor(r="",e,t){super(r,e,t)}}});var ii,rn,bo,U,_e=b(()=>{"use strict";He();qe();ii=[ue()];U=class extends(bo=re){get type(){return"noinclude"}toString(r){return r?"":super.toString()}};rn=le(bo),U=ge(rn,0,"NoincludeToken",ii,U),de(rn,1,U)});var cr,si=b(()=>{"use strict";_();F();Dt();_e();cr=class extends Ce{get type(){return"redirect-target"}constructor(r,e,t=f.getConfig(),n=[]){super(r,void 0,t,n),e!==void 0&&this.insertAt(new U(e,t,n))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,!0,!0)}lint(r=this.getAbsoluteIndex()){let e=super.lint(r,!1);if(this.length===2){let t=C(this.lastChild,{start:r},"no-ignored","useless link text");t.startIndex--,t.startCol--,t.fix={range:[t.startIndex,t.endIndex],text:""},e.push(t)}return e}}});var oi,Oe,ct,nn,To,Xe,ai=b(()=>{"use strict";He();F();P();pt();si();oi=[ue(!1,!1)];Xe=class extends(To=y){constructor(e,t,n,i,s,o=f.getConfig(),a=[]){super(void 0,o,a);T(this,Oe);T(this,ct);v(this,Oe,e),v(this,ct,s);let p=new RegExp(String.raw`^(?:${o.redirection.join("|")})\s*(?::\s*)?$`,"iu");this.append(new ce(t,p,"redirect-syntax",o,a,{}),new cr(n,i==null?void 0:i.slice(1),o,a))}get type(){return"redirect"}getAttribute(e){return e==="padding"?u(this,Oe).length:super.getAttribute(e)}toString(e){return u(this,Oe)+super.toString(e)+u(this,ct)}lint(e=this.getAbsoluteIndex()){return this.lastChild.lint(e+u(this,Oe).length+this.firstChild.toString().length)}print(){return super.print({pre:u(this,Oe),post:u(this,ct)})}};nn=le(To),Oe=new WeakMap,ct=new WeakMap,Xe=ge(nn,0,"RedirectToken",oi,Xe),de(nn,1,Xe)});var li={};se(li,{parseRedirect:()=>yo});var yo,di=b(()=>{"use strict";F();ai();yo=(d,r,e)=>{var n;(n=r.regexRedirect)!=null||(r.regexRedirect=new RegExp(String.raw`^(\s*)((?:${r.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));let t=r.regexRedirect.exec(d);return t&&f.normalizeTitle(t[3],0,!1,r,!0,!0).valid?(d=`\0${e.length}o\x7F${d.slice(t[0].length)}`,new Xe(...t.slice(1),r,e),d):!1}});var hr,gi=b(()=>{"use strict";P();hr=class extends y{get type(){return"onlyinclude"}toString(r){return`<onlyinclude>${super.toString(r)}</onlyinclude>`}getAttribute(r){return r==="padding"?13:r==="plain"||super.getAttribute(r)}print(){return super.print({pre:'<span class="wpb-ext"><onlyinclude></span>',post:'<span class="wpb-ext"></onlyinclude></span>'})}}});var Me,ht,sn=b(()=>{"use strict";P();ht=class extends y{constructor(e,t,n,i,s,o=[]){super(void 0,s);T(this,Me);X(this,"closed");X(this,"selfClosing");this.setAttribute("name",e.toLowerCase()),v(this,Me,[e,i||e]),this.closed=i!=="",this.selfClosing=i===void 0,this.append(t,n);let a=typeof t=="string"?-1:o.indexOf(t);o.splice(a===-1?1/0:a,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(e){let{selfClosing:t,firstChild:n,lastChild:i}=this,[s,o]=u(this,Me);return t?`<${s}${n.toString(e)}/>`:`<${s}${n.toString(e)}>${i.toString(e)}${this.closed?`</${o}>`:""}`}text(){let[e,t]=u(this,Me);return this.selfClosing?`<${e}${this.firstChild.text()}/>`:`<${e}${super.text(">")}${this.closed?`</${t}>`:""}`}getAttribute(e){return e==="padding"?u(this,Me)[0].length+1:super.getAttribute(e)}getGaps(){return 1}print(){let[e,t]=u(this,Me);return super.print(this.selfClosing?{pre:`<${e}`,post:"/>"}:{pre:`<${e}`,sep:">",post:this.closed?`</${t}>`:""})}};Me=new WeakMap});var pi,on,ko,Qe,ui=b(()=>{"use strict";_();Q();He();F();sn();pi=[ue(!1)];Qe=class extends(ko=ht){get type(){return"include"}constructor(r,e="",t,n,i,s){super(r,e,t!=null?t:"",t===void 0||n!=null?n:"",i,s)}toString(r){return r?"":super.toString()}lint(r=this.getAbsoluteIndex()){let e=[],{firstChild:t,closed:n,name:i}=this,s=new E(this,r);if(t.data.trim()){let o=C(t,s,"no-ignored","useless attribute","warning");o.suggestions=[{desc:"remove",range:[o.startIndex,o.endIndex],text:""}],e.push(o)}if(!n){let o=N(this,s,"unclosed-comment",f.msg("unclosed $1",`<${i}>`));o.suggestions=[{desc:"close",range:[o.endIndex,o.endIndex],text:`</${i}>`}],e.push(o)}return e}};on=le(ko),Qe=ge(on,0,"IncludeToken",pi,Qe),de(on,1,Qe)});var V,ci,hi,fr,an,mi,mt,fi,xi,bi,mr,Ti,yi,ki,vi,Ai=b(()=>{"use strict";V=new Set(["align"]),ci=new Set(["cite"]),hi=new Set(["cite","datetime"]),fr=new Set(["width"]),an=new Set(["axis","align","bgcolor","height","width","valign"]),mi=new Set([...an,"abbr","headers","scope","rowspan","colspan"]),mt=new Set(["type"]),fi=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),xi=new Set(["clear"]),bi=new Set(["bgcolor","align","valign"]),mr=new Set,Ti=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"]),yi={div:V,h1:V,h2:V,h3:V,h4:V,h5:V,h6:V,blockquote:ci,q:ci,p:V,br:xi,pre:fr,ins:hi,del:hi,ul:mt,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...fi,"border"]),caption:V,tr:bi,td:mi,th:mi,img:new Set(["alt","src","width","height","srcset"]),font:new Set(["size","color","face"]),hr:fr,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:mt,poem:V,categorytree:V,combooption:V},ki={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:mr,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:mr,inputbox:mr,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:mr,poll:new Set(["id","show-results-before-voting"]),sm2:mt,flashmp3:mt,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"])},vi={table:fi,td:new Set([...an,"scope"]),th:an,br:xi,caption:V,div:V,hr:fr,h1:V,h2:V,h3:V,h4:V,h5:V,h6:V,li:mt,p:V,pre:fr,tr:bi,ul:mt}});var vo,Ht,ft,Y,$e,xt,wi=b(()=>{"use strict";_();K();Se();Ai();Q();F();P();Ee();vo=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,xt=class extends y{constructor(e,t,n,i="",s,o=[],a=f.getConfig(),p=[]){let g=new G(n,"attr-key",a,p),l;if(n==="title"||t==="img"&&n==="alt")l=new y(s,a,p,{}),l.type="attr-value",l.setAttribute("stage",10);else if(t==="gallery"&&n==="caption"||t==="choose"&&(n==="before"||n==="after")){let c={...a,excludes:[...a.excludes,"heading","html","table","hr","list"]};l=new y(s,c,p,{}),l.type="attr-value",l.setAttribute("stage",1)}else l=new G(s,"attr-value",a,p,{});super(void 0,a,p);T(this,Ht);T(this,ft);T(this,Y);T(this,$e);v(this,Ht,e),this.append(g,l),v(this,Y,i),v(this,$e,[...o]),v(this,ft,t),this.setAttribute("name",te(n).trim().toLowerCase())}get type(){return u(this,Ht)}get tag(){return u(this,ft)}get balanced(){return!u(this,Y)||u(this,$e)[0]===u(this,$e)[1]}afterBuild(){u(this,Y).includes("\0")&&v(this,Y,this.buildFromStr(u(this,Y),0)),this.parentNode&&v(this,ft,this.parentNode.name),this.setAttribute("name",this.firstChild.toString(!0).trim().toLowerCase()),super.afterBuild()}toString(e){let[t="",n=""]=u(this,$e);return u(this,Y)?super.toString(e,u(this,Y)+t)+n:this.firstChild.toString(e)}text(){return u(this,Y)?`${super.text(`${u(this,Y).trim()}"`)}"`:this.firstChild.text()}getGaps(){var e,t;return u(this,Y)?u(this,Y).length+((t=(e=u(this,$e)[0])==null?void 0:e.length)!=null?t:0):0}lint(e=this.getAbsoluteIndex(),t){var k;let n=super.lint(e,t),{balanced:i,firstChild:s,lastChild:o,type:a,name:p,tag:g}=this,l=this.getValue(),c=new E(this,e);if(!i){let x=C(o,c,"unclosed-quote",f.msg("unclosed $1","quotes"),"warning");x.startIndex--,x.startCol--;let A={range:[x.endIndex,x.endIndex],text:u(this,$e)[0]};o.childNodes.some(({type:S,data:$})=>S==="text"&&/\s/u.test($))?x.suggestions=[{desc:"close",...A}]:x.fix=A,n.push(x)}let h=ki[g],m=yi[g];if(!(h!=null&&h.has(p))&&!(m!=null&&m.has(p))&&(a==="ext-attr"?h||m:!/\{\{[^{]+\}\}/u.test(p))&&(a==="ext-attr"&&!m||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(p)&&(g==="meta"||g==="link"||!Ti.has(p))))n.push(C(s,c,"illegal-attr","illegal attribute name"));else if((k=vi[g])!=null&&k.has(p))n.push(C(s,c,"obsolete-attr","obsolete attribute","warning"));else if(p==="style"&&typeof l=="string"&&vo.test(l))n.push(C(o,c,"insecure-style","insecure style"));else if(p==="tabindex"&&typeof l=="string"&&l!=="0"){let x=C(o,c,"illegal-attr","nonzero tabindex");x.suggestions=[{desc:"remove",range:[e,x.endIndex],text:""},{desc:"0 tabindex",range:[x.startIndex,x.endIndex],text:"0"}],n.push(x)}return n}getValue(){return u(this,Y)?this.lastChild.text().trim():this.type==="ext-attr"||""}print(){let[e="",t=""]=u(this,$e);return u(this,Y)?super.print({sep:dt(u(this,Y))+e,post:t}):super.print()}};Ht=new WeakMap,ft=new WeakMap,Y=new WeakMap,$e=new WeakMap});var Si,Ao,Vt,Ge,xr=b(()=>{"use strict";_();K();Q();F();P();Ee();wi();Si=d=>d.slice(0,-1),Ao=d=>`${Si(d)}-dirty`,Ge=class extends y{constructor(e,t,n,i=f.getConfig(),s=[]){super(void 0,i,s,{});T(this,Vt);if(v(this,Vt,t),this.setAttribute("name",n),e){let o=/([^\s/](?:(?!\0\d+~\x7F)[^\s/=])*)(?:((?:\s(?:\s|\0\d+[cn]\x7F)*)?(?:=|\0\d+~\x7F)(?:\s|\0\d+[cn]\x7F)*)(?:(["'])(.*?)(\3|$)|(\S*)))?/gsu,a="",p=o.exec(e),g=0,l=()=>{a&&(super.insertAt(new G(a,Ao(t),i,s,{})),a="")};for(;p;){let{index:c,0:h,1:m,2:k,3:x,4:A,5:S,6:$}=p;if(a+=e.slice(g,c),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(te(m).trim())){let w=A!=null?A:$,L=[x,S],B=new xt(Si(t),n,m,k,w,L,i,s);l(),super.insertAt(B)}else a+=h;({lastIndex:g}=o),p=o.exec(e)}a+=e.slice(g),l()}}get type(){return u(this,Vt)}afterBuild(){let{parentNode:e}=this;(e==null?void 0:e.type)==="td"&&e.subtype==="caption"&&this.setAttribute("name","caption"),super.afterBuild()}getAttrTokens(e){return this.childNodes.filter(t=>t instanceof xt&&(!e||t.name===e.toLowerCase().trim()))}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 n=super.lint(e,t),{parentNode:i,childNodes:s}=this,o=new Map,a=new Set,p=new E(this,e);if((i==null?void 0:i.type)==="html"&&i.closing&&this.text().trim()){let g=N(this,p,"no-ignored","attributes of a closing tag");g.fix={range:[e,g.endIndex],text:""},n.push(g)}for(let g of s)if(g instanceof xt){let{name:l}=g;o.has(l)?(a.add(l),o.get(l).push(g)):o.set(l,[g])}else{let l=g.text().trim();if(l){let c=C(g,p,"no-ignored","containing invalid attribute",/[\p{L}\d]/u.test(l)?"error":"warning");c.suggestions=[{desc:"remove",range:[c.startIndex,c.endIndex],text:" "}],n.push(c)}}if(a.size>0)for(let g of a)n.push(...o.get(g).map(l=>C(l,p,"no-duplicate",f.msg("duplicated $1 attribute",g))));return n}print(){return this.toString()?`<span class="wpb-${this.type}">${this.childNodes.map(e=>e.print(e instanceof G?{class:e.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}};Vt=new WeakMap});var br,Ci=b(()=>{"use strict";Se();F();P();_e();br=class extends y{get type(){return"ext-inner"}constructor(r,e=f.getConfig(),t=[]){if(r){let n=/<nowiki>/giu,i=/<\/nowiki>/giu,{length:s}=n.source,o=n.exec(r);o&&(i.lastIndex=o.index+s);let a=i.exec(r),p=0,g="";for(;o&&a;)new U(o[0],e,t),new U(a[0],e,t),g+=`${r.slice(p,o.index)}\0${t.length-1}n\x7F${r.slice(o.index+s,a.index)}\0${t.length}n\x7F`,p=a.index+s+1,n.lastIndex=p,o=n.exec(r),o&&(i.lastIndex=o.index+s),a=i.exec(r);r=g+r.slice(p)}super(r,e,t,{}),this.setAttribute("stage",10)}getAttribute(r){return r==="plain"||super.getAttribute(r)}lint(r=this.getAbsoluteIndex()){return super.lint(r,/<\s*\/\s*(pre)\b/giu)}}});var bt,ln=b(()=>{"use strict";_();Q();Xt();F();P();Ee();bt=class extends y{get type(){return"ext-inner"}constructor(r,e,t=f.getConfig(),n=[],i){if(super(void 0,t,n,{}),e){let s=G;this.append(...e.split(`
|
|
4
|
-
`).map(o=>i?o:Ze(o,t,n,r)).map(o=>new s(o,"param-line",t,n,{})))}n.splice(n.indexOf(this),1),n.push(this)}toString(r){return super.toString(r,`
|
|
1
|
+
"use strict";(()=>{var zn=Object.create;var De=Object.defineProperty;var Wn=Object.getOwnPropertyDescriptor;var co=Object.getOwnPropertyNames;var ho=Object.getPrototypeOf,mo=Object.prototype.hasOwnProperty;var Un=(a,r)=>(r=Symbol[a])?r:Symbol.for("Symbol."+a),dt=a=>{throw TypeError(a)};var fo=(a,r,e)=>r in a?De(a,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[r]=e;var Gn=(a,r)=>De(a,"name",{value:r,configurable:!0});var b=(a,r)=>()=>(a&&(r=a(a=0)),r);var Dn=(a,r)=>()=>(r||a((r={exports:{}}).exports,r),r.exports),se=(a,r)=>{for(var e in r)De(a,e,{get:r[e],enumerable:!0})},Hn=(a,r,e,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of co(r))!mo.call(a,n)&&n!==e&&De(a,n,{get:()=>r[n],enumerable:!(t=Wn(r,n))||t.enumerable});return a};var xo=(a,r,e)=>(e=a!=null?zn(ho(a)):{},Hn(r||!a||!a.__esModule?De(e,"default",{value:a,enumerable:!0}):e,a)),Z=a=>Hn(De({},"__esModule",{value:!0}),a);var le=a=>{var r;return[,,,zn((r=a==null?void 0:a[Un("metadata")])!=null?r:null)]},Vn=["class","method","getter","setter","accessor","field","value","get","set"],Ot=a=>a!==void 0&&typeof a!="function"?dt("Function expected"):a,bo=(a,r,e,t,n)=>({kind:Vn[a],name:r,metadata:t,addInitializer:i=>e._?dt("Already initialized"):n.push(Ot(i||null))}),de=(a,r,e,t)=>{for(var n=0,i=a[r>>1],s=i&&i.length;n<s;n++)r&1?i[n].call(e):t=i[n].call(e,t);return t},ge=(a,r,e,t,n,i)=>{var s,o,l,p,g,d=r&7,c=!!(r&8),h=!!(r&16),m=d>3?a.length+1:d?c?1:2:0,k=Vn[d+5],x=d>3&&(a[m-1]=[]),A=a[m]||(a[m]=[]),S=d&&(!h&&!c&&(n=n.prototype),d<5&&(d>3||!h)&&Wn(d<4?n:{get[e](){return u(this,i)},set[e](w){return v(this,i,w)}},e));d?h&&d<4&&Gn(i,(d>2?"set ":d>1?"get ":"")+e):Gn(n,e);for(var $=t.length-1;$>=0;$--)p=bo(d,e,l={},a[3],A),d&&(p.static=c,p.private=h,g=p.access={has:h?w=>To(n,w):w=>e in w},d^3&&(g.get=h?w=>(d^1?u:R)(w,n,d^4?i:S.get):w=>w[e]),d>2&&(g.set=h?(w,L)=>v(w,n,L,d^4?i:S.set):(w,L)=>w[e]=L)),o=(0,t[$])(d?d<4?h?i:S[k]:d>4?void 0:{get:S.get,set:S.set}:n,p),l._=1,d^4||o===void 0?Ot(o)&&(d>4?x.unshift(o):d?h?i=o:S[k]=o:n=o):typeof o!="object"||o===null?dt("Object expected"):(Ot(s=o.get)&&(S.get=s),Ot(s=o.set)&&(S.set=s),Ot(s=o.init)&&x.unshift(s));return d||(n[Un("metadata")]=a[3]),S&&De(n,e,S),h?d^4?i:S:n},X=(a,r,e)=>fo(a,typeof r!="symbol"?r+"":r,e),Qr=(a,r,e)=>r.has(a)||dt("Cannot "+e),To=(a,r)=>Object(r)!==r?dt('Cannot use the "in" operator on this value'):a.has(r),u=(a,r,e)=>(Qr(a,r,"read from private field"),e?e.call(a):r.get(a)),T=(a,r,e)=>r.has(a)?dt("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(a):r.set(a,e),v=(a,r,e,t)=>(Qr(a,r,"write to private field"),t?t.call(a,e):r.set(a,e),e),R=(a,r,e)=>(Qr(a,r,"access private method"),e);var dr=(a,r,e,t)=>({set _(n){v(a,r,n,e)},get _(){return u(a,r,t)}});var Zr,Xn,Qn=b(()=>{"use strict";Zr={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};Object.setPrototypeOf(Zr,null);Xn=["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"]});var ni=Dn((Ea,ri)=>{"use strict";var Kr=Object.defineProperty,yo=Object.getOwnPropertyDescriptor,ko=Object.getOwnPropertyNames,vo=Object.prototype.hasOwnProperty,Ao=(a,r)=>{for(var e in r)Kr(a,e,{get:r[e],enumerable:!0})},wo=(a,r,e,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of ko(r))!vo.call(a,n)&&n!==e&&Kr(a,n,{get:()=>r[n],enumerable:!(t=yo(r,n))||t.enumerable});return a},So=a=>wo(Kr({},"__esModule",{value:!0}),a),Jn={};Ao(Jn,{CDN:()=>Kn,getObject:()=>Ro,loadScript:()=>Fo,normalizeTitle:()=>Eo,numToHex:()=>Lo,parseVersion:()=>Bo,rawurldecode:()=>ti,setObject:()=>Po,splitColors:()=>Io});ri.exports=So(Jn);var Kn="https://testingcf.jsdelivr.net",Yn=String.raw`#(?:[\da-f]{3,4}|(?:[\da-f]{2}){3,4})(?![\p{L}\d_])`,Be=String.raw`(?:\d*\.)?\d+%?`,Zn=String.raw`(?:\d*\.)?\d+(?:deg|grad|rad|turn)?`,ei=String.raw`rgba?\(\s*(?:${String.raw`${new Array(3).fill(Be).join(String.raw`\s+`)}(?:\s*\/\s*${Be})?`}|${String.raw`${new Array(3).fill(Be).join(String.raw`\s*,\s*`)}(?:\s*,\s*${Be})?`})\s*\)`,Co=String.raw`hsla?\(\s*(?:${String.raw`${Zn}\s+${Be}\s+${Be}(?:\s*\/\s*${Be})?`}|${String.raw`${Zn}${String.raw`\s*,\s*(?:\d*\.)?\d+%`.repeat(2)}(?:\s*,\s*${Be})?`})\s*\)`,$o=new RegExp(String.raw`(^|[^\p{L}\d_])(${Yn}|${ei}|${Co})`,"giu"),No=new RegExp(String.raw`(^|[^\p{L}\d_])(${Yn}|${ei})`,"giu"),Jr;typeof document=="object"&&(Jr=document.createElement("span"));var ti=a=>decodeURIComponent(a.replace(/%(?![\da-f]{2})/giu,"%25")),Eo=a=>{let r=ti(a);return/[<>[\]|{}]/u.test(r)?r:(Jr.innerHTML=r,Jr.textContent)},Lo=a=>Math.round(a*255).toString(16).padStart(2,"0"),Io=(a,r=!0)=>{let e=[],t=r?$o:No;t.lastIndex=0;let n=t.exec(a),i=0;for(;n;){let s=n.index+n[1].length;s>i&&e.push([a.slice(i,s),i,s,!1]),{lastIndex:i}=t,e.push([n[2],s,i,!0]),n=t.exec(a)}return a.length>i&&e.push([a.slice(i),i,a.length,!1]),e},Fo=(a,r,e)=>new Promise(t=>{let n=`${Kn}/${a}`,i=window;for(let s of r.split("."))i=i==null?void 0:i[s];if(i)t();else if(e&&typeof define=="function"&&"amd"in define){let s=window.require;s.config({paths:{[r]:n}}),s([r],o=>{Object.assign(window,{[r]:o}),t()})}else{let s=document.createElement("script");s.src=n,s.onload=()=>{t()},document.head.append(s)}}),Ro=a=>JSON.parse(String(localStorage.getItem(a))),Po=(a,r)=>{localStorage.setItem(a,JSON.stringify(r))},Bo=a=>a.split(".",3).map(Number)});var gr,ii,Ae,we,He,si,te,oi,pe,jo,Mt,ai,li,qo,_o,gt,Ne,J=b(()=>{"use strict";gr=xo(ni()),ii=String.raw`[^[\]<>"\0-\x1F\x7F\p{Zs}\uFFFD]`,Ae=String.raw`(?:\[[\da-f:.]+\]|${ii})`,we=String.raw`(?:${ii}|\0\d+[cn!~]\x7F)*`,He=(a,r)=>e=>e.replace(a,r),si=He(/[\0\x7F]|\r$/gmu,""),te=He(/\0\d+[cn]\x7F/gu,""),oi=He(/[\\{}()|.?*+^$[\]]/gu,String.raw`\$&`),pe=(a,r="")=>a.map(e=>typeof e=="string"?e:e.text()).join(r),jo={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},Mt=He(/&(?:#(\d+|[Xx][\da-fA-F]+)|([lLgG][tT]|[lr]brac[ke]|nbsp|amp|AMP|quot|QUOT));/gu,(a,r,e)=>r?String.fromCodePoint(+((/^x/iu.test(r)?"0":"")+r)):jo[e.toLowerCase()]),ai=He(/&#(\d+|x[\da-f]+);/giu,(a,r)=>String.fromCodePoint(+((/^x/iu.test(r)?"0":"")+r))),li=He(/\n/gu,String.raw`\n`),qo={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},_o=a=>He(a,r=>`&${qo[r]};`),gt=_o(/[&<>]/gu),Ne=(a,r={})=>{let{pre:e="",post:t="",sep:n=""}=r;return e+a.map(i=>i.print()).join(n)+t}});var di=Dn((Ia,Oo)=>{Oo.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","828":"Module"},nsid:{file:6,category:14},parserFunction:[{"#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","#regex":"regex","#related":"related","#cscore":"cscore"},["!","=","#FORMAL","#timef","#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 Yr,Se=b(()=>{"use strict";Yr=di()});var Ve,E,Q=b(()=>{"use strict";E=class{constructor(r,e){T(this,Ve);X(this,"token");X(this,"start");this.token=r,this.start=e}get top(){var r;return(r=u(this,Ve))!=null||v(this,Ve,this.getPosition()),u(this,Ve).top}get left(){var r;return(r=u(this,Ve))!=null||v(this,Ve,this.getPosition()),u(this,Ve).left}getPosition(){return this.token.getRootNode().posFromIndex(this.start)}};Ve=new WeakMap});var gi,C,N,_=b(()=>{"use strict";Q();F();gi=a=>(r,e,t,n,i="error")=>{let{start:s}=e,{top:o,left:l}=e instanceof E?e:new E(r,s),{offsetHeight:p,offsetWidth:g}=r,{startIndex:d,startLine:c,startCol:h}=a(r,s,o,l);return{rule:t,message:f.msg(n),severity:i,startIndex:d,endIndex:d+r.toString().length,startLine:c,endLine:c+p-1,startCol:h,endCol:p===1?h+g:g}},C=gi((a,r,e,t)=>{let n=a.getRelativeIndex(),{top:i,left:s}=a.parentNode.posFromIndex(n);return{startIndex:r+n,startLine:e+i,startCol:i?s:t+s}}),N=gi((a,r,e,t)=>({startIndex:r,startLine:e,startCol:t}))});var pr,pi=b(()=>{"use strict";pr=(a,r,e)=>({type:t,name:n})=>a.split(",").some(i=>{let[s,...o]=i.trim().split("#");return(!s||s===t)&&o.every(l=>l===n)})});var ui,ci,Gt,zt,en,pt,tn=b(()=>{"use strict";ui=a=>{let r=a.split(`
|
|
2
|
+
`),e=r.length;return{height:e,width:r[e-1].length}},ci=(a,r)=>r.childNodes.slice(0,a).reduce((e,t,n)=>e+t.toString().length+r.getGaps(n),0)+r.getAttribute("padding"),pt=class{constructor(){T(this,zt);X(this,"childNodes",[]);T(this,Gt)}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get parentNode(){return u(this,Gt)}get nextSibling(){var e;let r=(e=this.parentNode)==null?void 0:e.childNodes;return r&&r[r.indexOf(this)+1]}get previousSibling(){var e;let r=(e=this.parentNode)==null?void 0:e.childNodes;return r&&r[r.indexOf(this)-1]}get offsetHeight(){return R(this,zt,en).call(this).height}get offsetWidth(){return R(this,zt,en).call(this).width}getAttribute(r){return r==="padding"?0:this[r]}setAttribute(r,e){r==="parentNode"?v(this,Gt,e):this[r]=e}getRootNode(){let{parentNode:r}=this;for(;r!=null&&r.parentNode;)({parentNode:r}=r);return r!=null?r:this}indexFromPos(r,e){let t=String(this).split(`
|
|
3
|
+
`);return r>=0&&e>=0&&r<=t.length-1&&e<=t[r].length?t.slice(0,r).reduce((n,i)=>n+i.length+1,0)+e:void 0}posFromIndex(r){let e=String(this);if(r>=-e.length&&r<=e.length){let{height:t,width:n}=ui(e.slice(0,r));return{top:t-1,left:n}}}getGaps(r){return 0}getRelativeIndex(r){if(r===void 0){let{parentNode:e}=this;return e?ci(e.childNodes.indexOf(this),e):0}return ci(r,this)}getAbsoluteIndex(){let{parentNode:r}=this;return r?r.getAbsoluteIndex()+this.getRelativeIndex():0}seal(r,e){Object.defineProperty(this,r,{enumerable:!e&&!!this[r],configurable:!0})}is(r){return this.type===r}};Gt=new WeakMap,zt=new WeakSet,en=function(){return ui(String(this))}});var je,rn,nn,ur,hi=b(()=>{"use strict";J();be();pi();tn();ur=class extends pt{constructor(){super(...arguments);T(this,je)}get length(){return this.childNodes.length}text(e){return pe(this.childNodes,e)}normalize(){let e=[...this.childNodes],t=n=>{e.splice(n,1)};for(let n=e.length-1;n>=0;n--){let{type:i,data:s}=e[n];i!=="text"||this.getGaps(n-1)||s===""&&t(n)}this.setAttribute("childNodes",e)}removeAt(e){return sn(this,e,1)[0]}insertAt(e,t=this.length){return sn(this,t,0,[e]),e}closest(e){let t=pr(e,this),{parentNode:n}=this;for(;n;){if(t(n))return n;({parentNode:n}=n)}}querySelector(e){let t=pr(e,this);return R(this,je,rn).call(this,t)}querySelectorAll(e){let t=pr(e,this);return R(this,je,nn).call(this,t)}append(...e){for(let t of e)this.insertAt(t)}replaceChildren(...e){for(let t=this.length-1;t>=0;t--)this.removeAt(t);this.append(...e)}setText(e,t=0){t+=t<0?this.length:0;let n=this.childNodes[t],{data:i}=n;return n.replaceData(e),i}toString(e,t=""){return this.childNodes.map(n=>n.toString(e)).join(t)}lint(e=this.getAbsoluteIndex(),t){let n=[];for(let i=0,s=e+this.getAttribute("padding");i<this.length;i++){let o=this.childNodes[i];n.push(...o.lint(s,t)),s+=o.toString().length+this.getGaps(i)}return n}print(e={}){let t=e.class;return this.toString()?`${t===""?"":`<span class="wpb-${t!=null?t:this.type}">`}${Ne(this.childNodes,e)}${t===""?"":"</span>"}`:""}json(e,t=this.getAbsoluteIndex()){let n={...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();n.childNodes.push(o.type==="text"?{data:o.data,range:[s,s+l]}:o.json(void 0,s)),s+=l+this.getGaps(i)}return n}};je=new WeakSet,rn=function(e){var t;for(let n of this.childNodes){if(n.type==="text")continue;if(e(n))return n;let i=R(t=n,je,rn).call(t,e);if(i)return i}},nn=function(e){var n;let t=[];for(let i of this.childNodes)i.type!=="text"&&(e(i)&&t.push(i),t.push(...R(n=i,je,nn).call(n,e)));return t}});var mi,Mo,Go,zo,Wo,Uo,Do,cr,fi,Wt,xi=b(()=>{"use strict";J();F();tn();mi=String.raw`<\s*(?:/\s*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+`,Mo=new RegExp(String.raw`${mi}|https?[:/]/+`,"giu"),Go=new RegExp(mi,"giu"),zo=new RegExp(String.raw`^https?://${Ae}${we}\.(?:gif|png|jpg|jpeg)$`,"iu"),Wo={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},Uo={"<":"tag-like","[":"lonely-bracket","{":"lonely-bracket","]":"lonely-bracket","}":"lonely-bracket",h:"lonely-http"},Do=["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"],Wt=class extends pt{constructor(e){super();T(this,cr);X(this,"data","");Object.defineProperties(this,{childNodes:{enumerable:!1,configurable:!1},data:{value:e}})}get type(){return"text"}toString(e){var t;return e&&!((t=this.parentNode)!=null&&t.getAttribute("built"))?te(this.data):this.data}text(){return this.data}lint(e=this.getAbsoluteIndex(),t){var B,j,q;if(t===!1)return[];let{data:n,parentNode:i,nextSibling:s,previousSibling:o}=this;if(!i)throw new Error("An isolated text node cannot be linted!");let{type:l,name:p,parentNode:g}=i,d=!1;if(l==="attr-value"){let{type:D,name:H,tag:ne}=g;if(D!=="ext-attr")d=!0;else if(ne==="choose"&&(H==="before"||H==="after"))return[]}if(t!=null||(t=l==="free-ext-link"||l==="ext-link-url"||l==="ext-link-text"||l==="image-parameter"&&p==="link"||d?Go:Mo),n.search(t)===-1)return[];t.lastIndex=0;let c=[],h=s==null?void 0:s.type,m=s==null?void 0:s.name,k=o==null?void 0:o.type,x=this.getRootNode(),{ext:A,html:S}=x.getAttribute("config"),{top:$,left:w}=x.posFromIndex(e),L=new Set(["onlyinclude","noinclude","includeonly",A,S,Do].flat(2));for(let D=t.exec(n);D;D=t.exec(n)){let[,H,ne]=D,{0:ee,index:W}=D;if(ne&&ne!=="]"){let{length:ae}=ne;W+=ae,ee=ee.slice(ae)}let{0:I,length:xe}=ee;if(I==="<"&&!L.has(H.toLowerCase())||I==="["&&l==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(n.slice(W+1))||s!=null&&s.is("ext")&&m==="nowiki"&&((B=s.innerText)!=null&&B.includes("]"))))continue;if(I==="]"&&(W||xe>1))t.lastIndex--;else if(I==="h"&&W===0&&l==="ext-link-text"&&zo.test(n))continue;let ke=e+W,Pe=ke+xe,ie=x.toString(),ve=ie[Pe],lt=ie[ke-1],Hr=xe>1&&!(I==="<"&&!/[\s/>]/u.test(ve!=null?ve:"")||d&&(I==="["||I==="]"))||I==="{"&&(ve===I||lt==="-")||I==="}"&&(lt===I||ve==="-")||I==="["&&(ve===I||l==="ext-link-text"||h==="free-ext-link"&&!n.slice(W+1).trim())||I==="]"&&(lt===I||k==="free-ext-link"&&!n.slice(0,W).includes("]"))?"error":"warning",Vr=I==="{"||I==="[";if(Hr==="warning"&&(Vr||(I==="]"||I==="}"))){let ae=Wo[I],Xr=Vr?n.slice(W+1):n.slice(0,W);if(I==="{"&&((j=ae.exec(Xr))==null?void 0:j[0])==="}"||I==="}"&&((q=ae.exec(Xr))==null?void 0:q[0])==="{")continue;if(!Xr.includes(I)){let Mn=Vr?"nextSibling":"previousSibling",Ue=this[Mn];for(;Ue&&(Ue.type!=="text"||!ae.test(Ue.data));)Ue=Ue[Mn];if(Ue&&ae.exec(Ue.data)[0]!==I)continue}}let lr=n.slice(0,W).split(`
|
|
4
|
+
`),qn=lr.length+$-1,_n=lr[lr.length-1],On=lr.length===1?w+_n.length:_n.length,_t={rule:Uo[I],message:f.msg('lonely "$1"',I==="h"?ee:I),severity:Hr,startIndex:ke,endIndex:Pe,startLine:qn,endLine:qn,startCol:On,endCol:On+xe};if(I==="<")_t.suggestions=[{desc:"escape",range:[ke,ke+1],text:"<"}];else if(I==="h"&&!(l==="ext-link-text"||l==="link-text")&&/[\p{L}\d_]/u.test(lt||""))_t.suggestions=[{desc:"whitespace",range:[ke,ke],text:" "}];else if(I==="["&&l==="ext-link-text"){let ae=i.getAbsoluteIndex()+i.toString().length;_t.suggestions=[{desc:"escape",range:[ae,ae+1],text:"]"}]}else if(I==="]"&&k==="free-ext-link"&&Hr==="error"){let ae=e-o.toString().length;_t.fix={range:[ae,ae],text:"["}}c.push(_t)}return c}replaceData(e){R(this,cr,fi).call(this,e)}print(){return gt(this.data)}};cr=new WeakSet,fi=function(e){this.setAttribute("data",e)}});var ue,Xe=b(()=>{"use strict";be();ue=(a=!0,r=!0)=>(e,t)=>{class n extends e{text(){return""}lint(s){return a?[]:super.lint(s)}}return hr(n,e),n}});var Ut,ce,ut=b(()=>{"use strict";P();ce=class extends y{constructor(e,t,n,i,s,o){super(e,i,s,o);T(this,Ut);v(this,Ut,n)}get type(){return u(this,Ut)}lint(e=this.getAbsoluteIndex()){return super.lint(e,!1)}};Ut=new WeakMap});var ct,G,Ee=b(()=>{"use strict";P();G=class extends y{constructor(e,t,n,i,s){super(e,n,i,s);T(this,ct);v(this,ct,t)}get type(){return u(this,ct)}set type(e){v(this,ct,e)}};ct=new WeakMap});var Ho,Qe,Te,qe,Ce,Ht=b(()=>{"use strict";_();Se();Q();F();P();Ee();Ho=a=>a==="redirect-target"||a==="link",Ce=class extends y{constructor(e,t,n=f.getConfig(),i=[],s="|"){super(void 0,n,i,{});T(this,Qe,!0);T(this,Te);T(this,qe);if(this.insertAt(new G(e,"link-target",n,i,{})),t!==void 0){let o=new y(t,n,i,{});o.type="link-text",o.setAttribute("stage",10),this.insertAt(o)}v(this,Te,s)}afterBuild(){v(this,qe,this.getTitle()),u(this,Te).includes("\0")&&v(this,Te,this.buildFromStr(u(this,Te),0)),this.setAttribute("name",u(this,qe).title),super.afterBuild()}setAttribute(e,t){e==="bracket"?v(this,Qe,t):e==="title"?v(this,qe,t):super.setAttribute(e,t)}toString(e){let t=super.toString(e,u(this,Te));return u(this,Qe)?`[[${t}]]`:t}text(){let e=super.text("|");return u(this,Qe)?`[[${e}]]`:e}getAttribute(e){return e==="title"?u(this,qe):e==="padding"?2:super.getAttribute(e)}getGaps(e){return e===0?u(this,Te).length:1}lint(e=this.getAbsoluteIndex(),t){let n=super.lint(e,t),{childNodes:[i,s],type:o}=this,{encoded:l,fragment:p}=u(this,qe),g=new E(this,e);if(i.childNodes.some(({type:d})=>d==="template")&&n.push(C(i,g,"unknown-page","template in an internal link target","warning")),l&&n.push(C(i,g,"url-encoding","unnecessary URL encoding in an internal link")),o==="link"||o==="category"){let d=s==null?void 0:s.childNodes.find(c=>c.type==="text"&&c.data.includes("|"));if(d){let c=C(s,g,"pipe-like",'additional "|" in the link text',"warning"),h=c.startIndex+d.getRelativeIndex();c.suggestions=[{desc:"escape",range:[h,h+d.data.length],text:d.data.replace(/\|/gu,"|")}],n.push(c)}}if(p!==void 0&&!Ho(o)){let d=C(i,g,"no-ignored","useless fragment"),c=i.childNodes.find(h=>h.type==="text"&&h.data.includes("#"));c&&(d.fix={range:[d.startIndex+c.getRelativeIndex()+c.data.indexOf("#"),d.endIndex],text:""}),n.push(d)}return n}getTitle(e){return this.normalizeTitle(this.firstChild.toString(!0),0,e,!0,!0)}print(){return super.print(u(this,Qe)?{pre:"[[",post:"]]",sep:u(this,Te)}:{sep:u(this,Te)})}};Qe=new WeakMap,Te=new WeakMap,qe=new WeakMap});var re,_e=b(()=>{"use strict";P();re=class extends y{get innerText(){return this.firstChild.data}constructor(r="",e,t){super(r,e,t)}}});var bi,on,Vo,U,Oe=b(()=>{"use strict";Xe();_e();bi=[ue()];U=class extends(Vo=re){get type(){return"noinclude"}toString(r){return r?"":super.toString()}};on=le(Vo),U=ge(on,0,"NoincludeToken",bi,U),de(on,1,U)});var mr,Ti=b(()=>{"use strict";_();F();Ht();Oe();mr=class extends Ce{get type(){return"redirect-target"}constructor(r,e,t=f.getConfig(),n=[]){super(r,void 0,t,n),e!==void 0&&this.insertAt(new U(e,t,n))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,!0,!0)}lint(r=this.getAbsoluteIndex()){let e=super.lint(r,!1);if(this.length===2){let t=C(this.lastChild,{start:r},"no-ignored","useless link text");t.startIndex--,t.startCol--,t.fix={range:[t.startIndex,t.endIndex],text:""},e.push(t)}return e}}});var yi,Me,ht,an,Xo,Ze,ki=b(()=>{"use strict";Xe();F();P();ut();Ti();yi=[ue(!1,!1)];Ze=class extends(Xo=y){constructor(e,t,n,i,s,o=f.getConfig(),l=[]){super(void 0,o,l);T(this,Me);T(this,ht);v(this,Me,e),v(this,ht,s);let p=new RegExp(String.raw`^(?:${o.redirection.join("|")})\s*(?::\s*)?$`,"iu");this.append(new ce(t,p,"redirect-syntax",o,l,{}),new mr(n,i==null?void 0:i.slice(1),o,l))}get type(){return"redirect"}getAttribute(e){return e==="padding"?u(this,Me).length:super.getAttribute(e)}toString(e){return u(this,Me)+super.toString(e)+u(this,ht)}lint(e=this.getAbsoluteIndex()){return this.lastChild.lint(e+u(this,Me).length+this.firstChild.toString().length)}print(){return super.print({pre:u(this,Me),post:u(this,ht)})}};an=le(Xo),Me=new WeakMap,ht=new WeakMap,Ze=ge(an,0,"RedirectToken",yi,Ze),de(an,1,Ze)});var vi={};se(vi,{parseRedirect:()=>Qo});var Qo,Ai=b(()=>{"use strict";F();ki();Qo=(a,r,e)=>{var n;(n=r.regexRedirect)!=null||(r.regexRedirect=new RegExp(String.raw`^(\s*)((?:${r.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));let t=r.regexRedirect.exec(a);return t&&f.normalizeTitle(t[3],0,!1,r,!0,!0).valid?(a=`\0${e.length}o\x7F${a.slice(t[0].length)}`,new Ze(...t.slice(1),r,e),a):!1}});var fr,wi=b(()=>{"use strict";P();fr=class extends y{get type(){return"onlyinclude"}toString(r){return`<onlyinclude>${super.toString(r)}</onlyinclude>`}getAttribute(r){return r==="padding"?13:r==="plain"||super.getAttribute(r)}print(){return super.print({pre:'<span class="wpb-ext"><onlyinclude></span>',post:'<span class="wpb-ext"></onlyinclude></span>'})}}});var Ge,mt,ln=b(()=>{"use strict";P();mt=class extends y{constructor(e,t,n,i,s,o=[]){super(void 0,s);T(this,Ge);X(this,"closed");X(this,"selfClosing");this.setAttribute("name",e.toLowerCase()),v(this,Ge,[e,i||e]),this.closed=i!=="",this.selfClosing=i===void 0,this.append(t,n);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:n,lastChild:i}=this,[s,o]=u(this,Ge);return t?`<${s}${n.toString(e)}/>`:`<${s}${n.toString(e)}>${i.toString(e)}${this.closed?`</${o}>`:""}`}text(){let[e,t]=u(this,Ge);return this.selfClosing?`<${e}${this.firstChild.text()}/>`:`<${e}${super.text(">")}${this.closed?`</${t}>`:""}`}getAttribute(e){return e==="padding"?u(this,Ge)[0].length+1:super.getAttribute(e)}getGaps(){return 1}print(){let[e,t]=u(this,Ge);return super.print(this.selfClosing?{pre:`<${e}`,post:"/>"}:{pre:`<${e}`,sep:">",post:this.closed?`</${t}>`:""})}};Ge=new WeakMap});var Si,dn,Zo,Je,Ci=b(()=>{"use strict";_();Q();Xe();F();ln();Si=[ue(!1)];Je=class extends(Zo=mt){get type(){return"include"}constructor(r,e="",t,n,i,s){super(r,e,t!=null?t:"",t===void 0||n!=null?n:"",i,s)}toString(r){return r?"":super.toString()}lint(r=this.getAbsoluteIndex()){let e=[],{firstChild:t,closed:n,name:i}=this,s=new E(this,r);if(t.data.trim()){let o=C(t,s,"no-ignored","useless attribute","warning");o.suggestions=[{desc:"remove",range:[o.startIndex,o.endIndex],text:""}],e.push(o)}if(!n){let o=N(this,s,"unclosed-comment",f.msg("unclosed $1",`<${i}>`));o.suggestions=[{desc:"close",range:[o.endIndex,o.endIndex],text:`</${i}>`}],e.push(o)}return e}};dn=le(Zo),Je=ge(dn,0,"IncludeToken",Si,Je),de(dn,1,Je)});var V,$i,Ni,br,gn,Ei,ft,Li,Ii,Fi,xr,Ri,Pi,Bi,ji,qi=b(()=>{"use strict";V=new Set(["align"]),$i=new Set(["cite"]),Ni=new Set(["cite","datetime"]),br=new Set(["width"]),gn=new Set(["axis","align","bgcolor","height","width","valign"]),Ei=new Set([...gn,"abbr","headers","scope","rowspan","colspan"]),ft=new Set(["type"]),Li=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),Ii=new Set(["clear"]),Fi=new Set(["bgcolor","align","valign"]),xr=new Set,Ri=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"]),Pi={div:V,h1:V,h2:V,h3:V,h4:V,h5:V,h6:V,blockquote:$i,q:$i,p:V,br:Ii,pre:br,ins:Ni,del:Ni,ul:ft,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...Li,"border"]),caption:V,tr:Fi,td:Ei,th:Ei,img:new Set(["alt","src","width","height","srcset"]),font:new Set(["size","color","face"]),hr:br,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:ft,poem:V,categorytree:V,combooption:V},Bi={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:xr,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:xr,inputbox:xr,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:xr,poll:new Set(["id","show-results-before-voting"]),sm2:ft,flashmp3:ft,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"])},ji={table:Li,td:new Set([...gn,"scope"]),th:gn,br:Ii,caption:V,div:V,hr:br,h1:V,h2:V,h3:V,h4:V,h5:V,h6:V,li:ft,p:V,pre:br,tr:Fi,ul:ft}});var Jo,Vt,xt,Y,$e,bt,_i=b(()=>{"use strict";_();J();Se();qi();Q();F();P();Ee();Jo=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,bt=class extends y{constructor(e,t,n,i="",s,o=[],l=f.getConfig(),p=[]){let g=new G(n,"attr-key",l,p),d;if(n==="title"||t==="img"&&n==="alt")d=new y(s,l,p,{}),d.type="attr-value",d.setAttribute("stage",10);else if(t==="gallery"&&n==="caption"||t==="choose"&&(n==="before"||n==="after")){let c={...l,excludes:[...l.excludes,"heading","html","table","hr","list"]};d=new y(s,c,p,{}),d.type="attr-value",d.setAttribute("stage",1)}else d=new G(s,"attr-value",l,p,{});super(void 0,l,p);T(this,Vt);T(this,xt);T(this,Y);T(this,$e);v(this,Vt,e),this.append(g,d),v(this,Y,i),v(this,$e,[...o]),v(this,xt,t),this.setAttribute("name",te(n).trim().toLowerCase())}get type(){return u(this,Vt)}get tag(){return u(this,xt)}get balanced(){return!u(this,Y)||u(this,$e)[0]===u(this,$e)[1]}afterBuild(){u(this,Y).includes("\0")&&v(this,Y,this.buildFromStr(u(this,Y),0)),this.parentNode&&v(this,xt,this.parentNode.name),this.setAttribute("name",this.firstChild.toString(!0).trim().toLowerCase()),super.afterBuild()}toString(e){let[t="",n=""]=u(this,$e);return u(this,Y)?super.toString(e,u(this,Y)+t)+n:this.firstChild.toString(e)}text(){return u(this,Y)?`${super.text(`${u(this,Y).trim()}"`)}"`:this.firstChild.text()}getGaps(){var e,t;return u(this,Y)?u(this,Y).length+((t=(e=u(this,$e)[0])==null?void 0:e.length)!=null?t:0):0}lint(e=this.getAbsoluteIndex(),t){var k;let n=super.lint(e,t),{balanced:i,firstChild:s,lastChild:o,type:l,name:p,tag:g}=this,d=this.getValue(),c=new E(this,e);if(!i){let x=C(o,c,"unclosed-quote",f.msg("unclosed $1","quotes"),"warning");x.startIndex--,x.startCol--;let A={range:[x.endIndex,x.endIndex],text:u(this,$e)[0]};o.childNodes.some(({type:S,data:$})=>S==="text"&&/\s/u.test($))?x.suggestions=[{desc:"close",...A}]:x.fix=A,n.push(x)}let h=Bi[g],m=Pi[g];if(!(h!=null&&h.has(p))&&!(m!=null&&m.has(p))&&(l==="ext-attr"?h||m:!/\{\{[^{]+\}\}/u.test(p))&&(l==="ext-attr"&&!m||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(p)&&(g==="meta"||g==="link"||!Ri.has(p))))n.push(C(s,c,"illegal-attr","illegal attribute name"));else if((k=ji[g])!=null&&k.has(p))n.push(C(s,c,"obsolete-attr","obsolete attribute","warning"));else if(p==="style"&&typeof d=="string"&&Jo.test(d))n.push(C(o,c,"insecure-style","insecure style"));else if(p==="tabindex"&&typeof d=="string"&&d!=="0"){let x=C(o,c,"illegal-attr","nonzero tabindex");x.suggestions=[{desc:"remove",range:[e,x.endIndex],text:""},{desc:"0 tabindex",range:[x.startIndex,x.endIndex],text:"0"}],n.push(x)}return n}getValue(){return u(this,Y)?this.lastChild.text().trim():this.type==="ext-attr"||""}print(){let[e="",t=""]=u(this,$e);return u(this,Y)?super.print({sep:gt(u(this,Y))+e,post:t}):super.print()}};Vt=new WeakMap,xt=new WeakMap,Y=new WeakMap,$e=new WeakMap});var Oi,Ko,Xt,ze,Tr=b(()=>{"use strict";_();J();Q();F();P();Ee();_i();Oi=a=>a.slice(0,-1),Ko=a=>`${Oi(a)}-dirty`,ze=class extends y{constructor(e,t,n,i=f.getConfig(),s=[]){super(void 0,i,s,{});T(this,Xt);if(v(this,Xt,t),this.setAttribute("name",n),e){let o=/([^\s/](?:(?!\0\d+~\x7F)[^\s/=])*)(?:((?:\s(?:\s|\0\d+[cn]\x7F)*)?(?:=|\0\d+~\x7F)(?:\s|\0\d+[cn]\x7F)*)(?:(["'])(.*?)(\3|$)|(\S*)))?/gsu,l="",p=o.exec(e),g=0,d=()=>{l&&(super.insertAt(new G(l,Ko(t),i,s,{})),l="")};for(;p;){let{index:c,0:h,1:m,2:k,3:x,4:A,5:S,6:$}=p;if(l+=e.slice(g,c),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(te(m).trim())){let w=A!=null?A:$,L=[x,S],B=new bt(Oi(t),n,m,k,w,L,i,s);d(),super.insertAt(B)}else l+=h;({lastIndex:g}=o),p=o.exec(e)}l+=e.slice(g),d()}}get type(){return u(this,Xt)}afterBuild(){let{parentNode:e}=this;(e==null?void 0:e.type)==="td"&&e.subtype==="caption"&&this.setAttribute("name","caption"),super.afterBuild()}getAttrTokens(e){return this.childNodes.filter(t=>t instanceof bt&&(!e||t.name===e.toLowerCase().trim()))}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 n=super.lint(e,t),{parentNode:i,childNodes:s}=this,o=new Map,l=new Set,p=new E(this,e);if((i==null?void 0:i.type)==="html"&&i.closing&&this.text().trim()){let g=N(this,p,"no-ignored","attributes of a closing tag");g.fix={range:[e,g.endIndex],text:""},n.push(g)}for(let g of s)if(g instanceof bt){let{name:d}=g;o.has(d)?(l.add(d),o.get(d).push(g)):o.set(d,[g])}else{let d=g.text().trim();if(d){let c=C(g,p,"no-ignored","containing invalid attribute",/[\p{L}\d]/u.test(d)?"error":"warning");c.suggestions=[{desc:"remove",range:[c.startIndex,c.endIndex],text:" "}],n.push(c)}}if(l.size>0)for(let g of l)n.push(...o.get(g).map(d=>C(d,p,"no-duplicate",f.msg("duplicated $1 attribute",g))));return n}print(){return this.toString()?`<span class="wpb-${this.type}">${this.childNodes.map(e=>e.print(e instanceof G?{class:e.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}};Xt=new WeakMap});var yr,Mi=b(()=>{"use strict";Se();F();P();Oe();yr=class extends y{get type(){return"ext-inner"}constructor(r,e=f.getConfig(),t=[]){if(r){let n=/<nowiki>/giu,i=/<\/nowiki>/giu,{length:s}=n.source,o=n.exec(r);o&&(i.lastIndex=o.index+s);let l=i.exec(r),p=0,g="";for(;o&&l;)new U(o[0],e,t),new U(l[0],e,t),g+=`${r.slice(p,o.index)}\0${t.length-1}n\x7F${r.slice(o.index+s,l.index)}\0${t.length}n\x7F`,p=l.index+s+1,n.lastIndex=p,o=n.exec(r),o&&(i.lastIndex=o.index+s),l=i.exec(r);r=g+r.slice(p)}super(r,e,t,{}),this.setAttribute("stage",10)}getAttribute(r){return r==="plain"||super.getAttribute(r)}lint(r=this.getAbsoluteIndex()){return super.lint(r,/<\s*\/\s*(pre)\b/giu)}}});var Tt,pn=b(()=>{"use strict";_();Q();Qt();F();P();Ee();Tt=class extends y{get type(){return"ext-inner"}constructor(r,e,t=f.getConfig(),n=[],i){if(super(void 0,t,n,{}),e){let s=G;this.append(...e.split(`
|
|
5
|
+
`).map(o=>i?o:Ke(o,t,n,r)).map(o=>new s(o,"param-line",t,n,{})))}n.splice(n.indexOf(this),1),n.push(this)}toString(r){return super.toString(r,`
|
|
5
6
|
`)}text(){return super.text(`
|
|
6
|
-
`)}getGaps(){return 1}lint(r=this.getAbsoluteIndex()){let e=new E(this,r),t=f.msg("invalid parameter of <$1>",this.name),n=[];for(let i of this.childNodes){let s=i.childNodes.filter(({type:o})=>o!=="comment"&&o!=="include"&&o!=="noinclude");if(s.some(({type:o})=>o==="ext"))n.push(C(i,e,"no-ignored",t));else{let o=s.findIndex(({type:p})=>p!=="text"),
|
|
7
|
-
`})}}});var Qt,Tt,Tr,yt,dn=b(()=>{"use strict";_();be();Q();F();P();pt();yt=class extends y{constructor(e,t,n=f.getConfig(),i=[]){super(void 0,n,i);T(this,Tt);T(this,Qt);v(this,Qt,e);let s=new y(t[0],n,i);s.type="heading-title",s.setAttribute("stage",2);let o=new ce(t[1],/^\s*$/u,"heading-trail",n,i,{});this.append(s,o)}get type(){return"heading"}get level(){return u(this,Qt)}toString(e){let t=u(this,Tt,Tr);return t+this.firstChild.toString(e)+t+this.lastChild.toString(e)}text(){let e=u(this,Tt,Tr);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 n=super.lint(e,t),{firstChild:i,level:s}=this,o=i.toString(),a=i.childNodes.filter(kt("quote")),p=a.filter(({bold:c})=>c),g=a.filter(({italic:c})=>c),l=new E(this,e);return this.level===1&&n.push(C(i,l,"h1","<h1>")),(o.startsWith("=")||o.endsWith("="))&&n.push(C(i,l,"unbalanced-header",f.msg("unbalanced $1 in a section header",'"="'))),this.closest("html-attrs,table-attrs")&&n.push(N(this,l,"parsing-order","section header in a HTML tag")),p.length%2&&n.push(C(p[p.length-1],{...l,start:e+s,left:l.left+s},"format-leakage",f.msg("unbalanced $1 in a section header","bold apostrophes"))),g.length%2&&n.push(C(g[g.length-1],{start:e+s},"format-leakage",f.msg("unbalanced $1 in a section header","italic apostrophes"))),n}print(){let e=u(this,Tt,Tr);return super.print({pre:e,sep:e})}json(){let e=super.json();return e.level=this.level,e}};Qt=new WeakMap,Tt=new WeakSet,Tr=function(){return"=".repeat(this.level)}});var wo,yr,$i=b(()=>{"use strict";K();_();F();P();wo=new RegExp(`https?://${Ae}${we}$`,"iu"),yr=class extends y{get type(){return"parameter"}get anon(){return this.firstChild.length===0}constructor(r,e,t=f.getConfig(),n=[]){super(void 0,t,n);let i=new y(typeof r=="number"?void 0:r,t,n,{}),s=new y(e,t,n);i.type="parameter-key",i.setAttribute("stage",2),s.type="parameter-value",s.setAttribute("stage",2),this.append(i,s)}trimName(r,e=!0){let t=(typeof r=="string"?r:r.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:r,firstChild:e}=this,t=this.trimName(e);r&&r.getArgs(t,!1,!1).add(this)}super.afterBuild()}toString(r){return this.anon?this.lastChild.toString(r):super.toString(r,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(r=this.getAbsoluteIndex(),e){var s;let t=super.lint(r,e),{firstChild:n}=this,i=(s=wo.exec(n.text()))==null?void 0:s[0];if(i&&new URL(i).search){let o=C(n,{start:r},"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:"{{=}}"},t.push(o)}return t}print(){return super.print({sep:this.anon?"":"="})}json(){let r=super.json();return r.anon=this.anon,r}}});var So,Kt,Ke,Je,Ye,gn,Ni,Zt,Ei=b(()=>{"use strict";K();_();be();Se();Q();F();P();$i();Ee();pt();So=new Set(["pageid","articlepath","server","servername","scriptpath","stylepath"]),Zt=class extends y{constructor(e,t,n=f.getConfig(),i=[]){var m,k;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\x7F`,i[s].toString().replace(/^\n/u,"")));super(void 0,n,i,{});T(this,Ye);X(this,"modifier","");T(this,Kt,"template");T(this,Ke,!1);T(this,Je,new Map);let{parserFunction:[a,p]}=n,g=(m=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(e))==null?void 0:m[0];if(g)this.setAttribute("modifier",g),e=e.slice(g.length);else if(e.includes(":")){let[x,...A]=e.split(":"),[S]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((k=A[0])!=null?k:"");this.setModifier(`${x}:${S}`)&&(e=A.join(":").slice(S.length))}let l=e.includes(":");if(l||t.length===0&&!u(this,Ke)){let[x,...A]=e.split(":"),S=te(x),$=S[A.length>0?"trimStart":"trim"](),w=$.toLowerCase(),L=Object.prototype.hasOwnProperty.call(a,w)&&a[w],B=p.includes($);if(B||So.has(L)||l&&L){this.setAttribute("name",L||w),v(this,Kt,"magic-word");let q=new RegExp(String.raw`^\s*${$}\s*$`,B?"u":"iu"),D=new ce(x,q,"magic-word-name",n,i,{});if(super.insertAt(D),A.length>0&&t.unshift([A.join(":")]),this.name==="invoke")for(let H=0;H<2;H++){let ne=t.shift();if(!ne)break;let ee=new G(ne.join("="),`invoke-${H?"function":"module"}`,n,i);super.insertAt(ee)}}}if(this.type==="template"){let x=te(e).trim();if(!this.normalizeTitle(x,10,!0).valid)throw i.pop(),new SyntaxError("Invalid template name");let A=new G(e,"template-name",n,i,{});super.insertAt(A)}typeof s=="number"&&(i[s]=void 0);let c=this.isTemplate(),h=1;for(let[x,A]of t.entries())!c&&!(this.name==="switch"&&x>0)&&(A[0]=A.join("="),A.length=1),A.length===1&&(A.unshift(h),h++),this.insertAt(new yr(...A,n,i));this.seal("modifier")}get type(){return u(this,Kt)}setModifier(e){let{parserFunction:[,,t,n]}=this.getAttribute("config"),i=te(e).trim();if(e&&!i.endsWith(":"))return!1;let s=i.slice(0,-1).toLowerCase(),o=t.includes(s),a=n.includes(s);return u(this,Ke)&&o||!u(this,Ke)&&(a||e==="")||(ye.running||this.length>1)&&(o||a||e==="")?(this.setAttribute("modifier",e),v(this,Ke,o),!!e):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0)),super.afterBuild(),this.isTemplate()&&this.type==="template"&&this.setAttribute("name",R(this,Ye,gn).call(this).title)}toString(e){return`{{${this.modifier}${this.type==="magic-word"?`${this.firstChild.toString(e)}${this.length===1?"":":"}${this.childNodes.slice(1).map(t=>t.toString(e)).join("|")}`:super.toString(e,"|")}}}`}text(){let{childNodes:e,length:t,firstChild:n,modifier:i,type:s,name:o}=this;return s==="magic-word"&&o==="vardefine"?"":`{{${i}${s==="magic-word"?n.text()+(t===1?"":":")+pe(e.slice(1),"|"):super.text("|")}}}`}getAttribute(e){switch(e){case"padding":return this.modifier.length+2;default:return super.getAttribute(e)}}getGaps(){return 1}lint(e=this.getAbsoluteIndex(),t){let n=super.lint(e,t);if(!this.isTemplate())return n;let{type:i,childNodes:s,length:o}=this,a=new E(this,e),p=i==="magic-word";if(p&&!R(this,Ye,gn).call(this).valid)n.push(C(s[1],a,"invalid-invoke","illegal module name"));else{let l=s[p?1:0],c=l.childNodes.find(h=>h.type==="text"&&Ot(h.data).includes("#"));if(c){let h=C(l,a,"no-ignored","useless fragment");h.fix={range:[h.startIndex+c.getRelativeIndex()+c.data.indexOf("#"),h.endIndex],text:""},n.push(h)}}if(p&&o===2)return n.push(N(this,a,"invalid-invoke","missing module function")),n;let g=this.getDuplicatedArgs().filter(([,l])=>!l[0].querySelector("ext"));return g.length>0&&n.push(...g.flatMap(([,l])=>l).map(l=>C(l,a,"no-duplicate","duplicated parameter"))),n}insertAt(e,t=this.length){return super.insertAt(e,t),e.anon?R(this,Ye,Ni).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getAllArgs(){return this.childNodes.filter(kt("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:e})=>e)}getArgs(e,t,n=!0){let i=String(e).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),s;return u(this,Je).has(i)?s=u(this,Je).get(i):(s=new Set(this.getAllArgs().filter(({name:o})=>i===o)),u(this,Je).set(i,s)),s}getDuplicatedArgs(){return[...u(this,Je)].filter(([,{size:e}])=>e>1).map(([e,t])=>[e,[...t]])}getPossibleValues(){let{type:e,name:t,childNodes:n}=this;if(e==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let i;switch(t){case"if":case"ifexist":case"ifexpr":case"iferror":i=2;break;case"ifeq":i=3;break;default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}let s=n.slice(i,i+2).map(({childNodes:[,o]})=>o);for(let o=0;o<s.length;){let{length:a,0:p}=s[o].childNodes.filter(g=>g.text().trim());if(a===0)s.splice(o,1);else if(a>1||p.type!=="magic-word")o++;else try{let g=p.getPossibleValues();s.splice(o,1,...g),o+=g.length}catch(g){o++}}return s}print(){let{childNodes:e,length:t,firstChild:n,modifier:i,type:s}=this;return`<span class="wpb-${s}">{{${dt(i)}${s==="magic-word"?n.print()+(t===1?"":":")+Ne(e.slice(1),{sep:"|"}):Ne(e,{sep:"|"})}}}</span>`}};Kt=new WeakMap,Ke=new WeakMap,Je=new WeakMap,Ye=new WeakSet,gn=function(){let e=this.type==="template",t=this.childNodes[e?0:1];return this.normalizeTitle(t.toString(!0),e?10:828)},Ni=function(e){let t=this.getAnonArgs(),n=typeof e!="number";for(let i=n?t.indexOf(e):e-1;i<t.length;i++){let s=t[i],{name:o}=s,a=String(i+1);o!==a&&(s.setAttribute("name",a),this.getArgs(a,!1,!1).add(s))}}});var Li,pn,Co,et,Ii=b(()=>{"use strict";He();P();Li=[ue()];et=class extends(Co=y){get type(){return"hidden"}};pn=le(Co),et=ge(pn,0,"HiddenToken",Li,et),de(pn,1,et)});var vr,Fi,kr,Ri=b(()=>{"use strict";K();_();Q();F();P();Ee();Ii();kr=class extends y{constructor(e,t=f.getConfig(),n=[]){super(void 0,t,n,{});T(this,vr);for(let[i,s]of e.entries())if(i===0){let o=new G(s,"arg-name",t,n,{});super.insertAt(o)}else if(i>1){let o=new et(s,t,n);super.insertAt(o)}else{let o=new y(s,t,n);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`{{{${pe(this.childNodes.slice(0,2),"|")}}}}`}getAttribute(e){return e==="padding"?3:super.getAttribute(e)}getGaps(){return 1}afterBuild(){R(this,vr,Fi).call(this),super.afterBuild()}lint(e=this.getAbsoluteIndex(),t){let{childNodes:[n,i,...s]}=this;if(!this.getAttribute("include")){let a=N(this,{start:e},"no-arg","unexpected template argument");return i&&(a.fix={range:[e,a.endIndex],text:i.text()}),[a]}let o=n.lint(e+3,t);if(i&&o.push(...i.lint(e+4+n.toString().length,t)),s.length>0){let a=new E(this,e);o.push(...s.map(p=>{let g=C(p,a,"no-ignored","invisible content inside triple braces");return g.startIndex--,g.startCol--,g.suggestions=[{desc:"remove",range:[g.startIndex,g.endIndex],text:""},{desc:"escape",range:[g.startIndex,g.startIndex+1],text:"{{!}}"}],g}))}return o}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}};vr=new WeakSet,Fi=function(){this.setAttribute("name",this.firstChild.toString(!0).trim())}});var Pi={};se(Pi,{parseBraces:()=>Jt});var $o,un,No,Jt,Ar=b(()=>{"use strict";K();dn();Ei();Ri();$o={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},un=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),No=/\{\{\s*([^\s\0<>[\]{}|_#&%:.]+)\s*\}\}(?!\})/gu,Jt=(d,r,e)=>{var c,h,m,k,x,A;let t=String.raw`${(c=r.excludes)!=null&&c.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,n=String.raw`|\{{2,}`,{parserFunction:[,,,i]}=r,s=[];d=d.replace(No,(S,$)=>{var w;return new Zt(S.slice(2,-2),[],r,e),`\0${e.length-2}${(w=un.get($.toLowerCase()))!=null?w:"t"}\x7F`});let o=d.lastIndexOf("}}")-d.length,a=o+d.length!==-1,p=new RegExp(t+(a?n:""),"gmu"),g=p.exec(d),l;for(;g||l!==void 0&&l<=d.length&&((m=(h=s[s.length-1])==null?void 0:h[0])!=null&&m.startsWith("="));){if(g!=null&&g[1]){let[,{length:W}]=g;g[0]=g[0].slice(W),g.index+=W}let{0:S,index:$}=g!=null?g:{0:`
|
|
8
|
-
`,index:
|
|
9
|
-
`){
|
|
10
|
-
)`:""}(\s*)$`,"u")]),
|
|
11
|
-
`))!=null?i:[]){let o=/^([^|]+)(?:\|(.*))?/u.exec(s);if(!o){super.insertAt(s.trim()?new U(s,t,n):s);continue}let[,
|
|
7
|
+
`)}getGaps(){return 1}lint(r=this.getAbsoluteIndex()){let e=new E(this,r),t=f.msg("invalid parameter of <$1>",this.name),n=[];for(let i of this.childNodes){let s=i.childNodes.filter(({type:o})=>o!=="comment"&&o!=="include"&&o!=="noinclude");if(s.some(({type:o})=>o==="ext"))n.push(C(i,e,"no-ignored",t));else{let o=s.findIndex(({type:p})=>p!=="text"),l=s.slice(0,o>=0?o:void 0).map(String).join("");if(l&&!(o>=0?/^[a-z]+(?:\[\])?\s*(?:=|$)/iu:/^[a-z]+(?:\[\])?\s*=/iu).test(l)){let p=C(i,e,"no-ignored",t);p.suggestions=[{desc:"remove",range:[p.startIndex,p.endIndex],text:""}],n.push(p)}else n.push(...i.lint(r,!1))}r+=i.toString().length+1}return n}print(){return super.print({sep:`
|
|
8
|
+
`})}}});var Zt,yt,kr,kt,un=b(()=>{"use strict";_();be();Q();F();P();ut();kt=class extends y{constructor(e,t,n=f.getConfig(),i=[]){super(void 0,n,i);T(this,yt);T(this,Zt);v(this,Zt,e);let s=new y(t[0],n,i);s.type="heading-title",s.setAttribute("stage",2);let o=new ce(t[1],/^\s*$/u,"heading-trail",n,i,{});this.append(s,o)}get type(){return"heading"}get level(){return u(this,Zt)}toString(e){let t=u(this,yt,kr);return t+this.firstChild.toString(e)+t+this.lastChild.toString(e)}text(){let e=u(this,yt,kr);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 n=super.lint(e,t),{firstChild:i,level:s}=this,o=i.toString(),l=i.childNodes.filter(vt("quote")),p=l.filter(({bold:c})=>c),g=l.filter(({italic:c})=>c),d=new E(this,e);return this.level===1&&n.push(C(i,d,"h1","<h1>")),(o.startsWith("=")||o.endsWith("="))&&n.push(C(i,d,"unbalanced-header",f.msg("unbalanced $1 in a section header",'"="'))),this.closest("html-attrs,table-attrs")&&n.push(N(this,d,"parsing-order","section header in a HTML tag")),p.length%2&&n.push(C(p[p.length-1],{...d,start:e+s,left:d.left+s},"format-leakage",f.msg("unbalanced $1 in a section header","bold apostrophes"))),g.length%2&&n.push(C(g[g.length-1],{start:e+s},"format-leakage",f.msg("unbalanced $1 in a section header","italic apostrophes"))),n}print(){let e=u(this,yt,kr);return super.print({pre:e,sep:e})}json(){let e=super.json();return e.level=this.level,e}};Zt=new WeakMap,yt=new WeakSet,kr=function(){return"=".repeat(this.level)}});var Yo,vr,Gi=b(()=>{"use strict";J();_();F();P();Yo=new RegExp(`https?://${Ae}${we}$`,"iu"),vr=class extends y{get type(){return"parameter"}get anon(){return this.firstChild.length===0}constructor(r,e,t=f.getConfig(),n=[]){super(void 0,t,n);let i=new y(typeof r=="number"?void 0:r,t,n,{}),s=new y(e,t,n);i.type="parameter-key",i.setAttribute("stage",2),s.type="parameter-value",s.setAttribute("stage",2),this.append(i,s)}trimName(r,e=!0){let t=(typeof r=="string"?r:r.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:r,firstChild:e}=this,t=this.trimName(e);r&&r.getArgs(t,!1,!1).add(this)}super.afterBuild()}toString(r){return this.anon?this.lastChild.toString(r):super.toString(r,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(r=this.getAbsoluteIndex(),e){var s;let t=super.lint(r,e),{firstChild:n}=this,i=(s=Yo.exec(n.text()))==null?void 0:s[0];if(i&&new URL(i).search){let o=C(n,{start:r},"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:"{{=}}"},t.push(o)}return t}print(){return super.print({sep:this.anon?"":"="})}json(){let r=super.json();return r.anon=this.anon,r}}});var ea,Kt,Ye,et,tt,cn,zi,Jt,Wi=b(()=>{"use strict";J();_();be();Se();Q();F();P();Gi();Ee();ut();ea=new Set(["pageid","articlepath","server","servername","scriptpath","stylepath"]),Jt=class extends y{constructor(e,t,n=f.getConfig(),i=[]){var m,k;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\x7F`,i[s].toString().replace(/^\n/u,"")));super(void 0,n,i,{});T(this,tt);X(this,"modifier","");T(this,Kt,"template");T(this,Ye,!1);T(this,et,new Map);let{parserFunction:[l,p]}=n,g=(m=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(e))==null?void 0:m[0];if(g)this.setAttribute("modifier",g),e=e.slice(g.length);else if(e.includes(":")){let[x,...A]=e.split(":"),[S]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((k=A[0])!=null?k:"");this.setModifier(`${x}:${S}`)&&(e=A.join(":").slice(S.length))}let d=e.includes(":");if(d||t.length===0&&!u(this,Ye)){let[x,...A]=e.split(":"),S=te(x),$=S[A.length>0?"trimStart":"trim"](),w=$.toLowerCase(),L=Object.prototype.hasOwnProperty.call(l,w)&&l[w],B=p.includes($);if(B||ea.has(L)||d&&L){this.setAttribute("name",L||w.replace(/^#/u,"")),v(this,Kt,"magic-word");let q=new RegExp(String.raw`^\s*${$}\s*$`,B?"u":"iu"),D=new ce(x,q,"magic-word-name",n,i,{});if(super.insertAt(D),A.length>0&&t.unshift([A.join(":")]),this.name==="invoke")for(let H=0;H<2;H++){let ne=t.shift();if(!ne)break;let ee=new G(ne.join("="),`invoke-${H?"function":"module"}`,n,i);super.insertAt(ee)}}}if(this.type==="template"){let x=te(e).trim();if(!this.normalizeTitle(x,10,!0).valid)throw i.pop(),new SyntaxError("Invalid template name");let A=new G(e,"template-name",n,i,{});super.insertAt(A)}typeof s=="number"&&(i[s]=void 0);let c=this.isTemplate(),h=1;for(let[x,A]of t.entries())!c&&!(this.name==="switch"&&x>0)&&(A[0]=A.join("="),A.length=1),A.length===1&&(A.unshift(h),h++),this.insertAt(new vr(...A,n,i));this.seal("modifier")}get type(){return u(this,Kt)}setModifier(e){let{parserFunction:[,,t,n]}=this.getAttribute("config"),i=te(e).trim();if(e&&!i.endsWith(":"))return!1;let s=i.slice(0,-1).toLowerCase(),o=t.includes(s),l=n.includes(s);return u(this,Ye)&&o||!u(this,Ye)&&(l||e==="")||(ye.running||this.length>1)&&(o||l||e==="")?(this.setAttribute("modifier",e),v(this,Ye,o),!!e):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0)),super.afterBuild(),this.isTemplate()&&this.type==="template"&&this.setAttribute("name",R(this,tt,cn).call(this).title)}toString(e){return`{{${this.modifier}${this.type==="magic-word"?`${this.firstChild.toString(e)}${this.length===1?"":":"}${this.childNodes.slice(1).map(t=>t.toString(e)).join("|")}`:super.toString(e,"|")}}}`}text(){let{childNodes:e,length:t,firstChild:n,modifier:i,type:s,name:o}=this;return s==="magic-word"&&o==="vardefine"?"":`{{${i}${s==="magic-word"?n.text()+(t===1?"":":")+pe(e.slice(1),"|"):super.text("|")}}}`}getAttribute(e){switch(e){case"padding":return this.modifier.length+2;default:return super.getAttribute(e)}}getGaps(){return 1}lint(e=this.getAbsoluteIndex(),t){let n=super.lint(e,t);if(!this.isTemplate())return n;let{type:i,childNodes:s,length:o}=this,l=new E(this,e),p=i==="magic-word";if(p&&!R(this,tt,cn).call(this).valid)n.push(C(s[1],l,"invalid-invoke","illegal module name"));else{let d=s[p?1:0],c=d.childNodes.find(h=>h.type==="text"&&Mt(h.data).includes("#"));if(c){let h=C(d,l,"no-ignored","useless fragment");h.fix={range:[h.startIndex+c.getRelativeIndex()+c.data.indexOf("#"),h.endIndex],text:""},n.push(h)}}if(p&&o===2)return n.push(N(this,l,"invalid-invoke","missing module function")),n;let g=this.getDuplicatedArgs().filter(([,d])=>!d[0].querySelector("ext"));return g.length>0&&n.push(...g.flatMap(([,d])=>d).map(d=>C(d,l,"no-duplicate","duplicated parameter"))),n}insertAt(e,t=this.length){return super.insertAt(e,t),e.anon?R(this,tt,zi).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getAllArgs(){return this.childNodes.filter(vt("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:e})=>e)}getArgs(e,t,n=!0){let i=String(e).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),s;return u(this,et).has(i)?s=u(this,et).get(i):(s=new Set(this.getAllArgs().filter(({name:o})=>i===o)),u(this,et).set(i,s)),s}getDuplicatedArgs(){return[...u(this,et)].filter(([,{size:e}])=>e>1).map(([e,t])=>[e,[...t]])}getPossibleValues(){let{type:e,name:t,childNodes:n}=this;if(e==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let i;switch(t){case"if":case"ifexist":case"ifexpr":case"iferror":i=2;break;case"ifeq":i=3;break;default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}let s=n.slice(i,i+2).map(({childNodes:[,o]})=>o);for(let o=0;o<s.length;){let{length:l,0:p}=s[o].childNodes.filter(g=>g.text().trim());if(l===0)s.splice(o,1);else if(l>1||p.type!=="magic-word")o++;else try{let g=p.getPossibleValues();s.splice(o,1,...g),o+=g.length}catch(g){o++}}return s}print(){let{childNodes:e,length:t,firstChild:n,modifier:i,type:s}=this;return`<span class="wpb-${s}">{{${gt(i)}${s==="magic-word"?n.print()+(t===1?"":":")+Ne(e.slice(1),{sep:"|"}):Ne(e,{sep:"|"})}}}</span>`}};Kt=new WeakMap,Ye=new WeakMap,et=new WeakMap,tt=new WeakSet,cn=function(){let e=this.type==="template",t=this.childNodes[e?0:1];return this.normalizeTitle(t.toString(!0),e?10:828)},zi=function(e){let t=this.getAnonArgs(),n=typeof e!="number";for(let i=n?t.indexOf(e):e-1;i<t.length;i++){let s=t[i],{name:o}=s,l=String(i+1);o!==l&&(s.setAttribute("name",l),this.getArgs(l,!1,!1).add(s))}}});var Ui,hn,ta,rt,Di=b(()=>{"use strict";Xe();P();Ui=[ue()];rt=class extends(ta=y){get type(){return"hidden"}};hn=le(ta),rt=ge(hn,0,"HiddenToken",Ui,rt),de(hn,1,rt)});var wr,Hi,Ar,Vi=b(()=>{"use strict";J();_();Q();F();P();Ee();Di();Ar=class extends y{constructor(e,t=f.getConfig(),n=[]){super(void 0,t,n,{});T(this,wr);for(let[i,s]of e.entries())if(i===0){let o=new G(s,"arg-name",t,n,{});super.insertAt(o)}else if(i>1){let o=new rt(s,t,n);super.insertAt(o)}else{let o=new y(s,t,n);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`{{{${pe(this.childNodes.slice(0,2),"|")}}}}`}getAttribute(e){return e==="padding"?3:super.getAttribute(e)}getGaps(){return 1}afterBuild(){R(this,wr,Hi).call(this),super.afterBuild()}lint(e=this.getAbsoluteIndex(),t){let{childNodes:[n,i,...s]}=this;if(!this.getAttribute("include")){let l=N(this,{start:e},"no-arg","unexpected template argument");return i&&(l.fix={range:[e,l.endIndex],text:i.text()}),[l]}let o=n.lint(e+3,t);if(i&&o.push(...i.lint(e+4+n.toString().length,t)),s.length>0){let l=new E(this,e);o.push(...s.map(p=>{let g=C(p,l,"no-ignored","invisible content inside triple braces");return g.startIndex--,g.startCol--,g.suggestions=[{desc:"remove",range:[g.startIndex,g.endIndex],text:""},{desc:"escape",range:[g.startIndex,g.startIndex+1],text:"{{!}}"}],g}))}return o}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}};wr=new WeakSet,Hi=function(){this.setAttribute("name",this.firstChild.toString(!0).trim())}});var Xi={};se(Xi,{parseBraces:()=>Yt});var ra,mn,na,Yt,Sr=b(()=>{"use strict";J();un();Wi();Vi();ra={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},mn=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),na=/\{\{\s*([^\s\0<>[\]{}|_#&%:.]+)\s*\}\}(?!\})/gu,Yt=(a,r,e)=>{var c,h,m,k,x,A;let t=String.raw`${(c=r.excludes)!=null&&c.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,n=String.raw`|\{{2,}`,{parserFunction:[,,,i]}=r,s=[];a=a.replace(na,(S,$)=>{var w;return new Jt(S.slice(2,-2),[],r,e),`\0${e.length-2}${(w=mn.get($.toLowerCase()))!=null?w:"t"}\x7F`});let o=a.lastIndexOf("}}")-a.length,l=o+a.length!==-1,p=new RegExp(t+(l?n:""),"gmu"),g=p.exec(a),d;for(;g||d!==void 0&&d<=a.length&&((m=(h=s[s.length-1])==null?void 0:h[0])!=null&&m.startsWith("="));){if(g!=null&&g[1]){let[,{length:W}]=g;g[0]=g[0].slice(W),g.index+=W}let{0:S,index:$}=g!=null?g:{0:`
|
|
9
|
+
`,index:a.length},w=(k=s.pop())!=null?k:{},{0:L,index:B,parts:j,findEqual:q,pos:D}=w,H=S==="="&&q,ne=W=>{j[j.length-1].push(W.slice(D,$))};if(S==="]]"||S==="}-")d=$+2;else if(S===`
|
|
10
|
+
`){d=$+1;let{pos:W,findEqual:I}=(x=s[s.length-1])!=null?x:{};if(W===void 0||I||te(a.slice(W,B))!==""){let xe=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(a.slice(B,$));xe&&(a=`${a.slice(0,B)}\0${e.length}h\x7F${a.slice($)}`,d=B+4+String(e.length).length,new kt(xe[1].length,xe.slice(2),r,e))}}else if(S==="|"||H)d=$+1,ne(a),S==="|"&&j.push([]),w.pos=d,w.findEqual=S==="|",s.push(w);else if(S.startsWith("}}")){let W=S.slice(0,Math.min(L.length,3)),I=L.length-W.length,{length:xe}=e;d=$+W.length,ne(a);let ke=!1,Pe="t";if(W.length===3){let ie=j.map(lt=>lt.join("=")),ve=ie.length>1&&te(ie[1]).trim();new Ar(ie,r,e),ve&&ve.endsWith(":")&&i.includes(ve.slice(0,-1).toLowerCase())&&(Pe="s")}else try{new Jt(j[0][0],j.slice(1),r,e);let ie=te(j[0][0]).trim();mn.has(ie.toLowerCase())?Pe=mn.get(ie.toLowerCase()):/^(?:filepath|(?:full|canonical)urle?):./iu.test(ie)?Pe="m":/^#vardefine:./iu.test(ie)&&(Pe="n")}catch(ie){if(ie instanceof SyntaxError&&ie.message==="Invalid template name")ke=!0;else throw ie}ke||(a=`${a.slice(0,B+I)}\0${xe}${Pe}\x7F${a.slice(d)}`,d=B+I+3+String(xe).length,I>1?s.push({0:L.slice(0,I),index:B,pos:B+I,parts:[[]]}):I===1&&a[B-1]==="-"&&s.push({0:"-{",index:B-1,pos:B+1,parts:[[]]}))}else d=$+S.length,S.startsWith("{")&&(g.pos=d,g.parts=[[]]),s.push(..."0"in w?[w]:[],g);let ee=s[s.length-1];if(l&&o+a.length<d)for(l=!1;(A=ee==null?void 0:ee[0])!=null&&A.startsWith("{");)s.pop(),ee=s[s.length-1];p=new RegExp(t+(l?n:"")+(ee?`|${ra[ee[0][0]]}${ee.findEqual?"|=":""}`:""),"gmu"),p.lastIndex=d,g=p.exec(a)}return a}});var Cr,Qi=b(()=>{"use strict";Qt();Sr();F();pn();Cr=class extends Tt{constructor(r,e,t=f.getConfig(),n=[]){let i=Symbol("InputboxToken"),{length:s}=n;n.push(i),e&&(e=Ke(e,t,n,r)),e&&(e=Yt(e,t,n)),n.splice(s,1),super(r,e,t,n,{})}}});function Zi(a,r,e,t,n){r=r.trim();let i=r.replace(a==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(a){case"width":return!i&&!!r||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(i);case"link":{if(!i)return r;let s=new RegExp(String.raw`^(?:${e.protocol}|//|\0\d+m\x7F)`,"iu"),o=new RegExp(String.raw`^(?:(?:${e.protocol}|//)${Ae}|\0\d+m\x7F)${we}$`,"iu");if(s.test(i))return o.test(i)&&r;i.startsWith("[[")&&i.endsWith("]]")&&(i=i.slice(2,-2));let l=f.normalizeTitle(i,0,!1,e,t,!0,!0);return l.valid&&l}case"lang":return(n==="svg"||n==="svgz")&&!/[^a-z\d-]/u.test(i);case"alt":case"class":case"manualthumb":return!0;case"page":return(n==="djvu"||n==="djv"||n==="pdf")&&Number(i)>0;default:return!!i&&!isNaN(i)}}var ia,oe,Nr,Ji,$r,Ki=b(()=>{"use strict";J();_();F();P();ia=new Set(["alt","link","lang","page","caption"]);$r=class extends y{constructor(e,t,n=f.getConfig(),i){var r=(...vg)=>(super(...vg),T(this,Nr),T(this,oe,""),this);var p;let s,o=Object.entries(n.img).map(([g,d])=>[g,d,new RegExp(String.raw`^(\s*(?!\s))${g.replace("$1","(.*)")}${g.endsWith("$1")?`(?=$|
|
|
11
|
+
)`:""}(\s*)$`,"u")]),l=o.find(([,g,d])=>(s=d.exec(e),s&&(s.length!==4||Zi(g,s[2],n,!0,t)!==!1)));if(l&&s){s.length===3?(r(void 0,n,i),v(this,oe,e)):(r(s[2],n,i,{}),v(this,oe,s[1]+l[0]+s[3])),this.setAttribute("name",l[1]);return}r(e,{...n,excludes:[...(p=n.excludes)!=null?p:[],"list"]},i),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get type(){return"image-parameter"}get link(){return this.name==="link"?Zi("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var e;((e=this.parentNode)==null?void 0:e.type)==="gallery-image"&&!ia.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(e){return u(this,oe)?u(this,oe).replace("$1",super.toString(e)):super.toString(e)}text(){return u(this,oe)?u(this,oe).replace("$1",super.text()).trim():super.text().trim()}getAttribute(e){return e==="plain"?this.name==="caption":e==="padding"?Math.max(0,u(this,oe).indexOf("$1")):super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){let n=super.lint(e,t),{link:i,name:s}=this;if(s==="invalid"){let o=N(this,{start:e},"invalid-gallery","invalid image parameter");o.fix={range:[e-1,o.endIndex],text:""},n.push(o)}else typeof i=="object"&&i.encoded&&n.push(N(this,{start:e},"url-encoding","unnecessary URL encoding in an internal link"));return n}getValue(){return this.name==="invalid"?this.text():R(this,Nr,Ji).call(this)||super.text()}print(){return u(this,oe)?`<span class="wpb-image-parameter">${u(this,oe).replace("$1",`<span class="wpb-image-caption">${Ne(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}};oe=new WeakMap,Nr=new WeakSet,Ji=function(){return u(this,oe)&&!u(this,oe).includes("$1")}});var Yi,es,ts,sa,At,fn=b(()=>{"use strict";J();_();Q();F();Ht();Ki();Yi=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),es=new Set(["left","right","center","none"]),ts=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),sa=(a,r,e,t)=>{if(t===void 0)return[];let n=new RegExp(`${[a,r,e].map(oi).join("|")}`,"gu"),i=[],s=n.exec(t),o=0,l=0;for(;s;){let{0:p,index:g}=s;p!==e?o+=p===a?1:-1:o===0&&(i.push(t.slice(l,g)),{lastIndex:l}=n),s=n.exec(t)}return i.push(t.slice(l)),i},At=class extends Ce{get type(){return"file"}get extension(){return this.getTitle().extension}constructor(r,e,t=f.getConfig(),n=[],i="|"){super(r,void 0,t,n,i);let{extension:s}=this.getTitle(!0);this.append(...sa("-{","}-","|",e).map(o=>new $r(o,s,t,n)))}lint(r=this.getAbsoluteIndex(),e){var h;let t=super.lint(r,e),n=this.getAllArgs().filter(({childNodes:m})=>{let k=m.filter(x=>x.text().trim());return k.length!==1||k[0].type!=="arg"}),i=[...new Set(n.map(({name:m})=>m))],s=i.filter(m=>Yi.has(m)),o=i.filter(m=>es.has(m)),l=i.filter(m=>ts.has(m)),[p]=s,g=p==="framed"||p==="manualthumb",d=new E(this,r);if(this.closest("ext-link-text")&&((h=this.getValue("link"))==null?void 0:h.trim())!==""&&t.push(N(this,d,"nested-link","internal link in an external link")),g)for(let m of n.filter(({name:k})=>k==="width")){let k=C(m,d,"invalid-gallery","invalid image parameter");k.fix={range:[k.startIndex-1,k.endIndex],text:""},t.push(k)}if(n.length===i.length&&s.length<2&&o.length<2&&l.length<2)return t;let c=(m,k)=>x=>C(x,d,"no-duplicate",f.msg(`${m} image $1 parameter`,k));for(let m of i){if(m==="invalid"||m==="width"&&g)continue;let k=n.filter(({name:x})=>x===m);m==="caption"&&(k=[...k.slice(0,-1).filter(x=>x.text()),...k.slice(-1)]),k.length>1&&t.push(...k.map(c("duplicated",m)))}return s.length>1&&t.push(...n.filter(({name:m})=>Yi.has(m)).map(c("conflicting","frame"))),o.length>1&&t.push(...n.filter(({name:m})=>es.has(m)).map(c("conflicting","horizontal-alignment"))),l.length>1&&t.push(...n.filter(({name:m})=>ts.has(m)).map(c("conflicting","vertical-alignment"))),t}getAllArgs(){return this.childNodes.slice(1)}getArgs(r){return this.getAllArgs().filter(({name:e})=>r===e)}getArg(r){let e=this.getArgs(r);return e[r==="manualthumb"?0:e.length-1]}getValue(r){var e;return(e=this.getArg(r))==null?void 0:e.getValue()}}});var wt,xn=b(()=>{"use strict";_();Se();F();P();fn();wt=class extends At{constructor(e,t,n,i=f.getConfig(),s=[]){let o;if(n!==void 0){let{length:l}=s;o=new y(n,i,s);for(let p=1;p<11;p++)o.parseOnce();s.splice(l,1)}super(t,o==null?void 0:o.toString(),i,s);X(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=`${e}-image`,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(){let e=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),e?0:6,!0,!e)}getAttribute(e){return e==="padding"?0:super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){let n=super.lint(e,t),{ns:i,interwiki:s}=this.getAttribute("title");return(s||i!==6)&&n.push(N(this,{start:e},"invalid-gallery","invalid gallery image")),n}}});var Lr,rs,Er,ns=b(()=>{"use strict";F();P();xn();Oe();Er=class extends y{constructor(e,t=f.getConfig(),n=[]){var i;super(void 0,t,n,{});T(this,Lr);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 U(s,t,n):s);continue}let[,l,p]=o;R(this,Lr,rs).call(this,l)?super.insertAt(new wt("gallery",l,p,t,n)):super.insertAt(new U(s,t,n))}}get type(){return"ext-inner"}toString(e){return super.toString(e,`
|
|
12
13
|
`)}text(){return super.text(`
|
|
13
14
|
`).replace(/\n\s*\n/gu,`
|
|
14
|
-
`)}getGaps(){return 1}lint(e=this.getAbsoluteIndex(),t){let{top:n,left:i}=this.getRootNode().posFromIndex(e),s=[];for(let[o,
|
|
15
|
-
`})}};
|
|
16
|
-
`),i=new Set(e.protocol.split("|")),s=U,o=!0,
|
|
15
|
+
`)}getGaps(){return 1}lint(e=this.getAbsoluteIndex(),t){let{top:n,left:i}=this.getRootNode().posFromIndex(e),s=[];for(let[o,l]of this.childNodes.entries()){let p=l.toString(),{length:g}=p,d=p.trim(),c=n+o,h=o?0:i;if(l.type==="noinclude"&&d&&!/^<!--.*-->$/u.test(d)){let m=e+g;s.push({rule:"no-ignored",message:f.msg("invalid content in <$1>","gallery"),severity:d.startsWith("|")?"warning":"error",startIndex:e,endIndex:m,startLine:c,endLine:c,startCol:h,endCol:h+g,suggestions:[{desc:"remove",range:[e,m],text:""},{desc:"comment",range:[e,m],text:`<!--${p}-->`}]})}else l.type!=="noinclude"&&l.type!=="text"&&s.push(...l.lint(e,t));e+=g+1}return s}print(){return super.print({sep:`
|
|
16
|
+
`})}};Lr=new WeakSet,rs=function(e){return this.normalizeTitle(e,6,!0,!0).valid}});var St,bn=b(()=>{"use strict";_();Ht();St=class extends Ce{get type(){return"link"}lint(r=this.getAbsoluteIndex(),e){let t=super.lint(r,e);return this.closest("ext-link-text")&&t.push(N(this,{start:r},"nested-link","internal link in an external link")),t}}});var oa,aa,er,Le,Ir=b(()=>{"use strict";_();J();Q();F();P();oa=String.raw`(?:[\p{Zs}\t]| |�*160;|&#[xX]0*[aA]0;)`,aa=new RegExp(`${oa}+`,"gu"),Le=class extends y{constructor(e,t="free-ext-link",n=f.getConfig(),i){super(e,n,i,{});T(this,er);v(this,er,t)}get type(){return u(this,er)}get innerText(){let e=new Map([["!","|"],["=","="]]),t=pe(this.childNodes.map(n=>{let{type:i}=n,s=String(n.name);return i==="magic-word"&&e.has(s)?e.get(s):n}));return this.type==="magic-link"&&(t=t.replace(aa," ")),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:ai(e)}lint(e=this.getAbsoluteIndex(),t){let n=super.lint(e,t),i=new E(this,e);if(this.type==="magic-link"){let{link:p}=this;if(p.startsWith("ISBN")){let g=[...p.slice(5)].map(d=>d==="X"?10:Number(d));(g.length===10&&g.reduce((d,c,h)=>d+c*(10-h),0)%11||g.length===13&&(g[12]===10||g.reduce((d,c,h)=>d+c*(h%2?3:1),0)%10))&&n.push(N(this,i,"invalid-isbn","invalid ISBN"))}return n}let s=this.type==="ext-link-url",o=s?/\|/u:/[,;。:!?()]+/u,l=this.childNodes.find(p=>p.type==="text"&&o.test(p.data));if(l){let{data:p}=l,g=C(l,i,"unterminated-url",f.msg("$1 in URL",s?'"|"':"full-width punctuation"),"warning"),{index:d,0:c}=o.exec(p),h=g.startIndex+d;g.suggestions=s?[{desc:"whitespace",range:[h,h+1],text:" "}]:[{desc:"whitespace",range:[h,h],text:" "},{desc:"escape",range:[h,h+c.length],text:encodeURI(c)}],n.push(g)}return n}};er=new WeakMap});var Ie,Ct,Tn=b(()=>{"use strict";Se();_();F();P();Ir();Ct=class extends y{constructor(e,t="",n="",i=f.getConfig(),s=[]){super(void 0,i,s,{});T(this,Ie);let o=e&&/^\0\d+f\x7F$/u.test(e)?s[Number(e.slice(1,-2))]:new Le(e,"ext-link-url",i,s);if(this.insertAt(o),v(this,Ie,t),n){let l=new y(n,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)}${u(this,Ie)}]`:`[${super.toString(e,u(this,Ie))}]`}text(){return`[${super.text(" ")}]`}getAttribute(e){return e==="padding"?1:super.getAttribute(e)}getGaps(){return u(this,Ie).length}lint(e=this.getAbsoluteIndex(),t){let n=super.lint(e,t);return this.length===1&&this.closest("heading-title")&&n.push(N(this,{start:e},"var-anchor","variable anchor in a section header")),n}print(){return super.print(this.length===1?{pre:"[",post:`${u(this,Ie)}]`}:{pre:"[",sep:u(this,Ie),post:"]"})}};Ie=new WeakMap});var tr,is=b(()=>{"use strict";F();P();Oe();bn();Tn();tr=class extends y{get type(){return"imagemap-link"}constructor(r,e,t,n=f.getConfig(),i=[]){super(void 0,n,i),this.append(r,e.length===2?new St(...e,n,i):new Ct(...e,n,i),new U(t,n,i))}}});var Fr,ss=b(()=>{"use strict";_();be();Q();F();P();Oe();xn();is();Fr=class extends y{get type(){return"ext-inner"}get image(){return this.childNodes.find(vt("imagemap-image"))}constructor(r,e=f.getConfig(),t=[]){if(super(void 0,e,t,{}),!r)return;let n=r.split(`
|
|
17
|
+
`),i=new Set(e.protocol.split("|")),s=U,o=!0,l=!1;for(let p of n){let g=p.trim();if(!(l||!g||g.startsWith("#"))){if(o){let[d,...c]=p.split("|"),h=this.normalizeTitle(d,0,!0);if(h.valid&&!h.interwiki&&h.ns===6){let m=new wt("imagemap",d,c.length>0?c.join("|"):void 0,e,t);super.insertAt(m),o=!1;continue}else l=!0}else if(p.trim().split(/[\t ]/u)[0]==="desc"){super.insertAt(p);continue}else if(p.includes("[")){let d=p.indexOf("["),c=p.slice(d),h=/^\[\[([^|]+)(?:\|([^\]]+))?\]\][\w\s]*$/u.exec(c);if(h){if(this.normalizeTitle(h[1],0,!0,!1,!0).valid){super.insertAt(new tr(p.slice(0,d),h.slice(1),c.slice(c.indexOf("]]")+2),e,t));continue}}else if(i.has(c.slice(1,c.indexOf(":")+1))||i.has(c.slice(1,c.indexOf("//")+2))){let m=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(c);if(m){super.insertAt(new tr(p.slice(0,d),m.slice(1),c.slice(c.indexOf("]")+1),e,t));continue}}}}super.insertAt(new s(p,e,t))}}toString(r){return super.toString(r,`
|
|
17
18
|
`)}text(){return super.text(`
|
|
18
19
|
`).replace(/\n{2,}/gu,`
|
|
19
20
|
`)}getGaps(){return 1}lint(r=this.getAbsoluteIndex(),e){let t=super.lint(r,e),n=new E(this,r);return this.image?t.push(...this.childNodes.filter(i=>{let s=i.toString().trim();return i.type==="noinclude"&&s&&!s.startsWith("#")}).map(i=>C(i,n,"invalid-imagemap","invalid link in <imagemap>"))):t.push(N(this,n,"invalid-imagemap","<imagemap> without an image")),t}print(){return super.print({sep:`
|
|
20
|
-
`})}}});var Ir,Hi=b(()=>{"use strict";_();F();qe();Ir=class extends re{get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex()){let{name:e,firstChild:{data:t}}=this;if((e==="templatestyles"||e==="section")&&t){let n=N(this,{start:r},"void-ext",f.msg("nothing should be in <$1>",e));return n.fix={range:[r,n.endIndex],text:""},[n]}return super.lint(r,new RegExp(String.raw`<\s*(?:/\s*)${e==="nowiki"?"":"?"}(${e})\b`,"giu"))}}});var Fr={};se(Fr,{NestedToken:()=>xn});var Ro,tr,Ct,xn,Rr=b(()=>{"use strict";_();Q();Xt();Ar();F();P();bn();_e();Ro=new Set(["comment","include","arg","template","magic-word"]),xn=class extends y{constructor(e,t,n,i=f.getConfig(),s=[]){if(typeof t=="boolean"){let o=Symbol("InputboxToken"),{length:a}=s;s.push(o),e&&(e=Ze(e,i,s,t)),e&&(e=Jt(e,i,s)),s.splice(a,1)}else e&&(e=e.replace(t,(o,a,p,g,l)=>{let c=`\0${s.length+1}e\x7F`;return new $t(a,p,g,l,i,!1,s),c}));e&&(e=e.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(o,a,p)=>(new U(p,i,s),`${a}\0${s.length}n\x7F`)));super(e,i,s);T(this,tr);T(this,Ct);v(this,tr,[...n]),v(this,Ct,t)}get type(){return"ext-inner"}lint(e=this.getAbsoluteIndex(),t){let n=new E(this,e),i=u(this,Ct)?"includeonly":"noinclude",s=typeof u(this,Ct)=="boolean"?new RegExp(String.raw`^(?:<${i}(?:\s[^>]*)?/?>|</${i}\s*>)$`,"iu"):/^<!--.*-->$/su;return[...super.lint(e,t),...this.childNodes.filter(o=>{if(o.type==="ext")return!u(this,tr).includes(o.name);if(Ro.has(o.type))return!1;let a=o.toString().trim();return a&&!s.test(a)}).map(o=>{let a=C(o,n,"no-ignored",f.msg("invalid content in <$1>",this.name));return a.suggestions=[{desc:"remove",range:[a.startIndex,a.endIndex],text:""},{desc:"comment",range:[a.startIndex,a.endIndex],text:`<!--${o.toString()}-->`}],a})]}};tr=new WeakMap,Ct=new WeakMap});var Vi,$t,bn=b(()=>{"use strict";_();Q();F();P();sn();xr();Ci();ln();Bi();Wi();Di();Hi();Vi=(d,r)=>{let e=new Set(d);return e.delete(r),[...e]},$t=class extends ht{get type(){return"ext"}constructor(r,e,t,n,i=f.getConfig(),s=!1,o=[]){var c;let a=r.toLowerCase(),p=new Ge(!e||e.trimStart()!==e?e:` ${e}`,"ext-attrs",a,i,o),g={...i,ext:Vi(i.ext,a),excludes:[...(c=i.excludes)!=null?c:[]]},l;switch(g.inExt=!0,a){case"tab":g.ext=Vi(g.ext,"tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":a==="poem"&&g.excludes.push("heading"),l=new y(t,g,o);break;case"pre":l=new br(t,g,o);break;case"dynamicpagelist":l=new bt(s,t,g,o);break;case"inputbox":g.excludes.push("heading"),l=new wr(s,t,g,o);break;case"references":{let{NestedToken:h}=(Rr(),Z(Fr));g.excludes.push("heading"),l=new h(t,s,["ref"],g,o);break}case"choose":{let{NestedToken:h}=(Rr(),Z(Fr));l=new h(t,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>(.*?)<\/(\1)>)/gsu,["option","choicetemplate"],g,o);break}case"combobox":{let{NestedToken:h}=(Rr(),Z(Fr));l=new h(t,/<(combooption)(\s[^>]*?)?(?:\/>|>(.*?)<\/(combooption\s*)>)/gisu,["combooption"],g,o);break}case"gallery":l=new $r(t,g,o);break;case"imagemap":l=new Lr(t,g,o);break;default:l=new Ir(t,g,o)}l.setAttribute("name",a),l.type==="plain"&&(l.type="ext-inner"),super(r,p,l,n,i,o),this.seal("closed",!0)}lint(r=this.getAbsoluteIndex(),e){let t=super.lint(r,e),n=new E(this,r);return this.name!=="nowiki"&&this.closest("html-attrs,table-attrs")&&t.push(N(this,n,"parsing-order","extension tag in HTML tag attributes")),this.name==="ref"&&this.closest("heading-title")&&t.push(N(this,n,"var-anchor","variable anchor in a section header")),t}}});var Xi,Tn,Po,tt,Qi=b(()=>{"use strict";_();He();F();qe();Xi=[ue(!1)];tt=class extends(Po=re){constructor(e,t=!0,n,i){super(e,n,i);X(this,"closed");this.closed=t}get type(){return"comment"}getAttribute(e){return e==="padding"?4:super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){if(this.closed)return[];let t=N(this,{start:e},"unclosed-comment",f.msg("unclosed $1","HTML comment"));return t.fix={range:[t.endIndex,t.endIndex],text:"-->"},[t]}toString(e){return e?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}};Tn=le(Po),tt=ge(Tn,0,"CommentToken",Xi,tt),de(Tn,1,tt)});var Zi={};se(Zi,{parseCommentAndExt:()=>Ze});var Ze,Xt=b(()=>{"use strict";gi();_e();ui();bn();Qi();Ze=(d,r,e,t)=>{let n="<onlyinclude>",i="</onlyinclude>",{length:s}=n,o=()=>{let c=d.indexOf(n);return{i:c,j:d.indexOf(i,c+s)}};if(t){let{i:c,j:h}=o();if(c!==-1&&h!==-1){let m="",k=x=>{new U(x,r,e),m+=`\0${e.length-1}n\x7F`};for(;c!==-1&&h!==-1;){let x=`\0${e.length}e\x7F`;new hr(d.slice(c+s,h),r,e),c>0&&k(d.slice(0,c)),m+=x,d=d.slice(h+s+1),{i:c,j:h}=o()}return d&&k(d),m}}let a=r.ext.join("|"),p=t?"includeonly":"(?:no|only)include",g=t?"noinclude":"includeonly",l=new RegExp(String.raw`<!--.*?(?:-->|$)|<${p}(?:\s[^>]*)?/?>|</${p}\s*>|<(${a})(\s[^>]*?)?(?:/>|>(.*?)</(\1\s*)>)|<(${g})(\s[^>]*?)?(?:/>|>(.*?)(?:</(${g}\s*)>|$))`,"gisu");return d.replace(l,(c,h,m,k,x,A,S,$,w)=>{let L=e.length,B="n";if(h)B="e",new $t(h,m,k,x,r,A,e);else if(c.startsWith("<!--")){B="c";let j=c.endsWith("-->");new tt(c.slice(4,j?-3:void 0),j,r,e)}else A?new Qe(A,S,$,w,r,e):new U(c,r,e);return`\0${L}${B}\x7F`})}});var Bo,jo,qo,Nt,he,ze,Pr,Ki=b(()=>{"use strict";_();K();Q();P();Bo=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),jo=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"]),qo=new Set(["strike","big","center","font","tt"]),Pr=class extends y{constructor(e,t,n,i,s,o){super(void 0,s,o);T(this,Nt);T(this,he);T(this,ze);this.insertAt(t),this.setAttribute("name",e.toLowerCase()),v(this,Nt,n),v(this,he,i),v(this,ze,e)}get type(){return"html"}get selfClosing(){return u(this,he)}get closing(){return u(this,Nt)}toString(e){return`<${this.closing?"/":""}${u(this,ze)}${super.toString(e)}${u(this,he)?"/":""}>`}text(){let{closing:e}=this,t=u(this,ze)+(e?"":super.text());return`<${e?"/":""}${t}${u(this,he)?"/":""}>`}getAttribute(e){return e==="padding"?u(this,ze).length+(this.closing?2:1):super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){var s;let n=super.lint(e,t),i=new E(this,e);this.name==="h1"&&!this.closing&&n.push(N(this,i,"h1","<h1>")),this.closest("table-attrs")&&n.push(N(this,i,"parsing-order","HTML tag in table attributes"));try{this.findMatchingTag()}catch(o){if(o instanceof SyntaxError){let{message:a}=o,p=a.split(":")[0].toLowerCase(),g=N(this,i,"unmatched-tag",p);if(p==="unclosed tag"&&!this.closest("heading-title"))if(jo.has(this.name)){let l=(s=this.parentNode)==null?void 0:s.childNodes,c=l==null?void 0:l.indexOf(this);l!=null&&l.slice(0,c).some(({type:h,name:m})=>h==="html"&&m===this.name)||(g.severity="warning")}else g.severity="warning";else if(p==="unmatched closing tag"){let l=this.closest("magic-word");l&&Bo.has(l.name)?g.severity="warning":g.suggestions=[{desc:"remove",range:[e,g.endIndex],text:""}]}else if(p==="tag that is both closing and self-closing"){let{html:[,,l]}=this.getAttribute("config");l.includes(this.name)&&(g.fix={range:[e+1,e+2],text:""})}n.push(g)}}return qo.has(this.name)&&n.push(N(this,i,"obsolete-tag","obsolete HTML tag","warning")),(this.name==="b"||this.name==="strong")&&this.closest("heading-title")&&n.push(N(this,i,"bold-header","bold in section header","warning")),n}findMatchingTag(){let{html:[e,t,n]}=this.getAttribute("config"),{name:i,parentNode:s,closing:o}=this,a=Xn(this.toString());if(o&&(u(this,he)||n.includes(i)))throw new SyntaxError(`Tag that is both closing and self-closing: ${a}`);if(n.includes(i)||u(this,he)&&t.includes(i))return this;if(u(this,he)&&e.includes(i))throw new SyntaxError(`Invalid self-closing tag: ${a}`);if(!s)return;let{childNodes:p}=s,g=p.indexOf(this),l=(o?p.slice(0,g).reverse():p.slice(g+1)).filter(h=>h.type==="html"&&h.name===i),c=o?-1:1;for(let h of l)if(u(h,Nt)?c--:c++,c===0)return h;throw new SyntaxError(`${o?"Unmatched closing":"Unclosed"} tag: ${a}`)}print(){return super.print({pre:`<${this.closing?"/":""}${u(this,ze)}`,post:`${u(this,he)?"/":""}>`})}json(){let e=super.json();return Object.assign(e,{closing:this.closing,selfClosing:u(this,he)}),e}};Nt=new WeakMap,he=new WeakMap,ze=new WeakMap});var Ji={};se(Ji,{parseHtml:()=>_o});var _o,Yi=b(()=>{"use strict";xr();Ki();_o=(d,r,e)=>{let t=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,{html:n}=r,i=new Set([...n[0],...n[1],...n[2]]),s=d.split("<"),o=s.shift();for(let a of s){let p=t.exec(a),g=p==null?void 0:p[2],l=g==null?void 0:g.toLowerCase();if(!p||!i.has(l)){o+=`<${a}`;continue}let[,c,,h="",m,k]=p,{length:x}=e,A=new Ge(h,"html-attrs",l,r,e),S=A.getAttr("itemprop");if(l==="meta"&&(S===void 0||A.getAttr("content")===void 0)||l==="link"&&(S===void 0||A.getAttr("href")===void 0)){o+=`<${a}`,e.length=x;continue}o+=`\0${e.length}x\x7F${k}`,new Pr(g,A,c==="/",m==="/>",r,e)}return o}});var es,rs=b(()=>{"use strict";be();es=(d=0)=>(r,e)=>{var n,ts;class t extends r{constructor(){super(...arguments);T(this,n)}getAttr(a){return u(this,n,ts).getAttr(a)}}return n=new WeakSet,ts=function(){return this.childNodes[d]},ur(t,r),t}});var Et,yn=b(()=>{"use strict";rs();F();P();pt();xr();Et=class extends es(1)(y){constructor(r,e,t,n,i=f.getConfig(),s=[],o){super(void 0,i,s,o),this.append(new ce(e,r,"table-syntax",i,s,{}),new Ge(n,"table-attrs",t,i,s))}}});var me,rr,nt,kn,ns,rt,vn=b(()=>{"use strict";_();Se();be();Q();F();P();yn();rt=class extends Et{constructor(e,t,n=f.getConfig(),i=[]){var p;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,n,i);T(this,nt);T(this,me,"");T(this,rr);s&&([lr(this,me)._]=s);let a=new y(t==null?void 0:t.slice(((p=s==null?void 0:s.index)!=null?p:NaN)+u(this,me).length),n,i);a.type="td-inner",a.setAttribute("stage",4),this.insertAt(a)}get type(){return"td"}get rowspan(){return this.getAttr("rowspan")}get colspan(){return this.getAttr("colspan")}get subtype(){return R(this,nt,kn).call(this).subtype}afterBuild(){u(this,me).includes("\0")&&v(this,me,this.buildFromStr(u(this,me),0)),super.afterBuild()}toString(e){let{childNodes:[t,n,i]}=this;return t.toString(e)+n.toString(e)+u(this,me)+i.toString(e)}text(){let{childNodes:[e,t,n]}=this;return e.text()+t.text()+u(this,me)+n.text()}getGaps(e){return e===1?u(this,me).length:0}lint(e=this.getAbsoluteIndex(),t){let n=super.lint(e,t),i=new E(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 a=o.includes("||"),p=C(s,i,"pipe-like",'additional "|" in a table cell',a?"error":"warning");if(a){let g={caption:"|+",td:"|",th:"!"}[this.subtype];p.fix={range:[p.startIndex,p.endIndex],text:o.replace(/\|\|/gu,`
|
|
21
|
+
`})}}});var Rr,os=b(()=>{"use strict";_();F();_e();Rr=class extends re{get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex()){let{name:e,firstChild:{data:t}}=this;if((e==="templatestyles"||e==="section")&&t){let n=N(this,{start:r},"void-ext",f.msg("nothing should be in <$1>",e));return n.fix={range:[r,n.endIndex],text:""},[n]}return super.lint(r,new RegExp(String.raw`<\s*(?:/\s*)${e==="nowiki"?"":"?"}(${e})\b`,"giu"))}}});var Pr={};se(Pr,{NestedToken:()=>yn});var la,rr,$t,yn,Br=b(()=>{"use strict";_();Q();Qt();Sr();F();P();kn();Oe();la=new Set(["comment","include","arg","template","magic-word"]),yn=class extends y{constructor(e,t,n,i=f.getConfig(),s=[]){if(typeof t=="boolean"){let o=Symbol("InputboxToken"),{length:l}=s;s.push(o),e&&(e=Ke(e,i,s,t)),e&&(e=Yt(e,i,s)),s.splice(l,1)}else e&&(e=e.replace(t,(o,l,p,g,d)=>{let c=`\0${s.length+1}e\x7F`;return new Nt(l,p,g,d,i,!1,s),c}));e&&(e=e.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(o,l,p)=>(new U(p,i,s),`${l}\0${s.length}n\x7F`)));super(e,i,s);T(this,rr);T(this,$t);v(this,rr,[...n]),v(this,$t,t)}get type(){return"ext-inner"}lint(e=this.getAbsoluteIndex(),t){let n=new E(this,e),i=u(this,$t)?"includeonly":"noinclude",s=typeof u(this,$t)=="boolean"?new RegExp(String.raw`^(?:<${i}(?:\s[^>]*)?/?>|</${i}\s*>)$`,"iu"):/^<!--.*-->$/su;return[...super.lint(e,t),...this.childNodes.filter(o=>{if(o.type==="ext")return!u(this,rr).includes(o.name);if(la.has(o.type))return!1;let l=o.toString().trim();return l&&!s.test(l)}).map(o=>{let l=C(o,n,"no-ignored",f.msg("invalid content in <$1>",this.name));return l.suggestions=[{desc:"remove",range:[l.startIndex,l.endIndex],text:""},{desc:"comment",range:[l.startIndex,l.endIndex],text:`<!--${o.toString()}-->`}],l})]}};rr=new WeakMap,$t=new WeakMap});var as,Nt,kn=b(()=>{"use strict";_();Q();F();P();ln();Tr();Mi();pn();Qi();ns();ss();os();as=(a,r)=>{let e=new Set(a);return e.delete(r),[...e]},Nt=class extends mt{get type(){return"ext"}constructor(r,e,t,n,i=f.getConfig(),s=!1,o=[]){var c;let l=r.toLowerCase(),p=new ze(!e||e.trimStart()!==e?e:` ${e}`,"ext-attrs",l,i,o),g={...i,ext:as(i.ext,l),excludes:[...(c=i.excludes)!=null?c:[]]},d;switch(g.inExt=!0,l){case"tab":g.ext=as(g.ext,"tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":l==="poem"&&g.excludes.push("heading"),d=new y(t,g,o);break;case"pre":d=new yr(t,g,o);break;case"dynamicpagelist":d=new Tt(s,t,g,o);break;case"inputbox":g.excludes.push("heading"),d=new Cr(s,t,g,o);break;case"references":{let{NestedToken:h}=(Br(),Z(Pr));g.excludes.push("heading"),d=new h(t,s,["ref"],g,o);break}case"choose":{let{NestedToken:h}=(Br(),Z(Pr));d=new h(t,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>(.*?)<\/(\1)>)/gsu,["option","choicetemplate"],g,o);break}case"combobox":{let{NestedToken:h}=(Br(),Z(Pr));d=new h(t,/<(combooption)(\s[^>]*?)?(?:\/>|>(.*?)<\/(combooption\s*)>)/gisu,["combooption"],g,o);break}case"gallery":d=new Er(t,g,o);break;case"imagemap":d=new Fr(t,g,o);break;default:d=new Rr(t,g,o)}d.setAttribute("name",l),d.type==="plain"&&(d.type="ext-inner"),super(r,p,d,n,i,o),this.seal("closed",!0)}lint(r=this.getAbsoluteIndex(),e){let t=super.lint(r,e),n=new E(this,r);return this.name!=="nowiki"&&this.closest("html-attrs,table-attrs")&&t.push(N(this,n,"parsing-order","extension tag in HTML tag attributes")),this.name==="ref"&&this.closest("heading-title")&&t.push(N(this,n,"var-anchor","variable anchor in a section header")),t}}});var ls,vn,da,nt,ds=b(()=>{"use strict";_();Xe();F();_e();ls=[ue(!1)];nt=class extends(da=re){constructor(e,t=!0,n,i){super(e,n,i);X(this,"closed");this.closed=t}get type(){return"comment"}getAttribute(e){return e==="padding"?4:super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){if(this.closed)return[];let t=N(this,{start:e},"unclosed-comment",f.msg("unclosed $1","HTML comment"));return t.fix={range:[t.endIndex,t.endIndex],text:"-->"},[t]}toString(e){return e?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}};vn=le(da),nt=ge(vn,0,"CommentToken",ls,nt),de(vn,1,nt)});var gs={};se(gs,{parseCommentAndExt:()=>Ke});var Ke,Qt=b(()=>{"use strict";wi();Oe();Ci();kn();ds();Ke=(a,r,e,t)=>{let n="<onlyinclude>",i="</onlyinclude>",{length:s}=n,o=()=>{let c=a.indexOf(n);return{i:c,j:a.indexOf(i,c+s)}};if(t){let{i:c,j:h}=o();if(c!==-1&&h!==-1){let m="",k=x=>{new U(x,r,e),m+=`\0${e.length-1}n\x7F`};for(;c!==-1&&h!==-1;){let x=`\0${e.length}e\x7F`;new fr(a.slice(c+s,h),r,e),c>0&&k(a.slice(0,c)),m+=x,a=a.slice(h+s+1),{i:c,j:h}=o()}return a&&k(a),m}}let l=r.ext.join("|"),p=t?"includeonly":"(?:no|only)include",g=t?"noinclude":"includeonly",d=new RegExp(String.raw`<!--.*?(?:-->|$)|<${p}(?:\s[^>]*)?/?>|</${p}\s*>|<(${l})(\s[^>]*?)?(?:/>|>(.*?)</(\1\s*)>)|<(${g})(\s[^>]*?)?(?:/>|>(.*?)(?:</(${g}\s*)>|$))`,"gisu");return a.replace(d,(c,h,m,k,x,A,S,$,w)=>{let L=e.length,B="n";if(h)B="e",new Nt(h,m,k,x,r,A,e);else if(c.startsWith("<!--")){B="c";let j=c.endsWith("-->");new nt(c.slice(4,j?-3:void 0),j,r,e)}else A?new Je(A,S,$,w,r,e):new U(c,r,e);return`\0${L}${B}\x7F`})}});var ga,pa,ua,Et,he,We,jr,ps=b(()=>{"use strict";_();J();Q();P();ga=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),pa=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"]),ua=new Set(["strike","big","center","font","tt"]),jr=class extends y{constructor(e,t,n,i,s,o){super(void 0,s,o);T(this,Et);T(this,he);T(this,We);this.insertAt(t),this.setAttribute("name",e.toLowerCase()),v(this,Et,n),v(this,he,i),v(this,We,e)}get type(){return"html"}get selfClosing(){return u(this,he)}get closing(){return u(this,Et)}toString(e){return`<${this.closing?"/":""}${u(this,We)}${super.toString(e)}${u(this,he)?"/":""}>`}text(){let{closing:e}=this,t=u(this,We)+(e?"":super.text());return`<${e?"/":""}${t}${u(this,he)?"/":""}>`}getAttribute(e){return e==="padding"?u(this,We).length+(this.closing?2:1):super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){var s;let n=super.lint(e,t),i=new E(this,e);this.name==="h1"&&!this.closing&&n.push(N(this,i,"h1","<h1>")),this.closest("table-attrs")&&n.push(N(this,i,"parsing-order","HTML tag in table attributes"));try{this.findMatchingTag()}catch(o){if(o instanceof SyntaxError){let{message:l}=o,p=l.split(":")[0].toLowerCase(),g=N(this,i,"unmatched-tag",p);if(p==="unclosed tag"&&!this.closest("heading-title"))if(pa.has(this.name)){let d=(s=this.parentNode)==null?void 0:s.childNodes,c=d==null?void 0:d.indexOf(this);d!=null&&d.slice(0,c).some(({type:h,name:m})=>h==="html"&&m===this.name)||(g.severity="warning")}else g.severity="warning";else if(p==="unmatched closing tag"){let d=this.closest("magic-word");d&&ga.has(d.name)?g.severity="warning":g.suggestions=[{desc:"remove",range:[e,g.endIndex],text:""}]}else if(p==="tag that is both closing and self-closing"){let{html:[,,d]}=this.getAttribute("config");d.includes(this.name)&&(g.fix={range:[e+1,e+2],text:""})}n.push(g)}}return ua.has(this.name)&&n.push(N(this,i,"obsolete-tag","obsolete HTML tag","warning")),(this.name==="b"||this.name==="strong")&&this.closest("heading-title")&&n.push(N(this,i,"bold-header","bold in section header","warning")),n}findMatchingTag(){let{html:[e,t,n]}=this.getAttribute("config"),{name:i,parentNode:s,closing:o}=this,l=li(this.toString());if(o&&(u(this,he)||n.includes(i)))throw new SyntaxError(`Tag that is both closing and self-closing: ${l}`);if(n.includes(i)||u(this,he)&&t.includes(i))return this;if(u(this,he)&&e.includes(i))throw new SyntaxError(`Invalid self-closing tag: ${l}`);if(!s)return;let{childNodes:p}=s,g=p.indexOf(this),d=(o?p.slice(0,g).reverse():p.slice(g+1)).filter(h=>h.type==="html"&&h.name===i),c=o?-1:1;for(let h of d)if(u(h,Et)?c--:c++,c===0)return h;throw new SyntaxError(`${o?"Unmatched closing":"Unclosed"} tag: ${l}`)}print(){return super.print({pre:`<${this.closing?"/":""}${u(this,We)}`,post:`${u(this,he)?"/":""}>`})}json(){let e=super.json();return Object.assign(e,{closing:this.closing,selfClosing:u(this,he)}),e}};Et=new WeakMap,he=new WeakMap,We=new WeakMap});var us={};se(us,{parseHtml:()=>ca});var ca,cs=b(()=>{"use strict";Tr();ps();ca=(a,r,e)=>{let t=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,{html:n}=r,i=new Set([...n[0],...n[1],...n[2]]),s=a.split("<"),o=s.shift();for(let l of s){let p=t.exec(l),g=p==null?void 0:p[2],d=g==null?void 0:g.toLowerCase();if(!p||!i.has(d)){o+=`<${l}`;continue}let[,c,,h="",m,k]=p,{length:x}=e,A=new ze(h,"html-attrs",d,r,e),S=A.getAttr("itemprop");if(d==="meta"&&(S===void 0||A.getAttr("content")===void 0)||d==="link"&&(S===void 0||A.getAttr("href")===void 0)){o+=`<${l}`,e.length=x;continue}o+=`\0${e.length}x\x7F${k}`,new jr(g,A,c==="/",m==="/>",r,e)}return o}});var hs,fs=b(()=>{"use strict";be();hs=(a=0)=>(r,e)=>{var n,ms;class t extends r{constructor(){super(...arguments);T(this,n)}getAttr(l){return u(this,n,ms).getAttr(l)}}return n=new WeakSet,ms=function(){return this.childNodes[a]},hr(t,r),t}});var Lt,An=b(()=>{"use strict";fs();F();P();ut();Tr();Lt=class extends hs(1)(y){constructor(r,e,t,n,i=f.getConfig(),s=[],o){super(void 0,i,s,o),this.append(new ce(e,r,"table-syntax",i,s,{}),new ze(n,"table-attrs",t,i,s))}}});var me,nr,st,wn,xs,it,Sn=b(()=>{"use strict";_();Se();be();Q();F();P();An();it=class extends Lt{constructor(e,t,n=f.getConfig(),i=[]){var p;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,n,i);T(this,st);T(this,me,"");T(this,nr);s&&([dr(this,me)._]=s);let l=new y(t==null?void 0:t.slice(((p=s==null?void 0:s.index)!=null?p:NaN)+u(this,me).length),n,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 R(this,st,wn).call(this).subtype}afterBuild(){u(this,me).includes("\0")&&v(this,me,this.buildFromStr(u(this,me),0)),super.afterBuild()}toString(e){let{childNodes:[t,n,i]}=this;return t.toString(e)+n.toString(e)+u(this,me)+i.toString(e)}text(){let{childNodes:[e,t,n]}=this;return e.text()+t.text()+u(this,me)+n.text()}getGaps(e){return e===1?u(this,me).length:0}lint(e=this.getAbsoluteIndex(),t){let n=super.lint(e,t),i=new E(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("||"),p=C(s,i,"pipe-like",'additional "|" in a table cell',l?"error":"warning");if(l){let g={caption:"|+",td:"|",th:"!"}[this.subtype];p.fix={range:[p.startIndex,p.endIndex],text:o.replace(/\|\|/gu,`
|
|
21
22
|
${g}`)}}else p.suggestions=[{desc:"escape",range:[p.startIndex,p.endIndex],text:o.replace(/\|/gu,"|")}];n.push(p)}}return n}isIndependent(){return this.firstChild.text().startsWith(`
|
|
22
|
-
`)}getAttr(e){let t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}print(){let{childNodes:[e,t,n]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${u(this,me)}${n.print()}</span>`}json(){let e=super.json();return e.subtype=this.subtype,e}};me=new WeakMap,
|
|
23
|
-
|}`,e){let t=this.getAttribute("config"),n=this.getAttribute("accum"),i=e?[r]:f.parse(r,this.getAttribute("include"),2,t).childNodes;ye.run(()=>{let s=new ce(void 0,
|
|
23
|
+
`)}getAttr(e){let t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}print(){let{childNodes:[e,t,n]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${u(this,me)}${n.print()}</span>`}json(){let e=super.json();return e.subtype=this.subtype,e}};me=new WeakMap,nr=new WeakMap,st=new WeakSet,wn=function(){var t;let{rev:e}=ye;return(t=u(this,nr))!=null||v(this,nr,[e,R(this,st,xs).call(this)]),u(this,nr)[1]},xs=function(){var o;let e=this.firstChild.text(),t=e.slice(-1),n="td";if(t==="!"?n="th":t==="+"&&(n="caption"),this.isIndependent())return{subtype:n};let{previousSibling:i}=this;return{...R(o=i,st,wn).call(o)}}});var It,Cn=b(()=>{"use strict";_();An();Sn();It=class extends Lt{lint(r=this.getAbsoluteIndex(),e){let t=super.lint(r,e),n=this.childNodes.find(({type:l})=>l==="table-inter");if(!n)return t;let i=n.childNodes.find(l=>l.text().trim()),s=/^\s*(?:!|\{\{\s*![!-]?\s*\}\})/u;if(!i||s.test(i.toString())||i.is("arg")&&s.test(i.default||""))return t;if(i.is("magic-word"))try{if(i.getPossibleValues().every(l=>s.test(l.text())))return t}catch(l){}let o=C(n,{start:r},"fostered-content","content to be moved out from the table");return o.severity=i.type==="template"?"warning":"error",o.startIndex++,o.startLine++,o.startCol=0,t.push(o),t}getRowCount(){return Number(this.childNodes.some(r=>r instanceof it&&r.isIndependent()&&!r.firstChild.text().endsWith("+")))}getNthCol(r,e){let t=0;for(let n of this.childNodes.slice(2))if(n instanceof it&&(n.isIndependent()&&(t=+(n.subtype!=="caption")),r-=t,r<0))return n}}});var ha,ma,$n,qr,bs=b(()=>{"use strict";_();be();Q();F();Cn();ut();ha=/^\n[^\S\n]*(?:\|\}|\{\{\s*!\s*\}\}\}|\{\{\s*!\)\s*\}\})$/u,ma=({type:a})=>a==="tr"||a==="table-syntax",$n=class extends Array{},qr=class extends It{get type(){return"table"}get closed(){return this.lastChild.type==="table-syntax"}constructor(r,e,t,n){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,r,"table",e,t,n,{})}lint(r=this.getAbsoluteIndex(),e){let t=super.lint(r,e),n=new E(this,r);this.closed||t.push(C(this.firstChild,n,"unclosed-table",f.msg("unclosed $1","table")));let i=this.getLayout(),{length:s}=i;if(s>1){let o=1,l=1/0,p=0;for(;p<s;p++){let g=i[p],d=g.length;if(d<o)break;d<l&&(l=d);let c=g.indexOf(g[d-1])+1;if(c>l)break;c>o&&(o=c)}if(p<s){let g=C(this.getNthRow(p),n,"table-layout","inconsistent table layout","warning");g.startIndex++,g.startLine++,g.startCol=0,t.push(g)}}return t}close(r=`
|
|
24
|
+
|}`,e){let t=this.getAttribute("config"),n=this.getAttribute("accum"),i=e?[r]:f.parse(r,this.getAttribute("include"),2,t).childNodes;ye.run(()=>{let s=new ce(void 0,ha,"table-syntax",t,n,{});super.insertAt(s)}),this.lastChild.replaceChildren(...i)}getLayout(r){let e=this.getAllRows(),{length:t}=e,n=new $n(...Ts(t,()=>[]));for(let[i,s]of n.entries()){let o=0,l=0,p;for(let g of e[i].childNodes.slice(2))if(g.type==="td"){if(g.isIndependent()&&(p=g.subtype!=="caption"),p){let d={row:i,column:o},{rowspan:c,colspan:h}=g;for(o++;s[l];)l++;for(let m=i;m<Math.min(i+c,t);m++)for(let k=l;k<l+h;k++)n[m][k]=d;l+=h}}else if(ma(g))break}return n}getAllRows(){return[...super.getRowCount()?[this]:[],...this.childNodes.slice(1).filter(r=>r.type==="tr"&&r.getRowCount()>0)]}getNthCell(r){var t;let e=r;return e&&((t=this.getNthRow(e.row,!1,!1))==null?void 0:t.getNthCol(e.column))}getNthRow(r,e,t){let n=super.getRowCount();if(r===0&&n)return this;n&&r--;for(let i of this.childNodes.slice(2))if(i.type==="tr"&&i.getRowCount()&&(r--,r<0))return i}json(){let r=super.json();return r.closed=this.closed,r}}});var _r,ys=b(()=>{"use strict";Cn();_r=class extends It{get type(){return"tr"}constructor(r,e,t,n){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,r,"tr",e,t,n,{})}}});var Ft,Nn=b(()=>{"use strict";_e();Ft=class extends re{}});var Rt,En=b(()=>{"use strict";Nn();Rt=class extends Ft{get type(){return"dd"}}});var ks={};se(ks,{parseTable:()=>xa});var fa,xa,vs=b(()=>{"use strict";P();bs();ys();Sn();En();fa=a=>a.lastChild.constructor!==y,xa=({firstChild:{data:a},type:r,name:e},t,n)=>{let i=[],s=a.split(`
|
|
24
25
|
`),o=r==="root"||r==="parameter-value"||r==="ext-inner"&&e==="poem"?"":`
|
|
25
|
-
${s.shift()}`,
|
|
26
|
-
${c}${w&&`\0${n.length-1}d\x7F`}${L}\0${n.length}b\x7F`,
|
|
27
|
-
${
|
|
28
|
-
${
|
|
29
|
-
${c}${x}`,!0),p($,i[i.length-1])}else if(A){
|
|
30
|
-
${c}${A}`,$,t,n);i.push(
|
|
31
|
-
${c}${S}`,q=D=>{let H=new rt(j,$.slice(B,L==null?void 0:L.index),t,n);return D.insertAt(H),H};for(;L;)q(a),{lastIndex:B}=w,[j]=L,L=w.exec($);i.push(a,q(a))}}return o.slice(1)}});var qr,ds=b(()=>{"use strict";qe();qr=class extends re{get type(){return"hr"}}});var gs,$n,Wo,it,ps=b(()=>{"use strict";He();F();qe();gs=[ue()];it=class extends(Wo=re){get type(){return"double-underscore"}constructor(r,e,t=f.getConfig(),n){super(r,t,n)}getAttribute(r){return r==="padding"?2:super.getAttribute(r)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}};$n=le(Wo),it=ge($n,0,"DoubleUnderscoreToken",gs,it),de($n,1,it)});var us={};se(us,{parseHrAndDoubleUnderscore:()=>Uo});var Uo,cs=b(()=>{"use strict";ds();ps();dn();Uo=({firstChild:{data:d},type:r,name:e},t,n)=>{var a;let{doubleUnderscore:i}=t,s=new Set(i[0]),o=new Set(i[1]);return(a=t.regexHrAndDoubleUnderscore)!=null||(t.regexHrAndDoubleUnderscore=new RegExp(`__(${[...s,...o].join("|")})__`,"giu")),r!=="root"&&(r!=="ext-inner"||e!=="poem")&&(d=`\0${d}`),d=d.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(p,g,l)=>(new qr(l,t,n),`${g}\0${n.length-1}r\x7F`)).replace(t.regexHrAndDoubleUnderscore,(p,g)=>{var m,k;let l=o.has(g),c=g.toLowerCase(),h=s.has(c);return l||h?(new it(g,l,t,n),`\0${n.length-1}${h&&((k=(m=i[2])==null?void 0:m[c])!=null?k:c)==="toc"?"u":"n"}\x7F`):p}).replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(p,g,l,c,h)=>{let m=`${g}\0${n.length}h\x7F`;return new yt(l.length,[c,h],t,n),m}),r==="root"||r==="ext-inner"&&e==="poem"?d:d.slice(1)}});var _r,hs=b(()=>{"use strict";_();Q();F();qe();_r=class extends re{get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}text(){let{parentNode:r,innerText:e}=this;return(r==null?void 0:r.type)==="image-parameter"&&r.name!=="caption"?"":e}lint(r=this.getAbsoluteIndex()){let{previousSibling:e,nextSibling:t,bold:n}=this,i=f.msg('lonely "$1"',"'"),s=[],o=new E(this,r),a,p=(g,l,c)=>({desc:"escape",range:[g,l],text:"'".repeat(c)});if((e==null?void 0:e.type)==="text"&&e.data.endsWith("'")){a=N(this,o,"lonely-apos",i);let{startIndex:g,startLine:l,startCol:c}=a,[,{length:h}]=/(?:^|[^'])('+)$/u.exec(e.data),m=r-h;s.push({...a,startIndex:m,endIndex:g,startCol:c-h,endLine:l,endCol:c,suggestions:[p(m,g,h)]})}if((t==null?void 0:t.type)==="text"&&t.data.startsWith("'")){a!=null||(a=N(this,o,"lonely-apos",i));let{endIndex:g,endLine:l,endCol:c}=a,[{length:h}]=/^'+/u.exec(t.data),m=g+h;s.push({...a,startIndex:g,endIndex:m,startLine:l,startCol:c,endCol:c+h,suggestions:[p(g,m,h)]})}return n&&this.closest("heading-title")&&s.push(N(this,o,"bold-header","bold in section header","warning")),s}json(){let r=super.json();return Object.assign(r,{bold:this.bold,italic:this.italic}),r}}});var ms={};se(ms,{parseQuotes:()=>Nn});var Nn,En=b(()=>{"use strict";hs();Nn=(d,r,e)=>{var g;let t=d.split(/('{2,})/u),{length:n}=t;if(n===1)return d;let i=0,s=0,o,a,p;for(let l=1;l<n;l+=2){let c=t[l].length;switch(c){case 2:s++;break;case 4:t[l-1]+="'",t[l]="'''";case 3:if(i++,o!==void 0)break;t[l-1].endsWith(" ")?a===void 0&&p===void 0&&(p=l):t[l-1].slice(-2,-1)===" "?o=l:a!=null||(a=l);break;default:t[l-1]+="'".repeat(c-5),t[l]="'''''",s++,i++}}if(s%2===1&&i%2===1){let l=(g=o!=null?o:a)!=null?g:p;l!==void 0&&(t[l]="''",t[l-1]+="'")}for(let l=1;l<n;l+=2)new _r(t[l],r,e),t[l]=`\0${e.length-1}q\x7F`;return t.join("")}});var fs={};se(fs,{parseExternalLinks:()=>Ln});var Ln,In=b(()=>{"use strict";K();fn();Er();Ln=(d,r,e,t)=>{var n;return(n=r.regexExternalLinks)!=null||(r.regexExternalLinks=new RegExp(String.raw`\[(\0\d+f\x7F|(?:(?:${r.protocol}|//)${Ae}|\0\d+m\x7F)${we}(?=[[\]<>"\t\p{Zs}]|\0\d))(\p{Zs}*(?!\p{Zs}))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),d.replace(r.regexExternalLinks,(i,s,o,a)=>{let{length:p}=e,g=/&[lg]t;/u.exec(s);return g&&(s=s.slice(0,g.index),o="",a=s.slice(g.index)+o+a),t?(new Le(s,"ext-link-url",r,e),`[\0${p}f\x7F${o}${a}]`):(new St(s,o,a,r,e),`\0${p}w\x7F`)})}});var Or,xs=b(()=>{"use strict";Dt();Or=class extends Ce{get type(){return"category"}}});var Ts={};se(Ts,{parseLinks:()=>bs});var Do,bs,ys=b(()=>{"use strict";F();En();In();mn();cn();xs();Do=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)(.*)$/su,bs=(d,r,e)=>{var s;(s=r.regexLinks)!=null||(r.regexLinks=new RegExp(String.raw`^\s*(?:${r.protocol}|//)`,"iu"));let t=r.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)(.*?[^\]]))?\]\](.*)$/su:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)(.*?[^\]])?)?\]\](.*)$/su,n=d.split("[["),i=n.shift();for(let o=0;o<n.length;o++){let a=!1,p,g,l,c,h=n[o],m=t.exec(h);if(m)[,p,g,l,c]=m,c.startsWith("]")&&(l!=null&&l.includes("["))&&(l+="]",c=c.slice(1));else{let L=Do.exec(h);L&&(a=!0,[,p,g,l]=L)}if(p===void 0||r.regexLinks.test(p)||/\0\d+[exhbru]\x7F/u.test(p)){i+=`[[${h}`;continue}let k=p.trim().startsWith(":");if(k&&a){i+=`[[${h}`;continue}let x=f.normalizeTitle(p,0,!1,r,!0,!0,!0),{ns:A,valid:S,interwiki:$}=x;if(S){if(a){if($||A!==6){i+=`[[${h}`;continue}let L=!1;for(o++;o<n.length;o++){let B=n[o],j=B.split("]]");if(j.length>2){L=!0,l+=`[[${j[0]}]]${j[1]}`,c=j.slice(2).join("]]");break}else if(j.length===2)l+=`[[${j[0]}]]${j[1]}`;else{l+=`[[${B}`;break}}if(l=bs(l,r,e),!L){i+=`[[${p}${g}${l}`;continue}}}else{i+=`[[${h}`;continue}l&&(l=Nn(l,r,e));let w=wt;k||(!$&&A===6?(l&&(l=Ln(l,r,e,!0)),w=vt):!$&&A===14&&(w=Or)),l===void 0&&g&&(l=""),i+=`\0${e.length}l\x7F${c}`,new w(p,l,r,e,g)}return i}});var ws={};se(ws,{parseMagicLinks:()=>Vo});var As,ks,vs,Ho,Vo,Ss=b(()=>{"use strict";K();Er();As=String.raw`[\p{Zs}\t]| |�*160;|�*a0;`,ks=`(?:${As})+`,vs=`(?:${As}|-)`,Ho=String.raw`(?:RFC|PMID)${ks}\d+\b|ISBN${ks}(?:97[89]${vs}?)?(?:\d${vs}?){9}[\dx]\b`,Vo=(d,r,e)=>{var t;return(t=r.regexMagicLinks)!=null||(r.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\d_])(?:(?:${r.protocol})(${Ae}${we})|${Ho})`,"giu")),d.replace(r.regexMagicLinks,(n,i,s)=>{let o=i?n.slice(i.length):n;if(s){let a="",p=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(o);p&&(a=o.slice(p.index),o=o.slice(0,p.index));let g=o.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,l=g.exec(o);if(l){let c=1;l[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(o.slice(0,l.index))&&(c=2),a=o.slice(l.index+c)+a,o=o.slice(0,l.index+c)}return a.length>=s.length?n:(new Le(o,void 0,r,e),`${i}\0${e.length-1}w\x7F${a}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(o))return n;return new Le(o,"magic-link",r,e),`${i}\0${e.length-1}i\x7F`})}});var Cs,$s=b(()=>{"use strict";Cs=(d,r)=>d.startsWith(r)?r.length:[...r].findIndex((e,t)=>e!==d[t])});var Mr,Ns=b(()=>{"use strict";Sn();Mr=class extends It{get type(){return"list"}}});var Es={};se(Es,{parseList:()=>Xo});var Xo,Ls=b(()=>{"use strict";$s();Ns();Cn();Xo=(d,r,e,t)=>{let n=/^((?:\0\d+[cno]\x7F)*)([;:*#]+\s*)/u.exec(d);if(!n)return r.lastPrefix="",d;let[i,s,o]=n,a=o.replace(/;/gu,":"),p=Cs(a,r.lastPrefix),g=(p>1?o.slice(p-1):o).split(/(?=;)/u),l=g[0].startsWith(";"),c=g.length-(l?0:1);if(p>1){let q=o.slice(0,p-1);l?g.unshift(q):g[0]=q+g[0]}r.lastPrefix=a;let h=s+g.map((q,D)=>`\0${t.length+D}d\x7F`).join("")+d.slice(i.length);for(let q of g)new Mr(q,e,t);if(!c)return h;let{html:[m]}=e,k=/:+|-\{|\0\d+[xq]\x7F/gu,x=k,A=x.exec(h),S=0,$=!1,w=!1,L=0,B=(q,D)=>(new Ft(q,e,t),`${h.slice(0,D)}\0${t.length-1}d\x7F${h.slice(D+q.length)}`),j=q=>{q?S&&S--:S++};for(;A&&c;){let{0:q,index:D}=A;if(q==="-{"){if(!L){let{lastIndex:H}=x;x=/-\{|\}-/gu,x.lastIndex=H}L++}else if(q==="}-"){if(L--,!L){let{lastIndex:H}=x;x=k,x.lastIndex=H}}else if(q.endsWith("x\x7F")){let{name:H,closing:ne,selfClosing:ee}=t[Number(q.slice(1,-2))];(!ee||m.includes(H))&&j(ne)}else if(q.endsWith("q\x7F")){let{bold:H,italic:ne}=t[Number(q.slice(1,-2))];H&&(j($),$=!$),ne&&(j(w),w=!w)}else if(S===0){if(q.length>=c)return B(q.slice(0,c),D);c-=q.length,x.lastIndex=D+4+String(t.length).length,h=B(q,D)}A=x.exec(h)}return h}});var Is,Fe,Gr,Fs=b(()=>{"use strict";_();Q();F();P();Ee();Is=new Set(["A","T","R","D","-","H","N"]),Gr=class extends y{constructor(e,t=f.getConfig(),n=[]){super(void 0,t,n,{});T(this,Fe);this.append(...e.map(i=>new G(i,"converter-flag",t,n)))}get type(){return"converter-flags"}afterBuild(){v(this,Fe,this.childNodes.map(e=>e.text().trim())),super.afterBuild()}toString(e){return super.toString(e,";")}text(){return super.text(";")}getGaps(){return 1}getUnknownFlags(){return new Set(u(this,Fe).filter(e=>/\{{3}[^{}]+\}{3}/u.test(e)))}getVariantFlags(){let e=new Set(this.getAttribute("config").variants);return new Set(u(this,Fe).filter(t=>e.has(t)))}lint(e=this.getAbsoluteIndex(),t){let n=this.getVariantFlags(),i=this.getUnknownFlags(),s=new Set(u(this,Fe).filter(l=>Is.has(l))),o=u(this,Fe).filter(l=>!l).length,a=u(this,Fe).length-i.size-o,p=super.lint(e,t);if(n.size===a||s.size===a)return p;let g=new E(this,e);for(let[l,c]of this.childNodes.entries()){let h=c.text().trim();if(h&&!n.has(h)&&!i.has(h)&&(n.size>0||!s.has(h))){let m=C(c,g,"no-ignored","invalid conversion flag");n.size===0&&Is.has(h.toUpperCase())?m.fix={range:[m.startIndex,m.endIndex],text:h.toUpperCase()}:m.suggestions=[{desc:"remove",range:[m.startIndex-(l&&1),m.endIndex],text:""}],p.push(m)}}return p}print(){return super.print({sep:";"})}};Fe=new WeakMap});var Rt,Rs=b(()=>{"use strict";F();P();Ee();Rt=class extends y{get type(){return"converter-rule"}constructor(r,e=!0,t=f.getConfig(),n=[]){super(void 0,t,n);let i=r.indexOf(":"),s=r.slice(0,i).indexOf("=>"),o=s===-1?r.slice(0,i):r.slice(s+2,i);e&&t.variants.includes(o.trim())?(super.insertAt(new G(o,"converter-rule-variant",t,n)),super.insertAt(new G(r.slice(i+1),"converter-rule-to",t,n)),s!==-1&&super.insertAt(new G(r.slice(0,s),"converter-rule-from",t,n),0)):super.insertAt(new G(r,"converter-rule-to",t,n))}toString(r){let{childNodes:e,firstChild:t,lastChild:n}=this;return e.length===3?`${t.toString(r)}=>${e[1].toString(r)}:${n.toString(r)}`:super.toString(r,":")}text(){let{childNodes:r,firstChild:e,lastChild:t}=this;return r.length===3?`${e.text()}=>${r[1].text()}:${t.text()}`:super.text(":")}getGaps(r){return r===0&&this.length===3?2:1}print(){let{childNodes:r}=this;if(r.length===3){let[e,t,n]=r;return`<span class="wpb-converter-rule">${e.print()}=>${t.print()}:${n.print()}</span>`}return super.print({sep:":"})}}});var zr,Ps=b(()=>{"use strict";K();F();P();Fs();Rs();zr=class extends y{get type(){return"converter"}constructor(r,e,t=f.getConfig(),n=[]){super(void 0,t,n),this.append(new Gr(r,t,n));let[i]=e,s=i.includes(":"),o=new Rt(i,s,t,n);s&&o.length===1||!s&&e.length===2&&!te(e[1]).trim()?this.insertAt(new Rt(e.join(";"),!1,t,n)):this.append(o,...e.slice(1).map(a=>new Rt(a,!0,t,n)))}toString(r){let{childNodes:[e,...t]}=this;return`-{${e.toString(r)}${e.length>0?"|":""}${t.map(n=>n.toString(r)).join(";")}}-`}text(){let{childNodes:[r,...e]}=this;return`-{${r.text()}|${pe(e,";")}}-`}getAttribute(r){return r==="padding"?2:super.getAttribute(r)}getGaps(r){return r||this.firstChild.length>0?1:0}print(){let{childNodes:[r,...e]}=this;return`<span class="wpb-converter">-{${r.print()}${r.length>0?"|":""}${Ne(e,{sep:";"})}}-</span>`}}});var Bs={};se(Bs,{parseConverter:()=>Qo});var Qo,js=b(()=>{"use strict";Ps();Qo=(d,r,e)=>{var a;(a=r.regexConverter)!=null||(r.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${r.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"u"));let t=/-\{/gu,n=/-\{|\}-/gu,i=[],s=t,o=s.exec(d);for(;o;){let{0:p,index:g}=o;if(p==="}-"){let l=i.pop(),{length:c}=e,h=d.slice(l.index+2,g),m=h.indexOf("|"),[k,x]=m===-1?[[],h]:[h.slice(0,m).split(";"),h.slice(m+1)],A=x.replace(/(&[#a-z\d]+);/giu,"$1"),S=A.split(r.regexConverter).map($=>$.replace(/\x01/gu,";"));new zr(k,S,r,e),d=`${d.slice(0,l.index)}\0${c}v\x7F${d.slice(g+2)}`,i.length===0&&(s=t),s.lastIndex=l.index+3+String(c).length}else i.push(o),s=n,s.lastIndex=g+2;o=s.exec(d)}return d}});var Wr={};se(Wr,{Token:()=>y});var nr,fe,O,z,st,Pt,ir,M,qs,_s,Os,Ms,Gs,zs,Ws,Us,Ds,Hs,Vs,Xs,Fn,y,P=b(()=>{"use strict";K();Se();be();_();F();ei();ni();Fn=class Fn extends gr{constructor(e,t=f.getConfig(),n=[],i){super();T(this,M);T(this,nr,"plain");T(this,fe,0);T(this,O);T(this,z);T(this,st);T(this,Pt,!1);T(this,ir);typeof e=="string"&&this.insertAt(e),v(this,O,t),v(this,z,n),n.push(this)}get type(){return u(this,nr)}set type(e){v(this,nr,e)}parseOnce(e=u(this,fe),t=!1){if(e<u(this,fe)||this.length===0||!this.getAttribute("plain"))return this;if(u(this,fe)>=11)return this;switch(e){case 0:if(this.type==="root"){u(this,z).pop();let n=R(this,M,qs).call(this);t&&(t=!n)}v(this,st,t),R(this,M,_s).call(this,t);break;case 1:R(this,M,Os).call(this);break;case 2:R(this,M,Ms).call(this);break;case 3:R(this,M,Gs).call(this);break;case 4:R(this,M,zs).call(this);break;case 5:R(this,M,Ws).call(this);break;case 6:R(this,M,Us).call(this);break;case 7:R(this,M,Ds).call(this);break;case 8:R(this,M,Hs).call(this);break;case 9:R(this,M,Vs).call(this);break;case 10:R(this,M,Xs).call(this)}if(this.type==="root")for(let n of u(this,z))n==null||n.parseOnce(e,t);return lr(this,fe)._++,this}buildFromStr(e,t){let n=e.split(/[\0\x7F]/u).map((i,s)=>{if(s%2===0)return new zt(i);if(isNaN(i.slice(-1)))return u(this,z)[Number(i.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${i}`)});return t===0?n.map(String).join(""):t===1?pe(n):n}build(){v(this,fe,11);let{length:e,firstChild:t}=this,n=t==null?void 0:t.toString();if(e===1&&t.type==="text"&&n.includes("\0")&&(this.replaceChildren(...this.buildFromStr(n)),this.normalize(),this.type==="root"))for(let i of u(this,z))i==null||i.build()}afterBuild(){if(this.type==="root")for(let e of u(this,z))e==null||e.afterBuild();v(this,Pt,!0)}parse(e=11,t){for(e=Math.min(e,11);u(this,fe)<e;)this.parseOnce(u(this,fe),t);return e&&(this.build(),this.afterBuild()),this}getAttribute(e){var t;switch(e){case"plain":return this.constructor===Fn;case"config":return u(this,O);case"include":return(t=u(this,st))!=null?t:!!u(this.getRootNode(),st);case"accum":return u(this,z);case"built":return u(this,Pt);default:return super.getAttribute(e)}}setAttribute(e,t){switch(e){case"stage":u(this,fe)===0&&this.type==="root"&&u(this,z).shift(),v(this,fe,t);break;default:super.setAttribute(e,t)}}insertAt(e,t=this.length){let n=typeof e=="string"?new zt(e):e;return super.insertAt(n,t),n.type==="root"&&(n.type="plain"),n}normalizeTitle(e,t=0,n,i,s){return f.normalizeTitle(e,t,u(this,st),u(this,O),n,i,s)}lint(e=this.getAbsoluteIndex(),t){var i;let n=super.lint(e,t);if(this.type==="root"){let s={},o="category,html-attr#id,ext-attr#id,table-attr#id";for(let m of this.querySelectorAll(o)){let k;if(m.type==="category")k=m.name;else{let A=m.getValue();k=`#${A===!0?"":A}`}let x=s[k];x?x.add(m):s[k]=new Set([m])}for(let[m,k]of Object.entries(s))if(k.size>1&&!m.startsWith("#mw-customcollapsible-")){let x=!m.startsWith("#"),A=`duplicated ${x?"category":"id"}`,S=x?"error":"warning";n.push(...[...k].map($=>{let w=N($,{start:$.getAbsoluteIndex()},"no-duplicate",A,S);return x&&(w.suggestions=[{desc:"remove",range:[w.startIndex,w.endIndex],text:""}]),w}))}let a=/<!--\s*lint-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->/gu,p=this.toString(),g=[],l=a.exec(p),c=0,h=0;for(;l;){let{1:m,index:k}=l,x=(i=l[2])==null?void 0:i.trim();h+=p.slice(c,k).split(`
|
|
32
|
-
`).length-1,c=k,g.push({line:h+(m==="disable-line"?0:1),from:m==="disable"?
|
|
26
|
+
${s.shift()}`,l,p=(d,c)=>{if(!c){o+=d;return}let{lastChild:h}=c;if(fa(c)){let m=new y(d,t,n);m.type="table-inter",m.setAttribute("stage",3),c.insertAt(m)}else h.setText(h.toString()+d)},g=()=>l.type==="td"?i.pop():l;for(let d of s){l=i.pop();let[c]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(d),h=d.slice(c.length),m=/^(:*)((?:\s|\0\d+[cn]\x7F)*)(\{\||\{(?:\0\d+[cn]\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(h);if(m){for(;l&&l.type!=="td";)l=i.pop();let[,w,L,B,j]=m;w&&new Rt(w,t,n),p(`
|
|
27
|
+
${c}${w&&`\0${n.length-1}d\x7F`}${L}\0${n.length}b\x7F`,l),i.push(...l?[l]:[],new qr(B,j,t,n));continue}else if(!l){o+=`
|
|
28
|
+
${d}`;continue}let k=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(h);if(!k){p(`
|
|
29
|
+
${d}`,l),i.push(l);continue}let[,x,A,S,$]=k;if(x){for(;l.type!=="table";)l=i.pop();l.close(`
|
|
30
|
+
${c}${x}`,!0),p($,i[i.length-1])}else if(A){l=g(),l.type==="tr"&&(l=i.pop());let w=new _r(`
|
|
31
|
+
${c}${A}`,$,t,n);i.push(l,w),l.insertAt(w)}else{l=g();let w=S==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu,L=w.exec($),B=0,j=`
|
|
32
|
+
${c}${S}`,q=D=>{let H=new it(j,$.slice(B,L==null?void 0:L.index),t,n);return D.insertAt(H),H};for(;L;)q(l),{lastIndex:B}=w,[j]=L,L=w.exec($);i.push(l,q(l))}}return o.slice(1)}});var Or,As=b(()=>{"use strict";_e();Or=class extends re{get type(){return"hr"}}});var ws,Ln,ba,ot,Ss=b(()=>{"use strict";Xe();F();_e();ws=[ue()];ot=class extends(ba=re){get type(){return"double-underscore"}constructor(r,e,t=f.getConfig(),n){super(r,t,n)}getAttribute(r){return r==="padding"?2:super.getAttribute(r)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}};Ln=le(ba),ot=ge(Ln,0,"DoubleUnderscoreToken",ws,ot),de(Ln,1,ot)});var Cs={};se(Cs,{parseHrAndDoubleUnderscore:()=>Ta});var Ta,$s=b(()=>{"use strict";As();Ss();un();Ta=({firstChild:{data:a},type:r,name:e},t,n)=>{var l;let{doubleUnderscore:i}=t,s=new Set(i[0]),o=new Set(i[1]);return(l=t.regexHrAndDoubleUnderscore)!=null||(t.regexHrAndDoubleUnderscore=new RegExp(`__(${[...s,...o].join("|")})__`,"giu")),r!=="root"&&(r!=="ext-inner"||e!=="poem")&&(a=`\0${a}`),a=a.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(p,g,d)=>(new Or(d,t,n),`${g}\0${n.length-1}r\x7F`)).replace(t.regexHrAndDoubleUnderscore,(p,g)=>{var m,k;let d=o.has(g),c=g.toLowerCase(),h=s.has(c);return d||h?(new ot(g,d,t,n),`\0${n.length-1}${h&&((k=(m=i[2])==null?void 0:m[c])!=null?k:c)==="toc"?"u":"n"}\x7F`):p}).replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(p,g,d,c,h)=>{let m=`${g}\0${n.length}h\x7F`;return new kt(d.length,[c,h],t,n),m}),r==="root"||r==="ext-inner"&&e==="poem"?a:a.slice(1)}});var Mr,Ns=b(()=>{"use strict";_();Q();F();_e();Mr=class extends re{get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}text(){let{parentNode:r,innerText:e}=this;return(r==null?void 0:r.type)==="image-parameter"&&r.name!=="caption"?"":e}lint(r=this.getAbsoluteIndex()){let{previousSibling:e,nextSibling:t,bold:n}=this,i=f.msg('lonely "$1"',"'"),s=[],o=new E(this,r),l,p=(g,d,c)=>({desc:"escape",range:[g,d],text:"'".repeat(c)});if((e==null?void 0:e.type)==="text"&&e.data.endsWith("'")){l=N(this,o,"lonely-apos",i);let{startIndex:g,startLine:d,startCol:c}=l,[,{length:h}]=/(?:^|[^'])('+)$/u.exec(e.data),m=r-h;s.push({...l,startIndex:m,endIndex:g,startCol:c-h,endLine:d,endCol:c,suggestions:[p(m,g,h)]})}if((t==null?void 0:t.type)==="text"&&t.data.startsWith("'")){l!=null||(l=N(this,o,"lonely-apos",i));let{endIndex:g,endLine:d,endCol:c}=l,[{length:h}]=/^'+/u.exec(t.data),m=g+h;s.push({...l,startIndex:g,endIndex:m,startLine:d,startCol:c,endCol:c+h,suggestions:[p(g,m,h)]})}return n&&this.closest("heading-title")&&s.push(N(this,o,"bold-header","bold in section header","warning")),s}json(){let r=super.json();return Object.assign(r,{bold:this.bold,italic:this.italic}),r}}});var Es={};se(Es,{parseQuotes:()=>In});var In,Fn=b(()=>{"use strict";Ns();In=(a,r,e)=>{var g;let t=a.split(/('{2,})/u),{length:n}=t;if(n===1)return a;let i=0,s=0,o,l,p;for(let d=1;d<n;d+=2){let c=t[d].length;switch(c){case 2:s++;break;case 4:t[d-1]+="'",t[d]="'''";case 3:if(i++,o!==void 0)break;t[d-1].endsWith(" ")?l===void 0&&p===void 0&&(p=d):t[d-1].slice(-2,-1)===" "?o=d:l!=null||(l=d);break;default:t[d-1]+="'".repeat(c-5),t[d]="'''''",s++,i++}}if(s%2===1&&i%2===1){let d=(g=o!=null?o:l)!=null?g:p;d!==void 0&&(t[d]="''",t[d-1]+="'")}for(let d=1;d<n;d+=2)new Mr(t[d],r,e),t[d]=`\0${e.length-1}q\x7F`;return t.join("")}});var Ls={};se(Ls,{parseExternalLinks:()=>Rn});var Rn,Pn=b(()=>{"use strict";J();Tn();Ir();Rn=(a,r,e,t)=>{var n;return(n=r.regexExternalLinks)!=null||(r.regexExternalLinks=new RegExp(String.raw`\[(\0\d+f\x7F|(?:(?:${r.protocol}|//)${Ae}|\0\d+m\x7F)${we}(?=[[\]<>"\t\p{Zs}]|\0\d))(\p{Zs}*(?!\p{Zs}))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),a.replace(r.regexExternalLinks,(i,s,o,l)=>{let{length:p}=e,g=/&[lg]t;/u.exec(s);return g&&(s=s.slice(0,g.index),o="",l=s.slice(g.index)+o+l),t?(new Le(s,"ext-link-url",r,e),`[\0${p}f\x7F${o}${l}]`):(new Ct(s,o,l,r,e),`\0${p}w\x7F`)})}});var Gr,Is=b(()=>{"use strict";Ht();Gr=class extends Ce{get type(){return"category"}}});var Rs={};se(Rs,{parseLinks:()=>Fs});var ya,Fs,Ps=b(()=>{"use strict";F();Fn();Pn();bn();fn();Is();ya=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)(.*)$/su,Fs=(a,r,e)=>{var s;(s=r.regexLinks)!=null||(r.regexLinks=new RegExp(String.raw`^\s*(?:${r.protocol}|//)`,"iu"));let t=r.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)(.*?[^\]]))?\]\](.*)$/su:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)(.*?[^\]])?)?\]\](.*)$/su,n=a.split("[["),i=n.shift();for(let o=0;o<n.length;o++){let l=!1,p,g,d,c,h=n[o],m=t.exec(h);if(m)[,p,g,d,c]=m,c.startsWith("]")&&(d!=null&&d.includes("["))&&(d+="]",c=c.slice(1));else{let L=ya.exec(h);L&&(l=!0,[,p,g,d]=L)}if(p===void 0||r.regexLinks.test(p)||/\0\d+[exhbru]\x7F/u.test(p)){i+=`[[${h}`;continue}let k=p.trim().startsWith(":");if(k&&l){i+=`[[${h}`;continue}let x=f.normalizeTitle(p,0,!1,r,!0,!0,!0),{ns:A,valid:S,interwiki:$}=x;if(S){if(l){if($||A!==6){i+=`[[${h}`;continue}let L=!1;for(o++;o<n.length;o++){let B=n[o],j=B.split("]]");if(j.length>2){L=!0,d+=`[[${j[0]}]]${j[1]}`,c=j.slice(2).join("]]");break}else if(j.length===2)d+=`[[${j[0]}]]${j[1]}`;else{d+=`[[${B}`;break}}if(d=Fs(d,r,e),!L){i+=`[[${p}${g}${d}`;continue}}}else{i+=`[[${h}`;continue}d&&(d=In(d,r,e));let w=St;k||(!$&&A===6?(d&&(d=Rn(d,r,e,!0)),w=At):!$&&A===14&&(w=Gr)),d===void 0&&g&&(d=""),i+=`\0${e.length}l\x7F${c}`,new w(p,d,r,e,g)}return i}});var _s={};se(_s,{parseMagicLinks:()=>va});var qs,Bs,js,ka,va,Os=b(()=>{"use strict";J();Ir();qs=String.raw`[\p{Zs}\t]| |�*160;|�*a0;`,Bs=`(?:${qs})+`,js=`(?:${qs}|-)`,ka=String.raw`(?:RFC|PMID)${Bs}\d+\b|ISBN${Bs}(?:97[89]${js}?)?(?:\d${js}?){9}[\dx]\b`,va=(a,r,e)=>{var t;return(t=r.regexMagicLinks)!=null||(r.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\d_])(?:(?:${r.protocol})(${Ae}${we})|${ka})`,"giu")),a.replace(r.regexMagicLinks,(n,i,s)=>{let o=i?n.slice(i.length):n;if(s){let l="",p=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(o);p&&(l=o.slice(p.index),o=o.slice(0,p.index));let g=o.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,d=g.exec(o);if(d){let c=1;d[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(o.slice(0,d.index))&&(c=2),l=o.slice(d.index+c)+l,o=o.slice(0,d.index+c)}return l.length>=s.length?n:(new Le(o,void 0,r,e),`${i}\0${e.length-1}w\x7F${l}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(o))return n;return new Le(o,"magic-link",r,e),`${i}\0${e.length-1}i\x7F`})}});var Ms,Gs=b(()=>{"use strict";Ms=(a,r)=>a.startsWith(r)?r.length:[...r].findIndex((e,t)=>e!==a[t])});var zr,zs=b(()=>{"use strict";Nn();zr=class extends Ft{get type(){return"list"}}});var Ws={};se(Ws,{parseList:()=>Aa});var Aa,Us=b(()=>{"use strict";Gs();zs();En();Aa=(a,r,e,t)=>{let n=/^((?:\0\d+[cno]\x7F)*)([;:*#]+\s*)/u.exec(a);if(!n)return r.lastPrefix="",a;let[i,s,o]=n,l=o.replace(/;/gu,":"),p=Ms(l,r.lastPrefix),g=(p>1?o.slice(p-1):o).split(/(?=;)/u),d=g[0].startsWith(";"),c=g.length-(d?0:1);if(p>1){let q=o.slice(0,p-1);d?g.unshift(q):g[0]=q+g[0]}r.lastPrefix=l;let h=s+g.map((q,D)=>`\0${t.length+D}d\x7F`).join("")+a.slice(i.length);for(let q of g)new zr(q,e,t);if(!c)return h;let{html:[m]}=e,k=/:+|-\{|\0\d+[xq]\x7F/gu,x=k,A=x.exec(h),S=0,$=!1,w=!1,L=0,B=(q,D)=>(new Rt(q,e,t),`${h.slice(0,D)}\0${t.length-1}d\x7F${h.slice(D+q.length)}`),j=q=>{q?S&&S--:S++};for(;A&&c;){let{0:q,index:D}=A;if(q==="-{"){if(!L){let{lastIndex:H}=x;x=/-\{|\}-/gu,x.lastIndex=H}L++}else if(q==="}-"){if(L--,!L){let{lastIndex:H}=x;x=k,x.lastIndex=H}}else if(q.endsWith("x\x7F")){let{name:H,closing:ne,selfClosing:ee}=t[Number(q.slice(1,-2))];(!ee||m.includes(H))&&j(ne)}else if(q.endsWith("q\x7F")){let{bold:H,italic:ne}=t[Number(q.slice(1,-2))];H&&(j($),$=!$),ne&&(j(w),w=!w)}else if(S===0){if(q.length>=c)return B(q.slice(0,c),D);c-=q.length,x.lastIndex=D+4+String(t.length).length,h=B(q,D)}A=x.exec(h)}return h}});var Ds,Fe,Wr,Hs=b(()=>{"use strict";_();Q();F();P();Ee();Ds=new Set(["A","T","R","D","-","H","N"]),Wr=class extends y{constructor(e,t=f.getConfig(),n=[]){super(void 0,t,n,{});T(this,Fe);this.append(...e.map(i=>new G(i,"converter-flag",t,n)))}get type(){return"converter-flags"}afterBuild(){v(this,Fe,this.childNodes.map(e=>e.text().trim())),super.afterBuild()}toString(e){return super.toString(e,";")}text(){return super.text(";")}getGaps(){return 1}getUnknownFlags(){return new Set(u(this,Fe).filter(e=>/\{{3}[^{}]+\}{3}/u.test(e)))}getVariantFlags(){let e=new Set(this.getAttribute("config").variants);return new Set(u(this,Fe).filter(t=>e.has(t)))}lint(e=this.getAbsoluteIndex(),t){let n=this.getVariantFlags(),i=this.getUnknownFlags(),s=new Set(u(this,Fe).filter(d=>Ds.has(d))),o=u(this,Fe).filter(d=>!d).length,l=u(this,Fe).length-i.size-o,p=super.lint(e,t);if(n.size===l||s.size===l)return p;let g=new E(this,e);for(let[d,c]of this.childNodes.entries()){let h=c.text().trim();if(h&&!n.has(h)&&!i.has(h)&&(n.size>0||!s.has(h))){let m=C(c,g,"no-ignored","invalid conversion flag");n.size===0&&Ds.has(h.toUpperCase())?m.fix={range:[m.startIndex,m.endIndex],text:h.toUpperCase()}:m.suggestions=[{desc:"remove",range:[m.startIndex-(d&&1),m.endIndex],text:""}],p.push(m)}}return p}print(){return super.print({sep:";"})}};Fe=new WeakMap});var Pt,Vs=b(()=>{"use strict";F();P();Ee();Pt=class extends y{get type(){return"converter-rule"}constructor(r,e=!0,t=f.getConfig(),n=[]){super(void 0,t,n);let i=r.indexOf(":"),s=r.slice(0,i).indexOf("=>"),o=s===-1?r.slice(0,i):r.slice(s+2,i);e&&t.variants.includes(o.trim())?(super.insertAt(new G(o,"converter-rule-variant",t,n)),super.insertAt(new G(r.slice(i+1),"converter-rule-to",t,n)),s!==-1&&super.insertAt(new G(r.slice(0,s),"converter-rule-from",t,n),0)):super.insertAt(new G(r,"converter-rule-to",t,n))}toString(r){let{childNodes:e,firstChild:t,lastChild:n}=this;return e.length===3?`${t.toString(r)}=>${e[1].toString(r)}:${n.toString(r)}`:super.toString(r,":")}text(){let{childNodes:r,firstChild:e,lastChild:t}=this;return r.length===3?`${e.text()}=>${r[1].text()}:${t.text()}`:super.text(":")}getGaps(r){return r===0&&this.length===3?2:1}print(){let{childNodes:r}=this;if(r.length===3){let[e,t,n]=r;return`<span class="wpb-converter-rule">${e.print()}=>${t.print()}:${n.print()}</span>`}return super.print({sep:":"})}}});var Ur,Xs=b(()=>{"use strict";J();F();P();Hs();Vs();Ur=class extends y{get type(){return"converter"}constructor(r,e,t=f.getConfig(),n=[]){super(void 0,t,n),this.append(new Wr(r,t,n));let[i]=e,s=i.includes(":"),o=new Pt(i,s,t,n);s&&o.length===1||!s&&e.length===2&&!te(e[1]).trim()?this.insertAt(new Pt(e.join(";"),!1,t,n)):this.append(o,...e.slice(1).map(l=>new Pt(l,!0,t,n)))}toString(r){let{childNodes:[e,...t]}=this;return`-{${e.toString(r)}${e.length>0?"|":""}${t.map(n=>n.toString(r)).join(";")}}-`}text(){let{childNodes:[r,...e]}=this;return`-{${r.text()}|${pe(e,";")}}-`}getAttribute(r){return r==="padding"?2:super.getAttribute(r)}getGaps(r){return r||this.firstChild.length>0?1:0}print(){let{childNodes:[r,...e]}=this;return`<span class="wpb-converter">-{${r.print()}${r.length>0?"|":""}${Ne(e,{sep:";"})}}-</span>`}}});var Qs={};se(Qs,{parseConverter:()=>wa});var wa,Zs=b(()=>{"use strict";Xs();wa=(a,r,e)=>{var l;(l=r.regexConverter)!=null||(r.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${r.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"u"));let t=/-\{/gu,n=/-\{|\}-/gu,i=[],s=t,o=s.exec(a);for(;o;){let{0:p,index:g}=o;if(p==="}-"){let d=i.pop(),{length:c}=e,h=a.slice(d.index+2,g),m=h.indexOf("|"),[k,x]=m===-1?[[],h]:[h.slice(0,m).split(";"),h.slice(m+1)],A=x.replace(/(&[#a-z\d]+);/giu,"$1"),S=A.split(r.regexConverter).map($=>$.replace(/\x01/gu,";"));new Ur(k,S,r,e),a=`${a.slice(0,d.index)}\0${c}v\x7F${a.slice(g+2)}`,i.length===0&&(s=t),s.lastIndex=d.index+3+String(c).length}else i.push(o),s=n,s.lastIndex=g+2;o=s.exec(a)}return a}});var Dr={};se(Dr,{Token:()=>y});var ir,fe,O,z,at,Bt,sr,M,Js,Ks,Ys,eo,to,ro,no,io,so,oo,ao,lo,Bn,y,P=b(()=>{"use strict";J();Se();be();_();F();hi();xi();Bn=class Bn extends ur{constructor(e,t=f.getConfig(),n=[],i){super();T(this,M);T(this,ir,"plain");T(this,fe,0);T(this,O);T(this,z);T(this,at);T(this,Bt,!1);T(this,sr);typeof e=="string"&&this.insertAt(e),v(this,O,t),v(this,z,n),n.push(this)}get type(){return u(this,ir)}set type(e){v(this,ir,e)}parseOnce(e=u(this,fe),t=!1){if(e<u(this,fe)||this.length===0||!this.getAttribute("plain"))return this;if(u(this,fe)>=11)return this;switch(e){case 0:if(this.type==="root"){u(this,z).pop();let n=R(this,M,Js).call(this);t&&(t=!n)}v(this,at,t),R(this,M,Ks).call(this,t);break;case 1:R(this,M,Ys).call(this);break;case 2:R(this,M,eo).call(this);break;case 3:R(this,M,to).call(this);break;case 4:R(this,M,ro).call(this);break;case 5:R(this,M,no).call(this);break;case 6:R(this,M,io).call(this);break;case 7:R(this,M,so).call(this);break;case 8:R(this,M,oo).call(this);break;case 9:R(this,M,ao).call(this);break;case 10:R(this,M,lo).call(this)}if(this.type==="root")for(let n of u(this,z))n==null||n.parseOnce(e,t);return dr(this,fe)._++,this}buildFromStr(e,t){let n=e.split(/[\0\x7F]/u).map((i,s)=>{if(s%2===0)return new Wt(i);if(isNaN(i.slice(-1)))return u(this,z)[Number(i.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${i}`)});return t===0?n.map(String).join(""):t===1?pe(n):n}build(){v(this,fe,11);let{length:e,firstChild:t}=this,n=t==null?void 0:t.toString();if(e===1&&t.type==="text"&&n.includes("\0")&&(this.replaceChildren(...this.buildFromStr(n)),this.normalize(),this.type==="root"))for(let i of u(this,z))i==null||i.build()}afterBuild(){if(this.type==="root")for(let e of u(this,z))e==null||e.afterBuild();v(this,Bt,!0)}parse(e=11,t){for(e=Math.min(e,11);u(this,fe)<e;)this.parseOnce(u(this,fe),t);return e&&(this.build(),this.afterBuild()),this}getAttribute(e){var t;switch(e){case"plain":return this.constructor===Bn;case"config":return u(this,O);case"include":return(t=u(this,at))!=null?t:!!u(this.getRootNode(),at);case"accum":return u(this,z);case"built":return u(this,Bt);default:return super.getAttribute(e)}}setAttribute(e,t){switch(e){case"stage":u(this,fe)===0&&this.type==="root"&&u(this,z).shift(),v(this,fe,t);break;default:super.setAttribute(e,t)}}insertAt(e,t=this.length){let n=typeof e=="string"?new Wt(e):e;return super.insertAt(n,t),n.type==="root"&&(n.type="plain"),n}normalizeTitle(e,t=0,n,i,s){return f.normalizeTitle(e,t,u(this,at),u(this,O),n,i,s)}lint(e=this.getAbsoluteIndex(),t){var i;let n=super.lint(e,t);if(this.type==="root"){let s={},o="category,html-attr#id,ext-attr#id,table-attr#id";for(let m of this.querySelectorAll(o)){let k;if(m.type==="category")k=m.name;else{let A=m.getValue();k=`#${A===!0?"":A}`}let x=s[k];x?x.add(m):s[k]=new Set([m])}for(let[m,k]of Object.entries(s))if(k.size>1&&!m.startsWith("#mw-customcollapsible-")){let x=!m.startsWith("#"),A=`duplicated ${x?"category":"id"}`,S=x?"error":"warning";n.push(...[...k].map($=>{let w=N($,{start:$.getAbsoluteIndex()},"no-duplicate",A,S);return x&&(w.suggestions=[{desc:"remove",range:[w.startIndex,w.endIndex],text:""}]),w}))}let l=/<!--\s*lint-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->/gu,p=this.toString(),g=[],d=l.exec(p),c=0,h=0;for(;d;){let{1:m,index:k}=d,x=(i=d[2])==null?void 0:i.trim();h+=p.slice(c,k).split(`
|
|
33
|
+
`).length-1,c=k,g.push({line:h+(m==="disable-line"?0:1),from:m==="disable"?l.lastIndex:void 0,to:m==="enable"?l.lastIndex:void 0,rules:x?new Set(x.split(",").map(A=>A.trim())):void 0}),d=l.exec(p)}n=n.filter(({rule:m,startLine:k,startIndex:x})=>{let A={pos:0};for(let{line:S,from:$,to:w,rules:L}of g){if(S>k+1)break;if(L&&!L.has(m))continue;if(S===k&&$===void 0&&w===void 0)return!1;$<=x&&$>A.pos?(A.pos=$,A.type="from"):w<=x&&w>A.pos&&(A.pos=w,A.type="to")}return A.type!=="from"})}return n}toString(e,t){var s;let{rev:n}=ye,i=this.getRootNode();return!e&&i.type==="root"&&u(i,Bt)?((s=u(this,sr))!=null||v(this,sr,[n,super.toString(!1,t)]),u(this,sr)[1]):super.toString(e,t)}};ir=new WeakMap,fe=new WeakMap,O=new WeakMap,z=new WeakMap,at=new WeakMap,Bt=new WeakMap,sr=new WeakMap,M=new WeakSet,Js=function(){let{parseRedirect:e}=(Ai(),Z(vi)),t=this.firstChild.toString(),n=e(t,u(this,O),u(this,z));return n&&this.setText(n),!!n},Ks=function(e){let{parseCommentAndExt:t}=(Qt(),Z(gs));this.setText(t(this.firstChild.toString(),u(this,O),u(this,z),e))},Ys=function(){let{parseBraces:e}=(Sr(),Z(Xi)),t=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,n=e(t,u(this,O),u(this,z));this.setText(this.type==="root"?n:n.slice(1))},eo=function(){var t;if((t=u(this,O).excludes)!=null&&t.includes("html"))return;let{parseHtml:e}=(cs(),Z(us));this.setText(e(this.firstChild.toString(),u(this,O),u(this,z)))},to=function(){var t;if((t=u(this,O).excludes)!=null&&t.includes("table"))return;let{parseTable:e}=(vs(),Z(ks));this.setText(e(this,u(this,O),u(this,z)))},ro=function(){var t;if((t=u(this,O).excludes)!=null&&t.includes("hr"))return;let{parseHrAndDoubleUnderscore:e}=($s(),Z(Cs));this.setText(e(this,u(this,O),u(this,z)))},no=function(){let{parseLinks:e}=(Ps(),Z(Rs));this.setText(e(this.firstChild.toString(),u(this,O),u(this,z)))},io=function(){var n;if((n=u(this,O).excludes)!=null&&n.includes("quote"))return;let{parseQuotes:e}=(Fn(),Z(Es)),t=this.firstChild.toString().split(`
|
|
33
34
|
`);for(let i=0;i<t.length;i++)t[i]=e(t[i],u(this,O),u(this,z));this.setText(t.join(`
|
|
34
|
-
`))},
|
|
35
|
+
`))},so=function(){var t;if((t=u(this,O).excludes)!=null&&t.includes("extLink"))return;let{parseExternalLinks:e}=(Pn(),Z(Ls));this.setText(e(this.firstChild.toString(),u(this,O),u(this,z)))},oo=function(){var t;if((t=u(this,O).excludes)!=null&&t.includes("magicLink"))return;let{parseMagicLinks:e}=(Os(),Z(_s));this.setText(e(this.firstChild.toString(),u(this,O),u(this,z)))},ao=function(){var s;if((s=u(this,O).excludes)!=null&&s.includes("list"))return;let{parseList:e}=(Us(),Z(Ws)),t=this.firstChild.toString().split(`
|
|
35
36
|
`),n={lastPrefix:""},i=this.type==="root"||this.type==="ext-inner"&&this.name==="poem"?0:1;for(;i<t.length;i++)t[i]=e(t[i],n,u(this,O),u(this,z));this.setText(t.join(`
|
|
36
|
-
`))},
|
|
37
|
+
`))},lo=function(){if(u(this,O).variants.length>0){let{parseConverter:e}=(Zs(),Z(Qs));this.setText(e(this.firstChild.toString(),u(this,O),u(this,z)))}};y=Bn});var ye,vt,sn,Ts,hr,be=b(()=>{"use strict";ye={running:!1,run(a){let{running:r}=this;this.running=!0;try{let{Token:e}=(P(),Z(Dr)),t=a();return t instanceof e&&!t.getAttribute("built")&&t.afterBuild(),this.running=r,t}catch(e){throw this.running=r,e}},rev:0},vt=a=>r=>r.type===a,sn=(a,r,e,t=[])=>{let n=[...a.childNodes],i=n.splice(r,e,...t);a.setAttribute("childNodes",n);for(let s of t)s.setAttribute("parentNode",a);return i},Ts=(a,r)=>new Array(a).fill(void 0).map((e,t)=>r(t)),hr=(a,r)=>{Object.defineProperty(a,"name",{value:r.name})}});var go={};se(go,{Title:()=>jn});var or,ar,jt,Re,jn,po=b(()=>{"use strict";J();jn=class{constructor(r,e,t,n,i){T(this,or);T(this,ar);T(this,jt);T(this,Re);X(this,"interwiki","");X(this,"valid");X(this,"encoded",!1);let s=r.trim().startsWith("../");if(n&&r.includes("%"))try{let l=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(r);r=(0,gr.rawurldecode)(r),this.encoded=l}catch(l){}if(r=Mt(r).replace(/[_ ]+/gu," ").trim(),s)v(this,jt,0);else{let l=e;r.startsWith(":")&&(l=0,r=r.slice(1).trim());let p=r.split(":");if(p.length>1){let g=p[0].trim().toLowerCase(),d=Object.prototype.hasOwnProperty.call(t.nsid,g)&&t.nsid[g];d&&(l=d,r=p.slice(1).join(":").trim())}v(this,jt,l)}let o=r.indexOf("#");if(o!==-1){let l=r.slice(o+1).trimEnd();if(l.includes("%"))try{l=(0,gr.rawurldecode)(l)}catch(p){}v(this,Re,l.replace(/ /gu,"_")),r=r.slice(0,o).trim()}this.valid=!!(r||this.interwiki||i&&this.ns===0&&u(this,Re)!==void 0)&&Mt(r)===r&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(s?/^(?:\.\.\/)+(.*)/u.exec(r)[1]:r),this.main=r,Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}}),v(this,ar,t.namespaces)}get ns(){return u(this,jt)}get fragment(){return u(this,Re)}get main(){return u(this,or)}set main(r){r=r.replace(/_/gu," ").trim(),v(this,or,r&&r[0].toUpperCase()+r.slice(1))}get prefix(){let r=u(this,ar)[this.ns];return r+(r&&":")}get title(){return this.getRedirection()[1]}get extension(){let{main:r}=this,e=r.lastIndexOf(".");return e===-1?void 0:r.slice(e+1).toLowerCase()}toString(r){return`${r?this.title.replace(/_/gu," "):this.title}${u(this,Re)===void 0?"":`#${u(this,Re)}`}`}getRedirection(){return[!1,(this.interwiki+(this.interwiki&&":")+this.prefix+this.main).replace(/ /gu,"_")]}setFragment(r){v(this,Re,r)}};or=new WeakMap,ar=new WeakMap,jt=new WeakMap,Re=new WeakMap});var qt,uo,Sa,f,F=b(()=>{Qn();be();Se();J();qt={config:Yr,i18n:void 0,rules:Xn,getConfig(){let{doubleUnderscore:a}=this.config;return a.length>2&&a[0].length===0&&(a[0]=Object.keys(a[2])),{...Yr,...this.config,excludes:[]}},msg(a,r=""){var e,t;return a&&((t=(e=this.i18n)==null?void 0:e[a])!=null?t:a).replace("$1",this.msg(r))},normalizeTitle(a,r=0,e,t=qt.getConfig(),n,i=!1,s=!1){let{Title:o}=(po(),Z(go)),l;if(n)l=new o(a,r,t,i,s);else{let{Token:p}=(P(),Z(Dr));l=ye.run(()=>{let g=new p(a,t);g.type="root",g.parseOnce(0,e).parseOnce();let d=new o(g.toString(),r,t,i,s);for(let c of["main","fragment"]){let h=d[c];if(h!=null&&h.includes("\0")){let m=g.buildFromStr(h,1);c==="main"?d.main=m:d.setFragment(m)}}return d})}return l},parse(a,r,e=11,t=qt.getConfig()){if(a=si(a),typeof e!="number"){let s=Array.isArray(e)?e:[e];e=Math.max(...s.map(o=>Zr[o]||11))}let{Token:n}=(P(),Z(Dr));return ye.run(()=>{let s=new n(a,t);return s.type="root",s.parse(e,r)})}},uo={},Sa=new Set(["normalizeTitle","parse"]);for(let a in qt)Sa.has(a)||(uo[a]={enumerable:!1});Object.defineProperties(qt,uo);Object.assign(globalThis,{Parser:qt});f=qt});F();})();
|
|
37
38
|
//# sourceMappingURL=bundle.min.js.map
|
package/config/default.json
CHANGED
|
@@ -383,7 +383,6 @@
|
|
|
383
383
|
"#匹配式": "ifeq",
|
|
384
384
|
"#若相等": "ifeq",
|
|
385
385
|
"#如果相等": "ifeq",
|
|
386
|
-
"#若表達式": "ifeq",
|
|
387
386
|
"#ifeq": "ifeq",
|
|
388
387
|
"#多选式": "switch",
|
|
389
388
|
"#多条件式": "switch",
|
|
@@ -397,6 +396,7 @@
|
|
|
397
396
|
"#如有": "ifexist",
|
|
398
397
|
"#ifexist": "ifexist",
|
|
399
398
|
"#若表达式": "ifexpr",
|
|
399
|
+
"#若表達式": "ifexpr",
|
|
400
400
|
"#ifexpr": "ifexpr",
|
|
401
401
|
"#错误式": "iferror",
|
|
402
402
|
"#如果错误": "iferror",
|
package/config/zhwiki.json
CHANGED
|
@@ -364,7 +364,6 @@
|
|
|
364
364
|
"#匹配式": "ifeq",
|
|
365
365
|
"#若相等": "ifeq",
|
|
366
366
|
"#如果相等": "ifeq",
|
|
367
|
-
"#若表達式": "ifeq",
|
|
368
367
|
"#ifeq": "ifeq",
|
|
369
368
|
"#多选式": "switch",
|
|
370
369
|
"#多条件式": "switch",
|
|
@@ -378,6 +377,7 @@
|
|
|
378
377
|
"#如有": "ifexist",
|
|
379
378
|
"#ifexist": "ifexist",
|
|
380
379
|
"#若表达式": "ifexpr",
|
|
380
|
+
"#若表達式": "ifexpr",
|
|
381
381
|
"#ifexpr": "ifexpr",
|
|
382
382
|
"#错误式": "iferror",
|
|
383
383
|
"#如果错误": "iferror",
|
package/dist/lib/node.d.ts
CHANGED
|
@@ -70,6 +70,12 @@ export declare abstract class AstNode implements AstNodeBase {
|
|
|
70
70
|
constructor();
|
|
71
71
|
/** 获取根节点 */
|
|
72
72
|
getRootNode(): Token | this;
|
|
73
|
+
/**
|
|
74
|
+
* 将行列号转换为字符位置
|
|
75
|
+
* @param top 行号
|
|
76
|
+
* @param left 列号
|
|
77
|
+
*/
|
|
78
|
+
indexFromPos(top: number, left: number): number | undefined;
|
|
73
79
|
/**
|
|
74
80
|
* 将字符位置转换为行列号
|
|
75
81
|
* @param index 字符位置
|
|
@@ -155,12 +161,6 @@ export declare abstract class AstNode implements AstNodeBase {
|
|
|
155
161
|
* @throws `RangeError` 不在同一个语法树
|
|
156
162
|
*/
|
|
157
163
|
compareDocumentPosition(other: AstNodes): number;
|
|
158
|
-
/**
|
|
159
|
-
* 将行列号转换为字符位置
|
|
160
|
-
* @param top 行号
|
|
161
|
-
* @param left 列号
|
|
162
|
-
*/
|
|
163
|
-
indexFromPos(top: number, left: number): number | undefined;
|
|
164
164
|
/** 获取当前节点的行列位置和大小 */
|
|
165
165
|
getBoundingClientRect(): Dimension & Position;
|
|
166
166
|
/** 销毁 */
|
package/dist/lib/node.js
CHANGED
|
@@ -195,6 +195,17 @@ class AstNode {
|
|
|
195
195
|
}
|
|
196
196
|
return parentNode ?? this;
|
|
197
197
|
}
|
|
198
|
+
/**
|
|
199
|
+
* 将行列号转换为字符位置
|
|
200
|
+
* @param top 行号
|
|
201
|
+
* @param left 列号
|
|
202
|
+
*/
|
|
203
|
+
indexFromPos(top, left) {
|
|
204
|
+
const lines = String(this).split('\n');
|
|
205
|
+
return top >= 0 && left >= 0 && top <= lines.length - 1 && left <= lines[top].length
|
|
206
|
+
? lines.slice(0, top).reduce((acc, cur) => acc + cur.length + 1, 0) + left
|
|
207
|
+
: undefined;
|
|
208
|
+
}
|
|
198
209
|
/**
|
|
199
210
|
* 将字符位置转换为行列号
|
|
200
211
|
* @param index 字符位置
|
|
@@ -439,17 +450,6 @@ class AstNode {
|
|
|
439
450
|
const aAncestors = [...this.getAncestors().reverse(), this], bAncestors = [...other.getAncestors().reverse(), other], depth = aAncestors.findIndex((ancestor, i) => bAncestors[i] !== ancestor), { childNodes } = aAncestors[depth - 1];
|
|
440
451
|
return childNodes.indexOf(aAncestors[depth]) - childNodes.indexOf(bAncestors[depth]);
|
|
441
452
|
}
|
|
442
|
-
/**
|
|
443
|
-
* 将行列号转换为字符位置
|
|
444
|
-
* @param top 行号
|
|
445
|
-
* @param left 列号
|
|
446
|
-
*/
|
|
447
|
-
indexFromPos(top, left) {
|
|
448
|
-
const lines = String(this).split('\n');
|
|
449
|
-
return top >= 0 && left >= 0 && top <= lines.length - 1 && left <= lines[top].length
|
|
450
|
-
? lines.slice(0, top).reduce((acc, cur) => acc + cur.length + 1, 0) + left
|
|
451
|
-
: undefined;
|
|
452
|
-
}
|
|
453
453
|
/** 获取当前节点的相对位置 */
|
|
454
454
|
#getPosition() {
|
|
455
455
|
return this.parentNode?.posFromIndex(this.getRelativeIndex()) ?? { top: 0, left: 0 };
|
package/dist/src/transclude.js
CHANGED
|
@@ -76,7 +76,7 @@ class TranscludeToken extends index_2.Token {
|
|
|
76
76
|
if (isFunction || parts.length === 0 && !this.#raw) {
|
|
77
77
|
const [magicWord, ...arg] = title.split(':'), cleaned = (0, string_1.removeComment)(magicWord), name = cleaned[arg.length > 0 ? 'trimStart' : 'trim'](), lcName = name.toLowerCase(), canonicalName = Object.prototype.hasOwnProperty.call(insensitive, lcName) && insensitive[lcName], isSensitive = sensitive.includes(name), isVar = isSensitive || insensitiveVars.has(canonicalName);
|
|
78
78
|
if (isVar || isFunction && canonicalName) {
|
|
79
|
-
this.setAttribute('name', canonicalName || lcName);
|
|
79
|
+
this.setAttribute('name', canonicalName || lcName.replace(/^#/u, ''));
|
|
80
80
|
this.#type = 'magic-word';
|
|
81
81
|
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
82
82
|
/^\s*uc\s*$/iu;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const commonHtmlAttrs: Set<string>, htmlAttrs: Record<string, Set<string>>, extAttrs: Record<string, Set<string>>, obsoleteAttrs: Record<string, Set<string>>;
|
package/dist/util/string.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.removeCommentLine = exports.newline = exports.sanitizeAlt = exports.sanitizeId = exports.sanitizeAttr = exports.sanitize = exports.normalizeSpace = exports.encode = exports.print = exports.escape = exports.noWrap = exports.decodeNumber = exports.decodeHtml = exports.text = exports.
|
|
3
|
+
exports.removeCommentLine = exports.newline = exports.sanitizeAlt = exports.sanitizeId = exports.sanitizeAttr = exports.sanitize = exports.normalizeSpace = exports.encode = exports.print = exports.escape = exports.noWrap = exports.decodeNumber = exports.decodeHtml = exports.text = exports.escapeRegExp = exports.removeComment = exports.tidy = exports.extUrlChar = exports.extUrlCharFirst = exports.rawurldecode = void 0;
|
|
4
|
+
var common_1 = require("@bhsd/common");
|
|
5
|
+
Object.defineProperty(exports, "rawurldecode", { enumerable: true, get: function () { return common_1.rawurldecode; } });
|
|
4
6
|
const commonExtUrlChar = String.raw `[^[\]<>"\0-\x1F\x7F\p{Zs}\uFFFD]`;
|
|
5
7
|
exports.extUrlCharFirst = String.raw `(?:\[[\da-f:.]+\]|${commonExtUrlChar})`;
|
|
6
8
|
exports.extUrlChar = String.raw `(?:${commonExtUrlChar}|\0\d+[cn!~]\x7F)*`;
|
|
@@ -16,12 +18,6 @@ exports.tidy = factory(/[\0\x7F]|\r$/gmu, '');
|
|
|
16
18
|
exports.removeComment = factory(/\0\d+[cn]\x7F/gu, '');
|
|
17
19
|
/** escape special chars for RegExp constructor */
|
|
18
20
|
exports.escapeRegExp = factory(/[\\{}()|.?*+^$[\]]/gu, String.raw `\$&`);
|
|
19
|
-
/**
|
|
20
|
-
* PHP的`rawurldecode`函数的JavaScript实现
|
|
21
|
-
* @param str 要解码的字符串
|
|
22
|
-
*/
|
|
23
|
-
const rawurldecode = (str) => decodeURIComponent(str.replace(/%(?![\da-f]{2})/giu, '%25'));
|
|
24
|
-
exports.rawurldecode = rawurldecode;
|
|
25
21
|
/**
|
|
26
22
|
* extract effective wikitext
|
|
27
23
|
* @param childNodes a Token's contents
|
package/extensions/dist/base.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
var _a;
|
|
3
|
-
const version = '1.13.
|
|
3
|
+
const version = '1.13.5', src = (_a = document.currentScript) === null || _a === void 0 ? void 0 : _a.src, file = /\/extensions\/dist\/base\.(?:min\.)?js$/u, CDN = src && file.test(src)
|
|
4
4
|
? src.replace(file, '')
|
|
5
5
|
: `https://testingcf.jsdelivr.net/npm/wikiparser-node@${version}`;
|
|
6
6
|
const workerJS = () => {
|
|
@@ -26,7 +26,10 @@ const codejar = (async () => {
|
|
|
26
26
|
const id = wikiparse.id++;
|
|
27
27
|
const highlight = async (e) => (await wikiparse.print(e.textContent, jar.include, undefined, id)).map(([, , printed]) => printed).join('');
|
|
28
28
|
const jar = {
|
|
29
|
-
...CodeJar(root, highlight, {
|
|
29
|
+
...CodeJar(root, highlight, {
|
|
30
|
+
spellcheck: true,
|
|
31
|
+
autoclose: { open: '([{"', close: ')]}"' },
|
|
32
|
+
}),
|
|
30
33
|
include: Boolean(include),
|
|
31
34
|
editor: root,
|
|
32
35
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wikiparser-node",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.5",
|
|
4
4
|
"description": "A Node.js parser for MediaWiki markup with AST",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mediawiki",
|
|
@@ -56,11 +56,30 @@
|
|
|
56
56
|
"chalk": "^4.1.2"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@bhsd/common": "^0.4.
|
|
59
|
+
"@bhsd/common": "^0.4.5",
|
|
60
60
|
"@codemirror/lint": "^6.8.0",
|
|
61
|
+
"@stylistic/eslint-plugin": "^2.3.0",
|
|
62
|
+
"@stylistic/stylelint-plugin": "^2.0.0",
|
|
61
63
|
"@types/node": "^22.9.0",
|
|
62
|
-
"
|
|
64
|
+
"@typescript-eslint/eslint-plugin": "^7.15.0",
|
|
65
|
+
"@typescript-eslint/parser": "^7.15.0",
|
|
66
|
+
"codejar-async": "^4.2.5",
|
|
67
|
+
"esbuild": "^0.21.4",
|
|
68
|
+
"eslint": "^8.56.0",
|
|
69
|
+
"eslint-plugin-es-x": "^8.0.0",
|
|
70
|
+
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
71
|
+
"eslint-plugin-jsdoc": "^48.5.2",
|
|
72
|
+
"eslint-plugin-json-es": "^1.6.0",
|
|
73
|
+
"eslint-plugin-markdown": "^4.0.1",
|
|
74
|
+
"eslint-plugin-n": "^17.9.0",
|
|
75
|
+
"eslint-plugin-promise": "^6.2.0",
|
|
76
|
+
"eslint-plugin-regexp": "^2.6.0",
|
|
77
|
+
"eslint-plugin-unicorn": "^54.0.0",
|
|
78
|
+
"http-server": "^14.1.0",
|
|
63
79
|
"monaco-editor": "^0.52.0",
|
|
80
|
+
"stylelint": "^16.6.1",
|
|
81
|
+
"stylelint-config-recommended": "^14.0.0",
|
|
82
|
+
"typescript": "^5.5.3",
|
|
64
83
|
"v8r": "^3.0.0"
|
|
65
84
|
},
|
|
66
85
|
"engines": {
|