wikiparser-node 1.25.1 → 1.26.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 +20 -20
- 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/data/ext/math.json +41 -0
- package/dist/base.d.mts +15 -3
- package/dist/base.d.ts +15 -3
- package/dist/bin/config.js +8 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -3
- package/dist/lib/element.js +1 -1
- package/dist/lib/lintConfig.d.ts +18 -7
- package/dist/lib/lintConfig.js +55 -15
- package/dist/lib/lsp.js +16 -8
- package/dist/lib/text.js +35 -33
- package/dist/src/arg.js +8 -6
- package/dist/src/attribute.js +23 -13
- 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 +9 -5
- package/dist/src/imagemap.js +7 -5
- package/dist/src/index.js +50 -41
- package/dist/src/link/base.js +19 -11
- package/dist/src/link/file.js +24 -18
- 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 +4 -2
- 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/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/extensions/dist/base.js +1 -1
- package/extensions/editor.css +2 -2
- 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 _a=Object.defineProperty,$a=Object.defineProperties;var Ta=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?_a(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,Ta(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 Ca=(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 m=(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 m(e,t,i)}});var Lu=Ca((Fu,Aa)=>{var Ia=Object.create,mt=Object.defineProperty,El=Object.getOwnPropertyDescriptor,sn=Object.getOwnPropertyNames,Na=Object.prototype.hasOwnProperty,Fl=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),xt=e=>{throw TypeError(e)},jl=(e,t,s)=>t in e?mt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Bn=(e,t)=>mt(e,"name",{value:t,configurable:!0}),C=(e,t)=>function(){return e&&(t=(0,e[sn(e)[0]])(e=0)),t},Pl=(e,t)=>function(){return t||(0,e[sn(e)[0]])((t={exports:{}}).exports,t),t.exports},se=(e,t)=>{for(var s in t)mt(e,s,{get:t[s],enumerable:!0})},La=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of sn(t))!Na.call(e,n)&&n!==s&&mt(e,n,{get:()=>t[n],enumerable:!(i=El(t,n))||i.enumerable});return e},V=e=>La(mt({},"__esModule",{value:!0}),e),K=e=>{var t;return[,,,Ia((t=e==null?void 0:e[Fl("metadata")])!=null?t:null)]},Rl=["class","method","getter","setter","accessor","field","value","get","set"],It=e=>e!==void 0&&typeof e!="function"?xt("Function expected"):e,Ea=(e,t,s,i,n)=>({kind:Rl[e],name:t,metadata:i,addInitializer:r=>s._?xt("Already initialized"):n.push(It(r||null))}),nn=(e,t)=>jl(t,Fl("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,v=Rl[h+5],b=h>3&&(e[p-1]=[]),S=e[p]||(e[p]=[]),A=h&&(!c&&!g&&(n=n.prototype),h<5&&(h>3||!c)&&El(h<4?n:{get[s](){return he(this,r)},set[s](f){return we(this,r,f)}},s));h?c&&h<4&&Bn(r,(h>2?"set ":h>1?"get ":"")+s):Bn(n,s);for(var w=i.length-1;w>=0;w--)d=Ea(h,s,u={},e[3],S),h&&(d.static=g,d.private=c,a=d.access={has:c?f=>ja(n,f):f=>s in f},h^3&&(a.get=c?f=>(h^1?he:Ui)(f,n,h^4?r:A.get):f=>f[s]),h>2&&(a.set=c?(f,y)=>we(f,n,y,h^4?r:A.set):(f,y)=>f[s]=y)),o=(0,i[w])(h?h<4?c?r:A[v]:h>4?void 0:{get:A.get,set:A.set}:n,d),u._=1,h^4||o===void 0?It(o)&&(h>4?b.unshift(o):h?c?r=o:A[v]=o:n=o):typeof o!="object"||o===null?xt("Object expected"):(It(l=o.get)&&(A.get=l),It(l=o.set)&&(A.set=l),It(l=o.init)&&b.unshift(l));return h||nn(e,n),A&&mt(n,s,A),c?h^4?r:A:n},Fa=(e,t,s)=>jl(e,typeof t!="symbol"?t+"":t,s),rn=(e,t,s)=>t.has(e)||xt("Cannot "+s),ja=(e,t)=>Object(t)!==t?xt('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)?xt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),we=(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),Pa=(e,t,s,i)=>({set _(n){we(e,t,n,s)},get _(){return he(e,t,i)}}),Ol,fs,Bl=C({"base.ts"(){"use strict";Ol=(()=>{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 ye(e,t,s){return s===1?e.replace(/\0(\d+)g\x7F/gu,(i,n)=>ye(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,ht,ct,gt,st,ql,be,Xe,qn,Wn,ms,Wl,zn,Mn,Ut,pt,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]`,ht=String.raw`(?:\[[\da-f:.]+\]|${Rs})`,ct=String.raw`(?:${Rs}|\0\d+[cn!~]\x7F)*`,gt=e=>e.trim().toLowerCase(),st=(e,t)=>s=>s.replace(e,t),ql=st(/[\0\x7F]|\r$/gmu,""),be=st(/\0\d+[cn]\x7F/gu,""),Xe=(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),Wl=st(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),zn={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},Mn=e=>st(e,t=>`&${zn[t]};`),Ut=Mn(/[&<>]/gu),pt=(e,t={})=>{const{pre:s="",post:i="",sep:n=""}=t;return s+e.map(r=>r.print()).join(n)+i}}}),Ra=Pl({"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}}}),Oa=Pl({"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:[]}}}),Se,zl,Hi,Ke=C({"util/constants.ts"(){"use strict";Se=11,zl=Ra(),Hi=Oa()}});function dt(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=dt}}),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 m(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=m(this,s))!=null||L(this,s,m(this,e).getRootNode().posFromIndex(m(this,t))),m(this,s)},r)}}),Un,Hn,Mt,Gi,Os,B,Q,$e,bs,U,ln,qe,on,an,un,Dt,ft,dn,Je,Ul,z=C({"util/lint.ts"(){"use strict";Ye(),Ne(),de(),W(),Un=new Set(["tr","td","th","caption"]),Hn=new Set(["Template:!!","Template:!-"]),Mt=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&&Mt(t.childNodes[1]);if(t.is("magic-word"))try{const s=t.getPossibleValues().map(Mt);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:v}=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:v}},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}}),Q=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:" "}),ft=(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,"|")}),Je=(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},Ul=(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,Hl=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";z(),ws=(e=!0)=>t=>{const s=new WeakMap;return function(...i){return Je(s.get(this),()=>t.apply(this,i),n=>{s.set(this,n)},e)}}}}),Dl,Ba=C({"mixin/nodeLike.ts"(){"use strict";Dl=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,wt,yt,Kt,St,kt,At,Ve,Gl=C({"lib/node.ts"(){"use strict";z(),Ne(),cn(),Ba(),W(),Vn=[Dl],Gn=[ws(!1)],Ve=class{constructor(){J(At,5,this),Fa(this,"childNodes",[]),Re(this,Xt),Re(this,wt),Re(this,yt),Re(this,Kt),Re(this,St),Re(this,kt,{})}get parentNode(){return he(this,Xt)}get nextSibling(){return he(this,wt)}get previousSibling(){return he(this,yt)}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":we(this,Xt,t),t||(we(this,wt,void 0),we(this,yt,void 0));break;case"nextSibling":we(this,wt,t);break;case"previousSibling":we(this,yt,t);break;case"aIndex":I.viewOnly&&we(this,St,[ke.rev,t]);break;default:this[e]=t}}getRootNode(){return Je(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"&&we(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 Je(he(this,kt)[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,kt)[n]=[ke.rev,i]),i+=t[n].toString().length+this.getGaps(n);return i},t=>{he(this,kt)[e]=t})}getAbsoluteIndex(){return Je(he(this,St),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{we(this,St,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!`)}},At=K(null),Xt=new WeakMap,wt=new WeakMap,yt=new WeakMap,Kt=new WeakMap,St=new WeakMap,kt=new WeakMap,X(At,1,"getLines",Gn,Ve),Ve=X(At,0,"AstNode",Vn,Ve),J(At,1,Ve)}}),Vl,qa=C({"mixin/elementLike.ts"(){"use strict";Hl(),Vl=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,Wa=C({"lib/element.ts"(){"use strict";ge(),Ne(),Hl(),Gl(),qa(),Qn=[Vl],Nt=class extends(Jn=Ve){get length(){return this.childNodes.length}text(e){return Xe(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":""}">`)+pt(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,zs,er,Qi,za=C({"lib/text.ts"(){"use strict";var e,Ql,s;ge(),z(),W(),Gl(),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},zs=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 Ve{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:v}=a;if(c==="attr-value"){const{name:O,tag:re}=v;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 b=[],S=h==null?void 0:h.type,A=h==null?void 0:h.name,w=g==null?void 0:g.type,f=this.getRootNode(),y=f.toString(),{ext:_,html:x,variants:k}=f.getAttribute("config"),{top:T,left:$}=f.posFromIndex(n),{lintConfig:j}=I,E=j.rules["tag-like"],P=typeof E=="number"?new Set:new Set(Object.keys(E[1]).filter(O=>O!=="invalid"&&O!=="disallowed")),ne=new Set(["onlyinclude","noinclude","includeonly",..._,...x[0],...x[1],...x[2],...P,...j.getSeverity("tag-like","disallowed")?zs:[]]);for(let O=r.exec(d);O;O=r.exec(d)){const[,re,fe]=O;let{index:G,0:D}=O;if(fe&&fe!=="]"){const{length:pe}=fe;G+=pe,D=D.slice(pe)}D=D.toLowerCase();const[Y]=D,M=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(G+1))||h!=null&&h.is("ext")&&A==="nowiki"&&((l=h.innerText)!=null&&l.includes("]")))||M&&(!a.isPlain()||Yn.has(c)))continue;oe&&(G||ae>1)&&r.lastIndex--;let te=n+G,Ue=te+ae,ue,ve;const Ce=y[Ue],Is=y[te-1],Ns=Z||ee,Ls=Z&&Is==="-"&&k.length>0,Es=H&&Ce==="-"&&k.length>0,Cn=ee&&S==="free-ext-link"&&!d.slice(G+1).trim()||oe&&w==="free-ext-link"&&!d.slice(0,G).includes("]");if(M)ue="lonely-http",D=D.toUpperCase(),ve=j.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:zs.has(re)&&!_.includes(re)&&(pe="disallowed"),ve=j.getSeverity(ue,pe)}else if(Ls||Es)ue="lonely-bracket",ve=j.getSeverity(ue,"converter"),Ls&&G>0?(D="-{",G--,te--,ae=2):Es&&G<d.length-1&&(D="}-",Ue++,ae=2);else if(Cn)ue="lonely-bracket",ve=j.getSeverity(ue,"extLink");else if(Ns||H||oe)if(ue="lonely-bracket",ae>1||Z&&Ce===Y||H&&Is===Y)ve=j.getSeverity(ue,"double");else{if(!ee||c!=="ext-link-text"){const pe=Zn[Y],Fs=Ns?d.slice(G+1):d.slice(0,G);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 De=this[En];for(;De&&(De.type!=="text"||!pe.test(De.data));)De=De[En];if(De&&pe.exec(De.data)[0]!==Y)continue}}ve=j.getSeverity(ue,"single")}else ue="lonely-http",ve=j.getSeverity(ue);if(!ve)continue;const In=this.posFromIndex(G),{line:Nn,character:Ln}=Gi(T,$,In.top+1,In.left),He={rule:ue,message:I.msg("lonely",M||Y==="h"||Ls||Es?D:Y),severity:ve,startIndex:te,endIndex:Ue,startLine:Nn,endLine:Nn,startCol:Ln,endCol:Ln+ae};if(j.computeEditInfo)if(Y==="<")He.suggestions=[ft(te,"<")];else if(Y==="h"&&c!=="link-text"&&er.test(Is||""))He.suggestions=[Dt(te)];else if(ee&&c==="ext-link-text"){const pe=a.getAbsoluteIndex()+a.toString().length;He.suggestions=[ft(pe,"]")]}else if(oe&&Cn){const pe=n-g.toString().length;He.suggestions=[bs(pe,"left-bracket","[")]}else M&&(He.suggestions=[...O[0]===D?[]:[un(He,D)],...Ce===":"||Ce===":"?[Dt(Ue,1)]:[]]);b.push(He)}return b}}replaceData(n){R(this,e,Ql).call(this,n)}splitText(n){this.lspError("AstText.splitText")}escape(){}print(){return Ut(this.data)}},e=new WeakSet,Ql=function(n){this.setAttribute("data",n)},s)}}),Ze,vt=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,bt=C({"src/syntax.ts"(){"use strict";var e,t;q(),et=(t=class extends F{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)}}),je,We=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 F{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)}}),tr,sr,Ms,ir,Oe,ys=C({"src/link/base.ts"(){"use strict";var e,t,s,i;z(),Ke(),de(),We(),Fe(),W(),q(),ze(),tr=n=>n==="redirect-target"||n==="link",sr=[Ie,je("[[")],Oe=(i=class extends(ir=F){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 F(l,o,u,{});a.type="link-text",a.setAttribute("stage",Se-1),this.insertAt(a)}L(this,t,d)}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:[u,d],type:a}=this,{encoded:h,fragment:g}=m(this,s),{lintConfig:c}=I,{computeEditInfo:p,fix:v}=c,b=new le(this,r);let S="unknown-page",A=c.getSeverity(S);if(A&&u.childNodes.some(({type:w})=>w==="template")&&o.push(B(u,b,S,"template-in-link",A)),S="url-encoding",A=c.getSeverity(S),A&&h){const w=B(u,b,S,"unnecessary-encoding",A);(p||v)&&(w.fix=ln(w,u)),o.push(w)}if(S="pipe-like",A=c.getSeverity(S,"link"),A&&(a==="link"||a==="category")){const w=d==null?void 0:d.childNodes.findIndex(y=>y.type==="text"&&y.data.includes("|")),f=d==null?void 0:d.childNodes[w];if(f){const y=B(d,b,S,"pipe-in-link",A);if(p){const _=y.startIndex+d.getRelativeIndex(w);y.suggestions=[dn(_,f.data)]}o.push(y)}}if(S="no-ignored",A=c.getSeverity(S,"fragment"),A&&g!==void 0&&!tr(a)){const w=B(u,b,S,"useless-fragment",A);if(p||v){const f=u.childNodes.findIndex(_=>_.type==="text"&&_.data.includes("#")),y=u.childNodes[f];y&&(w.fix=U(w,u.getRelativeIndex(f)+y.data.indexOf("#")))}o.push(w)}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),Ms=K(ir),Oe=X(Ms,0,"LinkBaseToken",sr,Oe),J(Ms,1,Oe)}}),nr,Us,rr,Te,tt=C({"src/nowiki/base.ts"(){"use strict";Fe(),q(),nr=[Ie],Te=class extends(rr=F){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,Me=C({"src/nowiki/noinclude.ts"(){"use strict";vt(),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)}}),Jl,Ma=C({"src/link/redirectTarget.ts"(){"use strict";z(),W(),ys(),Me(),Jl=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,Ua=C({"src/redirect.ts"(){"use strict";var e,t,s;vt(),Fe(),q(),bt(),Ma(),ar=[Ze(!1,!1),Ie],Lt=(s=class extends(ur=F){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 Jl(l,o==null?void 0:o.slice(1),d,a))}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),Ds=K(ur),Lt=X(Ds,0,"RedirectToken",ar,Lt),J(Ds,1,Lt)}}),Xl={};se(Xl,{parseRedirect:()=>Kl});var Kl,Ha=C({"parser/redirect.ts"(){"use strict";W(),Ua(),Kl=(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,Da=C({"src/onlyinclude.ts"(){"use strict";We(),Fe(),q(),dr=[Ie,je("<onlyinclude>")],Et=class extends(hr=F){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,Qe,gn=C({"src/tagPair/index.ts"(){"use strict";var e,t;Ss(),Fe(),q(),cr=[Vt(),Ie],Qe=(t=class extends(gr=F){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]=m(this,e);return n?`<${o}${r.toString(i)}/>`:`<${o}${r.toString(i)}>${l.toString(i)}${this.closed?`</${u}>`:""}`}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),Vs=K(gr),Qe=X(Vs,0,"TagPairToken",cr,Qe),J(Vs,1,Qe)}}),Yl,Ga=C({"src/tagPair/translate.ts"(){"use strict";var e,Zl,s;q(),gn(),bt(),Me(),Yl=(s=class extends Qe{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 F(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,Zl).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,Zl=function(){return this.firstChild.toString()===" nowrap"},s)}}),pr,Qs,fr,Ft,Va=C({"src/tagPair/include.ts"(){"use strict";z(),de(),vt(),W(),gn(),pr=[Ze(!1)],Ft=class extends(fr=Qe){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=Q(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,eo;class s extends t{constructor(){super(...arguments);N(this,i)}hasAttr(o){this.lspError("AttributesParent.hasAttr")}getAttr(o){return R(this,i,eo).call(this).getAttr(o)}}return i=new WeakSet,eo=function(){return this.childNodes[e]},s}}}),ie,Js,Xs,_t,Zt,Ks,Ge,Ys,Zs,ei,es,ti,Ae,to,so,io,no,Qa=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"]),Ge=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,to=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"]),so={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:Ge,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:Ge,poem:ie,categorytree:ie,combooption:ie,math:Ae,chem:Ae,ce:Ae,img:new Set(["alt","src","width","height","loading","srcset"])},io={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:Ge,flashmp3:Ge,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},no={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:Ge,p:ie,pre:_t,tr:ei,ul:Ge}}}),mr,xr,vr,br,as,Ja=C({"src/attribute.ts"(){"use strict";var e,t,s,i,n,Ji,l;z(),ge(),Ke(),Qa(),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 F{constructor(u,d,a,h="",g,c=[],p=I.getConfig(),v=[]){const b=new xe(a,"attr-key",p,v);let S;if(a==="title"||d==="img"&&a==="alt")S=new F(g,p,v,{}),S.type="attr-value",S.setAttribute("stage",Se-1);else if(d==="gallery"&&a==="caption"||d==="choose"&&(a==="before"||a==="after")){const A=Le(me({},p),{excludes:[...p.excludes,"heading","html","table","hr","list"]});S=new F(g,A,v,{}),S.type="attr-value",S.setAttribute("stage",1)}else S=new xe(g,"attr-value",p,v,{});super(void 0,p,v);N(this,n);N(this,e);N(this,t);N(this,s);N(this,i);L(this,e,u),this.append(b,S),L(this,s,h),L(this,i,[...c]),L(this,t,d),this.setAttribute("name",gt(be(a)))}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",gt(this.firstChild.text())),super.afterBuild()}toString(u){const[d="",a=""]=m(this,i);return m(this,s)?super.toString(u,m(this,s)+d)+a:this.firstChild.toString(u)}text(){return m(this,s)?`${super.text(`${m(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var u,d;return m(this,s)?m(this,s).length+((d=(u=m(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:v,tag:b}=this,S=new le(this,u),A=["unclosed-quote","obsolete-attr"],{lintConfig:w}=I,f=A.map(_=>w.getSeverity(_,v));if(f[0]&&!g){const _=B(p,S,A[0],I.msg("unclosed","quotes"),f[0]);_.startIndex--,_.startCol--,w.computeEditInfo&&(_.suggestions=[qe(_.endIndex,m(this,i)[0])]),h.push(_)}const y=R(this,n,Ji).call(this,u,S);return y&&h.push(y),f[1]&&((a=no[b])!=null&&a.has(v))&&h.push(B(c,S,A[1],"obsolete-attribute",f[1])),h}}getValue(){return m(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=""]=m(this,i);return m(this,s)?super.print({sep:Ut(m(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:v}=this,b=!h.childNodes.some(({type:k})=>vr.has(k)),S=this.getValue(),A=io[p],w=so[p],{length:f}=this.toString();let y="illegal-attr",_,x;if({lintConfig:_}=I,{computeEditInfo:x}=_,!(A!=null&&A.has(c))&&!(w!=null&&w.has(c))&&(g==="ext-attr"?A||w:!/\{\{[^{]+\}\}/u.test(c))&&(g==="ext-attr"&&!w||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(c)&&(p==="meta"||p==="link"||!to.has(c)))||(c==="itemtype"||c==="itemid"||c==="itemref")&&!(v!=null&&v.hasAttr("itemscope"))){if(u===void 0)return!0;{const k=_.getSeverity(y,"unknown");if(k){const T=B(a,d,y,"illegal-attribute-name",k);return x&&(T.suggestions=[U(u,f)]),T}}}else if(c==="style"&&typeof S=="string"&&mr.test(S)){if(u===void 0)return!0;{y="insecure-style";const k=_.getSeverity(y);return k&&B(h,d,y,"insecure-style",k)}}else if(c==="tabindex"&&typeof S=="string"&&S!=="0"){if(u===void 0)return!0;{const k=_.getSeverity(y,"tabindex");if(k){const T=B(h,d,y,"nonzero-tabindex",k);return x&&(T.suggestions=[U(u,f),$e(T,"0 tabindex","0")]),T}}}else if(b&&g!=="ext-attr"){const k=Ul(p,c),T=String(S).toLowerCase();if(k.length>0&&k.every($=>$!==T)){if(u===void 0)return!0;{const $=_.getSeverity(y,"value");return $&&B(h,d,y,"illegal-attribute-value",$)}}}else if(typeof S=="string"&&((/^xmlns:[\w:.-]+$/u.test(c)||br.has(c))&&xr.test(S)||b&&(c==="href"||p==="img"&&c==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(S))){if(u===void 0)return!0;{const k=_.getSeverity(y,"value");return k&&B(h,d,y,"illegal-attribute-value",k)}}return!1},l)}}),si,wr,yr,As,fn=C({"src/attributes.ts"(){"use strict";var e,t,us,i;z(),ge(),de(),W(),q(),ze(),Ja(),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 F{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:v,0:b,1:S,2:A,3:w,4:f,5:y,6:_}=g;if(h+=r.slice(c,v),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(be(S).trim())){const x=f!=null?f:_,k=[w,y],T=new as(si(l),o,S,A,x,k,u,d);p(),super.insertAt(T)}else h+=b;({lastIndex:c}=a),g=a.exec(r)}h+=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 as&&(!r||l.name===gt(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:v,fix:b}=p,S=["closingTag","invalidAttributes","nonWordAttributes"].map(w=>p.getSeverity(c[0],w));if(S[0]&&R(this,t,us).call(this)){const w=Q(this,g,c[0],"attributes-of-closing-tag",S[0]);if(v){const f=u.getAbsoluteIndex();w.suggestions=[U(w),on(f)]}o.push(w)}for(const w of d)if(w instanceof as){const{name:f}=w;a.has(f)?(h.add(f),a.get(f).push(w)):a.set(f,[w])}else{const f=w.text().trim(),y=S[yr.test(f)?1:2];if(f&&y){const _=B(w,g,c[0],"invalid-attribute",y);v&&(_.suggestions=[U(_,0," ")]),o.push(_)}}const A=p.getSeverity(c[1],"attribute");if(A&&h.size>0)for(const w of h){const f=a.get(w).map(y=>{const _=y.getValue();return[y,_===!0?"":_]});o.push(...f.map(([y,_],x)=>{const k=B(y,g,c[1],I.msg("duplicate-attribute",w),A);if(v||b){const T=U(k);!_||f.slice(0,x).some(([,$])=>$===_)?k.fix=T:v&&(k.suggestions=[T])}return k}))}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)}}),ro={};se(ro,{PreToken:()=>lo});var lo,Xa=C({"src/pre.ts"(){"use strict";Ke(),q(),Me(),lo=class extends F{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",Se-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}}}),oo={};se(oo,{ParamTagToken:()=>it});var Sr,ii,kr,it,ao=C({"src/paramTag/index.ts"(){"use strict";z(),de(),Ts(),mn(),W(),q(),ze(),Sr=[_s],it=class extends(kr=F){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),it=X(ii,0,"ParamTagToken",Sr,it),J(ii,1,it)}}),Ar,ni,_r,nt,uo=C({"src/heading.ts"(){"use strict";var e,t,ds,i;z(),Ne(),de(),Fe(),W(),q(),bt(),Ar=[Ie],nt=(i=class extends(_r=F){constructor(r,l,o,u=[]){super(void 0,o,u);N(this,t);N(this,e);L(this,e,r);const d=new F(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 m(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(),v=["h1","unbalanced-header","format-leakage"],{lintConfig:b}=I,{computeEditInfo:S,fix:A}=b,w=v.map(f=>b.getSeverity(f,"apostrophe"));if(w[0]&&this.level===1){const f=B(u,c,v[0],"<h1>",w[0]);S&&!g&&(f.suggestions=[$e(f,"h2",`=${a}=`)]),o.push(f)}if(w[1]&&g){const f=I.msg("unbalanced-in-section-header",'"="'),y=B(u,c,v[1],f,w[1]);if(!(!S||a==="="))if(h){const[_]=/^=+/u.exec(a),x=d+_.length;y.suggestions=[{desc:`h${d}`,range:[y.startIndex,y.startIndex+_.length],text:""}],x<7&&y.suggestions.push({desc:`h${x}`,range:[y.endIndex,y.endIndex],text:_})}else{const _=/[^=](=+)$/u.exec(a)[1],x=d+_.length;y.suggestions=[{desc:`h${d}`,range:[y.endIndex-_.length,y.endIndex],text:""}],x<7&&y.suggestions.push({desc:`h${x}`,range:[y.startIndex,y.startIndex],text:_})}o.push(y)}if(p){const f="parsing-order",y=b.getSeverity(f,p===2?"heading":"templateInTable");y&&o.push(Q(this,c,f,"header-in-html",y))}if(w[2]){const f=this.getRootNode().toString(),y=u.childNodes.filter(Cs("quote")),_=y.filter(({bold:k})=>k),x=y.filter(({italic:k})=>k);if(_.length%2){const k=B(_[_.length-1],Le(me({},c),{start:r+d,left:c.left+d}),v[2],I.msg("unbalanced-in-section-header","bold-apostrophes"),w[2]);if(S||A){const T=r+d+a.length,$=U(k);f.slice(k.endIndex,T).trim()?S&&(k.suggestions=[$,qe(T,"'''")]):_.length===1&&x.length===0?k.fix=$:S&&(k.suggestions=[$])}o.push(k)}if(x.length%2){const k=B(x[x.length-1],{start:r+d},v[2],I.msg("unbalanced-in-section-header","italic-apostrophes"),w[2]);if(S||A){const T=r+d+a.length;f.slice(k.endIndex,T).trim()?S&&(k.suggestions=[qe(T,"''")]):x.length===1&&_.length===0?k.fix=U(k):S&&(k.suggestions=[U(k)])}o.push(k)}}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),nt=X(ni,0,"HeadingToken",Ar,nt),J(ni,1,nt)}}),$r,ho,Ka=C({"src/parameter.ts"(){"use strict";ge(),z(),W(),q(),$r=new RegExp(`https?://${ht}${ct}$`,"iu"),ho=class extends F{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 F(typeof e=="number"?void 0:e,s,i,{}),r=new F(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=ft(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,rt,Ya=C({"src/transclude.ts"(){"use strict";var e,t,s,i,n,r,hs,co,u;ge(),z(),Ne(),de(),Ss(),Fe(),W(),q(),Ka(),ze(),bt(),Tr=[Ie,Vt()],rt=(u=class extends(Cr=F){constructor(a,h,g,c=[]){var $,j;let p;const v=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(a);v&&(p=Number(v[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:[b,S],variable:A,functionHook:w}=g,f=($=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(a))==null?void 0:$[0];if(f)this.setAttribute("modifier",f),a=a.slice(f.length);else if(a.includes(":")){const[E,...P]=a.split(":"),[ne]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((j=P[0])!=null?j:"");this.setModifier(`${E}:${ne}`)&&(a=P.join(":").slice(ne.length))}const y=a.search(/[::]/u),_=a[y]===":",x=y!==-1;if(x||h.length===0&&!m(this,s)){const E=x?a.slice(0,y):a,P=x&&a.slice(y+1),ne=be(E),O=x?ne.slice(ne.search(/\S/u))+(_?":":""):ne.trim(),re=O.toLowerCase(),fe=Array.isArray(S),G=fe?S.includes(O):Object.prototype.hasOwnProperty.call(S,O),D=!fe&&G?S[O]:Object.prototype.hasOwnProperty.call(b,re)&&b[re],Y=fe&&G||!("functionHook"in g)||w.includes(D),M=fe&&G||A.includes(D);if(x?D&&Y:M){this.setAttribute("name",D||re.replace(/^#|:$/u,"")),L(this,e,"magic-word"),_&&L(this,t,":");const Z=new et(E,"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 E=be(a).trim();if(!this.normalizeTitle(E,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 k=this.isTemplate();let T=1;for(let E=0;E<h.length;E++){const P=h[E];k||this.name==="switch"&&E>0||this.name==="tag"&&E>1||(P[0]=P.join("="),P.length=1),P.length===1&&(P.unshift(T),T++),this.insertAt(new ho(...P,g,c))}this.seal("modifier")}get type(){return m(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(),v=h.includes(p),b=g.includes(p);return m(this,s)&&v||!m(this,s)&&(b||!a)||(ke.running||this.length>1)&&(v||b||!a)?(this.setAttribute("modifier",a),L(this,s,v),!!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",m(this,n).title))}toString(a){const{childNodes:h,length:g,firstChild:c,modifier:p,type:v}=this;return`{{${p}${v==="magic-word"?c.toString(a)+(g===1?"":m(this,t))+h.slice(1).map(b=>b.toString(a)).join("|"):super.toString(a,"|")}}}`}text(){const{childNodes:a,length:h,firstChild:g,modifier:c,type:p,name:v}=this;return p==="magic-word"&&v==="vardefine"?"":`{{${c}${p==="magic-word"?g.text()+(h===1?"":m(this,t))+Xe(a.slice(1),"|"):super.text("|")}}}`}getAttribute(a){switch(a){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||!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:v}=this,b=new le(this,a),{lintConfig:S}=I,{computeEditInfo:A}=S,w=c==="magic-word";let f="no-ignored",y=S.getSeverity(f,"fragment");if(w&&!R(this,r,hs).call(this).valid)f="invalid-invoke",y=S.getSeverity(f,"name"),y&&g.push(B(p[1],b,f,"illegal-module",y));else if(y){const _=p[w?1:0],x=_.childNodes.findIndex(T=>T.type==="text"&&ms(T.data).includes("#")),k=_.childNodes[x];if(k){const T=B(_,b,f,"useless-fragment",y);A&&(T.suggestions=[U(T,_.getRelativeIndex(x)+k.data.indexOf("#"))]),g.push(T)}}if(f="invalid-invoke",y=S.getSeverity(f,"function"),y&&w&&v===2)return g.push(Q(this,b,f,"missing-function",y)),g;if(f="no-duplicate",y=S.getSeverity(f,"parameter"),y){const _=this.getDuplicatedArgs().filter(([,k])=>!k[0].querySelector("ext")),x="duplicate-parameter";for(const[,k]of _)g.push(...k.map(T=>{const $=B(T,b,f,x,y);return A&&($.suggestions=[U($,-1)]),$}))}return g}}insertAt(a,h=this.length){return super.insertAt(a,h),a.anon?R(this,r,co).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 m(this,i).has(c)?p=m(this,i).get(c):(p=new Set(this.getAllArgs().filter(({name:v})=>c===v)),m(this,i).set(c,p)),p}getDuplicatedArgs(){return[...m(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 v=g.slice(2),b=v[v.length-1];p=[...v.filter(({anon:S})=>!S),...b!=null&&b.anon?[b]:[]].map(({lastChild:S})=>S);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}p!=null||(p=g.slice(c,c+2).map(({lastChild:v})=>v));for(let v=0;v<p.length;){const{length:b,0:S}=p[v].childNodes.filter(A=>A.text().trim());if(b===0)p.splice(v,1);else if(b>1||S.type!=="magic-word")v++;else try{const A=S.getPossibleValues();p.splice(v,1,...A),v+=A.length}catch(A){v++}}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?"":m(this,t))+pt(a.slice(1),{sep:"|"}):(c?`<span class="wpb-magic-word">${Ut(c)}</span>`:"")+pt(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})},co=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:v}=p,b=String(c+1);(v!==b||p===a)&&(p.setAttribute("name",b),this.getArgs(b,!1,!1).add(p))}},u),ri=K(Cr),rt=X(ri,0,"TranscludeToken",Tr,rt),J(ri,1,rt)}}),Ir,li,Nr,jt,Za=C({"src/hidden.ts"(){"use strict";vt(),q(),Ir=[Ze()],jt=class extends(Nr=F){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,eu=C({"src/arg.ts"(){"use strict";var e,tu,s;ge(),z(),de(),We(),Ss(),Fe(),W(),q(),ze(),Za(),Lr=[Ie,je("{{{"),Vt()],Pt=(s=class extends(Er=F){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 F(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`{{{${Xe(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 v=o.lint(p,r);v.length>0&&d.push(...v)}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(v=>{const b=B(v,p,a[0],"invisible-triple-braces",c[0]);return b.startIndex--,b.startCol--,g&&(b.suggestions=[U(b),ft(b.startIndex,"{{!}}")]),b}))}if(c[1]&&!this.getAttribute("include")){const p=Q(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,tu=function(){},s),oi=K(Er),Pt=X(oi,0,"ArgToken",Lr,Pt),J(oi,1,Pt)}}),go={};se(go,{parseBraces:()=>$s});var Fr,ai,ts,ui,di,hi,jr,ci,$s,xn=C({"parser/braces.ts"(){"use strict";Ye(),ge(),uo(),Ya(),eu(),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=dt(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=gt(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,v,b,S,A;const i=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,n]}=t,r=[],l=[],o=(w,f,y,_)=>{f[f.length-1].push(ye(w.slice(y,_),l))};let u;do u!==void 0&&(e=u),u=e.replace(jr,(w,f,y)=>{if(f!==void 0||typeof y=="string")try{const{length:_}=s,x=(f!=null?f:y).split("|");return new rt(ye(x[0],l),x.slice(1).map(k=>{const T=k.indexOf("=");return(T===-1?[k]:[k.slice(0,T),k.slice(T+1)]).map($=>ye($,l))}),t,s),`\0${_}${ci(x[0])}`}catch(_){if(!(_ instanceof SyntaxError)||_.message!=="Invalid template name")throw _}return l.push(ye(w,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&&((v=(p=r[r.length-1])==null?void 0:p[0])!=null&&v.startsWith("="));){if(g!=null&&g[1]){const[,{length:P}]=g;g[0]=g[0].slice(P),g.index+=P}const{0:w,index:f}=g!=null?g:{0:`
|
|
8
|
+
`,index:e.length},y=(b=r.pop())!=null?b:{},{0:_,index:x,parts:k,findEqual:T,pos:$}=y,j=w==="="&&T;if(w==="]]"||w==="}-")c=f+2;else if(w===`
|
|
9
|
+
`){c=f+1;const{pos:P,findEqual:ne}=(S=r[r.length-1])!=null?S:{};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,f));O&&(O[2]=ye(O[2],l),O[2].includes(`
|
|
10
|
+
`)||(e=`${e.slice(0,x)}\0${s.length}h${e.slice(f)}`,c=x+4+String(s.length).length,new nt(O[1].length,O.slice(2),t,s)))}}else if(w==="|"||j)c=f+1,o(e,k,$,f),w==="|"&&k.push([]),y.pos=c,y.findEqual=w==="|",r.push(y);else if(w.startsWith("}}")){const P=w.slice(0,Math.min(_.length,3)),ne=_.length-P.length,{length:O}=s;c=f+P.length,o(e,k,$,f);let re=!1,fe="t";if(P.length===3){const G=k.map(Y=>Y.join("=")),D=G.length>1&&be(G[1]).trim();new Pt(G,t,s),D&&D.endsWith(":")&&n.includes(D.slice(0,-1).toLowerCase())&&(fe="s")}else try{new rt(k[0][0],k.slice(1),t,s),fe=ci(k[0][0])}catch(G){if(G instanceof SyntaxError&&G.message==="Invalid template name")re=!0;else throw G}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:_.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=f+w.length,w.startsWith("{")&&(g.pos=c,g.parts=[[]]),r.push(..."0"in y?[y]:[],g);let E=r[r.length-1];if(a&&d+e.length<c)for(a=!1;(A=E==null?void 0:E[0])!=null&&A.startsWith("{");)r.pop(),E=r[r.length-1];h=hi(i+(a?ui:"")+(E?`|${Fr[E[0][0]]}${E.findEqual?"|=":""}`:"")),h.lastIndex=c,g=h.exec(e)}return ye(e,l)}}}),po={};se(po,{InputboxToken:()=>fo});var fo,su=C({"src/paramTag/inputbox.ts"(){"use strict";Ts(),xn(),W(),ao(),fo=class extends it{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:()=>mo});var Pr,Rr,mo,gi=C({"src/nested.ts"(){"use strict";var e,t,s;z(),de(),Ts(),xn(),W(),q(),Fo(),Me(),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")}),mo=(s=class extends F{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 ut(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 m(this,t)=="boolean"?Rr[m(this,t)?1:0]:/^<!--[\s\S]*-->$/u;return[...l,...this.childNodes.filter(g=>{const{type:c,name:p}=g;if(c==="ext")return!m(this,e).includes(p);if(Pr.has(c))return!1;const v=g.toString().trim();return v&&!h.test(v)}).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(xo(s.protocol).test(r))return vo(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 xo,vo,Br,qr,bo,iu=C({"src/imageParameter.ts"(){"use strict";var e,t,wo,n;Ye(),ge(),z(),W(),q(),xo=dt(r=>new RegExp(String.raw`^(?:${r}|//|\0\d+m\x7F)`,"iu")),vo=dt(r=>new RegExp(String.raw`^(?:(?:${r}|//)${ht}|\0\d+m\x7F)${ct}$`,"iu")),Br=dt(r=>new RegExp(String.raw`^(\s*(?!\s))${r.replace("$1","(.*)")}${r.endsWith("$1")?`(?=$|
|
|
11
|
+
)`:""}(\s*)$`,"u")),qr=new Set(["alt","link","lang","page","caption"]),bo=(n=class extends F{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]);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 m(this,e)?m(this,e).replace("$1",super.toString(l)):super.toString(l)}text(){return m(this,e)?m(this,e).replace("$1",super.text()).trim():super.text().trim()}isPlain(){return this.name==="caption"}getAttribute(l){return l==="invalid"?this.name==="invalid":l==="padding"?Math.max(0,m(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",v=d.getSeverity(p,"parameter");if(v){const b=Q(this,{start:l},p,"invalid-image-parameter",v);(a||h)&&(b.fix=U(b,-1)),u.push(b)}}else if(typeof g=="object"&&g.encoded){const p="url-encoding",v=d.getSeverity(p,"file");if(v){const b=Q(this,{start:l},p,"unnecessary-encoding",v);(a||h)&&(b.fix=ln(b,this)),u.push(b)}}return u}}getValue(){return this.name==="invalid"?this.text():R(this,t,wo).call(this)||super.text()}print(){return m(this,e)?`<span class="wpb-image-parameter${this.name==="invalid"?" wpb-invalid":""}">${m(this,e).replace("$1",`<span class="wpb-image-caption">${pt(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}},e=new WeakMap,t=new WeakSet,wo=function(){return m(this,e)&&!m(this,e).includes("$1")},n)}}),pi,Wr,zr,fi,mi,xi,Mr,vi,vn,yo=C({"src/link/file.ts"(){"use strict";z(),de(),W(),ys(),iu(),pi=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),Wr=new Set(["arg"]),zr=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"]),Mr=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(){return this.getAttribute("title").extension}constructor(e,t,s,i=[],n="|"){super(e,void 0,s,i,n);const{extension:r}=this.getTitle(!0,!0);this.safeAppend(Mr(t).map(l=>new bo(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:f})=>f))],l=r.filter(f=>pi.has(f)),o=r.filter(f=>fi.has(f)),u=r.filter(f=>mi.has(f)),[d]=l,a=d==="framed"||d==="manualthumb",h=new le(this,e),{lintConfig:g}=I,{computeEditInfo:c,fix:p}=g,{extension:v}=this;let b="nested-link",S=g.getSeverity(b,"file");if(S&&xi.has(v)&&this.closest("ext-link-text")&&((s=this.getValue("link"))==null?void 0:s.trim())!==""){const f=Q(this,h,b,"link-in-extlink",S);if(c||p){const y=this.getArg("link");if(y){const _=e+y.getRelativeIndex();f.fix={desc:I.msg("delink"),range:[_,_+y.toString().length],text:"link="}}else f.fix=bs(f.endIndex-2,"delink","|link=")}i.push(f)}if(b="invalid-gallery",S=g.getSeverity(b,"parameter"),S&&a)for(const f of n.filter(({name:y})=>y==="width")){const y=B(f,h,b,"invalid-image-parameter",S);(c||p)&&(y.fix=U(y,-1)),i.push(y)}if(n.length===r.length&&l.length<2&&o.length<2&&u.length<2)return i;b="no-duplicate";const A=["unknownImageParameter","imageParameter"].map(f=>g.getSeverity(b,f)),w=(f,y,_,x=!0)=>f.map(k=>{if(S=A[Number(typeof x=="function"?x(k):x)],!S)return!1;const T=B(k,h,b,I.msg(`${y}-image-parameter`,_),S);return c&&(T.suggestions=[U(T,-1)]),T}).filter(k=>k!==!1);for(const f of r){if(f==="invalid"||f==="width"&&a)continue;const y=f==="caption";let _=n.filter(({name:x})=>x===f);if(y&&(_=[..._.slice(0,-1).filter(x=>x.text()),..._.slice(-1)]),_.length>1){let x=!y||!v||xi.has(v);if(y&&x){const k=vi(_,zr);x=k.length>1&&(T=>k.includes(T))}i.push(...w(_,"duplicate",f,x))}}return l.length>1&&i.push(...w(n.filter(({name:f})=>pi.has(f)),"conflicting","frame")),o.length>1&&i.push(...w(n.filter(({name:f})=>fi.has(f)),"conflicting","horizontal-alignment")),u.length>1&&i.push(...w(n.filter(({name:f})=>mi.has(f)),"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,lt,So=C({"src/link/galleryImage.ts"(){"use strict";var e,Xi,s;z(),Ke(),We(),W(),q(),yo(),Ur=[je("")],lt=(s=class extends(Hr=vn){constructor(n,r,l,o,u=[]){let d;if(l!==void 0){const{length:a}=u;d=new F(l,o,u);for(let h=0;h<Se-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=Q(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),lt=X(bi,0,"GalleryImageToken",Ur,lt),J(bi,1,lt)}}),ko={};se(ko,{GalleryToken:()=>Rt});var Dr,wi,Gr,Rt,nu=C({"src/gallery.ts"(){"use strict";var e,Ao,ru,i;z(),mn(),W(),q(),So(),Me(),Dr=[_s],Rt=(i=class extends(Gr=F){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,Ao).call(this,h)?super.insertAt(new lt("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],v=p.toString(),{length:b}=v,S=v.trim(),{type:A}=p,w=o+c,f=c?0:u;if(p.setAttribute("aIndex",r),A==="noinclude"&&S&&!/^<!--.*-->$/u.test(S)){let[y]=g;if(S.startsWith("|")?[,y]=g:(S.startsWith("<!--")||S.endsWith("-->"))&&([,,y]=g),y){const _=r+b,x={rule:a,message:I.msg("invalid-content","gallery"),severity:y,startIndex:r,endIndex:_,startLine:w,endLine:w,startCol:f,endCol:f+b};h.computeEditInfo&&(x.suggestions=[U(x),an(x,v)]),d.push(x)}}else if(A!=="noinclude"&&A!=="text"){const y=p.lint(r,l);y.length>0&&d.push(...y)}r+=b+1}return d}}json(r,l=this.getAbsoluteIndex()){const o=super.json(void 0,l)}},e=new WeakSet,Ao=function(r){return this.normalizeTitle(r,6,{halfParsed:!0,temporary:!0,decode:!0}).valid},ru=function(r){},i),wi=K(Gr),Rt=X(wi,0,"GalleryToken",Dr,Rt),J(wi,1,Rt)}}),bn,_o=C({"src/link/index.ts"(){"use strict";Ye(),z(),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=Q(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;z(),ge(),de(),W(),q(),Vr=String.raw`(?:[${Be}\t]| |�*160;|&#[xX]0*[aA]0;)`,Qr=new RegExp(`${Vr}+`,"gu"),Gt=(i=class extends F{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 m(this,e)}get innerText(){const r=new Map([["!","|"],["=","="]]);let l=Xe(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:Wl(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 v="invalid-isbn",b=d.getSeverity(v);return b&&R(this,t,Ki).call(this)&&o.push(Q(this,u,v,"invalid-isbn",b)),o}const g=a==="ext-link-url",c="unterminated-url",p=d.getSeverity(c,g?"pipe":"punctuation");if(p){const v=g?/\|/u:/[,;。:!?()]+/u,b=h.find(S=>S.type==="text"&&v.test(S.data));if(b){const{data:S}=b,A=B(b,u,c,I.msg("in-url",g?'"|"':"full-width-punctuation"),p);if(d.computeEditInfo){const{index:w,0:f}=v.exec(S),y=A.startIndex+w;A.suggestions=g?[Dt(y,1)]:[Dt(y),{desc:I.msg("encode"),range:[y,y+f.length],text:encodeURI(f)}]}o.push(A)}}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,ot,$o=C({"src/extLink.ts"(){"use strict";var e,t;Ke(),z(),We(),W(),q(),wn(),Jr=[je("[")],ot=(t=class extends(Xr=F){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 F(r,l,o,{});d.type="ext-link-text",d.setAttribute("stage",Se-1),this.insertAt(d)}}get type(){return"ext-link"}toString(i){return this.length===1?`[${super.toString(i)}${m(this,e)}]`:`[${super.toString(i,m(this,e))}]`}text(){return`[${super.text(" ")}]`}getGaps(){return m(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(Q(this,{start:i},l,"variable-anchor",o)),r}}print(){return super.print(this.length===1?{pre:"[",post:`${m(this,e)}]`}:{pre:"[",sep:m(this,e),post:"]"})}},e=new WeakMap,t),yi=K(Xr),ot=X(yi,0,"ExtLinkToken",Jr,ot),J(yi,1,ot)}}),Yi,lu=C({"src/imagemapLink.ts"(){"use strict";q(),Me(),_o(),$o(),Yi=class extends F{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 ot(...t,i,n),new ce(s,i,n))}}}}),To={};se(To,{ImagemapToken:()=>Ot});var Kr,Si,Yr,Ot,ou=C({"src/imagemap.ts"(){"use strict";z(),Ne(),de(),mn(),W(),q(),Me(),So(),lu(),Kr=[_s],Ot=class extends(Yr=F){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 lt("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(Q(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,at,Co=C({"src/nowiki/comment.ts"(){"use strict";z(),vt(),We(),W(),tt(),Zr=[Ze(!1),je("<!--")],at=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=Q(this,{start:t},s,I.msg("unclosed","html-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),at=X(ki,0,"CommentToken",Zr,at),J(ki,1,at)}}),Io={};se(Io,{CommentedToken:()=>No});var No,au=C({"src/commented.ts"(){"use strict";q(),Co(),No=class extends F{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 at(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"))}}}}),Lo={};se(Lo,{NowikiToken:()=>Eo});var tl,sl,Eo,uu=C({"src/nowiki/index.ts"(){"use strict";var e,Zi,s;Ye(),z(),W(),tt(),tl=dt(i=>new RegExp(String.raw`<\s*(?:/\s*)${i==="nowiki"?"":"?"}(${i})\b`,"giu")),sl=new Set(["languages","section","templatestyles"]),Eo=(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=Q(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,ut,Fo=C({"src/tagPair/ext.ts"(){"use strict";z(),de(),W(),pn(),q(),gn(),fn(),il=[ks()],ut=class extends(nl=Qe){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 F(s,d,l);break;case"pre":{const{PreToken:h}=(Xa(),V(ro));a=new h(s,d,l);break}case"dynamicpagelist":{const{ParamTagToken:h}=(ao(),V(oo));a=new h(r,s,d,l);break}case"inputbox":{const{InputboxToken:h}=(su(),V(po));a=new h(r,s,d,l);break}case"references":{const{NestedToken:h}=(gi(),V(cs));d.excludes.push("heading"),a=new h(s,r,["ref"],d,l);break}case"choose":{const{NestedToken:h}=(gi(),V(cs));a=new h(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],d,l);break}case"combobox":{const{NestedToken:h}=(gi(),V(cs));a=new h(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],d,l);break}case"gallery":{const{GalleryToken:h}=(nu(),V(ko));a=new h(s,d,l);break}case"imagemap":{const{ImagemapToken:h}=(ou(),V(To));a=new h(s,d,l);break}case"hiero":{const{CommentedToken:h}=(au(),V(Io));a=new h(s,d,l);break}default:{const{NowikiToken:h}=(uu(),V(Lo));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(Q(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(Q(this,n,r,"variable-anchor",l)),s}}},Ai=K(nl),ut=X(Ai,0,"ExtToken",il,ut),J(Ai,1,ut)}}),jo={};se(jo,{parseCommentAndExt:()=>Qt});var _i,rl,ss,ll,$i,Qt,Ts=C({"parser/commentAndExt.ts"(){"use strict";Ye(),ge(),Da(),Me(),Ga(),Va(),Fo(),Co(),_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 Yl(d,a&&ye(a,o),l,s),`\0${h}g`}),e=ye(e,o)}return e.replace(ll[i?1:0](r),(o,u,d,a,h,g,c,p,v)=>{const b=s.length;let S="n";if(u)S="e",new ut(u,d,a,h,l,g,s);else if(o.startsWith("<!--")){S="c";const A=o.endsWith("-->");new at(ye(o,s,1).slice(4,A?-3:void 0),A,t,s)}else g?new Ft(g,c&&ye(c,s,1),p&&ye(p,s,1),v,t,s):new ce(o,t,s);return`\0${b}${S}`})}}}),ol,al,ul,dl,Ti,hl,Bt,du=C({"src/html.ts"(){"use strict";var e,t,s,i,n;z(),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=F){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 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 u;{const d=super.lint(l,o),{name:a,parentNode:h,closing:g,selfClosing:c}=this,p=new le(this,l),{lintConfig:v}=I,{computeEditInfo:b,fix:S}=v,A=this.inTableAttrs();let w="h1",f=v.getSeverity(w,"html");if(f&&a==="h1"&&!g){const $=Q(this,p,w,"<h1>",f);b&&($.suggestions=[{desc:"h2",range:[l+2,l+3],text:"2"}]),d.push($)}if(w="parsing-order",f=A&&v.getSeverity(w,A===2?"html":"templateInTable"),f){const $=Q(this,p,w,"html-in-table",f);b&&A===2&&($.suggestions=[U($)]),d.push($)}if(w="obsolete-tag",f=v.getSeverity(w,a),f&&ul.has(a)&&d.push(Q(this,p,w,"obsolete-tag",f)),w="bold-header",f=v.getSeverity(w,a),f&&(a==="b"||a==="strong")&&((u=this.closest("heading-title,ext"))==null?void 0:u.type)==="heading-title"){const $=Q(this,p,w,"bold-in-header",f);b&&($.suggestions=[U($)]),d.push($)}const{html:[,y,_]}=this.getAttribute("config"),x=_.includes(a),k=y.includes(a),T=!x&&!k;if(w="unmatched-tag",g&&(c||x)||c&&T){if(f=v.getSeverity(w,g?"both":"selfClosing"),f){const $=Q(this,p,w,g?"closing-and-self-closing":"invalid-self-closing",f);if(b||S){const j=on(l),E={desc:I.msg("no-self-closing"),range:[$.endIndex-2,$.endIndex-1],text:""};k?b&&($.suggestions=[j,E]):g?$.fix=x?j:E:b&&($.suggestions=[E,qe($.endIndex,`></${a}>`,-2)])}d.push($)}}else if(!this.findMatchingTag()){const $=Q(this,p,w,g?"unmatched-closing":"unclosed-tag"),j=this.closest("magic-word");if(j&&ol.has(j.name))f=v.getSeverity(w,"conditional");else if(g)f=v.getSeverity(w,"closing"),$.suggestions=[U($)];else{f=v.getSeverity(w,"opening");const E=h==null?void 0:h.childNodes;al.has(a)&&(E!=null&&E.slice(0,E.indexOf(this)).some(P=>P.type==="html"&&P.name===a&&!P.findMatchingTag())&&($.suggestions=[qe(l+1,"/")]),this.closest("heading-title")&&($.rule="format-leakage",f=v.getSeverity("format-leakage",a)))}f&&($.severity=f,d.push($))}return d}}findMatchingTag(){return Je(m(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,v=p.indexOf(this),b=u?p.slice(0,v).reverse():p.slice(v+1),S=[this],{rev:A}=ke;for(const w of b)if(!(!w.is("html")||w.name!==l||c&&m(w,t)))if(m(w,e)===u)S.push(w);else{const f=S.pop();if(f===this)return w;I.viewOnly&&(L(f,i,[A,w]),L(w,i,[A,f]))}if(I.viewOnly)for(const w of S)L(w,i,[A,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?"/":""}${m(this,s)}`,post:`${m(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)}}),Po={};se(Po,{parseHtml:()=>Ro});var cl,Ro,hu=C({"parser/html.ts"(){"use strict";fn(),du(),cl=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,Ro=(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:v}=s,b=new As(g,"html-attrs",a,t,s),S=b.hasAttr("itemprop");if(a==="meta"&&!(S&&b.hasAttr("content"))||a==="link"&&!(S&&b.hasAttr("href"))){r+=`<${o}`,s.length=v;continue}r+=`\0${s.length}x${p}`,new Bt(d,b,h==="/",c==="/>",t,s)}return r}}}),yn,Oo=C({"src/table/base.ts"(){"use strict";pn(),q(),bt(),fn(),yn=class extends ks(1)(F){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,$t,Tt,xs,Bo=C({"src/table/td.ts"(){"use strict";z(),de(),cn(),W(),q(),Oo(),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,$t),Re(this,_e,""),n&&([Pa(this,_e)._]=n);const l=new F(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,$t,Tt).call(this).subtype}afterBuild(){he(this,_e).includes("\0")&&we(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,$t=new WeakSet,Tt=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,$t,Tt).call(e))},Tt=X(is,17,"#getSyntax",gl,$t,Tt),nn(is,xs)}}),Sn,qo=C({"src/table/trBase.ts"(){"use strict";z(),W(),Oo(),Bo(),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=Mt(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,cu=C({"src/table/index.ts"(){"use strict";z(),Ne(),de(),cn(),W(),qo(),bt(),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],I.msg("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)}}),Wo,gu=C({"src/table/tr.ts"(){"use strict";qo(),Wo=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,zo=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";zo(),An=class extends kn{get type(){return"dd"}}}}),Uo={};se(Uo,{parseTable:()=>Ho});var vl,Ni,Ho,pu=C({"parser/table.ts"(){"use strict";q(),cu(),gu(),Bo(),Mo(),vl=e=>e.lastChild.constructor!==F,Ni=(e,t)=>e.is("td")?t.pop():e,Ho=({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 F(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[,w,f,y,_]=c;w&&new An(w,i,n),d(`
|
|
19
|
+
${h}${w&&`\0${n.length-1}d`}${f}\0${n.length}b`,u),r.push(...u?[u]:[],new gs(y,_,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[,v,b,S,A]=p;if(v){for(;!u.is("table");)u=r.pop();u.close(`
|
|
22
|
+
${h}${v}`,!0),d(A,r[r.length-1])}else if(b){u=Ni(u,r),u.is("tr")&&(u=r.pop());const w=new Wo(`
|
|
23
|
+
${h}${b}`,A,i,n);r.push(u,w),u.insertAt(w)}else{u=Ni(u,r);const w=S==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu;let f=w.exec(A),y=0,_=`
|
|
24
|
+
${h}${S}`;const x=k=>{const T=new xs(_,A.slice(y,f==null?void 0:f.index),i,n);return k.insertAt(T),T};for(;f;)x(u),{lastIndex:y}=w,[_]=f,f=w.exec(A);r.push(u,x(u))}}return o.slice(1)}}}),Do,fu=C({"src/nowiki/hr.ts"(){"use strict";tt(),Do=class extends Te{get type(){return"hr"}}}}),bl,Li,wl,qt,mu=C({"src/nowiki/doubleUnderscore.ts"(){"use strict";vt(),We(),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)}}),Go={};se(Go,{parseHrAndDoubleUnderscore:()=>Vo});var Vo,xu=C({"parser/hrAndDoubleUnderscore.ts"(){"use strict";fu(),mu(),uo(),Vo=({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 Do(c,i,n),`${g}\0${n.length-1}r`)).replace(i.regexHrAndDoubleUnderscore,(h,g)=>{var b;const c=i.sensitiveDoubleUnderscore.has(g),p=g.toLowerCase(),v=i.insensitiveDoubleUnderscore.has(p);return c||v?(new qt(g,c,i,n),`\0${n.length-1}${v&&((b=o==null?void 0:o[p])!=null?b: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,v)=>{const b=`${g}\0${n.length}h`;return new nt(c.length,[p,v],i,n),b})),t==="root"||t==="ext-inner"&&s==="poem"?e:e.slice(1)}}}),Qo,vu=C({"src/nowiki/quote.ts"(){"use strict";var e,t;z(),de(),W(),tt(),Qo=(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:m(this,e).bold}:void 0),this.italic?{italic:m(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(b=>g.getSeverity(h[0],b)),v=g.getSeverity(h[1]);if(u!=null&&u.endsWith("'")){const b=p[(o.bold||o.italic)&&/[a-z\d]'$/iu.test(u)?1:0];if(b){const S=Q(this,a,h[0],I.msg("lonely","'"),b),{startLine:A,startCol:w}=S,[,{length:f}]=/(?:^|[^'])('+)$/u.exec(u),y=i-f,_=Le(me({},S),{startIndex:y,endIndex:i,endLine:A,startCol:w-f,endCol:w});c&&(_.suggestions=[ft(y,"'",f),U(_)]),d.push(_)}}if(v&&l&&((n=this.closest("heading-title,ext"))==null?void 0:n.type)==="heading-title"){const b=Q(this,a,h[1],"bold-in-header",v);c&&(b.suggestions=[U(b)]),d.push(b)}return d}}json(i,n=this.getAbsoluteIndex()){const r=super.json(void 0,n)}},e=new WeakMap,t)}}),Jo={};se(Jo,{parseQuotes:()=>_n});var _n,Xo=C({"parser/quotes.ts"(){"use strict";vu(),_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 v=n[p].length;switch(v){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(v-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 v=n[p].length,b=v!==2,S=v!==3;b&&(h=!h),S&&(g=!g),new Qo(n[p],{bold:b&&h,italic:S&&g},t,s),n[p]=`\0${s.length-1}q`}return n.join("")}}}),Ko={};se(Ko,{parseExternalLinks:()=>$n});var $n,Yo=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}|//)${ht}|\0\d+m\x7F)${ct}(?=[[\]<>"\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 ot(l,o,u,t,s),`\0${d}w`)})}}}),Zo,bu=C({"src/link/category.ts"(){"use strict";ys(),Zo=class extends Oe{get type(){return"category"}get sortkey(){}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t)}}}}),ea={};se(ea,{parseLinks:()=>en});var yl,en,wu=C({"parser/links.ts"(){"use strict";ge(),W(),Xo(),Yo(),_o(),yo(),bu(),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],v=n.exec(p);if(v)[,a,h,g,c]=v,c.startsWith("]")&&(g!=null&&g.includes("["))&&(g+="]",c=c.slice(1));else{const y=yl.exec(p);y&&(d=!0,[,a,h,g]=y)}if(a===void 0||t.regexLinks.test(a)||/\0\d+[exhbru]\x7F/u.test(a)){l+=`[[${p}`;continue}let b=be(a).trim();const S=b.startsWith(":");if(S&&d){l+=`[[${p}`;continue}else!b&&g&&!g.includes(`
|
|
25
|
+
`)&&(b=be(g).trim());const{ns:A,valid:w}=I.normalizeTitle(b,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0});if(w){if(d){if(A!==6){l+=`[[${p}`;continue}let y=!1;for(u++;u<r.length;u++){const _=r[u],x=_.split("]]");if(x.length>2){y=!0,g+=`[[${x[0]}]]${x[1]}`,c=x.slice(2).join("]]");break}else if(x.length===2)g+=`[[${x[0]}]]${x[1]}`;else{g+=`[[${_}`;break}}if(g=en(g,t,s,i),!y){l+=`[[${a}${h}${g}`;continue}}}else{l+=`[[${p}`;continue}g&&(g=_n(g,t,s,i));let f=bn;S||(A===6?(g&&(g=$n(g,t,s,!0)),f=vn):A===14&&(f=Zo)),g===void 0&&h&&(g=""),l+=`\0${s.length}l${c}`,new f(a,g,t,s,h)}return l}}}),ta={};se(ta,{parseMagicLinks:()=>sa});var Ei,Fi,ji,Pi,sa,yu=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`,sa=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${ht}${ct})|${Pi})`,"giu")}catch(i){t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${ht}${ct})|${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`})}}}),ia,Su=C({"util/html.ts"(){"use strict";ia=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,i)=>s!==e[i])}}),na,ku=C({"src/nowiki/list.ts"(){"use strict";zo(),na=class extends kn{get type(){return"list"}}}}),ra={};se(ra,{parseList:()=>la});var la,Au=C({"parser/list.ts"(){"use strict";Su(),ku(),Mo(),la=(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=ia(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 j=$.split(/(?=;)/u);h.unshift(...j),c+=$.includes(";")?j.length:0}else h[0]=$+h[0]}t.lastPrefix=d;let p=l+h.map(($,j)=>`\0${i.length+j}d`).join("")+e.slice(r.length);for(const $ of h)new na($,s,i);if(!c)return p;const{html:[v,,b]}=s,S=/:+|-\{|\0\d+[xq]\x7F/gu;let A=S,w=A.exec(p),f=0,y=!1,_=!1,x=0;const k=($,j)=>(new An($,s,i),`${p.slice(0,j)}\0${i.length-1}d${p.slice(j+$.length)}`),T=$=>{$?f&&f--:f++};for(;w&&c;){const{0:$,index:j}=w;if($==="-{"){if(!x){const{lastIndex:E}=A;A=/-\{|\}-/gu,A.lastIndex=E}x++}else if($==="}-"){if(x--,!x){const{lastIndex:E}=A;A=S,A.lastIndex=E}}else if($.endsWith("x")){const{name:E,closing:P,selfClosing:ne}=i[Number($.slice(1,-2))];(v.includes(E)||!ne&&!b.includes(E))&&T(P)}else if($.endsWith("q")){const{bold:E,italic:P}=i[Number($.slice(1,-2))];E&&(T(y),y=!y),P&&(T(_),_=!_)}else if(f===0){if($.length>=c)return k($.slice(0,c),j);c-=$.length,A.lastIndex=j+4+String(i.length).length,p=k($,j)}w=A.exec(p)}return p}}}),rs,Sl,Ri,kl,Wt,_u=C({"src/converterFlags.ts"(){"use strict";var e,t;z(),de(),Ss(),W(),q(),ze(),rs=new Set(["A","T","R","D","-","H","N"]),Sl=[Vt()],Wt=(t=class extends(kl=F){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(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=>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(m(this,e).filter(b=>rs.has(b))),u=m(this,e).filter(b=>!b).length,d=m(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",v=a.getSeverity(p,"conversionFlag");if(v){const b=new le(this,i);for(let S=0;S<this.length;S++){const A=this.childNodes[S],w=A.text().trim();if(this.isInvalidFlag(w,r,l,o)){const f=B(A,b,p,"invalid-conversion-flag",v);(h||g)&&(r.size===0&&rs.has(w.toUpperCase())?f.fix=un(f,w):h&&(f.suggestions=[U(f,S&&-1)])),c.push(f)}}}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 F{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,zt,Tu=C({"src/converter.ts"(){"use strict";ge(),We(),Fe(),q(),_u(),$u(),Al=[Ie,je("-{")],zt=class extends(_l=F){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()}|${Xe(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?"|":""}${pt(t,{sep:";"})}}-</span>`}},Oi=K(_l),zt=X(Oi,0,"ConverterToken",Al,zt),J(Oi,1,zt)}}),oa={};se(oa,{parseConverter:()=>aa});var aa,Cu=C({"parser/converter.ts"(){"use strict";Tu(),aa=(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("|"),[v,b]=p===-1?[[],c]:[c.slice(0,p).split(";"),c.slice(p+1)],S=b.replace(/(&[#a-z\d]+);/giu,"$1"),A=S.split(t.regexConverter).map(w=>w.replace(/\x01/gu,";"));new zt(v,A,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:()=>F});var $l,F,q=C({"src/index.ts"(){"use strict";var e,t,s,i,n,r,l,o,ua,da,ha,ca,ga,pa,fa,ma,xa,va,ba,wa,f;ge(),Ke(),z(),Ne(),W(),Wa(),za(),$l=["category","html-attr#id,ext-attr#id,table-attr#id"],F=(f=class extends Nt{constructor(x,k=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,k),L(this,i,T),T.push(this)}get type(){return m(this,e)}set type(x){L(this,e,x)}parseOnce(x=m(this,t),k=!1,T){if(x<m(this,t)||this.length===0||!this.isPlain())return this;if(m(this,t)>=Se)return this;switch(x){case 0:if(this.type==="root"){m(this,i).pop();const $=R(this,o,ua).call(this);k&&(k=!$)}L(this,n,k),R(this,o,da).call(this,k);break;case 1:R(this,o,ha).call(this);break;case 2:R(this,o,ca).call(this);break;case 3:R(this,o,ga).call(this);break;case 4:R(this,o,pa).call(this);break;case 5:R(this,o,fa).call(this,T);break;case 6:R(this,o,ma).call(this,T);break;case 7:R(this,o,xa).call(this);break;case 8:R(this,o,va).call(this);break;case 9:R(this,o,ba).call(this);break;case 10:R(this,o,wa).call(this)}if(this.type==="root")for(const $ of m(this,i))$==null||$.parseOnce(x,k,T);return On(this,t)._++,this}buildFromStr(x,k){const T=x.split(/[\0\x7F]/u).map(($,j)=>{if(j%2===0)return new Qi($);if(isNaN($.slice(-1)))return m(this,i)[Number($.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${$}`)});return k===0?T.map(String).join(""):k===1?Xe(T):T}build(){L(this,t,Se);const{length:x,firstChild:k}=this,T=k==null?void 0:k.toString();if(x===1&&k.type==="text"&&T.includes("\0")&&(Tn(this,0,1,this.buildFromStr(T)),this.normalize(),this.type==="root"))for(const $ of m(this,i))$==null||$.build()}afterBuild(){if(this.type==="root")for(const x of m(this,i))x==null||x.afterBuild();L(this,r,!0)}parse(x=Se,k,T){for(x=Math.min(x,Se);m(this,t)<x;)this.parseOnce(m(this,t),k,T);return x&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===f}getAttribute(x){var k;switch(x){case"config":return m(this,s);case"include":return(k=m(this,n))!=null?k:!!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"&&Mt(this)===2;default:return super.getAttribute(x)}}setAttribute(x,k){switch(x){case"stage":m(this,t)===0&&this.type==="root"&&m(this,i).shift(),L(this,t,k);break;default:super.setAttribute(x,k)}}insertAt(x,k=this.length){const T=typeof x=="string"?new Qi(x):x;super.insertAt(T,k);const{type:$}=T;return $==="root"&&(T.type="plain"),T}normalizeTitle(x,k=0,T){return I.normalizeTitle(x,k,m(this,n),m(this,s),T)}inTableAttrs(){var x,k;return((x=this.closest("table-attrs,ext"))==null?void 0:x.type)==="table-attrs"&&((k=this.closest("table-attrs,arg,magic-word,template"))!=null&&k.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(),k){var T;{const{lintConfig:$}=I,{computeEditInfo:j,fix:E,ignoreDisables:P,configurationComment:ne}=$;let O=super.lint(x,k);if(this.type==="root"){const re=new Map,fe="no-duplicate",G=["category","id"].map(M=>$.getSeverity(fe,M)),D=this.toString(),Y=$l.filter((M,Z)=>G[Z]).join();if(Y){for(const M of this.querySelectorAll(Y)){let Z;if(M.is("category"))Z=M.name;else{const H=M.getValue();H&&H!==!0&&(Z=`#${H}`)}if(Z){const H=re.get(Z);H?H.add(M):re.set(Z,new Set([M]))}}for(const[M,Z]of re)if(Z.size>1&&!M.startsWith("#mw-customcollapsible-")){const H=!M.startsWith("#"),ee=`duplicate-${H?"category":"id"}`,oe=G[H?0:1];O.push(...[...Z].map(ae=>{const te=Q(ae,{start:ae.getAbsoluteIndex()},fe,ee,oe);return j&&H&&(te.suggestions=[U(te)]),te}))}}if(!P){const M=new RegExp(String.raw`<!--\s*${ne}-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->`,"gu"),Z=[];let H=M.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"?M.lastIndex:void 0,to:ee==="enable"?M.lastIndex:void 0,rules:ae?new Set(ae.split(",").map(te=>te.trim())):void 0}),H=M.exec(D)}O=O.filter(({rule:ee,startLine:oe,startIndex:ae})=>{const te={pos:0};for(const{line:Ue,from:ue,to:ve,rules:Ce}of Z){if(Ue>oe+1)break;if(Ce&&!Ce.has(ee))continue;if(Ue===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(E&&O.some(({fix:M})=>M)){const M=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 M)oe<=Z&&(H=H.slice(0,ee)+ae+H.slice(oe),Z=ee);Object.assign(O,{output:H})}if(!j)for(const M of O)delete M.fix,delete M.suggestions}return O}}toString(x,k){return x?super.toString(!0,k):Je(m(this,l),()=>super.toString(!1,k),T=>{const $=this.getRootNode();$.type==="root"&&m($,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,ua=function(){const{parseRedirect:x}=(Ha(),V(Xl)),k=this.firstChild.toString(),T=x(k,m(this,s),m(this,i));return T&&this.setText(T),!!T},da=function(x){const{parseCommentAndExt:k}=(Ts(),V(jo));this.setText(k(this.firstChild.toString(),m(this,s),m(this,i),x))},ha=function(){const{parseBraces:x}=(xn(),V(go)),k=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,T=x(k,m(this,s),m(this,i));this.setText(this.type==="root"?T:T.slice(1))},ca=function(){if(m(this,s).excludes.includes("html"))return;const{parseHtml:x}=(hu(),V(Po));this.setText(x(this.firstChild.toString(),m(this,s),m(this,i)))},ga=function(){if(m(this,s).excludes.includes("table"))return;const{parseTable:x}=(pu(),V(Uo));this.setText(x(this,m(this,s),m(this,i)))},pa=function(){if(m(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:x}=(xu(),V(Go));this.setText(x(this,m(this,s),m(this,i)))},fa=function(x){const{parseLinks:k}=(wu(),V(ea));this.setText(k(this.firstChild.toString(),m(this,s),m(this,i),x))},ma=function(x){if(m(this,s).excludes.includes("quote"))return;const{parseQuotes:k}=(Xo(),V(Jo)),T=this.firstChild.toString().split(`
|
|
26
|
+
`);for(let $=0;$<T.length;$++)T[$]=k(T[$],m(this,s),m(this,i),x);this.setText(T.join(`
|
|
27
|
+
`))},xa=function(){if(m(this,s).excludes.includes("extLink"))return;const{parseExternalLinks:x}=(Yo(),V(Ko));this.setText(x(this.firstChild.toString(),m(this,s),m(this,i)))},va=function(){if(m(this,s).excludes.includes("magicLink"))return;const{parseMagicLinks:x}=(yu(),V(ta));this.setText(x(this.firstChild.toString(),m(this,s),m(this,i)))},ba=function(){if(m(this,s).excludes.includes("list"))return;const{parseList:x}=(Au(),V(ra)),{firstChild:k,type:T,name:$}=this,j=k.toString().split(`
|
|
28
|
+
`),E={lastPrefix:""};let P=T==="root"||T==="ext-inner"&&$==="poem"?0:1;for(;P<j.length;P++)j[P]=x(j[P],E,m(this,s),m(this,i));this.setText(j.join(`
|
|
29
|
+
`))},wa=function(){if(m(this,s).variants.length>0){const{parseConverter:x}=(Cu(),V(oa));this.setText(x(this.firstChild.toString(),m(this,s),m(this,i)))}},f)}}),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(),V(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}}}),Tl,Ct,Bi,ls,qi,Cl,Wi,Il,tn,Iu=C({"lib/lintConfig.ts"(){"use strict";var e,t;Bl(),Tl=new Set([0,1,2]),Ct=new Map([[0,!1],[1,"warning"],[2,"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=>typeof s=="number"&&Tl.has(s),Cl=s=>qi(s)||Array.isArray(s)&&s.length===2&&qi(s[0])&&s[1]&&typeof s[1]=="object",Wi=(s,i,n)=>{if(fs.includes(i)){if(n===void 0)return!1;if(Cl(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)}`)},Il=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;const n=this[s];return typeof n=="number"?Ct.get(n):i&&(r=Ct.get(n[1][i]))!=null?r:Ct.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 m(this,e)}set rules(s){L(this,e,new Proxy(new Il(s),{set:Wi,deleteProperty(){return!1}}))}getSeverity(s,i){return m(this,e).getSeverity(s,i)}},e=new WeakMap,t)}}),ya={};se(ya,{Title:()=>Sa});var Sa,Nu=C({"lib/title.ts"(){"use strict";var e,t,s,i,n,r;Ye(),ge(),Sa=(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 v=l.split(":");if(v.length>1){const b=gt(v[0]),S=Object.prototype.hasOwnProperty.call(u.nsid,b)&&u.nsid[b];S&&(p=S,l=v.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(v){}L(this,n,p.replace(/ /gu,"_")),l=l.slice(0,c).trim()}this.valid=!!(l||h&&this.ns===0&&m(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"),m(this,s).includes("$1")||L(this,s,m(this,s)+`${m(this,s).endsWith("/")?"":"/"}$1`),d||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return m(this,i)}get fragment(){return m(this,n)}get main(){return m(this,e)}set main(l){l=l.replace(/_/gu," ").trim(),L(this,e,l&&l[0].toUpperCase()+l.slice(1))}get prefix(){const l=m(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)}}),ka={};se(ka,{default:()=>I});Aa.exports=V(ka);var os,zi,Nl,Pe,Mi,Ll,I,W=C({"index.ts"(){Bl(),Ne(),Ke(),ge(),Iu(),os=!0,zi=new tn,Pe={config:Hi,get rules(){return fs},get i18n(){return me(me({},zl),Nl)},set i18n(e){Nl=e},get lintConfig(){return zi},set lintConfig(e){zi=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}=(Nu(),V(ya));let l;if(n!=null&&n.halfParsed)l=new r(e,t,i,n);else{const{Token:o}=(q(),V(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=Se,i=Pe.getConfig()){e=ql(e);let n;typeof s!="number"&&(n=Array.isArray(s)?s:[s],s=Math.max(...n.map(o=>Ol[o]||Se)));const{Token:r}=(q(),V(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!")}},Mi={},Ll=new Set(["lintConfig","normalizeTitle","parse","createLanguageService"]);for(const e in Pe)Ll.has(e)||(Mi[e]={enumerable:!1});Object.defineProperties(Pe,Mi),Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:Pe}),I=Pe}});W()});Lu();})();
|