wikiparser-node
Version:
A Node.js parser for MediaWiki markup with AST
2 lines • 148 kB
JavaScript
"use strict";(()=>{var au=Object.defineProperty;var or=e=>{throw TypeError(e)};var uu=(e,t,s)=>t in e?au(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var du=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Le=(e,t,s)=>uu(e,typeof t!="symbol"?t+"":t,s),Xs=(e,t,s)=>t.has(e)||or("Cannot "+s);var w=(e,t,s)=>(Xs(e,t,"read from private field"),s?s.call(e):t.get(e)),P=(e,t,s)=>t.has(e)?or("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),j=(e,t,s,i)=>(Xs(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),R=(e,t,s)=>(Xs(e,t,"access private method"),s);var ar=(e,t,s,i)=>({set _(l){j(e,t,l,s)},get _(){return w(e,t,i)}});var dd=du((hd,ou)=>{var cu=Object.create,Lt=Object.defineProperty,fo=Object.getOwnPropertyDescriptor,Ln=Object.getOwnPropertyNames,hu=Object.prototype.hasOwnProperty,mo=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Ft=e=>{throw TypeError(e)},xo=(e,t,s)=>t in e?Lt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,ur=(e,t)=>Lt(e,"name",{value:t,configurable:!0}),I=(e,t)=>function(){return e&&(t=(0,e[Ln(e)[0]])(e=0)),t},vo=(e,t)=>function(){return t||(0,e[Ln(e)[0]])((t={exports:{}}).exports,t),t.exports},ae=(e,t)=>{for(var s in t)Lt(e,s,{get:t[s],enumerable:!0})},gu=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of Ln(t))!hu.call(e,l)&&l!==s&&Lt(e,l,{get:()=>t[l],enumerable:!(i=fo(t,l))||i.enumerable});return e},ee=e=>gu(Lt({},"__esModule",{value:!0}),e),oe=e=>{var t;return[,,,cu((t=e==null?void 0:e[mo("metadata")])!=null?t:null)]},bo=["class","method","getter","setter","accessor","field","value","get","set"],Dt=e=>e!==void 0&&typeof e!="function"?Ft("Function expected"):e,pu=(e,t,s,i,l)=>({kind:bo[e],name:t,metadata:i,addInitializer:n=>s._?Ft("Already initialized"):l.push(Dt(n||null))}),Fn=(e,t)=>xo(t,mo("metadata"),e[3]),ne=(e,t,s,i)=>{for(var l=0,n=e[t>>1],r=n&&n.length;l<r;l++)t&1?n[l].call(s):i=n[l].call(s,i);return i},re=(e,t,s,i,l,n)=>{var r,o,a,u,d,c=t&7,f=!!(t&8),p=!!(t&16),v=c>3?e.length+1:c?f?1:2:0,k=bo[c+5],$=c>3&&(e[v-1]=[]),_=e[v]||(e[v]=[]),T=c&&(!p&&!f&&(l=l.prototype),c<5&&(c>3||!p)&&fo(c<4?l:{get[s](){return pe(this,n)},set[s](h){return _e(this,n,h)}},s));c?p&&c<4&&ur(n,(c>2?"set ":c>1?"get ":"")+s):ur(l,s);for(var g=i.length-1;g>=0;g--)u=pu(c,s,a={},e[3],_),c&&(u.static=f,u.private=p,d=u.access={has:p?h=>mu(l,h):h=>s in h},c^3&&(d.get=p?h=>(c^1?pe:cn)(h,l,c^4?n:T.get):h=>h[s]),c>2&&(d.set=p?(h,x)=>_e(h,l,x,c^4?n:T.set):(h,x)=>h[s]=x)),o=(0,i[g])(c?c<4?p?n:T[k]:c>4?void 0:{get:T.get,set:T.set}:l,u),a._=1,c^4||o===void 0?Dt(o)&&(c>4?$.unshift(o):c?p?n=o:T[k]=o:l=o):typeof o!="object"||o===null?Ft("Object expected"):(Dt(r=o.get)&&(T.get=r),Dt(r=o.set)&&(T.set=r),Dt(r=o.init)&&$.unshift(r));return c||Fn(e,l),T&&Lt(l,s,T),p?c^4?n:T:l},fu=(e,t,s)=>xo(e,typeof t!="symbol"?t+"":t,s),En=(e,t,s)=>t.has(e)||Ft("Cannot "+s),mu=(e,t)=>Object(t)!==t?Ft('Cannot use the "in" operator on this value'):e.has(t),pe=(e,t,s)=>(En(e,t,"read from private field"),s?s.call(e):t.get(e)),He=(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),_e=(e,t,s,i)=>(En(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),cn=(e,t,s)=>(En(e,t,"access private method"),s),xu=(e,t,s,i)=>({set _(l){_e(e,t,l,s)},get _(){return pe(e,t,i)}}),wo,as,jn=I({"base.ts"(){"use strict";wo=(()=>{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})(),as=(()=>{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 Ee(e,t,s){return s===1?e.replace(/\0(\d+)g\x7F/gu,(i,l)=>Ee(String(t[l]),t,2)):s===2?e.replace(/\0(\d+)n\x7F/gu,(i,l)=>String(t[l])):e.replace(/\0(\d+)\x7F/gu,(i,l)=>t[l])}var Ge,Ks,_t,Tt,Ct,pt,us,Te,dt,dr,cr,ds,yo,hr,gr,cs,It,fe=I({"util/string.ts"(){"use strict";Ge=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Ks=String.raw`[^[\]<>"\0-\x1F\x7F${Ge}\uFFFD]`,_t=String.raw`(?:\[[\da-f:.]+\]|${Ks})`,Tt=String.raw`(?:${Ks}|\0\d+[cn!~]\x7F)*`,Ct=e=>e.trim().toLowerCase(),pt=(e,t)=>s=>s.replace(e,t),us=pt(/[\0\x7F]|\r$/gmu,""),Te=pt(/\0\d+[cn]\x7F/gu,""),dt=(e,t="")=>e.map(s=>typeof s=="string"?s:s.text()).join(t),dr={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},cr=pt(/&(?:#(\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)):dr[s.toLowerCase()]),ds=e=>cr(e),yo=pt(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),hr={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},gr=e=>pt(e,t=>`&${hr[t]};`),cs=gr(/[&<>]/gu),It=(e,t={})=>{const{pre:s="",post:i="",sep:l=""}=t;return s+e.map(n=>n.print()).join(l)+i}}}),vu=vo({"i18n/en.json"(e,t){t.exports={"attributes-of-closing-tag":"attributes of a closing tag","bold-apostrophes":"bold apostrophes","bold-in-header":"bold text in a section header",close:null,"closing-and-self-closing":"tag that is both closing and self-closing",comment:null,"conflicting-image-parameter":"conflicting image $1 parameter","content-outside-table":"content to be moved outside the table",decode:null,delink:null,"duplicate-attribute":"duplicate $1 attribute","duplicate-category":"duplicate category","duplicate-id":"duplicate HTML id","duplicate-image-parameter":"duplicate image $1 parameter","duplicate-parameter":"duplicate template parameter",encode:null,escape:null,expand:null,"ext-in-html":"extension tag in HTML tag attributes",frame:null,"full-width-punctuation":"full-width punctuation","header-in-html":"section header in HTML tag attributes","horizontal-alignment":null,"html-in-table":"HTML tag in table attributes","illegal-attribute-name":"invalid attribute name","illegal-attribute-value":"invalid attribute value","illegal-module":"invalid Scribunto module name","imagemap-without-image":"<imagemap> without an image","in-url":"$1 in URL","inconsistent-table":"inconsistent table layout","insecure-style":"insecure style","invalid-attribute":"element containing an invalid attribute name","invalid-content":"invalid content in <$1>","invalid-conversion-flag":"invalid conversion flag","invalid-gallery":"invalid gallery image","invalid-image-parameter":"invalid image parameter","invalid-imagemap-link":"invalid link in <imagemap>","invalid-isbn":"invalid ISBN","invalid-parameter":"invalid parameter of <$1>","invalid-self-closing":"invalid self-closing tag","invisible-triple-braces":"invisible content inside triple braces","italic-apostrophes":"italic apostrophes","left-bracket":"opening bracket","link-in-extlink":"internal link in an external link",lonely:'lonely "$1"',"missing-extension":"missing file extension","missing-function":"missing Scribunto module function name",newline:null,"no-self-closing":"no self-closing","nonzero-tabindex":"nonzero tabindex","nothing-in":"nothing should be in <$1>","obsolete-attribute":"obsolete attribute","obsolete-tag":"obsolete HTML tag",open:null,prefix:null,"pipe-in-link":'additional "|" in the link text',"pipe-in-table":'additional "|" in a table cell',remove:null,"template-in-link":"template in an internal link target","unbalanced-in-section-header":"unbalanced $1 in a section header",unclosed:"unclosed $1","unclosed-comment":"unclosed HTML comment","unclosed-quotes":"unclosed quotes","unclosed-table":"unclosed table","unclosed-tag":"unclosed tag","unescaped-query":"unescaped query string in an anonymous parameter","unexpected-argument":"unexpected template argument","unmatched-closing":"unmatched closing tag","unnecessary-encoding":"unnecessary percent-encoding in an internal link",uppercase:null,"useless-attribute":"useless attribute","useless-fragment":"useless fragment","useless-link-text":"useless link text","variable-anchor":"variable anchor in a section header","vertical-alignment":null,whitespace:null}}}),bu=vo({"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:[]}}}),ke,So,hn,Je=I({"util/constants.ts"(){"use strict";ke=11,So=vu(),hn=bu()}});function at(e){const t=new Map,s=new WeakMap;return i=>{const l=typeof i=="string"?t:s;if(l.has(i)){const r=l.get(i);return r.lastIndex=0,r}const n=e(i);return l.set(i,n),n}}var hs,Ao,pr,ko,$o,Xe=I({"../common/dist/index.mjs"(){"use strict";hs=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25")),Ao=e=>Math.round(e*255).toString(16).padStart(2,"0"),pr=(()=>{const e=String.raw`#(?:[\da-f]{3,4}|(?:[\da-f]{2}){3,4})(?![\p{L}\p{N}_])`,t=String.raw`(?:\d*\.)?\d+%?`,s=String.raw`(?:\d*\.)?\d+(?:deg|grad|rad|turn)?`,i=String.raw`rgba?\(\s*(?:${String.raw`${new Array(3).fill(t).join(String.raw`\s+`)}(?:\s*\/\s*${t})?`}|${String.raw`${new Array(3).fill(t).join(String.raw`\s*,\s*`)}(?:\s*,\s*${t})?`})\s*\)`,l=String.raw`hsla?\(\s*(?:${String.raw`${s}\s+${t}\s+${t}(?:\s*\/\s*${t})?`}|${String.raw`${s}${String.raw`\s*,\s*(?:\d*\.)?\d+%`.repeat(2)}(?:\s*,\s*${t})?`})\s*\)`;return{full:new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${e}|${i}|${l})`,"giu"),rgb:new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${e}|${i})`,"giu")}})(),ko=(e,t=!0)=>{const s=[],i=pr[t?"full":"rgb"];i.lastIndex=0;let l=i.exec(e),n=0;for(;l;){const r=l.index+l[1].length;r>n&&s.push([e.slice(n,r),n,r,!1]),{lastIndex:n}=i,s.push([l[2],r,n,e[r-1]!=="&"||!/^#\d+$/u.test(l[2])]),l=i.exec(e)}return e.length>n&&s.push([e.slice(n),n,e.length,!1]),s},$o=at}}),ce,me=I({"lib/rect.ts"(){"use strict";var e,t,s,i,gn,n;ce=(n=class{constructor(r,o){P(this,i);P(this,e);P(this,t);P(this,s);j(this,e,r),j(this,t,o)}get start(){return w(this,t)}get top(){return R(this,i,gn).call(this).top}get left(){return R(this,i,gn).call(this).left}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakSet,gn=function(){var r;return(r=w(this,s))!=null||j(this,s,w(this,e).getRootNode().posFromIndex(w(this,t))),w(this,s)},n)}}),fr,mr,ls,gs,Ys,X,ie,Re,qs,te,Rn,Ve,Pn,On,Bn,ps,Nt,qn,ut,Wn,K=I({"util/lint.ts"(){"use strict";Xe(),Oe(),me(),G(),fr=new Set(["tr","td","th","caption"]),mr=new Set(["Template:!!","Template:!-"]),ls=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")&&mr.has(t.name)||t.is("html")&&fr.has(t.name))return!1;if(t.is("arg"))return t.length>1&&ls(t.childNodes[1]);if(t.is("magic-word"))try{const s=t.getPossibleValues().map(ls);return s.includes(2)?2:s.includes(1)&&1}catch{}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?1:2},gs=(e,t,s,i)=>({line:e+s-1,character:(s===1?t:0)+i}),Ys=e=>(t,s,i,l,n="error")=>{const{start:r}=s,{top:o,left:a}=s instanceof ce?s:new ce(t,r),{offsetHeight:u,offsetWidth:d}=t,{startIndex:c,startLine:f,startCol:p}=e(t,r,o,a),{line:v,character:k}=gs(f,p,u,d);return{rule:i,message:N.msg(l),severity:n,startIndex:c,endIndex:c+t.toString().length,startLine:f,endLine:v,startCol:p,endCol:k}},X=Ys((e,t,s,i)=>{const l=e.getRelativeIndex(),{top:n,left:r}=e.parentNode.posFromIndex(l);return{startIndex:t+l,startLine:s+n,startCol:n?r:i+r}}),ie=Ys((e,t,s,i)=>({startIndex:t,startLine:s,startCol:i})),Re=(e,t,s,i=0)=>({desc:N.msg(t),range:[e.startIndex+i,e.endIndex],text:s}),qs=(e,t,s)=>({desc:N.msg(t),range:[e,e],text:s}),te=(e,t=0,s="")=>typeof e=="number"?{desc:N.msg("remove"),range:[e,e+t],text:s}:Re(e,"remove",s,t),Rn=(e,t)=>Re(e,"decode",hs(t.text().replace(/%(?=21|3[ce]|5[bd]|7[b-d])/giu,"%25"))),Ve=(e,t,s=0)=>({desc:N.msg("close"),range:[e+s,e],text:t}),Pn=e=>({desc:N.msg("open"),range:[e+1,e+2],text:""}),On=(e,t)=>Re(e,"comment",`<!--${t}-->`),Bn=(e,t)=>Re(e,"uppercase",t.toUpperCase()),ps=(e,t=0)=>({desc:N.msg("whitespace"),range:[e,e+t],text:" "}),Nt=(e,t,s=1)=>({desc:N.msg("escape"),range:[e,e+s],text:t.repeat(s)}),qn=(e,t)=>({desc:N.msg("escape"),range:[e,e+t.length],text:t.replace(/\|/gu,"|")}),ut=(e,t,s,i)=>{if(e&&(i||N.viewOnly&&e[0]===we.rev))return e[1];const l=t();return(i||N.viewOnly)&&s([we.rev,l]),l},Wn=(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"]:[]}}),xr,Mn,_o=I({"parser/selector.ts"(){"use strict";xr=(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},Mn=(e,t,s)=>{const i=e.split(",");return({type:l,name:n})=>i.some(r=>xr(r.trim(),l,n))}}}),Ws,Un=I({"mixin/cached.ts"(){"use strict";K(),Ws=(e=!0)=>t=>{const s=new WeakMap;return function(...i){return ut(s.get(this),()=>t.apply(this,i),l=>{s.set(this,l)},e)}}}}),To,wu=I({"mixin/nodeLike.ts"(){"use strict";To=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}}}),vr,br,bs,Pt,Ot,ws,Bt,qt,Wt,rt,Co=I({"lib/node.ts"(){"use strict";K(),Oe(),Un(),wu(),G(),br=[To],vr=[Ws(!1)],rt=class{constructor(){ne(Wt,5,this),fu(this,"childNodes",[]),He(this,bs),He(this,Pt),He(this,Ot),He(this,ws),He(this,Bt),He(this,qt,{})}get parentNode(){return pe(this,bs)}get nextSibling(){return pe(this,Pt)}get previousSibling(){return pe(this,Ot)}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":_e(this,bs,t),t||(_e(this,Pt,void 0),_e(this,Ot,void 0));break;case"nextSibling":_e(this,Pt,t);break;case"previousSibling":_e(this,Ot,t);break;case"aIndex":N.viewOnly&&_e(this,Bt,[we.rev,t]);break;default:this[e]=t}}getRootNode(){return ut(pe(this,ws),()=>{var e,t;return(t=(e=this.parentNode)==null?void 0:e.getRootNode())!=null?t:this},e=>{const[,t]=e;t.type==="root"&&_e(this,ws,e)})}indexFromPos(e,t){{if(e<0||t<0)return;const s=this.getLines();if(e>=s.length)return;const[,i,l]=s[e],n=i+t;return n>l?void 0:n}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(([,,l])=>e<=l);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 ut(pe(this,qt)[e],()=>{const{childNodes:t}=this,s=e+(e<0?t.length:0);let i=this.getAttribute("padding");for(let l=0;l<s;l++)N.viewOnly&&(pe(this,qt)[l]=[we.rev,i]),i+=t[l].toString().length+this.getGaps(l);return i},t=>{pe(this,qt)[e]=t})}getAbsoluteIndex(){return ut(pe(this,Bt),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{_e(this,Bt,e)})}getBoundingClientRect(){return{...this.getDimension(),...this.getRootNode().posFromIndex(this.getAbsoluteIndex())}}is(e){return this.type===e}getLines(){const e=[];let t=0;for(const s of String(this).split(`
`)){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!`)}},Wt=oe(null),bs=new WeakMap,Pt=new WeakMap,Ot=new WeakMap,ws=new WeakMap,Bt=new WeakMap,qt=new WeakMap,re(Wt,1,"getLines",vr,rt),rt=re(Wt,0,"AstNode",br,rt),ne(Wt,1,rt)}}),Io,yu=I({"mixin/elementLike.ts"(){"use strict";_o(),Io=e=>{var s,pn;class t extends e{constructor(){super(...arguments);P(this,s)}getElementBy(r){for(const o of this.childNodes){if(o.type==="text")continue;if(r(o))return o;const a=o.getElementBy(r);if(a)return a}}querySelector(r){return this.getElementBy(R(this,s,pn).call(this,r))}getElementsBy(r,o=[]){for(const a of this.childNodes)a.type!=="text"&&(r(a)&&o.push(a),a.getElementsBy(r,o));return o}querySelectorAll(r){return this.getElementsBy(R(this,s,pn).call(this,r))}escape(){for(const r of this.childNodes)r.escape()}}return s=new WeakSet,pn=function(r){return Mn(r,this)},t}}}),wr,Zs,yr,Gt,Su=I({"lib/element.ts"(){"use strict";fe(),Oe(),_o(),Co(),yu(),wr=[Io],Gt=class extends(yr=rt){get length(){return this.childNodes.length}text(e){return dt(this.childNodes,e)}normalize(){const e=this.getChildNodes(),t=s=>{var i,l;e.splice(s,1),(i=e[s-1])==null||i.setAttribute("nextSibling",e[s]),(l=e[s])==null||l.setAttribute("previousSibling",e[s-1])};for(let s=e.length-1;s>=0;s--){const{type:i,data:l}=e[s];i!=="text"||e.length===1||this.getGaps(s-(s&&1))||l===""&&t(s)}this.setAttribute("childNodes",e)}removeAt(e){return ms(this,e,1)[0]}insertAt(e,t=this.length){return ms(this,t,0,[e]),e}closest(e){const t=Mn(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){for(let t=this.length-1;t>=0;t--)this.removeAt(t);this.safeAppend(e)}setText(e,t=0){t+=t<0?this.length:0;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){{if(e===void 0)return;const{length:t}=this.toString();if(e>t||e<-t)return;e+=e<0?t:0;let s=this,i=0,l=0;for(;s.type!=="text";){const{childNodes:n}=s;i+=s.getAttribute("padding");for(let r=0;i<=e&&r<n.length;r++){const o=n[r],{nextSibling:a}=o,u=o.toString(),d=u.length;if(o.setAttribute("aIndex",i),i+=d,i>e||i===e&&d>0&&(!a||a.type==="text"||o.type!=="text"&&(u.trim()||!a.toString().trim()))){s=o,i-=d,l=i;break}i+=s.getGaps(r)}if(s.childNodes===n)return{offsetNode:s,offset:e-l}}return{offsetNode:s,offset:e-l}}this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(e){var t;{const s=(t=this.caretPositionFromIndex(e))==null?void 0:t.offsetNode;return(s==null?void 0:s.type)==="text"?s.parentNode:s}this.lspError("AstElement.elementFromIndex")}elementFromPoint(e,t){return this.elementFromIndex(this.indexFromPos(t,e))}lint(e=this.getAbsoluteIndex(),t){{const s=[];for(let i=0,l=e+this.getAttribute("padding");i<this.length;i++){const n=this.childNodes[i];n.setAttribute("aIndex",l);const r=n.lint(l,t);r.length>0&&s.push(...r),l+=n.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":""}">`)+It(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){{const s={...this,type:this.type,range:[t,t+this.toString().length],childNodes:[]};for(let i=0,l=t+this.getAttribute("padding");i<this.length;i++){const n=this.childNodes[i],{length:r}=n.toString();n.setAttribute("aIndex",l),s.childNodes.push(n.type==="text"?{data:n.data,range:[l,l+r]}:n.json(void 0,l)),l+=r+this.getGaps(i)}return s}this.lspError("AstElement.json")}},Zs=oe(yr),Gt=re(Zs,0,"AstElement",wr,Gt),ne(Zs,1,Gt)}}),xs,Ms=I({"mixin/gapped.ts"(){"use strict";xs=(e=1)=>t=>{class s extends t{getGaps(){return e}}return s}}}),Be,qe=I({"mixin/noEscape.ts"(){"use strict";Be=e=>{{class t extends e{escape(){}}return t}}}}),Sr,No,Au=I({"src/parameter.ts"(){"use strict";fe(),K(),G(),V(),Sr=new RegExp(`https?://${_t}${Tt}$`,"iu"),No=class extends H{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){var e;try{return!!((e=this.parentNode)!=null&&e.getDuplicatedArgs().some(([t])=>t===this.name))}catch{return!1}}constructor(e,t,s,i=[]){super(void 0,s,i);const l=new H(typeof e=="number"?void 0:e,s,i,{}),n=new H(t,s,i);l.type="parameter-key",l.setAttribute("stage",2),n.type="parameter-value",n.setAttribute("stage",2),this.append(l,n)}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),l="unescaped",{lintConfig:n}=N,r=n.getSeverity(l);if(r){const{firstChild:o}=this,a=(s=Sr.exec(o.text()))==null?void 0:s[0];try{if(a&&new URL(a).search){const u=X(o,{start:e},l,"unescaped-query",r);u.startIndex=u.endIndex,u.startLine=u.endLine,u.startCol=u.endCol,u.endIndex++,u.endCol++,(n.computeEditInfo||n.fix)&&(u.fix=Nt(u.startIndex,"{{=}}")),i.push(u)}}catch{}}return i}}print(){return super.print({sep:this.anon?"":"="})}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t);return Object.assign(s,{anon:this.anon},this.duplicated&&{duplicated:!0}),s}}}}),$e,Ke=I({"src/atom.ts"(){"use strict";var e,t;V(),$e=(t=class extends H{constructor(i,l,n,r,o){super(i,n,r,o);P(this,e);j(this,e,l)}get type(){return w(this,e)}set type(i){j(this,e,i)}getAttribute(i){var l;return i==="invalid"?this.type==="converter-flag"&&!!((l=this.parentNode)!=null&&l.isInvalidFlag(this)):super.getAttribute(i)}},e=new WeakMap,t)}}),Qe,Et=I({"src/syntax.ts"(){"use strict";var e,t;V(),Qe=(t=class extends H{constructor(i,l,n,r,o){super(i,n,r,o);P(this,e);j(this,e,l)}get type(){return w(this,e)}lint(i=this.getAbsoluteIndex()){return super.lint(i,!1)}},e=new WeakMap,t)}}),Lo={};ae(Lo,{TranscludeToken:()=>lt});var Ar,ei,kr,lt,Fo=I({"src/transclude.ts"(){"use strict";var e,t,s,i,l,n,Vt,Eo,a;fe(),K(),Oe(),me(),Ms(),qe(),G(),V(),Au(),Ke(),Et(),Ar=[Be,xs()],lt=(a=class extends(kr=H){constructor(d,c,f,p=[]){var A,L;let v;const k=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(d);k&&(v=Number(k[1]),d=d.replace(`\0${v}h`,p[v].toString().replace(/^\n/u,"")));super(void 0,f,p,{});P(this,n);Le(this,"modifier","");P(this,e,"template");P(this,t,":");P(this,s,!1);P(this,i,new Map);P(this,l);const{parserFunction:[$,_],variable:T,functionHook:g}=f,h=(A=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(d))==null?void 0:A[0];if(h)this.setAttribute("modifier",h),d=d.slice(h.length);else if(d.includes(":")){const[C,...F]=d.split(":"),[B]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((L=F[0])!=null?L:"");this.setModifier(`${C}:${B}`)&&(d=F.join(":").slice(B.length))}const x=d.search(/[::]/u),b=d[x]===":",m=x!==-1;if(m||c.length===0&&!w(this,s)){const C=m?d.slice(0,x):d,F=m&&d.slice(x+1),B=Te(C),O=m?B.slice(B.search(/\S/u))+(b?":":""):B.trim(),E=O.toLowerCase(),D=Array.isArray(_),W=D?_.includes(O):Object.prototype.hasOwnProperty.call(_,O),q=!D&&W?_[O]:Object.prototype.hasOwnProperty.call($,E)&&$[E],z=D&&W||!("functionHook"in f)||g.includes(q),M=D&&W||T.includes(q);if(m?q&&z:M){this.setAttribute("name",q||E.replace(/^#|:$/u,"")),j(this,e,"magic-word"),b&&j(this,t,":");const Q=new Qe(C,"magic-word-name",f,p);if(super.insertAt(Q),F!==!1&&c.unshift([F]),this.name==="invoke")for(let J=0;J<2;J++){const se=c.shift();if(!se)break;const ue=new $e(se.join("="),`invoke-${J?"function":"module"}`,f,p);super.insertAt(ue)}}}if(this.type==="template"){const C=Te(d).trim();if(!this.normalizeTitle(C,10,{halfParsed:!0,temporary:!0}).valid)throw p.pop(),new SyntaxError("Invalid template name");const F=new $e(d,"template-name",f,p,{});super.insertAt(F)}typeof v=="number"&&(p[v]=void 0);const y=this.isTemplate();let S=1;for(let C=0;C<c.length;C++){const F=c[C];y||this.name==="switch"&&C>0||this.name==="tag"&&C>1||(F[0]=F.join("="),F.length=1),F.length===1&&(F.unshift(S),S++),this.insertAt(new No(...F,f,p))}this.seal("modifier")}get type(){return w(this,e)}get module(){return this.type==="magic-word"&&this.name==="invoke"?R(this,n,Vt).call(this).title:void 0}get function(){var d;return this.type==="magic-word"&&this.name==="invoke"?(d=this.childNodes[2])==null?void 0:d.text().trim():void 0}setModifier(d){const{parserFunction:[,,c,f]}=this.getAttribute("config"),p=Te(d).trim();if(d&&!p.endsWith(":"))return!1;const v=p.slice(0,-1).toLowerCase(),k=c.includes(v),$=f.includes(v);return w(this,s)&&k||!w(this,s)&&($||!d)||(we.running||this.length>1)&&(k||$||!d)?(this.setAttribute("modifier",d),j(this,s,k),!!d):!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"&&(j(this,l,R(this,n,Vt).call(this)),this.setAttribute("name",w(this,l).title))}toString(d){const{childNodes:c,length:f,firstChild:p,modifier:v,type:k}=this;return`{{${v}${k==="magic-word"?p.toString(d)+(f===1?"":w(this,t))+c.slice(1).map($=>$.toString(d)).join("|"):super.toString(d,"|")}}}`}text(){const{childNodes:d,length:c,firstChild:f,modifier:p,type:v,name:k}=this;return v==="magic-word"&&k==="vardefine"?"":`{{${p}${v==="magic-word"?f.text()+(c===1?"":w(this,t))+dt(d.slice(1),"|"):super.text("|")}}}`}getAttribute(d){switch(d){case"padding":return this.modifier.length+2;case"title":return w(this,l);case"colon":return w(this,t);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!R(this,n,Vt).call(this).valid);default:return super.getAttribute(d)}}lint(d=this.getAbsoluteIndex(),c){{const f=super.lint(d,c);if(!this.isTemplate())return f;const{type:p,childNodes:v,length:k}=this,$=new ce(this,d),{lintConfig:_}=N,{computeEditInfo:T}=_,g=p==="magic-word";let h="no-ignored",x=_.getSeverity(h,"fragment");if(g&&!R(this,n,Vt).call(this).valid)h="invalid-invoke",x=_.getSeverity(h,"name"),x&&f.push(X(v[1],$,h,"illegal-module",x));else if(x){const b=v[g?1:0],m=b.childNodes.findIndex(S=>S.type==="text"&&ds(S.data).includes("#")),y=b.childNodes[m];if(y){const S=X(b,$,h,"useless-fragment",x);T&&(S.suggestions=[te(S,b.getRelativeIndex(m)+y.data.indexOf("#"))]),f.push(S)}}if(h="invalid-invoke",x=_.getSeverity(h,"function"),x&&g&&k===2)return f.push(ie(this,$,h,"missing-function",x)),f;if(h="no-duplicate",x=_.getSeverity(h,"parameter"),x){const b=this.getDuplicatedArgs().filter(([,y])=>!y[0].querySelector("ext")),m="duplicate-parameter";for(const[,y]of b)f.push(...y.map(S=>{const A=X(S,$,h,m,x);return T&&(A.suggestions=[te(A,-1)]),A}))}return f}}insertAt(d,c=this.length){return super.insertAt(d,c),d.anon?R(this,n,Eo).call(this,d):d.name&&this.getArgs(d.name,!1,!1).add(d),d}getAllArgs(){return this.childNodes.filter(Qs("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:d})=>d)}getArgs(d,c,f=!0){const p=String(d).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");let v;return w(this,i).has(p)?v=w(this,i).get(p):(v=new Set(this.getAllArgs().filter(({name:k})=>p===k)),w(this,i).set(p,v)),v}getDuplicatedArgs(){return[...w(this,i)].filter(([,{size:d}])=>d>1).map(([d,c])=>[d,[...c]])}getPossibleValues(){const{type:d,name:c,childNodes:f}=this;if(d==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let p,v;switch(c){case"if":case"ifexist":case"ifexpr":case"iferror":p=2;break;case"ifeq":p=3;break;case"switch":{const k=f.slice(2),$=k[k.length-1];v=[...k.filter(({anon:_})=>!_),...$!=null&&$.anon?[$]:[]].map(({lastChild:_})=>_);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}v!=null||(v=f.slice(p,p+2).map(({lastChild:k})=>k));for(let k=0;k<v.length;){const{length:$,0:_}=v[k].childNodes.filter(T=>T.text().trim());if($===0)v.splice(k,1);else if($>1||_.type!=="magic-word")k++;else try{const T=_.getPossibleValues();v.splice(k,1,...T),k+=T.length}catch{k++}}return v}print(){const{childNodes:d,length:c,firstChild:f,modifier:p,type:v}=this;return`<span class="wpb-${v}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${v==="magic-word"?cs(p)+f.print()+(c===1?"":w(this,t))+It(d.slice(1),{sep:"|"}):(p?`<span class="wpb-magic-word">${cs(p)}</span>`:"")+It(d,{sep:"|"})}}}</span>`}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,l=new WeakMap,n=new WeakSet,Vt=function(){const d=this.type==="template";return this.normalizeTitle(this.childNodes[d?0:1].text(),d?10:828,{temporary:!0})},Eo=function(d){const c=this.getAnonArgs(),f=typeof d!="number";for(let p=f?c.indexOf(d):d-1;p<c.length;p++){const v=c[p],{name:k}=v,$=String(p+1);(k!==$||v===d)&&(v.setAttribute("name",$),this.getArgs($,!1,!1).add(v))}},a),ei=oe(kr),lt=re(ei,0,"TranscludeToken",Ar,lt),ne(ei,1,lt)}}),ys,ti,si,$r,_r,Tr,Cr,ii,Ir,fn,ku=I({"lib/text.ts"(){"use strict";var e,mn,s;fe(),K(),Oe(),G(),Co(),ys=String.raw`[${Ge}\t]*`,ti=String.raw`[^\S\n]*`,si=String.raw`<${ti}(?:/${ti})?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${ys}\d)|isbn(?=[-::]?${ys}(?:\d(?:${ys}|-)){6})`,$r=new RegExp(String.raw`${si}|https?[:/]/+`,"giu"),_r=new RegExp(si,"giu"),Tr=new Set(["attr-value","ext-link-text","link-text"]),Cr={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},ii=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"]),Ir=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch{return/\w/u}})(),fn=(s=class extends rt{constructor(n){super();P(this,e);Le(this,"data","");this.data=n}get type(){return"text"}toString(n){var r;return n&&!((r=this.parentNode)!=null&&r.getAttribute("built"))?Te(this.data):this.data}text(){return this.data}lint(n=this.getAbsoluteIndex(),r){var o,a,u;{if(r===!1)return[];const{data:d,parentNode:c,nextSibling:f,previousSibling:p}=this;if(!c)throw new Error("An isolated text node cannot be linted!");const{type:v,name:k,parentNode:$}=c;if(v==="attr-value"){const{name:E,tag:D}=$;if(D==="ref"&&(E==="name"||E==="follow")||E==="group"&&(D==="ref"||D==="references")||D==="choose"&&(E==="before"||E==="after"))return[]}if(r!=null||(r=v==="free-ext-link"||v==="ext-link-url"||v==="ext-link-text"||v==="image-parameter"&&k==="link"||v==="attr-value"?_r:$r),d.search(r)===-1)return[];r.lastIndex=0;const _=[],T=f==null?void 0:f.type,g=f==null?void 0:f.name,h=p==null?void 0:p.type,x=this.getRootNode(),b=x.toString(),{ext:m,html:y,variants:S}=x.getAttribute("config"),{top:A,left:L}=x.posFromIndex(n),{lintConfig:C}=N,F=C.rules["tag-like"],B=typeof F=="object"&&F[1]?new Set(Object.keys(F[1]).filter(E=>E!=="invalid"&&E!=="disallowed")):new Set,O=new Set(["onlyinclude","noinclude","includeonly",...m,...y[0],...y[1],...y[2],...B,...C.getSeverity("tag-like","disallowed")?ii:[]]);for(let E=r.exec(d);E;E=r.exec(d)){const[,D,W]=E;let{index:q,0:z}=E;if(W&&W!=="]"){const{length:ye}=W;q+=ye,z=z.slice(ye)}z=z.toLowerCase();const[M]=z,Q=M==="r"||M==="p"||M==="i",J=M==="{",se=M==="}",ue=M==="[",he=M==="]";let{length:le}=z;if(M==="<"&&!O.has(D.toLowerCase())||ue&&v==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(d.slice(q+1))||f!=null&&f.is("ext")&&g==="nowiki"&&((o=f.innerText)!=null&&o.includes("]")))||Q&&(!c.isPlain()||Tr.has(v)))continue;he&&(q||le>1)&&r.lastIndex--;let Ie=n+q,Ne=Ie+le,U,Y;const ge=b[Ne],ve=b[Ie-1],Ce=J||ue,Me=J&&ve==="-"&&S.length>0,Se=se&&ge==="-"&&S.length>0,gt=ue&&T==="free-ext-link"&&!d.slice(q+1).trim()||he&&h==="free-ext-link"&&!d.slice(0,q).includes("]");if(Q)U="lonely-http",z=z.toUpperCase(),Y=C.getSeverity(U,z);else if(M==="<"){U="tag-like";let ye;/^<\/?\s/u.test(z)||!/[\s/>]/u.test(ge!=null?ge:"")?ye="invalid":B.has(D)?ye=D:ii.has(D)&&!m.includes(D)&&(ye="disallowed"),Y=C.getSeverity(U,ye)}else if(Me||Se)U="lonely-bracket",Y=C.getSeverity(U,"converter"),Me&&q>0?(z="-{",q--,Ie--,le=2):Se&&q<d.length-1&&(z="}-",Ne++,le=2);else if(gt)U="lonely-bracket",Y=C.getSeverity(U,"extLink");else if(Ce||se||he)if(U="lonely-bracket",le>1||J&&ge===M||se&&ve===M)Y=C.getSeverity(U,"double");else{if(!ue||v!=="ext-link-text"){const ye=Cr[M],Js=Ce?d.slice(q+1):d.slice(0,q);if(J&&((a=ye.exec(Js))==null?void 0:a[0])==="}"||se&&((u=ye.exec(Js))==null?void 0:u[0])==="{")continue;if(!Js.includes(M)){const lr=Ce?"nextSibling":"previousSibling";let st=this[lr];for(;st&&(st.type!=="text"||!ye.test(st.data));)st=st[lr];if(st&&ye.exec(st.data)[0]!==M)continue}}Y=C.getSeverity(U,"single")}else U="lonely-http",Y=C.getSeverity(U);if(!Y)continue;const Z=this.posFromIndex(q),{line:et,character:Rt}=gs(A,L,Z.top+1,Z.left),tt={rule:U,message:N.msg("lonely",Q||M==="h"||Me||Se?z:M),severity:Y,startIndex:Ie,endIndex:Ne,startLine:et,endLine:et,startCol:Rt,endCol:Rt+le};if(C.computeEditInfo)if(M==="<")tt.suggestions=[Nt(Ie,"<")];else if(M==="h"&&v!=="link-text"&&Ir.test(ve||""))tt.suggestions=[ps(Ie)];else if(ue&&v==="ext-link-text"){const ye=c.getAbsoluteIndex()+c.toString().length;tt.suggestions=[Nt(ye,"]")]}else if(he&>){const ye=n-p.toString().length;tt.suggestions=[qs(ye,"left-bracket","[")]}else Q&&(tt.suggestions=[...E[0]===z?[]:[Bn(tt,z)],...ge===":"||ge===":"?[ps(Ne,1)]:[]]);_.push(tt)}return _}}replaceData(n){R(this,e,mn).call(this,n)}splitText(n){{const{parentNode:r,data:o}=this;if(!r)throw new Error("The text node to be split has no parent node!");const a=new s(o.slice(n));return ms(r,r.childNodes.indexOf(this)+1,0,[a]),this.setAttribute("data",o.slice(0,n)),a}this.lspError("AstText.splitText")}escape(){{const{parentNode:n}=this;if(!n)throw new Error("The text node to be escaped has no parent node!");const{TranscludeToken:r}=(Fo(),ee(Lo)),o=n.getAttribute("config"),a=n.childNodes.indexOf(this)+1,u=f=>Math.max(this.data.lastIndexOf("=",f),this.data.lastIndexOf("|",f));let d=u();const c=()=>new r(this.data[d]==="="?"=":"!",[],o);for(;d>=0;d=u(d-1))d<this.data.length-1&&this.splitText(d+1),n.insertAt(we.run(c),a),R(this,e,mn).call(this,this.data.slice(0,d))}}print(){return cs(this.data)}},e=new WeakSet,mn=function(n){this.setAttribute("data",n)},s)}}),ct,jt=I({"mixin/hidden.ts"(){"use strict";ct=(e=!0,t=!0)=>s=>{class i extends s{text(){return""}lint(n){return e?[]:super.lint(n)}}return i}}}),We,Ye=I({"mixin/padded.ts"(){"use strict";We=({length:e})=>t=>{class s extends t{getAttribute(l){return l==="padding"?e:super.getAttribute(l)}}return s}}}),Nr,Lr,ni,Fr,De,Us=I({"src/link/base.ts"(){"use strict";var e,t,s,i;K(),Je(),me(),Ye(),qe(),G(),V(),Ke(),Nr=l=>l==="redirect-target"||l==="link",Lr=[Be,We("[[")],De=(i=class extends(Fr=H){constructor(n,r,o,a=[],u="|"){super(void 0,o,a,{});P(this,e,!0);P(this,t);P(this,s);if(this.insertAt(new $e(n,"link-target",o,a,{})),r!==void 0){const d=new H(r,o,a,{});d.type="link-text",d.setAttribute("stage",ke-1),this.insertAt(d)}j(this,t,u)}get link(){return w(this,s)}get fragment(){return w(this,s).fragment}afterBuild(){j(this,s,this.getTitle()),w(this,t).includes("\0")&&j(this,t,this.buildFromStr(w(this,t),0)),this.setAttribute("name",w(this,s).title),super.afterBuild()}setAttribute(n,r){n==="bracket"?j(this,e,r):n==="title"?j(this,s,r):super.setAttribute(n,r)}toString(n){const r=super.toString(n,w(this,t));return w(this,e)?`[[${r}]]`:r}text(){const n=super.text("|");return w(this,e)?`[[${n}]]`:n}getAttribute(n){return n==="title"?w(this,s):super.getAttribute(n)}getGaps(n){return n===0?w(this,t).length:1}lint(n=this.getAbsoluteIndex(),r){{const o=super.lint(n,r),{childNodes:[a,u],type:d}=this,{encoded:c,fragment:f}=w(this,s),{lintConfig:p}=N,{computeEditInfo:v,fix:k}=p,$=new ce(this,n);let _="unknown-page",T=p.getSeverity(_);if(T&&a.childNodes.some(({type:g})=>g==="template")&&o.push(X(a,$,_,"template-in-link",T)),_="url-encoding",T=p.getSeverity(_),T&&c){const g=X(a,$,_,"unnecessary-encoding",T);(v||k)&&(g.fix=Rn(g,a)),o.push(g)}if(_="pipe-like",T=p.getSeverity(_,"link"),T&&(d==="link"||d==="category")){const g=u==null?void 0:u.childNodes.findIndex(x=>x.type==="text"&&x.data.includes("|")),h=u==null?void 0:u.childNodes[g];if(h){const x=X(u,$,_,"pipe-in-link",T);if(v){const b=x.startIndex+u.getRelativeIndex(g);x.suggestions=[qn(b,h.data)]}o.push(x)}}if(_="no-ignored",T=p.getSeverity(_,"fragment"),T&&f!==void 0&&!Nr(d)){const g=X(a,$,_,"useless-fragment",T);if(v||k){const h=a.childNodes.findIndex(b=>b.type==="text"&&b.data.includes("#")),x=a.childNodes[h];x&&(g.fix=te(g,a.getRelativeIndex(h)+x.data.indexOf("#")))}o.push(g)}return o}}getTitle(n,r){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:r,temporary:n,decode:!0,selfLink:!0})}print(){return super.print(w(this,e)?{pre:"[[",post:"]]",sep:w(this,t)}:{sep:w(this,t)})}json(n,r=this.getAbsoluteIndex()){const o=super.json(void 0,r);{const{type:a,fragment:u}=this;return u!==void 0&&(a==="link"||a==="redirect-target")&&(o.fragment=u),o}}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i),ni=oe(Fr),De=re(ni,0,"LinkBaseToken",Lr,De),ne(ni,1,De)}}),Er,ri,jr,Pe,ht=I({"src/nowiki/base.ts"(){"use strict";qe(),V(),Er=[Be],Pe=class extends(jr=H){get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}},ri=oe(jr),Pe=re(ri,0,"NowikiBaseToken",Er,Pe),ne(ri,1,Pe)}}),Rr,li,Pr,xe,Ze=I({"src/nowiki/noinclude.ts"(){"use strict";jt(),ht(),Rr=[ct()],xe=class extends(Pr=Pe){get type(){return"noinclude"}toString(e){return e?"":super.toString()}},li=oe(Pr),xe=re(li,0,"NoincludeToken",Rr,xe),ne(li,1,xe)}}),jo,$u=I({"src/link/redirectTarget.ts"(){"use strict";K(),G(),Us(),Ze(),jo=class extends De{get type(){return"redirect-target"}constructor(e,t,s,i){super(e,void 0,s,i),t!==void 0&&this.insertAt(new xe(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}=N,l=i.getSeverity(s,"redirect");if(l&&this.length===2){const n=X(this.lastChild,{start:e},s,"useless-link-text",l);n.startIndex--,n.startCol--,(i.computeEditInfo||i.fix)&&(n.fix=te(n)),t.push(n)}return t}}}}}),Or,oi,Br,Qt,_u=I({"src/redirect.ts"(){"use strict";var e,t,s;jt(),qe(),V(),Et(),$u(),Or=[ct(!1,!1),Be],Qt=(s=class extends(Br=H){constructor(l,n,r,o,a,u,d=[]){super(void 0,u,d);P(this,e);P(this,t);j(this,e,l),j(this,t,a),this.append(new Qe(n,"redirect-syntax",u,d),new jo(r,o==null?void 0:o.slice(1),u,d))}get type(){return"redirect"}getAttribute(l){return l==="padding"?w(this,e).length:super.getAttribute(l)}toString(l){return w(this,e)+super.toString(l)+w(this,t)}lint(l=this.getAbsoluteIndex()){{const n=l+w(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",n),this.lastChild.lint(n)}}print(){return super.print({pre:w(this,e),post:w(this,t)})}},e=new WeakMap,t=new WeakMap,s),oi=oe(Br),Qt=re(oi,0,"RedirectToken",Or,Qt),ne(oi,1,Qt)}}),Ro={};ae(Ro,{parseRedirect:()=>Po});var Po,Tu=I({"parser/redirect.ts"(){"use strict";G(),_u(),Po=(e,t,s)=>{var l;(l=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&&N.normalizeTitle(i[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0}).valid?(e=`\0${s.length}o${e.slice(i[0].length)}`,new Qt(...i.slice(1),t,s),e):!1}}}),qr,ai,Wr,Jt,Cu=I({"src/onlyinclude.ts"(){"use strict";Ye(),qe(),V(),qr=[Be,We("<onlyinclude>")],Jt=class extends(Wr=H){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>'})}},ai=oe(Wr),Jt=re(ai,0,"OnlyincludeToken",qr,Jt),ne(ai,1,Jt)}}),Mr,ui,Ur,ot,zn=I({"src/tagPair/index.ts"(){"use strict";var e,t;Ms(),qe(),V(),Mr=[xs(),Be],ot=(t=class extends(Ur=H){constructor(i,l,n,r,o,a=[]){super(void 0,o);P(this,e);Le(this,"closed");Le(this,"selfClosing");this.setAttribute("name",i.toLowerCase()),j(this,e,[i,r||i]),this.closed=r!=="",this.selfClosing=r===void 0,this.append(l,n);const u=typeof l=="string"?-1:a.indexOf(l);a.splice(u===-1?1/0:u,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(i){const{selfClosing:l,firstChild:n,lastChild:r}=this,[o,a]=w(this,e);return l?`<${o}${n.toString(i)}/>`:`<${o}${n.toString(i)}>${r.toString(i)}${this.closed?`</${a}>`:""}`}text(){const[i,l]=w(this,e);return this.selfClosing?`<${i}${this.firstChild.text()}/>`:`<${i}${super.text(">")}${this.closed?`</${l}>`:""}`}getAttribute(i){return i==="padding"?w(this,e)[0].length+1:super.getAttribute(i)}print(){const[i,l]=w(this,e);return super.print(this.selfClosing?{pre:`<${i}`,post:"/>"}:{pre:`<${i}`,sep:">",post:this.closed?`</${l}>`:""})}},e=new WeakMap,t),ui=oe(Ur),ot=re(ui,0,"TagPairToken",Mr,ot),ne(ui,1,ot)}}),Oo,Iu=I({"src/tagPair/translate.ts"(){"use strict";var e,Bo,s;V(),zn(),Et(),Ze(),Oo=(s=class extends ot{constructor(l,n,r,o=[]){const a=new Qe(l,"translate-attr",r,o);n=n==null?void 0:n.replace(/(<tvar\|[^>]+>)([\s\S]*?)(<\/>)/gu,(d,c,f,p)=>(new xe(c,r,o),new xe(p,r,o),`\0${o.length-1}n${f}\0${o.length}n`)).replace(/(<tvar\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\2|[^"'\s>]+))?\s*>)([\s\S]*?)(<\/tvar\s*>)/giu,(d,c,f,p,v)=>(new xe(c,r,o),new xe(v,r,o),`\0${o.length-1}n${p}\0${o.length}n`));const u=new H(n,r,o);u.type="translate-inner";super("translate",a,u,"translate",r,o);P(this,e);this.seal("closed",!0),this.seal("selfClosing",!0)}get type(){return"translate"}toString(l){return l?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){return`<span class="wpb-ext"><translate${R(this,e,Bo).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,Bo=function(){return this.firstChild.toString()===" nowrap"},s)}}),zr,di,Hr,Xt,Nu=I({"src/tagPair/include.ts"(){"use strict";K(),me(),jt(),G(),zn(),zr=[ct(!1)],Xt=class extends(Hr=ot){get type(){return"include"}constructor(e,t="",s,i,l,n){super(e,t,s!=null?s:"",s===void 0||i!=null?i:"",l,n)}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){{const t=[],{firstChild:s,closed:i,name:l}=this,n=new ce(this,e),r=["no-ignored","unclosed-comment"],{lintConfig:o}=N,{computeEditInfo:a}=o,u=r.map(d=>o.getSeverity(d,"include"));if(u[0]&&s.data.trim()){const d=X(s,n,r[0],"useless-attribute",u[0]);a&&(d.suggestions=[te(d)]),t.push(d)}if(u[1]&&!i){const d=ie(this,n,r[1],N.msg("unclosed",`<${l}>`),u[1]);a&&(d.suggestions=[Ve(d.endIndex,`</${l}>`)]),t.push(d)}return t}}},di=oe(Hr),Xt=re(di,0,"IncludeToken",zr,Xt),ne(di,1,Xt)}}),zs,Hn=I({"mixin/attributesParent.ts"(){"use strict";zs=(e=0)=>t=>{var i,xn;class s extends t{constructor(){super(...arguments);P(this,i)}hasAttr(o){return R(this,i,xn).call(this).hasAttr(o)}getAttr(o){return R(this,i,xn).call(this).getAttr(o)}}return i=new WeakSet,xn=function(){return this.childNodes[e]},s}}}),de,ci,hi,Mt,Ss,gi,it,pi,fi,mi,As,xi,je,Dn,Gn,Vn,qo,Wo=I({"util/sharable.ts"(){"use strict";de=new Set(["align"]),ci=new Set(["cite"]),hi=new Set(["cite","datetime"]),Mt=new Set(["width"]),Ss=new Set(["axis","align","bgcolor","height","width","valign"]),gi=new Set([...Ss,"abbr","headers","scope","rowspan","colspan"]),it=new Set(["type"]),pi=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),fi=new Set(["clear"]),mi=new Set(["bgcolor","align","valign"]),As=new Set(["qid","forcemathmode","type","display"]),xi=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),je=new Set,Dn=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"]),Gn={div:de,h1:de,h2:de,h3:de,h4:de,h5:de,h6:de,blockquote:ci,q:ci,p:de,br:fi,pre:Mt,ins:hi,del:hi,ul:it,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...pi,"border"]),caption:de,tr:mi,td:gi,th:gi,font:new Set(["size","color","face"]),hr:Mt,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:it,poem:de,categorytree:de,combooption:de,math:je,chem:je,ce:je,img:new Set(["alt","src","width","height","loading","srcset"])},Vn={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:je,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:je,inputbox:je,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:je,poll:new Set(["id","show-results-before-voting"]),sm2:it,flashmp3:it,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([...As,"chem"]),chem:As,ce:As,hiero:je,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:xi,syntaxhighlight:xi,templatedata:je,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:je},qo={table:pi,td:new Set([...Ss,"scope"]),th:Ss,br:fi,caption:de,div:de,hr:Mt,h1:de,h2:de,h3:de,h4:de,h5:de,h6:de,li:it,p:de,pre:Mt,tr:mi,ul:it}}}),Dr,Gr,Vr,Qr,Ls,Lu=I({"src/attribute.ts"(){"use strict";var e,t,s,i,l,vn,r;K(),fe(),Je(),Wo(),me(),G(),V(),Ke(),Dr=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,Gr=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,Vr=new Set(["ext","arg","magic-word","template"]),Qr=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),Ls=(r=class extends H{constructor(a,u,d,c="",f,p=[],v=N.getConfig(),k=[]){const $=new $e(d,"attr-key",v,k);let _;if(d==="title"||u==="img"&&d==="alt")_=new H(f,v,k,{}),_.type="attr-value",_.setAttribute("stage",ke-1);else if(u==="gallery"&&d==="caption"||u==="choose"&&(d==="before"||d==="after")){const T={...v,excl