wikiparser-node 1.25.1 → 1.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/bundle-es8.min.js +25 -25
- package/bundle/bundle-lsp.min.js +30 -30
- package/bundle/bundle.min.js +23 -23
- package/config/default.json +3 -0
- package/config/enwiki.json +3 -0
- package/config/jawiki.json +3 -0
- package/config/minimum.json +1 -0
- package/config/moegirl.json +0 -20
- package/config/zhwiki.json +3 -0
- package/coverage/badge.svg +1 -1
- package/data/.schema.json +2 -1
- package/data/ext/math.json +41 -0
- package/data/signatures.json +82 -16
- package/dist/base.d.mts +16 -4
- package/dist/base.d.ts +16 -4
- package/dist/bin/config.js +8 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -3
- package/dist/lib/document.js +6 -0
- package/dist/lib/element.js +1 -1
- package/dist/lib/lintConfig.d.ts +18 -7
- package/dist/lib/lintConfig.js +68 -21
- package/dist/lib/lsp.js +16 -8
- package/dist/lib/text.js +36 -34
- package/dist/src/arg.js +8 -6
- package/dist/src/attribute.js +37 -27
- package/dist/src/attributes.js +23 -15
- package/dist/src/converterFlags.js +9 -7
- package/dist/src/gallery.js +7 -5
- package/dist/src/heading.js +35 -25
- package/dist/src/html.js +38 -29
- package/dist/src/imageParameter.js +14 -7
- package/dist/src/imagemap.js +7 -5
- package/dist/src/index.js +51 -42
- package/dist/src/link/base.js +19 -11
- package/dist/src/link/file.js +32 -19
- package/dist/src/link/galleryImage.js +4 -2
- package/dist/src/link/index.js +4 -2
- package/dist/src/link/redirectTarget.js +4 -2
- package/dist/src/magicLink.js +13 -10
- package/dist/src/nested.js +7 -5
- package/dist/src/nowiki/comment.js +5 -3
- package/dist/src/nowiki/index.js +4 -2
- package/dist/src/nowiki/quote.js +10 -6
- package/dist/src/paramTag/index.js +4 -2
- package/dist/src/parameter.js +4 -2
- package/dist/src/table/index.js +1 -1
- package/dist/src/table/td.js +9 -7
- package/dist/src/tagPair/ext.js +3 -3
- package/dist/src/tagPair/include.js +7 -3
- package/dist/src/transclude.js +13 -7
- package/dist/util/html.js +2 -1
- package/extensions/dist/base.js +1 -1
- package/extensions/editor.css +2 -2
- package/i18n/en.json +14 -13
- package/i18n/zh-hans.json +19 -18
- package/i18n/zh-hant.json +31 -30
- package/package.json +5 -5
package/bundle/bundle-es8.min.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
"use strict";(()=>{var wa=Object.defineProperty,ya=Object.defineProperties;var Sa=Object.getOwnPropertyDescriptors;var Nn=Object.getOwnPropertySymbols;var ka=Object.prototype.hasOwnProperty,Aa=Object.prototype.propertyIsEnumerable;var Ln=e=>{throw TypeError(e)};var Ns=(e,t,s)=>t in e?wa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,ce=(e,t)=>{for(var s in t||(t={}))ka.call(t,s)&&Ns(e,s,t[s]);if(Nn)for(var s of Nn(t))Aa.call(t,s)&&Ns(e,s,t[s]);return e},Ie=(e,t)=>ya(e,Sa(t));var _a=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ne=(e,t,s)=>Ns(e,typeof t!="symbol"?t+"":t,s),Ls=(e,t,s)=>t.has(e)||Ln("Cannot "+s);var m=(e,t,s)=>(Ls(e,t,"read from private field"),s?s.call(e):t.get(e)),N=(e,t,s)=>t.has(e)?Ln("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),L=(e,t,s,i)=>(Ls(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),j=(e,t,s)=>(Ls(e,t,"access private method"),s);var Fn=(e,t,s,i)=>({set _(n){L(e,t,n,s)},get _(){return m(e,t,i)}});var Cu=_a((Nu,ba)=>{var $a=Object.create,pt=Object.defineProperty,Tl=Object.getOwnPropertyDescriptor,Yi=Object.getOwnPropertyNames,Ta=Object.prototype.hasOwnProperty,Cl=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),ft=e=>{throw TypeError(e)},Il=(e,t,s)=>t in e?pt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,En=(e,t)=>pt(e,"name",{value:t,configurable:!0}),_=(e,t)=>function(){return e&&(t=(0,e[Yi(e)[0]])(e=0)),t},Nl=(e,t)=>function(){return t||(0,e[Yi(e)[0]])((t={exports:{}}).exports,t),t.exports},te=(e,t)=>{for(var s in t)pt(e,s,{get:t[s],enumerable:!0})},Ca=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Yi(t))!Ta.call(e,n)&&n!==s&&pt(e,n,{get:()=>t[n],enumerable:!(i=Tl(t,n))||i.enumerable});return e},Q=e=>Ca(pt({},"__esModule",{value:!0}),e),Y=e=>{var t;return[,,,$a((t=e==null?void 0:e[Cl("metadata")])!=null?t:null)]},Ll=["class","method","getter","setter","accessor","field","value","get","set"],Tt=e=>e!==void 0&&typeof e!="function"?ft("Function expected"):e,Ia=(e,t,s,i,n)=>({kind:Ll[e],name:t,metadata:i,addInitializer:r=>s._?ft("Already initialized"):n.push(Tt(r||null))}),Zi=(e,t)=>Il(t,Cl("metadata"),e[3]),X=(e,t,s,i)=>{for(var n=0,r=e[t>>1],l=r&&r.length;n<l;n++)t&1?r[n].call(s):i=r[n].call(s,i);return i},K=(e,t,s,i,n,r)=>{var l,o,a,h,u,d=t&7,g=!!(t&8),c=!!(t&16),p=d>3?e.length+1:d?g?1:2:0,w=Ll[d+5],v=d>3&&(e[p-1]=[]),f=e[p]||(e[p]=[]),b=d&&(!c&&!g&&(n=n.prototype),d<5&&(d>3||!c)&&Tl(d<4?n:{get[s](){return ae(this,r)},set[s](y){return xe(this,r,y)}},s));d?c&&d<4&&En(r,(d>2?"set ":d>1?"get ":"")+s):En(n,s);for(var S=i.length-1;S>=0;S--)h=Ia(d,s,a={},e[3],f),d&&(h.static=g,h.private=c,u=h.access={has:c?y=>La(n,y):y=>s in y},d^3&&(u.get=c?y=>(d^1?ae:qi)(y,n,d^4?r:b.get):y=>y[s]),d>2&&(u.set=c?(y,A)=>xe(y,n,A,d^4?r:b.set):(y,A)=>y[s]=A)),o=(0,i[S])(d?d<4?c?r:b[w]:d>4?void 0:{get:b.get,set:b.set}:n,h),a._=1,d^4||o===void 0?Tt(o)&&(d>4?v.unshift(o):d?c?r=o:b[w]=o:n=o):typeof o!="object"||o===null?ft("Object expected"):(Tt(l=o.get)&&(b.get=l),Tt(l=o.set)&&(b.set=l),Tt(l=o.init)&&v.unshift(l));return d||Zi(e,n),b&&pt(n,s,b),c?d^4?r:b:n},Na=(e,t,s)=>Il(e,typeof t!="symbol"?t+"":t,s),en=(e,t,s)=>t.has(e)||ft("Cannot "+s),La=(e,t)=>Object(t)!==t?ft('Cannot use the "in" operator on this value'):e.has(t),ae=(e,t,s)=>(en(e,t,"read from private field"),s?s.call(e):t.get(e)),je=(e,t,s)=>t.has(e)?ft("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),xe=(e,t,s,i)=>(en(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),qi=(e,t,s)=>(en(e,t,"access private method"),s),Fa=(e,t,s,i)=>({set _(n){xe(e,t,n,s)},get _(){return ae(e,t,i)}}),Fl,tn,El=_({"base.ts"(){"use strict";Fl=(()=>{const e={redirect:1,onlyinclude:1,noinclude:1,include:1,comment:1,ext:1,arg:2,"magic-word":2,template:2,heading:2,html:3,table:4,hr:5,"double-underscore":5,link:6,category:6,file:6,quote:7,"ext-link":8,"free-ext-link":9,"magic-link":9,list:10,dd:10,converter:11,"list-range":11};return Object.setPrototypeOf(e,null),e})(),tn=(()=>{const e=["bold-header","format-leakage","fostered-content","h1","illegal-attr","insecure-style","invalid-gallery","invalid-imagemap","invalid-invoke","invalid-isbn","lonely-apos","lonely-bracket","lonely-http","nested-link","no-arg","no-duplicate","no-ignored","obsolete-attr","obsolete-tag","parsing-order","pipe-like","table-layout","tag-like","unbalanced-header","unclosed-comment","unclosed-quote","unclosed-table","unescaped","unknown-page","unmatched-tag","unterminated-url","url-encoding","var-anchor","void-ext"];return Object.freeze(e),e})()}});function ve(e,t,s){return s===1?e.replace(/\0(\d+)g\x7F/gu,(i,n)=>ve(String(t[n]),t,2)):s===2?e.replace(/\0(\d+)n\x7F/gu,(i,n)=>String(t[n])):e.replace(/\0(\d+)\x7F/gu,(i,n)=>t[n])}var Re,Fs,ut,dt,ht,et,jl,me,Qe,jn,Pn,cs,Pl,Rn,On,Mt,ct,de=_({"util/string.ts"(){"use strict";Re=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Fs=String.raw`[^[\]<>"\0-\x1F\x7F${Re}\uFFFD]`,ut=String.raw`(?:\[[\da-f:.]+\]|${Fs})`,dt=String.raw`(?:${Fs}|\0\d+[cn!~]\x7F)*`,ht=e=>e.trim().toLowerCase(),et=(e,t)=>s=>s.replace(e,t),jl=et(/[\0\x7F]|\r$/gmu,""),me=et(/\0\d+[cn]\x7F/gu,""),Qe=(e,t="")=>e.map(s=>typeof s=="string"?s:s.text()).join(t),jn={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},Pn=et(/&(?:#(\d+|[Xx][\da-fA-F]+)|([lg]t|[LG]T|[lr]brac[ke]|nbsp|amp|AMP|quot|QUOT));/gu,(e,t,s)=>t?String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t)):jn[s.toLowerCase()]),cs=e=>Pn(e),Pl=et(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),Rn={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},On=e=>et(e,t=>`&${Rn[t]};`),Mt=On(/[&<>]/gu),ct=(e,t={})=>{const{pre:s="",post:i="",sep:n=""}=t;return s+e.map(r=>r.print()).join(n)+i}}}),Ea=Nl({"i18n/en.json"(e,t){t.exports={"attributes-of-closing-tag":"attributes of a closing tag","bold-apostrophes":"bold apostrophes","bold-in-header":"bold in section header",close:null,"closing-and-self-closing":"tag that is both closing and self-closing",comment:null,"conflicting-image-parameter":"conflicting image $1 parameter","content-outside-table":"content to be moved outside the table",decode:null,delink:null,"duplicate-attribute":"duplicate $1 attribute","duplicate-category":"duplicate category","duplicate-id":"duplicate id","duplicate-image-parameter":"duplicate image $1 parameter","duplicate-parameter":"duplicate parameter",encode:null,escape:null,expand:null,"ext-in-html":"extension tag in HTML tag attributes",frame:null,"full-width-punctuation":"full-width punctuation","header-in-html":"section header in HTML tag attributes","horizontal-alignment":null,"html-comment":"HTML comment","html-in-table":"HTML tag in table attributes","illegal-attribute-name":"illegal attribute name","illegal-attribute-value":"illegal attribute value","illegal-module":"illegal module name","imagemap-without-image":"<imagemap> without an image","in-url":"$1 in URL","inconsistent-table":"inconsistent table layout","insecure-style":"insecure style","invalid-attribute":"containing invalid attribute","invalid-content":"invalid content in <$1>","invalid-conversion-flag":"invalid conversion flag","invalid-gallery":"invalid gallery image","invalid-image-parameter":"invalid image parameter","invalid-imagemap-link":"invalid link in <imagemap>","invalid-isbn":"invalid ISBN","invalid-parameter":"invalid parameter of <$1>","invalid-self-closing":"invalid self-closing tag","invisible-triple-braces":"invisible content inside triple braces","italic-apostrophes":"italic apostrophes","left-bracket":"left bracket","link-in-extlink":"internal link in an external link",lonely:'lonely "$1"',"missing-function":"missing module function",newline:null,"no-self-closing":"no self-closing","nonzero-tabindex":"nonzero tabindex","nothing-in":"nothing should be in <$1>","obsolete-attribute":"obsolete attribute","obsolete-tag":"obsolete HTML tag",open:null,prefix:null,"pipe-in-link":'additional "|" in the link text',"pipe-in-table":'additional "|" in a table cell',quotes:null,remove:null,table:null,"template-in-link":"template in an internal link target","unbalanced-in-section-header":"unbalanced $1 in a section header",unclosed:"unclosed $1","unclosed-tag":"unclosed tag","unescaped-query":"unescaped query string in an anonymous parameter","unexpected-argument":"unexpected template argument","unmatched-closing":"unmatched closing tag","unnecessary-encoding":"unnecessary URL encoding in an internal link",uppercase:null,"useless-attribute":"useless attribute","useless-fragment":"useless fragment","useless-link-text":"useless link text","variable-anchor":"variable anchor in a section header","vertical-alignment":null,whitespace:null}}}),ja=Nl({"config/minimum.json"(e,t){t.exports={ext:[],html:[["b","bdi","del","i","ins","u","font","big","small","sub","sup","h1","h2","h3","h4","h5","h6","cite","code","em","s","strike","strong","tt","var","div","center","blockquote","ol","ul","dl","table","caption","pre","ruby","rb","rp","rt","rtc","p","span","abbr","dfn","kbd","samp","data","time","mark","tr","td","th","q","bdo"],["li","dt","dd"],["br","wbr","hr","meta","link"]],namespaces:{0:"",6:"File",10:"Template",14:"Category",828:"Module"},nsid:{"":0,file:6,template:10,category:14,module:828},functionHook:["msgnw"],variable:["!","=","pageid","articlepath","server","servername","scriptpath","stylepath"],parserFunction:[{msgnw:"msgnw",pageid:"pageid",articlepath:"articlepath",server:"server",servername:"servername",scriptpath:"scriptpath",stylepath:"stylepath","#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"formatdate","#dateformat":"formatdate","#invoke":"invoke","#while":"while","#dowhile":"dowhile","#loop":"loop","#forargs":"forargs","#fornumargs":"fornumargs","#if":"if","#ifeq":"ifeq","#switch":"switch","#ifexist":"ifexist","#ifexpr":"ifexpr","#iferror":"iferror","#time":"time","#timel":"timel","#expr":"expr","#rel2abs":"rel2abs","#titleparts":"titleparts","#categorytree":"categorytree","#urldecode":"urldecode","#choose":"choose","#var":"var","#varexists":"varexists","#var_final":"var_final","#vardefine":"vardefine","#vardefineecho":"vardefineecho","#widget":"widget","#related":"related","#regex":"regex","#regex_var":"regex_var","#regexquote":"regexquote","#regexall":"regexall","#len":"len","#pos":"pos","#rpos":"rpos","#sub":"sub","#count":"count","#rmatch":"rmatch","#rreplace":"rreplace","#replace":"replace","#rsplit":"rsplit","#explode":"explode","#tab":"tab","#seo":"seo","#babel":"babel","#translation":"translation","#commaseparatedlist":"commaseparatedlist","#coordinates":"coordinates","#lst":"lst","#lsth":"lsth","#lstx":"lstx","#assessment":"assessment","#mentor":"mentor","#property":"property","#target":"target","#section":"lst","#section-x":"lstx","#section-h":"lsth","#statements":"statements","#useliquidthreads":"useliquidthreads","#lqtpagelimit":"lqtpagelimit","#avatar":"avatar","#img":"img","#chart":"chart"},{"!":"!","=":"=","#FORMAL":"formal","#bcp47":"bcp47","#dir":"dir","#interwikilink":"interwikilink","#interlanguagelink":"interlanguagelink","#timef":"timef","#timefl":"timefl"},["msg","raw"],["subst","safesubst"]],doubleUnderscore:[[],[]],protocol:"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|matrix:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|wikipedia://|worldwind://|xmpp:",interwiki:[],img:{},redirection:["#redirect"],variants:[]}}}),be,Rl,Wi,Je=_({"util/constants.ts"(){"use strict";be=11,Rl=Ea(),Wi=ja()}});function at(e){const t=new Map,s=new WeakMap;return i=>{const n=typeof i=="string"?t:s;if(n.has(i)){const l=n.get(i);return l.lastIndex=0,l}const r=e(i);return n.set(i,r),r}}var zt,Ol,Xe=_({"../common/dist/index.mjs"(){"use strict";zt=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25")),Ol=at}}),ie,oe=_({"lib/rect.ts"(){"use strict";var e,t,s,i,Mi,r;ie=(r=class{constructor(l,o){N(this,i);N(this,e);N(this,t);N(this,s);L(this,e,l),L(this,t,o)}get start(){return m(this,t)}get top(){return j(this,i,Mi).call(this).top}get left(){return j(this,i,Mi).call(this).left}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakSet,Mi=function(){var l;return(l=m(this,s))!=null||L(this,s,m(this,e).getRootNode().posFromIndex(m(this,t))),m(this,s)},r)}}),Bn,qn,Wt,zi,Es,O,J,ke,fs,D,sn,Oe,nn,rn,ln,Ut,gt,on,Ve,Bl,z=_({"util/lint.ts"(){"use strict";Xe(),$e(),oe(),q(),Bn=new Set(["tr","td","th","caption"]),qn=new Set(["Template:!!","Template:!-"]),Wt=e=>{const t=e.childNodes.find(s=>s.text().trim());if(!t||t.type==="text"&&t.data.trim().startsWith("!")||t.is("magic-word")&&t.name==="!"||t.is("template")&&qn.has(t.name)||t.is("html")&&Bn.has(t.name))return!1;if(t.is("arg"))return t.length>1&&Wt(t.childNodes[1]);if(t.is("magic-word"))try{const s=t.getPossibleValues().map(Wt);return s.includes(2)?2:s.includes(1)&&1}catch(s){}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?1:2},zi=(e,t,s,i)=>({line:e+s-1,character:(s===1?t:0)+i}),Es=e=>(t,s,i,n,r="error")=>{const{start:l}=s,{top:o,left:a}=s instanceof ie?s:new ie(t,l),{offsetHeight:h,offsetWidth:u}=t,{startIndex:d,startLine:g,startCol:c}=e(t,l,o,a),{line:p,character:w}=zi(g,c,h,u);return{rule:i,message:k.msg(n),severity:r,startIndex:d,endIndex:d+t.toString().length,startLine:g,endLine:p,startCol:c,endCol:w}},O=Es((e,t,s,i)=>{const n=e.getRelativeIndex(),{top:r,left:l}=e.parentNode.posFromIndex(n);return{startIndex:t+n,startLine:s+r,startCol:r?l:i+l}}),J=Es((e,t,s,i)=>({startIndex:t,startLine:s,startCol:i})),ke=(e,t,s,i=0)=>({desc:k.msg(t),range:[e.startIndex+i,e.endIndex],text:s}),fs=(e,t,s)=>({desc:k.msg(t),range:[e,e],text:s}),D=(e,t=0,s="")=>typeof e=="number"?{desc:k.msg("remove"),range:[e,e+t],text:s}:ke(e,"remove",s,t),sn=(e,t)=>ke(e,"decode",zt(t.text().replace(/%(?=21|3[ce]|5[bd]|7[b-d])/giu,"%25"))),Oe=(e,t,s=0)=>({desc:k.msg("close"),range:[e+s,e],text:t}),nn=e=>({desc:k.msg("open"),range:[e+1,e+2],text:""}),rn=(e,t)=>ke(e,"comment",`<!--${t}-->`),ln=(e,t)=>ke(e,"uppercase",t.toUpperCase()),Ut=(e,t=0)=>({desc:k.msg("whitespace"),range:[e,e+t],text:" "}),gt=(e,t,s=1)=>({desc:k.msg("escape"),range:[e,e+s],text:t.repeat(s)}),on=(e,t)=>({desc:k.msg("escape"),range:[e,e+t.length],text:t.replace(/\|/gu,"|")}),Ve=(e,t,s,i)=>{if(e&&(i||k.viewOnly&&e[0]===we.rev))return e[1];const n=t();return(i||k.viewOnly)&&s([we.rev,n]),n},Bl=(e,t)=>e==="ol"&&t==="type"?["1","a","A","i","I"]:e==="th"&&t==="scope"?["row","col","rowgroup","colgroup"]:t==="dir"?["ltr","rtl","auto"]:t==="aria-hidden"?["true","false"]:[]}}),Wn,an,ql=_({"parser/selector.ts"(){"use strict";Wn=(e,t,s)=>{if(e.includes("#")){const i=e.indexOf("#");return(i===0||e.slice(0,i)===t)&&e.slice(i+1)===s}return!e||e===t},an=(e,t,s)=>{const i=e.split(",");return({type:n,name:r})=>i.some(l=>Wn(l.trim(),n,r))}}}),ms,un=_({"mixin/cached.ts"(){"use strict";z(),ms=(e=!0)=>t=>{const s=new WeakMap;return function(...i){return Ve(s.get(this),()=>t.apply(this,i),n=>{s.set(this,n)},e)}}}}),Wl,Pa=_({"mixin/nodeLike.ts"(){"use strict";Wl=e=>{class t extends e{get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get offsetHeight(){return this.getDimension().height}get offsetWidth(){return this.getDimension().width}}return t}}}),Mn,zn,Qt,vt,bt,Jt,wt,yt,St,De,Ml=_({"lib/node.ts"(){"use strict";z(),$e(),un(),Pa(),q(),zn=[Wl],Mn=[ms(!1)],De=class{constructor(){X(St,5,this),Na(this,"childNodes",[]),je(this,Qt),je(this,vt),je(this,bt),je(this,Jt),je(this,wt),je(this,yt,{})}get parentNode(){return ae(this,Qt)}get nextSibling(){return ae(this,vt)}get previousSibling(){return ae(this,bt)}getChildNodes(){const{childNodes:e}=this;return Object.isFrozen(e)?[...e]:e}getAttribute(e){return e==="padding"?0:this[e]}setAttribute(e,t){switch(e){case"parentNode":xe(this,Qt,t),t||(xe(this,vt,void 0),xe(this,bt,void 0));break;case"nextSibling":xe(this,vt,t);break;case"previousSibling":xe(this,bt,t);break;case"aIndex":k.viewOnly&&xe(this,wt,[we.rev,t]);break;default:this[e]=t}}getRootNode(){return Ve(ae(this,Jt),()=>{var e,t;return(t=(e=this.parentNode)==null?void 0:e.getRootNode())!=null?t:this},e=>{const[,t]=e;t.type==="root"&&xe(this,Jt,e)})}indexFromPos(e,t){this.lspError("AstNode.indexFromPos")}posFromIndex(e){const{length:t}=String(this);if(e+=e<0?t:0,e>=0&&e<=t){const s=this.getLines(),i=s.findIndex(([,,n])=>e<=n);return{top:i,left:e-s[i][1]}}}getDimension(){const e=this.getLines(),t=e[e.length-1];return{height:e.length,width:t[2]-t[1]}}getGaps(e){return 0}getRelativeIndex(e){if(e===void 0){const{parentNode:t}=this;return t?t.getRelativeIndex(t.childNodes.indexOf(this)):0}return Ve(ae(this,yt)[e],()=>{const{childNodes:t}=this,s=e+(e<0?t.length:0);let i=this.getAttribute("padding");for(let n=0;n<s;n++)k.viewOnly&&(ae(this,yt)[n]=[we.rev,i]),i+=t[n].toString().length+this.getGaps(n);return i},t=>{ae(this,yt)[e]=t})}getAbsoluteIndex(){return Ve(ae(this,wt),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{xe(this,wt,e)})}getBoundingClientRect(){this.lspError("AstNode.getBoundingClientRect")}is(e){return this.type===e}getLines(){const e=[];let t=0;for(const s of String(this).split(`
|
|
2
|
-
`)){const i=t+s.length;e.push([s,t,i]),t=i+1}return e}seal(e,t){const s=!t&&!!this[e];Object.defineProperty(this,e,{enumerable:s,configurable:!0})}lspError(e){throw new Error(`${e} method is only available in the LSP version!`)}},St=Y(null),Qt=new WeakMap,vt=new WeakMap,bt=new WeakMap,Jt=new WeakMap,wt=new WeakMap,yt=new WeakMap,K(St,1,"getLines",Mn,De),De=K(St,0,"AstNode",zn,De),X(St,1,De)}}),zl,Ra=_({"mixin/elementLike.ts"(){"use strict";ql(),zl=e=>{var s,Ui;class t extends e{constructor(){super(...arguments);N(this,s)}getElementBy(l){for(const o of this.childNodes){if(o.type==="text")continue;if(l(o))return o;const a=o.getElementBy(l);if(a)return a}}querySelector(l){return this.getElementBy(j(this,s,Ui).call(this,l))}getElementsBy(l,o=[]){for(const a of this.childNodes)a.type!=="text"&&(l(a)&&o.push(a),a.getElementsBy(l,o));return o}querySelectorAll(l){return this.getElementsBy(j(this,s,Ui).call(this,l))}escape(){}}return s=new WeakSet,Ui=function(l){return an(l,this)},t}}}),Un,js,Hn,Ct,Oa=_({"lib/element.ts"(){"use strict";de(),$e(),ql(),Ml(),Ra(),Un=[zl],Ct=class extends(Hn=De){get length(){return this.childNodes.length}text(e){return Qe(this.childNodes,e)}normalize(){const e=this.getChildNodes(),t=s=>{var i,n;e.splice(s,1),(i=e[s-1])==null||i.setAttribute("nextSibling",e[s]),(n=e[s])==null||n.setAttribute("previousSibling",e[s-1])};for(let s=e.length-1;s>=0;s--){const{type:i,data:n}=e[s];i!=="text"||e.length===1||this.getGaps(s-(s&&1))||n===""&&t(s)}this.setAttribute("childNodes",e)}removeAt(e){this.lspError("AstElement.removeAt")}insertAt(e,t=this.length){return An(this,t,0,[e]),e}closest(e){const t=an(e,this);let{parentNode:s}=this;for(;s;){if(t(s))return s;({parentNode:s}=s)}}append(...e){this.safeAppend(e)}safeAppend(e){for(const t of e)this.insertAt(t)}safeReplaceChildren(e){}setText(e,t=0){t+=t<0?this.length:0;const s=this.childNodes[t],{data:i}=s;return s.replaceData(e),i}toString(e,t=""){return this.childNodes.map(s=>s.toString(e)).join(t)}caretPositionFromIndex(e){this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(e){this.lspError("AstElement.elementFromIndex")}elementFromPoint(e,t){this.lspError("AstElement.elementFromPoint")}lint(e=this.getAbsoluteIndex(),t){{const s=[];for(let i=0,n=e+this.getAttribute("padding");i<this.length;i++){const r=this.childNodes[i];r.setAttribute("aIndex",n);const l=r.lint(n,t);l.length>0&&s.push(...l),n+=r.toString().length+this.getGaps(i)}return s}}print(e={}){const t=e.class;return this.toString()?(t===""?"":`<span class="wpb-${t!=null?t:this.type}${this.getAttribute("invalid")?" wpb-invalid":""}">`)+ct(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){this.lspError("AstElement.json")}},js=Y(Hn),Ct=K(js,0,"AstElement",Un,Ct),X(js,1,Ct)}}),Xt,Ps,Rs,Dn,Gn,Vn,Qn,Os,Jn,Hi,Ba=_({"lib/text.ts"(){"use strict";var e,Ul,s;de(),z(),q(),Ml(),Xt=String.raw`[${Re}\t]*`,Ps=String.raw`[^\S\n]*`,Rs=String.raw`<${Ps}(?:/${Ps})?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${Xt}\d)|isbn(?=[-::]?${Xt}(?:\d(?:${Xt}|-)){6})`,Dn=new RegExp(String.raw`${Rs}|https?[:/]/+`,"giu"),Gn=new RegExp(Rs,"giu"),Vn=new Set(["attr-value","ext-link-text","link-text"]),Qn={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},Os=new Set(["html","head","style","title","body","a","audio","img","video","embed","iframe","object","canvas","script","col","colgroup","tbody","tfoot","thead","button","input","label","option","select","textarea"]),Jn=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch(i){return/\w/u}})(),Hi=(s=class extends De{constructor(n){super();N(this,e);Ne(this,"data","");this.data=n}get type(){return"text"}toString(n){var r;return n&&!((r=this.parentNode)!=null&&r.getAttribute("built"))?me(this.data):this.data}text(){return this.data}lint(n=this.getAbsoluteIndex(),r){var l,o,a;{if(r===!1)return[];const{data:h,parentNode:u,nextSibling:d,previousSibling:g}=this;if(!u)throw new Error("An isolated text node cannot be linted!");const{type:c,name:p,parentNode:w}=u;if(c==="attr-value"){const{name:W,tag:H}=w;if(H==="ref"&&(W==="name"||W==="follow")||W==="group"&&(H==="ref"||H==="references")||H==="choose"&&(W==="before"||W==="after"))return[]}if(r!=null||(r=c==="free-ext-link"||c==="ext-link-url"||c==="ext-link-text"||c==="image-parameter"&&p==="link"||c==="attr-value"?Gn:Dn),h.search(r)===-1)return[];r.lastIndex=0;const v=[],f=d==null?void 0:d.type,b=d==null?void 0:d.name,S=g==null?void 0:g.type,y=this.getRootNode(),A=y.toString(),{ext:T,html:x,variants:$}=y.getAttribute("config"),{top:I,left:C}=y.posFromIndex(n),U=k.lintConfig["tag-like"],R=typeof U=="number"?new Set:new Set(Object.keys(U[1]).filter(W=>W!=="invalid"&&W!=="disallowed")),P=new Set(["onlyinclude","noinclude","includeonly",...T,...x[0],...x[1],...x[2],...R,...Os]);for(let W=r.exec(h);W;W=r.exec(h)){const[,H,pe]=W;let{index:ee,0:M}=W;if(pe&&pe!=="]"){const{length:he}=pe;ee+=he,M=M.slice(he)}M=M.toLowerCase();const[F]=M,V=F==="r"||F==="p"||F==="i",G=F==="{",Z=F==="}",ne=F==="[",le=F==="]";let{length:re}=M;if(F==="<"&&!P.has(H.toLowerCase())||ne&&c==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(h.slice(ee+1))||d!=null&&d.is("ext")&&b==="nowiki"&&((l=d.innerText)!=null&&l.includes("]")))||V&&(!u.isPlain()||Vn.has(c)))continue;le&&(ee||re>1)&&r.lastIndex--;let Te=n+ee,Vt=Te+re,fe,Ce;const Me=A[Vt],_s=A[Te-1],$s=G||ne,Ts=G&&_s==="-"&&$.length>0,Cs=Z&&Me==="-"&&$.length>0,_n=ne&&f==="free-ext-link"&&!h.slice(ee+1).trim()||le&&S==="free-ext-link"&&!h.slice(0,ee).includes("]");if(V)fe="lonely-http",M=M.toUpperCase(),Ce=k.lintConfig.getSeverity(fe,M);else if(F==="<"){fe="tag-like";let he;/^<\/?\s/u.test(M)||!/[\s/>]/u.test(Me!=null?Me:"")?he="invalid":R.has(H)?he=H:Os.has(H)&&!T.includes(H)&&(he="disallowed"),Ce=k.lintConfig.getSeverity(fe,he)}else if(Ts||Cs)fe="lonely-bracket",Ce=k.lintConfig.getSeverity(fe,"converter"),Ts&&ee>0?(M="-{",ee--,Te--,re=2):Cs&&ee<h.length-1&&(M="}-",Vt++,re=2);else if(_n)fe="lonely-bracket",Ce=k.lintConfig.getSeverity(fe,"extLink");else if($s||Z||le)if(fe="lonely-bracket",re>1||G&&Me===F||Z&&_s===F)Ce=k.lintConfig.getSeverity(fe,"double");else{if(!ne||c!=="ext-link-text"){const he=Qn[F],Is=$s?h.slice(ee+1):h.slice(0,ee);if(G&&((o=he.exec(Is))==null?void 0:o[0])==="}"||Z&&((a=he.exec(Is))==null?void 0:a[0])==="{")continue;if(!Is.includes(F)){const In=$s?"nextSibling":"previousSibling";let Ue=this[In];for(;Ue&&(Ue.type!=="text"||!he.test(Ue.data));)Ue=Ue[In];if(Ue&&he.exec(Ue.data)[0]!==F)continue}}Ce=k.lintConfig.getSeverity(fe,"single")}else fe="lonely-http",Ce=k.lintConfig.getSeverity(fe);if(!Ce)continue;const $n=this.posFromIndex(ee),{line:Tn,character:Cn}=zi(I,C,$n.top+1,$n.left),ze={rule:fe,message:k.msg("lonely",V||F==="h"||Ts||Cs?M:F),severity:Ce,startIndex:Te,endIndex:Vt,startLine:Tn,endLine:Tn,startCol:Cn,endCol:Cn+re};if(F==="<")ze.suggestions=[gt(Te,"<")];else if(F==="h"&&c!=="link-text"&&Jn.test(_s||""))ze.suggestions=[Ut(Te)];else if(ne&&c==="ext-link-text"){const he=u.getAbsoluteIndex()+u.toString().length;ze.suggestions=[gt(he,"]")]}else if(le&&_n){const he=n-g.toString().length;ze.suggestions=[fs(he,"left-bracket","[")]}else V&&(ze.suggestions=[...W[0]===M?[]:[ln(ze,M)],...Me===":"||Me===":"?[Ut(Vt,1)]:[]]);v.push(ze)}return v}}replaceData(n){j(this,e,Ul).call(this,n)}splitText(n){this.lspError("AstText.splitText")}escape(){}print(){return Mt(this.data)}},e=new WeakSet,Ul=function(n){this.setAttribute("data",n)},s)}}),Ke,mt=_({"mixin/hidden.ts"(){"use strict";Ke=(e=!0,t=!0)=>s=>{class i extends s{text(){return""}lint(r){return e?[]:super.lint(r)}}return i}}}),_e,Le=_({"mixin/noEscape.ts"(){"use strict";_e=e=>{}}}),Ye,xt=_({"src/syntax.ts"(){"use strict";var e,t;B(),Ye=(t=class extends E{constructor(i,n,r,l,o){super(i,r,l,o);N(this,e);L(this,e,n)}get type(){return m(this,e)}lint(i=this.getAbsoluteIndex()){return super.lint(i,!1)}},e=new WeakMap,t)}}),Fe,Be=_({"mixin/padded.ts"(){"use strict";Fe=({length:e})=>t=>{class s extends t{getAttribute(n){return n==="padding"?e:super.getAttribute(n)}}return s}}}),ge,qe=_({"src/atom.ts"(){"use strict";var e,t;B(),ge=(t=class extends E{constructor(i,n,r,l,o){super(i,r,l,o);N(this,e);L(this,e,n)}get type(){return m(this,e)}set type(i){L(this,e,i)}getAttribute(i){var n;return i==="invalid"?this.type==="converter-flag"&&!!((n=this.parentNode)!=null&&n.isInvalidFlag(this)):super.getAttribute(i)}},e=new WeakMap,t)}}),Xn,Kn,Bs,Yn,Pe,xs=_({"src/link/base.ts"(){"use strict";var e,t,s,i;z(),Je(),oe(),Be(),Le(),q(),B(),qe(),Xn=n=>n==="redirect-target"||n==="link",Kn=[_e,Fe("[[")],Pe=(i=class extends(Yn=E){constructor(r,l,o,a=[],h="|"){super(void 0,o,a,{});N(this,e,!0);N(this,t);N(this,s);if(this.insertAt(new ge(r,"link-target",o,a,{})),l!==void 0){const u=new E(l,o,a,{});u.type="link-text",u.setAttribute("stage",be-1),this.insertAt(u)}L(this,t,h)}get link(){}get fragment(){}afterBuild(){L(this,s,this.getTitle()),m(this,t).includes("\0")&&L(this,t,this.buildFromStr(m(this,t),0)),this.setAttribute("name",m(this,s).title),super.afterBuild()}setAttribute(r,l){r==="bracket"?L(this,e,l):r==="title"?L(this,s,l):super.setAttribute(r,l)}toString(r){const l=super.toString(r,m(this,t));return m(this,e)?`[[${l}]]`:l}text(){const r=super.text("|");return m(this,e)?`[[${r}]]`:r}getAttribute(r){return r==="title"?m(this,s):super.getAttribute(r)}getGaps(r){return r===0?m(this,t).length:1}lint(r=this.getAbsoluteIndex(),l){{const o=super.lint(r,l),{childNodes:[a,h],type:u}=this,{encoded:d,fragment:g}=m(this,s),c=new ie(this,r);let p="unknown-page",w=k.lintConfig.getSeverity(p);if(w&&a.childNodes.some(({type:v})=>v==="template")&&o.push(O(a,c,p,"template-in-link",w)),p="url-encoding",w=k.lintConfig.getSeverity(p),w&&d){const v=O(a,c,p,"unnecessary-encoding",w);v.fix=sn(v,a),o.push(v)}if(p="pipe-like",w=k.lintConfig.getSeverity(p,"link"),w&&(u==="link"||u==="category")){const v=h==null?void 0:h.childNodes.findIndex(b=>b.type==="text"&&b.data.includes("|")),f=h==null?void 0:h.childNodes[v];if(f){const b=O(h,c,p,"pipe-in-link",w),S=b.startIndex+h.getRelativeIndex(v);b.suggestions=[on(S,f.data)],o.push(b)}}if(p="no-ignored",w=k.lintConfig.getSeverity(p,"fragment"),w&&g!==void 0&&!Xn(u)){const v=O(a,c,p,"useless-fragment",w),f=a.childNodes.findIndex(S=>S.type==="text"&&S.data.includes("#")),b=a.childNodes[f];b&&(v.fix=D(v,a.getRelativeIndex(f)+b.data.indexOf("#"))),o.push(v)}return o}}getTitle(r,l){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:l,temporary:r,decode:!0,selfLink:!0})}print(){return super.print(m(this,e)?{pre:"[[",post:"]]",sep:m(this,t)}:{sep:m(this,t)})}json(r,l=this.getAbsoluteIndex()){const o=super.json(void 0,l)}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i),Bs=Y(Yn),Pe=K(Bs,0,"LinkBaseToken",Kn,Pe),X(Bs,1,Pe)}}),Zn,qs,er,Ae,Ze=_({"src/nowiki/base.ts"(){"use strict";Le(),B(),Zn=[_e],Ae=class extends(er=E){get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}},qs=Y(er),Ae=K(qs,0,"NowikiBaseToken",Zn,Ae),X(qs,1,Ae)}}),tr,Ws,sr,ue,We=_({"src/nowiki/noinclude.ts"(){"use strict";mt(),Ze(),tr=[Ke()],ue=class extends(sr=Ae){get type(){return"noinclude"}toString(e){return e?"":super.toString()}},Ws=Y(sr),ue=K(Ws,0,"NoincludeToken",tr,ue),X(Ws,1,ue)}}),Hl,qa=_({"src/link/redirectTarget.ts"(){"use strict";z(),q(),xs(),We(),Hl=class extends Pe{get type(){return"redirect-target"}constructor(e,t,s,i){super(e,void 0,s,i),t!==void 0&&this.insertAt(new ue(t,s,i))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,{halfParsed:!0,decode:!0})}lint(e=this.getAbsoluteIndex()){{const t=super.lint(e,!1),s="no-ignored",i=k.lintConfig.getSeverity(s,"redirect");if(i&&this.length===2){const n=O(this.lastChild,{start:e},s,"useless-link-text",i);n.startIndex--,n.startCol--,n.fix=D(n),t.push(n)}return t}}}}}),ir,Ms,nr,It,Wa=_({"src/redirect.ts"(){"use strict";var e,t,s;mt(),Le(),B(),xt(),qa(),ir=[Ke(!1,!1),_e],It=(s=class extends(nr=E){constructor(n,r,l,o,a,h,u=[]){super(void 0,h,u);N(this,e);N(this,t);L(this,e,n),L(this,t,a),this.append(new Ye(r,"redirect-syntax",h,u),new Hl(l,o==null?void 0:o.slice(1),h,u))}get type(){return"redirect"}getAttribute(n){return n==="padding"?m(this,e).length:super.getAttribute(n)}toString(n){return m(this,e)+super.toString(n)+m(this,t)}lint(n=this.getAbsoluteIndex()){{const r=n+m(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",r),this.lastChild.lint(r)}}print(){return super.print({pre:m(this,e),post:m(this,t)})}},e=new WeakMap,t=new WeakMap,s),Ms=Y(nr),It=K(Ms,0,"RedirectToken",ir,It),X(Ms,1,It)}}),Dl={};te(Dl,{parseRedirect:()=>Gl});var Gl,Ma=_({"parser/redirect.ts"(){"use strict";q(),Wa(),Gl=(e,t,s)=>{var n;(n=t.regexRedirect)!=null||(t.regexRedirect=new RegExp(String.raw`^(\s*)((?:${t.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));const i=t.regexRedirect.exec(e);return i&&k.normalizeTitle(i[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0}).valid?(e=`\0${s.length}o${e.slice(i[0].length)}`,new It(...i.slice(1),t,s),e):!1}}}),rr,zs,lr,Nt,za=_({"src/onlyinclude.ts"(){"use strict";Be(),Le(),B(),rr=[_e,Fe("<onlyinclude>")],Nt=class extends(lr=E){get type(){return"onlyinclude"}toString(e){return`<onlyinclude>${super.toString(e)}</onlyinclude>`}isPlain(){return!0}print(){return super.print({pre:'<span class="wpb-ext"><onlyinclude></span>',post:'<span class="wpb-ext"></onlyinclude></span>'})}},zs=Y(lr),Nt=K(zs,0,"OnlyincludeToken",rr,Nt),X(zs,1,Nt)}}),Dt,vs=_({"mixin/gapped.ts"(){"use strict";Dt=(e=1)=>t=>{class s extends t{getGaps(){return e}}return s}}}),or,Us,ar,Ge,dn=_({"src/tagPair/index.ts"(){"use strict";var e,t;vs(),Le(),B(),or=[Dt(),_e],Ge=(t=class extends(ar=E){constructor(i,n,r,l,o,a=[]){super(void 0,o);N(this,e);Ne(this,"closed");Ne(this,"selfClosing");this.setAttribute("name",i.toLowerCase()),L(this,e,[i,l||i]),this.closed=l!=="",this.selfClosing=l===void 0,this.append(n,r);const h=typeof n=="string"?-1:a.indexOf(n);a.splice(h===-1?1/0:h,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(i){const{selfClosing:n,firstChild:r,lastChild:l}=this,[o,a]=m(this,e);return n?`<${o}${r.toString(i)}/>`:`<${o}${r.toString(i)}>${l.toString(i)}${this.closed?`</${a}>`:""}`}text(){const[i,n]=m(this,e);return this.selfClosing?`<${i}${this.firstChild.text()}/>`:`<${i}${super.text(">")}${this.closed?`</${n}>`:""}`}getAttribute(i){return i==="padding"?m(this,e)[0].length+1:super.getAttribute(i)}print(){const[i,n]=m(this,e);return super.print(this.selfClosing?{pre:`<${i}`,post:"/>"}:{pre:`<${i}`,sep:">",post:this.closed?`</${n}>`:""})}},e=new WeakMap,t),Us=Y(ar),Ge=K(Us,0,"TagPairToken",or,Ge),X(Us,1,Ge)}}),Vl,Ua=_({"src/tagPair/translate.ts"(){"use strict";var e,Ql,s;B(),dn(),xt(),We(),Vl=(s=class extends Ge{constructor(n,r,l,o=[]){const a=new Ye(n,"translate-attr",l,o);r=r==null?void 0:r.replace(/(<tvar\|[^>]+>)([\s\S]*?)(<\/>)/gu,(u,d,g,c)=>(new ue(d,l,o),new ue(c,l,o),`\0${o.length-1}n${g}\0${o.length}n`)).replace(/(<tvar\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\2|[^"'\s>]+))?\s*>)([\s\S]*?)(<\/tvar\s*>)/giu,(u,d,g,c,p)=>(new ue(d,l,o),new ue(p,l,o),`\0${o.length-1}n${c}\0${o.length}n`));const h=new E(r,l,o);h.type="translate-inner";super("translate",a,h,"translate",l,o);N(this,e);this.seal("closed",!0),this.seal("selfClosing",!0)}get type(){return"translate"}toString(n){return n?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){return`<span class="wpb-ext"><translate${j(this,e,Ql).call(this)?'<span class="wpb-ext-attrs"> <span class="wpb-ext-attr"><span class="wpb-attr-key">nowrap</span></span></span>':""}>${this.lastChild.print({class:"ext-inner"})}</translate></span>`}},e=new WeakSet,Ql=function(){return this.firstChild.toString()===" nowrap"},s)}}),ur,Hs,dr,Lt,Ha=_({"src/tagPair/include.ts"(){"use strict";z(),oe(),mt(),q(),dn(),ur=[Ke(!1)],Lt=class extends(dr=Ge){get type(){return"include"}constructor(e,t="",s,i,n,r){super(e,t,s!=null?s:"",s===void 0||i!=null?i:"",n,r)}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){{const t=[],{firstChild:s,closed:i,name:n}=this,r=new ie(this,e),l=["no-ignored","unclosed-comment"],o=l.map(a=>k.lintConfig.getSeverity(a,"include"));if(o[0]&&s.data.trim()){const a=O(s,r,l[0],"useless-attribute",o[0]);a.suggestions=[D(a)],t.push(a)}if(o[1]&&!i){const a=J(this,r,l[1],k.msg("unclosed",`<${n}>`),o[1]);a.suggestions=[Oe(a.endIndex,`</${n}>`)],t.push(a)}return t}}},Hs=Y(dr),Lt=K(Hs,0,"IncludeToken",ur,Lt),X(Hs,1,Lt)}}),bs,hn=_({"mixin/attributesParent.ts"(){"use strict";bs=(e=0)=>t=>{var i,Jl;class s extends t{constructor(){super(...arguments);N(this,i)}hasAttr(o){this.lspError("AttributesParent.hasAttr")}getAttr(o){return j(this,i,Jl).call(this).getAttr(o)}}return i=new WeakSet,Jl=function(){return this.childNodes[e]},s}}}),se,Ds,Gs,kt,Kt,Vs,He,Qs,Js,Xs,Yt,Ks,ye,Xl,Kl,Yl,Zl,Da=_({"util/sharable.ts"(){"use strict";se=new Set(["align"]),Ds=new Set(["cite"]),Gs=new Set(["cite","datetime"]),kt=new Set(["width"]),Kt=new Set(["axis","align","bgcolor","height","width","valign"]),Vs=new Set([...Kt,"abbr","headers","scope","rowspan","colspan"]),He=new Set(["type"]),Qs=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),Js=new Set(["clear"]),Xs=new Set(["bgcolor","align","valign"]),Yt=new Set(["qid","forcemathmode","type","display"]),Ks=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),ye=new Set,Xl=new Set(["id","class","style","lang","dir","title","tabindex","aria-describedby","aria-flowto","aria-hidden","aria-label","aria-labelledby","aria-level","aria-owns","role","about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),Kl={div:se,h1:se,h2:se,h3:se,h4:se,h5:se,h6:se,blockquote:Ds,q:Ds,p:se,br:Js,pre:kt,ins:Gs,del:Gs,ul:He,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...Qs,"border"]),caption:se,tr:Xs,td:Vs,th:Vs,font:new Set(["size","color","face"]),hr:kt,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:He,poem:se,categorytree:se,combooption:se,math:ye,chem:ye,ce:ye,img:new Set(["alt","src","width","height","loading","srcset"])},Yl={gallery:new Set(["mode","showfilename","caption","perrow","widths","heights","showthumbnails"]),poem:new Set(["compact"]),categorytree:new Set(["hideroot","onlyroot","depth","mode","hideprefix","namespaces","showcount","notranslations"]),combooption:new Set(["name","for","inline"]),nowiki:ye,indicator:new Set(["name"]),langconvert:new Set(["from","to"]),ref:new Set(["group","name","follow","dir","details"]),references:new Set(["group","responsive"]),charinsert:new Set(["label"]),choose:new Set(["uncached","before","after"]),option:new Set(["weight"]),imagemap:ye,inputbox:ye,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:ye,poll:new Set(["id","show-results-before-voting"]),sm2:He,flashmp3:He,score:new Set(["line_width_inches","lang","override_midi","raw","note-language","override_audio","override_ogg","sound","vorbis"]),seo:new Set(["title","title_mode","title_separator","keywords","description","robots","google_bot","image","image_width","image_height","image_alt","type","site_name","locale","section","author","published_time","twitter_site"]),tab:new Set(["nested","name","index","class","block","inline","openname","closename","collapsed","dropdown","style","bgcolor","container","id","title"]),tabs:new Set(["plain","class","container","id","title","style"]),combobox:new Set(["placeholder","value","id","class","text","dropdown","style"]),math:new Set([...Yt,"chem"]),chem:Yt,ce:Yt,hiero:ye,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:Ks,syntaxhighlight:Ks,templatedata:ye,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:ye},Zl={table:Qs,td:new Set([...Kt,"scope"]),th:Kt,br:Js,caption:se,div:se,hr:kt,h1:se,h2:se,h3:se,h4:se,h5:se,h6:se,li:He,p:se,pre:kt,tr:Xs,ul:He}}}),hr,cr,gr,pr,rs,Ga=_({"src/attribute.ts"(){"use strict";var e,t,s,i,n,Di,l;z(),de(),Je(),Da(),oe(),q(),B(),qe(),hr=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,cr=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,gr=new Set(["ext","arg","magic-word","template"]),pr=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),rs=(l=class extends E{constructor(a,h,u,d="",g,c=[],p=k.getConfig(),w=[]){const v=new ge(u,"attr-key",p,w);let f;if(u==="title"||h==="img"&&u==="alt")f=new E(g,p,w,{}),f.type="attr-value",f.setAttribute("stage",be-1);else if(h==="gallery"&&u==="caption"||h==="choose"&&(u==="before"||u==="after")){const b=Ie(ce({},p),{excludes:[...p.excludes,"heading","html","table","hr","list"]});f=new E(g,b,w,{}),f.type="attr-value",f.setAttribute("stage",1)}else f=new ge(g,"attr-value",p,w,{});super(void 0,p,w);N(this,n);N(this,e);N(this,t);N(this,s);N(this,i);L(this,e,a),this.append(v,f),L(this,s,d),L(this,i,[...c]),L(this,t,h),this.setAttribute("name",ht(me(u)))}get type(){return m(this,e)}get tag(){return m(this,t)}get balanced(){return!m(this,s)||m(this,i)[0]===m(this,i)[1]}afterBuild(){m(this,s).includes("\0")&&L(this,s,this.buildFromStr(m(this,s),0)),this.parentNode&&L(this,t,this.parentNode.name),this.setAttribute("name",ht(this.firstChild.text())),super.afterBuild()}toString(a){const[h="",u=""]=m(this,i);return m(this,s)?super.toString(a,m(this,s)+h)+u:this.firstChild.toString(a)}text(){return m(this,s)?`${super.text(`${m(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var a,h;return m(this,s)?m(this,s).length+((h=(a=m(this,i)[0])==null?void 0:a.length)!=null?h:0):0}lint(a=this.getAbsoluteIndex(),h){var u;{const d=super.lint(a,h),{balanced:g,firstChild:c,lastChild:p,name:w,tag:v}=this,f=new ie(this,a),b=["unclosed-quote","obsolete-attr"],S=b.map(A=>k.lintConfig.getSeverity(A,w));if(S[0]&&!g){const A=O(p,f,b[0],k.msg("unclosed","quotes"),S[0]);A.startIndex--,A.startCol--,A.suggestions=[Oe(A.endIndex,m(this,i)[0])],d.push(A)}const y=j(this,n,Di).call(this,a,f);return y&&d.push(y),S[1]&&((u=Zl[v])!=null&&u.has(w))&&d.push(O(c,f,b[1],"obsolete-attribute",S[1])),d}}getValue(){return m(this,s)?this.lastChild.text().trim():this.type==="ext-attr"||""}escape(){}getAttribute(a){return a==="invalid"?j(this,n,Di).call(this):super.getAttribute(a)}print(){const[a="",h=""]=m(this,i);return m(this,s)?super.print({sep:Mt(m(this,s))+a,post:h}):super.print()}json(a,h=this.getAbsoluteIndex()){const u=super.json(void 0,h)}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n=new WeakSet,Di=function(a,h){const{firstChild:u,lastChild:d,type:g,name:c,tag:p,parentNode:w}=this,v=!d.childNodes.some(({type:T})=>gr.has(T)),f=this.getValue(),b=Yl[p],S=Kl[p],{length:y}=this.toString();let A="illegal-attr";if(!(b!=null&&b.has(c))&&!(S!=null&&S.has(c))&&(g==="ext-attr"?b||S:!/\{\{[^{]+\}\}/u.test(c))&&(g==="ext-attr"&&!S||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(c)&&(p==="meta"||p==="link"||!Xl.has(c)))||(c==="itemtype"||c==="itemid"||c==="itemref")&&!(w!=null&&w.hasAttr("itemscope"))){if(a===void 0)return!0;{const T=k.lintConfig.getSeverity(A,"unknown");if(T){const x=O(u,h,A,"illegal-attribute-name",T);return x.suggestions=[D(a,y)],x}}}else if(c==="style"&&typeof f=="string"&&hr.test(f)){if(a===void 0)return!0;{A="insecure-style";const T=k.lintConfig.getSeverity(A);return T&&O(d,h,A,"insecure-style",T)}}else if(c==="tabindex"&&typeof f=="string"&&f!=="0"){if(a===void 0)return!0;{const T=k.lintConfig.getSeverity(A,"tabindex");if(T){const x=O(d,h,A,"nonzero-tabindex",T);return x.suggestions=[D(a,y),ke(x,"0 tabindex","0")],x}}}else if(v&&g!=="ext-attr"){const T=Bl(p,c),x=String(f).toLowerCase();if(T.length>0&&T.every($=>$!==x)){if(a===void 0)return!0;{const $=k.lintConfig.getSeverity(A,"value");return $&&O(d,h,A,"illegal-attribute-value",$)}}}else if(typeof f=="string"&&((/^xmlns:[\w:.-]+$/u.test(c)||pr.has(c))&&cr.test(f)||v&&(c==="href"||p==="img"&&c==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(f))){if(a===void 0)return!0;{const T=k.lintConfig.getSeverity(A,"value");return T&&O(d,h,A,"illegal-attribute-value",T)}}return!1},l)}}),Ys,fr,mr,ws,cn=_({"src/attributes.ts"(){"use strict";var e,t,ls,i;z(),de(),oe(),q(),B(),qe(),Ga(),Ys=n=>n.slice(0,-1),fr=n=>`${Ys(n)}-dirty`,mr=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch(n){return/[^\W_]/u}})(),ws=(i=class extends E{constructor(r,l,o,a,h=[]){super(void 0,a,h,{});N(this,t);N(this,e);if(L(this,e,l),this.setAttribute("name",o),r){const u=/([^\s/](?:(?!\0\d+~\x7F)[^\s/=])*)(?:((?:\s(?:\s|\0\d+[cn]\x7F)*)?(?:=|\0\d+~\x7F)(?:\s|\0\d+[cn]\x7F)*)(?:(["'])([\s\S]*?)(\3|$)|(\S*)))?/gu;let d="",g=u.exec(r),c=0;const p=()=>{d&&(super.insertAt(new ge(d,fr(l),a,h,{})),d="")};for(;g;){const{index:w,0:v,1:f,2:b,3:S,4:y,5:A,6:T}=g;if(d+=r.slice(c,w),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(me(f).trim())){const x=y!=null?y:T,$=[S,A],I=new rs(Ys(l),o,f,b,x,$,a,h);p(),super.insertAt(I)}else d+=v;({lastIndex:c}=u),g=u.exec(r)}d+=r.slice(c),p()}}get type(){return m(this,e)}afterBuild(){const{parentNode:r}=this;r!=null&&r.is("td")&&this.setAttribute("name",r.subtype),super.afterBuild()}getAttrTokens(r){return this.childNodes.filter(l=>l instanceof rs&&(!r||l.name===ht(r)))}hasAttr(r){return this.getAttrTokens(r).length>0}getAttrToken(r){const l=this.getAttrTokens(r);return l[l.length-1]}getAttr(r){var l;return(l=this.getAttrToken(r))==null?void 0:l.getValue()}lint(r=this.getAbsoluteIndex(),l){{const o=super.lint(r,l),{parentNode:a,childNodes:h}=this,u=new Map,d=new Set,g=new ie(this,r),c=["no-ignored","no-duplicate"],p=["closingTag","invalidAttributes","nonWordAttributes"].map(v=>k.lintConfig.getSeverity(c[0],v));if(p[0]&&j(this,t,ls).call(this)){const v=J(this,g,c[0],"attributes-of-closing-tag",p[0]),f=a.getAbsoluteIndex();v.suggestions=[D(v),nn(f)],o.push(v)}for(const v of h)if(v instanceof rs){const{name:f}=v;u.has(f)?(d.add(f),u.get(f).push(v)):u.set(f,[v])}else{const f=v.text().trim(),b=p[mr.test(f)?1:2];if(f&&b){const S=O(v,g,c[0],"invalid-attribute",b);S.suggestions=[D(S,0," ")],o.push(S)}}const w=k.lintConfig.getSeverity(c[1],"attribute");if(w&&d.size>0)for(const v of d){const f=u.get(v).map(b=>{const S=b.getValue();return[b,S===!0?"":S]});o.push(...f.map(([b,S],y)=>{const A=O(b,g,c[1],k.msg("duplicate-attribute",v),w),T=D(A);return!S||f.slice(0,y).some(([,x])=>x===S)?A.fix=T:A.suggestions=[T],A}))}return o}}getAttribute(r){return r==="invalid"?j(this,t,ls).call(this):super.getAttribute(r)}print(){return this.toString()?`<span class="wpb-${this.type}${j(this,t,ls).call(this)?" wpb-invalid":""}">${this.childNodes.map(r=>r.print(r instanceof ge?{class:r.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,ls=function(){const{parentNode:r}=this;return(r==null?void 0:r.type)==="html"&&r.closing&&this.text().trim()!==""},i)}}),eo={};te(eo,{PreToken:()=>to});var to,Va=_({"src/pre.ts"(){"use strict";Je(),B(),We(),to=class extends E{get type(){return"ext-inner"}constructor(e,t,s=[]){if(e){const i=/<nowiki>/giu,n=/<\/nowiki>/giu,{length:r}=i.source;let l=i.exec(e);l&&(n.lastIndex=l.index+r);let o=n.exec(e),a=0,h="";for(;l&&o;)new ue(l[0],t,s),new ue(o[0],t,s),h+=`${e.slice(a,l.index)}\0${s.length-1}n${e.slice(l.index+r,o.index)}\0${s.length}n`,a=o.index+r+1,i.lastIndex=a,l=i.exec(e),l&&(n.lastIndex=l.index+r),o=n.exec(e);e=h+e.slice(a)}super(e,t,s,{}),this.setAttribute("stage",be-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),ys,gn=_({"mixin/multiLine.ts"(){"use strict";ys=e=>{class t extends e{toString(i){return super.toString(i,`
|
|
1
|
+
"use strict";(()=>{var Aa=Object.defineProperty,_a=Object.defineProperties;var $a=Object.getOwnPropertyDescriptors;var Jt=Object.getOwnPropertySymbols;var Fn=Object.prototype.hasOwnProperty,jn=Object.prototype.propertyIsEnumerable;var Pn=e=>{throw TypeError(e)};var js=(e,t,s)=>t in e?Aa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,me=(e,t)=>{for(var s in t||(t={}))Fn.call(t,s)&&js(e,s,t[s]);if(Jt)for(var s of Jt(t))jn.call(t,s)&&js(e,s,t[s]);return e},Le=(e,t)=>_a(e,$a(t));var Rn=(e,t)=>{var s={};for(var i in e)Fn.call(e,i)&&t.indexOf(i)<0&&(s[i]=e[i]);if(e!=null&&Jt)for(var i of Jt(e))t.indexOf(i)<0&&jn.call(e,i)&&(s[i]=e[i]);return s};var Ta=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ee=(e,t,s)=>js(e,typeof t!="symbol"?t+"":t,s),Ps=(e,t,s)=>t.has(e)||Pn("Cannot "+s);var f=(e,t,s)=>(Ps(e,t,"read from private field"),s?s.call(e):t.get(e)),N=(e,t,s)=>t.has(e)?Pn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),L=(e,t,s,i)=>(Ps(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),R=(e,t,s)=>(Ps(e,t,"access private method"),s);var On=(e,t,s,i)=>({set _(n){L(e,t,n,s)},get _(){return f(e,t,i)}});var Nu=Ta((Eu,ka)=>{var Ca=Object.create,xt=Object.defineProperty,Ll=Object.getOwnPropertyDescriptor,sn=Object.getOwnPropertyNames,Ia=Object.prototype.hasOwnProperty,El=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),vt=e=>{throw TypeError(e)},Fl=(e,t,s)=>t in e?xt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Bn=(e,t)=>xt(e,"name",{value:t,configurable:!0}),C=(e,t)=>function(){return e&&(t=(0,e[sn(e)[0]])(e=0)),t},jl=(e,t)=>function(){return t||(0,e[sn(e)[0]])((t={exports:{}}).exports,t),t.exports},se=(e,t)=>{for(var s in t)xt(e,s,{get:t[s],enumerable:!0})},Na=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of sn(t))!Ia.call(e,n)&&n!==s&&xt(e,n,{get:()=>t[n],enumerable:!(i=Ll(t,n))||i.enumerable});return e},Q=e=>Na(xt({},"__esModule",{value:!0}),e),K=e=>{var t;return[,,,Ca((t=e==null?void 0:e[El("metadata")])!=null?t:null)]},Pl=["class","method","getter","setter","accessor","field","value","get","set"],It=e=>e!==void 0&&typeof e!="function"?vt("Function expected"):e,La=(e,t,s,i,n)=>({kind:Pl[e],name:t,metadata:i,addInitializer:r=>s._?vt("Already initialized"):n.push(It(r||null))}),nn=(e,t)=>Fl(t,El("metadata"),e[3]),J=(e,t,s,i)=>{for(var n=0,r=e[t>>1],l=r&&r.length;n<l;n++)t&1?r[n].call(s):i=r[n].call(s,i);return i},X=(e,t,s,i,n,r)=>{var l,o,u,d,a,h=t&7,g=!!(t&8),c=!!(t&16),p=h>3?e.length+1:h?g?1:2:0,b=Pl[h+5],w=h>3&&(e[p-1]=[]),k=e[p]||(e[p]=[]),_=h&&(!c&&!g&&(n=n.prototype),h<5&&(h>3||!c)&&Ll(h<4?n:{get[s](){return he(this,r)},set[s](m){return ye(this,r,m)}},s));h?c&&h<4&&Bn(r,(h>2?"set ":h>1?"get ":"")+s):Bn(n,s);for(var v=i.length-1;v>=0;v--)d=La(h,s,u={},e[3],k),h&&(d.static=g,d.private=c,a=d.access={has:c?m=>Fa(n,m):m=>s in m},h^3&&(a.get=c?m=>(h^1?he:Ui)(m,n,h^4?r:_.get):m=>m[s]),h>2&&(a.set=c?(m,S)=>ye(m,n,S,h^4?r:_.set):(m,S)=>m[s]=S)),o=(0,i[v])(h?h<4?c?r:_[b]:h>4?void 0:{get:_.get,set:_.set}:n,d),u._=1,h^4||o===void 0?It(o)&&(h>4?w.unshift(o):h?c?r=o:_[b]=o:n=o):typeof o!="object"||o===null?vt("Object expected"):(It(l=o.get)&&(_.get=l),It(l=o.set)&&(_.set=l),It(l=o.init)&&w.unshift(l));return h||nn(e,n),_&&xt(n,s,_),c?h^4?r:_:n},Ea=(e,t,s)=>Fl(e,typeof t!="symbol"?t+"":t,s),rn=(e,t,s)=>t.has(e)||vt("Cannot "+s),Fa=(e,t)=>Object(t)!==t?vt('Cannot use the "in" operator on this value'):e.has(t),he=(e,t,s)=>(rn(e,t,"read from private field"),s?s.call(e):t.get(e)),Re=(e,t,s)=>t.has(e)?vt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),ye=(e,t,s,i)=>(rn(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),Ui=(e,t,s)=>(rn(e,t,"access private method"),s),ja=(e,t,s,i)=>({set _(n){ye(e,t,n,s)},get _(){return he(e,t,i)}}),Rl,fs,Ol=C({"base.ts"(){"use strict";Rl=(()=>{const e={redirect:1,onlyinclude:1,noinclude:1,include:1,comment:1,ext:1,arg:2,"magic-word":2,template:2,heading:2,html:3,table:4,hr:5,"double-underscore":5,link:6,category:6,file:6,quote:7,"ext-link":8,"free-ext-link":9,"magic-link":9,list:10,dd:10,converter:11,"list-range":11};return Object.setPrototypeOf(e,null),e})(),fs=(()=>{const e=["bold-header","format-leakage","fostered-content","h1","illegal-attr","insecure-style","invalid-gallery","invalid-imagemap","invalid-invoke","invalid-isbn","lonely-apos","lonely-bracket","lonely-http","nested-link","no-arg","no-duplicate","no-ignored","obsolete-attr","obsolete-tag","parsing-order","pipe-like","table-layout","tag-like","unbalanced-header","unclosed-comment","unclosed-quote","unclosed-table","unescaped","unknown-page","unmatched-tag","unterminated-url","url-encoding","var-anchor","void-ext"];return Object.freeze(e),e})()}});function Se(e,t,s){return s===1?e.replace(/\0(\d+)g\x7F/gu,(i,n)=>Se(String(t[n]),t,2)):s===2?e.replace(/\0(\d+)n\x7F/gu,(i,n)=>String(t[n])):e.replace(/\0(\d+)\x7F/gu,(i,n)=>t[n])}var Be,Rs,ct,gt,pt,st,Bl,be,Ke,qn,Wn,ms,ql,Mn,zn,Ut,ft,ge=C({"util/string.ts"(){"use strict";Be=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Rs=String.raw`[^[\]<>"\0-\x1F\x7F${Be}\uFFFD]`,ct=String.raw`(?:\[[\da-f:.]+\]|${Rs})`,gt=String.raw`(?:${Rs}|\0\d+[cn!~]\x7F)*`,pt=e=>e.trim().toLowerCase(),st=(e,t)=>s=>s.replace(e,t),Bl=st(/[\0\x7F]|\r$/gmu,""),be=st(/\0\d+[cn]\x7F/gu,""),Ke=(e,t="")=>e.map(s=>typeof s=="string"?s:s.text()).join(t),qn={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},Wn=st(/&(?:#(\d+|[Xx][\da-fA-F]+)|([lg]t|[LG]T|[lr]brac[ke]|nbsp|amp|AMP|quot|QUOT));/gu,(e,t,s)=>t?String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t)):qn[s.toLowerCase()]),ms=e=>Wn(e),ql=st(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),Mn={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},zn=e=>st(e,t=>`&${Mn[t]};`),Ut=zn(/[&<>]/gu),ft=(e,t={})=>{const{pre:s="",post:i="",sep:n=""}=t;return s+e.map(r=>r.print()).join(n)+i}}}),Pa=jl({"i18n/en.json"(e,t){t.exports={"attributes-of-closing-tag":"attributes of a closing tag","bold-apostrophes":"bold apostrophes","bold-in-header":"bold text in a section header",close:null,"closing-and-self-closing":"tag that is both closing and self-closing",comment:null,"conflicting-image-parameter":"conflicting image $1 parameter","content-outside-table":"content to be moved outside the table",decode:null,delink:null,"duplicate-attribute":"duplicate $1 attribute","duplicate-category":"duplicate category","duplicate-id":"duplicate HTML id","duplicate-image-parameter":"duplicate image $1 parameter","duplicate-parameter":"duplicate template parameter",encode:null,escape:null,expand:null,"ext-in-html":"extension tag in HTML tag attributes",frame:null,"full-width-punctuation":"full-width punctuation","header-in-html":"section header in HTML tag attributes","horizontal-alignment":null,"html-in-table":"HTML tag in table attributes","illegal-attribute-name":"invalid attribute name","illegal-attribute-value":"invalid attribute value","illegal-module":"invalid Scribunto module name","imagemap-without-image":"<imagemap> without an image","in-url":"$1 in URL","inconsistent-table":"inconsistent table layout","insecure-style":"insecure style","invalid-attribute":"element containing an invalid attribute name","invalid-content":"invalid content in <$1>","invalid-conversion-flag":"invalid conversion flag","invalid-gallery":"invalid gallery image","invalid-image-parameter":"invalid image parameter","invalid-imagemap-link":"invalid link in <imagemap>","invalid-isbn":"invalid ISBN","invalid-parameter":"invalid parameter of <$1>","invalid-self-closing":"invalid self-closing tag","invisible-triple-braces":"invisible content inside triple braces","italic-apostrophes":"italic apostrophes","left-bracket":"opening bracket","link-in-extlink":"internal link in an external link",lonely:'lonely "$1"',"missing-extension":"missing file extension","missing-function":"missing Scribunto module function name",newline:null,"no-self-closing":"no self-closing","nonzero-tabindex":"nonzero tabindex","nothing-in":"nothing should be in <$1>","obsolete-attribute":"obsolete attribute","obsolete-tag":"obsolete HTML tag",open:null,prefix:null,"pipe-in-link":'additional "|" in the link text',"pipe-in-table":'additional "|" in a table cell',remove:null,"template-in-link":"template in an internal link target","unbalanced-in-section-header":"unbalanced $1 in a section header",unclosed:"unclosed $1","unclosed-comment":"unclosed HTML comment","unclosed-quotes":"unclosed quotes","unclosed-table":"unclosed table","unclosed-tag":"unclosed tag","unescaped-query":"unescaped query string in an anonymous parameter","unexpected-argument":"unexpected template argument","unmatched-closing":"unmatched closing tag","unnecessary-encoding":"unnecessary percent-encoding in an internal link",uppercase:null,"useless-attribute":"useless attribute","useless-fragment":"useless fragment","useless-link-text":"useless link text","variable-anchor":"variable anchor in a section header","vertical-alignment":null,whitespace:null}}}),Ra=jl({"config/minimum.json"(e,t){t.exports={ext:[],html:[["b","bdi","del","i","ins","u","font","big","small","sub","sup","h1","h2","h3","h4","h5","h6","cite","code","em","s","strike","strong","tt","var","div","center","blockquote","ol","ul","dl","table","caption","pre","ruby","rb","rp","rt","rtc","p","span","abbr","dfn","kbd","samp","data","time","mark","tr","td","th","q","bdo"],["li","dt","dd"],["br","wbr","hr","meta","link"]],namespaces:{0:"",6:"File",10:"Template",14:"Category",828:"Module"},nsid:{"":0,file:6,template:10,category:14,module:828},functionHook:["msgnw"],variable:["!","=","pageid","articlepath","server","servername","scriptpath","stylepath"],parserFunction:[{msgnw:"msgnw",pageid:"pageid",articlepath:"articlepath",server:"server",servername:"servername",scriptpath:"scriptpath",stylepath:"stylepath","#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"formatdate","#dateformat":"formatdate","#invoke":"invoke","#while":"while","#dowhile":"dowhile","#loop":"loop","#forargs":"forargs","#fornumargs":"fornumargs","#if":"if","#ifeq":"ifeq","#switch":"switch","#ifexist":"ifexist","#ifexpr":"ifexpr","#iferror":"iferror","#time":"time","#timel":"timel","#expr":"expr","#rel2abs":"rel2abs","#titleparts":"titleparts","#categorytree":"categorytree","#urldecode":"urldecode","#choose":"choose","#var":"var","#varexists":"varexists","#var_final":"var_final","#vardefine":"vardefine","#vardefineecho":"vardefineecho","#widget":"widget","#related":"related","#regex":"regex","#regex_var":"regex_var","#regexquote":"regexquote","#regexall":"regexall","#len":"len","#pos":"pos","#rpos":"rpos","#sub":"sub","#count":"count","#rmatch":"rmatch","#rreplace":"rreplace","#replace":"replace","#rsplit":"rsplit","#explode":"explode","#tab":"tab","#seo":"seo","#babel":"babel","#translation":"translation","#commaseparatedlist":"commaseparatedlist","#coordinates":"coordinates","#lst":"lst","#lsth":"lsth","#lstx":"lstx","#assessment":"assessment","#mentor":"mentor","#property":"property","#target":"target","#section":"lst","#section-x":"lstx","#section-h":"lsth","#statements":"statements","#useliquidthreads":"useliquidthreads","#lqtpagelimit":"lqtpagelimit","#avatar":"avatar","#img":"img","#chart":"chart"},{"!":"!","=":"=","#FORMAL":"formal","#bcp47":"bcp47","#dir":"dir","#interwikilink":"interwikilink","#interlanguagelink":"interlanguagelink","#contentmodel":"contentmodel","#timef":"timef","#timefl":"timefl"},["msg","raw"],["subst","safesubst"]],doubleUnderscore:[[],[]],protocol:"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|matrix:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|wikipedia://|worldwind://|xmpp:",interwiki:[],img:{},redirection:["#redirect"],variants:[]}}}),we,Wl,Hi,We=C({"util/constants.ts"(){"use strict";we=11,Wl=Pa(),Hi=Ra()}});function ht(e){const t=new Map,s=new WeakMap;return i=>{const n=typeof i=="string"?t:s;if(n.has(i)){const l=n.get(i);return l.lastIndex=0,l}const r=e(i);return n.set(i,r),r}}var Ht,Ml,Ye=C({"../common/dist/index.mjs"(){"use strict";Ht=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25")),Ml=ht}}),le,de=C({"lib/rect.ts"(){"use strict";var e,t,s,i,Di,r;le=(r=class{constructor(l,o){N(this,i);N(this,e);N(this,t);N(this,s);L(this,e,l),L(this,t,o)}get start(){return f(this,t)}get top(){return R(this,i,Di).call(this).top}get left(){return R(this,i,Di).call(this).left}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakSet,Di=function(){var l;return(l=f(this,s))!=null||L(this,s,f(this,e).getRootNode().posFromIndex(f(this,t))),f(this,s)},r)}}),Un,Hn,zt,Gi,Os,B,G,$e,bs,U,ln,qe,on,an,un,Dt,mt,dn,Xe,zl,M=C({"util/lint.ts"(){"use strict";Ye(),Ne(),de(),W(),Un=new Set(["tr","td","th","caption"]),Hn=new Set(["Template:!!","Template:!-"]),zt=e=>{const t=e.childNodes.find(s=>s.text().trim());if(!t||t.type==="text"&&t.data.trim().startsWith("!")||t.is("magic-word")&&t.name==="!"||t.is("template")&&Hn.has(t.name)||t.is("html")&&Un.has(t.name))return!1;if(t.is("arg"))return t.length>1&&zt(t.childNodes[1]);if(t.is("magic-word"))try{const s=t.getPossibleValues().map(zt);return s.includes(2)?2:s.includes(1)&&1}catch(s){}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?1:2},Gi=(e,t,s,i)=>({line:e+s-1,character:(s===1?t:0)+i}),Os=e=>(t,s,i,n,r="error")=>{const{start:l}=s,{top:o,left:u}=s instanceof le?s:new le(t,l),{offsetHeight:d,offsetWidth:a}=t,{startIndex:h,startLine:g,startCol:c}=e(t,l,o,u),{line:p,character:b}=Gi(g,c,d,a);return{rule:i,message:I.msg(n),severity:r,startIndex:h,endIndex:h+t.toString().length,startLine:g,endLine:p,startCol:c,endCol:b}},B=Os((e,t,s,i)=>{const n=e.getRelativeIndex(),{top:r,left:l}=e.parentNode.posFromIndex(n);return{startIndex:t+n,startLine:s+r,startCol:r?l:i+l}}),G=Os((e,t,s,i)=>({startIndex:t,startLine:s,startCol:i})),$e=(e,t,s,i=0)=>({desc:I.msg(t),range:[e.startIndex+i,e.endIndex],text:s}),bs=(e,t,s)=>({desc:I.msg(t),range:[e,e],text:s}),U=(e,t=0,s="")=>typeof e=="number"?{desc:I.msg("remove"),range:[e,e+t],text:s}:$e(e,"remove",s,t),ln=(e,t)=>$e(e,"decode",Ht(t.text().replace(/%(?=21|3[ce]|5[bd]|7[b-d])/giu,"%25"))),qe=(e,t,s=0)=>({desc:I.msg("close"),range:[e+s,e],text:t}),on=e=>({desc:I.msg("open"),range:[e+1,e+2],text:""}),an=(e,t)=>$e(e,"comment",`<!--${t}-->`),un=(e,t)=>$e(e,"uppercase",t.toUpperCase()),Dt=(e,t=0)=>({desc:I.msg("whitespace"),range:[e,e+t],text:" "}),mt=(e,t,s=1)=>({desc:I.msg("escape"),range:[e,e+s],text:t.repeat(s)}),dn=(e,t)=>({desc:I.msg("escape"),range:[e,e+t.length],text:t.replace(/\|/gu,"|")}),Xe=(e,t,s,i)=>{if(e&&(i||I.viewOnly&&e[0]===ke.rev))return e[1];const n=t();return(i||I.viewOnly)&&s([ke.rev,n]),n},zl=(e,t)=>e==="ol"&&t==="type"?["1","a","A","i","I"]:e==="th"&&t==="scope"?["row","col","rowgroup","colgroup"]:t==="dir"?["ltr","rtl","auto"]:t==="aria-hidden"?["true","false"]:[]}}),Dn,hn,Ul=C({"parser/selector.ts"(){"use strict";Dn=(e,t,s)=>{if(e.includes("#")){const i=e.indexOf("#");return(i===0||e.slice(0,i)===t)&&e.slice(i+1)===s}return!e||e===t},hn=(e,t,s)=>{const i=e.split(",");return({type:n,name:r})=>i.some(l=>Dn(l.trim(),n,r))}}}),ws,cn=C({"mixin/cached.ts"(){"use strict";M(),ws=(e=!0)=>t=>{const s=new WeakMap;return function(...i){return Xe(s.get(this),()=>t.apply(this,i),n=>{s.set(this,n)},e)}}}}),Hl,Oa=C({"mixin/nodeLike.ts"(){"use strict";Hl=e=>{class t extends e{get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get offsetHeight(){return this.getDimension().height}get offsetWidth(){return this.getDimension().width}}return t}}}),Gn,Vn,Xt,yt,St,Kt,kt,At,_t,Qe,Dl=C({"lib/node.ts"(){"use strict";M(),Ne(),cn(),Oa(),W(),Vn=[Hl],Gn=[ws(!1)],Qe=class{constructor(){J(_t,5,this),Ea(this,"childNodes",[]),Re(this,Xt),Re(this,yt),Re(this,St),Re(this,Kt),Re(this,kt),Re(this,At,{})}get parentNode(){return he(this,Xt)}get nextSibling(){return he(this,yt)}get previousSibling(){return he(this,St)}getChildNodes(){const{childNodes:e}=this;return Object.isFrozen(e)?[...e]:e}getAttribute(e){return e==="padding"?0:this[e]}setAttribute(e,t){switch(e){case"parentNode":ye(this,Xt,t),t||(ye(this,yt,void 0),ye(this,St,void 0));break;case"nextSibling":ye(this,yt,t);break;case"previousSibling":ye(this,St,t);break;case"aIndex":I.viewOnly&&ye(this,kt,[ke.rev,t]);break;default:this[e]=t}}getRootNode(){return Xe(he(this,Kt),()=>{var e,t;return(t=(e=this.parentNode)==null?void 0:e.getRootNode())!=null?t:this},e=>{const[,t]=e;t.type==="root"&&ye(this,Kt,e)})}indexFromPos(e,t){this.lspError("AstNode.indexFromPos")}posFromIndex(e){const{length:t}=String(this);if(e+=e<0?t:0,e>=0&&e<=t){const s=this.getLines(),i=s.findIndex(([,,n])=>e<=n);return{top:i,left:e-s[i][1]}}}getDimension(){const e=this.getLines(),t=e[e.length-1];return{height:e.length,width:t[2]-t[1]}}getGaps(e){return 0}getRelativeIndex(e){if(e===void 0){const{parentNode:t}=this;return t?t.getRelativeIndex(t.childNodes.indexOf(this)):0}return Xe(he(this,At)[e],()=>{const{childNodes:t}=this,s=e+(e<0?t.length:0);let i=this.getAttribute("padding");for(let n=0;n<s;n++)I.viewOnly&&(he(this,At)[n]=[ke.rev,i]),i+=t[n].toString().length+this.getGaps(n);return i},t=>{he(this,At)[e]=t})}getAbsoluteIndex(){return Xe(he(this,kt),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{ye(this,kt,e)})}getBoundingClientRect(){this.lspError("AstNode.getBoundingClientRect")}is(e){return this.type===e}getLines(){const e=[];let t=0;for(const s of String(this).split(`
|
|
2
|
+
`)){const i=t+s.length;e.push([s,t,i]),t=i+1}return e}seal(e,t){const s=!t&&!!this[e];Object.defineProperty(this,e,{enumerable:s,configurable:!0})}lspError(e){throw new Error(`${e} method is only available in the LSP version!`)}},_t=K(null),Xt=new WeakMap,yt=new WeakMap,St=new WeakMap,Kt=new WeakMap,kt=new WeakMap,At=new WeakMap,X(_t,1,"getLines",Gn,Qe),Qe=X(_t,0,"AstNode",Vn,Qe),J(_t,1,Qe)}}),Gl,Ba=C({"mixin/elementLike.ts"(){"use strict";Ul(),Gl=e=>{var s,Vi;class t extends e{constructor(){super(...arguments);N(this,s)}getElementBy(l){for(const o of this.childNodes){if(o.type==="text")continue;if(l(o))return o;const u=o.getElementBy(l);if(u)return u}}querySelector(l){return this.getElementBy(R(this,s,Vi).call(this,l))}getElementsBy(l,o=[]){for(const u of this.childNodes)u.type!=="text"&&(l(u)&&o.push(u),u.getElementsBy(l,o));return o}querySelectorAll(l){return this.getElementsBy(R(this,s,Vi).call(this,l))}escape(){}}return s=new WeakSet,Vi=function(l){return hn(l,this)},t}}}),Qn,Bs,Jn,Nt,qa=C({"lib/element.ts"(){"use strict";ge(),Ne(),Ul(),Dl(),Ba(),Qn=[Gl],Nt=class extends(Jn=Qe){get length(){return this.childNodes.length}text(e){return Ke(this.childNodes,e)}normalize(){const e=this.getChildNodes(),t=s=>{var i,n;e.splice(s,1),(i=e[s-1])==null||i.setAttribute("nextSibling",e[s]),(n=e[s])==null||n.setAttribute("previousSibling",e[s-1])};for(let s=e.length-1;s>=0;s--){const{type:i,data:n}=e[s];i!=="text"||e.length===1||this.getGaps(s-(s&&1))||n===""&&t(s)}this.setAttribute("childNodes",e)}removeAt(e){this.lspError("AstElement.removeAt")}insertAt(e,t=this.length){return Tn(this,t,0,[e]),e}closest(e){const t=hn(e,this);let{parentNode:s}=this;for(;s;){if(t(s))return s;({parentNode:s}=s)}}append(...e){this.safeAppend(e)}safeAppend(e){for(const t of e)this.insertAt(t)}safeReplaceChildren(e){}setText(e,t=0){t+=t<0?this.length:0;const s=this.childNodes[t],{data:i}=s;return s.replaceData(e),i}toString(e,t=""){return this.childNodes.map(s=>s.toString(e)).join(t)}caretPositionFromIndex(e){this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(e){this.lspError("AstElement.elementFromIndex")}elementFromPoint(e,t){this.lspError("AstElement.elementFromPoint")}lint(e=this.getAbsoluteIndex(),t){{const s=[];for(let i=0,n=e+this.getAttribute("padding");i<this.length;i++){const r=this.childNodes[i];r.setAttribute("aIndex",n);const l=r.lint(n,t);l.length>0&&s.push(...l),n+=r.toString().length+this.getGaps(i)}return s}}print(e={}){const t=e.class;return this.toString()?(t===""?"":`<span class="wpb-${t!=null?t:this.type}${this.getAttribute("invalid")?" wpb-invalid":""}">`)+ft(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){this.lspError("AstElement.json")}},Bs=K(Jn),Nt=X(Bs,0,"AstElement",Qn,Nt),J(Bs,1,Nt)}}),Yt,qs,Ws,Xn,Kn,Yn,Zn,Ms,er,Qi,Wa=C({"lib/text.ts"(){"use strict";var e,Vl,s;ge(),M(),W(),Dl(),Yt=String.raw`[${Be}\t]*`,qs=String.raw`[^\S\n]*`,Ws=String.raw`<${qs}(?:/${qs})?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${Yt}\d)|isbn(?=[-::]?${Yt}(?:\d(?:${Yt}|-)){6})`,Xn=new RegExp(String.raw`${Ws}|https?[:/]/+`,"giu"),Kn=new RegExp(Ws,"giu"),Yn=new Set(["attr-value","ext-link-text","link-text"]),Zn={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},Ms=new Set(["html","head","style","title","body","a","audio","img","video","embed","iframe","object","canvas","script","col","colgroup","tbody","tfoot","thead","button","input","label","option","select","textarea"]),er=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch(i){return/\w/u}})(),Qi=(s=class extends Qe{constructor(n){super();N(this,e);Ee(this,"data","");this.data=n}get type(){return"text"}toString(n){var r;return n&&!((r=this.parentNode)!=null&&r.getAttribute("built"))?be(this.data):this.data}text(){return this.data}lint(n=this.getAbsoluteIndex(),r){var l,o,u;{if(r===!1)return[];const{data:d,parentNode:a,nextSibling:h,previousSibling:g}=this;if(!a)throw new Error("An isolated text node cannot be linted!");const{type:c,name:p,parentNode:b}=a;if(c==="attr-value"){const{name:O,tag:re}=b;if(re==="ref"&&(O==="name"||O==="follow")||O==="group"&&(re==="ref"||re==="references")||re==="choose"&&(O==="before"||O==="after"))return[]}if(r!=null||(r=c==="free-ext-link"||c==="ext-link-url"||c==="ext-link-text"||c==="image-parameter"&&p==="link"||c==="attr-value"?Kn:Xn),d.search(r)===-1)return[];r.lastIndex=0;const w=[],k=h==null?void 0:h.type,_=h==null?void 0:h.name,v=g==null?void 0:g.type,m=this.getRootNode(),S=m.toString(),{ext:A,html:x,variants:y}=m.getAttribute("config"),{top:T,left:$}=m.posFromIndex(n),{lintConfig:E}=I,F=E.rules["tag-like"],P=typeof F=="object"&&F[1]?new Set(Object.keys(F[1]).filter(O=>O!=="invalid"&&O!=="disallowed")):new Set,ne=new Set(["onlyinclude","noinclude","includeonly",...A,...x[0],...x[1],...x[2],...P,...E.getSeverity("tag-like","disallowed")?Ms:[]]);for(let O=r.exec(d);O;O=r.exec(d)){const[,re,fe]=O;let{index:V,0:D}=O;if(fe&&fe!=="]"){const{length:pe}=fe;V+=pe,D=D.slice(pe)}D=D.toLowerCase();const[Y]=D,z=Y==="r"||Y==="p"||Y==="i",Z=Y==="{",H=Y==="}",ee=Y==="[",oe=Y==="]";let{length:ae}=D;if(Y==="<"&&!ne.has(re.toLowerCase())||ee&&c==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(d.slice(V+1))||h!=null&&h.is("ext")&&_==="nowiki"&&((l=h.innerText)!=null&&l.includes("]")))||z&&(!a.isPlain()||Yn.has(c)))continue;oe&&(V||ae>1)&&r.lastIndex--;let te=n+V,He=te+ae,ue,ve;const Ce=S[He],Is=S[te-1],Ns=Z||ee,Ls=Z&&Is==="-"&&y.length>0,Es=H&&Ce==="-"&&y.length>0,Cn=ee&&k==="free-ext-link"&&!d.slice(V+1).trim()||oe&&v==="free-ext-link"&&!d.slice(0,V).includes("]");if(z)ue="lonely-http",D=D.toUpperCase(),ve=E.getSeverity(ue,D);else if(Y==="<"){ue="tag-like";let pe;/^<\/?\s/u.test(D)||!/[\s/>]/u.test(Ce!=null?Ce:"")?pe="invalid":P.has(re)?pe=re:Ms.has(re)&&!A.includes(re)&&(pe="disallowed"),ve=E.getSeverity(ue,pe)}else if(Ls||Es)ue="lonely-bracket",ve=E.getSeverity(ue,"converter"),Ls&&V>0?(D="-{",V--,te--,ae=2):Es&&V<d.length-1&&(D="}-",He++,ae=2);else if(Cn)ue="lonely-bracket",ve=E.getSeverity(ue,"extLink");else if(Ns||H||oe)if(ue="lonely-bracket",ae>1||Z&&Ce===Y||H&&Is===Y)ve=E.getSeverity(ue,"double");else{if(!ee||c!=="ext-link-text"){const pe=Zn[Y],Fs=Ns?d.slice(V+1):d.slice(0,V);if(Z&&((o=pe.exec(Fs))==null?void 0:o[0])==="}"||H&&((u=pe.exec(Fs))==null?void 0:u[0])==="{")continue;if(!Fs.includes(Y)){const En=Ns?"nextSibling":"previousSibling";let Ge=this[En];for(;Ge&&(Ge.type!=="text"||!pe.test(Ge.data));)Ge=Ge[En];if(Ge&&pe.exec(Ge.data)[0]!==Y)continue}}ve=E.getSeverity(ue,"single")}else ue="lonely-http",ve=E.getSeverity(ue);if(!ve)continue;const In=this.posFromIndex(V),{line:Nn,character:Ln}=Gi(T,$,In.top+1,In.left),De={rule:ue,message:I.msg("lonely",z||Y==="h"||Ls||Es?D:Y),severity:ve,startIndex:te,endIndex:He,startLine:Nn,endLine:Nn,startCol:Ln,endCol:Ln+ae};if(E.computeEditInfo)if(Y==="<")De.suggestions=[mt(te,"<")];else if(Y==="h"&&c!=="link-text"&&er.test(Is||""))De.suggestions=[Dt(te)];else if(ee&&c==="ext-link-text"){const pe=a.getAbsoluteIndex()+a.toString().length;De.suggestions=[mt(pe,"]")]}else if(oe&&Cn){const pe=n-g.toString().length;De.suggestions=[bs(pe,"left-bracket","[")]}else z&&(De.suggestions=[...O[0]===D?[]:[un(De,D)],...Ce===":"||Ce===":"?[Dt(He,1)]:[]]);w.push(De)}return w}}replaceData(n){R(this,e,Vl).call(this,n)}splitText(n){this.lspError("AstText.splitText")}escape(){}print(){return Ut(this.data)}},e=new WeakSet,Vl=function(n){this.setAttribute("data",n)},s)}}),Ze,bt=C({"mixin/hidden.ts"(){"use strict";Ze=(e=!0,t=!0)=>s=>{class i extends s{text(){return""}lint(r){return e?[]:super.lint(r)}}return i}}}),Ie,Fe=C({"mixin/noEscape.ts"(){"use strict";Ie=e=>{}}}),et,wt=C({"src/syntax.ts"(){"use strict";var e,t;q(),et=(t=class extends j{constructor(i,n,r,l,o){super(i,r,l,o);N(this,e);L(this,e,n)}get type(){return f(this,e)}lint(i=this.getAbsoluteIndex()){return super.lint(i,!1)}},e=new WeakMap,t)}}),je,Me=C({"mixin/padded.ts"(){"use strict";je=({length:e})=>t=>{class s extends t{getAttribute(n){return n==="padding"?e:super.getAttribute(n)}}return s}}}),xe,ze=C({"src/atom.ts"(){"use strict";var e,t;q(),xe=(t=class extends j{constructor(i,n,r,l,o){super(i,r,l,o);N(this,e);L(this,e,n)}get type(){return f(this,e)}set type(i){L(this,e,i)}getAttribute(i){var n;return i==="invalid"?this.type==="converter-flag"&&!!((n=this.parentNode)!=null&&n.isInvalidFlag(this)):super.getAttribute(i)}},e=new WeakMap,t)}}),tr,sr,zs,ir,Oe,ys=C({"src/link/base.ts"(){"use strict";var e,t,s,i;M(),We(),de(),Me(),Fe(),W(),q(),ze(),tr=n=>n==="redirect-target"||n==="link",sr=[Ie,je("[[")],Oe=(i=class extends(ir=j){constructor(r,l,o,u=[],d="|"){super(void 0,o,u,{});N(this,e,!0);N(this,t);N(this,s);if(this.insertAt(new xe(r,"link-target",o,u,{})),l!==void 0){const a=new j(l,o,u,{});a.type="link-text",a.setAttribute("stage",we-1),this.insertAt(a)}L(this,t,d)}get link(){}get fragment(){}afterBuild(){L(this,s,this.getTitle()),f(this,t).includes("\0")&&L(this,t,this.buildFromStr(f(this,t),0)),this.setAttribute("name",f(this,s).title),super.afterBuild()}setAttribute(r,l){r==="bracket"?L(this,e,l):r==="title"?L(this,s,l):super.setAttribute(r,l)}toString(r){const l=super.toString(r,f(this,t));return f(this,e)?`[[${l}]]`:l}text(){const r=super.text("|");return f(this,e)?`[[${r}]]`:r}getAttribute(r){return r==="title"?f(this,s):super.getAttribute(r)}getGaps(r){return r===0?f(this,t).length:1}lint(r=this.getAbsoluteIndex(),l){{const o=super.lint(r,l),{childNodes:[u,d],type:a}=this,{encoded:h,fragment:g}=f(this,s),{lintConfig:c}=I,{computeEditInfo:p,fix:b}=c,w=new le(this,r);let k="unknown-page",_=c.getSeverity(k);if(_&&u.childNodes.some(({type:v})=>v==="template")&&o.push(B(u,w,k,"template-in-link",_)),k="url-encoding",_=c.getSeverity(k),_&&h){const v=B(u,w,k,"unnecessary-encoding",_);(p||b)&&(v.fix=ln(v,u)),o.push(v)}if(k="pipe-like",_=c.getSeverity(k,"link"),_&&(a==="link"||a==="category")){const v=d==null?void 0:d.childNodes.findIndex(S=>S.type==="text"&&S.data.includes("|")),m=d==null?void 0:d.childNodes[v];if(m){const S=B(d,w,k,"pipe-in-link",_);if(p){const A=S.startIndex+d.getRelativeIndex(v);S.suggestions=[dn(A,m.data)]}o.push(S)}}if(k="no-ignored",_=c.getSeverity(k,"fragment"),_&&g!==void 0&&!tr(a)){const v=B(u,w,k,"useless-fragment",_);if(p||b){const m=u.childNodes.findIndex(A=>A.type==="text"&&A.data.includes("#")),S=u.childNodes[m];S&&(v.fix=U(v,u.getRelativeIndex(m)+S.data.indexOf("#")))}o.push(v)}return o}}getTitle(r,l){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:l,temporary:r,decode:!0,selfLink:!0})}print(){return super.print(f(this,e)?{pre:"[[",post:"]]",sep:f(this,t)}:{sep:f(this,t)})}json(r,l=this.getAbsoluteIndex()){const o=super.json(void 0,l)}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i),zs=K(ir),Oe=X(zs,0,"LinkBaseToken",sr,Oe),J(zs,1,Oe)}}),nr,Us,rr,Te,tt=C({"src/nowiki/base.ts"(){"use strict";Fe(),q(),nr=[Ie],Te=class extends(rr=j){get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}},Us=K(rr),Te=X(Us,0,"NowikiBaseToken",nr,Te),J(Us,1,Te)}}),lr,Hs,or,ce,Ue=C({"src/nowiki/noinclude.ts"(){"use strict";bt(),tt(),lr=[Ze()],ce=class extends(or=Te){get type(){return"noinclude"}toString(e){return e?"":super.toString()}},Hs=K(or),ce=X(Hs,0,"NoincludeToken",lr,ce),J(Hs,1,ce)}}),Ql,Ma=C({"src/link/redirectTarget.ts"(){"use strict";M(),W(),ys(),Ue(),Ql=class extends Oe{get type(){return"redirect-target"}constructor(e,t,s,i){super(e,void 0,s,i),t!==void 0&&this.insertAt(new ce(t,s,i))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,{halfParsed:!0,decode:!0})}lint(e=this.getAbsoluteIndex()){{const t=super.lint(e,!1),s="no-ignored",{lintConfig:i}=I,n=i.getSeverity(s,"redirect");if(n&&this.length===2){const r=B(this.lastChild,{start:e},s,"useless-link-text",n);r.startIndex--,r.startCol--,(i.computeEditInfo||i.fix)&&(r.fix=U(r)),t.push(r)}return t}}}}}),ar,Ds,ur,Lt,za=C({"src/redirect.ts"(){"use strict";var e,t,s;bt(),Fe(),q(),wt(),Ma(),ar=[Ze(!1,!1),Ie],Lt=(s=class extends(ur=j){constructor(n,r,l,o,u,d,a=[]){super(void 0,d,a);N(this,e);N(this,t);L(this,e,n),L(this,t,u),this.append(new et(r,"redirect-syntax",d,a),new Ql(l,o==null?void 0:o.slice(1),d,a))}get type(){return"redirect"}getAttribute(n){return n==="padding"?f(this,e).length:super.getAttribute(n)}toString(n){return f(this,e)+super.toString(n)+f(this,t)}lint(n=this.getAbsoluteIndex()){{const r=n+f(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",r),this.lastChild.lint(r)}}print(){return super.print({pre:f(this,e),post:f(this,t)})}},e=new WeakMap,t=new WeakMap,s),Ds=K(ur),Lt=X(Ds,0,"RedirectToken",ar,Lt),J(Ds,1,Lt)}}),Jl={};se(Jl,{parseRedirect:()=>Xl});var Xl,Ua=C({"parser/redirect.ts"(){"use strict";W(),za(),Xl=(e,t,s)=>{var n;(n=t.regexRedirect)!=null||(t.regexRedirect=new RegExp(String.raw`^(\s*)((?:${t.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));const i=t.regexRedirect.exec(e);return i&&I.normalizeTitle(i[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0}).valid?(e=`\0${s.length}o${e.slice(i[0].length)}`,new Lt(...i.slice(1),t,s),e):!1}}}),dr,Gs,hr,Et,Ha=C({"src/onlyinclude.ts"(){"use strict";Me(),Fe(),q(),dr=[Ie,je("<onlyinclude>")],Et=class extends(hr=j){get type(){return"onlyinclude"}toString(e){return`<onlyinclude>${super.toString(e)}</onlyinclude>`}isPlain(){return!0}print(){return super.print({pre:'<span class="wpb-ext"><onlyinclude></span>',post:'<span class="wpb-ext"></onlyinclude></span>'})}},Gs=K(hr),Et=X(Gs,0,"OnlyincludeToken",dr,Et),J(Gs,1,Et)}}),Vt,Ss=C({"mixin/gapped.ts"(){"use strict";Vt=(e=1)=>t=>{class s extends t{getGaps(){return e}}return s}}}),cr,Vs,gr,Je,gn=C({"src/tagPair/index.ts"(){"use strict";var e,t;Ss(),Fe(),q(),cr=[Vt(),Ie],Je=(t=class extends(gr=j){constructor(i,n,r,l,o,u=[]){super(void 0,o);N(this,e);Ee(this,"closed");Ee(this,"selfClosing");this.setAttribute("name",i.toLowerCase()),L(this,e,[i,l||i]),this.closed=l!=="",this.selfClosing=l===void 0,this.append(n,r);const d=typeof n=="string"?-1:u.indexOf(n);u.splice(d===-1?1/0:d,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(i){const{selfClosing:n,firstChild:r,lastChild:l}=this,[o,u]=f(this,e);return n?`<${o}${r.toString(i)}/>`:`<${o}${r.toString(i)}>${l.toString(i)}${this.closed?`</${u}>`:""}`}text(){const[i,n]=f(this,e);return this.selfClosing?`<${i}${this.firstChild.text()}/>`:`<${i}${super.text(">")}${this.closed?`</${n}>`:""}`}getAttribute(i){return i==="padding"?f(this,e)[0].length+1:super.getAttribute(i)}print(){const[i,n]=f(this,e);return super.print(this.selfClosing?{pre:`<${i}`,post:"/>"}:{pre:`<${i}`,sep:">",post:this.closed?`</${n}>`:""})}},e=new WeakMap,t),Vs=K(gr),Je=X(Vs,0,"TagPairToken",cr,Je),J(Vs,1,Je)}}),Kl,Da=C({"src/tagPair/translate.ts"(){"use strict";var e,Yl,s;q(),gn(),wt(),Ue(),Kl=(s=class extends Je{constructor(n,r,l,o=[]){const u=new et(n,"translate-attr",l,o);r=r==null?void 0:r.replace(/(<tvar\|[^>]+>)([\s\S]*?)(<\/>)/gu,(a,h,g,c)=>(new ce(h,l,o),new ce(c,l,o),`\0${o.length-1}n${g}\0${o.length}n`)).replace(/(<tvar\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\2|[^"'\s>]+))?\s*>)([\s\S]*?)(<\/tvar\s*>)/giu,(a,h,g,c,p)=>(new ce(h,l,o),new ce(p,l,o),`\0${o.length-1}n${c}\0${o.length}n`));const d=new j(r,l,o);d.type="translate-inner";super("translate",u,d,"translate",l,o);N(this,e);this.seal("closed",!0),this.seal("selfClosing",!0)}get type(){return"translate"}toString(n){return n?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){return`<span class="wpb-ext"><translate${R(this,e,Yl).call(this)?'<span class="wpb-ext-attrs"> <span class="wpb-ext-attr"><span class="wpb-attr-key">nowrap</span></span></span>':""}>${this.lastChild.print({class:"ext-inner"})}</translate></span>`}},e=new WeakSet,Yl=function(){return this.firstChild.toString()===" nowrap"},s)}}),pr,Qs,fr,Ft,Ga=C({"src/tagPair/include.ts"(){"use strict";M(),de(),bt(),W(),gn(),pr=[Ze(!1)],Ft=class extends(fr=Je){get type(){return"include"}constructor(e,t="",s,i,n,r){super(e,t,s!=null?s:"",s===void 0||i!=null?i:"",n,r)}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){{const t=[],{firstChild:s,closed:i,name:n}=this,r=new le(this,e),l=["no-ignored","unclosed-comment"],{lintConfig:o}=I,{computeEditInfo:u}=o,d=l.map(a=>o.getSeverity(a,"include"));if(d[0]&&s.data.trim()){const a=B(s,r,l[0],"useless-attribute",d[0]);u&&(a.suggestions=[U(a)]),t.push(a)}if(d[1]&&!i){const a=G(this,r,l[1],I.msg("unclosed",`<${n}>`),d[1]);u&&(a.suggestions=[qe(a.endIndex,`</${n}>`)]),t.push(a)}return t}}},Qs=K(fr),Ft=X(Qs,0,"IncludeToken",pr,Ft),J(Qs,1,Ft)}}),ks,pn=C({"mixin/attributesParent.ts"(){"use strict";ks=(e=0)=>t=>{var i,Zl;class s extends t{constructor(){super(...arguments);N(this,i)}hasAttr(o){this.lspError("AttributesParent.hasAttr")}getAttr(o){return R(this,i,Zl).call(this).getAttr(o)}}return i=new WeakSet,Zl=function(){return this.childNodes[e]},s}}}),ie,Js,Xs,$t,Zt,Ks,Ve,Ys,Zs,ei,es,ti,Ae,eo,to,so,io,Va=C({"util/sharable.ts"(){"use strict";ie=new Set(["align"]),Js=new Set(["cite"]),Xs=new Set(["cite","datetime"]),$t=new Set(["width"]),Zt=new Set(["axis","align","bgcolor","height","width","valign"]),Ks=new Set([...Zt,"abbr","headers","scope","rowspan","colspan"]),Ve=new Set(["type"]),Ys=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),Zs=new Set(["clear"]),ei=new Set(["bgcolor","align","valign"]),es=new Set(["qid","forcemathmode","type","display"]),ti=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),Ae=new Set,eo=new Set(["id","class","style","lang","dir","title","tabindex","aria-describedby","aria-flowto","aria-hidden","aria-label","aria-labelledby","aria-level","aria-owns","role","about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),to={div:ie,h1:ie,h2:ie,h3:ie,h4:ie,h5:ie,h6:ie,blockquote:Js,q:Js,p:ie,br:Zs,pre:$t,ins:Xs,del:Xs,ul:Ve,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...Ys,"border"]),caption:ie,tr:ei,td:Ks,th:Ks,font:new Set(["size","color","face"]),hr:$t,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Ve,poem:ie,categorytree:ie,combooption:ie,math:Ae,chem:Ae,ce:Ae,img:new Set(["alt","src","width","height","loading","srcset"])},so={gallery:new Set(["mode","showfilename","caption","perrow","widths","heights","showthumbnails"]),poem:new Set(["compact"]),categorytree:new Set(["hideroot","onlyroot","depth","mode","hideprefix","namespaces","showcount","notranslations"]),combooption:new Set(["name","for","inline"]),nowiki:Ae,indicator:new Set(["name"]),langconvert:new Set(["from","to"]),ref:new Set(["group","name","follow","dir","details"]),references:new Set(["group","responsive"]),charinsert:new Set(["label"]),choose:new Set(["uncached","before","after"]),option:new Set(["weight"]),imagemap:Ae,inputbox:Ae,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:Ae,poll:new Set(["id","show-results-before-voting"]),sm2:Ve,flashmp3:Ve,score:new Set(["line_width_inches","lang","override_midi","raw","note-language","override_audio","override_ogg","sound","vorbis"]),seo:new Set(["title","title_mode","title_separator","keywords","description","robots","google_bot","image","image_width","image_height","image_alt","type","site_name","locale","section","author","published_time","twitter_site"]),tab:new Set(["nested","name","index","class","block","inline","openname","closename","collapsed","dropdown","style","bgcolor","container","id","title"]),tabs:new Set(["plain","class","container","id","title","style"]),combobox:new Set(["placeholder","value","id","class","text","dropdown","style"]),math:new Set([...es,"chem"]),chem:es,ce:es,hiero:Ae,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:ti,syntaxhighlight:ti,templatedata:Ae,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:Ae},io={table:Ys,td:new Set([...Zt,"scope"]),th:Zt,br:Zs,caption:ie,div:ie,hr:$t,h1:ie,h2:ie,h3:ie,h4:ie,h5:ie,h6:ie,li:Ve,p:ie,pre:$t,tr:ei,ul:Ve}}}),mr,xr,vr,br,as,Qa=C({"src/attribute.ts"(){"use strict";var e,t,s,i,n,Ji,l;M(),ge(),We(),Va(),de(),W(),q(),ze(),mr=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,xr=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,vr=new Set(["ext","arg","magic-word","template"]),br=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),as=(l=class extends j{constructor(u,d,a,h="",g,c=[],p=I.getConfig(),b=[]){const w=new xe(a,"attr-key",p,b);let k;if(a==="title"||d==="img"&&a==="alt")k=new j(g,p,b,{}),k.type="attr-value",k.setAttribute("stage",we-1);else if(d==="gallery"&&a==="caption"||d==="choose"&&(a==="before"||a==="after")){const _=Le(me({},p),{excludes:[...p.excludes,"heading","html","table","hr","list"]});k=new j(g,_,b,{}),k.type="attr-value",k.setAttribute("stage",1)}else k=new xe(g,"attr-value",p,b,{});super(void 0,p,b);N(this,n);N(this,e);N(this,t);N(this,s);N(this,i);L(this,e,u),this.append(w,k),L(this,s,h),L(this,i,[...c]),L(this,t,d),this.setAttribute("name",pt(be(a)))}get type(){return f(this,e)}get tag(){return f(this,t)}get balanced(){return!f(this,s)||f(this,i)[0]===f(this,i)[1]}afterBuild(){f(this,s).includes("\0")&&L(this,s,this.buildFromStr(f(this,s),0)),this.parentNode&&L(this,t,this.parentNode.name),this.setAttribute("name",pt(this.firstChild.text())),super.afterBuild()}toString(u){const[d="",a=""]=f(this,i);return f(this,s)?super.toString(u,f(this,s)+d)+a:this.firstChild.toString(u)}text(){return f(this,s)?`${super.text(`${f(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var u,d;return f(this,s)?f(this,s).length+((d=(u=f(this,i)[0])==null?void 0:u.length)!=null?d:0):0}lint(u=this.getAbsoluteIndex(),d){var a;{const h=super.lint(u,d),{balanced:g,firstChild:c,lastChild:p,name:b,tag:w}=this,k=new le(this,u),_=["unclosed-quote","obsolete-attr"],{lintConfig:v}=I,m=_.map(A=>v.getSeverity(A,b));if(m[0]&&!g){const A=B(p,k,_[0],"unclosed-quotes",m[0]);A.startIndex--,A.startCol--,v.computeEditInfo&&(A.suggestions=[qe(A.endIndex,f(this,i)[0])]),h.push(A)}const S=R(this,n,Ji).call(this,u,k);return S&&h.push(S),m[1]&&((a=io[w])!=null&&a.has(b))&&h.push(B(c,k,_[1],"obsolete-attribute",m[1])),h}}getValue(){return f(this,s)?this.lastChild.text().trim():this.type==="ext-attr"||""}escape(){}getAttribute(u){return u==="invalid"?R(this,n,Ji).call(this):super.getAttribute(u)}print(){const[u="",d=""]=f(this,i);return f(this,s)?super.print({sep:Ut(f(this,s))+u,post:d}):super.print()}json(u,d=this.getAbsoluteIndex()){const a=super.json(void 0,d)}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n=new WeakSet,Ji=function(u,d){const{firstChild:a,lastChild:h,type:g,name:c,tag:p,parentNode:b}=this,w=!h.childNodes.some(({type:y})=>vr.has(y)),k=this.getValue(),_=so[p],v=to[p],{length:m}=this.toString();let S="illegal-attr",A,x;if({lintConfig:A}=I,{computeEditInfo:x}=A,!(_!=null&&_.has(c))&&!(v!=null&&v.has(c))&&(g==="ext-attr"?_||v:!/\{\{[^{]+\}\}/u.test(c))&&(g==="ext-attr"&&!v||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(c)&&(p==="meta"||p==="link"||!eo.has(c)))||(c==="itemtype"||c==="itemid"||c==="itemref")&&!(b!=null&&b.hasAttr("itemscope"))){if(u===void 0)return!0;{const y=A.getSeverity(S,"unknown");if(y){const T=B(a,d,S,"illegal-attribute-name",y);return x&&(T.suggestions=[U(u,m)]),T}}}else if(c==="style"&&typeof k=="string"&&mr.test(k)){if(u===void 0)return!0;{S="insecure-style";const y=A.getSeverity(S);return y&&B(h,d,S,"insecure-style",y)}}else if(c==="tabindex"&&typeof k=="string"&&k!=="0"){if(u===void 0)return!0;{const y=A.getSeverity(S,"tabindex");if(y){const T=B(h,d,S,"nonzero-tabindex",y);return x&&(T.suggestions=[U(u,m),$e(T,"0 tabindex","0")]),T}}}else if(typeof k=="string"&&((/^xmlns:[\w:.-]+$/u.test(c)||br.has(c))&&xr.test(k)||w&&(c==="href"||p==="img"&&c==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(k))){if(u===void 0)return!0;{const y=A.getSeverity(S,"value");return y&&B(h,d,S,"illegal-attribute-value",y)}}else if(w&&g!=="ext-attr"){const y=zl(p,c),T=String(k).toLowerCase();if(y.length>0&&y.every($=>$!==T)){if(u===void 0)return!0;{const $=A.getSeverity(S,"value");return $&&B(h,d,S,"illegal-attribute-value",$)}}}return!1},l)}}),si,wr,yr,As,fn=C({"src/attributes.ts"(){"use strict";var e,t,us,i;M(),ge(),de(),W(),q(),ze(),Qa(),si=n=>n.slice(0,-1),wr=n=>`${si(n)}-dirty`,yr=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch(n){return/[^\W_]/u}})(),As=(i=class extends j{constructor(r,l,o,u,d=[]){super(void 0,u,d,{});N(this,t);N(this,e);if(L(this,e,l),this.setAttribute("name",o),r){const a=/([^\s/](?:(?!\0\d+~\x7F)[^\s/=])*)(?:((?:\s(?:\s|\0\d+[cn]\x7F)*)?(?:=|\0\d+~\x7F)(?:\s|\0\d+[cn]\x7F)*)(?:(["'])([\s\S]*?)(\3|$)|(\S*)))?/gu;let h="",g=a.exec(r),c=0;const p=()=>{h&&(super.insertAt(new xe(h,wr(l),u,d,{})),h="")};for(;g;){const{index:b,0:w,1:k,2:_,3:v,4:m,5:S,6:A}=g;if(h+=r.slice(c,b),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(be(k).trim())){const x=m!=null?m:A,y=[v,S],T=new as(si(l),o,k,_,x,y,u,d);p(),super.insertAt(T)}else h+=w;({lastIndex:c}=a),g=a.exec(r)}h+=r.slice(c),p()}}get type(){return f(this,e)}afterBuild(){const{parentNode:r}=this;r!=null&&r.is("td")&&this.setAttribute("name",r.subtype),super.afterBuild()}getAttrTokens(r){return this.childNodes.filter(l=>l instanceof as&&(!r||l.name===pt(r)))}hasAttr(r){return this.getAttrTokens(r).length>0}getAttrToken(r){const l=this.getAttrTokens(r);return l[l.length-1]}getAttr(r){var l;return(l=this.getAttrToken(r))==null?void 0:l.getValue()}lint(r=this.getAbsoluteIndex(),l){{const o=super.lint(r,l),{parentNode:u,childNodes:d}=this,a=new Map,h=new Set,g=new le(this,r),c=["no-ignored","no-duplicate"],{lintConfig:p}=I,{computeEditInfo:b,fix:w}=p,k=["closingTag","invalidAttributes","nonWordAttributes"].map(v=>p.getSeverity(c[0],v));if(k[0]&&R(this,t,us).call(this)){const v=G(this,g,c[0],"attributes-of-closing-tag",k[0]);if(b){const m=u.getAbsoluteIndex();v.suggestions=[U(v),on(m)]}o.push(v)}for(const v of d)if(v instanceof as){const{name:m}=v;a.has(m)?(h.add(m),a.get(m).push(v)):a.set(m,[v])}else{const m=v.text().trim(),S=k[yr.test(m)?1:2];if(m&&S){const A=B(v,g,c[0],"invalid-attribute",S);b&&(A.suggestions=[U(A,0," ")]),o.push(A)}}const _=p.getSeverity(c[1],"attribute");if(_&&h.size>0)for(const v of h){const m=a.get(v).map(S=>{const A=S.getValue();return[S,A===!0?"":A]});o.push(...m.map(([S,A],x)=>{const y=B(S,g,c[1],I.msg("duplicate-attribute",v),_);if(b||w){const T=U(y);!A||m.slice(0,x).some(([,$])=>$===A)?y.fix=T:b&&(y.suggestions=[T])}return y}))}return o}}getAttribute(r){return r==="invalid"?R(this,t,us).call(this):super.getAttribute(r)}print(){return this.toString()?`<span class="wpb-${this.type}${R(this,t,us).call(this)?" wpb-invalid":""}">${this.childNodes.map(r=>r.print(r instanceof xe?{class:r.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,us=function(){const{parentNode:r}=this;return(r==null?void 0:r.type)==="html"&&r.closing&&this.text().trim()!==""},i)}}),no={};se(no,{PreToken:()=>ro});var ro,Ja=C({"src/pre.ts"(){"use strict";We(),q(),Ue(),ro=class extends j{get type(){return"ext-inner"}constructor(e,t,s=[]){if(e){const i=/<nowiki>/giu,n=/<\/nowiki>/giu,{length:r}=i.source;let l=i.exec(e);l&&(n.lastIndex=l.index+r);let o=n.exec(e),u=0,d="";for(;l&&o;)new ce(l[0],t,s),new ce(o[0],t,s),d+=`${e.slice(u,l.index)}\0${s.length-1}n${e.slice(l.index+r,o.index)}\0${s.length}n`,u=o.index+r+1,i.lastIndex=u,l=i.exec(e),l&&(n.lastIndex=l.index+r),o=n.exec(e);e=d+e.slice(u)}super(e,t,s,{}),this.setAttribute("stage",we-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),_s,mn=C({"mixin/multiLine.ts"(){"use strict";_s=e=>{class t extends e{toString(i){return super.toString(i,`
|
|
3
3
|
`)}text(){return super.text(`
|
|
4
4
|
`).replace(/\n\s*\n/gu,`
|
|
5
5
|
`)}getGaps(){return 1}print(){return super.print({sep:`
|
|
6
|
-
`})}}return t}}}),
|
|
7
|
-
`).map(l=>n?l:Gt(l,s,i,e)).map(l=>new r(l,"param-line",s,i,{})))}i.splice(i.indexOf(this),1),i.push(this)}lint(e=this.getAbsoluteIndex()){{const t="no-ignored",s=k.lintConfig.getSeverity(t,this.name);if(!s)return[];const i=new ie(this,e),n=k.msg("invalid-parameter",this.name),r=[];for(const l of this.childNodes){l.setAttribute("aIndex",e);const o=l.childNodes.filter(({type:a})=>a!=="comment"&&a!=="include"&&a!=="noinclude");if(o.some(({type:a})=>a==="ext"))r.push(O(l,i,t,n,s));else{const a=o.findIndex(({type:u})=>u!=="text"),h=o.slice(0,a===-1?void 0:a).map(String).join("");if(h&&!(a===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(h)){const u=O(l,i,t,n,s);u.suggestions=[D(u)],r.push(u)}else{const u=l.lint(e,!1);u.length>0&&r.push(...u)}}e+=l.toString().length+1}return r}}},Zs=Y(vr),tt=K(Zs,0,"ParamTagToken",xr,tt),X(Zs,1,tt)}}),br,ei,wr,st,no=_({"src/heading.ts"(){"use strict";var e,t,os,i;z(),$e(),oe(),Le(),q(),B(),xt(),br=[_e],st=(i=class extends(wr=E){constructor(r,l,o,a=[]){super(void 0,o,a);N(this,t);N(this,e);L(this,e,r);const h=new E(l[0],o,a);h.type="heading-title",h.setAttribute("stage",2);const u=new Ye(l[1],"heading-trail",o,a);this.append(h,u)}get type(){return"heading"}get level(){return m(this,e)}toString(r){const l=j(this,t,os).call(this);return l+this.firstChild.toString(r)+l+this.lastChild.toString(r)}text(){const r=j(this,t,os).call(this);return r+this.firstChild.text()+r}getAttribute(r){return r==="invalid"?this.inHtmlAttrs()===2:r==="padding"?this.level:super.getAttribute(r)}getGaps(){return this.level}lint(r=this.getAbsoluteIndex(),l){{const o=super.lint(r,l),{firstChild:a,level:h}=this,u=a.toString(),d=u.startsWith("="),g=d||u.endsWith("="),c=new ie(this,r),p=this.inHtmlAttrs(),w=["h1","unbalanced-header","format-leakage"],v=w.map(f=>k.lintConfig.getSeverity(f,"apostrophe"));if(v[0]&&this.level===1){const f=O(a,c,w[0],"<h1>",v[0]);g||(f.suggestions=[ke(f,"h2",`=${u}=`)]),o.push(f)}if(v[1]&&g){const f=k.msg("unbalanced-in-section-header",'"="'),b=O(a,c,w[1],f,v[1]);if(u!=="=")if(d){const[S]=/^=+/u.exec(u),y=h+S.length;b.suggestions=[{desc:`h${h}`,range:[b.startIndex,b.startIndex+S.length],text:""}],y<7&&b.suggestions.push({desc:`h${y}`,range:[b.endIndex,b.endIndex],text:S})}else{const S=/[^=](=+)$/u.exec(u)[1],y=h+S.length;b.suggestions=[{desc:`h${h}`,range:[b.endIndex-S.length,b.endIndex],text:""}],y<7&&b.suggestions.push({desc:`h${y}`,range:[b.startIndex,b.startIndex],text:S})}o.push(b)}if(p){const f="parsing-order",b=k.lintConfig.getSeverity(f,p===2?"heading":"templateInTable");b&&o.push(J(this,c,f,"header-in-html",b))}if(v[2]){const f=this.getRootNode().toString(),b=a.childNodes.filter(As("quote")),S=b.filter(({bold:A})=>A),y=b.filter(({italic:A})=>A);if(S.length%2){const A=O(S[S.length-1],Ie(ce({},c),{start:r+h,left:c.left+h}),w[2],k.msg("unbalanced-in-section-header","bold-apostrophes"),v[2]),T=r+h+u.length,x=D(A);f.slice(A.endIndex,T).trim()?A.suggestions=[x,Oe(T,"'''")]:S.length===1&&y.length===0?A.fix=x:A.suggestions=[x],o.push(A)}if(y.length%2){const A=O(y[y.length-1],{start:r+h},w[2],k.msg("unbalanced-in-section-header","italic-apostrophes"),v[2]),T=r+h+u.length;f.slice(A.endIndex,T).trim()?A.suggestions=[Oe(T,"''")]:y.length===1&&S.length===0?A.fix=D(A):A.suggestions=[D(A)],o.push(A)}}return o}}print(){const r=j(this,t,os).call(this);return super.print({pre:r,sep:r})}json(r,l=this.getAbsoluteIndex()){const o=super.json(void 0,l)}},e=new WeakMap,t=new WeakSet,os=function(){return"=".repeat(this.level)},i),ei=Y(wr),st=K(ei,0,"HeadingToken",br,st),X(ei,1,st)}}),yr,ro,Qa=_({"src/parameter.ts"(){"use strict";de(),z(),q(),B(),yr=new RegExp(`https?://${ut}${dt}$`,"iu"),ro=class extends E{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){}constructor(e,t,s,i=[]){super(void 0,s,i);const n=new E(typeof e=="number"?void 0:e,s,i,{}),r=new E(t,s,i);n.type="parameter-key",n.setAttribute("stage",2),r.type="parameter-value",r.setAttribute("stage",2),this.append(n,r)}trimName(e,t=!0){const s=(typeof e=="string"?e:e.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",s),s}afterBuild(){if(!this.anon){const{parentNode:e,firstChild:t}=this,s=this.trimName(t);e&&e.getArgs(s,!1,!1).add(this)}super.afterBuild()}toString(e){return this.anon?this.lastChild.toString(e):super.toString(e,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(e=this.getAbsoluteIndex(),t){var s;{const i=super.lint(e,t),n="unescaped",r=k.lintConfig.getSeverity(n);if(r){const{firstChild:l}=this,o=(s=yr.exec(l.text()))==null?void 0:s[0];try{if(o&&new URL(o).search){const a=O(l,{start:e},n,"unescaped-query",r);a.startIndex=a.endIndex,a.startLine=a.endLine,a.startCol=a.endCol,a.endIndex++,a.endCol++,a.fix=gt(a.startIndex,"{{=}}"),i.push(a)}}catch(a){}}return i}}print(){return super.print({sep:this.anon?"":"="})}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t)}}}}),Sr,ti,kr,it,Ja=_({"src/transclude.ts"(){"use strict";var e,t,s,i,n,r,as,lo,a;de(),z(),$e(),oe(),vs(),Le(),q(),B(),Qa(),qe(),xt(),Sr=[_e,Dt()],it=(a=class extends(kr=E){constructor(u,d,g,c=[]){var C,U;let p;const w=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(u);w&&(p=Number(w[1]),u=u.replace(`\0${p}h`,c[p].toString().replace(/^\n/u,"")));super(void 0,g,c,{});N(this,r);Ne(this,"modifier","");N(this,e,"template");N(this,t,":");N(this,s,!1);N(this,i,new Map);N(this,n);const{parserFunction:[v,f],variable:b,functionHook:S}=g,y=(C=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(u))==null?void 0:C[0];if(y)this.setAttribute("modifier",y),u=u.slice(y.length);else if(u.includes(":")){const[R,...P]=u.split(":"),[W]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((U=P[0])!=null?U:"");this.setModifier(`${R}:${W}`)&&(u=P.join(":").slice(W.length))}const A=u.search(/[::]/u),T=u[A]===":",x=A!==-1;if(x||d.length===0&&!m(this,s)){const R=x?u.slice(0,A):u,P=x&&u.slice(A+1),W=me(R),H=x?W.slice(W.search(/\S/u))+(T?":":""):W.trim(),pe=H.toLowerCase(),ee=Array.isArray(f),M=ee?f.includes(H):Object.prototype.hasOwnProperty.call(f,H),F=!ee&&M?f[H]:Object.prototype.hasOwnProperty.call(v,pe)&&v[pe],V=ee&&M||!("functionHook"in g)||S.includes(F),G=ee&&M||b.includes(F);if(x?F&&V:G){this.setAttribute("name",F||pe.replace(/^#|:$/u,"")),L(this,e,"magic-word"),T&&L(this,t,":");const Z=new Ye(R,"magic-word-name",g,c);if(super.insertAt(Z),P!==!1&&d.unshift([P]),this.name==="invoke")for(let ne=0;ne<2;ne++){const le=d.shift();if(!le)break;const re=new ge(le.join("="),`invoke-${ne?"function":"module"}`,g,c);super.insertAt(re)}}}if(this.type==="template"){const R=me(u).trim();if(!this.normalizeTitle(R,10,{halfParsed:!0,temporary:!0}).valid)throw c.pop(),new SyntaxError("Invalid template name");const P=new ge(u,"template-name",g,c,{});super.insertAt(P)}typeof p=="number"&&(c[p]=void 0);const $=this.isTemplate();let I=1;for(let R=0;R<d.length;R++){const P=d[R];$||this.name==="switch"&&R>0||this.name==="tag"&&R>1||(P[0]=P.join("="),P.length=1),P.length===1&&(P.unshift(I),I++),this.insertAt(new ro(...P,g,c))}this.seal("modifier")}get type(){return m(this,e)}get module(){}get function(){}setModifier(u){const{parserFunction:[,,d,g]}=this.getAttribute("config"),c=me(u).trim();if(u&&!c.endsWith(":"))return!1;const p=c.slice(0,-1).toLowerCase(),w=d.includes(p),v=g.includes(p);return m(this,s)&&w||!m(this,s)&&(v||!u)||(we.running||this.length>1)&&(w||v||!u)?(this.setAttribute("modifier",u),L(this,s,w),!!u):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0)),super.afterBuild(),this.isTemplate()&&this.type==="template"&&(L(this,n,j(this,r,as).call(this)),this.setAttribute("name",m(this,n).title))}toString(u){const{childNodes:d,length:g,firstChild:c,modifier:p,type:w}=this;return`{{${p}${w==="magic-word"?c.toString(u)+(g===1?"":m(this,t))+d.slice(1).map(v=>v.toString(u)).join("|"):super.toString(u,"|")}}}`}text(){const{childNodes:u,length:d,firstChild:g,modifier:c,type:p,name:w}=this;return p==="magic-word"&&w==="vardefine"?"":`{{${c}${p==="magic-word"?g.text()+(d===1?"":m(this,t))+Qe(u.slice(1),"|"):super.text("|")}}}`}getAttribute(u){switch(u){case"padding":return this.modifier.length+2;case"title":return m(this,n);case"colon":return m(this,t);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!j(this,r,as).call(this).valid);default:return super.getAttribute(u)}}lint(u=this.getAbsoluteIndex(),d){{const g=super.lint(u,d);if(!this.isTemplate())return g;const{type:c,childNodes:p,length:w}=this,v=new ie(this,u),f=c==="magic-word";let b="no-ignored",S=k.lintConfig.getSeverity(b,"fragment");if(f&&!j(this,r,as).call(this).valid)b="invalid-invoke",S=k.lintConfig.getSeverity(b,"name"),S&&g.push(O(p[1],v,b,"illegal-module",S));else if(S){const y=p[f?1:0],A=y.childNodes.findIndex(x=>x.type==="text"&&cs(x.data).includes("#")),T=y.childNodes[A];if(T){const x=O(y,v,b,"useless-fragment",S);x.suggestions=[D(x,y.getRelativeIndex(A)+T.data.indexOf("#"))],g.push(x)}}if(b="invalid-invoke",S=k.lintConfig.getSeverity(b,"function"),S&&f&&w===2)return g.push(J(this,v,b,"missing-function",S)),g;if(b="no-duplicate",S=k.lintConfig.getSeverity(b,"parameter"),S){const y=this.getDuplicatedArgs().filter(([,T])=>!T[0].querySelector("ext")),A="duplicate-parameter";for(const[,T]of y)g.push(...T.map(x=>{const $=O(x,v,b,A,S);return $.suggestions=[D($,-1)],$}))}return g}}insertAt(u,d=this.length){return super.insertAt(u,d),u.anon?j(this,r,lo).call(this,u):u.name&&this.getArgs(u.name,!1,!1).add(u),u}getAllArgs(){return this.childNodes.filter(As("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:u})=>u)}getArgs(u,d,g=!0){const c=String(u).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");let p;return m(this,i).has(c)?p=m(this,i).get(c):(p=new Set(this.getAllArgs().filter(({name:w})=>c===w)),m(this,i).set(c,p)),p}getDuplicatedArgs(){return[...m(this,i)].filter(([,{size:u}])=>u>1).map(([u,d])=>[u,[...d]])}getPossibleValues(){const{type:u,name:d,childNodes:g}=this;if(u==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let c,p;switch(d){case"if":case"ifexist":case"ifexpr":case"iferror":c=2;break;case"ifeq":c=3;break;case"switch":{const w=g.slice(2),v=w[w.length-1];p=[...w.filter(({anon:f})=>!f),...v!=null&&v.anon?[v]:[]].map(({lastChild:f})=>f);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}p!=null||(p=g.slice(c,c+2).map(({lastChild:w})=>w));for(let w=0;w<p.length;){const{length:v,0:f}=p[w].childNodes.filter(b=>b.text().trim());if(v===0)p.splice(w,1);else if(v>1||f.type!=="magic-word")w++;else try{const b=f.getPossibleValues();p.splice(w,1,...b),w+=b.length}catch(b){w++}}return p}print(){const{childNodes:u,length:d,firstChild:g,modifier:c,type:p}=this;return`<span class="wpb-${p}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${p==="magic-word"?Mt(c)+g.print()+(d===1?"":m(this,t))+ct(u.slice(1),{sep:"|"}):(c?`<span class="wpb-magic-word">${Mt(c)}</span>`:"")+ct(u,{sep:"|"})}}}</span>`}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakSet,as=function(){const u=this.type==="template";return this.normalizeTitle(this.childNodes[u?0:1].text(),u?10:828,{temporary:!0})},lo=function(u){const d=this.getAnonArgs(),g=typeof u!="number";for(let c=g?d.indexOf(u):u-1;c<d.length;c++){const p=d[c],{name:w}=p,v=String(c+1);(w!==v||p===u)&&(p.setAttribute("name",v),this.getArgs(v,!1,!1).add(p))}},a),ti=Y(kr),it=K(ti,0,"TranscludeToken",Sr,it),X(ti,1,it)}}),Ar,si,_r,Ft,Xa=_({"src/hidden.ts"(){"use strict";mt(),B(),Ar=[Ke()],Ft=class extends(_r=E){get type(){return"hidden"}getAttribute(e){return e==="invalid"||super.getAttribute(e)}},si=Y(_r),Ft=K(si,0,"HiddenToken",Ar,Ft),X(si,1,Ft)}}),$r,ii,Tr,Et,Ka=_({"src/arg.ts"(){"use strict";var e,Ya,s;de(),z(),oe(),Be(),vs(),Le(),q(),B(),qe(),Xa(),$r=[_e,Fe("{{{"),Dt()],Et=(s=class extends(Tr=E){constructor(n,r,l=[]){super(void 0,r,l,{});N(this,e);for(let o=0;o<n.length;o++){const a=n[o];if(o===0){const h=new ge(a,"arg-name",r,l,{});super.insertAt(h)}else if(o>1){const h=new Ft(a,r,l);super.insertAt(h)}else{const h=new E(a,r,l);h.type="arg-default",h.setAttribute("stage",2),super.insertAt(h)}}}get type(){return"arg"}get default(){}toString(n){return`{{{${super.toString(n,"|")}}}}`}text(){return`{{{${Qe(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){super.afterBuild()}lint(n=this.getAbsoluteIndex(),r){{const{childNodes:[l,o,...a]}=this;l.setAttribute("aIndex",n+3);const h=l.lint(n+3,r);if(o){const g=n+4+l.toString().length;o.setAttribute("aIndex",g);const c=o.lint(g,r);c.length>0&&h.push(...c)}const u=["no-ignored","no-arg"],d=u.map(g=>k.lintConfig.getSeverity(g,"arg"));if(d[0]&&a.length>0){const g=new ie(this,n);h.push(...a.map(c=>{const p=O(c,g,u[0],"invisible-triple-braces",d[0]);return p.startIndex--,p.startCol--,p.suggestions=[D(p),gt(p.startIndex,"{{!}}")],p}))}if(d[1]&&!this.getAttribute("include")){const g=J(this,{start:n},u[1],"unexpected-argument",d[1]);o&&(g.suggestions=[ke(g,"expand",o.text())]),h.push(g)}return h}}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(n,r=this.getAbsoluteIndex()){const l=super.json(void 0,r)}},e=new WeakSet,Ya=function(){},s),ii=Y(Tr),Et=K(ii,0,"ArgToken",$r,Et),X(ii,1,Et)}}),oo={};te(oo,{parseBraces:()=>Ss});var Cr,ni,Zt,ri,li,oi,Ir,ai,Ss,pn=_({"parser/braces.ts"(){"use strict";Xe(),de(),no(),Ja(),Ka(),Cr={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},ni=String.raw`\[(?!\[)`,Zt=String.raw`\n(?![=\0])`,ri=String.raw`|\{{2,}`,li=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),oi=at(e=>new RegExp(e,"gmu")),Ir=new RegExp(String.raw`\{\{((?:[^\n{}[]|${ni}|${Zt})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${Zt})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${ni}|${Zt})*\}-`,"gu"),ai=e=>{const t=ht(me(e));return li.has(t)?li.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},Ss=(e,t,s)=>{var p,w,v,f,b;const i=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,n]}=t,r=[],l=[],o=(S,y,A,T)=>{y[y.length-1].push(ve(S.slice(A,T),l))};let a;do a!==void 0&&(e=a),a=e.replace(Ir,(S,y,A)=>{if(y!==void 0||typeof A=="string")try{const{length:T}=s,x=(y!=null?y:A).split("|");return new it(ve(x[0],l),x.slice(1).map($=>{const I=$.indexOf("=");return(I===-1?[$]:[$.slice(0,I),$.slice(I+1)]).map(C=>ve(C,l))}),t,s),`\0${T}${ai(x[0])}`}catch(T){if(!(T instanceof SyntaxError)||T.message!=="Invalid template name")throw T}return l.push(ve(S,l)),`\0${l.length-1}`});while(a!==e);e=a;const h=e.lastIndexOf("}}")-e.length;let u=h+e.length!==-1,d=oi(i+(u?ri:"")),g=d.exec(e),c;for(;g||c!==void 0&&c<=e.length&&((w=(p=r[r.length-1])==null?void 0:p[0])!=null&&w.startsWith("="));){if(g!=null&&g[1]){const[,{length:P}]=g;g[0]=g[0].slice(P),g.index+=P}const{0:S,index:y}=g!=null?g:{0:`
|
|
8
|
-
`,index:e.length},
|
|
9
|
-
`){c=
|
|
10
|
-
`)||(e=`${e.slice(0,x)}\0${s.length}h${e.slice(
|
|
11
|
-
)`:""}(\s*)$`,"u")),
|
|
12
|
-
`))!=null?
|
|
13
|
-
`),n=new Set(t.protocol.split("|")),r=ue;let l=!0,o=!1;for(const a of i){const h=a.trim();if(!(o||!h||h.startsWith("#"))){if(l){const u=a.indexOf("|"),d=u===-1?a:a.slice(0,u),{valid:g,ns:c}=this.normalizeTitle(d,0,{halfParsed:!0,temporary:!0});if(g&&c===6){const p=new nt("imagemap",d,u===-1?void 0:a.slice(u+1),t,s);super.insertAt(p),l=!1;continue}else o=!0}else if(a.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(a);continue}else if(a.includes("[")){const u=a.indexOf("["),d=a.slice(u),g=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(d);if(g){if(this.normalizeTitle(g[1],0,{halfParsed:!0,temporary:!0,selfLink:!0}).valid){super.insertAt(new Qi(a.slice(0,u),g.slice(1),d.slice(d.indexOf("]]")+2),t,s));continue}}else if(d.startsWith("[//")||n.has(d.slice(1,d.indexOf(":")+1))||n.has(d.slice(1,d.indexOf("//")+2))){const c=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(d);if(c){super.insertAt(new Qi(a.slice(0,u),c.slice(1),d.slice(d.indexOf("]")+1),t,s));continue}}}}super.insertAt(new r(a,t,s))}}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new ie(this,e),{childNodes:n,image:r}=this,l="invalid-imagemap",o=k.lintConfig.getSeverity(l,r?"link":"image");return o&&(r?s.push(...n.filter(a=>{const h=a.toString().trim();return a.is("noinclude")&&h&&!h.startsWith("#")}).map(a=>{const h=O(a,i,l,"invalid-imagemap-link",o);return h.suggestions=[D(h,-1),ke(h,"comment","# ")],h})):s.push(J(this,i,l,"imagemap-without-image",o))),s}}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}},vi=Y(Vr),Pt=K(vi,0,"ImagemapToken",Gr,Pt),X(vi,1,Pt)}}),Qr,bi,Jr,lt,ko=_({"src/nowiki/comment.ts"(){"use strict";z(),mt(),Be(),q(),Ze(),Qr=[Ke(!1),Fe("<!--")],lt=class extends(Jr=Ae){constructor(t,s,i,n){super(t,i,n);Ne(this,"closed");this.closed=s}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){{if(this.closed)return[];const s="unclosed-comment",i=k.lintConfig.getSeverity(s);if(!i)return[];const n=J(this,{start:t},s,k.msg("unclosed","html-comment"),i);return n.suggestions=[Oe(n.endIndex,"-->")],[n]}}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}},bi=Y(Jr),lt=K(bi,0,"CommentToken",Qr,lt),X(bi,1,lt)}}),Ao={};te(Ao,{CommentedToken:()=>_o});var _o,ru=_({"src/commented.ts"(){"use strict";B(),ko(),_o=class extends E{get type(){return"ext-inner"}constructor(e,t,s=[]){if(super(void 0,t,s,{AstText:":",CommentToken:":"}),e){let i=e.indexOf("<!--"),n=i!==-1&&e.indexOf("-->",i+4),r=0;for(;n!==!1&&n!==-1;)i>r&&this.insertAt(e.slice(r,i)),this.insertAt(new lt(e.slice(i+4,n),!0,t,s)),r=n+3,i=e.indexOf("<!--",r),n=i!==-1&&e.indexOf("-->",i+4);r<e.length&&this.insertAt(e.slice(r))}}lint(e=this.getAbsoluteIndex()){return super.lint(e,new RegExp(String.raw`<\s*(?:\/\s*)?(${this.name})\b`,"giu"))}}}}),$o={};te($o,{NowikiToken:()=>To});var Xr,Kr,To,lu=_({"src/nowiki/index.ts"(){"use strict";var e,Ji,s;Xe(),z(),q(),Ze(),Xr=at(i=>new RegExp(String.raw`<\s*(?:/\s*)${i==="nowiki"?"":"?"}(${i})\b`,"giu")),Kr=new Set(["languages","section","templatestyles"]),To=(s=class extends Ae{constructor(){super(...arguments);N(this,e)}get type(){return"ext-inner"}lint(n=this.getAbsoluteIndex()){{const{name:r}=this,l="void-ext",o=k.lintConfig.getSeverity(l,r);if(o&&j(this,e,Ji).call(this)){const a=J(this,{start:n},l,k.msg("nothing-in",r),o);return a.suggestions=[D(a)],[a]}return super.lint(n,Xr(r))}}getAttribute(n){return n==="invalid"?j(this,e,Ji).call(this):super.getAttribute(n)}},e=new WeakSet,Ji=function(){const{name:n,firstChild:{data:r}}=this;return Kr.has(n)&&!!r},s)}}),Yr,wi,Zr,ot,Co=_({"src/tagPair/ext.ts"(){"use strict";z(),oe(),q(),hn(),B(),dn(),cn(),Yr=[bs()],ot=class extends(Zr=Ge){get type(){return"ext"}constructor(e,t,s,i,n=k.getConfig(),r=!1,l=[]){const o=e.toLowerCase(),a=new ws(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",o,n,l),h=Ie(ce({},n),{ext:n.ext.filter(d=>d!==o),excludes:[...n.excludes],inExt:!0});let u;switch(o){case"tab":h.ext=h.ext.filter(d=>d!=="tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":o==="poem"&&h.excludes.push("heading"),u=new E(s,h,l);break;case"pre":{const{PreToken:d}=(Va(),Q(eo));u=new d(s,h,l);break}case"dynamicpagelist":{const{ParamTagToken:d}=(io(),Q(so));u=new d(r,s,h,l);break}case"inputbox":{const{InputboxToken:d}=(Za(),Q(ao));u=new d(r,s,h,l);break}case"references":{const{NestedToken:d}=(ui(),Q(us));h.excludes.push("heading"),u=new d(s,r,["ref"],h,l);break}case"choose":{const{NestedToken:d}=(ui(),Q(us));u=new d(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],h,l);break}case"combobox":{const{NestedToken:d}=(ui(),Q(us));u=new d(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],h,l);break}case"gallery":{const{GalleryToken:d}=(tu(),Q(vo));u=new d(s,h,l);break}case"imagemap":{const{ImagemapToken:d}=(nu(),Q(So));u=new d(s,h,l);break}case"hiero":{const{CommentedToken:d}=(ru(),Q(Ao));u=new d(s,h,l);break}default:{const{NowikiToken:d}=(lu(),Q($o));u=new d(s,h,l)}}u.setAttribute("name",o),u.type==="plain"&&(u.type="ext-inner"),super(e,a,u,i,n,l),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new ie(this,e);if(this.name!=="nowiki"){const l=this.inHtmlAttrs(),o="parsing-order",a=l&&k.lintConfig.getSeverity(o,l===2?"ext":"templateInTable");a&&s.push(J(this,i,o,"ext-in-html",a))}const n="var-anchor",r=k.lintConfig.getSeverity(n,"ref");return r&&this.name==="ref"&&this.closest("heading-title")&&s.push(J(this,i,n,"variable-anchor",r)),s}}},wi=Y(Zr),ot=K(wi,0,"ExtToken",Yr,ot),X(wi,1,ot)}}),Io={};te(Io,{parseCommentAndExt:()=>Gt});var yi,el,es,tl,Si,Gt,ks=_({"parser/commentAndExt.ts"(){"use strict";Xe(),de(),za(),We(),Ua(),Ha(),Co(),ko(),yi="<onlyinclude>",el="</onlyinclude>",{length:es}=yi,tl=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",s=e?"noinclude":"includeonly";return Ol(i=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${i.join("|")})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(${"\\1"}\s*)>)|<(${s})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${s}\s*)>|$))`,"giu"))}),Si=e=>{const t=e.indexOf(yi);return{i:t,j:e.indexOf(el,t+es)}},Gt=(e,t,s,i)=>{if(i){let{i:o,j:a}=Si(e);if(o!==-1&&a!==-1){let h="";const u=d=>{new ue(d,t,s),h+=`\0${s.length-1}n`};for(;o!==-1&&a!==-1;){const d=`\0${s.length}e`;new Nt(e.slice(o+es,a),t,s),o>0&&u(e.slice(0,o)),h+=d,e=e.slice(a+es+1),{i:o,j:a}=Si(e)}return e&&u(e),h}}const{ext:n}=t,r=n.filter(o=>o!=="translate"&&o!=="tvar"),l=Ie(ce({},t),{ext:r});if(n.includes("translate")){const o=[];e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,a=>(o.push(a),`\0${o.length-1}`)).replace(/<translate( nowrap)?>([\s\S]+?)?<\/translate>/gu,(a,h,u)=>{const d=s.length;return new Vl(h,u&&ve(u,o),l,s),`\0${d}g`}),e=ve(e,o)}return e.replace(tl[i?1:0](r),(o,a,h,u,d,g,c,p,w)=>{const v=s.length;let f="n";if(a)f="e",new ot(a,h,u,d,l,g,s);else if(o.startsWith("<!--")){f="c";const b=o.endsWith("-->");new lt(ve(o,s,1).slice(4,b?-3:void 0),b,t,s)}else g?new Lt(g,c&&ve(c,s,1),p&&ve(p,s,1),w,t,s):new ue(o,t,s);return`\0${v}${f}`})}}}),sl,il,nl,rl,ki,ll,Rt,ou=_({"src/html.ts"(){"use strict";var e,t,s,i,n;z(),$e(),oe(),hn(),q(),B(),sl=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),il=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"]),nl=new Set(["strike","big","center","font","tt"]),rl=[bs()],Rt=(n=class extends(ll=E){constructor(l,o,a,h,u,d){super(void 0,u,d);N(this,e);N(this,t);N(this,s);N(this,i);this.insertAt(o),this.setAttribute("name",l.toLowerCase()),L(this,e,a),L(this,t,h),L(this,s,l)}get type(){return"html"}get selfClosing(){return m(this,t)}get closing(){return m(this,e)}toString(l){return`<${this.closing?"/":""}${m(this,s)}${super.toString(l)}${m(this,t)?"/":""}>`}text(){const{closing:l}=this,o=m(this,s)+(l?"":super.text());return`<${l?"/":""}${o}${m(this,t)?"/":""}>`}getAttribute(l){return l==="invalid"?this.inTableAttrs()===2:l==="padding"?m(this,s).length+(this.closing?2:1):super.getAttribute(l)}lint(l=this.getAbsoluteIndex(),o){var a;{const h=super.lint(l,o),{name:u,parentNode:d,closing:g,selfClosing:c}=this,p=new ie(this,l),w=this.inTableAttrs();let v="h1",f=k.lintConfig.getSeverity(v,"html");if(f&&u==="h1"&&!g){const x=J(this,p,v,"<h1>",f);x.suggestions=[{desc:"h2",range:[l+2,l+3],text:"2"}],h.push(x)}if(v="parsing-order",f=w&&k.lintConfig.getSeverity(v,w===2?"html":"templateInTable"),f){const x=J(this,p,v,"html-in-table",f);w===2&&(x.suggestions=[D(x)]),h.push(x)}if(v="obsolete-tag",f=k.lintConfig.getSeverity(v,u),f&&nl.has(u)&&h.push(J(this,p,v,"obsolete-tag",f)),v="bold-header",f=k.lintConfig.getSeverity(v,u),f&&(u==="b"||u==="strong")&&((a=this.closest("heading-title,ext"))==null?void 0:a.type)==="heading-title"){const x=J(this,p,v,"bold-in-header",f);x.suggestions=[D(x)],h.push(x)}const{html:[,b,S]}=this.getAttribute("config"),y=S.includes(u),A=b.includes(u),T=!y&&!A;if(v="unmatched-tag",g&&(c||y)||c&&T){if(f=k.lintConfig.getSeverity(v,g?"both":"selfClosing"),f){const x=J(this,p,v,g?"closing-and-self-closing":"invalid-self-closing",f),$=nn(l),I={desc:k.msg("no-self-closing"),range:[x.endIndex-2,x.endIndex-1],text:""};A?x.suggestions=[$,I]:g?x.fix=y?$:I:x.suggestions=[I,Oe(x.endIndex,`></${u}>`,-2)],h.push(x)}}else if(!this.findMatchingTag()){const x=J(this,p,v,g?"unmatched-closing":"unclosed-tag"),$=this.closest("magic-word");if($&&sl.has($.name))f=k.lintConfig.getSeverity(v,"conditional");else if(g)f=k.lintConfig.getSeverity(v,"closing"),x.suggestions=[D(x)];else{f=k.lintConfig.getSeverity(v,"opening");const I=d==null?void 0:d.childNodes;il.has(u)&&(I!=null&&I.slice(0,I.indexOf(this)).some(C=>C.type==="html"&&C.name===u&&!C.findMatchingTag())&&(x.suggestions=[Oe(l+1,"/")]),this.closest("heading-title")&&(x.rule="format-leakage",f=k.lintConfig.getSeverity("format-leakage",u)))}f&&(x.severity=f,h.push(x))}return h}}findMatchingTag(){return Ve(m(this,i),()=>{const{name:l,parentNode:o,closing:a,selfClosing:h}=this,{html:[,u,d]}=this.getAttribute("config"),g=d.includes(l),c=u.includes(l);if(g||c&&h)return this;if(!o)return;const{childNodes:p}=o,w=p.indexOf(this),v=a?p.slice(0,w).reverse():p.slice(w+1),f=[this],{rev:b}=we;for(const S of v)if(!(!S.is("html")||S.name!==l||c&&m(S,t)))if(m(S,e)===a)f.push(S);else{const y=f.pop();if(y===this)return S;k.viewOnly&&(L(y,i,[b,S]),L(S,i,[b,y]))}if(k.viewOnly)for(const S of f)L(S,i,[b,void 0])},l=>{L(this,i,l),l[1]&&l[1]!==this&&L(l[1],i,[we.rev,this])})}print(){return super.print({pre:`<${this.closing?"/":""}${m(this,s)}`,post:`${m(this,t)?"/":""}>`})}json(l,o=this.getAbsoluteIndex()){const a=super.json(void 0,o)}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n),ki=Y(ll),Rt=K(ki,0,"HtmlToken",rl,Rt),X(ki,1,Rt)}}),No={};te(No,{parseHtml:()=>Lo});var ol,Lo,au=_({"parser/html.ts"(){"use strict";cn(),ou(),ol=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,Lo=(e,t,s)=>{var l;const{html:i}=t;(l=t.htmlElements)!=null||(t.htmlElements=new Set([...i[0],...i[1],...i[2]]));const n=e.split("<");let r=n.shift();for(const o of n){const a=ol.exec(o),h=a==null?void 0:a[2],u=h==null?void 0:h.toLowerCase();if(!a||!t.htmlElements.has(u)){r+=`<${o}`;continue}const[,d,,g="",c,p]=a,{length:w}=s,v=new ws(g,"html-attrs",u,t,s),f=v.hasAttr("itemprop");if(u==="meta"&&!(f&&v.hasAttr("content"))||u==="link"&&!(f&&v.hasAttr("href"))){r+=`<${o}`,s.length=w;continue}r+=`\0${s.length}x${p}`,new Rt(h,v,d==="/",c==="/>",t,s)}return r}}}),vn,Fo=_({"src/table/base.ts"(){"use strict";hn(),B(),xt(),cn(),vn=class extends bs(1)(E){constructor(e,t,s,i,n,r=[],l){super(void 0,n,r,l),this.append(new Ye(t,"table-syntax",n,r),new ws(i,"table-attrs",s,n,r))}escape(){}}}}),al,Ai,Se,ts,At,_t,gs,Eo=_({"src/table/td.ts"(){"use strict";z(),oe(),un(),q(),B(),Fo(),gs=class extends(Ai=vn,al=[ms(!1)],Ai){constructor(e,t,s,i=[]){var o;let n=/\||\0\d+!\x7F/u.exec(t!=null?t:""),r=n?t.slice(0,n.index):"";/\[\[|-\{/u.test(r)&&(n=null,r=""),super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",r,s,i),X(ts,5,this),je(this,At),je(this,Se,""),n&&([Fa(this,Se)._]=n);const l=new E(t==null?void 0:t.slice(((o=n==null?void 0:n.index)!=null?o:NaN)+ae(this,Se).length),s,i);l.type="td-inner",l.setAttribute("stage",4),this.insertAt(l)}get type(){return"td"}get rowspan(){return this.getAttr("rowspan")}get colspan(){return this.getAttr("colspan")}get subtype(){return qi(this,At,_t).call(this).subtype}afterBuild(){ae(this,Se).includes("\0")&&xe(this,Se,this.buildFromStr(ae(this,Se),0)),super.afterBuild()}toString(e){const{childNodes:[t,s,i]}=this;return t.toString(e)+s.toString(e)+ae(this,Se)+i.toString(e)}text(){const{childNodes:[e,t,s]}=this;return e.text()+t.text()+ae(this,Se)+s.text()}getGaps(e){return e===1?ae(this,Se).length:0}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new ie(this,e+this.getRelativeIndex(this.length-1)),n="pipe-like",r=["td","double"].map(l=>k.lintConfig.getSeverity(n,l));for(const l of this.lastChild.childNodes)if(l.type==="text"){const{data:o}=l;if(o.includes("|")){const a=o.includes("||"),h=r[a?1:0];if(h){const u=O(l,i,n,"pipe-in-table",h);if(a){const d={caption:"|+",td:"|",th:"!"}[this.subtype];u.fix=ke(u,"newline",o.replace(/\|\|/gu,`
|
|
14
|
-
${
|
|
15
|
-
`)}getAttr(e){const t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}escape(){}print(){const{childNodes:[e,t,s]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${
|
|
16
|
-
|}`,t){const s=this.getAttribute("config"),i=this.getAttribute("accum");
|
|
6
|
+
`})}}return t}}}),lo={};se(lo,{ParamTagToken:()=>nt});var Sr,ii,kr,nt,oo=C({"src/paramTag/index.ts"(){"use strict";M(),de(),Ts(),mn(),W(),q(),ze(),Sr=[_s],nt=class extends(kr=j){get type(){return"ext-inner"}constructor(e,t,s=I.getConfig(),i=[],n){if(super(void 0,s,i,{}),t){const r=xe;this.append(...t.split(`
|
|
7
|
+
`).map(l=>n?l:Qt(l,s,i,e)).map(l=>new r(l,"param-line",s,i,{})))}i.splice(i.indexOf(this),1),i.push(this)}lint(e=this.getAbsoluteIndex()){{const t="no-ignored",{lintConfig:s}=I,i=s.getSeverity(t,this.name);if(!i)return[];const n=new le(this,e),r=I.msg("invalid-parameter",this.name),l=[];for(const o of this.childNodes){o.setAttribute("aIndex",e);const u=o.childNodes.filter(({type:d})=>d!=="comment"&&d!=="include"&&d!=="noinclude");if(u.some(({type:d})=>d==="ext"))l.push(B(o,n,t,r,i));else{const d=u.findIndex(({type:h})=>h!=="text"),a=u.slice(0,d===-1?void 0:d).map(String).join("");if(a&&!(d===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(a)){const h=B(o,n,t,r,i);s.computeEditInfo&&(h.suggestions=[U(h)]),l.push(h)}else{const h=o.lint(e,!1);h.length>0&&l.push(...h)}}e+=o.toString().length+1}return l}}},ii=K(kr),nt=X(ii,0,"ParamTagToken",Sr,nt),J(ii,1,nt)}}),Ar,ni,_r,rt,ao=C({"src/heading.ts"(){"use strict";var e,t,ds,i;M(),Ne(),de(),Fe(),W(),q(),wt(),Ar=[Ie],rt=(i=class extends(_r=j){constructor(r,l,o,u=[]){super(void 0,o,u);N(this,t);N(this,e);L(this,e,r);const d=new j(l[0],o,u);d.type="heading-title",d.setAttribute("stage",2);const a=new et(l[1],"heading-trail",o,u);this.append(d,a)}get type(){return"heading"}get level(){return f(this,e)}toString(r){const l=R(this,t,ds).call(this);return l+this.firstChild.toString(r)+l+this.lastChild.toString(r)}text(){const r=R(this,t,ds).call(this);return r+this.firstChild.text()+r}getAttribute(r){return r==="invalid"?this.inHtmlAttrs()===2:r==="padding"?this.level:super.getAttribute(r)}getGaps(){return this.level}lint(r=this.getAbsoluteIndex(),l){{const o=super.lint(r,l),{firstChild:u,level:d}=this,a=u.toString(),h=a.startsWith("="),g=h||a.endsWith("="),c=new le(this,r),p=this.inHtmlAttrs(),b=["h1","unbalanced-header","format-leakage"],{lintConfig:w}=I,{computeEditInfo:k,fix:_}=w,v=b.map(m=>w.getSeverity(m,"apostrophe"));if(v[0]&&this.level===1){const m=B(u,c,b[0],"<h1>",v[0]);k&&!g&&(m.suggestions=[$e(m,"h2",`=${a}=`)]),o.push(m)}if(v[1]&&g){const m=I.msg("unbalanced-in-section-header",'"="'),S=B(u,c,b[1],m,v[1]);if(!(!k||a==="="))if(h){const[A]=/^=+/u.exec(a),x=d+A.length;S.suggestions=[{desc:`h${d}`,range:[S.startIndex,S.startIndex+A.length],text:""}],x<7&&S.suggestions.push({desc:`h${x}`,range:[S.endIndex,S.endIndex],text:A})}else{const A=/[^=](=+)$/u.exec(a)[1],x=d+A.length;S.suggestions=[{desc:`h${d}`,range:[S.endIndex-A.length,S.endIndex],text:""}],x<7&&S.suggestions.push({desc:`h${x}`,range:[S.startIndex,S.startIndex],text:A})}o.push(S)}if(p){const m="parsing-order",S=w.getSeverity(m,p===2?"heading":"templateInTable");S&&o.push(G(this,c,m,"header-in-html",S))}if(v[2]){const m=this.getRootNode().toString(),S=u.childNodes.filter(Cs("quote")),A=S.filter(({bold:y})=>y),x=S.filter(({italic:y})=>y);if(A.length%2){const y=B(A[A.length-1],Le(me({},c),{start:r+d,left:c.left+d}),b[2],I.msg("unbalanced-in-section-header","bold-apostrophes"),v[2]);if(k||_){const T=r+d+a.length,$=U(y);m.slice(y.endIndex,T).trim()?k&&(y.suggestions=[$,qe(T,"'''")]):A.length===1&&x.length===0?y.fix=$:k&&(y.suggestions=[$])}o.push(y)}if(x.length%2){const y=B(x[x.length-1],{start:r+d},b[2],I.msg("unbalanced-in-section-header","italic-apostrophes"),v[2]);if(k||_){const T=r+d+a.length;m.slice(y.endIndex,T).trim()?k&&(y.suggestions=[qe(T,"''")]):x.length===1&&A.length===0?y.fix=U(y):k&&(y.suggestions=[U(y)])}o.push(y)}}return o}}print(){const r=R(this,t,ds).call(this);return super.print({pre:r,sep:r})}json(r,l=this.getAbsoluteIndex()){const o=super.json(void 0,l)}},e=new WeakMap,t=new WeakSet,ds=function(){return"=".repeat(this.level)},i),ni=K(_r),rt=X(ni,0,"HeadingToken",Ar,rt),J(ni,1,rt)}}),$r,uo,Xa=C({"src/parameter.ts"(){"use strict";ge(),M(),W(),q(),$r=new RegExp(`https?://${ct}${gt}$`,"iu"),uo=class extends j{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){}constructor(e,t,s,i=[]){super(void 0,s,i);const n=new j(typeof e=="number"?void 0:e,s,i,{}),r=new j(t,s,i);n.type="parameter-key",n.setAttribute("stage",2),r.type="parameter-value",r.setAttribute("stage",2),this.append(n,r)}trimName(e,t=!0){const s=(typeof e=="string"?e:e.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",s),s}afterBuild(){if(!this.anon){const{parentNode:e,firstChild:t}=this,s=this.trimName(t);e&&e.getArgs(s,!1,!1).add(this)}super.afterBuild()}toString(e){return this.anon?this.lastChild.toString(e):super.toString(e,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(e=this.getAbsoluteIndex(),t){var s;{const i=super.lint(e,t),n="unescaped",{lintConfig:r}=I,l=r.getSeverity(n);if(l){const{firstChild:o}=this,u=(s=$r.exec(o.text()))==null?void 0:s[0];try{if(u&&new URL(u).search){const d=B(o,{start:e},n,"unescaped-query",l);d.startIndex=d.endIndex,d.startLine=d.endLine,d.startCol=d.endCol,d.endIndex++,d.endCol++,(r.computeEditInfo||r.fix)&&(d.fix=mt(d.startIndex,"{{=}}")),i.push(d)}}catch(d){}}return i}}print(){return super.print({sep:this.anon?"":"="})}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t)}}}}),Tr,ri,Cr,lt,Ka=C({"src/transclude.ts"(){"use strict";var e,t,s,i,n,r,hs,ho,u;ge(),M(),Ne(),de(),Ss(),Fe(),W(),q(),Xa(),ze(),wt(),Tr=[Ie,Vt()],lt=(u=class extends(Cr=j){constructor(a,h,g,c=[]){var $,E;let p;const b=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(a);b&&(p=Number(b[1]),a=a.replace(`\0${p}h`,c[p].toString().replace(/^\n/u,"")));super(void 0,g,c,{});N(this,r);Ee(this,"modifier","");N(this,e,"template");N(this,t,":");N(this,s,!1);N(this,i,new Map);N(this,n);const{parserFunction:[w,k],variable:_,functionHook:v}=g,m=($=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(a))==null?void 0:$[0];if(m)this.setAttribute("modifier",m),a=a.slice(m.length);else if(a.includes(":")){const[F,...P]=a.split(":"),[ne]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((E=P[0])!=null?E:"");this.setModifier(`${F}:${ne}`)&&(a=P.join(":").slice(ne.length))}const S=a.search(/[::]/u),A=a[S]===":",x=S!==-1;if(x||h.length===0&&!f(this,s)){const F=x?a.slice(0,S):a,P=x&&a.slice(S+1),ne=be(F),O=x?ne.slice(ne.search(/\S/u))+(A?":":""):ne.trim(),re=O.toLowerCase(),fe=Array.isArray(k),V=fe?k.includes(O):Object.prototype.hasOwnProperty.call(k,O),D=!fe&&V?k[O]:Object.prototype.hasOwnProperty.call(w,re)&&w[re],Y=fe&&V||!("functionHook"in g)||v.includes(D),z=fe&&V||_.includes(D);if(x?D&&Y:z){this.setAttribute("name",D||re.replace(/^#|:$/u,"")),L(this,e,"magic-word"),A&&L(this,t,":");const Z=new et(F,"magic-word-name",g,c);if(super.insertAt(Z),P!==!1&&h.unshift([P]),this.name==="invoke")for(let H=0;H<2;H++){const ee=h.shift();if(!ee)break;const oe=new xe(ee.join("="),`invoke-${H?"function":"module"}`,g,c);super.insertAt(oe)}}}if(this.type==="template"){const F=be(a).trim();if(!this.normalizeTitle(F,10,{halfParsed:!0,temporary:!0}).valid)throw c.pop(),new SyntaxError("Invalid template name");const P=new xe(a,"template-name",g,c,{});super.insertAt(P)}typeof p=="number"&&(c[p]=void 0);const y=this.isTemplate();let T=1;for(let F=0;F<h.length;F++){const P=h[F];y||this.name==="switch"&&F>0||this.name==="tag"&&F>1||(P[0]=P.join("="),P.length=1),P.length===1&&(P.unshift(T),T++),this.insertAt(new uo(...P,g,c))}this.seal("modifier")}get type(){return f(this,e)}get module(){}get function(){}setModifier(a){const{parserFunction:[,,h,g]}=this.getAttribute("config"),c=be(a).trim();if(a&&!c.endsWith(":"))return!1;const p=c.slice(0,-1).toLowerCase(),b=h.includes(p),w=g.includes(p);return f(this,s)&&b||!f(this,s)&&(w||!a)||(ke.running||this.length>1)&&(b||w||!a)?(this.setAttribute("modifier",a),L(this,s,b),!!a):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0)),super.afterBuild(),this.isTemplate()&&this.type==="template"&&(L(this,n,R(this,r,hs).call(this)),this.setAttribute("name",f(this,n).title))}toString(a){const{childNodes:h,length:g,firstChild:c,modifier:p,type:b}=this;return`{{${p}${b==="magic-word"?c.toString(a)+(g===1?"":f(this,t))+h.slice(1).map(w=>w.toString(a)).join("|"):super.toString(a,"|")}}}`}text(){const{childNodes:a,length:h,firstChild:g,modifier:c,type:p,name:b}=this;return p==="magic-word"&&b==="vardefine"?"":`{{${c}${p==="magic-word"?g.text()+(h===1?"":f(this,t))+Ke(a.slice(1),"|"):super.text("|")}}}`}getAttribute(a){switch(a){case"padding":return this.modifier.length+2;case"title":return f(this,n);case"colon":return f(this,t);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!R(this,r,hs).call(this).valid);default:return super.getAttribute(a)}}lint(a=this.getAbsoluteIndex(),h){{const g=super.lint(a,h);if(!this.isTemplate())return g;const{type:c,childNodes:p,length:b}=this,w=new le(this,a),{lintConfig:k}=I,{computeEditInfo:_}=k,v=c==="magic-word";let m="no-ignored",S=k.getSeverity(m,"fragment");if(v&&!R(this,r,hs).call(this).valid)m="invalid-invoke",S=k.getSeverity(m,"name"),S&&g.push(B(p[1],w,m,"illegal-module",S));else if(S){const A=p[v?1:0],x=A.childNodes.findIndex(T=>T.type==="text"&&ms(T.data).includes("#")),y=A.childNodes[x];if(y){const T=B(A,w,m,"useless-fragment",S);_&&(T.suggestions=[U(T,A.getRelativeIndex(x)+y.data.indexOf("#"))]),g.push(T)}}if(m="invalid-invoke",S=k.getSeverity(m,"function"),S&&v&&b===2)return g.push(G(this,w,m,"missing-function",S)),g;if(m="no-duplicate",S=k.getSeverity(m,"parameter"),S){const A=this.getDuplicatedArgs().filter(([,y])=>!y[0].querySelector("ext")),x="duplicate-parameter";for(const[,y]of A)g.push(...y.map(T=>{const $=B(T,w,m,x,S);return _&&($.suggestions=[U($,-1)]),$}))}return g}}insertAt(a,h=this.length){return super.insertAt(a,h),a.anon?R(this,r,ho).call(this,a):a.name&&this.getArgs(a.name,!1,!1).add(a),a}getAllArgs(){return this.childNodes.filter(Cs("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:a})=>a)}getArgs(a,h,g=!0){const c=String(a).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");let p;return f(this,i).has(c)?p=f(this,i).get(c):(p=new Set(this.getAllArgs().filter(({name:b})=>c===b)),f(this,i).set(c,p)),p}getDuplicatedArgs(){return[...f(this,i)].filter(([,{size:a}])=>a>1).map(([a,h])=>[a,[...h]])}getPossibleValues(){const{type:a,name:h,childNodes:g}=this;if(a==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let c,p;switch(h){case"if":case"ifexist":case"ifexpr":case"iferror":c=2;break;case"ifeq":c=3;break;case"switch":{const b=g.slice(2),w=b[b.length-1];p=[...b.filter(({anon:k})=>!k),...w!=null&&w.anon?[w]:[]].map(({lastChild:k})=>k);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}p!=null||(p=g.slice(c,c+2).map(({lastChild:b})=>b));for(let b=0;b<p.length;){const{length:w,0:k}=p[b].childNodes.filter(_=>_.text().trim());if(w===0)p.splice(b,1);else if(w>1||k.type!=="magic-word")b++;else try{const _=k.getPossibleValues();p.splice(b,1,..._),b+=_.length}catch(_){b++}}return p}print(){const{childNodes:a,length:h,firstChild:g,modifier:c,type:p}=this;return`<span class="wpb-${p}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${p==="magic-word"?Ut(c)+g.print()+(h===1?"":f(this,t))+ft(a.slice(1),{sep:"|"}):(c?`<span class="wpb-magic-word">${Ut(c)}</span>`:"")+ft(a,{sep:"|"})}}}</span>`}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakSet,hs=function(){const a=this.type==="template";return this.normalizeTitle(this.childNodes[a?0:1].text(),a?10:828,{temporary:!0})},ho=function(a){const h=this.getAnonArgs(),g=typeof a!="number";for(let c=g?h.indexOf(a):a-1;c<h.length;c++){const p=h[c],{name:b}=p,w=String(c+1);(b!==w||p===a)&&(p.setAttribute("name",w),this.getArgs(w,!1,!1).add(p))}},u),ri=K(Cr),lt=X(ri,0,"TranscludeToken",Tr,lt),J(ri,1,lt)}}),Ir,li,Nr,jt,Ya=C({"src/hidden.ts"(){"use strict";bt(),q(),Ir=[Ze()],jt=class extends(Nr=j){get type(){return"hidden"}getAttribute(e){return e==="invalid"||super.getAttribute(e)}},li=K(Nr),jt=X(li,0,"HiddenToken",Ir,jt),J(li,1,jt)}}),Lr,oi,Er,Pt,Za=C({"src/arg.ts"(){"use strict";var e,eu,s;ge(),M(),de(),Me(),Ss(),Fe(),W(),q(),ze(),Ya(),Lr=[Ie,je("{{{"),Vt()],Pt=(s=class extends(Er=j){constructor(n,r,l=[]){super(void 0,r,l,{});N(this,e);for(let o=0;o<n.length;o++){const u=n[o];if(o===0){const d=new xe(u,"arg-name",r,l,{});super.insertAt(d)}else if(o>1){const d=new jt(u,r,l);super.insertAt(d)}else{const d=new j(u,r,l);d.type="arg-default",d.setAttribute("stage",2),super.insertAt(d)}}}get type(){return"arg"}get default(){}toString(n){return`{{{${super.toString(n,"|")}}}}`}text(){return`{{{${Ke(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){super.afterBuild()}lint(n=this.getAbsoluteIndex(),r){{const{childNodes:[l,o,...u]}=this;l.setAttribute("aIndex",n+3);const d=l.lint(n+3,r);if(o){const p=n+4+l.toString().length;o.setAttribute("aIndex",p);const b=o.lint(p,r);b.length>0&&d.push(...b)}const a=["no-ignored","no-arg"],{lintConfig:h}=I,{computeEditInfo:g}=h,c=a.map(p=>h.getSeverity(p,"arg"));if(c[0]&&u.length>0){const p=new le(this,n);d.push(...u.map(b=>{const w=B(b,p,a[0],"invisible-triple-braces",c[0]);return w.startIndex--,w.startCol--,g&&(w.suggestions=[U(w),mt(w.startIndex,"{{!}}")]),w}))}if(c[1]&&!this.getAttribute("include")){const p=G(this,{start:n},a[1],"unexpected-argument",c[1]);g&&o&&(p.suggestions=[$e(p,"expand",o.text())]),d.push(p)}return d}}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(n,r=this.getAbsoluteIndex()){const l=super.json(void 0,r)}},e=new WeakSet,eu=function(){},s),oi=K(Er),Pt=X(oi,0,"ArgToken",Lr,Pt),J(oi,1,Pt)}}),co={};se(co,{parseBraces:()=>$s});var Fr,ai,ts,ui,di,hi,jr,ci,$s,xn=C({"parser/braces.ts"(){"use strict";Ye(),ge(),ao(),Ka(),Za(),Fr={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},ai=String.raw`\[(?!\[)`,ts=String.raw`\n(?![=\0])`,ui=String.raw`|\{{2,}`,di=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),hi=ht(e=>new RegExp(e,"gmu")),jr=new RegExp(String.raw`\{\{((?:[^\n{}[]|${ai}|${ts})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${ts})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${ai}|${ts})*\}-`,"gu"),ci=e=>{const t=pt(be(e));return di.has(t)?di.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},$s=(e,t,s)=>{var p,b,w,k,_;const i=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,n]}=t,r=[],l=[],o=(v,m,S,A)=>{m[m.length-1].push(Se(v.slice(S,A),l))};let u;do u!==void 0&&(e=u),u=e.replace(jr,(v,m,S)=>{if(m!==void 0||typeof S=="string")try{const{length:A}=s,x=(m!=null?m:S).split("|");return new lt(Se(x[0],l),x.slice(1).map(y=>{const T=y.indexOf("=");return(T===-1?[y]:[y.slice(0,T),y.slice(T+1)]).map($=>Se($,l))}),t,s),`\0${A}${ci(x[0])}`}catch(A){if(!(A instanceof SyntaxError)||A.message!=="Invalid template name")throw A}return l.push(Se(v,l)),`\0${l.length-1}`});while(u!==e);e=u;const d=e.lastIndexOf("}}")-e.length;let a=d+e.length!==-1,h=hi(i+(a?ui:"")),g=h.exec(e),c;for(;g||c!==void 0&&c<=e.length&&((b=(p=r[r.length-1])==null?void 0:p[0])!=null&&b.startsWith("="));){if(g!=null&&g[1]){const[,{length:P}]=g;g[0]=g[0].slice(P),g.index+=P}const{0:v,index:m}=g!=null?g:{0:`
|
|
8
|
+
`,index:e.length},S=(w=r.pop())!=null?w:{},{0:A,index:x,parts:y,findEqual:T,pos:$}=S,E=v==="="&&T;if(v==="]]"||v==="}-")c=m+2;else if(v===`
|
|
9
|
+
`){c=m+1;const{pos:P,findEqual:ne}=(k=r[r.length-1])!=null?k:{};if(P===void 0||ne||be(e.slice(P,x))!==""){const O=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(e.slice(x,m));O&&(O[2]=Se(O[2],l),O[2].includes(`
|
|
10
|
+
`)||(e=`${e.slice(0,x)}\0${s.length}h${e.slice(m)}`,c=x+4+String(s.length).length,new rt(O[1].length,O.slice(2),t,s)))}}else if(v==="|"||E)c=m+1,o(e,y,$,m),v==="|"&&y.push([]),S.pos=c,S.findEqual=v==="|",r.push(S);else if(v.startsWith("}}")){const P=v.slice(0,Math.min(A.length,3)),ne=A.length-P.length,{length:O}=s;c=m+P.length,o(e,y,$,m);let re=!1,fe="t";if(P.length===3){const V=y.map(Y=>Y.join("=")),D=V.length>1&&be(V[1]).trim();new Pt(V,t,s),D&&D.endsWith(":")&&n.includes(D.slice(0,-1).toLowerCase())&&(fe="s")}else try{new lt(y[0][0],y.slice(1),t,s),fe=ci(y[0][0])}catch(V){if(V instanceof SyntaxError&&V.message==="Invalid template name")re=!0;else throw V}re||(e=`${e.slice(0,x+ne)}\0${O}${fe}${e.slice(c)}`,c=x+ne+3+String(O).length,ne>1?r.push({0:A.slice(0,ne),index:x,pos:x+ne,parts:[[]]}):ne===1&&e[x-1]==="-"&&r.push({0:"-{",index:x-1,pos:x+1,parts:[[]]}))}else c=m+v.length,v.startsWith("{")&&(g.pos=c,g.parts=[[]]),r.push(..."0"in S?[S]:[],g);let F=r[r.length-1];if(a&&d+e.length<c)for(a=!1;(_=F==null?void 0:F[0])!=null&&_.startsWith("{");)r.pop(),F=r[r.length-1];h=hi(i+(a?ui:"")+(F?`|${Fr[F[0][0]]}${F.findEqual?"|=":""}`:"")),h.lastIndex=c,g=h.exec(e)}return Se(e,l)}}}),go={};se(go,{InputboxToken:()=>po});var po,tu=C({"src/paramTag/inputbox.ts"(){"use strict";Ts(),xn(),W(),oo(),po=class extends nt{constructor(e,t,s=I.getConfig(),i=[]){const n=Symbol("InputboxToken"),r=s.excludes.includes("heading")?s:Le(me({},s),{excludes:[...s.excludes,"heading"]}),{length:l}=i;i.push(n),t&&(t=Qt(t,r,i,e)),t&&(t=$s(t,r,i)),i.splice(l,1),super(e,t,r,i,{})}}}}),cs={};se(cs,{NestedToken:()=>fo});var Pr,Rr,fo,gi=C({"src/nested.ts"(){"use strict";var e,t,s;M(),de(),Ts(),xn(),W(),q(),Eo(),Ue(),Pr=new Set(["comment","include","arg","template","magic-word"]),Rr=[!1,!0].map(i=>{const n=i?"includeonly":"noinclude";return new RegExp(String.raw`^(?:<${n}(?:\s[^>]*)?/?>|</${n}\s*>)$`,"iu")}),fo=(s=class extends j{constructor(n,r,l,o,u=[]){if(typeof r=="boolean"){const d=Symbol("NestedToken"),{length:a}=u;u.push(d),n&&(n=Qt(n,o,u,r)),n&&(n=$s(n,o,u)),u.splice(a,1)}else n&&(n=n.replace(r,(d,a,h,g,c)=>{const p=`\0${u.length+1}e`;return new dt(a,h,g,c,o,!1,u),p}));n&&(n=n.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(d,a,h)=>(new ce(h,o,u),`${a}\0${u.length}n`)));super(n,o,u);N(this,e);N(this,t);L(this,e,[...l]),L(this,t,r)}get type(){return"ext-inner"}lint(n=this.getAbsoluteIndex(),r){{const l=super.lint(n,r),o="no-ignored",{lintConfig:u}=I,d=u.getSeverity(o,this.name);if(!d)return l;const a=new le(this,n),h=typeof f(this,t)=="boolean"?Rr[f(this,t)?1:0]:/^<!--[\s\S]*-->$/u;return[...l,...this.childNodes.filter(g=>{const{type:c,name:p}=g;if(c==="ext")return!f(this,e).includes(p);if(Pr.has(c))return!1;const b=g.toString().trim();return b&&!h.test(b)}).map(g=>{const c=B(g,a,o,I.msg("invalid-content",this.name),d);return u.computeEditInfo&&(c.suggestions=[U(c),an(c,g.toString())]),c})]}}},e=new WeakMap,t=new WeakMap,s)}});function Or(e,t,s,i,n){t=be(t).trim();let r=t.replace(e==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(e){case"width":return!r&&!!t||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(r);case"link":{if(r){if(mo(s.protocol).test(r))return xo(s.protocol).test(r)&&t;r.startsWith("[[")&&r.endsWith("]]")&&(r=r.slice(2,-2))}else return t;const l=I.normalizeTitle(r,0,!1,s,{halfParsed:i,decode:!0,selfLink:!0});return l.valid&&l}case"lang":return(n==="svg"||n==="svgz")&&!/[^a-z\d-]/u.test(r);case"alt":case"class":case"manualthumb":return!0;case"page":return(n==="djvu"||n==="djv"||n==="pdf")&&Number(r)>0;default:return!!r&&!isNaN(r)}}var mo,xo,Br,qr,vo,su=C({"src/imageParameter.ts"(){"use strict";var e,t,bo,n;Ye(),ge(),M(),We(),W(),q(),mo=ht(r=>new RegExp(String.raw`^(?:${r}|//|\0\d+m\x7F)`,"iu")),xo=ht(r=>new RegExp(String.raw`^(?:(?:${r}|//)${ct}|\0\d+m\x7F)${gt}$`,"iu")),Br=ht(r=>new RegExp(String.raw`^(\s*(?!\s))${r.replace("$1","(.*)")}${r.endsWith("$1")?`(?=$|
|
|
11
|
+
)`:""}(\s*)$`,"u")),qr=new Set(["alt","link","lang","page","caption"]),vo=(n=class extends j{constructor(l,o,u,d){var r=(...i)=>(super(...i),N(this,t),N(this,e,""),this);let a;const h=Object.entries(u.img).map(([c,p])=>[c,p,Br(c)]),g=h.find(([,c,p])=>(a=p.exec(l),a&&(a.length!==4||Or(c,a[2],u,!0,o)!==!1)));if(g&&a){a.length===3?(r(void 0,u,d),L(this,e,l)):(r(a[2],u,d,{}),L(this,e,a[1]+g[0]+a[3])),this.setAttribute("name",g[1]),g[1]==="alt"&&this.setAttribute("stage",we-1);return}r(l,u.excludes.includes("list")?u:Le(me({},u),{excludes:[...u.excludes,"list"]}),d),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get type(){return"image-parameter"}get link(){return this.name==="link"?Or("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var l;(l=this.parentNode)!=null&&l.is("gallery-image")&&!qr.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(l){return f(this,e)?f(this,e).replace("$1",super.toString(l)):super.toString(l)}text(){return f(this,e)?f(this,e).replace("$1",super.text()).trim():super.text().trim()}isPlain(){return this.name==="caption"||this.name==="alt"}getAttribute(l){return l==="invalid"?this.name==="invalid":l==="padding"?Math.max(0,f(this,e).indexOf("$1")):super.getAttribute(l)}lint(l=this.getAbsoluteIndex(),o){{const u=super.lint(l,o),{lintConfig:d}=I,{computeEditInfo:a,fix:h}=d,{link:g,name:c}=this;if(c==="invalid"){const p="invalid-gallery",b=d.getSeverity(p,"parameter");if(b){const w=G(this,{start:l},p,"invalid-image-parameter",b);(a||h)&&(w.fix=U(w,-1)),u.push(w)}}else if(typeof g=="object"&&g.encoded){const p="url-encoding",b=d.getSeverity(p,"file");if(b){const w=G(this,{start:l},p,"unnecessary-encoding",b);(a||h)&&(w.fix=ln(w,this)),u.push(w)}}return u}}getValue(){return this.name==="invalid"?this.text():R(this,t,bo).call(this)||super.text()}print(){return f(this,e)?`<span class="wpb-image-parameter${this.name==="invalid"?" wpb-invalid":""}">${f(this,e).replace("$1",`<span class="wpb-image-caption">${ft(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}},e=new WeakMap,t=new WeakSet,bo=function(){return f(this,e)&&!f(this,e).includes("$1")},n)}}),pi,Wr,Mr,fi,mi,xi,zr,vi,vn,wo=C({"src/link/file.ts"(){"use strict";M(),de(),W(),ys(),su(),pi=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),Wr=new Set(["arg"]),Mr=new Set(["template","magic-word"]),fi=new Set(["left","right","center","none"]),mi=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),xi=new Set(["tiff","tif","png","gif","jpg","jpeg","webp","xcf","pdf","svg","djvu"]),zr=e=>{if(e===void 0)return[];const t=/-\{|\}-|\|/gu,s=[];let i=t.exec(e),n=0,r=0;for(;i;){const{0:l,index:o}=i;l!=="|"?n+=l==="-{"?1:-1:n===0&&(s.push(e.slice(r,o)),{lastIndex:r}=t),i=t.exec(e)}return s.push(e.slice(r)),s},vi=(e,t)=>e.filter(({childNodes:s})=>{const i=s.filter(n=>n.text().trim());return i.length!==1||!t.has(i[0].type)}),vn=class extends Oe{get type(){return"file"}get extension(){}constructor(e,t,s,i=[],n="|"){super(e,void 0,s,i,n);const{extension:r}=this.getTitle(!0,!0);this.safeAppend(zr(t).map(l=>new vo(l,r,s,i)))}lint(e=this.getAbsoluteIndex(),t){var s;{const i=super.lint(e,t),n=vi(this.getAllArgs(),Wr),r=[...new Set(n.map(({name:A})=>A))],l=r.filter(A=>pi.has(A)),o=r.filter(A=>fi.has(A)),u=r.filter(A=>mi.has(A)),[d]=l,a=d==="framed"||d==="manualthumb",h=new le(this,e),{lintConfig:g}=I,{computeEditInfo:c,fix:p}=g,{ns:b,extension:w}=this.getAttribute("title"),{firstChild:k}=this;let _="nested-link",v=g.getSeverity(_,"file");if(v&&xi.has(w)&&this.closest("ext-link-text")&&((s=this.getValue("link"))==null?void 0:s.trim())!==""){const A=G(this,h,_,"link-in-extlink",v);if(c||p){const x=this.getArg("link");if(x){const y=e+x.getRelativeIndex();A.fix={desc:I.msg("delink"),range:[y,y+x.toString().length],text:"link="}}else A.fix=bs(A.endIndex-2,"delink","|link=")}i.push(A)}if(_="invalid-gallery",v=g.getSeverity(_,"extension"),v&&b===6&&!w&&!k.querySelector("arg,magic-word,template")&&i.push(G(this,h,_,"missing-extension",v)),v=g.getSeverity(_,"parameter"),v&&a)for(const A of n.filter(({name:x})=>x==="width")){const x=B(A,h,_,"invalid-image-parameter",v);(c||p)&&(x.fix=U(x,-1)),i.push(x)}if(n.length===r.length&&l.length<2&&o.length<2&&u.length<2)return i;_="no-duplicate";const m=["unknownImageParameter","imageParameter"].map(A=>g.getSeverity(_,A)),S=(A,x,y,T=!0)=>A.map($=>{if(v=m[Number(typeof T=="function"?T($):T)],!v)return!1;const E=B($,h,_,I.msg(`${x}-image-parameter`,y),v);return c&&(E.suggestions=[U(E,-1)]),E}).filter($=>$!==!1);for(const A of r){if(A==="invalid"||A==="width"&&a)continue;const x=A==="caption";let y=n.filter(({name:T})=>T===A);if(x&&(y=[...y.slice(0,-1).filter(T=>T.text()),...y.slice(-1)]),y.length>1){let T=!x||!w||xi.has(w);if(x&&T){const $=vi(y,Mr);T=$.length>1&&(E=>$.includes(E))}i.push(...S(y,"duplicate",A,T))}}return l.length>1&&i.push(...S(n.filter(({name:A})=>pi.has(A)),"conflicting","frame")),o.length>1&&i.push(...S(n.filter(({name:A})=>fi.has(A)),"conflicting","horizontal-alignment")),u.length>1&&i.push(...S(n.filter(({name:A})=>mi.has(A)),"conflicting","vertical-alignment")),i}}getAllArgs(){return this.childNodes.slice(1)}getArgs(e){return this.getAllArgs().filter(({name:t})=>e===t)}getArg(e){const t=this.getArgs(e);return t[e==="manualthumb"?0:t.length-1]}getValue(e){var t;return(t=this.getArg(e))==null?void 0:t.getValue()}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t)}}}}),Ur,bi,Hr,ot,yo=C({"src/link/galleryImage.ts"(){"use strict";var e,Xi,s;M(),We(),Me(),W(),q(),wo(),Ur=[je("")],ot=(s=class extends(Hr=vn){constructor(n,r,l,o,u=[]){let d;if(l!==void 0){const{length:a}=u;d=new j(l,o,u);for(let h=0;h<we-1;h++)d.parseOnce();u.splice(a,1)}super(r,d==null?void 0:d.toString(),o,u);N(this,e);Ee(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=`${n}-image`,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(n){const r=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),r?0:6,{halfParsed:!0,temporary:n,decode:!r})}lint(n=this.getAbsoluteIndex(),r){{const l=super.lint(n,r),o="invalid-gallery",{lintConfig:u}=I,d=u.getSeverity(o,"image");if(d&&R(this,e,Xi).call(this)){const a=G(this,{start:n},o,"invalid-gallery",d);u.computeEditInfo&&(a.suggestions=[bs(n,"prefix","File:")]),l.push(a)}return l}}getAttribute(n){return n==="invalid"?R(this,e,Xi).call(this):super.getAttribute(n)}},e=new WeakSet,Xi=function(){const{ns:n}=this.getAttribute("title");return n!==6},s),bi=K(Hr),ot=X(bi,0,"GalleryImageToken",Ur,ot),J(bi,1,ot)}}),So={};se(So,{GalleryToken:()=>Rt});var Dr,wi,Gr,Rt,iu=C({"src/gallery.ts"(){"use strict";var e,ko,nu,i;M(),mn(),W(),q(),yo(),Ue(),Dr=[_s],Rt=(i=class extends(Gr=j){constructor(r,l,o=[]){var u;super(void 0,l,o,{});N(this,e);for(const d of(u=r==null?void 0:r.split(`
|
|
12
|
+
`))!=null?u:[]){const a=/^([^|]+)(?:\|(.*))?/u.exec(d);if(!a){super.insertAt(d.trim()?new ce(d,l,o):d);continue}const[,h,g]=a;R(this,e,ko).call(this,h)?super.insertAt(new ot("gallery",h,g,l,o)):super.insertAt(new ce(d,l,o))}}get type(){return"ext-inner"}get widths(){}get heights(){}lint(r=this.getAbsoluteIndex(),l){{const{top:o,left:u}=this.getRootNode().posFromIndex(r),d=[],a="no-ignored",{lintConfig:h}=I,g=["Image","NoImage","Comment"].map(c=>h.getSeverity(a,`gallery${c}`));for(let c=0;c<this.length;c++){const p=this.childNodes[c],b=p.toString(),{length:w}=b,k=b.trim(),{type:_}=p,v=o+c,m=c?0:u;if(p.setAttribute("aIndex",r),_==="noinclude"&&k&&!/^<!--.*-->$/u.test(k)){let[S]=g;if(k.startsWith("|")?[,S]=g:(k.startsWith("<!--")||k.endsWith("-->"))&&([,,S]=g),S){const A=r+w,x={rule:a,message:I.msg("invalid-content","gallery"),severity:S,startIndex:r,endIndex:A,startLine:v,endLine:v,startCol:m,endCol:m+w};h.computeEditInfo&&(x.suggestions=[U(x),an(x,b)]),d.push(x)}}else if(_!=="noinclude"&&_!=="text"){const S=p.lint(r,l);S.length>0&&d.push(...S)}r+=w+1}return d}}json(r,l=this.getAbsoluteIndex()){const o=super.json(void 0,l)}},e=new WeakSet,ko=function(r){return this.normalizeTitle(r,6,{halfParsed:!0,temporary:!0,decode:!0}).valid},nu=function(r){},i),wi=K(Gr),Rt=X(wi,0,"GalleryToken",Dr,Rt),J(wi,1,Rt)}}),bn,Ao=C({"src/link/index.ts"(){"use strict";Ye(),M(),W(),ys(),bn=class extends Oe{get type(){return"link"}get innerText(){return this.length>1?this.lastChild.text():Ht(this.firstChild.text().replace(/^\s*:?/u,""))}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i="nested-link",{lintConfig:n}=I,r=n.getSeverity(i);if(r&&this.closest("ext-link-text")){const l=G(this,{start:e},i,"link-in-extlink",r);(n.computeEditInfo||n.fix)&&(l.fix=$e(l,"delink",this.innerText)),s.push(l)}return s}}}}}),Vr,Qr,Gt,wn=C({"src/magicLink.ts"(){"use strict";var e,t,Ki,i;M(),ge(),de(),W(),q(),Vr=String.raw`(?:[${Be}\t]| |�*160;|&#[xX]0*[aA]0;)`,Qr=new RegExp(`${Vr}+`,"gu"),Gt=(i=class extends j{constructor(r,l="free-ext-link",o=I.getConfig(),u){super(r,o,u,{});N(this,t);N(this,e);L(this,e,l)}get type(){return f(this,e)}get innerText(){const r=new Map([["!","|"],["=","="]]);let l=Ke(this.childNodes.map(o=>{const{type:u}=o,d=String(o.name);return u==="magic-word"&&r.has(d)?r.get(d):o}));return this.type==="magic-link"&&(l=l.replace(Qr," ")),l}get link(){const{innerText:r}=this;return this.type==="magic-link"?r.startsWith("ISBN")?`ISBN ${r.slice(5).replace(/[- ]/gu,"").replace(/x$/u,"X")}`:r:ql(r).replace(/\n/gu,"%0A")}lint(r=this.getAbsoluteIndex(),l){{const o=super.lint(r,l),u=new le(this,r),{lintConfig:d}=I,{type:a,childNodes:h}=this;if(a==="magic-link"){const b="invalid-isbn",w=d.getSeverity(b);return w&&R(this,t,Ki).call(this)&&o.push(G(this,u,b,"invalid-isbn",w)),o}const g=a==="ext-link-url",c="unterminated-url",p=d.getSeverity(c,g?"pipe":"punctuation");if(p){const b=g?/\|/u:/[,;。:!?()]+/u,w=h.find(k=>k.type==="text"&&b.test(k.data));if(w){const{data:k}=w,_=B(w,u,c,I.msg("in-url",g?'"|"':"full-width-punctuation"),p);if(d.computeEditInfo){const{index:v,0:m}=b.exec(k),S=_.startIndex+v;_.suggestions=g?[Dt(S,1)]:[Dt(S),{desc:I.msg("encode"),range:[S,S+m.length],text:encodeURI(m)}]}o.push(_)}}return o}}getUrl(r){this.lspError("MagicLinkToken.getUrl")}getAttribute(r){return r==="invalid"?R(this,t,Ki).call(this):super.getAttribute(r)}},e=new WeakMap,t=new WeakSet,Ki=function(){if(this.type==="magic-link"){const{link:r}=this;if(r.startsWith("ISBN")){const l=[...r.slice(5)].map(o=>o==="X"?10:Number(o));return l.length===10?l.reduce((o,u,d)=>o+u*(10-d),0)%11!==0:l.length===13&&(l[12]===10||l.reduce((o,u,d)=>o+u*(d%2?3:1),0)%10!==0)}}return!1},i)}}),Jr,yi,Xr,at,_o=C({"src/extLink.ts"(){"use strict";var e,t;We(),M(),Me(),W(),q(),wn(),Jr=[je("[")],at=(t=class extends(Xr=j){constructor(i,n="",r="",l,o=[]){super(void 0,l,o,{});N(this,e);const u=i&&/^\0\d+f\x7F$/u.test(i)?o[Number(i.slice(1,-2))]:new Gt(i,"ext-link-url",l,o);if(this.insertAt(u),L(this,e,n),r){const d=new j(r,l,o,{});d.type="ext-link-text",d.setAttribute("stage",we-1),this.insertAt(d)}}get type(){return"ext-link"}toString(i){return this.length===1?`[${super.toString(i)}${f(this,e)}]`:`[${super.toString(i,f(this,e))}]`}text(){return`[${super.text(" ")}]`}getGaps(){return f(this,e).length}lint(i=this.getAbsoluteIndex(),n){{const r=super.lint(i,n),l="var-anchor",o=I.lintConfig.getSeverity(l,"extLink");return o&&this.length===1&&this.closest("heading-title")&&r.push(G(this,{start:i},l,"variable-anchor",o)),r}}print(){return super.print(this.length===1?{pre:"[",post:`${f(this,e)}]`}:{pre:"[",sep:f(this,e),post:"]"})}},e=new WeakMap,t),yi=K(Xr),at=X(yi,0,"ExtLinkToken",Jr,at),J(yi,1,at)}}),Yi,ru=C({"src/imagemapLink.ts"(){"use strict";q(),Ue(),Ao(),_o(),Yi=class extends j{get type(){return"imagemap-link"}constructor(e,t,s,i,n=[]){super(void 0,i,n),this.append(e,t.length===2?new bn(...t,i,n):new at(...t,i,n),new ce(s,i,n))}}}}),$o={};se($o,{ImagemapToken:()=>Ot});var Kr,Si,Yr,Ot,lu=C({"src/imagemap.ts"(){"use strict";M(),Ne(),de(),mn(),W(),q(),Ue(),yo(),ru(),Kr=[_s],Ot=class extends(Yr=j){get type(){return"ext-inner"}get image(){return this.childNodes.find(Cs("imagemap-image"))}constructor(e,t=I.getConfig(),s=[]){if(super(void 0,t,s,{}),!e)return;const i=e.split(`
|
|
13
|
+
`),n=new Set(t.protocol.split("|")),r=ce;let l=!0,o=!1;for(const u of i){const d=u.trim();if(!(o||!d||d.startsWith("#"))){if(l){const a=u.indexOf("|"),h=a===-1?u:u.slice(0,a),{valid:g,ns:c}=this.normalizeTitle(h,0,{halfParsed:!0,temporary:!0});if(g&&c===6){const p=new ot("imagemap",h,a===-1?void 0:u.slice(a+1),t,s);super.insertAt(p),l=!1;continue}else o=!0}else if(u.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(u);continue}else if(u.includes("[")){const a=u.indexOf("["),h=u.slice(a),g=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(h);if(g){if(this.normalizeTitle(g[1],0,{halfParsed:!0,temporary:!0,selfLink:!0}).valid){super.insertAt(new Yi(u.slice(0,a),g.slice(1),h.slice(h.indexOf("]]")+2),t,s));continue}}else if(h.startsWith("[//")||n.has(h.slice(1,h.indexOf(":")+1))||n.has(h.slice(1,h.indexOf("//")+2))){const c=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(h);if(c){super.insertAt(new Yi(u.slice(0,a),c.slice(1),h.slice(h.indexOf("]")+1),t,s));continue}}}}super.insertAt(new r(u,t,s))}}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new le(this,e),{childNodes:n,image:r}=this,l="invalid-imagemap",{lintConfig:o}=I,u=o.getSeverity(l,r?"link":"image");return u&&(r?s.push(...n.filter(d=>{const a=d.toString().trim();return d.is("noinclude")&&a&&!a.startsWith("#")}).map(d=>{const a=B(d,i,l,"invalid-imagemap-link",u);return o.computeEditInfo&&(a.suggestions=[U(a,-1),$e(a,"comment","# ")]),a})):s.push(G(this,i,l,"imagemap-without-image",u))),s}}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}},Si=K(Yr),Ot=X(Si,0,"ImagemapToken",Kr,Ot),J(Si,1,Ot)}}),Zr,ki,el,ut,To=C({"src/nowiki/comment.ts"(){"use strict";M(),bt(),Me(),W(),tt(),Zr=[Ze(!1),je("<!--")],ut=class extends(el=Te){constructor(t,s,i,n){super(t,i,n);Ee(this,"closed");this.closed=s}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){{if(this.closed)return[];const s="unclosed-comment",{lintConfig:i}=I,n=i.getSeverity(s);if(!n)return[];const r=G(this,{start:t},s,"unclosed-comment",n);return i.computeEditInfo&&(r.suggestions=[qe(r.endIndex,"-->")]),[r]}}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}},ki=K(el),ut=X(ki,0,"CommentToken",Zr,ut),J(ki,1,ut)}}),Co={};se(Co,{CommentedToken:()=>Io});var Io,ou=C({"src/commented.ts"(){"use strict";q(),To(),Io=class extends j{get type(){return"ext-inner"}constructor(e,t,s=[]){if(super(void 0,t,s,{AstText:":",CommentToken:":"}),e){let i=e.indexOf("<!--"),n=i!==-1&&e.indexOf("-->",i+4),r=0;for(;n!==!1&&n!==-1;)i>r&&this.insertAt(e.slice(r,i)),this.insertAt(new ut(e.slice(i+4,n),!0,t,s)),r=n+3,i=e.indexOf("<!--",r),n=i!==-1&&e.indexOf("-->",i+4);r<e.length&&this.insertAt(e.slice(r))}}lint(e=this.getAbsoluteIndex()){return super.lint(e,new RegExp(String.raw`<\s*(?:\/\s*)?(${this.name})\b`,"giu"))}}}}),No={};se(No,{NowikiToken:()=>Lo});var tl,sl,Lo,au=C({"src/nowiki/index.ts"(){"use strict";var e,Zi,s;Ye(),M(),W(),tt(),tl=ht(i=>new RegExp(String.raw`<\s*(?:/\s*)${i==="nowiki"?"":"?"}(${i})\b`,"giu")),sl=new Set(["languages","section","templatestyles"]),Lo=(s=class extends Te{constructor(){super(...arguments);N(this,e)}get type(){return"ext-inner"}lint(n=this.getAbsoluteIndex()){{const{name:r}=this,l="void-ext",{lintConfig:o}=I,u=o.getSeverity(l,r);if(u&&R(this,e,Zi).call(this)){const d=G(this,{start:n},l,I.msg("nothing-in",r),u);return o.computeEditInfo&&(d.suggestions=[U(d)]),[d]}return super.lint(n,tl(r))}}getAttribute(n){return n==="invalid"?R(this,e,Zi).call(this):super.getAttribute(n)}},e=new WeakSet,Zi=function(){const{name:n,firstChild:{data:r}}=this;return sl.has(n)&&!!r},s)}}),il,Ai,nl,dt,Eo=C({"src/tagPair/ext.ts"(){"use strict";M(),de(),W(),pn(),q(),gn(),fn(),il=[ks()],dt=class extends(nl=Je){get type(){return"ext"}constructor(e,t,s,i,n=I.getConfig(),r=!1,l=[]){const o=e.toLowerCase(),u=new As(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",o,n,l),d=Le(me({},n),{ext:n.ext.filter(h=>h!==o),excludes:[...n.excludes],inExt:!0});let a;switch(o){case"tab":d.ext=d.ext.filter(h=>h!=="tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":o==="poem"&&d.excludes.push("heading"),a=new j(s,d,l);break;case"pre":{const{PreToken:h}=(Ja(),Q(no));a=new h(s,d,l);break}case"dynamicpagelist":{const{ParamTagToken:h}=(oo(),Q(lo));a=new h(r,s,d,l);break}case"inputbox":{const{InputboxToken:h}=(tu(),Q(go));a=new h(r,s,d,l);break}case"references":{const{NestedToken:h}=(gi(),Q(cs));d.excludes.push("heading"),a=new h(s,r,["ref"],d,l);break}case"choose":{const{NestedToken:h}=(gi(),Q(cs));a=new h(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],d,l);break}case"combobox":{const{NestedToken:h}=(gi(),Q(cs));a=new h(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],d,l);break}case"gallery":{const{GalleryToken:h}=(iu(),Q(So));a=new h(s,d,l);break}case"imagemap":{const{ImagemapToken:h}=(lu(),Q($o));a=new h(s,d,l);break}case"hiero":{const{CommentedToken:h}=(ou(),Q(Co));a=new h(s,d,l);break}default:{const{NowikiToken:h}=(au(),Q(No));a=new h(s,d,l)}}a.setAttribute("name",o),a.type==="plain"&&(a.type="ext-inner"),super(e,u,a,i,n,l),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),{lintConfig:i}=I,n=new le(this,e);if(this.name!=="nowiki"){const o=this.inHtmlAttrs(),u="parsing-order",d=o&&i.getSeverity(u,o===2?"ext":"templateInTable");d&&s.push(G(this,n,u,"ext-in-html",d))}const r="var-anchor",l=i.getSeverity(r,"ref");return l&&this.name==="ref"&&this.closest("heading-title")&&s.push(G(this,n,r,"variable-anchor",l)),s}}},Ai=K(nl),dt=X(Ai,0,"ExtToken",il,dt),J(Ai,1,dt)}}),Fo={};se(Fo,{parseCommentAndExt:()=>Qt});var _i,rl,ss,ll,$i,Qt,Ts=C({"parser/commentAndExt.ts"(){"use strict";Ye(),ge(),Ha(),Ue(),Da(),Ga(),Eo(),To(),_i="<onlyinclude>",rl="</onlyinclude>",{length:ss}=_i,ll=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",s=e?"noinclude":"includeonly";return Ml(i=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${i.join("|")})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(${"\\1"}\s*)>)|<(${s})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${s}\s*)>|$))`,"giu"))}),$i=e=>{const t=e.indexOf(_i);return{i:t,j:e.indexOf(rl,t+ss)}},Qt=(e,t,s,i)=>{if(i){let{i:o,j:u}=$i(e);if(o!==-1&&u!==-1){let d="";const a=h=>{new ce(h,t,s),d+=`\0${s.length-1}n`};for(;o!==-1&&u!==-1;){const h=`\0${s.length}e`;new Et(e.slice(o+ss,u),t,s),o>0&&a(e.slice(0,o)),d+=h,e=e.slice(u+ss+1),{i:o,j:u}=$i(e)}return e&&a(e),d}}const{ext:n}=t,r=n.filter(o=>o!=="translate"&&o!=="tvar"),l=Le(me({},t),{ext:r});if(n.includes("translate")){const o=[];e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,u=>(o.push(u),`\0${o.length-1}`)).replace(/<translate( nowrap)?>([\s\S]+?)?<\/translate>/gu,(u,d,a)=>{const h=s.length;return new Kl(d,a&&Se(a,o),l,s),`\0${h}g`}),e=Se(e,o)}return e.replace(ll[i?1:0](r),(o,u,d,a,h,g,c,p,b)=>{const w=s.length;let k="n";if(u)k="e",new dt(u,d,a,h,l,g,s);else if(o.startsWith("<!--")){k="c";const _=o.endsWith("-->");new ut(Se(o,s,1).slice(4,_?-3:void 0),_,t,s)}else g?new Ft(g,c&&Se(c,s,1),p&&Se(p,s,1),b,t,s):new ce(o,t,s);return`\0${w}${k}`})}}}),ol,al,ul,dl,Ti,hl,Bt,uu=C({"src/html.ts"(){"use strict";var e,t,s,i,n;M(),Ne(),de(),pn(),W(),q(),ol=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),al=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"]),ul=new Set(["strike","big","center","font","tt"]),dl=[ks()],Bt=(n=class extends(hl=j){constructor(l,o,u,d,a,h){super(void 0,a,h);N(this,e);N(this,t);N(this,s);N(this,i);this.insertAt(o),this.setAttribute("name",l.toLowerCase()),L(this,e,u),L(this,t,d),L(this,s,l)}get type(){return"html"}get selfClosing(){return f(this,t)}get closing(){return f(this,e)}toString(l){return`<${this.closing?"/":""}${f(this,s)}${super.toString(l)}${f(this,t)?"/":""}>`}text(){const{closing:l}=this,o=f(this,s)+(l?"":super.text());return`<${l?"/":""}${o}${f(this,t)?"/":""}>`}getAttribute(l){return l==="invalid"?this.inTableAttrs()===2:l==="padding"?f(this,s).length+(this.closing?2:1):super.getAttribute(l)}lint(l=this.getAbsoluteIndex(),o){var u;{const d=super.lint(l,o),{name:a,parentNode:h,closing:g,selfClosing:c}=this,p=new le(this,l),{lintConfig:b}=I,{computeEditInfo:w,fix:k}=b,_=this.inTableAttrs();let v="h1",m=b.getSeverity(v,"html");if(m&&a==="h1"&&!g){const $=G(this,p,v,"<h1>",m);w&&($.suggestions=[{desc:"h2",range:[l+2,l+3],text:"2"}]),d.push($)}if(v="parsing-order",m=_&&b.getSeverity(v,_===2?"html":"templateInTable"),m){const $=G(this,p,v,"html-in-table",m);w&&_===2&&($.suggestions=[U($)]),d.push($)}if(v="obsolete-tag",m=b.getSeverity(v,a),m&&ul.has(a)&&d.push(G(this,p,v,"obsolete-tag",m)),v="bold-header",m=b.getSeverity(v,a),m&&(a==="b"||a==="strong")&&((u=this.closest("heading-title,ext"))==null?void 0:u.type)==="heading-title"){const $=G(this,p,v,"bold-in-header",m);w&&($.suggestions=[U($)]),d.push($)}const{html:[,S,A]}=this.getAttribute("config"),x=A.includes(a),y=S.includes(a),T=!x&&!y;if(v="unmatched-tag",g&&(c||x)||c&&T){if(m=b.getSeverity(v,g?"both":"selfClosing"),m){const $=G(this,p,v,g?"closing-and-self-closing":"invalid-self-closing",m);if(w||k){const E=on(l),F={desc:I.msg("no-self-closing"),range:[$.endIndex-2,$.endIndex-1],text:""};y?w&&($.suggestions=[E,F]):g?$.fix=x?E:F:w&&($.suggestions=[F,qe($.endIndex,`></${a}>`,-2)])}d.push($)}}else if(!this.findMatchingTag()){const $=G(this,p,v,g?"unmatched-closing":"unclosed-tag"),E=this.closest("magic-word");if(E&&ol.has(E.name))m=b.getSeverity(v,"conditional");else if(g)m=b.getSeverity(v,"closing"),$.suggestions=[U($)];else{m=b.getSeverity(v,"opening");const F=h==null?void 0:h.childNodes;al.has(a)&&(F!=null&&F.slice(0,F.indexOf(this)).some(P=>P.type==="html"&&P.name===a&&!P.findMatchingTag())&&($.suggestions=[qe(l+1,"/")]),this.closest("heading-title")&&($.rule="format-leakage",m=b.getSeverity("format-leakage",a)))}m&&($.severity=m,d.push($))}return d}}findMatchingTag(){return Xe(f(this,i),()=>{const{name:l,parentNode:o,closing:u,selfClosing:d}=this,{html:[,a,h]}=this.getAttribute("config"),g=h.includes(l),c=a.includes(l);if(g||c&&d)return this;if(!o)return;const{childNodes:p}=o,b=p.indexOf(this),w=u?p.slice(0,b).reverse():p.slice(b+1),k=[this],{rev:_}=ke;for(const v of w)if(!(!v.is("html")||v.name!==l||c&&f(v,t)))if(f(v,e)===u)k.push(v);else{const m=k.pop();if(m===this)return v;I.viewOnly&&(L(m,i,[_,v]),L(v,i,[_,m]))}if(I.viewOnly)for(const v of k)L(v,i,[_,void 0])},l=>{L(this,i,l),l[1]&&l[1]!==this&&L(l[1],i,[ke.rev,this])})}print(){return super.print({pre:`<${this.closing?"/":""}${f(this,s)}`,post:`${f(this,t)?"/":""}>`})}json(l,o=this.getAbsoluteIndex()){const u=super.json(void 0,o)}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n),Ti=K(hl),Bt=X(Ti,0,"HtmlToken",dl,Bt),J(Ti,1,Bt)}}),jo={};se(jo,{parseHtml:()=>Po});var cl,Po,du=C({"parser/html.ts"(){"use strict";fn(),uu(),cl=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,Po=(e,t,s)=>{var l;const{html:i}=t;(l=t.htmlElements)!=null||(t.htmlElements=new Set([...i[0],...i[1],...i[2]]));const n=e.split("<");let r=n.shift();for(const o of n){const u=cl.exec(o),d=u==null?void 0:u[2],a=d==null?void 0:d.toLowerCase();if(!u||!t.htmlElements.has(a)){r+=`<${o}`;continue}const[,h,,g="",c,p]=u,{length:b}=s,w=new As(g,"html-attrs",a,t,s),k=w.hasAttr("itemprop");if(a==="meta"&&!(k&&w.hasAttr("content"))||a==="link"&&!(k&&w.hasAttr("href"))){r+=`<${o}`,s.length=b;continue}r+=`\0${s.length}x${p}`,new Bt(d,w,h==="/",c==="/>",t,s)}return r}}}),yn,Ro=C({"src/table/base.ts"(){"use strict";pn(),q(),wt(),fn(),yn=class extends ks(1)(j){constructor(e,t,s,i,n,r=[],l){super(void 0,n,r,l),this.append(new et(t,"table-syntax",n,r),new As(i,"table-attrs",s,n,r))}escape(){}}}}),gl,Ci,_e,is,Tt,Ct,xs,Oo=C({"src/table/td.ts"(){"use strict";M(),de(),cn(),W(),q(),Ro(),xs=class extends(Ci=yn,gl=[ws(!1)],Ci){constructor(e,t,s,i=[]){var o;let n=/\||\0\d+!\x7F/u.exec(t!=null?t:""),r=n?t.slice(0,n.index):"";/\[\[|-\{/u.test(r)&&(n=null,r=""),super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",r,s,i),J(is,5,this),Re(this,Tt),Re(this,_e,""),n&&([ja(this,_e)._]=n);const l=new j(t==null?void 0:t.slice(((o=n==null?void 0:n.index)!=null?o:NaN)+he(this,_e).length),s,i);l.type="td-inner",l.setAttribute("stage",4),this.insertAt(l)}get type(){return"td"}get rowspan(){return this.getAttr("rowspan")}get colspan(){return this.getAttr("colspan")}get subtype(){return Ui(this,Tt,Ct).call(this).subtype}afterBuild(){he(this,_e).includes("\0")&&ye(this,_e,this.buildFromStr(he(this,_e),0)),super.afterBuild()}toString(e){const{childNodes:[t,s,i]}=this;return t.toString(e)+s.toString(e)+he(this,_e)+i.toString(e)}text(){const{childNodes:[e,t,s]}=this;return e.text()+t.text()+he(this,_e)+s.text()}getGaps(e){return e===1?he(this,_e).length:0}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new le(this,e+this.getRelativeIndex(this.length-1)),n="pipe-like",{lintConfig:r}=I,{computeEditInfo:l,fix:o}=r,u=["td","double"].map(d=>r.getSeverity(n,d));for(const d of this.lastChild.childNodes)if(d.type==="text"){const{data:a}=d;if(a.includes("|")){const h=a.includes("||"),g=u[h?1:0];if(g){const c=B(d,i,n,"pipe-in-table",g);if(l||o)if(h){const p={caption:"|+",td:"|",th:"!"}[this.subtype];c.fix=$e(c,"newline",a.replace(/\|\|/gu,`
|
|
14
|
+
${p}`))}else l&&(c.suggestions=[dn(c.startIndex,a)]);s.push(c)}}}return s}}isIndependent(){return this.firstChild.text().startsWith(`
|
|
15
|
+
`)}getAttr(e){const t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}escape(){}print(){const{childNodes:[e,t,s]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${he(this,_e)}${s.print()}</span>`}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t)}},is=K(Ci),_e=new WeakMap,Tt=new WeakSet,Ct=function(){var e;const t=this.firstChild.text(),s=t.slice(-1);let i="td";if(s==="!"?i="th":s==="+"&&(i="caption"),this.isIndependent())return{subtype:i};const{previousSibling:n}=this;return me({},Ui(e=n,Tt,Ct).call(e))},Ct=X(is,17,"#getSyntax",gl,Tt,Ct),nn(is,xs)}}),Sn,Bo=C({"src/table/trBase.ts"(){"use strict";M(),W(),Ro(),Oo(),Sn=class extends yn{lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=this.childNodes.find(({type:o})=>o==="table-inter");if(!i)return s;const n=zt(i),r="fostered-content",l=n&&I.lintConfig.getSeverity(r,n===2?void 0:"transclusion");if(l){const o=B(i,{start:e},r,"content-outside-table",l);o.startIndex++,o.startLine++,o.startCol=0,s.push(o)}return s}}getRowCount(){return Number(this.childNodes.some(e=>e instanceof xs&&e.isIndependent()&&!e.firstChild.text().endsWith("+")))}}}}),pl,fl,ml,xl,Ii,ns,gs,hu=C({"src/table/index.ts"(){"use strict";M(),Ne(),de(),cn(),W(),Bo(),wt(),pl=(e,t)=>new Array(e).fill(void 0).map((s,i)=>t(i)),fl=({type:e})=>e==="tr"||e==="table-syntax",ml=class extends Array{},gs=class extends(Ii=Sn,xl=[ws(!1)],Ii){constructor(e,t,s,i){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,"table",t,s,i,{}),J(ns,5,this)}get type(){return"table"}get closed(){return this.lastChild.is("table-syntax")}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new le(this,e),n=["unclosed-table","table-layout"],r=n.map(l=>I.lintConfig.getSeverity(l));if(r[0]&&!this.closed&&s.push(B(this.firstChild,i,n[0],"unclosed-table",r[0])),r[1]){const l=this.getLayout(),{length:o}=l;if(o>1){let u=1,d=1/0,a=0;for(;a<o;a++){const h=l[a],g=h.length;if(g<u)break;g<d&&(d=g);const c=h.indexOf(h[g-1])+1;if(c>d)break;c>u&&(u=c)}if(a<o){const h=this.getNthRow(a),g=B(h,i,n[1],"inconsistent-table",r[1]);g.startIndex++,g.startLine++,g.startCol=0,s.push(g)}}}return s}}close(e=`
|
|
16
|
+
|}`,t){const s=this.getAttribute("config"),i=this.getAttribute("accum");ke.run(()=>{const n=new et(t?e:void 0,"table-syntax",s,i);super.insertAt(n)})}getLayout(e){const t=this.getAllRows(),{length:s}=t,i=ml.from(pl(s,()=>[]));for(let n=0;n<i.length;n++){const r=i[n];let l=0,o=0,u;for(const d of t[n].childNodes.slice(2))if(d.is("td")){if(d.isIndependent()&&(u=d.subtype!=="caption"),u){const a={row:n,column:l},{rowspan:h,colspan:g}=d;for(l++;r[o];)o++;for(let c=n;c<Math.min(n+h,s);c++)for(let p=o;p<o+g;p++)i[c][p]=a;o+=g}}else if(fl(d))break}return i}getAllRows(){return[...super.getRowCount()?[this]:[],...this.childNodes.slice(1).filter(e=>e.is("tr")&&e.getRowCount()>0)]}getNthRow(e,t,s){const i=super.getRowCount();if(e===0&&i)return this;i&&e--;for(const n of this.childNodes.slice(2)){const{type:r}=n;if(r==="tr"&&n.getRowCount()&&(e--,e<0))return n}}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t)}},ns=K(Ii),X(ns,1,"getLayout",xl,gs),nn(ns,gs)}}),qo,cu=C({"src/table/tr.ts"(){"use strict";Bo(),qo=class extends Sn{get type(){return"tr"}constructor(e,t,s,i){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,e,"tr",t,s,i)}}}}),kn,Wo=C({"src/nowiki/listBase.ts"(){"use strict";tt(),kn=class extends Te{get indent(){}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t)}}}}),An,Mo=C({"src/nowiki/dd.ts"(){"use strict";Wo(),An=class extends kn{get type(){return"dd"}}}}),zo={};se(zo,{parseTable:()=>Uo});var vl,Ni,Uo,gu=C({"parser/table.ts"(){"use strict";q(),hu(),cu(),Oo(),Mo(),vl=e=>e.lastChild.constructor!==j,Ni=(e,t)=>e.is("td")?t.pop():e,Uo=({firstChild:{data:e},type:t,name:s},i,n)=>{const r=[],l=e.split(`
|
|
17
17
|
`);let o=t==="root"||t==="parameter-value"||t==="ext-inner"&&s==="poem"?"":`
|
|
18
|
-
${l.shift()}`,
|
|
19
|
-
${
|
|
20
|
-
${
|
|
21
|
-
${
|
|
22
|
-
${
|
|
23
|
-
${
|
|
24
|
-
${
|
|
25
|
-
`)&&(v=me(g).trim());const{ns:b,valid:S}=k.normalizeTitle(v,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0});if(S){if(h){if(b!==6){l+=`[[${p}`;continue}let A=!1;for(a++;a<r.length;a++){const T=r[a],x=T.split("]]");if(x.length>2){A=!0,g+=`[[${x[0]}]]${x[1]}`,c=x.slice(2).join("]]");break}else if(x.length===2)g+=`[[${x[0]}]]${x[1]}`;else{g+=`[[${T}`;break}}if(g=Xi(g,t,s,i),!A){l+=`[[${u}${d}${g}`;continue}}}else{l+=`[[${p}`;continue}g&&(g=Sn(g,t,s,i));let y=mn;f||(b===6?(g&&(g=kn(g,t,s,!0)),y=fn):b===14&&(y=Qo)),g===void 0&&d&&(g=""),l+=`\0${s.length}l${c}`,new y(u,g,t,s,d)}return l}}}),Xo={};te(Xo,{parseMagicLinks:()=>Ko});var Ci,Ii,Ni,Li,Ko,vu=_({"parser/magicLinks.ts"(){"use strict";de(),xn(),Ci=String.raw`[${Re}\t]| |�*160;|�*a0;`,Ii=`(?:${Ci})+`,Ni=`(?:${Ci}|-)`,Li=String.raw`(?:RFC|PMID)${Ii}\d+\b|ISBN${Ii}(?:97[89]${Ni}?)?(?:\d${Ni}?){9}[\dx]\b`,Ko=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${ut}${dt})|${Li})`,"giu")}catch(i){t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${ut}${dt})|${Li})`,"giu")}return e.replace(t.regexMagicLinks,(i,n,r)=>{let l=n?i.slice(n.length):i;if(r){let o="";const a=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(l);a&&(o=l.slice(a.index),l=l.slice(0,a.index));const h=l.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,u=h.exec(l);if(u){let d=1;u[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(l.slice(0,u.index))&&(d=2),o=l.slice(u.index+d)+o,l=l.slice(0,u.index+d)}return o.length>=r.length?i:(new Ht(l,void 0,t,s),`${n}\0${s.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(l))return i;return new Ht(l,"magic-link",t,s),`${n}\0${s.length-1}i`})}}}),Yo,bu=_({"util/html.ts"(){"use strict";Yo=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,i)=>s!==e[i])}}),Zo,wu=_({"src/nowiki/list.ts"(){"use strict";Ro(),Zo=class extends wn{get type(){return"list"}}}}),ea={};te(ea,{parseList:()=>ta});var ta,yu=_({"parser/list.ts"(){"use strict";bu(),wu(),Oo(),ta=(e,t,s,i)=>{const n=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!n)return t.lastPrefix="",e;const[r,l,o,a]=n,h=o.replace(/;/gu,":"),u=Yo(h,t.lastPrefix),d=((u>1?o.slice(u-1):o)+a).split(/(?=;)/u),g=d[0].startsWith(";");let c=d.length-(g?0:1);if(u>1){const C=o.slice(0,u-1);if(g){const U=C.split(/(?=;)/u);d.unshift(...U),c+=C.includes(";")?U.length:0}else d[0]=C+d[0]}t.lastPrefix=h;let p=l+d.map((C,U)=>`\0${i.length+U}d`).join("")+e.slice(r.length);for(const C of d)new Zo(C,s,i);if(!c)return p;const{html:[w,,v]}=s,f=/:+|-\{|\0\d+[xq]\x7F/gu;let b=f,S=b.exec(p),y=0,A=!1,T=!1,x=0;const $=(C,U)=>(new yn(C,s,i),`${p.slice(0,U)}\0${i.length-1}d${p.slice(U+C.length)}`),I=C=>{C?y&&y--:y++};for(;S&&c;){const{0:C,index:U}=S;if(C==="-{"){if(!x){const{lastIndex:R}=b;b=/-\{|\}-/gu,b.lastIndex=R}x++}else if(C==="}-"){if(x--,!x){const{lastIndex:R}=b;b=f,b.lastIndex=R}}else if(C.endsWith("x")){const{name:R,closing:P,selfClosing:W}=i[Number(C.slice(1,-2))];(w.includes(R)||!W&&!v.includes(R))&&I(P)}else if(C.endsWith("q")){const{bold:R,italic:P}=i[Number(C.slice(1,-2))];R&&(I(A),A=!A),P&&(I(T),T=!T)}else if(y===0){if(C.length>=c)return $(C.slice(0,c),U);c-=C.length,b.lastIndex=U+4+String(i.length).length,p=$(C,U)}S=b.exec(p)}return p}}}),is,xl,Fi,vl,Bt,Su=_({"src/converterFlags.ts"(){"use strict";var e,t;z(),oe(),vs(),q(),B(),qe(),is=new Set(["A","T","R","D","-","H","N"]),xl=[Dt()],Bt=(t=class extends(vl=E){constructor(i,n,r=[]){super(void 0,n,r,{});N(this,e);this.safeAppend(i.map(l=>new ge(l,"converter-flag",n,r)))}get type(){return"converter-flags"}afterBuild(){L(this,e,this.childNodes.map(i=>i.text().trim())),super.afterBuild()}toString(i){return super.toString(i,";")}text(){return super.text(";")}getUnknownFlags(){return new Set(m(this,e).filter(i=>/\{{3}[^{}]+\}{3}/u.test(i)))}getVariantFlags(){const i=new Set(this.getAttribute("config").variants);return new Set(m(this,e).filter(n=>i.has(n)))}isInvalidFlag(i,n,r,l){return typeof i=="object"&&(i=i.text().trim(),n=this.getVariantFlags(),r=this.getUnknownFlags(),l=new Set(m(this,e).filter(o=>is.has(o)))),!!i&&!n.has(i)&&!r.has(i)&&(n.size>0||!l.has(i))}lint(i=this.getAbsoluteIndex(),n){{const r=this.getVariantFlags(),l=this.getUnknownFlags(),o=new Set(m(this,e).filter(c=>is.has(c))),a=m(this,e).filter(c=>!c).length,h=m(this,e).length-l.size-a,u=super.lint(i,n);if(r.size===h||o.size===h)return u;const d="no-ignored",g=k.lintConfig.getSeverity(d,"conversionFlag");if(g){const c=new ie(this,i);for(let p=0;p<this.length;p++){const w=this.childNodes[p],v=w.text().trim();if(this.isInvalidFlag(v,r,l,o)){const f=O(w,c,d,"invalid-conversion-flag",g);r.size===0&&is.has(v.toUpperCase())?f.fix=ln(f,v):f.suggestions=[D(f,p&&-1)],u.push(f)}}}return u}}print(){return super.print({sep:";"})}},e=new WeakMap,t),Fi=Y(vl),Bt=K(Fi,0,"ConverterFlagsToken",xl,Bt),X(Fi,1,Bt)}}),hs,ku=_({"src/converterRule.ts"(){"use strict";q(),B(),qe(),hs=class extends E{get type(){return"converter-rule"}get variant(){}constructor(e,t=!0,s=k.getConfig(),i=[]){super(void 0,s,i);const n=e.indexOf(":"),r=e.slice(0,n).indexOf("=>"),l=r===-1?e.slice(0,n):e.slice(r+2,n);t&&s.variants.includes(l.trim().toLowerCase())?(super.insertAt(new ge(l,"converter-rule-variant",s,i)),super.insertAt(new ge(e.slice(n+1),"converter-rule-to",s,i)),r!==-1&&super.insertAt(new ge(e.slice(0,r),"converter-rule-from",s,i),0)):super.insertAt(new ge(e,"converter-rule-to",s,i))}toString(e){const{childNodes:t,firstChild:s,lastChild:i}=this;return t.length===3?`${s.toString(e)}=>${t[1].toString(e)}:${i.toString(e)}`:super.toString(e,":")}text(){const{childNodes:e,firstChild:t,lastChild:s}=this;return e.length===3?`${t.text()}=>${e[1].text()}:${s.text()}`:super.text(":")}getGaps(e){return e===0&&this.length===3?2:1}print(){const{childNodes:e}=this;if(e.length===3){const[t,s,i]=e;return`<span class="wpb-converter-rule">${t.print()}=>${s.print()}:${i.print()}</span>`}return super.print({sep:":"})}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t)}}}}),bl,Ei,wl,qt,Au=_({"src/converter.ts"(){"use strict";de(),Be(),Le(),B(),Su(),ku(),bl=[_e,Fe("-{")],qt=class extends(wl=E){get type(){return"converter"}constructor(e,t,s,i=[]){super(void 0,s,i),this.insertAt(new Bt(e,s,i));const[n]=t,r=n.includes(":"),l=new hs(n,r,s,i);r&&l.length===1||!r&&t.length===2&&!me(t[1]).trim()?this.insertAt(new hs(t.join(";"),!1,s,i)):this.append(l,...t.slice(1).map(o=>new hs(o,!0,s,i)))}toString(e){const{childNodes:[t,...s]}=this;return`-{${t.toString(e)}${t.length>0?"|":""}${s.map(i=>i.toString(e)).join(";")}}-`}text(){const{childNodes:[e,...t]}=this;return`-{${e.text()}|${Qe(t,";")}}-`}getGaps(e){return e||this.firstChild.length>0?1:0}print(){const{childNodes:[e,...t]}=this;return`<span class="wpb-converter">-{${e.print()}${e.length>0?"|":""}${ct(t,{sep:";"})}}-</span>`}},Ei=Y(wl),qt=K(Ei,0,"ConverterToken",bl,qt),X(Ei,1,qt)}}),sa={};te(sa,{parseConverter:()=>ia});var ia,_u=_({"parser/converter.ts"(){"use strict";Au(),ia=(e,t,s)=>{var a;(a=t.regexConverter)!=null||(t.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${t.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"iu"));const i=/-\{/gu,n=/-\{|\}-/gu,r=[];let l=i,o=l.exec(e);for(;o;){const{0:h,index:u}=o;if(h==="}-"){const d=r.pop(),{length:g}=s,c=e.slice(d.index+2,u),p=c.indexOf("|"),[w,v]=p===-1?[[],c]:[c.slice(0,p).split(";"),c.slice(p+1)],f=v.replace(/(&[#a-z\d]+);/giu,"$1"),b=f.split(t.regexConverter).map(S=>S.replace(/\x01/gu,";"));new qt(w,b,t,s),e=`${e.slice(0,d.index)}\0${g}v${e.slice(u+2)}`,r.length===0&&(l=i),l.lastIndex=d.index+3+String(g).length}else r.push(o),l=n,l.lastIndex=u+2;o=l.exec(e)}return e}}}),ps={};te(ps,{Token:()=>E});var yl,E,B=_({"src/index.ts"(){"use strict";var e,t,s,i,n,r,l,o,na,ra,la,oa,aa,ua,da,ha,ca,ga,pa,fa,y;de(),Je(),z(),$e(),q(),Oa(),Ba(),yl=["category","html-attr#id,ext-attr#id,table-attr#id"],E=(y=class extends Ct{constructor(x,$=k.getConfig(),I=[],C){super();N(this,o);N(this,e,"plain");N(this,t,0);N(this,s);N(this,i);N(this,n);N(this,r,!1);N(this,l);typeof x=="string"&&this.insertAt(x),L(this,s,$),L(this,i,I),I.push(this)}get type(){return m(this,e)}set type(x){L(this,e,x)}parseOnce(x=m(this,t),$=!1,I){if(x<m(this,t)||this.length===0||!this.isPlain())return this;if(m(this,t)>=be)return this;switch(x){case 0:if(this.type==="root"){m(this,i).pop();const C=j(this,o,na).call(this);$&&($=!C)}L(this,n,$),j(this,o,ra).call(this,$);break;case 1:j(this,o,la).call(this);break;case 2:j(this,o,oa).call(this);break;case 3:j(this,o,aa).call(this);break;case 4:j(this,o,ua).call(this);break;case 5:j(this,o,da).call(this,I);break;case 6:j(this,o,ha).call(this,I);break;case 7:j(this,o,ca).call(this);break;case 8:j(this,o,ga).call(this);break;case 9:j(this,o,pa).call(this);break;case 10:j(this,o,fa).call(this)}if(this.type==="root")for(const C of m(this,i))C==null||C.parseOnce(x,$,I);return Fn(this,t)._++,this}buildFromStr(x,$){const I=x.split(/[\0\x7F]/u).map((C,U)=>{if(U%2===0)return new Hi(C);if(isNaN(C.slice(-1)))return m(this,i)[Number(C.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${C}`)});return $===0?I.map(String).join(""):$===1?Qe(I):I}build(){L(this,t,be);const{length:x,firstChild:$}=this,I=$==null?void 0:$.toString();if(x===1&&$.type==="text"&&I.includes("\0")&&(An(this,0,1,this.buildFromStr(I)),this.normalize(),this.type==="root"))for(const C of m(this,i))C==null||C.build()}afterBuild(){if(this.type==="root")for(const x of m(this,i))x==null||x.afterBuild();L(this,r,!0)}parse(x=be,$,I){for(x=Math.min(x,be);m(this,t)<x;)this.parseOnce(m(this,t),$,I);return x&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===y}getAttribute(x){var $;switch(x){case"config":return m(this,s);case"include":return($=m(this,n))!=null?$:!!m(this.getRootNode(),n);case"accum":return m(this,i);case"built":return m(this,r);case"stage":return m(this,t);case"invalid":return this.type==="table-inter"&&Wt(this)===2;default:return super.getAttribute(x)}}setAttribute(x,$){switch(x){case"stage":m(this,t)===0&&this.type==="root"&&m(this,i).shift(),L(this,t,$);break;default:super.setAttribute(x,$)}}insertAt(x,$=this.length){const I=typeof x=="string"?new Hi(x):x;super.insertAt(I,$);const{type:C}=I;return C==="root"&&(I.type="plain"),I}normalizeTitle(x,$=0,I){return k.normalizeTitle(x,$,m(this,n),m(this,s),I)}inTableAttrs(){var x,$;return((x=this.closest("table-attrs,ext"))==null?void 0:x.type)==="table-attrs"&&(($=this.closest("table-attrs,arg,magic-word,template"))!=null&&$.is("table-attrs")?2:1)}inHtmlAttrs(){var x;return(x=this.closest("html-attrs,ext"))!=null&&x.is("html-attrs")?2:this.inTableAttrs()}lint(x=this.getAbsoluteIndex(),$){var I;{let C=super.lint(x,$);if(this.type==="root"){const U=new Map,R="no-duplicate",P=["category","id"].map(F=>k.lintConfig.getSeverity(R,F)),W=yl.filter((F,V)=>P[V]).join();if(W){for(const F of this.querySelectorAll(W)){let V;if(F.is("category"))V=F.name;else{const G=F.getValue();G&&G!==!0&&(V=`#${G}`)}if(V){const G=U.get(V);G?G.add(F):U.set(V,new Set([F]))}}for(const[F,V]of U)if(V.size>1&&!F.startsWith("#mw-customcollapsible-")){const G=!F.startsWith("#"),Z=`duplicate-${G?"category":"id"}`,ne=P[G?0:1];C.push(...[...V].map(le=>{const re=J(le,{start:le.getAbsoluteIndex()},R,Z,ne);return G&&(re.suggestions=[D(re)]),re}))}}const H=/<!--\s*lint-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->/gu,pe=this.toString(),ee=[];let M=H.exec(pe);for(;M;){const{1:F,index:V}=M,G=(I=M[2])==null?void 0:I.trim();ee.push({line:this.posFromIndex(V).top+(F==="disable-line"?0:1),from:F==="disable"?H.lastIndex:void 0,to:F==="enable"?H.lastIndex:void 0,rules:G?new Set(G.split(",").map(Z=>Z.trim())):void 0}),M=H.exec(pe)}if(C=C.filter(({rule:F,startLine:V,startIndex:G})=>{const Z={pos:0};for(const{line:ne,from:le,to:re,rules:Te}of ee){if(ne>V+1)break;if(Te&&!Te.has(F))continue;if(ne===V&&le===void 0&&re===void 0)return!1;le<=G&&le>Z.pos?(Z.pos=le,Z.type="from"):re<=G&&re>Z.pos&&(Z.pos=re,Z.type="to")}return Z.type!=="from"}),C.some(({fix:F})=>F)){const F=C.map(({fix:Z})=>Z).filter(Boolean).sort(({range:[Z,ne]},{range:[le,re]})=>ne===re?le-Z:re-ne);let V=1/0,G=pe;for(const{range:[Z,ne],text:le}of F)ne<=V&&(G=G.slice(0,Z)+le+G.slice(ne),V=Z);Object.assign(C,{output:G})}}return C}}toString(x,$){return x?super.toString(!0,$):Ve(m(this,l),()=>super.toString(!1,$),I=>{const C=this.getRootNode();C.type==="root"&&m(C,r)&&L(this,l,I)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakMap,l=new WeakMap,o=new WeakSet,na=function(){const{parseRedirect:x}=(Ma(),Q(Dl)),$=this.firstChild.toString(),I=x($,m(this,s),m(this,i));return I&&this.setText(I),!!I},ra=function(x){const{parseCommentAndExt:$}=(ks(),Q(Io));this.setText($(this.firstChild.toString(),m(this,s),m(this,i),x))},la=function(){const{parseBraces:x}=(pn(),Q(oo)),$=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,I=x($,m(this,s),m(this,i));this.setText(this.type==="root"?I:I.slice(1))},oa=function(){if(m(this,s).excludes.includes("html"))return;const{parseHtml:x}=(au(),Q(No));this.setText(x(this.firstChild.toString(),m(this,s),m(this,i)))},aa=function(){if(m(this,s).excludes.includes("table"))return;const{parseTable:x}=(hu(),Q(Bo));this.setText(x(this,m(this,s),m(this,i)))},ua=function(){if(m(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:x}=(pu(),Q(Mo));this.setText(x(this,m(this,s),m(this,i)))},da=function(x){const{parseLinks:$}=(xu(),Q(Jo));this.setText($(this.firstChild.toString(),m(this,s),m(this,i),x))},ha=function(x){if(m(this,s).excludes.includes("quote"))return;const{parseQuotes:$}=(Do(),Q(Ho)),I=this.firstChild.toString().split(`
|
|
26
|
-
`);for(let
|
|
27
|
-
`))},
|
|
28
|
-
`),
|
|
29
|
-
`))},
|
|
18
|
+
${l.shift()}`,u;const d=(a,h)=>{if(!h){o+=a;return}const{lastChild:g}=h;if(vl(h)){const c=new j(a,i,n);c.type="table-inter",c.setAttribute("stage",3),h.insertAt(c)}else g.setText(g.toString()+a)};for(const a of l){u=r.pop();const[h]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(a),g=a.slice(h.length),c=/^(:*)((?:\s|\0\d+[cn]\x7F)*)(\{\||\{(?:\0\d+[cn]\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(g);if(c){for(;u&&!u.is("td");)u=r.pop();const[,v,m,S,A]=c;v&&new An(v,i,n),d(`
|
|
19
|
+
${h}${v&&`\0${n.length-1}d`}${m}\0${n.length}b`,u),r.push(...u?[u]:[],new gs(S,A,i,n));continue}else if(!u){o+=`
|
|
20
|
+
${a}`;continue}const p=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(g);if(!p){d(`
|
|
21
|
+
${a}`,u),r.push(u);continue}const[,b,w,k,_]=p;if(b){for(;!u.is("table");)u=r.pop();u.close(`
|
|
22
|
+
${h}${b}`,!0),d(_,r[r.length-1])}else if(w){u=Ni(u,r),u.is("tr")&&(u=r.pop());const v=new qo(`
|
|
23
|
+
${h}${w}`,_,i,n);r.push(u,v),u.insertAt(v)}else{u=Ni(u,r);const v=k==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu;let m=v.exec(_),S=0,A=`
|
|
24
|
+
${h}${k}`;const x=y=>{const T=new xs(A,_.slice(S,m==null?void 0:m.index),i,n);return y.insertAt(T),T};for(;m;)x(u),{lastIndex:S}=v,[A]=m,m=v.exec(_);r.push(u,x(u))}}return o.slice(1)}}}),Ho,pu=C({"src/nowiki/hr.ts"(){"use strict";tt(),Ho=class extends Te{get type(){return"hr"}}}}),bl,Li,wl,qt,fu=C({"src/nowiki/doubleUnderscore.ts"(){"use strict";bt(),Me(),tt(),bl=[Ze(),je("__")],qt=class extends(wl=Te){get type(){return"double-underscore"}constructor(e,t,s,i){var o,u;super(e,s,i);const n=e.toLowerCase(),{doubleUnderscore:[,,r,l]}=s;this.setAttribute("name",(u=t?(o=l==null?void 0:l[e])==null?void 0:o.toLowerCase():r==null?void 0:r[n])!=null?u:n)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}},Li=K(wl),qt=X(Li,0,"DoubleUnderscoreToken",bl,qt),J(Li,1,qt)}}),Do={};se(Do,{parseHrAndDoubleUnderscore:()=>Go});var Go,mu=C({"parser/hrAndDoubleUnderscore.ts"(){"use strict";pu(),fu(),ao(),Go=({firstChild:{data:e},type:t,name:s},i,n)=>{var u,d,a;const{doubleUnderscore:[r,l,o]}=i;return(u=i.insensitiveDoubleUnderscore)!=null||(i.insensitiveDoubleUnderscore=new Set(r)),(d=i.sensitiveDoubleUnderscore)!=null||(i.sensitiveDoubleUnderscore=new Set(l)),(a=i.regexHrAndDoubleUnderscore)!=null||(i.regexHrAndDoubleUnderscore=new RegExp(`__(${[...r,...l].join("|")})__`,"giu")),t!=="root"&&(t!=="ext-inner"||s!=="poem")&&(e=`\0${e}`),e=e.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(h,g,c)=>(new Ho(c,i,n),`${g}\0${n.length-1}r`)).replace(i.regexHrAndDoubleUnderscore,(h,g)=>{var w;const c=i.sensitiveDoubleUnderscore.has(g),p=g.toLowerCase(),b=i.insensitiveDoubleUnderscore.has(p);return c||b?(new qt(g,c,i,n),`\0${n.length-1}${b&&((w=o==null?void 0:o[p])!=null?w:p)==="toc"?"u":"n"}`):h}),i.excludes.includes("heading")||(e=e.replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(h,g,c,p,b)=>{const w=`${g}\0${n.length}h`;return new rt(c.length,[p,b],i,n),w})),t==="root"||t==="ext-inner"&&s==="poem"?e:e.slice(1)}}}),Vo,xu=C({"src/nowiki/quote.ts"(){"use strict";var e,t;M(),de(),W(),tt(),Vo=(t=class extends Te{constructor(i,n,r,l){super(i,r,l);N(this,e);L(this,e,n)}get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}get closing(){return me(me({},this.bold?{bold:f(this,e).bold}:void 0),this.italic?{italic:f(this,e).italic}:void 0)}text(){const{parentNode:i,innerText:n}=this;return i!=null&&i.is("image-parameter")&&i.name!=="caption"?"":n}lint(i=this.getAbsoluteIndex()){var n;{const{previousSibling:r,bold:l,closing:o}=this,u=(r==null?void 0:r.type)==="text"?r.data:void 0,d=[],a=new le(this,i),h=["lonely-apos","bold-header"],{lintConfig:g}=I,{computeEditInfo:c}=g,p=[void 0,"word"].map(w=>g.getSeverity(h[0],w)),b=g.getSeverity(h[1]);if(u!=null&&u.endsWith("'")){const w=p[(o.bold||o.italic)&&/[a-z\d]'$/iu.test(u)?1:0];if(w){const k=G(this,a,h[0],I.msg("lonely","'"),w),{startLine:_,startCol:v}=k,[,{length:m}]=/(?:^|[^'])('+)$/u.exec(u),S=i-m,A=Le(me({},k),{startIndex:S,endIndex:i,endLine:_,startCol:v-m,endCol:v});c&&(A.suggestions=[mt(S,"'",m),U(A)]),d.push(A)}}if(b&&l&&((n=this.closest("heading-title,ext"))==null?void 0:n.type)==="heading-title"){const w=G(this,a,h[1],"bold-in-header",b);c&&(w.suggestions=[U(w)]),d.push(w)}return d}}json(i,n=this.getAbsoluteIndex()){const r=super.json(void 0,n)}},e=new WeakMap,t)}}),Qo={};se(Qo,{parseQuotes:()=>_n});var _n,Jo=C({"parser/quotes.ts"(){"use strict";xu(),_n=(e,t,s,i)=>{var c;const n=e.split(/('{2,})/u),{length:r}=n;if(r===1)return e;let l=0,o=0,u,d,a;for(let p=1;p<r;p+=2){const b=n[p].length;switch(b){case 2:o++;break;case 4:n[p-1]+="'",n[p]="'''";case 3:if(l++,u!==void 0)break;n[p-1].endsWith(" ")?d===void 0&&a===void 0&&(a=p):n[p-1].slice(-2,-1)===" "?u=p:d!=null||(d=p);break;default:n[p-1]+="'".repeat(b-5),n[p]="'''''",o++,l++}}if(o%2===1&&l%2===1){const p=(c=u!=null?u:d)!=null?c:a;p!==void 0&&(n[p]="''",n[p-1]+="'")}let h=!0,g=!0;for(let p=1;p<r;p+=2){const b=n[p].length,w=b!==2,k=b!==3;w&&(h=!h),k&&(g=!g),new Vo(n[p],{bold:w&&h,italic:k&&g},t,s),n[p]=`\0${s.length-1}q`}return n.join("")}}}),Xo={};se(Xo,{parseExternalLinks:()=>$n});var $n,Ko=C({"parser/externalLinks.ts"(){"use strict";ge(),_o(),wn(),$n=(e,t,s,i)=>{var n;return(n=t.regexExternalLinks)!=null||(t.regexExternalLinks=new RegExp(String.raw`\[((?:\0\d+[cn]\x7F)*(?:\0\d+f\x7F|(?:(?:${t.protocol}|//)${ct}|\0\d+m\x7F)${gt}(?=[[\]<>"\t${Be}]|\0\d)))([${Be}]*(?![${Be}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),e.replace(t.regexExternalLinks,(r,l,o,u)=>{const{length:d}=s,a=/&[lg]t;/u.exec(l);return a&&(o="",u=l.slice(a.index)+o+u,l=l.slice(0,a.index)),i?(new Gt(l,"ext-link-url",t,s),`[\0${d}f${o}${u}]`):(new at(l,o,u,t,s),`\0${d}w`)})}}}),Yo,vu=C({"src/link/category.ts"(){"use strict";ys(),Yo=class extends Oe{get type(){return"category"}get sortkey(){}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t)}}}}),Zo={};se(Zo,{parseLinks:()=>en});var yl,en,bu=C({"parser/links.ts"(){"use strict";ge(),W(),Jo(),Ko(),Ao(),wo(),vu(),yl=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,en=(e,t,s,i)=>{var o;(o=t.regexLinks)!=null||(t.regexLinks=new RegExp(String.raw`^\s*(?:${t.protocol}|//)`,"iu"));const n=t.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]]))?\]\]([\s\S]*)$/u:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])*)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]])?)?\]\]([\s\S]*)$/u,r=e.split("[[");let l=r.shift();for(let u=0;u<r.length;u++){let d=!1,a,h,g,c;const p=r[u],b=n.exec(p);if(b)[,a,h,g,c]=b,c.startsWith("]")&&(g!=null&&g.includes("["))&&(g+="]",c=c.slice(1));else{const S=yl.exec(p);S&&(d=!0,[,a,h,g]=S)}if(a===void 0||t.regexLinks.test(a)||/\0\d+[exhbru]\x7F/u.test(a)){l+=`[[${p}`;continue}let w=be(a).trim();const k=w.startsWith(":");if(k&&d){l+=`[[${p}`;continue}else!w&&g&&!g.includes(`
|
|
25
|
+
`)&&(w=be(g).trim());const{ns:_,valid:v}=I.normalizeTitle(w,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0});if(v){if(d){if(_!==6){l+=`[[${p}`;continue}let S=!1;for(u++;u<r.length;u++){const A=r[u],x=A.split("]]");if(x.length>2){S=!0,g+=`[[${x[0]}]]${x[1]}`,c=x.slice(2).join("]]");break}else if(x.length===2)g+=`[[${x[0]}]]${x[1]}`;else{g+=`[[${A}`;break}}if(g=en(g,t,s,i),!S){l+=`[[${a}${h}${g}`;continue}}}else{l+=`[[${p}`;continue}g&&(g=_n(g,t,s,i));let m=bn;k||(_===6?(g&&(g=$n(g,t,s,!0)),m=vn):_===14&&(m=Yo)),g===void 0&&h&&(g=""),l+=`\0${s.length}l${c}`,new m(a,g,t,s,h)}return l}}}),ea={};se(ea,{parseMagicLinks:()=>ta});var Ei,Fi,ji,Pi,ta,wu=C({"parser/magicLinks.ts"(){"use strict";ge(),wn(),Ei=String.raw`[${Be}\t]| |�*160;|�*a0;`,Fi=`(?:${Ei})+`,ji=`(?:${Ei}|-)`,Pi=String.raw`(?:RFC|PMID)${Fi}\d+\b|ISBN${Fi}(?:97[89]${ji}?)?(?:\d${ji}?){9}[\dx]\b`,ta=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${ct}${gt})|${Pi})`,"giu")}catch(i){t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${ct}${gt})|${Pi})`,"giu")}return e.replace(t.regexMagicLinks,(i,n,r)=>{let l=n?i.slice(n.length):i;if(r){let o="";const u=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(l);u&&(o=l.slice(u.index),l=l.slice(0,u.index));const d=l.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,a=d.exec(l);if(a){let h=1;a[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(l.slice(0,a.index))&&(h=2),o=l.slice(a.index+h)+o,l=l.slice(0,a.index+h)}return o.length>=r.length?i:(new Gt(l,void 0,t,s),`${n}\0${s.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(l))return i;return new Gt(l,"magic-link",t,s),`${n}\0${s.length-1}i`})}}}),sa,yu=C({"util/html.ts"(){"use strict";sa=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,i)=>s!==e[i])}}),ia,Su=C({"src/nowiki/list.ts"(){"use strict";Wo(),ia=class extends kn{get type(){return"list"}}}}),na={};se(na,{parseList:()=>ra});var ra,ku=C({"parser/list.ts"(){"use strict";yu(),Su(),Mo(),ra=(e,t,s,i)=>{const n=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!n)return t.lastPrefix="",e;const[r,l,o,u]=n,d=o.replace(/;/gu,":"),a=sa(d,t.lastPrefix),h=((a>1?o.slice(a-1):o)+u).split(/(?=;)/u),g=h[0].startsWith(";");let c=h.length-(g?0:1);if(a>1){const $=o.slice(0,a-1);if(g){const E=$.split(/(?=;)/u);h.unshift(...E),c+=$.includes(";")?E.length:0}else h[0]=$+h[0]}t.lastPrefix=d;let p=l+h.map(($,E)=>`\0${i.length+E}d`).join("")+e.slice(r.length);for(const $ of h)new ia($,s,i);if(!c)return p;const{html:[b,,w]}=s,k=/:+|-\{|\0\d+[xq]\x7F/gu;let _=k,v=_.exec(p),m=0,S=!1,A=!1,x=0;const y=($,E)=>(new An($,s,i),`${p.slice(0,E)}\0${i.length-1}d${p.slice(E+$.length)}`),T=$=>{$?m&&m--:m++};for(;v&&c;){const{0:$,index:E}=v;if($==="-{"){if(!x){const{lastIndex:F}=_;_=/-\{|\}-/gu,_.lastIndex=F}x++}else if($==="}-"){if(x--,!x){const{lastIndex:F}=_;_=k,_.lastIndex=F}}else if($.endsWith("x")){const{name:F,closing:P,selfClosing:ne}=i[Number($.slice(1,-2))];(b.includes(F)||!ne&&!w.includes(F))&&T(P)}else if($.endsWith("q")){const{bold:F,italic:P}=i[Number($.slice(1,-2))];F&&(T(S),S=!S),P&&(T(A),A=!A)}else if(m===0){if($.length>=c)return y($.slice(0,c),E);c-=$.length,_.lastIndex=E+4+String(i.length).length,p=y($,E)}v=_.exec(p)}return p}}}),rs,Sl,Ri,kl,Wt,Au=C({"src/converterFlags.ts"(){"use strict";var e,t;M(),de(),Ss(),W(),q(),ze(),rs=new Set(["A","T","R","D","-","H","N"]),Sl=[Vt()],Wt=(t=class extends(kl=j){constructor(i,n,r=[]){super(void 0,n,r,{});N(this,e);this.safeAppend(i.map(l=>new xe(l,"converter-flag",n,r)))}get type(){return"converter-flags"}afterBuild(){L(this,e,this.childNodes.map(i=>i.text().trim())),super.afterBuild()}toString(i){return super.toString(i,";")}text(){return super.text(";")}getUnknownFlags(){return new Set(f(this,e).filter(i=>/\{{3}[^{}]+\}{3}/u.test(i)))}getVariantFlags(){const i=new Set(this.getAttribute("config").variants);return new Set(f(this,e).filter(n=>i.has(n)))}isInvalidFlag(i,n,r,l){return typeof i=="object"&&(i=i.text().trim(),n=this.getVariantFlags(),r=this.getUnknownFlags(),l=new Set(f(this,e).filter(o=>rs.has(o)))),!!i&&!n.has(i)&&!r.has(i)&&(n.size>0||!l.has(i))}lint(i=this.getAbsoluteIndex(),n){{const r=this.getVariantFlags(),l=this.getUnknownFlags(),o=new Set(f(this,e).filter(w=>rs.has(w))),u=f(this,e).filter(w=>!w).length,d=f(this,e).length-l.size-u,{lintConfig:a}=I,{computeEditInfo:h,fix:g}=a,c=super.lint(i,n);if(r.size===d||o.size===d)return c;const p="no-ignored",b=a.getSeverity(p,"conversionFlag");if(b){const w=new le(this,i);for(let k=0;k<this.length;k++){const _=this.childNodes[k],v=_.text().trim();if(this.isInvalidFlag(v,r,l,o)){const m=B(_,w,p,"invalid-conversion-flag",b);(h||g)&&(r.size===0&&rs.has(v.toUpperCase())?m.fix=un(m,v):h&&(m.suggestions=[U(m,k&&-1)])),c.push(m)}}}return c}}print(){return super.print({sep:";"})}},e=new WeakMap,t),Ri=K(kl),Wt=X(Ri,0,"ConverterFlagsToken",Sl,Wt),J(Ri,1,Wt)}}),ps,_u=C({"src/converterRule.ts"(){"use strict";W(),q(),ze(),ps=class extends j{get type(){return"converter-rule"}get variant(){}constructor(e,t=!0,s=I.getConfig(),i=[]){super(void 0,s,i);const n=e.indexOf(":"),r=e.slice(0,n).indexOf("=>"),l=r===-1?e.slice(0,n):e.slice(r+2,n);t&&s.variants.includes(l.trim().toLowerCase())?(super.insertAt(new xe(l,"converter-rule-variant",s,i)),super.insertAt(new xe(e.slice(n+1),"converter-rule-to",s,i)),r!==-1&&super.insertAt(new xe(e.slice(0,r),"converter-rule-from",s,i),0)):super.insertAt(new xe(e,"converter-rule-to",s,i))}toString(e){const{childNodes:t,firstChild:s,lastChild:i}=this;return t.length===3?`${s.toString(e)}=>${t[1].toString(e)}:${i.toString(e)}`:super.toString(e,":")}text(){const{childNodes:e,firstChild:t,lastChild:s}=this;return e.length===3?`${t.text()}=>${e[1].text()}:${s.text()}`:super.text(":")}getGaps(e){return e===0&&this.length===3?2:1}print(){const{childNodes:e}=this;if(e.length===3){const[t,s,i]=e;return`<span class="wpb-converter-rule">${t.print()}=>${s.print()}:${i.print()}</span>`}return super.print({sep:":"})}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t)}}}}),Al,Oi,_l,Mt,$u=C({"src/converter.ts"(){"use strict";ge(),Me(),Fe(),q(),Au(),_u(),Al=[Ie,je("-{")],Mt=class extends(_l=j){get type(){return"converter"}constructor(e,t,s,i=[]){super(void 0,s,i),this.insertAt(new Wt(e,s,i));const[n]=t,r=n.includes(":"),l=new ps(n,r,s,i);r&&l.length===1||!r&&t.length===2&&!be(t[1]).trim()?this.insertAt(new ps(t.join(";"),!1,s,i)):this.append(l,...t.slice(1).map(o=>new ps(o,!0,s,i)))}toString(e){const{childNodes:[t,...s]}=this;return`-{${t.toString(e)}${t.length>0?"|":""}${s.map(i=>i.toString(e)).join(";")}}-`}text(){const{childNodes:[e,...t]}=this;return`-{${e.text()}|${Ke(t,";")}}-`}getGaps(e){return e||this.firstChild.length>0?1:0}print(){const{childNodes:[e,...t]}=this;return`<span class="wpb-converter">-{${e.print()}${e.length>0?"|":""}${ft(t,{sep:";"})}}-</span>`}},Oi=K(_l),Mt=X(Oi,0,"ConverterToken",Al,Mt),J(Oi,1,Mt)}}),la={};se(la,{parseConverter:()=>oa});var oa,Tu=C({"parser/converter.ts"(){"use strict";$u(),oa=(e,t,s)=>{var u;(u=t.regexConverter)!=null||(t.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${t.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"iu"));const i=/-\{/gu,n=/-\{|\}-/gu,r=[];let l=i,o=l.exec(e);for(;o;){const{0:d,index:a}=o;if(d==="}-"){const h=r.pop(),{length:g}=s,c=e.slice(h.index+2,a),p=c.indexOf("|"),[b,w]=p===-1?[[],c]:[c.slice(0,p).split(";"),c.slice(p+1)],k=w.replace(/(&[#a-z\d]+);/giu,"$1"),_=k.split(t.regexConverter).map(v=>v.replace(/\x01/gu,";"));new Mt(b,_,t,s),e=`${e.slice(0,h.index)}\0${g}v${e.slice(a+2)}`,r.length===0&&(l=i),l.lastIndex=h.index+3+String(g).length}else r.push(o),l=n,l.lastIndex=a+2;o=l.exec(e)}return e}}}),vs={};se(vs,{Token:()=>j});var $l,j,q=C({"src/index.ts"(){"use strict";var e,t,s,i,n,r,l,o,aa,ua,da,ha,ca,ga,pa,fa,ma,xa,va,ba,m;ge(),We(),M(),Ne(),W(),qa(),Wa(),$l=["category","html-attr#id,ext-attr#id,table-attr#id"],j=(m=class extends Nt{constructor(x,y=I.getConfig(),T=[],$){super();N(this,o);N(this,e,"plain");N(this,t,0);N(this,s);N(this,i);N(this,n);N(this,r,!1);N(this,l);typeof x=="string"&&this.insertAt(x),L(this,s,y),L(this,i,T),T.push(this)}get type(){return f(this,e)}set type(x){L(this,e,x)}parseOnce(x=f(this,t),y=!1,T){if(x<f(this,t)||this.length===0||!this.isPlain())return this;if(f(this,t)>=we)return this;switch(x){case 0:if(this.type==="root"){f(this,i).pop();const $=R(this,o,aa).call(this);y&&(y=!$)}L(this,n,y),R(this,o,ua).call(this,y);break;case 1:R(this,o,da).call(this);break;case 2:R(this,o,ha).call(this);break;case 3:R(this,o,ca).call(this);break;case 4:R(this,o,ga).call(this);break;case 5:R(this,o,pa).call(this,T);break;case 6:R(this,o,fa).call(this,T);break;case 7:R(this,o,ma).call(this);break;case 8:R(this,o,xa).call(this);break;case 9:R(this,o,va).call(this);break;case 10:R(this,o,ba).call(this)}if(this.type==="root")for(const $ of f(this,i))$==null||$.parseOnce(x,y,T);return On(this,t)._++,this}buildFromStr(x,y){const T=x.split(/[\0\x7F]/u).map(($,E)=>{if(E%2===0)return new Qi($);if(isNaN($.slice(-1)))return f(this,i)[Number($.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${$}`)});return y===0?T.map(String).join(""):y===1?Ke(T):T}build(){L(this,t,we);const{length:x,firstChild:y}=this,T=y==null?void 0:y.toString();if(x===1&&y.type==="text"&&T.includes("\0")&&(Tn(this,0,1,this.buildFromStr(T)),this.normalize(),this.type==="root"))for(const $ of f(this,i))$==null||$.build()}afterBuild(){if(this.type==="root")for(const x of f(this,i))x==null||x.afterBuild();L(this,r,!0)}parse(x=we,y,T){for(x=Math.min(x,we);f(this,t)<x;)this.parseOnce(f(this,t),y,T);return x&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===m}getAttribute(x){var y;switch(x){case"config":return f(this,s);case"include":return(y=f(this,n))!=null?y:!!f(this.getRootNode(),n);case"accum":return f(this,i);case"built":return f(this,r);case"stage":return f(this,t);case"invalid":return this.type==="table-inter"&&zt(this)===2;default:return super.getAttribute(x)}}setAttribute(x,y){switch(x){case"stage":f(this,t)===0&&this.type==="root"&&f(this,i).shift(),L(this,t,y);break;default:super.setAttribute(x,y)}}insertAt(x,y=this.length){const T=typeof x=="string"?new Qi(x):x;super.insertAt(T,y);const{type:$}=T;return $==="root"&&(T.type="plain"),T}normalizeTitle(x,y=0,T){return I.normalizeTitle(x,y,f(this,n),f(this,s),T)}inTableAttrs(){var x,y;return((x=this.closest("table-attrs,ext"))==null?void 0:x.type)==="table-attrs"&&((y=this.closest("table-attrs,arg,magic-word,template"))!=null&&y.is("table-attrs")?2:1)}inHtmlAttrs(){var x;return(x=this.closest("html-attrs,ext"))!=null&&x.is("html-attrs")?2:this.inTableAttrs()}lint(x=this.getAbsoluteIndex(),y){var T;{const{lintConfig:$}=I,{computeEditInfo:E,fix:F,ignoreDisables:P,configurationComment:ne}=$;let O=super.lint(x,y);if(this.type==="root"){const re=new Map,fe="no-duplicate",V=["category","id"].map(z=>$.getSeverity(fe,z)),D=this.toString(),Y=$l.filter((z,Z)=>V[Z]).join();if(Y){for(const z of this.querySelectorAll(Y)){let Z;if(z.is("category"))Z=z.name;else{const H=z.getValue();H&&H!==!0&&(Z=`#${H}`)}if(Z){const H=re.get(Z);H?H.add(z):re.set(Z,new Set([z]))}}for(const[z,Z]of re)if(Z.size>1&&!z.startsWith("#mw-customcollapsible-")){const H=!z.startsWith("#"),ee=`duplicate-${H?"category":"id"}`,oe=V[H?0:1];O.push(...[...Z].map(ae=>{const te=G(ae,{start:ae.getAbsoluteIndex()},fe,ee,oe);return E&&H&&(te.suggestions=[U(te)]),te}))}}if(!P){const z=new RegExp(String.raw`<!--\s*${ne}-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->`,"gu"),Z=[];let H=z.exec(D);for(;H;){const{1:ee,index:oe}=H,ae=(T=H[2])==null?void 0:T.trim();Z.push({line:this.posFromIndex(oe).top+(ee==="disable-line"?0:1),from:ee==="disable"?z.lastIndex:void 0,to:ee==="enable"?z.lastIndex:void 0,rules:ae?new Set(ae.split(",").map(te=>te.trim())):void 0}),H=z.exec(D)}O=O.filter(({rule:ee,startLine:oe,startIndex:ae})=>{const te={pos:0};for(const{line:He,from:ue,to:ve,rules:Ce}of Z){if(He>oe+1)break;if(Ce&&!Ce.has(ee))continue;if(He===oe&&ue===void 0&&ve===void 0)return!1;ue<=ae&&ue>te.pos?(te.pos=ue,te.type="from"):ve<=ae&&ve>te.pos&&(te.pos=ve,te.type="to")}return te.type!=="from"})}if(F&&O.some(({fix:z})=>z)){const z=O.map(({fix:ee})=>ee).filter(Boolean).sort(({range:[ee,oe]},{range:[ae,te]})=>oe===te?ae-ee:te-oe);let Z=1/0,H=D;for(const{range:[ee,oe],text:ae}of z)oe<=Z&&(H=H.slice(0,ee)+ae+H.slice(oe),Z=ee);Object.assign(O,{output:H})}if(!E)for(const z of O)delete z.fix,delete z.suggestions}return O}}toString(x,y){return x?super.toString(!0,y):Xe(f(this,l),()=>super.toString(!1,y),T=>{const $=this.getRootNode();$.type==="root"&&f($,r)&&L(this,l,T)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakMap,l=new WeakMap,o=new WeakSet,aa=function(){const{parseRedirect:x}=(Ua(),Q(Jl)),y=this.firstChild.toString(),T=x(y,f(this,s),f(this,i));return T&&this.setText(T),!!T},ua=function(x){const{parseCommentAndExt:y}=(Ts(),Q(Fo));this.setText(y(this.firstChild.toString(),f(this,s),f(this,i),x))},da=function(){const{parseBraces:x}=(xn(),Q(co)),y=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,T=x(y,f(this,s),f(this,i));this.setText(this.type==="root"?T:T.slice(1))},ha=function(){if(f(this,s).excludes.includes("html"))return;const{parseHtml:x}=(du(),Q(jo));this.setText(x(this.firstChild.toString(),f(this,s),f(this,i)))},ca=function(){if(f(this,s).excludes.includes("table"))return;const{parseTable:x}=(gu(),Q(zo));this.setText(x(this,f(this,s),f(this,i)))},ga=function(){if(f(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:x}=(mu(),Q(Do));this.setText(x(this,f(this,s),f(this,i)))},pa=function(x){const{parseLinks:y}=(bu(),Q(Zo));this.setText(y(this.firstChild.toString(),f(this,s),f(this,i),x))},fa=function(x){if(f(this,s).excludes.includes("quote"))return;const{parseQuotes:y}=(Jo(),Q(Qo)),T=this.firstChild.toString().split(`
|
|
26
|
+
`);for(let $=0;$<T.length;$++)T[$]=y(T[$],f(this,s),f(this,i),x);this.setText(T.join(`
|
|
27
|
+
`))},ma=function(){if(f(this,s).excludes.includes("extLink"))return;const{parseExternalLinks:x}=(Ko(),Q(Xo));this.setText(x(this.firstChild.toString(),f(this,s),f(this,i)))},xa=function(){if(f(this,s).excludes.includes("magicLink"))return;const{parseMagicLinks:x}=(wu(),Q(ea));this.setText(x(this.firstChild.toString(),f(this,s),f(this,i)))},va=function(){if(f(this,s).excludes.includes("list"))return;const{parseList:x}=(ku(),Q(na)),{firstChild:y,type:T,name:$}=this,E=y.toString().split(`
|
|
28
|
+
`),F={lastPrefix:""};let P=T==="root"||T==="ext-inner"&&$==="poem"?0:1;for(;P<E.length;P++)E[P]=x(E[P],F,f(this,s),f(this,i));this.setText(E.join(`
|
|
29
|
+
`))},ba=function(){if(f(this,s).variants.length>0){const{parseConverter:x}=(Tu(),Q(la));this.setText(x(this.firstChild.toString(),f(this,s),f(this,i)))}},m)}}),ke,Cs,Tn,Ne=C({"util/debug.ts"(){"use strict";ke={running:!1,run(e){const{running:t}=this;this.running=!0;try{const{Token:s}=(q(),Q(vs)),i=e();return i instanceof s&&!i.getAttribute("built")&&i.afterBuild(),this.running=t,i}catch(s){throw this.running=t,s}},rev:0},Cs=e=>t=>t.type===e,Tn=(e,t,s,i=[])=>{var l,o;let n=e.getChildNodes(),r;n.length===s?(r=n,n=i):r=n.splice(t,s,...i);for(let u=0;u<i.length;u++){const d=i[u];d.setAttribute("parentNode",e),d.setAttribute("nextSibling",n[t+u+1]),d.setAttribute("previousSibling",n[t+u-1])}return(l=n[t-1])==null||l.setAttribute("nextSibling",n[t]),(o=n[t+i.length])==null||o.setAttribute("previousSibling",n[t+i.length-1]),n===i&&e.setAttribute("childNodes",n),r}}}),it,Bi,ls,qi,Tl,Wi,Cl,tn,Cu=C({"lib/lintConfig.ts"(){"use strict";var e,t;Ol(),it=new Map([[0,!1],[1,"warning"],[2,"error"],[!1,!1],["off",!1],["warning","warning"],["error","error"]]),Bi={"bold-header":[1,{}],"format-leakage":[1,{}],"fostered-content":[1,{}],h1:[1,{}],"illegal-attr":[2,{}],"insecure-style":2,"invalid-gallery":[2,{parameter:1}],"invalid-imagemap":[2,{}],"invalid-invoke":[2,{}],"invalid-isbn":2,"lonely-apos":[1,{}],"lonely-bracket":[1,{extLink:2}],"lonely-http":[1,{}],"nested-link":[2,{}],"no-arg":1,"no-duplicate":[2,{category:1,id:1,unknownImageParameter:1}],"no-ignored":[2,{fragment:1,galleryComment:1,galleryNoImage:1,include:1,nonWordAttributes:1,redirect:1}],"obsolete-attr":1,"obsolete-tag":1,"parsing-order":[2,{templateInTable:1}],"pipe-like":[1,{double:2}],"table-layout":1,"tag-like":[2,{disallowed:1,invalid:1}],"unbalanced-header":2,"unclosed-comment":[1,{}],"unclosed-quote":1,"unclosed-table":2,unescaped:2,"unknown-page":1,"unmatched-tag":[1,{}],"unterminated-url":[1,{}],"url-encoding":[1,{}],"var-anchor":[1,{}],"void-ext":[2,{}]},Object.freeze(Bi),ls={configurationComment:"lint",ignoreDisables:!1,fix:!0,computeEditInfo:!0},Object.freeze(ls),qi=s=>it.has(s),Tl=s=>qi(s)||Array.isArray(s)&&qi(s[0])&&(s.length===1||typeof s[1]=="object"),Wi=(s,i,n)=>{if(fs.includes(i)){if(n===void 0)return!1;if(Tl(n))return s[i]=n,!0}else throw new RangeError(`Unknown lint rule: ${i}`);throw new RangeError(`Invalid lint config for ${i}: ${JSON.stringify(n)}`)},Cl=class{constructor(s){if(Object.assign(this,JSON.parse(JSON.stringify(Bi))),!!s)for(const[i,n]of Object.entries(s))Wi(this,i,n)}getSeverity(s,i){var r,l;const n=this[s];return typeof n!="object"?it.get(n):i&&(l=it.get((r=n[1])==null?void 0:r[i]))!=null?l:it.get(n[0])}},tn=(t=class{constructor(s){N(this,e);if(Object.assign(this,ls),s&&!("rules"in s)&&Object.keys(s).some(n=>fs.includes(n)))this.rules=s;else{const i=s!=null?s:{},{rules:n}=i,r=Rn(i,["rules"]);this.rules=n;for(const[l,o]of Object.entries(r))o!==void 0&&Object.prototype.hasOwnProperty.call(ls,l)&&(this[l]=o)}}get rules(){return f(this,e)}set rules(s){L(this,e,new Proxy(new Cl(s),{set:Wi,deleteProperty(){return!1}}))}getSeverity(s,i){return f(this,e).getSeverity(s,i)}},e=new WeakMap,t)}}),wa={};se(wa,{Title:()=>ya});var ya,Iu=C({"lib/title.ts"(){"use strict";var e,t,s,i,n,r;Ye(),ge(),ya=(r=class{constructor(l,o,u,{temporary:d,decode:a,selfLink:h}={}){N(this,e);N(this,t);N(this,s);N(this,i);N(this,n);Ee(this,"valid");Ee(this,"encoded",!1);const g=l.trim().startsWith("../");if(a&&l.includes("%"))try{const p=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(l);l=Ht(l),this.encoded=p}catch(p){}if(l=ms(l).replace(/[_ ]+/gu," ").trim(),g)L(this,i,0);else{let p=o;l.startsWith(":")&&(p=0,l=l.slice(1).trim());const b=l.split(":");if(b.length>1){const w=pt(b[0]),k=Object.prototype.hasOwnProperty.call(u.nsid,w)&&u.nsid[w];k&&(p=k,l=b.slice(1).join(":").trim())}L(this,i,p)}const c=l.indexOf("#");if(c!==-1){let p=l.slice(c).trim().slice(1);if(p.includes("%"))try{p=Ht(p)}catch(b){}L(this,n,p.replace(/ /gu,"_")),l=l.slice(0,c).trim()}this.valid=!!(l||h&&this.ns===0&&f(this,n)!==void 0)&&ms(l)===l&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(g?/^(?:\.\.\/)+(.*)/u.exec(l)[1]:l),this.main=l,L(this,t,u.namespaces),L(this,s,u.articlePath||"/wiki/$1"),f(this,s).includes("$1")||L(this,s,f(this,s)+`${f(this,s).endsWith("/")?"":"/"}$1`),d||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return f(this,i)}get fragment(){return f(this,n)}get main(){return f(this,e)}set main(l){l=l.replace(/_/gu," ").trim(),L(this,e,l&&l[0].toUpperCase()+l.slice(1))}get prefix(){const l=f(this,t)[this.ns];return l+(l&&":")}get title(){return this.getRedirection()[1]}get extension(){const{main:l}=this,o=l.lastIndexOf(".");return o===-1?void 0:l.slice(o+1).toLowerCase()}getRedirection(){return[!1,(this.prefix+this.main).replace(/ /gu,"_")]}setFragment(l){L(this,n,l)}getUrl(l){throw new Error("Title.getUrl method is only available in the LSP version!")}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n=new WeakMap,r)}}),Sa={};se(Sa,{default:()=>I});ka.exports=Q(Sa);var os,Mi,Il,Pe,zi,Nl,I,W=C({"index.ts"(){Ol(),Ne(),We(),ge(),Cu(),os=!0,Mi=new tn,Pe={config:Hi,get rules(){return fs},get i18n(){return me(me({},Wl),Il)},set i18n(e){Il=e},get lintConfig(){return Mi},set lintConfig(e){Mi=new tn(e)},get viewOnly(){return os},set viewOnly(e){os&&!e&&ke.rev++,os=e},getConfig(e){const t=e!=null?e:this.config,{doubleUnderscore:s,ext:i,parserFunction:n,variable:r}=t;for(let l=0;l<2;l++)s.length>l+2&&s[l].length===0&&(s[l]=Object.keys(s[l+2]));return i.includes("translate")&&!r.includes("translationlanguage")&&(r.push("translationlanguage"),Array.isArray(n[1])?n[1].push("TRANSLATIONLANGUAGE"):n[1].TRANSLATIONLANGUAGE="translationlanguage"),Le(me(me({},Hi),t),{excludes:[]})},msg(e,t=""){var s;return e&&((s=this.i18n[e])!=null?s:e).replace("$1",this.msg(t))},normalizeTitle(e,t=0,s,i=Pe.getConfig(),n){const{Title:r}=(Iu(),Q(wa));let l;if(n!=null&&n.halfParsed)l=new r(e,t,i,n);else{const{Token:o}=(q(),Q(vs));l=ke.run(()=>{const u=new o(e,i);u.type="root",u.parseOnce(0,s).parseOnce();const d=new r(u.toString(),t,i,n);u.build();for(const a of["main","fragment"]){const h=d[a];if(h!=null&&h.includes("\0")){const g=u.buildFromStr(h,1);a==="main"?d.main=g:d.setFragment(g)}}return d})}return l},parse(e,t,s=we,i=Pe.getConfig()){e=Bl(e);let n;typeof s!="number"&&(n=Array.isArray(s)?s:[s],s=Math.max(...n.map(o=>Rl[o]||we)));const{Token:r}=(q(),Q(vs));return ke.run(()=>{const o=new r(e,i);return o.type="root",o.parse(s,t)})},async partialParse(e,t,s,i=Pe.getConfig()){},createLanguageService(e={}){throw new Error("Parser.createLanguageService method is only available in the LSP version!")}},zi={},Nl=new Set(["lintConfig","normalizeTitle","parse","createLanguageService"]);for(const e in Pe)Nl.has(e)||(zi[e]={enumerable:!1});Object.defineProperties(Pe,zi),Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:Pe}),I=Pe}});W()});Nu();})();
|