wikiparser-node 1.26.0 → 1.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,37 +1,37 @@
1
- "use strict";(()=>{var uu=Object.defineProperty;var or=e=>{throw TypeError(e)};var du=(e,t,s)=>t in e?uu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var cu=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Le=(e,t,s)=>du(e,typeof t!="symbol"?t+"":t,s),Xs=(e,t,s)=>t.has(e)||or("Cannot "+s);var b=(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),E=(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){E(e,t,l,s)},get _(){return b(e,t,i)}});var cd=cu((gd,au)=>{var hu=Object.create,Nt=Object.defineProperty,mo=Object.getOwnPropertyDescriptor,Ln=Object.getOwnPropertyNames,gu=Object.prototype.hasOwnProperty,xo=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Lt=e=>{throw TypeError(e)},vo=(e,t,s)=>t in e?Nt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,ur=(e,t)=>Nt(e,"name",{value:t,configurable:!0}),N=(e,t)=>function(){return e&&(t=(0,e[Ln(e)[0]])(e=0)),t},bo=(e,t)=>function(){return t||(0,e[Ln(e)[0]])((t={exports:{}}).exports,t),t.exports},ae=(e,t)=>{for(var s in t)Nt(e,s,{get:t[s],enumerable:!0})},pu=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of Ln(t))!gu.call(e,l)&&l!==s&&Nt(e,l,{get:()=>t[l],enumerable:!(i=mo(t,l))||i.enumerable});return e},ee=e=>pu(Nt({},"__esModule",{value:!0}),e),oe=e=>{var t;return[,,,hu((t=e==null?void 0:e[xo("metadata")])!=null?t:null)]},wo=["class","method","getter","setter","accessor","field","value","get","set"],Dt=e=>e!==void 0&&typeof e!="function"?Lt("Function expected"):e,fu=(e,t,s,i,l)=>({kind:wo[e],name:t,metadata:i,addInitializer:n=>s._?Lt("Already initialized"):l.push(Dt(n||null))}),Fn=(e,t)=>vo(t,xo("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,h=t&7,m=!!(t&8),f=!!(t&16),x=h>3?e.length+1:h?m?1:2:0,k=wo[h+5],$=h>3&&(e[x-1]=[]),_=e[x]||(e[x]=[]),T=h&&(!f&&!m&&(l=l.prototype),h<5&&(h>3||!f)&&mo(h<4?l:{get[s](){return pe(this,n)},set[s](c){return $e(this,n,c)}},s));h?f&&h<4&&ur(n,(h>2?"set ":h>1?"get ":"")+s):ur(l,s);for(var g=i.length-1;g>=0;g--)u=fu(h,s,a={},e[3],_),h&&(u.static=m,u.private=f,d=u.access={has:f?c=>xu(l,c):c=>s in c},h^3&&(d.get=f?c=>(h^1?pe:cn)(c,l,h^4?n:T.get):c=>c[s]),h>2&&(d.set=f?(c,p)=>$e(c,l,p,h^4?n:T.set):(c,p)=>c[s]=p)),o=(0,i[g])(h?h<4?f?n:T[k]:h>4?void 0:{get:T.get,set:T.set}:l,u),a._=1,h^4||o===void 0?Dt(o)&&(h>4?$.unshift(o):h?f?n=o:T[k]=o:l=o):typeof o!="object"||o===null?Lt("Object expected"):(Dt(r=o.get)&&(T.get=r),Dt(r=o.set)&&(T.set=r),Dt(r=o.init)&&$.unshift(r));return h||Fn(e,l),T&&Nt(l,s,T),f?h^4?n:T:l},mu=(e,t,s)=>vo(e,typeof t!="symbol"?t+"":t,s),En=(e,t,s)=>t.has(e)||Lt("Cannot "+s),xu=(e,t)=>Object(t)!==t?Lt('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)?Lt("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),vu=(e,t,s,i)=>({set _(l){$e(e,t,l,s)},get _(){return pe(e,t,i)}}),yo,as,jn=N({"base.ts"(){"use strict";yo=(()=>{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,_t,Tt,pt,us,Te,ut,dr,cr,ds,So,hr,gr,cs,Ct,fe=N({"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})`,_t=String.raw`(?:${Ks}|\0\d+[cn!~]\x7F)*`,Tt=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,""),ut=(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),So=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),Ct=(e,t={})=>{const{pre:s="",post:i="",sep:l=""}=t;return s+e.map(n=>n.print()).join(l)+i}}}),bu=bo({"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}}}),wu=bo({"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:[]}}}),_e,Ao,hn,dt=N({"util/constants.ts"(){"use strict";_e=11,Ao=bu(),hn=wu()}});function ot(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,ko,pr,$o,_o,Je=N({"../common/dist/index.mjs"(){"use strict";hs=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25")),ko=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")}})(),$o=(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=ot}}),ce,me=N({"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);E(this,e,r),E(this,t,o)}get start(){return b(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=b(this,s))!=null||E(this,s,b(this,e).getRootNode().posFromIndex(b(this,t))),b(this,s)},n)}}),fr,mr,ls,gs,Ys,X,ie,Re,qs,te,Rn,Ve,Pn,On,Bn,ps,It,qn,at,Wn,K=N({"util/lint.ts"(){"use strict";Je(),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:h,startLine:m,startCol:f}=e(t,r,o,a),{line:x,character:k}=gs(m,f,u,d);return{rule:i,message:I.msg(l),severity:n,startIndex:h,endIndex:h+t.toString().length,startLine:m,endLine:x,startCol:f,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:I.msg(t),range:[e.startIndex+i,e.endIndex],text:s}),qs=(e,t,s)=>({desc:I.msg(t),range:[e,e],text:s}),te=(e,t=0,s="")=>typeof e=="number"?{desc:I.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:I.msg("close"),range:[e+s,e],text:t}),Pn=e=>({desc:I.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:I.msg("whitespace"),range:[e,e+t],text:" "}),It=(e,t,s=1)=>({desc:I.msg("escape"),range:[e,e+s],text:t.repeat(s)}),qn=(e,t)=>({desc:I.msg("escape"),range:[e,e+t.length],text:t.replace(/\|/gu,"&#124;")}),at=(e,t,s,i)=>{if(e&&(i||I.viewOnly&&e[0]===we.rev))return e[1];const l=t();return(i||I.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,Un,To=N({"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},Un=(e,t,s)=>{const i=e.split(",");return({type:l,name:n})=>i.some(r=>xr(r.trim(),l,n))}}}),Ws,Mn=N({"mixin/cached.ts"(){"use strict";K(),Ws=(e=!0)=>t=>{const s=new WeakMap;return function(...i){return at(s.get(this),()=>t.apply(this,i),l=>{s.set(this,l)},e)}}}}),Co,yu=N({"mixin/nodeLike.ts"(){"use strict";Co=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,Rt,Pt,ws,Ot,Bt,qt,nt,Io=N({"lib/node.ts"(){"use strict";K(),Oe(),Mn(),yu(),G(),br=[Co],vr=[Ws(!1)],nt=class{constructor(){ne(qt,5,this),mu(this,"childNodes",[]),He(this,bs),He(this,Rt),He(this,Pt),He(this,ws),He(this,Ot),He(this,Bt,{})}get parentNode(){return pe(this,bs)}get nextSibling(){return pe(this,Rt)}get previousSibling(){return pe(this,Pt)}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,Rt,void 0),$e(this,Pt,void 0));break;case"nextSibling":$e(this,Rt,t);break;case"previousSibling":$e(this,Pt,t);break;case"aIndex":I.viewOnly&&$e(this,Ot,[we.rev,t]);break;default:this[e]=t}}getRootNode(){return at(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 at(pe(this,Bt)[e],()=>{const{childNodes:t}=this,s=e+(e<0?t.length:0);let i=this.getAttribute("padding");for(let l=0;l<s;l++)I.viewOnly&&(pe(this,Bt)[l]=[we.rev,i]),i+=t[l].toString().length+this.getGaps(l);return i},t=>{pe(this,Bt)[e]=t})}getAbsoluteIndex(){return at(pe(this,Ot),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{$e(this,Ot,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(`
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!`)}},qt=oe(null),bs=new WeakMap,Rt=new WeakMap,Pt=new WeakMap,ws=new WeakMap,Ot=new WeakMap,Bt=new WeakMap,re(qt,1,"getLines",vr,nt),nt=re(qt,0,"AstNode",br,nt),ne(qt,1,nt)}}),No,Su=N({"mixin/elementLike.ts"(){"use strict";To(),No=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 Un(r,this)},t}}}),wr,Zs,yr,Gt,Au=N({"lib/element.ts"(){"use strict";fe(),Oe(),To(),Io(),Su(),wr=[No],Gt=class extends(yr=nt){get length(){return this.childNodes.length}text(e){return ut(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=Un(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":""}">`)+Ct(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,Us=N({"mixin/gapped.ts"(){"use strict";xs=(e=1)=>t=>{class s extends t{getGaps(){return e}}return s}}}),Be,qe=N({"mixin/noEscape.ts"(){"use strict";Be=e=>{{class t extends e{escape(){}}return t}}}}),Sr,Lo,ku=N({"src/parameter.ts"(){"use strict";fe(),K(),G(),V(),Sr=new RegExp(`https?://${$t}${_t}$`,"iu"),Lo=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}=I,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=It(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}}}}),ke,Xe=N({"src/atom.ts"(){"use strict";var e,t;V(),ke=(t=class extends H{constructor(i,l,n,r,o){super(i,n,r,o);P(this,e);E(this,e,l)}get type(){return b(this,e)}set type(i){E(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,Ft=N({"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);E(this,e,l)}get type(){return b(this,e)}lint(i=this.getAbsoluteIndex()){return super.lint(i,!1)}},e=new WeakMap,t)}}),Fo={};ae(Fo,{TranscludeToken:()=>rt});var Ar,ei,kr,rt,Eo=N({"src/transclude.ts"(){"use strict";var e,t,s,i,l,n,Vt,jo,a;fe(),K(),Oe(),me(),Us(),qe(),G(),V(),ku(),Xe(),Ft(),Ar=[Be,xs()],rt=(a=class extends(kr=H){constructor(d,h,m,f=[]){var A,j;let x;const k=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(d);k&&(x=Number(k[1]),d=d.replace(`\0${x}h`,f[x].toString().replace(/^\n/u,"")));super(void 0,m,f,{});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}=m,c=(A=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(d))==null?void 0:A[0];if(c)this.setAttribute("modifier",c),d=d.slice(c.length);else if(d.includes(":")){const[C,...L]=d.split(":"),[B]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((j=L[0])!=null?j:"");this.setModifier(`${C}:${B}`)&&(d=L.join(":").slice(B.length))}const p=d.search(/[::]/u),w=d[p]===":",v=p!==-1;if(v||h.length===0&&!b(this,s)){const C=v?d.slice(0,p):d,L=v&&d.slice(p+1),B=Te(C),O=v?B.slice(B.search(/\S/u))+(w?":":""):B.trim(),F=O.toLowerCase(),D=Array.isArray(_),W=D?_.includes(O):Object.prototype.hasOwnProperty.call(_,O),q=!D&&W?_[O]:Object.prototype.hasOwnProperty.call($,F)&&$[F],z=D&&W||!("functionHook"in m)||g.includes(q),U=D&&W||T.includes(q);if(v?q&&z:U){this.setAttribute("name",q||F.replace(/^#|:$/u,"")),E(this,e,"magic-word"),w&&E(this,t,":");const Q=new Qe(C,"magic-word-name",m,f);if(super.insertAt(Q),L!==!1&&h.unshift([L]),this.name==="invoke")for(let J=0;J<2;J++){const se=h.shift();if(!se)break;const ue=new ke(se.join("="),`invoke-${J?"function":"module"}`,m,f);super.insertAt(ue)}}}if(this.type==="template"){const C=Te(d).trim();if(!this.normalizeTitle(C,10,{halfParsed:!0,temporary:!0}).valid)throw f.pop(),new SyntaxError("Invalid template name");const L=new ke(d,"template-name",m,f,{});super.insertAt(L)}typeof x=="number"&&(f[x]=void 0);const y=this.isTemplate();let S=1;for(let C=0;C<h.length;C++){const L=h[C];y||this.name==="switch"&&C>0||this.name==="tag"&&C>1||(L[0]=L.join("="),L.length=1),L.length===1&&(L.unshift(S),S++),this.insertAt(new Lo(...L,m,f))}this.seal("modifier")}get type(){return b(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:[,,h,m]}=this.getAttribute("config"),f=Te(d).trim();if(d&&!f.endsWith(":"))return!1;const x=f.slice(0,-1).toLowerCase(),k=h.includes(x),$=m.includes(x);return b(this,s)&&k||!b(this,s)&&($||!d)||(we.running||this.length>1)&&(k||$||!d)?(this.setAttribute("modifier",d),E(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"&&(E(this,l,R(this,n,Vt).call(this)),this.setAttribute("name",b(this,l).title))}toString(d){const{childNodes:h,length:m,firstChild:f,modifier:x,type:k}=this;return`{{${x}${k==="magic-word"?f.toString(d)+(m===1?"":b(this,t))+h.slice(1).map($=>$.toString(d)).join("|"):super.toString(d,"|")}}}`}text(){const{childNodes:d,length:h,firstChild:m,modifier:f,type:x,name:k}=this;return x==="magic-word"&&k==="vardefine"?"":`{{${f}${x==="magic-word"?m.text()+(h===1?"":b(this,t))+ut(d.slice(1),"|"):super.text("|")}}}`}getAttribute(d){switch(d){case"padding":return this.modifier.length+2;case"title":return b(this,l);case"colon":return b(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(),h){{const m=super.lint(d,h);if(!this.isTemplate())return m;const{type:f,childNodes:x,length:k}=this,$=new ce(this,d),{lintConfig:_}=I,{computeEditInfo:T}=_,g=f==="magic-word";let c="no-ignored",p=_.getSeverity(c,"fragment");if(g&&!R(this,n,Vt).call(this).valid)c="invalid-invoke",p=_.getSeverity(c,"name"),p&&m.push(X(x[1],$,c,"illegal-module",p));else if(p){const w=x[g?1:0],v=w.childNodes.findIndex(S=>S.type==="text"&&ds(S.data).includes("#")),y=w.childNodes[v];if(y){const S=X(w,$,c,"useless-fragment",p);T&&(S.suggestions=[te(S,w.getRelativeIndex(v)+y.data.indexOf("#"))]),m.push(S)}}if(c="invalid-invoke",p=_.getSeverity(c,"function"),p&&g&&k===2)return m.push(ie(this,$,c,"missing-function",p)),m;if(c="no-duplicate",p=_.getSeverity(c,"parameter"),p){const w=this.getDuplicatedArgs().filter(([,y])=>!y[0].querySelector("ext")),v="duplicate-parameter";for(const[,y]of w)m.push(...y.map(S=>{const A=X(S,$,c,v,p);return T&&(A.suggestions=[te(A,-1)]),A}))}return m}}insertAt(d,h=this.length){return super.insertAt(d,h),d.anon?R(this,n,jo).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,h,m=!0){const f=String(d).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");let x;return b(this,i).has(f)?x=b(this,i).get(f):(x=new Set(this.getAllArgs().filter(({name:k})=>f===k)),b(this,i).set(f,x)),x}getDuplicatedArgs(){return[...b(this,i)].filter(([,{size:d}])=>d>1).map(([d,h])=>[d,[...h]])}getPossibleValues(){const{type:d,name:h,childNodes:m}=this;if(d==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let f,x;switch(h){case"if":case"ifexist":case"ifexpr":case"iferror":f=2;break;case"ifeq":f=3;break;case"switch":{const k=m.slice(2),$=k[k.length-1];x=[...k.filter(({anon:_})=>!_),...$!=null&&$.anon?[$]:[]].map(({lastChild:_})=>_);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}x!=null||(x=m.slice(f,f+2).map(({lastChild:k})=>k));for(let k=0;k<x.length;){const{length:$,0:_}=x[k].childNodes.filter(T=>T.text().trim());if($===0)x.splice(k,1);else if($>1||_.type!=="magic-word")k++;else try{const T=_.getPossibleValues();x.splice(k,1,...T),k+=T.length}catch{k++}}return x}print(){const{childNodes:d,length:h,firstChild:m,modifier:f,type:x}=this;return`<span class="wpb-${x}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${x==="magic-word"?cs(f)+m.print()+(h===1?"":b(this,t))+Ct(d.slice(1),{sep:"|"}):(f?`<span class="wpb-magic-word">${cs(f)}</span>`:"")+Ct(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})},jo=function(d){const h=this.getAnonArgs(),m=typeof d!="number";for(let f=m?h.indexOf(d):d-1;f<h.length;f++){const x=h[f],{name:k}=x,$=String(f+1);(k!==$||x===d)&&(x.setAttribute("name",$),this.getArgs($,!1,!1).add(x))}},a),ei=oe(kr),rt=re(ei,0,"TranscludeToken",Ar,rt),ne(ei,1,rt)}}),ys,ti,si,$r,_r,Tr,Cr,ii,Ir,fn,$u=N({"lib/text.ts"(){"use strict";var e,mn,s;fe(),K(),Oe(),G(),Io(),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 nt{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:h,nextSibling:m,previousSibling:f}=this;if(!h)throw new Error("An isolated text node cannot be linted!");const{type:x,name:k,parentNode:$}=h;if(x==="attr-value"){const{name:F,tag:D}=$;if(D==="ref"&&(F==="name"||F==="follow")||F==="group"&&(D==="ref"||D==="references")||D==="choose"&&(F==="before"||F==="after"))return[]}if(r!=null||(r=x==="free-ext-link"||x==="ext-link-url"||x==="ext-link-text"||x==="image-parameter"&&k==="link"||x==="attr-value"?_r:$r),d.search(r)===-1)return[];r.lastIndex=0;const _=[],T=m==null?void 0:m.type,g=m==null?void 0:m.name,c=f==null?void 0:f.type,p=this.getRootNode(),w=p.toString(),{ext:v,html:y,variants:S}=p.getAttribute("config"),{top:A,left:j}=p.posFromIndex(n),{lintConfig:C}=I,L=C.rules["tag-like"],B=typeof L=="number"?new Set:new Set(Object.keys(L[1]).filter(F=>F!=="invalid"&&F!=="disallowed")),O=new Set(["onlyinclude","noinclude","includeonly",...v,...y[0],...y[1],...y[2],...B,...C.getSeverity("tag-like","disallowed")?ii:[]]);for(let F=r.exec(d);F;F=r.exec(d)){const[,D,W]=F;let{index:q,0:z}=F;if(W&&W!=="]"){const{length:ye}=W;q+=ye,z=z.slice(ye)}z=z.toLowerCase();const[U]=z,Q=U==="r"||U==="p"||U==="i",J=U==="{",se=U==="}",ue=U==="[",he=U==="]";let{length:le}=z;if(U==="<"&&!O.has(D.toLowerCase())||ue&&x==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(d.slice(q+1))||m!=null&&m.is("ext")&&g==="nowiki"&&((o=m.innerText)!=null&&o.includes("]")))||Q&&(!h.isPlain()||Tr.has(x)))continue;he&&(q||le>1)&&r.lastIndex--;let Ie=n+q,Ne=Ie+le,M,Y;const ge=w[Ne],ve=w[Ie-1],Ce=J||ue,Ue=J&&ve==="-"&&S.length>0,Se=se&&ge==="-"&&S.length>0,gt=ue&&T==="free-ext-link"&&!d.slice(q+1).trim()||he&&c==="free-ext-link"&&!d.slice(0,q).includes("]");if(Q)M="lonely-http",z=z.toUpperCase(),Y=C.getSeverity(M,z);else if(U==="<"){M="tag-like";let ye;/^<\/?\s/u.test(z)||!/[\s/>]/u.test(ge!=null?ge:"")?ye="invalid":B.has(D)?ye=D:ii.has(D)&&!v.includes(D)&&(ye="disallowed"),Y=C.getSeverity(M,ye)}else if(Ue||Se)M="lonely-bracket",Y=C.getSeverity(M,"converter"),Ue&&q>0?(z="-{",q--,Ie--,le=2):Se&&q<d.length-1&&(z="}-",Ne++,le=2);else if(gt)M="lonely-bracket",Y=C.getSeverity(M,"extLink");else if(Ce||se||he)if(M="lonely-bracket",le>1||J&&ge===U||se&&ve===U)Y=C.getSeverity(M,"double");else{if(!ue||x!=="ext-link-text"){const ye=Cr[U],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(U)){const lr=Ce?"nextSibling":"previousSibling";let tt=this[lr];for(;tt&&(tt.type!=="text"||!ye.test(tt.data));)tt=tt[lr];if(tt&&ye.exec(tt.data)[0]!==U)continue}}Y=C.getSeverity(M,"single")}else M="lonely-http",Y=C.getSeverity(M);if(!Y)continue;const Z=this.posFromIndex(q),{line:Ze,character:jt}=gs(A,j,Z.top+1,Z.left),et={rule:M,message:I.msg("lonely",Q||U==="h"||Ue||Se?z:U),severity:Y,startIndex:Ie,endIndex:Ne,startLine:Ze,endLine:Ze,startCol:jt,endCol:jt+le};if(C.computeEditInfo)if(U==="<")et.suggestions=[It(Ie,"&lt;")];else if(U==="h"&&x!=="link-text"&&Ir.test(ve||""))et.suggestions=[ps(Ie)];else if(ue&&x==="ext-link-text"){const ye=h.getAbsoluteIndex()+h.toString().length;et.suggestions=[It(ye,"&#93;")]}else if(he&&gt){const ye=n-f.toString().length;et.suggestions=[qs(ye,"left-bracket","[")]}else Q&&(et.suggestions=[...F[0]===z?[]:[Bn(et,z)],...ge===":"||ge===":"?[ps(Ne,1)]:[]]);_.push(et)}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}=(Eo(),ee(Fo)),o=n.getAttribute("config"),a=n.childNodes.indexOf(this)+1,u=m=>Math.max(this.data.lastIndexOf("=",m),this.data.lastIndexOf("|",m));let d=u();const h=()=>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(h),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,Et=N({"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,Ke=N({"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,Ms=N({"src/link/base.ts"(){"use strict";var e,t,s,i;K(),dt(),me(),Ke(),qe(),G(),V(),Xe(),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 ke(n,"link-target",o,a,{})),r!==void 0){const d=new H(r,o,a,{});d.type="link-text",d.setAttribute("stage",_e-1),this.insertAt(d)}E(this,t,u)}get link(){return b(this,s)}get fragment(){return b(this,s).fragment}afterBuild(){E(this,s,this.getTitle()),b(this,t).includes("\0")&&E(this,t,this.buildFromStr(b(this,t),0)),this.setAttribute("name",b(this,s).title),super.afterBuild()}setAttribute(n,r){n==="bracket"?E(this,e,r):n==="title"?E(this,s,r):super.setAttribute(n,r)}toString(n){const r=super.toString(n,b(this,t));return b(this,e)?`[[${r}]]`:r}text(){const n=super.text("|");return b(this,e)?`[[${n}]]`:n}getAttribute(n){return n==="title"?b(this,s):super.getAttribute(n)}getGaps(n){return n===0?b(this,t).length:1}lint(n=this.getAbsoluteIndex(),r){{const o=super.lint(n,r),{childNodes:[a,u],type:d}=this,{encoded:h,fragment:m}=b(this,s),{lintConfig:f}=I,{computeEditInfo:x,fix:k}=f,$=new ce(this,n);let _="unknown-page",T=f.getSeverity(_);if(T&&a.childNodes.some(({type:g})=>g==="template")&&o.push(X(a,$,_,"template-in-link",T)),_="url-encoding",T=f.getSeverity(_),T&&h){const g=X(a,$,_,"unnecessary-encoding",T);(x||k)&&(g.fix=Rn(g,a)),o.push(g)}if(_="pipe-like",T=f.getSeverity(_,"link"),T&&(d==="link"||d==="category")){const g=u==null?void 0:u.childNodes.findIndex(p=>p.type==="text"&&p.data.includes("|")),c=u==null?void 0:u.childNodes[g];if(c){const p=X(u,$,_,"pipe-in-link",T);if(x){const w=p.startIndex+u.getRelativeIndex(g);p.suggestions=[qn(w,c.data)]}o.push(p)}}if(_="no-ignored",T=f.getSeverity(_,"fragment"),T&&m!==void 0&&!Nr(d)){const g=X(a,$,_,"useless-fragment",T);if(x||k){const c=a.childNodes.findIndex(w=>w.type==="text"&&w.data.includes("#")),p=a.childNodes[c];p&&(g.fix=te(g,a.getRelativeIndex(c)+p.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(b(this,e)?{pre:"[[",post:"]]",sep:b(this,t)}:{sep:b(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=N({"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,Ye=N({"src/nowiki/noinclude.ts"(){"use strict";Et(),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)}}),Ro,_u=N({"src/link/redirectTarget.ts"(){"use strict";K(),G(),Ms(),Ye(),Ro=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}=I,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,Tu=N({"src/redirect.ts"(){"use strict";var e,t,s;Et(),qe(),V(),Ft(),_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);E(this,e,l),E(this,t,a),this.append(new Qe(n,"redirect-syntax",u,d),new Ro(r,o==null?void 0:o.slice(1),u,d))}get type(){return"redirect"}getAttribute(l){return l==="padding"?b(this,e).length:super.getAttribute(l)}toString(l){return b(this,e)+super.toString(l)+b(this,t)}lint(l=this.getAbsoluteIndex()){{const n=l+b(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",n),this.lastChild.lint(n)}}print(){return super.print({pre:b(this,e),post:b(this,t)})}},e=new WeakMap,t=new WeakMap,s),oi=oe(Br),Qt=re(oi,0,"RedirectToken",Or,Qt),ne(oi,1,Qt)}}),Po={};ae(Po,{parseRedirect:()=>Oo});var Oo,Cu=N({"parser/redirect.ts"(){"use strict";G(),Tu(),Oo=(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&&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 Qt(...i.slice(1),t,s),e):!1}}}),qr,ai,Wr,Jt,Iu=N({"src/onlyinclude.ts"(){"use strict";Ke(),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">&lt;onlyinclude&gt;</span>',post:'<span class="wpb-ext">&lt;/onlyinclude&gt;</span>'})}},ai=oe(Wr),Jt=re(ai,0,"OnlyincludeToken",qr,Jt),ne(ai,1,Jt)}}),Ur,ui,Mr,lt,zn=N({"src/tagPair/index.ts"(){"use strict";var e,t;Us(),qe(),V(),Ur=[xs(),Be],lt=(t=class extends(Mr=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()),E(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]=b(this,e);return l?`<${o}${n.toString(i)}/>`:`<${o}${n.toString(i)}>${r.toString(i)}${this.closed?`</${a}>`:""}`}text(){const[i,l]=b(this,e);return this.selfClosing?`<${i}${this.firstChild.text()}/>`:`<${i}${super.text(">")}${this.closed?`</${l}>`:""}`}getAttribute(i){return i==="padding"?b(this,e)[0].length+1:super.getAttribute(i)}print(){const[i,l]=b(this,e);return super.print(this.selfClosing?{pre:`&lt;${i}`,post:"/&gt;"}:{pre:`&lt;${i}`,sep:"&gt;",post:this.closed?`&lt;/${l}&gt;`:""})}},e=new WeakMap,t),ui=oe(Mr),lt=re(ui,0,"TagPairToken",Ur,lt),ne(ui,1,lt)}}),Bo,Nu=N({"src/tagPair/translate.ts"(){"use strict";var e,qo,s;V(),zn(),Ft(),Ye(),Bo=(s=class extends lt{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,h,m,f)=>(new xe(h,r,o),new xe(f,r,o),`\0${o.length-1}n${m}\0${o.length}n`)).replace(/(<tvar\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\2|[^"'\s>]+))?\s*>)([\s\S]*?)(<\/tvar\s*>)/giu,(d,h,m,f,x)=>(new xe(h,r,o),new xe(x,r,o),`\0${o.length-1}n${f}\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">&lt;translate${R(this,e,qo).call(this)?'<span class="wpb-ext-attrs"> <span class="wpb-ext-attr"><span class="wpb-attr-key">nowrap</span></span></span>':""}&gt;${this.lastChild.print({class:"ext-inner"})}&lt;/translate&gt;</span>`}},e=new WeakSet,qo=function(){return this.firstChild.toString()===" nowrap"},s)}}),zr,di,Hr,Xt,Lu=N({"src/tagPair/include.ts"(){"use strict";K(),me(),Et(),G(),zn(),zr=[ct(!1)],Xt=class extends(Hr=lt){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}=I,{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],I.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=N({"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,Wt,Ss,gi,st,pi,fi,mi,As,xi,je,Dn,Gn,Vn,Wo,Uo=N({"util/sharable.ts"(){"use strict";de=new Set(["align"]),ci=new Set(["cite"]),hi=new Set(["cite","datetime"]),Wt=new Set(["width"]),Ss=new Set(["axis","align","bgcolor","height","width","valign"]),gi=new Set([...Ss,"abbr","headers","scope","rowspan","colspan"]),st=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:Wt,ins:hi,del:hi,ul:st,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:Wt,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:st,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:st,flashmp3:st,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},Wo={table:pi,td:new Set([...Ss,"scope"]),th:Ss,br:fi,caption:de,div:de,hr:Wt,h1:de,h2:de,h3:de,h4:de,h5:de,h6:de,li:st,p:de,pre:Wt,tr:mi,ul:st}}}),Dr,Gr,Vr,Qr,Ls,Fu=N({"src/attribute.ts"(){"use strict";var e,t,s,i,l,vn,r;K(),fe(),dt(),Uo(),me(),G(),V(),Xe(),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,h="",m,f=[],x=I.getConfig(),k=[]){const $=new ke(d,"attr-key",x,k);let _;if(d==="title"||u==="img"&&d==="alt")_=new H(m,x,k,{}),_.type="attr-value",_.setAttribute("stage",_e-1);else if(u==="gallery"&&d==="caption"||u==="choose"&&(d==="before"||d==="after")){const T={...x,excludes:[...x.excludes,"heading","html","table","hr","list"]};_=new H(m,T,k,{}),_.type="attr-value",_.setAttribute("stage",1)}else _=new ke(m,"attr-value",x,k,{});super(void 0,x,k);P(this,l);P(this,e);P(this,t);P(this,s);P(this,i);E(this,e,a),this.append($,_),E(this,s,h),E(this,i,[...f]),E(this,t,u),this.setAttribute("name",Tt(Te(d)))}get type(){return b(this,e)}get tag(){return b(this,t)}get balanced(){return!b(this,s)||b(this,i)[0]===b(this,i)[1]}afterBuild(){b(this,s).includes("\0")&&E(this,s,this.buildFromStr(b(this,s),0)),this.parentNode&&E(this,t,this.parentNode.name),this.setAttribute("name",Tt(this.firstChild.text())),super.afterBuild()}toString(a){const[u="",d=""]=b(this,i);return b(this,s)?super.toString(a,b(this,s)+u)+d:this.firstChild.toString(a)}text(){return b(this,s)?`${super.text(`${b(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var a,u;return b(this,s)?b(this,s).length+((u=(a=b(this,i)[0])==null?void 0:a.length)!=null?u:0):0}lint(a=this.getAbsoluteIndex(),u){var d;{const h=super.lint(a,u),{balanced:m,firstChild:f,lastChild:x,name:k,tag:$}=this,_=new ce(this,a),T=["unclosed-quote","obsolete-attr"],{lintConfig:g}=I,c=T.map(w=>g.getSeverity(w,k));if(c[0]&&!m){const w=X(x,_,T[0],I.msg("unclosed","quotes"),c[0]);w.startIndex--,w.startCol--,g.computeEditInfo&&(w.suggestions=[Ve(w.endIndex,b(this,i)[0])]),h.push(w)}const p=R(this,l,vn).call(this,a,_);return p&&h.push(p),c[1]&&((d=Wo[$])!=null&&d.has(k))&&h.push(X(f,_,T[1],"obsolete-attribute",c[1])),h}}getValue(){return b(this,s)?this.lastChild.text().trim():this.type==="ext-attr"||""}escape(){E(this,s,"{{=}}"),this.lastChild.escape()}getAttribute(a){return a==="invalid"?R(this,l,vn).call(this):super.getAttribute(a)}print(){const[a="",u=""]=b(this,i);return b(this,s)?super.print({sep:cs(b(this,s))+a,post:u}):super.print()}json(a,u=this.getAbsoluteIndex()){const d=super.json(void 0,u);return d.tag=this.tag,d}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,l=new WeakSet,vn=function(a,u){const{firstChild:d,lastChild:h,type:m,name:f,tag:x,parentNode:k}=this,$=!h.childNodes.some(({type:y})=>Vr.has(y)),_=this.getValue(),T=Vn[x],g=Gn[x],{length:c}=this.toString();let p="illegal-attr",w,v;if({lintConfig:w}=I,{computeEditInfo:v}=w,!(T!=null&&T.has(f))&&!(g!=null&&g.has(f))&&(m==="ext-attr"?T||g:!/\{\{[^{]+\}\}/u.test(f))&&(m==="ext-attr"&&!g||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(f)&&(x==="meta"||x==="link"||!Dn.has(f)))||(f==="itemtype"||f==="itemid"||f==="itemref")&&!(k!=null&&k.hasAttr("itemscope"))){if(a===void 0)return!0;{const y=w.getSeverity(p,"unknown");if(y){const S=X(d,u,p,"illegal-attribute-name",y);return v&&(S.suggestions=[te(a,c)]),S}}}else if(f==="style"&&typeof _=="string"&&Dr.test(_)){if(a===void 0)return!0;{p="insecure-style";const y=w.getSeverity(p);return y&&X(h,u,p,"insecure-style",y)}}else if(f==="tabindex"&&typeof _=="string"&&_!=="0"){if(a===void 0)return!0;{const y=w.getSeverity(p,"tabindex");if(y){const S=X(h,u,p,"nonzero-tabindex",y);return v&&(S.suggestions=[te(a,c),Re(S,"0 tabindex","0")]),S}}}else if($&&m!=="ext-attr"){const y=Wn(x,f),S=String(_).toLowerCase();if(y.length>0&&y.every(A=>A!==S)){if(a===void 0)return!0;{const A=w.getSeverity(p,"value");return A&&X(h,u,p,"illegal-attribute-value",A)}}}else if(typeof _=="string"&&((/^xmlns:[\w:.-]+$/u.test(f)||Qr.has(f))&&Gr.test(_)||$&&(f==="href"||x==="img"&&f==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(_))){if(a===void 0)return!0;{const y=w.getSeverity(p,"value");return y&&X(h,u,p,"illegal-attribute-value",y)}}return!1},r)}}),vi,Jr,Xr,Hs,Qn=N({"src/attributes.ts"(){"use strict";var e,t,Fs,i;K(),fe(),me(),G(),V(),Xe(),Fu(),vi=l=>l.slice(0,-1),Jr=l=>`${vi(l)}-dirty`,Xr=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch{return/[^\W_]/u}})(),Hs=(i=class extends H{constructor(n,r,o,a,u=[]){super(void 0,a,u,{});P(this,t);P(this,e);if(E(this,e,r),this.setAttribute("name",o),n){const d=/([^\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="",m=d.exec(n),f=0;const x=()=>{h&&(super.insertAt(new ke(h,Jr(r),a,u,{})),h="")};for(;m;){const{index:k,0:$,1:_,2:T,3:g,4:c,5:p,6:w}=m;if(h+=n.slice(f,k),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(Te(_).trim())){const v=c!=null?c:w,y=[g,p],S=new Ls(vi(r),o,_,T,v,y,a,u);x(),super.insertAt(S)}else h+=$;({lastIndex:f}=d),m=d.exec(n)}h+=n.slice(f),x()}}get type(){return b(this,e)}afterBuild(){const{parentNode:n}=this;n!=null&&n.is("td")&&this.setAttribute("name",n.subtype),super.afterBuild()}getAttrTokens(n){return this.childNodes.filter(r=>r instanceof Ls&&(!n||r.name===Tt(n)))}hasAttr(n){return this.getAttrTokens(n).length>0}getAttrToken(n){const r=this.getAttrTokens(n);return r[r.length-1]}getAttr(n){var r;return(r=this.getAttrToken(n))==null?void 0:r.getValue()}lint(n=this.getAbsoluteIndex(),r){{const o=super.lint(n,r),{parentNode:a,childNodes:u}=this,d=new Map,h=new Set,m=new ce(this,n),f=["no-ignored","no-duplicate"],{lintConfig:x}=I,{computeEditInfo:k,fix:$}=x,_=["closingTag","invalidAttributes","nonWordAttributes"].map(g=>x.getSeverity(f[0],g));if(_[0]&&R(this,t,Fs).call(this)){const g=ie(this,m,f[0],"attributes-of-closing-tag",_[0]);if(k){const c=a.getAbsoluteIndex();g.suggestions=[te(g),Pn(c)]}o.push(g)}for(const g of u)if(g instanceof Ls){const{name:c}=g;d.has(c)?(h.add(c),d.get(c).push(g)):d.set(c,[g])}else{const c=g.text().trim(),p=_[Xr.test(c)?1:2];if(c&&p){const w=X(g,m,f[0],"invalid-attribute",p);k&&(w.suggestions=[te(w,0," ")]),o.push(w)}}const T=x.getSeverity(f[1],"attribute");if(T&&h.size>0)for(const g of h){const c=d.get(g).map(p=>{const w=p.getValue();return[p,w===!0?"":w]});o.push(...c.map(([p,w],v)=>{const y=X(p,m,f[1],I.msg("duplicate-attribute",g),T);if(k||$){const S=te(y);!w||c.slice(0,v).some(([,A])=>A===w)?y.fix=S:k&&(y.suggestions=[S])}return y}))}return o}}getAttribute(n){return n==="invalid"?R(this,t,Fs).call(this):super.getAttribute(n)}print(){return this.toString()?`<span class="wpb-${this.type}${R(this,t,Fs).call(this)?" wpb-invalid":""}">${this.childNodes.map(n=>n.print(n instanceof ke?{class:n.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,Fs=function(){const{parentNode:n}=this;return(n==null?void 0:n.type)==="html"&&n.closing&&this.text().trim()!==""},i)}}),Mo={};ae(Mo,{PreToken:()=>zo});var zo,Eu=N({"src/pre.ts"(){"use strict";dt(),V(),Ye(),zo=class extends H{get type(){return"ext-inner"}constructor(e,t,s=[]){if(e){const i=/<nowiki>/giu,l=/<\/nowiki>/giu,{length:n}=i.source;let r=i.exec(e);r&&(l.lastIndex=r.index+n);let o=l.exec(e),a=0,u="";for(;r&&o;)new xe(r[0],t,s),new xe(o[0],t,s),u+=`${e.slice(a,r.index)}\0${s.length-1}n${e.slice(r.index+n,o.index)}\0${s.length}n`,a=o.index+n+1,i.lastIndex=a,r=i.exec(e),r&&(l.lastIndex=r.index+n),o=l.exec(e);e=u+e.slice(a)}super(e,t,s,{}),this.setAttribute("stage",_e-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),Ds,Jn=N({"mixin/multiLine.ts"(){"use strict";Ds=e=>{class t extends e{toString(i){return super.toString(i,`
1
+ "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,"&#124;")}),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(`
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!`)}},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,"&lt;")];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,"&#93;")]}else if(he&&gt){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">&lt;onlyinclude&gt;</span>',post:'<span class="wpb-ext">&lt;/onlyinclude&gt;</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:`&lt;${i}`,post:"/&gt;"}:{pre:`&lt;${i}`,sep:"&gt;",post:this.closed?`&lt;/${l}&gt;`:""})}},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">&lt;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>':""}&gt;${this.lastChild.print({class:"ext-inner"})}&lt;/translate&gt;</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,excludes:[...v.excludes,"heading","html","table","hr","list"]};_=new H(f,T,k,{}),_.type="attr-value",_.setAttribute("stage",1)}else _=new $e(f,"attr-value",v,k,{});super(void 0,v,k);P(this,l);P(this,e);P(this,t);P(this,s);P(this,i);j(this,e,a),this.append($,_),j(this,s,c),j(this,i,[...p]),j(this,t,u),this.setAttribute("name",Ct(Te(d)))}get type(){return w(this,e)}get tag(){return w(this,t)}get balanced(){return!w(this,s)||w(this,i)[0]===w(this,i)[1]}afterBuild(){w(this,s).includes("\0")&&j(this,s,this.buildFromStr(w(this,s),0)),this.parentNode&&j(this,t,this.parentNode.name),this.setAttribute("name",Ct(this.firstChild.text())),super.afterBuild()}toString(a){const[u="",d=""]=w(this,i);return w(this,s)?super.toString(a,w(this,s)+u)+d:this.firstChild.toString(a)}text(){return w(this,s)?`${super.text(`${w(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var a,u;return w(this,s)?w(this,s).length+((u=(a=w(this,i)[0])==null?void 0:a.length)!=null?u:0):0}lint(a=this.getAbsoluteIndex(),u){var d;{const c=super.lint(a,u),{balanced:f,firstChild:p,lastChild:v,name:k,tag:$}=this,_=new ce(this,a),T=["unclosed-quote","obsolete-attr"],{lintConfig:g}=N,h=T.map(b=>g.getSeverity(b,k));if(h[0]&&!f){const b=X(v,_,T[0],"unclosed-quotes",h[0]);b.startIndex--,b.startCol--,g.computeEditInfo&&(b.suggestions=[Ve(b.endIndex,w(this,i)[0])]),c.push(b)}const x=R(this,l,vn).call(this,a,_);return x&&c.push(x),h[1]&&((d=qo[$])!=null&&d.has(k))&&c.push(X(p,_,T[1],"obsolete-attribute",h[1])),c}}getValue(){return w(this,s)?this.lastChild.text().trim():this.type==="ext-attr"||""}escape(){j(this,s,"{{=}}"),this.lastChild.escape()}getAttribute(a){return a==="invalid"?R(this,l,vn).call(this):super.getAttribute(a)}print(){const[a="",u=""]=w(this,i);return w(this,s)?super.print({sep:cs(w(this,s))+a,post:u}):super.print()}json(a,u=this.getAbsoluteIndex()){const d=super.json(void 0,u);return d.tag=this.tag,d}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,l=new WeakSet,vn=function(a,u){const{firstChild:d,lastChild:c,type:f,name:p,tag:v,parentNode:k}=this,$=!c.childNodes.some(({type:y})=>Vr.has(y)),_=this.getValue(),T=Vn[v],g=Gn[v],{length:h}=this.toString();let x="illegal-attr",b,m;if({lintConfig:b}=N,{computeEditInfo:m}=b,!(T!=null&&T.has(p))&&!(g!=null&&g.has(p))&&(f==="ext-attr"?T||g:!/\{\{[^{]+\}\}/u.test(p))&&(f==="ext-attr"&&!g||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(p)&&(v==="meta"||v==="link"||!Dn.has(p)))||(p==="itemtype"||p==="itemid"||p==="itemref")&&!(k!=null&&k.hasAttr("itemscope"))){if(a===void 0)return!0;{const y=b.getSeverity(x,"unknown");if(y){const S=X(d,u,x,"illegal-attribute-name",y);return m&&(S.suggestions=[te(a,h)]),S}}}else if(p==="style"&&typeof _=="string"&&Dr.test(_)){if(a===void 0)return!0;{x="insecure-style";const y=b.getSeverity(x);return y&&X(c,u,x,"insecure-style",y)}}else if(p==="tabindex"&&typeof _=="string"&&_!=="0"){if(a===void 0)return!0;{const y=b.getSeverity(x,"tabindex");if(y){const S=X(c,u,x,"nonzero-tabindex",y);return m&&(S.suggestions=[te(a,h),Re(S,"0 tabindex","0")]),S}}}else if(typeof _=="string"&&((/^xmlns:[\w:.-]+$/u.test(p)||Qr.has(p))&&Gr.test(_)||$&&(p==="href"||v==="img"&&p==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(_))){if(a===void 0)return!0;{const y=b.getSeverity(x,"value");return y&&X(c,u,x,"illegal-attribute-value",y)}}else if($&&f!=="ext-attr"){const y=Wn(v,p),S=String(_).toLowerCase();if(y.length>0&&y.every(A=>A!==S)){if(a===void 0)return!0;{const A=b.getSeverity(x,"value");return A&&X(c,u,x,"illegal-attribute-value",A)}}}return!1},r)}}),vi,Jr,Xr,Hs,Qn=I({"src/attributes.ts"(){"use strict";var e,t,Fs,i;K(),fe(),me(),G(),V(),Ke(),Lu(),vi=l=>l.slice(0,-1),Jr=l=>`${vi(l)}-dirty`,Xr=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch{return/[^\W_]/u}})(),Hs=(i=class extends H{constructor(n,r,o,a,u=[]){super(void 0,a,u,{});P(this,t);P(this,e);if(j(this,e,r),this.setAttribute("name",o),n){const d=/([^\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 c="",f=d.exec(n),p=0;const v=()=>{c&&(super.insertAt(new $e(c,Jr(r),a,u,{})),c="")};for(;f;){const{index:k,0:$,1:_,2:T,3:g,4:h,5:x,6:b}=f;if(c+=n.slice(p,k),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(Te(_).trim())){const m=h!=null?h:b,y=[g,x],S=new Ls(vi(r),o,_,T,m,y,a,u);v(),super.insertAt(S)}else c+=$;({lastIndex:p}=d),f=d.exec(n)}c+=n.slice(p),v()}}get type(){return w(this,e)}afterBuild(){const{parentNode:n}=this;n!=null&&n.is("td")&&this.setAttribute("name",n.subtype),super.afterBuild()}getAttrTokens(n){return this.childNodes.filter(r=>r instanceof Ls&&(!n||r.name===Ct(n)))}hasAttr(n){return this.getAttrTokens(n).length>0}getAttrToken(n){const r=this.getAttrTokens(n);return r[r.length-1]}getAttr(n){var r;return(r=this.getAttrToken(n))==null?void 0:r.getValue()}lint(n=this.getAbsoluteIndex(),r){{const o=super.lint(n,r),{parentNode:a,childNodes:u}=this,d=new Map,c=new Set,f=new ce(this,n),p=["no-ignored","no-duplicate"],{lintConfig:v}=N,{computeEditInfo:k,fix:$}=v,_=["closingTag","invalidAttributes","nonWordAttributes"].map(g=>v.getSeverity(p[0],g));if(_[0]&&R(this,t,Fs).call(this)){const g=ie(this,f,p[0],"attributes-of-closing-tag",_[0]);if(k){const h=a.getAbsoluteIndex();g.suggestions=[te(g),Pn(h)]}o.push(g)}for(const g of u)if(g instanceof Ls){const{name:h}=g;d.has(h)?(c.add(h),d.get(h).push(g)):d.set(h,[g])}else{const h=g.text().trim(),x=_[Xr.test(h)?1:2];if(h&&x){const b=X(g,f,p[0],"invalid-attribute",x);k&&(b.suggestions=[te(b,0," ")]),o.push(b)}}const T=v.getSeverity(p[1],"attribute");if(T&&c.size>0)for(const g of c){const h=d.get(g).map(x=>{const b=x.getValue();return[x,b===!0?"":b]});o.push(...h.map(([x,b],m)=>{const y=X(x,f,p[1],N.msg("duplicate-attribute",g),T);if(k||$){const S=te(y);!b||h.slice(0,m).some(([,A])=>A===b)?y.fix=S:k&&(y.suggestions=[S])}return y}))}return o}}getAttribute(n){return n==="invalid"?R(this,t,Fs).call(this):super.getAttribute(n)}print(){return this.toString()?`<span class="wpb-${this.type}${R(this,t,Fs).call(this)?" wpb-invalid":""}">${this.childNodes.map(n=>n.print(n instanceof $e?{class:n.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,Fs=function(){const{parentNode:n}=this;return(n==null?void 0:n.type)==="html"&&n.closing&&this.text().trim()!==""},i)}}),Mo={};ae(Mo,{PreToken:()=>Uo});var Uo,Fu=I({"src/pre.ts"(){"use strict";Je(),V(),Ze(),Uo=class extends H{get type(){return"ext-inner"}constructor(e,t,s=[]){if(e){const i=/<nowiki>/giu,l=/<\/nowiki>/giu,{length:n}=i.source;let r=i.exec(e);r&&(l.lastIndex=r.index+n);let o=l.exec(e),a=0,u="";for(;r&&o;)new xe(r[0],t,s),new xe(o[0],t,s),u+=`${e.slice(a,r.index)}\0${s.length-1}n${e.slice(r.index+n,o.index)}\0${s.length}n`,a=o.index+n+1,i.lastIndex=a,r=i.exec(e),r&&(l.lastIndex=r.index+n),o=l.exec(e);e=u+e.slice(a)}super(e,t,s,{}),this.setAttribute("stage",ke-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),Ds,Jn=I({"mixin/multiLine.ts"(){"use strict";Ds=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}}}),Ho={};ae(Ho,{ParamTagToken:()=>bt});var Kr,bi,Yr,bt,Do=N({"src/paramTag/index.ts"(){"use strict";K(),me(),Vs(),Jn(),G(),V(),Xe(),Kr=[Ds],bt=class extends(Yr=H){get type(){return"ext-inner"}constructor(e,t,s=I.getConfig(),i=[],l){if(super(void 0,s,i,{}),t){const n=ke;this.append(...t.split(`
7
- `).map(r=>l?r:vs(r,s,i,e)).map(r=>new n(r,"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 l=new ce(this,e),n=I.msg("invalid-parameter",this.name),r=[];for(const o of this.childNodes){o.setAttribute("aIndex",e);const a=o.childNodes.filter(({type:u})=>u!=="comment"&&u!=="include"&&u!=="noinclude");if(a.some(({type:u})=>u==="ext"))r.push(X(o,l,t,n,i));else{const u=a.findIndex(({type:h})=>h!=="text"),d=a.slice(0,u===-1?void 0:u).map(String).join("");if(d&&!(u===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(d)){const h=X(o,l,t,n,i);s.computeEditInfo&&(h.suggestions=[te(h)]),r.push(h)}else{const h=o.lint(e,!1);h.length>0&&r.push(...h)}}e+=o.toString().length+1}return r}}},bi=oe(Yr),bt=re(bi,0,"ParamTagToken",Kr,bt),ne(bi,1,bt)}}),Zr,wi,el,wt,Go=N({"src/heading.ts"(){"use strict";var e,t,Es,i;K(),Oe(),me(),qe(),G(),V(),Ft(),Zr=[Be],wt=(i=class extends(el=H){constructor(n,r,o,a=[]){super(void 0,o,a);P(this,t);P(this,e);E(this,e,n);const u=new H(r[0],o,a);u.type="heading-title",u.setAttribute("stage",2);const d=new Qe(r[1],"heading-trail",o,a);this.append(u,d)}get type(){return"heading"}get level(){return b(this,e)}toString(n){const r=R(this,t,Es).call(this);return r+this.firstChild.toString(n)+r+this.lastChild.toString(n)}text(){const n=R(this,t,Es).call(this);return n+this.firstChild.text()+n}getAttribute(n){return n==="invalid"?this.inHtmlAttrs()===2:n==="padding"?this.level:super.getAttribute(n)}getGaps(){return this.level}lint(n=this.getAbsoluteIndex(),r){{const o=super.lint(n,r),{firstChild:a,level:u}=this,d=a.toString(),h=d.startsWith("="),m=h||d.endsWith("="),f=new ce(this,n),x=this.inHtmlAttrs(),k=["h1","unbalanced-header","format-leakage"],{lintConfig:$}=I,{computeEditInfo:_,fix:T}=$,g=k.map(c=>$.getSeverity(c,"apostrophe"));if(g[0]&&this.level===1){const c=X(a,f,k[0],"<h1>",g[0]);_&&!m&&(c.suggestions=[Re(c,"h2",`=${d}=`)]),o.push(c)}if(g[1]&&m){const c=I.msg("unbalanced-in-section-header",'"="'),p=X(a,f,k[1],c,g[1]);if(!(!_||d==="="))if(h){const[w]=/^=+/u.exec(d),v=u+w.length;p.suggestions=[{desc:`h${u}`,range:[p.startIndex,p.startIndex+w.length],text:""}],v<7&&p.suggestions.push({desc:`h${v}`,range:[p.endIndex,p.endIndex],text:w})}else{const w=/[^=](=+)$/u.exec(d)[1],v=u+w.length;p.suggestions=[{desc:`h${u}`,range:[p.endIndex-w.length,p.endIndex],text:""}],v<7&&p.suggestions.push({desc:`h${v}`,range:[p.startIndex,p.startIndex],text:w})}o.push(p)}if(x){const c="parsing-order",p=$.getSeverity(c,x===2?"heading":"templateInTable");p&&o.push(ie(this,f,c,"header-in-html",p))}if(g[2]){const c=this.getRootNode().toString(),p=a.childNodes.filter(Qs("quote")),w=p.filter(({bold:y})=>y),v=p.filter(({italic:y})=>y);if(w.length%2){const y=X(w[w.length-1],{...f,start:n+u,left:f.left+u},k[2],I.msg("unbalanced-in-section-header","bold-apostrophes"),g[2]);if(_||T){const S=n+u+d.length,A=te(y);c.slice(y.endIndex,S).trim()?_&&(y.suggestions=[A,Ve(S,"'''")]):w.length===1&&v.length===0?y.fix=A:_&&(y.suggestions=[A])}o.push(y)}if(v.length%2){const y=X(v[v.length-1],{start:n+u},k[2],I.msg("unbalanced-in-section-header","italic-apostrophes"),g[2]);if(_||T){const S=n+u+d.length;c.slice(y.endIndex,S).trim()?_&&(y.suggestions=[Ve(S,"''")]):v.length===1&&w.length===0?y.fix=te(y):_&&(y.suggestions=[te(y)])}o.push(y)}}return o}}print(){const n=R(this,t,Es).call(this);return super.print({pre:n,sep:n})}json(n,r=this.getAbsoluteIndex()){const o=super.json(void 0,r);return o.level=this.level,o}},e=new WeakMap,t=new WeakSet,Es=function(){return"=".repeat(this.level)},i),wi=oe(el),wt=re(wi,0,"HeadingToken",Zr,wt),ne(wi,1,wt)}}),tl,yi,sl,Kt,ju=N({"src/hidden.ts"(){"use strict";Et(),V(),tl=[ct()],Kt=class extends(sl=H){get type(){return"hidden"}getAttribute(e){return e==="invalid"||super.getAttribute(e)}},yi=oe(sl),Kt=re(yi,0,"HiddenToken",tl,Kt),ne(yi,1,Kt)}}),il,Si,nl,Yt,Ru=N({"src/arg.ts"(){"use strict";var e,Vo,s;fe(),K(),me(),Ke(),Us(),qe(),G(),V(),Xe(),ju(),il=[Be,We("{{{"),xs()],Yt=(s=class extends(nl=H){constructor(l,n,r=[]){super(void 0,n,r,{});P(this,e);for(let o=0;o<l.length;o++){const a=l[o];if(o===0){const u=new ke(a,"arg-name",n,r,{});super.insertAt(u)}else if(o>1){const u=new Kt(a,n,r);super.insertAt(u)}else{const u=new H(a,n,r);u.type="arg-default",u.setAttribute("stage",2),super.insertAt(u)}}}get type(){return"arg"}get default(){var l,n;return(n=(l=this.childNodes[1])==null?void 0:l.text())!=null?n:!1}toString(l){return`{{{${super.toString(l,"|")}}}}`}text(){return`{{{${ut(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){R(this,e,Vo).call(this),super.afterBuild()}lint(l=this.getAbsoluteIndex(),n){{const{childNodes:[r,o,...a]}=this;r.setAttribute("aIndex",l+3);const u=r.lint(l+3,n);if(o){const x=l+4+r.toString().length;o.setAttribute("aIndex",x);const k=o.lint(x,n);k.length>0&&u.push(...k)}const d=["no-ignored","no-arg"],{lintConfig:h}=I,{computeEditInfo:m}=h,f=d.map(x=>h.getSeverity(x,"arg"));if(f[0]&&a.length>0){const x=new ce(this,l);u.push(...a.map(k=>{const $=X(k,x,d[0],"invisible-triple-braces",f[0]);return $.startIndex--,$.startCol--,m&&($.suggestions=[te($),It($.startIndex,"{{!}}")]),$}))}if(f[1]&&!this.getAttribute("include")){const x=ie(this,{start:l},d[1],"unexpected-argument",f[1]);m&&o&&(x.suggestions=[Re(x,"expand",o.text())]),u.push(x)}return u}}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(l,n=this.getAbsoluteIndex()){const r=super.json(void 0,n);return r.default=this.default,r}},e=new WeakSet,Vo=function(){this.setAttribute("name",this.firstChild.text().trim())},s),Si=oe(nl),Yt=re(Si,0,"ArgToken",il,Yt),ne(Si,1,Yt)}}),Qo={};ae(Qo,{parseBraces:()=>Gs});var rl,Ai,ks,ki,$i,_i,ll,Ti,Gs,Xn=N({"parser/braces.ts"(){"use strict";Je(),fe(),Go(),Eo(),Ru(),rl={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},Ai=String.raw`\[(?!\[)`,ks=String.raw`\n(?![=\0])`,ki=String.raw`|\{{2,}`,$i=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),_i=ot(e=>new RegExp(e,"gmu")),ll=new RegExp(String.raw`\{\{((?:[^\n{}[]|${Ai}|${ks})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${ks})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${Ai}|${ks})*\}-`,"gu"),Ti=e=>{const t=Tt(Te(e));return $i.has(t)?$i.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},Gs=(e,t,s)=>{var x,k,$,_,T;const i=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,l]}=t,n=[],r=[],o=(g,c,p,w)=>{c[c.length-1].push(Ee(g.slice(p,w),r))};let a;do a!==void 0&&(e=a),a=e.replace(ll,(g,c,p)=>{if(c!==void 0||typeof p=="string")try{const{length:w}=s,v=(c!=null?c:p).split("|");return new rt(Ee(v[0],r),v.slice(1).map(y=>{const S=y.indexOf("=");return(S===-1?[y]:[y.slice(0,S),y.slice(S+1)]).map(A=>Ee(A,r))}),t,s),`\0${w}${Ti(v[0])}`}catch(w){if(!(w instanceof SyntaxError)||w.message!=="Invalid template name")throw w}return r.push(Ee(g,r)),`\0${r.length-1}`});while(a!==e);e=a;const u=e.lastIndexOf("}}")-e.length;let d=u+e.length!==-1,h=_i(i+(d?ki:"")),m=h.exec(e),f;for(;m||f!==void 0&&f<=e.length&&((k=(x=n[n.length-1])==null?void 0:x[0])!=null&&k.startsWith("="));){if(m!=null&&m[1]){const[,{length:L}]=m;m[0]=m[0].slice(L),m.index+=L}const{0:g,index:c}=m!=null?m:{0:`
8
- `,index:e.length},p=($=n.pop())!=null?$:{},{0:w,index:v,parts:y,findEqual:S,pos:A}=p,j=g==="="&&S;if(g==="]]"||g==="}-")f=c+2;else if(g===`
9
- `){f=c+1;const{pos:L,findEqual:B}=(_=n[n.length-1])!=null?_:{};if(L===void 0||B||Te(e.slice(L,v))!==""){const O=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(e.slice(v,c));O&&(O[2]=Ee(O[2],r),O[2].includes(`
10
- `)||(e=`${e.slice(0,v)}\0${s.length}h${e.slice(c)}`,f=v+4+String(s.length).length,new wt(O[1].length,O.slice(2),t,s)))}}else if(g==="|"||j)f=c+1,o(e,y,A,c),g==="|"&&y.push([]),p.pos=f,p.findEqual=g==="|",n.push(p);else if(g.startsWith("}}")){const L=g.slice(0,Math.min(w.length,3)),B=w.length-L.length,{length:O}=s;f=c+L.length,o(e,y,A,c);let F=!1,D="t";if(L.length===3){const W=y.map(z=>z.join("=")),q=W.length>1&&Te(W[1]).trim();new Yt(W,t,s),q&&q.endsWith(":")&&l.includes(q.slice(0,-1).toLowerCase())&&(D="s")}else try{new rt(y[0][0],y.slice(1),t,s),D=Ti(y[0][0])}catch(W){if(W instanceof SyntaxError&&W.message==="Invalid template name")F=!0;else throw W}F||(e=`${e.slice(0,v+B)}\0${O}${D}${e.slice(f)}`,f=v+B+3+String(O).length,B>1?n.push({0:w.slice(0,B),index:v,pos:v+B,parts:[[]]}):B===1&&e[v-1]==="-"&&n.push({0:"-{",index:v-1,pos:v+1,parts:[[]]}))}else f=c+g.length,g.startsWith("{")&&(m.pos=f,m.parts=[[]]),n.push(..."0"in p?[p]:[],m);let C=n[n.length-1];if(d&&u+e.length<f)for(d=!1;(T=C==null?void 0:C[0])!=null&&T.startsWith("{");)n.pop(),C=n[n.length-1];h=_i(i+(d?ki:"")+(C?`|${rl[C[0][0]]}${C.findEqual?"|=":""}`:"")),h.lastIndex=f,m=h.exec(e)}return Ee(e,r)}}}),Jo={};ae(Jo,{InputboxToken:()=>Xo});var Xo,Pu=N({"src/paramTag/inputbox.ts"(){"use strict";Vs(),Xn(),G(),Do(),Xo=class extends bt{constructor(e,t,s=I.getConfig(),i=[]){const l=Symbol("InputboxToken"),n=s.excludes.includes("heading")?s:{...s,excludes:[...s.excludes,"heading"]},{length:r}=i;i.push(l),t&&(t=vs(t,n,i,e)),t&&(t=Gs(t,n,i)),i.splice(r,1),super(e,t,n,i,{})}}}}),js={};ae(js,{NestedToken:()=>Ko});var ol,al,Ko,Ci=N({"src/nested.ts"(){"use strict";var e,t,s;K(),me(),Vs(),Xn(),G(),V(),pa(),Ye(),ol=new Set(["comment","include","arg","template","magic-word"]),al=[!1,!0].map(i=>{const l=i?"includeonly":"noinclude";return new RegExp(String.raw`^(?:<${l}(?:\s[^>]*)?/?>|</${l}\s*>)$`,"iu")}),Ko=(s=class extends H{constructor(l,n,r,o,a=[]){if(typeof n=="boolean"){const u=Symbol("NestedToken"),{length:d}=a;a.push(u),l&&(l=vs(l,o,a,n)),l&&(l=Gs(l,o,a)),a.splice(d,1)}else l&&(l=l.replace(n,(u,d,h,m,f)=>{const x=`\0${a.length+1}e`;return new kt(d,h,m,f,o,!1,a),x}));l&&(l=l.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(u,d,h)=>(new xe(h,o,a),`${d}\0${a.length}n`)));super(l,o,a);P(this,e);P(this,t);E(this,e,[...r]),E(this,t,n)}get type(){return"ext-inner"}lint(l=this.getAbsoluteIndex(),n){{const r=super.lint(l,n),o="no-ignored",{lintConfig:a}=I,u=a.getSeverity(o,this.name);if(!u)return r;const d=new ce(this,l),h=typeof b(this,t)=="boolean"?al[b(this,t)?1:0]:/^<!--[\s\S]*-->$/u;return[...r,...this.childNodes.filter(m=>{const{type:f,name:x}=m;if(f==="ext")return!b(this,e).includes(x);if(ol.has(f))return!1;const k=m.toString().trim();return k&&!h.test(k)}).map(m=>{const f=X(m,d,o,I.msg("invalid-content",this.name),u);return a.computeEditInfo&&(f.suggestions=[te(f),On(f,m.toString())]),f})]}}},e=new WeakMap,t=new WeakMap,s)}});function ul(e,t,s,i,l){t=Te(t).trim();let n=t.replace(e==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(e){case"width":return!n&&!!t||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(n);case"link":{if(n){if(Yo(s.protocol).test(n))return Zo(s.protocol).test(n)&&t;n.startsWith("[[")&&n.endsWith("]]")&&(n=n.slice(2,-2))}else return t;const r=I.normalizeTitle(n,0,!1,s,{halfParsed:i,decode:!0,selfLink:!0});return r.valid&&r}case"lang":return(l==="svg"||l==="svgz")&&!/[^a-z\d-]/u.test(n);case"alt":case"class":case"manualthumb":return!0;case"page":return(l==="djvu"||l==="djv"||l==="pdf")&&Number(n)>0;default:return!!n&&!isNaN(n)}}var Yo,Zo,dl,cl,ea,Ou=N({"src/imageParameter.ts"(){"use strict";var e,t,ta,l;Je(),fe(),K(),G(),V(),Yo=ot(n=>new RegExp(String.raw`^(?:${n}|//|\0\d+m\x7F)`,"iu")),Zo=ot(n=>new RegExp(String.raw`^(?:(?:${n}|//)${$t}|\0\d+m\x7F)${_t}$`,"iu")),dl=ot(n=>new RegExp(String.raw`^(\s*(?!\s))${n.replace("$1","(.*)")}${n.endsWith("$1")?`(?=$|
11
- )`:""}(\s*)$`,"u")),cl=new Set(["alt","link","lang","page","caption"]),ea=(l=class extends H{constructor(r,o,a,u){var n=(...i)=>(super(...i),P(this,t),P(this,e,""),this);let d;const h=Object.entries(a.img).map(([f,x])=>[f,x,dl(f)]),m=h.find(([,f,x])=>(d=x.exec(r),d&&(d.length!==4||ul(f,d[2],a,!0,o)!==!1)));if(m&&d){d.length===3?(n(void 0,a,u),E(this,e,r)):(n(d[2],a,u,{}),E(this,e,d[1]+m[0]+d[3])),this.setAttribute("name",m[1]);return}n(r,a.excludes.includes("list")?a:{...a,excludes:[...a.excludes,"list"]},u),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get type(){return"image-parameter"}get link(){return this.name==="link"?ul("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var r;(r=this.parentNode)!=null&&r.is("gallery-image")&&!cl.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(r){return b(this,e)?b(this,e).replace("$1",super.toString(r)):super.toString(r)}text(){return b(this,e)?b(this,e).replace("$1",super.text()).trim():super.text().trim()}isPlain(){return this.name==="caption"}getAttribute(r){return r==="invalid"?this.name==="invalid":r==="padding"?Math.max(0,b(this,e).indexOf("$1")):super.getAttribute(r)}lint(r=this.getAbsoluteIndex(),o){{const a=super.lint(r,o),{lintConfig:u}=I,{computeEditInfo:d,fix:h}=u,{link:m,name:f}=this;if(f==="invalid"){const x="invalid-gallery",k=u.getSeverity(x,"parameter");if(k){const $=ie(this,{start:r},x,"invalid-image-parameter",k);(d||h)&&($.fix=te($,-1)),a.push($)}}else if(typeof m=="object"&&m.encoded){const x="url-encoding",k=u.getSeverity(x,"file");if(k){const $=ie(this,{start:r},x,"unnecessary-encoding",k);(d||h)&&($.fix=Rn($,this)),a.push($)}}return a}}getValue(){return this.name==="invalid"?this.text():R(this,t,ta).call(this)||super.text()}print(){return b(this,e)?`<span class="wpb-image-parameter${this.name==="invalid"?" wpb-invalid":""}">${b(this,e).replace("$1",`<span class="wpb-image-caption">${Ct(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}},e=new WeakMap,t=new WeakSet,ta=function(){return b(this,e)&&!b(this,e).includes("$1")},l)}}),Ii,hl,gl,Ni,Li,Fi,pl,Ei,Kn,sa=N({"src/link/file.ts"(){"use strict";K(),me(),G(),Ms(),Ou(),Ii=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),hl=new Set(["arg"]),gl=new Set(["template","magic-word"]),Ni=new Set(["left","right","center","none"]),Li=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),Fi=new Set(["tiff","tif","png","gif","jpg","jpeg","webp","xcf","pdf","svg","djvu"]),pl=e=>{if(e===void 0)return[];const t=/-\{|\}-|\|/gu,s=[];let i=t.exec(e),l=0,n=0;for(;i;){const{0:r,index:o}=i;r!=="|"?l+=r==="-{"?1:-1:l===0&&(s.push(e.slice(n,o)),{lastIndex:n}=t),i=t.exec(e)}return s.push(e.slice(n)),s},Ei=(e,t)=>e.filter(({childNodes:s})=>{const i=s.filter(l=>l.text().trim());return i.length!==1||!t.has(i[0].type)}),Kn=class extends De{get type(){return"file"}get extension(){return this.getAttribute("title").extension}constructor(e,t,s,i=[],l="|"){super(e,void 0,s,i,l);const{extension:n}=this.getTitle(!0,!0);this.safeAppend(pl(t).map(r=>new ea(r,n,s,i)))}lint(e=this.getAbsoluteIndex(),t){var s;{const i=super.lint(e,t),l=Ei(this.getAllArgs(),hl),n=[...new Set(l.map(({name:c})=>c))],r=n.filter(c=>Ii.has(c)),o=n.filter(c=>Ni.has(c)),a=n.filter(c=>Li.has(c)),[u]=r,d=u==="framed"||u==="manualthumb",h=new ce(this,e),{lintConfig:m}=I,{computeEditInfo:f,fix:x}=m,{extension:k}=this;let $="nested-link",_=m.getSeverity($,"file");if(_&&Fi.has(k)&&this.closest("ext-link-text")&&((s=this.getValue("link"))==null?void 0:s.trim())!==""){const c=ie(this,h,$,"link-in-extlink",_);if(f||x){const p=this.getArg("link");if(p){const w=e+p.getRelativeIndex();c.fix={desc:I.msg("delink"),range:[w,w+p.toString().length],text:"link="}}else c.fix=qs(c.endIndex-2,"delink","|link=")}i.push(c)}if($="invalid-gallery",_=m.getSeverity($,"parameter"),_&&d)for(const c of l.filter(({name:p})=>p==="width")){const p=X(c,h,$,"invalid-image-parameter",_);(f||x)&&(p.fix=te(p,-1)),i.push(p)}if(l.length===n.length&&r.length<2&&o.length<2&&a.length<2)return i;$="no-duplicate";const T=["unknownImageParameter","imageParameter"].map(c=>m.getSeverity($,c)),g=(c,p,w,v=!0)=>c.map(y=>{if(_=T[Number(typeof v=="function"?v(y):v)],!_)return!1;const S=X(y,h,$,I.msg(`${p}-image-parameter`,w),_);return f&&(S.suggestions=[te(S,-1)]),S}).filter(y=>y!==!1);for(const c of n){if(c==="invalid"||c==="width"&&d)continue;const p=c==="caption";let w=l.filter(({name:v})=>v===c);if(p&&(w=[...w.slice(0,-1).filter(v=>v.text()),...w.slice(-1)]),w.length>1){let v=!p||!k||Fi.has(k);if(p&&v){const y=Ei(w,gl);v=y.length>1&&(S=>y.includes(S))}i.push(...g(w,"duplicate",c,v))}}return r.length>1&&i.push(...g(l.filter(({name:c})=>Ii.has(c)),"conflicting","frame")),o.length>1&&i.push(...g(l.filter(({name:c})=>Ni.has(c)),"conflicting","horizontal-alignment")),a.length>1&&i.push(...g(l.filter(({name:c})=>Li.has(c)),"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);{const{extension:i}=this;return i&&(s.extension=i),s}}}}}),fl,ji,ml,yt,ia=N({"src/link/galleryImage.ts"(){"use strict";var e,bn,s;K(),dt(),Ke(),G(),V(),sa(),fl=[We("")],yt=(s=class extends(ml=Kn){constructor(l,n,r,o,a=[]){let u;if(r!==void 0){const{length:d}=a;u=new H(r,o,a);for(let h=0;h<_e-1;h++)u.parseOnce();a.splice(d,1)}super(n,u==null?void 0:u.toString(),o,a);P(this,e);Le(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=`${l}-image`,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(l){const n=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),n?0:6,{halfParsed:!0,temporary:l,decode:!n})}lint(l=this.getAbsoluteIndex(),n){{const r=super.lint(l,n),o="invalid-gallery",{lintConfig:a}=I,u=a.getSeverity(o,"image");if(u&&R(this,e,bn).call(this)){const d=ie(this,{start:l},o,"invalid-gallery",u);a.computeEditInfo&&(d.suggestions=[qs(l,"prefix","File:")]),r.push(d)}return r}}getAttribute(l){return l==="invalid"?R(this,e,bn).call(this):super.getAttribute(l)}},e=new WeakSet,bn=function(){const{ns:l}=this.getAttribute("title");return l!==6},s),ji=oe(ml),yt=re(ji,0,"GalleryImageToken",fl,yt),ne(ji,1,yt)}}),na={};ae(na,{GalleryToken:()=>Zt});var xl,Ri,vl,Zt,Bu=N({"src/gallery.ts"(){"use strict";var e,ra,wn,i;K(),Jn(),G(),V(),ia(),Ye(),xl=[Ds],Zt=(i=class extends(vl=H){constructor(n,r,o=[]){var a;super(void 0,r,o,{});P(this,e);for(const u of(a=n==null?void 0:n.split(`
12
- `))!=null?a:[]){const d=/^([^|]+)(?:\|(.*))?/u.exec(u);if(!d){super.insertAt(u.trim()?new xe(u,r,o):u);continue}const[,h,m]=d;R(this,e,ra).call(this,h)?super.insertAt(new yt("gallery",h,m,r,o)):super.insertAt(new xe(u,r,o))}}get type(){return"ext-inner"}get widths(){return R(this,e,wn).call(this,"widths")}get heights(){return R(this,e,wn).call(this,"heights")}lint(n=this.getAbsoluteIndex(),r){{const{top:o,left:a}=this.getRootNode().posFromIndex(n),u=[],d="no-ignored",{lintConfig:h}=I,m=["Image","NoImage","Comment"].map(f=>h.getSeverity(d,`gallery${f}`));for(let f=0;f<this.length;f++){const x=this.childNodes[f],k=x.toString(),{length:$}=k,_=k.trim(),{type:T}=x,g=o+f,c=f?0:a;if(x.setAttribute("aIndex",n),T==="noinclude"&&_&&!/^<!--.*-->$/u.test(_)){let[p]=m;if(_.startsWith("|")?[,p]=m:(_.startsWith("<!--")||_.endsWith("-->"))&&([,,p]=m),p){const w=n+$,v={rule:d,message:I.msg("invalid-content","gallery"),severity:p,startIndex:n,endIndex:w,startLine:g,endLine:g,startCol:c,endCol:c+$};h.computeEditInfo&&(v.suggestions=[te(v),On(v,k)]),u.push(v)}}else if(T!=="noinclude"&&T!=="text"){const p=x.lint(n,r);p.length>0&&u.push(...p)}n+=$+1}return u}}json(n,r=this.getAbsoluteIndex()){const o=super.json(void 0,r);return Object.assign(o,{widths:this.widths,heights:this.heights}),o}},e=new WeakSet,ra=function(n){return this.normalizeTitle(n,6,{halfParsed:!0,temporary:!0,decode:!0}).valid},wn=function(n){var r,o;{const a=(r=this.parentNode)==null?void 0:r.getAttr(n),u=typeof a=="string"&&((o=/^(\d+)\s*(?:px)?$/u.exec(a))==null?void 0:o[1]);return u&&Number(u)||120}},i),Ri=oe(vl),Zt=re(Ri,0,"GalleryToken",xl,Zt),ne(Ri,1,Zt)}}),Yn,la=N({"src/link/index.ts"(){"use strict";Je(),K(),G(),Ms(),Yn=class extends De{get type(){return"link"}get innerText(){return this.length>1?this.lastChild.text():hs(this.firstChild.text().replace(/^\s*:?/u,""))}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i="nested-link",{lintConfig:l}=I,n=l.getSeverity(i);if(n&&this.closest("ext-link-text")){const r=ie(this,{start:e},i,"link-in-extlink",n);(l.computeEditInfo||l.fix)&&(r.fix=Re(r,"delink",this.innerText)),s.push(r)}return s}}}}}),bl,wl,fs,Zn=N({"src/magicLink.ts"(){"use strict";var e,t,yn,i;K(),fe(),me(),G(),V(),bl=String.raw`(?:[${Ge}\t]|&nbsp;|&#0*160;|&#[xX]0*[aA]0;)`,wl=new RegExp(`${bl}+`,"gu"),fs=(i=class extends H{constructor(n,r="free-ext-link",o=I.getConfig(),a){super(n,o,a,{});P(this,t);P(this,e);E(this,e,r)}get type(){return b(this,e)}get innerText(){const n=new Map([["!","|"],["=","="]]);let r=ut(this.childNodes.map(o=>{const{type:a}=o,u=String(o.name);return a==="magic-word"&&n.has(u)?n.get(u):o}));return this.type==="magic-link"&&(r=r.replace(wl," ")),r}get link(){const{innerText:n}=this;return this.type==="magic-link"?n.startsWith("ISBN")?`ISBN ${n.slice(5).replace(/[- ]/gu,"").replace(/x$/u,"X")}`:n:So(n).replace(/\n/gu,"%0A")}lint(n=this.getAbsoluteIndex(),r){{const o=super.lint(n,r),a=new ce(this,n),{lintConfig:u}=I,{type:d,childNodes:h}=this;if(d==="magic-link"){const k="invalid-isbn",$=u.getSeverity(k);return $&&R(this,t,yn).call(this)&&o.push(ie(this,a,k,"invalid-isbn",$)),o}const m=d==="ext-link-url",f="unterminated-url",x=u.getSeverity(f,m?"pipe":"punctuation");if(x){const k=m?/\|/u:/[,;。:!?()]+/u,$=h.find(_=>_.type==="text"&&k.test(_.data));if($){const{data:_}=$,T=X($,a,f,I.msg("in-url",m?'"|"':"full-width-punctuation"),x);if(u.computeEditInfo){const{index:g,0:c}=k.exec(_),p=T.startIndex+g;T.suggestions=m?[ps(p,1)]:[ps(p),{desc:I.msg("encode"),range:[p,p+c.length],text:encodeURI(c)}]}o.push(T)}}return o}}getUrl(n){{const{type:r}=this;let{link:o}=this;if(r==="magic-link"){if(o.startsWith("ISBN"))return this.normalizeTitle(`BookSources/${o.slice(5)}`,-1,{temporary:!0}).getUrl(n);o=o.startsWith("RFC")?`https://datatracker.ietf.org/doc/html/rfc${o.slice(4)}`:`https://pubmed.ncbi.nlm.nih.gov/${o.slice(5)}`}else o.startsWith("//")&&(o=`https:${o}`);return new URL(o)}this.lspError("MagicLinkToken.getUrl")}getAttribute(n){return n==="invalid"?R(this,t,yn).call(this):super.getAttribute(n)}},e=new WeakMap,t=new WeakSet,yn=function(){if(this.type==="magic-link"){const{link:n}=this;if(n.startsWith("ISBN")){const r=[...n.slice(5)].map(o=>o==="X"?10:Number(o));return r.length===10?r.reduce((o,a,u)=>o+a*(10-u),0)%11!==0:r.length===13&&(r[12]===10||r.reduce((o,a,u)=>o+a*(u%2?3:1),0)%10!==0)}}return!1},i)}}),yl,Pi,Sl,St,oa=N({"src/extLink.ts"(){"use strict";var e,t;dt(),K(),Ke(),G(),V(),Zn(),yl=[We("[")],St=(t=class extends(Sl=H){constructor(i,l="",n="",r,o=[]){super(void 0,r,o,{});P(this,e);const a=i&&/^\0\d+f\x7F$/u.test(i)?o[Number(i.slice(1,-2))]:new fs(i,"ext-link-url",r,o);if(this.insertAt(a),E(this,e,l),n){const u=new H(n,r,o,{});u.type="ext-link-text",u.setAttribute("stage",_e-1),this.insertAt(u)}}get type(){return"ext-link"}toString(i){return this.length===1?`[${super.toString(i)}${b(this,e)}]`:`[${super.toString(i,b(this,e))}]`}text(){return`[${super.text(" ")}]`}getGaps(){return b(this,e).length}lint(i=this.getAbsoluteIndex(),l){{const n=super.lint(i,l),r="var-anchor",o=I.lintConfig.getSeverity(r,"extLink");return o&&this.length===1&&this.closest("heading-title")&&n.push(ie(this,{start:i},r,"variable-anchor",o)),n}}print(){return super.print(this.length===1?{pre:"[",post:`${b(this,e)}]`}:{pre:"[",sep:b(this,e),post:"]"})}},e=new WeakMap,t),Pi=oe(Sl),St=re(Pi,0,"ExtLinkToken",yl,St),ne(Pi,1,St)}}),Sn,qu=N({"src/imagemapLink.ts"(){"use strict";V(),Ye(),la(),oa(),Sn=class extends H{get type(){return"imagemap-link"}constructor(e,t,s,i,l=[]){super(void 0,i,l),this.append(e,t.length===2?new Yn(...t,i,l):new St(...t,i,l),new xe(s,i,l))}}}}),aa={};ae(aa,{ImagemapToken:()=>es});var Al,Oi,kl,es,Wu=N({"src/imagemap.ts"(){"use strict";K(),Oe(),me(),Jn(),G(),V(),Ye(),ia(),qu(),Al=[Ds],es=class extends(kl=H){get type(){return"ext-inner"}get image(){return this.childNodes.find(Qs("imagemap-image"))}constructor(e,t=I.getConfig(),s=[]){if(super(void 0,t,s,{}),!e)return;const i=e.split(`
13
- `),l=new Set(t.protocol.split("|")),n=xe;let r=!0,o=!1;for(const a of i){const u=a.trim();if(!(o||!u||u.startsWith("#"))){if(r){const d=a.indexOf("|"),h=d===-1?a:a.slice(0,d),{valid:m,ns:f}=this.normalizeTitle(h,0,{halfParsed:!0,temporary:!0});if(m&&f===6){const x=new yt("imagemap",h,d===-1?void 0:a.slice(d+1),t,s);super.insertAt(x),r=!1;continue}else o=!0}else if(a.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(a);continue}else if(a.includes("[")){const d=a.indexOf("["),h=a.slice(d),m=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(h);if(m){if(this.normalizeTitle(m[1],0,{halfParsed:!0,temporary:!0,selfLink:!0}).valid){super.insertAt(new Sn(a.slice(0,d),m.slice(1),h.slice(h.indexOf("]]")+2),t,s));continue}}else if(h.startsWith("[//")||l.has(h.slice(1,h.indexOf(":")+1))||l.has(h.slice(1,h.indexOf("//")+2))){const f=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(h);if(f){super.insertAt(new Sn(a.slice(0,d),f.slice(1),h.slice(h.indexOf("]")+1),t,s));continue}}}}super.insertAt(new n(a,t,s))}}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new ce(this,e),{childNodes:l,image:n}=this,r="invalid-imagemap",{lintConfig:o}=I,a=o.getSeverity(r,n?"link":"image");return a&&(n?s.push(...l.filter(u=>{const d=u.toString().trim();return u.is("noinclude")&&d&&!d.startsWith("#")}).map(u=>{const d=X(u,i,r,"invalid-imagemap-link",a);return o.computeEditInfo&&(d.suggestions=[te(d,-1),Re(d,"comment","# ")]),d})):s.push(ie(this,i,r,"imagemap-without-image",a))),s}}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}},Oi=oe(kl),es=re(Oi,0,"ImagemapToken",Al,es),ne(Oi,1,es)}}),$l,Bi,_l,At,ua=N({"src/nowiki/comment.ts"(){"use strict";K(),Et(),Ke(),G(),ht(),$l=[ct(!1),We("<!--")],At=class extends(_l=Pe){constructor(t,s,i,l){super(t,i,l);Le(this,"closed");this.closed=s}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){{if(this.closed)return[];const s="unclosed-comment",{lintConfig:i}=I,l=i.getSeverity(s);if(!l)return[];const n=ie(this,{start:t},s,I.msg("unclosed","html-comment"),l);return i.computeEditInfo&&(n.suggestions=[Ve(n.endIndex,"-->")]),[n]}}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"&lt;!--",post:this.closed?"--&gt;":""})}},Bi=oe(_l),At=re(Bi,0,"CommentToken",$l,At),ne(Bi,1,At)}}),da={};ae(da,{CommentedToken:()=>ca});var ca,Uu=N({"src/commented.ts"(){"use strict";V(),ua(),ca=class extends H{get type(){return"ext-inner"}constructor(e,t,s=[]){if(super(void 0,t,s,{AstText:":",CommentToken:":"}),e){let i=e.indexOf("<!--"),l=i!==-1&&e.indexOf("-->",i+4),n=0;for(;l!==!1&&l!==-1;)i>n&&this.insertAt(e.slice(n,i)),this.insertAt(new At(e.slice(i+4,l),!0,t,s)),n=l+3,i=e.indexOf("<!--",n),l=i!==-1&&e.indexOf("-->",i+4);n<e.length&&this.insertAt(e.slice(n))}}lint(e=this.getAbsoluteIndex()){return super.lint(e,new RegExp(String.raw`<\s*(?:\/\s*)?(${this.name})\b`,"giu"))}}}}),ha={};ae(ha,{NowikiToken:()=>ga});var Tl,Cl,ga,Mu=N({"src/nowiki/index.ts"(){"use strict";var e,An,s;Je(),K(),G(),ht(),Tl=ot(i=>new RegExp(String.raw`<\s*(?:/\s*)${i==="nowiki"?"":"?"}(${i})\b`,"giu")),Cl=new Set(["languages","section","templatestyles"]),ga=(s=class extends Pe{constructor(){super(...arguments);P(this,e)}get type(){return"ext-inner"}lint(l=this.getAbsoluteIndex()){{const{name:n}=this,r="void-ext",{lintConfig:o}=I,a=o.getSeverity(r,n);if(a&&R(this,e,An).call(this)){const u=ie(this,{start:l},r,I.msg("nothing-in",n),a);return o.computeEditInfo&&(u.suggestions=[te(u)]),[u]}return super.lint(l,Tl(n))}}getAttribute(l){return l==="invalid"?R(this,e,An).call(this):super.getAttribute(l)}},e=new WeakSet,An=function(){const{name:l,firstChild:{data:n}}=this;return Cl.has(l)&&!!n},s)}}),Il,qi,Nl,kt,pa=N({"src/tagPair/ext.ts"(){"use strict";K(),me(),G(),Hn(),V(),zn(),Qn(),Il=[zs()],kt=class extends(Nl=lt){get type(){return"ext"}constructor(e,t,s,i,l=I.getConfig(),n=!1,r=[]){const o=e.toLowerCase(),a=new Hs(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",o,l,r),u={...l,ext:l.ext.filter(h=>h!==o),excludes:[...l.excludes],inExt:!0};let d;switch(o){case"tab":u.ext=u.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"&&u.excludes.push("heading"),d=new H(s,u,r);break;case"pre":{const{PreToken:h}=(Eu(),ee(Mo));d=new h(s,u,r);break}case"dynamicpagelist":{const{ParamTagToken:h}=(Do(),ee(Ho));d=new h(n,s,u,r);break}case"inputbox":{const{InputboxToken:h}=(Pu(),ee(Jo));d=new h(n,s,u,r);break}case"references":{const{NestedToken:h}=(Ci(),ee(js));u.excludes.push("heading"),d=new h(s,n,["ref"],u,r);break}case"choose":{const{NestedToken:h}=(Ci(),ee(js));d=new h(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],u,r);break}case"combobox":{const{NestedToken:h}=(Ci(),ee(js));d=new h(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],u,r);break}case"gallery":{const{GalleryToken:h}=(Bu(),ee(na));d=new h(s,u,r);break}case"imagemap":{const{ImagemapToken:h}=(Wu(),ee(aa));d=new h(s,u,r);break}case"hiero":{const{CommentedToken:h}=(Uu(),ee(da));d=new h(s,u,r);break}default:{const{NowikiToken:h}=(Mu(),ee(ha));d=new h(s,u,r)}}d.setAttribute("name",o),d.type==="plain"&&(d.type="ext-inner"),super(e,a,d,i,l,r),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),{lintConfig:i}=I,l=new ce(this,e);if(this.name!=="nowiki"){const o=this.inHtmlAttrs(),a="parsing-order",u=o&&i.getSeverity(a,o===2?"ext":"templateInTable");u&&s.push(ie(this,l,a,"ext-in-html",u))}const n="var-anchor",r=i.getSeverity(n,"ref");return r&&this.name==="ref"&&this.closest("heading-title")&&s.push(ie(this,l,n,"variable-anchor",r)),s}}},qi=oe(Nl),kt=re(qi,0,"ExtToken",Il,kt),ne(qi,1,kt)}}),fa={};ae(fa,{parseCommentAndExt:()=>vs});var Wi,Ll,$s,Fl,Ui,vs,Vs=N({"parser/commentAndExt.ts"(){"use strict";Je(),fe(),Iu(),Ye(),Nu(),Lu(),pa(),ua(),Wi="<onlyinclude>",Ll="</onlyinclude>",{length:$s}=Wi,Fl=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",s=e?"noinclude":"includeonly";return _o(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"))}),Ui=e=>{const t=e.indexOf(Wi);return{i:t,j:e.indexOf(Ll,t+$s)}},vs=(e,t,s,i)=>{if(i){let{i:o,j:a}=Ui(e);if(o!==-1&&a!==-1){let u="";const d=h=>{new xe(h,t,s),u+=`\0${s.length-1}n`};for(;o!==-1&&a!==-1;){const h=`\0${s.length}e`;new Jt(e.slice(o+$s,a),t,s),o>0&&d(e.slice(0,o)),u+=h,e=e.slice(a+$s+1),{i:o,j:a}=Ui(e)}return e&&d(e),u}}const{ext:l}=t,n=l.filter(o=>o!=="translate"&&o!=="tvar"),r={...t,ext:n};if(l.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,u,d)=>{const h=s.length;return new Bo(u,d&&Ee(d,o),r,s),`\0${h}g`}),e=Ee(e,o)}return e.replace(Fl[i?1:0](n),(o,a,u,d,h,m,f,x,k)=>{const $=s.length;let _="n";if(a)_="e",new kt(a,u,d,h,r,m,s);else if(o.startsWith("<!--")){_="c";const T=o.endsWith("-->");new At(Ee(o,s,1).slice(4,T?-3:void 0),T,t,s)}else m?new Xt(m,f&&Ee(f,s,1),x&&Ee(x,s,1),k,t,s):new xe(o,t,s);return`\0${$}${_}`})}}}),El,jl,Rl,Pl,Mi,Ol,ts,zu=N({"src/html.ts"(){"use strict";var e,t,s,i,l;K(),Oe(),me(),Hn(),G(),V(),El=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),jl=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"]),Rl=new Set(["strike","big","center","font","tt"]),Pl=[zs()],ts=(l=class extends(Ol=H){constructor(r,o,a,u,d,h){super(void 0,d,h);P(this,e);P(this,t);P(this,s);P(this,i);this.insertAt(o),this.setAttribute("name",r.toLowerCase()),E(this,e,a),E(this,t,u),E(this,s,r)}get type(){return"html"}get selfClosing(){return b(this,t)}get closing(){return b(this,e)}toString(r){return`<${this.closing?"/":""}${b(this,s)}${super.toString(r)}${b(this,t)?"/":""}>`}text(){const{closing:r}=this,o=b(this,s)+(r?"":super.text());return`<${r?"/":""}${o}${b(this,t)?"/":""}>`}getAttribute(r){return r==="invalid"?this.inTableAttrs()===2:r==="padding"?b(this,s).length+(this.closing?2:1):super.getAttribute(r)}lint(r=this.getAbsoluteIndex(),o){var a;{const u=super.lint(r,o),{name:d,parentNode:h,closing:m,selfClosing:f}=this,x=new ce(this,r),{lintConfig:k}=I,{computeEditInfo:$,fix:_}=k,T=this.inTableAttrs();let g="h1",c=k.getSeverity(g,"html");if(c&&d==="h1"&&!m){const A=ie(this,x,g,"<h1>",c);$&&(A.suggestions=[{desc:"h2",range:[r+2,r+3],text:"2"}]),u.push(A)}if(g="parsing-order",c=T&&k.getSeverity(g,T===2?"html":"templateInTable"),c){const A=ie(this,x,g,"html-in-table",c);$&&T===2&&(A.suggestions=[te(A)]),u.push(A)}if(g="obsolete-tag",c=k.getSeverity(g,d),c&&Rl.has(d)&&u.push(ie(this,x,g,"obsolete-tag",c)),g="bold-header",c=k.getSeverity(g,d),c&&(d==="b"||d==="strong")&&((a=this.closest("heading-title,ext"))==null?void 0:a.type)==="heading-title"){const A=ie(this,x,g,"bold-in-header",c);$&&(A.suggestions=[te(A)]),u.push(A)}const{html:[,p,w]}=this.getAttribute("config"),v=w.includes(d),y=p.includes(d),S=!v&&!y;if(g="unmatched-tag",m&&(f||v)||f&&S){if(c=k.getSeverity(g,m?"both":"selfClosing"),c){const A=ie(this,x,g,m?"closing-and-self-closing":"invalid-self-closing",c);if($||_){const j=Pn(r),C={desc:I.msg("no-self-closing"),range:[A.endIndex-2,A.endIndex-1],text:""};y?$&&(A.suggestions=[j,C]):m?A.fix=v?j:C:$&&(A.suggestions=[C,Ve(A.endIndex,`></${d}>`,-2)])}u.push(A)}}else if(!this.findMatchingTag()){const A=ie(this,x,g,m?"unmatched-closing":"unclosed-tag"),j=this.closest("magic-word");if(j&&El.has(j.name))c=k.getSeverity(g,"conditional");else if(m)c=k.getSeverity(g,"closing"),A.suggestions=[te(A)];else{c=k.getSeverity(g,"opening");const C=h==null?void 0:h.childNodes;jl.has(d)&&(C!=null&&C.slice(0,C.indexOf(this)).some(L=>L.type==="html"&&L.name===d&&!L.findMatchingTag())&&(A.suggestions=[Ve(r+1,"/")]),this.closest("heading-title")&&(A.rule="format-leakage",c=k.getSeverity("format-leakage",d)))}c&&(A.severity=c,u.push(A))}return u}}findMatchingTag(){return at(b(this,i),()=>{const{name:r,parentNode:o,closing:a,selfClosing:u}=this,{html:[,d,h]}=this.getAttribute("config"),m=h.includes(r),f=d.includes(r);if(m||f&&u)return this;if(!o)return;const{childNodes:x}=o,k=x.indexOf(this),$=a?x.slice(0,k).reverse():x.slice(k+1),_=[this],{rev:T}=we;for(const g of $)if(!(!g.is("html")||g.name!==r||f&&b(g,t)))if(b(g,e)===a)_.push(g);else{const c=_.pop();if(c===this)return g;I.viewOnly&&(E(c,i,[T,g]),E(g,i,[T,c]))}if(I.viewOnly)for(const g of _)E(g,i,[T,void 0])},r=>{E(this,i,r),r[1]&&r[1]!==this&&E(r[1],i,[we.rev,this])})}print(){return super.print({pre:`&lt;${this.closing?"/":""}${b(this,s)}`,post:`${b(this,t)?"/":""}&gt;`})}json(r,o=this.getAbsoluteIndex()){const a=super.json(void 0,o);return Object.assign(a,{closing:this.closing,selfClosing:b(this,t)}),a}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,l),Mi=oe(Ol),ts=re(Mi,0,"HtmlToken",Pl,ts),ne(Mi,1,ts)}}),ma={};ae(ma,{parseHtml:()=>xa});var Bl,xa,Hu=N({"parser/html.ts"(){"use strict";Qn(),zu(),Bl=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,xa=(e,t,s)=>{var r;const{html:i}=t;(r=t.htmlElements)!=null||(t.htmlElements=new Set([...i[0],...i[1],...i[2]]));const l=e.split("<");let n=l.shift();for(const o of l){const a=Bl.exec(o),u=a==null?void 0:a[2],d=u==null?void 0:u.toLowerCase();if(!a||!t.htmlElements.has(d)){n+=`<${o}`;continue}const[,h,,m="",f,x]=a,{length:k}=s,$=new Hs(m,"html-attrs",d,t,s),_=$.hasAttr("itemprop");if(d==="meta"&&!(_&&$.hasAttr("content"))||d==="link"&&!(_&&$.hasAttr("href"))){n+=`<${o}`,s.length=k;continue}n+=`\0${s.length}x${x}`,new ts(u,$,h==="/",f==="/>",t,s)}return n}}}),ql,er,va=N({"src/table/base.ts"(){"use strict";Hn(),G(),V(),Ft(),Qn(),ql=e=>{const t=e.childNodes.map(i=>i.type==="text"?i.data.replace(/\|\|/gu,"{{!!}}").replace(/\|/gu,"{{!}}"):i.toString()).join(""),{childNodes:s}=I.parse(t,e.getAttribute("include"),2,e.getAttribute("config"));e.safeReplaceChildren(s)},er=class extends zs(1)(H){constructor(e,t,s,i,l,n=[],r){super(void 0,l,n,r),this.append(new Qe(t,"table-syntax",l,n),new Hs(i,"table-attrs",s,l,n))}escape(){for(const e of this.childNodes)e instanceof Qe?ql(e):e.escape()}}}}),Wl,zi,Ae,_s,Ut,Mt,Bs,ba=N({"src/table/td.ts"(){"use strict";K(),me(),Mn(),G(),V(),va(),Bs=class extends(zi=er,Wl=[Ws(!1)],zi){constructor(e,t,s,i=[]){var o;let l=/\||\0\d+!\x7F/u.exec(t!=null?t:""),n=l?t.slice(0,l.index):"";/\[\[|-\{/u.test(n)&&(l=null,n=""),super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",n,s,i),ne(_s,5,this),He(this,Ut),He(this,Ae,""),l&&([vu(this,Ae)._]=l);const r=new H(t==null?void 0:t.slice(((o=l==null?void 0:l.index)!=null?o:NaN)+pe(this,Ae).length),s,i);r.type="td-inner",r.setAttribute("stage",4),this.insertAt(r)}get type(){return"td"}get rowspan(){return this.getAttr("rowspan")}get colspan(){return this.getAttr("colspan")}get subtype(){return cn(this,Ut,Mt).call(this).subtype}afterBuild(){pe(this,Ae).includes("\0")&&$e(this,Ae,this.buildFromStr(pe(this,Ae),0)),super.afterBuild()}toString(e){const{childNodes:[t,s,i]}=this;return t.toString(e)+s.toString(e)+pe(this,Ae)+i.toString(e)}text(){const{childNodes:[e,t,s]}=this;return e.text()+t.text()+pe(this,Ae)+s.text()}getGaps(e){return e===1?pe(this,Ae).length:0}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new ce(this,e+this.getRelativeIndex(this.length-1)),l="pipe-like",{lintConfig:n}=I,{computeEditInfo:r,fix:o}=n,a=["td","double"].map(u=>n.getSeverity(l,u));for(const u of this.lastChild.childNodes)if(u.type==="text"){const{data:d}=u;if(d.includes("|")){const h=d.includes("||"),m=a[h?1:0];if(m){const f=X(u,i,l,"pipe-in-table",m);if(r||o)if(h){const x={caption:"|+",td:"|",th:"!"}[this.subtype];f.fix=Re(f,"newline",d.replace(/\|\|/gu,`
14
- ${x}`))}else r&&(f.suggestions=[qn(f.startIndex,d)]);s.push(f)}}}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(){super.escape(),this.childNodes[1].toString()&&(pe(this,Ae)||$e(this,Ae,"{{!}}")),pe(this,Ae)==="|"&&$e(this,Ae,"{{!}}")}print(){const{childNodes:[e,t,s]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${pe(this,Ae)}${s.print()}</span>`}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t);{const{rowspan:i,colspan:l}=this;return Object.assign(s,{subtype:this.subtype},i!==1&&{rowspan:i},l!==1&&{colspan:l}),s}}},_s=oe(zi),Ae=new WeakMap,Ut=new WeakSet,Mt=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:l}=this;return{...cn(e=l,Ut,Mt).call(e)}},Mt=re(_s,17,"#getSyntax",Wl,Ut,Mt),Fn(_s,Bs)}}),tr,wa=N({"src/table/trBase.ts"(){"use strict";K(),G(),va(),ba(),tr=class extends er{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 l=ls(i),n="fostered-content",r=l&&I.lintConfig.getSeverity(n,l===2?void 0:"transclusion");if(r){const o=X(i,{start:e},n,"content-outside-table",r);o.startIndex++,o.startLine++,o.startCol=0,s.push(o)}return s}}getRowCount(){return Number(this.childNodes.some(e=>e instanceof Bs&&e.isIndependent()&&!e.firstChild.text().endsWith("+")))}}}}),Ul,Ml,zl,Hl,Hi,Ts,Rs,Du=N({"src/table/index.ts"(){"use strict";K(),Oe(),me(),Mn(),G(),wa(),Ft(),Ul=(e,t)=>new Array(e).fill(void 0).map((s,i)=>t(i)),Ml=({type:e})=>e==="tr"||e==="table-syntax",zl=class extends Array{},Rs=class extends(Hi=tr,Hl=[Ws(!1)],Hi){constructor(e,t,s,i){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,"table",t,s,i,{}),ne(Ts,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 ce(this,e),l=["unclosed-table","table-layout"],n=l.map(r=>I.lintConfig.getSeverity(r));if(n[0]&&!this.closed&&s.push(X(this.firstChild,i,l[0],I.msg("unclosed","table"),n[0])),n[1]){const r=this.getLayout(),{length:o}=r;if(o>1){let a=1,u=1/0,d=0;for(;d<o;d++){const h=r[d],m=h.length;if(m<a)break;m<u&&(u=m);const f=h.indexOf(h[m-1])+1;if(f>u)break;f>a&&(a=f)}if(d<o){const h=this.getNthRow(d),m=X(h,i,l[1],"inconsistent-table",n[1]);m.startIndex++,m.startLine++,m.startCol=0,s.push(m)}}}return s}}close(e=`
16
- |}`,t){const s=this.getAttribute("config"),i=this.getAttribute("accum");we.run(()=>{const l=new Qe(t?e:void 0,"table-syntax",s,i);super.insertAt(l)})}getLayout(e){const t=this.getAllRows(),{length:s}=t,i=zl.from(Ul(s,()=>[]));for(let l=0;l<i.length;l++){const n=i[l];let r=0,o=0,a;for(const u of t[l].childNodes.slice(2))if(u.is("td")){if(u.isIndependent()&&(a=u.subtype!=="caption"),a){const d={row:l,column:r},{rowspan:h,colspan:m}=u;for(r++;n[o];)o++;for(let f=l;f<Math.min(l+h,s);f++)for(let x=o;x<o+m;x++)i[f][x]=d;o+=m}}else if(Ml(u))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 l of this.childNodes.slice(2)){const{type:n}=l;if(n==="tr"&&l.getRowCount()&&(e--,e<0))return l}}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t);return s.closed=this.closed,s}},Ts=oe(Hi),re(Ts,1,"getLayout",Hl,Rs),Fn(Ts,Rs)}}),ya,Gu=N({"src/table/tr.ts"(){"use strict";wa(),ya=class extends tr{get type(){return"tr"}constructor(e,t,s,i){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,e,"tr",t,s,i)}}}}),sr,Sa=N({"src/nowiki/listBase.ts"(){"use strict";ht(),sr=class extends Pe{get indent(){return this.innerText.split(":").length-1}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t);{const{indent:i}=this;return i&&(s.indent=i),s}}}}}),ir,Aa=N({"src/nowiki/dd.ts"(){"use strict";Sa(),ir=class extends sr{get type(){return"dd"}}}}),ka={};ae(ka,{parseTable:()=>$a});var Dl,Di,$a,Vu=N({"parser/table.ts"(){"use strict";V(),Du(),Gu(),ba(),Aa(),Dl=e=>e.lastChild.constructor!==H,Di=(e,t)=>e.is("td")?t.pop():e,$a=({firstChild:{data:e},type:t,name:s},i,l)=>{const n=[],r=e.split(`
6
+ `})}}return t}}}),zo={};ae(zo,{ParamTagToken:()=>wt});var Kr,bi,Yr,wt,Ho=I({"src/paramTag/index.ts"(){"use strict";K(),me(),Vs(),Jn(),G(),V(),Ke(),Kr=[Ds],wt=class extends(Yr=H){get type(){return"ext-inner"}constructor(e,t,s=N.getConfig(),i=[],l){if(super(void 0,s,i,{}),t){const n=$e;this.append(...t.split(`
7
+ `).map(r=>l?r:vs(r,s,i,e)).map(r=>new n(r,"param-line",s,i,{})))}i.splice(i.indexOf(this),1),i.push(this)}lint(e=this.getAbsoluteIndex()){{const t="no-ignored",{lintConfig:s}=N,i=s.getSeverity(t,this.name);if(!i)return[];const l=new ce(this,e),n=N.msg("invalid-parameter",this.name),r=[];for(const o of this.childNodes){o.setAttribute("aIndex",e);const a=o.childNodes.filter(({type:u})=>u!=="comment"&&u!=="include"&&u!=="noinclude");if(a.some(({type:u})=>u==="ext"))r.push(X(o,l,t,n,i));else{const u=a.findIndex(({type:c})=>c!=="text"),d=a.slice(0,u===-1?void 0:u).map(String).join("");if(d&&!(u===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(d)){const c=X(o,l,t,n,i);s.computeEditInfo&&(c.suggestions=[te(c)]),r.push(c)}else{const c=o.lint(e,!1);c.length>0&&r.push(...c)}}e+=o.toString().length+1}return r}}},bi=oe(Yr),wt=re(bi,0,"ParamTagToken",Kr,wt),ne(bi,1,wt)}}),Zr,wi,el,yt,Do=I({"src/heading.ts"(){"use strict";var e,t,Es,i;K(),Oe(),me(),qe(),G(),V(),Et(),Zr=[Be],yt=(i=class extends(el=H){constructor(n,r,o,a=[]){super(void 0,o,a);P(this,t);P(this,e);j(this,e,n);const u=new H(r[0],o,a);u.type="heading-title",u.setAttribute("stage",2);const d=new Qe(r[1],"heading-trail",o,a);this.append(u,d)}get type(){return"heading"}get level(){return w(this,e)}toString(n){const r=R(this,t,Es).call(this);return r+this.firstChild.toString(n)+r+this.lastChild.toString(n)}text(){const n=R(this,t,Es).call(this);return n+this.firstChild.text()+n}getAttribute(n){return n==="invalid"?this.inHtmlAttrs()===2:n==="padding"?this.level:super.getAttribute(n)}getGaps(){return this.level}lint(n=this.getAbsoluteIndex(),r){{const o=super.lint(n,r),{firstChild:a,level:u}=this,d=a.toString(),c=d.startsWith("="),f=c||d.endsWith("="),p=new ce(this,n),v=this.inHtmlAttrs(),k=["h1","unbalanced-header","format-leakage"],{lintConfig:$}=N,{computeEditInfo:_,fix:T}=$,g=k.map(h=>$.getSeverity(h,"apostrophe"));if(g[0]&&this.level===1){const h=X(a,p,k[0],"<h1>",g[0]);_&&!f&&(h.suggestions=[Re(h,"h2",`=${d}=`)]),o.push(h)}if(g[1]&&f){const h=N.msg("unbalanced-in-section-header",'"="'),x=X(a,p,k[1],h,g[1]);if(!(!_||d==="="))if(c){const[b]=/^=+/u.exec(d),m=u+b.length;x.suggestions=[{desc:`h${u}`,range:[x.startIndex,x.startIndex+b.length],text:""}],m<7&&x.suggestions.push({desc:`h${m}`,range:[x.endIndex,x.endIndex],text:b})}else{const b=/[^=](=+)$/u.exec(d)[1],m=u+b.length;x.suggestions=[{desc:`h${u}`,range:[x.endIndex-b.length,x.endIndex],text:""}],m<7&&x.suggestions.push({desc:`h${m}`,range:[x.startIndex,x.startIndex],text:b})}o.push(x)}if(v){const h="parsing-order",x=$.getSeverity(h,v===2?"heading":"templateInTable");x&&o.push(ie(this,p,h,"header-in-html",x))}if(g[2]){const h=this.getRootNode().toString(),x=a.childNodes.filter(Qs("quote")),b=x.filter(({bold:y})=>y),m=x.filter(({italic:y})=>y);if(b.length%2){const y=X(b[b.length-1],{...p,start:n+u,left:p.left+u},k[2],N.msg("unbalanced-in-section-header","bold-apostrophes"),g[2]);if(_||T){const S=n+u+d.length,A=te(y);h.slice(y.endIndex,S).trim()?_&&(y.suggestions=[A,Ve(S,"'''")]):b.length===1&&m.length===0?y.fix=A:_&&(y.suggestions=[A])}o.push(y)}if(m.length%2){const y=X(m[m.length-1],{start:n+u},k[2],N.msg("unbalanced-in-section-header","italic-apostrophes"),g[2]);if(_||T){const S=n+u+d.length;h.slice(y.endIndex,S).trim()?_&&(y.suggestions=[Ve(S,"''")]):m.length===1&&b.length===0?y.fix=te(y):_&&(y.suggestions=[te(y)])}o.push(y)}}return o}}print(){const n=R(this,t,Es).call(this);return super.print({pre:n,sep:n})}json(n,r=this.getAbsoluteIndex()){const o=super.json(void 0,r);return o.level=this.level,o}},e=new WeakMap,t=new WeakSet,Es=function(){return"=".repeat(this.level)},i),wi=oe(el),yt=re(wi,0,"HeadingToken",Zr,yt),ne(wi,1,yt)}}),tl,yi,sl,Kt,Eu=I({"src/hidden.ts"(){"use strict";jt(),V(),tl=[ct()],Kt=class extends(sl=H){get type(){return"hidden"}getAttribute(e){return e==="invalid"||super.getAttribute(e)}},yi=oe(sl),Kt=re(yi,0,"HiddenToken",tl,Kt),ne(yi,1,Kt)}}),il,Si,nl,Yt,ju=I({"src/arg.ts"(){"use strict";var e,Go,s;fe(),K(),me(),Ye(),Ms(),qe(),G(),V(),Ke(),Eu(),il=[Be,We("{{{"),xs()],Yt=(s=class extends(nl=H){constructor(l,n,r=[]){super(void 0,n,r,{});P(this,e);for(let o=0;o<l.length;o++){const a=l[o];if(o===0){const u=new $e(a,"arg-name",n,r,{});super.insertAt(u)}else if(o>1){const u=new Kt(a,n,r);super.insertAt(u)}else{const u=new H(a,n,r);u.type="arg-default",u.setAttribute("stage",2),super.insertAt(u)}}}get type(){return"arg"}get default(){var l,n;return(n=(l=this.childNodes[1])==null?void 0:l.text())!=null?n:!1}toString(l){return`{{{${super.toString(l,"|")}}}}`}text(){return`{{{${dt(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){R(this,e,Go).call(this),super.afterBuild()}lint(l=this.getAbsoluteIndex(),n){{const{childNodes:[r,o,...a]}=this;r.setAttribute("aIndex",l+3);const u=r.lint(l+3,n);if(o){const v=l+4+r.toString().length;o.setAttribute("aIndex",v);const k=o.lint(v,n);k.length>0&&u.push(...k)}const d=["no-ignored","no-arg"],{lintConfig:c}=N,{computeEditInfo:f}=c,p=d.map(v=>c.getSeverity(v,"arg"));if(p[0]&&a.length>0){const v=new ce(this,l);u.push(...a.map(k=>{const $=X(k,v,d[0],"invisible-triple-braces",p[0]);return $.startIndex--,$.startCol--,f&&($.suggestions=[te($),Nt($.startIndex,"{{!}}")]),$}))}if(p[1]&&!this.getAttribute("include")){const v=ie(this,{start:l},d[1],"unexpected-argument",p[1]);f&&o&&(v.suggestions=[Re(v,"expand",o.text())]),u.push(v)}return u}}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(l,n=this.getAbsoluteIndex()){const r=super.json(void 0,n);return r.default=this.default,r}},e=new WeakSet,Go=function(){this.setAttribute("name",this.firstChild.text().trim())},s),Si=oe(nl),Yt=re(Si,0,"ArgToken",il,Yt),ne(Si,1,Yt)}}),Vo={};ae(Vo,{parseBraces:()=>Gs});var rl,Ai,ks,ki,$i,_i,ll,Ti,Gs,Xn=I({"parser/braces.ts"(){"use strict";Xe(),fe(),Do(),Fo(),ju(),rl={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},Ai=String.raw`\[(?!\[)`,ks=String.raw`\n(?![=\0])`,ki=String.raw`|\{{2,}`,$i=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),_i=at(e=>new RegExp(e,"gmu")),ll=new RegExp(String.raw`\{\{((?:[^\n{}[]|${Ai}|${ks})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${ks})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${Ai}|${ks})*\}-`,"gu"),Ti=e=>{const t=Ct(Te(e));return $i.has(t)?$i.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},Gs=(e,t,s)=>{var v,k,$,_,T;const i=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,l]}=t,n=[],r=[],o=(g,h,x,b)=>{h[h.length-1].push(Ee(g.slice(x,b),r))};let a;do a!==void 0&&(e=a),a=e.replace(ll,(g,h,x)=>{if(h!==void 0||typeof x=="string")try{const{length:b}=s,m=(h!=null?h:x).split("|");return new lt(Ee(m[0],r),m.slice(1).map(y=>{const S=y.indexOf("=");return(S===-1?[y]:[y.slice(0,S),y.slice(S+1)]).map(A=>Ee(A,r))}),t,s),`\0${b}${Ti(m[0])}`}catch(b){if(!(b instanceof SyntaxError)||b.message!=="Invalid template name")throw b}return r.push(Ee(g,r)),`\0${r.length-1}`});while(a!==e);e=a;const u=e.lastIndexOf("}}")-e.length;let d=u+e.length!==-1,c=_i(i+(d?ki:"")),f=c.exec(e),p;for(;f||p!==void 0&&p<=e.length&&((k=(v=n[n.length-1])==null?void 0:v[0])!=null&&k.startsWith("="));){if(f!=null&&f[1]){const[,{length:F}]=f;f[0]=f[0].slice(F),f.index+=F}const{0:g,index:h}=f!=null?f:{0:`
8
+ `,index:e.length},x=($=n.pop())!=null?$:{},{0:b,index:m,parts:y,findEqual:S,pos:A}=x,L=g==="="&&S;if(g==="]]"||g==="}-")p=h+2;else if(g===`
9
+ `){p=h+1;const{pos:F,findEqual:B}=(_=n[n.length-1])!=null?_:{};if(F===void 0||B||Te(e.slice(F,m))!==""){const O=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(e.slice(m,h));O&&(O[2]=Ee(O[2],r),O[2].includes(`
10
+ `)||(e=`${e.slice(0,m)}\0${s.length}h${e.slice(h)}`,p=m+4+String(s.length).length,new yt(O[1].length,O.slice(2),t,s)))}}else if(g==="|"||L)p=h+1,o(e,y,A,h),g==="|"&&y.push([]),x.pos=p,x.findEqual=g==="|",n.push(x);else if(g.startsWith("}}")){const F=g.slice(0,Math.min(b.length,3)),B=b.length-F.length,{length:O}=s;p=h+F.length,o(e,y,A,h);let E=!1,D="t";if(F.length===3){const W=y.map(z=>z.join("=")),q=W.length>1&&Te(W[1]).trim();new Yt(W,t,s),q&&q.endsWith(":")&&l.includes(q.slice(0,-1).toLowerCase())&&(D="s")}else try{new lt(y[0][0],y.slice(1),t,s),D=Ti(y[0][0])}catch(W){if(W instanceof SyntaxError&&W.message==="Invalid template name")E=!0;else throw W}E||(e=`${e.slice(0,m+B)}\0${O}${D}${e.slice(p)}`,p=m+B+3+String(O).length,B>1?n.push({0:b.slice(0,B),index:m,pos:m+B,parts:[[]]}):B===1&&e[m-1]==="-"&&n.push({0:"-{",index:m-1,pos:m+1,parts:[[]]}))}else p=h+g.length,g.startsWith("{")&&(f.pos=p,f.parts=[[]]),n.push(..."0"in x?[x]:[],f);let C=n[n.length-1];if(d&&u+e.length<p)for(d=!1;(T=C==null?void 0:C[0])!=null&&T.startsWith("{");)n.pop(),C=n[n.length-1];c=_i(i+(d?ki:"")+(C?`|${rl[C[0][0]]}${C.findEqual?"|=":""}`:"")),c.lastIndex=p,f=c.exec(e)}return Ee(e,r)}}}),Qo={};ae(Qo,{InputboxToken:()=>Jo});var Jo,Ru=I({"src/paramTag/inputbox.ts"(){"use strict";Vs(),Xn(),G(),Ho(),Jo=class extends wt{constructor(e,t,s=N.getConfig(),i=[]){const l=Symbol("InputboxToken"),n=s.excludes.includes("heading")?s:{...s,excludes:[...s.excludes,"heading"]},{length:r}=i;i.push(l),t&&(t=vs(t,n,i,e)),t&&(t=Gs(t,n,i)),i.splice(r,1),super(e,t,n,i,{})}}}}),js={};ae(js,{NestedToken:()=>Xo});var ol,al,Xo,Ci=I({"src/nested.ts"(){"use strict";var e,t,s;K(),me(),Vs(),Xn(),G(),V(),ga(),Ze(),ol=new Set(["comment","include","arg","template","magic-word"]),al=[!1,!0].map(i=>{const l=i?"includeonly":"noinclude";return new RegExp(String.raw`^(?:<${l}(?:\s[^>]*)?/?>|</${l}\s*>)$`,"iu")}),Xo=(s=class extends H{constructor(l,n,r,o,a=[]){if(typeof n=="boolean"){const u=Symbol("NestedToken"),{length:d}=a;a.push(u),l&&(l=vs(l,o,a,n)),l&&(l=Gs(l,o,a)),a.splice(d,1)}else l&&(l=l.replace(n,(u,d,c,f,p)=>{const v=`\0${a.length+1}e`;return new $t(d,c,f,p,o,!1,a),v}));l&&(l=l.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(u,d,c)=>(new xe(c,o,a),`${d}\0${a.length}n`)));super(l,o,a);P(this,e);P(this,t);j(this,e,[...r]),j(this,t,n)}get type(){return"ext-inner"}lint(l=this.getAbsoluteIndex(),n){{const r=super.lint(l,n),o="no-ignored",{lintConfig:a}=N,u=a.getSeverity(o,this.name);if(!u)return r;const d=new ce(this,l),c=typeof w(this,t)=="boolean"?al[w(this,t)?1:0]:/^<!--[\s\S]*-->$/u;return[...r,...this.childNodes.filter(f=>{const{type:p,name:v}=f;if(p==="ext")return!w(this,e).includes(v);if(ol.has(p))return!1;const k=f.toString().trim();return k&&!c.test(k)}).map(f=>{const p=X(f,d,o,N.msg("invalid-content",this.name),u);return a.computeEditInfo&&(p.suggestions=[te(p),On(p,f.toString())]),p})]}}},e=new WeakMap,t=new WeakMap,s)}});function ul(e,t,s,i,l){t=Te(t).trim();let n=t.replace(e==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(e){case"width":return!n&&!!t||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(n);case"link":{if(n){if(Ko(s.protocol).test(n))return Yo(s.protocol).test(n)&&t;n.startsWith("[[")&&n.endsWith("]]")&&(n=n.slice(2,-2))}else return t;const r=N.normalizeTitle(n,0,!1,s,{halfParsed:i,decode:!0,selfLink:!0});return r.valid&&r}case"lang":return(l==="svg"||l==="svgz")&&!/[^a-z\d-]/u.test(n);case"alt":case"class":case"manualthumb":return!0;case"page":return(l==="djvu"||l==="djv"||l==="pdf")&&Number(n)>0;default:return!!n&&!isNaN(n)}}var Ko,Yo,dl,cl,Zo,Pu=I({"src/imageParameter.ts"(){"use strict";var e,t,ea,l;Xe(),fe(),K(),Je(),G(),V(),Ko=at(n=>new RegExp(String.raw`^(?:${n}|//|\0\d+m\x7F)`,"iu")),Yo=at(n=>new RegExp(String.raw`^(?:(?:${n}|//)${_t}|\0\d+m\x7F)${Tt}$`,"iu")),dl=at(n=>new RegExp(String.raw`^(\s*(?!\s))${n.replace("$1","(.*)")}${n.endsWith("$1")?`(?=$|
11
+ )`:""}(\s*)$`,"u")),cl=new Set(["alt","link","lang","page","caption"]),Zo=(l=class extends H{constructor(r,o,a,u){var n=(...i)=>(super(...i),P(this,t),P(this,e,""),this);let d;const c=Object.entries(a.img).map(([p,v])=>[p,v,dl(p)]),f=c.find(([,p,v])=>(d=v.exec(r),d&&(d.length!==4||ul(p,d[2],a,!0,o)!==!1)));if(f&&d){d.length===3?(n(void 0,a,u),j(this,e,r)):(n(d[2],a,u,{}),j(this,e,d[1]+f[0]+d[3])),this.setAttribute("name",f[1]),f[1]==="alt"&&this.setAttribute("stage",ke-1);return}n(r,a.excludes.includes("list")?a:{...a,excludes:[...a.excludes,"list"]},u),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get type(){return"image-parameter"}get link(){return this.name==="link"?ul("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var r;(r=this.parentNode)!=null&&r.is("gallery-image")&&!cl.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(r){return w(this,e)?w(this,e).replace("$1",super.toString(r)):super.toString(r)}text(){return w(this,e)?w(this,e).replace("$1",super.text()).trim():super.text().trim()}isPlain(){return this.name==="caption"||this.name==="alt"}getAttribute(r){return r==="invalid"?this.name==="invalid":r==="padding"?Math.max(0,w(this,e).indexOf("$1")):super.getAttribute(r)}lint(r=this.getAbsoluteIndex(),o){{const a=super.lint(r,o),{lintConfig:u}=N,{computeEditInfo:d,fix:c}=u,{link:f,name:p}=this;if(p==="invalid"){const v="invalid-gallery",k=u.getSeverity(v,"parameter");if(k){const $=ie(this,{start:r},v,"invalid-image-parameter",k);(d||c)&&($.fix=te($,-1)),a.push($)}}else if(typeof f=="object"&&f.encoded){const v="url-encoding",k=u.getSeverity(v,"file");if(k){const $=ie(this,{start:r},v,"unnecessary-encoding",k);(d||c)&&($.fix=Rn($,this)),a.push($)}}return a}}getValue(){return this.name==="invalid"?this.text():R(this,t,ea).call(this)||super.text()}print(){return w(this,e)?`<span class="wpb-image-parameter${this.name==="invalid"?" wpb-invalid":""}">${w(this,e).replace("$1",`<span class="wpb-image-caption">${It(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}},e=new WeakMap,t=new WeakSet,ea=function(){return w(this,e)&&!w(this,e).includes("$1")},l)}}),Ii,hl,gl,Ni,Li,Fi,pl,Ei,Kn,ta=I({"src/link/file.ts"(){"use strict";K(),me(),G(),Us(),Pu(),Ii=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),hl=new Set(["arg"]),gl=new Set(["template","magic-word"]),Ni=new Set(["left","right","center","none"]),Li=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),Fi=new Set(["tiff","tif","png","gif","jpg","jpeg","webp","xcf","pdf","svg","djvu"]),pl=e=>{if(e===void 0)return[];const t=/-\{|\}-|\|/gu,s=[];let i=t.exec(e),l=0,n=0;for(;i;){const{0:r,index:o}=i;r!=="|"?l+=r==="-{"?1:-1:l===0&&(s.push(e.slice(n,o)),{lastIndex:n}=t),i=t.exec(e)}return s.push(e.slice(n)),s},Ei=(e,t)=>e.filter(({childNodes:s})=>{const i=s.filter(l=>l.text().trim());return i.length!==1||!t.has(i[0].type)}),Kn=class extends De{get type(){return"file"}get extension(){return this.getAttribute("title").extension}constructor(e,t,s,i=[],l="|"){super(e,void 0,s,i,l);const{extension:n}=this.getTitle(!0,!0);this.safeAppend(pl(t).map(r=>new Zo(r,n,s,i)))}lint(e=this.getAbsoluteIndex(),t){var s;{const i=super.lint(e,t),l=Ei(this.getAllArgs(),hl),n=[...new Set(l.map(({name:b})=>b))],r=n.filter(b=>Ii.has(b)),o=n.filter(b=>Ni.has(b)),a=n.filter(b=>Li.has(b)),[u]=r,d=u==="framed"||u==="manualthumb",c=new ce(this,e),{lintConfig:f}=N,{computeEditInfo:p,fix:v}=f,{ns:k,extension:$}=this.getAttribute("title"),{firstChild:_}=this;let T="nested-link",g=f.getSeverity(T,"file");if(g&&Fi.has($)&&this.closest("ext-link-text")&&((s=this.getValue("link"))==null?void 0:s.trim())!==""){const b=ie(this,c,T,"link-in-extlink",g);if(p||v){const m=this.getArg("link");if(m){const y=e+m.getRelativeIndex();b.fix={desc:N.msg("delink"),range:[y,y+m.toString().length],text:"link="}}else b.fix=qs(b.endIndex-2,"delink","|link=")}i.push(b)}if(T="invalid-gallery",g=f.getSeverity(T,"extension"),g&&k===6&&!$&&!_.querySelector("arg,magic-word,template")&&i.push(ie(this,c,T,"missing-extension",g)),g=f.getSeverity(T,"parameter"),g&&d)for(const b of l.filter(({name:m})=>m==="width")){const m=X(b,c,T,"invalid-image-parameter",g);(p||v)&&(m.fix=te(m,-1)),i.push(m)}if(l.length===n.length&&r.length<2&&o.length<2&&a.length<2)return i;T="no-duplicate";const h=["unknownImageParameter","imageParameter"].map(b=>f.getSeverity(T,b)),x=(b,m,y,S=!0)=>b.map(A=>{if(g=h[Number(typeof S=="function"?S(A):S)],!g)return!1;const L=X(A,c,T,N.msg(`${m}-image-parameter`,y),g);return p&&(L.suggestions=[te(L,-1)]),L}).filter(A=>A!==!1);for(const b of n){if(b==="invalid"||b==="width"&&d)continue;const m=b==="caption";let y=l.filter(({name:S})=>S===b);if(m&&(y=[...y.slice(0,-1).filter(S=>S.text()),...y.slice(-1)]),y.length>1){let S=!m||!$||Fi.has($);if(m&&S){const A=Ei(y,gl);S=A.length>1&&(L=>A.includes(L))}i.push(...x(y,"duplicate",b,S))}}return r.length>1&&i.push(...x(l.filter(({name:b})=>Ii.has(b)),"conflicting","frame")),o.length>1&&i.push(...x(l.filter(({name:b})=>Ni.has(b)),"conflicting","horizontal-alignment")),a.length>1&&i.push(...x(l.filter(({name:b})=>Li.has(b)),"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);{const{extension:i}=this;return i&&(s.extension=i),s}}}}}),fl,ji,ml,St,sa=I({"src/link/galleryImage.ts"(){"use strict";var e,bn,s;K(),Je(),Ye(),G(),V(),ta(),fl=[We("")],St=(s=class extends(ml=Kn){constructor(l,n,r,o,a=[]){let u;if(r!==void 0){const{length:d}=a;u=new H(r,o,a);for(let c=0;c<ke-1;c++)u.parseOnce();a.splice(d,1)}super(n,u==null?void 0:u.toString(),o,a);P(this,e);Le(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=`${l}-image`,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(l){const n=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),n?0:6,{halfParsed:!0,temporary:l,decode:!n})}lint(l=this.getAbsoluteIndex(),n){{const r=super.lint(l,n),o="invalid-gallery",{lintConfig:a}=N,u=a.getSeverity(o,"image");if(u&&R(this,e,bn).call(this)){const d=ie(this,{start:l},o,"invalid-gallery",u);a.computeEditInfo&&(d.suggestions=[qs(l,"prefix","File:")]),r.push(d)}return r}}getAttribute(l){return l==="invalid"?R(this,e,bn).call(this):super.getAttribute(l)}},e=new WeakSet,bn=function(){const{ns:l}=this.getAttribute("title");return l!==6},s),ji=oe(ml),St=re(ji,0,"GalleryImageToken",fl,St),ne(ji,1,St)}}),ia={};ae(ia,{GalleryToken:()=>Zt});var xl,Ri,vl,Zt,Ou=I({"src/gallery.ts"(){"use strict";var e,na,wn,i;K(),Jn(),G(),V(),sa(),Ze(),xl=[Ds],Zt=(i=class extends(vl=H){constructor(n,r,o=[]){var a;super(void 0,r,o,{});P(this,e);for(const u of(a=n==null?void 0:n.split(`
12
+ `))!=null?a:[]){const d=/^([^|]+)(?:\|(.*))?/u.exec(u);if(!d){super.insertAt(u.trim()?new xe(u,r,o):u);continue}const[,c,f]=d;R(this,e,na).call(this,c)?super.insertAt(new St("gallery",c,f,r,o)):super.insertAt(new xe(u,r,o))}}get type(){return"ext-inner"}get widths(){return R(this,e,wn).call(this,"widths")}get heights(){return R(this,e,wn).call(this,"heights")}lint(n=this.getAbsoluteIndex(),r){{const{top:o,left:a}=this.getRootNode().posFromIndex(n),u=[],d="no-ignored",{lintConfig:c}=N,f=["Image","NoImage","Comment"].map(p=>c.getSeverity(d,`gallery${p}`));for(let p=0;p<this.length;p++){const v=this.childNodes[p],k=v.toString(),{length:$}=k,_=k.trim(),{type:T}=v,g=o+p,h=p?0:a;if(v.setAttribute("aIndex",n),T==="noinclude"&&_&&!/^<!--.*-->$/u.test(_)){let[x]=f;if(_.startsWith("|")?[,x]=f:(_.startsWith("<!--")||_.endsWith("-->"))&&([,,x]=f),x){const b=n+$,m={rule:d,message:N.msg("invalid-content","gallery"),severity:x,startIndex:n,endIndex:b,startLine:g,endLine:g,startCol:h,endCol:h+$};c.computeEditInfo&&(m.suggestions=[te(m),On(m,k)]),u.push(m)}}else if(T!=="noinclude"&&T!=="text"){const x=v.lint(n,r);x.length>0&&u.push(...x)}n+=$+1}return u}}json(n,r=this.getAbsoluteIndex()){const o=super.json(void 0,r);return Object.assign(o,{widths:this.widths,heights:this.heights}),o}},e=new WeakSet,na=function(n){return this.normalizeTitle(n,6,{halfParsed:!0,temporary:!0,decode:!0}).valid},wn=function(n){var r,o;{const a=(r=this.parentNode)==null?void 0:r.getAttr(n),u=typeof a=="string"&&((o=/^(\d+)\s*(?:px)?$/u.exec(a))==null?void 0:o[1]);return u&&Number(u)||120}},i),Ri=oe(vl),Zt=re(Ri,0,"GalleryToken",xl,Zt),ne(Ri,1,Zt)}}),Yn,ra=I({"src/link/index.ts"(){"use strict";Xe(),K(),G(),Us(),Yn=class extends De{get type(){return"link"}get innerText(){return this.length>1?this.lastChild.text():hs(this.firstChild.text().replace(/^\s*:?/u,""))}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i="nested-link",{lintConfig:l}=N,n=l.getSeverity(i);if(n&&this.closest("ext-link-text")){const r=ie(this,{start:e},i,"link-in-extlink",n);(l.computeEditInfo||l.fix)&&(r.fix=Re(r,"delink",this.innerText)),s.push(r)}return s}}}}}),bl,wl,fs,Zn=I({"src/magicLink.ts"(){"use strict";var e,t,yn,i;K(),fe(),me(),G(),V(),bl=String.raw`(?:[${Ge}\t]|&nbsp;|&#0*160;|&#[xX]0*[aA]0;)`,wl=new RegExp(`${bl}+`,"gu"),fs=(i=class extends H{constructor(n,r="free-ext-link",o=N.getConfig(),a){super(n,o,a,{});P(this,t);P(this,e);j(this,e,r)}get type(){return w(this,e)}get innerText(){const n=new Map([["!","|"],["=","="]]);let r=dt(this.childNodes.map(o=>{const{type:a}=o,u=String(o.name);return a==="magic-word"&&n.has(u)?n.get(u):o}));return this.type==="magic-link"&&(r=r.replace(wl," ")),r}get link(){const{innerText:n}=this;return this.type==="magic-link"?n.startsWith("ISBN")?`ISBN ${n.slice(5).replace(/[- ]/gu,"").replace(/x$/u,"X")}`:n:yo(n).replace(/\n/gu,"%0A")}lint(n=this.getAbsoluteIndex(),r){{const o=super.lint(n,r),a=new ce(this,n),{lintConfig:u}=N,{type:d,childNodes:c}=this;if(d==="magic-link"){const k="invalid-isbn",$=u.getSeverity(k);return $&&R(this,t,yn).call(this)&&o.push(ie(this,a,k,"invalid-isbn",$)),o}const f=d==="ext-link-url",p="unterminated-url",v=u.getSeverity(p,f?"pipe":"punctuation");if(v){const k=f?/\|/u:/[,;。:!?()]+/u,$=c.find(_=>_.type==="text"&&k.test(_.data));if($){const{data:_}=$,T=X($,a,p,N.msg("in-url",f?'"|"':"full-width-punctuation"),v);if(u.computeEditInfo){const{index:g,0:h}=k.exec(_),x=T.startIndex+g;T.suggestions=f?[ps(x,1)]:[ps(x),{desc:N.msg("encode"),range:[x,x+h.length],text:encodeURI(h)}]}o.push(T)}}return o}}getUrl(n){{const{type:r}=this;let{link:o}=this;if(r==="magic-link"){if(o.startsWith("ISBN"))return this.normalizeTitle(`BookSources/${o.slice(5)}`,-1,{temporary:!0}).getUrl(n);o=o.startsWith("RFC")?`https://datatracker.ietf.org/doc/html/rfc${o.slice(4)}`:`https://pubmed.ncbi.nlm.nih.gov/${o.slice(5)}`}else o.startsWith("//")&&(o=`https:${o}`);return new URL(o)}this.lspError("MagicLinkToken.getUrl")}getAttribute(n){return n==="invalid"?R(this,t,yn).call(this):super.getAttribute(n)}},e=new WeakMap,t=new WeakSet,yn=function(){if(this.type==="magic-link"){const{link:n}=this;if(n.startsWith("ISBN")){const r=[...n.slice(5)].map(o=>o==="X"?10:Number(o));return r.length===10?r.reduce((o,a,u)=>o+a*(10-u),0)%11!==0:r.length===13&&(r[12]===10||r.reduce((o,a,u)=>o+a*(u%2?3:1),0)%10!==0)}}return!1},i)}}),yl,Pi,Sl,At,la=I({"src/extLink.ts"(){"use strict";var e,t;Je(),K(),Ye(),G(),V(),Zn(),yl=[We("[")],At=(t=class extends(Sl=H){constructor(i,l="",n="",r,o=[]){super(void 0,r,o,{});P(this,e);const a=i&&/^\0\d+f\x7F$/u.test(i)?o[Number(i.slice(1,-2))]:new fs(i,"ext-link-url",r,o);if(this.insertAt(a),j(this,e,l),n){const u=new H(n,r,o,{});u.type="ext-link-text",u.setAttribute("stage",ke-1),this.insertAt(u)}}get type(){return"ext-link"}toString(i){return this.length===1?`[${super.toString(i)}${w(this,e)}]`:`[${super.toString(i,w(this,e))}]`}text(){return`[${super.text(" ")}]`}getGaps(){return w(this,e).length}lint(i=this.getAbsoluteIndex(),l){{const n=super.lint(i,l),r="var-anchor",o=N.lintConfig.getSeverity(r,"extLink");return o&&this.length===1&&this.closest("heading-title")&&n.push(ie(this,{start:i},r,"variable-anchor",o)),n}}print(){return super.print(this.length===1?{pre:"[",post:`${w(this,e)}]`}:{pre:"[",sep:w(this,e),post:"]"})}},e=new WeakMap,t),Pi=oe(Sl),At=re(Pi,0,"ExtLinkToken",yl,At),ne(Pi,1,At)}}),Sn,Bu=I({"src/imagemapLink.ts"(){"use strict";V(),Ze(),ra(),la(),Sn=class extends H{get type(){return"imagemap-link"}constructor(e,t,s,i,l=[]){super(void 0,i,l),this.append(e,t.length===2?new Yn(...t,i,l):new At(...t,i,l),new xe(s,i,l))}}}}),oa={};ae(oa,{ImagemapToken:()=>es});var Al,Oi,kl,es,qu=I({"src/imagemap.ts"(){"use strict";K(),Oe(),me(),Jn(),G(),V(),Ze(),sa(),Bu(),Al=[Ds],es=class extends(kl=H){get type(){return"ext-inner"}get image(){return this.childNodes.find(Qs("imagemap-image"))}constructor(e,t=N.getConfig(),s=[]){if(super(void 0,t,s,{}),!e)return;const i=e.split(`
13
+ `),l=new Set(t.protocol.split("|")),n=xe;let r=!0,o=!1;for(const a of i){const u=a.trim();if(!(o||!u||u.startsWith("#"))){if(r){const d=a.indexOf("|"),c=d===-1?a:a.slice(0,d),{valid:f,ns:p}=this.normalizeTitle(c,0,{halfParsed:!0,temporary:!0});if(f&&p===6){const v=new St("imagemap",c,d===-1?void 0:a.slice(d+1),t,s);super.insertAt(v),r=!1;continue}else o=!0}else if(a.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(a);continue}else if(a.includes("[")){const d=a.indexOf("["),c=a.slice(d),f=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(c);if(f){if(this.normalizeTitle(f[1],0,{halfParsed:!0,temporary:!0,selfLink:!0}).valid){super.insertAt(new Sn(a.slice(0,d),f.slice(1),c.slice(c.indexOf("]]")+2),t,s));continue}}else if(c.startsWith("[//")||l.has(c.slice(1,c.indexOf(":")+1))||l.has(c.slice(1,c.indexOf("//")+2))){const p=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(c);if(p){super.insertAt(new Sn(a.slice(0,d),p.slice(1),c.slice(c.indexOf("]")+1),t,s));continue}}}}super.insertAt(new n(a,t,s))}}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new ce(this,e),{childNodes:l,image:n}=this,r="invalid-imagemap",{lintConfig:o}=N,a=o.getSeverity(r,n?"link":"image");return a&&(n?s.push(...l.filter(u=>{const d=u.toString().trim();return u.is("noinclude")&&d&&!d.startsWith("#")}).map(u=>{const d=X(u,i,r,"invalid-imagemap-link",a);return o.computeEditInfo&&(d.suggestions=[te(d,-1),Re(d,"comment","# ")]),d})):s.push(ie(this,i,r,"imagemap-without-image",a))),s}}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}},Oi=oe(kl),es=re(Oi,0,"ImagemapToken",Al,es),ne(Oi,1,es)}}),$l,Bi,_l,kt,aa=I({"src/nowiki/comment.ts"(){"use strict";K(),jt(),Ye(),G(),ht(),$l=[ct(!1),We("<!--")],kt=class extends(_l=Pe){constructor(t,s,i,l){super(t,i,l);Le(this,"closed");this.closed=s}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){{if(this.closed)return[];const s="unclosed-comment",{lintConfig:i}=N,l=i.getSeverity(s);if(!l)return[];const n=ie(this,{start:t},s,"unclosed-comment",l);return i.computeEditInfo&&(n.suggestions=[Ve(n.endIndex,"-->")]),[n]}}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"&lt;!--",post:this.closed?"--&gt;":""})}},Bi=oe(_l),kt=re(Bi,0,"CommentToken",$l,kt),ne(Bi,1,kt)}}),ua={};ae(ua,{CommentedToken:()=>da});var da,Wu=I({"src/commented.ts"(){"use strict";V(),aa(),da=class extends H{get type(){return"ext-inner"}constructor(e,t,s=[]){if(super(void 0,t,s,{AstText:":",CommentToken:":"}),e){let i=e.indexOf("<!--"),l=i!==-1&&e.indexOf("-->",i+4),n=0;for(;l!==!1&&l!==-1;)i>n&&this.insertAt(e.slice(n,i)),this.insertAt(new kt(e.slice(i+4,l),!0,t,s)),n=l+3,i=e.indexOf("<!--",n),l=i!==-1&&e.indexOf("-->",i+4);n<e.length&&this.insertAt(e.slice(n))}}lint(e=this.getAbsoluteIndex()){return super.lint(e,new RegExp(String.raw`<\s*(?:\/\s*)?(${this.name})\b`,"giu"))}}}}),ca={};ae(ca,{NowikiToken:()=>ha});var Tl,Cl,ha,Mu=I({"src/nowiki/index.ts"(){"use strict";var e,An,s;Xe(),K(),G(),ht(),Tl=at(i=>new RegExp(String.raw`<\s*(?:/\s*)${i==="nowiki"?"":"?"}(${i})\b`,"giu")),Cl=new Set(["languages","section","templatestyles"]),ha=(s=class extends Pe{constructor(){super(...arguments);P(this,e)}get type(){return"ext-inner"}lint(l=this.getAbsoluteIndex()){{const{name:n}=this,r="void-ext",{lintConfig:o}=N,a=o.getSeverity(r,n);if(a&&R(this,e,An).call(this)){const u=ie(this,{start:l},r,N.msg("nothing-in",n),a);return o.computeEditInfo&&(u.suggestions=[te(u)]),[u]}return super.lint(l,Tl(n))}}getAttribute(l){return l==="invalid"?R(this,e,An).call(this):super.getAttribute(l)}},e=new WeakSet,An=function(){const{name:l,firstChild:{data:n}}=this;return Cl.has(l)&&!!n},s)}}),Il,qi,Nl,$t,ga=I({"src/tagPair/ext.ts"(){"use strict";K(),me(),G(),Hn(),V(),zn(),Qn(),Il=[zs()],$t=class extends(Nl=ot){get type(){return"ext"}constructor(e,t,s,i,l=N.getConfig(),n=!1,r=[]){const o=e.toLowerCase(),a=new Hs(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",o,l,r),u={...l,ext:l.ext.filter(c=>c!==o),excludes:[...l.excludes],inExt:!0};let d;switch(o){case"tab":u.ext=u.ext.filter(c=>c!=="tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":o==="poem"&&u.excludes.push("heading"),d=new H(s,u,r);break;case"pre":{const{PreToken:c}=(Fu(),ee(Mo));d=new c(s,u,r);break}case"dynamicpagelist":{const{ParamTagToken:c}=(Ho(),ee(zo));d=new c(n,s,u,r);break}case"inputbox":{const{InputboxToken:c}=(Ru(),ee(Qo));d=new c(n,s,u,r);break}case"references":{const{NestedToken:c}=(Ci(),ee(js));u.excludes.push("heading"),d=new c(s,n,["ref"],u,r);break}case"choose":{const{NestedToken:c}=(Ci(),ee(js));d=new c(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],u,r);break}case"combobox":{const{NestedToken:c}=(Ci(),ee(js));d=new c(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],u,r);break}case"gallery":{const{GalleryToken:c}=(Ou(),ee(ia));d=new c(s,u,r);break}case"imagemap":{const{ImagemapToken:c}=(qu(),ee(oa));d=new c(s,u,r);break}case"hiero":{const{CommentedToken:c}=(Wu(),ee(ua));d=new c(s,u,r);break}default:{const{NowikiToken:c}=(Mu(),ee(ca));d=new c(s,u,r)}}d.setAttribute("name",o),d.type==="plain"&&(d.type="ext-inner"),super(e,a,d,i,l,r),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),{lintConfig:i}=N,l=new ce(this,e);if(this.name!=="nowiki"){const o=this.inHtmlAttrs(),a="parsing-order",u=o&&i.getSeverity(a,o===2?"ext":"templateInTable");u&&s.push(ie(this,l,a,"ext-in-html",u))}const n="var-anchor",r=i.getSeverity(n,"ref");return r&&this.name==="ref"&&this.closest("heading-title")&&s.push(ie(this,l,n,"variable-anchor",r)),s}}},qi=oe(Nl),$t=re(qi,0,"ExtToken",Il,$t),ne(qi,1,$t)}}),pa={};ae(pa,{parseCommentAndExt:()=>vs});var Wi,Ll,$s,Fl,Mi,vs,Vs=I({"parser/commentAndExt.ts"(){"use strict";Xe(),fe(),Cu(),Ze(),Iu(),Nu(),ga(),aa(),Wi="<onlyinclude>",Ll="</onlyinclude>",{length:$s}=Wi,Fl=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",s=e?"noinclude":"includeonly";return $o(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"))}),Mi=e=>{const t=e.indexOf(Wi);return{i:t,j:e.indexOf(Ll,t+$s)}},vs=(e,t,s,i)=>{if(i){let{i:o,j:a}=Mi(e);if(o!==-1&&a!==-1){let u="";const d=c=>{new xe(c,t,s),u+=`\0${s.length-1}n`};for(;o!==-1&&a!==-1;){const c=`\0${s.length}e`;new Jt(e.slice(o+$s,a),t,s),o>0&&d(e.slice(0,o)),u+=c,e=e.slice(a+$s+1),{i:o,j:a}=Mi(e)}return e&&d(e),u}}const{ext:l}=t,n=l.filter(o=>o!=="translate"&&o!=="tvar"),r={...t,ext:n};if(l.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,u,d)=>{const c=s.length;return new Oo(u,d&&Ee(d,o),r,s),`\0${c}g`}),e=Ee(e,o)}return e.replace(Fl[i?1:0](n),(o,a,u,d,c,f,p,v,k)=>{const $=s.length;let _="n";if(a)_="e",new $t(a,u,d,c,r,f,s);else if(o.startsWith("<!--")){_="c";const T=o.endsWith("-->");new kt(Ee(o,s,1).slice(4,T?-3:void 0),T,t,s)}else f?new Xt(f,p&&Ee(p,s,1),v&&Ee(v,s,1),k,t,s):new xe(o,t,s);return`\0${$}${_}`})}}}),El,jl,Rl,Pl,Ui,Ol,ts,Uu=I({"src/html.ts"(){"use strict";var e,t,s,i,l;K(),Oe(),me(),Hn(),G(),V(),El=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),jl=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"]),Rl=new Set(["strike","big","center","font","tt"]),Pl=[zs()],ts=(l=class extends(Ol=H){constructor(r,o,a,u,d,c){super(void 0,d,c);P(this,e);P(this,t);P(this,s);P(this,i);this.insertAt(o),this.setAttribute("name",r.toLowerCase()),j(this,e,a),j(this,t,u),j(this,s,r)}get type(){return"html"}get selfClosing(){return w(this,t)}get closing(){return w(this,e)}toString(r){return`<${this.closing?"/":""}${w(this,s)}${super.toString(r)}${w(this,t)?"/":""}>`}text(){const{closing:r}=this,o=w(this,s)+(r?"":super.text());return`<${r?"/":""}${o}${w(this,t)?"/":""}>`}getAttribute(r){return r==="invalid"?this.inTableAttrs()===2:r==="padding"?w(this,s).length+(this.closing?2:1):super.getAttribute(r)}lint(r=this.getAbsoluteIndex(),o){var a;{const u=super.lint(r,o),{name:d,parentNode:c,closing:f,selfClosing:p}=this,v=new ce(this,r),{lintConfig:k}=N,{computeEditInfo:$,fix:_}=k,T=this.inTableAttrs();let g="h1",h=k.getSeverity(g,"html");if(h&&d==="h1"&&!f){const A=ie(this,v,g,"<h1>",h);$&&(A.suggestions=[{desc:"h2",range:[r+2,r+3],text:"2"}]),u.push(A)}if(g="parsing-order",h=T&&k.getSeverity(g,T===2?"html":"templateInTable"),h){const A=ie(this,v,g,"html-in-table",h);$&&T===2&&(A.suggestions=[te(A)]),u.push(A)}if(g="obsolete-tag",h=k.getSeverity(g,d),h&&Rl.has(d)&&u.push(ie(this,v,g,"obsolete-tag",h)),g="bold-header",h=k.getSeverity(g,d),h&&(d==="b"||d==="strong")&&((a=this.closest("heading-title,ext"))==null?void 0:a.type)==="heading-title"){const A=ie(this,v,g,"bold-in-header",h);$&&(A.suggestions=[te(A)]),u.push(A)}const{html:[,x,b]}=this.getAttribute("config"),m=b.includes(d),y=x.includes(d),S=!m&&!y;if(g="unmatched-tag",f&&(p||m)||p&&S){if(h=k.getSeverity(g,f?"both":"selfClosing"),h){const A=ie(this,v,g,f?"closing-and-self-closing":"invalid-self-closing",h);if($||_){const L=Pn(r),C={desc:N.msg("no-self-closing"),range:[A.endIndex-2,A.endIndex-1],text:""};y?$&&(A.suggestions=[L,C]):f?A.fix=m?L:C:$&&(A.suggestions=[C,Ve(A.endIndex,`></${d}>`,-2)])}u.push(A)}}else if(!this.findMatchingTag()){const A=ie(this,v,g,f?"unmatched-closing":"unclosed-tag"),L=this.closest("magic-word");if(L&&El.has(L.name))h=k.getSeverity(g,"conditional");else if(f)h=k.getSeverity(g,"closing"),A.suggestions=[te(A)];else{h=k.getSeverity(g,"opening");const C=c==null?void 0:c.childNodes;jl.has(d)&&(C!=null&&C.slice(0,C.indexOf(this)).some(F=>F.type==="html"&&F.name===d&&!F.findMatchingTag())&&(A.suggestions=[Ve(r+1,"/")]),this.closest("heading-title")&&(A.rule="format-leakage",h=k.getSeverity("format-leakage",d)))}h&&(A.severity=h,u.push(A))}return u}}findMatchingTag(){return ut(w(this,i),()=>{const{name:r,parentNode:o,closing:a,selfClosing:u}=this,{html:[,d,c]}=this.getAttribute("config"),f=c.includes(r),p=d.includes(r);if(f||p&&u)return this;if(!o)return;const{childNodes:v}=o,k=v.indexOf(this),$=a?v.slice(0,k).reverse():v.slice(k+1),_=[this],{rev:T}=we;for(const g of $)if(!(!g.is("html")||g.name!==r||p&&w(g,t)))if(w(g,e)===a)_.push(g);else{const h=_.pop();if(h===this)return g;N.viewOnly&&(j(h,i,[T,g]),j(g,i,[T,h]))}if(N.viewOnly)for(const g of _)j(g,i,[T,void 0])},r=>{j(this,i,r),r[1]&&r[1]!==this&&j(r[1],i,[we.rev,this])})}print(){return super.print({pre:`&lt;${this.closing?"/":""}${w(this,s)}`,post:`${w(this,t)?"/":""}&gt;`})}json(r,o=this.getAbsoluteIndex()){const a=super.json(void 0,o);return Object.assign(a,{closing:this.closing,selfClosing:w(this,t)}),a}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,l),Ui=oe(Ol),ts=re(Ui,0,"HtmlToken",Pl,ts),ne(Ui,1,ts)}}),fa={};ae(fa,{parseHtml:()=>ma});var Bl,ma,zu=I({"parser/html.ts"(){"use strict";Qn(),Uu(),Bl=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,ma=(e,t,s)=>{var r;const{html:i}=t;(r=t.htmlElements)!=null||(t.htmlElements=new Set([...i[0],...i[1],...i[2]]));const l=e.split("<");let n=l.shift();for(const o of l){const a=Bl.exec(o),u=a==null?void 0:a[2],d=u==null?void 0:u.toLowerCase();if(!a||!t.htmlElements.has(d)){n+=`<${o}`;continue}const[,c,,f="",p,v]=a,{length:k}=s,$=new Hs(f,"html-attrs",d,t,s),_=$.hasAttr("itemprop");if(d==="meta"&&!(_&&$.hasAttr("content"))||d==="link"&&!(_&&$.hasAttr("href"))){n+=`<${o}`,s.length=k;continue}n+=`\0${s.length}x${v}`,new ts(u,$,c==="/",p==="/>",t,s)}return n}}}),ql,er,xa=I({"src/table/base.ts"(){"use strict";Hn(),G(),V(),Et(),Qn(),ql=e=>{const t=e.childNodes.map(i=>i.type==="text"?i.data.replace(/\|\|/gu,"{{!!}}").replace(/\|/gu,"{{!}}"):i.toString()).join(""),{childNodes:s}=N.parse(t,e.getAttribute("include"),2,e.getAttribute("config"));e.safeReplaceChildren(s)},er=class extends zs(1)(H){constructor(e,t,s,i,l,n=[],r){super(void 0,l,n,r),this.append(new Qe(t,"table-syntax",l,n),new Hs(i,"table-attrs",s,l,n))}escape(){for(const e of this.childNodes)e instanceof Qe?ql(e):e.escape()}}}}),Wl,zi,Ae,_s,Ut,zt,Bs,va=I({"src/table/td.ts"(){"use strict";K(),me(),Un(),G(),V(),xa(),Bs=class extends(zi=er,Wl=[Ws(!1)],zi){constructor(e,t,s,i=[]){var o;let l=/\||\0\d+!\x7F/u.exec(t!=null?t:""),n=l?t.slice(0,l.index):"";/\[\[|-\{/u.test(n)&&(l=null,n=""),super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",n,s,i),ne(_s,5,this),He(this,Ut),He(this,Ae,""),l&&([xu(this,Ae)._]=l);const r=new H(t==null?void 0:t.slice(((o=l==null?void 0:l.index)!=null?o:NaN)+pe(this,Ae).length),s,i);r.type="td-inner",r.setAttribute("stage",4),this.insertAt(r)}get type(){return"td"}get rowspan(){return this.getAttr("rowspan")}get colspan(){return this.getAttr("colspan")}get subtype(){return cn(this,Ut,zt).call(this).subtype}afterBuild(){pe(this,Ae).includes("\0")&&_e(this,Ae,this.buildFromStr(pe(this,Ae),0)),super.afterBuild()}toString(e){const{childNodes:[t,s,i]}=this;return t.toString(e)+s.toString(e)+pe(this,Ae)+i.toString(e)}text(){const{childNodes:[e,t,s]}=this;return e.text()+t.text()+pe(this,Ae)+s.text()}getGaps(e){return e===1?pe(this,Ae).length:0}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new ce(this,e+this.getRelativeIndex(this.length-1)),l="pipe-like",{lintConfig:n}=N,{computeEditInfo:r,fix:o}=n,a=["td","double"].map(u=>n.getSeverity(l,u));for(const u of this.lastChild.childNodes)if(u.type==="text"){const{data:d}=u;if(d.includes("|")){const c=d.includes("||"),f=a[c?1:0];if(f){const p=X(u,i,l,"pipe-in-table",f);if(r||o)if(c){const v={caption:"|+",td:"|",th:"!"}[this.subtype];p.fix=Re(p,"newline",d.replace(/\|\|/gu,`
14
+ ${v}`))}else r&&(p.suggestions=[qn(p.startIndex,d)]);s.push(p)}}}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(){super.escape(),this.childNodes[1].toString()&&(pe(this,Ae)||_e(this,Ae,"{{!}}")),pe(this,Ae)==="|"&&_e(this,Ae,"{{!}}")}print(){const{childNodes:[e,t,s]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${pe(this,Ae)}${s.print()}</span>`}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t);{const{rowspan:i,colspan:l}=this;return Object.assign(s,{subtype:this.subtype},i!==1&&{rowspan:i},l!==1&&{colspan:l}),s}}},_s=oe(zi),Ae=new WeakMap,Ut=new WeakSet,zt=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:l}=this;return{...cn(e=l,Ut,zt).call(e)}},zt=re(_s,17,"#getSyntax",Wl,Ut,zt),Fn(_s,Bs)}}),tr,ba=I({"src/table/trBase.ts"(){"use strict";K(),G(),xa(),va(),tr=class extends er{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 l=ls(i),n="fostered-content",r=l&&N.lintConfig.getSeverity(n,l===2?void 0:"transclusion");if(r){const o=X(i,{start:e},n,"content-outside-table",r);o.startIndex++,o.startLine++,o.startCol=0,s.push(o)}return s}}getRowCount(){return Number(this.childNodes.some(e=>e instanceof Bs&&e.isIndependent()&&!e.firstChild.text().endsWith("+")))}}}}),Ml,Ul,zl,Hl,Hi,Ts,Rs,Hu=I({"src/table/index.ts"(){"use strict";K(),Oe(),me(),Un(),G(),ba(),Et(),Ml=(e,t)=>new Array(e).fill(void 0).map((s,i)=>t(i)),Ul=({type:e})=>e==="tr"||e==="table-syntax",zl=class extends Array{},Rs=class extends(Hi=tr,Hl=[Ws(!1)],Hi){constructor(e,t,s,i){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,"table",t,s,i,{}),ne(Ts,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 ce(this,e),l=["unclosed-table","table-layout"],n=l.map(r=>N.lintConfig.getSeverity(r));if(n[0]&&!this.closed&&s.push(X(this.firstChild,i,l[0],"unclosed-table",n[0])),n[1]){const r=this.getLayout(),{length:o}=r;if(o>1){let a=1,u=1/0,d=0;for(;d<o;d++){const c=r[d],f=c.length;if(f<a)break;f<u&&(u=f);const p=c.indexOf(c[f-1])+1;if(p>u)break;p>a&&(a=p)}if(d<o){const c=this.getNthRow(d),f=X(c,i,l[1],"inconsistent-table",n[1]);f.startIndex++,f.startLine++,f.startCol=0,s.push(f)}}}return s}}close(e=`
16
+ |}`,t){const s=this.getAttribute("config"),i=this.getAttribute("accum");we.run(()=>{const l=new Qe(t?e:void 0,"table-syntax",s,i);super.insertAt(l)})}getLayout(e){const t=this.getAllRows(),{length:s}=t,i=zl.from(Ml(s,()=>[]));for(let l=0;l<i.length;l++){const n=i[l];let r=0,o=0,a;for(const u of t[l].childNodes.slice(2))if(u.is("td")){if(u.isIndependent()&&(a=u.subtype!=="caption"),a){const d={row:l,column:r},{rowspan:c,colspan:f}=u;for(r++;n[o];)o++;for(let p=l;p<Math.min(l+c,s);p++)for(let v=o;v<o+f;v++)i[p][v]=d;o+=f}}else if(Ul(u))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 l of this.childNodes.slice(2)){const{type:n}=l;if(n==="tr"&&l.getRowCount()&&(e--,e<0))return l}}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t);return s.closed=this.closed,s}},Ts=oe(Hi),re(Ts,1,"getLayout",Hl,Rs),Fn(Ts,Rs)}}),wa,Du=I({"src/table/tr.ts"(){"use strict";ba(),wa=class extends tr{get type(){return"tr"}constructor(e,t,s,i){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,e,"tr",t,s,i)}}}}),sr,ya=I({"src/nowiki/listBase.ts"(){"use strict";ht(),sr=class extends Pe{get indent(){return this.innerText.split(":").length-1}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t);{const{indent:i}=this;return i&&(s.indent=i),s}}}}}),ir,Sa=I({"src/nowiki/dd.ts"(){"use strict";ya(),ir=class extends sr{get type(){return"dd"}}}}),Aa={};ae(Aa,{parseTable:()=>ka});var Dl,Di,ka,Gu=I({"parser/table.ts"(){"use strict";V(),Hu(),Du(),va(),Sa(),Dl=e=>e.lastChild.constructor!==H,Di=(e,t)=>e.is("td")?t.pop():e,ka=({firstChild:{data:e},type:t,name:s},i,l)=>{const n=[],r=e.split(`
17
17
  `);let o=t==="root"||t==="parameter-value"||t==="ext-inner"&&s==="poem"?"":`
18
- ${r.shift()}`,a;const u=(d,h)=>{if(!h){o+=d;return}const{lastChild:m}=h;if(Dl(h)){const f=new H(d,i,l);f.type="table-inter",f.setAttribute("stage",3),h.insertAt(f)}else m.setText(m.toString()+d)};for(const d of r){a=n.pop();const[h]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(d),m=d.slice(h.length),f=/^(:*)((?:\s|\0\d+[cn]\x7F)*)(\{\||\{(?:\0\d+[cn]\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(m);if(f){for(;a&&!a.is("td");)a=n.pop();const[,g,c,p,w]=f;g&&new ir(g,i,l),u(`
19
- ${h}${g&&`\0${l.length-1}d`}${c}\0${l.length}b`,a),n.push(...a?[a]:[],new Rs(p,w,i,l));continue}else if(!a){o+=`
20
- ${d}`;continue}const x=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(m);if(!x){u(`
21
- ${d}`,a),n.push(a);continue}const[,k,$,_,T]=x;if(k){for(;!a.is("table");)a=n.pop();a.close(`
22
- ${h}${k}`,!0),u(T,n[n.length-1])}else if($){a=Di(a,n),a.is("tr")&&(a=n.pop());const g=new ya(`
23
- ${h}${$}`,T,i,l);n.push(a,g),a.insertAt(g)}else{a=Di(a,n);const g=_==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu;let c=g.exec(T),p=0,w=`
24
- ${h}${_}`;const v=y=>{const S=new Bs(w,T.slice(p,c==null?void 0:c.index),i,l);return y.insertAt(S),S};for(;c;)v(a),{lastIndex:p}=g,[w]=c,c=g.exec(T);n.push(a,v(a))}}return o.slice(1)}}}),_a,Qu=N({"src/nowiki/hr.ts"(){"use strict";ht(),_a=class extends Pe{get type(){return"hr"}}}}),Gl,Gi,Vl,ss,Ju=N({"src/nowiki/doubleUnderscore.ts"(){"use strict";Et(),Ke(),ht(),Gl=[ct(),We("__")],ss=class extends(Vl=Pe){get type(){return"double-underscore"}constructor(e,t,s,i){var o,a;super(e,s,i);const l=e.toLowerCase(),{doubleUnderscore:[,,n,r]}=s;this.setAttribute("name",(a=t?(o=r==null?void 0:r[e])==null?void 0:o.toLowerCase():n==null?void 0:n[l])!=null?a:l)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}},Gi=oe(Vl),ss=re(Gi,0,"DoubleUnderscoreToken",Gl,ss),ne(Gi,1,ss)}}),Ta={};ae(Ta,{parseHrAndDoubleUnderscore:()=>Ca});var Ca,Xu=N({"parser/hrAndDoubleUnderscore.ts"(){"use strict";Qu(),Ju(),Go(),Ca=({firstChild:{data:e},type:t,name:s},i,l)=>{var a,u,d;const{doubleUnderscore:[n,r,o]}=i;return(a=i.insensitiveDoubleUnderscore)!=null||(i.insensitiveDoubleUnderscore=new Set(n)),(u=i.sensitiveDoubleUnderscore)!=null||(i.sensitiveDoubleUnderscore=new Set(r)),(d=i.regexHrAndDoubleUnderscore)!=null||(i.regexHrAndDoubleUnderscore=new RegExp(`__(${[...n,...r].join("|")})__`,"giu")),t!=="root"&&(t!=="ext-inner"||s!=="poem")&&(e=`\0${e}`),e=e.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(h,m,f)=>(new _a(f,i,l),`${m}\0${l.length-1}r`)).replace(i.regexHrAndDoubleUnderscore,(h,m)=>{var $;const f=i.sensitiveDoubleUnderscore.has(m),x=m.toLowerCase(),k=i.insensitiveDoubleUnderscore.has(x);return f||k?(new ss(m,f,i,l),`\0${l.length-1}${k&&(($=o==null?void 0:o[x])!=null?$:x)==="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,m,f,x,k)=>{const $=`${m}\0${l.length}h`;return new wt(f.length,[x,k],i,l),$})),t==="root"||t==="ext-inner"&&s==="poem"?e:e.slice(1)}}}),Ia,Ku=N({"src/nowiki/quote.ts"(){"use strict";var e,t;K(),me(),G(),ht(),Ia=(t=class extends Pe{constructor(i,l,n,r){super(i,n,r);P(this,e);E(this,e,l)}get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}get closing(){return{...this.bold?{bold:b(this,e).bold}:void 0,...this.italic?{italic:b(this,e).italic}:void 0}}text(){const{parentNode:i,innerText:l}=this;return i!=null&&i.is("image-parameter")&&i.name!=="caption"?"":l}lint(i=this.getAbsoluteIndex()){var l;{const{previousSibling:n,bold:r,closing:o}=this,a=(n==null?void 0:n.type)==="text"?n.data:void 0,u=[],d=new ce(this,i),h=["lonely-apos","bold-header"],{lintConfig:m}=I,{computeEditInfo:f}=m,x=[void 0,"word"].map($=>m.getSeverity(h[0],$)),k=m.getSeverity(h[1]);if(a!=null&&a.endsWith("'")){const $=x[(o.bold||o.italic)&&/[a-z\d]'$/iu.test(a)?1:0];if($){const _=ie(this,d,h[0],I.msg("lonely","'"),$),{startLine:T,startCol:g}=_,[,{length:c}]=/(?:^|[^'])('+)$/u.exec(a),p=i-c,w={..._,startIndex:p,endIndex:i,endLine:T,startCol:g-c,endCol:g};f&&(w.suggestions=[It(p,"&apos;",c),te(w)]),u.push(w)}}if(k&&r&&((l=this.closest("heading-title,ext"))==null?void 0:l.type)==="heading-title"){const $=ie(this,d,h[1],"bold-in-header",k);f&&($.suggestions=[te($)]),u.push($)}return u}}json(i,l=this.getAbsoluteIndex()){const n=super.json(void 0,l);return Object.assign(n,{bold:this.bold,italic:this.italic}),n}},e=new WeakMap,t)}}),Na={};ae(Na,{parseQuotes:()=>nr});var nr,La=N({"parser/quotes.ts"(){"use strict";Ku(),nr=(e,t,s,i)=>{var f;const l=e.split(/('{2,})/u),{length:n}=l;if(n===1)return e;let r=0,o=0,a,u,d;for(let x=1;x<n;x+=2){const k=l[x].length;switch(k){case 2:o++;break;case 4:l[x-1]+="'",l[x]="'''";case 3:if(r++,a!==void 0)break;l[x-1].endsWith(" ")?u===void 0&&d===void 0&&(d=x):l[x-1].slice(-2,-1)===" "?a=x:u!=null||(u=x);break;default:l[x-1]+="'".repeat(k-5),l[x]="'''''",o++,r++}}if(o%2===1&&r%2===1){const x=(f=a!=null?a:u)!=null?f:d;x!==void 0&&(l[x]="''",l[x-1]+="'")}let h=!0,m=!0;for(let x=1;x<n;x+=2){const k=l[x].length,$=k!==2,_=k!==3;$&&(h=!h),_&&(m=!m),new Ia(l[x],{bold:$&&h,italic:_&&m},t,s),l[x]=`\0${s.length-1}q`}return l.join("")}}}),Fa={};ae(Fa,{parseExternalLinks:()=>rr});var rr,Ea=N({"parser/externalLinks.ts"(){"use strict";fe(),oa(),Zn(),rr=(e,t,s,i)=>{var l;return(l=t.regexExternalLinks)!=null||(t.regexExternalLinks=new RegExp(String.raw`\[((?:\0\d+[cn]\x7F)*(?:\0\d+f\x7F|(?:(?:${t.protocol}|//)${$t}|\0\d+m\x7F)${_t}(?=[[\]<>"\t${Ge}]|\0\d)))([${Ge}]*(?![${Ge}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),e.replace(t.regexExternalLinks,(n,r,o,a)=>{const{length:u}=s,d=/&[lg]t;/u.exec(r);return d&&(o="",a=r.slice(d.index)+o+a,r=r.slice(0,d.index)),i?(new fs(r,"ext-link-url",t,s),`[\0${u}f${o}${a}]`):(new St(r,o,a,t,s),`\0${u}w`)})}}}),ja,Yu=N({"src/link/category.ts"(){"use strict";fe(),Ms(),ja=class extends De{get type(){return"category"}get sortkey(){{const{childNodes:[,e]}=this;return e&&ds(e.text())}}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t);{const{sortkey:i}=this;return i&&(s.sortkey=i),s}}}}}),Ra={};ae(Ra,{parseLinks:()=>kn});var Ql,kn,Zu=N({"parser/links.ts"(){"use strict";fe(),G(),La(),Ea(),la(),sa(),Yu(),Ql=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,kn=(e,t,s,i)=>{var o;(o=t.regexLinks)!=null||(t.regexLinks=new RegExp(String.raw`^\s*(?:${t.protocol}|//)`,"iu"));const l=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,n=e.split("[[");let r=n.shift();for(let a=0;a<n.length;a++){let u=!1,d,h,m,f;const x=n[a],k=l.exec(x);if(k)[,d,h,m,f]=k,f.startsWith("]")&&(m!=null&&m.includes("["))&&(m+="]",f=f.slice(1));else{const p=Ql.exec(x);p&&(u=!0,[,d,h,m]=p)}if(d===void 0||t.regexLinks.test(d)||/\0\d+[exhbru]\x7F/u.test(d)){r+=`[[${x}`;continue}let $=Te(d).trim();const _=$.startsWith(":");if(_&&u){r+=`[[${x}`;continue}else!$&&m&&!m.includes(`
25
- `)&&($=Te(m).trim());const{ns:T,valid:g}=I.normalizeTitle($,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0});if(g){if(u){if(T!==6){r+=`[[${x}`;continue}let p=!1;for(a++;a<n.length;a++){const w=n[a],v=w.split("]]");if(v.length>2){p=!0,m+=`[[${v[0]}]]${v[1]}`,f=v.slice(2).join("]]");break}else if(v.length===2)m+=`[[${v[0]}]]${v[1]}`;else{m+=`[[${w}`;break}}if(m=kn(m,t,s,i),!p){r+=`[[${d}${h}${m}`;continue}}}else{r+=`[[${x}`;continue}m&&(m=nr(m,t,s,i));let c=Yn;_||(T===6?(m&&(m=rr(m,t,s,!0)),c=Kn):T===14&&(c=ja)),m===void 0&&h&&(m=""),r+=`\0${s.length}l${f}`,new c(d,m,t,s,h)}return r}}}),Pa={};ae(Pa,{parseMagicLinks:()=>Oa});var Vi,Qi,Ji,Xi,Oa,ed=N({"parser/magicLinks.ts"(){"use strict";fe(),Zn(),Vi=String.raw`[${Ge}\t]|&nbsp;|&#0*160;|&#x0*a0;`,Qi=`(?:${Vi})+`,Ji=`(?:${Vi}|-)`,Xi=String.raw`(?:RFC|PMID)${Qi}\d+\b|ISBN${Qi}(?:97[89]${Ji}?)?(?:\d${Ji}?){9}[\dx]\b`,Oa=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${$t}${_t})|${Xi})`,"giu")}catch{t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${$t}${_t})|${Xi})`,"giu")}return e.replace(t.regexMagicLinks,(i,l,n)=>{let r=l?i.slice(l.length):i;if(n){let o="";const a=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(r);a&&(o=r.slice(a.index),r=r.slice(0,a.index));const u=r.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,d=u.exec(r);if(d){let h=1;d[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(r.slice(0,d.index))&&(h=2),o=r.slice(d.index+h)+o,r=r.slice(0,d.index+h)}return o.length>=n.length?i:(new fs(r,void 0,t,s),`${l}\0${s.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(r))return i;return new fs(r,"magic-link",t,s),`${l}\0${s.length-1}i`})}}}),Ba,td=N({"util/html.ts"(){"use strict";Ba=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,i)=>s!==e[i])}}),qa,sd=N({"src/nowiki/list.ts"(){"use strict";Sa(),qa=class extends sr{get type(){return"list"}}}}),Wa={};ae(Wa,{parseList:()=>Ua});var Ua,id=N({"parser/list.ts"(){"use strict";td(),sd(),Aa(),Ua=(e,t,s,i)=>{const l=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!l)return t.lastPrefix="",e;const[n,r,o,a]=l,u=o.replace(/;/gu,":"),d=Ba(u,t.lastPrefix),h=((d>1?o.slice(d-1):o)+a).split(/(?=;)/u),m=h[0].startsWith(";");let f=h.length-(m?0:1);if(d>1){const A=o.slice(0,d-1);if(m){const j=A.split(/(?=;)/u);h.unshift(...j),f+=A.includes(";")?j.length:0}else h[0]=A+h[0]}t.lastPrefix=u;let x=r+h.map((A,j)=>`\0${i.length+j}d`).join("")+e.slice(n.length);for(const A of h)new qa(A,s,i);if(!f)return x;const{html:[k,,$]}=s,_=/:+|-\{|\0\d+[xq]\x7F/gu;let T=_,g=T.exec(x),c=0,p=!1,w=!1,v=0;const y=(A,j)=>(new ir(A,s,i),`${x.slice(0,j)}\0${i.length-1}d${x.slice(j+A.length)}`),S=A=>{A?c&&c--:c++};for(;g&&f;){const{0:A,index:j}=g;if(A==="-{"){if(!v){const{lastIndex:C}=T;T=/-\{|\}-/gu,T.lastIndex=C}v++}else if(A==="}-"){if(v--,!v){const{lastIndex:C}=T;T=_,T.lastIndex=C}}else if(A.endsWith("x")){const{name:C,closing:L,selfClosing:B}=i[Number(A.slice(1,-2))];(k.includes(C)||!B&&!$.includes(C))&&S(L)}else if(A.endsWith("q")){const{bold:C,italic:L}=i[Number(A.slice(1,-2))];C&&(S(p),p=!p),L&&(S(w),w=!w)}else if(c===0){if(A.length>=f)return y(A.slice(0,f),j);f-=A.length,T.lastIndex=j+4+String(i.length).length,x=y(A,j)}g=T.exec(x)}return x}}}),Cs,Jl,Ki,Xl,is,nd=N({"src/converterFlags.ts"(){"use strict";var e,t;K(),me(),Us(),G(),V(),Xe(),Cs=new Set(["A","T","R","D","-","H","N"]),Jl=[xs()],is=(t=class extends(Xl=H){constructor(i,l,n=[]){super(void 0,l,n,{});P(this,e);this.safeAppend(i.map(r=>new ke(r,"converter-flag",l,n)))}get type(){return"converter-flags"}afterBuild(){E(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(b(this,e).filter(i=>/\{{3}[^{}]+\}{3}/u.test(i)))}getVariantFlags(){const i=new Set(this.getAttribute("config").variants);return new Set(b(this,e).filter(l=>i.has(l)))}isInvalidFlag(i,l,n,r){return typeof i=="object"&&(i=i.text().trim(),l=this.getVariantFlags(),n=this.getUnknownFlags(),r=new Set(b(this,e).filter(o=>Cs.has(o)))),!!i&&!l.has(i)&&!n.has(i)&&(l.size>0||!r.has(i))}lint(i=this.getAbsoluteIndex(),l){{const n=this.getVariantFlags(),r=this.getUnknownFlags(),o=new Set(b(this,e).filter($=>Cs.has($))),a=b(this,e).filter($=>!$).length,u=b(this,e).length-r.size-a,{lintConfig:d}=I,{computeEditInfo:h,fix:m}=d,f=super.lint(i,l);if(n.size===u||o.size===u)return f;const x="no-ignored",k=d.getSeverity(x,"conversionFlag");if(k){const $=new ce(this,i);for(let _=0;_<this.length;_++){const T=this.childNodes[_],g=T.text().trim();if(this.isInvalidFlag(g,n,r,o)){const c=X(T,$,x,"invalid-conversion-flag",k);(h||m)&&(n.size===0&&Cs.has(g.toUpperCase())?c.fix=Bn(c,g):h&&(c.suggestions=[te(c,_&&-1)])),f.push(c)}}}return f}}print(){return super.print({sep:";"})}},e=new WeakMap,t),Ki=oe(Xl),is=re(Ki,0,"ConverterFlagsToken",Jl,is),ne(Ki,1,is)}}),Ps,rd=N({"src/converterRule.ts"(){"use strict";G(),V(),Xe(),Ps=class extends H{get type(){return"converter-rule"}get variant(){var e,t;return(t=(e=this.childNodes[this.length-2])==null?void 0:e.text().trim().toLowerCase())!=null?t:""}constructor(e,t=!0,s=I.getConfig(),i=[]){super(void 0,s,i);const l=e.indexOf(":"),n=e.slice(0,l).indexOf("=>"),r=n===-1?e.slice(0,l):e.slice(n+2,l);t&&s.variants.includes(r.trim().toLowerCase())?(super.insertAt(new ke(r,"converter-rule-variant",s,i)),super.insertAt(new ke(e.slice(l+1),"converter-rule-to",s,i)),n!==-1&&super.insertAt(new ke(e.slice(0,n),"converter-rule-from",s,i),0)):super.insertAt(new ke(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);return s.variant=this.variant,s}}}}),Kl,Yi,Yl,ns,ld=N({"src/converter.ts"(){"use strict";fe(),Ke(),qe(),V(),nd(),rd(),Kl=[Be,We("-{")],ns=class extends(Yl=H){get type(){return"converter"}constructor(e,t,s,i=[]){super(void 0,s,i),this.insertAt(new is(e,s,i));const[l]=t,n=l.includes(":"),r=new Ps(l,n,s,i);n&&r.length===1||!n&&t.length===2&&!Te(t[1]).trim()?this.insertAt(new Ps(t.join(";"),!1,s,i)):this.append(r,...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()}|${ut(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>`}},Yi=oe(Yl),ns=re(Yi,0,"ConverterToken",Kl,ns),ne(Yi,1,ns)}}),Ma={};ae(Ma,{parseConverter:()=>za});var za,od=N({"parser/converter.ts"(){"use strict";ld(),za=(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,l=/-\{|\}-/gu,n=[];let r=i,o=r.exec(e);for(;o;){const{0:u,index:d}=o;if(u==="}-"){const h=n.pop(),{length:m}=s,f=e.slice(h.index+2,d),x=f.indexOf("|"),[k,$]=x===-1?[[],f]:[f.slice(0,x).split(";"),f.slice(x+1)],_=$.replace(/(&[#a-z\d]+);/giu,"$1"),T=_.split(t.regexConverter).map(g=>g.replace(/\x01/gu,";"));new ns(k,T,t,s),e=`${e.slice(0,h.index)}\0${m}v${e.slice(d+2)}`,n.length===0&&(r=i),r.lastIndex=h.index+3+String(m).length}else n.push(o),r=l,r.lastIndex=d+2;o=r.exec(e)}return e}}}),os={};ae(os,{Token:()=>H});var Zl,H,V=N({"src/index.ts"(){"use strict";var e,t,s,i,l,n,r,o,Ha,Da,Ga,Va,Qa,Ja,Xa,Ka,Ya,Za,eu,tu,c;fe(),dt(),K(),Oe(),G(),Au(),$u(),Zl=["category","html-attr#id,ext-attr#id,table-attr#id"],H=(c=class extends Gt{constructor(v,y=I.getConfig(),S=[],A){super();P(this,o);P(this,e,"plain");P(this,t,0);P(this,s);P(this,i);P(this,l);P(this,n,!1);P(this,r);typeof v=="string"&&this.insertAt(v),E(this,s,y),E(this,i,S),S.push(this)}get type(){return b(this,e)}set type(v){E(this,e,v)}parseOnce(v=b(this,t),y=!1,S){if(v<b(this,t)||this.length===0||!this.isPlain())return this;if(b(this,t)>=_e)return this;switch(v){case 0:if(this.type==="root"){b(this,i).pop();const A=R(this,o,Ha).call(this);y&&(y=!A)}E(this,l,y),R(this,o,Da).call(this,y);break;case 1:R(this,o,Ga).call(this);break;case 2:R(this,o,Va).call(this);break;case 3:R(this,o,Qa).call(this);break;case 4:R(this,o,Ja).call(this);break;case 5:R(this,o,Xa).call(this,S);break;case 6:R(this,o,Ka).call(this,S);break;case 7:R(this,o,Ya).call(this);break;case 8:R(this,o,Za).call(this);break;case 9:R(this,o,eu).call(this);break;case 10:R(this,o,tu).call(this)}if(this.type==="root")for(const A of b(this,i))A==null||A.parseOnce(v,y,S);return ar(this,t)._++,this}buildFromStr(v,y){const S=v.split(/[\0\x7F]/u).map((A,j)=>{if(j%2===0)return new fn(A);if(isNaN(A.slice(-1)))return b(this,i)[Number(A.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${A}`)});return y===0?S.map(String).join(""):y===1?ut(S):S}build(){E(this,t,_e);const{length:v,firstChild:y}=this,S=y==null?void 0:y.toString();if(v===1&&y.type==="text"&&S.includes("\0")&&(ms(this,0,1,this.buildFromStr(S)),this.normalize(),this.type==="root"))for(const A of b(this,i))A==null||A.build()}afterBuild(){if(this.type==="root")for(const v of b(this,i))v==null||v.afterBuild();E(this,n,!0)}parse(v=_e,y,S){for(v=Math.min(v,_e);b(this,t)<v;)this.parseOnce(b(this,t),y,S);return v&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===c}getAttribute(v){var y;switch(v){case"config":return b(this,s);case"include":return(y=b(this,l))!=null?y:!!b(this.getRootNode(),l);case"accum":return b(this,i);case"built":return b(this,n);case"stage":return b(this,t);case"invalid":return this.type==="table-inter"&&ls(this)===2;default:return super.getAttribute(v)}}setAttribute(v,y){switch(v){case"stage":b(this,t)===0&&this.type==="root"&&b(this,i).shift(),E(this,t,y);break;default:super.setAttribute(v,y)}}insertAt(v,y=this.length){const S=typeof v=="string"?new fn(v):v;super.insertAt(S,y);const{type:A}=S;return A==="root"&&(S.type="plain"),S}normalizeTitle(v,y=0,S){return I.normalizeTitle(v,y,b(this,l),b(this,s),S)}inTableAttrs(){var v,y;return((v=this.closest("table-attrs,ext"))==null?void 0:v.type)==="table-attrs"&&((y=this.closest("table-attrs,arg,magic-word,template"))!=null&&y.is("table-attrs")?2:1)}inHtmlAttrs(){var v;return(v=this.closest("html-attrs,ext"))!=null&&v.is("html-attrs")?2:this.inTableAttrs()}lint(v=this.getAbsoluteIndex(),y){var S;{const{lintConfig:A}=I,{computeEditInfo:j,fix:C,ignoreDisables:L,configurationComment:B}=A;let O=super.lint(v,y);if(this.type==="root"){const F=new Map,D="no-duplicate",W=["category","id"].map(U=>A.getSeverity(D,U)),q=this.toString(),z=Zl.filter((U,Q)=>W[Q]).join();if(z){for(const U of this.querySelectorAll(z)){let Q;if(U.is("category"))Q=U.name;else{const J=U.getValue();J&&J!==!0&&(Q=`#${J}`)}if(Q){const J=F.get(Q);J?J.add(U):F.set(Q,new Set([U]))}}for(const[U,Q]of F)if(Q.size>1&&!U.startsWith("#mw-customcollapsible-")){const J=!U.startsWith("#"),se=`duplicate-${J?"category":"id"}`,ue=W[J?0:1];O.push(...[...Q].map(he=>{const le=ie(he,{start:he.getAbsoluteIndex()},D,se,ue);return j&&J&&(le.suggestions=[te(le)]),le}))}}if(!L){const U=new RegExp(String.raw`<!--\s*${B}-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->`,"gu"),Q=[];let J=U.exec(q);for(;J;){const{1:se,index:ue}=J,he=(S=J[2])==null?void 0:S.trim();Q.push({line:this.posFromIndex(ue).top+(se==="disable-line"?0:1),from:se==="disable"?U.lastIndex:void 0,to:se==="enable"?U.lastIndex:void 0,rules:he?new Set(he.split(",").map(le=>le.trim())):void 0}),J=U.exec(q)}O=O.filter(({rule:se,startLine:ue,startIndex:he})=>{const le={pos:0};for(const{line:Ie,from:Ne,to:M,rules:Y}of Q){if(Ie>ue+1)break;if(Y&&!Y.has(se))continue;if(Ie===ue&&Ne===void 0&&M===void 0)return!1;Ne<=he&&Ne>le.pos?(le.pos=Ne,le.type="from"):M<=he&&M>le.pos&&(le.pos=M,le.type="to")}return le.type!=="from"})}if(C&&O.some(({fix:U})=>U)){const U=O.map(({fix:se})=>se).filter(Boolean).sort(({range:[se,ue]},{range:[he,le]})=>ue===le?he-se:le-ue);let Q=1/0,J=q;for(const{range:[se,ue],text:he}of U)ue<=Q&&(J=J.slice(0,se)+he+J.slice(ue),Q=se);Object.assign(O,{output:J})}if(!j)for(const U of O)delete U.fix,delete U.suggestions}return O}}toString(v,y){return v?super.toString(!0,y):at(b(this,r),()=>super.toString(!1,y),S=>{const A=this.getRootNode();A.type==="root"&&b(A,n)&&E(this,r,S)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,l=new WeakMap,n=new WeakMap,r=new WeakMap,o=new WeakSet,Ha=function(){const{parseRedirect:v}=(Cu(),ee(Po)),y=this.firstChild.toString(),S=v(y,b(this,s),b(this,i));return S&&this.setText(S),!!S},Da=function(v){const{parseCommentAndExt:y}=(Vs(),ee(fa));this.setText(y(this.firstChild.toString(),b(this,s),b(this,i),v))},Ga=function(){const{parseBraces:v}=(Xn(),ee(Qo)),y=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,S=v(y,b(this,s),b(this,i));this.setText(this.type==="root"?S:S.slice(1))},Va=function(){if(b(this,s).excludes.includes("html"))return;const{parseHtml:v}=(Hu(),ee(ma));this.setText(v(this.firstChild.toString(),b(this,s),b(this,i)))},Qa=function(){if(b(this,s).excludes.includes("table"))return;const{parseTable:v}=(Vu(),ee(ka));this.setText(v(this,b(this,s),b(this,i)))},Ja=function(){if(b(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:v}=(Xu(),ee(Ta));this.setText(v(this,b(this,s),b(this,i)))},Xa=function(v){const{parseLinks:y}=(Zu(),ee(Ra));this.setText(y(this.firstChild.toString(),b(this,s),b(this,i),v))},Ka=function(v){if(b(this,s).excludes.includes("quote"))return;const{parseQuotes:y}=(La(),ee(Na)),S=this.firstChild.toString().split(`
26
- `);for(let A=0;A<S.length;A++)S[A]=y(S[A],b(this,s),b(this,i),v);this.setText(S.join(`
27
- `))},Ya=function(){if(b(this,s).excludes.includes("extLink"))return;const{parseExternalLinks:v}=(Ea(),ee(Fa));this.setText(v(this.firstChild.toString(),b(this,s),b(this,i)))},Za=function(){if(b(this,s).excludes.includes("magicLink"))return;const{parseMagicLinks:v}=(ed(),ee(Pa));this.setText(v(this.firstChild.toString(),b(this,s),b(this,i)))},eu=function(){if(b(this,s).excludes.includes("list"))return;const{parseList:v}=(id(),ee(Wa)),{firstChild:y,type:S,name:A}=this,j=y.toString().split(`
28
- `),C={lastPrefix:""};let L=S==="root"||S==="ext-inner"&&A==="poem"?0:1;for(;L<j.length;L++)j[L]=v(j[L],C,b(this,s),b(this,i));this.setText(j.join(`
29
- `))},tu=function(){if(b(this,s).variants.length>0){const{parseConverter:v}=(od(),ee(Ma));this.setText(v(this.firstChild.toString(),b(this,s),b(this,i)))}},c)}}),we,Qs,ms,Oe=N({"util/debug.ts"(){"use strict";we={running:!1,run(e){const{running:t}=this;this.running=!0;try{const{Token:s}=(V(),ee(os)),i=e();return i instanceof s&&!i.getAttribute("built")&&i.afterBuild(),this.running=t,i}catch(s){throw this.running=t,s}},rev:0},Qs=e=>t=>t.type===e,ms=(e,t,s,i=[])=>{var r,o;let l=e.getChildNodes(),n;l.length===s?(n=l,l=i):n=l.splice(t,s,...i);for(let a=0;a<i.length;a++){const u=i[a];u.setAttribute("parentNode",e),u.setAttribute("nextSibling",l[t+a+1]),u.setAttribute("previousSibling",l[t+a-1])}return(r=l[t-1])==null||r.setAttribute("nextSibling",l[t]),(o=l[t+i.length])==null||o.setAttribute("previousSibling",l[t+i.length-1]),l===i&&e.setAttribute("childNodes",l),n}}}),eo,zt,Zi,Is,en,to,tn,so,$n,ad=N({"lib/lintConfig.ts"(){"use strict";var e,t;jn(),eo=new Set([0,1,2]),zt=new Map([[0,!1],[1,"warning"],[2,"error"]]),Zi={"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(Zi),Is={configurationComment:"lint",ignoreDisables:!1,fix:!0,computeEditInfo:!0},Object.freeze(Is),en=s=>typeof s=="number"&&eo.has(s),to=s=>en(s)||Array.isArray(s)&&s.length===2&&en(s[0])&&s[1]&&typeof s[1]=="object",tn=(s,i,l)=>{if(as.includes(i)){if(l===void 0)return!1;if(to(l))return s[i]=l,!0}else throw new RangeError(`Unknown lint rule: ${i}`);throw new RangeError(`Invalid lint config for ${i}: ${JSON.stringify(l)}`)},so=class{constructor(s){if(Object.assign(this,JSON.parse(JSON.stringify(Zi))),!!s)for(const[i,l]of Object.entries(s))tn(this,i,l)}getSeverity(s,i){var n;const l=this[s];return typeof l=="number"?zt.get(l):i&&(n=zt.get(l[1][i]))!=null?n:zt.get(l[0])}},$n=(t=class{constructor(s){P(this,e);if(Object.assign(this,Is),s&&!("rules"in s)&&Object.keys(s).some(i=>as.includes(i)))this.rules=s;else{const{rules:i,...l}=s!=null?s:{};this.rules=i;for(const[n,r]of Object.entries(l))r!==void 0&&Object.prototype.hasOwnProperty.call(Is,n)&&(this[n]=r)}}get rules(){return b(this,e)}set rules(s){E(this,e,new Proxy(new so(s),{set:tn,deleteProperty(){return!1}}))}getSeverity(s,i){return b(this,e).getSeverity(s,i)}},e=new WeakMap,t)}}),su={};ae(su,{Title:()=>iu});var iu,ud=N({"lib/title.ts"(){"use strict";var e,t,s,i,l,n;Je(),fe(),iu=(n=class{constructor(r,o,a,{temporary:u,decode:d,selfLink:h}={}){P(this,e);P(this,t);P(this,s);P(this,i);P(this,l);Le(this,"valid");Le(this,"encoded",!1);const m=r.trim().startsWith("../");if(d&&r.includes("%"))try{const x=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(r);r=hs(r),this.encoded=x}catch{}if(r=ds(r).replace(/[_ ]+/gu," ").trim(),m)E(this,i,0);else{let x=o;r.startsWith(":")&&(x=0,r=r.slice(1).trim());const k=r.split(":");if(k.length>1){const $=Tt(k[0]),_=Object.prototype.hasOwnProperty.call(a.nsid,$)&&a.nsid[$];_&&(x=_,r=k.slice(1).join(":").trim())}E(this,i,x)}const f=r.indexOf("#");if(f!==-1){let x=r.slice(f).trim().slice(1);if(x.includes("%"))try{x=hs(x)}catch{}E(this,l,x.replace(/ /gu,"_")),r=r.slice(0,f).trim()}this.valid=!!(r||h&&this.ns===0&&b(this,l)!==void 0)&&ds(r)===r&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(m?/^(?:\.\.\/)+(.*)/u.exec(r)[1]:r),this.main=r,E(this,t,a.namespaces),E(this,s,a.articlePath||"/wiki/$1"),b(this,s).includes("$1")||E(this,s,b(this,s)+`${b(this,s).endsWith("/")?"":"/"}$1`),u||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return b(this,i)}get fragment(){return b(this,l)}get main(){return b(this,e)}set main(r){r=r.replace(/_/gu," ").trim(),E(this,e,r&&r[0].toUpperCase()+r.slice(1))}get prefix(){const r=b(this,t)[this.ns];return r+(r&&":")}get title(){return this.getRedirection()[1]}get extension(){const{main:r}=this,o=r.lastIndexOf(".");return o===-1?void 0:r.slice(o+1).toLowerCase()}getRedirection(){return[!1,(this.prefix+this.main).replace(/ /gu,"_")]}setFragment(r){E(this,l,r)}getUrl(r){{typeof r=="string"&&(E(this,s,r),b(this,s).includes("$1")||E(this,s,b(this,s)+`${b(this,s).endsWith("/")?"":"/"}$1`));const{title:o,fragment:a}=this;return o?b(this,s).replace("$1",encodeURIComponent(o)+(a?`#${encodeURIComponent(a)}`:"")):a===void 0?"":`#${encodeURIComponent(a)}`}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,l=new WeakMap,n)}}),nu={};ae(nu,{LanguageService:()=>ru,isAttr:()=>Os,tasks:()=>_n});var _n,io,no,ro,lo,sn,oo,ao,uo,co,Os,ho,nn,ft,rn,Me,be,ln,on,mt,xt,it,Ht,an,go,ru,dd=N({"lib/lsp.ts"(){"use strict";var e,t,s,i,l,n,r,o,a,u,rs,Fe,Tn,Cn,In,lu,Nn,vt,T;Je(),jn(),Uo(),K(),fe(),G(),_n=new WeakMap,io=new Set(["ref"]),no=new Set(["ref","references"]),ro=new Set(["name","follow"]),lo=new Set(["group"]),sn=new Set(["arg-name","template-name","link-target","parameter-key"]),oo=new Set(["ext","html","attr-key","image-parameter","heading-title","heading","magic-word-name",...sn]),ao=new Set(["text","comment","noinclude","include"]),uo=["ext","html","table"].map(g=>`${g}-attr#style`).join(),co=ot(g=>new RegExp(`^(?:${g}|//)`,"iu")),Os=({type:g,parentNode:c,length:p,firstChild:w},v)=>g==="attr-value"&&p===1&&w.type==="text"&&(!v||c.name==="style"),ho=g=>g.is("html-attr")||g.is("table-attr"),nn=g=>g.childNodes.every(({type:c})=>ao.has(c)),ft=(g,c)=>{const{top:p,left:w}=g.posFromIndex(c);return{line:p,character:w}},rn=(g,c,p)=>({start:ft(g,c),end:ft(g,p)}),Me=g=>{const{top:c,left:p,height:w,width:v}=g.getBoundingClientRect();return{start:{line:c,character:p},end:gs(c,p,w,v)}},be=(g,c,p,{line:w,character:v},y,S)=>[...new Set(g)].map(A=>{var C;const j=(C=S==null?void 0:S(A))==null?void 0:C.description;return{label:A,kind:c,textEdit:{range:{start:{line:w,character:v-p.length},end:{line:w,character:v}},newText:A+(y!=null?y:"")},...j&&{documentation:{kind:"markdown",value:j}}}}),ln=(g,c,{line:p,character:w})=>{const v=g.indexFromPos(p,w);return g.caretPositionFromIndex(v+Number(/\w/u.test(c.charAt(v))))},on=(g,c,p)=>{const{type:w,parentNode:v={}}=g,{name:y,tag:S}=v;return w==="attr-value"&&c.has(S)&&p.has(y)?g.toString().trim():NaN},mt=g=>on(g,io,ro),xt=g=>on(g,no,lo),it=(g,c)=>{const p=g==null?void 0:g.getAttr(c);return p!==!0&&p||!1},Ht=g=>{const{type:c,name:p,parentNode:w}=g;switch(c){case"heading":return g.level;case"heading-title":return w.level;case"parameter-key":return`${w.parentNode.name}|${w.name}`;case"ext":case"html":case"image-parameter":return p;default:return w.name}},an=(g,c,p=!1)=>({range:rn(g,...c.range),newText:c.text,title:`${p?"Fix":"Suggestion"}: ${c.desc}`,fix:p}),go=(g,c)=>{const{lintConfig:p}=I,{rules:w,fix:v,computeEditInfo:y}=p;if(p.fix=!0,p.computeEditInfo=!1,c){p.rules=void 0;for(const A of as)p.rules[A]=A===c?w[A]:0}const{output:S}=g.lint();return p.fix=v,p.computeEditInfo=y,c&&(p.rules=w),S===void 0?[]:[{range:Me(g),newText:S}]},ru=(T=class{constructor(g){P(this,u);P(this,e);P(this,t);P(this,s);P(this,i);P(this,l);P(this,n);P(this,r);P(this,o);P(this,a);Le(this,"include",!0);Le(this,"config");Le(this,"data");_n.set(g,this),Object.defineProperties(this,{config:{enumerable:!1},data:{enumerable:!1}})}destroy(){Object.setPrototypeOf(this,null)}async provideDocumentColors(g,c,p=!0){const w=await R(this,u,Fe).call(this,c);return w.querySelectorAll("attr-value,parameter-value,arg-default").reverse().flatMap(v=>{const{type:y,childNodes:S}=v;return y!=="attr-value"&&!nn(v)?[]:S.filter(A=>A.type==="text").reverse().flatMap(A=>{const{data:j}=A,C=$o(j,p).filter(([,,,B])=>B);if(C.length===0)return[];const L=A.getAbsoluteIndex();return C.map(([B,O,F])=>{const D=g(B);return D.length===4&&{color:{red:D[0]/255,green:D[1]/255,blue:D[2]/255,alpha:D[3]},range:rn(w,L+O,L+F)}}).filter(Boolean)})})}provideColorPresentations(g){const{color:{red:c,green:p,blue:w,alpha:v},range:y}=g,S=[c,p,w],A=v<1?`rgba(${S.map(j=>Math.round(j*255)).join()},${v})`:`#${S.map(ko).join("")}`;return[{label:A,textEdit:{range:y,newText:A}}]}async provideCompletionItems(g,c){var J,se,ue,he,le,Ie,Ne;const{re:p,allTags:w,functions:v,switches:y,protocols:S,params:A,tags:j,ext:C}=R(this,u,lu).call(this),{line:L,character:B}=c,O=g.split(/\r?\n/u,L+1)[L],F=p.exec((J=O==null?void 0:O.slice(0,B))!=null?J:""),[,,D={},W={}]=this.config.doubleUnderscore;if((F==null?void 0:F[1])!==void 0){const M=F[1].startsWith("/");return be(w,"Class",F[1].slice(M?1:0),c,M&&!(O!=null&&O.slice(B).trim().startsWith(">"))?">":"")}else{if(F!=null&&F[4])return be(y,"Constant",F[4],c,"",M=>{if(this.data)return M=M.slice(2,-2),M in D?M=D[M]:M in W&&(M=W[M]),R(this,u,Nn).call(this,M.toLowerCase())});if((F==null?void 0:F[5])!==void 0)return be(S,"Reference",F[5],c)}const q=await R(this,u,Fe).call(this,g);let z;if(F!=null&&F[2]){z=q.elementFromPoint(F.index+F[2].length-1,L);const M=(se=F[3])!=null?se:"";if(F[2]==="{{{")return be(q.querySelectorAll("arg").filter(Z=>Z.name&&Z!==z).map(({name:Z})=>Z),"Variable",M,c);const[Y,ge]=this.config.parserFunction,ve=Array.isArray(ge),Ce=O.charAt(B),Ue=M.startsWith(":"),Se=Ue?M.slice(1).trimStart():M;if(F[2]==="[[")return be(q.querySelectorAll("link,file,category,redirect-target").filter(Z=>Z!==z).map(({name:Z})=>Z),"Folder",Se,c);let gt=v;return Ce===":"?gt=v.filter(Z=>!Z.endsWith(":")):Ce===":"&&(gt=v.filter(Z=>Z.endsWith(":")).map(Z=>Z.slice(0,-1))),[...be(gt,"Function",M,c,"",Z=>{if(this.data)Z in Y?Z=Y[Z]:!ve&&Z in ge&&(Z=ge[Z]);else return;return R(this,u,vt).call(this,Z.toLowerCase())}),...M.startsWith("#")?[]:be(q.querySelectorAll("template").filter(Z=>Z!==z).map(Z=>{const{name:Ze}=Z;if(Ue)return Ze;const{ns:jt}=Z.getAttribute("title");return jt===0?`:${Ze}`:jt===10?Ze.slice(9):Ze}),"Folder",Se,c)]}let U,Q;if((F==null?void 0:F[7])===void 0&&(z=q.elementFromPoint(B,L),{type:U,parentNode:Q}=z),(F==null?void 0:F[6])!==void 0||U==="image-parameter"){const M=q.indexFromPos(L,B),Y=(he=(ue=F==null?void 0:F[6])==null?void 0:ue.trimStart())!=null?he:b(this,e).slice(z.getAbsoluteIndex(),M).trimStart(),ge=b(this,e)[M]==="=";return[...be(A,"Property",Y,c).filter(({label:ve})=>!ge||!/[= ]$/u.test(ve)),...be(q.querySelectorAll("image-parameter#width").filter(ve=>ve!==z).map(ve=>ve.text()),"Unit",Y,c)]}else if((F==null?void 0:F[7])!==void 0||U==="attr-key"){const M=(Ie=(le=F==null?void 0:F[7])==null?void 0:le.toLowerCase())!=null?Ie:Q.tag,Y=(Ne=F==null?void 0:F[9])!=null?Ne:z.toString().slice(0,B-q.posFromIndex(z.getAbsoluteIndex()).left);if(!j.has(M))return;const ge=Gn[M],ve=Vn[M],Ce=ve&&be(ve,"Field",Y,c);return C.includes(M)&&!ge?Ce:[...Ce!=null?Ce:[],...M==="meta"||M==="link"?[]:be(Dn,"Property",Y,c),...ge?be(ge,"Property",Y,c):[],...be(["data-"],"Variable",Y,c),...be(["xmlns:"],"Interface",Y,c)]}else if(U==="parameter-key"||U==="parameter-value"&&Q.anon){const M=Q.parentNode,{type:Y,name:ge}=M;if(Y==="magic-word"&&ge!=="invoke")return;const ve=b(this,e).slice(z.getAbsoluteIndex(),q.indexFromPos(L,B)).trimStart(),{module:Ce,function:Ue}=M;return ve?be(q.querySelectorAll("parameter").filter(Se=>Se===Q||Se.anon||Se.parentNode.type!==Y||Se.parentNode.name!==ge?!1:Y==="template"?!0:Se.parentNode.module===Ce&&Se.parentNode.function===Ue).map(({name:Se})=>Se),"Variable",ve,c,U==="parameter-value"?"=":""):void 0}else if(Os(z)&&ho(Q)){const M=Wn(Q.tag,Q.name);if(M.length===0)return;const Y=b(this,e).slice(z.getAbsoluteIndex(),q.indexFromPos(L,B)).trimStart();return be(M,"Value",Y,c)}}async provideDiagnostics(g,c=!0){const p=await R(this,u,Fe).call(this,g),{lintConfig:w}=I,v=w.fix;w.fix=!1;const y=p.lint();return w.fix=v,[(c?y:y.filter(({severity:C})=>C==="error")).map(({startLine:C,startCol:L,endLine:B,endCol:O,severity:F,rule:D,message:W,fix:q,suggestions:z})=>({range:{start:{line:C,character:L},end:{line:B,character:O}},severity:F==="error"?1:2,source:"WikiLint",code:D,message:W,data:[...q?[an(p,q,!0)]:[],...z?z.map(U=>an(p,U)):[]]})),[],[]].flat(2)}resolveCodeAction(g){if(g.kind!=="source.fixAll")return g;const{rule:c}=g.data;return{...g,edit:{changes:{"":go(b(this,l),c)}}}}async provideFoldingRanges(g){const c=await R(this,u,Fe).call(this,g),{length:p}=c.getLines(),w=[],v=new Array(6),y=c.querySelectorAll("heading-title,table,template,magic-word");for(const S of[...y].reverse())S.getRelativeIndex();for(const S of y){const{offsetHeight:A}=S;if(S.type==="heading-title"||A>2){const{top:j}=c.posFromIndex(S.getAbsoluteIndex());if(S.type==="heading-title"){const{level:C}=S.parentNode;for(let L=C-1;L<6;L++){const B=v[L];B!==void 0&&B<j-1&&w.push({startLine:B,endLine:j-1,kind:"region"}),v[L]=void 0}v[C-1]=j+A-1}else w.push({startLine:j,endLine:j+A-2,kind:"region"})}}for(const S of v)S!==void 0&&S<p-1&&w.push({startLine:S,endLine:p-1,kind:"region"});return w}async provideLinks(g){var y;(y=this.config)!=null||(this.config=I.getConfig());const{articlePath:c,protocol:p}=this.config,w=c==null?void 0:c.includes("//"),v=co(p);return(await R(this,u,Fe).call(this,g)).querySelectorAll(`magic-link,ext-link-url,free-ext-link,attr-value,image-parameter#link${w?",link-target,template-name,invoke-module,magic-word#filepath,magic-word#widget":""}`).reverse().map(S=>{let A;S.is("magic-word")&&({name:A}=S,S=S.childNodes[1].lastChild);const{type:j,parentNode:C,firstChild:L,lastChild:B,childNodes:O,length:F}=S,{tag:D}=C;if(A!=null||(A=C.name),!(j!=="attr-value"||A==="src"&&["templatestyles","img"].includes(D)||A==="cite"&&["blockquote","del","ins","q"].includes(D))||!nn(S))return!1;let W=O.filter(q=>q.type==="text").map(({data:q})=>q).join("").trim();if(!W)return!1;try{if(S.is("magic-link")||S.is("ext-link-url")||S.is("free-ext-link"))W=S.getUrl(c);else if(j==="link-target"&&(C.is("link")||C.is("redirect-target")||C.is("category"))){if(W.startsWith("/"))return!1;W=C.link.getUrl(c)}else if(j==="template-name")W=C.getAttribute("title").getUrl(c);else if(["link-target","invoke-module","parameter-value"].includes(j)||j==="attr-value"&&A==="src"&&D==="templatestyles"||j==="image-parameter"&&!v.test(W)){if(!w||W.startsWith("/"))return!1;let q=0;switch(j){case"attr-value":q=10;break;case"invoke-module":q=828;break;case"parameter-value":q=A==="filepath"?6:274}const z=I.normalizeTitle(W,q,!1,this.config,{temporary:!0});if(!z.valid)return!1;W=z.getUrl()}if(typeof W=="string"&&W.startsWith("//")&&(W=`https:${W}`),W=new URL(W).href,j==="image-parameter"){const q=L.getBoundingClientRect(),{top:z,left:U,height:Q,width:J}=F===1?q:B.getBoundingClientRect();return{range:{start:{line:q.top,character:q.left},end:gs(z,U,Q,J)},target:W}}return{range:Me(S),target:W}}catch{return!1}}).filter(Boolean)}async provideReferences(g,c){const p=await R(this,u,Fe).call(this,g),{offsetNode:w,offset:v}=ln(p,b(this,e),c),y=w.type==="text"?w.parentNode:w,S=v===0&&(y.type==="ext-attr-dirty"||y.type==="html-attr-dirty")?y.parentNode.parentNode:y,{type:A}=S,j=mt(S),C=xt(S);if(!j&&!C&&!oo.has(A))return;const L=Ht(S),B=p.querySelectorAll(A==="heading-title"?"heading":A).filter(O=>A==="attr-value"?mt(O)===j||xt(O)===C:Ht(O)===L).reverse().map(O=>({range:Me(O.type==="parameter-key"?O.parentNode:O)}));return B.length===0?void 0:B}async provideDefinition(g,c){const p=await R(this,u,Fe).call(this,g),w=p.elementFromPoint(c.character,c.line),v=w.is("ext")&&w.name==="ref"?w:w.closest("ext#ref"),y=it(v,"name");if(!y)return;const S=it(v,"group"),A=p.querySelectorAll("ext#ref").filter(j=>j.innerText&&it(j,"name")===y&&it(j,"group")===S).reverse().map(({lastChild:j})=>({range:Me(j)}));return A.length===0?void 0:A}async resolveRenameLocation(g,c){const p=await R(this,u,Fe).call(this,g),w=p.elementFromPoint(c.character,c.line),{type:v}=w,y=mt(w),S=xt(w);return!y&&!S&&(!sn.has(v)||v==="parameter-key"&&/^[1-9]\d*$/u.test(w.parentNode.name)||v==="link-target"&&!["link","redirect-target"].includes(w.parentNode.type))?void 0:Me(w)}async provideRenameEdits(g,c,p){const w=await R(this,u,Fe).call(this,g),v=w.elementFromPoint(c.character,c.line),{type:y}=v,S=mt(v),A=S&&it(v.parentNode.parentNode,"group"),j=xt(v),C=Ht(v),L=w.querySelectorAll(y).filter(B=>{const{type:O}=B.parentNode;return y==="link-target"&&O!=="link"&&O!=="redirect-target"?!1:y==="attr-value"?xt(B)===j||mt(B)===S&&it(B.parentNode.parentNode,"group")===A:Ht(B)===C});return L.length===0?void 0:{changes:{"":L.reverse().map(B=>({range:Me(B),newText:p}))}}}async provideHover(g,c){if(!this.data)return;const p=await R(this,u,Fe).call(this,g);let{offsetNode:w,offset:v}=ln(p,b(this,e),c);w.type==="text"&&(v+=w.getRelativeIndex(),w=w.parentNode);const{type:y,parentNode:S,length:A,name:j}=w;let C,L,B,O;if(w.is("double-underscore")&&v>0)C=R(this,u,Nn).call(this,w.name);else if(y==="magic-word-name")C=R(this,u,vt).call(this,S.name),L=w.text().trim(),B=S.getAttribute("colon");else if(w.is("magic-word")&&!w.modifier&&A===1&&(v>0||p.posFromIndex(w.getAbsoluteIndex()).left===c.character))C=R(this,u,vt).call(this,j),L=w.firstChild.text().trim(),B=w.getAttribute("colon");else if((w.is("magic-word")||w.is("template"))&&w.modifier&&v>=2&&w.getRelativeIndex(0)>v&&(L=w.modifier.trim().slice(0,-1),C=R(this,u,vt).call(this,L.toLowerCase()),B=":",C)){const F=w.getAbsoluteIndex();O={start:ft(p,F+2),end:ft(p,F+w.modifier.trimEnd().length+1)}}return C&&{contents:{kind:"markdown",value:(C.signatures?`${C.signatures.map(F=>`- **{{ ${L}${F.length===0?"**":`${B}** `}${F.map(({label:D,const:W})=>W?D:`*${D}*`).join(" **|** ")} **}}**`).join(`
18
+ ${r.shift()}`,a;const u=(d,c)=>{if(!c){o+=d;return}const{lastChild:f}=c;if(Dl(c)){const p=new H(d,i,l);p.type="table-inter",p.setAttribute("stage",3),c.insertAt(p)}else f.setText(f.toString()+d)};for(const d of r){a=n.pop();const[c]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(d),f=d.slice(c.length),p=/^(:*)((?:\s|\0\d+[cn]\x7F)*)(\{\||\{(?:\0\d+[cn]\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(f);if(p){for(;a&&!a.is("td");)a=n.pop();const[,g,h,x,b]=p;g&&new ir(g,i,l),u(`
19
+ ${c}${g&&`\0${l.length-1}d`}${h}\0${l.length}b`,a),n.push(...a?[a]:[],new Rs(x,b,i,l));continue}else if(!a){o+=`
20
+ ${d}`;continue}const v=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(f);if(!v){u(`
21
+ ${d}`,a),n.push(a);continue}const[,k,$,_,T]=v;if(k){for(;!a.is("table");)a=n.pop();a.close(`
22
+ ${c}${k}`,!0),u(T,n[n.length-1])}else if($){a=Di(a,n),a.is("tr")&&(a=n.pop());const g=new wa(`
23
+ ${c}${$}`,T,i,l);n.push(a,g),a.insertAt(g)}else{a=Di(a,n);const g=_==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu;let h=g.exec(T),x=0,b=`
24
+ ${c}${_}`;const m=y=>{const S=new Bs(b,T.slice(x,h==null?void 0:h.index),i,l);return y.insertAt(S),S};for(;h;)m(a),{lastIndex:x}=g,[b]=h,h=g.exec(T);n.push(a,m(a))}}return o.slice(1)}}}),$a,Vu=I({"src/nowiki/hr.ts"(){"use strict";ht(),$a=class extends Pe{get type(){return"hr"}}}}),Gl,Gi,Vl,ss,Qu=I({"src/nowiki/doubleUnderscore.ts"(){"use strict";jt(),Ye(),ht(),Gl=[ct(),We("__")],ss=class extends(Vl=Pe){get type(){return"double-underscore"}constructor(e,t,s,i){var o,a;super(e,s,i);const l=e.toLowerCase(),{doubleUnderscore:[,,n,r]}=s;this.setAttribute("name",(a=t?(o=r==null?void 0:r[e])==null?void 0:o.toLowerCase():n==null?void 0:n[l])!=null?a:l)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}},Gi=oe(Vl),ss=re(Gi,0,"DoubleUnderscoreToken",Gl,ss),ne(Gi,1,ss)}}),_a={};ae(_a,{parseHrAndDoubleUnderscore:()=>Ta});var Ta,Ju=I({"parser/hrAndDoubleUnderscore.ts"(){"use strict";Vu(),Qu(),Do(),Ta=({firstChild:{data:e},type:t,name:s},i,l)=>{var a,u,d;const{doubleUnderscore:[n,r,o]}=i;return(a=i.insensitiveDoubleUnderscore)!=null||(i.insensitiveDoubleUnderscore=new Set(n)),(u=i.sensitiveDoubleUnderscore)!=null||(i.sensitiveDoubleUnderscore=new Set(r)),(d=i.regexHrAndDoubleUnderscore)!=null||(i.regexHrAndDoubleUnderscore=new RegExp(`__(${[...n,...r].join("|")})__`,"giu")),t!=="root"&&(t!=="ext-inner"||s!=="poem")&&(e=`\0${e}`),e=e.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(c,f,p)=>(new $a(p,i,l),`${f}\0${l.length-1}r`)).replace(i.regexHrAndDoubleUnderscore,(c,f)=>{var $;const p=i.sensitiveDoubleUnderscore.has(f),v=f.toLowerCase(),k=i.insensitiveDoubleUnderscore.has(v);return p||k?(new ss(f,p,i,l),`\0${l.length-1}${k&&(($=o==null?void 0:o[v])!=null?$:v)==="toc"?"u":"n"}`):c}),i.excludes.includes("heading")||(e=e.replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(c,f,p,v,k)=>{const $=`${f}\0${l.length}h`;return new yt(p.length,[v,k],i,l),$})),t==="root"||t==="ext-inner"&&s==="poem"?e:e.slice(1)}}}),Ca,Xu=I({"src/nowiki/quote.ts"(){"use strict";var e,t;K(),me(),G(),ht(),Ca=(t=class extends Pe{constructor(i,l,n,r){super(i,n,r);P(this,e);j(this,e,l)}get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}get closing(){return{...this.bold?{bold:w(this,e).bold}:void 0,...this.italic?{italic:w(this,e).italic}:void 0}}text(){const{parentNode:i,innerText:l}=this;return i!=null&&i.is("image-parameter")&&i.name!=="caption"?"":l}lint(i=this.getAbsoluteIndex()){var l;{const{previousSibling:n,bold:r,closing:o}=this,a=(n==null?void 0:n.type)==="text"?n.data:void 0,u=[],d=new ce(this,i),c=["lonely-apos","bold-header"],{lintConfig:f}=N,{computeEditInfo:p}=f,v=[void 0,"word"].map($=>f.getSeverity(c[0],$)),k=f.getSeverity(c[1]);if(a!=null&&a.endsWith("'")){const $=v[(o.bold||o.italic)&&/[a-z\d]'$/iu.test(a)?1:0];if($){const _=ie(this,d,c[0],N.msg("lonely","'"),$),{startLine:T,startCol:g}=_,[,{length:h}]=/(?:^|[^'])('+)$/u.exec(a),x=i-h,b={..._,startIndex:x,endIndex:i,endLine:T,startCol:g-h,endCol:g};p&&(b.suggestions=[Nt(x,"&apos;",h),te(b)]),u.push(b)}}if(k&&r&&((l=this.closest("heading-title,ext"))==null?void 0:l.type)==="heading-title"){const $=ie(this,d,c[1],"bold-in-header",k);p&&($.suggestions=[te($)]),u.push($)}return u}}json(i,l=this.getAbsoluteIndex()){const n=super.json(void 0,l);return Object.assign(n,{bold:this.bold,italic:this.italic}),n}},e=new WeakMap,t)}}),Ia={};ae(Ia,{parseQuotes:()=>nr});var nr,Na=I({"parser/quotes.ts"(){"use strict";Xu(),nr=(e,t,s,i)=>{var p;const l=e.split(/('{2,})/u),{length:n}=l;if(n===1)return e;let r=0,o=0,a,u,d;for(let v=1;v<n;v+=2){const k=l[v].length;switch(k){case 2:o++;break;case 4:l[v-1]+="'",l[v]="'''";case 3:if(r++,a!==void 0)break;l[v-1].endsWith(" ")?u===void 0&&d===void 0&&(d=v):l[v-1].slice(-2,-1)===" "?a=v:u!=null||(u=v);break;default:l[v-1]+="'".repeat(k-5),l[v]="'''''",o++,r++}}if(o%2===1&&r%2===1){const v=(p=a!=null?a:u)!=null?p:d;v!==void 0&&(l[v]="''",l[v-1]+="'")}let c=!0,f=!0;for(let v=1;v<n;v+=2){const k=l[v].length,$=k!==2,_=k!==3;$&&(c=!c),_&&(f=!f),new Ca(l[v],{bold:$&&c,italic:_&&f},t,s),l[v]=`\0${s.length-1}q`}return l.join("")}}}),La={};ae(La,{parseExternalLinks:()=>rr});var rr,Fa=I({"parser/externalLinks.ts"(){"use strict";fe(),la(),Zn(),rr=(e,t,s,i)=>{var l;return(l=t.regexExternalLinks)!=null||(t.regexExternalLinks=new RegExp(String.raw`\[((?:\0\d+[cn]\x7F)*(?:\0\d+f\x7F|(?:(?:${t.protocol}|//)${_t}|\0\d+m\x7F)${Tt}(?=[[\]<>"\t${Ge}]|\0\d)))([${Ge}]*(?![${Ge}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),e.replace(t.regexExternalLinks,(n,r,o,a)=>{const{length:u}=s,d=/&[lg]t;/u.exec(r);return d&&(o="",a=r.slice(d.index)+o+a,r=r.slice(0,d.index)),i?(new fs(r,"ext-link-url",t,s),`[\0${u}f${o}${a}]`):(new At(r,o,a,t,s),`\0${u}w`)})}}}),Ea,Ku=I({"src/link/category.ts"(){"use strict";fe(),Us(),Ea=class extends De{get type(){return"category"}get sortkey(){{const{childNodes:[,e]}=this;return e&&ds(e.text())}}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t);{const{sortkey:i}=this;return i&&(s.sortkey=i),s}}}}}),ja={};ae(ja,{parseLinks:()=>kn});var Ql,kn,Yu=I({"parser/links.ts"(){"use strict";fe(),G(),Na(),Fa(),ra(),ta(),Ku(),Ql=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,kn=(e,t,s,i)=>{var o;(o=t.regexLinks)!=null||(t.regexLinks=new RegExp(String.raw`^\s*(?:${t.protocol}|//)`,"iu"));const l=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,n=e.split("[[");let r=n.shift();for(let a=0;a<n.length;a++){let u=!1,d,c,f,p;const v=n[a],k=l.exec(v);if(k)[,d,c,f,p]=k,p.startsWith("]")&&(f!=null&&f.includes("["))&&(f+="]",p=p.slice(1));else{const x=Ql.exec(v);x&&(u=!0,[,d,c,f]=x)}if(d===void 0||t.regexLinks.test(d)||/\0\d+[exhbru]\x7F/u.test(d)){r+=`[[${v}`;continue}let $=Te(d).trim();const _=$.startsWith(":");if(_&&u){r+=`[[${v}`;continue}else!$&&f&&!f.includes(`
25
+ `)&&($=Te(f).trim());const{ns:T,valid:g}=N.normalizeTitle($,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0});if(g){if(u){if(T!==6){r+=`[[${v}`;continue}let x=!1;for(a++;a<n.length;a++){const b=n[a],m=b.split("]]");if(m.length>2){x=!0,f+=`[[${m[0]}]]${m[1]}`,p=m.slice(2).join("]]");break}else if(m.length===2)f+=`[[${m[0]}]]${m[1]}`;else{f+=`[[${b}`;break}}if(f=kn(f,t,s,i),!x){r+=`[[${d}${c}${f}`;continue}}}else{r+=`[[${v}`;continue}f&&(f=nr(f,t,s,i));let h=Yn;_||(T===6?(f&&(f=rr(f,t,s,!0)),h=Kn):T===14&&(h=Ea)),f===void 0&&c&&(f=""),r+=`\0${s.length}l${p}`,new h(d,f,t,s,c)}return r}}}),Ra={};ae(Ra,{parseMagicLinks:()=>Pa});var Vi,Qi,Ji,Xi,Pa,Zu=I({"parser/magicLinks.ts"(){"use strict";fe(),Zn(),Vi=String.raw`[${Ge}\t]|&nbsp;|&#0*160;|&#x0*a0;`,Qi=`(?:${Vi})+`,Ji=`(?:${Vi}|-)`,Xi=String.raw`(?:RFC|PMID)${Qi}\d+\b|ISBN${Qi}(?:97[89]${Ji}?)?(?:\d${Ji}?){9}[\dx]\b`,Pa=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${_t}${Tt})|${Xi})`,"giu")}catch{t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${_t}${Tt})|${Xi})`,"giu")}return e.replace(t.regexMagicLinks,(i,l,n)=>{let r=l?i.slice(l.length):i;if(n){let o="";const a=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(r);a&&(o=r.slice(a.index),r=r.slice(0,a.index));const u=r.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,d=u.exec(r);if(d){let c=1;d[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(r.slice(0,d.index))&&(c=2),o=r.slice(d.index+c)+o,r=r.slice(0,d.index+c)}return o.length>=n.length?i:(new fs(r,void 0,t,s),`${l}\0${s.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(r))return i;return new fs(r,"magic-link",t,s),`${l}\0${s.length-1}i`})}}}),Oa,ed=I({"util/html.ts"(){"use strict";Oa=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,i)=>s!==e[i])}}),Ba,td=I({"src/nowiki/list.ts"(){"use strict";ya(),Ba=class extends sr{get type(){return"list"}}}}),qa={};ae(qa,{parseList:()=>Wa});var Wa,sd=I({"parser/list.ts"(){"use strict";ed(),td(),Sa(),Wa=(e,t,s,i)=>{const l=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!l)return t.lastPrefix="",e;const[n,r,o,a]=l,u=o.replace(/;/gu,":"),d=Oa(u,t.lastPrefix),c=((d>1?o.slice(d-1):o)+a).split(/(?=;)/u),f=c[0].startsWith(";");let p=c.length-(f?0:1);if(d>1){const A=o.slice(0,d-1);if(f){const L=A.split(/(?=;)/u);c.unshift(...L),p+=A.includes(";")?L.length:0}else c[0]=A+c[0]}t.lastPrefix=u;let v=r+c.map((A,L)=>`\0${i.length+L}d`).join("")+e.slice(n.length);for(const A of c)new Ba(A,s,i);if(!p)return v;const{html:[k,,$]}=s,_=/:+|-\{|\0\d+[xq]\x7F/gu;let T=_,g=T.exec(v),h=0,x=!1,b=!1,m=0;const y=(A,L)=>(new ir(A,s,i),`${v.slice(0,L)}\0${i.length-1}d${v.slice(L+A.length)}`),S=A=>{A?h&&h--:h++};for(;g&&p;){const{0:A,index:L}=g;if(A==="-{"){if(!m){const{lastIndex:C}=T;T=/-\{|\}-/gu,T.lastIndex=C}m++}else if(A==="}-"){if(m--,!m){const{lastIndex:C}=T;T=_,T.lastIndex=C}}else if(A.endsWith("x")){const{name:C,closing:F,selfClosing:B}=i[Number(A.slice(1,-2))];(k.includes(C)||!B&&!$.includes(C))&&S(F)}else if(A.endsWith("q")){const{bold:C,italic:F}=i[Number(A.slice(1,-2))];C&&(S(x),x=!x),F&&(S(b),b=!b)}else if(h===0){if(A.length>=p)return y(A.slice(0,p),L);p-=A.length,T.lastIndex=L+4+String(i.length).length,v=y(A,L)}g=T.exec(v)}return v}}}),Cs,Jl,Ki,Xl,is,id=I({"src/converterFlags.ts"(){"use strict";var e,t;K(),me(),Ms(),G(),V(),Ke(),Cs=new Set(["A","T","R","D","-","H","N"]),Jl=[xs()],is=(t=class extends(Xl=H){constructor(i,l,n=[]){super(void 0,l,n,{});P(this,e);this.safeAppend(i.map(r=>new $e(r,"converter-flag",l,n)))}get type(){return"converter-flags"}afterBuild(){j(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(w(this,e).filter(i=>/\{{3}[^{}]+\}{3}/u.test(i)))}getVariantFlags(){const i=new Set(this.getAttribute("config").variants);return new Set(w(this,e).filter(l=>i.has(l)))}isInvalidFlag(i,l,n,r){return typeof i=="object"&&(i=i.text().trim(),l=this.getVariantFlags(),n=this.getUnknownFlags(),r=new Set(w(this,e).filter(o=>Cs.has(o)))),!!i&&!l.has(i)&&!n.has(i)&&(l.size>0||!r.has(i))}lint(i=this.getAbsoluteIndex(),l){{const n=this.getVariantFlags(),r=this.getUnknownFlags(),o=new Set(w(this,e).filter($=>Cs.has($))),a=w(this,e).filter($=>!$).length,u=w(this,e).length-r.size-a,{lintConfig:d}=N,{computeEditInfo:c,fix:f}=d,p=super.lint(i,l);if(n.size===u||o.size===u)return p;const v="no-ignored",k=d.getSeverity(v,"conversionFlag");if(k){const $=new ce(this,i);for(let _=0;_<this.length;_++){const T=this.childNodes[_],g=T.text().trim();if(this.isInvalidFlag(g,n,r,o)){const h=X(T,$,v,"invalid-conversion-flag",k);(c||f)&&(n.size===0&&Cs.has(g.toUpperCase())?h.fix=Bn(h,g):c&&(h.suggestions=[te(h,_&&-1)])),p.push(h)}}}return p}}print(){return super.print({sep:";"})}},e=new WeakMap,t),Ki=oe(Xl),is=re(Ki,0,"ConverterFlagsToken",Jl,is),ne(Ki,1,is)}}),Ps,nd=I({"src/converterRule.ts"(){"use strict";G(),V(),Ke(),Ps=class extends H{get type(){return"converter-rule"}get variant(){var e,t;return(t=(e=this.childNodes[this.length-2])==null?void 0:e.text().trim().toLowerCase())!=null?t:""}constructor(e,t=!0,s=N.getConfig(),i=[]){super(void 0,s,i);const l=e.indexOf(":"),n=e.slice(0,l).indexOf("=>"),r=n===-1?e.slice(0,l):e.slice(n+2,l);t&&s.variants.includes(r.trim().toLowerCase())?(super.insertAt(new $e(r,"converter-rule-variant",s,i)),super.insertAt(new $e(e.slice(l+1),"converter-rule-to",s,i)),n!==-1&&super.insertAt(new $e(e.slice(0,n),"converter-rule-from",s,i),0)):super.insertAt(new $e(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);return s.variant=this.variant,s}}}}),Kl,Yi,Yl,ns,rd=I({"src/converter.ts"(){"use strict";fe(),Ye(),qe(),V(),id(),nd(),Kl=[Be,We("-{")],ns=class extends(Yl=H){get type(){return"converter"}constructor(e,t,s,i=[]){super(void 0,s,i),this.insertAt(new is(e,s,i));const[l]=t,n=l.includes(":"),r=new Ps(l,n,s,i);n&&r.length===1||!n&&t.length===2&&!Te(t[1]).trim()?this.insertAt(new Ps(t.join(";"),!1,s,i)):this.append(r,...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()}|${dt(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?"|":""}${It(t,{sep:";"})}}-</span>`}},Yi=oe(Yl),ns=re(Yi,0,"ConverterToken",Kl,ns),ne(Yi,1,ns)}}),Ma={};ae(Ma,{parseConverter:()=>Ua});var Ua,ld=I({"parser/converter.ts"(){"use strict";rd(),Ua=(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,l=/-\{|\}-/gu,n=[];let r=i,o=r.exec(e);for(;o;){const{0:u,index:d}=o;if(u==="}-"){const c=n.pop(),{length:f}=s,p=e.slice(c.index+2,d),v=p.indexOf("|"),[k,$]=v===-1?[[],p]:[p.slice(0,v).split(";"),p.slice(v+1)],_=$.replace(/(&[#a-z\d]+);/giu,"$1"),T=_.split(t.regexConverter).map(g=>g.replace(/\x01/gu,";"));new ns(k,T,t,s),e=`${e.slice(0,c.index)}\0${f}v${e.slice(d+2)}`,n.length===0&&(r=i),r.lastIndex=c.index+3+String(f).length}else n.push(o),r=l,r.lastIndex=d+2;o=r.exec(e)}return e}}}),os={};ae(os,{Token:()=>H});var Zl,H,V=I({"src/index.ts"(){"use strict";var e,t,s,i,l,n,r,o,za,Ha,Da,Ga,Va,Qa,Ja,Xa,Ka,Ya,Za,eu,h;fe(),Je(),K(),Oe(),G(),Su(),ku(),Zl=["category","html-attr#id,ext-attr#id,table-attr#id"],H=(h=class extends Gt{constructor(m,y=N.getConfig(),S=[],A){super();P(this,o);P(this,e,"plain");P(this,t,0);P(this,s);P(this,i);P(this,l);P(this,n,!1);P(this,r);typeof m=="string"&&this.insertAt(m),j(this,s,y),j(this,i,S),S.push(this)}get type(){return w(this,e)}set type(m){j(this,e,m)}parseOnce(m=w(this,t),y=!1,S){if(m<w(this,t)||this.length===0||!this.isPlain())return this;if(w(this,t)>=ke)return this;switch(m){case 0:if(this.type==="root"){w(this,i).pop();const A=R(this,o,za).call(this);y&&(y=!A)}j(this,l,y),R(this,o,Ha).call(this,y);break;case 1:R(this,o,Da).call(this);break;case 2:R(this,o,Ga).call(this);break;case 3:R(this,o,Va).call(this);break;case 4:R(this,o,Qa).call(this);break;case 5:R(this,o,Ja).call(this,S);break;case 6:R(this,o,Xa).call(this,S);break;case 7:R(this,o,Ka).call(this);break;case 8:R(this,o,Ya).call(this);break;case 9:R(this,o,Za).call(this);break;case 10:R(this,o,eu).call(this)}if(this.type==="root")for(const A of w(this,i))A==null||A.parseOnce(m,y,S);return ar(this,t)._++,this}buildFromStr(m,y){const S=m.split(/[\0\x7F]/u).map((A,L)=>{if(L%2===0)return new fn(A);if(isNaN(A.slice(-1)))return w(this,i)[Number(A.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${A}`)});return y===0?S.map(String).join(""):y===1?dt(S):S}build(){j(this,t,ke);const{length:m,firstChild:y}=this,S=y==null?void 0:y.toString();if(m===1&&y.type==="text"&&S.includes("\0")&&(ms(this,0,1,this.buildFromStr(S)),this.normalize(),this.type==="root"))for(const A of w(this,i))A==null||A.build()}afterBuild(){if(this.type==="root")for(const m of w(this,i))m==null||m.afterBuild();j(this,n,!0)}parse(m=ke,y,S){for(m=Math.min(m,ke);w(this,t)<m;)this.parseOnce(w(this,t),y,S);return m&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===h}getAttribute(m){var y;switch(m){case"config":return w(this,s);case"include":return(y=w(this,l))!=null?y:!!w(this.getRootNode(),l);case"accum":return w(this,i);case"built":return w(this,n);case"stage":return w(this,t);case"invalid":return this.type==="table-inter"&&ls(this)===2;default:return super.getAttribute(m)}}setAttribute(m,y){switch(m){case"stage":w(this,t)===0&&this.type==="root"&&w(this,i).shift(),j(this,t,y);break;default:super.setAttribute(m,y)}}insertAt(m,y=this.length){const S=typeof m=="string"?new fn(m):m;super.insertAt(S,y);const{type:A}=S;return A==="root"&&(S.type="plain"),S}normalizeTitle(m,y=0,S){return N.normalizeTitle(m,y,w(this,l),w(this,s),S)}inTableAttrs(){var m,y;return((m=this.closest("table-attrs,ext"))==null?void 0:m.type)==="table-attrs"&&((y=this.closest("table-attrs,arg,magic-word,template"))!=null&&y.is("table-attrs")?2:1)}inHtmlAttrs(){var m;return(m=this.closest("html-attrs,ext"))!=null&&m.is("html-attrs")?2:this.inTableAttrs()}lint(m=this.getAbsoluteIndex(),y){var S;{const{lintConfig:A}=N,{computeEditInfo:L,fix:C,ignoreDisables:F,configurationComment:B}=A;let O=super.lint(m,y);if(this.type==="root"){const E=new Map,D="no-duplicate",W=["category","id"].map(M=>A.getSeverity(D,M)),q=this.toString(),z=Zl.filter((M,Q)=>W[Q]).join();if(z){for(const M of this.querySelectorAll(z)){let Q;if(M.is("category"))Q=M.name;else{const J=M.getValue();J&&J!==!0&&(Q=`#${J}`)}if(Q){const J=E.get(Q);J?J.add(M):E.set(Q,new Set([M]))}}for(const[M,Q]of E)if(Q.size>1&&!M.startsWith("#mw-customcollapsible-")){const J=!M.startsWith("#"),se=`duplicate-${J?"category":"id"}`,ue=W[J?0:1];O.push(...[...Q].map(he=>{const le=ie(he,{start:he.getAbsoluteIndex()},D,se,ue);return L&&J&&(le.suggestions=[te(le)]),le}))}}if(!F){const M=new RegExp(String.raw`<!--\s*${B}-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->`,"gu"),Q=[];let J=M.exec(q);for(;J;){const{1:se,index:ue}=J,he=(S=J[2])==null?void 0:S.trim();Q.push({line:this.posFromIndex(ue).top+(se==="disable-line"?0:1),from:se==="disable"?M.lastIndex:void 0,to:se==="enable"?M.lastIndex:void 0,rules:he?new Set(he.split(",").map(le=>le.trim())):void 0}),J=M.exec(q)}O=O.filter(({rule:se,startLine:ue,startIndex:he})=>{const le={pos:0};for(const{line:Ie,from:Ne,to:U,rules:Y}of Q){if(Ie>ue+1)break;if(Y&&!Y.has(se))continue;if(Ie===ue&&Ne===void 0&&U===void 0)return!1;Ne<=he&&Ne>le.pos?(le.pos=Ne,le.type="from"):U<=he&&U>le.pos&&(le.pos=U,le.type="to")}return le.type!=="from"})}if(C&&O.some(({fix:M})=>M)){const M=O.map(({fix:se})=>se).filter(Boolean).sort(({range:[se,ue]},{range:[he,le]})=>ue===le?he-se:le-ue);let Q=1/0,J=q;for(const{range:[se,ue],text:he}of M)ue<=Q&&(J=J.slice(0,se)+he+J.slice(ue),Q=se);Object.assign(O,{output:J})}if(!L)for(const M of O)delete M.fix,delete M.suggestions}return O}}toString(m,y){return m?super.toString(!0,y):ut(w(this,r),()=>super.toString(!1,y),S=>{const A=this.getRootNode();A.type==="root"&&w(A,n)&&j(this,r,S)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,l=new WeakMap,n=new WeakMap,r=new WeakMap,o=new WeakSet,za=function(){const{parseRedirect:m}=(Tu(),ee(Ro)),y=this.firstChild.toString(),S=m(y,w(this,s),w(this,i));return S&&this.setText(S),!!S},Ha=function(m){const{parseCommentAndExt:y}=(Vs(),ee(pa));this.setText(y(this.firstChild.toString(),w(this,s),w(this,i),m))},Da=function(){const{parseBraces:m}=(Xn(),ee(Vo)),y=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,S=m(y,w(this,s),w(this,i));this.setText(this.type==="root"?S:S.slice(1))},Ga=function(){if(w(this,s).excludes.includes("html"))return;const{parseHtml:m}=(zu(),ee(fa));this.setText(m(this.firstChild.toString(),w(this,s),w(this,i)))},Va=function(){if(w(this,s).excludes.includes("table"))return;const{parseTable:m}=(Gu(),ee(Aa));this.setText(m(this,w(this,s),w(this,i)))},Qa=function(){if(w(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:m}=(Ju(),ee(_a));this.setText(m(this,w(this,s),w(this,i)))},Ja=function(m){const{parseLinks:y}=(Yu(),ee(ja));this.setText(y(this.firstChild.toString(),w(this,s),w(this,i),m))},Xa=function(m){if(w(this,s).excludes.includes("quote"))return;const{parseQuotes:y}=(Na(),ee(Ia)),S=this.firstChild.toString().split(`
26
+ `);for(let A=0;A<S.length;A++)S[A]=y(S[A],w(this,s),w(this,i),m);this.setText(S.join(`
27
+ `))},Ka=function(){if(w(this,s).excludes.includes("extLink"))return;const{parseExternalLinks:m}=(Fa(),ee(La));this.setText(m(this.firstChild.toString(),w(this,s),w(this,i)))},Ya=function(){if(w(this,s).excludes.includes("magicLink"))return;const{parseMagicLinks:m}=(Zu(),ee(Ra));this.setText(m(this.firstChild.toString(),w(this,s),w(this,i)))},Za=function(){if(w(this,s).excludes.includes("list"))return;const{parseList:m}=(sd(),ee(qa)),{firstChild:y,type:S,name:A}=this,L=y.toString().split(`
28
+ `),C={lastPrefix:""};let F=S==="root"||S==="ext-inner"&&A==="poem"?0:1;for(;F<L.length;F++)L[F]=m(L[F],C,w(this,s),w(this,i));this.setText(L.join(`
29
+ `))},eu=function(){if(w(this,s).variants.length>0){const{parseConverter:m}=(ld(),ee(Ma));this.setText(m(this.firstChild.toString(),w(this,s),w(this,i)))}},h)}}),we,Qs,ms,Oe=I({"util/debug.ts"(){"use strict";we={running:!1,run(e){const{running:t}=this;this.running=!0;try{const{Token:s}=(V(),ee(os)),i=e();return i instanceof s&&!i.getAttribute("built")&&i.afterBuild(),this.running=t,i}catch(s){throw this.running=t,s}},rev:0},Qs=e=>t=>t.type===e,ms=(e,t,s,i=[])=>{var r,o;let l=e.getChildNodes(),n;l.length===s?(n=l,l=i):n=l.splice(t,s,...i);for(let a=0;a<i.length;a++){const u=i[a];u.setAttribute("parentNode",e),u.setAttribute("nextSibling",l[t+a+1]),u.setAttribute("previousSibling",l[t+a-1])}return(r=l[t-1])==null||r.setAttribute("nextSibling",l[t]),(o=l[t+i.length])==null||o.setAttribute("previousSibling",l[t+i.length-1]),l===i&&e.setAttribute("childNodes",l),n}}}),ft,Zi,Is,en,eo,tn,to,$n,od=I({"lib/lintConfig.ts"(){"use strict";var e,t;jn(),ft=new Map([[0,!1],[1,"warning"],[2,"error"],[!1,!1],["off",!1],["warning","warning"],["error","error"]]),Zi={"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(Zi),Is={configurationComment:"lint",ignoreDisables:!1,fix:!0,computeEditInfo:!0},Object.freeze(Is),en=s=>ft.has(s),eo=s=>en(s)||Array.isArray(s)&&en(s[0])&&(s.length===1||typeof s[1]=="object"),tn=(s,i,l)=>{if(as.includes(i)){if(l===void 0)return!1;if(eo(l))return s[i]=l,!0}else throw new RangeError(`Unknown lint rule: ${i}`);throw new RangeError(`Invalid lint config for ${i}: ${JSON.stringify(l)}`)},to=class{constructor(s){if(Object.assign(this,JSON.parse(JSON.stringify(Zi))),!!s)for(const[i,l]of Object.entries(s))tn(this,i,l)}getSeverity(s,i){var n,r;const l=this[s];return typeof l!="object"?ft.get(l):i&&(r=ft.get((n=l[1])==null?void 0:n[i]))!=null?r:ft.get(l[0])}},$n=(t=class{constructor(s){P(this,e);if(Object.assign(this,Is),s&&!("rules"in s)&&Object.keys(s).some(i=>as.includes(i)))this.rules=s;else{const{rules:i,...l}=s!=null?s:{};this.rules=i;for(const[n,r]of Object.entries(l))r!==void 0&&Object.prototype.hasOwnProperty.call(Is,n)&&(this[n]=r)}}get rules(){return w(this,e)}set rules(s){j(this,e,new Proxy(new to(s),{set:tn,deleteProperty(){return!1}}))}getSeverity(s,i){return w(this,e).getSeverity(s,i)}},e=new WeakMap,t)}}),tu={};ae(tu,{Title:()=>su});var su,ad=I({"lib/title.ts"(){"use strict";var e,t,s,i,l,n;Xe(),fe(),su=(n=class{constructor(r,o,a,{temporary:u,decode:d,selfLink:c}={}){P(this,e);P(this,t);P(this,s);P(this,i);P(this,l);Le(this,"valid");Le(this,"encoded",!1);const f=r.trim().startsWith("../");if(d&&r.includes("%"))try{const v=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(r);r=hs(r),this.encoded=v}catch{}if(r=ds(r).replace(/[_ ]+/gu," ").trim(),f)j(this,i,0);else{let v=o;r.startsWith(":")&&(v=0,r=r.slice(1).trim());const k=r.split(":");if(k.length>1){const $=Ct(k[0]),_=Object.prototype.hasOwnProperty.call(a.nsid,$)&&a.nsid[$];_&&(v=_,r=k.slice(1).join(":").trim())}j(this,i,v)}const p=r.indexOf("#");if(p!==-1){let v=r.slice(p).trim().slice(1);if(v.includes("%"))try{v=hs(v)}catch{}j(this,l,v.replace(/ /gu,"_")),r=r.slice(0,p).trim()}this.valid=!!(r||c&&this.ns===0&&w(this,l)!==void 0)&&ds(r)===r&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(f?/^(?:\.\.\/)+(.*)/u.exec(r)[1]:r),this.main=r,j(this,t,a.namespaces),j(this,s,a.articlePath||"/wiki/$1"),w(this,s).includes("$1")||j(this,s,w(this,s)+`${w(this,s).endsWith("/")?"":"/"}$1`),u||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return w(this,i)}get fragment(){return w(this,l)}get main(){return w(this,e)}set main(r){r=r.replace(/_/gu," ").trim(),j(this,e,r&&r[0].toUpperCase()+r.slice(1))}get prefix(){const r=w(this,t)[this.ns];return r+(r&&":")}get title(){return this.getRedirection()[1]}get extension(){const{main:r}=this,o=r.lastIndexOf(".");return o===-1?void 0:r.slice(o+1).toLowerCase()}getRedirection(){return[!1,(this.prefix+this.main).replace(/ /gu,"_")]}setFragment(r){j(this,l,r)}getUrl(r){{typeof r=="string"&&(j(this,s,r),w(this,s).includes("$1")||j(this,s,w(this,s)+`${w(this,s).endsWith("/")?"":"/"}$1`));const{title:o,fragment:a}=this;return o?w(this,s).replace("$1",encodeURIComponent(o)+(a?`#${encodeURIComponent(a)}`:"")):a===void 0?"":`#${encodeURIComponent(a)}`}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,l=new WeakMap,n)}}),iu={};ae(iu,{LanguageService:()=>nu,isAttr:()=>Os,tasks:()=>_n});var _n,so,io,no,ro,sn,lo,oo,ao,uo,Os,co,nn,mt,rn,Ue,be,ln,on,xt,vt,nt,Ht,an,ho,nu,ud=I({"lib/lsp.ts"(){"use strict";var e,t,s,i,l,n,r,o,a,u,rs,Fe,Tn,Cn,In,ru,Nn,bt,T;Xe(),jn(),Wo(),K(),fe(),G(),_n=new WeakMap,so=new Set(["ref"]),io=new Set(["ref","references"]),no=new Set(["name","follow"]),ro=new Set(["group"]),sn=new Set(["arg-name","template-name","link-target","parameter-key"]),lo=new Set(["ext","html","attr-key","image-parameter","heading-title","heading","magic-word-name",...sn]),oo=new Set(["text","comment","noinclude","include"]),ao=["ext","html","table"].map(g=>`${g}-attr#style`).join(),uo=at(g=>new RegExp(`^(?:${g}|//)`,"iu")),Os=({type:g,parentNode:h,length:x,firstChild:b},m)=>g==="attr-value"&&x===1&&b.type==="text"&&(!m||h.name==="style"),co=g=>g.is("html-attr")||g.is("table-attr"),nn=g=>g.childNodes.every(({type:h})=>oo.has(h)),mt=(g,h)=>{const{top:x,left:b}=g.posFromIndex(h);return{line:x,character:b}},rn=(g,h,x)=>({start:mt(g,h),end:mt(g,x)}),Ue=g=>{const{top:h,left:x,height:b,width:m}=g.getBoundingClientRect();return{start:{line:h,character:x},end:gs(h,x,b,m)}},be=(g,h,x,{line:b,character:m},y,S)=>[...new Set(g)].map(A=>{var C;const L=(C=S==null?void 0:S(A))==null?void 0:C.description;return{label:A,kind:h,textEdit:{range:{start:{line:b,character:m-x.length},end:{line:b,character:m}},newText:A+(y!=null?y:"")},...L&&{documentation:{kind:"markdown",value:L}}}}),ln=(g,h,{line:x,character:b})=>{const m=g.indexFromPos(x,b);return g.caretPositionFromIndex(m+Number(/\w/u.test(h.charAt(m))))},on=(g,h,x)=>{const{type:b,parentNode:m={}}=g,{name:y,tag:S}=m;return b==="attr-value"&&h.has(S)&&x.has(y)?g.toString().trim():NaN},xt=g=>on(g,so,no),vt=g=>on(g,io,ro),nt=(g,h)=>{const x=g==null?void 0:g.getAttr(h);return x!==!0&&x||!1},Ht=g=>{const{type:h,name:x,parentNode:b}=g;switch(h){case"heading":return g.level;case"heading-title":return b.level;case"parameter-key":return`${b.parentNode.name}|${b.name}`;case"ext":case"html":case"image-parameter":return x;default:return b.name}},an=(g,h,x=!1)=>({range:rn(g,...h.range),newText:h.text,title:`${x?"Fix":"Suggestion"}: ${h.desc}`,fix:x}),ho=(g,h)=>{const{lintConfig:x}=N,{rules:b,fix:m,computeEditInfo:y}=x;if(x.fix=!0,x.computeEditInfo=!1,h){x.rules=void 0;for(const A of as)x.rules[A]=A===h?b[A]:0}const{output:S}=g.lint();return x.fix=m,x.computeEditInfo=y,h&&(x.rules=b),S===void 0?[]:[{range:Ue(g),newText:S}]},nu=(T=class{constructor(g){P(this,u);P(this,e);P(this,t);P(this,s);P(this,i);P(this,l);P(this,n);P(this,r);P(this,o);P(this,a);Le(this,"include",!0);Le(this,"config");Le(this,"data");_n.set(g,this),Object.defineProperties(this,{config:{enumerable:!1},data:{enumerable:!1}})}destroy(){Object.setPrototypeOf(this,null)}async provideDocumentColors(g,h,x=!0){const b=await R(this,u,Fe).call(this,h);return b.querySelectorAll("attr-value,parameter-value,arg-default").reverse().flatMap(m=>{const{type:y,childNodes:S}=m;return y!=="attr-value"&&!nn(m)?[]:S.filter(A=>A.type==="text").reverse().flatMap(A=>{const{data:L}=A,C=ko(L,x).filter(([,,,B])=>B);if(C.length===0)return[];const F=A.getAbsoluteIndex();return C.map(([B,O,E])=>{const D=g(B);return D.length===4&&{color:{red:D[0]/255,green:D[1]/255,blue:D[2]/255,alpha:D[3]},range:rn(b,F+O,F+E)}}).filter(Boolean)})})}provideColorPresentations(g){const{color:{red:h,green:x,blue:b,alpha:m},range:y}=g,S=[h,x,b],A=m<1?`rgba(${S.map(L=>Math.round(L*255)).join()},${m})`:`#${S.map(Ao).join("")}`;return[{label:A,textEdit:{range:y,newText:A}}]}async provideCompletionItems(g,h){var J,se,ue,he,le,Ie,Ne;const{re:x,allTags:b,functions:m,switches:y,protocols:S,params:A,tags:L,ext:C}=R(this,u,ru).call(this),{line:F,character:B}=h,O=g.split(/\r?\n/u,F+1)[F],E=x.exec((J=O==null?void 0:O.slice(0,B))!=null?J:""),[,,D={},W={}]=this.config.doubleUnderscore;if((E==null?void 0:E[1])!==void 0){const U=E[1].startsWith("/");return be(b,"Class",E[1].slice(U?1:0),h,U&&!(O!=null&&O.slice(B).trim().startsWith(">"))?">":"")}else{if(E!=null&&E[4])return be(y,"Constant",E[4],h,"",U=>{if(this.data)return U=U.slice(2,-2),U in D?U=D[U]:U in W&&(U=W[U]),R(this,u,Nn).call(this,U.toLowerCase())});if((E==null?void 0:E[5])!==void 0)return be(S,"Reference",E[5],h)}const q=await R(this,u,Fe).call(this,g);let z;if(E!=null&&E[2]){z=q.elementFromPoint(E.index+E[2].length-1,F);const U=(se=E[3])!=null?se:"";if(E[2]==="{{{")return be(q.querySelectorAll("arg").filter(Z=>Z.name&&Z!==z).map(({name:Z})=>Z),"Variable",U,h);const[Y,ge]=this.config.parserFunction,ve=Array.isArray(ge),Ce=O.charAt(B),Me=U.startsWith(":"),Se=Me?U.slice(1).trimStart():U;if(E[2]==="[[")return be(q.querySelectorAll("link,file,category,redirect-target").filter(Z=>Z!==z).map(({name:Z})=>Z),"Folder",Se,h);let gt=m;return Ce===":"?gt=m.filter(Z=>!Z.endsWith(":")):Ce===":"&&(gt=m.filter(Z=>Z.endsWith(":")).map(Z=>Z.slice(0,-1))),[...be(gt,"Function",U,h,"",Z=>{if(this.data)Z in Y?Z=Y[Z]:!ve&&Z in ge&&(Z=ge[Z]);else return;return R(this,u,bt).call(this,Z.toLowerCase())}),...U.startsWith("#")?[]:be(q.querySelectorAll("template").filter(Z=>Z!==z).map(Z=>{const{name:et}=Z;if(Me)return et;const{ns:Rt}=Z.getAttribute("title");return Rt===0?`:${et}`:Rt===10?et.slice(9):et}),"Folder",Se,h)]}let M,Q;if((E==null?void 0:E[7])===void 0&&(z=q.elementFromPoint(B,F),{type:M,parentNode:Q}=z),(E==null?void 0:E[6])!==void 0||M==="image-parameter"){const U=q.indexFromPos(F,B),Y=(he=(ue=E==null?void 0:E[6])==null?void 0:ue.trimStart())!=null?he:w(this,e).slice(z.getAbsoluteIndex(),U).trimStart(),ge=w(this,e)[U]==="=";return[...be(A,"Property",Y,h).filter(({label:ve})=>!ge||!/[= ]$/u.test(ve)),...be(q.querySelectorAll("image-parameter#width").filter(ve=>ve!==z).map(ve=>ve.text()),"Unit",Y,h)]}else if((E==null?void 0:E[7])!==void 0||M==="attr-key"){const U=(Ie=(le=E==null?void 0:E[7])==null?void 0:le.toLowerCase())!=null?Ie:Q.tag,Y=(Ne=E==null?void 0:E[9])!=null?Ne:z.toString().slice(0,B-q.posFromIndex(z.getAbsoluteIndex()).left);if(!L.has(U))return;const ge=Gn[U],ve=Vn[U],Ce=ve&&be(ve,"Field",Y,h);return C.includes(U)&&!ge?Ce:[...Ce!=null?Ce:[],...U==="meta"||U==="link"?[]:be(Dn,"Property",Y,h),...ge?be(ge,"Property",Y,h):[],...be(["data-"],"Variable",Y,h),...be(["xmlns:"],"Interface",Y,h)]}else if(M==="parameter-key"||M==="parameter-value"&&Q.anon){const U=Q.parentNode,{type:Y,name:ge}=U;if(Y==="magic-word"&&ge!=="invoke")return;const ve=w(this,e).slice(z.getAbsoluteIndex(),q.indexFromPos(F,B)).trimStart(),{module:Ce,function:Me}=U;return ve?be(q.querySelectorAll("parameter").filter(Se=>Se===Q||Se.anon||Se.parentNode.type!==Y||Se.parentNode.name!==ge?!1:Y==="template"?!0:Se.parentNode.module===Ce&&Se.parentNode.function===Me).map(({name:Se})=>Se),"Variable",ve,h,M==="parameter-value"?"=":""):void 0}else if(Os(z)&&co(Q)){const U=Wn(Q.tag,Q.name);if(U.length===0)return;const Y=w(this,e).slice(z.getAbsoluteIndex(),q.indexFromPos(F,B)).trimStart();return be(U,"Value",Y,h)}}async provideDiagnostics(g,h=!0){const x=await R(this,u,Fe).call(this,g),{lintConfig:b}=N,m=b.fix;b.fix=!1;const y=x.lint();return b.fix=m,[(h?y:y.filter(({severity:C})=>C==="error")).map(({startLine:C,startCol:F,endLine:B,endCol:O,severity:E,rule:D,message:W,fix:q,suggestions:z})=>({range:{start:{line:C,character:F},end:{line:B,character:O}},severity:E==="error"?1:2,source:"WikiLint",code:D,message:W,data:[...q?[an(x,q,!0)]:[],...z?z.map(M=>an(x,M)):[]]})),[],[]].flat(2)}resolveCodeAction(g){if(g.kind!=="source.fixAll")return g;const{rule:h}=g.data;return{...g,edit:{changes:{"":ho(w(this,l),h)}}}}async provideFoldingRanges(g){const h=await R(this,u,Fe).call(this,g),{length:x}=h.getLines(),b=[],m=new Array(6),y=h.querySelectorAll("heading-title,table,template,magic-word");for(const S of[...y].reverse())S.getRelativeIndex();for(const S of y){const{offsetHeight:A}=S;if(S.type==="heading-title"||A>2){const{top:L}=h.posFromIndex(S.getAbsoluteIndex());if(S.type==="heading-title"){const{level:C}=S.parentNode;for(let F=C-1;F<6;F++){const B=m[F];B!==void 0&&B<L-1&&b.push({startLine:B,endLine:L-1,kind:"region"}),m[F]=void 0}m[C-1]=L+A-1}else b.push({startLine:L,endLine:L+A-2,kind:"region"})}}for(const S of m)S!==void 0&&S<x-1&&b.push({startLine:S,endLine:x-1,kind:"region"});return b}async provideLinks(g){var y;(y=this.config)!=null||(this.config=N.getConfig());const{articlePath:h,protocol:x}=this.config,b=h==null?void 0:h.includes("//"),m=uo(x);return(await R(this,u,Fe).call(this,g)).querySelectorAll(`magic-link,ext-link-url,free-ext-link,attr-value,image-parameter#link${b?",link-target,template-name,invoke-module,magic-word#filepath,magic-word#widget":""}`).reverse().map(S=>{let A;S.is("magic-word")&&({name:A}=S,S=S.childNodes[1].lastChild);const{type:L,parentNode:C,firstChild:F,lastChild:B,childNodes:O,length:E}=S,{tag:D}=C;if(A!=null||(A=C.name),!(L!=="attr-value"||A==="src"&&["templatestyles","img"].includes(D)||A==="cite"&&["blockquote","del","ins","q"].includes(D))||!nn(S))return!1;let W=O.filter(q=>q.type==="text").map(({data:q})=>q).join("").trim();if(!W)return!1;try{if(S.is("magic-link")||S.is("ext-link-url")||S.is("free-ext-link"))W=S.getUrl(h);else if(L==="link-target"&&(C.is("link")||C.is("redirect-target")||C.is("category"))){if(W.startsWith("/"))return!1;W=C.link.getUrl(h)}else if(L==="template-name")W=C.getAttribute("title").getUrl(h);else if(["link-target","invoke-module","parameter-value"].includes(L)||L==="attr-value"&&A==="src"&&D==="templatestyles"||L==="image-parameter"&&!m.test(W)){if(!b||W.startsWith("/"))return!1;let q=0;switch(L){case"attr-value":q=10;break;case"invoke-module":q=828;break;case"parameter-value":q=A==="filepath"?6:274}const z=N.normalizeTitle(W,q,!1,this.config,{temporary:!0});if(!z.valid)return!1;W=z.getUrl()}if(typeof W=="string"&&W.startsWith("//")&&(W=`https:${W}`),W=new URL(W).href,L==="image-parameter"){const q=F.getBoundingClientRect(),{top:z,left:M,height:Q,width:J}=E===1?q:B.getBoundingClientRect();return{range:{start:{line:q.top,character:q.left},end:gs(z,M,Q,J)},target:W}}return{range:Ue(S),target:W}}catch{return!1}}).filter(Boolean)}async provideReferences(g,h){const x=await R(this,u,Fe).call(this,g),{offsetNode:b,offset:m}=ln(x,w(this,e),h),y=b.type==="text"?b.parentNode:b,S=m===0&&(y.type==="ext-attr-dirty"||y.type==="html-attr-dirty")?y.parentNode.parentNode:y,{type:A}=S,L=xt(S),C=vt(S);if(!L&&!C&&!lo.has(A))return;const F=Ht(S),B=x.querySelectorAll(A==="heading-title"?"heading":A).filter(O=>A==="attr-value"?xt(O)===L||vt(O)===C:Ht(O)===F).reverse().map(O=>({range:Ue(O.type==="parameter-key"?O.parentNode:O)}));return B.length===0?void 0:B}async provideDefinition(g,h){const x=await R(this,u,Fe).call(this,g),b=x.elementFromPoint(h.character,h.line),m=b.is("ext")&&b.name==="ref"?b:b.closest("ext#ref"),y=nt(m,"name");if(!y)return;const S=nt(m,"group"),A=x.querySelectorAll("ext#ref").filter(L=>L.innerText&&nt(L,"name")===y&&nt(L,"group")===S).reverse().map(({lastChild:L})=>({range:Ue(L)}));return A.length===0?void 0:A}async resolveRenameLocation(g,h){const x=await R(this,u,Fe).call(this,g),b=x.elementFromPoint(h.character,h.line),{type:m}=b,y=xt(b),S=vt(b);return!y&&!S&&(!sn.has(m)||m==="parameter-key"&&/^[1-9]\d*$/u.test(b.parentNode.name)||m==="link-target"&&!["link","redirect-target"].includes(b.parentNode.type))?void 0:Ue(b)}async provideRenameEdits(g,h,x){const b=await R(this,u,Fe).call(this,g),m=b.elementFromPoint(h.character,h.line),{type:y}=m,S=xt(m),A=S&&nt(m.parentNode.parentNode,"group"),L=vt(m),C=Ht(m),F=b.querySelectorAll(y).filter(B=>{const{type:O}=B.parentNode;return y==="link-target"&&O!=="link"&&O!=="redirect-target"?!1:y==="attr-value"?vt(B)===L||xt(B)===S&&nt(B.parentNode.parentNode,"group")===A:Ht(B)===C});return F.length===0?void 0:{changes:{"":F.reverse().map(B=>({range:Ue(B),newText:x}))}}}async provideHover(g,h){if(!this.data)return;const x=await R(this,u,Fe).call(this,g);let{offsetNode:b,offset:m}=ln(x,w(this,e),h);b.type==="text"&&(m+=b.getRelativeIndex(),b=b.parentNode);const{type:y,parentNode:S,length:A,name:L}=b;let C,F,B,O;if(b.is("double-underscore")&&m>0)C=R(this,u,Nn).call(this,b.name);else if(y==="magic-word-name")C=R(this,u,bt).call(this,S.name),F=b.text().trim(),B=S.getAttribute("colon");else if(b.is("magic-word")&&!b.modifier&&A===1&&(m>0||x.posFromIndex(b.getAbsoluteIndex()).left===h.character))C=R(this,u,bt).call(this,L),F=b.firstChild.text().trim(),B=b.getAttribute("colon");else if((b.is("magic-word")||b.is("template"))&&b.modifier&&m>=2&&b.getRelativeIndex(0)>m&&(F=b.modifier.trim().slice(0,-1),C=R(this,u,bt).call(this,F.toLowerCase()),B=":",C)){const E=b.getAbsoluteIndex();O={start:mt(x,E+2),end:mt(x,E+b.modifier.trimEnd().length+1)}}return C&&{contents:{kind:"markdown",value:(C.signatures?`${C.signatures.map(E=>`- **{{ ${F}${E.length===0?"**":`${B}** `}${E.map(({label:D,const:W})=>W?D:`*${D}*`).join(" **|** ")} **}}**`).join(`
30
30
  `)}
31
31
 
32
- `:"")+C.description},range:O!=null?O:Me(w)}}async provideSignatureHelp(g,c){if(!this.data)return;const{line:p,character:w}=c,v=g.split(/\r?\n/u,p+1)[p],{lastChild:y}=await R(this,u,Cn).call(this,`${v.slice(0,w+/^[^{}<]*/u.exec(v.slice(w))[0].length)}}}`);if(!y.is("magic-word")||y.length===1)return;const{name:S,childNodes:A,firstChild:j}=y,C=R(this,u,vt).call(this,S);if(!(C!=null&&C.signatures))return;const L=A.length-1,B=C.signatures.filter(W=>{var q;return(W.length>=L||((q=W[W.length-1])==null?void 0:q.rest))&&W.every(({label:z,const:U},Q)=>{var se;const J=U&&Q<L&&((se=A[Q+1])==null?void 0:se.text().trim());return!J||z.toLowerCase().includes(J.toLowerCase())})});if(B.length===0)return;let O=-1;for(let W=y.getAbsoluteIndex()+y.getAttribute("padding");O<L&&(W+=A[O+1].toString().length+1,!(W>w));O++);const F=j.text().trim(),D=y.getAttribute("colon");return{signatures:B.map(W=>({label:`{{${F}${W.length===0?"":D}${W.map(({label:q})=>q).join("|")}}}`,parameters:W.map(({label:q,const:z})=>({label:q,...z?{documentation:"Predefined parameter"}:void 0})),...W.length<L?{activeParameter:Math.min(O,W.length-1)}:void 0})),activeParameter:O}}async provideInlayHints(g){const c=await R(this,u,Fe).call(this,g);let p=[];for(const w of c.querySelectorAll("template,magic-word#invoke").reverse()){const{type:v,childNodes:y}=w;p=[...p,...y.slice(v==="template"?1:3).filter(({anon:S})=>S).reverse().map(S=>({position:ft(c,S.getAbsoluteIndex()),label:`${S.name}=`,kind:2}))]}return p}findStyleTokens(){return b(this,l).querySelectorAll(uo).filter(({lastChild:g})=>Os(g))}async provideRefactoringAction(g,c){let p,w;if(c){const{start:S,end:A}=c;if(S.line===A.line&&S.character===A.character)return[];p=g.split(/\r?\n/u,A.line+1),w=S.line===A.line?p[A.line].slice(S.character,A.character):`${p[S.line].slice(S.character)}
33
- ${p.slice(S.line+1,A.line).join(`
34
- `)}${p.length===2?"":`
35
- `}${p[A.line].slice(0,A.character)}`}else if(g)p=g.split(/\r?\n/u),w=p.join(`
36
- `),c={start:{line:0,character:0},end:{line:p.length-1,character:p[p.length-1].length}};else return[];const v=await R(this,u,Cn).call(this,w),{viewOnly:y}=I;return I.viewOnly=!1,v.escape(),I.viewOnly=y,[{title:"Escape with magic words",kind:"refactor.rewrite",edit:{changes:{"":[{range:c,newText:v.toString()}]}}}]}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,l=new WeakMap,n=new WeakMap,r=new WeakMap,o=new WeakMap,a=new WeakMap,u=new WeakSet,rs=function(){return b(this,r)===this.config&&b(this,o)===this.include},Fe=async function(g){var c;return g=us(g),!b(this,s)&&R(this,u,rs).call(this)&&b(this,e)===g?b(this,l):(E(this,e,g),(c=b(this,s))!=null||E(this,s,R(this,u,Tn).call(this)),b(this,s))},Tn=async function(){var p;(p=this.config)!=null||(this.config=I.getConfig()),E(this,r,this.config),E(this,o,this.include);const g=b(this,e),c=await I.partialParse(g,()=>b(this,e),this.include,this.config);return R(this,u,rs).call(this)&&b(this,e)===g?(E(this,l,c),E(this,s,void 0),c):(E(this,s,R(this,u,Tn).call(this)),b(this,s))},Cn=async function(g){var c;return g=us(g),!b(this,i)&&R(this,u,rs).call(this)&&b(this,t)===g?b(this,n):(E(this,t,g),(c=b(this,i))!=null||E(this,i,R(this,u,In).call(this)),b(this,i))},In=async function(){var p;(p=this.config)!=null||(this.config=I.getConfig()),E(this,r,this.config),E(this,o,this.include);const g=b(this,t),c=await I.partialParse(g,()=>b(this,t),this.include,this.config);return R(this,u,rs).call(this)&&b(this,t)===g?(E(this,n,c),E(this,i,void 0),c):(E(this,i,R(this,u,In).call(this)),b(this,i))},lu=function(){var g;if(!b(this,a)||b(this,a)[1]!==this.config){(g=this.config)!=null||(this.config=I.getConfig());const{nsid:c,ext:p,html:w,parserFunction:[v,y,...S],doubleUnderscore:A,protocol:j,img:C}=this.config,L=new Set([p,w].flat(2)),B=new RegExp("(?:"+String.raw`<(\/?\w*)`+"|"+String.raw`(\{{2,4}|\[\[)\s*([^|{}<>[\]\s][^|{}<>[\]#]*)?`+"|"+String.raw`(__(?:(?!__)[\p{L}\p{N}_])*)`+"|"+String.raw`(?<!\[)\[([a-z:/]*)`+"|"+String.raw`\[\[\s*(?:${Object.entries(c).filter(([,O])=>O===6).map(([O])=>O).join("|")})\s*:[^[\]{}<>]+\|([^[\]{}<>|=]*)`+"|"+String.raw`<(\w+)(?:\s(?:[^<>{}|=\s]+(?:\s*=\s*(?:[^\s"']\S*|(["']).*?\8))?(?=\s))*)?\s(\w*)`+")$","iu");E(this,a,[{re:B,ext:p,tags:L,allTags:[...L,"onlyinclude","includeonly","noinclude"],functions:[Object.keys(v),Array.isArray(y)?y:Object.keys(y),S].flat(2),switches:A.slice(0,2).flat().map(O=>`__${O}__`),protocols:j.split("|"),params:Object.keys(C).filter(O=>O.endsWith("$1")||!O.includes("$1")).map(O=>O.replace(/\$1$/u,""))},this.config])}return b(this,a)[0]},Nn=function(g){return this.data.behaviorSwitches.find(({aliases:c})=>c.includes(g))},vt=function(g){return this.data.parserFunctions.find(({aliases:c})=>c.some(p=>p.replace(/^#/u,"")===g))},T)}}),ou={};ae(ou,{default:()=>I});au.exports=ee(ou);var Ns,un,po,ze,dn,fo,I,G=N({"index.ts"(){jn(),Oe(),dt(),fe(),ad(),Ns=!0,un=new $n,ze={config:hn,get rules(){return as},get i18n(){return{...Ao,...po}},set i18n(e){po=e},get lintConfig(){return un},set lintConfig(e){un=new $n(e)},get viewOnly(){return Ns},set viewOnly(e){Ns&&!e&&we.rev++,Ns=e},getConfig(e){const t=e!=null?e:this.config,{doubleUnderscore:s,ext:i,parserFunction:l,variable:n}=t;for(let r=0;r<2;r++)s.length>r+2&&s[r].length===0&&(s[r]=Object.keys(s[r+2]));return i.includes("translate")&&!n.includes("translationlanguage")&&(n.push("translationlanguage"),Array.isArray(l[1])?l[1].push("TRANSLATIONLANGUAGE"):l[1].TRANSLATIONLANGUAGE="translationlanguage"),{...hn,...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=ze.getConfig(),l){const{Title:n}=(ud(),ee(su));let r;if(l!=null&&l.halfParsed)r=new n(e,t,i,l);else{const{Token:o}=(V(),ee(os));r=we.run(()=>{const a=new o(e,i);a.type="root",a.parseOnce(0,s).parseOnce();const u=new n(a.toString(),t,i,l);a.build();for(const d of["main","fragment"]){const h=u[d];if(h!=null&&h.includes("\0")){const m=a.buildFromStr(h,1);d==="main"?u.main=m:u.setFragment(m)}}return u})}return r},parse(e,t,s=_e,i=ze.getConfig()){e=us(e);let l;typeof s!="number"&&(l=Array.isArray(s)?s:[s],s=Math.max(...l.map(o=>yo[o]||_e)));const{Token:n}=(V(),ee(os));return we.run(()=>{const o=new n(e,i);return o.type="root",o.parse(s,t)})},async partialParse(e,t,s,i=ze.getConfig()){{const{Token:l}=(V(),ee(os)),n=typeof setImmediate=="function"?setImmediate:setTimeout,{running:r}=we;we.running=!0;const o=new l(us(e),i);o.type="root";let a=0;try{await new Promise(u=>{const d=()=>{t()===e?(a++,n(h,0)):u()},h=()=>{a===_e+1?(o.afterBuild(),u()):(o[a===_e?"build":"parseOnce"](a,s),d())};n(h,0)})}catch(u){throw we.running=r,u}return we.running=r,o}},createLanguageService(e={}){var t;{const s=(dd(),ee(nu)),{LanguageService:i,tasks:l}=s;return(t=l.get(e))!=null?t:new i(e)}throw new Error("Parser.createLanguageService method is only available in the LSP version!")}},dn={},fo=new Set(["lintConfig","normalizeTitle","parse","createLanguageService"]);for(const e in ze)fo.has(e)||(dn[e]={enumerable:!1});Object.defineProperties(ze,dn),Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:ze}),I=ze}});G()});cd();})();
32
+ `:"")+C.description},range:O!=null?O:Ue(b)}}async provideSignatureHelp(g,h){if(!this.data)return;const{line:x,character:b}=h,m=g.split(/\r?\n/u,x+1)[x],{lastChild:y}=await R(this,u,Cn).call(this,`${m.slice(0,b+/^[^{}<]*/u.exec(m.slice(b))[0].length)}}}`);if(!y.is("magic-word")||y.length===1)return;const{name:S,childNodes:A,firstChild:L}=y,C=R(this,u,bt).call(this,S);if(!(C!=null&&C.signatures))return;const F=A.length-1,B=C.signatures.filter(W=>{var q;return(W.length>=F||((q=W[W.length-1])==null?void 0:q.rest))&&W.every(({label:z,const:M},Q)=>{var se;const J=M&&Q<F&&((se=A[Q+1])==null?void 0:se.text().trim());return!J||z.toLowerCase().includes(J.toLowerCase())})});if(B.length===0)return;let O=-1;for(let W=y.getAbsoluteIndex()+y.getAttribute("padding");O<F&&(W+=A[O+1].toString().length+1,!(W>b));O++);const E=L.text().trim(),D=y.getAttribute("colon");return{signatures:B.map(W=>({label:`{{${E}${W.length===0?"":D}${W.map(({label:q})=>q).join("|")}}}`,parameters:W.map(({label:q,const:z})=>({label:q,...z?{documentation:"Predefined parameter"}:void 0})),...W.length<F?{activeParameter:Math.min(O,W.length-1)}:void 0})),activeParameter:O}}async provideInlayHints(g){const h=await R(this,u,Fe).call(this,g);let x=[];for(const b of h.querySelectorAll("template,magic-word#invoke").reverse()){const{type:m,childNodes:y}=b;x=[...x,...y.slice(m==="template"?1:3).filter(({anon:S})=>S).reverse().map(S=>({position:mt(h,S.getAbsoluteIndex()),label:`${S.name}=`,kind:2}))]}return x}findStyleTokens(){return w(this,l).querySelectorAll(ao).filter(({lastChild:g})=>Os(g))}async provideRefactoringAction(g,h){let x,b;if(h){const{start:S,end:A}=h;if(S.line===A.line&&S.character===A.character)return[];x=g.split(/\r?\n/u,A.line+1),b=S.line===A.line?x[A.line].slice(S.character,A.character):`${x[S.line].slice(S.character)}
33
+ ${x.slice(S.line+1,A.line).join(`
34
+ `)}${x.length===2?"":`
35
+ `}${x[A.line].slice(0,A.character)}`}else if(g)x=g.split(/\r?\n/u),b=x.join(`
36
+ `),h={start:{line:0,character:0},end:{line:x.length-1,character:x[x.length-1].length}};else return[];const m=await R(this,u,Cn).call(this,b),{viewOnly:y}=N;return N.viewOnly=!1,m.escape(),N.viewOnly=y,[{title:"Escape with magic words",kind:"refactor.rewrite",edit:{changes:{"":[{range:h,newText:m.toString()}]}}}]}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,l=new WeakMap,n=new WeakMap,r=new WeakMap,o=new WeakMap,a=new WeakMap,u=new WeakSet,rs=function(){return w(this,r)===this.config&&w(this,o)===this.include},Fe=async function(g){var h;return g=us(g),!w(this,s)&&R(this,u,rs).call(this)&&w(this,e)===g?w(this,l):(j(this,e,g),(h=w(this,s))!=null||j(this,s,R(this,u,Tn).call(this)),w(this,s))},Tn=async function(){var x;(x=this.config)!=null||(this.config=N.getConfig()),j(this,r,this.config),j(this,o,this.include);const g=w(this,e),h=await N.partialParse(g,()=>w(this,e),this.include,this.config);return R(this,u,rs).call(this)&&w(this,e)===g?(j(this,l,h),j(this,s,void 0),h):(j(this,s,R(this,u,Tn).call(this)),w(this,s))},Cn=async function(g){var h;return g=us(g),!w(this,i)&&R(this,u,rs).call(this)&&w(this,t)===g?w(this,n):(j(this,t,g),(h=w(this,i))!=null||j(this,i,R(this,u,In).call(this)),w(this,i))},In=async function(){var x;(x=this.config)!=null||(this.config=N.getConfig()),j(this,r,this.config),j(this,o,this.include);const g=w(this,t),h=await N.partialParse(g,()=>w(this,t),this.include,this.config);return R(this,u,rs).call(this)&&w(this,t)===g?(j(this,n,h),j(this,i,void 0),h):(j(this,i,R(this,u,In).call(this)),w(this,i))},ru=function(){var g;if(!w(this,a)||w(this,a)[1]!==this.config){(g=this.config)!=null||(this.config=N.getConfig());const{nsid:h,ext:x,html:b,parserFunction:[m,y,...S],doubleUnderscore:A,protocol:L,img:C}=this.config,F=new Set([x,b].flat(2)),B=new RegExp("(?:"+String.raw`<(\/?\w*)`+"|"+String.raw`(\{{2,4}|\[\[)\s*([^|{}<>[\]\s][^|{}<>[\]#]*)?`+"|"+String.raw`(__(?:(?!__)[\p{L}\p{N}_])*)`+"|"+String.raw`(?<!\[)\[([a-z:/]*)`+"|"+String.raw`\[\[\s*(?:${Object.entries(h).filter(([,O])=>O===6).map(([O])=>O).join("|")})\s*:[^[\]{}<>]+\|([^[\]{}<>|=]*)`+"|"+String.raw`<(\w+)(?:\s(?:[^<>{}|=\s]+(?:\s*=\s*(?:[^\s"']\S*|(["']).*?\8))?(?=\s))*)?\s(\w*)`+")$","iu");j(this,a,[{re:B,ext:x,tags:F,allTags:[...F,"onlyinclude","includeonly","noinclude"],functions:[Object.keys(m),Array.isArray(y)?y:Object.keys(y),S].flat(2),switches:A.slice(0,2).flat().map(O=>`__${O}__`),protocols:L.split("|"),params:Object.keys(C).filter(O=>O.endsWith("$1")||!O.includes("$1")).map(O=>O.replace(/\$1$/u,""))},this.config])}return w(this,a)[0]},Nn=function(g){return this.data.behaviorSwitches.find(({aliases:h})=>h.includes(g))},bt=function(g){return this.data.parserFunctions.find(({aliases:h})=>h.some(x=>x.replace(/^#/u,"")===g))},T)}}),lu={};ae(lu,{default:()=>N});ou.exports=ee(lu);var Ns,un,go,ze,dn,po,N,G=I({"index.ts"(){jn(),Oe(),Je(),fe(),od(),Ns=!0,un=new $n,ze={config:hn,get rules(){return as},get i18n(){return{...So,...go}},set i18n(e){go=e},get lintConfig(){return un},set lintConfig(e){un=new $n(e)},get viewOnly(){return Ns},set viewOnly(e){Ns&&!e&&we.rev++,Ns=e},getConfig(e){const t=e!=null?e:this.config,{doubleUnderscore:s,ext:i,parserFunction:l,variable:n}=t;for(let r=0;r<2;r++)s.length>r+2&&s[r].length===0&&(s[r]=Object.keys(s[r+2]));return i.includes("translate")&&!n.includes("translationlanguage")&&(n.push("translationlanguage"),Array.isArray(l[1])?l[1].push("TRANSLATIONLANGUAGE"):l[1].TRANSLATIONLANGUAGE="translationlanguage"),{...hn,...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=ze.getConfig(),l){const{Title:n}=(ad(),ee(tu));let r;if(l!=null&&l.halfParsed)r=new n(e,t,i,l);else{const{Token:o}=(V(),ee(os));r=we.run(()=>{const a=new o(e,i);a.type="root",a.parseOnce(0,s).parseOnce();const u=new n(a.toString(),t,i,l);a.build();for(const d of["main","fragment"]){const c=u[d];if(c!=null&&c.includes("\0")){const f=a.buildFromStr(c,1);d==="main"?u.main=f:u.setFragment(f)}}return u})}return r},parse(e,t,s=ke,i=ze.getConfig()){e=us(e);let l;typeof s!="number"&&(l=Array.isArray(s)?s:[s],s=Math.max(...l.map(o=>wo[o]||ke)));const{Token:n}=(V(),ee(os));return we.run(()=>{const o=new n(e,i);return o.type="root",o.parse(s,t)})},async partialParse(e,t,s,i=ze.getConfig()){{const{Token:l}=(V(),ee(os)),n=typeof setImmediate=="function"?setImmediate:setTimeout,{running:r}=we;we.running=!0;const o=new l(us(e),i);o.type="root";let a=0;try{await new Promise(u=>{const d=()=>{t()===e?(a++,n(c,0)):u()},c=()=>{a===ke+1?(o.afterBuild(),u()):(o[a===ke?"build":"parseOnce"](a,s),d())};n(c,0)})}catch(u){throw we.running=r,u}return we.running=r,o}},createLanguageService(e={}){var t;{const s=(ud(),ee(iu)),{LanguageService:i,tasks:l}=s;return(t=l.get(e))!=null?t:new i(e)}throw new Error("Parser.createLanguageService method is only available in the LSP version!")}},dn={},po=new Set(["lintConfig","normalizeTitle","parse","createLanguageService"]);for(const e in ze)po.has(e)||(dn[e]={enumerable:!1});Object.defineProperties(ze,dn),Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:ze}),N=ze}});G()});dd();})();
37
37
  //# sourceMappingURL=bundle-lsp.min.js.map