wikiparser-node 1.22.1 → 1.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/bundle-es8.min.js +22 -22
- package/bundle/bundle-lsp.min.js +26 -26
- package/bundle/bundle.min.js +22 -22
- package/dist/index.d.ts +1 -1
- package/dist/lib/element.d.ts +3 -57
- package/dist/lib/element.js +12 -122
- package/dist/lib/lsp.js +1 -1
- package/dist/lib/node.d.ts +3 -8
- package/dist/lib/node.js +16 -22
- package/dist/lib/range.d.ts +90 -4
- package/dist/lib/range.js +596 -391
- package/dist/lib/text.js +1 -1
- package/dist/lib/title.js +1 -1
- package/dist/mixin/attributesParent.js +2 -12
- package/dist/mixin/elementLike.d.ts +65 -0
- package/dist/mixin/elementLike.js +93 -0
- package/dist/mixin/fixed.js +2 -3
- package/dist/mixin/gapped.js +2 -2
- package/dist/mixin/hidden.js +2 -2
- package/dist/mixin/multiLine.js +2 -2
- package/dist/mixin/noEscape.js +2 -2
- package/dist/mixin/nodeLike.d.ts +17 -0
- package/dist/mixin/nodeLike.js +29 -0
- package/dist/mixin/padded.js +2 -1
- package/dist/mixin/singleLine.js +2 -1
- package/dist/mixin/sol.js +2 -2
- package/dist/mixin/syntax.js +2 -2
- package/dist/parser/selector.js +3 -0
- package/dist/src/atom.d.ts +1 -1
- package/dist/src/html.d.ts +8 -0
- package/dist/src/html.js +20 -0
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +2 -1
- package/dist/src/link/galleryImage.js +1 -1
- package/dist/src/nested.js +1 -1
- package/dist/src/paramTag/index.d.ts +1 -1
- package/dist/src/syntax.d.ts +1 -1
- package/dist/src/table/base.d.ts +1 -1
- package/dist/src/table/index.d.ts +0 -1
- package/dist/src/table/index.js +1 -1
- package/dist/src/transclude.js +1 -1
- package/dist/util/debug.js +2 -0
- package/dist/util/sharable.js +1 -1
- package/dist/util/sharable.mjs +1 -1
- package/extensions/dist/base.js +1 -1
- package/package.json +1 -2
package/bundle/bundle-es8.min.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
"use strict";(()=>{var Vo=Object.defineProperty,Qo=Object.defineProperties;var Jo=Object.getOwnPropertyDescriptors;var mn=Object.getOwnPropertySymbols;var Xo=Object.prototype.hasOwnProperty,Ko=Object.prototype.propertyIsEnumerable;var vn=e=>{throw TypeError(e)};var ks=(e,t,s)=>t in e?Vo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,fe=(e,t)=>{for(var s in t||(t={}))Xo.call(t,s)&&ks(e,s,t[s]);if(mn)for(var s of mn(t))Ko.call(t,s)&&ks(e,s,t[s]);return e},Se=(e,t)=>Qo(e,Jo(t));var Yo=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var ke=(e,t,s)=>ks(e,typeof t!="symbol"?t+"":t,s),_s=(e,t,s)=>t.has(e)||vn("Cannot "+s);var f=(e,t,s)=>(_s(e,t,"read from private field"),s?s.call(e):t.get(e)),N=(e,t,s)=>t.has(e)?vn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),L=(e,t,s,n)=>(_s(e,t,"write to private field"),n?n.call(e,s):t.set(e,s),s),j=(e,t,s)=>(_s(e,t,"access private method"),s);var bn=(e,t,s,n)=>({set _(l){L(e,t,l,s)},get _(){return f(e,t,n)}});var Za=Yo((td,Go)=>{var Zo=Object.create,nt=Object.defineProperty,rl=Object.getOwnPropertyDescriptor,Gi=Object.getOwnPropertyNames,ea=Object.prototype.hasOwnProperty,ll=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),rt=e=>{throw TypeError(e)},ol=(e,t,s)=>t in e?nt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,wn=(e,t)=>nt(e,"name",{value:t,configurable:!0}),T=(e,t)=>function(){return e&&(t=(0,e[Gi(e)[0]])(e=0)),t},ta=(e,t)=>function(){return t||(0,e[Gi(e)[0]])((t={exports:{}}).exports,t),t.exports},Y=(e,t)=>{for(var s in t)nt(e,s,{get:t[s],enumerable:!0})},sa=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of Gi(t))!ea.call(e,l)&&l!==s&&nt(e,l,{get:()=>t[l],enumerable:!(n=rl(t,l))||n.enumerable});return e},G=e=>sa(nt({},"__esModule",{value:!0}),e),Z=e=>{var t;return[,,,Zo((t=e==null?void 0:e[ll("metadata")])!=null?t:null)]},al=["class","method","getter","setter","accessor","field","value","get","set"],mt=e=>e!==void 0&&typeof e!="function"?rt("Function expected"):e,ia=(e,t,s,n,l)=>({kind:al[e],name:t,metadata:n,addInitializer:i=>s._?rt("Already initialized"):l.push(mt(i||null))}),ds=(e,t)=>ol(t,ll("metadata"),e[3]),ee=(e,t,s,n)=>{for(var l=0,i=e[t>>1],r=i&&i.length;l<r;l++)t&1?i[l].call(s):n=i[l].call(s,n);return n},te=(e,t,s,n,l,i)=>{var r,o,a,h,d,u=t&7,g=!!(t&8),c=!!(t&16),p=u>3?e.length+1:u?g?1:2:0,v=al[u+5],m=u>3&&(e[p-1]=[]),x=e[p]||(e[p]=[]),b=u&&(!c&&!g&&(l=l.prototype),u<5&&(u>3||!c)&&rl(u<4?l:{get[s](){return de(this,i)},set[s](y){return xe(this,i,y)}},s));u?c&&u<4&&wn(i,(u>2?"set ":u>1?"get ":"")+s):wn(l,s);for(var w=n.length-1;w>=0;w--)h=ia(u,s,a={},e[3],x),u&&(h.static=g,h.private=c,d=h.access={has:c?y=>ra(l,y):y=>s in y},u^3&&(d.get=c?y=>(u^1?de:Lt)(y,l,u^4?i:b.get):y=>y[s]),u>2&&(d.set=c?(y,A)=>xe(y,l,A,u^4?i:b.set):(y,A)=>y[s]=A)),o=(0,n[w])(u?u<4?c?i:b[v]:u>4?void 0:{get:b.get,set:b.set}:l,h),a._=1,u^4||o===void 0?mt(o)&&(u>4?m.unshift(o):u?c?i=o:b[v]=o:l=o):typeof o!="object"||o===null?rt("Object expected"):(mt(r=o.get)&&(b.get=r),mt(r=o.set)&&(b.set=r),mt(r=o.init)&&m.unshift(r));return u||ds(e,l),b&&nt(l,s,b),c?u^4?i:b:l},na=(e,t,s)=>ol(e,typeof t!="symbol"?t+"":t,s),Vi=(e,t,s)=>t.has(e)||rt("Cannot "+s),ra=(e,t)=>Object(t)!==t?rt('Cannot use the "in" operator on this value'):e.has(t),de=(e,t,s)=>(Vi(e,t,"read from private field"),s?s.call(e):t.get(e)),_e=(e,t,s)=>t.has(e)?rt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),xe=(e,t,s,n)=>(Vi(e,t,"write to private field"),n?n.call(e,s):t.set(e,s),s),Lt=(e,t,s)=>(Vi(e,t,"access private method"),s),la=(e,t,s,n)=>({set _(l){xe(e,t,l,s)},get _(){return de(e,t,n)}}),dl,Qi,hl=T({"base.ts"(){"use strict";dl=(()=>{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})(),Qi=(()=>{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 Ze(e){const t=new Map,s=new WeakMap;return n=>{const l=typeof n=="string"?t:s;if(l.has(n)){const r=l.get(n);return r.lastIndex=0,r}const i=e(n);return l.set(n,i),i}}var Ft,ul,Rt=T({"../common/dist/index.mjs"(){"use strict";Ft=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25")),ul=Ze}}),Ne,$s,et,tt,st,$e,Ge,cl,ve,We,yn,Sn,jt,gl,An,kn,Et,it,oe=T({"util/string.ts"(){"use strict";Rt(),Ne=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,$s=String.raw`[^[\]<>"\0-\x1F\x7F${Ne}\uFFFD]`,et=String.raw`(?:\[[\da-f:.]+\]|${$s})`,tt=String.raw`(?:${$s}|\0\d+[cn!~]\x7F)*`,st=e=>e.trim().toLowerCase(),$e=(e,t)=>e.replace(/\0(\d+)\x7F/gu,(s,n)=>t[n]),Ge=(e,t)=>s=>s.replace(e,t),cl=Ge(/[\0\x7F]|\r$/gmu,""),ve=Ge(/\0\d+[cn]\x7F/gu,""),We=(e,t="")=>e.map(s=>typeof s=="string"?s:s.text()).join(t),yn={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},Sn=Ge(/&(?:#(\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)):yn[s.toLowerCase()]),jt=e=>Sn(e),gl=Ge(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),An={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},kn=e=>Ge(e,t=>`&${An[t]};`),Et=kn(/[&<>]/gu),it=(e,t={})=>{const{pre:s="",post:n="",sep:l=""}=t;return s+e.map(i=>i.print()).join(l)+n}}}),oa=ta({"config/minimum.json"(e,t){t.exports={ext:[],html:[["b","bdi","del","i","ins","u","font","big","small","sub","sup","h1","h2","h3","h4","h5","h6","cite","code","em","s","strike","strong","tt","var","div","center","blockquote","ol","ul","dl","table","caption","pre","ruby","rb","rp","rt","rtc","p","span","abbr","dfn","kbd","samp","data","time","mark","tr","td","th","q","bdo"],["li","dt","dd"],["br","wbr","hr","meta","link"]],namespaces:{0:"",6:"File",10:"Template",14:"Category",828:"Module"},nsid:{"":0,file:6,template:10,category:14,module:828},functionHook:["msgnw"],variable:["!","=","pageid","articlepath","server","servername","scriptpath","stylepath"],parserFunction:[{msgnw:"msgnw",pageid:"pageid",articlepath:"articlepath",server:"server",servername:"servername",scriptpath:"scriptpath",stylepath:"stylepath","#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"formatdate","#dateformat":"formatdate","#invoke":"invoke","#while":"while","#dowhile":"dowhile","#loop":"loop","#forargs":"forargs","#fornumargs":"fornumargs","#if":"if","#ifeq":"ifeq","#switch":"switch","#ifexist":"ifexist","#ifexpr":"ifexpr","#iferror":"iferror","#time":"time","#timel":"timel","#expr":"expr","#rel2abs":"rel2abs","#titleparts":"titleparts","#categorytree":"categorytree","#urldecode":"urldecode","#choose":"choose","#var":"var","#varexists":"varexists","#var_final":"var_final","#vardefine":"vardefine","#vardefineecho":"vardefineecho","#widget":"widget","#related":"related","#regex":"regex","#regex_var":"regex_var","#regexquote":"regexquote","#regexall":"regexall","#len":"len","#pos":"pos","#rpos":"rpos","#sub":"sub","#count":"count","#rmatch":"rmatch","#rreplace":"rreplace","#replace":"replace","#rsplit":"rsplit","#explode":"explode","#tab":"tab","#seo":"seo","#babel":"babel","#translation":"translation","#commaseparatedlist":"commaseparatedlist","#coordinates":"coordinates","#lst":"lst","#lsth":"lsth","#lstx":"lstx","#assessment":"assessment","#mentor":"mentor","#property":"property","#target":"target","#section":"lst","#section-x":"lstx","#section-h":"lsth","#statements":"statements","#useliquidthreads":"useliquidthreads","#lqtpagelimit":"lqtpagelimit","#avatar":"avatar","#img":"img","#chart":"chart"},{"!":"!","=":"=","#FORMAL":"formal","#bcp47":"bcp47","#dir":"dir","#interwikilink":"interwikilink","#interlanguagelink":"interlanguagelink","#timef":"timef","#timefl":"timefl"},["msg","raw"],["subst","safesubst"]],doubleUnderscore:[[],[]],protocol:"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|matrix:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|wikipedia://|worldwind://|xmpp:",interwiki:[],img:{},redirection:["#redirect"],variants:[]}}}),me,Li,Me=T({"util/constants.ts"(){"use strict";me=11,Li=oa()}}),le,ae=T({"lib/rect.ts"(){"use strict";var e,t,s,n,Fi,i;le=(i=class{constructor(r,o){N(this,n);N(this,e);N(this,t);N(this,s);L(this,e,r),L(this,t,o)}get start(){return f(this,t)}get top(){return j(this,n,Fi).call(this).top}get left(){return j(this,n,Fi).call(this).left}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n=new WeakSet,Fi=function(){var r;return(r=f(this,s))!=null||L(this,s,f(this,e).getRootNode().posFromIndex(f(this,t))),f(this,s)},i)}}),_n,$n,It,ji,Ts,R,V,qe,pl,M=T({"util/lint.ts"(){"use strict";pe(),ae(),B(),_n=new Set(["tr","td","th","caption"]),$n=new Set(["Template:!!","Template:!-"]),It=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")&&$n.has(t.name)||t.is("html")&&_n.has(t.name))return!1;if(t.is("arg"))return t.length>1&&It(t.childNodes[1]);if(t.is("magic-word"))try{const s=t.getPossibleValues().map(It);return s.includes(2)?2:s.includes(1)&&1}catch(s){}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?1:2},ji=(e,t,s,n)=>({line:e+s-1,character:(s===1?t:0)+n}),Ts=e=>(t,s,n,l,i="error")=>{const{start:r}=s,{top:o,left:a}=s instanceof le?s:new le(t,r),{offsetHeight:h,offsetWidth:d}=t,{startIndex:u,startLine:g,startCol:c}=e(t,r,o,a),{line:p,character:v}=ji(g,c,h,d);return{rule:n,message:_.msg(l),severity:i,startIndex:u,endIndex:u+t.toString().length,startLine:g,endLine:p,startCol:c,endCol:v}},R=Ts((e,t,s,n)=>{const l=e.getRelativeIndex(),{top:i,left:r}=e.parentNode.posFromIndex(l);return{startIndex:t+l,startLine:s+i,startCol:i?r:n+r}}),V=Ts((e,t,s,n)=>({startIndex:t,startLine:s,startCol:n})),qe=(e,t,s,n)=>{if(e&&(n||_.viewOnly&&e[0]===be.rev))return e[1];const l=t();return(n||_.viewOnly)&&s([be.rev,l]),l},pl=(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"]:[]}}),Tn,Yt,aa=T({"parser/selector.ts"(){"use strict";Tn=(e,t,s)=>{if(e.includes("#")){const n=e.indexOf("#");return(n===0||e.slice(0,n)===t)&&e.slice(n+1)===s}return!e||e===t},Yt=(e,t,s)=>{const n=e.split(",");return({type:l,name:i})=>n.some(r=>Tn(r.trim(),l,i))}}}),hs,Ji=T({"mixin/cached.ts"(){"use strict";M(),hs=(e=!0)=>t=>{const s=new WeakMap;return function(...n){return qe(s.get(this),()=>t.apply(this,n),l=>{s.set(this,l)},e)}}}}),Cn,qt,dt,ht,Wt,ut,ct,Mt,Cs,Ut,Nt,fl=T({"lib/node.ts"(){"use strict";M(),pe(),Ji(),B(),Cn=[hs(!1)],Nt=class{constructor(){ee(Ut,5,this),_e(this,Mt),na(this,"childNodes",[]),_e(this,qt),_e(this,dt),_e(this,ht),_e(this,Wt),_e(this,ut),_e(this,ct,{})}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get parentNode(){return de(this,qt)}get nextSibling(){return de(this,dt)}get previousSibling(){return de(this,ht)}get offsetHeight(){return Lt(this,Mt,Cs).call(this).height}get offsetWidth(){return Lt(this,Mt,Cs).call(this).width}getChildNodes(){const{childNodes:e}=this;return Object.isFrozen(e)?[...e]:e}getAttribute(e){return e==="padding"?0:this[e]}setAttribute(e,t){switch(e){case"parentNode":xe(this,qt,t),t||(xe(this,dt,void 0),xe(this,ht,void 0));break;case"nextSibling":xe(this,dt,t);break;case"previousSibling":xe(this,ht,t);break;case"aIndex":_.viewOnly&&xe(this,ut,[be.rev,t]);break;default:this[e]=t}}getRootNode(){return qe(de(this,Wt),()=>{var e,t;return(t=(e=this.parentNode)==null?void 0:e.getRootNode())!=null?t:this},e=>{const[,t]=e;t.type==="root"&&xe(this,Wt,e)})}indexFromPos(e,t){this.lspError("AstNode.indexFromPos")}posFromIndex(e){const{length:t}=String(this);if(e+=e<0?t:0,e>=0&&e<=t){const s=this.getLines(),n=s.findIndex(([,,l])=>e<=l);return{top:n,left:e-s[n][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 qe(de(this,ct)[e],()=>{const{childNodes:t}=this,s=e+(e<0?t.length:0);let n=this.getAttribute("padding");for(let l=0;l<s;l++)_.viewOnly&&(de(this,ct)[l]=[be.rev,n]),n+=t[l].toString().length+this.getGaps(l);return n},t=>{de(this,ct)[e]=t})}getAbsoluteIndex(){return qe(de(this,ut),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{xe(this,ut,e)})}getBoundingClientRect(){this.lspError("AstNode.getBoundingClientRect")}is(e){return this.type===e}getLines(){const e=[];let t=0;for(const s of String(this).split(`
|
|
2
|
-
`)){const n=t+s.length;e.push([s,t,n]),t=n+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!`)}},Ut=Z(null),qt=new WeakMap,dt=new WeakMap,ht=new WeakMap,Wt=new WeakMap,ut=new WeakMap,ct=new WeakMap,Mt=new WeakSet,Cs=function(){const e=this.getLines(),t=e[e.length-1];return{height:e.length,width:t[2]-t[1]}},te(Ut,1,"getLines",Cn,Nt),ds(Ut,Nt)}}),xl,da=T({"lib/element.ts"(){"use strict";var e,Ei,Pi,n;oe(),pe(),aa(),fl(),xl=(n=class extends Nt{constructor(){super(...arguments);N(this,e)}get length(){return this.childNodes.length}text(i){return We(this.childNodes,i)}normalize(){const i=this.getChildNodes(),r=o=>{var a,h;i.splice(o,1),(a=i[o-1])==null||a.setAttribute("nextSibling",i[o]),(h=i[o])==null||h.setAttribute("previousSibling",i[o-1])};for(let o=i.length-1;o>=0;o--){const{type:a,data:h}=i[o];a!=="text"||i.length===1||this.getGaps(o-(o&&1))||h===""&&r(o)}this.setAttribute("childNodes",i)}removeAt(i){return as(this,i,1)[0]}insertAt(i,r=this.length){return as(this,r,0,[i]),i}closest(i){const r=Yt(i,this);let{parentNode:o}=this;for(;o;){if(r(o))return o;({parentNode:o}=o)}}querySelector(i){const r=Yt(i,this);return j(this,e,Ei).call(this,r)}querySelectorAll(i){const r=Yt(i,this);return j(this,e,Pi).call(this,r)}append(...i){this.safeAppend(i)}safeAppend(i){for(const r of i)this.insertAt(r)}replaceChildren(...i){this.safeReplaceChildren(i)}safeReplaceChildren(i){for(let r=this.length-1;r>=0;r--)this.removeAt(r);this.safeAppend(i)}setText(i,r=0){r+=r<0?this.length:0;const o=this.childNodes[r],{data:a}=o;return o.replaceData(i),a}toString(i,r=""){return this.childNodes.map(o=>o.toString(i)).join(r)}caretPositionFromIndex(i){this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(i){this.lspError("AstElement.elementFromIndex")}elementFromPoint(i,r){this.lspError("AstElement.elementFromPoint")}lint(i=this.getAbsoluteIndex(),r){const o=[];for(let a=0,h=i+this.getAttribute("padding");a<this.length;a++){const d=this.childNodes[a];d.setAttribute("aIndex",h);const u=d.lint(h,r);u.length>0&&o.push(...u),h+=d.toString().length+this.getGaps(a)}return o}print(i={}){const r=i.class;return this.toString()?(r===""?"":`<span class="wpb-${r!=null?r:this.type}${this.getAttribute("invalid")?" wpb-invalid":""}">`)+it(this.childNodes,i)+(r===""?"":"</span>"):""}json(i,r=this.getAbsoluteIndex()){const o=Se(fe({},this),{type:this.type,range:[r,r+this.toString().length],childNodes:[]});for(let a=0,h=r+this.getAttribute("padding");a<this.length;a++){const d=this.childNodes[a],{length:u}=d.toString();d.setAttribute("aIndex",h),o.childNodes.push(d.type==="text"?{data:d.data,range:[h,h+u]}:d.json(void 0,h)),h+=u+this.getGaps(a)}return o}},e=new WeakSet,Ei=function(i){var r;for(const o of this.childNodes){if(o.type==="text")continue;if(i(o))return o;const a=j(r=o,e,Ei).call(r,i);if(a)return a}},Pi=function(i,r=[]){var o;for(const a of this.childNodes)a.type!=="text"&&(i(a)&&r.push(a),j(o=a,e,Pi).call(o,i,r));return r},n)}}),zt,Is,In,Nn,Ln,Fn,Ns,Ls,Ri,ha=T({"lib/text.ts"(){"use strict";var e,ml,s;oe(),M(),B(),fl(),zt=String.raw`[${Ne}\t]*`,Is=String.raw`<\s*(?:/\s*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${zt}\d)|isbn(?=[-::]?${zt}(?:\d(?:${zt}|-)){6})`,In=new RegExp(String.raw`${Is}|https?[:/]/+`,"giu"),Nn=new RegExp(Is,"giu"),Ln=new Set(["attr-value","ext-link-text","link-text"]),Fn={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},Ns=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"]);try{Ls=new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch(n){Ls=/\w/u}Ri=(s=class extends Nt{constructor(l){super();N(this,e);ke(this,"data","");this.data=l}get type(){return"text"}toString(l){var i;return l&&!((i=this.parentNode)!=null&&i.getAttribute("built"))?ve(this.data):this.data}text(){return this.data}lint(l=this.getAbsoluteIndex(),i){var C,I,U;if(i===!1)return[];const{data:r,parentNode:o,nextSibling:a,previousSibling:h}=this;if(!o)throw new Error("An isolated text node cannot be linted!");const{type:d,name:u,parentNode:g}=o;if(d==="attr-value"){const{name:F,tag:P}=g;if(P==="ref"&&(F==="name"||F==="extends"||F==="follow")||F==="group"&&(P==="ref"||P==="references")||P==="choose"&&(F==="before"||F==="after"))return[]}if(i!=null||(i=d==="free-ext-link"||d==="ext-link-url"||d==="ext-link-text"||d==="image-parameter"&&u==="link"||d==="attr-value"?Nn:In),r.search(i)===-1)return[];i.lastIndex=0;const c=[],p=a==null?void 0:a.type,v=a==null?void 0:a.name,m=h==null?void 0:h.type,x=this.getRootNode(),b=x.toString(),{ext:w,html:y,variants:A}=x.getAttribute("config"),{top:k,left:S}=x.posFromIndex(l),$=new Set(["onlyinclude","noinclude","includeonly",...w,...y[0],...y[1],...y[2],...Ns]);for(let F=i.exec(r);F;F=i.exec(r)){const[,P,X]=F;let{index:W,0:Q}=F;if(X&&X!=="]"){const{length:ce}=X;W+=ce,Q=Q.slice(ce)}Q=Q.toLowerCase();const[z]=Q,ie=z==="r"||z==="p"||z==="i",q=z==="{",D=z==="}",H=z==="[",J=z==="]";let{length:ne}=Q;if(z==="<"&&!$.has(P.toLowerCase())||H&&d==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(r.slice(W+1))||a!=null&&a.is("ext")&&v==="nowiki"&&((C=a.innerText)!=null&&C.includes("]")))||ie&&(!o.isPlain()||Ln.has(d)))continue;J&&(W||ne>1)&&i.lastIndex--;let K=l+W,re=K+ne,ue,Ae;const Pe=b[re],bs=b[K-1],ws=q||H,ys=q&&bs==="-"&&A.length>0,Ss=D&&Pe==="-"&&A.length>0,cn=H&&p==="free-ext-link"&&!r.slice(W+1).trim()||J&&m==="free-ext-link"&&!r.slice(0,W).includes("]");if(ie)ue="lonely-http",Q=Q.toUpperCase(),Ae=_.lintConfig.getSeverity(ue,Q);else if(z==="<"){ue="tag-like";let ce;/^<\s/u.test(Q)||!/[\s/>]/u.test(Pe!=null?Pe:"")?ce="invalid":Ns.has(P)&&(ce="disallowed"),Ae=_.lintConfig.getSeverity(ue,ce)}else if(ys||Ss)ue="lonely-bracket",Ae=_.lintConfig.getSeverity(ue,"converter"),ys&&W>0?(Q="-{",W--,K--,ne=2):Ss&&W<r.length-1&&(Q="}-",re++,ne=2);else if(cn)ue="lonely-bracket",Ae=_.lintConfig.getSeverity(ue,"extLink");else if(ws||D||J)if(ue="lonely-bracket",ne>1||q&&Pe===z||D&&bs===z)Ae=_.lintConfig.getSeverity(ue,"double");else{if(!H||d!=="ext-link-text"){const ce=Fn[z],As=ws?r.slice(W+1):r.slice(0,W);if(q&&((I=ce.exec(As))==null?void 0:I[0])==="}"||D&&((U=ce.exec(As))==null?void 0:U[0])==="{")continue;if(!As.includes(z)){const xn=ws?"nextSibling":"previousSibling";let Re=this[xn];for(;Re&&(Re.type!=="text"||!ce.test(Re.data));)Re=Re[xn];if(Re&&ce.exec(Re.data)[0]!==z)continue}}Ae=_.lintConfig.getSeverity(ue,"single")}else ue="lonely-http",Ae=_.lintConfig.getSeverity(ue);if(!Ae)continue;const gn=this.posFromIndex(W),{line:pn,character:fn}=ji(k,S,gn.top+1,gn.left),De={rule:ue,message:_.msg('lonely "$1"',ie||z==="h"||ys||Ss?Q:z),severity:Ae,startIndex:K,endIndex:re,startLine:pn,endLine:pn,startCol:fn,endCol:fn+ne};if(z==="<")De.suggestions=[{desc:"escape",range:[K,K+1],text:"<"}];else if(z==="h"&&d!=="link-text"&&Ls.test(bs||""))De.suggestions=[{desc:"whitespace",range:[K,K],text:" "}];else if(H&&d==="ext-link-text"){const ce=o.getAbsoluteIndex()+o.toString().length;De.suggestions=[{desc:"escape",range:[ce,ce+1],text:"]"}]}else if(J&&cn){const ce=l-h.toString().length;De.suggestions=[{desc:"left bracket",range:[ce,ce],text:"["}]}else ie&&(De.suggestions=[...F[0]===Q?[]:[{desc:"uppercase",range:[K,re],text:Q}],...Pe===":"||Pe===":"?[{desc:"whitespace",range:[re,re+1],text:" "}]:[]]);c.push(De)}return c}replaceData(l){j(this,e,ml).call(this,l)}print(){return Et(this.data)}},e=new WeakSet,ml=function(l){this.setAttribute("data",l)},s)}}),Ue,lt=T({"mixin/hidden.ts"(){"use strict";pe(),Ue=(e=!0,t=!0)=>s=>{class n extends s{text(){return""}lint(i){return e?[]:super.lint(i)}}return at(n,s),n}}}),ze,ot=T({"src/syntax.ts"(){"use strict";var e,t;O(),ze=(t=class extends E{constructor(n,l,i,r,o){super(n,i,r,o);N(this,e);L(this,e,l)}get type(){return f(this,e)}lint(n=this.getAbsoluteIndex()){return super.lint(n,!1)}},e=new WeakMap,t)}}),Te,Le=T({"mixin/padded.ts"(){"use strict";pe(),Te=({length:e})=>t=>{class s extends t{getAttribute(l){return l==="padding"?e:super.getAttribute(l)}}return at(s,t),s}}}),ge,Fe=T({"src/atom.ts"(){"use strict";var e,t;O(),ge=(t=class extends E{constructor(n,l,i,r,o){super(n,i,r,o);N(this,e);L(this,e,l)}get type(){return f(this,e)}set type(n){L(this,e,n)}getAttribute(n){var l;return n==="invalid"?this.type==="converter-flag"&&!!((l=this.parentNode)!=null&&l.isInvalidFlag(this)):super.getAttribute(n)}},e=new WeakMap,t)}}),jn,En,Fs,Pn,Ie,us=T({"src/link/base.ts"(){"use strict";var e,t,s,n;M(),Me(),oe(),ae(),Le(),B(),O(),Fe(),jn=l=>l==="redirect-target"||l==="link",En=[Te("[[")],Ie=(n=class extends(Pn=E){constructor(i,r,o,a=[],h="|"){super(void 0,o,a,{});N(this,e,!0);N(this,t);N(this,s);if(this.insertAt(new ge(i,"link-target",o,a,{})),r!==void 0){const d=new E(r,o,a,{});d.type="link-text",d.setAttribute("stage",me-1),this.insertAt(d)}L(this,t,h)}get link(){}get fragment(){return f(this,s).fragment}afterBuild(){L(this,s,this.getTitle()),f(this,t).includes("\0")&&L(this,t,this.buildFromStr(f(this,t),0)),this.setAttribute("name",f(this,s).title),super.afterBuild()}setAttribute(i,r){i==="bracket"?L(this,e,r):i==="title"?L(this,s,r):super.setAttribute(i,r)}toString(i){const r=super.toString(i,f(this,t));return f(this,e)?`[[${r}]]`:r}text(){const i=super.text("|");return f(this,e)?`[[${i}]]`:i}getAttribute(i){return i==="title"?f(this,s):super.getAttribute(i)}getGaps(i){return i===0?f(this,t).length:1}lint(i=this.getAbsoluteIndex(),r){const o=super.lint(i,r),{childNodes:[a,h],type:d}=this,{encoded:u,fragment:g}=f(this,s),c=new le(this,i);let p="unknown-page",v=_.lintConfig.getSeverity(p);if(v&&a.childNodes.some(({type:m})=>m==="template")&&o.push(R(a,c,p,"template in an internal link target",v)),p="url-encoding",v=_.lintConfig.getSeverity(p),v&&u){const m=R(a,c,p,"unnecessary URL encoding in an internal link",v);m.fix={desc:"decode",range:[m.startIndex,m.endIndex],text:Ft(a.text())},o.push(m)}if(p="pipe-like",v=_.lintConfig.getSeverity(p,"link"),v&&(d==="link"||d==="category")){const m=h==null?void 0:h.childNodes.findIndex(b=>b.type==="text"&&b.data.includes("|")),x=h==null?void 0:h.childNodes[m];if(x){const b=R(h,c,p,'additional "|" in the link text',v),w=b.startIndex+h.getRelativeIndex(m);b.suggestions=[{desc:"escape",range:[w,w+x.data.length],text:x.data.replace(/\|/gu,"|")}],o.push(b)}}if(p="no-ignored",v=_.lintConfig.getSeverity(p,"fragment"),v&&g!==void 0&&!jn(d)){const m=R(a,c,p,"useless fragment",v),x=a.childNodes.findIndex(w=>w.type==="text"&&w.data.includes("#")),b=a.childNodes[x];b&&(m.fix={desc:"remove",range:[m.startIndex+a.getRelativeIndex(x)+b.data.indexOf("#"),m.endIndex],text:""}),o.push(m)}return o}getTitle(i,r){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:r,temporary:i,decode:!0,selfLink:!0})}print(){return super.print(f(this,e)?{pre:"[[",post:"]]",sep:f(this,t)}:{sep:f(this,t)})}json(i,r=this.getAbsoluteIndex()){const o=super.json(void 0,r),{type:a,fragment:h}=this;return h!==void 0&&(a==="link"||a==="redirect-target")&&(o.fragment=h),o}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n),Fs=Z(Pn),Ie=te(Fs,0,"LinkBaseToken",En,Ie),ee(Fs,1,Ie)}}),je,He=T({"src/nowiki/base.ts"(){"use strict";O(),je=class extends E{get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}}}}),Rn,js,On,he,Ee=T({"src/nowiki/noinclude.ts"(){"use strict";lt(),He(),Rn=[Ue()],he=class extends(On=je){get type(){return"noinclude"}toString(e){return e?"":super.toString()}},js=Z(On),he=te(js,0,"NoincludeToken",Rn,he),ee(js,1,he)}}),vl,ua=T({"src/link/redirectTarget.ts"(){"use strict";M(),B(),us(),Ee(),vl=class extends Ie{get type(){return"redirect-target"}constructor(e,t,s,n){super(e,void 0,s,n),t!==void 0&&this.insertAt(new he(t,s,n))}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",n=_.lintConfig.getSeverity(s,"redirect");if(n&&this.length===2){const l=R(this.lastChild,{start:e},s,"useless link text",n);l.startIndex--,l.startCol--,l.fix={desc:"remove",range:[l.startIndex,l.endIndex],text:""},t.push(l)}return t}}}}),Bn,Es,qn,vt,ca=T({"src/redirect.ts"(){"use strict";var e,t,s;lt(),O(),ot(),ua(),Bn=[Ue(!1,!1)],vt=(s=class extends(qn=E){constructor(l,i,r,o,a,h,d=[]){super(void 0,h,d);N(this,e);N(this,t);L(this,e,l),L(this,t,a),this.append(new ze(i,"redirect-syntax",h,d),new vl(r,o==null?void 0:o.slice(1),h,d))}get type(){return"redirect"}getAttribute(l){return l==="padding"?f(this,e).length:super.getAttribute(l)}toString(l){return f(this,e)+super.toString(l)+f(this,t)}lint(l=this.getAbsoluteIndex()){const i=l+f(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",i),this.lastChild.lint(i)}print(){return super.print({pre:f(this,e),post:f(this,t)})}},e=new WeakMap,t=new WeakMap,s),Es=Z(qn),vt=te(Es,0,"RedirectToken",Bn,vt),ee(Es,1,vt)}}),bl={};Y(bl,{parseRedirect:()=>wl});var wl,ga=T({"parser/redirect.ts"(){"use strict";B(),ca(),wl=(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 n=t.regexRedirect.exec(e);return n&&_.normalizeTitle(n[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0}).valid?(e=`\0${s.length}o${e.slice(n[0].length)}`,new vt(...n.slice(1),t,s),e):!1}}}),Wn,Ps,Mn,bt,pa=T({"src/onlyinclude.ts"(){"use strict";Le(),O(),Wn=[Te("<onlyinclude>")],bt=class extends(Mn=E){get type(){return"onlyinclude"}toString(e){return`<onlyinclude>${super.toString(e)}</onlyinclude>`}isPlain(){return!0}print(){return super.print({pre:'<span class="wpb-ext"><onlyinclude></span>',post:'<span class="wpb-ext"></onlyinclude></span>'})}},Ps=Z(Mn),bt=te(Ps,0,"OnlyincludeToken",Wn,bt),ee(Ps,1,bt)}}),Ot,cs=T({"mixin/gapped.ts"(){"use strict";pe(),Ot=(e=1)=>t=>{class s extends t{getGaps(){return e}}return at(s,t),s}}}),Un,Rs,zn,Be,Xi=T({"src/tagPair/index.ts"(){"use strict";var e,t;cs(),O(),Un=[Ot()],Be=(t=class extends(zn=E){constructor(n,l,i,r,o,a=[]){super(void 0,o);N(this,e);ke(this,"closed");ke(this,"selfClosing");this.setAttribute("name",n.toLowerCase()),L(this,e,[n,r||n]),this.closed=r!=="",this.selfClosing=r===void 0,this.append(l,i);const h=typeof l=="string"?-1:a.indexOf(l);a.splice(h===-1?1/0:h,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(n){const{selfClosing:l,firstChild:i,lastChild:r}=this,[o,a]=f(this,e);return l?`<${o}${i.toString(n)}/>`:`<${o}${i.toString(n)}>${r.toString(n)}${this.closed?`</${a}>`:""}`}text(){const[n,l]=f(this,e);return this.selfClosing?`<${n}${this.firstChild.text()}/>`:`<${n}${super.text(">")}${this.closed?`</${l}>`:""}`}getAttribute(n){return n==="padding"?f(this,e)[0].length+1:super.getAttribute(n)}print(){const[n,l]=f(this,e);return super.print(this.selfClosing?{pre:`<${n}`,post:"/>"}:{pre:`<${n}`,sep:">",post:this.closed?`</${l}>`:""})}},e=new WeakMap,t),Rs=Z(zn),Be=te(Rs,0,"TagPairToken",Un,Be),ee(Rs,1,Be)}}),yl,fa=T({"src/tagPair/translate.ts"(){"use strict";var e,Sl,s;O(),Xi(),ot(),Ee(),yl=(s=class extends Be{constructor(l,i,r,o=[]){const a=new ze(l,"translate-attr",r,o);i=i==null?void 0:i.replace(/(<tvar\|[^>]+>)([\s\S]*?)(<\/>)/gu,(d,u,g,c)=>(new he(u,r,o),new he(c,r,o),`\0${o.length-1}n${g}\0${o.length}n`)).replace(/(<tvar\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\2|[^"'\s>]+))?\s*>)([\s\S]*?)(<\/tvar\s*>)/giu,(d,u,g,c,p)=>(new he(u,r,o),new he(p,r,o),`\0${o.length-1}n${c}\0${o.length}n`));const h=new E(i,r,o);h.type="translate-inner";super("translate",a,h,"translate",r,o);N(this,e);this.seal("closed",!0),this.seal("selfClosing",!0)}get type(){return"translate"}toString(l){return l?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){return`<span class="wpb-ext"><translate${j(this,e,Sl).call(this)?'<span class="wpb-ext-attrs"> <span class="wpb-ext-attr"><span class="wpb-attr-key">nowrap</span></span></span>':""}>${this.lastChild.print({class:"ext-inner"})}</translate></span>`}},e=new WeakSet,Sl=function(){return this.firstChild.toString()===" nowrap"},s)}}),Hn,Os,Dn,wt,xa=T({"src/tagPair/include.ts"(){"use strict";M(),ae(),lt(),B(),Xi(),Hn=[Ue(!1)],wt=class extends(Dn=Be){get type(){return"include"}constructor(e,t="",s,n,l,i){super(e,t,s!=null?s:"",s===void 0||n!=null?n:"",l,i)}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){const t=[],{firstChild:s,closed:n,name:l}=this,i=new le(this,e),r=["no-ignored","unclosed-comment"],o=r.map(a=>_.lintConfig.getSeverity(a,"include"));if(o[0]&&s.data.trim()){const a=R(s,i,r[0],"useless attribute",o[0]);a.suggestions=[{desc:"remove",range:[a.startIndex,a.endIndex],text:""}],t.push(a)}if(o[1]&&!n){const a=V(this,i,r[1],_.msg("unclosed $1",`<${l}>`),o[1]);a.suggestions=[{desc:"close",range:[a.endIndex,a.endIndex],text:`</${l}>`}],t.push(a)}return t}},Os=Z(Dn),wt=te(Os,0,"IncludeToken",Hn,wt),ee(Os,1,wt)}}),gs,Ki=T({"mixin/attributesParent.ts"(){"use strict";pe(),gs=(e=0)=>t=>{var n,Oi;class s extends t{constructor(){super(...arguments);N(this,n)}hasAttr(o){return j(this,n,Oi).call(this).hasAttr(o)}getAttr(o){return j(this,n,Oi).call(this).getAttr(o)}}return n=new WeakSet,Oi=function(){return this.childNodes[e]},at(s,t),s}}}),se,Bs,qs,gt,Ht,Ws,Oe,Ms,Us,zs,Dt,Hs,we,Al,kl,_l,$l,ma=T({"util/sharable.ts"(){"use strict";se=new Set(["align"]),Bs=new Set(["cite"]),qs=new Set(["cite","datetime"]),gt=new Set(["width"]),Ht=new Set(["axis","align","bgcolor","height","width","valign"]),Ws=new Set([...Ht,"abbr","headers","scope","rowspan","colspan"]),Oe=new Set(["type"]),Ms=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),Us=new Set(["clear"]),zs=new Set(["bgcolor","align","valign"]),Dt=new Set(["qid","forcemathmode","type","display"]),Hs=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),we=new Set,Al=new Set(["id","class","style","lang","dir","title","tabindex","aria-describedby","aria-flowto","aria-hidden","aria-label","aria-labelledby","aria-level","aria-owns","role","about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),kl={div:se,h1:se,h2:se,h3:se,h4:se,h5:se,h6:se,blockquote:Bs,q:Bs,p:se,br:Us,pre:gt,ins:qs,del:qs,ul:Oe,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...Ms,"border"]),caption:se,tr:zs,td:Ws,th:Ws,font:new Set(["size","color","face"]),hr:gt,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Oe,poem:se,categorytree:se,combooption:se,math:we,chem:we,ce:we,img:new Set(["alt","src","width","height","loading"])},_l={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:we,indicator:new Set(["name"]),langconvert:new Set(["from","to"]),ref:new Set(["group","name","extends","follow","dir"]),references:new Set(["group","responsive"]),charinsert:new Set(["label"]),choose:new Set(["uncached","before","after"]),option:new Set(["weight"]),imagemap:we,inputbox:we,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:we,poll:new Set(["id","show-results-before-voting"]),sm2:Oe,flashmp3:Oe,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([...Dt,"chem"]),chem:Dt,ce:Dt,hiero:we,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:Hs,syntaxhighlight:Hs,templatedata:we,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:we},$l={table:Ms,td:new Set([...Ht,"scope"]),th:Ht,br:Us,caption:se,div:se,hr:gt,h1:se,h2:se,h3:se,h4:se,h5:se,h6:se,li:Oe,p:se,pre:gt,tr:zs,ul:Oe}}}),Gn,Vn,Qn,Jn,Zt,va=T({"src/attribute.ts"(){"use strict";var e,t,s,n,l,Bi,r;M(),oe(),Me(),ma(),ae(),B(),O(),Fe(),Gn=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,Vn=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,Qn=new Set(["ext","arg","magic-word","template"]),Jn=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),Zt=(r=class extends E{constructor(a,h,d,u="",g,c=[],p=_.getConfig(),v=[]){const m=new ge(d,"attr-key",p,v);let x;if(d==="title"||h==="img"&&d==="alt")x=new E(g,p,v,{}),x.type="attr-value",x.setAttribute("stage",me-1);else if(h==="gallery"&&d==="caption"||h==="choose"&&(d==="before"||d==="after")||h==="img"&&d==="src"&&(g!=null&&g.includes("{{"))){const b=Se(fe({},p),{excludes:[...p.excludes,"heading","html","table","hr","list"]});x=new E(g,b,v,{}),x.type="attr-value",x.setAttribute("stage",1)}else x=new ge(g,"attr-value",p,v,{});super(void 0,p,v);N(this,l);N(this,e);N(this,t);N(this,s);N(this,n);L(this,e,a),this.append(m,x),L(this,s,u),L(this,n,[...c]),L(this,t,h),this.setAttribute("name",st(ve(d)))}get type(){return f(this,e)}get tag(){return f(this,t)}get balanced(){return!f(this,s)||f(this,n)[0]===f(this,n)[1]}afterBuild(){f(this,s).includes("\0")&&L(this,s,this.buildFromStr(f(this,s),0)),this.parentNode&&L(this,t,this.parentNode.name),this.setAttribute("name",st(this.firstChild.text())),super.afterBuild()}toString(a){const[h="",d=""]=f(this,n);return f(this,s)?super.toString(a,f(this,s)+h)+d:this.firstChild.toString(a)}text(){return f(this,s)?`${super.text(`${f(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var a,h;return f(this,s)?f(this,s).length+((h=(a=f(this,n)[0])==null?void 0:a.length)!=null?h:0):0}lint(a=this.getAbsoluteIndex(),h){var y;const d=super.lint(a,h),{balanced:u,firstChild:g,lastChild:c,name:p,tag:v}=this,m=new le(this,a),x=["unclosed-quote","obsolete-attr"],b=x.map(A=>_.lintConfig.getSeverity(A,p));if(b[0]&&!u){const A=R(c,m,x[0],_.msg("unclosed $1","quotes"),b[0]);A.startIndex--,A.startCol--,A.suggestions=[{desc:"close",range:[A.endIndex,A.endIndex],text:f(this,n)[0]}],d.push(A)}const w=j(this,l,Bi).call(this,a,m);return w&&d.push(w),b[1]&&((y=$l[v])!=null&&y.has(p))&&d.push(R(g,m,x[1],"obsolete attribute",b[1])),d}getValue(){return f(this,s)?this.lastChild.text().trim():this.type==="ext-attr"||""}getAttribute(a){return a==="invalid"?j(this,l,Bi).call(this):super.getAttribute(a)}print(){const[a="",h=""]=f(this,n);return f(this,s)?super.print({sep:Et(f(this,s))+a,post:h}):super.print()}json(a,h=this.getAbsoluteIndex()){const d=super.json(void 0,h);return d.tag=this.tag,d}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n=new WeakMap,l=new WeakSet,Bi=function(a,h){const{firstChild:d,lastChild:u,type:g,name:c,tag:p,parentNode:v}=this,m=!u.childNodes.some(({type:k})=>Qn.has(k)),x=this.getValue(),b=_l[p],w=kl[p],{length:y}=this.toString();let A="illegal-attr";if(!(b!=null&&b.has(c))&&!(w!=null&&w.has(c))&&(g==="ext-attr"?b||w:!/\{\{[^{]+\}\}/u.test(c))&&(g==="ext-attr"&&!w||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(c)&&(p==="meta"||p==="link"||!Al.has(c)))||(c==="itemtype"||c==="itemid"||c==="itemref")&&!(v!=null&&v.hasAttr("itemscope"))){if(a===void 0)return!0;const k=_.lintConfig.getSeverity(A,"unknown");if(k){const S=R(d,h,A,"illegal attribute name",k);return S.suggestions=[{desc:"remove",range:[a,a+y],text:""}],S}}else if(c==="style"&&typeof x=="string"&&Gn.test(x)){if(a===void 0)return!0;A="insecure-style";const k=_.lintConfig.getSeverity(A);return k&&R(u,h,A,"insecure style",k)}else if(c==="tabindex"&&typeof x=="string"&&x!=="0"){if(a===void 0)return!0;const k=_.lintConfig.getSeverity(A,"tabindex");if(k){const S=R(u,h,A,"nonzero tabindex",k);return S.suggestions=[{desc:"remove",range:[a,a+y],text:""},{desc:"0 tabindex",range:[S.startIndex,S.endIndex],text:"0"}],S}}else if(m&&g!=="ext-attr"){const k=pl(p,c),S=String(x).toLowerCase();if(k.length>0&&k.every($=>$!==S)){if(a===void 0)return!0;const $=_.lintConfig.getSeverity(A,"value");return $&&R(u,h,A,"illegal attribute value",$)}}else if(typeof x=="string"&&((/^xmlns:[\w:.-]+$/u.test(c)||Jn.has(c))&&Vn.test(x)||m&&(c==="href"||p==="img"&&c==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(x))){if(a===void 0)return!0;const k=_.lintConfig.getSeverity(A,"value");return k&&R(u,h,A,"illegal attribute value",k)}return!1},r)}}),Ds,Xn,Gs,ps,Yi=T({"src/attributes.ts"(){"use strict";var e,t,es,n;M(),oe(),ae(),B(),O(),Fe(),va(),Ds=l=>l.slice(0,-1),Xn=l=>`${Ds(l)}-dirty`;try{Gs=new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch(l){Gs=/[^\W_]/u}ps=(n=class extends E{constructor(i,r,o,a,h=[]){super(void 0,a,h,{});N(this,t);N(this,e);if(L(this,e,r),this.setAttribute("name",o),i){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 u="",g=d.exec(i),c=0;const p=()=>{u&&(super.insertAt(new ge(u,Xn(r),a,h,{})),u="")};for(;g;){const{index:v,0:m,1:x,2:b,3:w,4:y,5:A,6:k}=g;if(u+=i.slice(c,v),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(ve(x).trim())){const S=y!=null?y:k,$=[w,A],C=new Zt(Ds(r),o,x,b,S,$,a,h);p(),super.insertAt(C)}else u+=m;({lastIndex:c}=d),g=d.exec(i)}u+=i.slice(c),p()}}get type(){return f(this,e)}afterBuild(){const{parentNode:i}=this;i!=null&&i.is("td")&&this.setAttribute("name",i.subtype),super.afterBuild()}getAttrTokens(i){return this.childNodes.filter(r=>r instanceof Zt&&(!i||r.name===st(i)))}hasAttr(i){return this.getAttrTokens(i).length>0}getAttrToken(i){const r=this.getAttrTokens(i);return r[r.length-1]}getAttr(i){var r;return(r=this.getAttrToken(i))==null?void 0:r.getValue()}lint(i=this.getAbsoluteIndex(),r){const o=super.lint(i,r),{parentNode:a,childNodes:h}=this,d=new Map,u=new Set,g=new le(this,i),c=["no-ignored","no-duplicate"],p=["closingTag","invalidAttributes","nonWordAttributes"].map(m=>_.lintConfig.getSeverity(c[0],m));if(p[0]&&j(this,t,es).call(this)){const m=V(this,g,c[0],"attributes of a closing tag",p[0]),x=a.getAbsoluteIndex();m.suggestions=[{desc:"remove",range:[i,m.endIndex],text:""},{desc:"open",range:[x+1,x+2],text:""}],o.push(m)}for(const m of h)if(m instanceof Zt){const{name:x}=m;d.has(x)?(u.add(x),d.get(x).push(m)):d.set(x,[m])}else{const x=m.text().trim(),b=p[Gs.test(x)?1:2];if(x&&b){const w=R(m,g,c[0],"containing invalid attribute",b);w.suggestions=[{desc:"remove",range:[w.startIndex,w.endIndex],text:" "}],o.push(w)}}const v=_.lintConfig.getSeverity(c[1],"attribute");if(v&&u.size>0)for(const m of u){const x=d.get(m).map(b=>{const w=b.getValue();return[b,w===!0?"":w]});o.push(...x.map(([b,w],y)=>{const A=R(b,g,c[1],_.msg("duplicated $1 attribute",m),v),k={desc:"remove",range:[A.startIndex,A.endIndex],text:""};return!w||x.slice(0,y).some(([,S])=>S===w)?A.fix=k:A.suggestions=[k],A}))}return o}getAttribute(i){return i==="invalid"?j(this,t,es).call(this):super.getAttribute(i)}print(){return this.toString()?`<span class="wpb-${this.type}${j(this,t,es).call(this)?" wpb-invalid":""}">${this.childNodes.map(i=>i.print(i instanceof ge?{class:i.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,es=function(){const{parentNode:i}=this;return(i==null?void 0:i.type)==="html"&&i.closing&&this.text().trim()!==""},n)}}),Tl={};Y(Tl,{PreToken:()=>Cl});var Cl,ba=T({"src/pre.ts"(){"use strict";Me(),O(),Ee(),Cl=class extends E{get type(){return"ext-inner"}constructor(e,t,s=[]){if(e){const n=/<nowiki>/giu,l=/<\/nowiki>/giu,{length:i}=n.source;let r=n.exec(e);r&&(l.lastIndex=r.index+i);let o=l.exec(e),a=0,h="";for(;r&&o;)new he(r[0],t,s),new he(o[0],t,s),h+=`${e.slice(a,r.index)}\0${s.length-1}n${e.slice(r.index+i,o.index)}\0${s.length}n`,a=o.index+i+1,n.lastIndex=a,r=n.exec(e),r&&(l.lastIndex=r.index+i),o=l.exec(e);e=h+e.slice(a)}super(e,t,s,{}),this.setAttribute("stage",me-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),fs,Zi=T({"mixin/multiLine.ts"(){"use strict";pe(),fs=e=>{class t extends e{toString(n){return super.toString(n,`
|
|
1
|
+
"use strict";(()=>{var Xo=Object.defineProperty,Ko=Object.defineProperties;var Yo=Object.getOwnPropertyDescriptors;var fn=Object.getOwnPropertySymbols;var Zo=Object.prototype.hasOwnProperty,ea=Object.prototype.propertyIsEnumerable;var xn=e=>{throw TypeError(e)};var ws=(e,t,s)=>t in e?Xo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,pe=(e,t)=>{for(var s in t||(t={}))Zo.call(t,s)&&ws(e,s,t[s]);if(fn)for(var s of fn(t))ea.call(t,s)&&ws(e,s,t[s]);return e},ye=(e,t)=>Ko(e,Yo(t));var ta=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var ke=(e,t,s)=>ws(e,typeof t!="symbol"?t+"":t,s),ys=(e,t,s)=>t.has(e)||xn("Cannot "+s);var f=(e,t,s)=>(ys(e,t,"read from private field"),s?s.call(e):t.get(e)),N=(e,t,s)=>t.has(e)?xn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),L=(e,t,s,i)=>(ys(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),P=(e,t,s)=>(ys(e,t,"access private method"),s);var mn=(e,t,s,i)=>({set _(n){L(e,t,n,s)},get _(){return f(e,t,i)}});var id=ta((rd,Jo)=>{var sa=Object.create,rt=Object.defineProperty,ll=Object.getOwnPropertyDescriptor,Ui=Object.getOwnPropertyNames,ia=Object.prototype.hasOwnProperty,ol=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),lt=e=>{throw TypeError(e)},al=(e,t,s)=>t in e?rt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,vn=(e,t)=>rt(e,"name",{value:t,configurable:!0}),T=(e,t)=>function(){return e&&(t=(0,e[Ui(e)[0]])(e=0)),t},na=(e,t)=>function(){return t||(0,e[Ui(e)[0]])((t={exports:{}}).exports,t),t.exports},te=(e,t)=>{for(var s in t)rt(e,s,{get:t[s],enumerable:!0})},ra=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Ui(t))!ia.call(e,n)&&n!==s&&rt(e,n,{get:()=>t[n],enumerable:!(i=ll(t,n))||i.enumerable});return e},G=e=>ra(rt({},"__esModule",{value:!0}),e),ee=e=>{var t;return[,,,sa((t=e==null?void 0:e[ol("metadata")])!=null?t:null)]},dl=["class","method","getter","setter","accessor","field","value","get","set"],vt=e=>e!==void 0&&typeof e!="function"?lt("Function expected"):e,la=(e,t,s,i,n)=>({kind:dl[e],name:t,metadata:i,addInitializer:r=>s._?lt("Already initialized"):n.push(vt(r||null))}),zi=(e,t)=>al(t,ol("metadata"),e[3]),X=(e,t,s,i)=>{for(var n=0,r=e[t>>1],l=r&&r.length;n<l;n++)t&1?r[n].call(s):i=r[n].call(s,i);return i},K=(e,t,s,i,n,r)=>{var l,o,a,h,d,u=t&7,g=!!(t&8),c=!!(t&16),p=u>3?e.length+1:u?g?1:2:0,v=dl[u+5],m=u>3&&(e[p-1]=[]),x=e[p]||(e[p]=[]),b=u&&(!c&&!g&&(n=n.prototype),u<5&&(u>3||!c)&&ll(u<4?n:{get[s](){return de(this,r)},set[s](y){return fe(this,r,y)}},s));u?c&&u<4&&vn(r,(u>2?"set ":u>1?"get ":"")+s):vn(n,s);for(var w=i.length-1;w>=0;w--)h=la(u,s,a={},e[3],x),u&&(h.static=g,h.private=c,d=h.access={has:c?y=>aa(n,y):y=>s in y},u^3&&(d.get=c?y=>(u^1?de:Ti)(y,n,u^4?r:b.get):y=>y[s]),u>2&&(d.set=c?(y,A)=>fe(y,n,A,u^4?r:b.set):(y,A)=>y[s]=A)),o=(0,i[w])(u?u<4?c?r:b[v]:u>4?void 0:{get:b.get,set:b.set}:n,h),a._=1,u^4||o===void 0?vt(o)&&(u>4?m.unshift(o):u?c?r=o:b[v]=o:n=o):typeof o!="object"||o===null?lt("Object expected"):(vt(l=o.get)&&(b.get=l),vt(l=o.set)&&(b.set=l),vt(l=o.init)&&m.unshift(l));return u||zi(e,n),b&&rt(n,s,b),c?u^4?r:b:n},oa=(e,t,s)=>al(e,typeof t!="symbol"?t+"":t,s),Hi=(e,t,s)=>t.has(e)||lt("Cannot "+s),aa=(e,t)=>Object(t)!==t?lt('Cannot use the "in" operator on this value'):e.has(t),de=(e,t,s)=>(Hi(e,t,"read from private field"),s?s.call(e):t.get(e)),Ce=(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),fe=(e,t,s,i)=>(Hi(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),Ti=(e,t,s)=>(Hi(e,t,"access private method"),s),da=(e,t,s,i)=>({set _(n){fe(e,t,n,s)},get _(){return de(e,t,i)}}),hl,Di,ul=T({"base.ts"(){"use strict";hl=(()=>{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})(),Di=(()=>{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 et(e){const t=new Map,s=new WeakMap;return i=>{const n=typeof i=="string"?t:s;if(n.has(i)){const l=n.get(i);return l.lastIndex=0,l}const r=e(i);return n.set(i,r),r}}var Ft,cl,Rt=T({"../common/dist/index.mjs"(){"use strict";Ft=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25")),cl=et}}),Ne,Ss,tt,st,it,_e,Ve,gl,me,Me,bn,wn,jt,pl,yn,Sn,Et,nt,oe=T({"util/string.ts"(){"use strict";Rt(),Ne=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Ss=String.raw`[^[\]<>"\0-\x1F\x7F${Ne}\uFFFD]`,tt=String.raw`(?:\[[\da-f:.]+\]|${Ss})`,st=String.raw`(?:${Ss}|\0\d+[cn!~]\x7F)*`,it=e=>e.trim().toLowerCase(),_e=(e,t)=>e.replace(/\0(\d+)\x7F/gu,(s,i)=>t[i]),Ve=(e,t)=>s=>s.replace(e,t),gl=Ve(/[\0\x7F]|\r$/gmu,""),me=Ve(/\0\d+[cn]\x7F/gu,""),Me=(e,t="")=>e.map(s=>typeof s=="string"?s:s.text()).join(t),bn={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},wn=Ve(/&(?:#(\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)):bn[s.toLowerCase()]),jt=e=>wn(e),pl=Ve(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),yn={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},Sn=e=>Ve(e,t=>`&${yn[t]};`),Et=Sn(/[&<>]/gu),nt=(e,t={})=>{const{pre:s="",post:i="",sep:n=""}=t;return s+e.map(r=>r.print()).join(n)+i}}}),ha=na({"config/minimum.json"(e,t){t.exports={ext:[],html:[["b","bdi","del","i","ins","u","font","big","small","sub","sup","h1","h2","h3","h4","h5","h6","cite","code","em","s","strike","strong","tt","var","div","center","blockquote","ol","ul","dl","table","caption","pre","ruby","rb","rp","rt","rtc","p","span","abbr","dfn","kbd","samp","data","time","mark","tr","td","th","q","bdo"],["li","dt","dd"],["br","wbr","hr","meta","link"]],namespaces:{0:"",6:"File",10:"Template",14:"Category",828:"Module"},nsid:{"":0,file:6,template:10,category:14,module:828},functionHook:["msgnw"],variable:["!","=","pageid","articlepath","server","servername","scriptpath","stylepath"],parserFunction:[{msgnw:"msgnw",pageid:"pageid",articlepath:"articlepath",server:"server",servername:"servername",scriptpath:"scriptpath",stylepath:"stylepath","#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"formatdate","#dateformat":"formatdate","#invoke":"invoke","#while":"while","#dowhile":"dowhile","#loop":"loop","#forargs":"forargs","#fornumargs":"fornumargs","#if":"if","#ifeq":"ifeq","#switch":"switch","#ifexist":"ifexist","#ifexpr":"ifexpr","#iferror":"iferror","#time":"time","#timel":"timel","#expr":"expr","#rel2abs":"rel2abs","#titleparts":"titleparts","#categorytree":"categorytree","#urldecode":"urldecode","#choose":"choose","#var":"var","#varexists":"varexists","#var_final":"var_final","#vardefine":"vardefine","#vardefineecho":"vardefineecho","#widget":"widget","#related":"related","#regex":"regex","#regex_var":"regex_var","#regexquote":"regexquote","#regexall":"regexall","#len":"len","#pos":"pos","#rpos":"rpos","#sub":"sub","#count":"count","#rmatch":"rmatch","#rreplace":"rreplace","#replace":"replace","#rsplit":"rsplit","#explode":"explode","#tab":"tab","#seo":"seo","#babel":"babel","#translation":"translation","#commaseparatedlist":"commaseparatedlist","#coordinates":"coordinates","#lst":"lst","#lsth":"lsth","#lstx":"lstx","#assessment":"assessment","#mentor":"mentor","#property":"property","#target":"target","#section":"lst","#section-x":"lstx","#section-h":"lsth","#statements":"statements","#useliquidthreads":"useliquidthreads","#lqtpagelimit":"lqtpagelimit","#avatar":"avatar","#img":"img","#chart":"chart"},{"!":"!","=":"=","#FORMAL":"formal","#bcp47":"bcp47","#dir":"dir","#interwikilink":"interwikilink","#interlanguagelink":"interlanguagelink","#timef":"timef","#timefl":"timefl"},["msg","raw"],["subst","safesubst"]],doubleUnderscore:[[],[]],protocol:"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|matrix:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|wikipedia://|worldwind://|xmpp:",interwiki:[],img:{},redirection:["#redirect"],variants:[]}}}),xe,Ci,Ue=T({"util/constants.ts"(){"use strict";xe=11,Ci=ha()}}),le,ae=T({"lib/rect.ts"(){"use strict";var e,t,s,i,Ii,r;le=(r=class{constructor(l,o){N(this,i);N(this,e);N(this,t);N(this,s);L(this,e,l),L(this,t,o)}get start(){return f(this,t)}get top(){return P(this,i,Ii).call(this).top}get left(){return P(this,i,Ii).call(this).left}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakSet,Ii=function(){var l;return(l=f(this,s))!=null||L(this,s,f(this,e).getRootNode().posFromIndex(f(this,t))),f(this,s)},r)}}),An,kn,Lt,Ni,As,R,V,We,fl,M=T({"util/lint.ts"(){"use strict";Se(),ae(),B(),An=new Set(["tr","td","th","caption"]),kn=new Set(["Template:!!","Template:!-"]),Lt=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")&&kn.has(t.name)||t.is("html")&&An.has(t.name))return!1;if(t.is("arg"))return t.length>1&&Lt(t.childNodes[1]);if(t.is("magic-word"))try{const s=t.getPossibleValues().map(Lt);return s.includes(2)?2:s.includes(1)&&1}catch(s){}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?1:2},Ni=(e,t,s,i)=>({line:e+s-1,character:(s===1?t:0)+i}),As=e=>(t,s,i,n,r="error")=>{const{start:l}=s,{top:o,left:a}=s instanceof le?s:new le(t,l),{offsetHeight:h,offsetWidth:d}=t,{startIndex:u,startLine:g,startCol:c}=e(t,l,o,a),{line:p,character:v}=Ni(g,c,h,d);return{rule:i,message:_.msg(n),severity:r,startIndex:u,endIndex:u+t.toString().length,startLine:g,endLine:p,startCol:c,endCol:v}},R=As((e,t,s,i)=>{const n=e.getRelativeIndex(),{top:r,left:l}=e.parentNode.posFromIndex(n);return{startIndex:t+n,startLine:s+r,startCol:r?l:i+l}}),V=As((e,t,s,i)=>({startIndex:t,startLine:s,startCol:i})),We=(e,t,s,i)=>{if(e&&(i||_.viewOnly&&e[0]===ve.rev))return e[1];const n=t();return(i||_.viewOnly)&&s([ve.rev,n]),n},fl=(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"]:[]}}),_n,Gi,xl=T({"parser/selector.ts"(){"use strict";_n=(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},Gi=(e,t,s)=>{const i=e.split(",");return({type:n,name:r})=>i.some(l=>_n(l.trim(),n,r))}}}),ls,Vi=T({"mixin/cached.ts"(){"use strict";M(),ls=(e=!0)=>t=>{const s=new WeakMap;return function(...i){return We(s.get(this),()=>t.apply(this,i),n=>{s.set(this,n)},e)}}}}),ml,ua=T({"mixin/nodeLike.ts"(){"use strict";ml=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}}}),$n,Tn,qt,dt,ht,Wt,ut,ct,gt,Be,vl=T({"lib/node.ts"(){"use strict";M(),Se(),Vi(),ua(),B(),Tn=[ml],$n=[ls(!1)],Be=class{constructor(){X(gt,5,this),oa(this,"childNodes",[]),Ce(this,qt),Ce(this,dt),Ce(this,ht),Ce(this,Wt),Ce(this,ut),Ce(this,ct,{})}get parentNode(){return de(this,qt)}get nextSibling(){return de(this,dt)}get previousSibling(){return de(this,ht)}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":fe(this,qt,t),t||(fe(this,dt,void 0),fe(this,ht,void 0));break;case"nextSibling":fe(this,dt,t);break;case"previousSibling":fe(this,ht,t);break;case"aIndex":_.viewOnly&&fe(this,ut,[ve.rev,t]);break;default:this[e]=t}}getRootNode(){return We(de(this,Wt),()=>{var e,t;return(t=(e=this.parentNode)==null?void 0:e.getRootNode())!=null?t:this},e=>{const[,t]=e;t.type==="root"&&fe(this,Wt,e)})}indexFromPos(e,t){this.lspError("AstNode.indexFromPos")}posFromIndex(e){const{length:t}=String(this);if(e+=e<0?t:0,e>=0&&e<=t){const s=this.getLines(),i=s.findIndex(([,,n])=>e<=n);return{top:i,left:e-s[i][1]}}}getDimension(){const e=this.getLines(),t=e[e.length-1];return{height:e.length,width:t[2]-t[1]}}getGaps(e){return 0}getRelativeIndex(e){if(e===void 0){const{parentNode:t}=this;return t?t.getRelativeIndex(t.childNodes.indexOf(this)):0}return We(de(this,ct)[e],()=>{const{childNodes:t}=this,s=e+(e<0?t.length:0);let i=this.getAttribute("padding");for(let n=0;n<s;n++)_.viewOnly&&(de(this,ct)[n]=[ve.rev,i]),i+=t[n].toString().length+this.getGaps(n);return i},t=>{de(this,ct)[e]=t})}getAbsoluteIndex(){return We(de(this,ut),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{fe(this,ut,e)})}getBoundingClientRect(){this.lspError("AstNode.getBoundingClientRect")}is(e){return this.type===e}getLines(){const e=[];let t=0;for(const s of String(this).split(`
|
|
2
|
+
`)){const i=t+s.length;e.push([s,t,i]),t=i+1}return e}seal(e,t){const s=!t&&!!this[e];Object.defineProperty(this,e,{enumerable:s,configurable:!0})}lspError(e){throw new Error(`${e} method is only available in the LSP version!`)}},gt=ee(null),qt=new WeakMap,dt=new WeakMap,ht=new WeakMap,Wt=new WeakMap,ut=new WeakMap,ct=new WeakMap,K(gt,1,"getLines",$n,Be),Be=K(gt,0,"AstNode",Tn,Be),X(gt,1,Be)}}),bl,ca=T({"mixin/elementLike.ts"(){"use strict";xl(),bl=e=>{var s,Li;class t extends e{constructor(){super(...arguments);N(this,s)}getElementBy(l){for(const o of this.childNodes){if(o.type==="text")continue;if(l(o))return o;const a=o.getElementBy(l);if(a)return a}}querySelector(l){return this.getElementBy(P(this,s,Li).call(this,l))}getElementsBy(l,o=[]){for(const a of this.childNodes)a.type!=="text"&&(l(a)&&o.push(a),a.getElementsBy(l,o));return o}querySelectorAll(l){return this.getElementsBy(P(this,s,Li).call(this,l))}}return s=new WeakSet,Li=function(l){return Gi(l,this)},t}}}),Cn,ks,In,bt,ga=T({"lib/element.ts"(){"use strict";oe(),Se(),xl(),vl(),ca(),Cn=[bl],bt=class extends(In=Be){get length(){return this.childNodes.length}text(e){return Me(this.childNodes,e)}normalize(){const e=this.getChildNodes(),t=s=>{var i,n;e.splice(s,1),(i=e[s-1])==null||i.setAttribute("nextSibling",e[s]),(n=e[s])==null||n.setAttribute("previousSibling",e[s-1])};for(let s=e.length-1;s>=0;s--){const{type:i,data:n}=e[s];i!=="text"||e.length===1||this.getGaps(s-(s&&1))||n===""&&t(s)}this.setAttribute("childNodes",e)}removeAt(e){return rs(this,e,1)[0]}insertAt(e,t=this.length){return rs(this,t,0,[e]),e}closest(e){const t=Gi(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)}replaceChildren(...e){this.safeReplaceChildren(e)}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){this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(e){this.lspError("AstElement.elementFromIndex")}elementFromPoint(e,t){this.lspError("AstElement.elementFromPoint")}lint(e=this.getAbsoluteIndex(),t){const s=[];for(let i=0,n=e+this.getAttribute("padding");i<this.length;i++){const r=this.childNodes[i];r.setAttribute("aIndex",n);const l=r.lint(n,t);l.length>0&&s.push(...l),n+=r.toString().length+this.getGaps(i)}return s}print(e={}){const t=e.class;return this.toString()?(t===""?"":`<span class="wpb-${t!=null?t:this.type}${this.getAttribute("invalid")?" wpb-invalid":""}">`)+nt(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){const s=ye(pe({},this),{type:this.type,range:[t,t+this.toString().length],childNodes:[]});for(let i=0,n=t+this.getAttribute("padding");i<this.length;i++){const r=this.childNodes[i],{length:l}=r.toString();r.setAttribute("aIndex",n),s.childNodes.push(r.type==="text"?{data:r.data,range:[n,n+l]}:r.json(void 0,n)),n+=l+this.getGaps(i)}return s}},ks=ee(In),bt=K(ks,0,"AstElement",Cn,bt),X(ks,1,bt)}}),Mt,_s,Nn,Ln,Fn,jn,$s,Ts,Fi,pa=T({"lib/text.ts"(){"use strict";var e,wl,s;oe(),M(),B(),vl(),Mt=String.raw`[${Ne}\t]*`,_s=String.raw`<\s*(?:/\s*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${Mt}\d)|isbn(?=[-::]?${Mt}(?:\d(?:${Mt}|-)){6})`,Nn=new RegExp(String.raw`${_s}|https?[:/]/+`,"giu"),Ln=new RegExp(_s,"giu"),Fn=new Set(["attr-value","ext-link-text","link-text"]),jn={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},$s=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"]);try{Ts=new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch(i){Ts=/\w/u}Fi=(s=class extends Be{constructor(n){super();N(this,e);ke(this,"data","");this.data=n}get type(){return"text"}toString(n){var r;return n&&!((r=this.parentNode)!=null&&r.getAttribute("built"))?me(this.data):this.data}text(){return this.data}lint(n=this.getAbsoluteIndex(),r){var C,I,U;if(r===!1)return[];const{data:l,parentNode:o,nextSibling:a,previousSibling:h}=this;if(!o)throw new Error("An isolated text node cannot be linted!");const{type:d,name:u,parentNode:g}=o;if(d==="attr-value"){const{name:F,tag:E}=g;if(E==="ref"&&(F==="name"||F==="follow")||F==="group"&&(E==="ref"||E==="references")||E==="choose"&&(F==="before"||F==="after"))return[]}if(r!=null||(r=d==="free-ext-link"||d==="ext-link-url"||d==="ext-link-text"||d==="image-parameter"&&u==="link"||d==="attr-value"?Ln:Nn),l.search(r)===-1)return[];r.lastIndex=0;const c=[],p=a==null?void 0:a.type,v=a==null?void 0:a.name,m=h==null?void 0:h.type,x=this.getRootNode(),b=x.toString(),{ext:w,html:y,variants:A}=x.getAttribute("config"),{top:k,left:S}=x.posFromIndex(n),$=new Set(["onlyinclude","noinclude","includeonly",...w,...y[0],...y[1],...y[2],...$s]);for(let F=r.exec(l);F;F=r.exec(l)){const[,E,Y]=F;let{index:W,0:Q}=F;if(Y&&Y!=="]"){const{length:ce}=Y;W+=ce,Q=Q.slice(ce)}Q=Q.toLowerCase();const[z]=Q,ie=z==="r"||z==="p"||z==="i",q=z==="{",D=z==="}",H=z==="[",J=z==="]";let{length:ne}=Q;if(z==="<"&&!$.has(E.toLowerCase())||H&&d==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(l.slice(W+1))||a!=null&&a.is("ext")&&v==="nowiki"&&((C=a.innerText)!=null&&C.includes("]")))||ie&&(!o.isPlain()||Fn.has(d)))continue;J&&(W||ne>1)&&r.lastIndex--;let Z=n+W,re=Z+ne,ue,Ae;const Pe=b[re],fs=b[Z-1],xs=q||H,ms=q&&fs==="-"&&A.length>0,vs=D&&Pe==="-"&&A.length>0,hn=H&&p==="free-ext-link"&&!l.slice(W+1).trim()||J&&m==="free-ext-link"&&!l.slice(0,W).includes("]");if(ie)ue="lonely-http",Q=Q.toUpperCase(),Ae=_.lintConfig.getSeverity(ue,Q);else if(z==="<"){ue="tag-like";let ce;/^<\s/u.test(Q)||!/[\s/>]/u.test(Pe!=null?Pe:"")?ce="invalid":$s.has(E)&&(ce="disallowed"),Ae=_.lintConfig.getSeverity(ue,ce)}else if(ms||vs)ue="lonely-bracket",Ae=_.lintConfig.getSeverity(ue,"converter"),ms&&W>0?(Q="-{",W--,Z--,ne=2):vs&&W<l.length-1&&(Q="}-",re++,ne=2);else if(hn)ue="lonely-bracket",Ae=_.lintConfig.getSeverity(ue,"extLink");else if(xs||D||J)if(ue="lonely-bracket",ne>1||q&&Pe===z||D&&fs===z)Ae=_.lintConfig.getSeverity(ue,"double");else{if(!H||d!=="ext-link-text"){const ce=jn[z],bs=xs?l.slice(W+1):l.slice(0,W);if(q&&((I=ce.exec(bs))==null?void 0:I[0])==="}"||D&&((U=ce.exec(bs))==null?void 0:U[0])==="{")continue;if(!bs.includes(z)){const pn=xs?"nextSibling":"previousSibling";let Re=this[pn];for(;Re&&(Re.type!=="text"||!ce.test(Re.data));)Re=Re[pn];if(Re&&ce.exec(Re.data)[0]!==z)continue}}Ae=_.lintConfig.getSeverity(ue,"single")}else ue="lonely-http",Ae=_.lintConfig.getSeverity(ue);if(!Ae)continue;const un=this.posFromIndex(W),{line:cn,character:gn}=Ni(k,S,un.top+1,un.left),Ge={rule:ue,message:_.msg('lonely "$1"',ie||z==="h"||ms||vs?Q:z),severity:Ae,startIndex:Z,endIndex:re,startLine:cn,endLine:cn,startCol:gn,endCol:gn+ne};if(z==="<")Ge.suggestions=[{desc:"escape",range:[Z,Z+1],text:"<"}];else if(z==="h"&&d!=="link-text"&&Ts.test(fs||""))Ge.suggestions=[{desc:"whitespace",range:[Z,Z],text:" "}];else if(H&&d==="ext-link-text"){const ce=o.getAbsoluteIndex()+o.toString().length;Ge.suggestions=[{desc:"escape",range:[ce,ce+1],text:"]"}]}else if(J&&hn){const ce=n-h.toString().length;Ge.suggestions=[{desc:"left bracket",range:[ce,ce],text:"["}]}else ie&&(Ge.suggestions=[...F[0]===Q?[]:[{desc:"uppercase",range:[Z,re],text:Q}],...Pe===":"||Pe===":"?[{desc:"whitespace",range:[re,re+1],text:" "}]:[]]);c.push(Ge)}return c}replaceData(n){P(this,e,wl).call(this,n)}print(){return Et(this.data)}},e=new WeakSet,wl=function(n){this.setAttribute("data",n)},s)}}),ze,ot=T({"mixin/hidden.ts"(){"use strict";ze=(e=!0,t=!0)=>s=>{class i extends s{text(){return""}lint(r){return e?[]:super.lint(r)}}return i}}}),He,at=T({"src/syntax.ts"(){"use strict";var e,t;O(),He=(t=class extends j{constructor(i,n,r,l,o){super(i,r,l,o);N(this,e);L(this,e,n)}get type(){return f(this,e)}lint(i=this.getAbsoluteIndex()){return super.lint(i,!1)}},e=new WeakMap,t)}}),$e,Le=T({"mixin/padded.ts"(){"use strict";$e=({length:e})=>t=>{class s extends t{getAttribute(n){return n==="padding"?e:super.getAttribute(n)}}return s}}}),ge,Fe=T({"src/atom.ts"(){"use strict";var e,t;O(),ge=(t=class extends j{constructor(i,n,r,l,o){super(i,r,l,o);N(this,e);L(this,e,n)}get type(){return f(this,e)}set type(i){L(this,e,i)}getAttribute(i){var n;return i==="invalid"?this.type==="converter-flag"&&!!((n=this.parentNode)!=null&&n.isInvalidFlag(this)):super.getAttribute(i)}},e=new WeakMap,t)}}),En,Pn,Cs,Rn,Ie,os=T({"src/link/base.ts"(){"use strict";var e,t,s,i;M(),Ue(),oe(),ae(),Le(),B(),O(),Fe(),En=n=>n==="redirect-target"||n==="link",Pn=[$e("[[")],Ie=(i=class extends(Rn=j){constructor(r,l,o,a=[],h="|"){super(void 0,o,a,{});N(this,e,!0);N(this,t);N(this,s);if(this.insertAt(new ge(r,"link-target",o,a,{})),l!==void 0){const d=new j(l,o,a,{});d.type="link-text",d.setAttribute("stage",xe-1),this.insertAt(d)}L(this,t,h)}get link(){}get fragment(){return f(this,s).fragment}afterBuild(){L(this,s,this.getTitle()),f(this,t).includes("\0")&&L(this,t,this.buildFromStr(f(this,t),0)),this.setAttribute("name",f(this,s).title),super.afterBuild()}setAttribute(r,l){r==="bracket"?L(this,e,l):r==="title"?L(this,s,l):super.setAttribute(r,l)}toString(r){const l=super.toString(r,f(this,t));return f(this,e)?`[[${l}]]`:l}text(){const r=super.text("|");return f(this,e)?`[[${r}]]`:r}getAttribute(r){return r==="title"?f(this,s):super.getAttribute(r)}getGaps(r){return r===0?f(this,t).length:1}lint(r=this.getAbsoluteIndex(),l){const o=super.lint(r,l),{childNodes:[a,h],type:d}=this,{encoded:u,fragment:g}=f(this,s),c=new le(this,r);let p="unknown-page",v=_.lintConfig.getSeverity(p);if(v&&a.childNodes.some(({type:m})=>m==="template")&&o.push(R(a,c,p,"template in an internal link target",v)),p="url-encoding",v=_.lintConfig.getSeverity(p),v&&u){const m=R(a,c,p,"unnecessary URL encoding in an internal link",v);m.fix={desc:"decode",range:[m.startIndex,m.endIndex],text:Ft(a.text())},o.push(m)}if(p="pipe-like",v=_.lintConfig.getSeverity(p,"link"),v&&(d==="link"||d==="category")){const m=h==null?void 0:h.childNodes.findIndex(b=>b.type==="text"&&b.data.includes("|")),x=h==null?void 0:h.childNodes[m];if(x){const b=R(h,c,p,'additional "|" in the link text',v),w=b.startIndex+h.getRelativeIndex(m);b.suggestions=[{desc:"escape",range:[w,w+x.data.length],text:x.data.replace(/\|/gu,"|")}],o.push(b)}}if(p="no-ignored",v=_.lintConfig.getSeverity(p,"fragment"),v&&g!==void 0&&!En(d)){const m=R(a,c,p,"useless fragment",v),x=a.childNodes.findIndex(w=>w.type==="text"&&w.data.includes("#")),b=a.childNodes[x];b&&(m.fix={desc:"remove",range:[m.startIndex+a.getRelativeIndex(x)+b.data.indexOf("#"),m.endIndex],text:""}),o.push(m)}return o}getTitle(r,l){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:l,temporary:r,decode:!0,selfLink:!0})}print(){return super.print(f(this,e)?{pre:"[[",post:"]]",sep:f(this,t)}:{sep:f(this,t)})}json(r,l=this.getAbsoluteIndex()){const o=super.json(void 0,l),{type:a,fragment:h}=this;return h!==void 0&&(a==="link"||a==="redirect-target")&&(o.fragment=h),o}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i),Cs=ee(Rn),Ie=K(Cs,0,"LinkBaseToken",Pn,Ie),X(Cs,1,Ie)}}),je,De=T({"src/nowiki/base.ts"(){"use strict";O(),je=class extends j{get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}}}}),On,Is,Bn,he,Ee=T({"src/nowiki/noinclude.ts"(){"use strict";ot(),De(),On=[ze()],he=class extends(Bn=je){get type(){return"noinclude"}toString(e){return e?"":super.toString()}},Is=ee(Bn),he=K(Is,0,"NoincludeToken",On,he),X(Is,1,he)}}),yl,fa=T({"src/link/redirectTarget.ts"(){"use strict";M(),B(),os(),Ee(),yl=class extends Ie{get type(){return"redirect-target"}constructor(e,t,s,i){super(e,void 0,s,i),t!==void 0&&this.insertAt(new he(t,s,i))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,{halfParsed:!0,decode:!0})}lint(e=this.getAbsoluteIndex()){const t=super.lint(e,!1),s="no-ignored",i=_.lintConfig.getSeverity(s,"redirect");if(i&&this.length===2){const n=R(this.lastChild,{start:e},s,"useless link text",i);n.startIndex--,n.startCol--,n.fix={desc:"remove",range:[n.startIndex,n.endIndex],text:""},t.push(n)}return t}}}}),qn,Ns,Wn,wt,xa=T({"src/redirect.ts"(){"use strict";var e,t,s;ot(),O(),at(),fa(),qn=[ze(!1,!1)],wt=(s=class extends(Wn=j){constructor(n,r,l,o,a,h,d=[]){super(void 0,h,d);N(this,e);N(this,t);L(this,e,n),L(this,t,a),this.append(new He(r,"redirect-syntax",h,d),new yl(l,o==null?void 0:o.slice(1),h,d))}get type(){return"redirect"}getAttribute(n){return n==="padding"?f(this,e).length:super.getAttribute(n)}toString(n){return f(this,e)+super.toString(n)+f(this,t)}lint(n=this.getAbsoluteIndex()){const r=n+f(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",r),this.lastChild.lint(r)}print(){return super.print({pre:f(this,e),post:f(this,t)})}},e=new WeakMap,t=new WeakMap,s),Ns=ee(Wn),wt=K(Ns,0,"RedirectToken",qn,wt),X(Ns,1,wt)}}),Sl={};te(Sl,{parseRedirect:()=>Al});var Al,ma=T({"parser/redirect.ts"(){"use strict";B(),xa(),Al=(e,t,s)=>{var n;(n=t.regexRedirect)!=null||(t.regexRedirect=new RegExp(String.raw`^(\s*)((?:${t.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));const i=t.regexRedirect.exec(e);return i&&_.normalizeTitle(i[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0}).valid?(e=`\0${s.length}o${e.slice(i[0].length)}`,new wt(...i.slice(1),t,s),e):!1}}}),Mn,Ls,Un,yt,va=T({"src/onlyinclude.ts"(){"use strict";Le(),O(),Mn=[$e("<onlyinclude>")],yt=class extends(Un=j){get type(){return"onlyinclude"}toString(e){return`<onlyinclude>${super.toString(e)}</onlyinclude>`}isPlain(){return!0}print(){return super.print({pre:'<span class="wpb-ext"><onlyinclude></span>',post:'<span class="wpb-ext"></onlyinclude></span>'})}},Ls=ee(Un),yt=K(Ls,0,"OnlyincludeToken",Mn,yt),X(Ls,1,yt)}}),Ot,as=T({"mixin/gapped.ts"(){"use strict";Ot=(e=1)=>t=>{class s extends t{getGaps(){return e}}return s}}}),zn,Fs,Hn,qe,Qi=T({"src/tagPair/index.ts"(){"use strict";var e,t;as(),O(),zn=[Ot()],qe=(t=class extends(Hn=j){constructor(i,n,r,l,o,a=[]){super(void 0,o);N(this,e);ke(this,"closed");ke(this,"selfClosing");this.setAttribute("name",i.toLowerCase()),L(this,e,[i,l||i]),this.closed=l!=="",this.selfClosing=l===void 0,this.append(n,r);const h=typeof n=="string"?-1:a.indexOf(n);a.splice(h===-1?1/0:h,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(i){const{selfClosing:n,firstChild:r,lastChild:l}=this,[o,a]=f(this,e);return n?`<${o}${r.toString(i)}/>`:`<${o}${r.toString(i)}>${l.toString(i)}${this.closed?`</${a}>`:""}`}text(){const[i,n]=f(this,e);return this.selfClosing?`<${i}${this.firstChild.text()}/>`:`<${i}${super.text(">")}${this.closed?`</${n}>`:""}`}getAttribute(i){return i==="padding"?f(this,e)[0].length+1:super.getAttribute(i)}print(){const[i,n]=f(this,e);return super.print(this.selfClosing?{pre:`<${i}`,post:"/>"}:{pre:`<${i}`,sep:">",post:this.closed?`</${n}>`:""})}},e=new WeakMap,t),Fs=ee(Hn),qe=K(Fs,0,"TagPairToken",zn,qe),X(Fs,1,qe)}}),kl,ba=T({"src/tagPair/translate.ts"(){"use strict";var e,_l,s;O(),Qi(),at(),Ee(),kl=(s=class extends qe{constructor(n,r,l,o=[]){const a=new He(n,"translate-attr",l,o);r=r==null?void 0:r.replace(/(<tvar\|[^>]+>)([\s\S]*?)(<\/>)/gu,(d,u,g,c)=>(new he(u,l,o),new he(c,l,o),`\0${o.length-1}n${g}\0${o.length}n`)).replace(/(<tvar\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\2|[^"'\s>]+))?\s*>)([\s\S]*?)(<\/tvar\s*>)/giu,(d,u,g,c,p)=>(new he(u,l,o),new he(p,l,o),`\0${o.length-1}n${c}\0${o.length}n`));const h=new j(r,l,o);h.type="translate-inner";super("translate",a,h,"translate",l,o);N(this,e);this.seal("closed",!0),this.seal("selfClosing",!0)}get type(){return"translate"}toString(n){return n?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){return`<span class="wpb-ext"><translate${P(this,e,_l).call(this)?'<span class="wpb-ext-attrs"> <span class="wpb-ext-attr"><span class="wpb-attr-key">nowrap</span></span></span>':""}>${this.lastChild.print({class:"ext-inner"})}</translate></span>`}},e=new WeakSet,_l=function(){return this.firstChild.toString()===" nowrap"},s)}}),Dn,js,Gn,St,wa=T({"src/tagPair/include.ts"(){"use strict";M(),ae(),ot(),B(),Qi(),Dn=[ze(!1)],St=class extends(Gn=qe){get type(){return"include"}constructor(e,t="",s,i,n,r){super(e,t,s!=null?s:"",s===void 0||i!=null?i:"",n,r)}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){const t=[],{firstChild:s,closed:i,name:n}=this,r=new le(this,e),l=["no-ignored","unclosed-comment"],o=l.map(a=>_.lintConfig.getSeverity(a,"include"));if(o[0]&&s.data.trim()){const a=R(s,r,l[0],"useless attribute",o[0]);a.suggestions=[{desc:"remove",range:[a.startIndex,a.endIndex],text:""}],t.push(a)}if(o[1]&&!i){const a=V(this,r,l[1],_.msg("unclosed $1",`<${n}>`),o[1]);a.suggestions=[{desc:"close",range:[a.endIndex,a.endIndex],text:`</${n}>`}],t.push(a)}return t}},js=ee(Gn),St=K(js,0,"IncludeToken",Dn,St),X(js,1,St)}}),ds,Ji=T({"mixin/attributesParent.ts"(){"use strict";ds=(e=0)=>t=>{var i,ji;class s extends t{constructor(){super(...arguments);N(this,i)}hasAttr(o){return P(this,i,ji).call(this).hasAttr(o)}getAttr(o){return P(this,i,ji).call(this).getAttr(o)}}return i=new WeakSet,ji=function(){return this.childNodes[e]},s}}}),se,Es,Ps,pt,Ut,Rs,Oe,Os,Bs,qs,zt,Ws,be,$l,Tl,Cl,Il,ya=T({"util/sharable.ts"(){"use strict";se=new Set(["align"]),Es=new Set(["cite"]),Ps=new Set(["cite","datetime"]),pt=new Set(["width"]),Ut=new Set(["axis","align","bgcolor","height","width","valign"]),Rs=new Set([...Ut,"abbr","headers","scope","rowspan","colspan"]),Oe=new Set(["type"]),Os=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),Bs=new Set(["clear"]),qs=new Set(["bgcolor","align","valign"]),zt=new Set(["qid","forcemathmode","type","display"]),Ws=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),be=new Set,$l=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"]),Tl={div:se,h1:se,h2:se,h3:se,h4:se,h5:se,h6:se,blockquote:Es,q:Es,p:se,br:Bs,pre:pt,ins:Ps,del:Ps,ul:Oe,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...Os,"border"]),caption:se,tr:qs,td:Rs,th:Rs,font:new Set(["size","color","face"]),hr:pt,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Oe,poem:se,categorytree:se,combooption:se,math:be,chem:be,ce:be,img:new Set(["alt","src","width","height","loading"])},Cl={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:be,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:be,inputbox:be,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:be,poll:new Set(["id","show-results-before-voting"]),sm2:Oe,flashmp3:Oe,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([...zt,"chem"]),chem:zt,ce:zt,hiero:be,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:Ws,syntaxhighlight:Ws,templatedata:be,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:be},Il={table:Os,td:new Set([...Ut,"scope"]),th:Ut,br:Bs,caption:se,div:se,hr:pt,h1:se,h2:se,h3:se,h4:se,h5:se,h6:se,li:Oe,p:se,pre:pt,tr:qs,ul:Oe}}}),Vn,Qn,Jn,Xn,Xt,Sa=T({"src/attribute.ts"(){"use strict";var e,t,s,i,n,Ei,l;M(),oe(),Ue(),ya(),ae(),B(),O(),Fe(),Vn=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,Qn=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,Jn=new Set(["ext","arg","magic-word","template"]),Xn=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),Xt=(l=class extends j{constructor(a,h,d,u="",g,c=[],p=_.getConfig(),v=[]){const m=new ge(d,"attr-key",p,v);let x;if(d==="title"||h==="img"&&d==="alt")x=new j(g,p,v,{}),x.type="attr-value",x.setAttribute("stage",xe-1);else if(h==="gallery"&&d==="caption"||h==="choose"&&(d==="before"||d==="after")||h==="img"&&d==="src"&&(g!=null&&g.includes("{{"))){const b=ye(pe({},p),{excludes:[...p.excludes,"heading","html","table","hr","list"]});x=new j(g,b,v,{}),x.type="attr-value",x.setAttribute("stage",1)}else x=new ge(g,"attr-value",p,v,{});super(void 0,p,v);N(this,n);N(this,e);N(this,t);N(this,s);N(this,i);L(this,e,a),this.append(m,x),L(this,s,u),L(this,i,[...c]),L(this,t,h),this.setAttribute("name",it(me(d)))}get type(){return f(this,e)}get tag(){return f(this,t)}get balanced(){return!f(this,s)||f(this,i)[0]===f(this,i)[1]}afterBuild(){f(this,s).includes("\0")&&L(this,s,this.buildFromStr(f(this,s),0)),this.parentNode&&L(this,t,this.parentNode.name),this.setAttribute("name",it(this.firstChild.text())),super.afterBuild()}toString(a){const[h="",d=""]=f(this,i);return f(this,s)?super.toString(a,f(this,s)+h)+d:this.firstChild.toString(a)}text(){return f(this,s)?`${super.text(`${f(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var a,h;return f(this,s)?f(this,s).length+((h=(a=f(this,i)[0])==null?void 0:a.length)!=null?h:0):0}lint(a=this.getAbsoluteIndex(),h){var y;const d=super.lint(a,h),{balanced:u,firstChild:g,lastChild:c,name:p,tag:v}=this,m=new le(this,a),x=["unclosed-quote","obsolete-attr"],b=x.map(A=>_.lintConfig.getSeverity(A,p));if(b[0]&&!u){const A=R(c,m,x[0],_.msg("unclosed $1","quotes"),b[0]);A.startIndex--,A.startCol--,A.suggestions=[{desc:"close",range:[A.endIndex,A.endIndex],text:f(this,i)[0]}],d.push(A)}const w=P(this,n,Ei).call(this,a,m);return w&&d.push(w),b[1]&&((y=Il[v])!=null&&y.has(p))&&d.push(R(g,m,x[1],"obsolete attribute",b[1])),d}getValue(){return f(this,s)?this.lastChild.text().trim():this.type==="ext-attr"||""}getAttribute(a){return a==="invalid"?P(this,n,Ei).call(this):super.getAttribute(a)}print(){const[a="",h=""]=f(this,i);return f(this,s)?super.print({sep:Et(f(this,s))+a,post:h}):super.print()}json(a,h=this.getAbsoluteIndex()){const d=super.json(void 0,h);return d.tag=this.tag,d}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n=new WeakSet,Ei=function(a,h){const{firstChild:d,lastChild:u,type:g,name:c,tag:p,parentNode:v}=this,m=!u.childNodes.some(({type:k})=>Jn.has(k)),x=this.getValue(),b=Cl[p],w=Tl[p],{length:y}=this.toString();let A="illegal-attr";if(!(b!=null&&b.has(c))&&!(w!=null&&w.has(c))&&(g==="ext-attr"?b||w:!/\{\{[^{]+\}\}/u.test(c))&&(g==="ext-attr"&&!w||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(c)&&(p==="meta"||p==="link"||!$l.has(c)))||(c==="itemtype"||c==="itemid"||c==="itemref")&&!(v!=null&&v.hasAttr("itemscope"))){if(a===void 0)return!0;const k=_.lintConfig.getSeverity(A,"unknown");if(k){const S=R(d,h,A,"illegal attribute name",k);return S.suggestions=[{desc:"remove",range:[a,a+y],text:""}],S}}else if(c==="style"&&typeof x=="string"&&Vn.test(x)){if(a===void 0)return!0;A="insecure-style";const k=_.lintConfig.getSeverity(A);return k&&R(u,h,A,"insecure style",k)}else if(c==="tabindex"&&typeof x=="string"&&x!=="0"){if(a===void 0)return!0;const k=_.lintConfig.getSeverity(A,"tabindex");if(k){const S=R(u,h,A,"nonzero tabindex",k);return S.suggestions=[{desc:"remove",range:[a,a+y],text:""},{desc:"0 tabindex",range:[S.startIndex,S.endIndex],text:"0"}],S}}else if(m&&g!=="ext-attr"){const k=fl(p,c),S=String(x).toLowerCase();if(k.length>0&&k.every($=>$!==S)){if(a===void 0)return!0;const $=_.lintConfig.getSeverity(A,"value");return $&&R(u,h,A,"illegal attribute value",$)}}else if(typeof x=="string"&&((/^xmlns:[\w:.-]+$/u.test(c)||Xn.has(c))&&Qn.test(x)||m&&(c==="href"||p==="img"&&c==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(x))){if(a===void 0)return!0;const k=_.lintConfig.getSeverity(A,"value");return k&&R(u,h,A,"illegal attribute value",k)}return!1},l)}}),Ms,Kn,Us,hs,Xi=T({"src/attributes.ts"(){"use strict";var e,t,Kt,i;M(),oe(),ae(),B(),O(),Fe(),Sa(),Ms=n=>n.slice(0,-1),Kn=n=>`${Ms(n)}-dirty`;try{Us=new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch(n){Us=/[^\W_]/u}hs=(i=class extends j{constructor(r,l,o,a,h=[]){super(void 0,a,h,{});N(this,t);N(this,e);if(L(this,e,l),this.setAttribute("name",o),r){const 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 u="",g=d.exec(r),c=0;const p=()=>{u&&(super.insertAt(new ge(u,Kn(l),a,h,{})),u="")};for(;g;){const{index:v,0:m,1:x,2:b,3:w,4:y,5:A,6:k}=g;if(u+=r.slice(c,v),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(me(x).trim())){const S=y!=null?y:k,$=[w,A],C=new Xt(Ms(l),o,x,b,S,$,a,h);p(),super.insertAt(C)}else u+=m;({lastIndex:c}=d),g=d.exec(r)}u+=r.slice(c),p()}}get type(){return f(this,e)}afterBuild(){const{parentNode:r}=this;r!=null&&r.is("td")&&this.setAttribute("name",r.subtype),super.afterBuild()}getAttrTokens(r){return this.childNodes.filter(l=>l instanceof Xt&&(!r||l.name===it(r)))}hasAttr(r){return this.getAttrTokens(r).length>0}getAttrToken(r){const l=this.getAttrTokens(r);return l[l.length-1]}getAttr(r){var l;return(l=this.getAttrToken(r))==null?void 0:l.getValue()}lint(r=this.getAbsoluteIndex(),l){const o=super.lint(r,l),{parentNode:a,childNodes:h}=this,d=new Map,u=new Set,g=new le(this,r),c=["no-ignored","no-duplicate"],p=["closingTag","invalidAttributes","nonWordAttributes"].map(m=>_.lintConfig.getSeverity(c[0],m));if(p[0]&&P(this,t,Kt).call(this)){const m=V(this,g,c[0],"attributes of a closing tag",p[0]),x=a.getAbsoluteIndex();m.suggestions=[{desc:"remove",range:[r,m.endIndex],text:""},{desc:"open",range:[x+1,x+2],text:""}],o.push(m)}for(const m of h)if(m instanceof Xt){const{name:x}=m;d.has(x)?(u.add(x),d.get(x).push(m)):d.set(x,[m])}else{const x=m.text().trim(),b=p[Us.test(x)?1:2];if(x&&b){const w=R(m,g,c[0],"containing invalid attribute",b);w.suggestions=[{desc:"remove",range:[w.startIndex,w.endIndex],text:" "}],o.push(w)}}const v=_.lintConfig.getSeverity(c[1],"attribute");if(v&&u.size>0)for(const m of u){const x=d.get(m).map(b=>{const w=b.getValue();return[b,w===!0?"":w]});o.push(...x.map(([b,w],y)=>{const A=R(b,g,c[1],_.msg("duplicated $1 attribute",m),v),k={desc:"remove",range:[A.startIndex,A.endIndex],text:""};return!w||x.slice(0,y).some(([,S])=>S===w)?A.fix=k:A.suggestions=[k],A}))}return o}getAttribute(r){return r==="invalid"?P(this,t,Kt).call(this):super.getAttribute(r)}print(){return this.toString()?`<span class="wpb-${this.type}${P(this,t,Kt).call(this)?" wpb-invalid":""}">${this.childNodes.map(r=>r.print(r instanceof ge?{class:r.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,Kt=function(){const{parentNode:r}=this;return(r==null?void 0:r.type)==="html"&&r.closing&&this.text().trim()!==""},i)}}),Nl={};te(Nl,{PreToken:()=>Ll});var Ll,Aa=T({"src/pre.ts"(){"use strict";Ue(),O(),Ee(),Ll=class extends j{get type(){return"ext-inner"}constructor(e,t,s=[]){if(e){const i=/<nowiki>/giu,n=/<\/nowiki>/giu,{length:r}=i.source;let l=i.exec(e);l&&(n.lastIndex=l.index+r);let o=n.exec(e),a=0,h="";for(;l&&o;)new he(l[0],t,s),new he(o[0],t,s),h+=`${e.slice(a,l.index)}\0${s.length-1}n${e.slice(l.index+r,o.index)}\0${s.length}n`,a=o.index+r+1,i.lastIndex=a,l=i.exec(e),l&&(n.lastIndex=l.index+r),o=n.exec(e);e=h+e.slice(a)}super(e,t,s,{}),this.setAttribute("stage",xe-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),us,Ki=T({"mixin/multiLine.ts"(){"use strict";us=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
|
|
7
|
-
`).map(r=>l?r:Bt(r,s,n,e)).map(r=>new i(r,"param-line",s,n,{})))}n.splice(n.indexOf(this),1),n.push(this)}lint(e=this.getAbsoluteIndex()){const t="no-ignored",s=_.lintConfig.getSeverity(t,this.name);if(!s)return[];const n=new le(this,e),l=_.msg("invalid parameter of <$1>",this.name),i=[];for(const r of this.childNodes){r.setAttribute("aIndex",e);const o=r.childNodes.filter(({type:a})=>a!=="comment"&&a!=="include"&&a!=="noinclude");if(o.some(({type:a})=>a==="ext"))i.push(R(r,n,t,l,s));else{const a=o.findIndex(({type:d})=>d!=="text"),h=o.slice(0,a===-1?void 0:a).map(String).join("");if(h&&!(a===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(h)){const d=R(r,n,t,l,s);d.suggestions=[{desc:"remove",range:[d.startIndex,d.endIndex],text:""}],i.push(d)}else{const d=r.lint(e,!1);d.length>0&&i.push(...d)}}e+=r.toString().length+1}return i}},Vs=Z(Yn),Ve=te(Vs,0,"ParamTagToken",Kn,Ve),ee(Vs,1,Ve)}}),en,Ll=T({"src/heading.ts"(){"use strict";var e,t,ts,n;M(),pe(),ae(),B(),O(),ot(),en=(n=class extends E{constructor(i,r,o,a=[]){super(void 0,o,a);N(this,t);N(this,e);L(this,e,i);const h=new E(r[0],o,a);h.type="heading-title",h.setAttribute("stage",2);const d=new ze(r[1],"heading-trail",o,a);this.append(h,d)}get type(){return"heading"}get level(){return f(this,e)}toString(i){const r=j(this,t,ts).call(this);return r+this.firstChild.toString(i)+r+this.lastChild.toString(i)}text(){const i=j(this,t,ts).call(this);return i+this.firstChild.text()+i}getAttribute(i){return i==="invalid"?this.inHtmlAttrs()===2:i==="padding"?this.level:super.getAttribute(i)}getGaps(){return this.level}lint(i=this.getAbsoluteIndex(),r){const o=super.lint(i,r),{firstChild:a,level:h}=this,d=a.toString(),u=d.startsWith("="),g=u||d.endsWith("="),c=new le(this,i),p=this.inHtmlAttrs(),v=["h1","unbalanced-header","format-leakage"],m=v.map(x=>_.lintConfig.getSeverity(x,"apostrophe"));if(m[0]&&this.level===1){const x=R(a,c,v[0],"<h1>",m[0]);g||(x.suggestions=[{desc:"h2",range:[x.startIndex,x.endIndex],text:`=${d}=`}]),o.push(x)}if(m[1]&&g){const x=_.msg("unbalanced $1 in a section header",'"="'),b=R(a,c,v[1],x,m[1]);if(d!=="=")if(u){const[w]=/^=+/u.exec(d),y=h+w.length;b.suggestions=[{desc:`h${h}`,range:[b.startIndex,b.startIndex+w.length],text:""}],y<7&&b.suggestions.push({desc:`h${y}`,range:[b.endIndex,b.endIndex],text:w})}else{const w=/[^=](=+)$/u.exec(d)[1],y=h+w.length;b.suggestions=[{desc:`h${h}`,range:[b.endIndex-w.length,b.endIndex],text:""}],y<7&&b.suggestions.push({desc:`h${y}`,range:[b.startIndex,b.startIndex],text:w})}o.push(b)}if(p){const x="parsing-order",b=_.lintConfig.getSeverity(x,p===2?"heading":"templateInTable");b&&o.push(V(this,c,x,"section header in HTML tag attributes",b))}if(m[2]){const x=this.getRootNode().toString(),b=a.childNodes.filter(vs("quote")),w=b.filter(({bold:A})=>A),y=b.filter(({italic:A})=>A);if(w.length%2){const A=R(w[w.length-1],Se(fe({},c),{start:i+h,left:c.left+h}),v[2],_.msg("unbalanced $1 in a section header","bold apostrophes"),m[2]),k=i+h+d.length;x.slice(A.endIndex,k).trim()?A.suggestions=[{desc:"close",range:[k,k],text:"'''"}]:A.fix={desc:"remove",range:[A.startIndex,A.endIndex],text:""},o.push(A)}if(y.length%2){const A=R(y[y.length-1],{start:i+h},v[2],_.msg("unbalanced $1 in a section header","italic apostrophes"),m[2]),k=i+h+d.length;x.slice(A.endIndex,k).trim()?A.suggestions=[{desc:"close",range:[k,k],text:"''"}]:A.fix={desc:"remove",range:[A.startIndex,A.endIndex],text:""},o.push(A)}}return o}print(){const i=j(this,t,ts).call(this);return super.print({pre:i,sep:i})}json(i,r=this.getAbsoluteIndex()){const o=super.json(void 0,r);return o.level=this.level,o}},e=new WeakMap,t=new WeakSet,ts=function(){return"=".repeat(this.level)},n)}}),Zn,Fl,wa=T({"src/parameter.ts"(){"use strict";oe(),M(),B(),O(),Zn=new RegExp(`https?://${et}${tt}$`,"iu"),Fl=class extends E{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(t){return!1}}constructor(e,t,s,n=[]){super(void 0,s,n);const l=new E(typeof e=="number"?void 0:e,s,n,{}),i=new E(t,s,n);l.type="parameter-key",l.setAttribute("stage",2),i.type="parameter-value",i.setAttribute("stage",2),this.append(l,i)}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 i;const s=super.lint(e,t),n="unescaped",l=_.lintConfig.getSeverity(n);if(l){const{firstChild:r}=this,o=(i=Zn.exec(r.text()))==null?void 0:i[0];try{if(o&&new URL(o).search){const a="unescaped query string in an anonymous parameter",h=R(r,{start:e},n,a,l);h.startIndex=h.endIndex,h.startLine=h.endLine,h.startCol=h.endCol,h.endIndex++,h.endCol++,h.fix={desc:"escape",range:[h.startIndex,h.endIndex],text:"{{=}}"},s.push(h)}}catch(a){}}return s}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}}}}),er,Qs,tr,Qe,ya=T({"src/transclude.ts"(){"use strict";var e,t,s,n,l,i,ss,jl,a;oe(),M(),pe(),ae(),cs(),B(),O(),wa(),Fe(),ot(),er=[Ot()],Qe=(a=class extends(tr=E){constructor(d,u,g,c=[]){var I,U;let p;const v=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(d);v&&(p=Number(v[1]),d=d.replace(`\0${p}h`,c[p].toString().replace(/^\n/u,"")));super(void 0,g,c,{});N(this,i);ke(this,"modifier","");N(this,e,"template");N(this,t,":");N(this,s,!1);N(this,n,new Map);N(this,l);const{parserFunction:[m,x],variable:b,functionHook:w}=g,y=(I=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(d))==null?void 0:I[0];if(y)this.setAttribute("modifier",y),d=d.slice(y.length);else if(d.includes(":")){const[F,...P]=d.split(":"),[X]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((U=P[0])!=null?U:"");this.setModifier(`${F}:${X}`)&&(d=P.join(":").slice(X.length))}const A=d.search(/[::]/u),k=d[A]===":",S=A!==-1;if(S||u.length===0&&!f(this,s)){const F=S?d.slice(0,A):d,P=S&&d.slice(A+1),X=ve(F),W=S?X.slice(X.search(/\S/u))+(k?":":""):X.trim(),Q=W.toLowerCase(),z=Array.isArray(x),ie=z?x.includes(W):Object.prototype.hasOwnProperty.call(x,W),q=!z&&ie?x[W]:Object.prototype.hasOwnProperty.call(m,Q)&&m[Q],D=z&&ie||!("functionHook"in g)||w.includes(q),H=z&&ie||b.includes(q);if(S?q&&D:H){this.setAttribute("name",q||Q.replace(/^#|:$/u,"")),L(this,e,"magic-word"),k&&L(this,t,":");const J=new ze(F,"magic-word-name",g,c);if(super.insertAt(J),P!==!1&&u.unshift([P]),this.name==="invoke")for(let ne=0;ne<2;ne++){const K=u.shift();if(!K)break;const re=new ge(K.join("="),`invoke-${ne?"function":"module"}`,g,c);super.insertAt(re)}}}if(this.type==="template"){const F=ve(d).trim();if(!this.normalizeTitle(F,10,{halfParsed:!0,temporary:!0}).valid)throw c.pop(),new SyntaxError("Invalid template name");const P=new ge(d,"template-name",g,c,{});super.insertAt(P)}typeof p=="number"&&(c[p]=void 0);const $=this.isTemplate();let C=1;for(let F=0;F<u.length;F++){const P=u[F];$||this.name==="switch"&&F>0||this.name==="tag"&&F>1||(P[0]=P.join("="),P.length=1),P.length===1&&(P.unshift(C),C++),this.insertAt(new Fl(...P,g,c))}this.seal("modifier")}get type(){return f(this,e)}get module(){}get function(){}setModifier(d){const{parserFunction:[,,u,g]}=this.getAttribute("config"),c=ve(d).trim();if(d&&!c.endsWith(":"))return!1;const p=c.slice(0,-1).toLowerCase(),v=u.includes(p),m=g.includes(p);return f(this,s)&&v||!f(this,s)&&(m||!d)||(be.running||this.length>1)&&(v||m||!d)?(this.setAttribute("modifier",d),L(this,s,v),!!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"&&(L(this,l,j(this,i,ss).call(this)),this.setAttribute("name",f(this,l).title))}toString(d){return`{{${this.modifier}${this.type==="magic-word"?this.firstChild.toString(d)+(this.length===1?"":f(this,t))+this.childNodes.slice(1).map(u=>u.toString(d)).join("|"):super.toString(d,"|")}}}`}text(){const{childNodes:d,length:u,firstChild:g,modifier:c,type:p,name:v}=this;return p==="magic-word"&&v==="vardefine"?"":`{{${c}${p==="magic-word"?g.text()+(u===1?"":f(this,t))+We(d.slice(1),"|"):super.text("|")}}}`}getAttribute(d){switch(d){case"padding":return this.modifier.length+2;case"title":return f(this,l);case"colon":return f(this,t);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!j(this,i,ss).call(this).valid);default:return super.getAttribute(d)}}lint(d=this.getAbsoluteIndex(),u){const g=super.lint(d,u);if(!this.isTemplate())return g;const{type:c,childNodes:p,length:v}=this,m=new le(this,d),x=c==="magic-word";let b="no-ignored",w=_.lintConfig.getSeverity(b,"fragment");if(x&&!j(this,i,ss).call(this).valid)b="invalid-invoke",w=_.lintConfig.getSeverity(b,"name"),w&&g.push(R(p[1],m,b,"illegal module name",w));else if(w){const y=p[x?1:0],A=y.childNodes.findIndex(S=>S.type==="text"&&jt(S.data).includes("#")),k=y.childNodes[A];if(k){const S=R(y,m,b,"useless fragment",w);S.fix={desc:"remove",range:[S.startIndex+y.getRelativeIndex(A)+k.data.indexOf("#"),S.endIndex],text:""},g.push(S)}}if(b="invalid-invoke",w=_.lintConfig.getSeverity(b,"function"),w&&x&&v===2)return g.push(V(this,m,b,"missing module function",w)),g;if(b="no-duplicate",w=_.lintConfig.getSeverity(b,"parameter"),w){const y=this.getDuplicatedArgs().filter(([,k])=>!k[0].querySelector("ext")),A="duplicated parameter";for(const[,k]of y)g.push(...k.map(S=>{const $=R(S,m,b,A,w);return $.suggestions=[{desc:"remove",range:[$.startIndex-1,$.endIndex],text:""}],$}))}return g}insertAt(d,u=this.length){return super.insertAt(d,u),d.anon?j(this,i,jl).call(this,d):d.name&&this.getArgs(d.name,!1,!1).add(d),d}getAllArgs(){return this.childNodes.filter(vs("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:d})=>d)}getArgs(d,u,g=!0){const c=String(d).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");let p;return f(this,n).has(c)?p=f(this,n).get(c):(p=new Set(this.getAllArgs().filter(({name:v})=>c===v)),f(this,n).set(c,p)),p}getDuplicatedArgs(){return[...f(this,n)].filter(([,{size:d}])=>d>1).map(([d,u])=>[d,[...u]])}getPossibleValues(){const{type:d,name:u,childNodes:g}=this;if(d==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let c,p;switch(u){case"if":case"ifexist":case"ifexpr":case"iferror":c=2;break;case"ifeq":c=3;break;case"switch":{const v=g.slice(2),m=v[v.length-1];p=[...v.filter(({anon:x})=>!x),...m!=null&&m.anon?[m]:[]].map(({lastChild:x})=>x);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}p!=null||(p=g.slice(c,c+2).map(({lastChild:v})=>v));for(let v=0;v<p.length;){const{length:m,0:x}=p[v].childNodes.filter(b=>b.text().trim());if(m===0)p.splice(v,1);else if(m>1||x.type!=="magic-word")v++;else try{const b=x.getPossibleValues();p.splice(v,1,...b),v+=b.length}catch(b){v++}}return p}print(){const{childNodes:d,length:u,firstChild:g,modifier:c,type:p}=this;return`<span class="wpb-${p}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${p==="magic-word"?Et(c)+g.print()+(u===1?"":f(this,t))+it(d.slice(1),{sep:"|"}):(c?`<span class="wpb-magic-word">${Et(c)}</span>`:"")+it(d,{sep:"|"})}}}</span>`}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n=new WeakMap,l=new WeakMap,i=new WeakSet,ss=function(){const d=this.type==="template";return this.normalizeTitle(this.childNodes[d?0:1].text(),d?10:828,{temporary:!0})},jl=function(d){const u=this.getAnonArgs(),g=typeof d!="number";for(let c=g?u.indexOf(d):d-1;c<u.length;c++){const p=u[c],{name:v}=p,m=String(c+1);(v!==m||p===d)&&(p.setAttribute("name",m),this.getArgs(m,!1,!1).add(p))}},a),Qs=Z(tr),Qe=te(Qs,0,"TranscludeToken",er,Qe),ee(Qs,1,Qe)}}),sr,Js,ir,yt,Sa=T({"src/hidden.ts"(){"use strict";lt(),O(),sr=[Ue()],yt=class extends(ir=E){get type(){return"hidden"}getAttribute(e){return e==="invalid"||super.getAttribute(e)}},Js=Z(ir),yt=te(Js,0,"HiddenToken",sr,yt),ee(Js,1,yt)}}),nr,Xs,rr,St,Aa=T({"src/arg.ts"(){"use strict";var e,ka,s;oe(),M(),ae(),Le(),cs(),B(),O(),Fe(),Sa(),nr=[Te("{{{"),Ot()],St=(s=class extends(rr=E){constructor(l,i,r=[]){super(void 0,i,r,{});N(this,e);for(let o=0;o<l.length;o++){const a=l[o];if(o===0){const h=new ge(a,"arg-name",i,r,{});super.insertAt(h)}else if(o>1){const h=new yt(a,i,r);super.insertAt(h)}else{const h=new E(a,i,r);h.type="arg-default",h.setAttribute("stage",2),super.insertAt(h)}}}get type(){return"arg"}get default(){var l,i;return(i=(l=this.childNodes[1])==null?void 0:l.text())!=null?i:!1}toString(l){return`{{{${super.toString(l,"|")}}}}`}text(){return`{{{${We(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){super.afterBuild()}lint(l=this.getAbsoluteIndex(),i){const{childNodes:[r,o,...a]}=this;r.setAttribute("aIndex",l+3);const h=r.lint(l+3,i);if(o){const g=l+4+r.toString().length;o.setAttribute("aIndex",g);const c=o.lint(g,i);c.length>0&&h.push(...c)}const d=["no-ignored","no-arg"],u=d.map(g=>_.lintConfig.getSeverity(g,"arg"));if(u[0]&&a.length>0){const g=new le(this,l);h.push(...a.map(c=>{const p=R(c,g,d[0],"invisible content inside triple braces",u[0]);return p.startIndex--,p.startCol--,p.suggestions=[{desc:"remove",range:[p.startIndex,p.endIndex],text:""},{desc:"escape",range:[p.startIndex,p.startIndex+1],text:"{{!}}"}],p}))}if(u[1]&&!this.getAttribute("include")){const g=V(this,{start:l},d[1],"unexpected template argument",u[1]);o&&(g.suggestions=[{desc:"expand",range:[l,g.endIndex],text:o.text()}]),h.push(g)}return h}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(l,i=this.getAbsoluteIndex()){const r=super.json(void 0,i);return r.default=this.default,r}},e=new WeakSet,ka=function(){},s),Xs=Z(rr),St=te(Xs,0,"ArgToken",nr,St),ee(Xs,1,St)}}),El={};Y(El,{parseBraces:()=>xs});var lr,Ks,Gt,Ys,Zs,ei,or,ti,xs,tn=T({"parser/braces.ts"(){"use strict";Rt(),oe(),Ll(),ya(),Aa(),lr={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},Ks=String.raw`\[(?!\[)`,Gt=String.raw`\n(?![=\0])`,Ys=String.raw`|\{{2,}`,Zs=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),ei=Ze(e=>new RegExp(e,"gmu")),or=new RegExp(String.raw`\{\{((?:[^\n{}[]|${Ks}|${Gt})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${Gt})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${Ks}|${Gt})*\}-`,"gu"),ti=e=>{const t=st(ve(e));return Zs.has(t)?Zs.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},xs=(e,t,s)=>{var p,v,m,x,b;const n=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,l]}=t,i=[],r=[],o=(w,y,A,k)=>{y[y.length-1].push($e(w.slice(A,k),r))};let a;do a!==void 0&&(e=a),a=e.replace(or,(w,y,A)=>{if(y!==void 0||typeof A=="string")try{const{length:k}=s,S=(y!=null?y:A).split("|");return new Qe($e(S[0],r),S.slice(1).map($=>{const C=$.indexOf("=");return(C===-1?[$]:[$.slice(0,C),$.slice(C+1)]).map(I=>$e(I,r))}),t,s),`\0${k}${ti(S[0])}`}catch(k){if(!(k instanceof SyntaxError)||k.message!=="Invalid template name")throw k}return r.push($e(w,r)),`\0${r.length-1}`});while(a!==e);e=a;const h=e.lastIndexOf("}}")-e.length;let d=h+e.length!==-1,u=ei(n+(d?Ys:"")),g=u.exec(e),c;for(;g||c!==void 0&&c<=e.length&&((v=(p=i[i.length-1])==null?void 0:p[0])!=null&&v.startsWith("="));){if(g!=null&&g[1]){const[,{length:P}]=g;g[0]=g[0].slice(P),g.index+=P}const{0:w,index:y}=g!=null?g:{0:`
|
|
8
|
-
`,index:e.length},A=(m=
|
|
9
|
-
`){c=y+1;const{pos:
|
|
10
|
-
`)||(e=`${e.slice(0,S)}\0${s.length}h${e.slice(y)}`,c=S+4+String(s.length).length,new
|
|
11
|
-
)`:""}(\s*)$`,"u")),
|
|
12
|
-
`))!=null?a:[]){const d=/^([^|]+)(?:\|(.*))?/u.exec(h);if(!d){super.insertAt(h.trim()?new he(h,
|
|
13
|
-
`),l=new Set(t.protocol.split("|")),i=he;let r=!0,o=!1;for(const a of n){const h=a.trim();if(!(o||!h||h.startsWith("#"))){if(r){const d=a.indexOf("|"),u=d===-1?a:a.slice(0,d),{valid:g,ns:c}=this.normalizeTitle(u,0,{halfParsed:!0,temporary:!0});if(g&&c===6){const p=new Je("imagemap",u,d===-1?void 0:a.slice(d+1),t,s);super.insertAt(p),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("["),u=a.slice(d),g=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(u);if(g){if(this.normalizeTitle(g[1],0,{halfParsed:!0,temporary:!0,selfLink:!0}).valid){super.insertAt(new Ui(a.slice(0,d),g.slice(1),u.slice(u.indexOf("]]")+2),t,s));continue}}else if(u.startsWith("[//")||l.has(u.slice(1,u.indexOf(":")+1))||l.has(u.slice(1,u.indexOf("//")+2))){const c=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(u);if(c){super.insertAt(new Ui(a.slice(0,d),c.slice(1),u.slice(u.indexOf("]")+1),t,s));continue}}}}super.insertAt(new i(a,t,s))}}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),n=new le(this,e),{childNodes:l,image:i}=this,r="invalid-imagemap",o=_.lintConfig.getSeverity(r,i?"link":"image");return o&&(i?s.push(...l.filter(a=>{const h=a.toString().trim();return a.is("noinclude")&&h&&!h.startsWith("#")}).map(a=>{const h=R(a,n,r,"invalid link in <imagemap>",o);return h.suggestions=[{desc:"remove",range:[h.startIndex-1,h.endIndex],text:""},{desc:"comment",range:[h.startIndex,h.startIndex],text:"# "}],h})):s.push(V(this,n,r,"<imagemap> without an image",o))),s}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}},hi=Z($r),kt=te(hi,0,"ImagemapToken",_r,kt),ee(hi,1,kt)}}),Tr,ui,Cr,Ke,Jl=T({"src/nowiki/comment.ts"(){"use strict";M(),lt(),Le(),B(),He(),Tr=[Ue(!1),Te("<!--")],Ke=class extends(Cr=je){constructor(t,s,n,l){super(t,n,l);ke(this,"closed");this.closed=s}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){if(this.closed)return[];const s="unclosed-comment",n=_.lintConfig.getSeverity(s);if(!n)return[];const l=V(this,{start:t},s,_.msg("unclosed $1","HTML comment"),n);return l.suggestions=[{desc:"close",range:[l.endIndex,l.endIndex],text:"-->"}],[l]}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}},ui=Z(Cr),Ke=te(ui,0,"CommentToken",Tr,Ke),ee(ui,1,Ke)}}),Xl={};Y(Xl,{CommentedToken:()=>Kl});var Kl,Na=T({"src/commented.ts"(){"use strict";O(),Jl(),Kl=class extends E{get type(){return"ext-inner"}constructor(e,t,s=[]){if(super(void 0,t,s,{AstText:":",CommentToken:":"}),e){let n=e.indexOf("<!--"),l=n!==-1&&e.indexOf("-->",n+4),i=0;for(;l!==!1&&l!==-1;)n>i&&this.insertAt(e.slice(i,n)),this.insertAt(new Ke(e.slice(n+4,l),!0,t,s)),i=l+3,n=e.indexOf("<!--",i),l=n!==-1&&e.indexOf("-->",n+4);i<e.length&&this.insertAt(e.slice(i))}}lint(e=this.getAbsoluteIndex()){return super.lint(e,new RegExp(String.raw`<\s*(?:\/\s*)?(${this.name})\b`,"giu"))}}}}),Yl={};Y(Yl,{NowikiToken:()=>Zl});var Ir,Nr,Zl,La=T({"src/nowiki/index.ts"(){"use strict";var e,zi,s;Rt(),M(),B(),He(),Ir=Ze(n=>new RegExp(String.raw`<\s*(?:/\s*)${n==="nowiki"?"":"?"}(${n})\b`,"giu")),Nr=new Set(["img","languages","section","templatestyles"]),Zl=(s=class extends je{constructor(){super(...arguments);N(this,e)}get type(){return"ext-inner"}lint(l=this.getAbsoluteIndex()){const{name:i}=this,r="void-ext",o=_.lintConfig.getSeverity(r,i);if(o&&j(this,e,zi).call(this)){const a=V(this,{start:l},r,_.msg("nothing should be in <$1>",i),o);return a.fix={desc:"empty",range:[l,a.endIndex],text:""},[a]}return super.lint(l,Ir(i))}getAttribute(l){return l==="invalid"?j(this,e,zi).call(this):super.getAttribute(l)}},e=new WeakSet,zi=function(){const{name:l,firstChild:{data:i}}=this;return Nr.has(l)&&!!i},s)}}),Lr,ci,Fr,Ye,eo=T({"src/tagPair/ext.ts"(){"use strict";M(),ae(),B(),Ki(),O(),Xi(),Yi(),Lr=[gs()],Ye=class extends(Fr=Be){get type(){return"ext"}constructor(e,t,s,n,l=_.getConfig(),i=!1,r=[]){const o=e.toLowerCase(),a=new ps(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",o,l,r),h=Se(fe({},l),{ext:l.ext.filter(u=>u!==o),excludes:[...l.excludes]});let d;switch(h.inExt=!0,o){case"tab":h.ext=h.ext.filter(u=>u!=="tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":o==="poem"&&h.excludes.push("heading"),d=new E(s,h,r);break;case"pre":{const{PreToken:u}=(ba(),G(Tl));d=new u(s,h,r);break}case"dynamicpagelist":{const{ParamTagToken:u}=(Nl(),G(Il));d=new u(i,s,h,r);break}case"inputbox":{const{InputboxToken:u}=(_a(),G(Pl));d=new u(i,s,h,r);break}case"references":{const{NestedToken:u}=(si(),G(is));h.excludes.push("heading"),d=new u(s,i,["ref"],h,r);break}case"choose":{const{NestedToken:u}=(si(),G(is));d=new u(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],h,r);break}case"combobox":{const{NestedToken:u}=(si(),G(is));d=new u(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],h,r);break}case"gallery":{const{GalleryToken:u}=(Ta(),G(Hl));d=new u(s,h,r);break}case"imagemap":{const{ImagemapToken:u}=(Ia(),G(Ql));d=new u(s,h,r);break}case"hiero":{const{CommentedToken:u}=(Na(),G(Xl));d=new u(s,h,r);break}default:{const{NowikiToken:u}=(La(),G(Yl));d=new u(s,h,r)}}d.setAttribute("name",o),d.type==="plain"&&(d.type="ext-inner"),super(e,a,d,n,l,r),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),n=new le(this,e);if(this.name!=="nowiki"){const r=this.inHtmlAttrs(),o="parsing-order",a=r&&_.lintConfig.getSeverity(o,r===2?"ext":"templateInTable");a&&s.push(V(this,n,o,"extension tag in HTML tag attributes",a))}const l="var-anchor",i=_.lintConfig.getSeverity(l,"ref");return i&&this.name==="ref"&&this.closest("heading-title")&&s.push(V(this,n,l,"variable anchor in a section header",i)),s}},ci=Z(Fr),Ye=te(ci,0,"ExtToken",Lr,Ye),ee(ci,1,Ye)}}),to={};Y(to,{parseCommentAndExt:()=>Bt});var gi,jr,Vt,Er,pi,Bt,ms=T({"parser/commentAndExt.ts"(){"use strict";Rt(),oe(),pa(),Ee(),fa(),xa(),eo(),Jl(),gi="<onlyinclude>",jr="</onlyinclude>",{length:Vt}=gi,Er=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",s=e?"noinclude":"includeonly";return ul(n=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${n.filter(l=>l!=="img").join("|")})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(${"\\1"}\s*)>)|<(${s})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${s}\s*)>|$))${n.includes("img")?String.raw`|<img(\s[^>]*?)?(/?)>`:""}`,"giu"))}),pi=e=>{const t=e.indexOf(gi);return{i:t,j:e.indexOf(jr,t+Vt)}},Bt=(e,t,s,n)=>{if(n){let{i:o,j:a}=pi(e);if(o!==-1&&a!==-1){let h="";const d=u=>{new he(u,t,s),h+=`\0${s.length-1}n`};for(;o!==-1&&a!==-1;){const u=`\0${s.length}e`;new bt(e.slice(o+Vt,a),t,s),o>0&&d(e.slice(0,o)),h+=u,e=e.slice(a+Vt+1),{i:o,j:a}=pi(e)}return e&&d(e),h}}const{ext:l}=t,i=l.filter(o=>o!=="translate"&&o!=="tvar"),r=Se(fe({},t),{ext:i});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,h,d)=>{const u=s.length;return new yl(h,d&&$e(d,o),r,s),`\0${u}g`}),e=$e(e,o)}return e.replace(Er[n?1:0](i),(o,a,h,d,u,g,c,p,v,m,x)=>{const b=s.length;let w="n";if(a||i.includes("img")&&x!==void 0)w="e",new Ye(a!=null?a:"img",a?h:m,d,a?u:x&&void 0,r,g,s);else if(o.startsWith("<!--")){w="c";const y=o.endsWith("-->");new Ke(o.slice(4,y?-3:void 0),y,t,s)}else g?new wt(g,c,p,v,t,s):new he(o,t,s);return`\0${b}${w}`})}}}),Pr,Rr,Or,Br,fi,qr,_t,Fa=T({"src/html.ts"(){"use strict";var e,t,s,n,l;M(),pe(),ae(),Ki(),B(),O(),Pr=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),Rr=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"]),Or=new Set(["strike","big","center","font","tt"]),Br=[gs()],_t=(l=class extends(qr=E){constructor(r,o,a,h,d,u){super(void 0,d,u);N(this,e);N(this,t);N(this,s);N(this,n);this.insertAt(o),this.setAttribute("name",r.toLowerCase()),L(this,e,a),L(this,t,h),L(this,s,r)}get type(){return"html"}get selfClosing(){return f(this,t)}get closing(){return f(this,e)}toString(r){return`<${this.closing?"/":""}${f(this,s)}${super.toString(r)}${f(this,t)?"/":""}>`}text(){const{closing:r}=this,o=f(this,s)+(r?"":super.text());return`<${r?"/":""}${o}${f(this,t)?"/":""}>`}getAttribute(r){return r==="invalid"?this.inTableAttrs()===2:r==="padding"?f(this,s).length+(this.closing?2:1):super.getAttribute(r)}lint(r=this.getAbsoluteIndex(),o){const a=super.lint(r,o),{name:h,parentNode:d,closing:u,selfClosing:g}=this,c=new le(this,r),p=this.inTableAttrs();let v="h1",m=_.lintConfig.getSeverity(v,"html");if(m&&h==="h1"&&!u){const k=V(this,c,v,"<h1>",m);k.suggestions=[{desc:"h2",range:[r+2,r+3],text:"2"}],a.push(k)}if(v="parsing-order",m=p&&_.lintConfig.getSeverity(v,p===2?"html":"templateInTable"),m){const k=V(this,c,v,"HTML tag in table attributes",m);p===2&&(k.fix={desc:"remove",range:[r,k.endIndex],text:""}),a.push(k)}v="obsolete-tag",m=_.lintConfig.getSeverity(v,h),m&&Or.has(h)&&a.push(V(this,c,v,"obsolete HTML tag",m)),v="bold-header",m=_.lintConfig.getSeverity(v,h),m&&(h==="b"||h==="strong")&&this.closest("heading-title")&&a.push(V(this,c,v,"bold in section header",m));const{html:[,x,b]}=this.getAttribute("config"),w=b.includes(h),y=x.includes(h),A=!w&&!y;if(v="unmatched-tag",u&&(g||w)||g&&A){if(m=_.lintConfig.getSeverity(v,u?"both":"selfClosing"),m){const k=V(this,c,v,u?"tag that is both closing and self-closing":"invalid self-closing tag",m),S={desc:"open",range:[r+1,r+2],text:""},$={desc:"no self-closing",range:[k.endIndex-2,k.endIndex-1],text:""};y?k.suggestions=[S,$]:u?k.fix=w?S:$:k.suggestions=[$,{desc:"close",range:[k.endIndex-2,k.endIndex],text:`></${h}>`}],a.push(k)}}else if(!this.findMatchingTag()){const k=V(this,c,v,u?"unmatched closing tag":"unclosed tag"),S=this.closest("magic-word");if(S&&Pr.has(S.name))m=_.lintConfig.getSeverity(v,"conditional");else if(u)m=_.lintConfig.getSeverity(v,"closing"),k.suggestions=[{desc:"remove",range:[r,k.endIndex],text:""}];else{m=_.lintConfig.getSeverity(v,"opening");const $=d==null?void 0:d.childNodes;Rr.has(h)&&($!=null&&$.slice(0,$.indexOf(this)).some(({type:C,name:I})=>C==="html"&&I===h)&&(k.suggestions=[{desc:"close",range:[r+1,r+1],text:"/"}]),this.closest("heading-title")&&(k.rule="format-leakage",m=_.lintConfig.getSeverity("format-leakage",h)))}m&&(k.severity=m,a.push(k))}return a}findMatchingTag(){return qe(f(this,n),()=>{const{name:r,parentNode:o,closing:a,selfClosing:h}=this,{html:[,d,u]}=this.getAttribute("config"),g=u.includes(r),c=d.includes(r);if(g||c&&h)return this;if(!o)return;const{childNodes:p}=o,v=p.indexOf(this),m=a?p.slice(0,v).reverse():p.slice(v+1),x=[this],{rev:b}=be;for(const w of m)if(!(!w.is("html")||w.name!==r||c&&f(w,t)))if(f(w,e)===a)x.push(w);else{const y=x.pop();if(y===this)return w;_.viewOnly&&(L(y,n,[b,w]),L(w,n,[b,y]))}if(_.viewOnly)for(const w of x)L(w,n,[b,void 0])},r=>{L(this,n,r),r[1]&&r[1]!==this&&L(r[1],n,[be.rev,this])})}print(){return super.print({pre:`<${this.closing?"/":""}${f(this,s)}`,post:`${f(this,t)?"/":""}>`})}json(r,o=this.getAbsoluteIndex()){const a=super.json(void 0,o);return Object.assign(a,{closing:this.closing,selfClosing:f(this,t)}),a}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n=new WeakMap,l),fi=Z(qr),_t=te(fi,0,"HtmlToken",Br,_t),ee(fi,1,_t)}}),so={};Y(so,{parseHtml:()=>io});var Wr,io,ja=T({"parser/html.ts"(){"use strict";Yi(),Fa(),Wr=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,io=(e,t,s)=>{var r;const{html:n}=t;(r=t.htmlElements)!=null||(t.htmlElements=new Set([...n[0],...n[1],...n[2]]));const l=e.split("<");let i=l.shift();for(const o of l){const a=Wr.exec(o),h=a==null?void 0:a[2],d=h==null?void 0:h.toLowerCase();if(!a||!t.htmlElements.has(d)){i+=`<${o}`;continue}const[,u,,g="",c,p]=a,{length:v}=s,m=new ps(g,"html-attrs",d,t,s),x=m.hasAttr("itemprop");if(d==="meta"&&!(x&&m.hasAttr("content"))||d==="link"&&!(x&&m.hasAttr("href"))){i+=`<${o}`,s.length=v;continue}i+=`\0${s.length}x${p}`,new _t(h,m,u==="/",c==="/>",t,s)}return i}}}),ln,no=T({"src/table/base.ts"(){"use strict";Ki(),O(),ot(),Yi(),ln=class extends gs(1)(E){constructor(e,t,s,n,l,i=[],r){super(void 0,l,i,r),this.append(new ze(t,"table-syntax",l,i),new ps(n,"table-attrs",s,l,i))}}}}),Mr,xi,ye,Qt,pt,ft,ls,ro=T({"src/table/td.ts"(){"use strict";M(),ae(),Ji(),B(),O(),no(),ls=class extends(xi=ln,Mr=[hs(!1)],xi){constructor(e,t,s,n=[]){var o;let l=/\||\0\d+!\x7F/u.exec(t!=null?t:""),i=l?t.slice(0,l.index):"";/\[\[|-\{/u.test(i)&&(l=null,i=""),super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",i,s,n),ee(Qt,5,this),_e(this,pt),_e(this,ye,""),l&&([la(this,ye)._]=l);const r=new E(t==null?void 0:t.slice(((o=l==null?void 0:l.index)!=null?o:NaN)+de(this,ye).length),s,n);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 Lt(this,pt,ft).call(this).subtype}afterBuild(){de(this,ye).includes("\0")&&xe(this,ye,this.buildFromStr(de(this,ye),0)),super.afterBuild()}toString(e){const{childNodes:[t,s,n]}=this;return t.toString(e)+s.toString(e)+de(this,ye)+n.toString(e)}text(){const{childNodes:[e,t,s]}=this;return e.text()+t.text()+de(this,ye)+s.text()}getGaps(e){return e===1?de(this,ye).length:0}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),n=new le(this,e+this.getRelativeIndex(this.length-1)),l="pipe-like",i=["td","double"].map(r=>_.lintConfig.getSeverity(l,r));for(const r of this.lastChild.childNodes)if(r.type==="text"){const{data:o}=r;if(o.includes("|")){const a=o.includes("||"),h=i[a?1:0];if(h){const d=R(r,n,l,'additional "|" in a table cell',h);if(a){const u={caption:"|+",td:"|",th:"!"}[this.subtype];d.fix={desc:"newline",range:[d.startIndex,d.endIndex],text:o.replace(/\|\|/gu,`
|
|
6
|
+
`})}}return t}}}),Fl={};te(Fl,{ParamTagToken:()=>Qe});var Yn,zs,Zn,Qe,jl=T({"src/paramTag/index.ts"(){"use strict";M(),ae(),gs(),Ki(),B(),O(),Fe(),Yn=[us],Qe=class extends(Zn=j){get type(){return"ext-inner"}constructor(e,t,s=_.getConfig(),i=[],n){if(super(void 0,s,i,{}),t){const r=ge;this.append(...t.split(`
|
|
7
|
+
`).map(l=>n?l:Bt(l,s,i,e)).map(l=>new r(l,"param-line",s,i,{})))}i.splice(i.indexOf(this),1),i.push(this)}lint(e=this.getAbsoluteIndex()){const t="no-ignored",s=_.lintConfig.getSeverity(t,this.name);if(!s)return[];const i=new le(this,e),n=_.msg("invalid parameter of <$1>",this.name),r=[];for(const l of this.childNodes){l.setAttribute("aIndex",e);const o=l.childNodes.filter(({type:a})=>a!=="comment"&&a!=="include"&&a!=="noinclude");if(o.some(({type:a})=>a==="ext"))r.push(R(l,i,t,n,s));else{const a=o.findIndex(({type:d})=>d!=="text"),h=o.slice(0,a===-1?void 0:a).map(String).join("");if(h&&!(a===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(h)){const d=R(l,i,t,n,s);d.suggestions=[{desc:"remove",range:[d.startIndex,d.endIndex],text:""}],r.push(d)}else{const d=l.lint(e,!1);d.length>0&&r.push(...d)}}e+=l.toString().length+1}return r}},zs=ee(Zn),Qe=K(zs,0,"ParamTagToken",Yn,Qe),X(zs,1,Qe)}}),Yi,El=T({"src/heading.ts"(){"use strict";var e,t,Yt,i;M(),Se(),ae(),B(),O(),at(),Yi=(i=class extends j{constructor(r,l,o,a=[]){super(void 0,o,a);N(this,t);N(this,e);L(this,e,r);const h=new j(l[0],o,a);h.type="heading-title",h.setAttribute("stage",2);const d=new He(l[1],"heading-trail",o,a);this.append(h,d)}get type(){return"heading"}get level(){return f(this,e)}toString(r){const l=P(this,t,Yt).call(this);return l+this.firstChild.toString(r)+l+this.lastChild.toString(r)}text(){const r=P(this,t,Yt).call(this);return r+this.firstChild.text()+r}getAttribute(r){return r==="invalid"?this.inHtmlAttrs()===2:r==="padding"?this.level:super.getAttribute(r)}getGaps(){return this.level}lint(r=this.getAbsoluteIndex(),l){const o=super.lint(r,l),{firstChild:a,level:h}=this,d=a.toString(),u=d.startsWith("="),g=u||d.endsWith("="),c=new le(this,r),p=this.inHtmlAttrs(),v=["h1","unbalanced-header","format-leakage"],m=v.map(x=>_.lintConfig.getSeverity(x,"apostrophe"));if(m[0]&&this.level===1){const x=R(a,c,v[0],"<h1>",m[0]);g||(x.suggestions=[{desc:"h2",range:[x.startIndex,x.endIndex],text:`=${d}=`}]),o.push(x)}if(m[1]&&g){const x=_.msg("unbalanced $1 in a section header",'"="'),b=R(a,c,v[1],x,m[1]);if(d!=="=")if(u){const[w]=/^=+/u.exec(d),y=h+w.length;b.suggestions=[{desc:`h${h}`,range:[b.startIndex,b.startIndex+w.length],text:""}],y<7&&b.suggestions.push({desc:`h${y}`,range:[b.endIndex,b.endIndex],text:w})}else{const w=/[^=](=+)$/u.exec(d)[1],y=h+w.length;b.suggestions=[{desc:`h${h}`,range:[b.endIndex-w.length,b.endIndex],text:""}],y<7&&b.suggestions.push({desc:`h${y}`,range:[b.startIndex,b.startIndex],text:w})}o.push(b)}if(p){const x="parsing-order",b=_.lintConfig.getSeverity(x,p===2?"heading":"templateInTable");b&&o.push(V(this,c,x,"section header in HTML tag attributes",b))}if(m[2]){const x=this.getRootNode().toString(),b=a.childNodes.filter(ps("quote")),w=b.filter(({bold:A})=>A),y=b.filter(({italic:A})=>A);if(w.length%2){const A=R(w[w.length-1],ye(pe({},c),{start:r+h,left:c.left+h}),v[2],_.msg("unbalanced $1 in a section header","bold apostrophes"),m[2]),k=r+h+d.length;x.slice(A.endIndex,k).trim()?A.suggestions=[{desc:"close",range:[k,k],text:"'''"}]:A.fix={desc:"remove",range:[A.startIndex,A.endIndex],text:""},o.push(A)}if(y.length%2){const A=R(y[y.length-1],{start:r+h},v[2],_.msg("unbalanced $1 in a section header","italic apostrophes"),m[2]),k=r+h+d.length;x.slice(A.endIndex,k).trim()?A.suggestions=[{desc:"close",range:[k,k],text:"''"}]:A.fix={desc:"remove",range:[A.startIndex,A.endIndex],text:""},o.push(A)}}return o}print(){const r=P(this,t,Yt).call(this);return super.print({pre:r,sep:r})}json(r,l=this.getAbsoluteIndex()){const o=super.json(void 0,l);return o.level=this.level,o}},e=new WeakMap,t=new WeakSet,Yt=function(){return"=".repeat(this.level)},i)}}),er,Pl,ka=T({"src/parameter.ts"(){"use strict";oe(),M(),B(),O(),er=new RegExp(`https?://${tt}${st}$`,"iu"),Pl=class extends j{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(t){return!1}}constructor(e,t,s,i=[]){super(void 0,s,i);const n=new j(typeof e=="number"?void 0:e,s,i,{}),r=new j(t,s,i);n.type="parameter-key",n.setAttribute("stage",2),r.type="parameter-value",r.setAttribute("stage",2),this.append(n,r)}trimName(e,t=!0){const s=(typeof e=="string"?e:e.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",s),s}afterBuild(){if(!this.anon){const{parentNode:e,firstChild:t}=this,s=this.trimName(t);e&&e.getArgs(s,!1,!1).add(this)}super.afterBuild()}toString(e){return this.anon?this.lastChild.toString(e):super.toString(e,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(e=this.getAbsoluteIndex(),t){var r;const s=super.lint(e,t),i="unescaped",n=_.lintConfig.getSeverity(i);if(n){const{firstChild:l}=this,o=(r=er.exec(l.text()))==null?void 0:r[0];try{if(o&&new URL(o).search){const a="unescaped query string in an anonymous parameter",h=R(l,{start:e},i,a,n);h.startIndex=h.endIndex,h.startLine=h.endLine,h.startCol=h.endCol,h.endIndex++,h.endCol++,h.fix={desc:"escape",range:[h.startIndex,h.endIndex],text:"{{=}}"},s.push(h)}}catch(a){}}return s}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}}}}),tr,Hs,sr,Je,_a=T({"src/transclude.ts"(){"use strict";var e,t,s,i,n,r,Zt,Rl,a;oe(),M(),Se(),ae(),as(),B(),O(),ka(),Fe(),at(),tr=[Ot()],Je=(a=class extends(sr=j){constructor(d,u,g,c=[]){var I,U;let p;const v=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(d);v&&(p=Number(v[1]),d=d.replace(`\0${p}h`,c[p].toString().replace(/^\n/u,"")));super(void 0,g,c,{});N(this,r);ke(this,"modifier","");N(this,e,"template");N(this,t,":");N(this,s,!1);N(this,i,new Map);N(this,n);const{parserFunction:[m,x],variable:b,functionHook:w}=g,y=(I=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(d))==null?void 0:I[0];if(y)this.setAttribute("modifier",y),d=d.slice(y.length);else if(d.includes(":")){const[F,...E]=d.split(":"),[Y]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((U=E[0])!=null?U:"");this.setModifier(`${F}:${Y}`)&&(d=E.join(":").slice(Y.length))}const A=d.search(/[::]/u),k=d[A]===":",S=A!==-1;if(S||u.length===0&&!f(this,s)){const F=S?d.slice(0,A):d,E=S&&d.slice(A+1),Y=me(F),W=S?Y.slice(Y.search(/\S/u))+(k?":":""):Y.trim(),Q=W.toLowerCase(),z=Array.isArray(x),ie=z?x.includes(W):Object.prototype.hasOwnProperty.call(x,W),q=!z&&ie?x[W]:Object.prototype.hasOwnProperty.call(m,Q)&&m[Q],D=z&&ie||!("functionHook"in g)||w.includes(q),H=z&&ie||b.includes(q);if(S?q&&D:H){this.setAttribute("name",q||Q.replace(/^#|:$/u,"")),L(this,e,"magic-word"),k&&L(this,t,":");const J=new He(F,"magic-word-name",g,c);if(super.insertAt(J),E!==!1&&u.unshift([E]),this.name==="invoke")for(let ne=0;ne<2;ne++){const Z=u.shift();if(!Z)break;const re=new ge(Z.join("="),`invoke-${ne?"function":"module"}`,g,c);super.insertAt(re)}}}if(this.type==="template"){const F=me(d).trim();if(!this.normalizeTitle(F,10,{halfParsed:!0,temporary:!0}).valid)throw c.pop(),new SyntaxError("Invalid template name");const E=new ge(d,"template-name",g,c,{});super.insertAt(E)}typeof p=="number"&&(c[p]=void 0);const $=this.isTemplate();let C=1;for(let F=0;F<u.length;F++){const E=u[F];$||this.name==="switch"&&F>0||this.name==="tag"&&F>1||(E[0]=E.join("="),E.length=1),E.length===1&&(E.unshift(C),C++),this.insertAt(new Pl(...E,g,c))}this.seal("modifier")}get type(){return f(this,e)}get module(){}get function(){}setModifier(d){const{parserFunction:[,,u,g]}=this.getAttribute("config"),c=me(d).trim();if(d&&!c.endsWith(":"))return!1;const p=c.slice(0,-1).toLowerCase(),v=u.includes(p),m=g.includes(p);return f(this,s)&&v||!f(this,s)&&(m||!d)||(ve.running||this.length>1)&&(v||m||!d)?(this.setAttribute("modifier",d),L(this,s,v),!!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"&&(L(this,n,P(this,r,Zt).call(this)),this.setAttribute("name",f(this,n).title))}toString(d){return`{{${this.modifier}${this.type==="magic-word"?this.firstChild.toString(d)+(this.length===1?"":f(this,t))+this.childNodes.slice(1).map(u=>u.toString(d)).join("|"):super.toString(d,"|")}}}`}text(){const{childNodes:d,length:u,firstChild:g,modifier:c,type:p,name:v}=this;return p==="magic-word"&&v==="vardefine"?"":`{{${c}${p==="magic-word"?g.text()+(u===1?"":f(this,t))+Me(d.slice(1),"|"):super.text("|")}}}`}getAttribute(d){switch(d){case"padding":return this.modifier.length+2;case"title":return f(this,n);case"colon":return f(this,t);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!P(this,r,Zt).call(this).valid);default:return super.getAttribute(d)}}lint(d=this.getAbsoluteIndex(),u){const g=super.lint(d,u);if(!this.isTemplate())return g;const{type:c,childNodes:p,length:v}=this,m=new le(this,d),x=c==="magic-word";let b="no-ignored",w=_.lintConfig.getSeverity(b,"fragment");if(x&&!P(this,r,Zt).call(this).valid)b="invalid-invoke",w=_.lintConfig.getSeverity(b,"name"),w&&g.push(R(p[1],m,b,"illegal module name",w));else if(w){const y=p[x?1:0],A=y.childNodes.findIndex(S=>S.type==="text"&&jt(S.data).includes("#")),k=y.childNodes[A];if(k){const S=R(y,m,b,"useless fragment",w);S.fix={desc:"remove",range:[S.startIndex+y.getRelativeIndex(A)+k.data.indexOf("#"),S.endIndex],text:""},g.push(S)}}if(b="invalid-invoke",w=_.lintConfig.getSeverity(b,"function"),w&&x&&v===2)return g.push(V(this,m,b,"missing module function",w)),g;if(b="no-duplicate",w=_.lintConfig.getSeverity(b,"parameter"),w){const y=this.getDuplicatedArgs().filter(([,k])=>!k[0].querySelector("ext")),A="duplicated parameter";for(const[,k]of y)g.push(...k.map(S=>{const $=R(S,m,b,A,w);return $.suggestions=[{desc:"remove",range:[$.startIndex-1,$.endIndex],text:""}],$}))}return g}insertAt(d,u=this.length){return super.insertAt(d,u),d.anon?P(this,r,Rl).call(this,d):d.name&&this.getArgs(d.name,!1,!1).add(d),d}getAllArgs(){return this.childNodes.filter(ps("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:d})=>d)}getArgs(d,u,g=!0){const c=String(d).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");let p;return f(this,i).has(c)?p=f(this,i).get(c):(p=new Set(this.getAllArgs().filter(({name:v})=>c===v)),f(this,i).set(c,p)),p}getDuplicatedArgs(){return[...f(this,i)].filter(([,{size:d}])=>d>1).map(([d,u])=>[d,[...u]])}getPossibleValues(){const{type:d,name:u,childNodes:g}=this;if(d==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let c,p;switch(u){case"if":case"ifexist":case"ifexpr":case"iferror":c=2;break;case"ifeq":c=3;break;case"switch":{const v=g.slice(2),m=v[v.length-1];p=[...v.filter(({anon:x})=>!x),...m!=null&&m.anon?[m]:[]].map(({lastChild:x})=>x);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}p!=null||(p=g.slice(c,c+2).map(({lastChild:v})=>v));for(let v=0;v<p.length;){const{length:m,0:x}=p[v].childNodes.filter(b=>b.text().trim());if(m===0)p.splice(v,1);else if(m>1||x.type!=="magic-word")v++;else try{const b=x.getPossibleValues();p.splice(v,1,...b),v+=b.length}catch(b){v++}}return p}print(){const{childNodes:d,length:u,firstChild:g,modifier:c,type:p}=this;return`<span class="wpb-${p}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${p==="magic-word"?Et(c)+g.print()+(u===1?"":f(this,t))+nt(d.slice(1),{sep:"|"}):(c?`<span class="wpb-magic-word">${Et(c)}</span>`:"")+nt(d,{sep:"|"})}}}</span>`}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakSet,Zt=function(){const d=this.type==="template";return this.normalizeTitle(this.childNodes[d?0:1].text(),d?10:828,{temporary:!0})},Rl=function(d){const u=this.getAnonArgs(),g=typeof d!="number";for(let c=g?u.indexOf(d):d-1;c<u.length;c++){const p=u[c],{name:v}=p,m=String(c+1);(v!==m||p===d)&&(p.setAttribute("name",m),this.getArgs(m,!1,!1).add(p))}},a),Hs=ee(sr),Je=K(Hs,0,"TranscludeToken",tr,Je),X(Hs,1,Je)}}),ir,Ds,nr,At,$a=T({"src/hidden.ts"(){"use strict";ot(),O(),ir=[ze()],At=class extends(nr=j){get type(){return"hidden"}getAttribute(e){return e==="invalid"||super.getAttribute(e)}},Ds=ee(nr),At=K(Ds,0,"HiddenToken",ir,At),X(Ds,1,At)}}),rr,Gs,lr,kt,Ta=T({"src/arg.ts"(){"use strict";var e,Ca,s;oe(),M(),ae(),Le(),as(),B(),O(),Fe(),$a(),rr=[$e("{{{"),Ot()],kt=(s=class extends(lr=j){constructor(n,r,l=[]){super(void 0,r,l,{});N(this,e);for(let o=0;o<n.length;o++){const a=n[o];if(o===0){const h=new ge(a,"arg-name",r,l,{});super.insertAt(h)}else if(o>1){const h=new At(a,r,l);super.insertAt(h)}else{const h=new j(a,r,l);h.type="arg-default",h.setAttribute("stage",2),super.insertAt(h)}}}get type(){return"arg"}get default(){var n,r;return(r=(n=this.childNodes[1])==null?void 0:n.text())!=null?r:!1}toString(n){return`{{{${super.toString(n,"|")}}}}`}text(){return`{{{${Me(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){super.afterBuild()}lint(n=this.getAbsoluteIndex(),r){const{childNodes:[l,o,...a]}=this;l.setAttribute("aIndex",n+3);const h=l.lint(n+3,r);if(o){const g=n+4+l.toString().length;o.setAttribute("aIndex",g);const c=o.lint(g,r);c.length>0&&h.push(...c)}const d=["no-ignored","no-arg"],u=d.map(g=>_.lintConfig.getSeverity(g,"arg"));if(u[0]&&a.length>0){const g=new le(this,n);h.push(...a.map(c=>{const p=R(c,g,d[0],"invisible content inside triple braces",u[0]);return p.startIndex--,p.startCol--,p.suggestions=[{desc:"remove",range:[p.startIndex,p.endIndex],text:""},{desc:"escape",range:[p.startIndex,p.startIndex+1],text:"{{!}}"}],p}))}if(u[1]&&!this.getAttribute("include")){const g=V(this,{start:n},d[1],"unexpected template argument",u[1]);o&&(g.suggestions=[{desc:"expand",range:[n,g.endIndex],text:o.text()}]),h.push(g)}return h}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(n,r=this.getAbsoluteIndex()){const l=super.json(void 0,r);return l.default=this.default,l}},e=new WeakSet,Ca=function(){},s),Gs=ee(lr),kt=K(Gs,0,"ArgToken",rr,kt),X(Gs,1,kt)}}),Ol={};te(Ol,{parseBraces:()=>cs});var or,Vs,Ht,Qs,Js,Xs,ar,Ks,cs,Zi=T({"parser/braces.ts"(){"use strict";Rt(),oe(),El(),_a(),Ta(),or={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},Vs=String.raw`\[(?!\[)`,Ht=String.raw`\n(?![=\0])`,Qs=String.raw`|\{{2,}`,Js=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),Xs=et(e=>new RegExp(e,"gmu")),ar=new RegExp(String.raw`\{\{((?:[^\n{}[]|${Vs}|${Ht})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${Ht})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${Vs}|${Ht})*\}-`,"gu"),Ks=e=>{const t=it(me(e));return Js.has(t)?Js.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},cs=(e,t,s)=>{var p,v,m,x,b;const i=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,n]}=t,r=[],l=[],o=(w,y,A,k)=>{y[y.length-1].push(_e(w.slice(A,k),l))};let a;do a!==void 0&&(e=a),a=e.replace(ar,(w,y,A)=>{if(y!==void 0||typeof A=="string")try{const{length:k}=s,S=(y!=null?y:A).split("|");return new Je(_e(S[0],l),S.slice(1).map($=>{const C=$.indexOf("=");return(C===-1?[$]:[$.slice(0,C),$.slice(C+1)]).map(I=>_e(I,l))}),t,s),`\0${k}${Ks(S[0])}`}catch(k){if(!(k instanceof SyntaxError)||k.message!=="Invalid template name")throw k}return l.push(_e(w,l)),`\0${l.length-1}`});while(a!==e);e=a;const h=e.lastIndexOf("}}")-e.length;let d=h+e.length!==-1,u=Xs(i+(d?Qs:"")),g=u.exec(e),c;for(;g||c!==void 0&&c<=e.length&&((v=(p=r[r.length-1])==null?void 0:p[0])!=null&&v.startsWith("="));){if(g!=null&&g[1]){const[,{length:E}]=g;g[0]=g[0].slice(E),g.index+=E}const{0:w,index:y}=g!=null?g:{0:`
|
|
8
|
+
`,index:e.length},A=(m=r.pop())!=null?m:{},{0:k,index:S,parts:$,findEqual:C,pos:I}=A,U=w==="="&&C;if(w==="]]"||w==="}-")c=y+2;else if(w===`
|
|
9
|
+
`){c=y+1;const{pos:E,findEqual:Y}=(x=r[r.length-1])!=null?x:{};if(E===void 0||Y||me(e.slice(E,S))!==""){const W=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(e.slice(S,y));W&&(W[2]=_e(W[2],l),W[2].includes(`
|
|
10
|
+
`)||(e=`${e.slice(0,S)}\0${s.length}h${e.slice(y)}`,c=S+4+String(s.length).length,new Yi(W[1].length,W.slice(2),t,s)))}}else if(w==="|"||U)c=y+1,o(e,$,I,y),w==="|"&&$.push([]),A.pos=c,A.findEqual=w==="|",r.push(A);else if(w.startsWith("}}")){const E=w.slice(0,Math.min(k.length,3)),Y=k.length-E.length,{length:W}=s;c=y+E.length,o(e,$,I,y);let Q=!1,z="t";if(E.length===3){const ie=$.map(D=>D.join("=")),q=ie.length>1&&me(ie[1]).trim();new kt(ie,t,s),q&&q.endsWith(":")&&n.includes(q.slice(0,-1).toLowerCase())&&(z="s")}else try{new Je($[0][0],$.slice(1),t,s),z=Ks($[0][0])}catch(ie){if(ie instanceof SyntaxError&&ie.message==="Invalid template name")Q=!0;else throw ie}Q||(e=`${e.slice(0,S+Y)}\0${W}${z}${e.slice(c)}`,c=S+Y+3+String(W).length,Y>1?r.push({0:k.slice(0,Y),index:S,pos:S+Y,parts:[[]]}):Y===1&&e[S-1]==="-"&&r.push({0:"-{",index:S-1,pos:S+1,parts:[[]]}))}else c=y+w.length,w.startsWith("{")&&(g.pos=c,g.parts=[[]]),r.push(..."0"in A?[A]:[],g);let F=r[r.length-1];if(d&&h+e.length<c)for(d=!1;(b=F==null?void 0:F[0])!=null&&b.startsWith("{");)r.pop(),F=r[r.length-1];u=Xs(i+(d?Qs:"")+(F?`|${or[F[0][0]]}${F.findEqual?"|=":""}`:"")),u.lastIndex=c,g=u.exec(e)}return _e(e,l)}}}),Bl={};te(Bl,{InputboxToken:()=>ql});var ql,Ia=T({"src/paramTag/inputbox.ts"(){"use strict";gs(),Zi(),B(),jl(),ql=class extends Qe{constructor(e,t,s=_.getConfig(),i=[]){const n=Symbol("InputboxToken"),r=s.excludes.includes("heading")?s:ye(pe({},s),{excludes:[...s.excludes,"heading"]}),{length:l}=i;i.push(n),t&&(t=Bt(t,r,i,e)),t&&(t=cs(t,r,i)),i.splice(l,1),super(e,t,r,i,{})}}}}),es={};te(es,{NestedToken:()=>Wl});var dr,hr,Wl,Ys=T({"src/nested.ts"(){"use strict";var e,t,s;M(),ae(),gs(),Zi(),B(),O(),io(),Ee(),dr=new Set(["comment","include","arg","template","magic-word"]),hr=[!1,!0].map(i=>{const n=i?"includeonly":"noinclude";return new RegExp(String.raw`^(?:<${n}(?:\s[^>]*)?/?>|</${n}\s*>)$`,"iu")}),Wl=(s=class extends j{constructor(n,r,l,o,a=[]){if(typeof r=="boolean"){const h=Symbol("NestedToken"),{length:d}=a;a.push(h),n&&(n=Bt(n,o,a,r)),n&&(n=cs(n,o,a)),a.splice(d,1)}else n&&(n=n.replace(r,(h,d,u,g,c)=>{const p=`\0${a.length+1}e`;return new Ze(d,u,g,c,o,!1,a),p}));n&&(n=n.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(h,d,u)=>(new he(u,o,a),`${d}\0${a.length}n`)));super(n,o,a);N(this,e);N(this,t);L(this,e,[...l]),L(this,t,r)}get type(){return"ext-inner"}lint(n=this.getAbsoluteIndex(),r){const l=super.lint(n,r),o="no-ignored",a=_.lintConfig.getSeverity(o,this.name);if(!a)return l;const h=new le(this,n),d=typeof f(this,t)=="boolean"?hr[f(this,t)?1:0]:/^<!--[\s\S]*-->$/u;return[...l,...this.childNodes.filter(u=>{const{type:g,name:c}=u;if(g==="ext")return!f(this,e).includes(c);if(dr.has(g))return!1;const p=u.toString().trim();return p&&!d.test(p)}).map(u=>{const g=R(u,h,o,_.msg("invalid content in <$1>",this.name),a);return g.suggestions=[{desc:"remove",range:[g.startIndex,g.endIndex],text:""},{desc:"comment",range:[g.startIndex,g.endIndex],text:`<!--${u.toString()}-->`}],g})]}},e=new WeakMap,t=new WeakMap,s)}});function ur(e,t,s,i,n){t=me(t).trim();let r=t.replace(e==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(e){case"width":return!r&&!!t||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(r);case"link":{if(r){if(Ml(s.protocol).test(r))return Ul(s.protocol).test(r)&&t;r.startsWith("[[")&&r.endsWith("]]")&&(r=r.slice(2,-2))}else return t;const l=_.normalizeTitle(r,0,!1,s,{halfParsed:i,decode:!0,selfLink:!0});return l.valid&&l}case"lang":return(n==="svg"||n==="svgz")&&!/[^a-z\d-]/u.test(r);case"alt":case"class":case"manualthumb":return!0;case"page":return(n==="djvu"||n==="djv"||n==="pdf")&&Number(r)>0;default:return!!r&&!isNaN(r)}}var Ml,Ul,cr,gr,zl,Na=T({"src/imageParameter.ts"(){"use strict";var e,t,Hl,n;Rt(),oe(),M(),B(),O(),Ml=et(r=>new RegExp(String.raw`^(?:${r}|//|\0\d+m\x7F)`,"iu")),Ul=et(r=>new RegExp(String.raw`^(?:(?:${r}|//)${tt}|\0\d+m\x7F)${st}$`,"iu")),cr=et(r=>new RegExp(String.raw`^(\s*(?!\s))${r.replace("$1","(.*)")}${r.endsWith("$1")?`(?=$|
|
|
11
|
+
)`:""}(\s*)$`,"u")),gr=new Set(["alt","link","lang","page","caption"]),zl=(n=class extends j{constructor(l,o,a,h){var r=(...i)=>(super(...i),N(this,t),N(this,e,""),this);let d;const u=Object.entries(a.img).map(([c,p])=>[c,p,cr(c)]),g=u.find(([,c,p])=>(d=p.exec(l),d&&(d.length!==4||ur(c,d[2],a,!0,o)!==!1)));if(g&&d){d.length===3?(r(void 0,a,h),L(this,e,l)):(r(d[2],a,h,{}),L(this,e,d[1]+g[0]+d[3])),this.setAttribute("name",g[1]);return}r(l,a.excludes.includes("list")?a:ye(pe({},a),{excludes:[...a.excludes,"list"]}),h),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get type(){return"image-parameter"}get link(){return this.name==="link"?ur("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var l;(l=this.parentNode)!=null&&l.is("gallery-image")&&!gr.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(l){return f(this,e)?f(this,e).replace("$1",super.toString(l)):super.toString(l)}text(){return f(this,e)?f(this,e).replace("$1",super.text()).trim():super.text().trim()}isPlain(){return this.name==="caption"}getAttribute(l){return l==="invalid"?this.name==="invalid":l==="padding"?Math.max(0,f(this,e).indexOf("$1")):super.getAttribute(l)}lint(l=this.getAbsoluteIndex(),o){const a=super.lint(l,o),{link:h,name:d}=this;if(d==="invalid"){const u="invalid-gallery",g=_.lintConfig.getSeverity(u,"parameter");if(g){const c=V(this,{start:l},u,"invalid image parameter",g);c.fix={desc:"remove",range:[l-1,c.endIndex],text:""},a.push(c)}}else if(typeof h=="object"&&h.encoded){const u="url-encoding",g=_.lintConfig.getSeverity(u,"file");if(g){const c=V(this,{start:l},u,"unnecessary URL encoding in an internal link",g);c.suggestions=[{desc:"decode",range:[l,c.endIndex],text:Ft(this.text())}],a.push(c)}}return a}getValue(){return this.name==="invalid"?this.text():P(this,t,Hl).call(this)||super.text()}print(){return f(this,e)?`<span class="wpb-image-parameter${this.name==="invalid"?" wpb-invalid":""}">${f(this,e).replace("$1",`<span class="wpb-image-caption">${nt(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}},e=new WeakMap,t=new WeakSet,Hl=function(){return f(this,e)&&!f(this,e).includes("$1")},n)}}),Zs,pr,fr,ei,ti,xr,mr,si,en,Dl=T({"src/link/file.ts"(){"use strict";M(),ae(),B(),os(),Na(),Zs=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),pr=new Set(["arg"]),fr=new Set(["template","magic-word"]),ei=new Set(["left","right","center","none"]),ti=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),xr=new Set(["tiff","tif","png","gif","jpg","jpeg","webp","xcf","pdf","svg","djvu"]),mr=e=>{if(e===void 0)return[];const t=/-\{|\}-|\|/gu,s=[];let i=t.exec(e),n=0,r=0;for(;i;){const{0:l,index:o}=i;l!=="|"?n+=l==="-{"?1:-1:n===0&&(s.push(e.slice(r,o)),{lastIndex:r}=t),i=t.exec(e)}return s.push(e.slice(r)),s},si=(e,t)=>e.filter(({childNodes:s})=>{const i=s.filter(n=>n.text().trim());return i.length!==1||!t.has(i[0].type)}),en=class extends Ie{get type(){return"file"}get extension(){return this.getAttribute("title").extension}constructor(e,t,s,i=[],n="|"){super(e,void 0,s,i,n);const{extension:r}=this.getTitle(!0,!0);this.safeAppend(mr(t).map(l=>new zl(l,r,s,i)))}lint(e=this.getAbsoluteIndex(),t){var m;const s=super.lint(e,t),i=si(this.getAllArgs(),pr),n=[...new Set(i.map(({name:x})=>x))],r=n.filter(x=>Zs.has(x)),l=n.filter(x=>ei.has(x)),o=n.filter(x=>ti.has(x)),[a]=r,h=a==="framed"||a==="manualthumb",d=new le(this,e);let u="nested-link",g=_.lintConfig.getSeverity(u,"file");if(g&&this.closest("ext-link-text")&&((m=this.getValue("link"))==null?void 0:m.trim())!==""&&s.push(V(this,d,u,"internal link in an external link",g)),u="invalid-gallery",g=_.lintConfig.getSeverity(u,"parameter"),g&&h)for(const x of i.filter(({name:b})=>b==="width")){const b=R(x,d,u,"invalid image parameter",g);b.fix={desc:"remove",range:[b.startIndex-1,b.endIndex],text:""},s.push(b)}if(i.length===n.length&&r.length<2&&l.length<2&&o.length<2)return s;u="no-duplicate";const{extension:c}=this,p=["unknownImageParameter","imageParameter"].map(x=>_.lintConfig.getSeverity(u,x)),v=(x,b,w,y=!0)=>x.map(A=>{if(g=p[Number(typeof y=="function"?y(A):y)],!g)return!1;const k=R(A,d,u,_.msg(`${b} image $1 parameter`,w),g);return k.suggestions=[{desc:"remove",range:[k.startIndex-1,k.endIndex],text:""}],k}).filter(A=>A!==!1);for(const x of n){if(x==="invalid"||x==="width"&&h)continue;const b=x==="caption";let w=i.filter(({name:y})=>y===x);if(b&&(w=[...w.slice(0,-1).filter(y=>y.text()),...w.slice(-1)]),w.length>1){let y=!b||!c||xr.has(c);if(b&&y){const A=si(w,fr);y=A.length>1&&(k=>A.includes(k))}s.push(...v(w,"duplicated",x,y))}}return r.length>1&&s.push(...v(i.filter(({name:x})=>Zs.has(x)),"conflicting","frame")),l.length>1&&s.push(...v(i.filter(({name:x})=>ei.has(x)),"conflicting","horizontal-alignment")),o.length>1&&s.push(...v(i.filter(({name:x})=>ti.has(x)),"conflicting","vertical-alignment")),s}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),{extension:i}=this;return i&&(s.extension=i),s}}}}),vr,ii,br,Xe,Gl=T({"src/link/galleryImage.ts"(){"use strict";var e,Pi,s;M(),Ue(),Le(),B(),O(),Dl(),vr=[$e("")],Xe=(s=class extends(br=en){constructor(n,r,l,o,a=[]){let h;if(l!==void 0){const{length:d}=a;h=new j(l,o,a);for(let u=0;u<xe-1;u++)h.parseOnce();a.splice(d,1)}super(r,h==null?void 0:h.toString(),o,a);N(this,e);ke(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=`${n}-image`,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(n){const r=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),r?0:6,{halfParsed:!0,temporary:n,decode:!r})}lint(n=this.getAbsoluteIndex(),r){const l=super.lint(n,r),o="invalid-gallery",a=_.lintConfig.getSeverity(o,"image");if(a&&P(this,e,Pi).call(this)){const h=V(this,{start:n},o,"invalid gallery image",a);h.suggestions=[{desc:"prefix",range:[n,n],text:"File:"}],l.push(h)}return l}getAttribute(n){return n==="invalid"?P(this,e,Pi).call(this):super.getAttribute(n)}},e=new WeakSet,Pi=function(){const{ns:n}=this.getAttribute("title");return n!==6},s),ii=ee(br),Xe=K(ii,0,"GalleryImageToken",vr,Xe),X(ii,1,Xe)}}),Vl={};te(Vl,{GalleryToken:()=>_t});var wr,ni,yr,_t,La=T({"src/gallery.ts"(){"use strict";var e,Ql,Ri,i;Ki(),B(),O(),Gl(),Ee(),wr=[us],_t=(i=class extends(yr=j){constructor(r,l,o=[]){var a;super(void 0,l,o,{});N(this,e);for(const h of(a=r==null?void 0:r.split(`
|
|
12
|
+
`))!=null?a:[]){const d=/^([^|]+)(?:\|(.*))?/u.exec(h);if(!d){super.insertAt(h.trim()?new he(h,l,o):h);continue}const[,u,g]=d;P(this,e,Ql).call(this,u)?super.insertAt(new Xe("gallery",u,g,l,o)):super.insertAt(new he(h,l,o))}}get type(){return"ext-inner"}get widths(){return P(this,e,Ri).call(this,"widths")}get heights(){return P(this,e,Ri).call(this,"heights")}lint(r=this.getAbsoluteIndex(),l){const{top:o,left:a}=this.getRootNode().posFromIndex(r),h=[],d="no-ignored",u=["Image","NoImage","Comment"].map(g=>_.lintConfig.getSeverity(d,`gallery${g}`));for(let g=0;g<this.length;g++){const c=this.childNodes[g],p=c.toString(),{length:v}=p,m=p.trim(),{type:x}=c,b=o+g,w=g?0:a;if(c.setAttribute("aIndex",r),x==="noinclude"&&m&&!/^<!--.*-->$/u.test(m)){let[y]=u;if(m.startsWith("|")?[,y]=u:(m.startsWith("<!--")||m.endsWith("-->"))&&([,,y]=u),y){const A=r+v;h.push({rule:d,message:_.msg("invalid content in <$1>","gallery"),severity:y,startIndex:r,endIndex:A,startLine:b,endLine:b,startCol:w,endCol:w+v,suggestions:[{desc:"remove",range:[r,A],text:""},{desc:"comment",range:[r,A],text:`<!--${p}-->`}]})}}else if(x!=="noinclude"&&x!=="text"){const y=c.lint(r,l);y.length>0&&h.push(...y)}r+=v+1}return h}json(r,l=this.getAbsoluteIndex()){const o=super.json(void 0,l);return Object.assign(o,{widths:this.widths,heights:this.heights}),o}},e=new WeakSet,Ql=function(r){return this.normalizeTitle(r,6,{halfParsed:!0,temporary:!0,decode:!0}).valid},Ri=function(r){var a,h;const l=(a=this.parentNode)==null?void 0:a.getAttr(r),o=typeof l=="string"&&((h=/^(\d+)\s*(?:px)?$/u.exec(l))==null?void 0:h[1]);return o&&Number(o)||120},i),ni=ee(yr),_t=K(ni,0,"GalleryToken",wr,_t),X(ni,1,_t)}}),tn,Jl=T({"src/link/index.ts"(){"use strict";M(),B(),os(),tn=class extends Ie{get type(){return"link"}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),i="nested-link",n=_.lintConfig.getSeverity(i);return n&&this.closest("ext-link-text")&&s.push(V(this,{start:e},i,"internal link in an external link",n)),s}}}}),Sr,Ar,Pt,sn=T({"src/magicLink.ts"(){"use strict";var e,t,Oi,i;M(),oe(),ae(),B(),O(),Sr=String.raw`(?:[${Ne}\t]| |�*160;|&#[xX]0*[aA]0;)`,Ar=new RegExp(`${Sr}+`,"gu"),Pt=(i=class extends j{constructor(r,l="free-ext-link",o=_.getConfig(),a){super(r,o,a,{});N(this,t);N(this,e);L(this,e,l)}get type(){return f(this,e)}get innerText(){const r=new Map([["!","|"],["=","="]]);let l=Me(this.childNodes.map(o=>{const{type:a}=o,h=String(o.name);return a==="magic-word"&&r.has(h)?r.get(h):o}));return this.type==="magic-link"&&(l=l.replace(Ar," ")),l}get link(){const{innerText:r}=this;return this.type==="magic-link"?r.startsWith("ISBN")?`ISBN ${r.slice(5).replace(/[- ]/gu,"").replace(/x$/u,"X")}`:r:pl(r).replace(/\n/gu,"%0A")}lint(r=this.getAbsoluteIndex(),l){const o=super.lint(r,l),a=new le(this,r),{type:h,childNodes:d}=this;if(h==="magic-link"){const p="invalid-isbn",v=_.lintConfig.getSeverity(p);return v&&P(this,t,Oi).call(this)&&o.push(V(this,a,p,"invalid ISBN",v)),o}const u=h==="ext-link-url",g="unterminated-url",c=_.lintConfig.getSeverity(g,u?"pipe":"punctuation");if(c){const p=u?/\|/u:/[,;。:!?()]+/u,v=d.find(m=>m.type==="text"&&p.test(m.data));if(v){const{data:m}=v,x=R(v,a,g,_.msg("$1 in URL",u?'"|"':"full-width punctuation"),c),{index:b,0:w}=p.exec(m),y=x.startIndex+b;x.suggestions=u?[{desc:"whitespace",range:[y,y+1],text:" "}]:[{desc:"whitespace",range:[y,y],text:" "},{desc:"escape",range:[y,y+w.length],text:encodeURI(w)}],o.push(x)}}return o}getUrl(r){this.lspError("MagicLinkToken.getUrl")}getAttribute(r){return r==="invalid"?P(this,t,Oi).call(this):super.getAttribute(r)}},e=new WeakMap,t=new WeakSet,Oi=function(){if(this.type==="magic-link"){const{link:r}=this;if(r.startsWith("ISBN")){const l=[...r.slice(5)].map(o=>o==="X"?10:Number(o));return l.length===10?l.reduce((o,a,h)=>o+a*(10-h),0)%11!==0:l.length===13&&(l[12]===10||l.reduce((o,a,h)=>o+a*(h%2?3:1),0)%10!==0)}}return!1},i)}}),kr,ri,_r,Ke,Xl=T({"src/extLink.ts"(){"use strict";var e,t;Ue(),M(),Le(),B(),O(),sn(),kr=[$e("[")],Ke=(t=class extends(_r=j){constructor(i,n="",r="",l,o=[]){super(void 0,l,o,{});N(this,e);const a=i&&/^\0\d+f\x7F$/u.test(i)?o[Number(i.slice(1,-2))]:new Pt(i,"ext-link-url",l,o);if(this.insertAt(a),L(this,e,n),r){const h=new j(r,l,o,{});h.type="ext-link-text",h.setAttribute("stage",xe-1),this.insertAt(h)}}get type(){return"ext-link"}toString(i){return this.length===1?`[${super.toString(i)}${f(this,e)}]`:`[${super.toString(i,f(this,e))}]`}text(){return`[${super.text(" ")}]`}getGaps(){return f(this,e).length}lint(i=this.getAbsoluteIndex(),n){const r=super.lint(i,n),l="var-anchor",o=_.lintConfig.getSeverity(l,"extLink");return o&&this.length===1&&this.closest("heading-title")&&r.push(V(this,{start:i},l,"variable anchor in a section header",o)),r}print(){return super.print(this.length===1?{pre:"[",post:`${f(this,e)}]`}:{pre:"[",sep:f(this,e),post:"]"})}},e=new WeakMap,t),ri=ee(_r),Ke=K(ri,0,"ExtLinkToken",kr,Ke),X(ri,1,Ke)}}),Bi,Fa=T({"src/imagemapLink.ts"(){"use strict";O(),Ee(),Jl(),Xl(),Bi=class extends j{get type(){return"imagemap-link"}constructor(e,t,s,i,n=[]){super(void 0,i,n),this.append(e,t.length===2?new tn(...t,i,n):new Ke(...t,i,n),new he(s,i,n))}}}}),Kl={};te(Kl,{ImagemapToken:()=>$t});var $r,li,Tr,$t,ja=T({"src/imagemap.ts"(){"use strict";M(),Se(),ae(),Ki(),B(),O(),Ee(),Gl(),Fa(),$r=[us],$t=class extends(Tr=j){get type(){return"ext-inner"}get image(){return this.childNodes.find(ps("imagemap-image"))}constructor(e,t=_.getConfig(),s=[]){if(super(void 0,t,s,{}),!e)return;const i=e.split(`
|
|
13
|
+
`),n=new Set(t.protocol.split("|")),r=he;let l=!0,o=!1;for(const a of i){const h=a.trim();if(!(o||!h||h.startsWith("#"))){if(l){const d=a.indexOf("|"),u=d===-1?a:a.slice(0,d),{valid:g,ns:c}=this.normalizeTitle(u,0,{halfParsed:!0,temporary:!0});if(g&&c===6){const p=new Xe("imagemap",u,d===-1?void 0:a.slice(d+1),t,s);super.insertAt(p),l=!1;continue}else o=!0}else if(a.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(a);continue}else if(a.includes("[")){const d=a.indexOf("["),u=a.slice(d),g=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(u);if(g){if(this.normalizeTitle(g[1],0,{halfParsed:!0,temporary:!0,selfLink:!0}).valid){super.insertAt(new Bi(a.slice(0,d),g.slice(1),u.slice(u.indexOf("]]")+2),t,s));continue}}else if(u.startsWith("[//")||n.has(u.slice(1,u.indexOf(":")+1))||n.has(u.slice(1,u.indexOf("//")+2))){const c=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(u);if(c){super.insertAt(new Bi(a.slice(0,d),c.slice(1),u.slice(u.indexOf("]")+1),t,s));continue}}}}super.insertAt(new r(a,t,s))}}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),i=new le(this,e),{childNodes:n,image:r}=this,l="invalid-imagemap",o=_.lintConfig.getSeverity(l,r?"link":"image");return o&&(r?s.push(...n.filter(a=>{const h=a.toString().trim();return a.is("noinclude")&&h&&!h.startsWith("#")}).map(a=>{const h=R(a,i,l,"invalid link in <imagemap>",o);return h.suggestions=[{desc:"remove",range:[h.startIndex-1,h.endIndex],text:""},{desc:"comment",range:[h.startIndex,h.startIndex],text:"# "}],h})):s.push(V(this,i,l,"<imagemap> without an image",o))),s}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}},li=ee(Tr),$t=K(li,0,"ImagemapToken",$r,$t),X(li,1,$t)}}),Cr,oi,Ir,Ye,Yl=T({"src/nowiki/comment.ts"(){"use strict";M(),ot(),Le(),B(),De(),Cr=[ze(!1),$e("<!--")],Ye=class extends(Ir=je){constructor(t,s,i,n){super(t,i,n);ke(this,"closed");this.closed=s}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){if(this.closed)return[];const s="unclosed-comment",i=_.lintConfig.getSeverity(s);if(!i)return[];const n=V(this,{start:t},s,_.msg("unclosed $1","HTML comment"),i);return n.suggestions=[{desc:"close",range:[n.endIndex,n.endIndex],text:"-->"}],[n]}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}},oi=ee(Ir),Ye=K(oi,0,"CommentToken",Cr,Ye),X(oi,1,Ye)}}),Zl={};te(Zl,{CommentedToken:()=>eo});var eo,Ea=T({"src/commented.ts"(){"use strict";O(),Yl(),eo=class extends j{get type(){return"ext-inner"}constructor(e,t,s=[]){if(super(void 0,t,s,{AstText:":",CommentToken:":"}),e){let i=e.indexOf("<!--"),n=i!==-1&&e.indexOf("-->",i+4),r=0;for(;n!==!1&&n!==-1;)i>r&&this.insertAt(e.slice(r,i)),this.insertAt(new Ye(e.slice(i+4,n),!0,t,s)),r=n+3,i=e.indexOf("<!--",r),n=i!==-1&&e.indexOf("-->",i+4);r<e.length&&this.insertAt(e.slice(r))}}lint(e=this.getAbsoluteIndex()){return super.lint(e,new RegExp(String.raw`<\s*(?:\/\s*)?(${this.name})\b`,"giu"))}}}}),to={};te(to,{NowikiToken:()=>so});var Nr,Lr,so,Pa=T({"src/nowiki/index.ts"(){"use strict";var e,qi,s;Rt(),M(),B(),De(),Nr=et(i=>new RegExp(String.raw`<\s*(?:/\s*)${i==="nowiki"?"":"?"}(${i})\b`,"giu")),Lr=new Set(["img","languages","section","templatestyles"]),so=(s=class extends je{constructor(){super(...arguments);N(this,e)}get type(){return"ext-inner"}lint(n=this.getAbsoluteIndex()){const{name:r}=this,l="void-ext",o=_.lintConfig.getSeverity(l,r);if(o&&P(this,e,qi).call(this)){const a=V(this,{start:n},l,_.msg("nothing should be in <$1>",r),o);return a.fix={desc:"empty",range:[n,a.endIndex],text:""},[a]}return super.lint(n,Nr(r))}getAttribute(n){return n==="invalid"?P(this,e,qi).call(this):super.getAttribute(n)}},e=new WeakSet,qi=function(){const{name:n,firstChild:{data:r}}=this;return Lr.has(n)&&!!r},s)}}),Fr,ai,jr,Ze,io=T({"src/tagPair/ext.ts"(){"use strict";M(),ae(),B(),Ji(),O(),Qi(),Xi(),Fr=[ds()],Ze=class extends(jr=qe){get type(){return"ext"}constructor(e,t,s,i,n=_.getConfig(),r=!1,l=[]){const o=e.toLowerCase(),a=new hs(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",o,n,l),h=ye(pe({},n),{ext:n.ext.filter(u=>u!==o),excludes:[...n.excludes]});let d;switch(h.inExt=!0,o){case"tab":h.ext=h.ext.filter(u=>u!=="tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":o==="poem"&&h.excludes.push("heading"),d=new j(s,h,l);break;case"pre":{const{PreToken:u}=(Aa(),G(Nl));d=new u(s,h,l);break}case"dynamicpagelist":{const{ParamTagToken:u}=(jl(),G(Fl));d=new u(r,s,h,l);break}case"inputbox":{const{InputboxToken:u}=(Ia(),G(Bl));d=new u(r,s,h,l);break}case"references":{const{NestedToken:u}=(Ys(),G(es));h.excludes.push("heading"),d=new u(s,r,["ref"],h,l);break}case"choose":{const{NestedToken:u}=(Ys(),G(es));d=new u(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],h,l);break}case"combobox":{const{NestedToken:u}=(Ys(),G(es));d=new u(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],h,l);break}case"gallery":{const{GalleryToken:u}=(La(),G(Vl));d=new u(s,h,l);break}case"imagemap":{const{ImagemapToken:u}=(ja(),G(Kl));d=new u(s,h,l);break}case"hiero":{const{CommentedToken:u}=(Ea(),G(Zl));d=new u(s,h,l);break}default:{const{NowikiToken:u}=(Pa(),G(to));d=new u(s,h,l)}}d.setAttribute("name",o),d.type==="plain"&&(d.type="ext-inner"),super(e,a,d,i,n,l),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),i=new le(this,e);if(this.name!=="nowiki"){const l=this.inHtmlAttrs(),o="parsing-order",a=l&&_.lintConfig.getSeverity(o,l===2?"ext":"templateInTable");a&&s.push(V(this,i,o,"extension tag in HTML tag attributes",a))}const n="var-anchor",r=_.lintConfig.getSeverity(n,"ref");return r&&this.name==="ref"&&this.closest("heading-title")&&s.push(V(this,i,n,"variable anchor in a section header",r)),s}},ai=ee(jr),Ze=K(ai,0,"ExtToken",Fr,Ze),X(ai,1,Ze)}}),no={};te(no,{parseCommentAndExt:()=>Bt});var di,Er,Dt,Pr,hi,Bt,gs=T({"parser/commentAndExt.ts"(){"use strict";Rt(),oe(),va(),Ee(),ba(),wa(),io(),Yl(),di="<onlyinclude>",Er="</onlyinclude>",{length:Dt}=di,Pr=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",s=e?"noinclude":"includeonly";return cl(i=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${i.filter(n=>n!=="img").join("|")})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(${"\\1"}\s*)>)|<(${s})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${s}\s*)>|$))${i.includes("img")?String.raw`|<img(\s[^>]*?)?(/?)>`:""}`,"giu"))}),hi=e=>{const t=e.indexOf(di);return{i:t,j:e.indexOf(Er,t+Dt)}},Bt=(e,t,s,i)=>{if(i){let{i:o,j:a}=hi(e);if(o!==-1&&a!==-1){let h="";const d=u=>{new he(u,t,s),h+=`\0${s.length-1}n`};for(;o!==-1&&a!==-1;){const u=`\0${s.length}e`;new yt(e.slice(o+Dt,a),t,s),o>0&&d(e.slice(0,o)),h+=u,e=e.slice(a+Dt+1),{i:o,j:a}=hi(e)}return e&&d(e),h}}const{ext:n}=t,r=n.filter(o=>o!=="translate"&&o!=="tvar"),l=ye(pe({},t),{ext:r});if(n.includes("translate")){const o=[];e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,a=>(o.push(a),`\0${o.length-1}`)).replace(/<translate( nowrap)?>([\s\S]+?)?<\/translate>/gu,(a,h,d)=>{const u=s.length;return new kl(h,d&&_e(d,o),l,s),`\0${u}g`}),e=_e(e,o)}return e.replace(Pr[i?1:0](r),(o,a,h,d,u,g,c,p,v,m,x)=>{const b=s.length;let w="n";if(a||r.includes("img")&&x!==void 0)w="e",new Ze(a!=null?a:"img",a?h:m,d,a?u:x&&void 0,l,g,s);else if(o.startsWith("<!--")){w="c";const y=o.endsWith("-->");new Ye(o.slice(4,y?-3:void 0),y,t,s)}else g?new St(g,c,p,v,t,s):new he(o,t,s);return`\0${b}${w}`})}}}),Rr,Or,Br,qr,ui,Wr,Tt,Ra=T({"src/html.ts"(){"use strict";var e,t,s,i,n;M(),Se(),ae(),Ji(),B(),O(),Rr=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),Or=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"]),Br=new Set(["strike","big","center","font","tt"]),qr=[ds()],Tt=(n=class extends(Wr=j){constructor(l,o,a,h,d,u){super(void 0,d,u);N(this,e);N(this,t);N(this,s);N(this,i);this.insertAt(o),this.setAttribute("name",l.toLowerCase()),L(this,e,a),L(this,t,h),L(this,s,l)}get type(){return"html"}get selfClosing(){return f(this,t)}get closing(){return f(this,e)}toString(l){return`<${this.closing?"/":""}${f(this,s)}${super.toString(l)}${f(this,t)?"/":""}>`}text(){const{closing:l}=this,o=f(this,s)+(l?"":super.text());return`<${l?"/":""}${o}${f(this,t)?"/":""}>`}getAttribute(l){return l==="invalid"?this.inTableAttrs()===2:l==="padding"?f(this,s).length+(this.closing?2:1):super.getAttribute(l)}lint(l=this.getAbsoluteIndex(),o){const a=super.lint(l,o),{name:h,parentNode:d,closing:u,selfClosing:g}=this,c=new le(this,l),p=this.inTableAttrs();let v="h1",m=_.lintConfig.getSeverity(v,"html");if(m&&h==="h1"&&!u){const k=V(this,c,v,"<h1>",m);k.suggestions=[{desc:"h2",range:[l+2,l+3],text:"2"}],a.push(k)}if(v="parsing-order",m=p&&_.lintConfig.getSeverity(v,p===2?"html":"templateInTable"),m){const k=V(this,c,v,"HTML tag in table attributes",m);p===2&&(k.fix={desc:"remove",range:[l,k.endIndex],text:""}),a.push(k)}v="obsolete-tag",m=_.lintConfig.getSeverity(v,h),m&&Br.has(h)&&a.push(V(this,c,v,"obsolete HTML tag",m)),v="bold-header",m=_.lintConfig.getSeverity(v,h),m&&(h==="b"||h==="strong")&&this.closest("heading-title")&&a.push(V(this,c,v,"bold in section header",m));const{html:[,x,b]}=this.getAttribute("config"),w=b.includes(h),y=x.includes(h),A=!w&&!y;if(v="unmatched-tag",u&&(g||w)||g&&A){if(m=_.lintConfig.getSeverity(v,u?"both":"selfClosing"),m){const k=V(this,c,v,u?"tag that is both closing and self-closing":"invalid self-closing tag",m),S={desc:"open",range:[l+1,l+2],text:""},$={desc:"no self-closing",range:[k.endIndex-2,k.endIndex-1],text:""};y?k.suggestions=[S,$]:u?k.fix=w?S:$:k.suggestions=[$,{desc:"close",range:[k.endIndex-2,k.endIndex],text:`></${h}>`}],a.push(k)}}else if(!this.findMatchingTag()){const k=V(this,c,v,u?"unmatched closing tag":"unclosed tag"),S=this.closest("magic-word");if(S&&Rr.has(S.name))m=_.lintConfig.getSeverity(v,"conditional");else if(u)m=_.lintConfig.getSeverity(v,"closing"),k.suggestions=[{desc:"remove",range:[l,k.endIndex],text:""}];else{m=_.lintConfig.getSeverity(v,"opening");const $=d==null?void 0:d.childNodes;Or.has(h)&&($!=null&&$.slice(0,$.indexOf(this)).some(({type:C,name:I})=>C==="html"&&I===h)&&(k.suggestions=[{desc:"close",range:[l+1,l+1],text:"/"}]),this.closest("heading-title")&&(k.rule="format-leakage",m=_.lintConfig.getSeverity("format-leakage",h)))}m&&(k.severity=m,a.push(k))}return a}findMatchingTag(){return We(f(this,i),()=>{const{name:l,parentNode:o,closing:a,selfClosing:h}=this,{html:[,d,u]}=this.getAttribute("config"),g=u.includes(l),c=d.includes(l);if(g||c&&h)return this;if(!o)return;const{childNodes:p}=o,v=p.indexOf(this),m=a?p.slice(0,v).reverse():p.slice(v+1),x=[this],{rev:b}=ve;for(const w of m)if(!(!w.is("html")||w.name!==l||c&&f(w,t)))if(f(w,e)===a)x.push(w);else{const y=x.pop();if(y===this)return w;_.viewOnly&&(L(y,i,[b,w]),L(w,i,[b,y]))}if(_.viewOnly)for(const w of x)L(w,i,[b,void 0])},l=>{L(this,i,l),l[1]&&l[1]!==this&&L(l[1],i,[ve.rev,this])})}print(){return super.print({pre:`<${this.closing?"/":""}${f(this,s)}`,post:`${f(this,t)?"/":""}>`})}json(l,o=this.getAbsoluteIndex()){const a=super.json(void 0,o);return Object.assign(a,{closing:this.closing,selfClosing:f(this,t)}),a}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n),ui=ee(Wr),Tt=K(ui,0,"HtmlToken",qr,Tt),X(ui,1,Tt)}}),ro={};te(ro,{parseHtml:()=>lo});var Mr,lo,Oa=T({"parser/html.ts"(){"use strict";Xi(),Ra(),Mr=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,lo=(e,t,s)=>{var l;const{html:i}=t;(l=t.htmlElements)!=null||(t.htmlElements=new Set([...i[0],...i[1],...i[2]]));const n=e.split("<");let r=n.shift();for(const o of n){const a=Mr.exec(o),h=a==null?void 0:a[2],d=h==null?void 0:h.toLowerCase();if(!a||!t.htmlElements.has(d)){r+=`<${o}`;continue}const[,u,,g="",c,p]=a,{length:v}=s,m=new hs(g,"html-attrs",d,t,s),x=m.hasAttr("itemprop");if(d==="meta"&&!(x&&m.hasAttr("content"))||d==="link"&&!(x&&m.hasAttr("href"))){r+=`<${o}`,s.length=v;continue}r+=`\0${s.length}x${p}`,new Tt(h,m,u==="/",c==="/>",t,s)}return r}}}),nn,oo=T({"src/table/base.ts"(){"use strict";Ji(),O(),at(),Xi(),nn=class extends ds(1)(j){constructor(e,t,s,i,n,r=[],l){super(void 0,n,r,l),this.append(new He(t,"table-syntax",n,r),new hs(i,"table-attrs",s,n,r))}}}}),Ur,ci,we,Gt,ft,xt,is,ao=T({"src/table/td.ts"(){"use strict";M(),ae(),Vi(),B(),O(),oo(),is=class extends(ci=nn,Ur=[ls(!1)],ci){constructor(e,t,s,i=[]){var o;let n=/\||\0\d+!\x7F/u.exec(t!=null?t:""),r=n?t.slice(0,n.index):"";/\[\[|-\{/u.test(r)&&(n=null,r=""),super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",r,s,i),X(Gt,5,this),Ce(this,ft),Ce(this,we,""),n&&([da(this,we)._]=n);const l=new j(t==null?void 0:t.slice(((o=n==null?void 0:n.index)!=null?o:NaN)+de(this,we).length),s,i);l.type="td-inner",l.setAttribute("stage",4),this.insertAt(l)}get type(){return"td"}get rowspan(){return this.getAttr("rowspan")}get colspan(){return this.getAttr("colspan")}get subtype(){return Ti(this,ft,xt).call(this).subtype}afterBuild(){de(this,we).includes("\0")&&fe(this,we,this.buildFromStr(de(this,we),0)),super.afterBuild()}toString(e){const{childNodes:[t,s,i]}=this;return t.toString(e)+s.toString(e)+de(this,we)+i.toString(e)}text(){const{childNodes:[e,t,s]}=this;return e.text()+t.text()+de(this,we)+s.text()}getGaps(e){return e===1?de(this,we).length:0}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),i=new le(this,e+this.getRelativeIndex(this.length-1)),n="pipe-like",r=["td","double"].map(l=>_.lintConfig.getSeverity(n,l));for(const l of this.lastChild.childNodes)if(l.type==="text"){const{data:o}=l;if(o.includes("|")){const a=o.includes("||"),h=r[a?1:0];if(h){const d=R(l,i,n,'additional "|" in a table cell',h);if(a){const u={caption:"|+",td:"|",th:"!"}[this.subtype];d.fix={desc:"newline",range:[d.startIndex,d.endIndex],text:o.replace(/\|\|/gu,`
|
|
14
14
|
${u}`)}}else d.suggestions=[{desc:"escape",range:[d.startIndex,d.endIndex],text:o.replace(/\|/gu,"|")}];s.push(d)}}}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}print(){const{childNodes:[e,t,s]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${de(this,
|
|
16
|
-
|}`,t){const s=this.getAttribute("config"),
|
|
15
|
+
`)}getAttr(e){const t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}print(){const{childNodes:[e,t,s]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${de(this,we)}${s.print()}</span>`}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t),{rowspan:i,colspan:n}=this;return Object.assign(s,{subtype:this.subtype},i!==1&&{rowspan:i},n!==1&&{colspan:n}),s}},Gt=ee(ci),we=new WeakMap,ft=new WeakSet,xt=function(){var e;const t=this.firstChild.text(),s=t.slice(-1);let i="td";if(s==="!"?i="th":s==="+"&&(i="caption"),this.isIndependent())return{subtype:i};const{previousSibling:n}=this;return pe({},Ti(e=n,ft,xt).call(e))},xt=K(Gt,17,"#getSyntax",Ur,ft,xt),zi(Gt,is)}}),rn,ho=T({"src/table/trBase.ts"(){"use strict";M(),B(),oo(),ao(),rn=class extends nn{lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),i=this.childNodes.find(({type:o})=>o==="table-inter");if(!i)return s;const n=Lt(i),r="fostered-content",l=n&&_.lintConfig.getSeverity(r,n===2?void 0:"transclusion");if(l){const o=R(i,{start:e},r,"content to be moved outside the table",l);o.startIndex++,o.startLine++,o.startCol=0,s.push(o)}return s}getRowCount(){return Number(this.childNodes.some(e=>e instanceof is&&e.isIndependent()&&!e.firstChild.text().endsWith("+")))}}}}),zr,Hr,Dr,Gr,gi,Vt,ts,Ba=T({"src/table/index.ts"(){"use strict";M(),Se(),ae(),Vi(),B(),ho(),at(),zr=(e,t)=>new Array(e).fill(void 0).map((s,i)=>t(i)),Hr=({type:e})=>e==="tr"||e==="table-syntax",Dr=class extends Array{},ts=class extends(gi=rn,Gr=[ls(!1)],gi){constructor(e,t,s,i){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,"table",t,s,i,{}),X(Vt,5,this)}get type(){return"table"}get closed(){return this.lastChild.is("table-syntax")}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),i=new le(this,e),n=["unclosed-table","table-layout"],r=n.map(l=>_.lintConfig.getSeverity(l));if(r[0]&&!this.closed&&s.push(R(this.firstChild,i,n[0],_.msg("unclosed $1","table"),r[0])),r[1]){const l=this.getLayout(),{length:o}=l;if(o>1){let a=1,h=1/0,d=0;for(;d<o;d++){const u=l[d],g=u.length;if(g<a)break;g<h&&(h=g);const c=u.indexOf(u[g-1])+1;if(c>h)break;c>a&&(a=c)}if(d<o){const u=this.getNthRow(d),g=R(u,i,n[1],"inconsistent table layout",r[1]);g.startIndex++,g.startLine++,g.startCol=0,s.push(g)}}}return s}close(e=`
|
|
16
|
+
|}`,t){const s=this.getAttribute("config"),i=this.getAttribute("accum"),n=[e];ve.run(()=>{const r=new He(void 0,"table-syntax",s,i);super.insertAt(r)}),this.lastChild.safeReplaceChildren(n)}getLayout(e){const t=this.getAllRows(),{length:s}=t,i=Dr.from(zr(s,()=>[]));for(let n=0;n<i.length;n++){const r=i[n];let l=0,o=0,a;for(const h of t[n].childNodes.slice(2))if(h.is("td")){if(h.isIndependent()&&(a=h.subtype!=="caption"),a){const d={row:n,column:l},{rowspan:u,colspan:g}=h;for(l++;r[o];)o++;for(let c=n;c<Math.min(n+u,s);c++)for(let p=o;p<o+g;p++)i[c][p]=d;o+=g}}else if(Hr(h))break}return i}getAllRows(){return[...super.getRowCount()?[this]:[],...this.childNodes.slice(1).filter(e=>e.is("tr")&&e.getRowCount()>0)]}getNthRow(e,t,s){const i=super.getRowCount();if(e===0&&i)return this;i&&e--;for(const n of this.childNodes.slice(2)){const{type:r}=n;if(r==="tr"&&n.getRowCount()&&(e--,e<0))return n}}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t);return s.closed=this.closed,s}},Vt=ee(gi),K(Vt,1,"getLayout",Gr,ts),zi(Vt,ts)}}),uo,qa=T({"src/table/tr.ts"(){"use strict";ho(),uo=class extends rn{get type(){return"tr"}constructor(e,t,s,i){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,e,"tr",t,s,i)}}}}),ln,co=T({"src/nowiki/listBase.ts"(){"use strict";De(),ln=class extends je{get indent(){return this.innerText.split(":").length-1}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t),{indent:i}=this;return i&&(s.indent=i),s}}}}),on,go=T({"src/nowiki/dd.ts"(){"use strict";co(),on=class extends ln{get type(){return"dd"}}}}),po={};te(po,{parseTable:()=>fo});var Vr,pi,fo,Wa=T({"parser/table.ts"(){"use strict";O(),Ba(),qa(),ao(),go(),Vr=e=>e.lastChild.constructor!==j,pi=(e,t)=>e.is("td")?t.pop():e,fo=({firstChild:{data:e},type:t,name:s},i,n)=>{const r=[],l=e.split(`
|
|
17
17
|
`);let o=t==="root"||t==="parameter-value"||t==="ext-inner"&&s==="poem"?"":`
|
|
18
|
-
${
|
|
19
|
-
${u}${w&&`\0${
|
|
18
|
+
${l.shift()}`,a;const h=(d,u)=>{if(!u){o+=d;return}const{lastChild:g}=u;if(Vr(u)){const c=new j(d,i,n);c.type="table-inter",c.setAttribute("stage",3),u.insertAt(c)}else g.setText(g.toString()+d)};for(const d of l){a=r.pop();const[u]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(d),g=d.slice(u.length),c=/^(:*)((?:\s|\0\d+[cn]\x7F)*)(\{\||\{(?:\0\d+[cn]\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(g);if(c){for(;a&&!a.is("td");)a=r.pop();const[,w,y,A,k]=c;w&&new on(w,i,n),h(`
|
|
19
|
+
${u}${w&&`\0${n.length-1}d`}${y}\0${n.length}b`,a),r.push(...a?[a]:[],new ts(A,k,i,n));continue}else if(!a){o+=`
|
|
20
20
|
${d}`;continue}const p=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(g);if(!p){h(`
|
|
21
|
-
${d}`,a),
|
|
22
|
-
${u}${v}`,!0),h(b,
|
|
23
|
-
${u}${m}`,b,n
|
|
24
|
-
${u}${x}`;const S=$=>{const C=new ls(k,b.slice(A,y==null?void 0:y.index),n,l);return $.insertAt(C),C};for(;y;)S(a),{lastIndex:A}=w,[k]=y,y=w.exec(b);i.push(a,S(a))}}return o.slice(1)}}}),go,Oa=T({"src/nowiki/hr.ts"(){"use strict";He(),go=class extends je{get type(){return"hr"}}}}),Vr,bi,Qr,$t,Ba=T({"src/nowiki/doubleUnderscore.ts"(){"use strict";lt(),Le(),He(),Vr=[Ue(),Te("__")],$t=class extends(Qr=je){get type(){return"double-underscore"}constructor(e,t,s,n){var o,a;super(e,s,n);const l=e.toLowerCase(),{doubleUnderscore:[,,i,r]}=s;this.setAttribute("name",(a=t?(o=r==null?void 0:r[e])==null?void 0:o.toLowerCase():i==null?void 0:i[l])!=null?a:l)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}},bi=Z(Qr),$t=te(bi,0,"DoubleUnderscoreToken",Vr,$t),ee(bi,1,$t)}}),po={};Y(po,{parseHrAndDoubleUnderscore:()=>fo});var fo,qa=T({"parser/hrAndDoubleUnderscore.ts"(){"use strict";Oa(),Ba(),Ll(),fo=({firstChild:{data:e},type:t,name:s},n,l)=>{var a,h,d;const{doubleUnderscore:[i,r,o]}=n;return(a=n.insensitiveDoubleUnderscore)!=null||(n.insensitiveDoubleUnderscore=new Set(i)),(h=n.sensitiveDoubleUnderscore)!=null||(n.sensitiveDoubleUnderscore=new Set(r)),(d=n.regexHrAndDoubleUnderscore)!=null||(n.regexHrAndDoubleUnderscore=new RegExp(`__(${[...i,...r].join("|")})__`,"giu")),t!=="root"&&(t!=="ext-inner"||s!=="poem")&&(e=`\0${e}`),e=e.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(u,g,c)=>(new go(c,n,l),`${g}\0${l.length-1}r`)).replace(n.regexHrAndDoubleUnderscore,(u,g)=>{var m;const c=n.sensitiveDoubleUnderscore.has(g),p=g.toLowerCase(),v=n.insensitiveDoubleUnderscore.has(p);return c||v?(new $t(g,c,n,l),`\0${l.length-1}${v&&((m=o==null?void 0:o[p])!=null?m:p)==="toc"?"u":"n"}`):u}).replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(u,g,c,p,v)=>{const m=`${g}\0${l.length}h`;return new en(c.length,[p,v],n,l),m}),t==="root"||t==="ext-inner"&&s==="poem"?e:e.slice(1)}}}),xo,Wa=T({"src/nowiki/quote.ts"(){"use strict";var e,t;M(),ae(),B(),He(),xo=(t=class extends je{constructor(n,l,i,r){super(n,i,r);N(this,e);L(this,e,l)}get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}get closing(){return fe(fe({},this.bold?{bold:f(this,e).bold}:void 0),this.italic?{italic:f(this,e).italic}:void 0)}text(){const{parentNode:n,innerText:l}=this;return n!=null&&n.is("image-parameter")&&n.name!=="caption"?"":l}lint(n=this.getAbsoluteIndex()){const{previousSibling:l,bold:i,closing:r}=this,o=(l==null?void 0:l.type)==="text"?l.data:void 0,a=[],h=new le(this,n),d=["lonely-apos","bold-header"],u=[void 0,"word"].map(c=>_.lintConfig.getSeverity(d[0],c)),g=_.lintConfig.getSeverity(d[1]);if(o!=null&&o.endsWith("'")){const c=u[(r.bold||r.italic)&&/[a-z\d]'$/iu.test(o)?1:0];if(c){const p=V(this,h,d[0],_.msg('lonely "$1"',"'"),c),{startIndex:v,startLine:m,startCol:x}=p,[,{length:b}]=/(?:^|[^'])('+)$/u.exec(o),w=n-b;a.push(Se(fe({},p),{startIndex:w,endIndex:v,endLine:m,startCol:x-b,endCol:x,suggestions:[{desc:"escape",range:[w,v],text:"'".repeat(b)},{desc:"remove",range:[w,v],text:""}]}))}}if(g&&i&&this.closest("heading-title")){const c=V(this,h,d[1],"bold in section header",g);c.suggestions=[{desc:"remove",range:[n,n+3],text:""}],a.push(c)}return a}json(n,l=this.getAbsoluteIndex()){const i=super.json(void 0,l);return Object.assign(i,{bold:this.bold,italic:this.italic}),i}},e=new WeakMap,t)}}),mo={};Y(mo,{parseQuotes:()=>hn});var hn,vo=T({"parser/quotes.ts"(){"use strict";Wa(),hn=(e,t,s,n)=>{var c;const l=e.split(/('{2,})/u),{length:i}=l;if(i===1)return e;let r=0,o=0,a,h,d;for(let p=1;p<i;p+=2){const v=l[p].length;switch(v){case 2:o++;break;case 4:l[p-1]+="'",l[p]="'''";case 3:if(r++,a!==void 0)break;l[p-1].endsWith(" ")?h===void 0&&d===void 0&&(d=p):l[p-1].slice(-2,-1)===" "?a=p:h!=null||(h=p);break;default:l[p-1]+="'".repeat(v-5),l[p]="'''''",o++,r++}}if(o%2===1&&r%2===1){const p=(c=a!=null?a:h)!=null?c:d;p!==void 0&&(l[p]="''",l[p-1]+="'")}let u=!0,g=!0;for(let p=1;p<i;p+=2){const v=l[p].length,m=v!==2,x=v!==3;m&&(u=!u),x&&(g=!g),new xo(l[p],{bold:m&&u,italic:x&&g},t,s),l[p]=`\0${s.length-1}q`}return l.join("")}}}),bo={};Y(bo,{parseExternalLinks:()=>un});var un,wo=T({"parser/externalLinks.ts"(){"use strict";oe(),Vl(),rn(),un=(e,t,s,n)=>{var l;return(l=t.regexExternalLinks)!=null||(t.regexExternalLinks=new RegExp(String.raw`\[(\0\d+f\x7F|(?:(?:${t.protocol}|//)${et}|\0\d+m\x7F)${tt}(?=[[\]<>"\t${Ne}]|\0\d))([${Ne}]*(?![${Ne}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),e.replace(t.regexExternalLinks,(i,r,o,a)=>{const{length:h}=s,d=/&[lg]t;/u.exec(r);return d&&(o="",a=r.slice(d.index)+o+a,r=r.slice(0,d.index)),n?(new Pt(r,"ext-link-url",t,s),`[\0${h}f${o}${a}]`):(new Xe(r,o,a,t,s),`\0${h}w`)})}}}),yo,Ma=T({"src/link/category.ts"(){"use strict";oe(),us(),yo=class extends Ie{get type(){return"category"}get sortkey(){const{childNodes:[,e]}=this;return e&&jt(e.text())}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t),{sortkey:n}=this;return n&&(s.sortkey=n),s}}}}),So={};Y(So,{parseLinks:()=>Hi});var Jr,Hi,Ua=T({"parser/links.ts"(){"use strict";B(),vo(),wo(),Gl(),Ul(),Ma(),Jr=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,Hi=(e,t,s,n)=>{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,i=e.split("[[");let r=i.shift();for(let a=0;a<i.length;a++){let h=!1,d,u,g,c;const p=i[a],v=l.exec(p);if(v)[,d,u,g,c]=v,c.startsWith("]")&&(g!=null&&g.includes("["))&&(g+="]",c=c.slice(1));else{const y=Jr.exec(p);y&&(h=!0,[,d,u,g]=y)}if(d===void 0||t.regexLinks.test(d)||/\0\d+[exhbru]\x7F/u.test(d)){r+=`[[${p}`;continue}const m=d.trim().startsWith(":");if(m&&h){r+=`[[${p}`;continue}const{ns:x,valid:b}=_.normalizeTitle(d,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0});if(b){if(h){if(x!==6){r+=`[[${p}`;continue}let y=!1;for(a++;a<i.length;a++){const A=i[a],k=A.split("]]");if(k.length>2){y=!0,g+=`[[${k[0]}]]${k[1]}`,c=k.slice(2).join("]]");break}else if(k.length===2)g+=`[[${k[0]}]]${k[1]}`;else{g+=`[[${A}`;break}}if(g=Hi(g,t,s,n),!y){r+=`[[${d}${u}${g}`;continue}}}else{r+=`[[${p}`;continue}g&&(g=hn(g,t,s,n));let w=nn;m||(x===6?(g&&(g=un(g,t,s,!0)),w=sn):x===14&&(w=yo)),g===void 0&&u&&(g=""),r+=`\0${s.length}l${c}`,new w(d,g,t,s,u)}return r}}}),Ao={};Y(Ao,{parseMagicLinks:()=>ko});var wi,yi,Si,Ai,ko,za=T({"parser/magicLinks.ts"(){"use strict";oe(),rn(),wi=String.raw`[${Ne}\t]| |�*160;|�*a0;`,yi=`(?:${wi})+`,Si=`(?:${wi}|-)`,Ai=String.raw`(?:RFC|PMID)${yi}\d+\b|ISBN${yi}(?:97[89]${Si}?)?(?:\d${Si}?){9}[\dx]\b`,ko=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${et}${tt})|${Ai})`,"giu")}catch(n){t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${et}${tt})|${Ai})`,"giu")}return e.replace(t.regexMagicLinks,(n,l,i)=>{let r=l?n.slice(l.length):n;if(i){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 h=r.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,d=h.exec(r);if(d){let u=1;d[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(r.slice(0,d.index))&&(u=2),o=r.slice(d.index+u)+o,r=r.slice(0,d.index+u)}return o.length>=i.length?n:(new Pt(r,void 0,t,s),`${l}\0${s.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(r))return n;return new Pt(r,"magic-link",t,s),`${l}\0${s.length-1}i`})}}}),_o,Ha=T({"util/html.ts"(){"use strict";_o=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,n)=>s!==e[n])}}),$o,Da=T({"src/nowiki/list.ts"(){"use strict";ao(),$o=class extends an{get type(){return"list"}}}}),To={};Y(To,{parseList:()=>Co});var Co,Ga=T({"parser/list.ts"(){"use strict";Ha(),Da(),ho(),Co=(e,t,s,n)=>{const l=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!l)return t.lastPrefix="",e;const[i,r,o,a]=l,h=o.replace(/;/gu,":"),d=_o(h,t.lastPrefix),u=((d>1?o.slice(d-1):o)+a).split(/(?=;)/u),g=u[0].startsWith(";");let c=u.length-(g?0:1);if(d>1){const I=o.slice(0,d-1);if(g){const U=I.split(/(?=;)/u);u.unshift(...U),c+=I.includes(";")?U.length:0}else u[0]=I+u[0]}t.lastPrefix=h;let p=r+u.map((I,U)=>`\0${n.length+U}d`).join("")+e.slice(i.length);for(const I of u)new $o(I,s,n);if(!c)return p;const{html:[v,,m]}=s,x=/:+|-\{|\0\d+[xq]\x7F/gu;let b=x,w=b.exec(p),y=0,A=!1,k=!1,S=0;const $=(I,U)=>(new dn(I,s,n),`${p.slice(0,U)}\0${n.length-1}d${p.slice(U+I.length)}`),C=I=>{I?y&&y--:y++};for(;w&&c;){const{0:I,index:U}=w;if(I==="-{"){if(!S){const{lastIndex:F}=b;b=/-\{|\}-/gu,b.lastIndex=F}S++}else if(I==="}-"){if(S--,!S){const{lastIndex:F}=b;b=x,b.lastIndex=F}}else if(I.endsWith("x")){const{name:F,closing:P,selfClosing:X}=n[Number(I.slice(1,-2))];(v.includes(F)||!X&&!m.includes(F))&&C(P)}else if(I.endsWith("q")){const{bold:F,italic:P}=n[Number(I.slice(1,-2))];F&&(C(A),A=!A),P&&(C(k),k=!k)}else if(y===0){if(I.length>=c)return $(I.slice(0,c),U);c-=I.length,b.lastIndex=U+4+String(n.length).length,p=$(I,U)}w=b.exec(p)}return p}}}),Xt,Xr,ki,Kr,Tt,Va=T({"src/converterFlags.ts"(){"use strict";var e,t;M(),ae(),cs(),B(),O(),Fe(),Xt=new Set(["A","T","R","D","-","H","N"]),Xr=[Ot()],Tt=(t=class extends(Kr=E){constructor(n,l,i=[]){super(void 0,l,i,{});N(this,e);this.safeAppend(n.map(r=>new ge(r,"converter-flag",l,i)))}get type(){return"converter-flags"}afterBuild(){L(this,e,this.childNodes.map(n=>n.text().trim())),super.afterBuild()}toString(n){return super.toString(n,";")}text(){return super.text(";")}getUnknownFlags(){return new Set(f(this,e).filter(n=>/\{{3}[^{}]+\}{3}/u.test(n)))}getVariantFlags(){const n=new Set(this.getAttribute("config").variants);return new Set(f(this,e).filter(l=>n.has(l)))}isInvalidFlag(n,l,i,r){return typeof n=="object"&&(n=n.text().trim(),l=this.getVariantFlags(),i=this.getUnknownFlags(),r=new Set(f(this,e).filter(o=>Xt.has(o)))),!!n&&!l.has(n)&&!i.has(n)&&(l.size>0||!r.has(n))}lint(n=this.getAbsoluteIndex(),l){const i=this.getVariantFlags(),r=this.getUnknownFlags(),o=new Set(f(this,e).filter(c=>Xt.has(c))),a=f(this,e).filter(c=>!c).length,h=f(this,e).length-r.size-a,d=super.lint(n,l);if(i.size===h||o.size===h)return d;const u="no-ignored",g=_.lintConfig.getSeverity(u,"conversionFlag");if(g){const c=new le(this,n);for(let p=0;p<this.length;p++){const v=this.childNodes[p],m=v.text().trim();if(this.isInvalidFlag(m,i,r,o)){const x=R(v,c,u,"invalid conversion flag",g);i.size===0&&Xt.has(m.toUpperCase())?x.fix={desc:"uppercase",range:[x.startIndex,x.endIndex],text:m.toUpperCase()}:x.suggestions=[{desc:"remove",range:[x.startIndex-(p&&1),x.endIndex],text:""}],d.push(x)}}}return d}print(){return super.print({sep:";"})}},e=new WeakMap,t),ki=Z(Kr),Tt=te(ki,0,"ConverterFlagsToken",Xr,Tt),ee(ki,1,Tt)}}),rs,Qa=T({"src/converterRule.ts"(){"use strict";B(),O(),Fe(),rs=class extends E{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=_.getConfig(),n=[]){super(void 0,s,n);const l=e.indexOf(":"),i=e.slice(0,l).indexOf("=>"),r=i===-1?e.slice(0,l):e.slice(i+2,l);t&&s.variants.includes(r.trim().toLowerCase())?(super.insertAt(new ge(r,"converter-rule-variant",s,n)),super.insertAt(new ge(e.slice(l+1),"converter-rule-to",s,n)),i!==-1&&super.insertAt(new ge(e.slice(0,i),"converter-rule-from",s,n),0)):super.insertAt(new ge(e,"converter-rule-to",s,n))}toString(e){const{childNodes:t,firstChild:s,lastChild:n}=this;return t.length===3?`${s.toString(e)}=>${t[1].toString(e)}:${n.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,n]=e;return`<span class="wpb-converter-rule">${t.print()}=>${s.print()}:${n.print()}</span>`}return super.print({sep:":"})}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t);return s.variant=this.variant,s}}}}),Yr,_i,Zr,Ct,Ja=T({"src/converter.ts"(){"use strict";oe(),Le(),O(),Va(),Qa(),Yr=[Te("-{")],Ct=class extends(Zr=E){get type(){return"converter"}constructor(e,t,s,n=[]){super(void 0,s,n),this.insertAt(new Tt(e,s,n));const[l]=t,i=l.includes(":"),r=new rs(l,i,s,n);i&&r.length===1||!i&&t.length===2&&!ve(t[1]).trim()?this.insertAt(new rs(t.join(";"),!1,s,n)):this.append(r,...t.slice(1).map(o=>new rs(o,!0,s,n)))}toString(e){const{childNodes:[t,...s]}=this;return`-{${t.toString(e)}${t.length>0?"|":""}${s.map(n=>n.toString(e)).join(";")}}-`}text(){const{childNodes:[e,...t]}=this;return`-{${e.text()}|${We(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>`}},_i=Z(Zr),Ct=te(_i,0,"ConverterToken",Yr,Ct),ee(_i,1,Ct)}}),Io={};Y(Io,{parseConverter:()=>No});var No,Xa=T({"parser/converter.ts"(){"use strict";Ja(),No=(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 n=/-\{/gu,l=/-\{|\}-/gu,i=[];let r=n,o=r.exec(e);for(;o;){const{0:h,index:d}=o;if(h==="}-"){const u=i.pop(),{length:g}=s,c=e.slice(u.index+2,d),p=c.indexOf("|"),[v,m]=p===-1?[[],c]:[c.slice(0,p).split(";"),c.slice(p+1)],x=m.replace(/(&[#a-z\d]+);/giu,"$1"),b=x.split(t.regexConverter).map(w=>w.replace(/\x01/gu,";"));new Ct(v,b,t,s),e=`${e.slice(0,u.index)}\0${g}v${e.slice(d+2)}`,i.length===0&&(r=n),r.lastIndex=u.index+3+String(g).length}else i.push(o),r=l,r.lastIndex=d+2;o=r.exec(e)}return e}}}),os={};Y(os,{Token:()=>E});var el,E,O=T({"src/index.ts"(){"use strict";var e,t,s,n,l,i,r,o,Lo,Fo,jo,Eo,Po,Ro,Oo,Bo,qo,Wo,Mo,Uo,y;oe(),Me(),M(),pe(),B(),da(),ha(),el=["category","html-attr#id,ext-attr#id,table-attr#id"],E=(y=class extends xl{constructor(S,$=_.getConfig(),C=[],I){super();N(this,o);N(this,e,"plain");N(this,t,0);N(this,s);N(this,n);N(this,l);N(this,i,!1);N(this,r);typeof S=="string"&&this.insertAt(S),L(this,s,$),L(this,n,C),C.push(this)}get type(){return f(this,e)}set type(S){L(this,e,S)}parseOnce(S=f(this,t),$=!1,C){if(S<f(this,t)||this.length===0||!this.isPlain())return this;if(f(this,t)>=me)return this;switch(S){case 0:if(this.type==="root"){f(this,n).pop();const I=j(this,o,Lo).call(this);$&&($=!I)}L(this,l,$),j(this,o,Fo).call(this,$);break;case 1:j(this,o,jo).call(this);break;case 2:j(this,o,Eo).call(this);break;case 3:j(this,o,Po).call(this);break;case 4:j(this,o,Ro).call(this);break;case 5:j(this,o,Oo).call(this,C);break;case 6:j(this,o,Bo).call(this,C);break;case 7:j(this,o,qo).call(this);break;case 8:j(this,o,Wo).call(this);break;case 9:j(this,o,Mo).call(this);break;case 10:j(this,o,Uo).call(this)}if(this.type==="root")for(const I of f(this,n))I==null||I.parseOnce(S,$,C);return bn(this,t)._++,this}buildFromStr(S,$){const C=S.split(/[\0\x7F]/u).map((I,U)=>{if(U%2===0)return new Ri(I);if(isNaN(I.slice(-1)))return f(this,n)[Number(I.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${I}`)});return $===0?C.map(String).join(""):$===1?We(C):C}build(){L(this,t,me);const{length:S,firstChild:$}=this,C=$==null?void 0:$.toString();if(S===1&&$.type==="text"&&C.includes("\0")&&(as(this,0,1,this.buildFromStr(C)),this.normalize(),this.type==="root"))for(const I of f(this,n))I==null||I.build()}afterBuild(){if(this.type==="root")for(const S of f(this,n))S==null||S.afterBuild();L(this,i,!0)}parse(S=me,$,C){for(S=Math.min(S,me);f(this,t)<S;)this.parseOnce(f(this,t),$,C);return S&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===y}getAttribute(S){var $;switch(S){case"config":return f(this,s);case"include":return($=f(this,l))!=null?$:!!f(this.getRootNode(),l);case"accum":return f(this,n);case"built":return f(this,i);case"stage":return f(this,t);case"invalid":return this.type==="table-inter"&&It(this)===2;default:return super.getAttribute(S)}}setAttribute(S,$){switch(S){case"stage":f(this,t)===0&&this.type==="root"&&f(this,n).shift(),L(this,t,$);break;default:super.setAttribute(S,$)}}insertAt(S,$=this.length){const C=typeof S=="string"?new Ri(S):S;super.insertAt(C,$);const{type:I}=C;return I==="root"&&(C.type="plain"),C}normalizeTitle(S,$=0,C){return _.normalizeTitle(S,$,f(this,l),f(this,s),C)}inTableAttrs(){var S,$;return((S=this.closest("table-attrs,ext"))==null?void 0:S.type)==="table-attrs"&&(($=this.closest("table-attrs,arg,magic-word,template"))!=null&&$.is("table-attrs")?2:1)}inHtmlAttrs(){var S;return(S=this.closest("html-attrs,ext"))!=null&&S.is("html-attrs")?2:this.inTableAttrs()}lint(S=this.getAbsoluteIndex(),$){var I;let C=super.lint(S,$);if(this.type==="root"){const U=new Map,F="no-duplicate",P=["category","id"].map(q=>_.lintConfig.getSeverity(F,q)),X=el.filter((q,D)=>P[D]).join();if(X){for(const q of this.querySelectorAll(X)){let D;if(q.is("category"))D=q.name;else{const H=q.getValue();H&&H!==!0&&(D=`#${H}`)}if(D){const H=U.get(D);H?H.add(q):U.set(D,new Set([q]))}}for(const[q,D]of U)if(D.size>1&&!q.startsWith("#mw-customcollapsible-")){const H=!q.startsWith("#"),J=`duplicated ${H?"category":"id"}`,ne=P[H?0:1];C.push(...[...D].map(K=>{const re=V(K,{start:K.getAbsoluteIndex()},F,J,ne);return H&&(re.suggestions=[{desc:"remove",range:[re.startIndex,re.endIndex],text:""}]),re}))}}const W=/<!--\s*lint-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->/gu,Q=this.toString(),z=[];let ie=W.exec(Q);for(;ie;){const{1:q,index:D}=ie,H=(I=ie[2])==null?void 0:I.trim();z.push({line:this.posFromIndex(D).top+(q==="disable-line"?0:1),from:q==="disable"?W.lastIndex:void 0,to:q==="enable"?W.lastIndex:void 0,rules:H?new Set(H.split(",").map(J=>J.trim())):void 0}),ie=W.exec(Q)}if(C=C.filter(({rule:q,startLine:D,startIndex:H})=>{const J={pos:0};for(const{line:ne,from:K,to:re,rules:ue}of z){if(ne>D+1)break;if(ue&&!ue.has(q))continue;if(ne===D&&K===void 0&&re===void 0)return!1;K<=H&&K>J.pos?(J.pos=K,J.type="from"):re<=H&&re>J.pos&&(J.pos=re,J.type="to")}return J.type!=="from"}),C.some(({fix:q})=>q)){const q=C.map(({fix:J})=>J).filter(Boolean).sort(({range:[J,ne]},{range:[K,re]})=>ne===re?K-J:re-ne);let D=1/0,H=Q;for(const{range:[J,ne],text:K}of q)ne<=D&&(H=H.slice(0,J)+K+H.slice(ne),D=J);Object.assign(C,{output:H})}}return C}toString(S,$){return S?super.toString(!0,$):qe(f(this,r),()=>super.toString(!1,$),C=>{const I=this.getRootNode();I.type==="root"&&f(I,i)&&L(this,r,C)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n=new WeakMap,l=new WeakMap,i=new WeakMap,r=new WeakMap,o=new WeakSet,Lo=function(){const{parseRedirect:S}=(ga(),G(bl)),$=this.firstChild.toString(),C=S($,f(this,s),f(this,n));return C&&this.setText(C),!!C},Fo=function(S){const{parseCommentAndExt:$}=(ms(),G(to));this.setText($(this.firstChild.toString(),f(this,s),f(this,n),S))},jo=function(){const{parseBraces:S}=(tn(),G(El)),$=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,C=S($,f(this,s),f(this,n));this.setText(this.type==="root"?C:C.slice(1))},Eo=function(){if(f(this,s).excludes.includes("html"))return;const{parseHtml:S}=(ja(),G(so));this.setText(S(this.firstChild.toString(),f(this,s),f(this,n)))},Po=function(){if(f(this,s).excludes.includes("table"))return;const{parseTable:S}=(Ra(),G(uo));this.setText(S(this,f(this,s),f(this,n)))},Ro=function(){if(f(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:S}=(qa(),G(po));this.setText(S(this,f(this,s),f(this,n)))},Oo=function(S){const{parseLinks:$}=(Ua(),G(So));this.setText($(this.firstChild.toString(),f(this,s),f(this,n),S))},Bo=function(S){if(f(this,s).excludes.includes("quote"))return;const{parseQuotes:$}=(vo(),G(mo)),C=this.firstChild.toString().split(`
|
|
25
|
-
`);for(let I=0;I<C.length;I++)C[I]=$(C[I],f(this,s),f(this,
|
|
26
|
-
`))},
|
|
27
|
-
`),F={lastPrefix:""};let
|
|
28
|
-
`))},
|
|
21
|
+
${d}`,a),r.push(a);continue}const[,v,m,x,b]=p;if(v){for(;!a.is("table");)a=r.pop();a.close(`
|
|
22
|
+
${u}${v}`,!0),h(b,r[r.length-1])}else if(m){a=pi(a,r),a.is("tr")&&(a=r.pop());const w=new uo(`
|
|
23
|
+
${u}${m}`,b,i,n);r.push(a,w),a.insertAt(w)}else{a=pi(a,r);const w=x==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu;let y=w.exec(b),A=0,k=`
|
|
24
|
+
${u}${x}`;const S=$=>{const C=new is(k,b.slice(A,y==null?void 0:y.index),i,n);return $.insertAt(C),C};for(;y;)S(a),{lastIndex:A}=w,[k]=y,y=w.exec(b);r.push(a,S(a))}}return o.slice(1)}}}),xo,Ma=T({"src/nowiki/hr.ts"(){"use strict";De(),xo=class extends je{get type(){return"hr"}}}}),Qr,fi,Jr,Ct,Ua=T({"src/nowiki/doubleUnderscore.ts"(){"use strict";ot(),Le(),De(),Qr=[ze(),$e("__")],Ct=class extends(Jr=je){get type(){return"double-underscore"}constructor(e,t,s,i){var o,a;super(e,s,i);const n=e.toLowerCase(),{doubleUnderscore:[,,r,l]}=s;this.setAttribute("name",(a=t?(o=l==null?void 0:l[e])==null?void 0:o.toLowerCase():r==null?void 0:r[n])!=null?a:n)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}},fi=ee(Jr),Ct=K(fi,0,"DoubleUnderscoreToken",Qr,Ct),X(fi,1,Ct)}}),mo={};te(mo,{parseHrAndDoubleUnderscore:()=>vo});var vo,za=T({"parser/hrAndDoubleUnderscore.ts"(){"use strict";Ma(),Ua(),El(),vo=({firstChild:{data:e},type:t,name:s},i,n)=>{var a,h,d;const{doubleUnderscore:[r,l,o]}=i;return(a=i.insensitiveDoubleUnderscore)!=null||(i.insensitiveDoubleUnderscore=new Set(r)),(h=i.sensitiveDoubleUnderscore)!=null||(i.sensitiveDoubleUnderscore=new Set(l)),(d=i.regexHrAndDoubleUnderscore)!=null||(i.regexHrAndDoubleUnderscore=new RegExp(`__(${[...r,...l].join("|")})__`,"giu")),t!=="root"&&(t!=="ext-inner"||s!=="poem")&&(e=`\0${e}`),e=e.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(u,g,c)=>(new xo(c,i,n),`${g}\0${n.length-1}r`)).replace(i.regexHrAndDoubleUnderscore,(u,g)=>{var m;const c=i.sensitiveDoubleUnderscore.has(g),p=g.toLowerCase(),v=i.insensitiveDoubleUnderscore.has(p);return c||v?(new Ct(g,c,i,n),`\0${n.length-1}${v&&((m=o==null?void 0:o[p])!=null?m:p)==="toc"?"u":"n"}`):u}).replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(u,g,c,p,v)=>{const m=`${g}\0${n.length}h`;return new Yi(c.length,[p,v],i,n),m}),t==="root"||t==="ext-inner"&&s==="poem"?e:e.slice(1)}}}),bo,Ha=T({"src/nowiki/quote.ts"(){"use strict";var e,t;M(),ae(),B(),De(),bo=(t=class extends je{constructor(i,n,r,l){super(i,r,l);N(this,e);L(this,e,n)}get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}get closing(){return pe(pe({},this.bold?{bold:f(this,e).bold}:void 0),this.italic?{italic:f(this,e).italic}:void 0)}text(){const{parentNode:i,innerText:n}=this;return i!=null&&i.is("image-parameter")&&i.name!=="caption"?"":n}lint(i=this.getAbsoluteIndex()){const{previousSibling:n,bold:r,closing:l}=this,o=(n==null?void 0:n.type)==="text"?n.data:void 0,a=[],h=new le(this,i),d=["lonely-apos","bold-header"],u=[void 0,"word"].map(c=>_.lintConfig.getSeverity(d[0],c)),g=_.lintConfig.getSeverity(d[1]);if(o!=null&&o.endsWith("'")){const c=u[(l.bold||l.italic)&&/[a-z\d]'$/iu.test(o)?1:0];if(c){const p=V(this,h,d[0],_.msg('lonely "$1"',"'"),c),{startIndex:v,startLine:m,startCol:x}=p,[,{length:b}]=/(?:^|[^'])('+)$/u.exec(o),w=i-b;a.push(ye(pe({},p),{startIndex:w,endIndex:v,endLine:m,startCol:x-b,endCol:x,suggestions:[{desc:"escape",range:[w,v],text:"'".repeat(b)},{desc:"remove",range:[w,v],text:""}]}))}}if(g&&r&&this.closest("heading-title")){const c=V(this,h,d[1],"bold in section header",g);c.suggestions=[{desc:"remove",range:[i,i+3],text:""}],a.push(c)}return a}json(i,n=this.getAbsoluteIndex()){const r=super.json(void 0,n);return Object.assign(r,{bold:this.bold,italic:this.italic}),r}},e=new WeakMap,t)}}),wo={};te(wo,{parseQuotes:()=>an});var an,yo=T({"parser/quotes.ts"(){"use strict";Ha(),an=(e,t,s,i)=>{var c;const n=e.split(/('{2,})/u),{length:r}=n;if(r===1)return e;let l=0,o=0,a,h,d;for(let p=1;p<r;p+=2){const v=n[p].length;switch(v){case 2:o++;break;case 4:n[p-1]+="'",n[p]="'''";case 3:if(l++,a!==void 0)break;n[p-1].endsWith(" ")?h===void 0&&d===void 0&&(d=p):n[p-1].slice(-2,-1)===" "?a=p:h!=null||(h=p);break;default:n[p-1]+="'".repeat(v-5),n[p]="'''''",o++,l++}}if(o%2===1&&l%2===1){const p=(c=a!=null?a:h)!=null?c:d;p!==void 0&&(n[p]="''",n[p-1]+="'")}let u=!0,g=!0;for(let p=1;p<r;p+=2){const v=n[p].length,m=v!==2,x=v!==3;m&&(u=!u),x&&(g=!g),new bo(n[p],{bold:m&&u,italic:x&&g},t,s),n[p]=`\0${s.length-1}q`}return n.join("")}}}),So={};te(So,{parseExternalLinks:()=>dn});var dn,Ao=T({"parser/externalLinks.ts"(){"use strict";oe(),Xl(),sn(),dn=(e,t,s,i)=>{var n;return(n=t.regexExternalLinks)!=null||(t.regexExternalLinks=new RegExp(String.raw`\[(\0\d+f\x7F|(?:(?:${t.protocol}|//)${tt}|\0\d+m\x7F)${st}(?=[[\]<>"\t${Ne}]|\0\d))([${Ne}]*(?![${Ne}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),e.replace(t.regexExternalLinks,(r,l,o,a)=>{const{length:h}=s,d=/&[lg]t;/u.exec(l);return d&&(o="",a=l.slice(d.index)+o+a,l=l.slice(0,d.index)),i?(new Pt(l,"ext-link-url",t,s),`[\0${h}f${o}${a}]`):(new Ke(l,o,a,t,s),`\0${h}w`)})}}}),ko,Da=T({"src/link/category.ts"(){"use strict";oe(),os(),ko=class extends Ie{get type(){return"category"}get sortkey(){const{childNodes:[,e]}=this;return e&&jt(e.text())}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t),{sortkey:i}=this;return i&&(s.sortkey=i),s}}}}),_o={};te(_o,{parseLinks:()=>Wi});var Xr,Wi,Ga=T({"parser/links.ts"(){"use strict";B(),yo(),Ao(),Jl(),Dl(),Da(),Xr=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,Wi=(e,t,s,i)=>{var o;(o=t.regexLinks)!=null||(t.regexLinks=new RegExp(String.raw`^\s*(?:${t.protocol}|//)`,"iu"));const n=t.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]]))?\]\]([\s\S]*)$/u:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]])?)?\]\]([\s\S]*)$/u,r=e.split("[[");let l=r.shift();for(let a=0;a<r.length;a++){let h=!1,d,u,g,c;const p=r[a],v=n.exec(p);if(v)[,d,u,g,c]=v,c.startsWith("]")&&(g!=null&&g.includes("["))&&(g+="]",c=c.slice(1));else{const y=Xr.exec(p);y&&(h=!0,[,d,u,g]=y)}if(d===void 0||t.regexLinks.test(d)||/\0\d+[exhbru]\x7F/u.test(d)){l+=`[[${p}`;continue}const m=d.trim().startsWith(":");if(m&&h){l+=`[[${p}`;continue}const{ns:x,valid:b}=_.normalizeTitle(d,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0});if(b){if(h){if(x!==6){l+=`[[${p}`;continue}let y=!1;for(a++;a<r.length;a++){const A=r[a],k=A.split("]]");if(k.length>2){y=!0,g+=`[[${k[0]}]]${k[1]}`,c=k.slice(2).join("]]");break}else if(k.length===2)g+=`[[${k[0]}]]${k[1]}`;else{g+=`[[${A}`;break}}if(g=Wi(g,t,s,i),!y){l+=`[[${d}${u}${g}`;continue}}}else{l+=`[[${p}`;continue}g&&(g=an(g,t,s,i));let w=tn;m||(x===6?(g&&(g=dn(g,t,s,!0)),w=en):x===14&&(w=ko)),g===void 0&&u&&(g=""),l+=`\0${s.length}l${c}`,new w(d,g,t,s,u)}return l}}}),$o={};te($o,{parseMagicLinks:()=>To});var xi,mi,vi,bi,To,Va=T({"parser/magicLinks.ts"(){"use strict";oe(),sn(),xi=String.raw`[${Ne}\t]| |�*160;|�*a0;`,mi=`(?:${xi})+`,vi=`(?:${xi}|-)`,bi=String.raw`(?:RFC|PMID)${mi}\d+\b|ISBN${mi}(?:97[89]${vi}?)?(?:\d${vi}?){9}[\dx]\b`,To=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${tt}${st})|${bi})`,"giu")}catch(i){t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${tt}${st})|${bi})`,"giu")}return e.replace(t.regexMagicLinks,(i,n,r)=>{let l=n?i.slice(n.length):i;if(r){let o="";const a=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(l);a&&(o=l.slice(a.index),l=l.slice(0,a.index));const h=l.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,d=h.exec(l);if(d){let u=1;d[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(l.slice(0,d.index))&&(u=2),o=l.slice(d.index+u)+o,l=l.slice(0,d.index+u)}return o.length>=r.length?i:(new Pt(l,void 0,t,s),`${n}\0${s.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(l))return i;return new Pt(l,"magic-link",t,s),`${n}\0${s.length-1}i`})}}}),Co,Qa=T({"util/html.ts"(){"use strict";Co=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,i)=>s!==e[i])}}),Io,Ja=T({"src/nowiki/list.ts"(){"use strict";co(),Io=class extends ln{get type(){return"list"}}}}),No={};te(No,{parseList:()=>Lo});var Lo,Xa=T({"parser/list.ts"(){"use strict";Qa(),Ja(),go(),Lo=(e,t,s,i)=>{const n=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!n)return t.lastPrefix="",e;const[r,l,o,a]=n,h=o.replace(/;/gu,":"),d=Co(h,t.lastPrefix),u=((d>1?o.slice(d-1):o)+a).split(/(?=;)/u),g=u[0].startsWith(";");let c=u.length-(g?0:1);if(d>1){const I=o.slice(0,d-1);if(g){const U=I.split(/(?=;)/u);u.unshift(...U),c+=I.includes(";")?U.length:0}else u[0]=I+u[0]}t.lastPrefix=h;let p=l+u.map((I,U)=>`\0${i.length+U}d`).join("")+e.slice(r.length);for(const I of u)new Io(I,s,i);if(!c)return p;const{html:[v,,m]}=s,x=/:+|-\{|\0\d+[xq]\x7F/gu;let b=x,w=b.exec(p),y=0,A=!1,k=!1,S=0;const $=(I,U)=>(new on(I,s,i),`${p.slice(0,U)}\0${i.length-1}d${p.slice(U+I.length)}`),C=I=>{I?y&&y--:y++};for(;w&&c;){const{0:I,index:U}=w;if(I==="-{"){if(!S){const{lastIndex:F}=b;b=/-\{|\}-/gu,b.lastIndex=F}S++}else if(I==="}-"){if(S--,!S){const{lastIndex:F}=b;b=x,b.lastIndex=F}}else if(I.endsWith("x")){const{name:F,closing:E,selfClosing:Y}=i[Number(I.slice(1,-2))];(v.includes(F)||!Y&&!m.includes(F))&&C(E)}else if(I.endsWith("q")){const{bold:F,italic:E}=i[Number(I.slice(1,-2))];F&&(C(A),A=!A),E&&(C(k),k=!k)}else if(y===0){if(I.length>=c)return $(I.slice(0,c),U);c-=I.length,b.lastIndex=U+4+String(i.length).length,p=$(I,U)}w=b.exec(p)}return p}}}),Qt,Kr,wi,Yr,It,Ka=T({"src/converterFlags.ts"(){"use strict";var e,t;M(),ae(),as(),B(),O(),Fe(),Qt=new Set(["A","T","R","D","-","H","N"]),Kr=[Ot()],It=(t=class extends(Yr=j){constructor(i,n,r=[]){super(void 0,n,r,{});N(this,e);this.safeAppend(i.map(l=>new ge(l,"converter-flag",n,r)))}get type(){return"converter-flags"}afterBuild(){L(this,e,this.childNodes.map(i=>i.text().trim())),super.afterBuild()}toString(i){return super.toString(i,";")}text(){return super.text(";")}getUnknownFlags(){return new Set(f(this,e).filter(i=>/\{{3}[^{}]+\}{3}/u.test(i)))}getVariantFlags(){const i=new Set(this.getAttribute("config").variants);return new Set(f(this,e).filter(n=>i.has(n)))}isInvalidFlag(i,n,r,l){return typeof i=="object"&&(i=i.text().trim(),n=this.getVariantFlags(),r=this.getUnknownFlags(),l=new Set(f(this,e).filter(o=>Qt.has(o)))),!!i&&!n.has(i)&&!r.has(i)&&(n.size>0||!l.has(i))}lint(i=this.getAbsoluteIndex(),n){const r=this.getVariantFlags(),l=this.getUnknownFlags(),o=new Set(f(this,e).filter(c=>Qt.has(c))),a=f(this,e).filter(c=>!c).length,h=f(this,e).length-l.size-a,d=super.lint(i,n);if(r.size===h||o.size===h)return d;const u="no-ignored",g=_.lintConfig.getSeverity(u,"conversionFlag");if(g){const c=new le(this,i);for(let p=0;p<this.length;p++){const v=this.childNodes[p],m=v.text().trim();if(this.isInvalidFlag(m,r,l,o)){const x=R(v,c,u,"invalid conversion flag",g);r.size===0&&Qt.has(m.toUpperCase())?x.fix={desc:"uppercase",range:[x.startIndex,x.endIndex],text:m.toUpperCase()}:x.suggestions=[{desc:"remove",range:[x.startIndex-(p&&1),x.endIndex],text:""}],d.push(x)}}}return d}print(){return super.print({sep:";"})}},e=new WeakMap,t),wi=ee(Yr),It=K(wi,0,"ConverterFlagsToken",Kr,It),X(wi,1,It)}}),ss,Ya=T({"src/converterRule.ts"(){"use strict";B(),O(),Fe(),ss=class extends j{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=_.getConfig(),i=[]){super(void 0,s,i);const n=e.indexOf(":"),r=e.slice(0,n).indexOf("=>"),l=r===-1?e.slice(0,n):e.slice(r+2,n);t&&s.variants.includes(l.trim().toLowerCase())?(super.insertAt(new ge(l,"converter-rule-variant",s,i)),super.insertAt(new ge(e.slice(n+1),"converter-rule-to",s,i)),r!==-1&&super.insertAt(new ge(e.slice(0,r),"converter-rule-from",s,i),0)):super.insertAt(new ge(e,"converter-rule-to",s,i))}toString(e){const{childNodes:t,firstChild:s,lastChild:i}=this;return t.length===3?`${s.toString(e)}=>${t[1].toString(e)}:${i.toString(e)}`:super.toString(e,":")}text(){const{childNodes:e,firstChild:t,lastChild:s}=this;return e.length===3?`${t.text()}=>${e[1].text()}:${s.text()}`:super.text(":")}getGaps(e){return e===0&&this.length===3?2:1}print(){const{childNodes:e}=this;if(e.length===3){const[t,s,i]=e;return`<span class="wpb-converter-rule">${t.print()}=>${s.print()}:${i.print()}</span>`}return super.print({sep:":"})}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t);return s.variant=this.variant,s}}}}),Zr,yi,el,Nt,Za=T({"src/converter.ts"(){"use strict";oe(),Le(),O(),Ka(),Ya(),Zr=[$e("-{")],Nt=class extends(el=j){get type(){return"converter"}constructor(e,t,s,i=[]){super(void 0,s,i),this.insertAt(new It(e,s,i));const[n]=t,r=n.includes(":"),l=new ss(n,r,s,i);r&&l.length===1||!r&&t.length===2&&!me(t[1]).trim()?this.insertAt(new ss(t.join(";"),!1,s,i)):this.append(l,...t.slice(1).map(o=>new ss(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()}|${Me(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?"|":""}${nt(t,{sep:";"})}}-</span>`}},yi=ee(el),Nt=K(yi,0,"ConverterToken",Zr,Nt),X(yi,1,Nt)}}),Fo={};te(Fo,{parseConverter:()=>jo});var jo,ed=T({"parser/converter.ts"(){"use strict";Za(),jo=(e,t,s)=>{var a;(a=t.regexConverter)!=null||(t.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${t.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"iu"));const i=/-\{/gu,n=/-\{|\}-/gu,r=[];let l=i,o=l.exec(e);for(;o;){const{0:h,index:d}=o;if(h==="}-"){const u=r.pop(),{length:g}=s,c=e.slice(u.index+2,d),p=c.indexOf("|"),[v,m]=p===-1?[[],c]:[c.slice(0,p).split(";"),c.slice(p+1)],x=m.replace(/(&[#a-z\d]+);/giu,"$1"),b=x.split(t.regexConverter).map(w=>w.replace(/\x01/gu,";"));new Nt(v,b,t,s),e=`${e.slice(0,u.index)}\0${g}v${e.slice(d+2)}`,r.length===0&&(l=i),l.lastIndex=u.index+3+String(g).length}else r.push(o),l=n,l.lastIndex=d+2;o=l.exec(e)}return e}}}),ns={};te(ns,{Token:()=>j});var tl,j,O=T({"src/index.ts"(){"use strict";var e,t,s,i,n,r,l,o,Eo,Po,Ro,Oo,Bo,qo,Wo,Mo,Uo,zo,Ho,Do,y;oe(),Ue(),M(),Se(),B(),ga(),pa(),tl=["category","html-attr#id,ext-attr#id,table-attr#id"],j=(y=class extends bt{constructor(S,$=_.getConfig(),C=[],I){super();N(this,o);N(this,e,"plain");N(this,t,0);N(this,s);N(this,i);N(this,n);N(this,r,!1);N(this,l);typeof S=="string"&&this.insertAt(S),L(this,s,$),L(this,i,C),C.push(this)}get type(){return f(this,e)}set type(S){L(this,e,S)}parseOnce(S=f(this,t),$=!1,C){if(S<f(this,t)||this.length===0||!this.isPlain())return this;if(f(this,t)>=xe)return this;switch(S){case 0:if(this.type==="root"){f(this,i).pop();const I=P(this,o,Eo).call(this);$&&($=!I)}L(this,n,$),P(this,o,Po).call(this,$);break;case 1:P(this,o,Ro).call(this);break;case 2:P(this,o,Oo).call(this);break;case 3:P(this,o,Bo).call(this);break;case 4:P(this,o,qo).call(this);break;case 5:P(this,o,Wo).call(this,C);break;case 6:P(this,o,Mo).call(this,C);break;case 7:P(this,o,Uo).call(this);break;case 8:P(this,o,zo).call(this);break;case 9:P(this,o,Ho).call(this);break;case 10:P(this,o,Do).call(this)}if(this.type==="root")for(const I of f(this,i))I==null||I.parseOnce(S,$,C);return mn(this,t)._++,this}buildFromStr(S,$){const C=S.split(/[\0\x7F]/u).map((I,U)=>{if(U%2===0)return new Fi(I);if(isNaN(I.slice(-1)))return f(this,i)[Number(I.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${I}`)});return $===0?C.map(String).join(""):$===1?Me(C):C}build(){L(this,t,xe);const{length:S,firstChild:$}=this,C=$==null?void 0:$.toString();if(S===1&&$.type==="text"&&C.includes("\0")&&(rs(this,0,1,this.buildFromStr(C)),this.normalize(),this.type==="root"))for(const I of f(this,i))I==null||I.build()}afterBuild(){if(this.type==="root")for(const S of f(this,i))S==null||S.afterBuild();L(this,r,!0)}parse(S=xe,$,C){for(S=Math.min(S,xe);f(this,t)<S;)this.parseOnce(f(this,t),$,C);return S&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===y}getAttribute(S){var $;switch(S){case"config":return f(this,s);case"include":return($=f(this,n))!=null?$:!!f(this.getRootNode(),n);case"accum":return f(this,i);case"built":return f(this,r);case"stage":return f(this,t);case"invalid":return this.type==="table-inter"&&Lt(this)===2;default:return super.getAttribute(S)}}setAttribute(S,$){switch(S){case"stage":f(this,t)===0&&this.type==="root"&&f(this,i).shift(),L(this,t,$);break;default:super.setAttribute(S,$)}}insertAt(S,$=this.length){const C=typeof S=="string"?new Fi(S):S;super.insertAt(C,$);const{type:I}=C;return I==="root"&&(C.type="plain"),C}normalizeTitle(S,$=0,C){return _.normalizeTitle(S,$,f(this,n),f(this,s),C)}inTableAttrs(){var S,$;return((S=this.closest("table-attrs,ext"))==null?void 0:S.type)==="table-attrs"&&(($=this.closest("table-attrs,arg,magic-word,template"))!=null&&$.is("table-attrs")?2:1)}inHtmlAttrs(){var S;return(S=this.closest("html-attrs,ext"))!=null&&S.is("html-attrs")?2:this.inTableAttrs()}lint(S=this.getAbsoluteIndex(),$){var I;let C=super.lint(S,$);if(this.type==="root"){const U=new Map,F="no-duplicate",E=["category","id"].map(q=>_.lintConfig.getSeverity(F,q)),Y=tl.filter((q,D)=>E[D]).join();if(Y){for(const q of this.querySelectorAll(Y)){let D;if(q.is("category"))D=q.name;else{const H=q.getValue();H&&H!==!0&&(D=`#${H}`)}if(D){const H=U.get(D);H?H.add(q):U.set(D,new Set([q]))}}for(const[q,D]of U)if(D.size>1&&!q.startsWith("#mw-customcollapsible-")){const H=!q.startsWith("#"),J=`duplicated ${H?"category":"id"}`,ne=E[H?0:1];C.push(...[...D].map(Z=>{const re=V(Z,{start:Z.getAbsoluteIndex()},F,J,ne);return H&&(re.suggestions=[{desc:"remove",range:[re.startIndex,re.endIndex],text:""}]),re}))}}const W=/<!--\s*lint-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->/gu,Q=this.toString(),z=[];let ie=W.exec(Q);for(;ie;){const{1:q,index:D}=ie,H=(I=ie[2])==null?void 0:I.trim();z.push({line:this.posFromIndex(D).top+(q==="disable-line"?0:1),from:q==="disable"?W.lastIndex:void 0,to:q==="enable"?W.lastIndex:void 0,rules:H?new Set(H.split(",").map(J=>J.trim())):void 0}),ie=W.exec(Q)}if(C=C.filter(({rule:q,startLine:D,startIndex:H})=>{const J={pos:0};for(const{line:ne,from:Z,to:re,rules:ue}of z){if(ne>D+1)break;if(ue&&!ue.has(q))continue;if(ne===D&&Z===void 0&&re===void 0)return!1;Z<=H&&Z>J.pos?(J.pos=Z,J.type="from"):re<=H&&re>J.pos&&(J.pos=re,J.type="to")}return J.type!=="from"}),C.some(({fix:q})=>q)){const q=C.map(({fix:J})=>J).filter(Boolean).sort(({range:[J,ne]},{range:[Z,re]})=>ne===re?Z-J:re-ne);let D=1/0,H=Q;for(const{range:[J,ne],text:Z}of q)ne<=D&&(H=H.slice(0,J)+Z+H.slice(ne),D=J);Object.assign(C,{output:H})}}return C}toString(S,$){return S?super.toString(!0,$):We(f(this,l),()=>super.toString(!1,$),C=>{const I=this.getRootNode();I.type==="root"&&f(I,r)&&L(this,l,C)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakMap,l=new WeakMap,o=new WeakSet,Eo=function(){const{parseRedirect:S}=(ma(),G(Sl)),$=this.firstChild.toString(),C=S($,f(this,s),f(this,i));return C&&this.setText(C),!!C},Po=function(S){const{parseCommentAndExt:$}=(gs(),G(no));this.setText($(this.firstChild.toString(),f(this,s),f(this,i),S))},Ro=function(){const{parseBraces:S}=(Zi(),G(Ol)),$=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,C=S($,f(this,s),f(this,i));this.setText(this.type==="root"?C:C.slice(1))},Oo=function(){if(f(this,s).excludes.includes("html"))return;const{parseHtml:S}=(Oa(),G(ro));this.setText(S(this.firstChild.toString(),f(this,s),f(this,i)))},Bo=function(){if(f(this,s).excludes.includes("table"))return;const{parseTable:S}=(Wa(),G(po));this.setText(S(this,f(this,s),f(this,i)))},qo=function(){if(f(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:S}=(za(),G(mo));this.setText(S(this,f(this,s),f(this,i)))},Wo=function(S){const{parseLinks:$}=(Ga(),G(_o));this.setText($(this.firstChild.toString(),f(this,s),f(this,i),S))},Mo=function(S){if(f(this,s).excludes.includes("quote"))return;const{parseQuotes:$}=(yo(),G(wo)),C=this.firstChild.toString().split(`
|
|
25
|
+
`);for(let I=0;I<C.length;I++)C[I]=$(C[I],f(this,s),f(this,i),S);this.setText(C.join(`
|
|
26
|
+
`))},Uo=function(){if(f(this,s).excludes.includes("extLink"))return;const{parseExternalLinks:S}=(Ao(),G(So));this.setText(S(this.firstChild.toString(),f(this,s),f(this,i)))},zo=function(){if(f(this,s).excludes.includes("magicLink"))return;const{parseMagicLinks:S}=(Va(),G($o));this.setText(S(this.firstChild.toString(),f(this,s),f(this,i)))},Ho=function(){if(f(this,s).excludes.includes("list"))return;const{parseList:S}=(Xa(),G(No)),{firstChild:$,type:C,name:I}=this,U=$.toString().split(`
|
|
27
|
+
`),F={lastPrefix:""};let E=C==="root"||C==="ext-inner"&&I==="poem"?0:1;for(;E<U.length;E++)U[E]=S(U[E],F,f(this,s),f(this,i));this.setText(U.join(`
|
|
28
|
+
`))},Do=function(){if(f(this,s).variants.length>0){const{parseConverter:S}=(ed(),G(Fo));this.setText(S(this.firstChild.toString(),f(this,s),f(this,i)))}},y)}}),ve,ps,rs,Se=T({"util/debug.ts"(){"use strict";ve={running:!1,run(e){const{running:t}=this;this.running=!0;try{const{Token:s}=(O(),G(ns)),i=e();return i instanceof s&&!i.getAttribute("built")&&i.afterBuild(),this.running=t,i}catch(s){throw this.running=t,s}},rev:0},ps=e=>t=>t.type===e,rs=(e,t,s,i=[])=>{var l,o;let n=e.getChildNodes(),r;n.length===s?(r=n,n=i):r=n.splice(t,s,...i);for(let a=0;a<i.length;a++){const h=i[a];h.setAttribute("parentNode",e),h.setAttribute("nextSibling",n[t+a+1]),h.setAttribute("previousSibling",n[t+a-1])}return(l=n[t-1])==null||l.setAttribute("nextSibling",n[t]),(o=n[t+i.length])==null||o.setAttribute("previousSibling",n[t+i.length-1]),n===i&&e.setAttribute("childNodes",n),r}}}),sl,mt,Si,Ai,il,ki,nl,Mi,td=T({"lib/lintConfig.ts"(){"use strict";ul(),sl=new Set([0,1,2]),mt=new Map([[0,!1],[1,"warning"],[2,"error"]]),Si={"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(Si),Ai=e=>typeof e=="number"&&sl.has(e),il=e=>Ai(e)||Array.isArray(e)&&e.length===2&&Ai(e[0])&&e[1]&&typeof e[1]=="object",ki=(e,t,s)=>{if(Di.includes(t)){if(il(s))return e[t]=s,!0}else throw new RangeError(`Unknown lint rule: ${t}`);throw new RangeError(`Invalid lint config for ${t}: ${JSON.stringify(s)}`)},nl=class{constructor(e){if(Object.assign(this,JSON.parse(JSON.stringify(Si))),!!e)for(const[t,s]of Object.entries(e))ki(this,t,s)}getSeverity(e,t){var i;if(!(e in this))throw new RangeError(`Unknown rule: ${e}`);const s=this[e];return typeof s=="number"?mt.get(s):t&&(i=mt.get(s[1][t]))!=null?i:mt.get(s[0])}},Mi=e=>new Proxy(new nl(e),{set:ki})}}),Go={};te(Go,{Title:()=>Vo});var Vo,sd=T({"lib/title.ts"(){"use strict";var e,t,s,i,n,r;oe(),Vo=(r=class{constructor(l,o,a,{temporary:h,decode:d,selfLink:u}={}){N(this,e);N(this,t);N(this,s);N(this,i);N(this,n);ke(this,"valid");ke(this,"encoded",!1);const g=l.trim().startsWith("../");if(d&&l.includes("%"))try{const p=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(l);l=Ft(l),this.encoded=p}catch(p){}if(l=jt(l).replace(/[_ ]+/gu," ").trim(),g)L(this,i,0);else{let p=o;l.startsWith(":")&&(p=0,l=l.slice(1).trim());const v=l.split(":");if(v.length>1){const m=it(v[0]),x=Object.prototype.hasOwnProperty.call(a.nsid,m)&&a.nsid[m];x&&(p=x,l=v.slice(1).join(":").trim())}L(this,i,p)}const c=l.indexOf("#");if(c!==-1){let p=l.slice(c).trim().slice(1);if(p.includes("%"))try{p=Ft(p)}catch(v){}L(this,n,p.replace(/ /gu,"_")),l=l.slice(0,c).trim()}this.valid=!!(l||u&&this.ns===0&&f(this,n)!==void 0)&&jt(l)===l&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(g?/^(?:\.\.\/)+(.*)/u.exec(l)[1]:l),this.main=l,L(this,t,a.namespaces),L(this,s,a.articlePath||"/wiki/$1"),f(this,s).includes("$1")||L(this,s,f(this,s)+`${f(this,s).endsWith("/")?"":"/"}$1`),h||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return f(this,i)}get fragment(){return f(this,n)}get main(){return f(this,e)}set main(l){l=l.replace(/_/gu," ").trim(),L(this,e,l&&l[0].toUpperCase()+l.slice(1))}get prefix(){const l=f(this,t)[this.ns];return l+(l&&":")}get title(){return this.getRedirection()[1]}get extension(){const{main:l}=this,o=l.lastIndexOf(".");return o===-1?void 0:l.slice(o+1).toLowerCase()}getRedirection(){return[!1,(this.prefix+this.main).replace(/ /gu,"_")]}setFragment(l){L(this,n,l)}getUrl(l){throw new Error("Title.getUrl method is only available in the LSP version!")}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n=new WeakMap,r)}}),Qo={};te(Qo,{default:()=>_});Jo.exports=G(Qo);var Jt,_i,Te,$i,rl,_,B=T({"index.ts"(){ul(),Se(),Ue(),oe(),td(),Jt=!0,_i=Mi(),Te={config:Ci,i18n:void 0,rules:Di,get lintConfig(){return _i},set lintConfig(e){_i=Mi(e)},get viewOnly(){return Jt},set viewOnly(e){Jt&&!e&&ve.rev++,Jt=e},getConfig(e){const t=e!=null?e:this.config,{doubleUnderscore:s,ext:i,parserFunction:n,variable:r}=t;for(let l=0;l<2;l++)s.length>l+2&&s[l].length===0&&(s[l]=Object.keys(s[l+2]));return i.includes("translate")&&!r.includes("translationlanguage")&&(r.push("translationlanguage"),Array.isArray(n[1])?n[1].push("TRANSLATIONLANGUAGE"):n[1].TRANSLATIONLANGUAGE="translationlanguage"),ye(pe(pe({},Ci),t),{excludes:[]})},msg(e,t=""){var s,i;return e&&((i=(s=this.i18n)==null?void 0:s[e])!=null?i:e).replace("$1",this.msg(t))},normalizeTitle(e,t=0,s,i=Te.getConfig(),n){const{Title:r}=(sd(),G(Go));let l;if(n!=null&&n.halfParsed)l=new r(e,t,i,n);else{const{Token:o}=(O(),G(ns));l=ve.run(()=>{const a=new o(e,i);a.type="root",a.parseOnce(0,s).parseOnce();const h=new r(a.toString(),t,i,n);a.build();for(const d of["main","fragment"]){const u=h[d];if(u!=null&&u.includes("\0")){const g=a.buildFromStr(u,1);d==="main"?h.main=g:h.setFragment(g)}}return h})}return l},parse(e,t,s=xe,i=Te.getConfig()){e=gl(e);let n;typeof s!="number"&&(n=Array.isArray(s)?s:[s],s=Math.max(...n.map(o=>hl[o]||xe)));const{Token:r}=(O(),G(ns));return ve.run(()=>{const o=new r(e,i);return o.type="root",o.parse(s,t)})},async partialParse(e,t,s,i=Te.getConfig()){},createLanguageService(e={}){throw new Error("Parser.createLanguageService method is only available in the LSP version!")}},$i={},rl=new Set(["lintConfig","normalizeTitle","parse","createLanguageService"]);for(const e in Te)rl.has(e)||($i[e]={enumerable:!1});Object.defineProperties(Te,$i),Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:Te}),_=Te}});B()});id();})();
|