wikiparser-node 1.4.3-b → 1.4.4-b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +1 -1
- package/README.md +1 -1
- package/bundle/bundle.min.js +10 -10
- package/extensions/dist/base.js +3 -3
- package/extensions/ui.css +1 -1
- package/i18n/zh-hans.json +1 -0
- package/i18n/zh-hant.json +1 -0
- package/package.json +6 -8
package/README.en.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
# Introduction
|
|
10
10
|
|
|
11
|
-
wikiparser-node is an offline [Wikitext](https://www.mediawiki.org/wiki/Wikitext) parser developed by Bhsd for the [Node.js](https://nodejs.org/) environment. It can parse almost all wiki syntax and generate an [Abstract Syntax Tree (AST)](https://en.wikipedia.org/wiki/Abstract_syntax_tree). It also allows for easy querying and modification of the AST, and returns the modified wikitext.
|
|
11
|
+
wikiparser-node is an offline [Wikitext](https://www.mediawiki.org/wiki/Wikitext) parser developed by Bhsd for the [Node.js](https://nodejs.org/) environment. It can parse almost all wiki syntax and generate an [Abstract Syntax Tree (AST)](https://en.wikipedia.org/wiki/Abstract_syntax_tree) ([Try it online](https://bhsd-harry.github.io/wikiparser-node/#editor)). It also allows for easy querying and modification of the AST, and returns the modified wikitext.
|
|
12
12
|
|
|
13
13
|
# Other Versions
|
|
14
14
|
|
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
# 简介
|
|
10
10
|
|
|
11
|
-
wikiparser-node 是一款由 Bhsd 开发的基于 [Node.js](https://nodejs.org/) 环境的离线[维基文本](https://www.mediawiki.org/wiki/Wikitext)语法解析器,可以解析几乎全部的维基语法并生成[语法树](https://en.wikipedia.org/wiki/Abstract_syntax_tree)
|
|
11
|
+
wikiparser-node 是一款由 Bhsd 开发的基于 [Node.js](https://nodejs.org/) 环境的离线[维基文本](https://www.mediawiki.org/wiki/Wikitext)语法解析器,可以解析几乎全部的维基语法并生成[语法树](https://en.wikipedia.org/wiki/Abstract_syntax_tree)([在线解析](https://bhsd-harry.github.io/wikiparser-node/#editor)),还可以很方便地对语法树进行查询和修改,最后返回修改后的维基文本。
|
|
12
12
|
|
|
13
13
|
# 其他版本
|
|
14
14
|
|
package/bundle/bundle.min.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";(()=>{var bt=Object.defineProperty;var Ui=Object.getOwnPropertyDescriptor;var Di=Object.getOwnPropertyNames;var Hi=Object.prototype.hasOwnProperty;var Vi=(d,i,e)=>i in d?bt(d,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):d[i]=e;var b=(d,i)=>()=>(d&&(i=d(d=0)),i);var Zi=(d,i)=>()=>(i||d((i={exports:{}}).exports,i),i.exports),W=(d,i)=>{for(var e in i)bt(d,e,{get:i[e],enumerable:!0})},Qi=(d,i,e,t)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of Di(i))!Hi.call(d,r)&&r!==e&&bt(d,r,{get:()=>i[r],enumerable:!(t=Ui(i,r))||t.enumerable});return d};var G=d=>Qi(bt({},"__esModule",{value:!0}),d);var f=(d,i,e)=>(Vi(d,typeof i!="symbol"?i+"":i,e),e),Tr=(d,i,e)=>{if(!i.has(d))throw TypeError("Cannot "+e)};var u=(d,i,e)=>(Tr(d,i,"read from private field"),e?e.call(d):i.get(d)),k=(d,i,e)=>{if(i.has(d))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(d):i.set(d,e)},S=(d,i,e,t)=>(Tr(d,i,"write to private field"),t?t.call(d,e):i.set(d,e),e);var kt=(d,i,e,t)=>({set _(r){S(d,i,r,e)},get _(){return u(d,i,t)}}),C=(d,i,e)=>(Tr(d,i,"access private method"),e);var Ne,Fe,xr,Ee=b(()=>{"use strict";Ne={running:!1,run(d){return d()}},Fe=d=>i=>i.type===d,xr=(d,i,e,t=[])=>{let r=[...d.childNodes],n=r.splice(i,e,...t);d.setAttribute("childNodes",r);for(let s of t)s.setAttribute("parentNode",d);return n}});var an=Zi((Fs,Xi)=>{Xi.exports={ext:[],html:[["b","bdi","del","i","ins","u","font","big","small","sub","sup","h1","h2","h3","h4","h5","h6","cite","code","em","s","strike","strong","tt","var","div","center","blockquote","ol","ul","dl","table","caption","pre","ruby","rb","rp","rt","rtc","p","span","abbr","dfn","kbd","samp","data","time","mark","tr","td","th","q","bdo"],["li","dt","dd"],["br","wbr","hr","meta","link","img"]],namespaces:{},nsid:{file:6,category:14},parserFunction:[{"#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"formatdate","#invoke":"invoke","#while":"while","#dowhile":"dowhile","#loop":"loop","#forargs":"forargs","#fornumargs":"fornumargs","#if":"if","#ifeq":"ifeq","#switch":"switch","#ifexist":"ifexist","#ifexpr":"ifexpr","#iferror":"iferror","#time":"time","#timel":"timel","#expr":"expr","#rel2abs":"rel2abs","#titleparts":"titleparts","#categorytree":"categorytree","#urldecode":"urldecode","#choose":"choose","#var":"var","#varexists":"varexists","#var_final":"var_final","#vardefine":"vardefine","#vardefineecho":"vardefineecho","#widget":"widget","#regex":"regex","#related":"related","#cscore":"cscore"},["!","="],["msg","\u539F\u59CB","raw"],["\u66FF\u4EE3","subst","\u5B89\u5168\u66FF\u4EE3","safesubst"]],doubleUnderscore:[[],[]],protocol:"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|worldwind://|xmpp:",interwiki:[],img:{},variants:[]}});var ln,de=b(()=>{"use strict";ln=an()});var be,ke,lt,dn,te,pn,pe,yt,gn,
|
|
1
|
+
"use strict";(()=>{var bt=Object.defineProperty;var Ui=Object.getOwnPropertyDescriptor;var Di=Object.getOwnPropertyNames;var Hi=Object.prototype.hasOwnProperty;var Vi=(d,i,e)=>i in d?bt(d,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):d[i]=e;var b=(d,i)=>()=>(d&&(i=d(d=0)),i);var Zi=(d,i)=>()=>(i||d((i={exports:{}}).exports,i),i.exports),W=(d,i)=>{for(var e in i)bt(d,e,{get:i[e],enumerable:!0})},Qi=(d,i,e,t)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of Di(i))!Hi.call(d,r)&&r!==e&&bt(d,r,{get:()=>i[r],enumerable:!(t=Ui(i,r))||t.enumerable});return d};var G=d=>Qi(bt({},"__esModule",{value:!0}),d);var f=(d,i,e)=>(Vi(d,typeof i!="symbol"?i+"":i,e),e),Tr=(d,i,e)=>{if(!i.has(d))throw TypeError("Cannot "+e)};var u=(d,i,e)=>(Tr(d,i,"read from private field"),e?e.call(d):i.get(d)),k=(d,i,e)=>{if(i.has(d))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(d):i.set(d,e)},S=(d,i,e,t)=>(Tr(d,i,"write to private field"),t?t.call(d,e):i.set(d,e),e);var kt=(d,i,e,t)=>({set _(r){S(d,i,r,e)},get _(){return u(d,i,t)}}),C=(d,i,e)=>(Tr(d,i,"access private method"),e);var Ne,Fe,xr,Ee=b(()=>{"use strict";Ne={running:!1,run(d){return d()}},Fe=d=>i=>i.type===d,xr=(d,i,e,t=[])=>{let r=[...d.childNodes],n=r.splice(i,e,...t);d.setAttribute("childNodes",r);for(let s of t)s.setAttribute("parentNode",d);return n}});var an=Zi((Fs,Xi)=>{Xi.exports={ext:[],html:[["b","bdi","del","i","ins","u","font","big","small","sub","sup","h1","h2","h3","h4","h5","h6","cite","code","em","s","strike","strong","tt","var","div","center","blockquote","ol","ul","dl","table","caption","pre","ruby","rb","rp","rt","rtc","p","span","abbr","dfn","kbd","samp","data","time","mark","tr","td","th","q","bdo"],["li","dt","dd"],["br","wbr","hr","meta","link","img"]],namespaces:{},nsid:{file:6,category:14},parserFunction:[{"#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"formatdate","#invoke":"invoke","#while":"while","#dowhile":"dowhile","#loop":"loop","#forargs":"forargs","#fornumargs":"fornumargs","#if":"if","#ifeq":"ifeq","#switch":"switch","#ifexist":"ifexist","#ifexpr":"ifexpr","#iferror":"iferror","#time":"time","#timel":"timel","#expr":"expr","#rel2abs":"rel2abs","#titleparts":"titleparts","#categorytree":"categorytree","#urldecode":"urldecode","#choose":"choose","#var":"var","#varexists":"varexists","#var_final":"var_final","#vardefine":"vardefine","#vardefineecho":"vardefineecho","#widget":"widget","#regex":"regex","#related":"related","#cscore":"cscore"},["!","="],["msg","\u539F\u59CB","raw"],["\u66FF\u4EE3","subst","\u5B89\u5168\u66FF\u4EE3","safesubst"]],doubleUnderscore:[[],[]],protocol:"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|worldwind://|xmpp:",interwiki:[],img:{},variants:[]}});var ln,de=b(()=>{"use strict";ln=an()});var be,ke,lt,dn,te,pn,pe,yt,gn,he,H=b(()=>{"use strict";be='(?:\\[[\\da-f:.]+\\]|[^[\\]<>"\0-\x7F\\p{Zs}\uFFFD])',ke='(?:[^[\\]<>"\0-\x7F\\p{Zs}\uFFFD]|\0\\d+[c!~]\x7F)*',lt=(d,i)=>e=>e.replace(d,i),dn=lt(/[\0\x7F]/gu,""),te=lt(/\0\d+c\x7F/gu,""),pn=lt(/[\\{}()|.?*+^$[\]]/gu,"\\$&"),pe=(d,i="")=>d.map(e=>typeof e=="string"?e:e.text()).join(i),yt=lt(/&#(\d+|x[\da-f]+);/giu,(d,i)=>String.fromCodePoint(+`${i.toLowerCase().startsWith("x")?"0":""}${i}`)),gn=lt(/\n/gu,"\\n"),he=(d,i={})=>{let{pre:e="",post:t="",sep:r=""}=i;return`${e}${d.map(n=>n.print()).join(r)}${t}`}});var un={};W(un,{Title:()=>br});var br,hn=b(()=>{"use strict";H();A();br=class{constructor(i,e=0,t=m.getConfig(),r=!1,n=!1){f(this,"valid");f(this,"ns");f(this,"fragment");f(this,"encoded",!1);if(i=yt(i),r&&i.includes("%"))try{let l=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(i);i=decodeURIComponent(i),this.encoded=l}catch(l){}i=i.replace(/_/gu," ").trim();let s=e;i.startsWith(":")&&(s=0,i=i.slice(1).trim());let a=i.split(":");if(a.length>1){let l=t.nsid[a[0].trim().toLowerCase()];l&&(s=l,i=a.slice(1).join(":").trim())}this.ns=s;let o=i.indexOf("#");if(o!==-1){let l=i.slice(o+1).trimEnd();if(l.includes("%"))try{l=decodeURIComponent(l)}catch(g){}else if(l.includes("."))try{l=decodeURIComponent(l.replace(/\./gu,"%"))}catch(g){}this.fragment=l,i=i.slice(0,o).trim()}this.valid=!!(i||this.interwiki||n&&this.fragment!==void 0)&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|]|%[\da-f]{2}/iu.test(i)}}});var dt,pt,kr,_e,yr=b(()=>{"use strict";_e=class{constructor(){k(this,pt);f(this,"childNodes",[]);k(this,dt,void 0)}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get parentNode(){return u(this,dt)}get nextSibling(){var e;let i=(e=this.parentNode)==null?void 0:e.childNodes;return i&&i[i.indexOf(this)+1]}get previousSibling(){var e;let i=(e=this.parentNode)==null?void 0:e.childNodes;return i&&i[i.indexOf(this)-1]}get offsetHeight(){return C(this,pt,kr).call(this).height}get offsetWidth(){return C(this,pt,kr).call(this).width}getAttribute(i){return i==="padding"?0:i in this?String(this[i]):void 0}setAttribute(i,e){i==="parentNode"?S(this,dt,e):this[i]=e}getRootNode(){let{parentNode:i}=this;for(;i!=null&&i.parentNode;)({parentNode:i}=i);return i!=null?i:this}posFromIndex(i){let e=String(this);if(i>=-e.length&&i<=e.length){let t=e.slice(0,i).split(`
|
|
2
2
|
`),r=t.length-1;return{top:r,left:t[r].length}}}getGaps(i){return 0}getRelativeIndex(i){let e,t=(r,n)=>e.slice(0,r).reduce((s,a,o)=>s+String(a).length+n.getGaps(o),0)+n.getAttribute("padding");if(i===void 0){let{parentNode:r}=this;return r?({childNodes:e}=r,t(e.indexOf(this),r)):0}return{childNodes:e}=this,t(i,this)}getAbsoluteIndex(){let{parentNode:i}=this;return i?i.getAbsoluteIndex()+this.getRelativeIndex():0}seal(i,e){Object.defineProperty(this,i,{enumerable:!e&&!!this[i],configurable:!0})}};dt=new WeakMap,pt=new WeakSet,kr=function(){let i=String(this).split(`
|
|
3
|
-
`),e=i.length;return{height:e,width:i[e-1].length}}});var vt,mn,At,cn=b(()=>{"use strict";H();Ee();yr();At=class extends _e{constructor(){super(...arguments);k(this,vt)}get length(){return this.childNodes.length}text(e){return pe(this.childNodes,e)}normalize(){let e=[...this.childNodes];for(let t=e.length-1;t>=0;t--){let{type:r,data:n}=e[t]
|
|
4
|
-
`),rn=xt.length+N-1,nn=xt[xt.length-1],sn=xt.length===1?I+nn.length:nn.length;h.push({message:m.msg('lonely "$1"',E==="h"?ee:E),severity:tn,startIndex:Oe,endIndex:xe,startLine:rn,endLine:rn,startCol:sn,endCol:sn+ie})}return h}replaceData(e){C(this,St,xn).call(this,e)}print(){let e={"&":"amp","<":"lt",">":"gt"};return this.data.replace(/[&<>]/gu,t=>`&${e[t]};`)}};St=new WeakSet,xn=function(e){this.setAttribute("data",e)}});var wt,kn=b(()=>{"use strict";F();wt=class extends x{constructor(){super(...arguments);f(this,"type","onlyinclude")}toString(){return`<onlyinclude>${super.toString()}</onlyinclude>`}getAttribute(e){return e==="padding"?13:e==="plain"||super.getAttribute(e)}print(){return super.print({pre:'<span class="wpb-ext"><onlyinclude></span>',post:'<span class="wpb-ext"></onlyinclude></span>'})}}});var ue,Me=b(()=>{"use strict";ue=d=>{class i extends d{text(){return""}lint(){return[]}}return i}});var V,Le=b(()=>{"use strict";Me();ye();V=class extends ue(Q){constructor(){super(...arguments);f(this,"type","noinclude")}}});var Ae,ze,wr=b(()=>{"use strict";A();F();ze=class extends x{constructor(e,t,r,n,s=m.getConfig(),a=[]){super(void 0,s);k(this,Ae,void 0);f(this,"closed");f(this,"selfClosing");this.setAttribute("name",e.toLowerCase()),S(this,Ae,[e,n||e]),this.closed=n!=="",this.selfClosing=n===void 0,this.append(t,r);let o=typeof t=="string"?-1:a.indexOf(t);a.splice(o===-1?1/0:o,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(){let{selfClosing:e,firstChild:t,lastChild:r}=this,[n,s]=u(this,Ae);return e?`<${n}${String(t)}/>`:`<${n}${String(t)}>${String(r)}${this.closed?`</${s}>`:""}`}text(){let[e,t]=u(this,Ae);return this.selfClosing?`<${e}${this.firstChild.text()}/>`:`<${e}${super.text(">")}${this.closed?`</${t}>`:""}`}getAttribute(e){return e==="padding"?u(this,Ae)[0].length+1:super.getAttribute(e)}getGaps(){return 1}print(){let[e,t]=u(this,Ae);return super.print(this.selfClosing?{pre:`<${e}`,post:"/>"}:{pre:`<${e}`,sep:">",post:this.closed?`</${t}>`:""})}};Ae=new WeakMap});var $t,yn=b(()=>{"use strict";R();Me();A();wr();$t=class extends ue(ze){constructor(e,t="",r,n,s=m.getConfig(),a=[]){super(e,t,r!=null?r:"",r===void 0||n!=null?n:"",s,a);f(this,"type","include")}lint(e=this.getAbsoluteIndex()){return this.closed?[]:[w(this,{start:e},m.msg("unclosed $1",`<${this.name}>`))]}}});var q,me=b(()=>{"use strict";A();F();q=class extends x{constructor(i,e,t=m.getConfig(),r=[],n){super(i,t,r,n),this.type=e}}});var ts,D,An,vn,Nt,$r,Sn,ut,$n,Cn,Nn,wn,Ct,rs,ns,is,We,Z,se,Ue,Fn=b(()=>{"use strict";R();H();de();A();F();me();ts=new Set(["id","class","style","lang","dir","title","tabindex","aria-describedby","aria-flowto","aria-hidden","aria-label","aria-labelledby","aria-owns","role","about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),D=new Set(["align"]),An=new Set(["cite"]),vn=new Set(["cite","datetime"]),Nt=new Set(["width"]),$r=new Set(["axis","align","bgcolor","height","width","valign"]),Sn=new Set([...$r,"abbr","headers","scope","rowspan","colspan"]),ut=new Set(["type"]),$n=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),Cn=new Set(["clear"]),Nn=new Set(["bgcolor","align","valign"]),wn={div:D,h1:D,h2:D,h3:D,h4:D,h5:D,h6:D,blockquote:An,q:An,p:D,br:Cn,pre:Nt,ins:vn,del:vn,ul:ut,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...$n,"border"]),caption:D,tr:Nn,td:Sn,th:Sn,img:new Set(["alt","src","width","height","srcset"]),font:new Set(["size","color","face"]),hr:Nt,rt:new Set(["rbspan"]),data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:new Set(["mode","showfilename","caption","perrow","widths","heights","showthumbnails","type"]),poem:new Set(["compact","align"]),categorytree:new Set(["align","hideroot","onlyroot","depth","mode","hideprefix","namespaces","showcount","notranslations"]),combooption:new Set(["name","for","inline","align"])},Ct=new Set,rs={nowiki:Ct,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:Ct,inputbox:Ct,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:Ct,poll:new Set(["id","show-results-before-voting"]),sm2:ut,flashmp3:ut,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"])},ns=new RegExp("expression|(?:filter|accelerator|-o-link(?:-source)?|-o-replace)\\s*:|(?:url|image(?:-set)?)\\s*\\(|attr\\s*\\([^)]+[\\s,]url","u"),is={table:$n,td:new Set([...$r,"scope"]),th:$r,br:Cn,caption:D,div:D,hr:Nt,h1:D,h2:D,h3:D,h4:D,h5:D,h6:D,li:ut,p:D,pre:Nt,tr:Nn,ul:ut},Ue=class extends x{constructor(e,t,r,n="",s,a=[],o=m.getConfig(),l=[]){let g=new q(r,"attr-key",o,l,{}),p;if(r==="title"||t==="img"&&r==="alt")p=new x(s,o,l,{}),p.type="attr-value",p.setAttribute("stage",10);else if(t==="gallery"&&r==="caption"){let h={...o,excludes:[...o.excludes,"quote","extLink","magicLink","list"]};p=new x(s,h,l,{}),p.type="attr-value",p.setAttribute("stage",5)}else if(t==="choose"&&(r==="before"||r==="after")){let h={...o,excludes:[...o.excludes,"heading","html","table","hr","list"]};p=new x(s,h,l,{}),p.type="attr-value",p.setAttribute("stage",1)}else p=new q(s,"attr-value",o,l,{});super(void 0,o,l);k(this,We,void 0);k(this,Z,void 0);k(this,se,void 0);this.type=e,this.append(g,p),S(this,Z,n),S(this,se,[...a]),S(this,We,t),this.setAttribute("name",te(r).trim().toLowerCase())}get tag(){return u(this,We)}get balanced(){return!u(this,Z)||u(this,se)[0]===u(this,se)[1]}afterBuild(){u(this,Z).includes("\0")&&S(this,Z,this.buildFromStr(u(this,Z),0)),this.parentNode&&S(this,We,this.parentNode.name),this.setAttribute("name",this.firstChild.text().trim().toLowerCase())}toString(){let[e="",t=""]=u(this,se);return u(this,Z)?`${super.toString(`${u(this,Z)}${e}`)}${t}`:String(this.firstChild)}text(){return u(this,Z)?`${super.text(`${u(this,Z).trim()}"`)}"`:this.firstChild.text()}getGaps(){var e,t;return u(this,Z)?u(this,Z).length+((t=(e=u(this,se)[0])==null?void 0:e.length)!=null?t:0):0}lint(e=this.getAbsoluteIndex()){var c,T;let t=super.lint(e),{balanced:r,firstChild:n,lastChild:s,type:a,name:o,tag:l}=this,g=this.getValue(),p;if(!r){let y=this.getRootNode();p={start:e,...y.posFromIndex(e)};let $=v(s,p,m.msg("unclosed $1","quotes"),"warning");t.push({...$,startIndex:$.startIndex-1,startCol:$.startCol-1})}let h=rs[l];return h&&!h.has(o)||(a==="ext-attr"?l in wn:!/\{\{[^{]+\}\}/u.test(o))&&!((c=wn[l])!=null&&c.has(o))&&!/^(?:xmlns:[\w:.-]+|data-[^:]*)$/u.test(o)&&(l==="meta"||l==="link"||!ts.has(o))?(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(n,p,"illegal attribute name"))):(T=is[l])!=null&&T.has(o)?(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(n,p,"obsolete attribute","warning"))):o==="style"&&typeof g=="string"&&ns.test(g)?(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(s,p,"insecure style"))):o==="tabindex"&&typeof g=="string"&&g.trim()!=="0"&&(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(s,p,"nonzero tabindex"))),t}getValue(){if(u(this,Z)){let e=this.lastChild.text();return u(this,se)[1]?e:e[u(this,se)[0]?"trimEnd":"trim"]()}return this.type==="ext-attr"||""}print(){let[e="",t=""]=u(this,se);return u(this,Z)?super.print({sep:`${u(this,Z)}${e}`,post:t}):super.print()}};We=new WeakMap,Z=new WeakMap,se=new WeakMap});var En,ss,ve,Et=b(()=>{"use strict";R();H();A();F();me();Fn();En=d=>d.slice(0,-1),ss=d=>`${En(d)}-dirty`,ve=class extends x{constructor(i,e,t,r=m.getConfig(),n=[]){if(super(void 0,r,n,{}),this.type=e,this.setAttribute("name",t),i){let s=new RegExp(`([^\\s/](?:(?!\0\\d+~\x7F)[^\\s/=])*)(?:((?:\\s|\0\\d+c\x7F)*(?:=|\0\\d+~\x7F)(?:\\s|\0\\d+c\x7F)*)(?:(["'])(.*?)(\\3|$)|(\\S*)))?`,"gsu"),a="",o=s.exec(i),l=0,g=()=>{a&&(super.insertAt(new q(a,ss(e),r,n,{})),a="")};for(;o;){let{index:p,0:h,1:c,2:T,3:y,4:$,5:B,6:L}=o;if(a+=i.slice(l,p),/^(?:[\w:]|\0\d+[t!~{}+-]\x7F)(?:[\w:.-]|\0\d+[t!~{}+-]\x7F)*$/u.test(te(c).trim())){let N=$!=null?$:L,I=[y,B],O=new Ue(En(e),t,c,T,N,I,r,n);g(),super.insertAt(O)}else a+=h;({lastIndex:l}=s),o=s.exec(i)}a+=i.slice(l),g()}}afterBuild(){if(this.type==="table-attrs"){let{parentNode:i}=this;this.setAttribute("name",(i==null?void 0:i.type)==="td"&&i.subtype==="caption"?"caption":i==null?void 0:i.type)}}getAttrTokens(i){return this.childNodes.filter(e=>e instanceof Ue&&(!i||e.name===i.toLowerCase().trim()))}getAttrToken(i){let e=this.getAttrTokens(i);return e[e.length-1]}getAttr(i){var e;return(e=this.getAttrToken(i))==null?void 0:e.getValue()}lint(i=this.getAbsoluteIndex()){let e=super.lint(i),{parentNode:t,length:r,childNodes:n}=this,s=new Map,a=new Set,o;(t==null?void 0:t.type)==="html"&&t.closing&&this.text().trim()&&(o={start:i,...this.getRootNode().posFromIndex(i)},e.push(w(this,o,"attributes of a closing tag")));for(let l=0;l<r;l++){let g=n[l];if(g instanceof q&&g.text().trim())o!=null||(o={start:i,...this.getRootNode().posFromIndex(i)}),e.push(v(g,o,"containing invalid attribute"));else if(g instanceof Ue){let{name:p}=g;s.has(p)?(a.add(p),s.get(p).push(g)):p!=="class"&&s.set(p,[g])}}if(a.size>0){o!=null||(o={start:i,...this.getRootNode().posFromIndex(i)});for(let l of a)e.push(...s.get(l).map(g=>v(g,o,m.msg("duplicated $1 attribute",l))))}return e}print(){return String(this)?`<span class="wpb-${this.type}">${this.childNodes.map(i=>i.print(i instanceof q&&i.text().trim()?{class:"attr-dirty"}:void 0)).join("")}</span>`:""}}});var Ln={};W(Ln,{PreToken:()=>Cr});var Cr,In=b(()=>{"use strict";de();A();F();Le();Cr=class extends x{constructor(e,t=m.getConfig(),r=[]){if(e){let n="<nowiki>",s="</nowiki>",{length:a}=n,o=e.indexOf(n),l=e.indexOf(s,o+a),g="";for(;o!==-1&&l!==-1;)new V(n,t,r),new V(s,t,r),g+=`${e.slice(0,o)}\0${r.length-1}c\x7F${e.slice(o+a,l)}\0${r.length}c\x7F`,e=e.slice(l+a+1),o=e.indexOf(n),l=e.indexOf(s,o+a);e=`${g}${e}`}super(e,t,r,{});f(this,"type","ext-inner");this.setAttribute("stage",10)}getAttribute(e){return e==="plain"||super.getAttribute(e)}}});var Pn={};W(Pn,{ParamTagToken:()=>ht});var ht,Nr=b(()=>{"use strict";R();A();F();me();ht=class extends x{constructor(e,t=m.getConfig(),r=[],n={}){super(void 0,t,r,{});f(this,"type","ext-inner");if(e){let s=q;this.append(...e.split(`
|
|
3
|
+
`),e=i.length;return{height:e,width:i[e-1].length}}});var vt,mn,At,cn=b(()=>{"use strict";H();Ee();yr();At=class extends _e{constructor(){super(...arguments);k(this,vt)}get length(){return this.childNodes.length}text(e){return pe(this.childNodes,e)}normalize(){let e=[...this.childNodes];for(let t=e.length-1;t>=0;t--){let{type:r,data:n}=e[t];r!=="text"||this.getGaps(t-1)||n===""&&e.splice(t,1)}this.setAttribute("childNodes",e)}removeAt(e){return xr(this,e,1)[0]}insertAt(e,t=this.length){return xr(this,t,0,[e]),e}closest(e){let t=C(this,vt,mn).call(this,e),{parentNode:r}=this;for(;r;){if(t(r))return r;({parentNode:r}=r)}}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 r=this.childNodes[t],{data:n}=r;return r.replaceData(e),n}toString(e=""){return this.childNodes.map(String).join(e)}lint(e=this.getAbsoluteIndex()){let t=[];for(let r=0,n=e+this.getAttribute("padding");r<this.length;r++){let s=this.childNodes[r];t.push(...s.lint(n)),n+=String(s).length+this.getGaps(r)}return t}print(e={}){var t;return String(this)?`<span class="wpb-${(t=e.class)!=null?t:this.type}">${he(this.childNodes,e)}</span>`:""}json(e,t=this.getAbsoluteIndex()){let r={...this,range:[t,t+String(this).length],childNodes:[]};for(let n=0,s=t+this.getAttribute("padding");n<this.length;n++){let a=this.childNodes[n],{length:o}=String(a);a.type==="text"?r.childNodes.push({data:a.data,range:[s,s+o]}):r.childNodes.push(a.json(void 0,s)),s+=o+this.getGaps(n)}return r}};vt=new WeakSet,mn=function(e){let t=new Set(e.split(",").map(r=>r.trim()));return({type:r})=>t.has(r)}});var fn,v,w,R=b(()=>{"use strict";A();fn=d=>(i,e,t,r="error")=>{let{start:n}=e,{top:s,left:a}="top"in e?e:i.getRootNode().posFromIndex(n),{offsetHeight:o,offsetWidth:l}=i,{startIndex:g,startLine:p,startCol:h}=d(i,n,s,a);return{message:m.msg(t),severity:r,startIndex:g,endIndex:g+String(i).length,startLine:p,endLine:p+o-1,startCol:h,endCol:o===1?h+l:l}},v=fn((d,i,e,t)=>{let r=d.getRelativeIndex(),{top:n,left:s}=d.parentNode.posFromIndex(r);return{startIndex:i+r,startLine:e+n,startCol:n?s:t+s}}),w=fn((d,i,e,t)=>({startIndex:i,startLine:e,startCol:t}))});var Q,ye=b(()=>{"use strict";A();F();Q=class extends x{get innerText(){return this.firstChild.data}constructor(i="",e=m.getConfig(),t=[]){super(i,e,t)}}});var vr={};W(vr,{NowikiToken:()=>Ar});var Ar,Sr=b(()=>{"use strict";R();A();ye();Ar=class extends Q{constructor(){super(...arguments);f(this,"type","ext-inner")}lint(e=this.getAbsoluteIndex()){let{name:t,firstChild:{data:r}}=this;return(t==="templatestyles"||t==="section")&&r?[w(this,{start:e},m.msg("nothing should be in <$1>",t))]:super.lint(e)}}});var Tn,Ki,Ji,Yi,es,St,xn,gt,bn=b(()=>{"use strict";A();yr();Tn="<\\s*(?:\\/\\s*)?([a-z]\\w*)|\\{+|\\}+|\\[{2,}|\\[(?![^[]*?\\])|((?:^|\\])[^[]*?)\\]+",Ki=new RegExp(`${Tn}|https?[:/]\\/+`,"giu"),Ji=new RegExp(Tn,"giu"),Yi={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},es=["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"],gt=class extends _e{constructor(e){super();k(this,St);f(this,"type","text");f(this,"data","");Object.defineProperties(this,{childNodes:{enumerable:!1,configurable:!1},type:{enumerable:!1,writable:!1},data:{value:e}})}toString(){return this.data}text(){return this.data}lint(e=this.getAbsoluteIndex()){var P,_,J;let{data:t,parentNode:r,nextSibling:n,previousSibling:s}=this,{NowikiToken:a}=(Sr(),G(vr)),{type:o,name:l}=r,g=l==="nowiki"||l==="pre",p;if(o==="ext-inner"&&(l==="pre"||r instanceof a)?p=new RegExp(`<\\s*(?:\\/\\s*)${g?"":"?"}(${l})\\b`,"giu"):o==="free-ext-link"||o==="ext-link-url"||o==="image-parameter"&&l==="link"||o==="attr-value"?p=Ji:p=Ki,t.search(p)===-1)return[];p.lastIndex=0;let h=[],c=n==null?void 0:n.type,T=n==null?void 0:n.name,y=s==null?void 0:s.type,$=this.getRootNode(),{ext:B,html:L}=$.getAttribute("config"),{top:N,left:I}=$.posFromIndex(e),O=new Set(["onlyinclude","noinclude","includeonly",B,L,es].flat(2));for(let U=p.exec(t);U;U=p.exec(t)){let[,Te,Be]=U,{0:ee,index:z}=U;if(Be&&Be!=="]"){let{length:$e}=Be;z+=$e,ee=ee.slice($e)}let{0:E,length:ie}=ee;if(E==="<"&&!O.has(Te.toLowerCase())||E==="["&&o==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(t.slice(z+1))||c==="ext"&&T==="nowiki"&&((P=n.innerText)!=null&&P.includes("]"))))continue;E==="]"&&(z||ie>1)&&p.lastIndex--;let Oe=e+z,xe=Oe+ie,K=String($),le=K[xe],at=K[Oe-1],tn=ie>1&&(E!=="<"||!g&&/[\s/>]/u.test(le!=null?le:""))||E==="{"&&(le===E||at==="-")||E==="}"&&(at===E||le==="-")||E==="["&&(le===E||o==="ext-link-text"||!t.slice(z+1).trim()&&c==="free-ext-link")||E==="]"&&(at===E||!t.slice(0,z).trim()&&y==="free-ext-link")?"error":"warning",cr=E==="{"||E==="[";if(tn==="warning"&&(cr||(E==="]"||E==="}"))){let $e=Yi[E],fr=cr?t.slice(z+1):t.slice(0,z);if(E==="{"&&((_=$e.exec(fr))==null?void 0:_[0])==="}"||E==="}"&&((J=$e.exec(fr))==null?void 0:J[0])==="{")continue;if(!fr.includes(E)){let on=cr?"nextSibling":"previousSibling",Ce=this[on];for(;Ce&&(Ce.type!=="text"||!$e.test(Ce.data));)Ce=Ce[on];if(Ce&&$e.exec(Ce.data)[0]!==E)continue}}let xt=t.slice(0,z).split(`
|
|
4
|
+
`),rn=xt.length+N-1,nn=xt[xt.length-1],sn=xt.length===1?I+nn.length:nn.length;h.push({message:m.msg('lonely "$1"',E==="h"?ee:E),severity:tn,startIndex:Oe,endIndex:xe,startLine:rn,endLine:rn,startCol:sn,endCol:sn+ie})}return h}replaceData(e){C(this,St,xn).call(this,e)}print(){let e={"&":"amp","<":"lt",">":"gt"};return this.data.replace(/[&<>]/gu,t=>`&${e[t]};`)}};St=new WeakSet,xn=function(e){this.setAttribute("data",e)}});var wt,kn=b(()=>{"use strict";F();wt=class extends x{constructor(){super(...arguments);f(this,"type","onlyinclude")}toString(){return`<onlyinclude>${super.toString()}</onlyinclude>`}getAttribute(e){return e==="padding"?13:e==="plain"||super.getAttribute(e)}print(){return super.print({pre:'<span class="wpb-ext"><onlyinclude></span>',post:'<span class="wpb-ext"></onlyinclude></span>'})}}});var ge,Me=b(()=>{"use strict";ge=d=>{class i extends d{text(){return""}lint(){return[]}}return i}});var V,Le=b(()=>{"use strict";Me();ye();V=class extends ge(Q){constructor(){super(...arguments);f(this,"type","noinclude")}}});var Ae,ze,wr=b(()=>{"use strict";A();F();ze=class extends x{constructor(e,t,r,n,s=m.getConfig(),a=[]){super(void 0,s);k(this,Ae,void 0);f(this,"closed");f(this,"selfClosing");this.setAttribute("name",e.toLowerCase()),S(this,Ae,[e,n||e]),this.closed=n!=="",this.selfClosing=n===void 0,this.append(t,r);let o=typeof t=="string"?-1:a.indexOf(t);a.splice(o===-1?1/0:o,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(){let{selfClosing:e,firstChild:t,lastChild:r}=this,[n,s]=u(this,Ae);return e?`<${n}${String(t)}/>`:`<${n}${String(t)}>${String(r)}${this.closed?`</${s}>`:""}`}text(){let[e,t]=u(this,Ae);return this.selfClosing?`<${e}${this.firstChild.text()}/>`:`<${e}${super.text(">")}${this.closed?`</${t}>`:""}`}getAttribute(e){return e==="padding"?u(this,Ae)[0].length+1:super.getAttribute(e)}getGaps(){return 1}print(){let[e,t]=u(this,Ae);return super.print(this.selfClosing?{pre:`<${e}`,post:"/>"}:{pre:`<${e}`,sep:">",post:this.closed?`</${t}>`:""})}};Ae=new WeakMap});var $t,yn=b(()=>{"use strict";R();Me();A();wr();$t=class extends ge(ze){constructor(e,t="",r,n,s=m.getConfig(),a=[]){super(e,t,r!=null?r:"",r===void 0||n!=null?n:"",s,a);f(this,"type","include")}lint(e=this.getAbsoluteIndex()){return this.closed?[]:[w(this,{start:e},m.msg("unclosed $1",`<${this.name}>`))]}}});var q,me=b(()=>{"use strict";A();F();q=class extends x{constructor(i,e,t=m.getConfig(),r=[],n){super(i,t,r,n),this.type=e}}});var ts,D,An,vn,Nt,$r,Sn,ut,$n,Cn,Nn,wn,Ct,rs,ns,is,We,Z,se,Ue,Fn=b(()=>{"use strict";R();H();de();A();F();me();ts=new Set(["id","class","style","lang","dir","title","tabindex","aria-describedby","aria-flowto","aria-hidden","aria-label","aria-labelledby","aria-owns","role","about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),D=new Set(["align"]),An=new Set(["cite"]),vn=new Set(["cite","datetime"]),Nt=new Set(["width"]),$r=new Set(["axis","align","bgcolor","height","width","valign"]),Sn=new Set([...$r,"abbr","headers","scope","rowspan","colspan"]),ut=new Set(["type"]),$n=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),Cn=new Set(["clear"]),Nn=new Set(["bgcolor","align","valign"]),wn={div:D,h1:D,h2:D,h3:D,h4:D,h5:D,h6:D,blockquote:An,q:An,p:D,br:Cn,pre:Nt,ins:vn,del:vn,ul:ut,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...$n,"border"]),caption:D,tr:Nn,td:Sn,th:Sn,img:new Set(["alt","src","width","height","srcset"]),font:new Set(["size","color","face"]),hr:Nt,rt:new Set(["rbspan"]),data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:new Set(["mode","showfilename","caption","perrow","widths","heights","showthumbnails","type"]),poem:new Set(["compact","align"]),categorytree:new Set(["align","hideroot","onlyroot","depth","mode","hideprefix","namespaces","showcount","notranslations"]),combooption:new Set(["name","for","inline","align"])},Ct=new Set,rs={nowiki:Ct,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:Ct,inputbox:Ct,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:Ct,poll:new Set(["id","show-results-before-voting"]),sm2:ut,flashmp3:ut,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"])},ns=new RegExp("expression|(?:filter|accelerator|-o-link(?:-source)?|-o-replace)\\s*:|(?:url|image(?:-set)?)\\s*\\(|attr\\s*\\([^)]+[\\s,]url","u"),is={table:$n,td:new Set([...$r,"scope"]),th:$r,br:Cn,caption:D,div:D,hr:Nt,h1:D,h2:D,h3:D,h4:D,h5:D,h6:D,li:ut,p:D,pre:Nt,tr:Nn,ul:ut},Ue=class extends x{constructor(e,t,r,n="",s,a=[],o=m.getConfig(),l=[]){let g=new q(r,"attr-key",o,l,{}),p;if(r==="title"||t==="img"&&r==="alt")p=new x(s,o,l,{}),p.type="attr-value",p.setAttribute("stage",10);else if(t==="gallery"&&r==="caption"){let h={...o,excludes:[...o.excludes,"quote","extLink","magicLink","list"]};p=new x(s,h,l,{}),p.type="attr-value",p.setAttribute("stage",5)}else if(t==="choose"&&(r==="before"||r==="after")){let h={...o,excludes:[...o.excludes,"heading","html","table","hr","list"]};p=new x(s,h,l,{}),p.type="attr-value",p.setAttribute("stage",1)}else p=new q(s,"attr-value",o,l,{});super(void 0,o,l);k(this,We,void 0);k(this,Z,void 0);k(this,se,void 0);this.type=e,this.append(g,p),S(this,Z,n),S(this,se,[...a]),S(this,We,t),this.setAttribute("name",te(r).trim().toLowerCase())}get tag(){return u(this,We)}get balanced(){return!u(this,Z)||u(this,se)[0]===u(this,se)[1]}afterBuild(){u(this,Z).includes("\0")&&S(this,Z,this.buildFromStr(u(this,Z),0)),this.parentNode&&S(this,We,this.parentNode.name),this.setAttribute("name",this.firstChild.text().trim().toLowerCase())}toString(){let[e="",t=""]=u(this,se);return u(this,Z)?`${super.toString(`${u(this,Z)}${e}`)}${t}`:String(this.firstChild)}text(){return u(this,Z)?`${super.text(`${u(this,Z).trim()}"`)}"`:this.firstChild.text()}getGaps(){var e,t;return u(this,Z)?u(this,Z).length+((t=(e=u(this,se)[0])==null?void 0:e.length)!=null?t:0):0}lint(e=this.getAbsoluteIndex()){var c,T;let t=super.lint(e),{balanced:r,firstChild:n,lastChild:s,type:a,name:o,tag:l}=this,g=this.getValue(),p;if(!r){let y=this.getRootNode();p={start:e,...y.posFromIndex(e)};let $=v(s,p,m.msg("unclosed $1","quotes"),"warning");t.push({...$,startIndex:$.startIndex-1,startCol:$.startCol-1})}let h=rs[l];return h&&!h.has(o)||(a==="ext-attr"?l in wn:!/\{\{[^{]+\}\}/u.test(o))&&!((c=wn[l])!=null&&c.has(o))&&!/^(?:xmlns:[\w:.-]+|data-[^:]*)$/u.test(o)&&(l==="meta"||l==="link"||!ts.has(o))?(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(n,p,"illegal attribute name"))):(T=is[l])!=null&&T.has(o)?(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(n,p,"obsolete attribute","warning"))):o==="style"&&typeof g=="string"&&ns.test(g)?(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(s,p,"insecure style"))):o==="tabindex"&&typeof g=="string"&&g.trim()!=="0"&&(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(s,p,"nonzero tabindex"))),t}getValue(){if(u(this,Z)){let e=this.lastChild.text();return u(this,se)[1]?e:e[u(this,se)[0]?"trimEnd":"trim"]()}return this.type==="ext-attr"||""}print(){let[e="",t=""]=u(this,se);return u(this,Z)?super.print({sep:`${u(this,Z)}${e}`,post:t}):super.print()}};We=new WeakMap,Z=new WeakMap,se=new WeakMap});var En,ss,ve,Et=b(()=>{"use strict";R();H();A();F();me();Fn();En=d=>d.slice(0,-1),ss=d=>`${En(d)}-dirty`,ve=class extends x{constructor(i,e,t,r=m.getConfig(),n=[]){if(super(void 0,r,n,{}),this.type=e,this.setAttribute("name",t),i){let s=new RegExp(`([^\\s/](?:(?!\0\\d+~\x7F)[^\\s/=])*)(?:((?:\\s|\0\\d+c\x7F)*(?:=|\0\\d+~\x7F)(?:\\s|\0\\d+c\x7F)*)(?:(["'])(.*?)(\\3|$)|(\\S*)))?`,"gsu"),a="",o=s.exec(i),l=0,g=()=>{a&&(super.insertAt(new q(a,ss(e),r,n,{})),a="")};for(;o;){let{index:p,0:h,1:c,2:T,3:y,4:$,5:B,6:L}=o;if(a+=i.slice(l,p),/^(?:[\w:]|\0\d+[t!~{}+-]\x7F)(?:[\w:.-]|\0\d+[t!~{}+-]\x7F)*$/u.test(te(c).trim())){let N=$!=null?$:L,I=[y,B],O=new Ue(En(e),t,c,T,N,I,r,n);g(),super.insertAt(O)}else a+=h;({lastIndex:l}=s),o=s.exec(i)}a+=i.slice(l),g()}}afterBuild(){if(this.type==="table-attrs"){let{parentNode:i}=this;this.setAttribute("name",(i==null?void 0:i.type)==="td"&&i.subtype==="caption"?"caption":i==null?void 0:i.type)}}getAttrTokens(i){return this.childNodes.filter(e=>e instanceof Ue&&(!i||e.name===i.toLowerCase().trim()))}getAttrToken(i){let e=this.getAttrTokens(i);return e[e.length-1]}getAttr(i){var e;return(e=this.getAttrToken(i))==null?void 0:e.getValue()}lint(i=this.getAbsoluteIndex()){let e=super.lint(i),{parentNode:t,length:r,childNodes:n}=this,s=new Map,a=new Set,o;(t==null?void 0:t.type)==="html"&&t.closing&&this.text().trim()&&(o={start:i,...this.getRootNode().posFromIndex(i)},e.push(w(this,o,"attributes of a closing tag")));for(let l=0;l<r;l++){let g=n[l];if(g instanceof q&&g.text().trim())o!=null||(o={start:i,...this.getRootNode().posFromIndex(i)}),e.push(v(g,o,"containing invalid attribute"));else if(g instanceof Ue){let{name:p}=g;s.has(p)?(a.add(p),s.get(p).push(g)):p!=="class"&&s.set(p,[g])}}if(a.size>0){o!=null||(o={start:i,...this.getRootNode().posFromIndex(i)});for(let l of a)e.push(...s.get(l).map(g=>v(g,o,m.msg("duplicated $1 attribute",l))))}return e}print(){return String(this)?`<span class="wpb-${this.type}">${this.childNodes.map(i=>i.print(i instanceof q?{class:"attr-dirty"}:void 0)).join("")}</span>`:""}}});var Ln={};W(Ln,{PreToken:()=>Cr});var Cr,In=b(()=>{"use strict";de();A();F();Le();Cr=class extends x{constructor(e,t=m.getConfig(),r=[]){if(e){let n="<nowiki>",s="</nowiki>",{length:a}=n,o=e.indexOf(n),l=e.indexOf(s,o+a),g="";for(;o!==-1&&l!==-1;)new V(n,t,r),new V(s,t,r),g+=`${e.slice(0,o)}\0${r.length-1}c\x7F${e.slice(o+a,l)}\0${r.length}c\x7F`,e=e.slice(l+a+1),o=e.indexOf(n),l=e.indexOf(s,o+a);e=`${g}${e}`}super(e,t,r,{});f(this,"type","ext-inner");this.setAttribute("stage",10)}getAttribute(e){return e==="plain"||super.getAttribute(e)}}});var Pn={};W(Pn,{ParamTagToken:()=>ht});var ht,Nr=b(()=>{"use strict";R();A();F();me();ht=class extends x{constructor(e,t=m.getConfig(),r=[],n={}){super(void 0,t,r,{});f(this,"type","ext-inner");if(e){let s=q;this.append(...e.split(`
|
|
5
5
|
`).map(a=>new s(a,"param-line",t,r,{})))}}toString(){return super.toString(`
|
|
6
6
|
`)}text(){return super.text(`
|
|
7
7
|
`)}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){let t;return this.childNodes.filter(r=>{let{childNodes:n}=r,s=n.findIndex(({type:o})=>o!=="text"),a=(s>=0?n.slice(0,s).map(String).join(""):String(r)).trim();return a&&!(s>=0?/^[a-z]+(?:\[\])?\s*(?:=|$)/iu:/^[a-z]+(?:\[\])?\s*=/iu).test(a)}).map(r=>(t!=null||(t={start:e,...this.getRootNode().posFromIndex(e)}),v(r,t,m.msg("invalid parameter of <$1>",this.name))))}print(){return super.print({sep:`
|
|
8
|
-
`})}}});var he,mt=b(()=>{"use strict";A();F();he=class extends x{constructor(i,e,t="plain",r=m.getConfig(),n=[],s){super(i,r,n,s),this.type=t}lint(){return[]}}});var ct,De,Lt,He,Fr=b(()=>{"use strict";R();A();F();mt();He=class extends x{constructor(e,t,r=m.getConfig(),n=[]){super(void 0,r,n);k(this,De);f(this,"type","heading");k(this,ct,void 0);S(this,ct,e);let s=new x(t[0],r,n);s.type="heading-title",s.setAttribute("stage",2);let a=new he(t[1],/^[^\S\n]*$/u,"heading-trail",r,n,{});this.append(s,a)}get level(){return u(this,ct)}toString(){let e=u(this,De,Lt);return`${e}${String(this.firstChild)}${e}${String(this.lastChild)}`}text(){let e=u(this,De,Lt);return`${e}${this.firstChild.text()}${e}`}getAttribute(e){return e==="padding"?this.level:super.getAttribute(e)}getGaps(){return this.level}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{firstChild:r,level:n}=this,s=String(r),a=r.childNodes.filter(p=>p.type==="quote"),o=a.filter(({bold:p})=>p),l=a.filter(({italic:p})=>p),g;return this.level===1&&(g={start:e,...this.getRootNode().posFromIndex(e)},t.push(v(r,g,"<h1>"))),(s.startsWith("=")||s.endsWith("="))&&(g!=null||(g={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(r,g,m.msg("unbalanced $1 in a section header",'"="')))),this.closest("html-attrs, table-attrs")&&(g!=null||(g={start:e,...this.getRootNode().posFromIndex(e)}),t.push(w(this,g,"section header in a HTML tag"))),o.length%2&&(g!=null||(g={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(o[o.length-1],{...g,start:e+n,left:g.left+n},m.msg("unbalanced $1 in a section header","bold apostrophes")))),l.length%2&&(g!=null||(g={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(l[l.length-1],{start:e+n},m.msg("unbalanced $1 in a section header","italic apostrophes")))),t}print(){let e=u(this,De,Lt);return super.print({pre:e,sep:e})}json(){let e=super.json();return e.level=this.level,e}};ct=new WeakMap,De=new WeakSet,Lt=function(){return"=".repeat(this.level)}});var os,It,Rn=b(()=>{"use strict";H();R();A();F();os=d=>d.text().replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),It=class extends x{constructor(e,t,r=m.getConfig(),n=[]){super(void 0,r,n);f(this,"type","parameter");let s=new x(typeof e=="number"?void 0:e,r,n,{}),a=new x(t,r,n);s.type="parameter-key",a.type="parameter-value",a.setAttribute("stage",2),this.append(s,a)}get anon(){return this.firstChild.length===0}afterBuild(){if(!this.anon){let{parentNode:e,firstChild:t}=this,r=os(t);this.setAttribute("name",r),e&&e.getArgs(r,!1,!1).add(this)}}toString(){return this.anon?String(this.lastChild):super.toString("=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(e=this.getAbsoluteIndex()){var s;let t=super.lint(e),{firstChild:r}=this,n=(s=new RegExp(`https?://${be}${ke}$`,"iu").exec(r.text()))==null?void 0:s[0];if(n&&new URL(n).search){let a=v(r,{start:e},"unescaped query string in an anonymous parameter");t.push({...a,startIndex:a.endIndex,endIndex:a.endIndex+1,startLine:a.endLine,startCol:a.endCol,endCol:a.endCol+1})}return t}print(){return super.print({sep:this.anon?"":"="})}json(){let e=super.json();return e.anon=this.anon,e}}});var as,Ie,Pe,Rt,Gn,Gt,qn,Pt,jn=b(()=>{"use strict";H();R();Ee();de();A();F();Rn();me();mt();as=new Set(["pageid","articlepath","server","servername","scriptpath","stylepath"]),Pt=class extends x{constructor(e,t,r=m.getConfig(),n=[]){var h,c;super(void 0,r,n,{});k(this,Rt);k(this,Gt);f(this,"type","template");f(this,"modifier","");k(this,Ie,!1);k(this,Pe,new Map);let{parserFunction:[s,a]}=r,o=(h=/^(?:\s|\0\d+c\x7F)*\0\d+s\x7F/u.exec(e))==null?void 0:h[0];if(o)this.setAttribute("modifier",o),e=e.slice(o.length);else if(e.includes(":")){let[T,...y]=e.split(":"),[$]=/^(?:\s|\0\d+c\x7F)*/u.exec((c=y[0])!=null?c:"");this.setModifier(`${T}:${$}`)&&(e=y.join(":").slice($.length))}let l=e.includes(":");if(l||t.length===0&&!u(this,Ie)){let[T,...y]=e.split(":"),$=te(T),B=$[y.length>0?"trimStart":"trim"](),L=B.toLowerCase(),N=s[L],I=a.includes(B);if(I||as.has(N)||l&&N){this.setAttribute("name",N!=null?N:L),this.type="magic-word";let P=new RegExp(`^\\s*${B}\\s*$`,I?"u":"iu"),_=new he(T,P,"magic-word-name",r,n,{});if(super.insertAt(_),y.length>0&&t.unshift([y.join(":")]),this.name==="invoke")for(let Y=0;Y<2;Y++){let U=t.shift();if(!U)break;let Te=new q(U.join("="),`invoke-${Y?"function":"module"}`,r,n);super.insertAt(Te)}}}if(this.type==="template"){let T=te(yt(e)).split("#")[0].trim();if(!T||/^:[\s_]*:|\0\d+[eh!+-]\x7F|[<>[\]{}\n]|%[\da-f]{2}/iu.test(T))throw n.pop(),new SyntaxError("\u975E\u6CD5\u7684\u6A21\u677F\u540D\u79F0");let y=new q(e,"template-name",r,n,{});super.insertAt(y)}let g=this.isTemplate(),p=1;for(let T=0;T<t.length;T++){let y=t[T];!g&&!(this.name==="switch"&&T>0)&&(y[0]=y.join("="),y.length=1),y.length===1&&(y.unshift(p),p++),this.insertAt(new It(...y,r,n))}this.seal("modifier")}setModifier(e){let{parserFunction:[,,t,r]}=this.getAttribute("config"),n=te(e).trim();if(e&&!n.endsWith(":"))return!1;let s=n.slice(0,-1).toLowerCase(),a=t.includes(s),o=r.includes(s);return u(this,Ie)&&a||!u(this,Ie)&&(o||e==="")||(Ne.running||this.length>1)&&(a||o||e==="")?(this.setAttribute("modifier",e),S(this,Ie,a),!!e):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0))}toString(){return`{{${this.modifier}${this.type==="magic-word"?`${String(this.firstChild)}${this.length===1?"":":"}${this.childNodes.slice(1).map(String).join("|")}`:super.toString("|")}}}`}text(){let{childNodes:e,length:t,firstChild:r,modifier:n,type:s,name:a}=this;return s==="magic-word"&&a==="vardefine"?"":`{{${n}${s==="magic-word"?`${r.text()}${t===1?"":":"}${pe(e.slice(1),"|")}`:super.text("|")}}}`}getAttribute(e){switch(e){case"padding":return this.modifier.length+2;default:return super.getAttribute(e)}}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{type:r,childNodes:n,length:s}=this,a;if(!this.isTemplate())return t;let o=C(this,Rt,Gn).call(this);if(o.fragment!==void 0&&(a={start:e,...this.getRootNode().posFromIndex(e)},t.push(v(n[r==="template"?0:1],a,"useless fragment"))),o.valid||(a!=null||(a={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(n[1],a,"illegal module name"))),r==="magic-word"&&s===2)return a!=null||(a={start:e,...this.getRootNode().posFromIndex(e)}),t.push(w(this,a,"missing module function")),t;let l=this.getDuplicatedArgs();return l.length>0&&(a!=null||(a={start:e,...this.getRootNode().posFromIndex(e)}),t.push(...l.flatMap(([,g])=>g).map(g=>v(g,a,"duplicated parameter")))),t}insertAt(e,t=this.length){return super.insertAt(e,t),e.anon?C(this,Gt,qn).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getAllArgs(){return this.childNodes.filter(Fe("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:e})=>e)}getArgs(e,t=!1,r=!0){let n=String(e).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),s;return u(this,Pe).has(n)?s=u(this,Pe).get(n):(s=new Set(this.getAllArgs().filter(({name:a})=>n===a)),u(this,Pe).set(n,s)),s}getDuplicatedArgs(){return[...u(this,Pe)].filter(([,{size:e}])=>e>1).map(([e,t])=>[e,[...t]])}getPossibleValues(){let{type:e,name:t,childNodes:r,constructor:{name:n}}=this;if(e==="template")throw new Error(`${n}.getPossibleValues \u65B9\u6CD5\u4EC5\u4F9B\u7279\u5B9A\u9B54\u672F\u5B57\u4F7F\u7528\uFF01`);let s;switch(t){case"if":case"ifexist":case"ifexpr":case"iferror":s=2;break;case"ifeq":s=3;break;default:throw new Error(`${n}.getPossibleValues \u65B9\u6CD5\u4EC5\u4F9B\u7279\u5B9A\u9B54\u672F\u5B57\u4F7F\u7528\uFF01`)}let a=r.slice(s,s+2).map(({childNodes:[,o]})=>o);for(let o=0;o<a.length;){let{length:l,0:g}=a[o].childNodes.filter(p=>p.text().trim());if(l===0)a.splice(o,1);else if(l>1||g.type!=="magic-word")o++;else try{let p=g.getPossibleValues();a.splice(o,1,...p),o+=p.length}catch(p){o++}}return a}print(){let{childNodes:e,length:t,firstChild:r,modifier:n,type:s}=this;return`<span class="wpb-${s}">{{${n}${s==="magic-word"?`${r.print()}${t===1?"":":"}${ge(e.slice(1),{sep:"|"})}`:ge(e,{sep:"|"})}}}</span>`}};Ie=new WeakMap,Pe=new WeakMap,Rt=new WeakSet,Gn=function(){let e=this.type==="template",t=this.childNodes[e?0:1];return this.normalizeTitle(t.text(),e?10:828)},Gt=new WeakSet,qn=function(e){let t=this.getAnonArgs(),r=typeof e!="number";for(let n=r?t.indexOf(e):e-1;n<t.length;n++){let s=t[n],{name:a}=s,o=String(n+1);a!==o&&(s.setAttribute("name",o),this.getArgs(o,!1,!1).add(s))}}});var qt,Bn=b(()=>{"use strict";Me();F();qt=class extends ue(x){constructor(){super(...arguments);f(this,"type","hidden")}}});var jt,On=b(()=>{"use strict";H();R();A();F();me();Bn();jt=class extends x{constructor(e,t=m.getConfig(),r=[]){super(void 0,t,r,{});f(this,"type","arg");for(let n=0;n<e.length;n++)if(n===0){let s=new q(e[n],"arg-name",t,r,{});super.insertAt(s)}else if(n>1){let s=new qt(e[n],t,r,{});super.insertAt(s)}else{let s=new x(e[n],t,r);s.type="arg-default",s.setAttribute("stage",2),super.insertAt(s)}}get default(){var e,t;return(t=(e=this.childNodes[1])==null?void 0:e.text())!=null?t:!1}toString(){return`{{{${super.toString("|")}}}}`}text(){return`{{{${pe(this.childNodes.slice(0,2),"|")}}}}`}getAttribute(e){return e==="padding"?3:super.getAttribute(e)}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){if(!this.getAttribute("include"))return[w(this,{start:e},"unexpected template argument")];let{childNodes:[t,r,...n]}=this,s=t.lint(e+3);if(r&&s.push(...r.lint(e+4+String(t).length)),n.length>0){let a={start:e,...this.getRootNode().posFromIndex(e)};s.push(...n.map(o=>{let l=v(o,a,"invisible content inside triple braces");return{...l,startIndex:l.startIndex-1,startCol:l.startCol-1}}))}return s}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(){let e=super.json();return e.default=this.default,e}}});var _n={};W(_n,{parseBraces:()=>Er});var Er,Lr=b(()=>{"use strict";H();A();Fr();jn();On();Er=(d,i=m.getConfig(),e=[])=>{var h,c,T,y,$,B;let t=`${(h=i.excludes)!=null&&h.includes("heading")?"":"^(\0\\d+c\x7F)*={1,6}|"}\\[\\[|\\{{2,}|-\\{(?!\\{)`,{parserFunction:[,,,r]}=i,n=[],s={"=":`
|
|
8
|
+
`})}}});var ue,mt=b(()=>{"use strict";A();F();ue=class extends x{constructor(i,e,t="plain",r=m.getConfig(),n=[],s){super(i,r,n,s),this.type=t}lint(){return[]}}});var ct,De,Lt,He,Fr=b(()=>{"use strict";R();A();F();mt();He=class extends x{constructor(e,t,r=m.getConfig(),n=[]){super(void 0,r,n);k(this,De);f(this,"type","heading");k(this,ct,void 0);S(this,ct,e);let s=new x(t[0],r,n);s.type="heading-title",s.setAttribute("stage",2);let a=new ue(t[1],/^[^\S\n]*$/u,"heading-trail",r,n,{});this.append(s,a)}get level(){return u(this,ct)}toString(){let e=u(this,De,Lt);return`${e}${String(this.firstChild)}${e}${String(this.lastChild)}`}text(){let e=u(this,De,Lt);return`${e}${this.firstChild.text()}${e}`}getAttribute(e){return e==="padding"?this.level:super.getAttribute(e)}getGaps(){return this.level}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{firstChild:r,level:n}=this,s=String(r),a=r.childNodes.filter(p=>p.type==="quote"),o=a.filter(({bold:p})=>p),l=a.filter(({italic:p})=>p),g;return this.level===1&&(g={start:e,...this.getRootNode().posFromIndex(e)},t.push(v(r,g,"<h1>"))),(s.startsWith("=")||s.endsWith("="))&&(g!=null||(g={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(r,g,m.msg("unbalanced $1 in a section header",'"="')))),this.closest("html-attrs, table-attrs")&&(g!=null||(g={start:e,...this.getRootNode().posFromIndex(e)}),t.push(w(this,g,"section header in a HTML tag"))),o.length%2&&(g!=null||(g={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(o[o.length-1],{...g,start:e+n,left:g.left+n},m.msg("unbalanced $1 in a section header","bold apostrophes")))),l.length%2&&(g!=null||(g={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(l[l.length-1],{start:e+n},m.msg("unbalanced $1 in a section header","italic apostrophes")))),t}print(){let e=u(this,De,Lt);return super.print({pre:e,sep:e})}json(){let e=super.json();return e.level=this.level,e}};ct=new WeakMap,De=new WeakSet,Lt=function(){return"=".repeat(this.level)}});var os,It,Rn=b(()=>{"use strict";H();R();A();F();os=d=>d.text().replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),It=class extends x{constructor(e,t,r=m.getConfig(),n=[]){super(void 0,r,n);f(this,"type","parameter");let s=new x(typeof e=="number"?void 0:e,r,n,{}),a=new x(t,r,n);s.type="parameter-key",a.type="parameter-value",a.setAttribute("stage",2),this.append(s,a)}get anon(){return this.firstChild.length===0}afterBuild(){if(!this.anon){let{parentNode:e,firstChild:t}=this,r=os(t);this.setAttribute("name",r),e&&e.getArgs(r,!1,!1).add(this)}}toString(){return this.anon?String(this.lastChild):super.toString("=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(e=this.getAbsoluteIndex()){var s;let t=super.lint(e),{firstChild:r}=this,n=(s=new RegExp(`https?://${be}${ke}$`,"iu").exec(r.text()))==null?void 0:s[0];if(n&&new URL(n).search){let a=v(r,{start:e},"unescaped query string in an anonymous parameter");t.push({...a,startIndex:a.endIndex,endIndex:a.endIndex+1,startLine:a.endLine,startCol:a.endCol,endCol:a.endCol+1})}return t}print(){return super.print({sep:this.anon?"":"="})}json(){let e=super.json();return e.anon=this.anon,e}}});var as,Ie,Pe,Rt,Gn,Gt,qn,Pt,jn=b(()=>{"use strict";H();R();Ee();de();A();F();Rn();me();mt();as=new Set(["pageid","articlepath","server","servername","scriptpath","stylepath"]),Pt=class extends x{constructor(e,t,r=m.getConfig(),n=[]){var h,c;super(void 0,r,n,{});k(this,Rt);k(this,Gt);f(this,"type","template");f(this,"modifier","");k(this,Ie,!1);k(this,Pe,new Map);let{parserFunction:[s,a]}=r,o=(h=/^(?:\s|\0\d+c\x7F)*\0\d+s\x7F/u.exec(e))==null?void 0:h[0];if(o)this.setAttribute("modifier",o),e=e.slice(o.length);else if(e.includes(":")){let[T,...y]=e.split(":"),[$]=/^(?:\s|\0\d+c\x7F)*/u.exec((c=y[0])!=null?c:"");this.setModifier(`${T}:${$}`)&&(e=y.join(":").slice($.length))}let l=e.includes(":");if(l||t.length===0&&!u(this,Ie)){let[T,...y]=e.split(":"),$=te(T),B=$[y.length>0?"trimStart":"trim"](),L=B.toLowerCase(),N=s[L],I=a.includes(B);if(I||as.has(N)||l&&N){this.setAttribute("name",N!=null?N:L),this.type="magic-word";let P=new RegExp(`^\\s*${B}\\s*$`,I?"u":"iu"),_=new ue(T,P,"magic-word-name",r,n,{});if(super.insertAt(_),y.length>0&&t.unshift([y.join(":")]),this.name==="invoke")for(let J=0;J<2;J++){let U=t.shift();if(!U)break;let Te=new q(U.join("="),`invoke-${J?"function":"module"}`,r,n);super.insertAt(Te)}}}if(this.type==="template"){let T=te(yt(e)).split("#")[0].trim();if(!T||/^:[\s_]*:|\0\d+[eh!+-]\x7F|[<>[\]{}\n]|%[\da-f]{2}/iu.test(T))throw n.pop(),new SyntaxError("\u975E\u6CD5\u7684\u6A21\u677F\u540D\u79F0");let y=new q(e,"template-name",r,n,{});super.insertAt(y)}let g=this.isTemplate(),p=1;for(let T=0;T<t.length;T++){let y=t[T];!g&&!(this.name==="switch"&&T>0)&&(y[0]=y.join("="),y.length=1),y.length===1&&(y.unshift(p),p++),this.insertAt(new It(...y,r,n))}this.seal("modifier")}setModifier(e){let{parserFunction:[,,t,r]}=this.getAttribute("config"),n=te(e).trim();if(e&&!n.endsWith(":"))return!1;let s=n.slice(0,-1).toLowerCase(),a=t.includes(s),o=r.includes(s);return u(this,Ie)&&a||!u(this,Ie)&&(o||e==="")||(Ne.running||this.length>1)&&(a||o||e==="")?(this.setAttribute("modifier",e),S(this,Ie,a),!!e):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0))}toString(){return`{{${this.modifier}${this.type==="magic-word"?`${String(this.firstChild)}${this.length===1?"":":"}${this.childNodes.slice(1).map(String).join("|")}`:super.toString("|")}}}`}text(){let{childNodes:e,length:t,firstChild:r,modifier:n,type:s,name:a}=this;return s==="magic-word"&&a==="vardefine"?"":`{{${n}${s==="magic-word"?`${r.text()}${t===1?"":":"}${pe(e.slice(1),"|")}`:super.text("|")}}}`}getAttribute(e){switch(e){case"padding":return this.modifier.length+2;default:return super.getAttribute(e)}}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{type:r,childNodes:n,length:s}=this,a;if(!this.isTemplate())return t;let o=C(this,Rt,Gn).call(this);if(o.fragment!==void 0&&(a={start:e,...this.getRootNode().posFromIndex(e)},t.push(v(n[r==="template"?0:1],a,"useless fragment"))),o.valid||(a!=null||(a={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(n[1],a,"illegal module name"))),r==="magic-word"&&s===2)return a!=null||(a={start:e,...this.getRootNode().posFromIndex(e)}),t.push(w(this,a,"missing module function")),t;let l=this.getDuplicatedArgs();return l.length>0&&(a!=null||(a={start:e,...this.getRootNode().posFromIndex(e)}),t.push(...l.flatMap(([,g])=>g).map(g=>v(g,a,"duplicated parameter")))),t}insertAt(e,t=this.length){return super.insertAt(e,t),e.anon?C(this,Gt,qn).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getAllArgs(){return this.childNodes.filter(Fe("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:e})=>e)}getArgs(e,t=!1,r=!0){let n=String(e).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),s;return u(this,Pe).has(n)?s=u(this,Pe).get(n):(s=new Set(this.getAllArgs().filter(({name:a})=>n===a)),u(this,Pe).set(n,s)),s}getDuplicatedArgs(){return[...u(this,Pe)].filter(([,{size:e}])=>e>1).map(([e,t])=>[e,[...t]])}getPossibleValues(){let{type:e,name:t,childNodes:r,constructor:{name:n}}=this;if(e==="template")throw new Error(`${n}.getPossibleValues \u65B9\u6CD5\u4EC5\u4F9B\u7279\u5B9A\u9B54\u672F\u5B57\u4F7F\u7528\uFF01`);let s;switch(t){case"if":case"ifexist":case"ifexpr":case"iferror":s=2;break;case"ifeq":s=3;break;default:throw new Error(`${n}.getPossibleValues \u65B9\u6CD5\u4EC5\u4F9B\u7279\u5B9A\u9B54\u672F\u5B57\u4F7F\u7528\uFF01`)}let a=r.slice(s,s+2).map(({childNodes:[,o]})=>o);for(let o=0;o<a.length;){let{length:l,0:g}=a[o].childNodes.filter(p=>p.text().trim());if(l===0)a.splice(o,1);else if(l>1||g.type!=="magic-word")o++;else try{let p=g.getPossibleValues();a.splice(o,1,...p),o+=p.length}catch(p){o++}}return a}print(){let{childNodes:e,length:t,firstChild:r,modifier:n,type:s}=this;return`<span class="wpb-${s}">{{${n}${s==="magic-word"?`${r.print()}${t===1?"":":"}${he(e.slice(1),{sep:"|"})}`:he(e,{sep:"|"})}}}</span>`}};Ie=new WeakMap,Pe=new WeakMap,Rt=new WeakSet,Gn=function(){let e=this.type==="template",t=this.childNodes[e?0:1];return this.normalizeTitle(t.text(),e?10:828)},Gt=new WeakSet,qn=function(e){let t=this.getAnonArgs(),r=typeof e!="number";for(let n=r?t.indexOf(e):e-1;n<t.length;n++){let s=t[n],{name:a}=s,o=String(n+1);a!==o&&(s.setAttribute("name",o),this.getArgs(o,!1,!1).add(s))}}});var qt,Bn=b(()=>{"use strict";Me();F();qt=class extends ge(x){constructor(){super(...arguments);f(this,"type","hidden")}}});var jt,On=b(()=>{"use strict";H();R();A();F();me();Bn();jt=class extends x{constructor(e,t=m.getConfig(),r=[]){super(void 0,t,r,{});f(this,"type","arg");for(let n=0;n<e.length;n++)if(n===0){let s=new q(e[n],"arg-name",t,r,{});super.insertAt(s)}else if(n>1){let s=new qt(e[n],t,r,{});super.insertAt(s)}else{let s=new x(e[n],t,r);s.type="arg-default",s.setAttribute("stage",2),super.insertAt(s)}}get default(){var e,t;return(t=(e=this.childNodes[1])==null?void 0:e.text())!=null?t:!1}toString(){return`{{{${super.toString("|")}}}}`}text(){return`{{{${pe(this.childNodes.slice(0,2),"|")}}}}`}getAttribute(e){return e==="padding"?3:super.getAttribute(e)}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){if(!this.getAttribute("include"))return[w(this,{start:e},"unexpected template argument")];let{childNodes:[t,r,...n]}=this,s=t.lint(e+3);if(r&&s.push(...r.lint(e+4+String(t).length)),n.length>0){let a={start:e,...this.getRootNode().posFromIndex(e)};s.push(...n.map(o=>{let l=v(o,a,"invisible content inside triple braces");return{...l,startIndex:l.startIndex-1,startCol:l.startCol-1}}))}return s}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(){let e=super.json();return e.default=this.default,e}}});var _n={};W(_n,{parseBraces:()=>Er});var Er,Lr=b(()=>{"use strict";H();A();Fr();jn();On();Er=(d,i=m.getConfig(),e=[])=>{var h,c,T,y,$,B;let t=`${(h=i.excludes)!=null&&h.includes("heading")?"":"^(\0\\d+c\x7F)*={1,6}|"}\\[\\[|\\{{2,}|-\\{(?!\\{)`,{parserFunction:[,,,r]}=i,n=[],s={"=":`
|
|
9
9
|
`,"{":"\\}{2,}|\\|","-":"\\}-","[":"\\]\\]"},a=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"]]),o=new RegExp(t,"gmu"),l=o.exec(d),g=d.includes("}}"),p;for(;l||p!==void 0&&p<=d.length&&((T=(c=n[n.length-1])==null?void 0:c[0])!=null&&T.startsWith("="));){if(l!=null&&l[1]){let[,{length:z}]=l;l[0]=l[0].slice(z),l.index+=z}let{0:L,index:N}=l!=null?l:{0:`
|
|
10
|
-
`,index:d.length},I=(y=n.pop())!=null?y:{},{0:O,index:P,parts:_,findEqual:
|
|
11
|
-
`){p=N+1;let{pos:z,findEqual:E}=($=n[n.length-1])!=null?$:{};if(z===void 0||E||te(d.slice(z,P))!==""){let ie=/^(={1,6})(.+)\1((?:\s|\0\d+c\x7F)*)$/u.exec(d.slice(P,N));ie&&(d=`${d.slice(0,P)}\0${e.length}h\x7F${d.slice(N)}`,p=P+4+String(e.length).length,new He(ie[1].length,ie.slice(2),i,e))}}else if(L==="|"||Te)p=N+1,Be(d),L==="|"&&_.push([]),I.pos=p,I.findEqual=L==="|",n.push(I);else if(L.startsWith("}}")){let z=L.slice(0,Math.min(O.length,3)),E=O.length-z.length,{length:ie}=e;p=N+z.length,Be(d);let Oe=!1,xe="t";if(z.length===3){let K=_.map(at=>at.join("=")),le=K.length>1&&te(K[1]).trim();new jt(K,i,e),le&&le.endsWith(":")&&r.includes(le.slice(0,-1).toLowerCase())&&(xe="s")}else try{new Pt(_[0][0],_.slice(1),i,e);let K=te(_[0][0]).trim();a.has(K)?xe=a.get(K):/^(?:filepath|(?:full|canonical)urle?):.|^server$/iu.test(K)?xe="m":/^#vardefine:./iu.test(K)&&(xe="c")}catch(K){if(K instanceof SyntaxError&&K.message==="\u975E\u6CD5\u7684\u6A21\u677F\u540D\u79F0")Oe=!0;else throw K}Oe||(d=`${d.slice(0,P+E)}\0${ie}${xe}\x7F${d.slice(p)}`,p=P+E+3+String(ie).length,E>1?n.push({0:O.slice(0,E),index:P,pos:P+E,parts:[[]]}):E===1&&d[P-1]==="-"&&n.push({0:"-{",index:P-1,pos:P+1,parts:[[]]}))}else p=N+L.length,L.startsWith("{")&&(l.pos=p,l.parts=[[]]),n.push(..."0"in I?[I]:[],l);g&&(g=d.slice(p).includes("}}"));let ee=n[n.length-1];!g&&((B=ee==null?void 0:ee[0])!=null&&B.startsWith("{"))&&(n.pop(),ee=n[n.length-1]),o=new RegExp(t+(ee?`|${s[ee[0][0]]}${ee.findEqual?"|=":""}`:""),"gmu"),o.lastIndex=p,l=o.exec(d)}return d}});var Mn={};W(Mn,{InputboxToken:()=>Ir});var Ir,zn=b(()=>{"use strict";Lr();A();Nr();Ir=class extends ht{constructor(i,e=m.getConfig(),t=[]){let r=Symbol("InputboxToken");t.push(r),i&&(i=Er(i,e,t)),t.splice(t.indexOf(r),1),super(i,e,t,{})}}});var Ve,Pr=b(()=>{"use strict";R();Me();A();ye();Ve=class extends ue(Q){constructor(e,t=!0,r=m.getConfig(),n=[]){super(e,r,n);f(this,"type","comment");f(this,"closed");this.closed=t}getAttribute(e){return e==="padding"?4:super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){return this.closed?[]:[w(this,{start:e},m.msg("unclosed $1","HTML comment"))]}toString(){return`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}}});var Bt={};W(Bt,{NestedToken:()=>Rr});var Rr,Ot=b(()=>{"use strict";R();A();F();Gr();Le();Pr();Rr=class extends x{constructor(e,t,r,n=m.getConfig(),s=[]){e=e==null?void 0:e.replace(t,(a,o,l,g,p)=>{let h=`\0${s.length+1}${o?"e":"c"}\x7F`;if(o)new Ze(o,l,g,p,n,s);else{let c=a.endsWith("-->");new Ve(a.slice(4,c?-3:void 0),c,n,s)}return h}).replace(/(^|\0\d+[ce]\x7F)([^\0]+)(?=$|\0\d+[ce]\x7F)/gu,(a,o,l)=>(new V(l,n,s),`${o}\0${s.length}c\x7F`));super(e,n,s,{});f(this,"type","ext-inner")}lint(e=this.getAbsoluteIndex()){let t;return[...super.lint(e),...this.childNodes.filter(r=>{if(r.type==="ext"||r.type==="comment")return!1;let n=String(r).trim();return n&&!/^<!--.*-->$/su.test(n)}).map(r=>(t!=null||(t={start:e,...this.getRootNode().posFromIndex(e)}),v(r,t,m.msg("invalid content in <$1>",this.name))))]}}});var Re,oe,Ge,Se,_t=b(()=>{"use strict";R();de();A();F();me();Se=class extends x{constructor(e,t,r=m.getConfig(),n=[],s="|"){super(void 0,r,n,{});k(this,Re,!0);k(this,oe,void 0);k(this,Ge,void 0);if(this.insertAt(new q(e,"link-target",r,n,{})),t!==void 0){let a=new x(t,r,n,{});a.type="link-text",a.setAttribute("stage",10),this.insertAt(a)}S(this,oe,s)}afterBuild(){S(this,Ge,this.getTitle()),u(this,oe).includes("\0")&&S(this,oe,this.buildFromStr(u(this,oe),0))}setAttribute(e,t){e==="bracket"?S(this,Re,!!t):e==="title"?S(this,Ge,t):super.setAttribute(e,t)}toString(){let e=super.toString(u(this,oe));return u(this,Re)?`[[${e}]]`:e}text(){let e=super.text("|");return u(this,Re)?`[[${e}]]`:e}getAttribute(e){return e==="title"?u(this,Ge):e==="padding"?2:super.getAttribute(e)}getGaps(e){return e===0?u(this,oe).length:1}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{childNodes:[r,n],type:s}=this,{encoded:a,fragment:o}=u(this,Ge),l;return r.childNodes.some(({type:g})=>g==="template")&&(l={start:e,...this.getRootNode().posFromIndex(e)},t.push(v(r,l,"template in an internal link target","warning"))),a&&(l!=null||(l={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(r,l,"unnecessary URL encoding in an internal link"))),(s==="link"||s==="category")&&(n!=null&&n.childNodes.some(({type:g,data:p})=>g==="text"&&p.includes("|")))?(l!=null||(l={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(n,l,'additional "|" in the link text',"warning"))):s!=="link"&&o!==void 0&&(l!=null||(l={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(r,l,"useless fragment"))),t}getTitle(){return this.normalizeTitle(this.firstChild.text(),0,!1,!0,!0)}print(){return super.print(u(this,Re)?{pre:"[[",post:"]]",sep:u(this,oe)}:{sep:u(this,oe)})}};Re=new WeakMap,oe=new WeakMap,Ge=new WeakMap});function Wn(d,i,e=m.getConfig(),t=!1){i=i.trim();let r=i.replace(/\0\d+t\x7F/gu,"").trim();switch(d){case"width":return!r||/^(?:\d+x?|\d*x\d+)$/u.test(r);case"link":{if(!r||new RegExp(`^(?:(?:${e.protocol}|//)${be}|\0\\d+m\x7F)${ke}$`,"iu").test(r))return i;r.startsWith("[[")&&r.endsWith("]]")&&(r=r.slice(2,-2));let s=m.normalizeTitle(r,0,!1,e,t,!0,!0);return s.valid&&s}case"lang":return!r||e.variants.includes(r);case"alt":case"class":case"manualthumb":return!0;default:return!Number.isNaN(Number(r))}}var ls,J,zt,Un,Mt,Dn=b(()=>{"use strict";H();R();A();F();ls=new Set(["alt","link","lang","page","caption"]);Mt=class extends x{constructor(e,t=m.getConfig(),r=[]){var i=(...gl)=>(super(...gl),k(this,zt),f(this,"type","image-parameter"),k(this,J,""),this);var o;let n,s=Object.entries(t.img).map(([l,g])=>[l,g,new RegExp(`^(\\s*)${l.replace("$1","(.*)")}(\\s*)$`,"u")]),a=s.find(([,l,g])=>(n=g.exec(e),n&&(n.length!==4||Wn(l,n[2],t,!0)!==!1)));if(a&&n){n.length===3?(i(void 0,t,r),S(this,J,e)):(i(n[2],t,r,{}),S(this,J,`${n[1]}${a[0]}${n[3]}`)),this.setAttribute("name",a[1]);return}i(e,{...t,excludes:[...(o=t.excludes)!=null?o:[],"list"]},r),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get link(){return this.name==="link"?Wn("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var e;((e=this.parentNode)==null?void 0:e.type)==="gallery-image"&&!ls.has(this.name)&&this.setAttribute("name","invalid")}toString(){return u(this,J)?u(this,J).replace("$1",super.toString()):super.toString()}text(){return u(this,J)?u(this,J).replace("$1",super.text()).trim():super.text().trim()}getAttribute(e){return e==="plain"?this.name==="caption":e==="padding"?Math.max(0,u(this,J).indexOf("$1")):super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{link:r,name:n}=this;return n==="invalid"?t.push(w(this,{start:e},"invalid gallery image parameter")):typeof r=="object"&&r.encoded&&t.push(w(this,{start:e},"unnecessary URL encoding in an internal link")),t}getValue(){return this.name==="invalid"?this.text():C(this,zt,Un).call(this)||super.text()}print(){return u(this,J)?this.name==="invalid"?`<span class="wpb-image-invalid">${u(this,J).replace("$1",ge(this.childNodes))}</span>`:`<span class="wpb-image-parameter">${u(this,J).replace("$1",`<span class="wpb-image-caption">${ge(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}};J=new WeakMap,zt=new WeakSet,Un=function(){return u(this,J)&&!u(this,J).includes("$1")}});var qr,jr,Br,ds,Qe,Wt,Xe,Or=b(()=>{"use strict";H();R();A();_t();Dn();qr=new Set(["manualthumb","frameless","framed","thumbnail"]),jr=new Set(["left","right","center","none"]),Br=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),ds=(d,i,e,t)=>{if(t===void 0)return[];let r=new RegExp(`${[d,i,e].map(pn).join("|")}`,"gu"),n=[],s=r.exec(t),a=0,o=0;for(;s;){let{0:l,index:g}=s;l!==e?a+=l===d?1:-1:a===0&&(n.push(t.slice(o,g)),{lastIndex:o}=r),s=r.exec(t)}return n.push(t.slice(o)),n},Xe=class extends Se{constructor(e,t,r=m.getConfig(),n=[],s="|"){super(e,void 0,r,n,s);k(this,Qe);f(this,"type","file");this.append(...ds("-{","}-","|",t).map(a=>new Mt(a,r,n)))}lint(e=this.getAbsoluteIndex()){var p;let t=super.lint(e),r=this.getAllArgs().filter(({childNodes:h})=>{let c=h.filter(T=>T.text().trim());return c.length!==1||c[0].type!=="arg"}),n=[...new Set(r.map(({name:h})=>h))].filter(h=>h!=="invalid"),s=n.filter(h=>qr.has(h)),a=n.filter(h=>jr.has(h)),o=n.filter(h=>Br.has(h));if(this.closest("ext-link-text")&&((p=this.getValue("link"))==null?void 0:p.trim())!==""&&t.push(w(this,{start:e},"internal link in an external link")),r.length===n.length&&s.length<2&&a.length<2&&o.length<2)return t;let l={start:e,...this.getRootNode().posFromIndex(e)},g=(h,c)=>T=>v(T,l,m.msg(`${h} image $1 parameter`,c));for(let h of n){let c=r.filter(({name:T})=>T===h);h==="caption"&&(c=[...c.slice(0,-1).filter(T=>T.text()),...c.slice(-1)]),c.length>1&&t.push(...c.map(g("duplicated",h)))}return s.length>1&&t.push(...r.filter(({name:h})=>qr.has(h)).map(g("conflicting","frame"))),a.length>1&&t.push(...r.filter(({name:h})=>jr.has(h)).map(g("conflicting","horizontal-alignment"))),o.length>1&&t.push(...r.filter(({name:h})=>Br.has(h)).map(g("conflicting","vertical-alignment"))),t}getAllArgs(){return this.childNodes.slice(1)}getArgs(e){return this.getAllArgs().filter(({name:t})=>e===t)}getFrameArgs(){return C(this,Qe,Wt).call(this,qr,"\u6846\u67B6")}getHorizAlignArgs(){return C(this,Qe,Wt).call(this,jr,"\u6C34\u5E73\u5BF9\u9F50")}getVertAlignArgs(){return C(this,Qe,Wt).call(this,Br,"\u5782\u76F4\u5BF9\u9F50")}getArg(e){let t=this.getArgs(e);return t[t.length-1]}getValue(e){var t;return(t=this.getArg(e))==null?void 0:t.getValue()}};Qe=new WeakSet,Wt=function(e,t){return this.getAllArgs().filter(({name:n})=>e.has(n))}});var Ut,Hn,Ke,_r=b(()=>{"use strict";R();de();A();F();Or();Ke=class extends Xe{constructor(e,t,r,n=m.getConfig(),s=[]){let a;if(r!==void 0){a=new x(r,n,s),a.type="plain";for(let o=1;o<11;o++)a.parseOnce();s.splice(s.indexOf(a),1)}super(t,a==null?void 0:a.toString(),n,s);k(this,Ut);this.setAttribute("bracket",!1),this.type=`${e}-image`}getTitle(){let e=this.type==="imagemap-image";return this.normalizeTitle(String(this.firstChild),e?0:6,!0,!e)}getAttribute(e){return e==="padding"?0:super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{ns:r,interwiki:n}=this.getAttribute("title");return(n||r!==6)&&t.push(w(this,{start:e},"invalid gallery image")),t}afterBuild(){C(this,Ut,Hn).call(this,this.getTitle())}};Ut=new WeakSet,Hn=function(e){this.setAttribute("title",e)}});var Zn={};W(Zn,{GalleryToken:()=>Mr});var Dt,Vn,Mr,Qn=b(()=>{"use strict";A();F();_r();Le();Mr=class extends x{constructor(e,t=m.getConfig(),r=[]){var n;super(void 0,t,r,{});k(this,Dt);f(this,"type","ext-inner");for(let s of(n=e==null?void 0:e.split(`
|
|
10
|
+
`,index:d.length},I=(y=n.pop())!=null?y:{},{0:O,index:P,parts:_,findEqual:J,pos:U}=I,Te=L==="="&&J,Be=z=>{_[_.length-1].push(z.slice(U,N))};if(L==="]]"||L==="}-")p=N+2;else if(L===`
|
|
11
|
+
`){p=N+1;let{pos:z,findEqual:E}=($=n[n.length-1])!=null?$:{};if(z===void 0||E||te(d.slice(z,P))!==""){let ie=/^(={1,6})(.+)\1((?:\s|\0\d+c\x7F)*)$/u.exec(d.slice(P,N));ie&&(d=`${d.slice(0,P)}\0${e.length}h\x7F${d.slice(N)}`,p=P+4+String(e.length).length,new He(ie[1].length,ie.slice(2),i,e))}}else if(L==="|"||Te)p=N+1,Be(d),L==="|"&&_.push([]),I.pos=p,I.findEqual=L==="|",n.push(I);else if(L.startsWith("}}")){let z=L.slice(0,Math.min(O.length,3)),E=O.length-z.length,{length:ie}=e;p=N+z.length,Be(d);let Oe=!1,xe="t";if(z.length===3){let K=_.map(at=>at.join("=")),le=K.length>1&&te(K[1]).trim();new jt(K,i,e),le&&le.endsWith(":")&&r.includes(le.slice(0,-1).toLowerCase())&&(xe="s")}else try{new Pt(_[0][0],_.slice(1),i,e);let K=te(_[0][0]).trim();a.has(K)?xe=a.get(K):/^(?:filepath|(?:full|canonical)urle?):.|^server$/iu.test(K)?xe="m":/^#vardefine:./iu.test(K)&&(xe="c")}catch(K){if(K instanceof SyntaxError&&K.message==="\u975E\u6CD5\u7684\u6A21\u677F\u540D\u79F0")Oe=!0;else throw K}Oe||(d=`${d.slice(0,P+E)}\0${ie}${xe}\x7F${d.slice(p)}`,p=P+E+3+String(ie).length,E>1?n.push({0:O.slice(0,E),index:P,pos:P+E,parts:[[]]}):E===1&&d[P-1]==="-"&&n.push({0:"-{",index:P-1,pos:P+1,parts:[[]]}))}else p=N+L.length,L.startsWith("{")&&(l.pos=p,l.parts=[[]]),n.push(..."0"in I?[I]:[],l);g&&(g=d.slice(p).includes("}}"));let ee=n[n.length-1];!g&&((B=ee==null?void 0:ee[0])!=null&&B.startsWith("{"))&&(n.pop(),ee=n[n.length-1]),o=new RegExp(t+(ee?`|${s[ee[0][0]]}${ee.findEqual?"|=":""}`:""),"gmu"),o.lastIndex=p,l=o.exec(d)}return d}});var Mn={};W(Mn,{InputboxToken:()=>Ir});var Ir,zn=b(()=>{"use strict";Lr();A();Nr();Ir=class extends ht{constructor(i,e=m.getConfig(),t=[]){let r=Symbol("InputboxToken");t.push(r),i&&(i=Er(i,e,t)),t.splice(t.indexOf(r),1),super(i,e,t,{})}}});var Ve,Pr=b(()=>{"use strict";R();Me();A();ye();Ve=class extends ge(Q){constructor(e,t=!0,r=m.getConfig(),n=[]){super(e,r,n);f(this,"type","comment");f(this,"closed");this.closed=t}getAttribute(e){return e==="padding"?4:super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){return this.closed?[]:[w(this,{start:e},m.msg("unclosed $1","HTML comment"))]}toString(){return`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}}});var Bt={};W(Bt,{NestedToken:()=>Rr});var Rr,Ot=b(()=>{"use strict";R();A();F();Gr();Le();Pr();Rr=class extends x{constructor(e,t,r,n=m.getConfig(),s=[]){e=e==null?void 0:e.replace(t,(a,o,l,g,p)=>{let h=`\0${s.length+1}${o?"e":"c"}\x7F`;if(o)new Ze(o,l,g,p,n,s);else{let c=a.endsWith("-->");new Ve(a.slice(4,c?-3:void 0),c,n,s)}return h}).replace(/(^|\0\d+[ce]\x7F)([^\0]+)(?=$|\0\d+[ce]\x7F)/gu,(a,o,l)=>(new V(l,n,s),`${o}\0${s.length}c\x7F`));super(e,n,s,{});f(this,"type","ext-inner")}lint(e=this.getAbsoluteIndex()){let t;return[...super.lint(e),...this.childNodes.filter(r=>{if(r.type==="ext"||r.type==="comment")return!1;let n=String(r).trim();return n&&!/^<!--.*-->$/su.test(n)}).map(r=>(t!=null||(t={start:e,...this.getRootNode().posFromIndex(e)}),v(r,t,m.msg("invalid content in <$1>",this.name))))]}}});var Re,oe,Ge,Se,_t=b(()=>{"use strict";R();de();A();F();me();Se=class extends x{constructor(e,t,r=m.getConfig(),n=[],s="|"){super(void 0,r,n,{});k(this,Re,!0);k(this,oe,void 0);k(this,Ge,void 0);if(this.insertAt(new q(e,"link-target",r,n,{})),t!==void 0){let a=new x(t,r,n,{});a.type="link-text",a.setAttribute("stage",10),this.insertAt(a)}S(this,oe,s)}afterBuild(){S(this,Ge,this.getTitle()),u(this,oe).includes("\0")&&S(this,oe,this.buildFromStr(u(this,oe),0))}setAttribute(e,t){e==="bracket"?S(this,Re,!!t):e==="title"?S(this,Ge,t):super.setAttribute(e,t)}toString(){let e=super.toString(u(this,oe));return u(this,Re)?`[[${e}]]`:e}text(){let e=super.text("|");return u(this,Re)?`[[${e}]]`:e}getAttribute(e){return e==="title"?u(this,Ge):e==="padding"?2:super.getAttribute(e)}getGaps(e){return e===0?u(this,oe).length:1}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{childNodes:[r,n],type:s}=this,{encoded:a,fragment:o}=u(this,Ge),l;return r.childNodes.some(({type:g})=>g==="template")&&(l={start:e,...this.getRootNode().posFromIndex(e)},t.push(v(r,l,"template in an internal link target","warning"))),a&&(l!=null||(l={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(r,l,"unnecessary URL encoding in an internal link"))),(s==="link"||s==="category")&&(n!=null&&n.childNodes.some(({type:g,data:p})=>g==="text"&&p.includes("|")))?(l!=null||(l={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(n,l,'additional "|" in the link text',"warning"))):s!=="link"&&o!==void 0&&(l!=null||(l={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(r,l,"useless fragment"))),t}getTitle(){return this.normalizeTitle(this.firstChild.text(),0,!1,!0,!0)}print(){return super.print(u(this,Re)?{pre:"[[",post:"]]",sep:u(this,oe)}:{sep:u(this,oe)})}};Re=new WeakMap,oe=new WeakMap,Ge=new WeakMap});function Wn(d,i,e=m.getConfig(),t=!1){i=i.trim();let r=i.replace(/\0\d+t\x7F/gu,"").trim();switch(d){case"width":return!r||/^(?:\d+x?|\d*x\d+)$/u.test(r);case"link":{if(!r||new RegExp(`^(?:(?:${e.protocol}|//)${be}|\0\\d+m\x7F)${ke}$`,"iu").test(r))return i;r.startsWith("[[")&&r.endsWith("]]")&&(r=r.slice(2,-2));let s=m.normalizeTitle(r,0,!1,e,t,!0,!0);return s.valid&&s}case"lang":return!r||e.variants.includes(r);case"alt":case"class":case"manualthumb":return!0;default:return!Number.isNaN(Number(r))}}var ls,Y,zt,Un,Mt,Dn=b(()=>{"use strict";H();R();A();F();ls=new Set(["alt","link","lang","page","caption"]);Mt=class extends x{constructor(e,t=m.getConfig(),r=[]){var i=(...gl)=>(super(...gl),k(this,zt),f(this,"type","image-parameter"),k(this,Y,""),this);var o;let n,s=Object.entries(t.img).map(([l,g])=>[l,g,new RegExp(`^(\\s*)${l.replace("$1","(.*)")}(\\s*)$`,"u")]),a=s.find(([,l,g])=>(n=g.exec(e),n&&(n.length!==4||Wn(l,n[2],t,!0)!==!1)));if(a&&n){n.length===3?(i(void 0,t,r),S(this,Y,e)):(i(n[2],t,r,{}),S(this,Y,`${n[1]}${a[0]}${n[3]}`)),this.setAttribute("name",a[1]);return}i(e,{...t,excludes:[...(o=t.excludes)!=null?o:[],"list"]},r),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get link(){return this.name==="link"?Wn("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var e;((e=this.parentNode)==null?void 0:e.type)==="gallery-image"&&!ls.has(this.name)&&this.setAttribute("name","invalid")}toString(){return u(this,Y)?u(this,Y).replace("$1",super.toString()):super.toString()}text(){return u(this,Y)?u(this,Y).replace("$1",super.text()).trim():super.text().trim()}getAttribute(e){return e==="plain"?this.name==="caption":e==="padding"?Math.max(0,u(this,Y).indexOf("$1")):super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{link:r,name:n}=this;return n==="invalid"?t.push(w(this,{start:e},"invalid gallery image parameter")):typeof r=="object"&&r.encoded&&t.push(w(this,{start:e},"unnecessary URL encoding in an internal link")),t}getValue(){return this.name==="invalid"?this.text():C(this,zt,Un).call(this)||super.text()}print(){return u(this,Y)?`<span class="wpb-image-parameter">${u(this,Y).replace("$1",`<span class="wpb-image-caption">${he(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}};Y=new WeakMap,zt=new WeakSet,Un=function(){return u(this,Y)&&!u(this,Y).includes("$1")}});var qr,jr,Br,ds,Qe,Wt,Xe,Or=b(()=>{"use strict";H();R();A();_t();Dn();qr=new Set(["manualthumb","frameless","framed","thumbnail"]),jr=new Set(["left","right","center","none"]),Br=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),ds=(d,i,e,t)=>{if(t===void 0)return[];let r=new RegExp(`${[d,i,e].map(pn).join("|")}`,"gu"),n=[],s=r.exec(t),a=0,o=0;for(;s;){let{0:l,index:g}=s;l!==e?a+=l===d?1:-1:a===0&&(n.push(t.slice(o,g)),{lastIndex:o}=r),s=r.exec(t)}return n.push(t.slice(o)),n},Xe=class extends Se{constructor(e,t,r=m.getConfig(),n=[],s="|"){super(e,void 0,r,n,s);k(this,Qe);f(this,"type","file");this.append(...ds("-{","}-","|",t).map(a=>new Mt(a,r,n)))}lint(e=this.getAbsoluteIndex()){var p;let t=super.lint(e),r=this.getAllArgs().filter(({childNodes:h})=>{let c=h.filter(T=>T.text().trim());return c.length!==1||c[0].type!=="arg"}),n=[...new Set(r.map(({name:h})=>h))].filter(h=>h!=="invalid"),s=n.filter(h=>qr.has(h)),a=n.filter(h=>jr.has(h)),o=n.filter(h=>Br.has(h));if(this.closest("ext-link-text")&&((p=this.getValue("link"))==null?void 0:p.trim())!==""&&t.push(w(this,{start:e},"internal link in an external link")),r.length===n.length&&s.length<2&&a.length<2&&o.length<2)return t;let l={start:e,...this.getRootNode().posFromIndex(e)},g=(h,c)=>T=>v(T,l,m.msg(`${h} image $1 parameter`,c));for(let h of n){let c=r.filter(({name:T})=>T===h);h==="caption"&&(c=[...c.slice(0,-1).filter(T=>T.text()),...c.slice(-1)]),c.length>1&&t.push(...c.map(g("duplicated",h)))}return s.length>1&&t.push(...r.filter(({name:h})=>qr.has(h)).map(g("conflicting","frame"))),a.length>1&&t.push(...r.filter(({name:h})=>jr.has(h)).map(g("conflicting","horizontal-alignment"))),o.length>1&&t.push(...r.filter(({name:h})=>Br.has(h)).map(g("conflicting","vertical-alignment"))),t}getAllArgs(){return this.childNodes.slice(1)}getArgs(e){return this.getAllArgs().filter(({name:t})=>e===t)}getFrameArgs(){return C(this,Qe,Wt).call(this,qr,"\u6846\u67B6")}getHorizAlignArgs(){return C(this,Qe,Wt).call(this,jr,"\u6C34\u5E73\u5BF9\u9F50")}getVertAlignArgs(){return C(this,Qe,Wt).call(this,Br,"\u5782\u76F4\u5BF9\u9F50")}getArg(e){let t=this.getArgs(e);return t[t.length-1]}getValue(e){var t;return(t=this.getArg(e))==null?void 0:t.getValue()}};Qe=new WeakSet,Wt=function(e,t){return this.getAllArgs().filter(({name:n})=>e.has(n))}});var Ut,Hn,Ke,_r=b(()=>{"use strict";R();de();A();F();Or();Ke=class extends Xe{constructor(e,t,r,n=m.getConfig(),s=[]){let a;if(r!==void 0){a=new x(r,n,s),a.type="plain";for(let o=1;o<11;o++)a.parseOnce();s.splice(s.indexOf(a),1)}super(t,a==null?void 0:a.toString(),n,s);k(this,Ut);this.setAttribute("bracket",!1),this.type=`${e}-image`}getTitle(){let e=this.type==="imagemap-image";return this.normalizeTitle(String(this.firstChild),e?0:6,!0,!e)}getAttribute(e){return e==="padding"?0:super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{ns:r,interwiki:n}=this.getAttribute("title");return(n||r!==6)&&t.push(w(this,{start:e},"invalid gallery image")),t}afterBuild(){C(this,Ut,Hn).call(this,this.getTitle())}};Ut=new WeakSet,Hn=function(e){this.setAttribute("title",e)}});var Zn={};W(Zn,{GalleryToken:()=>Mr});var Dt,Vn,Mr,Qn=b(()=>{"use strict";A();F();_r();Le();Mr=class extends x{constructor(e,t=m.getConfig(),r=[]){var n;super(void 0,t,r,{});k(this,Dt);f(this,"type","ext-inner");for(let s of(n=e==null?void 0:e.split(`
|
|
12
12
|
`))!=null?n:[]){let a=/^([^|]+)(?:\|(.*))?/u.exec(s);if(!a){super.insertAt(s.trim()?new V(s,t):s);continue}let[,o,l]=a;C(this,Dt,Vn).call(this,o)?super.insertAt(new Ke("gallery",o,l,t,r)):super.insertAt(new V(s,t))}}toString(){return super.toString(`
|
|
13
13
|
`)}text(){return super.text(`
|
|
14
14
|
`).replace(/\n\s*\n/gu,`
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
`)}text(){return super.text(`
|
|
20
20
|
`).replace(/\n{2,}/gu,`
|
|
21
21
|
`)}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),r={start:e,...this.getRootNode().posFromIndex(e)};return this.image?t.push(...this.childNodes.filter(n=>{let s=String(n).trim();return n.type==="noinclude"&&s&&!s.startsWith("#")}).map(n=>v(n,r,"invalid link in <imagemap>"))):t.push(w(this,r,"<imagemap> without an image")),t}print(){return super.print({sep:`
|
|
22
|
-
`})}}});var Yn,Ze,Gr=b(()=>{"use strict";R();A();F();wr();Et();Yn=(d,i)=>{let e=new Set(d);return e.delete(i),[...e]},Ze=class extends ze{constructor(e,t,r,n,s=m.getConfig(),a=[]){var h;let o=e.toLowerCase(),l=new ve(!t||t.trimStart()!==t?t:` ${t}`,"ext-attrs",o,s,a),g={...s,ext:Yn(s.ext,o),excludes:[...(h=s.excludes)!=null?h:[]]},p;switch(g.inExt=!0,o){case"tab":g.ext=Yn(g.ext,"tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":o==="poem"&&g.excludes.push("heading"),p=new x(r,g,a);break;case"pre":{let{PreToken:c}=(In(),G(Ln));p=new c(r,g,a);break}case"dynamicpagelist":{let{ParamTagToken:c}=(Nr(),G(Pn));p=new c(r,g,a);break}case"inputbox":{g.excludes.push("heading");let{InputboxToken:c}=(zn(),G(Mn));p=new c(r,g,a);break}case"references":{let{NestedToken:c}=(Ot(),G(Bt));p=new c(r,/<!--.*?(?:-->|$)|<(ref)(\s[^>]*)?>(.*?)<\/(ref\s*)>/gisu,["ref"],g,a);break}case"choose":{let{NestedToken:c}=(Ot(),G(Bt));p=new c(r,/<(option|choicetemplate)(\s[^>]*)?>(.*?)<\/(\1)>/gsu,["option","choicetemplate"],g,a);break}case"combobox":{let{NestedToken:c}=(Ot(),G(Bt));p=new c(r,/<(combooption)(\s[^>]*)?>(.*?)<\/(combooption\s*)>/gisu,["combooption"],g,a);break}case"gallery":{let{GalleryToken:c}=(Qn(),G(Zn));p=new c(r,g,a);break}case"imagemap":{let{ImagemapToken:c}=(Jn(),G(Kn));p=new c(r,g,a);break}default:{let{NowikiToken:c}=(Sr(),G(vr));p=new c(r,g)}}p.setAttribute("name",o),p.type="ext-inner";super(e,l,p,n,s,a);f(this,"type","ext");this.seal("closed",!0)}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),r;return this.name!=="nowiki"&&this.closest("html-attrs, table-attrs")&&(r={start:e,...this.getRootNode().posFromIndex(e)},t.push(w(this,r,"extension tag in HTML tag attributes"))),this.name==="ref"&&this.closest("heading-title")&&(r!=null||(r={start:e,...this.getRootNode().posFromIndex(e)}),t.push(w(this,r,"variable anchor in a section header"))),t}}});var ei={};W(ei,{parseCommentAndExt:()=>ps});var ps,ti=b(()=>{"use strict";A();kn();Le();yn();Gr();Pr();ps=(d,i=m.getConfig(),e=[],t=!1)=>{let r="<onlyinclude>",n="</onlyinclude>",{length:s}=r,a=()=>{let h=d.indexOf(r);return{i:h,j:d.indexOf(n,h+s)}};if(t){let{i:h,j:c}=a();if(h!==-1&&c!==-1){let T="",y=$=>{new V($,i,e),T+=`\0${e.length-1}c\x7F`};for(;h!==-1&&c!==-1;){let $=`\0${e.length}e\x7F`;new wt(d.slice(h+s,c),i,e),h>0&&y(d.slice(0,h)),T+=$,d=d.slice(c+s+1),{i:h,j:c}=a()}return d&&y(d),T}}let o=i.ext.join("|"),l=t?"includeonly":"(?:no|only)include",g=t?"noinclude":"includeonly",p=new RegExp(`<!--.*?(?:-->|$)|<${l}(?:\\s[^>]*)?>|</${l}\\s*>|<(${o})(\\s[^>]*?)?(?:/>|>(.*?)</(\\1\\s*)>)|<(${g})(\\s[^>]*?)?(?:/>|>(.*?)(?:</(${g}\\s*)>|$))`,"gisu");return d.replace(p,(h,c,T,y,$,B,L,N,I)=>{let O=`\0${e.length}${c?"e":"c"}\x7F`;if(c)new Ze(c,T,y,$,i,e);else if(h.startsWith("<!--")){let P=h.endsWith("-->");new Ve(h.slice(4,P?-3:void 0),P,i,e)}else B?new $t(B,L,N,I,i,e):new V(h,i,e);return O})}});var gs,us,hs,tt,ae,we,Ht,ri=b(()=>{"use strict";R();H();A();F();gs=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),us=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"]),hs=new Set(["strike","big","center","font","tt"]),Ht=class extends x{constructor(e,t,r,n,s=m.getConfig(),a=[]){super(void 0,s,a);f(this,"type","html");k(this,tt,void 0);k(this,ae,void 0);k(this,we,void 0);this.insertAt(t),this.setAttribute("name",e.toLowerCase()),S(this,tt,r),S(this,ae,n),S(this,we,e)}get closing(){return u(this,tt)}toString(){return`<${this.closing?"/":""}${u(this,we)}${super.toString()}${u(this,ae)?"/":""}>`}text(){let{closing:e
|
|
23
|
-
|}`,t=!1){let r=this.getAttribute("config"),n=this.getAttribute("accum"),s=t?[e]:m.parse(e,this.getAttribute("include"),2,r).childNodes,a=Ne.run(()=>super.insertAt(new
|
|
22
|
+
`})}}});var Yn,Ze,Gr=b(()=>{"use strict";R();A();F();wr();Et();Yn=(d,i)=>{let e=new Set(d);return e.delete(i),[...e]},Ze=class extends ze{constructor(e,t,r,n,s=m.getConfig(),a=[]){var h;let o=e.toLowerCase(),l=new ve(!t||t.trimStart()!==t?t:` ${t}`,"ext-attrs",o,s,a),g={...s,ext:Yn(s.ext,o),excludes:[...(h=s.excludes)!=null?h:[]]},p;switch(g.inExt=!0,o){case"tab":g.ext=Yn(g.ext,"tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":o==="poem"&&g.excludes.push("heading"),p=new x(r,g,a);break;case"pre":{let{PreToken:c}=(In(),G(Ln));p=new c(r,g,a);break}case"dynamicpagelist":{let{ParamTagToken:c}=(Nr(),G(Pn));p=new c(r,g,a);break}case"inputbox":{g.excludes.push("heading");let{InputboxToken:c}=(zn(),G(Mn));p=new c(r,g,a);break}case"references":{let{NestedToken:c}=(Ot(),G(Bt));p=new c(r,/<!--.*?(?:-->|$)|<(ref)(\s[^>]*)?>(.*?)<\/(ref\s*)>/gisu,["ref"],g,a);break}case"choose":{let{NestedToken:c}=(Ot(),G(Bt));p=new c(r,/<(option|choicetemplate)(\s[^>]*)?>(.*?)<\/(\1)>/gsu,["option","choicetemplate"],g,a);break}case"combobox":{let{NestedToken:c}=(Ot(),G(Bt));p=new c(r,/<(combooption)(\s[^>]*)?>(.*?)<\/(combooption\s*)>/gisu,["combooption"],g,a);break}case"gallery":{let{GalleryToken:c}=(Qn(),G(Zn));p=new c(r,g,a);break}case"imagemap":{let{ImagemapToken:c}=(Jn(),G(Kn));p=new c(r,g,a);break}default:{let{NowikiToken:c}=(Sr(),G(vr));p=new c(r,g)}}p.setAttribute("name",o),p.type="ext-inner";super(e,l,p,n,s,a);f(this,"type","ext");this.seal("closed",!0)}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),r;return this.name!=="nowiki"&&this.closest("html-attrs, table-attrs")&&(r={start:e,...this.getRootNode().posFromIndex(e)},t.push(w(this,r,"extension tag in HTML tag attributes"))),this.name==="ref"&&this.closest("heading-title")&&(r!=null||(r={start:e,...this.getRootNode().posFromIndex(e)}),t.push(w(this,r,"variable anchor in a section header"))),t}}});var ei={};W(ei,{parseCommentAndExt:()=>ps});var ps,ti=b(()=>{"use strict";A();kn();Le();yn();Gr();Pr();ps=(d,i=m.getConfig(),e=[],t=!1)=>{let r="<onlyinclude>",n="</onlyinclude>",{length:s}=r,a=()=>{let h=d.indexOf(r);return{i:h,j:d.indexOf(n,h+s)}};if(t){let{i:h,j:c}=a();if(h!==-1&&c!==-1){let T="",y=$=>{new V($,i,e),T+=`\0${e.length-1}c\x7F`};for(;h!==-1&&c!==-1;){let $=`\0${e.length}e\x7F`;new wt(d.slice(h+s,c),i,e),h>0&&y(d.slice(0,h)),T+=$,d=d.slice(c+s+1),{i:h,j:c}=a()}return d&&y(d),T}}let o=i.ext.join("|"),l=t?"includeonly":"(?:no|only)include",g=t?"noinclude":"includeonly",p=new RegExp(`<!--.*?(?:-->|$)|<${l}(?:\\s[^>]*)?>|</${l}\\s*>|<(${o})(\\s[^>]*?)?(?:/>|>(.*?)</(\\1\\s*)>)|<(${g})(\\s[^>]*?)?(?:/>|>(.*?)(?:</(${g}\\s*)>|$))`,"gisu");return d.replace(p,(h,c,T,y,$,B,L,N,I)=>{let O=`\0${e.length}${c?"e":"c"}\x7F`;if(c)new Ze(c,T,y,$,i,e);else if(h.startsWith("<!--")){let P=h.endsWith("-->");new Ve(h.slice(4,P?-3:void 0),P,i,e)}else B?new $t(B,L,N,I,i,e):new V(h,i,e);return O})}});var gs,us,hs,tt,ae,we,Ht,ri=b(()=>{"use strict";R();H();A();F();gs=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),us=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"]),hs=new Set(["strike","big","center","font","tt"]),Ht=class extends x{constructor(e,t,r,n,s=m.getConfig(),a=[]){super(void 0,s,a);f(this,"type","html");k(this,tt,void 0);k(this,ae,void 0);k(this,we,void 0);this.insertAt(t),this.setAttribute("name",e.toLowerCase()),S(this,tt,r),S(this,ae,n),S(this,we,e)}get closing(){return u(this,tt)}toString(){return`<${this.closing?"/":""}${u(this,we)}${super.toString()}${u(this,ae)?"/":""}>`}text(){let{closing:e}=this,t=`${u(this,we)}${e?"":super.text()}`;return`<${e?"/":""}${t}${u(this,ae)?"/":""}>`}getAttribute(e){return e==="padding"?u(this,we).length+(this.closing?2:1):super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){var n;let t=super.lint(e),r;this.name==="h1"&&!this.closing&&(r=w(this,{start:e},"<h1>"),t.push(r)),this.closest("table-attrs")&&(r!=null||(r=w(this,{start:e},"")),t.push({...r,message:m.msg("HTML tag in table attributes")}));try{this.findMatchingTag()}catch(s){if(s instanceof SyntaxError){let{message:a}=s;r!=null||(r=w(this,{start:e},""));let[o]=a.split(":"),l={...r,message:m.msg(o)};if(o==="unclosed tag"&&!this.closest("heading-title"))if(us.has(this.name)){let g=(n=this.parentNode)==null?void 0:n.childNodes,p=g==null?void 0:g.indexOf(this);g!=null&&g.slice(0,p).some(({type:h,name:c})=>h==="html"&&c===this.name)||(l.severity="warning")}else l.severity="warning";else if(o==="unmatched closing tag"){let g=this.closest("magic-word");g&&gs.has(g.name)&&(l.severity="warning")}t.push(l)}}return hs.has(this.name)&&(r!=null||(r=w(this,{start:e},"")),t.push({...r,message:m.msg("obsolete HTML tag"),severity:"warning"})),(this.name==="b"||this.name==="strong")&&this.closest("heading-title")&&(r!=null||(r=w(this,{start:e},"")),t.push({...r,message:m.msg("bold in section header"),severity:"warning"})),t}findMatchingTag(){let{html:e}=this.getAttribute("config"),{name:t,parentNode:r,closing:n}=this,s=gn(String(this));if(n&&(u(this,ae)||e[2].includes(t)))throw new SyntaxError(`tag that is both closing and self-closing: ${s}`);if(e[2].includes(t)||u(this,ae)&&e[1].includes(t))return this;if(u(this,ae)&&e[0].includes(t))throw new SyntaxError(`invalid self-closing tag: ${s}`);if(!r)return;let{childNodes:a}=r,o=a.indexOf(this),l=(n?a.slice(0,o).reverse():a.slice(o+1)).filter(p=>p.type==="html"&&p.name===t),g=n?-1:1;for(let p of l)if(u(p,tt)?g--:g++,g===0)return p;throw new SyntaxError(`${n?"unmatched closing":"unclosed"} tag: ${s}`)}print(){return super.print({pre:`<${this.closing?"/":""}${u(this,we)}`,post:`${u(this,ae)?"/":""}>`})}json(){let e=super.json();return Object.assign(e,{closing:this.closing,selfClosing:u(this,ae)}),e}};tt=new WeakMap,ae=new WeakMap,we=new WeakMap});var ni={};W(ni,{parseHtml:()=>ms});var ms,ii=b(()=>{"use strict";A();Et();ri();ms=(d,i=m.getConfig(),e=[])=>{let t=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,r=new Set(i.html.flat()),n=d.split("<"),s=n.shift();for(let a of n){let o=t.exec(a),l=o==null?void 0:o[2],g=l==null?void 0:l.toLowerCase();if(!o||!r.has(g)){s+=`<${a}`;continue}let[,p,,h="",c,T]=o,y=new ve(h,"html-attrs",g,i,e),$=y.getAttr("itemprop");if(g==="meta"&&($===void 0||y.getAttr("content")===void 0)||g==="link"&&($===void 0||y.getAttr("href")===void 0)){s+=`<${a}`,e.pop();continue}s+=`\0${e.length}x\x7F${T}`,new Ht(l,y,p==="/",c==="/>",i,e)}return s}});var rt,Hr=b(()=>{"use strict";A();F();mt();Et();rt=class extends x{constructor(i,e,t,r=m.getConfig(),n=[],s={}){super(void 0,r,n,s),this.append(new ue(e,i,"table-syntax",r,n,{}),new ve(t,"table-attrs",this.type,r,n))}}});var nt,Vr=b(()=>{"use strict";R();Ee();Hr();nt=class extends rt{lint(i=this.getAbsoluteIndex()){let e=super.lint(i),t=this.childNodes.find(({type:l})=>l==="table-inter");if(!t)return e;let r=t.childNodes.find(l=>l.text().trim()),n=/^\s*(?:!|\{\{\s*![!-]?\s*\}\})/u,s=Fe("arg"),a=Fe("magic-word");if(!r||n.test(String(r))||s(r)&&n.test(r.default||""))return e;if(a(r))try{if(r.getPossibleValues().every(l=>n.test(l.text())))return e}catch(l){}let o=v(t,{start:i},"content to be moved out from the table");return e.push({...o,severity:r.type==="template"?"warning":"error",startIndex:o.startIndex+1,startLine:o.startLine+1,startCol:0}),e}}});var cs,Vt,si=b(()=>{"use strict";R();Ee();A();Vr();mt();cs=/^\n[^\S\n]*(?:\|\}|\{\{\s*!\s*\}\}\}|\{\{\s*!\)\s*\}\})$/u,Vt=class extends nt{constructor(e,t,r=m.getConfig(),n=[]){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,t,r,n,{});f(this,"type","table")}get closed(){return this.lastChild.type==="table-syntax"}lint(e=this.getAbsoluteIndex()){let t=super.lint(e);return this.closed||t.push(v(this.firstChild,{start:e},m.msg("unclosed $1","table"))),t}close(e=`
|
|
23
|
+
|}`,t=!1){let r=this.getAttribute("config"),n=this.getAttribute("accum"),s=t?[e]:m.parse(e,this.getAttribute("include"),2,r).childNodes,a=Ne.run(()=>super.insertAt(new ue(void 0,cs,"table-syntax",r,n,{})));t||a.afterBuild(),this.lastChild.replaceChildren(...s)}json(){let e=super.json();return e.closed=this.closed,e}}});var Zt,oi=b(()=>{"use strict";A();Vr();Zt=class extends nt{constructor(e,t,r=m.getConfig(),n=[]){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,e,t,r,n,{});f(this,"type","tr")}}});var re,Xt,ai,Qt,li=b(()=>{"use strict";R();de();A();F();Hr();Qt=class extends rt{constructor(e,t,r=m.getConfig(),n=[]){var l;let s=/\||\0\d+!\x7F/u.exec(t!=null?t:""),a=s?t.slice(0,s.index):"";/\[\[|-\{/u.test(a)&&(s=null,a="");super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,a,r,n);k(this,Xt);f(this,"type","td");k(this,re,"");s&&([kt(this,re)._]=s);let o=new x(t==null?void 0:t.slice(((l=s==null?void 0:s.index)!=null?l:NaN)+u(this,re).length),r,n);o.type="td-inner",o.setAttribute("stage",4),this.insertAt(o)}get subtype(){return C(this,Xt,ai).call(this).subtype}afterBuild(){u(this,re).includes("\0")&&S(this,re,this.buildFromStr(u(this,re),0))}toString(){let{childNodes:[e,t,r]}=this;return`${String(e)}${String(t)}${u(this,re)}${String(r)}`}text(){let{childNodes:[e,t,r]}=this;return`${e.text()}${t.text()}${u(this,re)}${r.text()}`}getGaps(e){return e===1?u(this,re).length:0}lint(e=this.getAbsoluteIndex()){let t=super.lint(e);e+=this.getRelativeIndex(this.length-1);for(let r of this.lastChild.childNodes)if(r.type==="text"){let{data:n}=r;n.includes("|")&&t.push(v(r,{start:e},'additional "|" in a table cell',n.includes("||")?"error":"warning"))}return t}print(){let{childNodes:[e,t,r]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${u(this,re)}${r.print()}</span>`}json(){let e=super.json();return e.subtype=this.subtype,e}};re=new WeakMap,Xt=new WeakSet,ai=function(){let e=this.firstChild.text(),t=e.slice(-1),r="td";return t==="!"?r="th":t==="+"&&(r="caption"),{subtype:r}}});var it,Zr=b(()=>{"use strict";ye();it=class extends Q{}});var st,Qr=b(()=>{"use strict";Zr();st=class extends it{constructor(){super(...arguments);f(this,"type","dd")}}});var di={};W(di,{parseTable:()=>Ts});var fs,Ts,pi=b(()=>{"use strict";A();F();si();oi();li();Qr();fs=d=>d.lastChild.constructor!==x,Ts=({firstChild:{data:d},type:i,name:e},t=m.getConfig(),r=[])=>{let n=[],s=d.split(`
|
|
24
24
|
`),a=i==="root"||i==="parameter-value"||i==="ext-inner"&&e==="poem"?"":`
|
|
25
25
|
${s.shift()}`,o,l=(p,h)=>{if(!h){a+=p;return}let{lastChild:c}=h;if(fs(h)){let T=new x(p,t,r);T.type="table-inter",T.setAttribute("stage",3),h.insertAt(T)}else c.setText(String(c)+p)},g=()=>o.type==="td"?n.pop():o;for(let p of s){o=n.pop();let[h]=/^(?:\s|\0\d+c\x7F)*/u.exec(p),c=p.slice(h.length),T=/^(:*)((?:\s|\0\d+c\x7F)*)(\{\||\{(?:\0\d+c\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(c);if(T){for(;o&&o.type!=="td";)o=n.pop();let[,I,O,P,_]=T;I&&new st(I,t,r),l(`
|
|
26
26
|
${h}${I&&`\0${r.length-1}d\x7F`}${O}\0${r.length}b\x7F`,o),n.push(...o?[o]:[],new Vt(P,_,t,r));continue}else if(!o){a+=`
|
|
@@ -28,8 +28,8 @@ ${p}`;continue}let y=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\
|
|
|
28
28
|
${p}`,o),n.push(o);continue}let[,$,B,L,N]=y;if($){for(;o.type!=="table";)o=n.pop();o.close(`
|
|
29
29
|
${h}${$}`,!0),l(N,n[n.length-1])}else if(B){o=g(),o.type==="tr"&&(o=n.pop());let I=new Zt(`
|
|
30
30
|
${h}${B}`,N,t,r);n.push(o,I),o.insertAt(I)}else{o=g();let I=L==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu,O=I.exec(N),P=0,_=`
|
|
31
|
-
${h}${L}`,
|
|
32
|
-
-\uFFFD]*)\\]`,"giu");return d.replace(t,(r,n,s,a)=>{let{length:o}=e,l=/&[lg]t;/u.exec(n);return l&&(n=n.slice(0,l.index),s="",a=`${n.slice(l.index)}${s}${a}`),new et(n,s,a,i,e),`\0${o}w\x7F`})}});var Ai={};W(Ai,{parseMagicLinks:()=>ys});var ys,vi=b(()=>{"use strict";H();A();Wr();ys=(d,i=m.getConfig(),e=[])=>{let t=new RegExp(`(^|[^\\p{L}\\d_])(?:${i.protocol})(${be}${ke})`,"giu");return d.replace(t,(r,n,s)=>{let a="",o=n?r.slice(1):r,l=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(o);l&&(a=o.slice(l.index),o=o.slice(0,l.index));let g=new RegExp(`[,;.:!?${o.includes("(")?"":")"}]+$`,"u"),p=g.exec(o);if(p){let h=0;p[0].startsWith(";")&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(o.slice(0,p.index))&&(h=1),a=`${o.slice(p.index+h)}${a}`,o=o.slice(0,p.index+h)}return a.length>=s.length?r:(new Ye(o,!1,i,e),`${n}\0${e.length-1}w\x7F${a}`)})}});var tr,Si=b(()=>{"use strict";Zr();tr=class extends it{constructor(){super(...arguments);f(this,"type","list")}}});var wi={};W(wi,{parseList:()=>As});var As,$i=b(()=>{"use strict";A();Si();Qr();As=(d,i=m.getConfig(),e=[])=>{let t=/^((?:\0\d+c\x7F)*)([;:*#]+)/u.exec(d);if(!t)return d;let[r,n,s]=t,a=`${n}\0${e.length}d\x7F${d.slice(r.length)}`,o=s.split(";").length-1;if(new tr(s,i,e),!o)return a;let l=/:+|-\{/gu,g=l.exec(a),p=0,h=(c,T)=>(new st(c,i,e),`${a.slice(0,T)}\0${e.length-1}d\x7F${a.slice(T+c.length)}`);for(;g&&o;){let{0:c,index:T}=g;if(c.startsWith(":")){if(c.length>=o)return h(c.slice(0,o),T);o-=c.length,l.lastIndex=T+4+String(e.length).length,a=h(c,T)}else if(c==="-{"){if(!p){let{lastIndex:y}=l;l=/-\{|\}-/gu,l.lastIndex=y}p++}else if(p--,!p){let{lastIndex:y}=l;l=/:+|-\{/gu,l.lastIndex=y}g=l.exec(a)}return a}});var vs,fe,rr,Ci=b(()=>{"use strict";R();A();F();me();vs=new Set(["A","T","R","D","-","H","N"]),rr=class extends x{constructor(e,t=m.getConfig(),r=[]){super(void 0,t,r,{});f(this,"type","converter-flags");k(this,fe,void 0);this.append(...e.map(n=>new q(n,"converter-flag",t,r)))}afterBuild(){S(this,fe,this.childNodes.map(e=>e.text().trim()))}toString(){return super.toString(";")}text(){return super.text(";")}getGaps(){return 1}getUnknownFlags(){return new Set(u(this,fe).filter(e=>/\{{3}[^{}]+\}{3}/u.test(e)))}getVariantFlags(){let e=new Set(this.getAttribute("config").variants);return new Set(u(this,fe).filter(t=>e.has(t)))}lint(e=this.getAbsoluteIndex()){let t=this.getVariantFlags(),r=this.getUnknownFlags(),n=new Set(u(this,fe).filter(h=>vs.has(h))),s=u(this,fe).filter(h=>!h).length,a=u(this,fe).length-r.size-s,o=super.lint(e);if(t.size===a||n.size===a)return o;let l={start:e,...this.getRootNode().posFromIndex(e)},{childNodes:g,length:p}=this;for(let h=0;h<p;h++){let c=g[h],T=c.text().trim();T&&!t.has(T)&&!r.has(T)&&(t.size>0||!n.has(T))&&o.push(v(c,l,"invalid conversion flag"))}return o}print(){return super.print({sep:";"})}};fe=new WeakMap});var ot,Ni=b(()=>{"use strict";A();F();me();ot=class extends x{constructor(e,t=!0,r=m.getConfig(),n=[]){super(void 0,r,n);f(this,"type","converter-rule");let s=e.indexOf(":"),a=e.slice(0,s).indexOf("=>"),o=a===-1?e.slice(0,s):e.slice(a+2,s);t&&r.variants.includes(o.trim())?(super.insertAt(new q(o,"converter-rule-variant",r,n)),super.insertAt(new q(e.slice(s+1),"converter-rule-to",r,n)),a!==-1&&super.insertAt(new q(e.slice(0,a),"converter-rule-from",r,n),0)):super.insertAt(new q(e,"converter-rule-to",r,n))}toString(){let{childNodes:e}=this;if(e.length===3){let[t,r,n]=e;return`${String(t)}=>${String(r)}:${String(n)}`}return super.toString(":")}text(){let{childNodes:e}=this;if(e.length===3){let[t,r,n]=e;return`${t.text()}=>${r.text()}:${n.text()}`}return super.text(":")}getGaps(e){return e===0&&this.length===3?2:1}print(){let{childNodes:e}=this;if(e.length===3){let[t,r,n]=e;return`<span class="wpb-converter-rule">${t.print()}=>${r.print()}:${n.print()}</span>`}return super.print({sep:":"})}}});var nr,Fi=b(()=>{"use strict";H();A();F();Ci();Ni();nr=class extends x{constructor(e,t,r=m.getConfig(),n=[]){super(void 0,r,n);f(this,"type","converter");this.append(new rr(e,r,n));let[s]=t,a=s.includes(":"),o=new ot(s,a,r,n);a&&o.length===1?this.insertAt(new ot(t.join(";"),!1,r,n)):this.append(o,...t.slice(1).map(l=>new ot(l,!0,r,n)))}toString(){let{childNodes:[e,...t]}=this;return`-{${String(e)}${e.length>0?"|":""}${t.map(String).join(";")}}-`}text(){let{childNodes:[e,...t]}=this;return`-{${e.text()}|${pe(t,";")}}-`}getAttribute(e){return e==="padding"?2:super.getAttribute(e)}getGaps(e){return e||this.firstChild.length>0?1:0}print(){let{childNodes:[e,...t]}=this;return`<span class="wpb-converter">-{${e.print()}${e.length>0?"|":""}${
|
|
31
|
+
${h}${L}`,J=U=>{let Te=new Qt(_,N.slice(P,O==null?void 0:O.index),t,r);return U.insertAt(Te),Te};for(;O;)J(o),{lastIndex:P}=I,[_]=O,O=I.exec(N);n.push(o,J(o))}}return a.slice(1)}});var Kt,gi=b(()=>{"use strict";ye();Kt=class extends Q{constructor(){super(...arguments);f(this,"type","hr")}}});var Jt,ui=b(()=>{"use strict";Me();A();ye();Jt=class extends ge(Q){constructor(e,t,r=m.getConfig(),n=[]){super(e,r,n);f(this,"type","double-underscore")}getAttribute(e){return e==="padding"?2:super.getAttribute(e)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}}});var hi={};W(hi,{parseHrAndDoubleUnderscore:()=>xs});var xs,mi=b(()=>{"use strict";A();gi();ui();Fr();xs=({firstChild:{data:d},type:i,name:e},t=m.getConfig(),r=[])=>{let{doubleUnderscore:n}=t,s=new Set(n[0]),a=new Set(n[1]);return i!=="root"&&(i!=="ext-inner"||e!=="poem")&&(d=`\0${d}`),d=d.replace(/^((?:\0\d+c\x7F)*)(-{4,})/gmu,(o,l,g)=>(new Kt(g,t,r),`${l}\0${r.length-1}r\x7F`)).replace(new RegExp(`__(${n.flat().join("|")})__`,"giu"),(o,l)=>{let g=a.has(l);return g||s.has(l.toLowerCase())?(new Jt(l,g,t,r),`\0${r.length-1}u\x7F`):o}).replace(/^((?:\0\d+c\x7F)*)(={1,6})(.+)\2((?:[^\S\n]|\0\d+c\x7F)*)$/gmu,(o,l,g,p,h)=>{let c=`${l}\0${r.length}h\x7F`;return new He(g.length,[p,h],t,r),c}),i==="root"||i==="ext-inner"&&e==="poem"?d:d.slice(1)}});var Yt,ci=b(()=>{"use strict";_t();Yt=class extends Se{constructor(){super(...arguments);f(this,"type","category")}}});var er,fi=b(()=>{"use strict";R();A();ye();er=class extends Q{constructor(){super(...arguments);f(this,"type","quote")}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}lint(e=this.getAbsoluteIndex()){let{previousSibling:t,nextSibling:r,bold:n}=this,s=m.msg('lonely "$1"',"'"),a=[],o;if((t==null?void 0:t.type)==="text"&&t.data.endsWith("'")){o=w(this,{start:e},s);let{startIndex:l,startLine:g,startCol:p}=o,[,{length:h}]=/(?:^|[^'])('+)$/u.exec(t.data),c=e-h;a.push({...o,startIndex:c,endIndex:l,startCol:p-h,endLine:g,endCol:p})}if((r==null?void 0:r.type)==="text"&&r.data.startsWith("'")){o!=null||(o=w(this,{start:e},s));let{endIndex:l,endLine:g,endCol:p}=o,[{length:h}]=/^'+/u.exec(r.data),c=l+h;a.push({...o,startIndex:l,endIndex:c,startLine:g,startCol:p,endCol:p+h})}return n&&this.closest("heading-title")&&(o!=null||(o=w(this,{start:e},s)),a.push({...o,message:m.msg("bold in section header"),severity:"warning"})),a}json(){let e=super.json();return Object.assign(e,{bold:this.bold,italic:this.italic}),e}}});var Xr={};W(Xr,{parseQuotes:()=>bs});var bs,Kr=b(()=>{"use strict";A();fi();bs=(d,i=m.getConfig(),e=[])=>{var g;let t=d.split(/('{2,})/u),{length:r}=t;if(r===1)return d;let n=0,s=0,a,o,l;for(let p=1;p<r;p+=2){let h=t[p].length;switch(h){case 2:s++;break;case 4:t[p-1]+="'",t[p]="'''";case 3:if(n++,a!==void 0)break;t[p-1].endsWith(" ")?o===void 0&&l===void 0&&(l=p):t[p-1].slice(-2,-1)===" "?a=p:o!=null||(o=p);break;default:t[p-1]+="'".repeat(h-5),t[p]="'''''",s++,n++}}if(s%2===1&&n%2===1){let p=(g=a!=null?a:o)!=null?g:l;p!==void 0&&(t[p]="''",t[p-1]+="'")}for(let p=1;p<r;p+=2)new er(t[p],i,e),t[p]=`\0${e.length-1}q\x7F`;return t.join("")}});var xi={};W(xi,{parseLinks:()=>Ti});var Ti,bi=b(()=>{"use strict";A();zr();Or();ci();Ti=(d,i=m.getConfig(),e=[])=>{let{parseQuotes:t}=(Kr(),G(Xr)),r=i.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)(.*?[^\]]))?\]\](.*)$/su:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)(.*?[^\]])?)?\]\](.*)$/su,n=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)(.*)$/su,s=new RegExp(`^\\s*(?:${i.protocol}|//)`,"iu"),a=d.split("[["),o=a.shift();for(let l=0;l<a.length;l++){let g=!1,p,h,c,T,y=a[l],$=r.exec(y);if($)[,p,h,c,T]=$,T.startsWith("]")&&(c!=null&&c.includes("["))&&(c+="]",T=T.slice(1));else{let _=n.exec(y);_&&(g=!0,[,p,h,c]=_)}if(p===void 0||s.test(p)||/\0\d+[exhbru]\x7F/u.test(p)){o+=`[[${y}`;continue}let B=p.trim().startsWith(":");if(B&&g){o+=`[[${y}`;continue}let L=m.normalizeTitle(p,0,!1,i,!0,!0,!0),{ns:N,valid:I,interwiki:O}=L;if(I){if(g){if(O||N!==6){o+=`[[${y}`;continue}let _=!1;for(l++;l<a.length;l++){let J=a[l],U=J.split("]]");if(U.length>2){_=!0,c+=`[[${U[0]}]]${U[1]}`,T=U.slice(2).join("]]");break}else if(U.length===2)c+=`[[${U[0]}]]${U[1]}`;else{c+=`[[${J}`;break}}if(c=Ti(c,i,e),!_){o+=`[[${p}${h}${c}`;continue}}}else{o+=`[[${y}`;continue}c&&(c=t(c,i,e)),o+=`\0${e.length}l\x7F${T}`;let P=Je;B||(!O&&N===6?P=Xe:!O&&N===14&&(P=Yt)),c===void 0&&h&&(c=""),new P(p,c,i,e,h)}return o}});var ki={};W(ki,{parseExternalLinks:()=>ks});var ks,yi=b(()=>{"use strict";H();A();Ur();ks=(d,i=m.getConfig(),e=[])=>{let t=new RegExp(`\\[((?:(?:${i.protocol}|//)${be}|\0\\d+m\x7F)${ke}(?=[[\\]<>"\\t\\p{Zs}]|\0\\d))(\\p{Zs}*(?=\\P{Zs}))([^\\]-\b
|
|
32
|
+
-\uFFFD]*)\\]`,"giu");return d.replace(t,(r,n,s,a)=>{let{length:o}=e,l=/&[lg]t;/u.exec(n);return l&&(n=n.slice(0,l.index),s="",a=`${n.slice(l.index)}${s}${a}`),new et(n,s,a,i,e),`\0${o}w\x7F`})}});var Ai={};W(Ai,{parseMagicLinks:()=>ys});var ys,vi=b(()=>{"use strict";H();A();Wr();ys=(d,i=m.getConfig(),e=[])=>{let t=new RegExp(`(^|[^\\p{L}\\d_])(?:${i.protocol})(${be}${ke})`,"giu");return d.replace(t,(r,n,s)=>{let a="",o=n?r.slice(1):r,l=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(o);l&&(a=o.slice(l.index),o=o.slice(0,l.index));let g=new RegExp(`[,;.:!?${o.includes("(")?"":")"}]+$`,"u"),p=g.exec(o);if(p){let h=0;p[0].startsWith(";")&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(o.slice(0,p.index))&&(h=1),a=`${o.slice(p.index+h)}${a}`,o=o.slice(0,p.index+h)}return a.length>=s.length?r:(new Ye(o,!1,i,e),`${n}\0${e.length-1}w\x7F${a}`)})}});var tr,Si=b(()=>{"use strict";Zr();tr=class extends it{constructor(){super(...arguments);f(this,"type","list")}}});var wi={};W(wi,{parseList:()=>As});var As,$i=b(()=>{"use strict";A();Si();Qr();As=(d,i=m.getConfig(),e=[])=>{let t=/^((?:\0\d+c\x7F)*)([;:*#]+)/u.exec(d);if(!t)return d;let[r,n,s]=t,a=`${n}\0${e.length}d\x7F${d.slice(r.length)}`,o=s.split(";").length-1;if(new tr(s,i,e),!o)return a;let l=/:+|-\{/gu,g=l.exec(a),p=0,h=(c,T)=>(new st(c,i,e),`${a.slice(0,T)}\0${e.length-1}d\x7F${a.slice(T+c.length)}`);for(;g&&o;){let{0:c,index:T}=g;if(c.startsWith(":")){if(c.length>=o)return h(c.slice(0,o),T);o-=c.length,l.lastIndex=T+4+String(e.length).length,a=h(c,T)}else if(c==="-{"){if(!p){let{lastIndex:y}=l;l=/-\{|\}-/gu,l.lastIndex=y}p++}else if(p--,!p){let{lastIndex:y}=l;l=/:+|-\{/gu,l.lastIndex=y}g=l.exec(a)}return a}});var vs,fe,rr,Ci=b(()=>{"use strict";R();A();F();me();vs=new Set(["A","T","R","D","-","H","N"]),rr=class extends x{constructor(e,t=m.getConfig(),r=[]){super(void 0,t,r,{});f(this,"type","converter-flags");k(this,fe,void 0);this.append(...e.map(n=>new q(n,"converter-flag",t,r)))}afterBuild(){S(this,fe,this.childNodes.map(e=>e.text().trim()))}toString(){return super.toString(";")}text(){return super.text(";")}getGaps(){return 1}getUnknownFlags(){return new Set(u(this,fe).filter(e=>/\{{3}[^{}]+\}{3}/u.test(e)))}getVariantFlags(){let e=new Set(this.getAttribute("config").variants);return new Set(u(this,fe).filter(t=>e.has(t)))}lint(e=this.getAbsoluteIndex()){let t=this.getVariantFlags(),r=this.getUnknownFlags(),n=new Set(u(this,fe).filter(h=>vs.has(h))),s=u(this,fe).filter(h=>!h).length,a=u(this,fe).length-r.size-s,o=super.lint(e);if(t.size===a||n.size===a)return o;let l={start:e,...this.getRootNode().posFromIndex(e)},{childNodes:g,length:p}=this;for(let h=0;h<p;h++){let c=g[h],T=c.text().trim();T&&!t.has(T)&&!r.has(T)&&(t.size>0||!n.has(T))&&o.push(v(c,l,"invalid conversion flag"))}return o}print(){return super.print({sep:";"})}};fe=new WeakMap});var ot,Ni=b(()=>{"use strict";A();F();me();ot=class extends x{constructor(e,t=!0,r=m.getConfig(),n=[]){super(void 0,r,n);f(this,"type","converter-rule");let s=e.indexOf(":"),a=e.slice(0,s).indexOf("=>"),o=a===-1?e.slice(0,s):e.slice(a+2,s);t&&r.variants.includes(o.trim())?(super.insertAt(new q(o,"converter-rule-variant",r,n)),super.insertAt(new q(e.slice(s+1),"converter-rule-to",r,n)),a!==-1&&super.insertAt(new q(e.slice(0,a),"converter-rule-from",r,n),0)):super.insertAt(new q(e,"converter-rule-to",r,n))}toString(){let{childNodes:e}=this;if(e.length===3){let[t,r,n]=e;return`${String(t)}=>${String(r)}:${String(n)}`}return super.toString(":")}text(){let{childNodes:e}=this;if(e.length===3){let[t,r,n]=e;return`${t.text()}=>${r.text()}:${n.text()}`}return super.text(":")}getGaps(e){return e===0&&this.length===3?2:1}print(){let{childNodes:e}=this;if(e.length===3){let[t,r,n]=e;return`<span class="wpb-converter-rule">${t.print()}=>${r.print()}:${n.print()}</span>`}return super.print({sep:":"})}}});var nr,Fi=b(()=>{"use strict";H();A();F();Ci();Ni();nr=class extends x{constructor(e,t,r=m.getConfig(),n=[]){super(void 0,r,n);f(this,"type","converter");this.append(new rr(e,r,n));let[s]=t,a=s.includes(":"),o=new ot(s,a,r,n);a&&o.length===1?this.insertAt(new ot(t.join(";"),!1,r,n)):this.append(o,...t.slice(1).map(l=>new ot(l,!0,r,n)))}toString(){let{childNodes:[e,...t]}=this;return`-{${String(e)}${e.length>0?"|":""}${t.map(String).join(";")}}-`}text(){let{childNodes:[e,...t]}=this;return`-{${e.text()}|${pe(t,";")}}-`}getAttribute(e){return e==="padding"?2:super.getAttribute(e)}getGaps(e){return e||this.firstChild.length>0?1:0}print(){let{childNodes:[e,...t]}=this;return`<span class="wpb-converter">-{${e.print()}${e.length>0?"|":""}${he(t,{sep:";"})}}-</span>`}}});var Ei={};W(Ei,{parseConverter:()=>Ss});var Ss,Li=b(()=>{"use strict";A();Fi();Ss=(d,i=m.getConfig(),e=[])=>{let t=/-\{/gu,r=/-\{|\}-/gu,n=[],s=t,a=s.exec(d);for(;a;){let{0:o,index:l}=a;if(o==="}-"){let g=n.pop(),{length:p}=e,h=d.slice(g.index+2,l),c=h.indexOf("|"),[T,y]=c===-1?[[],h]:[h.slice(0,c).split(";"),h.slice(c+1)],$=y.replace(/(&[#a-z\d]+);/giu,"$1"),B=`(?:${i.variants.join("|")})`,L=$.split(new RegExp(`;(?=(?:[^;]*?=>)?\\s*${B}\\s*:|(?:\\s|\0\\d+c\x7F)*$)`,"u")).map(N=>N.replace(/\x01/gu,";"));new nr(T,L,i,e),d=`${d.slice(0,g.index)}\0${p}v\x7F${d.slice(l+2)}`,n.length===0&&(s=t),s.lastIndex=g.index+3+String(p).length}else n.push(a),s=r,s.lastIndex=l+2;a=s.exec(d)}return d}});var Yr={};W(Yr,{Token:()=>x});var ne,j,M,qe,Tt,Jr,ir,Ii,sr,Pi,or,Ri,ar,Gi,lr,qi,dr,ji,pr,Bi,gr,Oi,ur,_i,hr,Mi,mr,zi,en,x,F=b(()=>{"use strict";H();de();A();cn();bn();en=class en extends At{constructor(e,t=m.getConfig(),r=[],n){super();k(this,Tt);k(this,ir);k(this,sr);k(this,or);k(this,ar);k(this,lr);k(this,dr);k(this,pr);k(this,gr);k(this,ur);k(this,hr);k(this,mr);f(this,"type","root");k(this,ne,0);k(this,j,void 0);k(this,M,void 0);k(this,qe,void 0);typeof e=="string"&&this.insertAt(e),S(this,j,t),S(this,M,r),r.push(this)}parseOnce(e=u(this,ne),t=!1){if(e<u(this,ne)||!this.getAttribute("plain")||this.length===0)return this;if(u(this,ne)>=11)return this;switch(e){case 0:this.type==="root"&&u(this,M).shift(),S(this,qe,t),C(this,ir,Ii).call(this,t);break;case 1:C(this,sr,Pi).call(this);break;case 2:C(this,or,Ri).call(this);break;case 3:C(this,ar,Gi).call(this);break;case 4:C(this,lr,qi).call(this);break;case 5:C(this,dr,ji).call(this);break;case 6:C(this,pr,Bi).call(this);break;case 7:C(this,gr,Oi).call(this);break;case 8:C(this,ur,_i).call(this);break;case 9:C(this,hr,Mi).call(this);break;case 10:C(this,mr,zi).call(this)}if(this.type==="root")for(let r of u(this,M))r.parseOnce(e,t);return kt(this,ne)._++,this}buildFromStr(e,t){let r=e.split(/[\0\x7F]/u).map((n,s)=>{if(s%2===0)return new gt(n);if(Number.isNaN(Number(n.slice(-1))))return u(this,M)[Number(n.slice(0,-1))];throw new Error(`\u89E3\u6790\u9519\u8BEF\uFF01\u672A\u6B63\u786E\u6807\u8BB0\u7684 Token\uFF1A${n}`)});return t===0?r.map(String).join(""):t===1?pe(r):r}afterBuild(){if(this.type==="root")for(let e of u(this,M))e.afterBuild()}parse(e=11,t=!1){for(e=Math.min(e,11);u(this,ne)<e;)this.parseOnce(u(this,ne),t);return e&&(C(this,Tt,Jr).call(this),this.afterBuild()),this}getAttribute(e){switch(e){case"plain":return this.constructor===en;case"config":return JSON.parse(JSON.stringify(u(this,j)));case"include":{if(u(this,qe)!==void 0)return u(this,qe);let t=this.getRootNode();return t!==this&&t.getAttribute("include")}case"accum":return u(this,M);default:return super.getAttribute(e)}}setAttribute(e,t){switch(e){case"stage":u(this,ne)===0&&this.type==="root"&&u(this,M).shift(),S(this,ne,t);break;default:super.setAttribute(e,t)}}insertAt(e,t=this.length){let r=typeof e=="string"?new gt(e):e;return super.insertAt(r,t),r.type==="root"&&(r.type="plain"),r}normalizeTitle(e,t=0,r=!1,n=!1,s=!1){return m.normalizeTitle(e,t,u(this,qe),u(this,j),r,n,s)}};ne=new WeakMap,j=new WeakMap,M=new WeakMap,qe=new WeakMap,Tt=new WeakSet,Jr=function(){var n;S(this,ne,11);let{length:e,firstChild:t}=this,r=String(t);if(e===1&&t.type==="text"&&r.includes("\0")&&(this.replaceChildren(...this.buildFromStr(r)),this.normalize(),this.type==="root"))for(let s of u(this,M))C(n=s,Tt,Jr).call(n)},ir=new WeakSet,Ii=function(e){let{parseCommentAndExt:t}=(ti(),G(ei));this.setText(t(String(this.firstChild),u(this,j),u(this,M),e))},sr=new WeakSet,Pi=function(){let{parseBraces:e}=(Lr(),G(_n)),t=this.type==="root"?String(this.firstChild):`\0${String(this.firstChild)}`,r=e(t,u(this,j),u(this,M));this.setText(this.type==="root"?r:r.slice(1))},or=new WeakSet,Ri=function(){var t;if((t=u(this,j).excludes)!=null&&t.includes("html"))return;let{parseHtml:e}=(ii(),G(ni));this.setText(e(String(this.firstChild),u(this,j),u(this,M)))},ar=new WeakSet,Gi=function(){var t;if((t=u(this,j).excludes)!=null&&t.includes("table"))return;let{parseTable:e}=(pi(),G(di));this.setText(e(this,u(this,j),u(this,M)))},lr=new WeakSet,qi=function(){var t;if((t=u(this,j).excludes)!=null&&t.includes("hr"))return;let{parseHrAndDoubleUnderscore:e}=(mi(),G(hi));this.setText(e(this,u(this,j),u(this,M)))},dr=new WeakSet,ji=function(){let{parseLinks:e}=(bi(),G(xi));this.setText(e(String(this.firstChild),u(this,j),u(this,M)))},pr=new WeakSet,Bi=function(){var r;if((r=u(this,j).excludes)!=null&&r.includes("quote"))return;let{parseQuotes:e}=(Kr(),G(Xr)),t=String(this.firstChild).split(`
|
|
33
33
|
`);for(let n=0;n<t.length;n++)t[n]=e(t[n],u(this,j),u(this,M));this.setText(t.join(`
|
|
34
34
|
`))},gr=new WeakSet,Oi=function(){var t;if((t=u(this,j).excludes)!=null&&t.includes("extLink"))return;let{parseExternalLinks:e}=(yi(),G(ki));this.setText(e(String(this.firstChild),u(this,j),u(this,M)))},ur=new WeakSet,_i=function(){var t;if((t=u(this,j).excludes)!=null&&t.includes("magicLink"))return;let{parseMagicLinks:e}=(vi(),G(Ai));this.setText(e(String(this.firstChild),u(this,j),u(this,M)))},hr=new WeakSet,Mi=function(){var n;if((n=u(this,j).excludes)!=null&&n.includes("list"))return;let{parseList:e}=($i(),G(wi)),t=String(this.firstChild).split(`
|
|
35
35
|
`),r=this.type==="root"||this.type==="ext-inner"&&this.name==="poem"?0:1;for(;r<t.length;r++)t[r]=e(t[r],u(this,j),u(this,M));this.setText(t.join(`
|
package/extensions/dist/base.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
const workerJS = () => {
|
|
3
|
-
importScripts('https://testingcf.jsdelivr.net/npm/wikiparser-node@1.4.
|
|
3
|
+
importScripts('https://testingcf.jsdelivr.net/npm/wikiparser-node@1.4.4-b/bundle/bundle.min.js');
|
|
4
4
|
const entities = { '&': 'amp', '<': 'lt', '>': 'gt' };
|
|
5
5
|
self.onmessage = ({ data }) => {
|
|
6
6
|
const [command, qid, wikitext, include, stage] = data;
|
|
@@ -15,7 +15,7 @@ const workerJS = () => {
|
|
|
15
15
|
postMessage([qid, Parser.getConfig()]);
|
|
16
16
|
break;
|
|
17
17
|
case 'json':
|
|
18
|
-
postMessage([qid,
|
|
18
|
+
postMessage([qid, Parser.parse(wikitext, include).json()]);
|
|
19
19
|
break;
|
|
20
20
|
case 'lint':
|
|
21
21
|
postMessage([qid, Parser.parse(wikitext, include).lint(), wikitext]);
|
|
@@ -56,7 +56,7 @@ const getFeedback = (command, qid, strict, raw, ...args) => new Promise(resolve
|
|
|
56
56
|
worker.postMessage([command, qid, raw, ...args]);
|
|
57
57
|
});
|
|
58
58
|
const getConfig = () => getFeedback('getConfig', -3);
|
|
59
|
-
const json =
|
|
59
|
+
const json = (wikitext, include, qid) => getFeedback('json', qid, false, wikitext, include);
|
|
60
60
|
const print = (wikitext, include, stage, qid = -1) => getFeedback('print', qid, false, wikitext, include, stage);
|
|
61
61
|
const lint = (wikitext, include, qid = -2) => getFeedback('lint', qid, true, wikitext, include);
|
|
62
62
|
const wikiparse = { id: 0, setI18N, setConfig, getConfig, print, lint, json };
|
package/extensions/ui.css
CHANGED
package/i18n/zh-hans.json
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"HTML tag in table attributes": "表格属性中的HTML标签",
|
|
22
22
|
"illegal attribute name": "非法的属性名",
|
|
23
23
|
"illegal module name": "非法的模块名称",
|
|
24
|
+
"inconsistent table layout": "不一致的表格布局",
|
|
24
25
|
"insecure style": "不安全的样式",
|
|
25
26
|
"internal link in an external link": "外链中的内链",
|
|
26
27
|
"invalid content in <$1>": "<$1>内的无效内容",
|
package/i18n/zh-hant.json
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"HTML tag in table attributes": "表格屬性中的HTML標籤",
|
|
22
22
|
"illegal attribute name": "非法的屬性名",
|
|
23
23
|
"illegal module name": "非法的模組名稱",
|
|
24
|
+
"inconsistent table layout": "不一致的表格佈局",
|
|
24
25
|
"insecure style": "不安全的樣式",
|
|
25
26
|
"internal link in an external link": "外部連結中的內部連結",
|
|
26
27
|
"invalid content in <$1>": "<$1>內的無效內容",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wikiparser-node",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.4-b",
|
|
4
4
|
"description": "A Node.js parser for MediaWiki markup with AST",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mediawiki",
|
|
@@ -24,27 +24,25 @@
|
|
|
24
24
|
"!/config/.schema.json"
|
|
25
25
|
],
|
|
26
26
|
"browser": "/bundle/bundle.min.js",
|
|
27
|
-
"main": "./bundle/bundle.js",
|
|
27
|
+
"main": "./bundle/bundle.min.js",
|
|
28
28
|
"types": "./extensions/typings.d.ts",
|
|
29
29
|
"repository": {
|
|
30
30
|
"type": "git",
|
|
31
31
|
"url": "git+https://github.com/bhsd-harry/wikiparser-node.git"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
|
-
"prepublishOnly": "npm run build
|
|
35
|
-
"build:
|
|
36
|
-
"build:prod": "esbuild index.ts --bundle --minify --target=es2018 --outfile=bundle/bundle.min.js",
|
|
37
|
-
"build:core": "rm bundle/*.js; npm run build:dev && npm run build:prod && eslint --no-eslintrc -c .eslintrc.browser.json bundle/",
|
|
34
|
+
"prepublishOnly": "npm run build",
|
|
35
|
+
"build:core": "esbuild index.ts --bundle --minify --target=es2018 --outfile=bundle/bundle.min.js && eslint --no-eslintrc -c .eslintrc.browser.json bundle/bundle.min.js",
|
|
38
36
|
"build:ext": "bash build-ext.sh",
|
|
39
37
|
"build": "npm run build:core && npm run build:ext",
|
|
40
|
-
"diff": "
|
|
38
|
+
"diff": "bash diff.sh",
|
|
41
39
|
"diff:stat": "f() { git diff --stat --ignore-all-space --color=always $1 $2 -- . ':!extensions/' ':!bin/' | grep '\\.ts'; }; f",
|
|
42
40
|
"lint:ts": "tsc --noEmit && tsc --noEmit --project extensions/tsconfig.json && eslint --cache .",
|
|
43
41
|
"lint:json": "ajv -s config/.schema.json -d 'config/*.json' --strict=true --strict-required=false",
|
|
44
42
|
"lint:css": "stylelint extensions/*.css",
|
|
45
43
|
"lint": "npm run lint:ts && npm run lint:json && npm run lint:css",
|
|
46
44
|
"server": "npm run test:end; http-server .. -c-1 --cors &",
|
|
47
|
-
"test": "npm run build
|
|
45
|
+
"test": "npm run build && gsed -i 's|importScripts.*|importScripts(\"http://127.0.0.1:8080/wikiparser-node/bundle/bundle.min.js\");|' extensions/dist/base.js; npm run server",
|
|
48
46
|
"test:end": "pkill -x http-server",
|
|
49
47
|
"test:real": "tsc --project tsconfig.dist.json && node dist/test/real.js"
|
|
50
48
|
},
|