wikiparser-node 1.30.0 → 1.32.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/README.md +9 -4
- package/bundle/bundle-es8.min.js +28 -29
- package/bundle/bundle-lsp.min.js +34 -34
- package/bundle/bundle.min.js +23 -23
- package/dist/addon/attribute.js +166 -0
- package/dist/addon/link.js +92 -0
- package/dist/addon/table.js +12 -3
- package/dist/addon/token.js +5 -316
- package/dist/addon/transclude.js +11 -8
- package/dist/base.d.mts +13 -4
- package/dist/base.d.ts +13 -4
- package/dist/base.js +2 -0
- package/dist/base.mjs +2 -0
- package/dist/bin/config.js +1 -1
- package/dist/index.d.ts +34 -5
- package/dist/index.js +100 -88
- package/dist/internal.d.ts +6 -1
- package/dist/lib/document.d.ts +9 -7
- package/dist/lib/document.js +91 -66
- package/dist/lib/element.d.ts +8 -8
- package/dist/lib/element.js +52 -50
- package/dist/lib/lintConfig.js +6 -2
- package/dist/lib/lsp.js +120 -56
- package/dist/lib/node.js +21 -15
- package/dist/lib/redirectMap.js +1 -1
- package/dist/lib/text.js +17 -14
- package/dist/lib/title.d.ts +11 -0
- package/dist/lib/title.js +37 -13
- package/dist/mixin/elementLike.js +2 -3
- package/dist/mixin/syntax.js +13 -7
- package/dist/parser/commentAndExt.js +4 -4
- package/dist/parser/hrAndDoubleUnderscore.js +11 -9
- package/dist/parser/selector.js +16 -41
- package/dist/render/expand.js +216 -0
- package/dist/render/extension.js +141 -0
- package/dist/render/html.js +91 -0
- package/dist/render/magicWords.js +768 -0
- package/dist/render/syntaxhighlight.js +415 -0
- package/dist/src/arg.js +8 -1
- package/dist/src/atom.js +2 -0
- package/dist/src/attribute.d.ts +5 -0
- package/dist/src/attribute.js +59 -104
- package/dist/src/attributes.d.ts +5 -0
- package/dist/src/attributes.js +17 -51
- package/dist/src/converter.js +4 -2
- package/dist/src/converterFlags.js +8 -6
- package/dist/src/converterRule.js +19 -15
- package/dist/src/extLink.js +2 -2
- package/dist/src/heading.d.ts +1 -1
- package/dist/src/heading.js +5 -3
- package/dist/src/imageParameter.d.ts +0 -1
- package/dist/src/imageParameter.js +34 -24
- package/dist/src/index.d.ts +5 -5
- package/dist/src/index.js +37 -27
- package/dist/src/link/base.js +26 -36
- package/dist/src/link/category.d.ts +8 -1
- package/dist/src/link/category.js +104 -38
- package/dist/src/link/file.js +21 -8
- package/dist/src/link/galleryImage.js +2 -3
- package/dist/src/link/index.d.ts +1 -1
- package/dist/src/link/index.js +12 -33
- package/dist/src/multiLine/index.js +1 -1
- package/dist/src/nowiki/comment.js +1 -1
- package/dist/src/nowiki/doubleUnderscore.js +4 -2
- package/dist/src/nowiki/index.js +34 -31
- package/dist/src/nowiki/list.js +3 -1
- package/dist/src/nowiki/listBase.d.ts +2 -1
- package/dist/src/nowiki/listBase.js +22 -8
- package/dist/src/nowiki/quote.d.ts +1 -1
- package/dist/src/nowiki/quote.js +3 -3
- package/dist/src/onlyinclude.js +1 -1
- package/dist/src/paramLine.js +2 -0
- package/dist/src/parameter.js +1 -1
- package/dist/src/redirect.js +1 -1
- package/dist/src/table/base.js +5 -4
- package/dist/src/table/index.d.ts +1 -6
- package/dist/src/table/index.js +7 -16
- package/dist/src/table/td.js +12 -9
- package/dist/src/tag/html.js +2 -3
- package/dist/src/tag/index.js +8 -6
- package/dist/src/tagPair/ext.js +18 -41
- package/dist/src/tagPair/index.js +6 -4
- package/dist/src/tagPair/translate.d.ts +1 -0
- package/dist/src/tagPair/translate.js +10 -3
- package/dist/src/transclude.js +18 -21
- package/dist/util/constants.js +9 -3
- package/dist/util/debug.js +72 -5
- package/dist/util/diff.js +17 -15
- package/dist/util/html.js +14 -5
- package/dist/util/selector.js +37 -0
- package/dist/util/sharable.d.mts +4 -1
- package/dist/util/sharable.js +7 -7
- package/dist/util/sharable.mjs +7 -7
- package/dist/util/string.js +51 -20
- package/extensions/dist/base.js +2 -2
- package/extensions/editor.css +1 -1
- package/i18n/en.json +1 -0
- package/i18n/zh-hans.json +30 -29
- package/i18n/zh-hant.json +31 -30
- package/package.json +23 -16
- package/dist/addon/magicWords.js +0 -132
package/bundle/bundle-lsp.min.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
"use strict";(()=>{var ku=Object.defineProperty;var gr=e=>{throw TypeError(e)};var $u=(e,t,s)=>t in e?ku(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var _u=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ne=(e,t,s)=>$u(e,typeof t!="symbol"?t+"":t,s),ei=(e,t,s)=>t.has(e)||gr("Cannot "+s);var b=(e,t,s)=>(ei(e,t,"read from private field"),s?s.call(e):t.get(e)),R=(e,t,s)=>t.has(e)?gr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),E=(e,t,s,n)=>(ei(e,t,"write to private field"),n?n.call(e,s):t.set(e,s),s),j=(e,t,s)=>(ei(e,t,"access private method"),s);var pr=(e,t,s,n)=>({set _(r){E(e,t,r,s)},get _(){return b(e,t,n)}});var Nd=_u((Fd,Au)=>{var wa=Object.create,gt=Object.defineProperty,Sa=Object.getOwnPropertyDescriptor,Pn=Object.getOwnPropertyNames,Tu=Object.getPrototypeOf,Cu=Object.prototype.hasOwnProperty,Aa=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Ot=e=>{throw TypeError(e)},ka=(e,t,s)=>t in e?gt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,fr=(e,t)=>gt(e,"name",{value:t,configurable:!0}),I=(e,t)=>function(){return e&&(t=(0,e[Pn(e)[0]])(e=0)),t},On=(e,t)=>function(){return t||(0,e[Pn(e)[0]])((t={exports:{}}).exports,t),t.exports},ae=(e,t)=>{for(var s in t)gt(e,s,{get:t[s],enumerable:!0})},$a=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Pn(t))!Cu.call(e,r)&&r!==s&>(e,r,{get:()=>t[r],enumerable:!(n=Sa(t,r))||n.enumerable});return e},Iu=(e,t,s)=>(s=e!=null?wa(Tu(e)):{},$a(t||!e||!e.__esModule?gt(s,"default",{value:e,enumerable:!0}):s,e)),se=e=>$a(gt({},"__esModule",{value:!0}),e),oe=e=>{var t;return[,,,wa((t=e==null?void 0:e[Aa("metadata")])!=null?t:null)]},_a=["class","method","getter","setter","accessor","field","value","get","set"],Xt=e=>e!==void 0&&typeof e!="function"?Ot("Function expected"):e,Nu=(e,t,s,n,r)=>({kind:_a[e],name:t,metadata:n,addInitializer:i=>s._?Ot("Already initialized"):r.push(Xt(i||null))}),Bn=(e,t)=>ka(t,Aa("metadata"),e[3]),re=(e,t,s,n)=>{for(var r=0,i=e[t>>1],l=i&&i.length;r<l;r++)t&1?i[r].call(s):n=i[r].call(s,n);return n},le=(e,t,s,n,r,i)=>{var l,a,u,o,d,c=t&7,f=!!(t&8),g=!!(t&16),y=c>3?e.length+1:c?f?1:2:0,$=_a[c+5],k=c>3&&(e[y-1]=[]),_=e[y]||(e[y]=[]),T=c&&(!g&&!f&&(r=r.prototype),c<5&&(c>3||!g)&&Sa(c<4?r:{get[s](){return xe(this,i)},set[s](h){return Te(this,i,h)}},s));c?g&&c<4&&fr(i,(c>2?"set ":c>1?"get ":"")+s):fr(r,s);for(var p=n.length-1;p>=0;p--)o=Nu(c,s,u={},e[3],_),c&&(o.static=f,o.private=g,d=o.access={has:g?h=>Fu(r,h):h=>s in h},c^3&&(d.get=g?h=>(c^1?xe:mn)(h,r,c^4?i:T.get):h=>h[s]),c>2&&(d.set=g?(h,m)=>Te(h,r,m,c^4?i:T.set):(h,m)=>h[s]=m)),a=(0,n[p])(c?c<4?g?i:T[$]:c>4?void 0:{get:T.get,set:T.set}:r,o),u._=1,c^4||a===void 0?Xt(a)&&(c>4?k.unshift(a):c?g?i=a:T[$]=a:r=a):typeof a!="object"||a===null?Ot("Object expected"):(Xt(l=a.get)&&(T.get=l),Xt(l=a.set)&&(T.set=l),Xt(l=a.init)&&k.unshift(l));return c||Bn(e,r),T&>(r,s,T),g?c^4?i:T:r},Lu=(e,t,s)=>ka(e,typeof t!="symbol"?t+"":t,s),qn=(e,t,s)=>t.has(e)||Ot("Cannot "+s),Fu=(e,t)=>Object(t)!==t?Ot('Cannot use the "in" operator on this value'):e.has(t),xe=(e,t,s)=>(qn(e,t,"read from private field"),s?s.call(e):t.get(e)),Je=(e,t,s)=>t.has(e)?Ot("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),Te=(e,t,s,n)=>(qn(e,t,"write to private field"),n?n.call(e,s):t.set(e,s),s),mn=(e,t,s)=>(qn(e,t,"access private method"),s),Eu=(e,t,s,n)=>({set _(r){Te(e,t,r,s)},get _(){return xe(e,t,n)}}),Ta,cs,Wn=I({"base.ts"(){"use strict";Ta=(()=>{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})(),cs=(()=>{const e=["bold-header","format-leakage","fostered-content","h1","illegal-attr","insecure-style","invalid-gallery","invalid-imagemap","invalid-invoke","invalid-isbn","invalid-url","lonely-apos","lonely-bracket","lonely-http","nested-link","no-arg","no-duplicate","no-ignored","obsolete-attr","obsolete-tag","parsing-order","pipe-like","syntax-like","table-layout","tag-like","unbalanced-header","unclosed-comment","unclosed-quote","unclosed-table","unescaped","unknown-page","unmatched-tag","unterminated-url","url-encoding","var-anchor","void-ext"];return Object.freeze(e),e})()}});function Ee(e,t,s){return s===1?e.replace(/\0(\d+)g\x7F/gu,(n,r)=>Ee(String(t[r]),t,2)):s===2?e.replace(/\0(\d+)n\x7F/gu,(n,r)=>String(t[r])):e.replace(/\0(\d+)\x7F/gu,(n,r)=>t[r])}var Ye,ti,Ft,Et,jt,yt,hs,Ce,pt,mr,xr,gs,Ca,vr,br,ps,Rt,ve=I({"util/string.ts"(){"use strict";Ye=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,ti=String.raw`[^[\]<>"\0-\x1F\x7F${Ye}\uFFFD]`,Ft=String.raw`(?:\[[\da-f:.]+\]|${ti})`,Et=String.raw`(?:${ti}|\0\d+[cn!~]\x7F)*`,jt=e=>e.trim().toLowerCase(),yt=(e,t)=>s=>s.replace(e,t),hs=yt(/[\0\x7F]|\r$/gmu,""),Ce=yt(/\0\d+[cn]\x7F/gu,""),pt=(e,t="")=>e.map(s=>typeof s=="string"?s:s.text()).join(t),mr={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},xr=yt(/&(?:#(\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)):mr[s.toLowerCase()]),gs=e=>xr(e),Ca=yt(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),vr={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},br=e=>yt(e,t=>`&${vr[t]};`),ps=br(/[&<>]/gu),Rt=(e,t={})=>{const{pre:s="",post:n="",sep:r=""}=t;return s+e.map(i=>i.print()).join(r)+n}}}),ju=On({"i18n/en.json"(e,t){t.exports={"attributes-of-closing-tag":"attributes of a closing tag","bold-apostrophes":"bold apostrophes","bold-in-header":"bold text in a section header",close:null,"closing-and-self-closing":"tag that is both closing and self-closing",comment:null,"conflicting-image-parameter":"conflicting image $1 parameter","content-outside-table":"content to be moved outside the table",decode:null,delink:null,"duplicate-attribute":"duplicate $1 attribute","duplicate-category":"duplicate category","duplicate-id":"duplicate HTML id","duplicate-image-parameter":"duplicate image $1 parameter","duplicate-parameter":"duplicate template parameter",encode:null,escape:null,expand:null,"ext-in-html":"extension tag in HTML tag attributes",frame:null,"full-width-punctuation":"full-width punctuation","header-in-html":"section header in HTML tag attributes","header-like":"header-like syntax in plain text","horizontal-alignment":null,"html-in-table":"HTML tag in table attributes","illegal-attribute-name":"invalid attribute name","illegal-attribute-value":"invalid attribute value","illegal-module":"invalid Scribunto module name","imagemap-without-image":"<imagemap> without an image","in-url":"$1 in URL","inconsistent-table":"inconsistent table layout","insecure-style":"insecure style","invalid-attribute":"element containing an invalid attribute name","invalid-content":"invalid content in <$1>","invalid-conversion-flag":"invalid conversion flag","invalid-gallery":"invalid gallery image","invalid-image-parameter":"invalid image parameter","invalid-imagemap-link":"invalid link in <imagemap>","invalid-isbn":"invalid ISBN","invalid-parameter":"invalid parameter of <$1>","invalid-self-closing":"invalid self-closing tag","invalid-thumb":"invalid thumbnail filename","invalid-url":"invalid URL","invisible-triple-braces":"invisible content inside triple braces","italic-apostrophes":"italic apostrophes","left-bracket":"opening bracket","link-in-extlink":"internal link in an external link",lonely:'lonely "$1"',"missing-extension":"missing file extension","missing-function":"missing Scribunto module function name",newline:null,"no-self-closing":"no self-closing","nonzero-tabindex":"nonzero tabindex","nothing-in":"nothing should be in <$1>","obsolete-attribute":"obsolete attribute","obsolete-tag":"obsolete HTML tag",open:null,prefix:null,"pipe-in-link":'additional "|" in the link text',"pipe-in-table":'additional "|" in a table cell',"redirect-like":"redirect-like syntax in a list item","ref-in-link":"<ref> in an internal or external link",remove:null,"template-in-link":"template in an internal link target","unbalanced-in-section-header":"unbalanced $1 in a section header",unclosed:"unclosed $1","unclosed-comment":"unclosed HTML comment","unclosed-quotes":"unclosed quotes","unclosed-table":"unclosed table","unclosed-tag":"unclosed tag","unescaped-query":"unescaped query string in an anonymous parameter","unexpected-argument":"unexpected template argument","unmatched-closing":"unmatched closing tag","unnecessary-encoding":"unnecessary percent-encoding in an internal link",uppercase:null,"useless-attribute":"useless attribute","useless-fragment":"useless fragment","useless-link-text":"useless link text","variable-anchor":"variable anchor in a section header","vertical-alignment":null,whitespace:null}}}),Ru=On({"config/minimum.json"(e,t){t.exports={ext:[],html:[["b","bdi","del","i","ins","u","font","big","small","sub","sup","h1","h2","h3","h4","h5","h6","cite","code","em","s","strike","strong","tt","var","div","center","blockquote","ol","ul","dl","table","caption","pre","ruby","rb","rp","rt","rtc","p","span","abbr","dfn","kbd","samp","data","time","mark","tr","td","th","q","bdo"],["li","dt","dd"],["br","wbr","hr","meta","link"]],namespaces:{0:"",6:"File",10:"Template",14:"Category",828:"Module"},nsid:{"":0,file:6,template:10,category:14,module:828},functionHook:["msgnw"],variable:["!","=","pageid","articlepath","server","servername","scriptpath","stylepath"],parserFunction:[{msgnw:"msgnw",pageid:"pageid",articlepath:"articlepath",server:"server",servername:"servername",scriptpath:"scriptpath",stylepath:"stylepath","#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"formatdate","#dateformat":"formatdate","#invoke":"invoke","#while":"while","#dowhile":"dowhile","#loop":"loop","#forargs":"forargs","#fornumargs":"fornumargs","#if":"if","#ifeq":"ifeq","#switch":"switch","#ifexist":"ifexist","#ifexpr":"ifexpr","#iferror":"iferror","#time":"time","#timel":"timel","#expr":"expr","#rel2abs":"rel2abs","#titleparts":"titleparts","#categorytree":"categorytree","#urldecode":"urldecode","#choose":"choose","#var":"var","#varexists":"varexists","#var_final":"var_final","#vardefine":"vardefine","#vardefineecho":"vardefineecho","#widget":"widget","#related":"related","#regex":"regex","#regex_var":"regex_var","#regexquote":"regexquote","#regexall":"regexall","#len":"len","#pos":"pos","#rpos":"rpos","#sub":"sub","#count":"count","#rmatch":"rmatch","#rreplace":"rreplace","#replace":"replace","#rsplit":"rsplit","#explode":"explode","#tab":"tab","#seo":"seo","#babel":"babel","#translation":"translation","#commaseparatedlist":"commaseparatedlist","#coordinates":"coordinates","#lst":"lst","#lsth":"lsth","#lstx":"lstx","#assessment":"assessment","#mentor":"mentor","#property":"property","#target":"target","#section":"lst","#section-x":"lstx","#section-h":"lsth","#statements":"statements","#useliquidthreads":"useliquidthreads","#lqtpagelimit":"lqtpagelimit","#avatar":"avatar","#img":"img","#chart":"chart"},{"!":"!","=":"=","#FORMAL":"formal","#bcp47":"bcp47","#dir":"dir","#interwikilink":"interwikilink","#interlanguagelink":"interlanguagelink","#contentmodel":"contentmodel","#timef":"timef","#timefl":"timefl"},["msg","raw"],["subst","safesubst"]],doubleUnderscore:[[],[]],protocol:"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|matrix:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|wikipedia://|worldwind://|xmpp:",interwiki:[],img:{},redirection:["#redirect"],variants:[]}}}),ke,Ia,xn,He=I({"util/constants.ts"(){"use strict";ke=11,Ia=ju(),xn=Ru()}});function ct(e){const t=new Map,s=new WeakMap;return n=>{const r=typeof n=="string"?t:s;if(r.has(n)){const l=r.get(n);return l.lastIndex=0,l}const i=e(n);return r.set(n,i),i}}var fs,Na,yr,La,et=I({"../common/dist/index.mjs"(){"use strict";fs=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25")),Na=e=>Math.round(e*255).toString(16).padStart(2,"0"),yr=(()=>{const e=String.raw`#(?:[\da-f]{3,4}|(?:[\da-f]{2}){3,4})(?![\p{L}\p{N}_])`,t=String.raw`(?:\d*\.)?\d+%?`,s=String.raw`(?:\d*\.)?\d+(?:deg|grad|rad|turn)?`,n=String.raw`rgba?\(\s*(?:${String.raw`${new Array(3).fill(t).join(String.raw`\s+`)}(?:\s*\/\s*${t})?`}|${String.raw`${new Array(3).fill(t).join(String.raw`\s*,\s*`)}(?:\s*,\s*${t})?`})\s*\)`,r=String.raw`hsla?\(\s*(?:${String.raw`${s}\s+${t}\s+${t}(?:\s*\/\s*${t})?`}|${String.raw`${s}${String.raw`\s*,\s*(?:\d*\.)?\d+%`.repeat(2)}(?:\s*,\s*${t})?`})\s*\)`;return{full:new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${e}|${n}|${r})`,"giu"),rgb:new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${e}|${n})`,"giu")}})(),La=(e,t=!0)=>{const s=[],n=yr[t?"full":"rgb"];n.lastIndex=0;let r=n.exec(e),i=0;for(;r;){const l=r.index+r[1].length;l>i&&s.push([e.slice(i,l),i,l,!1]),{lastIndex:i}=n,s.push([r[2],l,i,e[l-1]!=="&"||!/^#\d+$/u.test(r[2])]),r=n.exec(e)}return e.length>i&&s.push([e.slice(i),i,e.length,!1]),s}}}),pe,be=I({"lib/rect.ts"(){"use strict";var e,t,s,n,vn,i;pe=(i=class{constructor(l,a){R(this,n);R(this,e);R(this,t);R(this,s);E(this,e,l),E(this,t,a)}get start(){return b(this,t)}get top(){return j(this,n,vn).call(this).top}get left(){return j(this,n,vn).call(this).left}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n=new WeakSet,vn=function(){var l;return(l=b(this,s))!=null||E(this,s,b(this,e).getRootNode().posFromIndex(b(this,t))),b(this,s)},i)}}),wr,Sr,us,ms,si,Q,Z,Be,Hs,ee,Un,Ze,Mn,zn,Hn,xs,Pt,Dn,ht,Gn,X=I({"util/lint.ts"(){"use strict";et(),Re(),be(),D(),wr=new Set(["tr","td","th","caption"]),Sr=new Set(["Template:!!","Template:!-"]),us=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")&&Sr.has(t.name)||t.is("html")&&wr.has(t.name))return!1;if(t.is("arg"))return t.length>1&&us(t.childNodes[1]);if(t.is("magic-word"))try{const s=t.getPossibleValues().map(us);return s.includes(2)?2:s.includes(1)&&1}catch{}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?1:2},ms=(e,t,s,n)=>({line:e+s-1,character:(s===1?t:0)+n}),si=e=>(t,s,n,r,i="error")=>{const{start:l}=s,{top:a,left:u}=s instanceof pe?s:new pe(t,l),{offsetHeight:o,offsetWidth:d}=t,{startIndex:c,startLine:f,startCol:g}=e(t,l,a,u),{line:y,character:$}=ms(f,g,o,d);return{rule:n,message:N.msg(r),severity:i,startIndex:c,endIndex:c+t.toString().length,startLine:f,endLine:y,startCol:g,endCol:$}},Q=si((e,t,s,n)=>{const r=e.getRelativeIndex(),{top:i,left:l}=e.parentNode.posFromIndex(r);return{startIndex:t+r,startLine:s+i,startCol:i?l:n+l}}),Z=si((e,t,s,n)=>({startIndex:t,startLine:s,startCol:n})),Be=(e,t,s,n=0)=>({desc:N.msg(t),range:[e.startIndex+n,e.endIndex],text:s}),Hs=(e,t,s)=>({desc:N.msg(t),range:[e,e],text:s}),ee=(e,t=0,s="")=>typeof e=="number"?{desc:N.msg("remove"),range:[e,e+t],text:s}:Be(e,"remove",s,t),Un=(e,t)=>Be(e,"decode",fs(t.text().replace(/%(?=21|3[ce]|5[bd]|7[b-d])/giu,"%25"))),Ze=(e,t,s=0)=>({desc:N.msg("close"),range:[e+s,e],text:t}),Mn=e=>({desc:N.msg("open"),range:[e+1,e+2],text:""}),zn=(e,t)=>Be(e,"comment",`<!--${t}-->`),Hn=(e,t)=>Be(e,"uppercase",t.toUpperCase()),xs=(e,t=0)=>({desc:N.msg("whitespace"),range:[e,e+t],text:" "}),Pt=(e,t,s=1)=>({desc:N.msg("escape"),range:[e,e+s],text:t.repeat(s)}),Dn=(e,t)=>({desc:N.msg("escape"),range:[e,e+t.length],text:t.replace(/\|/gu,"|")}),ht=(e,t,s,n)=>{if(e&&(n||N.viewOnly&&e[0]===we.rev))return e[1];const r=t();return(n||N.viewOnly)&&s([we.rev,r]),r},Gn=(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"]:[]}}),Ar,Vn,Fa=I({"parser/selector.ts"(){"use strict";Ar=e=>{if(e.includes("#")){const t=e.indexOf("#"),s=e.slice(0,t),n=e.slice(t+1);return(r,i)=>(t===0||r===s)&&i===n}return e?t=>t===e:()=>!0},Vn=(e,t,s)=>{const n=e.split(",").map(r=>Ar(r.trim()));return(({type:r,name:i})=>n.some(l=>l(r,i)))}}}),Pu=On({"../node_modules/binary-search/index.js"(e,t){t.exports=function(s,n,r,i,l){var a,u;if(i===void 0)i=0;else if(i=i|0,i<0||i>=s.length)throw new RangeError("invalid lower bound");if(l===void 0)l=s.length-1;else if(l=l|0,l<i||l>=s.length)throw new RangeError("invalid upper bound");for(;i<=l;)if(a=i+(l-i>>>1),u=+r(s[a],n,a,s),u<0)i=a+1;else if(u>0)l=a-1;else return a;return~i}}}),kr,Ea,Ou=I({"util/search.ts"(){"use strict";kr=Iu(Pu()),Ea=(e,t,s)=>{const n=(0,kr.default)(e,t,s);return n<0?~n:n}}}),Ds,Qn=I({"mixin/cached.ts"(){"use strict";X(),Ds=(e=!0)=>t=>{const s=new WeakMap;return function(...n){return ht(s.get(this),()=>t.apply(this,n),r=>{s.set(this,r)},e)}}}}),ja,Bu=I({"mixin/nodeLike.ts"(){"use strict";ja=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}}}),$r,_r,Ss,Wt,Ut,As,Mt,zt,Ht,at,Ra=I({"lib/node.ts"(){"use strict";Ou(),X(),Re(),Qn(),Bu(),D(),_r=[ja],$r=[Ds(!1)],at=class{constructor(){re(Ht,5,this),Lu(this,"childNodes",[]),Je(this,Ss),Je(this,Wt),Je(this,Ut),Je(this,As),Je(this,Mt),Je(this,zt,{})}get parentNode(){return xe(this,Ss)}get nextSibling(){return xe(this,Wt)}get previousSibling(){return xe(this,Ut)}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":Te(this,Ss,t),t||(Te(this,Wt,void 0),Te(this,Ut,void 0));break;case"nextSibling":Te(this,Wt,t);break;case"previousSibling":Te(this,Ut,t);break;case"aIndex":N.viewOnly&&Te(this,Mt,[we.rev,t]);break;default:this[e]=t}}getRootNode(){return ht(xe(this,As),()=>{var e,t;return(t=(e=this.parentNode)==null?void 0:e.getRootNode())!=null?t:this},e=>{const[,t]=e;t.type==="root"&&Te(this,As,e)})}indexFromPos(e,t){{if(e<0||t<0)return;const s=this.getLines();if(e>=s.length)return;const[,n,r]=s[e],i=n+t;return i>r?void 0:i}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=Ea(s,e,([,,r],i)=>r-i);return{top:n,left:e-s[n][1]}}return}}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 ht(xe(this,zt)[e],()=>{const{childNodes:t}=this,s=e+(e<0?t.length:0);let n=this.getAttribute("padding");for(let r=0;r<s;r++)N.viewOnly&&(xe(this,zt)[r]=[we.rev,n]),n+=t[r].toString().length+this.getGaps(r);return n},t=>{xe(this,zt)[e]=t})}getAbsoluteIndex(){return ht(xe(this,Mt),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{Te(this,Mt,e)})}getBoundingClientRect(){return{...this.getDimension(),...this.getRootNode().posFromIndex(this.getAbsoluteIndex())}}is(e){return this.type===e}getLines(){{const e=[];let t=0;for(const s of String(this).split(`
|
|
2
|
-
`)){const 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!`)}},Ht=oe(null),Ss=new WeakMap,Wt=new WeakMap,Ut=new WeakMap,As=new WeakMap,Mt=new WeakMap,zt=new WeakMap,le(Ht,1,"getLines",$r,at),at=le(Ht,0,"AstNode",_r,at),re(Ht,1,at)}}),Pa,qu=I({"mixin/elementLike.ts"(){"use strict";Fa(),Pa=e=>{var t,bn;{class n extends e{constructor(){super(...arguments);R(this,t)}getElementBy(l){const a=[...this.childNodes].reverse();for(;a.length>0;){const u=a.pop(),{type:o,childNodes:d}=u;if(o!=="text"){if(l(u))return u;for(let c=d.length-1;c>=0;c--)a.push(d[c])}}}querySelector(l){return this.getElementBy(j(this,t,bn).call(this,l))}getElementsBy(l){const a=[...this.childNodes].reverse(),u=[];for(;a.length>0;){const o=a.pop(),{type:d,childNodes:c}=o;if(d!=="text"){l(o)&&u.push(o);for(let f=c.length-1;f>=0;f--)a.push(c[f])}}return u}querySelectorAll(l){return this.getElementsBy(j(this,t,bn).call(this,l))}escape(){for(const l of this.childNodes)l.escape()}}return t=new WeakSet,bn=function(l){return Vn(l,this)},n}}}}),Tr,ii,Cr,Kt,Wu=I({"lib/element.ts"(){"use strict";ve(),Re(),Fa(),Ra(),qu(),Tr=[Pa],Kt=class extends(Cr=at){get length(){return this.childNodes.length}text(e){return pt(this.childNodes,e)}normalize(){const e=this.getChildNodes(),t=s=>{var n,r;e.splice(s,1),(n=e[s-1])==null||n.setAttribute("nextSibling",e[s]),(r=e[s])==null||r.setAttribute("previousSibling",e[s-1])};for(let s=e.length-1;s>=0;s--){const{type:n,data:r}=e[s];n!=="text"||e.length===1||this.getGaps(s-(s&&1))||r===""&&t(s)}this.setAttribute("childNodes",e)}removeAt(e){return bs(this,e,1)[0]}insertAt(e,t=this.length){return bs(this,t,0,[e]),e}closest(e){const t=Vn(e,this);let{parentNode:s}=this;for(;s;){if(t(s))return s;({parentNode:s}=s)}}append(...e){this.safeAppend(e)}safeAppend(e){for(const t of e)this.insertAt(t)}safeReplaceChildren(e){for(let t=this.length-1;t>=0;t--)this.removeAt(t);this.safeAppend(e)}setText(e,t=0){t+=t<0?this.length:0;const s=this.childNodes[t],{data:n}=s;return s.replaceData(e),n}toString(e,t=""){return this.childNodes.map(s=>s.toString(e)).join(t)}caretPositionFromIndex(e){{if(e===void 0)return;const{length:t}=this.toString();if(e>t||e<-t)return;e+=e<0?t:0;let s=this,n=0,r=0;for(;s.type!=="text";){const{childNodes:i}=s;n+=s.getAttribute("padding");for(let l=0;n<=e&&l<i.length;l++){const a=i[l],{nextSibling:u}=a,o=a.toString(),d=o.length;if(a.setAttribute("aIndex",n),n+=d,n>e||n===e&&d>0&&(!u||u.type==="text"||a.type!=="text"&&(o.trim()||!u.toString().trim()))){s=a,n-=d,r=n;break}n+=s.getGaps(l)}if(s.childNodes===i)return{offsetNode:s,offset:e-r}}return{offsetNode:s,offset:e-r}}this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(e){var t;{const s=(t=this.caretPositionFromIndex(e))==null?void 0:t.offsetNode;return(s==null?void 0:s.type)==="text"?s.parentNode:s}this.lspError("AstElement.elementFromIndex")}elementFromPoint(e,t){return this.elementFromIndex(this.indexFromPos(t,e))}lint(e=this.getAbsoluteIndex(),t){{const s=[];for(let n=0,r=e+this.getAttribute("padding");n<this.length;n++){const i=this.childNodes[n];i.setAttribute("aIndex",r);const l=i.lint(r,t);l.length>0&&Array.prototype.push.apply(s,l),r+=i.toString().length+this.getGaps(n)}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":""}">`)+Rt(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){{const s={...this,type:this.type,range:[t,t+this.toString().length],childNodes:[]};for(let n=0,r=t+this.getAttribute("padding");n<this.length;n++){const i=this.childNodes[n],{length:l}=i.toString();i.setAttribute("aIndex",r),s.childNodes.push(i.type==="text"?{data:i.data,range:[r,r+l]}:i.json(void 0,r)),r+=l+this.getGaps(n)}return s}}},ii=oe(Cr),Kt=le(ii,0,"AstElement",Tr,Kt),re(ii,1,Kt)}}),ys,Gs=I({"mixin/gapped.ts"(){"use strict";ys=(e=1)=>t=>{class s extends t{getGaps(){return e}}return s}}}),Ue,De=I({"mixin/noEscape.ts"(){"use strict";Ue=e=>{{class t extends e{escape(){}}return t}}}}),Ir,Oa,Uu=I({"src/parameter.ts"(){"use strict";ve(),X(),D(),J(),Ir=new RegExp(`https?://${Ft}${Et}$`,"iu"),Oa=class extends z{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){var e;try{return!!((e=this.parentNode)!=null&&e.getDuplicatedArgs().some(([t])=>t===this.name))}catch{return!1}}constructor(e,t,s,n=[]){super(void 0,s,n);const r=new z(typeof e=="number"?void 0:e,s,n,{}),i=new z(t,s,n);r.type="parameter-key",r.setAttribute("stage",2),i.type="parameter-value",i.setAttribute("stage",2),this.append(r,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 s;{const n=super.lint(e,t),r="unescaped",{lintConfig:i}=N,l=i.getSeverity(r);if(l){const{firstChild:a}=this,u=(s=Ir.exec(a.text()))==null?void 0:s[0];try{if(u&&new URL(u).search){const o=Q(a,{start:e},r,"unescaped-query",l);o.startIndex=o.endIndex,o.startLine=o.endLine,o.startCol=o.endCol,o.endIndex++,o.endCol++,(i.computeEditInfo||i.fix)&&(o.fix=Pt(o.startIndex,"{{=}}")),n.push(o)}}catch{}}return n}}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}}}}}),We,ft=I({"src/atom.ts"(){"use strict";var e,t;J(),We=(t=class extends z{constructor(n,r,i,l,a){super(n,i,l,a);R(this,e);E(this,e,r)}get type(){return b(this,e)}set type(n){E(this,e,n)}getAttribute(n){var r;return n==="invalid"?this.type==="converter-flag"&&!!((r=this.parentNode)!=null&&r.isInvalidFlag(this)):super.getAttribute(n)}},e=new WeakMap,t)}}),ze,mt=I({"src/syntax.ts"(){"use strict";var e,t;J(),ze=(t=class extends z{constructor(n,r,i,l,a){super(n,i,l,a);R(this,e);E(this,e,r)}get type(){return b(this,e)}lint(n=this.getAbsoluteIndex()){return super.lint(n,!1)}},e=new WeakMap,t)}}),Ba={};ae(Ba,{TranscludeToken:()=>ot});var Nr,ni,Lr,ot,qa=I({"src/transclude.ts"(){"use strict";var e,t,s,n,r,i,Yt,Wa,u;ve(),X(),Re(),be(),Gs(),De(),D(),J(),Uu(),ft(),mt(),Nr=[Ue,ys()],ot=(u=class extends(Lr=z){constructor(d,c,f,g=[]){var A,C;let y;const $=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(d);$&&(y=Number($[1]),d=d.replace(`\0${y}h`,g[y].toString().replace(/^\n/u,"")));super(void 0,f,g,{});R(this,i);Ne(this,"modifier","");R(this,e,"template");R(this,t,":");R(this,s,!1);R(this,n,new Map);R(this,r);const{parserFunction:[k,_],variable:T,functionHook:p}=f,h=(A=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(d))==null?void 0:A[0];if(h)this.setAttribute("modifier",h),d=d.slice(h.length);else if(d.includes(":")){const[L,...B]=d.split(":"),[q]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((C=B[0])!=null?C:"");this.setModifier(`${L}:${q}`)&&(d=B.join(":").slice(q.length))}const m=d.search(/[::]/u),x=d[m]===":",S=m!==-1;if(S||c.length===0&&!b(this,s)){const L=S?d.slice(0,m):d,B=S&&d.slice(m+1),q=Ce(L),O=S?q.slice(q.search(/\S/u))+(x?":":""):q.trim(),W=O.toLowerCase(),F=Array.isArray(_),P=F?_.includes(O):Object.prototype.hasOwnProperty.call(_,O),U=!F&&P?_[O]:Object.prototype.hasOwnProperty.call(k,W)&&k[W],M=F&&P||!("functionHook"in f)||p.includes(U),ie=F&&P||T.includes(U);if(S?U&&M:ie){this.setAttribute("name",U||W.replace(/^#|:$/u,"")),E(this,e,"magic-word"),x&&E(this,t,":");const H=new ze(L,"magic-word-name",f,g);if(super.insertAt(H),B!==!1&&c.unshift([B]),this.name==="invoke")for(let G=0;G<2;G++){const K=c.shift();if(!K)break;const ue=new We(K.join("="),`invoke-${G?"function":"module"}`,f,g);super.insertAt(ue)}}}if(this.type==="template"){const L=Ce(d).trim();if(!this.normalizeTitle(L,10,{halfParsed:!0,temporary:!0}).valid)throw g.pop(),new SyntaxError("Invalid template name");const B=new We(d,"template-name",f,g,{});super.insertAt(B)}typeof y=="number"&&(g[y]=void 0);const v=this.isTemplate();let w=1;for(let L=0;L<c.length;L++){const B=c[L];v||this.name==="switch"&&L>0||this.name==="tag"&&L>1||(B[0]=B.join("="),B.length=1),B.length===1&&(B.unshift(w),w++),this.insertAt(new Oa(...B,f,g))}this.seal("modifier")}get type(){return b(this,e)}get module(){return this.type==="magic-word"&&this.name==="invoke"?j(this,i,Yt).call(this).title:void 0}get function(){var d;return this.type==="magic-word"&&this.name==="invoke"?(d=this.childNodes[2])==null?void 0:d.text().trim():void 0}setModifier(d){const{parserFunction:[,,c,f]}=this.getAttribute("config"),g=Ce(d).trim();if(d&&!g.endsWith(":"))return!1;const y=g.slice(0,-1).toLowerCase(),$=c.includes(y),k=f.includes(y);return(b(this,s)?$:k||!d)||(we.running||this.length>1)&&($||k||!d)?(this.setAttribute("modifier",d),E(this,s,$),!!d):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0)),super.afterBuild(),this.isTemplate()&&this.type==="template"&&(E(this,r,j(this,i,Yt).call(this)),this.setAttribute("name",b(this,r).title))}toString(d){const{childNodes:c,length:f,firstChild:g,modifier:y,type:$}=this;return`{{${y}${$==="magic-word"?g.toString(d)+(f===1?"":b(this,t))+c.slice(1).map(k=>k.toString(d)).join("|"):super.toString(d,"|")}}}`}text(){const{childNodes:d,length:c,firstChild:f,modifier:g,type:y,name:$}=this;return y==="magic-word"&&$==="vardefine"?"":`{{${g}${y==="magic-word"?f.text()+(c===1?"":b(this,t))+pt(d.slice(1),"|"):super.text("|")}}}`}getAttribute(d){switch(d){case"padding":return this.modifier.length+2;case"title":return b(this,r);case"colon":return b(this,t);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!j(this,i,Yt).call(this).valid);default:return super.getAttribute(d)}}lint(d=this.getAbsoluteIndex(),c){{const f=super.lint(d,c);if(!this.isTemplate())return f;const{type:g,childNodes:y,length:$}=this,k=new pe(this,d),{lintConfig:_}=N,{computeEditInfo:T}=_,p=g==="magic-word";let h="no-ignored",m=_.getSeverity(h,"fragment");if(p&&!j(this,i,Yt).call(this).valid)h="invalid-invoke",m=_.getSeverity(h,"name"),m&&f.push(Q(y[1],k,h,"illegal-module",m));else if(m){const x=y[p?1:0],S=x.childNodes.findIndex(w=>w.type==="text"&&gs(w.data).includes("#")),v=x.childNodes[S];if(v){const w=Q(x,k,h,"useless-fragment",m);T&&(w.suggestions=[ee(w,x.getRelativeIndex(S)+v.data.indexOf("#"))]),f.push(w)}}if(h="invalid-invoke",m=_.getSeverity(h,"function"),m&&p&&$===2)return f.push(Z(this,k,h,"missing-function",m)),f;if(h="no-duplicate",m=_.getSeverity(h,"parameter"),m){const x=this.getDuplicatedArgs().filter(([,v])=>!v[0].querySelector("ext")),S="duplicate-parameter";for(const[,v]of x)Array.prototype.push.apply(f,v.map(w=>{const A=Q(w,k,h,S,m);return T&&(A.suggestions=[ee(A,-1)]),A}))}return f}}insertAt(d,c=this.length){return super.insertAt(d,c),d.anon?j(this,i,Wa).call(this,d):d.name&&this.getArgs(d.name,!1,!1).add(d),d}getAllArgs(){return this.childNodes.filter(Zs("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:d})=>d)}getArgs(d,c,f=!0){const g=String(d).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");let y;return b(this,n).has(g)?y=b(this,n).get(g):(y=new Set(this.getAllArgs().filter(({name:$})=>g===$)),b(this,n).set(g,y)),y}getDuplicatedArgs(){return[...b(this,n)].filter(([,{size:d}])=>d>1).map(([d,c])=>[d,[...c]])}getPossibleValues(){const{type:d,name:c,childNodes:f}=this;if(d==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let g,y;switch(c){case"if":case"ifexist":case"ifexpr":case"iferror":g=2;break;case"ifeq":g=3;break;case"switch":{const $=f.slice(2),k=$[$.length-1];y=[...$.filter(({anon:_})=>!_),...k!=null&&k.anon?[k]:[]].map(({lastChild:_})=>_);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}y!=null||(y=f.slice(g,g+2).map(({lastChild:$})=>$));for(let $=0;$<y.length;){const{length:k,0:_}=y[$].childNodes.filter(T=>T.text().trim());if(k===0)y.splice($,1);else if(k>1||_.type!=="magic-word")$++;else try{const T=_.getPossibleValues();Array.prototype.splice.apply(y,[$,1,...T]),$+=T.length}catch{$++}}return y}print(){const{childNodes:d,length:c,firstChild:f,modifier:g,type:y}=this;return`<span class="wpb-${y}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${y==="magic-word"?ps(g)+f.print()+(c===1?"":b(this,t))+Rt(d.slice(1),{sep:"|"}):(g?`<span class="wpb-magic-word">${ps(g)}</span>`:"")+Rt(d,{sep:"|"})}}}</span>`}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n=new WeakMap,r=new WeakMap,i=new WeakSet,Yt=function(){const d=this.type==="template";return this.normalizeTitle((d?"":"Module:")+this.childNodes[d?0:1].text(),10,{temporary:!0,...!d&&{page:""}})},Wa=function(d){const c=this.getAnonArgs(),f=typeof d!="number";for(let g=f?c.indexOf(d):d-1;g<c.length;g++){const y=c[g],{name:$}=y,k=String(g+1);($!==k||y===d)&&(y.setAttribute("name",k),this.getArgs(k,!1,!1).add(y))}},u),ni=oe(Lr),ot=le(ni,0,"TranscludeToken",Nr,ot),re(ni,1,ot)}}),ks,ri,Fr,Er,jr,Rr,li,Pr,yn,Mu=I({"lib/text.ts"(){"use strict";var e,wn,s;ve(),X(),Re(),D(),Ra(),ks=String.raw`[${Ye}\t]*`,ri=String.raw`<(?:/[^\S\n]*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|\n={2,}`,Fr=new RegExp(String.raw`${ri}|https?[:/]/+|(?:rfc|pmid)(?=[-::]?${ks}\d)|isbn(?=[-::]?${ks}(?:\d(?:${ks}|-)){6})`,"giu"),Er=new RegExp(ri,"giu"),jr=new Set(["attr-value","ext-link-text","link-text"]),Rr={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},li=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"]),Pr=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch{return/\w/u}})(),yn=(s=class extends at{constructor(i){super();R(this,e);Ne(this,"data","");this.data=i}get type(){return"text"}toString(i){var l;return i&&!((l=this.parentNode)!=null&&l.getAttribute("built"))?Ce(this.data):this.data}text(){return this.data}lint(i=this.getAbsoluteIndex(),l){var a,u,o;{if(l===!1)return[];const{data:d,parentNode:c,nextSibling:f,previousSibling:g}=this;if(!c)throw new Error("An isolated text node cannot be linted!");const{type:y,parentNode:$}=c;if(y==="attr-value"){const{name:O,tag:W}=$;if(W==="ref"&&(O==="name"||O==="follow")||O==="group"&&(W==="ref"||W==="references")||W==="choose"&&(O==="before"||O==="after"))return[]}if(l!=null||(l=c.isPlain()&&!jr.has(y)?Fr:Er),d.search(l)===-1)return[];l.lastIndex=0;const k=[],_=f==null?void 0:f.type,T=f==null?void 0:f.name,p=g==null?void 0:g.type,h=this.getRootNode(),m=h.toString(),{ext:x,html:S,variants:v}=h.getAttribute("config"),{top:w,left:A}=h.posFromIndex(i),{lintConfig:C}=N,L=C.rules["tag-like"],B=typeof L=="object"&&L[1]?new Set(Object.keys(L[1]).filter(O=>O!=="invalid"&&O!=="disallowed")):new Set,q=new Set(["onlyinclude","noinclude","includeonly",...x,...S[0],...S[1],...S[2],...B,...C.getSeverity("tag-like","disallowed")?li:[]]);for(let O=l.exec(d);O;O=l.exec(d)){const[,W,F]=O;let{index:P,0:U}=O;if(F&&F!=="]"){const{length:me}=F;P+=me,U=U.slice(me)}else U.startsWith(`
|
|
3
|
-
==`)&&(P++,U=U.slice(1));U=U.toLowerCase();const[M]=U,ie=M==="r"||M==="p"||M==="i",H=M==="{",
|
|
4
|
-
`,P);let
|
|
5
|
-
`),Pe!==-1));)Le=Le.nextSibling;if(!Le)continue;Me=Le.data.slice(0,Pe)}else Me=d.slice(P+de,me);if(!/(?:^|[^=])=+\s*(?:\S\s*)?$/u.test(Me))continue;me===-1?(ne=Le.getAbsoluteIndex()+Me.length,{top:V,left:Y}=h.posFromIndex(ne)):(ne+=Me.length,de+=Me.length)}const nt={rule:he,message:N.msg(M==="="?"header-like":"lonely",ie||M==="h"||Ve||$e?U:M),severity:ye,startIndex:ce,endIndex:ne,startLine:it,endLine:V!=null?V:it,startCol:qt,endCol:Y!=null?Y:qt+de};if(C.computeEditInfo)if(M==="<")nt.suggestions=[Pt(ce,"<")];else if(M==="h"&&y!=="link-text"&&Pr.test(Se||""))nt.suggestions=[xs(ce)];else if(K&&y==="ext-link-text"){const me=c.getAbsoluteIndex()+c.toString().length;nt.suggestions=[Pt(me,"]")]}else if(ue&&bt){const me=i-g.toString().length;nt.suggestions=[Hs(me,"left-bracket","[")]}else ie&&(nt.suggestions=[...O[0]===U?[]:[Hn(nt,U)],...fe===":"||fe===":"?[xs(ne,1)]:[]]);k.push(nt)}return k}}replaceData(i){j(this,e,wn).call(this,i)}splitText(i){{const{parentNode:l,data:a}=this;if(!l)throw new Error("The text node to be split has no parent node!");const u=new s(a.slice(i));return bs(l,l.childNodes.indexOf(this)+1,0,[u]),this.setAttribute("data",a.slice(0,i)),u}this.lspError("AstText.splitText")}escape(){{const{parentNode:i}=this;if(!i)throw new Error("The text node to be escaped has no parent node!");const{TranscludeToken:l}=(qa(),se(Ba)),a=i.getAttribute("config"),u=i.childNodes.indexOf(this)+1,o=f=>Math.max(this.data.lastIndexOf("=",f),this.data.lastIndexOf("|",f));let d=o();const c=(()=>new l(this.data[d]==="="?"=":"!",[],a));for(;d>=0;d=o(d-1))d<this.data.length-1&&this.splitText(d+1),i.insertAt(we.run(c),u),j(this,e,wn).call(this,this.data.slice(0,d))}}print(){return ps(this.data)}},e=new WeakSet,wn=function(i){this.setAttribute("data",i)},s)}}),tt,xt=I({"mixin/hidden.ts"(){"use strict";tt=(e=!0,t=!0)=>s=>{class n extends s{text(){return""}lint(i){return e?[]:super.lint(i)}}return n}}}),Ge,st=I({"mixin/padded.ts"(){"use strict";Ge=({length:e})=>t=>{class s extends t{getAttribute(r){return r==="padding"?e:super.getAttribute(r)}}return s}}}),Or,Br,ai,qr,Xe,Vs=I({"src/link/base.ts"(){"use strict";var e,t,s,n;X(),He(),be(),st(),De(),D(),J(),ft(),Or=r=>r==="redirect-target"||r==="link",Br=[Ue,Ge("[[")],Xe=(n=class extends(qr=z){constructor(i,l,a,u=[],o="|"){super(void 0,a,u,{});R(this,e,!0);R(this,t);R(this,s);if(this.insertAt(new We(i,"link-target",a,u,{})),l!==void 0){const d=new z(l,a,u,{});d.type="link-text",d.setAttribute("stage",ke-1),this.insertAt(d)}E(this,t,o)}get link(){return b(this,s)}get fragment(){return b(this,s).fragment}afterBuild(){E(this,s,this.getTitle()),b(this,t).includes("\0")&&E(this,t,this.buildFromStr(b(this,t),0)),this.setAttribute("name",b(this,s).title),super.afterBuild()}setAttribute(i,l){i==="bracket"?E(this,e,l):i==="title"?E(this,s,l):super.setAttribute(i,l)}toString(i){const l=super.toString(i,b(this,t));return b(this,e)?`[[${l}]]`:l}text(){const i=super.text("|");return b(this,e)?`[[${i}]]`:i}getAttribute(i){return i==="title"?b(this,s):super.getAttribute(i)}getGaps(i){return i===0?b(this,t).length:1}lint(i=this.getAbsoluteIndex(),l){{const a=super.lint(i,l),{childNodes:[u,o],type:d}=this,{encoded:c,fragment:f}=b(this,s),{lintConfig:g}=N,{computeEditInfo:y,fix:$}=g,k=new pe(this,i);let _="unknown-page",T=g.getSeverity(_);if(T&&u.childNodes.some(({type:p})=>p==="template")&&a.push(Q(u,k,_,"template-in-link",T)),_="url-encoding",T=g.getSeverity(_),T&&c){const p=Q(u,k,_,"unnecessary-encoding",T);(y||$)&&(p.fix=Un(p,u)),a.push(p)}if(_="pipe-like",T=g.getSeverity(_,"link"),T&&(d==="link"||d==="category")){const p=o==null?void 0:o.childNodes.findIndex(m=>m.type==="text"&&m.data.includes("|")),h=o==null?void 0:o.childNodes[p];if(h){const m=Q(o,k,_,"pipe-in-link",T);if(y){const x=m.startIndex+o.getRelativeIndex(p);m.suggestions=[Dn(x,h.data)]}a.push(m)}}if(_="no-ignored",T=g.getSeverity(_,"fragment"),T&&f!==void 0&&!Or(d)){const p=Q(u,k,_,"useless-fragment",T);if(y||$){const h=u.childNodes.findIndex(x=>x.type==="text"&&x.data.includes("#")),m=u.childNodes[h];m&&(p.fix=ee(p,u.getRelativeIndex(h)+m.data.indexOf("#")))}a.push(p)}return a}}getTitle(i,l){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:l,temporary:i,decode:!0,selfLink:!0})}print(){return super.print(b(this,e)?{pre:"[[",post:"]]",sep:b(this,t)}:{sep:b(this,t)})}json(i,l=this.getAbsoluteIndex()){{const a=super.json(void 0,l),{type:u,fragment:o}=this;return o!==void 0&&(u==="link"||u==="redirect-target")&&(a.fragment=o),a}}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n),ai=oe(qr),Xe=le(ai,0,"LinkBaseToken",Br,Xe),re(ai,1,Xe)}}),Wr,oi,Ur,qe,vt=I({"src/nowiki/base.ts"(){"use strict";De(),J(),Wr=[Ue],qe=class extends(Ur=z){get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}},oi=oe(Ur),qe=le(oi,0,"NowikiBaseToken",Wr,qe),re(oi,1,qe)}}),Mr,ui,zr,je,Bt=I({"src/nowiki/noinclude.ts"(){"use strict";X(),xt(),D(),vt(),Mr=[tt(!1)],je=class extends(zr=qe){get type(){return"noinclude"}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){{const{lintConfig:t}=N,s="no-ignored",n=t.getSeverity(s,"include");if(n){const{innerText:r}=this,i=/^<(noinclude|includeonly|onlyinclude)\s+(?:[^\s>/]|\/(?!>))[^>]*>$/iu.exec(r);if(i){const l=Z(this,{start:e},s,"useless-attribute",n),{computeEditInfo:a}=t,u=i[1].length+1,o=r.endsWith("/>")?2:1;return l.startIndex+=u,l.startCol+=u,l.endIndex-=o,l.endCol-=o,a&&(l.suggestions=[ee(l)]),[l]}}return[]}}},ui=oe(zr),je=le(ui,0,"NoincludeToken",Mr,je),re(ui,1,je)}}),Ua,zu=I({"src/link/redirectTarget.ts"(){"use strict";X(),D(),Vs(),Bt(),Ua=class extends Xe{get type(){return"redirect-target"}constructor(e,t,s,n){super(e,void 0,s,n),t!==void 0&&this.insertAt(new je(t,s,n))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,{halfParsed:!0,decode:!0,page:""})}lint(e=this.getAbsoluteIndex()){{const t=super.lint(e,!1),s="no-ignored",{lintConfig:n}=N,r=n.getSeverity(s,"redirect");if(r&&this.length===2){const i=Q(this.lastChild,{start:e},s,"useless-link-text",r);i.startIndex--,i.startCol--,(n.computeEditInfo||n.fix)&&(i.fix=ee(i)),t.push(i)}return t}}}}}),Hr,di,Dr,Zt,Hu=I({"src/redirect.ts"(){"use strict";var e,t,s;xt(),De(),J(),mt(),zu(),Hr=[tt(!1,!1),Ue],Zt=(s=class extends(Dr=z){constructor(r,i,l,a,u,o,d=[]){super(void 0,o,d);R(this,e);R(this,t);E(this,e,r),E(this,t,u),this.append(new ze(i,"redirect-syntax",o,d),new Ua(l,a==null?void 0:a.slice(1),o,d))}get type(){return"redirect"}getAttribute(r){return r==="padding"?b(this,e).length:super.getAttribute(r)}toString(r){return b(this,e)+super.toString(r)+b(this,t)}lint(r=this.getAbsoluteIndex()){{const i=r+b(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",i),this.lastChild.lint(i)}}print(){return super.print({pre:b(this,e),post:b(this,t)})}},e=new WeakMap,t=new WeakMap,s),di=oe(Dr),Zt=le(di,0,"RedirectToken",Hr,Zt),re(di,1,Zt)}}),Ma={};ae(Ma,{parseRedirect:()=>za});var za,Du=I({"parser/redirect.ts"(){"use strict";D(),Hu(),za=(e,t,s)=>{var r;(r=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&&N.normalizeTitle(n[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,page:""}).valid?(e=`\0${s.length}o${e.slice(n[0].length)}`,new Zt(...n.slice(1),t,s),e):!1}}}),Gr,ci,Vr,es,Gu=I({"src/onlyinclude.ts"(){"use strict";st(),De(),J(),Gr=[Ue,Ge("<onlyinclude>")],es=class extends(Vr=z){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>'})}},ci=oe(Vr),es=le(ci,0,"OnlyincludeToken",Gr,es),re(ci,1,es)}}),Qr,hi,Jr,ut,Jn=I({"src/tagPair/index.ts"(){"use strict";var e,t;Gs(),De(),J(),Qr=[ys(),Ue],ut=(t=class extends(Jr=z){constructor(n,r,i,l,a,u=[]){super(void 0,a);R(this,e);Ne(this,"closed");Ne(this,"selfClosing");this.setAttribute("name",n.toLowerCase()),E(this,e,[n,l||n]),this.closed=l!=="",this.selfClosing=l===void 0,this.append(r,i);const o=typeof r=="string"?-1:u.indexOf(r);u.splice(o===-1?1/0:o,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(n){const{selfClosing:r,firstChild:i,lastChild:l}=this,[a,u]=b(this,e);return r?`<${a}${i.toString(n)}/>`:`<${a}${i.toString(n)}>${l.toString(n)}${this.closed?`</${u}>`:""}`}text(){const[n,r]=b(this,e);return this.selfClosing?`<${n}${this.firstChild.text()}/>`:`<${n}${super.text(">")}${this.closed?`</${r}>`:""}`}getAttribute(n){return n==="padding"?b(this,e)[0].length+1:super.getAttribute(n)}print(){const[n,r]=b(this,e);return super.print(this.selfClosing?{pre:`<${n}`,post:"/>"}:{pre:`<${n}`,sep:">",post:this.closed?`</${r}>`:""})}},e=new WeakMap,t),hi=oe(Jr),ut=le(hi,0,"TagPairToken",Qr,ut),re(hi,1,ut)}}),Xn,Ha=I({"src/tag/index.ts"(){"use strict";var e,t,s,n;X(),Re(),D(),J(),Xn=(n=class extends z{constructor(i,l,a,u,o){super(void 0,u,o);R(this,e);R(this,t);R(this,s);this.insertAt(l),E(this,e,a),E(this,t,i)}get closing(){return b(this,e)}toString(i){return`<${b(this,e)?"/":""}${b(this,t)}${super.toString(i)}${this.selfClosing?"/":""}>`}text(i=""){const{closing:l}=this;return`<${l&&!i?"/":""}${b(this,t)}${l?"":super.text()}${i}>`}getAttribute(i){return i==="padding"?b(this,t).length+(b(this,e)?2:1):super.getAttribute(i)}findMatchingTag(){return ht(b(this,s),()=>{const{type:i,name:l,parentNode:a,closing:u,selfClosing:o}=this;let d=!1,c=!1;if(i==="html"){const{html:[,_,T]}=this.getAttribute("config");d=T.includes(l),c=_.includes(l)}if(d||c&&o)return this;if(!a)return;const{childNodes:f}=a,g=f.indexOf(this),y=u?f.slice(0,g).reverse():f.slice(g+1),$=[this],{rev:k}=we;for(const _ of y)if(!(!_.is(i)||i==="html"&&(_.name!==l||c&&_.selfClosing)))if(b(_,e)===u){if(i==="tvar")return;$.push(_)}else{const T=$.pop();if(T===this)return _;N.viewOnly&&(E(T,s,[k,_]),E(_,s,[k,T]))}if(N.viewOnly)for(const _ of $)E(_,s,[k,void 0])},i=>{E(this,s,i),i[1]&&i[1]!==this&&E(i[1],s,[we.rev,this])})}print(){return super.print({pre:`<${b(this,e)?"/":""}${b(this,t)}`,post:`${this.selfClosing?"/":""}>`})}json(i,l=this.getAbsoluteIndex()){{const a=super.json(void 0,l);return a.closing=b(this,e),a}}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n)}}),Xr,gi,Kr,Ke,Vu=I({"src/tag/tvar.ts"(){"use strict";xt(),Ha(),mt(),Xr=[tt()],Ke=class extends(Kr=Xn){get type(){return"tvar"}constructor(e,t,s,n,r){const i=new ze(t,"tvar-name",n,r);super(e,i,s,n,r)}},gi=oe(Kr),Ke=le(gi,0,"TvarToken",Xr,Ke),re(gi,1,Ke)}}),Da,Qu=I({"src/tagPair/translate.ts"(){"use strict";var e,Ga,s;J(),Jn(),mt(),Vu(),Da=(s=class extends ut{constructor(r,i,l,a=[]){const u=new ze(r,"translate-attr",l,a);i=i==null?void 0:i.replace(/<tvar(\|[^>]+)>([\s\S]*?)<\/>/gu,(d,c,f)=>(new Ke("tvar",c,!1,l,a),new Ke("","",!0,l,a),`\0${a.length-2}n${f}\0${a.length}n`)).replace(/<(tvar)(\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\3|[^"'\s>]+))?\s*)>([\s\S]*?)<\/(tvar)(\s*)>/giu,(d,c,f,g,y,$,k)=>(new Ke(c,f,!1,l,a),new Ke($,k,!0,l,a),`\0${a.length-2}n${y}\0${a.length}n`));const o=new z(i,l,a);o.type="translate-inner";super("translate",u,o,"translate",l,a);R(this,e);this.seal("closed",!0),this.seal("selfClosing",!0)}get type(){return"translate"}toString(r){return r?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){return`<span class="wpb-ext"><translate${j(this,e,Ga).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,Ga=function(){return this.firstChild.toString()===" nowrap"},s)}}),Yr,pi,Zr,ts,Ju=I({"src/tagPair/include.ts"(){"use strict";X(),be(),xt(),D(),Jn(),Yr=[tt(!1)],ts=class extends(Zr=ut){get type(){return"include"}constructor(e,t="",s,n,r,i){super(e,t,s!=null?s:"",s===void 0||n!=null?n:"",r,i)}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){{const t=[],{firstChild:s,closed:n,name:r}=this,i=new pe(this,e),l=["no-ignored","unclosed-comment"],{lintConfig:a}=N,{computeEditInfo:u}=a,o=l.map(d=>a.getSeverity(d,"include"));if(o[0]&&s.data.trim()){const d=Q(s,i,l[0],"useless-attribute",o[0]);u&&(d.suggestions=[ee(d)]),t.push(d)}if(o[1]&&!n){const d=Z(this,i,l[1],N.msg("unclosed",`<${r}>`),o[1]);u&&(d.suggestions=[Ze(d.endIndex,`</${r}>`)]),t.push(d)}return t}}},pi=oe(Zr),ts=le(pi,0,"IncludeToken",Yr,ts),re(pi,1,ts)}}),Qs,Kn=I({"mixin/attributesParent.ts"(){"use strict";Qs=(e=0)=>t=>{var s,Sn;{class r extends t{constructor(){super(...arguments);R(this,s)}hasAttr(a){return j(this,s,Sn).call(this).hasAttr(a)}getAttr(a){return j(this,s,Sn).call(this).getAttr(a)}}return s=new WeakSet,Sn=function(){return this.childNodes[e]},r}}}}),ge,fi,mi,Dt,$s,xi,Gt,vi,bi,yi,_s,wi,Si,Ai,Oe,Yn,Zn,er,Va,Qa=I({"util/sharable.ts"(){"use strict";ge=new Set(["align"]),fi=new Set(["cite"]),mi=new Set(["cite","datetime"]),Dt=new Set(["width"]),$s=new Set(["axis","align","bgcolor","height","width","valign"]),xi=new Set([...$s,"abbr","headers","scope","rowspan","colspan"]),Gt=new Set(["type"]),vi=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),bi=new Set(["clear"]),yi=new Set(["bgcolor","align","valign"]),_s=new Set(["qid","forcemathmode","type","display"]),wi=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),Si=new Set(["weight"]),Ai=new Set(["width","height","zoom","latitude","longitude","align","mapstyle","lang","alt","text"]),Oe=new Set,Yn=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"]),Zn={div:ge,h1:ge,h2:ge,h3:ge,h4:ge,h5:ge,h6:ge,blockquote:fi,q:fi,p:ge,br:bi,pre:Dt,ins:mi,del:mi,ul:Gt,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...vi,"border"]),caption:ge,tr:yi,td:xi,th:xi,font:new Set(["size","color","face"]),hr:Dt,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Gt,poem:ge,categorytree:ge,combooption:ge,math:Oe,chem:Oe,ce:Oe,img:new Set(["alt","src","width","height","loading","srcset"])},er={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:Oe,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:Si,choicetemplate:Si,imagemap:Oe,inputbox:Oe,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:Oe,poll:new Set(["id","show-results-before-voting"]),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([..._s,"chem"]),chem:_s,ce:_s,hiero:Oe,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:wi,syntaxhighlight:wi,templatedata:Oe,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:Oe,mapframe:new Set([...Ai,"frameless"]),maplink:new Set([...Ai,"class"]),rss:new Set(["template","templatename","max","highlight","filter","filterout","reverse","date","item-max-length"]),"page-collection":new Set(["lang","name","description","end-date"])},Va={table:vi,td:new Set([...$s,"scope"]),th:$s,br:bi,caption:ge,div:ge,hr:Dt,h1:ge,h2:ge,h3:ge,h4:ge,h5:ge,h6:ge,li:Gt,p:ge,pre:Dt,tr:yi,ul:Gt}}}),el,tl,sl,il,Rs,Xu=I({"src/attribute.ts"(){"use strict";var e,t,s,n,r,Ja,An,a;X(),ve(),He(),Qa(),be(),D(),J(),ft(),el=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,tl=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,sl=new Set(["ext","arg","magic-word","template"]),il=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),Rs=(a=class extends z{constructor(o,d,c,f="",g,y=[],$=N.getConfig(),k=[]){const _=new We(c,"attr-key",$,k);let T;if(c==="title"||d==="img"&&c==="alt")T=new z(g,$,k,{}),T.type="attr-value",T.setAttribute("stage",ke-1);else if(d==="gallery"&&c==="caption"||d==="ref"&&c==="details"||(d==="mapframe"||d==="maplink")&&c==="text"||d==="choose"&&(c==="before"||c==="after")){const p={...$,excludes:[...$.excludes,"heading","html","table","hr","list"]};T=new z(g,p,k,{}),T.type="attr-value",T.setAttribute("stage",1)}else T=new We(g,"attr-value",$,k,{});super(void 0,$,k);R(this,r);R(this,e);R(this,t);R(this,s);R(this,n);E(this,e,o),this.append(_,T),E(this,s,f),E(this,n,[...y]),E(this,t,d),this.setAttribute("name",jt(Ce(c)))}get type(){return b(this,e)}get tag(){return b(this,t)}get balanced(){return!b(this,s)||b(this,n)[0]===b(this,n)[1]}afterBuild(){b(this,s).includes("\0")&&E(this,s,this.buildFromStr(b(this,s),0)),this.parentNode&&E(this,t,this.parentNode.name),j(this,r,Ja).call(this),super.afterBuild()}toString(o){const[d="",c=""]=b(this,n);return b(this,s)?super.toString(o,b(this,s)+d)+c:this.firstChild.toString(o)}text(){return b(this,s)?`${super.text(`${b(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var o,d;return b(this,s)?b(this,s).length+((d=(o=b(this,n)[0])==null?void 0:o.length)!=null?d:0):0}lint(o=this.getAbsoluteIndex(),d){var c;{const f=super.lint(o,d),{balanced:g,firstChild:y,lastChild:$,name:k,tag:_}=this,T=new pe(this,o),p=["unclosed-quote","obsolete-attr"],{lintConfig:h}=N,m=p.map(S=>h.getSeverity(S,k));if(m[0]&&!g){const S=Q($,T,p[0],"unclosed-quotes",m[0]);S.startIndex--,S.startCol--,h.computeEditInfo&&(S.suggestions=[Ze(S.endIndex,b(this,n)[0])]),f.push(S)}const x=j(this,r,An).call(this,o,T);return x&&f.push(x),m[1]&&((c=Va[_])!=null&&c.has(k))&&f.push(Q(y,T,p[1],"obsolete-attribute",m[1])),f}}getValue(){return b(this,s)?this.lastChild.text().trim():this.type==="ext-attr"||""}escape(){this.type!=="ext-attr"&&(E(this,s,"{{=}}"),this.lastChild.escape())}getAttribute(o){return o==="invalid"?j(this,r,An).call(this):super.getAttribute(o)}print(){const[o="",d=""]=b(this,n);return b(this,s)?super.print({sep:ps(b(this,s))+o,post:d}):super.print()}json(o,d=this.getAbsoluteIndex()){{const c=super.json(void 0,d);return c.tag=this.tag,c}}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n=new WeakMap,r=new WeakSet,Ja=function(){this.setAttribute("name",jt(this.firstChild.text()))},An=function(o,d){const{firstChild:c,lastChild:f,type:g,name:y,tag:$,parentNode:k}=this,_=!f.childNodes.some(({type:w})=>sl.has(w)),T=this.getValue(),p=er[$],h=Zn[$],{length:m}=this.toString();let x="illegal-attr",S,v;if({lintConfig:S}=N,{computeEditInfo:v}=S,!(p!=null&&p.has(y))&&!(h!=null&&h.has(y))&&(g==="ext-attr"?p||h:!/\{\{[^{]+\}\}/u.test(y))&&(g==="ext-attr"&&!h||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(y)&&($==="meta"||$==="link"||!Yn.has(y)))||(y==="itemtype"||y==="itemid"||y==="itemref")&&!(k!=null&&k.hasAttr("itemscope"))){if(o===void 0)return!0;{const w=S.getSeverity(x,"unknown");if(w){const A=Q(c,d,x,"illegal-attribute-name",w);return v&&(A.suggestions=[ee(o,m)]),A}}}else if(y==="style"&&typeof T=="string"&&el.test(T)){if(o===void 0)return!0;{x="insecure-style";const w=S.getSeverity(x);return w&&Q(f,d,x,"insecure-style",w)}}else if(y==="tabindex"&&typeof T=="string"&&T!=="0"){if(o===void 0)return!0;{const w=S.getSeverity(x,"tabindex");if(w){const A=Q(f,d,x,"nonzero-tabindex",w);return v&&(A.suggestions=[ee(o,m),Be(A,"0 tabindex","0")]),A}}}else if(typeof T=="string"&&((/^xmlns:[\w:.-]+$/u.test(y)||il.has(y))&&tl.test(T)||_&&(y==="href"||$==="img"&&y==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(T))){if(o===void 0)return!0;{const w=S.getSeverity(x,"value");return w&&Q(f,d,x,"illegal-attribute-value",w)}}else if(_&&g!=="ext-attr"){const w=Gn($,y),A=String(T).toLowerCase();if(w.length>0&&w.every(C=>C!==A)){if(o===void 0)return!0;{const C=S.getSeverity(x,"value");return C&&Q(f,d,x,"illegal-attribute-value",C)}}}return!1},a)}}),ki,nl,rl,Js,tr=I({"src/attributes.ts"(){"use strict";var e,t,Ps,n;X(),ve(),be(),D(),J(),ft(),Xu(),ki=r=>r.slice(0,-1),nl=r=>`${ki(r)}-dirty`,rl=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch{return/[^\W_]/u}})(),Js=(n=class extends z{constructor(i,l,a,u,o=[]){super(void 0,u,o,{});R(this,t);R(this,e);if(E(this,e,l),this.setAttribute("name",a),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 c="",f=d.exec(i),g=0;const y=(()=>{c&&(super.insertAt(new We(c,nl(l),u,o,{})),c="")});for(;f;){const{index:$,0:k,1:_,2:T,3:p,4:h,5:m,6:x}=f;if(c+=i.slice(g,$),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(Ce(_).trim())){const S=h!=null?h:x,v=[p,m],w=new Rs(ki(l),a,_,T,S,v,u,o);y(),super.insertAt(w)}else c+=k;({lastIndex:g}=d),f=d.exec(i)}c+=i.slice(g),y()}}get type(){return b(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(l=>l instanceof Rs&&(!i||l.name===jt(i)))}hasAttr(i){return this.getAttrTokens(i).length>0}getAttrToken(i){{const l=this.getAttrTokens(i);return l[l.length-1]}}getAttr(i){var l;return(l=this.getAttrToken(i))==null?void 0:l.getValue()}lint(i=this.getAbsoluteIndex(),l){{const a=super.lint(i,l),{parentNode:u,childNodes:o}=this,d=new Map,c=new Set,f=new pe(this,i),g=["no-ignored","no-duplicate"],{lintConfig:y}=N,{computeEditInfo:$,fix:k}=y,_=["closingTag","invalidAttributes","nonWordAttributes"].map(p=>y.getSeverity(g[0],p));if(_[0]&&j(this,t,Ps).call(this)){const p=Z(this,f,g[0],"attributes-of-closing-tag",_[0]);if($){const h=u.getAbsoluteIndex();p.suggestions=[ee(p),Mn(h)]}a.push(p)}for(const p of o)if(p instanceof Rs){const{name:h}=p;d.has(h)?(c.add(h),d.get(h).push(p)):d.set(h,[p])}else{const h=p.text().trim(),m=_[rl.test(h)?1:2];if(h&&m){const x=Q(p,f,g[0],"invalid-attribute",m);$&&(x.suggestions=[ee(x,0," ")]),a.push(x)}}const T=y.getSeverity(g[1],"attribute");if(T&&c.size>0)for(const p of c){const h=d.get(p).map(m=>{const x=m.getValue();return[m,x===!0?"":x]});Array.prototype.push.apply(a,h.map(([m,x],S)=>{const v=Q(m,f,g[1],N.msg("duplicate-attribute",p),T);if($||k){const w=ee(v);!x||h.slice(0,S).some(([,A])=>A===x)?v.fix=w:$&&(v.suggestions=[w])}return v}))}return a}}escape(){this.type!=="ext-attrs"&&super.escape()}getAttribute(i){return i==="invalid"?j(this,t,Ps).call(this):super.getAttribute(i)}print(){return this.toString()?`<span class="wpb-${this.type}${j(this,t,Ps).call(this)?" wpb-invalid":""}">${this.childNodes.map(i=>i.print(i instanceof We?{class:i.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,Ps=function(){const{parentNode:i}=this;return(i==null?void 0:i.type)==="html"&&i.closing&&this.text().trim()!==""},n)}}),Xa={};ae(Xa,{PreToken:()=>Ka});var Ka,Ku=I({"src/pre.ts"(){"use strict";He(),J(),Bt(),Ka=class extends z{get type(){return"ext-inner"}constructor(e,t,s=[]){if(e){const n=/<nowiki>/giu,r=/<\/nowiki>/giu,{length:i}=n.source;let l=n.exec(e);l&&(r.lastIndex=l.index+i);let a=r.exec(e),u=0,o="";for(;l&&a;)new je(l[0],t,s,!0),new je(a[0],t,s,!0),o+=`${e.slice(u,l.index)}\0${s.length-1}n${e.slice(l.index+i,a.index)}\0${s.length}n`,u=a.index+i+1,n.lastIndex=u,l=n.exec(e),l&&(r.lastIndex=l.index+i),a=r.exec(e);e=o+e.slice(u)}super(e,t,s,{}),this.setAttribute("stage",ke-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),Xs,sr=I({"src/multiLine/index.ts"(){"use strict";J(),Xs=class extends z{get type(){return"ext-inner"}toString(e){return super.toString(e,`
|
|
1
|
+
"use strict";(()=>{var Ru=Object.defineProperty;var yr=e=>{throw TypeError(e)};var Pu=(e,t,i)=>t in e?Ru(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var Ou=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ee=(e,t,i)=>Pu(e,typeof t!="symbol"?t+"":t,i),ts=(e,t,i)=>t.has(e)||yr("Cannot "+i);var b=(e,t,i)=>(ts(e,t,"read from private field"),i?i.call(e):t.get(e)),R=(e,t,i)=>t.has(e)?yr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,i),F=(e,t,i,n)=>(ts(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i),j=(e,t,i)=>(ts(e,t,"access private method"),i);var wr=(e,t,i,n)=>({set _(r){F(e,t,r,i)},get _(){return b(e,t,n)}});var Md=Ou((zd,ju)=>{var Na=Object.create,gt=Object.defineProperty,La=Object.getOwnPropertyDescriptor,Un=Object.getOwnPropertyNames,Bu=Object.getPrototypeOf,qu=Object.prototype.hasOwnProperty,Fa=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Ot=e=>{throw TypeError(e)},Ea=(e,t,i)=>t in e?gt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Sr=(e,t)=>gt(e,"name",{value:t,configurable:!0}),N=(e,t)=>function(){return e&&(t=(0,e[Un(e)[0]])(e=0)),t},zn=(e,t)=>function(){return t||(0,e[Un(e)[0]])((t={exports:{}}).exports,t),t.exports},oe=(e,t)=>{for(var i in t)gt(e,i,{get:t[i],enumerable:!0})},ja=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Un(t))!qu.call(e,r)&&r!==i&>(e,r,{get:()=>t[r],enumerable:!(n=La(t,r))||n.enumerable});return e},Wu=(e,t,i)=>(i=e!=null?Na(Bu(e)):{},ja(t||!e||!e.__esModule?gt(i,"default",{value:e,enumerable:!0}):i,e)),se=e=>ja(gt({},"__esModule",{value:!0}),e),ae=e=>{var t;return[,,,Na((t=e==null?void 0:e[Fa("metadata")])!=null?t:null)]},Ra=["class","method","getter","setter","accessor","field","value","get","set"],Xt=e=>e!==void 0&&typeof e!="function"?Ot("Function expected"):e,Mu=(e,t,i,n,r)=>({kind:Ra[e],name:t,metadata:n,addInitializer:s=>i._?Ot("Already initialized"):r.push(Xt(s||null))}),Hn=(e,t)=>Ea(t,Fa("metadata"),e[3]),ne=(e,t,i,n)=>{for(var r=0,s=e[t>>1],l=s&&s.length;r<l;r++)t&1?s[r].call(i):n=s[r].call(i,n);return n},re=(e,t,i,n,r,s)=>{var l,a,d,o,u,c=t&7,m=!!(t&8),f=!!(t&16),y=c>3?e.length+1:c?m?1:2:0,S=Ra[c+5],$=c>3&&(e[y-1]=[]),_=e[y]||(e[y]=[]),T=c&&(!f&&!m&&(r=r.prototype),c<5&&(c>3||!f)&&La(c<4?r:{get[i](){return xe(this,s)},set[i](h){return Ne(this,s,h)}},i));c?f&&c<4&&Sr(s,(c>2?"set ":c>1?"get ":"")+i):Sr(r,i);for(var g=n.length-1;g>=0;g--)o=Mu(c,i,d={},e[3],_),c&&(o.static=m,o.private=f,u=o.access={has:f?h=>zu(r,h):h=>i in h},c^3&&(u.get=f?h=>(c^1?xe:wn)(h,r,c^4?s:T.get):h=>h[i]),c>2&&(u.set=f?(h,x)=>Ne(h,r,x,c^4?s:T.set):(h,x)=>h[i]=x)),a=(0,n[g])(c?c<4?f?s:T[S]:c>4?void 0:{get:T.get,set:T.set}:r,o),d._=1,c^4||a===void 0?Xt(a)&&(c>4?$.unshift(a):c?f?s=a:T[S]=a:r=a):typeof a!="object"||a===null?Ot("Object expected"):(Xt(l=a.get)&&(T.get=l),Xt(l=a.set)&&(T.set=l),Xt(l=a.init)&&$.unshift(l));return c||Hn(e,r),T&>(r,i,T),f?c^4?s:T:r},Uu=(e,t,i)=>Ea(e,typeof t!="symbol"?t+"":t,i),Dn=(e,t,i)=>t.has(e)||Ot("Cannot "+i),zu=(e,t)=>Object(t)!==t?Ot('Cannot use the "in" operator on this value'):e.has(t),xe=(e,t,i)=>(Dn(e,t,"read from private field"),i?i.call(e):t.get(e)),Je=(e,t,i)=>t.has(e)?Ot("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,i),Ne=(e,t,i,n)=>(Dn(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i),wn=(e,t,i)=>(Dn(e,t,"access private method"),i),Hu=(e,t,i,n)=>({set _(r){Ne(e,t,r,i)},get _(){return xe(e,t,n)}}),Pa,hi,Gn=N({"base.ts"(){"use strict";Pa=(()=>{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};return Object.setPrototypeOf(e,null),e})(),hi=(()=>{const e=["arg-in-ext","bold-header","format-leakage","fostered-content","h1","illegal-attr","insecure-style","invalid-gallery","invalid-imagemap","invalid-invoke","invalid-isbn","invalid-url","lonely-apos","lonely-bracket","lonely-http","nested-link","no-arg","no-duplicate","no-ignored","obsolete-attr","obsolete-tag","parsing-order","pipe-like","syntax-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 Pe(e,t,i){return i===1?e.replace(/\0(\d+)g\x7F/gu,(n,r)=>Pe(String(t[r]),t,2)):i===2?e.replace(/\0(\d+)n\x7F/gu,(n,r)=>String(t[r])):e.replace(/\0(\d+)\x7F/gu,(n,r)=>t[r])}var Ye,is,Ft,Et,jt,bt,di,Te,pt,Ar,kr,Si,gi,Oa,$r,_r,pi,Rt,ve=N({"util/string.ts"(){"use strict";Ye=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,is=String.raw`[^[\]<>"\0-\x1F\x7F${Ye}\uFFFD]`,Ft=String.raw`(?:\[[\da-f:.]+\]|${is})`,Et=String.raw`(?:${is}|\0\d+[cn!~]\x7F)*`,jt=e=>e.trim().toLowerCase(),bt=(e,t)=>i=>i.replace(e,t),di=bt(/[\0\x7F]|\r$/gmu,""),Te=bt(/\0\d+[cn]\x7F/gu,""),pt=(e,t="")=>e.map(i=>typeof i=="string"?i:i.text()).join(t),Ar={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},kr=bt(/&(?:#(\d+|[Xx][\da-fA-F]+)|([lg]t|[LG]T|[lr]brac[ke]|nbsp|amp|AMP|quot|QUOT));/gu,(e,t,i)=>t?String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t)):Ar[i.toLowerCase()]),gi=e=>(Si!=null||(Si=kr),Si(e)),Oa=bt(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),$r={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},_r=(e=/[&<>"{}[\]|]/gu)=>bt(e,t=>`&${$r[t]};`),pi=_r(/[&<>]/gu),Rt=(e,t={})=>{const{pre:i="",post:n="",sep:r=""}=t;return i+e.map(s=>s.print()).join(r)+n}}}),Du=zn({"i18n/en.json"(e,t){t.exports={"argument-in-ext":"template argument inside an extension tag","attributes-of-closing-tag":"attributes of a closing tag","bold-apostrophes":"bold apostrophes","bold-in-header":"bold text in a section header",close:null,"closing-and-self-closing":"tag that is both closing and self-closing",comment:null,"conflicting-image-parameter":"conflicting image $1 parameter","content-outside-table":"content to be moved outside the table",decode:null,delink:null,"duplicate-attribute":"duplicate $1 attribute","duplicate-category":"duplicate category","duplicate-id":"duplicate HTML id","duplicate-image-parameter":"duplicate image $1 parameter","duplicate-parameter":"duplicate template parameter",encode:null,escape:null,expand:null,"ext-in-html":"extension tag in HTML tag attributes",frame:null,"full-width-punctuation":"full-width punctuation","header-in-html":"section header in HTML tag attributes","header-like":"header-like syntax in plain text","horizontal-alignment":null,"html-in-table":"HTML tag in table attributes","illegal-attribute-name":"invalid attribute name","illegal-attribute-value":"invalid attribute value","illegal-module":"invalid Scribunto module name","imagemap-without-image":"<imagemap> without an image","in-url":"$1 in URL","inconsistent-table":"inconsistent table layout","insecure-style":"insecure style","invalid-attribute":"element containing an invalid attribute name","invalid-content":"invalid content in <$1>","invalid-conversion-flag":"invalid conversion flag","invalid-gallery":"invalid gallery image","invalid-image-parameter":"invalid image parameter","invalid-imagemap-link":"invalid link in <imagemap>","invalid-isbn":"invalid ISBN","invalid-parameter":"invalid parameter of <$1>","invalid-self-closing":"invalid self-closing tag","invalid-thumb":"invalid thumbnail filename","invalid-url":"invalid URL","invisible-triple-braces":"invisible content inside triple braces","italic-apostrophes":"italic apostrophes","left-bracket":"opening bracket","link-in-extlink":"internal link in an external link",lonely:'lonely "$1"',"missing-extension":"missing file extension","missing-function":"missing Scribunto module function name",newline:null,"no-self-closing":"no self-closing","nonzero-tabindex":"nonzero tabindex","nothing-in":"nothing should be in <$1>","obsolete-attribute":"obsolete attribute","obsolete-tag":"obsolete HTML tag",open:null,prefix:null,"pipe-in-link":'additional "|" in the link text',"pipe-in-table":'additional "|" in a table cell',"redirect-like":"redirect-like syntax in a list item","ref-in-link":"<ref> in an internal or external link",remove:null,"template-in-link":"template in an internal link target","unbalanced-in-section-header":"unbalanced $1 in a section header",unclosed:"unclosed $1","unclosed-comment":"unclosed HTML comment","unclosed-quotes":"unclosed quotes","unclosed-table":"unclosed table","unclosed-tag":"unclosed tag","unescaped-query":"unescaped query string in an anonymous parameter","unexpected-argument":"unexpected template argument","unmatched-closing":"unmatched closing tag","unnecessary-encoding":"unnecessary percent-encoding in an internal link",uppercase:null,"useless-attribute":"useless attribute","useless-fragment":"useless fragment","useless-link-text":"useless link text","variable-anchor":"variable anchor in a section header","vertical-alignment":null,whitespace:null}}}),Gu=zn({"config/minimum.json"(e,t){t.exports={ext:[],html:[["b","bdi","del","i","ins","u","font","big","small","sub","sup","h1","h2","h3","h4","h5","h6","cite","code","em","s","strike","strong","tt","var","div","center","blockquote","ol","ul","dl","table","caption","pre","ruby","rb","rp","rt","rtc","p","span","abbr","dfn","kbd","samp","data","time","mark","tr","td","th","q","bdo"],["li","dt","dd"],["br","wbr","hr","meta","link"]],namespaces:{0:"",6:"File",10:"Template",14:"Category",828:"Module"},nsid:{"":0,file:6,template:10,category:14,module:828},functionHook:["msgnw"],variable:["!","=","pageid","articlepath","server","servername","scriptpath","stylepath"],parserFunction:[{msgnw:"msgnw",pageid:"pageid",articlepath:"articlepath",server:"server",servername:"servername",scriptpath:"scriptpath",stylepath:"stylepath","#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"formatdate","#dateformat":"formatdate","#invoke":"invoke","#while":"while","#dowhile":"dowhile","#loop":"loop","#forargs":"forargs","#fornumargs":"fornumargs","#if":"if","#ifeq":"ifeq","#switch":"switch","#ifexist":"ifexist","#ifexpr":"ifexpr","#iferror":"iferror","#time":"time","#timel":"timel","#expr":"expr","#rel2abs":"rel2abs","#titleparts":"titleparts","#categorytree":"categorytree","#urldecode":"urldecode","#choose":"choose","#var":"var","#varexists":"varexists","#var_final":"var_final","#vardefine":"vardefine","#vardefineecho":"vardefineecho","#widget":"widget","#related":"related","#regex":"regex","#regex_var":"regex_var","#regexquote":"regexquote","#regexall":"regexall","#len":"len","#pos":"pos","#rpos":"rpos","#sub":"sub","#count":"count","#rmatch":"rmatch","#rreplace":"rreplace","#replace":"replace","#rsplit":"rsplit","#explode":"explode","#tab":"tab","#seo":"seo","#babel":"babel","#translation":"translation","#commaseparatedlist":"commaseparatedlist","#coordinates":"coordinates","#lst":"lst","#lsth":"lsth","#lstx":"lstx","#assessment":"assessment","#mentor":"mentor","#property":"property","#target":"target","#section":"lst","#section-x":"lstx","#section-h":"lsth","#statements":"statements","#useliquidthreads":"useliquidthreads","#lqtpagelimit":"lqtpagelimit","#avatar":"avatar","#img":"img","#chart":"chart"},{"!":"!","=":"=","#FORMAL":"formal","#bcp47":"bcp47","#dir":"dir","#interwikilink":"interwikilink","#interlanguagelink":"interlanguagelink","#contentmodel":"contentmodel","#timef":"timef","#timefl":"timefl"},["msg","raw"],["subst","safesubst"]],doubleUnderscore:[[],[]],protocol:"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|matrix:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|wikipedia://|worldwind://|xmpp:",interwiki:[],img:{},redirection:["#redirect"],variants:[]}}}),$e,Ba,qa,Mi,Sn,Ue=N({"util/constants.ts"(){"use strict";$e=11,Ba=Du(),qa=new Set(["alt","link","lang","page","caption"]),Mi=new Set(["tiff","tif","png","gif","jpg","jpeg","webp","xcf","pdf","svg","djvu"]),Sn=Gu()}});function ct(e){const t=new Map,i=new WeakMap;return n=>{const r=typeof n=="string"?t:i;if(r.has(n)){const l=r.get(n);return l.lastIndex=0,l}const s=e(n);return r.set(n,s),s}}var fi,Wa,Tr,Ma,et=N({"../common/dist/index.mjs"(){"use strict";fi=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25")),Wa=e=>Math.round(e*255).toString(16).padStart(2,"0"),Tr=(()=>{const e=String.raw`#(?:[\da-f]{3,4}|(?:[\da-f]{2}){3,4})(?![\p{L}\p{N}_])`,t=String.raw`(?:\d*\.)?\d+%?`,i=String.raw`(?:\d*\.)?\d+(?:deg|grad|rad|turn)?`,n=String.raw`rgba?\(\s*(?:${String.raw`${new Array(3).fill(t).join(String.raw`\s+`)}(?:\s*\/\s*${t})?`}|${String.raw`${new Array(3).fill(t).join(String.raw`\s*,\s*`)}(?:\s*,\s*${t})?`})\s*\)`,r=String.raw`hsla?\(\s*(?:${String.raw`${i}\s+${t}\s+${t}(?:\s*\/\s*${t})?`}|${String.raw`${i}${String.raw`\s*,\s*(?:\d*\.)?\d+%`.repeat(2)}(?:\s*,\s*${t})?`})\s*\)`;return{full:new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${e}|${n}|${r})`,"giu"),rgb:new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${e}|${n})`,"giu")}})(),Ma=(e,t=!0)=>{const i=[],n=Tr[t?"full":"rgb"];n.lastIndex=0;let r=n.exec(e),s=0;for(;r;){const l=r.index+r[1].length;l>s&&i.push([e.slice(s,l),s,l,!1]),{lastIndex:s}=n,i.push([r[2],l,s,e[l-1]!=="&"||!/^#\d+$/u.test(r[2])]),r=n.exec(e)}return e.length>s&&i.push([e.slice(s),s,e.length,!1]),i}}}),fe,ye=N({"lib/rect.ts"(){"use strict";var e,t,i,n,An,s;fe=(s=class{constructor(l,a){R(this,n);R(this,e);R(this,t);R(this,i);F(this,e,l),F(this,t,a)}get start(){return b(this,t)}get top(){return j(this,n,An).call(this).top}get left(){return j(this,n,An).call(this).left}},e=new WeakMap,t=new WeakMap,i=new WeakMap,n=new WeakSet,An=function(){var l;return(l=b(this,i))!=null||F(this,i,b(this,e).getRootNode().posFromIndex(b(this,t))),b(this,i)},s)}}),Cr,Ir,ci,mi,ss,V,Y,qe,Di,ee,Vn,Ze,Qn,Jn,Xn,xi,Pt,Kn,ht,Yn,J=N({"util/lint.ts"(){"use strict";et(),Ie(),ye(),D(),Cr=new Set(["tr","td","th","caption"]),Ir=new Set(["Template:!!","Template:!-"]),ci=e=>{const t=e.childNodes.find(i=>i.text().trim());if(!t||t.type==="text"&&t.data.trim().startsWith("!")||t.is("magic-word")&&t.name==="!"||t.is("template")&&Ir.has(t.name)||t.is("html")&&Cr.has(t.name))return!1;if(t.is("arg"))return t.length>1&&ci(t.childNodes[1]);if(t.is("magic-word"))try{const i=t.getPossibleValues().map(ci);return i.includes(2)?2:i.includes(1)&&1}catch{}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?1:2},mi=(e,t,i,n)=>({line:e+i-1,character:(i===1?t:0)+n}),ss=e=>(t,i,n,r,s="error")=>{const{start:l}=i,{top:a,left:d}=i instanceof fe?i:new fe(t,l),{offsetHeight:o,offsetWidth:u}=t,{startIndex:c,startLine:m,startCol:f}=e(t,l,a,d),{line:y,character:S}=mi(m,f,o,u);return{rule:n,message:I.msg(r),severity:s,startIndex:c,endIndex:c+t.toString().length,startLine:m,endLine:y,startCol:f,endCol:S}},V=ss((e,t,i,n)=>{const r=e.getRelativeIndex(),{top:s,left:l}=e.parentNode.posFromIndex(r);return{startIndex:t+r,startLine:i+s,startCol:s?l:n+l}}),Y=ss((e,t,i,n)=>({startIndex:t,startLine:i,startCol:n})),qe=(e,t,i,n=0)=>({desc:I.msg(t),range:[e.startIndex+n,e.endIndex],text:i}),Di=(e,t,i)=>({desc:I.msg(t),range:[e,e],text:i}),ee=(e,t=0,i="")=>typeof e=="number"?{desc:I.msg("remove"),range:[e,e+t],text:i}:qe(e,"remove",i,t),Vn=(e,t)=>qe(e,"decode",fi(t.text().replace(/%(?=21|3[ce]|5[bd]|7[b-d])/giu,"%25"))),Ze=(e,t,i=0)=>({desc:I.msg("close"),range:[e+i,e],text:t}),Qn=e=>({desc:I.msg("open"),range:[e+1,e+2],text:""}),Jn=(e,t)=>qe(e,"comment",`<!--${t}-->`),Xn=(e,t)=>qe(e,"uppercase",t.toUpperCase()),xi=(e,t=0)=>({desc:I.msg("whitespace"),range:[e,e+t],text:" "}),Pt=(e,t,i=1)=>({desc:I.msg("escape"),range:[e,e+i],text:t.repeat(i)}),Kn=(e,t)=>({desc:I.msg("escape"),range:[e,e+t.length],text:t.replace(/\|/gu,"|")}),ht=(e,t,i,n)=>{if(e&&(n||I.viewOnly&&e[0]===pe.rev))return e[1];const r=t();return(n||I.viewOnly)&&i([pe.rev,r]),r},Yn=(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"]:[]}}),Nr,Zn,Ua=N({"util/selector.ts"(){"use strict";Nr=e=>{if(e.includes("#")){const t=e.indexOf("#"),i=e.slice(0,t),n=e.slice(t+1);return(r,s)=>(t===0||r===i)&&s===n}return t=>t===e},Zn=(e,t,i)=>{if(e=e.trim(),!e)return(()=>!0);const n=e.split(",").map(r=>r.trim()).filter(r=>r!=="").map(Nr);return(({type:r,name:s})=>n.some(l=>l(r,s)))}}}),Vu=zn({"../node_modules/binary-search/index.js"(e,t){t.exports=function(i,n,r,s,l){var a,d;if(s===void 0)s=0;else if(s=s|0,s<0||s>=i.length)throw new RangeError("invalid lower bound");if(l===void 0)l=i.length-1;else if(l=l|0,l<s||l>=i.length)throw new RangeError("invalid upper bound");for(;s<=l;)if(a=s+(l-s>>>1),d=+r(i[a],n,a,i),d<0)s=a+1;else if(d>0)l=a-1;else return a;return~s}}}),Lr,za,Qu=N({"util/search.ts"(){"use strict";Lr=Wu(Vu()),za=(e,t,i)=>{const n=(0,Lr.default)(e,t,i);return n<0?~n:n}}}),Gi,er=N({"mixin/cached.ts"(){"use strict";J(),Gi=(e=!0)=>t=>{const i=new WeakMap;return function(...n){return ht(i.get(this),()=>t.apply(this,n),r=>{i.set(this,r)},e)}}}}),Ha,Ju=N({"mixin/nodeLike.ts"(){"use strict";Ha=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}}}),Fr,Er,Ai,Wt,Mt,ki,Ut,zt,Ht,lt,Da=N({"lib/node.ts"(){"use strict";Qu(),J(),Ie(),er(),Ju(),D(),Er=[Ha],Fr=[Gi(!1)],lt=class{constructor(){ne(Ht,5,this),Uu(this,"childNodes",[]),Je(this,Ai),Je(this,Wt),Je(this,Mt),Je(this,ki),Je(this,Ut),Je(this,zt,{})}get parentNode(){return xe(this,Ai)}get nextSibling(){return xe(this,Wt)}get previousSibling(){return xe(this,Mt)}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":Ne(this,Ai,t),t||(Ne(this,Wt,void 0),Ne(this,Mt,void 0));break;case"nextSibling":Ne(this,Wt,t);break;case"previousSibling":Ne(this,Mt,t);break;case"aIndex":I.viewOnly&&Ne(this,Ut,[pe.rev,t]);break;default:this[e]=t}}getRootNode(){return ht(xe(this,ki),()=>{var e,t;return(t=(e=this.parentNode)==null?void 0:e.getRootNode())!=null?t:this},e=>{const[,t]=e;t.type==="root"&&Ne(this,ki,e)})}indexFromPos(e,t){{if(e<0||t<0)return;const i=this.getLines();if(e>=i.length)return;const[,n,r]=i[e],s=n+t;return s>r?void 0:s}this.lspError("AstNode.indexFromPos")}posFromIndex(e){{const{length:t}=String(this);if(e+=e<0?t:0,e>=0&&e<=t){const i=this.getLines(),n=za(i,e,([,,r],s)=>r-s);return{top:n,left:e-i[n][1]}}return}}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 ht(xe(this,zt)[e],()=>{const{childNodes:t}=this,i=e+(e<0?t.length:0);let n=this.getAttribute("padding");for(let r=0;r<i;r++)I.viewOnly&&(xe(this,zt)[r]=[pe.rev,n]),n+=t[r].toString().length+this.getGaps(r);return n},t=>{xe(this,zt)[e]=t})}getAbsoluteIndex(){return ht(xe(this,Ut),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{Ne(this,Ut,e)})}getBoundingClientRect(){return{...this.getDimension(),...this.getRootNode().posFromIndex(this.getAbsoluteIndex())}}is(e){return this.type===e}getLines(){{const e=[];let t=0;for(const i of String(this).split(`
|
|
2
|
+
`)){const n=t+i.length;e.push([i,t,n]),t=n+1}return e}}seal(e,t){{if(I.internal)return;const i=!t&&!!this[e];i||Object.defineProperty(this,e,{enumerable:i,configurable:!0})}}lspError(e){throw new Error(`${e} method is only available in the LSP version!`)}},Ht=ae(null),Ai=new WeakMap,Wt=new WeakMap,Mt=new WeakMap,ki=new WeakMap,Ut=new WeakMap,zt=new WeakMap,re(Ht,1,"getLines",Fr,lt),lt=re(Ht,0,"AstNode",Er,lt),ne(Ht,1,lt)}}),Ga,Xu=N({"mixin/elementLike.ts"(){"use strict";Ua(),Ga=e=>{var t,kn;{class n extends e{constructor(){super(...arguments);R(this,t)}getElementBy(l){const a=[...this.childNodes].reverse();for(;a.length>0;){const d=a.pop(),{type:o,childNodes:u}=d;if(o!=="text"){if(l(d))return d;for(let c=u.length-1;c>=0;c--)a.push(u[c])}}}querySelector(l){return this.getElementBy(j(this,t,kn).call(this,l))}getElementsBy(l){const a=[...this.childNodes].reverse(),d=[];for(;a.length>0;){const o=a.pop(),{type:u,childNodes:c}=o;if(u!=="text"){l(o)&&d.push(o);for(let m=c.length-1;m>=0;m--)a.push(c[m])}}return d}querySelectorAll(l){return this.getElementsBy(j(this,t,kn).call(this,l))}escape(){for(const l of this.childNodes)l.escape()}}return t=new WeakSet,kn=function(l){return Zn(l,this)},n}}}}),jr,ns,Rr,Kt,Ku=N({"lib/element.ts"(){"use strict";ve(),Ie(),Ua(),Da(),Xu(),jr=[Ga],Kt=class extends(Rr=lt){get length(){return this.childNodes.length}text(e){return pt(this.childNodes,e)}removeAt(e){return bi(this,e,1)[0]}insertAt(e,t=this.length){return bi(this,t,0,[e]),e}closest(e){const t=Zn(e,this);let{parentNode:i}=this;for(;i;){if(t(i))return i;({parentNode:i}=i)}}isInside(e){var t;return((t=this.closest(`${e},ext`))==null?void 0:t.type)===e}append(...e){this.safeAppend(e)}safeAppend(e){for(const t of e)this.insertAt(t)}safeReplaceChildren(e){for(let t=this.length-1;t>=0;t--)this.removeAt(t);this.safeAppend([...e])}setText(e,t=0){t+=t<0?this.length:0;const i=this.childNodes[t],{data:n}=i;return i.replaceData(e),n}toString(e,t=""){return this.childNodes.map(i=>i.toString(e)).join(t)}caretPositionFromIndex(e){{if(e===void 0)return;const{length:t}=this.toString();if(e>t||e<-t)return;e+=e<0?t:0;let i=this,n=0,r=0;for(;i.type!=="text";){const{childNodes:s}=i;n+=i.getAttribute("padding");for(let l=0;n<=e&&l<s.length;l++){const a=s[l],{nextSibling:d}=a,o=a.toString(),u=o.length;if(a.setAttribute("aIndex",n),n+=u,n>e||n===e&&u>0&&(!d||d.type==="text"||a.type!=="text"&&(o.trim()||!d.toString().trim()))){i=a,n-=u,r=n;break}n+=i.getGaps(l)}if(i.childNodes===s)return{offsetNode:i,offset:e-r}}return{offsetNode:i,offset:e-r}}this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(e){var t;{const i=(t=this.caretPositionFromIndex(e))==null?void 0:t.offsetNode;return(i==null?void 0:i.type)==="text"?i.parentNode:i}this.lspError("AstElement.elementFromIndex")}elementFromPoint(e,t){return this.elementFromIndex(this.indexFromPos(t,e))}lint(e=this.getAbsoluteIndex(),t){{const i=[];for(let n=0,r=e+this.getAttribute("padding");n<this.length;n++){const s=this.childNodes[n];s.setAttribute("aIndex",r);const l=s.lint(r,t);l.length>0&&Array.prototype.push.apply(i,l),r+=s.toString().length+this.getGaps(n)}return i}}print(e={}){{const t=e.class;return this.toString()?(t===""?"":`<span class="wpb-${t!=null?t:this.type}${this.getAttribute("invalid")?" wpb-invalid":""}">`)+Rt(this.childNodes,e)+(t===""?"":"</span>"):""}}json(e,t=this.getAbsoluteIndex()){{const i={...this,type:this.type,range:[t,t+this.toString().length],childNodes:[]};for(let n=0,r=t+this.getAttribute("padding");n<this.length;n++){const s=this.childNodes[n],{length:l}=s.toString();s.setAttribute("aIndex",r),i.childNodes.push(s.type==="text"?{data:s.data,range:[r,r+l]}:s.json(void 0,r)),r+=l+this.getGaps(n)}return i}}},ns=ae(Rr),Kt=re(ns,0,"AstElement",jr,Kt),ne(ns,1,Kt)}}),yi,Vi=N({"mixin/gapped.ts"(){"use strict";yi=(e=1)=>t=>{class i extends t{getGaps(){return e}}return i}}}),Ce,Le=N({"mixin/noEscape.ts"(){"use strict";Ce=e=>{{class t extends e{escape(){}}return t}}}}),Pr,Va,Yu=N({"src/parameter.ts"(){"use strict";ve(),J(),D(),Q(),Pr=new RegExp(`https?://${Ft}${Et}$`,"iu"),Va=class extends z{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){var e;try{return!!((e=this.parentNode)!=null&&e.getDuplicatedArgs().some(([t])=>t===this.name))}catch{return!1}}constructor(e,t,i,n=[]){super(void 0,i,n);const r=new z(typeof e=="number"?void 0:e,i,n,{}),s=new z(t,i,n);r.type="parameter-key",r.setAttribute("stage",2),s.type="parameter-value",s.setAttribute("stage",2),this.append(r,s)}trimName(e,t=!0){const i=(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",i),i}afterBuild(){if(!this.anon){const{parentNode:e,firstChild:t}=this,i=this.trimName(t);e&&e.getArgs(i,!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 n=super.lint(e,t),r="unescaped",{lintConfig:s}=I,l=s.getSeverity(r);if(l){const{firstChild:a}=this,d=(i=Pr.exec(a.text()))==null?void 0:i[0];try{if(d&&new URL(d).search){const o=V(a,{start:e},r,"unescaped-query",l);o.startIndex=o.endIndex,o.startLine=o.endLine,o.startCol=o.endCol,o.endIndex++,o.endCol++,(s.computeEditInfo||s.fix)&&(o.fix=Pt(o.startIndex,"{{=}}")),n.push(o)}}catch{}}return n}}print(){return super.print({sep:this.anon?"":"="})}json(e,t=this.getAbsoluteIndex()){{const i=super.json(void 0,t);return Object.assign(i,{anon:this.anon},this.duplicated&&{duplicated:!0}),i}}}}}),Me,ft=N({"src/atom.ts"(){"use strict";var e,t;Q(),Me=(t=class extends z{constructor(n,r,s,l,a){super(n,s,l,a);R(this,e);F(this,e,r)}get type(){return b(this,e)}set type(n){F(this,e,n)}getAttribute(n){var r;return n==="invalid"?this.type==="converter-flag"&&!!((r=this.parentNode)!=null&&r.isInvalidFlag(this)):super.getAttribute(n)}},e=new WeakMap,t)}}),He,mt=N({"src/syntax.ts"(){"use strict";var e,t;Q(),He=(t=class extends z{constructor(n,r,s,l,a){super(n,s,l,a);R(this,e);F(this,e,r)}get type(){return b(this,e)}lint(n=this.getAbsoluteIndex()){return super.lint(n,!1)}},e=new WeakMap,t)}}),Qa={};oe(Qa,{TranscludeToken:()=>at});var Or,rs,Br,at,Ja=N({"src/transclude.ts"(){"use strict";var e,t,i,n,r,s,Yt,Xa,d;ve(),J(),Ie(),ye(),Vi(),Le(),D(),Q(),Yu(),ft(),mt(),Or=[Ce,yi()],at=(d=class extends(Br=z){constructor(u,c,m,f=[]){var w,A;let y;const S=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(u);S&&(y=Number(S[1]),u=u.replace(`\0${y}h`,f[y].toString().replace(/^\n/u,"")));super(void 0,m,f,{});R(this,s);Ee(this,"modifier","");R(this,e,"template");R(this,t,":");R(this,i,!1);R(this,n,new Map);R(this,r);const{parserFunction:$,variable:_,functionHook:T}=m,g=(w=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(u))==null?void 0:w[0];if(g)this.setAttribute("modifier",g),u=u.slice(g.length);else if(u.includes(":")){const[C,...L]=u.split(":"),[q]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((A=L[0])!=null?A:"");this.setModifier(`${C}:${q}`)&&(u=L.join(":").slice(q.length))}const h=u.search(/[::]/u),x=u[h]===":",p=h!==-1;if(p||c.length===0&&!b(this,i)){const C=p?u.slice(0,h):u,L=p&&u.slice(h+1),q=Te(C),B=p?q.slice(q.search(/\S/u))+(x?":":""):q.trim(),[,O,W]=Cu(B,$),E=!("functionHook"in m)||T.includes(W),P=_.includes(W);if(p?W&&E:P){this.setAttribute("name",W),F(this,e,"magic-word"),x&&F(this,t,":");const U=new He(C,"magic-word-name",m,f);if(super.insertAt(U),L!==!1&&c.unshift([L]),this.name==="invoke")for(let M=0;M<2;M++){const ie=c.shift();if(!ie)break;const H=new Me(ie.join("="),`invoke-${M?"function":"module"}`,m,f);super.insertAt(H)}}}if(this.type==="template"){const C=Te(u).trim();if(!this.normalizeTitle(C,10,{halfParsed:!0,temporary:!0}).valid)throw f.pop(),new SyntaxError("Invalid template name");const L=new Me(u,"template-name",m,f,{});super.insertAt(L)}typeof y=="number"&&(f[y]=void 0);const k=this.isTemplate();let v=1;for(let C=0;C<c.length;C++){const L=c[C];k||this.name==="switch"&&C>0||this.name==="tag"&&C>1||(L[0]=L.join("="),L.length=1),L.length===1&&(L.unshift(v),v++),this.insertAt(new Va(...L,m,f))}this.seal("modifier")}get type(){return b(this,e)}get module(){return this.type==="magic-word"&&this.name==="invoke"?j(this,s,Yt).call(this).title:void 0}get function(){var u;return this.type==="magic-word"&&this.name==="invoke"?(u=this.childNodes[2])==null?void 0:u.text().trim():void 0}setModifier(u){const{parserFunction:[,,c,m]}=this.getAttribute("config"),f=Te(u).trim();if(u&&!f.endsWith(":"))return!1;const y=f.slice(0,-1).toLowerCase(),S=c.includes(y),$=m.includes(y);return(b(this,i)?S:$||!u)||(pe.running||this.length>1)&&(S||$||!u)?(this.setAttribute("modifier",u),F(this,i,S),!!u):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0)),super.afterBuild(),this.isTemplate()&&this.type==="template"&&(F(this,r,j(this,s,Yt).call(this)),this.setAttribute("name",b(this,r).title))}toString(u){const{childNodes:c,length:m,firstChild:f,modifier:y,type:S}=this;return`{{${y}${S==="magic-word"?f.toString(u)+(m===1?"":b(this,t))+c.slice(1).map($=>$.toString(u)).join("|"):super.toString(u,"|")}}}`}text(){const{childNodes:u,length:c,firstChild:m,modifier:f,type:y,name:S}=this;return y==="magic-word"&&S==="vardefine"?"":`{{${f}${y==="magic-word"?m.text()+(c===1?"":b(this,t))+pt(u.slice(1),"|"):super.text("|")}}}`}getAttribute(u){switch(u){case"padding":return this.modifier.length+2;case"title":return b(this,r);case"colon":return b(this,t);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!j(this,s,Yt).call(this).valid);default:return super.getAttribute(u)}}lint(u=this.getAbsoluteIndex(),c){{const m=super.lint(u,c);if(!this.isTemplate())return m;const{type:f,childNodes:y,length:S}=this,$=new fe(this,u),{lintConfig:_}=I,{computeEditInfo:T}=_,g=f==="magic-word";let h="no-ignored",x=_.getSeverity(h,"fragment");if(g&&!j(this,s,Yt).call(this).valid)h="invalid-invoke",x=_.getSeverity(h,"name"),x&&m.push(V(y[1],$,h,"illegal-module",x));else if(x){const p=y[g?1:0],k=p.childNodes.findIndex(w=>w.type==="text"&&gi(w.data).includes("#")),v=p.childNodes[k];if(v){const w=V(p,$,h,"useless-fragment",x);T&&(w.suggestions=[ee(w,p.getRelativeIndex(k)+v.data.indexOf("#"))]),m.push(w)}}if(h="invalid-invoke",x=_.getSeverity(h,"function"),x&&g&&S===2)return m.push(Y(this,$,h,"missing-function",x)),m;if(h="no-duplicate",x=_.getSeverity(h,"parameter"),x){const p=this.getDuplicatedArgs().filter(([,v])=>!v[0].querySelector("ext")),k="duplicate-parameter";for(const[,v]of p)Array.prototype.push.apply(m,v.map(w=>{const A=V(w,$,h,k,x);return T&&(A.suggestions=[ee(A,-1)]),A}))}return m}}insertAt(u,c=this.length){return super.insertAt(u,c),u.anon?j(this,s,Xa).call(this,u):u.name&&this.getArgs(u.name,!1,!1).add(u),u}getAllArgs(){return this.childNodes.filter(es("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:u})=>u)}getArgs(u,c,m=!0){const f=String(u).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");let y;return b(this,n).has(f)?y=b(this,n).get(f):(y=new Set(this.getAllArgs().filter(({name:S})=>f===S)),b(this,n).set(f,y)),y}getDuplicatedArgs(){return[...b(this,n)].filter(([,{size:u}])=>u>1).map(([u,c])=>[u,[...c]])}getPossibleValues(){const{type:u,name:c,childNodes:m}=this;if(u==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let f,y;switch(c){case"if":case"ifexist":case"ifexpr":case"iferror":f=2;break;case"ifeq":f=3;break;case"switch":{const S=m.slice(2),$=S[S.length-1];y=[...S.filter(({anon:_})=>!_),...$!=null&&$.anon?[$]:[]].map(({lastChild:_})=>_);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}y!=null||(y=m.slice(f,f+2).map(({lastChild:S})=>S));for(let S=0;S<y.length;){const{length:$,0:_}=y[S].childNodes.filter(T=>T.text().trim());if($===0)y.splice(S,1);else if($>1||!_.is("magic-word"))S++;else try{const T=_.getPossibleValues();Array.prototype.splice.apply(y,[S,1,...T]),S+=T.length}catch{S++}}return y}print(){{const{childNodes:u,length:c,firstChild:m,modifier:f,type:y}=this;return`<span class="wpb-${y}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${y==="magic-word"?pi(f)+m.print()+(c===1?"":b(this,t))+Rt(u.slice(1),{sep:"|"}):(f?`<span class="wpb-magic-word">${pi(f)}</span>`:"")+Rt(u,{sep:"|"})}}}</span>`}}},e=new WeakMap,t=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakMap,s=new WeakSet,Yt=function(){const u=this.type==="template";return this.normalizeTitle((u?"":"Module:")+Te(this.childNodes[u?0:1].text()),10,{temporary:!0,...!u&&{page:""}})},Xa=function(u){const c=this.getAnonArgs(),m=typeof u!="number";for(let f=m?c.indexOf(u):u-1;f<c.length;f++){const y=c[f],{name:S}=y,$=String(f+1);(S!==$||y===u)&&(y.setAttribute("name",$),this.getArgs($,!1,!1).add(y))}},d),rs=ae(Br),at=re(rs,0,"TranscludeToken",Or,at),ne(rs,1,at)}}),$i,ls,qr,Wr,Mr,Ur,as,zr,$n,Zu=N({"lib/text.ts"(){"use strict";var e,_n,i;ve(),J(),Ie(),D(),Da(),$i=String.raw`[${Ye}\t]*`,ls=String.raw`<(?:/[^\S\n]*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|\n={2,}`,qr=new RegExp(String.raw`${ls}|https?[:/]/+|(?:rfc|pmid)(?=[-::]?${$i}\d)|isbn(?=[-::]?${$i}(?:\d(?:${$i}|-)){6})`,"giu"),Wr=new RegExp(ls,"giu"),Mr=new Set(["attr-value","ext-link-text","link-text"]),Ur={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},as=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"]),zr=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch{return/\w/u}})(),$n=(i=class extends lt{constructor(s){super();R(this,e);Ee(this,"data","");this.data=s}get type(){return"text"}toString(s){var l;return s&&!((l=this.parentNode)!=null&&l.getAttribute("built"))?Te(this.data):this.data}text(){return this.data}lint(s=this.getAbsoluteIndex(),l){var a,d,o;{if(l===!1)return[];const{data:u,parentNode:c,nextSibling:m,previousSibling:f}=this;if(!c)throw new Error("An isolated text node cannot be linted!");const{type:y,parentNode:S}=c;if(y==="attr-value"){const{name:O,tag:W}=S;if(W==="ref"&&(O==="name"||O==="follow")||O==="group"&&(W==="ref"||W==="references")||W==="choose"&&(O==="before"||O==="after"))return[]}if(l!=null||(l=c.isPlain()&&!Mr.has(y)?qr:Wr),u.search(l)===-1)return[];l.lastIndex=0;const $=[],_=m==null?void 0:m.type,T=m==null?void 0:m.name,g=f==null?void 0:f.type,h=this.getRootNode(),x=h.toString(),{ext:p,html:k,variants:v}=h.getAttribute("config"),{top:w,left:A}=h.posFromIndex(s),{lintConfig:C}=I,L=C.rules["tag-like"],q=typeof L=="object"&&L[1]?new Set(Object.keys(L[1]).filter(O=>O!=="invalid"&&O!=="disallowed")):new Set,B=new Set(["onlyinclude","noinclude","includeonly",...p,...k[0],...k[1],...k[2],...q,...C.getSeverity("tag-like","disallowed")?as:[]]);for(let O=l.exec(u);O;O=l.exec(u)){const[,W,E]=O;let{index:P,0:U}=O;if(E&&E!=="]"){const{length:me}=E;P+=me,U=U.slice(me)}else U.startsWith(`
|
|
3
|
+
==`)&&(P++,U=U.slice(1));U=U.toLowerCase();const[M]=U,ie=M==="r"||M==="p"||M==="i",H=M==="{",X=M==="}",Z=M==="[",ue=M==="]";let{length:de}=U;if(M==="<"&&!B.has(W.toLowerCase())||Z&&y==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(u.slice(P+1))||m!=null&&m.is("ext")&&T==="nowiki"&&((a=m.innerText)!=null&&a.includes("]"))))continue;ue&&(P||de>1)&&l.lastIndex--;let ce=s+P,le=ce+de,he,we,G,K;const be=x[le],Se=x[ce-1],Fe=H||Z,Ge=H&&Se==="-"&&v.length>0,ke=X&&be==="-"&&v.length>0,te=Z&&_==="free-ext-link"&&!u.slice(P+1).trim()||ue&&g==="free-ext-link"&&!u.slice(0,P).includes("]");if(ie)he="lonely-http",U=U.toUpperCase(),we=C.getSeverity(he,U);else if(M==="<"){he="tag-like";let me;/^<\/?\s/u.test(U)||!/[\s/>]/u.test(be!=null?be:"")?me="invalid":q.has(W)?me=W:as.has(W)&&!p.includes(W)&&(me="disallowed"),we=C.getSeverity(he,me)}else if(M==="=")he="syntax-like",we=C.getSeverity(he,"heading");else if(Ge||ke)he="lonely-bracket",we=C.getSeverity(he,"converter"),Ge&&P>0?(U="-{",P--,ce--,de=2):ke&&P<u.length-1&&(U="}-",le++,de=2);else if(te)he="lonely-bracket",we=C.getSeverity(he,"extLink");else if(Fe||X||ue)if(he="lonely-bracket",de>1||H&&be===M||X&&Se===M)we=C.getSeverity(he,"double");else{if(!Z||y!=="ext-link-text"){const me=Ur[M],je=Fe?u.slice(P+1):u.slice(0,P);if(H&&((d=me.exec(je))==null?void 0:d[0])==="}"||X&&((o=me.exec(je))==null?void 0:o[0])==="{")continue;if(!je.includes(M)){const ze=Fe?"nextSibling":"previousSibling";let Be=this[ze];for(;Be&&(Be.type!=="text"||!me.test(Be.data));)Be=Be[ze];if(Be&&me.exec(Be.data)[0]!==M)continue}}we=C.getSeverity(he,"single")}else he="lonely-http",we=C.getSeverity(he);if(!we)continue;const st=this.posFromIndex(P),{line:qt,character:br}=mi(w,A,st.top+1,st.left);if(M==="="){const me=u.indexOf(`
|
|
4
|
+
`,P);let je=m,ze;if(me===-1){let Be=0;for(;je&&!(je.type==="text"&&(Be=je.data.indexOf(`
|
|
5
|
+
`),Be!==-1));)je=je.nextSibling;if(!je)continue;ze=je.data.slice(0,Be)}else ze=u.slice(P+de,me);if(!/(?:^|[^=])=+\s*(?:\S\s*)?$/u.test(ze))continue;me===-1?(le=je.getAbsoluteIndex()+ze.length,{top:G,left:K}=h.posFromIndex(le)):(le+=ze.length,de+=ze.length)}const nt={rule:he,message:I.msg(M==="="?"header-like":"lonely",ie||M==="h"||Ge||ke?U:M),severity:we,startIndex:ce,endIndex:le,startLine:qt,endLine:G!=null?G:qt,startCol:br,endCol:K!=null?K:br+de};if(C.computeEditInfo)if(M==="<")nt.suggestions=[Pt(ce,"<")];else if(M==="h"&&y!=="link-text"&&zr.test(Se||""))nt.suggestions=[xi(ce)];else if(Z&&y==="ext-link-text"){const me=c.getAbsoluteIndex()+c.toString().length;nt.suggestions=[Pt(me,"]")]}else if(ue&&te){const me=s-f.toString().length;nt.suggestions=[Di(me,"left-bracket","[")]}else ie&&(nt.suggestions=[...O[0]===U?[]:[Xn(nt,U)],...be===":"||be===":"?[xi(le,1)]:[]]);$.push(nt)}return $}}replaceData(s){j(this,e,_n).call(this,s)}splitText(s){{const{parentNode:l,data:a}=this;if(!l)throw new Error("The text node to be split has no parent node!");const d=new i(a.slice(s));return bi(l,l.childNodes.indexOf(this)+1,0,[d]),this.setAttribute("data",a.slice(0,s)),d}this.lspError("AstText.splitText")}escape(){{const{parentNode:s}=this;if(!s)throw new Error("The text node to be escaped has no parent node!");const{TranscludeToken:l}=(Ja(),se(Qa)),a=s.getAttribute("config"),d=s.childNodes.indexOf(this)+1,o=m=>Math.max(this.data.lastIndexOf("=",m),this.data.lastIndexOf("|",m));let u=o();const c=(()=>new l(this.data[u]==="="?"=":"!",[],a));for(;u>=0;u=o(u-1))u<this.data.length-1&&this.splitText(u+1),s.insertAt(pe.run(c),d),j(this,e,_n).call(this,this.data.slice(0,u))}}print(){return pi(this.data)}},e=new WeakSet,_n=function(s){this.setAttribute("data",s)},i)}}),tt,xt=N({"mixin/hidden.ts"(){"use strict";tt=(e=!0,t=!0)=>i=>{class n extends i{text(){return""}lint(s){return e?[]:super.lint(s)}}return n}}}),De,it=N({"mixin/padded.ts"(){"use strict";De=({length:e})=>t=>{class i extends t{getAttribute(r){return r==="padding"?e:super.getAttribute(r)}}return i}}}),Hr,os,Dr,Xe,Qi=N({"src/link/base.ts"(){"use strict";var e,t,i,n;J(),Ue(),Ie(),ye(),it(),Le(),D(),Q(),ft(),Hr=[Ce,De("[[")],Xe=(n=class extends(Dr=z){constructor(s,l,a,d=[],o="|"){super(void 0,a,d,{});R(this,e,!0);R(this,t);R(this,i);if(this.insertAt(new Me(s,"link-target",a,d,{})),l!==void 0){const u=new z(l,a,d,{});u.type="link-text",u.setAttribute("stage",$e-1),this.insertAt(u)}F(this,t,o)}get link(){return b(this,i)}get fragment(){return b(this,i).fragment}afterBuild(){F(this,i,this.getTitle()),b(this,t).includes("\0")&&F(this,t,this.buildFromStr(b(this,t),0)),this.setAttribute("name",b(this,i).title),super.afterBuild()}setAttribute(s,l){s==="bracket"?F(this,e,l):s==="title"?F(this,i,l):super.setAttribute(s,l)}toString(s){const l=super.toString(s,b(this,t));return b(this,e)?`[[${l}]]`:l}text(){const s=super.text("|");return b(this,e)?`[[${s}]]`:s}getAttribute(s){return s==="title"?b(this,i):super.getAttribute(s)}getGaps(s){return s===0?b(this,t).length:1}lint(s=this.getAbsoluteIndex(),l){{const a=super.lint(s,l),{childNodes:[d,o],type:u}=this,{encoded:c,fragment:m}=b(this,i),{lintConfig:f}=I,{computeEditInfo:y,fix:S}=f,$=new fe(this,s);let _="unknown-page",T=f.getSeverity(_);if(T&&d.childNodes.some(({type:g})=>g==="template")&&a.push(V(d,$,_,"template-in-link",T)),_="url-encoding",T=f.getSeverity(_),T&&c){const g=V(d,$,_,"unnecessary-encoding",T);(y||S)&&(g.fix=Vn(g,d)),a.push(g)}if(_="pipe-like",T=f.getSeverity(_,"link"),T&&(u==="link"||u==="category")){const g=o==null?void 0:o.childNodes.findIndex(x=>x.type==="text"&&x.data.includes("|")),h=o==null?void 0:o.childNodes[g];if(h){const x=V(o,$,_,"pipe-in-link",T);if(y){const p=x.startIndex+o.getRelativeIndex(g);x.suggestions=[Kn(p,h.data)]}a.push(x)}}if(_="no-ignored",T=f.getSeverity(_,"fragment"),T&&m!==void 0&&!Tu(u)){const g=V(d,$,_,"useless-fragment",T);if(y||S){const h=d.childNodes.findIndex(p=>p.type==="text"&&p.data.includes("#")),x=d.childNodes[h];x&&(g.fix=ee(g,d.getRelativeIndex(h)+x.data.indexOf("#")))}a.push(g)}return a}}getTitle(s,l){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:l,temporary:s,decode:!0,selfLink:!0})}print(){return super.print(b(this,e)?{pre:"[[",post:"]]",sep:b(this,t)}:{sep:b(this,t)})}json(s,l=this.getAbsoluteIndex()){{const a=super.json(void 0,l),{type:d,fragment:o}=this;return o!==void 0&&(d==="link"||d==="redirect-target")&&(a.fragment=o),a}}},e=new WeakMap,t=new WeakMap,i=new WeakMap,n),os=ae(Dr),Xe=re(os,0,"LinkBaseToken",Hr,Xe),ne(os,1,Xe)}}),Gr,us,Vr,We,vt=N({"src/nowiki/base.ts"(){"use strict";Le(),Q(),Gr=[Ce],We=class extends(Vr=z){get innerText(){return this.firstChild.data}constructor(e="",t,i){super(e,t,i)}},us=ae(Vr),We=re(us,0,"NowikiBaseToken",Gr,We),ne(us,1,We)}}),Qr,ds,Jr,Oe,Bt=N({"src/nowiki/noinclude.ts"(){"use strict";J(),xt(),D(),vt(),Qr=[tt(!1)],Oe=class extends(Jr=We){get type(){return"noinclude"}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){{const{lintConfig:t}=I,i="no-ignored",n=t.getSeverity(i,"include");if(n){const{innerText:r}=this,s=/^<(noinclude|includeonly|onlyinclude)\s+(?:[^\s>/]|\/(?!>))[^>]*>$/iu.exec(r);if(s){const l=Y(this,{start:e},i,"useless-attribute",n),{computeEditInfo:a}=t,d=s[1].length+1,o=r.endsWith("/>")?2:1;return l.startIndex+=d,l.startCol+=d,l.endIndex-=o,l.endCol-=o,a&&(l.suggestions=[ee(l)]),[l]}}return[]}}},ds=ae(Jr),Oe=re(ds,0,"NoincludeToken",Qr,Oe),ne(ds,1,Oe)}}),Ka,ed=N({"src/link/redirectTarget.ts"(){"use strict";J(),D(),Qi(),Bt(),Ka=class extends Xe{get type(){return"redirect-target"}constructor(e,t,i,n){super(e,void 0,i,n),t!==void 0&&this.insertAt(new Oe(t,i,n))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,{halfParsed:!0,decode:!0,page:""})}lint(e=this.getAbsoluteIndex()){{const t=super.lint(e,!1),i="no-ignored",{lintConfig:n}=I,r=n.getSeverity(i,"redirect");if(r&&this.length===2){const s=V(this.lastChild,{start:e},i,"useless-link-text",r);s.startIndex--,s.startCol--,(n.computeEditInfo||n.fix)&&(s.fix=ee(s)),t.push(s)}return t}}}}}),Xr,cs,Kr,Zt,td=N({"src/redirect.ts"(){"use strict";var e,t,i;xt(),Le(),Q(),mt(),ed(),Xr=[tt(!1,!1),Ce],Zt=(i=class extends(Kr=z){constructor(r,s,l,a,d,o,u=[]){super(void 0,o,u);R(this,e);R(this,t);F(this,e,r),F(this,t,d),this.append(new He(s,"redirect-syntax",o,u),new Ka(l,a==null?void 0:a.slice(1),o,u))}get type(){return"redirect"}getAttribute(r){return r==="padding"?b(this,e).length:super.getAttribute(r)}toString(r){return b(this,e)+super.toString(r)+b(this,t)}lint(r=this.getAbsoluteIndex()){{const s=r+b(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",s),this.lastChild.lint(s)}}print(){return super.print({pre:b(this,e),post:b(this,t)})}},e=new WeakMap,t=new WeakMap,i),cs=ae(Kr),Zt=re(cs,0,"RedirectToken",Xr,Zt),ne(cs,1,Zt)}}),Ya={};oe(Ya,{parseRedirect:()=>Za});var Za,id=N({"parser/redirect.ts"(){"use strict";D(),td(),Za=(e,t,i)=>{var r;(r=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&&I.normalizeTitle(n[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,page:""}).valid?(e=`\0${i.length}o${e.slice(n[0].length)}`,new Zt(...n.slice(1),t,i),e):!1}}}),Yr,hs,Zr,ei,sd=N({"src/onlyinclude.ts"(){"use strict";it(),Le(),Q(),Yr=[Ce,De("<onlyinclude>")],ei=class extends(Zr=z){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>'})}},hs=ae(Zr),ei=re(hs,0,"OnlyincludeToken",Yr,ei),ne(hs,1,ei)}}),el,gs,tl,ot,tr=N({"src/tagPair/index.ts"(){"use strict";var e,t;Vi(),Le(),Q(),el=[yi(),Ce],ot=(t=class extends(tl=z){constructor(n,r,s,l,a,d=[]){super(void 0,a);R(this,e);Ee(this,"closed");Ee(this,"selfClosing");this.setAttribute("name",n.toLowerCase()),F(this,e,[n,l||n]),this.closed=l!=="",this.selfClosing=l===void 0,this.append(r,s);const o=typeof r=="string"?-1:d.indexOf(r);d.splice(o===-1?1/0:o,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(n){const{selfClosing:r,firstChild:s,lastChild:l}=this,[a,d]=b(this,e);return r?`<${a}${s.toString(n)}/>`:`<${a}${s.toString(n)}>${l.toString(n)}${this.closed?`</${d}>`:""}`}text(){const[n,r]=b(this,e);return this.selfClosing?`<${n}${this.firstChild.text()}/>`:`<${n}${super.text(">")}${this.closed?`</${r}>`:""}`}getAttribute(n){return n==="padding"?b(this,e)[0].length+1:super.getAttribute(n)}print(){{const[n,r]=b(this,e);return super.print(this.selfClosing?{pre:`<${n}`,post:"/>"}:{pre:`<${n}`,sep:">",post:this.closed?`</${r}>`:""})}}},e=new WeakMap,t),gs=ae(tl),ot=re(gs,0,"TagPairToken",el,ot),ne(gs,1,ot)}}),il,ps,sl,ti,nd=N({"src/tagPair/include.ts"(){"use strict";J(),ye(),xt(),D(),tr(),il=[tt(!1)],ti=class extends(sl=ot){get type(){return"include"}constructor(e,t="",i,n,r,s){super(e,t,i!=null?i:"",i===void 0||n!=null?n:"",r,s)}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){{const t=[],{firstChild:i,closed:n,name:r}=this,s=new fe(this,e),l=["no-ignored","unclosed-comment"],{lintConfig:a}=I,{computeEditInfo:d}=a,o=l.map(u=>a.getSeverity(u,"include"));if(o[0]&&i.data.trim()){const u=V(i,s,l[0],"useless-attribute",o[0]);d&&(u.suggestions=[ee(u)]),t.push(u)}if(o[1]&&!n){const u=Y(this,s,l[1],I.msg("unclosed",`<${r}>`),o[1]);d&&(u.suggestions=[Ze(u.endIndex,`</${r}>`)]),t.push(u)}return t}}},ps=ae(sl),ti=re(ps,0,"IncludeToken",il,ti),ne(ps,1,ti)}}),Ji,ir=N({"mixin/attributesParent.ts"(){"use strict";Ji=(e=0)=>t=>{var i,Tn;{class r extends t{constructor(){super(...arguments);R(this,i)}hasAttr(a){return j(this,i,Tn).call(this).hasAttr(a)}getAttr(a){return j(this,i,Tn).call(this).getAttr(a)}}return i=new WeakSet,Tn=function(){return this.childNodes[e]},r}}}}),ge,fs,ms,Dt,_i,xs,Gt,vs,bs,ys,Ti,ws,Ss,As,Ve,sr,nr,rr,eo,to=N({"util/sharable.ts"(){"use strict";ge=new Set(["align"]),fs=new Set(["cite"]),ms=new Set(["cite","datetime"]),Dt=new Set(["width"]),_i=new Set(["axis","align","bgcolor","height","width","valign"]),xs=new Set([..._i,"abbr","headers","scope","rowspan","colspan"]),Gt=new Set(["type"]),vs=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),bs=new Set(["clear"]),ys=new Set(["bgcolor","align","valign"]),Ti=new Set(["id","qid","forcemathmode","type","display"]),ws=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),Ss=new Set(["weight"]),As=new Set(["width","height","zoom","latitude","longitude","align","mapstyle","lang","alt","text"]),Ve=new Set,sr=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"]),nr={div:ge,h1:ge,h2:ge,h3:ge,h4:ge,h5:ge,h6:ge,blockquote:fs,q:fs,p:ge,br:bs,pre:Dt,ins:ms,del:ms,ul:Gt,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...vs,"border"]),caption:ge,tr:ys,td:xs,th:xs,font:new Set(["size","color","face"]),hr:Dt,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Gt,poem:ge,categorytree:ge,combooption:ge,img:new Set(["alt","src","width","height","loading","srcset"])},rr={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:Ve,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:Ss,choicetemplate:Ss,imagemap:Ve,inputbox:Ve,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:Ve,poll:new Set(["id","show-results-before-voting"]),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([...Ti,"chem"]),chem:Ti,ce:Ti,hiero:Ve,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:ws,syntaxhighlight:ws,templatedata:Ve,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:Ve,mapframe:new Set([...As,"frameless"]),maplink:new Set([...As,"class"]),rss:new Set(["template","templatename","max","highlight","filter","filterout","reverse","date","item-max-length"]),"page-collection":new Set(["lang","name","description","end-date"])},eo={table:vs,td:new Set([..._i,"scope"]),th:_i,br:bs,caption:ge,div:ge,hr:Dt,h1:ge,h2:ge,h3:ge,h4:ge,h5:ge,h6:ge,li:Gt,p:ge,pre:Dt,tr:ys,ul:Gt}}}),nl,rl,ll,al,Pi,rd=N({"src/attribute.ts"(){"use strict";var e,t,i,n,r,io,Cn,a;J(),ve(),Ue(),to(),ye(),D(),Q(),ft(),nl=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,rl=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,ll=new Set(["ext","arg","magic-word","template"]),al=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),Pi=(a=class extends z{constructor(o,u,c,m="",f,y=[],S=I.getConfig(),$=[]){const _=new Me(c,"attr-key",S,$);let T;if(c==="title"||u==="img"&&c==="alt")T=new z(f,S,$,{}),T.type="attr-value",T.setAttribute("stage",$e-1);else if(u==="gallery"&&c==="caption"||u==="ref"&&c==="details"||(u==="mapframe"||u==="maplink")&&c==="text"||u==="choose"&&(c==="before"||c==="after")){const g={...S,excludes:[...S.excludes,"heading","html","table","hr","list"]};T=new z(f,g,$,{}),T.type="attr-value",T.setAttribute("stage",1)}else T=new Me(f,"attr-value",S,$,{});super(void 0,S,$);R(this,r);R(this,e);R(this,t);R(this,i);R(this,n);F(this,e,o),this.append(_,T),F(this,i,m),F(this,n,[...y]),F(this,t,u),this.setAttribute("name",jt(Te(c)))}get type(){return b(this,e)}get tag(){return b(this,t)}get balanced(){return!b(this,i)||b(this,n)[0]===b(this,n)[1]}afterBuild(){b(this,i).includes("\0")&&F(this,i,this.buildFromStr(b(this,i),0)),this.parentNode&&F(this,t,this.parentNode.name),j(this,r,io).call(this),super.afterBuild()}toString(o){const[u="",c=""]=b(this,n);return b(this,i)?super.toString(o,b(this,i)+u)+c:this.firstChild.toString(o)}text(){return b(this,i)?`${super.text(`${b(this,i).trim()}"`)}"`:this.firstChild.text()}getGaps(){var o,u;return b(this,i)?b(this,i).length+((u=(o=b(this,n)[0])==null?void 0:o.length)!=null?u:0):0}lint(o=this.getAbsoluteIndex(),u){var c;{const m=super.lint(o,u),{balanced:f,firstChild:y,lastChild:S,name:$,tag:_}=this,T=new fe(this,o),g=["unclosed-quote","obsolete-attr"],{lintConfig:h}=I,x=g.map(k=>h.getSeverity(k,$));if(x[0]&&!f){const k=V(S,T,g[0],"unclosed-quotes",x[0]);k.startIndex--,k.startCol--,h.computeEditInfo&&(k.suggestions=[Ze(k.endIndex,b(this,n)[0])]),m.push(k)}const p=j(this,r,Cn).call(this,o,T);return p&&m.push(p),x[1]&&((c=eo[_])!=null&&c.has($))&&m.push(V(y,T,g[1],"obsolete-attribute",x[1])),m}}getValue(){return b(this,i)?this.lastChild.text().trim():this.type==="ext-attr"||""}escape(){this.type!=="ext-attr"&&(F(this,i,"{{=}}"),this.lastChild.escape())}getAttribute(o){return o==="invalid"?j(this,r,Cn).call(this):super.getAttribute(o)}print(){{const[o="",u=""]=b(this,n);return b(this,i)?super.print({sep:pi(b(this,i))+o,post:u}):super.print()}}json(o,u=this.getAbsoluteIndex()){{const c=super.json(void 0,u);return c.tag=this.tag,c}}},e=new WeakMap,t=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakSet,io=function(){this.setAttribute("name",jt(this.firstChild.text()))},Cn=function(o,u){const{firstChild:c,lastChild:m,type:f,name:y,tag:S,parentNode:$}=this,_=!m.childNodes.some(({type:w})=>ll.has(w)),T=this.getValue(),g=rr[S],h=nr[S],{length:x}=this.toString();let p="illegal-attr",k,v;if({lintConfig:k}=I,{computeEditInfo:v}=k,!(g!=null&&g.has(y))&&!(h!=null&&h.has(y))&&(f==="ext-attr"?g||h:!/\{\{[^{]+\}\}/u.test(y))&&(f==="ext-attr"&&!h||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(y)&&(S==="meta"||S==="link"||!sr.has(y)))||(y==="itemtype"||y==="itemid"||y==="itemref")&&!($!=null&&$.hasAttr("itemscope"))){if(o===void 0)return!0;{const w=k.getSeverity(p,"unknown");if(w){const A=V(c,u,p,"illegal-attribute-name",w);return v&&(A.suggestions=[ee(o,x)]),A}}}else if(y==="style"&&typeof T=="string"&&nl.test(T)){if(o===void 0)return!0;{p="insecure-style";const w=k.getSeverity(p);return w&&V(m,u,p,"insecure-style",w)}}else if(y==="tabindex"&&typeof T=="string"&&T!=="0"){if(o===void 0)return!0;{const w=k.getSeverity(p,"tabindex");if(w){const A=V(m,u,p,"nonzero-tabindex",w);return v&&(A.suggestions=[ee(o,x),qe(A,"0 tabindex","0")]),A}}}else if(typeof T=="string"&&((/^xmlns:[\w:.-]+$/u.test(y)||al.has(y))&&rl.test(T)||_&&(y==="href"||S==="img"&&y==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(T))){if(o===void 0)return!0;{const w=k.getSeverity(p,"value");return w&&V(m,u,p,"illegal-attribute-value",w)}}else if(_&&f!=="ext-attr"){const w=Yn(S,y),A=String(T).toLowerCase();if(w.length>0&&w.every(C=>C!==A)){if(o===void 0)return!0;{const C=k.getSeverity(p,"value");return C&&V(m,u,p,"illegal-attribute-value",C)}}}return!1},a)}}),ks,ol,ul,Xi,lr=N({"src/attributes.ts"(){"use strict";var e,t,Oi,n;J(),ve(),ye(),D(),Q(),ft(),rd(),ks=r=>r.slice(0,-1),ol=r=>`${ks(r)}-dirty`,ul=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch{return/[^\W_]/u}})(),Xi=(n=class extends z{constructor(s,l,a,d,o=[]){super(void 0,d,o,{});R(this,t);R(this,e);if(F(this,e,l),this.setAttribute("name",a),s){const u=/([^\s/](?:(?!\0\d+~\x7F)[^\s/=])*)(?:((?:\s(?:\s|\0\d+[cn]\x7F)*)?(?:=|\0\d+~\x7F)(?:\s|\0\d+[cn]\x7F)*)(?:(["'])([\s\S]*?)(\3|$)|(\S*)))?/gu;let c="",m=u.exec(s),f=0;const y=(()=>{c&&(super.insertAt(new Me(c,ol(l),d,o,{})),c="")});for(;m;){const{index:S,0:$,1:_,2:T,3:g,4:h,5:x,6:p}=m;if(c+=s.slice(f,S),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(Te(_).trim())){const k=h!=null?h:p,v=[g,x],w=new Pi(ks(l),a,_,T,k,v,d,o);y(),super.insertAt(w)}else c+=$;({lastIndex:f}=u),m=u.exec(s)}c+=s.slice(f),y()}}get type(){return b(this,e)}afterBuild(){const{parentNode:s}=this;s!=null&&s.is("td")&&this.setAttribute("name",s.subtype),super.afterBuild()}getAttrTokens(s){return this.childNodes.filter(l=>l instanceof Pi&&(!s||l.name===jt(s)))}hasAttr(s){return this.getAttrTokens(s).length>0}getAttrToken(s){{const l=this.getAttrTokens(s);return l[l.length-1]}}getAttr(s){var l;return(l=this.getAttrToken(s))==null?void 0:l.getValue()}lint(s=this.getAbsoluteIndex(),l){{const a=super.lint(s,l),{parentNode:d,childNodes:o}=this,u=new Map,c=new Set,m=new fe(this,s),f=["no-ignored","no-duplicate"],{lintConfig:y}=I,{computeEditInfo:S,fix:$}=y,_=["closingTag","invalidAttributes","nonWordAttributes"].map(g=>y.getSeverity(f[0],g));if(_[0]&&j(this,t,Oi).call(this)){const g=Y(this,m,f[0],"attributes-of-closing-tag",_[0]);if(S){const h=d.getAbsoluteIndex();g.suggestions=[ee(g),Qn(h)]}a.push(g)}for(const g of o)if(g instanceof Pi){const{name:h}=g;u.has(h)?(c.add(h),u.get(h).push(g)):u.set(h,[g])}else{const h=g.text().trim(),x=_[ul.test(h)?1:2];if(h&&x){const p=V(g,m,f[0],"invalid-attribute",x);S&&(p.suggestions=[ee(p,0," ")]),a.push(p)}}const T=y.getSeverity(f[1],"attribute");if(T&&c.size>0)for(const g of c){const h=u.get(g).map(x=>{const p=x.getValue();return[x,p===!0?"":p]});Array.prototype.push.apply(a,h.map(([x,p],k)=>{const v=V(x,m,f[1],I.msg("duplicate-attribute",g),T);if(S||$){const w=ee(v);!p||h.slice(0,k).some(([,A])=>A===p)?v.fix=w:S&&(v.suggestions=[w])}return v}))}return a}}escape(){this.type!=="ext-attrs"&&super.escape()}getAttribute(s){return s==="invalid"?j(this,t,Oi).call(this):super.getAttribute(s)}print(){return this.toString()?`<span class="wpb-${this.type}${j(this,t,Oi).call(this)?" wpb-invalid":""}">${this.childNodes.map(s=>s.print(s instanceof Me?{class:s.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,Oi=function(){const{parentNode:s}=this;return(s==null?void 0:s.type)==="html"&&s.closing&&this.text().trim()!==""},n)}}),so={};oe(so,{PreToken:()=>no});var no,ld=N({"src/pre.ts"(){"use strict";Ue(),Q(),Bt(),no=class extends z{get type(){return"ext-inner"}constructor(e,t,i=[]){if(e){const n=/<nowiki>/giu,r=/<\/nowiki>/giu,{length:s}=n.source;let l=n.exec(e);l&&(r.lastIndex=l.index+s);let a=r.exec(e),d=0,o="";for(;l&&a;)new Oe(l[0],t,i,!0),new Oe(a[0],t,i,!0),o+=`${e.slice(d,l.index)}\0${i.length-1}n${e.slice(l.index+s,a.index)}\0${i.length}n`,d=a.index+s+1,n.lastIndex=d,l=n.exec(e),l&&(r.lastIndex=l.index+s),a=r.exec(e);e=o+e.slice(d)}super(e,t,i,{}),this.setAttribute("stage",$e-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),Ki,ar=N({"src/multiLine/index.ts"(){"use strict";Q(),Ki=class extends z{get type(){return"ext-inner"}toString(e){return super.toString(e,`
|
|
6
6
|
`)}text(){return super.text(`
|
|
7
7
|
`).replace(/\n\s*\n/gu,`
|
|
8
8
|
`)}getGaps(){return 1}print(){return super.print({sep:`
|
|
9
|
-
`})}}}}),
|
|
10
|
-
`).map(
|
|
11
|
-
`,index:e.length},
|
|
12
|
-
`){
|
|
13
|
-
`)||(e=`${e.slice(0,
|
|
14
|
-
)`:""}(\s*)$`,"u")),
|
|
15
|
-
`))!=null?
|
|
16
|
-
`),r=new Set(t.protocol.split("|"));let i=!0,l=!1;for(const a of n){const u=a.trim();if(!(l||!u||u.startsWith("#"))){if(i){const o=a.indexOf("|"),d=o===-1?a:a.slice(0,o),{valid:c,ns:f}=this.normalizeTitle(d,0,{halfParsed:!0,temporary:!0,page:""});if(c&&f===6){const g=new Tt("imagemap",d,o===-1?void 0:a.slice(o+1),t,s);super.insertAt(g),i=!1;continue}else l=!0}else if(a.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(a);continue}else if(a.includes("[")){const o=a.indexOf("["),d=a.slice(o),c=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(d);if(c){if(this.normalizeTitle(c[1],0,{halfParsed:!0,temporary:!0,selfLink:!0,page:""}).valid){super.insertAt(new Tn(a.slice(0,o),c.slice(1),d.slice(d.indexOf("]]")+2),t,s));continue}}else if(d.startsWith("[//")||r.has(d.slice(1,d.indexOf(":")+1))||r.has(d.slice(1,d.indexOf("//")+2))){const f=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(d);if(f){super.insertAt(new Tn(a.slice(0,o),f.slice(1),d.slice(d.indexOf("]")+1),t,s));continue}}}}super.insertAt(new Ms(a,t,s))}}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),n=new pe(this,e),{childNodes:r,image:i}=this,l="invalid-imagemap",{lintConfig:a}=N,u=a.getSeverity(l,i?"link":"image");return u&&(i?Array.prototype.push.apply(s,r.filter(o=>{const d=o.toString().trim();return o.is("noinclude")&&d&&!d.startsWith("#")}).map(o=>{const d=Q(o,n,l,"invalid-imagemap-link",u);return a.computeEditInfo&&(d.suggestions=[ee(d,-1),Be(d,"comment","# ")]),d})):s.push(Z(this,n,l,"imagemap-without-image",u))),s}}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}}}}),Il,Wi,Nl,It,So=I({"src/nowiki/comment.ts"(){"use strict";X(),xt(),st(),D(),vt(),Il=[tt(!1),Ge("<!--")],It=class extends(Nl=qe){constructor(t,s,n,r){super(t,n,r);Ne(this,"closed");this.closed=s}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){{if(this.closed)return[];const s="unclosed-comment",{lintConfig:n}=N,r=n.getSeverity(s);if(!r)return[];const i=Z(this,{start:t},s,"unclosed-comment",r);return n.computeEditInfo&&(i.suggestions=[Ze(i.endIndex,"-->")]),[i]}}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}},Wi=oe(Nl),It=le(Wi,0,"CommentToken",Il,It),re(Wi,1,It)}}),Ao={};ae(Ao,{CommentedToken:()=>ko});var ko,ld=I({"src/commented.ts"(){"use strict";J(),So(),ko=class extends z{get type(){return"ext-inner"}constructor(e,t,s=[]){if(super(void 0,t,s,{AstText:":",CommentToken:":"}),e){let n=e.indexOf("<!--"),r=n!==-1&&e.indexOf("-->",n+4),i=0;for(;r!==!1&&r!==-1;)n>i&&this.insertAt(e.slice(i,n)),this.insertAt(new It(e.slice(n+4,r),!0,t,s)),i=r+3,n=e.indexOf("<!--",i),r=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"))}}}}),$o={};ae($o,{NowikiToken:()=>_o});var Ll,Fl,_o,ad=I({"src/nowiki/index.ts"(){"use strict";var e,Cn,s;et(),X(),D(),vt(),Ll=ct(n=>new RegExp(String.raw`<\s*(?:/\s*)${n==="nowiki"?"":"?"}(${n})\b`,"giu")),Fl=new Set(["languages","section","templatestyles"]),_o=(s=class extends qe{constructor(){super(...arguments);R(this,e)}get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex()){{const{name:i}=this,{lintConfig:l}=N;let a="void-ext",u=l.getSeverity(a,i);if(u&&j(this,e,Cn).call(this)){const d=Z(this,{start:r},a,N.msg("nothing-in",i),u);return l.computeEditInfo&&(d.suggestions=[ee(d)]),[d]}return super.lint(r,Ll(i))}}getAttribute(r){return r==="invalid"?j(this,e,Cn).call(this):super.getAttribute(r)}},e=new WeakSet,Cn=function(){const{name:r,firstChild:{data:i}}=this;return Fl.has(r)&&!!i},s)}}),El,Ui,jl,Nt,To=I({"src/tagPair/ext.ts"(){"use strict";X(),be(),D(),Kn(),J(),Jn(),tr(),El=[Qs()],Nt=class extends(jl=ut){get type(){return"ext"}constructor(e,t,s,n,r=N.getConfig(),i=!1,l=[]){const a=e.toLowerCase(),u=new Js(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",a,r,l),o={...r,ext:r.ext.filter(c=>c!==a),excludes:[...r.excludes],inExt:!0};let d;switch(a){case"tab":o.ext=o.ext.filter(c=>c!=="tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":a==="poem"&&o.excludes.push("heading"),d=new z(s,o,l);break;case"pre":{const{PreToken:c}=(Ku(),se(Xa));d=new c(s,o,l);break}case"dynamicpagelist":{const{ParamTagToken:c}=(eo(),se(Za));d=new c(i,s,o,l);break}case"inputbox":{const{InputboxToken:c}=(td(),se(no));d=new c(i,s,o,l);break}case"references":{const{NestedToken:c}=(Ei(),se(Bs));o.excludes.push("heading"),d=new c(s,i,["ref"],o,l);break}case"choose":{const{NestedToken:c}=(Ei(),se(Bs));d=new c(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],o,l);break}case"combobox":{const{NestedToken:c}=(Ei(),se(Bs));d=new c(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],o,l);break}case"gallery":{const{GalleryToken:c}=(id(),se(fo));d=new c(s,o,l);break}case"imagemap":{const{ImagemapToken:c}=(rd(),se(yo));d=new c(s,o,l);break}case"hiero":{const{CommentedToken:c}=(ld(),se(Ao));d=new c(s,o,l);break}default:{const{NowikiToken:c}=(ad(),se($o));d=new c(s,o,l)}}d.setAttribute("name",a),d.type==="plain"&&(d.type="ext-inner"),super(e,u,d,n,r,l),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),{lintConfig:n}=N,r=new pe(this,e);if(this.name!=="nowiki"){const i=this.inHtmlAttrs(),l="parsing-order",a=i&&n.getSeverity(l,i===2?"ext":"templateInTable");a&&s.push(Z(this,r,l,"ext-in-html",a))}if(this.name==="ref"){let i="var-anchor",l=n.getSeverity(i,"ref");l&&this.closest("heading-title")&&s.push(Z(this,r,i,"variable-anchor",l)),i="nested-link",l=n.getSeverity(i,"ref"),l&&this.closest("link,ext-link-text")&&s.push(Z(this,r,i,"ref-in-link",l))}return s}}},Ui=oe(jl),Nt=le(Ui,0,"ExtToken",El,Nt),re(Ui,1,Nt)}}),Co={};ae(Co,{parseCommentAndExt:()=>ws});var Mi,Rl,Cs,Pl,zi,ws,Ys=I({"parser/commentAndExt.ts"(){"use strict";et(),ve(),Gu(),Bt(),Qu(),Ju(),To(),So(),Mi="<onlyinclude>",Rl="</onlyinclude>",{length:Cs}=Mi,Pl=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",s=e?"noinclude":"includeonly";return ct(n=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${n})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(${"\\1"}\s*)>)|<(${s})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${s}\s*)>|$))`,"giu"))}),zi=e=>{const t=e.indexOf(Mi);return{i:t,j:e.indexOf(Rl,t+Cs)}},ws=(e,t,s,n)=>{if(n){let{i:u,j:o}=zi(e);if(u!==-1&&o!==-1){let d="";const c=f=>{new je(f,t,s),d+=`\0${s.length-1}n`};for(;u!==-1&&o!==-1;){const f=`\0${s.length}e`;new es(e.slice(u+Cs,o),t,s),u>0&&c(e.slice(0,u)),d+=f,e=e.slice(o+Cs+1),{i:u,j:o}=zi(e)}return e&&c(e),d}}const{ext:r}=t;let i=r,l=t;if(r.includes("translate")){i=r.filter(o=>o!=="translate"&&o!=="tvar"),l={...t,ext:i};const u=[];e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,o=>(u.push(o),`\0${u.length-1}`)).replace(/<translate( nowrap)?>([\s\S]*?)<\/translate>/gu,(o,d,c)=>{const f=s.length;return new Da(d,c&&Ee(c,u),l,s),`\0${f}g`}),e=Ee(e,u)}const a=Pl[n?1:0](i.join("|"));return a.lastIndex=0,a.test(e)?e.replace(a,(u,o,d,c,f,g,y,$,k)=>{const _=s.length;let T="n";if(o)T="e",new Nt(o,d,c,f,l,g,s);else if(u.startsWith("<!--")){T="c";const p=u.endsWith("-->");new It(Ee(u,s,1).slice(4,p?-3:void 0),p,t,s)}else g?new ts(g,y&&Ee(y,s,1),$&&Ee($,s,1),k,t,s):new je(u,t,s,!0);return`\0${_}${T}`}):e}}}),Ol,Bl,ql,Wl,Hi,Ul,ns,od=I({"src/tag/html.ts"(){"use strict";var e,t;X(),be(),Kn(),D(),Ha(),Ol=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),Bl=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"]),ql=new Set(["strike","big","center","font","tt"]),Wl=[Qs()],ns=(t=class extends(Ul=Xn){constructor(n,r,i,l,a,u){super(n,r,i,a,u);R(this,e);this.setAttribute("name",n.toLowerCase()),E(this,e,l)}get type(){return"html"}get selfClosing(){return b(this,e)}text(){const{closing:n,selfClosing:r,name:i}=this,{html:[,,l]}=this.getAttribute("config");return l.includes(i)?n&&i!=="br"?"":super.text("/"):super.text(r&&!n?"/":"")}lint(n=this.getAbsoluteIndex(),r){var i;{const l=super.lint(n,r),{name:a,parentNode:u,closing:o,selfClosing:d}=this,c=new pe(this,n),{lintConfig:f}=N,{computeEditInfo:g,fix:y}=f,$=this.inTableAttrs();let k="h1",_=f.getSeverity(k,"html");if(_&&a==="h1"&&!o){const S=Z(this,c,k,"<h1>",_);g&&(S.suggestions=[{desc:"h2",range:[n+2,n+3],text:"2"}]),l.push(S)}if(k="parsing-order",_=$&&f.getSeverity(k,$===2?"html":"templateInTable"),_){const S=Z(this,c,k,"html-in-table",_);g&&$===2&&(S.suggestions=[ee(S)]),l.push(S)}if(k="obsolete-tag",_=f.getSeverity(k,a),_&&ql.has(a)&&l.push(Z(this,c,k,"obsolete-tag",_)),k="bold-header",_=f.getSeverity(k,a),_&&(a==="b"||a==="strong")&&((i=this.closest("heading-title,ext"))==null?void 0:i.type)==="heading-title"){const S=Z(this,c,k,"bold-in-header",_);g&&(S.suggestions=[ee(S)]),l.push(S)}const{html:[,T,p]}=this.getAttribute("config"),h=p.includes(a),m=T.includes(a),x=!h&&!m;if(k="unmatched-tag",o&&(d||h)||d&&x){if(_=f.getSeverity(k,o?"both":"selfClosing"),_){const S=Z(this,c,k,o?"closing-and-self-closing":"invalid-self-closing",_);if(g||y){const v=Mn(n),w={desc:N.msg("no-self-closing"),range:[S.endIndex-2,S.endIndex-1],text:""};m?g&&(S.suggestions=[v,w]):o?S.fix=h?v:w:g&&(S.suggestions=[w,Ze(S.endIndex,`></${a}>`,-2)])}l.push(S)}}else if(!this.findMatchingTag()){const S=Z(this,c,k,o?"unmatched-closing":"unclosed-tag"),v=this.closest("magic-word");if(v&&Ol.has(v.name))_=f.getSeverity(k,"conditional");else if(o)_=f.getSeverity(k,"closing"),S.suggestions=[ee(S)];else{_=f.getSeverity(k,"opening");const w=u==null?void 0:u.childNodes;Bl.has(a)&&(w!=null&&w.slice(0,w.indexOf(this)).some(A=>A.is("html")&&A.name===a&&!A.findMatchingTag())&&(S.suggestions=[Ze(n+1,"/")]),this.closest("heading-title")&&(S.rule="format-leakage",_=f.getSeverity("format-leakage",a)))}_&&(S.severity=_,l.push(S))}return l}}getAttribute(n){return n==="invalid"?this.inTableAttrs()===2:super.getAttribute(n)}json(n,r=this.getAbsoluteIndex()){{const i=super.json(void 0,r);return i.selfClosing=b(this,e),i}}},e=new WeakMap,t),Hi=oe(Ul),ns=le(Hi,0,"HtmlToken",Wl,ns),re(Hi,1,ns)}}),Io={};ae(Io,{parseHtml:()=>No});var Ml,No,ud=I({"parser/html.ts"(){"use strict";tr(),od(),Ml=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,No=(e,t,s)=>{var l;const{html:n}=t;(l=t.htmlElements)!=null||(t.htmlElements=new Set([...n[0],...n[1],...n[2]]));const r=e.split("<");let i=r.shift();for(const a of r){const u=Ml.exec(a),o=u==null?void 0:u[2],d=o==null?void 0:o.toLowerCase();if(!u||!t.htmlElements.has(d)){i+=`<${a}`;continue}const[,c,,f="",g,y]=u,{length:$}=s,k=new Js(f,"html-attrs",d,t,s),_=k.hasAttr("itemprop");if(d==="meta"&&!(_&&k.hasAttr("content"))||d==="link"&&!(_&&k.hasAttr("href"))){i+=`<${a}`,s.length=$;continue}i+=`\0${s.length}x${y}`,new ns(o,k,c==="/",g==="/>",t,s)}return i}}}),zl,Hl,Di,Dl,Lt,Lo=I({"src/table/base.ts"(){"use strict";Kn(),D(),J(),mt(),tr(),zl=e=>{const t=e.childNodes.map(n=>n.type==="text"?n.data.replace(/\|\|/gu,"{{!!}}").replace(/\|/gu,"{{!}}"):n.toString()).join(""),{childNodes:s}=N.parseWithRef(t,e,2);e.safeReplaceChildren(s)},Hl=[Qs(1)],Lt=class extends(Dl=z){constructor(e,t,s,n,r,i=[],l){super(void 0,r,i,l),this.append(new ze(t,"table-syntax",r,i),new Js(n,"table-attrs",s,r,i))}escape(){for(const e of this.childNodes)e instanceof ze?zl(e):e.escape()}},Di=oe(Dl),Lt=le(Di,0,"TableBaseToken",Hl,Lt),re(Di,1,Lt)}}),Gl,Gi,_e,Is,Vt,Qt,zs,Fo=I({"src/table/td.ts"(){"use strict";X(),be(),Qn(),D(),J(),Lo(),zs=class extends(Gi=Lt,Gl=[Ds(!1)],Gi){constructor(e,t,s,n=[]){var a;let r=/\||\0\d+!\x7F/u.exec(t!=null?t:""),i=r?t.slice(0,r.index):"";/\[\[|-\{/u.test(i)&&(r=null,i=""),super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",i,s,n),re(Is,5,this),Je(this,Vt),Je(this,_e,""),r&&([Eu(this,_e)._]=r);const l=new z(t==null?void 0:t.slice(((a=r==null?void 0:r.index)!=null?a:NaN)+xe(this,_e).length),s,n);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 mn(this,Vt,Qt).call(this).subtype}afterBuild(){xe(this,_e).includes("\0")&&Te(this,_e,this.buildFromStr(xe(this,_e),0)),super.afterBuild()}toString(e){const{childNodes:[t,s,n]}=this;return t.toString(e)+s.toString(e)+xe(this,_e)+n.toString(e)}text(){const{childNodes:[e,t,s]}=this;return e.text()+t.text()+xe(this,_e)+s.text()}getGaps(e){return e===1?xe(this,_e).length:0}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),n=new pe(this,e+this.getRelativeIndex(this.length-1)),r="pipe-like",{lintConfig:i}=N,{computeEditInfo:l,fix:a}=i,u=["td","double"].map(o=>i.getSeverity(r,o));for(const o of this.lastChild.childNodes)if(o.type==="text"){const{data:d}=o;if(d.includes("|")){const c=d.includes("||"),f=u[c?1:0];if(f){const g=Q(o,n,r,"pipe-in-table",f);if(l||a)if(c){const y={caption:"|+",td:"|",th:"!"}[this.subtype];g.fix=Be(g,"newline",d.replace(/\|\|/gu,`
|
|
17
|
-
${y}`))}else l&&(
|
|
18
|
-
`)}getAttr(e){{const t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}}escape(){super.escape(),this.childNodes[1].toString()&&(xe(this,_e)||
|
|
19
|
-
|}`,t){
|
|
20
|
-
`);let a=t==="root"||t==="parameter-value"||t==="ext-inner"&&
|
|
21
|
-
${l.shift()}`,
|
|
22
|
-
${c}${
|
|
23
|
-
${
|
|
24
|
-
${
|
|
25
|
-
${c}${
|
|
26
|
-
${c}${
|
|
27
|
-
${c}${_}`;const
|
|
28
|
-
`)&&(_=Ce(g).trim());const{ns:p,valid:h}=N.normalizeTitle(_,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0,page:n});if(h){if(d){if(p!==6){a+=`[[${$}`;continue}let x=!1;for(o++;o<l.length;o++){const S=l[o],v=S.split("]]");if(v.length>2){x=!0,g+=`[[${v[0]}]]${v[1]}`,y=v.slice(2).join("]]");break}else if(v.length===2)g+=`[[${v[0]}]]${v[1]}`;else{g+=`[[${S}`;break}}if(g=In(g,t,s,n,r),!x){a+=`[[${c}${f}${g}`;continue}}}else{a+=`[[${$}`;continue}g&&(g=cr(g,t,s,r));let m=lr;T||(p===6?(g&&(g=hr(g,t,s,!0)),m=rr):p===14&&(m=Qo)),g===void 0&&f&&(g=""),a+=`\0${s.length}l${y}`,new m(c,g,t,s,f)}return a}}}),Xo={};ae(Xo,{parseMagicLinks:()=>Ko});var Xi,Ki,Yi,Zi,Ko,bd=I({"parser/magicLinks.ts"(){"use strict";ve(),ar(),Xi=String.raw`[${Ye}\t]| |�*160;|�*a0;`,Ki=`(?:${Xi})+`,Yi=`(?:${Xi}|-)`,Zi=String.raw`(?:RFC|PMID)${Ki}\d+\b|ISBN${Ki}(?:97[89]${Yi}?)?(?:\d${Yi}?){9}[\dx]\b`,Ko=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${Ft}${Et})|${Zi})`,"giu")}catch{t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${Ft}${Et})|${Zi})`,"giu")}return e.replace(t.regexMagicLinks,(n,r,i)=>{let l=r?n.slice(r.length):n;if(i){let a="";const u=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(l);u&&(a=l.slice(u.index),l=l.slice(0,u.index));const o=l.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,d=o.exec(l);if(d){let c=1;d[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(l.slice(0,d.index))&&(c=2),a=l.slice(d.index+c)+a,l=l.slice(0,d.index+c)}return a.length>=i.length?n:(new vs(l,void 0,t,s),`${r}\0${s.length-1}w${a}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(l))return n;return new vs(l,"magic-link",t,s),`${r}\0${s.length-1}i`})}}}),Yo,yd=I({"util/html.ts"(){"use strict";Yo=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,n)=>s!==e[n])}}),ta,Zo,wd=I({"src/nowiki/list.ts"(){"use strict";X(),D(),Ro(),ta=new Set(["link","category","file"]),Zo=class extends ur{get type(){return"list"}lint(e=this.getAbsoluteIndex()){var t;{const s="syntax-like",n=N.lintConfig.getSeverity(s,"redirect"),{innerText:r}=this;if(n&&r==="#"){let{nextSibling:i}=this;if((i==null?void 0:i.type)==="list-range"&&(i=i.firstChild),(i==null?void 0:i.type)==="text"&&ta.has((t=i.nextSibling)==null?void 0:t.type)&&new RegExp(String.raw`^(?:${this.getAttribute("config").redirection.join("|")})\s*(?::\s*)?$`,"iu").test(`#${i.data}`)){const a=Z(i,{start:e+1},s,"redirect-like",n);return a.startIndex--,a.startCol--,a.endIndex+=2,a.endCol+=2,[a]}}return[]}}}}}),eu={};ae(eu,{parseList:()=>tu});var tu,Sd=I({"parser/list.ts"(){"use strict";yd(),wd(),Po(),tu=(e,t,s,n)=>{const r=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!r)return t.lastPrefix="",e;const[i,l,a,u]=r,o=a.replace(/;/gu,":"),d=Yo(o,t.lastPrefix),c=((d>1?a.slice(d-1):a)+u).split(/(?=;)/u),f=c[0].startsWith(";");let g=c.length-(f?0:1);if(d>1){const A=a.slice(0,d-1);if(f){const C=A.split(/(?=;)/u);c.unshift(...C),g+=A.includes(";")?C.length:0}else c[0]=A+c[0]}t.lastPrefix=o;let y=l+c.map((A,C)=>`\0${n.length+C}d`).join("")+e.slice(i.length);for(const A of c)new Zo(A,s,n);if(!g)return y;const{html:[$,,k]}=s,_=/:+|-\{|\0\d+[xq]\x7F/gu;let T=_,p=T.exec(y),h=0,m=!1,x=!1,S=0;const v=(A,C)=>(new dr(A,s,n),`${y.slice(0,C)}\0${n.length-1}d${y.slice(C+A.length)}`),w=A=>{A?h&&h--:h++};for(;p&&g;){const{0:A,index:C}=p;if(A==="-{"){if(!S){const{lastIndex:L}=T;T=/-\{|\}-/gu,T.lastIndex=L}S++}else if(A==="}-"){if(S--,!S){const{lastIndex:L}=T;T=_,T.lastIndex=L}}else if(A.endsWith("x")){const{name:L,closing:B,selfClosing:q}=n[Number(A.slice(1,-2))];($.includes(L)||!q&&!k.includes(L))&&w(B)}else if(A.endsWith("q")){const{bold:L,italic:B}=n[Number(A.slice(1,-2))];L&&(w(m),m=!m),B&&(w(x),x=!x)}else if(h===0){if(A.length>=g)return v(A.slice(0,g),C);g-=A.length,T.lastIndex=C+4+String(n.length).length,y=v(A,C)}p=T.exec(y)}return y}}}),Ls,sa,en,ia,ls,Ad=I({"src/converterFlags.ts"(){"use strict";var e,t;X(),be(),Gs(),D(),J(),ft(),Ls=new Set(["A","T","R","D","-","H","N"]),sa=[ys()],ls=(t=class extends(ia=z){constructor(n,r,i=[]){super(void 0,r,i,{});R(this,e);this.safeAppend(n.map(l=>new We(l,"converter-flag",r,i)))}get type(){return"converter-flags"}afterBuild(){E(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(b(this,e).filter(n=>/\{{3}[^{}]+\}{3}/u.test(n)))}getVariantFlags(){const n=new Set(this.getAttribute("config").variants);return new Set(b(this,e).filter(r=>n.has(r)))}isInvalidFlag(n,r,i,l){return typeof n=="object"&&(n=n.text().trim(),r=this.getVariantFlags(),i=this.getUnknownFlags(),l=new Set(b(this,e).filter(a=>Ls.has(a)))),!!n&&!r.has(n)&&!i.has(n)&&(r.size>0||!l.has(n))}lint(n=this.getAbsoluteIndex(),r){{const i=this.getVariantFlags(),l=this.getUnknownFlags(),a=new Set(b(this,e).filter(k=>Ls.has(k))),u=b(this,e).filter(k=>!k).length,o=b(this,e).length-l.size-u,{lintConfig:d}=N,{computeEditInfo:c,fix:f}=d,g=super.lint(n,r);if(i.size===o||a.size===o)return g;const y="no-ignored",$=d.getSeverity(y,"conversionFlag");if($){const k=new pe(this,n);for(let _=0;_<this.length;_++){const T=this.childNodes[_],p=T.text().trim();if(this.isInvalidFlag(p,i,l,a)){const h=Q(T,k,y,"invalid-conversion-flag",$);(c||f)&&(i.size===0&&Ls.has(p.toUpperCase())?h.fix=Hn(h,p):c&&(h.suggestions=[ee(h,_&&-1)])),g.push(h)}}}return g}}print(){return super.print({sep:";"})}},e=new WeakMap,t),en=oe(ia),ls=le(en,0,"ConverterFlagsToken",sa,ls),re(en,1,ls)}}),Fs,Ws,kd=I({"src/converterRule.ts"(){"use strict";He(),D(),J(),ft(),Fs=(e,t,s,n)=>{const r=new z(e,s,n);return r.type=`converter-rule-${t}`,r.setAttribute("stage",ke),r},Ws=class extends z{get type(){return"converter-rule"}get variant(){var e,t;return(t=(e=this.childNodes[this.length-2])==null?void 0:e.text().trim().toLowerCase())!=null?t:""}constructor(e,t=!0,s=N.getConfig(),n=[]){super(void 0,s,n,{});const r=e.indexOf(":"),i=e.slice(0,r).indexOf("=>"),l=i===-1?e.slice(0,r):e.slice(i+2,r);t&&s.variants.includes(l.trim().toLowerCase())?(super.insertAt(new We(l,"converter-rule-variant",s,n)),super.insertAt(Fs(e.slice(r+1),"to",s,n)),i!==-1&&super.insertAt(Fs(e.slice(0,i),"from",s,n),0)):super.insertAt(Fs(e,"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}}}}}),na,tn,ra,as,$d=I({"src/converter.ts"(){"use strict";ve(),st(),De(),J(),Ad(),kd(),na=[Ue,Ge("-{")],as=class extends(ra=z){get type(){return"converter"}constructor(e,t,s,n=[]){super(void 0,s,n),this.insertAt(new ls(e,s,n));const[r]=t,i=r.includes(":"),l=new Ws(r,i,s,n);(i?l.length===1:t.length===2&&!Ce(t[1]).trim())?this.insertAt(new Ws(t.join(";"),!1,s,n)):this.safeAppend([l,...t.slice(1).map(a=>new Ws(a,!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()}|${pt(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?"|":""}${Rt(t,{sep:";"})}}-</span>`}},tn=oe(ra),as=le(tn,0,"ConverterToken",na,as),re(tn,1,as)}}),su={};ae(su,{parseConverter:()=>iu});var iu,_d=I({"parser/converter.ts"(){"use strict";$d(),iu=(e,t,s)=>{var u;(u=t.regexConverter)!=null||(t.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${t.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"iu"));const n=/-\{/gu,r=/-\{|\}-/gu,i=[];let l=n,a=l.exec(e);for(;a;){const{0:o,index:d}=a;if(o==="}-"){const c=i.pop(),{length:f}=s,g=e.slice(c.index+2,d),y=g.indexOf("|"),[$,k]=y===-1?[[],g]:[g.slice(0,y).split(";"),g.slice(y+1)],_=k.replace(/(&[#a-z\d]+);/giu,"$1"),T=_.split(t.regexConverter).map(p=>p.replace(/\x01/gu,";"));new as($,T,t,s),e=`${e.slice(0,c.index)}\0${f}v${e.slice(d+2)}`,i.length===0&&(l=n),l.lastIndex=c.index+3+String(f).length}else i.push(a),l=r,l.lastIndex=d+2;a=l.exec(e)}return e}}}),ds={};ae(ds,{Token:()=>z});var la,z,J=I({"src/index.ts"(){"use strict";var e,t,s,n,r,i,l,a,u,nu,ru,lu,au,ou,uu,du,cu,hu,gu,pu,fu,m;ve(),He(),X(),Re(),D(),Wu(),Mu(),la=["category","html-attr#id,ext-attr#id,table-attr#id"],z=(m=class extends Kt{constructor(v,w=N.getConfig(),A=[],C){super();R(this,u);R(this,e,"plain");R(this,t,0);R(this,s);R(this,n);R(this,r);R(this,i,!1);R(this,l);R(this,a);typeof v=="string"&&this.insertAt(v),E(this,s,w),E(this,n,A),A.push(this)}get type(){return b(this,e)}set type(v){E(this,e,v)}get pageName(){return b(this.getRootNode(),a)}set pageName(v){if(v){const w=this.normalizeTitle(v,0,{temporary:!0,page:""});E(this,a,w.valid?w.title:void 0)}else E(this,a,v===""?"":void 0)}parseOnce(v=b(this,t),w=!1,A){if(v<b(this,t)||this.length===0||!this.isPlain())return this;if(b(this,t)>=ke)return this;switch(v){case 0:if(this.type==="root"){b(this,n).pop();const C=j(this,u,nu).call(this);w&&(w=!C)}E(this,r,w),j(this,u,ru).call(this,w);break;case 1:j(this,u,lu).call(this);break;case 2:j(this,u,au).call(this);break;case 3:j(this,u,ou).call(this);break;case 4:j(this,u,uu).call(this);break;case 5:j(this,u,du).call(this,A);break;case 6:j(this,u,cu).call(this,A);break;case 7:j(this,u,hu).call(this);break;case 8:j(this,u,gu).call(this);break;case 9:j(this,u,pu).call(this);break;case 10:j(this,u,fu).call(this)}if(this.type==="root")for(const C of b(this,n))C==null||C.parseOnce(v,w,A);return pr(this,t)._++,this}buildFromStr(v,w){const A=v.split(/[\0\x7F]/u).map((C,L)=>{if(L%2===0)return new yn(C);if(isNaN(C.slice(-1)))return b(this,n)[Number(C.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${C}`)});return w===0?A.map(String).join(""):w===1?pt(A):A}build(){E(this,t,ke);const{length:v,firstChild:w}=this,A=w==null?void 0:w.toString();if(v===1&&w.type==="text"&&A.includes("\0")&&(bs(this,0,1,this.buildFromStr(A)),this.normalize(),this.type==="root"))for(const C of b(this,n))C==null||C.build()}afterBuild(){if(this.type==="root")for(const v of b(this,n))v==null||v.afterBuild();E(this,i,!0)}parse(v=ke,w,A){for(v=Math.min(v,ke);b(this,t)<v;)this.parseOnce(b(this,t),w,A);return v&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===m}getAttribute(v){var w;switch(v){case"config":return b(this,s);case"include":return(w=b(this,r))!=null?w:!!b(this.getRootNode(),r);case"accum":return b(this,n);case"built":return b(this,i);case"stage":return b(this,t);case"invalid":return this.type==="table-inter"&&us(this)===2;default:return super.getAttribute(v)}}setAttribute(v,w){switch(v){case"stage":b(this,t)===0&&this.type==="root"&&b(this,n).shift(),E(this,t,w);break;default:super.setAttribute(v,w)}}insertAt(v,w=this.length){const A=typeof v=="string"?new yn(v):v;super.insertAt(A,w);const{type:C}=A;return C==="root"&&(A.type="plain"),A}normalizeTitle(v,w=0,A){return N.normalizeTitle(v,w,this.getAttribute("include"),b(this,s),{page:this.pageName,...A})}inTableAttrs(){var v,w;return((v=this.closest("table-attrs,ext"))==null?void 0:v.type)==="table-attrs"&&((w=this.closest("table-attrs,arg,magic-word,template"))!=null&&w.is("table-attrs")?2:1)}inHtmlAttrs(){var v;return(v=this.closest("html-attrs,ext"))!=null&&v.is("html-attrs")?2:this.inTableAttrs()}lint(v=this.getAbsoluteIndex(),w){var A;{const{lintConfig:C}=N,{computeEditInfo:L,fix:B,ignoreDisables:q,configurationComment:O}=C;let W=super.lint(v,w);if(this.type==="root"){const F=new Map,P="no-duplicate",U=["category","id"].map(H=>C.getSeverity(P,H)),M=this.toString(),ie=la.filter((H,G)=>U[G]).join();if(ie){for(const H of this.querySelectorAll(ie)){let G;if(H.is("category"))G=H.name;else{const K=H.getValue();K&&K!==!0&&(G=`#${K}`)}if(G){const K=F.get(G);K?K.add(H):F.set(G,new Set([H]))}}for(const[H,G]of F)if(G.size>1&&!H.startsWith("#mw-customcollapsible-")){const K=!H.startsWith("#"),ue=`duplicate-${K?"category":"id"}`,de=U[K?0:1];W.push(...[...G].map(ce=>{const ne=Z(ce,{start:ce.getAbsoluteIndex()},P,ue,de);return L&&K&&(ne.suggestions=[ee(ne)]),ne}))}}if(!q){const H=new RegExp(String.raw`<!--\s*${O}-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->`,"gu"),G=[];let K=H.exec(M);for(;K;){const{1:ue,index:de}=K,ce=(A=K[2])==null?void 0:A.trim();G.push({line:this.posFromIndex(de).top+(ue==="disable-line"?0:1),from:ue==="disable"?H.lastIndex:void 0,to:ue==="enable"?H.lastIndex:void 0,rules:ce?new Set(ce.split(",").map(ne=>ne.trim())):void 0}),K=H.exec(M)}W=W.filter(({rule:ue,startLine:de,startIndex:ce})=>{const ne={pos:0};for(const{line:he,from:ye,to:V,rules:Y}of G){if(he>de+1)break;if(Y&&!Y.has(ue))continue;if(he===de&&ye===void 0&&V===void 0)return!1;ye<=ce&&ye>ne.pos?(ne.pos=ye,ne.type="from"):V<=ce&&V>ne.pos&&(ne.pos=V,ne.type="to")}return ne.type!=="from"})}if(B&&W.some(({fix:H})=>H)){const H=W.map(({fix:ue})=>ue).filter(Boolean).sort(({range:[ue,de]},{range:[ce,ne]})=>de===ne?ce-ue:ne-de);let G=1/0,K=M;for(const{range:[ue,de],text:ce}of H)de<=G&&(K=K.slice(0,ue)+ce+K.slice(de),G=ue);Object.assign(W,{output:K})}if(!L)for(const H of W)delete H.fix,delete H.suggestions}return W}}toString(v,w){return v?super.toString(!0,w):ht(b(this,l),()=>super.toString(!1,w),A=>{const C=this.getRootNode();C.type==="root"&&b(C,i)&&E(this,l,A)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n=new WeakMap,r=new WeakMap,i=new WeakMap,l=new WeakMap,a=new WeakMap,u=new WeakSet,nu=function(){const{parseRedirect:v}=(Du(),se(Ma)),w=this.firstChild.toString(),A=v(w,b(this,s),b(this,n));return A&&this.setText(A),!!A},ru=function(v){const{parseCommentAndExt:w}=(Ys(),se(Co));this.setText(w(this.firstChild.toString(),b(this,s),b(this,n),v))},lu=function(){const{parseBraces:v}=(nr(),se(io)),w=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,A=v(w,b(this,s),b(this,n));this.setText(this.type==="root"?A:A.slice(1))},au=function(){if(b(this,s).excludes.includes("html"))return;const{parseHtml:v}=(ud(),se(Io));this.setText(v(this.firstChild.toString(),b(this,s),b(this,n)))},ou=function(){if(b(this,s).excludes.includes("table"))return;const{parseTable:v}=(hd(),se(Oo));this.setText(v(this,b(this,s),b(this,n)))},uu=function(){if(b(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:v}=(fd(),se(Uo));this.setText(v(this,b(this,s),b(this,n)))},du=function(v){const{parseLinks:w}=(vd(),se(Jo));this.setText(w(this.firstChild.toString(),b(this,s),b(this,n),this.pageName,v))},cu=function(v){if(b(this,s).excludes.includes("quote"))return;const{parseQuotes:w}=(Do(),se(Ho)),A=this.firstChild.toString().split(`
|
|
29
|
-
`);for(let C=0;C<A.length;C++)A[C]=w(A[C],b(this,
|
|
30
|
-
`))},
|
|
31
|
-
`),
|
|
32
|
-
`))},fu=function(){if(b(this,s).variants.length>0){const{parseConverter:v}=(_d(),se(su));this.setText(v(this.firstChild.toString(),b(this,s),b(this,n)))}},m)}}),we,Zs,bs,Re=I({"util/debug.ts"(){"use strict";we={running:!1,run(e){const{running:t}=this;this.running=!0;try{const{Token:s}=(J(),se(ds)),n=e();return n instanceof s&&!n.getAttribute("built")&&n.afterBuild(),this.running=t,n}catch(s){throw this.running=t,s}},rev:0},Zs=e=>t=>t.type===e,bs=(e,t,s,n=[])=>{var l,a;let r=e.getChildNodes(),i;r.length===s?(i=r,r=n):i=Array.prototype.splice.apply(r,[t,s,...n]);for(let u=0;u<n.length;u++){const o=n[u];o.setAttribute("parentNode",e),o.setAttribute("nextSibling",r[t+u+1]),o.setAttribute("previousSibling",r[t+u-1])}return(l=r[t-1])==null||l.setAttribute("nextSibling",r[t]),(a=r[t+n.length])==null||a.setAttribute("previousSibling",r[t+n.length-1]),r===n&&e.setAttribute("childNodes",r),i}}}),wt,sn,Es,nn,aa,rn,oa,Nn,Td=I({"lib/lintConfig.ts"(){"use strict";var e,t;Wn(),wt=new Map([[0,!1],[1,"warning"],[2,"error"],[!1,!1],["off",!1],["warning","warning"],["error","error"]]),sn={"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,"invalid-url":1,"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}],"syntax-like":[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,{both:2,selfClosing:2}],"unterminated-url":[1,{}],"url-encoding":[1,{}],"var-anchor":[1,{}],"void-ext":[2,{}]},Object.freeze(sn),Es={configurationComment:"lint",ignoreDisables:!1,fix:!0,computeEditInfo:!0},Object.freeze(Es),nn=s=>wt.has(s),aa=s=>nn(s)||Array.isArray(s)&&nn(s[0])&&(s.length===1||typeof s[1]=="object"),rn=(s,n,r)=>{if(cs.includes(n)){if(r===void 0)return!1;if(aa(r))return s[n]=r,!0}else throw new RangeError(`Unknown lint rule: ${n}`);throw new RangeError(`Invalid lint config for ${n}: ${JSON.stringify(r)}`)},oa=class{constructor(s){if(Object.assign(this,JSON.parse(JSON.stringify(sn))),!!s)for(const[n,r]of Object.entries(s))rn(this,n,r)}getSeverity(s,n){var i,l;const r=this[s];return typeof r!="object"?wt.get(r):n&&(l=wt.get((i=r[1])==null?void 0:i[n]))!=null?l:wt.get(r[0])}},Nn=(t=class{constructor(s){R(this,e);if(Object.assign(this,Es),s&&!("rules"in s)&&Object.keys(s).some(n=>cs.includes(n)))this.rules=s;else{const{rules:n,...r}=s!=null?s:{};this.rules=n;for(const[i,l]of Object.entries(r))l!==void 0&&Object.prototype.hasOwnProperty.call(Es,i)&&(this[i]=l)}}get rules(){return b(this,e)}set rules(s){E(this,e,new Proxy(new oa(s),{set:rn,deleteProperty(){return!1}}))}getSeverity(s,n){return b(this,e).getSeverity(s,n)}},e=new WeakMap,t)}}),mu={};ae(mu,{Title:()=>xu});var ln,xu,Cd=I({"lib/title.ts"(){"use strict";var e,t,s,n,r,i,vu,a;et(),ve(),ln=u=>{const[,{length:o},d]=/^((?:\.\.\/)*)([\s\S]*)/u.exec(u);return[o/3,d]},xu=(a=class{constructor(u,o,d,{temporary:c,decode:f,selfLink:g,page:y}={}){R(this,i);R(this,e);R(this,t);R(this,s);R(this,n);R(this,r);Ne(this,"page");Ne(this,"valid");Ne(this,"encoded",!1);this.page=y;const $=u.trim(),k=$.startsWith("../");if(f&&u.includes("%"))try{const h=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(u);u=fs(u),this.encoded=h}catch{}if(u=gs(u).replace(/[_ ]+/gu," ").trim(),k||y&&$.startsWith("/"))E(this,n,0);else{let h=o;u.startsWith(":")&&(h=0,u=u.slice(1).trim());const m=u.split(":");if(m.length>1){const x=jt(m[0]),S=Object.prototype.hasOwnProperty.call(d.nsid,x)&&d.nsid[x];S&&(h=S,u=m.slice(1).join(":").trim())}E(this,n,h)}const _=u.indexOf("#");if(_!==-1){let h=u.slice(_).trim().slice(1);if(h.includes("%"))try{h=fs(h)}catch{}E(this,r,h.replace(/ /gu,"_")),u=u.slice(0,_).trim()}const[T,p]=k?ln(u):[0,u];this.valid=!!(u||g&&this.ns===0&&b(this,r)!==void 0)&&gs(u)===u&&(T===0||y===void 0||y.split("/",T+1).length>T)&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(p),this.main=u,E(this,t,d.namespaces),E(this,s,d.articlePath||"/wiki/$1"),b(this,s).includes("$1")||E(this,s,b(this,s)+`${b(this,s).endsWith("/")?"":"/"}$1`),c||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return b(this,n)}get fragment(){return b(this,r)}get main(){return b(this,e)}set main(u){u=u.replace(/_/gu," ").trim(),E(this,e,u&&u[0].toUpperCase()+u.slice(1))}get prefix(){const u=b(this,t)[this.ns];return u+(u&&":")}get title(){return this.getRedirection()[1]}get extension(){const{main:u}=this,o=u.lastIndexOf(".");return o===-1?void 0:u.slice(o+1).toLowerCase()}getRedirection(){const{prefix:u}=this,o=u;return j(this,i,vu).call(this,o)}setFragment(u){E(this,r,u)}getUrl(u){{typeof u=="string"&&(E(this,s,u),b(this,s).includes("$1")||E(this,s,b(this,s)+`${b(this,s).endsWith("/")?"":"/"}$1`));const{title:o,fragment:d}=this;return o?b(this,s).replace("$1",encodeURIComponent(o)+(d?`#${encodeURIComponent(d)}`:"")):d===void 0?"":`#${encodeURIComponent(d)}`}throw new Error("Title.getUrl method is only available in the LSP version!")}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n=new WeakMap,r=new WeakMap,i=new WeakSet,vu=function(u){var d,c;let o=(u+this.main).replace(/ /gu,"_");if(o.startsWith("/"))o=((d=this.page)!=null?d:"")+o.replace(/(.)\/$/u,"$1");else if(o.startsWith("../")&&((c=this.page)!=null&&c.includes("/"))){const[f,g]=ln(o),y=this.page.split("/");y.length>f&&(o=y.slice(0,-f).join("/")+(g&&"/")+g)}return[!1,o]},a)}}),bu={};ae(bu,{LanguageService:()=>yu,tasks:()=>Ln});var Ln,ua,da,ca,ha,an,ga,pa,fa,ma,on,xa,un,St,dn,Qe,Ae,cn,hn,At,kt,rt,Jt,gn,va,yu,Id=I({"lib/lsp.ts"(){"use strict";var e,t,s,n,r,i,l,a,u,o,os,Fe,Fn,En,jn,wu,Rn,$t,T;et(),qo(),Wn(),Qa(),X(),ve(),D(),Ln=new WeakMap,ua=new Set(["ref"]),da=new Set(["ref","references"]),ca=new Set(["name","follow"]),ha=new Set(["group"]),an=new Set(["arg-name","template-name","link-target","parameter-key"]),ga=new Set(["ext","html","attr-key","image-parameter","heading-title","heading","magic-word-name",...an]),pa=new Set(["text","comment","noinclude","include"]),fa=["ext","html","table"].map(p=>`${p}-attr#style`).join(),ma=ct(p=>new RegExp(`^(?:${p}|//)`,"iu")),on=({type:p,parentNode:h,length:m,firstChild:x},S)=>p==="attr-value"&&m===1&&x.type==="text"&&(!S||h.name==="style"),xa=p=>p.is("html-attr")||p.is("table-attr"),un=p=>p.childNodes.every(({type:h})=>pa.has(h)),St=(p,h)=>{const{top:m,left:x}=p.posFromIndex(h);return{line:m,character:x}},dn=(p,h,m)=>({start:St(p,h),end:St(p,m)}),Qe=p=>{const{top:h,left:m,height:x,width:S}=p.getBoundingClientRect();return{start:{line:h,character:m},end:ms(h,m,x,S)}},Ae=(p,h,m,{line:x,character:S},v,w)=>[...new Set(p)].map(A=>{var L;const C=(L=w==null?void 0:w(A))==null?void 0:L.description;return{label:A,kind:h,textEdit:{range:{start:{line:x,character:S-m.length},end:{line:x,character:S}},newText:A+(v!=null?v:"")},...C&&{documentation:{kind:"markdown",value:C}}}}),cn=(p,h,{line:m,character:x})=>{const S=p.indexFromPos(m,x);return p.caretPositionFromIndex(S+Number(/\w/u.test(h.charAt(S))))},hn=(p,h,m)=>{const{type:x,parentNode:S={}}=p,{name:v,tag:w}=S;return x==="attr-value"&&h.has(w)&&m.has(v)?p.toString().trim():NaN},At=p=>hn(p,ua,ca),kt=p=>hn(p,da,ha),rt=(p,h)=>{const m=p==null?void 0:p.getAttr(h);return m!==!0&&m||!1},Jt=p=>{const{type:h,name:m,parentNode:x}=p;switch(h){case"heading":return p.level;case"heading-title":return x.level;case"parameter-key":return`${x.parentNode.name}|${x.name}`;case"ext":case"html":case"image-parameter":return m;default:return x.name}},gn=(p,h,m=!1)=>({range:dn(p,...h.range),newText:h.text,title:`${m?"Fix":"Suggestion"}: ${h.desc}`,fix:m}),va=(p,h)=>{const{lintConfig:m}=N,{rules:x,fix:S,computeEditInfo:v}=m;if(m.fix=!0,m.computeEditInfo=!1,h){m.rules=void 0;for(const A of cs)m.rules[A]=A===h?x[A]:0}const{output:w}=p.lint();return m.fix=S,m.computeEditInfo=v,h&&(m.rules=x),w===void 0?[]:[{range:Qe(p),newText:w}]},yu=(T=class{constructor(p){R(this,o);R(this,e);R(this,t);R(this,s);R(this,n);R(this,r);R(this,i);R(this,l);R(this,a);R(this,u);Ne(this,"include",!0);Ne(this,"config");Ne(this,"data");Ln.set(p,this),Object.defineProperties(this,{config:{enumerable:!1},data:{enumerable:!1}})}destroy(){Object.setPrototypeOf(this,null)}async provideDocumentColors(p,h,m=!0){const x=await j(this,o,Fe).call(this,h);return x.querySelectorAll("attr-value,parameter-value,arg-default").reverse().flatMap(S=>{const{type:v,childNodes:w}=S;return v!=="attr-value"&&!un(S)?[]:w.filter(A=>A.type==="text").reverse().flatMap(A=>{const{data:C}=A,L=La(C,m).filter(([,,,q])=>q);if(L.length===0)return[];const B=A.getAbsoluteIndex();return L.map(([q,O,W])=>{const F=p(q);return F.length===4&&{color:{red:F[0]/255,green:F[1]/255,blue:F[2]/255,alpha:F[3]},range:dn(x,B+O,B+W)}}).filter(Boolean)})})}provideColorPresentations(p){const{color:{red:h,green:m,blue:x,alpha:S},range:v}=p,w=[h,m,x],A=S<1?`rgba(${w.map(C=>Math.round(C*255)).join()},${S})`:`#${w.map(Na).join("")}`;return[{label:A,textEdit:{range:v,newText:A}}]}async provideCompletionItems(p,h){var K,ue,de,ce,ne,he,ye;const{re:m,allTags:x,functions:S,switches:v,jaSwitches:w,protocols:A,params:C,tags:L,ext:B}=j(this,o,wu).call(this),{line:q,character:O}=h,W=p.split(/\r?\n/u,q+1)[q],F=m.exec((K=W==null?void 0:W.slice(0,O))!=null?K:""),[,,P={},U={}]=this.config.doubleUnderscore;if((F==null?void 0:F[1])!==void 0){const V=F[1].startsWith("/");return Ae(x,"Class",F[1].slice(V?1:0),h,V&&!(W!=null&&W.slice(O).trim().startsWith(">"))?">":"")}else if(F!=null&&F[4]||F!=null&&F[5]&&w.length>0){const V=F[5]!==void 0;return Ae(V?w:v,"Constant",F[V?5:4],h,"",Y=>{if(this.data)V||(Y=Y.slice(2,-2));else return;return Y in P?Y=P[Y]:Y in U&&(Y=U[Y]),j(this,o,Rn).call(this,Y.toLowerCase())})}else if((F==null?void 0:F[6])!==void 0)return Ae(A,"Reference",F[6],h);const M=await j(this,o,Fe).call(this,p);let ie;if(F!=null&&F[2]){ie=M.elementFromPoint(F.index+F[2].length-1,q);const V=(ue=F[3])!=null?ue:"";if(F[2]==="{{{")return Ae(M.querySelectorAll("arg").filter(te=>te.name&&te!==ie).map(({name:te})=>te),"Variable",V,h);const[Y,fe]=this.config.parserFunction,Se=Array.isArray(fe),Ie=W.charAt(O),Ve=V.startsWith(":"),$e=Ve?V.slice(1).trimStart():V;if(F[2]==="[[")return Ae(M.querySelectorAll("link,file,category,redirect-target").filter(te=>te!==ie).map(({name:te})=>te),"Folder",$e,h);let bt=S;return Ie===":"?bt=S.filter(te=>!te.endsWith(":")):Ie===":"&&(bt=S.filter(te=>te.endsWith(":")).map(te=>te.slice(0,-1))),[...Ae(bt,"Function",V,h,"",te=>{if(this.data)te in Y?te=Y[te]:!Se&&te in fe&&(te=fe[te]);else return;return j(this,o,$t).call(this,te.toLowerCase())}),...V.startsWith("#")?[]:Ae(M.querySelectorAll("template").filter(te=>te!==ie).map(te=>{const{name:it}=te;if(Ve)return it;const{ns:qt}=te.getAttribute("title");return qt===0?`:${it}`:qt===10?it.slice(9):it}),"Folder",$e,h)]}let H,G;if((F==null?void 0:F[8])===void 0&&(ie=M.elementFromPoint(O,q),{type:H,parentNode:G}=ie),(F==null?void 0:F[7])!==void 0||H==="image-parameter"){const V=M.indexFromPos(q,O),Y=(ce=(de=F==null?void 0:F[7])==null?void 0:de.trimStart())!=null?ce:b(this,e).slice(ie.getAbsoluteIndex(),V).trimStart(),fe=b(this,e)[V]==="=";return[...Ae(C,"Property",Y,h).filter(({label:Se})=>!fe||!/[= ]$/u.test(Se)),...Ae(M.querySelectorAll("image-parameter#width").filter(Se=>Se!==ie).map(Se=>Se.text()),"Unit",Y,h)]}else if((F==null?void 0:F[8])!==void 0||H==="attr-key"){const V=(he=(ne=F==null?void 0:F[8])==null?void 0:ne.toLowerCase())!=null?he:G.tag,Y=(ye=F==null?void 0:F[10])!=null?ye:ie.toString().slice(0,O-M.posFromIndex(ie.getAbsoluteIndex()).left);if(!L.has(V))return;const fe=Zn[V],Se=er[V],Ie=Se&&Ae(Se,"Field",Y,h);return B.includes(V)&&!fe?Ie:[...Ie!=null?Ie:[],...V==="meta"||V==="link"?[]:Ae(Yn,"Property",Y,h),...fe?Ae(fe,"Property",Y,h):[],...Ae(["data-"],"Variable",Y,h),...Ae(["xmlns:"],"Interface",Y,h)]}else if(H==="parameter-key"||H==="parameter-value"&&G.anon){const V=G.parentNode,{type:Y,name:fe}=V;if(Y==="magic-word"&&fe!=="invoke")return;const Se=b(this,e).slice(ie.getAbsoluteIndex(),M.indexFromPos(q,O)).trimStart(),{module:Ie,function:Ve}=V;return Se?Ae(M.querySelectorAll("parameter").filter($e=>$e===G||$e.anon||$e.parentNode.type!==Y||$e.parentNode.name!==fe?!1:Y==="template"?!0:$e.parentNode.module===Ie&&$e.parentNode.function===Ve).map(({name:$e})=>$e),"Variable",Se,h,H==="parameter-value"?"=":""):void 0}else if(on(ie)&&xa(G)){const V=Gn(G.tag,G.name);if(V.length===0)return;const Y=b(this,e).slice(ie.getAbsoluteIndex(),M.indexFromPos(q,O)).trimStart();return Ae(V,"Value",Y,h)}}async provideDiagnostics(p,h=!0){const m=await j(this,o,Fe).call(this,p),{lintConfig:x}=N,S=x.fix;x.fix=!1;const v=m.lint();return x.fix=S,[(h?v:v.filter(({severity:L})=>L==="error")).map(({startLine:L,startCol:B,endLine:q,endCol:O,severity:W,rule:F,message:P,fix:U,suggestions:M})=>({range:{start:{line:L,character:B},end:{line:q,character:O}},severity:W==="error"?1:2,source:"WikiLint",code:F,message:P,data:[...U?[gn(m,U,!0)]:[],...M?M.map(ie=>gn(m,ie)):[]]})),[],[]].flat(2)}resolveCodeAction(p){if(p.kind!=="source.fixAll")return p;const{rule:h}=p.data;return{...p,edit:{changes:{"":va(b(this,r),h)}}}}async provideFoldingRanges(p){const h=await j(this,o,Fe).call(this,p),{length:m}=h.getLines(),x=[],S=new Array(6),v=h.querySelectorAll("heading-title,table,template,magic-word");for(const w of[...v].reverse())w.getRelativeIndex();for(const w of v){const{offsetHeight:A}=w;if(w.type==="heading-title"||A>2){const{top:C}=h.posFromIndex(w.getAbsoluteIndex());if(w.type==="heading-title"){const{level:L}=w.parentNode;for(let B=L-1;B<6;B++){const q=S[B];q!==void 0&&q<C-1&&x.push({startLine:q,endLine:C-1,kind:"region"}),S[B]=void 0}S[L-1]=C+A-1}else x.push({startLine:C,endLine:C+A-2,kind:"region"})}}for(const w of S)w!==void 0&&w<m-1&&x.push({startLine:w,endLine:m-1,kind:"region"});return x}async provideLinks(p){var v;(v=this.config)!=null||(this.config=N.getConfig());const{articlePath:h,protocol:m}=this.config,x=h==null?void 0:h.includes("//"),S=ma(m);return(await j(this,o,Fe).call(this,p)).querySelectorAll(`magic-link,ext-link-url,free-ext-link,attr-value${x?",link-target,template-name,invoke-module,magic-word#filepath,magic-word#widget":""},image-parameter#link,image-parameter#manualthumb`).reverse().map(w=>{let A;w.is("magic-word")?({name:A}=w,w=w.childNodes[1].lastChild):w.is("image-parameter")&&({name:A}=w);const{type:C,parentNode:L,firstChild:B,lastChild:q,childNodes:O,length:W}=w,{tag:F}=L;if(A!=null||(A=L.name),!(C!=="attr-value"||A==="cite"&&["blockquote","del","ins","q"].includes(F)||A==="src"&&["templatestyles","img"].includes(F)||A==="templatename"&&F==="rss"||A==="file"&&F==="phonos")||!un(w))return!1;let P=O.filter(U=>U.type==="text").map(({data:U})=>U).join("").trim();if(!P)return!1;try{if(w.is("magic-link")||w.is("ext-link-url")||w.is("free-ext-link"))P=w.getUrl(h);else if(C==="link-target"&&(L.is("link")||L.is("redirect-target")||L.is("category"))){if(/^(?:\.\.)?\//u.test(P))return!1;P=L.link.getUrl(h)}else if(C==="link-target"||C==="template-name")P=L.getAttribute("title").getUrl(h);else if(["invoke-module","parameter-value"].includes(C)||C==="attr-value"&&(A==="src"&&F==="templatestyles"||A==="templatename"&&F==="rss"||A==="file"&&F==="phonos")||C==="image-parameter"&&(A==="manualthumb"||!S.test(P))){if(!x||P.startsWith("/"))return!1;C==="image-parameter"&&A==="manualthumb"||C==="parameter-value"&&A==="filepath"||C==="attr-value"&&F==="phonos"?P=`File:${P}`:C==="parameter-value"?P=`Widget:${P}`:C==="invoke-module"&&(P=`Module:${P}`);const U=N.normalizeTitle(P,C==="attr-value"?10:0,!1,this.config,{temporary:!0});if(!U.valid)return!1;P=U.getUrl()}if(typeof P=="string"&&P.startsWith("//")&&(P=`https:${P}`),P=new URL(P).href,C==="image-parameter"){const U=B.getBoundingClientRect(),{top:M,left:ie,height:H,width:G}=W===1?U:q.getBoundingClientRect();return{range:{start:{line:U.top,character:U.left},end:ms(M,ie,H,G)},target:P}}return{range:Qe(w),target:P}}catch{return!1}}).filter(Boolean)}async provideReferences(p,h){const m=await j(this,o,Fe).call(this,p),{offsetNode:x,offset:S}=cn(m,b(this,e),h),v=x.type==="text"?x.parentNode:x,w=S===0&&(v.is("ext-attr-dirty")||v.is("html-attr-dirty"))?v.parentNode.parentNode:v,{type:A}=w,C=At(w),L=kt(w);if(!C&&!L&&!ga.has(A))return;const B=Jt(w),q=m.querySelectorAll(A==="heading-title"?"heading":A).filter(O=>A==="attr-value"?At(O)===C||kt(O)===L:Jt(O)===B).reverse().map(O=>({range:Qe(O.type==="parameter-key"?O.parentNode:O)}));return q.length===0?void 0:q}async provideDefinition(p,h){const m=await j(this,o,Fe).call(this,p),x=m.elementFromPoint(h.character,h.line),S=x.is("ext")&&x.name==="ref"?x:x.closest("ext#ref"),v=rt(S,"name");if(!v)return;const w=rt(S,"group"),A=m.querySelectorAll("ext#ref").filter(C=>C.innerText&&rt(C,"name")===v&&rt(C,"group")===w).reverse().map(({lastChild:C})=>({range:Qe(C)}));return A.length===0?void 0:A}async resolveRenameLocation(p,h){const m=await j(this,o,Fe).call(this,p),x=m.elementFromPoint(h.character,h.line),{type:S}=x,v=At(x),w=kt(x);return!v&&!w&&(!an.has(S)||S==="parameter-key"&&/^[1-9]\d*$/u.test(x.parentNode.name)||S==="link-target"&&!["link","redirect-target"].includes(x.parentNode.type))?void 0:Qe(x)}async provideRenameEdits(p,h,m){const x=await j(this,o,Fe).call(this,p),S=x.elementFromPoint(h.character,h.line),{type:v}=S,w=At(S),A=w&&rt(S.parentNode.parentNode,"group"),C=kt(S),L=Jt(S),B=x.querySelectorAll(v).filter(q=>{const{type:O}=q.parentNode;return v==="link-target"&&O!=="link"&&O!=="redirect-target"?!1:v==="attr-value"?kt(q)===C||At(q)===w&&rt(q.parentNode.parentNode,"group")===A:Jt(q)===L});return B.length===0?void 0:{changes:{"":B.reverse().map(q=>({range:Qe(q),newText:m}))}}}async provideHover(p,h){if(!this.data)return;const m=await j(this,o,Fe).call(this,p);let{offsetNode:x,offset:S}=cn(m,b(this,e),h);x.type==="text"&&(S+=x.getRelativeIndex(),x=x.parentNode);const{type:v,parentNode:w,length:A,name:C}=x;let L,B,q,O;if(x.is("double-underscore")&&S>0)L=j(this,o,Rn).call(this,x.name);else if(v==="magic-word-name")L=j(this,o,$t).call(this,w.name),B=x.text().trim(),q=w.getAttribute("colon");else if(x.is("magic-word")&&!x.modifier&&A===1&&(S>0||m.posFromIndex(x.getAbsoluteIndex()).left===h.character))L=j(this,o,$t).call(this,C),B=x.firstChild.text().trim(),q=x.getAttribute("colon");else if((x.is("magic-word")||x.is("template"))&&x.modifier&&S>=2&&x.getRelativeIndex(0)>S&&(B=x.modifier.trim().slice(0,-1),L=j(this,o,$t).call(this,B.toLowerCase()),q=":",L)){const W=x.getAbsoluteIndex();O={start:St(m,W+2),end:St(m,W+x.modifier.trimEnd().length+1)}}return L&&{contents:{kind:"markdown",value:(L.signatures?`${L.signatures.map(W=>`- **{{ ${B}${W.length===0?"**":`${q}** `}${W.map(({label:F,const:P})=>P?F:`*${F}*`).join(" **|** ")} **}}**`).join(`
|
|
9
|
+
`})}}}}),ro,ad=N({"src/paramLine.ts"(){"use strict";Q(),ro=class extends z{get type(){return"param-line"}}}}),lo={};oe(lo,{ParamTagToken:()=>or});var or,ao=N({"src/multiLine/paramTag.ts"(){"use strict";J(),ye(),Zi(),D(),ar(),ad(),or=class extends Ki{constructor(e,t,i=I.getConfig(),n=[],r){super(void 0,i,n,{}),t&&this.safeAppend(t.split(`
|
|
10
|
+
`).map(s=>r?s:wi(s,i,n,e)).map(s=>new ro(s,i,n,{}))),n.splice(n.indexOf(this),1),n.push(this)}lint(e=this.getAbsoluteIndex()){{const t="no-ignored",{lintConfig:i}=I,n=i.getSeverity(t,this.name);if(!n)return[];const r=new fe(this,e),s=I.msg("invalid-parameter",this.name),l=[];for(const a of this.childNodes){a.setAttribute("aIndex",e);const d=a.childNodes.filter(({type:o})=>o!=="comment"&&o!=="include"&&o!=="noinclude");if(d.some(({type:o})=>o==="ext"))l.push(V(a,r,t,s,n));else{const o=d.findIndex(({type:c})=>c!=="text"),u=d.slice(0,o===-1?void 0:o).map(String).join("");if(u&&!(o===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(u)){const c=V(a,r,t,s,n);i.computeEditInfo&&(c.suggestions=[ee(c)]),l.push(c)}else{const c=a.lint(e,!1);c.length>0&&Array.prototype.push.apply(l,c)}}e+=a.toString().length+1}return l}}}}}),dl,$s,cl,_t,oo=N({"src/heading.ts"(){"use strict";var e,t,Bi,n;J(),Ie(),ye(),Le(),D(),Q(),mt(),dl=[Ce],_t=(n=class extends(cl=z){constructor(s,l,a,d=[]){super(void 0,a,d);R(this,t);R(this,e);F(this,e,s);const o=new z(l[0],a,d);o.type="heading-title",o.setAttribute("stage",2);const u=new He(l[1],"heading-trail",a,d);this.append(o,u)}get type(){return"heading"}get level(){return b(this,e)}toString(s){const l=j(this,t,Bi).call(this);return l+this.firstChild.toString(s)+l+this.lastChild.toString(s)}text(){const s=j(this,t,Bi).call(this);return s+this.firstChild.text()+s}getAttribute(s){return s==="invalid"?this.inHtmlAttrs()===2:s==="padding"?this.level:super.getAttribute(s)}getGaps(){return this.level}lint(s=this.getAbsoluteIndex(),l){{const a=super.lint(s,l),{firstChild:d,level:o}=this,u=d.toString(),c=u.startsWith("="),m=c||u.endsWith("="),f=new fe(this,s),y=this.inHtmlAttrs(),S=["h1","unbalanced-header","format-leakage"],{lintConfig:$}=I,{computeEditInfo:_,fix:T}=$,g=S.map(h=>$.getSeverity(h,"apostrophe"));if(g[0]&&this.level===1){const h=V(d,f,S[0],"<h1>",g[0]);_&&!m&&(h.suggestions=[qe(h,"h2",`=${u}=`)]),a.push(h)}if(g[1]&&m){const h=I.msg("unbalanced-in-section-header",'"="'),x=V(d,f,S[1],h,g[1]);if(!(!_||u==="="))if(c){const[p]=/^=+/u.exec(u),k=o+p.length;x.suggestions=[{desc:`h${o}`,range:[x.startIndex,x.startIndex+p.length],text:""}],k<7&&x.suggestions.push({desc:`h${k}`,range:[x.endIndex,x.endIndex],text:p})}else{const p=/[^=](=+)$/u.exec(u)[1],k=o+p.length;x.suggestions=[{desc:`h${o}`,range:[x.endIndex-p.length,x.endIndex],text:""}],k<7&&x.suggestions.push({desc:`h${k}`,range:[x.startIndex,x.startIndex],text:p})}a.push(x)}if(y){const h="parsing-order",x=$.getSeverity(h,y===2?"heading":"templateInTable");x&&a.push(Y(this,f,h,"header-in-html",x))}if(g[2]){const h=this.getRootNode().toString(),x=d.childNodes.filter(es("quote")),p=x.filter(({bold:v})=>v),k=x.filter(({italic:v})=>v);if(p.length%2){const v=V(p[p.length-1],{...f,start:s+o,left:f.left+o},S[2],I.msg("unbalanced-in-section-header","bold-apostrophes"),g[2]);if(_||T){const w=s+o+u.length,A=ee(v);h.slice(v.endIndex,w).trim()?_&&(v.suggestions=[A,Ze(w,"'''")]):p.length===1&&k.length===0?v.fix=A:_&&(v.suggestions=[A])}a.push(v)}if(k.length%2){const v=V(k[k.length-1],{start:s+o},S[2],I.msg("unbalanced-in-section-header","italic-apostrophes"),g[2]);if(_||T){const w=s+o+u.length;h.slice(v.endIndex,w).trim()?_&&(v.suggestions=[Ze(w,"''")]):k.length===1&&p.length===0?v.fix=ee(v):_&&(v.suggestions=[ee(v)])}a.push(v)}}return a}}print(){{const s=j(this,t,Bi).call(this);return super.print({pre:s,sep:s})}}json(s,l=this.getAbsoluteIndex()){{const a=super.json(void 0,l);return a.level=this.level,a}}},e=new WeakMap,t=new WeakSet,Bi=function(){return"=".repeat(this.level)},n),$s=ae(cl),_t=re($s,0,"HeadingToken",dl,_t),ne($s,1,_t)}}),hl,_s,gl,ii,od=N({"src/hidden.ts"(){"use strict";xt(),Le(),Q(),hl=[tt(),Ce],ii=class extends(gl=z){get type(){return"hidden"}getAttribute(e){return e==="invalid"||super.getAttribute(e)}},_s=ae(gl),ii=re(_s,0,"HiddenToken",hl,ii),ne(_s,1,ii)}}),pl,Ts,fl,si,ud=N({"src/arg.ts"(){"use strict";var e,uo,i;ve(),J(),ye(),it(),Vi(),Le(),D(),Q(),ft(),od(),pl=[Ce,De("{{{"),yi()],si=(i=class extends(fl=z){constructor(r,s,l=[]){super(void 0,s,l,{});R(this,e);for(let a=0;a<r.length;a++){const d=r[a];if(a===0){const o=new Me(d,"arg-name",s,l,{});super.insertAt(o)}else if(a>1){const o=new ii(d,s,l);super.insertAt(o)}else{const o=new z(d,s,l);o.type="arg-default",o.setAttribute("stage",2),super.insertAt(o)}}}get type(){return"arg"}get default(){var r,s;return(s=(r=this.childNodes[1])==null?void 0:r.text())!=null?s:!1}toString(r){return`{{{${super.toString(r,"|")}}}}`}text(){return`{{{${pt(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){j(this,e,uo).call(this),super.afterBuild()}lint(r=this.getAbsoluteIndex(),s){{const{childNodes:[l,a,...d]}=this;l.setAttribute("aIndex",r+3);const o=l.lint(r+3,s);if(a){const $=r+4+l.toString().length;a.setAttribute("aIndex",$);const _=a.lint($,s);_.length>0&&Array.prototype.push.apply(o,_)}const u=["no-ignored","no-arg"],{lintConfig:c}=I,{computeEditInfo:m}=c,f=new fe(this,r),y=u.map($=>c.getSeverity($,"arg"));if(y[0]&&d.length>0&&Array.prototype.push.apply(o,d.map($=>{const _=V($,f,u[0],"invisible-triple-braces",y[0]);return _.startIndex--,_.startCol--,m&&(_.suggestions=[ee(_),Pt(_.startIndex,"{{!}}")]),_})),y[1]&&!this.getAttribute("include")){const $=Y(this,f,u[1],"unexpected-argument",y[1]);m&&a&&($.suggestions=[qe($,"expand",a.text())]),o.push($)}const S=this.closest("ext");if(S){const $="arg-in-ext",_=c.getSeverity($,S.name);_&&o.push(Y(this,f,$,"argument-in-ext",_))}return o}}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(r,s=this.getAbsoluteIndex()){{const l=super.json(void 0,s);return l.default=this.default,l}}},e=new WeakSet,uo=function(){this.setAttribute("name",this.firstChild.text().trim())},i),Ts=ae(fl),si=re(Ts,0,"ArgToken",pl,si),ne(Ts,1,si)}}),co={};oe(co,{parseBraces:()=>Yi});var ml,Cs,Ci,Is,Ns,Ls,xl,Fs,Yi,ur=N({"parser/braces.ts"(){"use strict";et(),ve(),oo(),Ja(),ud(),ml={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},Cs=String.raw`\[(?!\[)`,Ci=String.raw`\n(?![=\0])`,Is=String.raw`|\{{2,}`,Ns=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),Ls=ct(e=>new RegExp(e,"gmu")),xl=new RegExp(String.raw`\{\{((?:[^\n{}[]|${Cs}|${Ci})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${Ci})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${Cs}|${Ci})*\}-`,"gu"),Fs=e=>{const t=jt(Te(e));return Ns.has(t)?Ns.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},Yi=(e,t,i)=>{var y,S,$,_,T;const n=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,r]}=t,s=[],l=[],a=(g,h,x,p)=>{h[h.length-1].push(Pe(g.slice(x,p),l))};let d;do d!==void 0&&(e=d),d=e.replace(xl,(g,h,x)=>{if(h!==void 0||typeof x=="string")try{const{length:p}=i,k=(h!=null?h:x).split("|");return new at(Pe(k[0],l),k.slice(1).map(v=>{const w=v.indexOf("=");return(w===-1?[v]:[v.slice(0,w),v.slice(w+1)]).map(A=>Pe(A,l))}),t,i),`\0${p}${Fs(k[0])}`}catch(p){if(!(p instanceof SyntaxError)||p.message!=="Invalid template name")throw p}return l.push(Pe(g,l)),`\0${l.length-1}`});while(d!==e);e=d;const o=e.lastIndexOf("}}")-e.length;let u=o+e.length!==-1,c=Ls(n+(u?Is:"")),m=c.exec(e),f;for(;m||f!==void 0&&f<=e.length&&((S=(y=s[s.length-1])==null?void 0:y[0])!=null&&S.startsWith("="));){if(m!=null&&m[1]){const[,{length:q}]=m;m[0]=m[0].slice(q),m.index+=q}const{0:g,index:h}=m!=null?m:{0:`
|
|
11
|
+
`,index:e.length},x=($=s.pop())!=null?$:{},{0:p,index:k,parts:v,findEqual:w,pos:A}=x,C=g==="="&&w;if(g==="]]"||g==="}-")f=h+2;else if(g===`
|
|
12
|
+
`){f=h+1;const{pos:q,findEqual:B}=(_=s[s.length-1])!=null?_:{};if(q===void 0||B||Te(e.slice(q,k))!==""){const O=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(e.slice(k,h));O&&(O[2]=Pe(O[2],l),O[2].includes(`
|
|
13
|
+
`)||(e=`${e.slice(0,k)}\0${i.length}h${e.slice(h)}`,f=k+4+String(i.length).length,new _t(O[1].length,O.slice(2),t,i)))}}else if(g==="|"||C)f=h+1,a(e,v,A,h),g==="|"&&v.push([]),x.pos=f,x.findEqual=g==="|",s.push(x);else if(g.startsWith("}}")){const q=g.slice(0,Math.min(p.length,3)),B=p.length-q.length,{length:O}=i;f=h+q.length,a(e,v,A,h);let W=!1,E="t";if(q.length===3){const P=v.map(M=>M.join("=")),U=P.length>1&&Te(P[1]).trim();new si(P,t,i),U&&U.endsWith(":")&&r.includes(U.slice(0,-1).toLowerCase())&&(E="s")}else try{new at(v[0][0],v.slice(1),t,i),E=Fs(v[0][0])}catch(P){if(P instanceof SyntaxError&&P.message==="Invalid template name")W=!0;else throw P}W||(e=`${e.slice(0,k+B)}\0${O}${E}${e.slice(f)}`,f=k+B+3+String(O).length,B>1?s.push({0:p.slice(0,B),index:k,pos:k+B,parts:[[]]}):B===1&&e[k-1]==="-"&&s.push({0:"-{",index:k-1,pos:k+1,parts:[[]]}))}else f=h+g.length,g.startsWith("{")&&(m.pos=f,m.parts=[[]]),s.push(..."0"in x?[x]:[],m);let L=s[s.length-1];if(u&&o+e.length<f)for(u=!1;(T=L==null?void 0:L[0])!=null&&T.startsWith("{");)s.pop(),L=s[s.length-1];c=Ls(n+(u?Is:"")+(L?`|${ml[L[0][0]]}${L.findEqual?"|=":""}`:"")),c.lastIndex=f,m=c.exec(e)}return Pe(e,l)}}}),ho={};oe(ho,{InputboxToken:()=>go});var go,dd=N({"src/multiLine/inputbox.ts"(){"use strict";Zi(),ur(),D(),ao(),go=class extends or{constructor(e,t,i=I.getConfig(),n=[]){const r=Symbol("InputboxToken"),s=i.excludes.includes("heading")?i:{...i,excludes:[...i.excludes,"heading"]},{length:l}=n;n.push(r),t&&(t=wi(t,s,n,e)),t&&(t=Yi(t,s,n)),n.splice(l,1),super(e,t,s,n,{})}}}}),qi={};oe(qi,{NestedToken:()=>po});var vl,bl,po,Es=N({"src/nested.ts"(){"use strict";var e,t,i;J(),ye(),Zi(),ur(),D(),Q(),Eo(),Bt(),vl=new Set(["comment","include","arg","template","magic-word"]),bl=[!1,!0].map(n=>{const r=n?"includeonly":"noinclude";return new RegExp(String.raw`^(?:<${r}(?:\s[^>]*)?/?>|</${r}\s*>)$`,"iu")}),po=(i=class extends z{constructor(r,s,l,a,d=[]){if(typeof s=="boolean"){const o=Symbol("NestedToken"),{length:u}=d;d.push(o),r&&(r=wi(r,a,d,s)),r&&(r=Yi(r,a,d)),d.splice(u,1)}else r&&(r=r.replace(s,(o,u,c,m,f)=>{const y=`\0${d.length+1}e`;return new Nt(u,c,m,f,a,!1,d),y}));r&&(r=r.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(o,u,c)=>(new Oe(c,a,d),`${u}\0${d.length}n`)));super(r,a,d);R(this,e);R(this,t);F(this,e,[...l]),F(this,t,s)}get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex(),s){{const l=super.lint(r,s),a="no-ignored",{lintConfig:d}=I,o=d.getSeverity(a,this.name);if(!o)return l;const u=new fe(this,r),c=typeof b(this,t)=="boolean"?bl[b(this,t)?1:0]:/^<!--[\s\S]*-->$/u;return[...l,...this.childNodes.filter(m=>{const{type:f,name:y}=m;if(f==="ext")return!b(this,e).includes(y);if(vl.has(f))return!1;const S=m.toString().trim();return S&&!c.test(S)}).map(m=>{const f=V(m,u,a,I.msg("invalid-content",this.name),o);return d.computeEditInfo&&(f.suggestions=[ee(f),Jn(f,m.toString())]),f})]}}},e=new WeakMap,t=new WeakMap,i)}});function yl(e,t,i,n,r){t=Te(t).trim();let s=t.replace(e==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(e){case"width":return!s&&!!t||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(s);case"link":{const l=n==="gallery-image";if(s){if(fo(i.protocol).test(s))return mo(i.protocol).test(s)?t:l;s.startsWith("[[")&&s.endsWith("]]")&&(s=s.slice(2,-2))}else return t;const a=I.normalizeTitle(s,0,!1,i,{halfParsed:r,decode:!0,selfLink:!0,page:""});return a.valid?a:l}case"lang":return(n==="svg"||n==="svgz")&&!/[^a-z\d-]/u.test(s);case"alt":case"class":case"manualthumb":return!0;case"page":return(n==="djvu"||n==="djv"||n==="pdf")&&Number(s)>0;default:return!!s&&!isNaN(s)}}var fo,mo,wl,Sl,Al,js,kl,ni,cd=N({"src/imageParameter.ts"(){"use strict";var e,t,xo,r;et(),ve(),J(),Ue(),Ie(),Le(),D(),Q(),fo=ct(s=>new RegExp(String.raw`^(?:${s}|//|\0\d+m\x7F)`,"iu")),mo=ct(s=>new RegExp(String.raw`^(?:(?:${s}|//)${Ft}|\0\d+m\x7F)${Et}$`,"iu")),wl=ct(s=>new RegExp(String.raw`^(\s*(?!\s))${s.replace("$1","(.*)")}${s.endsWith("$1")?`(?=$|
|
|
14
|
+
)`:""}(\s*)$`,"u")),Sl=s=>{if(s)s.startsWith("//")&&(s=`https:${s}`);else return s;return new URL(s).href},Al=[Ce],ni=(r=class extends(kl=z){constructor(l,a,d,o){var s=(...n)=>(super(...n),R(this,t),R(this,e,""),this);let u;const c=Object.entries(d.img).map(([f,y])=>[f,y,wl(f)]),m=c.find(([,f,y])=>(u=y.exec(l),u&&(u.length!==4||yl(f,u[2],d,a,!0)!==!1)));if(m&&u){u.length===3?(s(void 0,d,o),F(this,e,l)):(s(u[2],d,o,{}),F(this,e,u[1]+m[0]+u[3])),this.setAttribute("name",m[1]),m[1]==="alt"&&this.setAttribute("stage",$e-1);return}s(l,d.excludes.includes("list")?d:{...d,excludes:[...d.excludes,"list"]},o),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get type(){return"image-parameter"}get thumb(){return this.name==="manualthumb"?this.normalizeTitle(`File:${super.text().trim()}`,6,{page:""}):void 0}get link(){{if(this.name!=="link")return;const l=super.text().trim();return pe.run(()=>{var o;const a=new z(l,this.getAttribute("config"));if(a.parseOnce(0,this.getAttribute("include")).parseOnce(),/^\0\d+m\x7F/u.test(a.firstChild.toString()))return l;const d=yl("link",l,this.getAttribute("config"),(o=this.parentNode)==null?void 0:o.type);return d===!0?void 0:d},I)}}afterBuild(){var l;(l=this.parentNode)!=null&&l.is("gallery-image")&&!qa.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(l){return b(this,e)?b(this,e).replace("$1",super.toString(l)):super.toString(l)}text(){return b(this,e)?b(this,e).replace("$1",super.text()).trim():super.text().trim()}isPlain(){return this.name==="caption"||this.name==="alt"}getAttribute(l){return l==="invalid"?this.name==="invalid":l==="padding"?Math.max(0,b(this,e).indexOf("$1")):super.getAttribute(l)}lint(l=this.getAbsoluteIndex(),a){{const d=super.lint(l,a),{lintConfig:o}=I,{computeEditInfo:u,fix:c}=o,{link:m,name:f}=this,y=f==="width"&&this.getValue();if(f==="invalid"||y&&y.endsWith("px")){const S="invalid-gallery",$=o.getSeverity(S,"parameter");if($){const _=Y(this,{start:l},S,"invalid-image-parameter",$);(u||c)&&(_.fix=y?ee(_,0,y):ee(_,-1)),d.push(_)}}else if(f==="link"){if(typeof m=="string"){const S="invalid-url",$=o.getSeverity(S);if($&&!this.querySelector("magic-word"))try{Sl(m)}catch{d.push(Y(this,{start:l},S,"invalid-url",$))}}else if(m.encoded){const S="url-encoding",$=o.getSeverity(S,"file");if($){const _=Y(this,{start:l},S,"unnecessary-encoding",$);(u||c)&&(_.fix=Vn(_,this)),d.push(_)}}}else if(f==="manualthumb"){const S="invalid-gallery",$=o.getSeverity(S,"thumb");if($&&!this.querySelector("arg,magic-word,template")){const{valid:_,ns:T,extension:g}=this.thumb;(!_||T!==6||!Mi.has(g))&&d.push(Y(this,{start:l},S,"invalid-thumb",$))}}return d}}getValue(){return this.name==="invalid"?this.text():j(this,t,xo).call(this)||super.text()}print(){return b(this,e)?`<span class="wpb-image-parameter${this.name==="invalid"?" wpb-invalid":""}">${b(this,e).replace("$1",`<span class="wpb-image-caption">${Rt(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}},e=new WeakMap,t=new WeakSet,xo=function(){return b(this,e)&&!b(this,e).includes("$1")},r),js=ae(kl),ni=re(js,0,"ImageParameterToken",Al,ni),ne(js,1,ni)}}),Rs,$l,_l,Ps,Os,Tl,Bs,dr,vo=N({"src/link/file.ts"(){"use strict";J(),Ue(),ye(),D(),Qi(),cd(),Rs=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),$l=new Set(["arg"]),_l=new Set(["template","magic-word"]),Ps=new Set(["left","right","center","none"]),Os=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),Tl=e=>{if(e===void 0)return[];const t=/-\{|\}-|\|/gu,i=[];let n=t.exec(e),r=0,s=0;for(;n;){const{0:l,index:a}=n;l!=="|"?r+=l==="-{"?1:-1:r===0&&(i.push(e.slice(s,a)),{lastIndex:s}=t),n=t.exec(e)}return i.push(e.slice(s)),i},Bs=(e,t)=>e.filter(({childNodes:i})=>!i.some(n=>n.text().trim()&&t.has(n.type))),dr=class extends Xe{get type(){return"file"}get extension(){return this.getAttribute("title").extension}constructor(e,t,i,n=[],r="|"){super(e,void 0,i,n,r);const{extension:s}=this.getTitle(!0,!0);this.safeAppend(Tl(t).map(l=>new ni(l,s,i,n)))}lint(e=this.getAbsoluteIndex(),t){var i;{const n=super.lint(e,t),r=Bs(this.getAllArgs(),$l),s=[...new Set(r.map(({name:p})=>p))],l=s.filter(p=>Rs.has(p)),a=s.filter(p=>Ps.has(p)),d=s.filter(p=>Os.has(p)),[o]=l,u=o==="framed"||o==="manualthumb",c=new fe(this,e),{lintConfig:m}=I,{computeEditInfo:f,fix:y}=m,{ns:S,extension:$}=this.getAttribute("title"),{firstChild:_}=this;let T="nested-link",g=m.getSeverity(T,"file");if(g&&Mi.has($)&&this.isInside("ext-link-text")&&((i=this.getValue("link"))==null?void 0:i.trim())!==""){const p=Y(this,c,T,"link-in-extlink",g);if(f||y){const k=this.getArg("link");if(k){const v=e+k.getRelativeIndex();p.fix={desc:I.msg("delink"),range:[v,v+k.toString().length],text:"link="}}else p.fix=Di(p.endIndex-2,"delink","|link=")}n.push(p)}if(T="invalid-gallery",g=m.getSeverity(T,"extension"),g&&S===6&&!$&&!_.querySelector("arg,magic-word,template")&&n.push(Y(this,c,T,"missing-extension",g)),g=m.getSeverity(T,"parameter"),g&&u)for(const p of r.filter(({name:k})=>k==="width")){const k=V(p,c,T,"invalid-image-parameter",g);(f||y)&&(k.fix=ee(k,-1)),n.push(k)}if(r.length===s.length&&l.length<2&&a.length<2&&d.length<2)return n;T="no-duplicate";const h=["unknownImageParameter","imageParameter"].map(p=>m.getSeverity(T,p)),x=(p,k,v,w=!0)=>p.map(A=>{if(g=h[Number(typeof w=="function"?w(A):w)],!g)return!1;const C=V(A,c,T,I.msg(`${k}-image-parameter`,v),g);return f&&(C.suggestions=[ee(C,-1)]),C}).filter(A=>A!==!1);for(const p of s){if(p==="invalid"||p==="width"&&u)continue;const k=p==="caption";let v=r.filter(({name:w})=>w===p);if(k&&(v=[...v.slice(0,-1).filter(w=>w.text()),...v.slice(-1)]),v.length>1){let w=!k||!$||Mi.has($);if(k&&w){const A=Bs(v,_l);w=A.length>1&&(C=>A.includes(C))}Array.prototype.push.apply(n,x(v,"duplicate",p,w))}}return l.length>1&&Array.prototype.push.apply(n,x(r.filter(({name:p})=>Rs.has(p)),"conflicting","frame")),a.length>1&&Array.prototype.push.apply(n,x(r.filter(({name:p})=>Ps.has(p)),"conflicting","horizontal-alignment")),d.length>1&&Array.prototype.push.apply(n,x(r.filter(({name:p})=>Os.has(p)),"conflicting","vertical-alignment")),n}}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 i=super.json(void 0,t),{extension:n}=this;return n&&(i.extension=n),i}}}}}),Cl,qs,Il,Tt,bo=N({"src/link/galleryImage.ts"(){"use strict";var e,In,i;J(),Ue(),it(),D(),Q(),vo(),Cl=[De("")],Tt=(i=class extends(Il=dr){constructor(r,s,l,a,d=[]){let o;if(l!==void 0){const{length:u}=d;o=new z(l,a,d);for(let c=0;c<$e-1;c++)o.parseOnce();d.splice(u,1)}super(s,o==null?void 0:o.firstChild.toString(),a,d);R(this,e);Ee(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=`${r}-image`,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(r){const s=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),s?0:6,{halfParsed:!0,temporary:r,decode:!s,page:""})}lint(r=this.getAbsoluteIndex(),s){{const l=super.lint(r,s),a="invalid-gallery",{lintConfig:d}=I,o=d.getSeverity(a,"image");if(o&&j(this,e,In).call(this)){const u=Y(this,{start:r},a,"invalid-gallery",o);d.computeEditInfo&&(u.suggestions=[Di(r,"prefix","File:")]),l.push(u)}return l}}getAttribute(r){return r==="invalid"?j(this,e,In).call(this):super.getAttribute(r)}},e=new WeakSet,In=function(){const{ns:r}=this.getAttribute("title");return r!==6},i),qs=ae(Il),Tt=re(qs,0,"GalleryImageToken",Cl,Tt),ne(qs,1,Tt)}}),Ui,yo=N({"src/nowiki/commentLine.ts"(){"use strict";Bt(),Ui=class extends Oe{}}}),wo={};oe(wo,{GalleryToken:()=>So});var So,hd=N({"src/multiLine/gallery.ts"(){"use strict";var e,Ao,Nn,n;J(),D(),ar(),bo(),yo(),So=(n=class extends Ki{constructor(s,l,a=[]){var d;super(void 0,l,a,{});R(this,e);for(const o of(d=s==null?void 0:s.split(`
|
|
15
|
+
`))!=null?d:[]){const u=/^([^|]+)(?:\|(.*))?/u.exec(o);if(!u){super.insertAt(o.trim()?new Ui(o,l,a):o);continue}const[,c,m]=u;j(this,e,Ao).call(this,c)?super.insertAt(new Tt("gallery",c,m,l,a)):super.insertAt(new Ui(o,l,a))}}get widths(){return j(this,e,Nn).call(this,"widths")}get heights(){return j(this,e,Nn).call(this,"heights")}lint(s=this.getAbsoluteIndex(),l){{const{top:a,left:d}=this.getRootNode().posFromIndex(s),o=[],u="no-ignored",{lintConfig:c}=I,m=["Image","NoImage","Comment"].map(f=>c.getSeverity(u,`gallery${f}`));for(let f=0;f<this.length;f++){const y=this.childNodes[f],S=y.toString(),{length:$}=S,_=S.trim(),{type:T}=y,g=a+f,h=f?0:d;if(y.setAttribute("aIndex",s),T==="noinclude"&&_&&!/^<!--.*-->$/u.test(_)){let[x]=m;if(_.startsWith("|")?[,x]=m:(_.startsWith("<!--")||_.endsWith("-->"))&&([,,x]=m),x){const p=s+$,k={rule:u,message:I.msg("invalid-content","gallery"),severity:x,startIndex:s,endIndex:p,startLine:g,endLine:g,startCol:h,endCol:h+$};c.computeEditInfo&&(k.suggestions=[ee(k),Jn(k,S)]),o.push(k)}}else if(T!=="noinclude"&&T!=="text"){const x=y.lint(s,l);x.length>0&&Array.prototype.push.apply(o,x)}s+=$+1}return o}}json(s,l=this.getAbsoluteIndex()){{const a=super.json(void 0,l);return Object.assign(a,{widths:this.widths,heights:this.heights}),a}}},e=new WeakSet,Ao=function(s){return this.normalizeTitle(s,6,{halfParsed:!0,temporary:!0,decode:!0,page:""}).valid},Nn=function(s){var l,a;{const d=(l=this.parentNode)==null?void 0:l.getAttr(s),o=typeof d=="string"&&((a=/^(\d+)\s*(?:px)?$/u.exec(d))==null?void 0:a[1]);return o&&Number(o)||120}},n)}}),cr,ko=N({"src/link/index.ts"(){"use strict";et(),J(),D(),Qi(),cr=class extends Xe{get type(){return"link"}get innerText(){return this.length>1?this.lastChild.text():fi(this.firstChild.text().replace(/^\s*:?/u,""))}lint(e=this.getAbsoluteIndex(),t){{const i=super.lint(e,t),n="nested-link",{lintConfig:r}=I,s=r.getSeverity(n);if(s&&this.isInside("ext-link-text")){const l=Y(this,{start:e},n,"link-in-extlink",s);(r.computeEditInfo||r.fix)&&(l.fix=qe(l,"delink",this.innerText)),i.push(l)}return i}}}}}),Nl,Ll,vi,hr=N({"src/magicLink.ts"(){"use strict";var e,t,Ln,n;J(),ve(),ye(),D(),Q(),Nl=String.raw`(?:[${Ye}\t]| |�*160;|&#[xX]0*[aA]0;)`,Ll=new RegExp(`${Nl}+`,"gu"),vi=(n=class extends z{constructor(s,l="free-ext-link",a=I.getConfig(),d){super(s,a,d,{});R(this,t);R(this,e);F(this,e,l)}get type(){return b(this,e)}get innerText(){const s=new Map([["!","|"],["=","="]]);let l=pt(this.childNodes.map(a=>{const{type:d}=a,o=String(a.name);return d==="magic-word"&&s.has(o)?s.get(o):a}));return this.type==="magic-link"&&(l=l.replace(Ll," ")),l}get link(){const{innerText:s}=this;return this.type==="magic-link"?s.startsWith("ISBN")?`ISBN ${s.slice(5).replace(/[- ]/gu,"").replace(/x$/u,"X")}`:s:Oa(s).replace(/\n/gu,"%0A")}lint(s=this.getAbsoluteIndex(),l){{const a=super.lint(s,l),d=new fe(this,s),{lintConfig:o}=I,{type:u,childNodes:c}=this;if(u==="magic-link"){const S="invalid-isbn",$=o.getSeverity(S);return $&&j(this,t,Ln).call(this)&&a.push(Y(this,d,S,"invalid-isbn",$)),a}let m="invalid-url",f=o.getSeverity(m);if(f&&!this.querySelector("magic-word"))try{this.getUrl()}catch{a.push(Y(this,d,m,"invalid-url",f))}const y=u==="ext-link-url";if(m="unterminated-url",f=o.getSeverity(m,y?"pipe":"punctuation"),f){const S=y?/\|/u:/[,;。:!?()]+/u,$=c.find(_=>_.type==="text"&&S.test(_.data));if($){const{data:_}=$,T=V($,d,m,I.msg("in-url",y?'"|"':"full-width-punctuation"),f);if(o.computeEditInfo){const{index:g,0:h}=S.exec(_),x=T.startIndex+g;T.suggestions=y?[xi(x,1)]:[xi(x),{desc:I.msg("encode"),range:[x,x+h.length],text:encodeURI(h)}]}a.push(T)}}return a}}getUrl(s){{const{type:l}=this;let{link:a}=this;if(l==="magic-link"){if(a.startsWith("ISBN"))return this.normalizeTitle(`BookSources/${a.slice(5)}`,-1,{temporary:!0}).getUrl(s);a=a.startsWith("RFC")?`https://datatracker.ietf.org/doc/html/rfc${a.slice(4)}`:`https://pubmed.ncbi.nlm.nih.gov/${a.slice(5)}`}else a.startsWith("//")&&(a=`https:${a}`);return new URL(a)}this.lspError("MagicLinkToken.getUrl")}getAttribute(s){return s==="invalid"?j(this,t,Ln).call(this):super.getAttribute(s)}},e=new WeakMap,t=new WeakSet,Ln=function(){if(this.type==="magic-link"){const{link:s}=this;if(s.startsWith("ISBN")){const l=[...s.slice(5)].map(a=>a==="X"?10:Number(a));return l.length===10?l.reduce((a,d,o)=>a+d*(10-o),0)%11!==0:l.length===13&&(l[12]===10||l.reduce((a,d,o)=>a+d*(o%2?3:1),0)%10!==0)}}return!1},n)}}),Fl,Ws,El,Ct,$o=N({"src/extLink.ts"(){"use strict";var e,t;Ue(),J(),it(),D(),Q(),hr(),Fl=[De("[")],Ct=(t=class extends(El=z){constructor(n,r="",s="",l,a=[]){super(void 0,l,a,{});R(this,e);const d=n&&/^\0\d+f\x7F$/u.test(n)?a[Number(n.slice(1,-2))]:new vi(n,"ext-link-url",l,a);if(this.insertAt(d),F(this,e,r),s){const o=new z(s,l,a,{});o.type="ext-link-text",o.setAttribute("stage",$e-1),this.insertAt(o)}}get type(){return"ext-link"}toString(n){return this.length===1?`[${super.toString(n)}${b(this,e)}]`:`[${super.toString(n,b(this,e))}]`}text(){return`[${super.text(" ")}]`}getGaps(){return b(this,e).length}lint(n=this.getAbsoluteIndex(),r){{const s=super.lint(n,r),l="var-anchor",a=I.lintConfig.getSeverity(l,"extLink");return a&&this.length===1&&this.isInside("heading-title")&&s.push(Y(this,{start:n},l,"variable-anchor",a)),s}}print(){return super.print(this.length===1?{pre:"[",post:`${b(this,e)}]`}:{pre:"[",sep:b(this,e),post:"]"})}},e=new WeakMap,t),Ws=ae(El),Ct=re(Ws,0,"ExtLinkToken",Fl,Ct),ne(Ws,1,Ct)}}),Fn,gd=N({"src/imagemapLink.ts"(){"use strict";Q(),Bt(),ko(),$o(),Fn=class extends z{get type(){return"imagemap-link"}constructor(e,t,i,n,r=[]){super(void 0,n,r),this.append(e,t.length===2?new cr(...t,n,r):new Ct(...t,n,r),new Oe(i,n,r))}}}}),_o={};oe(_o,{ImagemapToken:()=>To});var To,pd=N({"src/multiLine/imagemap.ts"(){"use strict";J(),Ie(),ye(),D(),ar(),yo(),bo(),gd(),To=class extends Ki{get image(){return this.childNodes.find(es("imagemap-image"))}constructor(e,t=I.getConfig(),i=[]){if(super(void 0,t,i,{}),!e)return;const n=e.split(`
|
|
16
|
+
`),r=new Set(t.protocol.split("|"));let s=!0,l=!1;for(const a of n){const d=a.trim();if(!(l||!d||d.startsWith("#"))){if(s){const o=a.indexOf("|"),u=o===-1?a:a.slice(0,o),{valid:c,ns:m}=this.normalizeTitle(u,0,{halfParsed:!0,temporary:!0,page:""});if(c&&m===6){const f=new Tt("imagemap",u,o===-1?void 0:a.slice(o+1),t,i);super.insertAt(f),s=!1;continue}else l=!0}else if(a.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(a);continue}else if(a.includes("[")){const o=a.indexOf("["),u=a.slice(o),c=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(u);if(c){if(this.normalizeTitle(c[1],0,{halfParsed:!0,temporary:!0,selfLink:!0,page:""}).valid){super.insertAt(new Fn(a.slice(0,o),c.slice(1),u.slice(u.indexOf("]]")+2),t,i));continue}}else if(u.startsWith("[//")||r.has(u.slice(1,u.indexOf(":")+1))||r.has(u.slice(1,u.indexOf("//")+2))){const m=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(u);if(m){super.insertAt(new Fn(a.slice(0,o),m.slice(1),u.slice(u.indexOf("]")+1),t,i));continue}}}}super.insertAt(new Ui(a,t,i))}}lint(e=this.getAbsoluteIndex(),t){{const i=super.lint(e,t),n=new fe(this,e),{childNodes:r,image:s}=this,l="invalid-imagemap",{lintConfig:a}=I,d=a.getSeverity(l,s?"link":"image");return d&&(s?Array.prototype.push.apply(i,r.filter(o=>{const u=o.toString().trim();return o.is("noinclude")&&u&&!u.startsWith("#")}).map(o=>{const u=V(o,n,l,"invalid-imagemap-link",d);return a.computeEditInfo&&(u.suggestions=[ee(u,-1),qe(u,"comment","# ")]),u})):i.push(Y(this,n,l,"imagemap-without-image",d))),i}}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}}}}),jl,Ms,Rl,It,Co=N({"src/nowiki/comment.ts"(){"use strict";J(),xt(),it(),D(),vt(),jl=[tt(!1),De("<!--")],It=class extends(Rl=We){constructor(t,i,n,r){super(t,n,r);Ee(this,"closed");this.closed=i}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){{if(this.closed)return[];const i="unclosed-comment",{lintConfig:n}=I,r=n.getSeverity(i);if(!r)return[];const s=Y(this,{start:t},i,"unclosed-comment",r);return n.computeEditInfo&&(s.suggestions=[Ze(s.endIndex,"-->")]),[s]}}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}},Ms=ae(Rl),It=re(Ms,0,"CommentToken",jl,It),ne(Ms,1,It)}}),Io={};oe(Io,{CommentedToken:()=>No});var No,fd=N({"src/commented.ts"(){"use strict";Q(),Co(),No=class extends z{get type(){return"ext-inner"}constructor(e,t,i=[]){if(super(void 0,t,i,{AstText:":",CommentToken:":"}),e){let n=e.indexOf("<!--"),r=n!==-1&&e.indexOf("-->",n+4),s=0;for(;r!==!1&&r!==-1;)n>s&&this.insertAt(e.slice(s,n)),this.insertAt(new It(e.slice(n+4,r),!0,t,i)),s=r+3,n=e.indexOf("<!--",s),r=n!==-1&&e.indexOf("-->",n+4);s<e.length&&this.insertAt(e.slice(s))}}lint(e=this.getAbsoluteIndex()){return super.lint(e,new RegExp(String.raw`<\s*(?:\/\s*)?(${this.name})\b`,"giu"))}}}}),Lo={};oe(Lo,{NowikiToken:()=>Fo});var Pl,Ol,Fo,md=N({"src/nowiki/index.ts"(){"use strict";var e,En,i;et(),J(),D(),vt(),Pl=ct(n=>new RegExp(String.raw`<\s*(?:/\s*)${n==="nowiki"?"":"?"}(${n})\b`,"giu")),Ol=new Set(["languages","section","templatestyles"]),Fo=(i=class extends We{constructor(){super(...arguments);R(this,e)}get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex()){{const{name:s}=this,{lintConfig:l}=I;let a="void-ext",d=l.getSeverity(a,s);if(d&&j(this,e,En).call(this)){const u=Y(this,{start:r},a,I.msg("nothing-in",s),d);return l.computeEditInfo&&(u.suggestions=[ee(u)]),[u]}return super.lint(r,Pl(s))}}getAttribute(r){return r==="invalid"?j(this,e,En).call(this):super.getAttribute(r)}},e=new WeakSet,En=function(){const{name:r,firstChild:{data:s}}=this;return Ol.has(r)&&!!s},i)}}),Bl,Us,ql,Nt,Eo=N({"src/tagPair/ext.ts"(){"use strict";J(),ye(),D(),ir(),Q(),tr(),lr(),Bl=[Ji()],Nt=class extends(ql=ot){get type(){return"ext"}constructor(e,t,i,n,r=I.getConfig(),s=!1,l=[]){const a=e.toLowerCase(),d=new Xi(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",a,r,l),o={...r,ext:r.ext.filter(c=>c!==a),excludes:[...r.excludes],inExt:!0};let u;switch(a){case"tab":o.ext=o.ext.filter(c=>c!=="tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":a==="poem"&&o.excludes.push("heading"),u=new z(i,o,l);break;case"pre":{const{PreToken:c}=(ld(),se(so));u=new c(i,o,l);break}case"dynamicpagelist":{const{ParamTagToken:c}=(ao(),se(lo));u=new c(s,i,o,l);break}case"inputbox":{const{InputboxToken:c}=(dd(),se(ho));u=new c(s,i,o,l);break}case"references":{const{NestedToken:c}=(Es(),se(qi));o.excludes.push("heading"),u=new c(i,s,["ref"],o,l);break}case"choose":{const{NestedToken:c}=(Es(),se(qi));u=new c(i,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],o,l);break}case"combobox":{const{NestedToken:c}=(Es(),se(qi));u=new c(i,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],o,l);break}case"gallery":{const{GalleryToken:c}=(hd(),se(wo));u=new c(i,o,l);break}case"imagemap":{const{ImagemapToken:c}=(pd(),se(_o));u=new c(i,o,l);break}case"hiero":{const{CommentedToken:c}=(fd(),se(Io));u=new c(i,o,l);break}default:{const{NowikiToken:c}=(md(),se(Lo));u=new c(i,o,l)}}u.setAttribute("name",a),u.type==="plain"&&(u.type="ext-inner"),super(e,d,u,n,r,l),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){{const i=super.lint(e,t),{lintConfig:n}=I,r=new fe(this,e);if(this.name!=="nowiki"){const s=this.inHtmlAttrs(),l="parsing-order",a=s&&n.getSeverity(l,s===2?"ext":"templateInTable");a&&i.push(Y(this,r,l,"ext-in-html",a))}if(this.name==="ref"){let s="var-anchor",l=n.getSeverity(s,"ref");l&&this.closest("heading-title")&&i.push(Y(this,r,s,"variable-anchor",l)),s="nested-link",l=n.getSeverity(s,"ref"),l&&this.closest("link-text,ext-link-text")&&i.push(Y(this,r,s,"ref-in-link",l))}return i}}},Us=ae(ql),Nt=re(Us,0,"ExtToken",Bl,Nt),ne(Us,1,Nt)}}),gr,jo=N({"src/tag/index.ts"(){"use strict";var e,t,i,n;J(),Ie(),Q(),D(),gr=(n=class extends z{constructor(s,l,a,d,o){super(void 0,d,o);R(this,e);R(this,t);R(this,i);this.insertAt(l),F(this,e,a),F(this,t,s)}get closing(){return b(this,e)}toString(s){return`<${b(this,e)?"/":""}${b(this,t)}${super.toString(s)}${this.selfClosing?"/":""}>`}text(s=""){const{closing:l}=this;return`<${l&&!s?"/":""}${b(this,t)}${l?"":super.text()}${s}>`}getAttribute(s){return s==="padding"?b(this,t).length+(b(this,e)?2:1):super.getAttribute(s)}findMatchingTag(){return ht(b(this,i),()=>{const{type:s,name:l,parentNode:a,closing:d,selfClosing:o}=this;let u=!1,c=!1;if(s==="html"){const{html:[,_,T]}=this.getAttribute("config");u=T.includes(l),c=_.includes(l)}if(u||c&&o)return this;if(!a)return;const{childNodes:m}=a,f=m.indexOf(this),y=d?m.slice(0,f).reverse():m.slice(f+1),S=[this],{rev:$}=pe;for(const _ of y)if(!(!_.is(s)||s==="html"&&(_.name!==l||c&&_.selfClosing)))if(b(_,e)===d){if(s==="tvar")return;S.push(_)}else{const T=S.pop();if(T===this)return _;I.viewOnly&&(F(T,i,[$,_]),F(_,i,[$,T]))}if(I.viewOnly)for(const _ of S)F(_,i,[$,void 0])},s=>{F(this,i,s),s[1]&&s[1]!==this&&F(s[1],i,[pe.rev,this])})}print(){return super.print({pre:`<${b(this,e)?"/":""}${b(this,t)}`,post:`${this.selfClosing?"/":""}>`})}json(s,l=this.getAbsoluteIndex()){{const a=super.json(void 0,l);return a.closing=b(this,e),a}}},e=new WeakMap,t=new WeakMap,i=new WeakMap,n)}}),Wl,zs,Ml,Ke,xd=N({"src/tag/tvar.ts"(){"use strict";xt(),Le(),jo(),mt(),Wl=[tt(),Ce],Ke=class extends(Ml=gr){get type(){return"tvar"}constructor(e,t,i,n,r){const s=new He(t,"tvar-name",n,r);super(e,s,i,n,r)}},zs=ae(Ml),Ke=re(zs,0,"TvarToken",Wl,Ke),ne(zs,1,Ke)}}),Ro={};oe(Ro,{TranslateToken:()=>Po});var Po,vd=N({"src/tagPair/translate.ts"(){"use strict";var e,Oo,i;Q(),tr(),mt(),xd(),Po=(i=class extends ot{constructor(r,s,l,a=[]){const d=new He(r,"translate-attr",l,a);s=s==null?void 0:s.replace(/<tvar(\|[^>]+)>([\s\S]*?)<\/>/gu,(u,c,m)=>(new Ke("tvar",c,!1,l,a),new Ke("","",!0,l,a),`\0${a.length-2}n${m}\0${a.length}n`)).replace(/<(tvar)(\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\3|[^"'\s>]+))?\s*)>([\s\S]*?)<\/(tvar)(\s*)>/giu,(u,c,m,f,y,S,$)=>(new Ke(c,m,!1,l,a),new Ke(S,$,!0,l,a),`\0${a.length-2}n${y}\0${a.length}n`));const o=new z(s,l,a);o.type="translate-inner";super("translate",d,o,"translate",l,a);R(this,e);this.seal("closed",!0),this.seal("selfClosing",!0)}get type(){return"translate"}toString(r){return r?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){return`<span class="wpb-ext"><translate${j(this,e,Oo).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,Oo=function(){return this.firstChild.toString()===" nowrap"},i)}}),Bo={};oe(Bo,{parseCommentAndExt:()=>wi});var Hs,Ul,Ii,zl,Ds,wi,Zi=N({"parser/commentAndExt.ts"(){"use strict";et(),ve(),sd(),Bt(),nd(),Eo(),Co(),Hs="<onlyinclude>",Ul="</onlyinclude>",{length:Ii}=Hs,zl=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",i=e?"noinclude":"includeonly";return ct(n=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${n})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(${"\\1"}\s*)>)|<(${i})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${i}\s*)>|$))`,"giu"))}),Ds=e=>{const t=e.indexOf(Hs);return{i:t,j:e.indexOf(Ul,t+Ii)}},wi=(e,t,i,n)=>{if(n){let{i:d,j:o}=Ds(e);if(d!==-1&&o!==-1){let u="";const c=m=>{new Oe(m,t,i),u+=`\0${i.length-1}n`};for(;d!==-1&&o!==-1;){const m=`\0${i.length}g`;new ei(e.slice(d+Ii,o),t,i),d>0&&c(e.slice(0,d)),u+=m,e=e.slice(o+Ii+1),{i:d,j:o}=Ds(e)}return e&&c(e),u}}const{ext:r}=t;let s=r,l=t;if(r.includes("translate")){const{TranslateToken:d}=(vd(),se(Ro)),o=[];s=r.filter(u=>u!=="translate"&&u!=="tvar"),l={...t,ext:s},e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,u=>(o.push(u),`\0${o.length-1}`)).replace(/<translate( nowrap)?>([\s\S]*?)<\/translate>/gu,(u,c,m)=>{const f=i.length;return new d(c,m&&Pe(m,o),l,i),`\0${f}g`}),e=Pe(e,o)}const a=zl[n?1:0](s.join("|"));return a.lastIndex=0,a.test(e)?e.replace(a,(d,o,u,c,m,f,y,S,$)=>{const _=i.length;let T="n";if(o)T="e",new Nt(o,u,c,m,l,f,i);else if(d.startsWith("<!--")){T="c";const g=d.endsWith("-->");new It(Pe(d,i,1).slice(4,g?-3:void 0),g,t,i)}else f?new ti(f,y&&Pe(y,i,1),S&&Pe(S,i,1),$,t,i):new Oe(d,t,i,!0);return`\0${_}${T}`}):e}}}),Hl,Dl,Gl,Vl,Gs,Ql,ri,bd=N({"src/tag/html.ts"(){"use strict";var e,t;J(),ye(),ir(),D(),jo(),Hl=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),Dl=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"]),Gl=new Set(["strike","big","center","font","tt"]),Vl=[Ji()],ri=(t=class extends(Ql=gr){constructor(n,r,s,l,a,d){super(n,r,s,a,d);R(this,e);this.setAttribute("name",n.toLowerCase()),F(this,e,l)}get type(){return"html"}get selfClosing(){return b(this,e)}text(){const{closing:n,selfClosing:r,name:s}=this,{html:[,,l]}=this.getAttribute("config");return l.includes(s)?n&&s!=="br"?"":super.text("/"):super.text(r&&!n?"/":"")}lint(n=this.getAbsoluteIndex(),r){{const s=super.lint(n,r),{name:l,parentNode:a,closing:d,selfClosing:o}=this,u=new fe(this,n),{lintConfig:c}=I,{computeEditInfo:m,fix:f}=c,y=this.inTableAttrs();let S="h1",$=c.getSeverity(S,"html");if($&&l==="h1"&&!d){const p=Y(this,u,S,"<h1>",$);m&&(p.suggestions=[{desc:"h2",range:[n+2,n+3],text:"2"}]),s.push(p)}if(S="parsing-order",$=y&&c.getSeverity(S,y===2?"html":"templateInTable"),$){const p=Y(this,u,S,"html-in-table",$);m&&y===2&&(p.suggestions=[ee(p)]),s.push(p)}if(S="obsolete-tag",$=c.getSeverity(S,l),$&&Gl.has(l)&&s.push(Y(this,u,S,"obsolete-tag",$)),S="bold-header",$=c.getSeverity(S,l),$&&(l==="b"||l==="strong")&&this.isInside("heading-title")){const p=Y(this,u,S,"bold-in-header",$);m&&(p.suggestions=[ee(p)]),s.push(p)}const{html:[,_,T]}=this.getAttribute("config"),g=T.includes(l),h=_.includes(l),x=!g&&!h;if(S="unmatched-tag",d&&(o||g)||o&&x){if($=c.getSeverity(S,d?"both":"selfClosing"),$){const p=Y(this,u,S,d?"closing-and-self-closing":"invalid-self-closing",$);if(m||f){const k=Qn(n),v={desc:I.msg("no-self-closing"),range:[p.endIndex-2,p.endIndex-1],text:""};h?m&&(p.suggestions=[k,v]):d?p.fix=g?k:v:m&&(p.suggestions=[v,Ze(p.endIndex,`></${l}>`,-2)])}s.push(p)}}else if(!this.findMatchingTag()){const p=Y(this,u,S,d?"unmatched-closing":"unclosed-tag"),k=this.closest("magic-word");if(k&&Hl.has(k.name))$=c.getSeverity(S,"conditional");else if(d)$=c.getSeverity(S,"closing"),p.suggestions=[ee(p)];else{$=c.getSeverity(S,"opening");const v=a==null?void 0:a.childNodes;Dl.has(l)&&(v!=null&&v.slice(0,v.indexOf(this)).some(w=>w.is("html")&&w.name===l&&!w.findMatchingTag())&&(p.suggestions=[Ze(n+1,"/")]),this.isInside("heading-title")&&(p.rule="format-leakage",$=c.getSeverity("format-leakage",l)))}$&&(p.severity=$,s.push(p))}return s}}getAttribute(n){return n==="invalid"?this.inTableAttrs()===2:super.getAttribute(n)}json(n,r=this.getAbsoluteIndex()){{const s=super.json(void 0,r);return s.selfClosing=b(this,e),s}}},e=new WeakMap,t),Gs=ae(Ql),ri=re(Gs,0,"HtmlToken",Vl,ri),ne(Gs,1,ri)}}),qo={};oe(qo,{parseHtml:()=>Wo});var Jl,Wo,yd=N({"parser/html.ts"(){"use strict";lr(),bd(),Jl=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,Wo=(e,t,i)=>{var l;const{html:n}=t;(l=t.htmlElements)!=null||(t.htmlElements=new Set([...n[0],...n[1],...n[2]]));const r=e.split("<");let s=r.shift();for(const a of r){const d=Jl.exec(a),o=d==null?void 0:d[2],u=o==null?void 0:o.toLowerCase();if(!d||!t.htmlElements.has(u)){s+=`<${a}`;continue}const[,c,,m="",f,y]=d,{length:S}=i,$=new Xi(m,"html-attrs",u,t,i),_=$.hasAttr("itemprop");if(u==="meta"&&!(_&&$.hasAttr("content"))||u==="link"&&!(_&&$.hasAttr("href"))){s+=`<${a}`,i.length=S;continue}s+=`\0${i.length}x${y}`,new ri(o,$,c==="/",f==="/>",t,i)}return s}}}),Xl,Kl,Vs,Yl,Lt,Mo=N({"src/table/base.ts"(){"use strict";Ie(),ir(),D(),Q(),mt(),lr(),Xl=e=>{const t=e.childNodes.map(n=>n.type==="text"?n.data.replace(/\|{1,2}/gu,({length:r})=>`{{${"!".repeat(r)}}}`):n.toString()).join(""),{childNodes:i}=I.parseWithRef(t,e,2);pe.run(()=>{e.safeReplaceChildren(i)})},Kl=[Ji(1)],Lt=class extends(Yl=z){constructor(e,t,i,n,r,s=[],l){super(void 0,r,s,l),this.append(new He(t,"table-syntax",r,s),new Xi(n,"table-attrs",i,r,s))}escape(){for(const e of this.childNodes)e instanceof He?Xl(e):e.escape()}},Vs=ae(Yl),Lt=re(Vs,0,"TableBaseToken",Kl,Lt),ne(Vs,1,Lt)}}),Zl,Qs,_e,Ni,Vt,Qt,zi,Uo=N({"src/table/td.ts"(){"use strict";J(),ye(),er(),D(),Q(),Mo(),zi=class extends(Qs=Lt,Zl=[Gi(!1)],Qs){constructor(e,t,i,n=[]){var a;let r=/\||\0\d+!\x7F/u.exec(t!=null?t:""),s=r?t.slice(0,r.index):"";/\[\[|-\{/u.test(s)&&(r=null,s=""),super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",s,i,n),ne(Ni,5,this),Je(this,Vt),Je(this,_e,""),r&&([Hu(this,_e)._]=r);const l=new z(t==null?void 0:t.slice(((a=r==null?void 0:r.index)!=null?a:NaN)+xe(this,_e).length),i,n);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 wn(this,Vt,Qt).call(this).subtype}afterBuild(){xe(this,_e).includes("\0")&&Ne(this,_e,this.buildFromStr(xe(this,_e),0)),super.afterBuild()}toString(e){const{childNodes:[t,i,n]}=this;return t.toString(e)+i.toString(e)+xe(this,_e)+n.toString(e)}text(){const{childNodes:[e,t,i]}=this;return e.text()+t.text()+xe(this,_e)+i.text()}getGaps(e){return e===1?xe(this,_e).length:0}lint(e=this.getAbsoluteIndex(),t){{const i=super.lint(e,t),n=new fe(this,e+this.getRelativeIndex(this.length-1)),r="pipe-like",{lintConfig:s}=I,{computeEditInfo:l,fix:a}=s,d=["td","double"].map(o=>s.getSeverity(r,o));for(const o of this.lastChild.childNodes)if(o.type==="text"){const{data:u}=o;if(u.includes("|")){const c=u.includes("||"),m=d[c?1:0];if(m){const f=V(o,n,r,"pipe-in-table",m);if(l||a)if(c){const y={caption:"|+",td:"|",th:"!"}[this.subtype];f.fix=qe(f,"newline",u.replace(/\|\|/gu,`
|
|
17
|
+
${y}`))}else l&&(f.suggestions=[Kn(f.startIndex,u)]);i.push(f)}}}return i}}isIndependent(){return this.firstChild.text().startsWith(`
|
|
18
|
+
`)}getAttr(e){{const t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}}escape(){super.escape(),this.childNodes[1].toString()&&(xe(this,_e)||Ne(this,_e,"{{!}}")),xe(this,_e)==="|"&&Ne(this,_e,"{{!}}")}print(){{const{childNodes:[e,t,i]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${xe(this,_e)}${i.print()}</span>`}}json(e,t=this.getAbsoluteIndex()){{const i=super.json(void 0,t),{rowspan:n,colspan:r}=this;return Object.assign(i,{subtype:this.subtype},n!==1&&{rowspan:n},r!==1&&{colspan:r}),i}}},Ni=ae(Qs),_e=new WeakMap,Vt=new WeakSet,Qt=function(){var e;const t=this.firstChild.text(),i=t.slice(-1);let n="td";if(i==="!"?n="th":i==="+"&&(n="caption"),this.isIndependent())return{subtype:n};const{previousSibling:r}=this;return{...wn(e=r,Vt,Qt).call(e)}},Qt=re(Ni,17,"#getSyntax",Zl,Vt,Qt),Hn(Ni,zi)}}),pr,zo=N({"src/table/trBase.ts"(){"use strict";J(),D(),Mo(),Uo(),pr=class extends Lt{lint(e=this.getAbsoluteIndex(),t){{const i=super.lint(e,t),n=this.childNodes.find(({type:a})=>a==="table-inter");if(!n)return i;const r=ci(n),s="fostered-content",l=r&&I.lintConfig.getSeverity(s,r===2?void 0:"transclusion");if(l){const a=V(n,{start:e},s,"content-outside-table",l);a.startIndex++,a.startLine++,a.startCol=0,i.push(a)}return i}}getRowCount(){return Number(this.childNodes.some(e=>e instanceof zi&&e.isIndependent()&&!e.firstChild.text().endsWith("+")))}}}}),ea,ta,ia,Js,Li,Wi,wd=N({"src/table/index.ts"(){"use strict";J(),Ie(),ye(),er(),D(),zo(),mt(),ea=(e,t)=>Array.from({length:e},(i,n)=>t(n)),ta=class extends Array{},Wi=class extends(Js=pr,ia=[Gi(!1)],Js){constructor(e,t,i,n){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,"table",t,i,n,{}),ne(Li,5,this)}get type(){return"table"}get closed(){return this.lastChild.is("table-syntax")}lint(e=this.getAbsoluteIndex(),t){{const i=super.lint(e,t),n=new fe(this,e),r=["unclosed-table","table-layout"],s=r.map(l=>I.lintConfig.getSeverity(l));if(s[0]&&!this.closed&&i.push(V(this.firstChild,n,r[0],"unclosed-table",s[0])),s[1]){const l=this.getLayout(),{length:a}=l;if(a>1){let d=1,o=1/0,u=0;for(;u<a;u++){const c=l[u],m=c.length;if(m<d)break;m<o&&(o=m);const f=c.indexOf(c[m-1])+1;if(f>o)break;f>d&&(d=f)}if(u<a){const c=this.getNthRow(u),m=V(c,n,r[1],"inconsistent-table",s[1]);m.startIndex++,m.startLine++,m.startCol=0,i.push(m)}}}return i}}close(e=`
|
|
19
|
+
|}`,t){pe.run(()=>{const i=new He(t?e:void 0,"table-syntax",this.getAttribute("config"),this.getAttribute("accum"));super.insertAt(i)})}getLayout(e){{const t=this.getAllRows(),{length:i}=t,n=ta.from(ea(i,()=>[]));for(let r=0;r<n.length;r++){const s=n[r];let l=0,a=0,d;for(const o of t[r].childNodes.slice(2))if(o.is("td")){if(o.isIndependent()&&(d=o.subtype!=="caption"),d){const u={row:r,column:l},{rowspan:c,colspan:m}=o;for(l++;s[a];)a++;for(let f=r;f<Math.min(r+c,i);f++)for(let y=a;y<a+m;y++)n[f][y]=u;a+=m}}else if(_u(o))break}return n}}getAllRows(){return[...super.getRowCount()?[this]:[],...this.childNodes.slice(1).filter(e=>e.is("tr")&&e.getRowCount()>0)]}getNthRow(e,t,i){{const n=super.getRowCount();if(e===0&&n)return this;n&&e--;for(const r of this.childNodes.slice(2)){const{type:s}=r;if(s==="tr"&&r.getRowCount()&&(e--,e<0))return r}return}}json(e,t=this.getAbsoluteIndex()){{const i=super.json(void 0,t);return i.closed=this.closed,i}}},Li=ae(Js),re(Li,1,"getLayout",ia,Wi),Hn(Li,Wi)}}),Ho,Sd=N({"src/table/tr.ts"(){"use strict";zo(),Ho=class extends pr{get type(){return"tr"}constructor(e,t,i,n){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,e,"tr",t,i,n)}}}}),fr,Do=N({"src/nowiki/listBase.ts"(){"use strict";vt(),fr=class extends We{get indent(){return this.innerText.split(":").length-1}json(e,t=this.getAbsoluteIndex()){{const i=super.json(void 0,t),{indent:n}=this;return n&&(i.indent=n),i}}}}}),mr,Go=N({"src/nowiki/dd.ts"(){"use strict";Do(),mr=class extends fr{get type(){return"dd"}}}}),Vo={};oe(Vo,{parseTable:()=>Qo});var sa,Xs,Qo,Ad=N({"parser/table.ts"(){"use strict";Q(),wd(),Sd(),Uo(),Go(),sa=e=>e.lastChild.constructor!==z,Xs=(e,t)=>e.is("td")?t.pop():e,Qo=({firstChild:{data:e},type:t,name:i},n,r)=>{const s=[],l=e.split(`
|
|
20
|
+
`);let a=t==="root"||t==="parameter-value"||t==="ext-inner"&&i==="poem"?"":`
|
|
21
|
+
${l.shift()}`,d;const o=(u,c)=>{if(!c){a+=u;return}const{lastChild:m}=c;if(sa(c)){const f=new z(u,n,r);f.type="table-inter",f.setAttribute("stage",3),c.insertAt(f)}else m.setText(m.toString()+u)};for(const u of l){d=s.pop();const[c]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(u),m=u.slice(c.length),f=/^(:*)((?:\s|\0\d+[cn]\x7F)*)(\{\||\{(?:\0\d+[cn]\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(m);if(f){for(;d&&!d.is("td");)d=s.pop();const[,g,h,x,p]=f;g&&new mr(g,n,r),o(`
|
|
22
|
+
${c}${g&&`\0${r.length-1}d`}${h}\0${r.length}b`,d),s.push(...d?[d]:[],new Wi(x,p,n,r));continue}else if(!d){a+=`
|
|
23
|
+
${u}`;continue}const y=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(m);if(!y){o(`
|
|
24
|
+
${u}`,d),s.push(d);continue}const[,S,$,_,T]=y;if(S){for(;!d.is("table");)d=s.pop();d.close(`
|
|
25
|
+
${c}${S}`,!0),o(T,s[s.length-1])}else if($){d=Xs(d,s),d.is("tr")&&(d=s.pop());const g=new Ho(`
|
|
26
|
+
${c}${$}`,T,n,r);s.push(d,g),d.insertAt(g)}else{d=Xs(d,s);const g=_==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu;let h=g.exec(T),x=0,p=`
|
|
27
|
+
${c}${_}`;const k=v=>{const w=new zi(p,T.slice(x,h==null?void 0:h.index),n,r);return v.insertAt(w),w};for(;h;)k(d),{lastIndex:x}=g,[p]=h,h=g.exec(T);s.push(d,k(d))}}return a.slice(1)}}}),ut,Jo=N({"../cm-util/dist/index.mjs"(){"use strict";ut=e=>!/^_{2}.+_{2}$/u.test(e)}}),Xo,kd=N({"src/nowiki/hr.ts"(){"use strict";vt(),Xo=class extends We{get type(){return"hr"}}}}),na,Ks,ra,li,$d=N({"src/nowiki/doubleUnderscore.ts"(){"use strict";var e,t;xt(),it(),vt(),na=[tt(),De("__")],li=(t=class extends(ra=We){constructor(n,r,s,l,a){var c,m;super(n,l,a);R(this,e);const d=n.toLowerCase(),{doubleUnderscore:[,,o,u]}=l;this.setAttribute("name",(m=r?(c=u==null?void 0:u[n])==null?void 0:c.toLowerCase():o==null?void 0:o[d])!=null?m:d),F(this,e,s)}get type(){return"double-underscore"}toString(){const n=b(this,e)?"__":"__";return n+this.innerText+n}print(){{const n=b(this,e)?"__":"__";return super.print({pre:n,post:n})}}},e=new WeakMap,t),Ks=ae(ra),li=re(Ks,0,"DoubleUnderscoreToken",na,li),ne(Ks,1,li)}}),Ko={};oe(Ko,{parseHrAndDoubleUnderscore:()=>Yo});var Yo,_d=N({"parser/hrAndDoubleUnderscore.ts"(){"use strict";Jo(),kd(),$d(),oo(),Yo=({firstChild:{data:e},type:t,name:i},n,r)=>{var o,u,c;const{doubleUnderscore:[s,l,a]}=n,d=[...s,...l];return(o=n.insensitiveDoubleUnderscore)!=null||(n.insensitiveDoubleUnderscore=new Set(s.filter(ut))),(u=n.sensitiveDoubleUnderscore)!=null||(n.sensitiveDoubleUnderscore=new Set(l.filter(ut))),(c=n.regexHrAndDoubleUnderscore)!=null||(n.regexHrAndDoubleUnderscore=new RegExp(String.raw`^((?:\0\d+[cno]\x7F)*)(-{4,})|__(${d.filter(ut).join("|")})__|_{2}(${d.filter(m=>!ut(m)).map(m=>m.slice(2,-2)).join("|")})_{2}`,"gimu")),t!=="root"&&(t!=="ext-inner"||i!=="poem")&&(e=`\0${e}`),e=e.replace(n.regexHrAndDoubleUnderscore,(m,f,y,S,$)=>{var x;if(y)return new Xo(y,n,r),`${f}\0${r.length-1}r`;const _=S!=null?S:$,T=n.sensitiveDoubleUnderscore.has(_),g=_.toLowerCase(),h=n.insensitiveDoubleUnderscore.has(g);return T||h?(new li(_,T,!!$,n,r),`\0${r.length-1}${h&&((x=a==null?void 0:a[g])!=null?x:g)==="toc"?"u":"n"}`):m}),n.excludes.includes("heading")||(e=e.replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(m,f,y,S,$)=>{const _=`${f}\0${r.length}h`;return new _t(y.length,[S,$],n,r),_})),t==="root"||t==="ext-inner"&&i==="poem"?e:e.slice(1)}}}),Zo,Td=N({"src/nowiki/quote.ts"(){"use strict";var e,t;J(),ye(),D(),vt(),Zo=(t=class extends We{constructor(n,r,s,l){super(n,s,l);R(this,e);F(this,e,r)}get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}get closing(){return{...this.bold?{bold:b(this,e).bold}:void 0,...this.italic?{italic:b(this,e).italic}:void 0}}text(){const{parentNode:n,innerText:r}=this;return n!=null&&n.is("image-parameter")&&n.name!=="caption"?"":r}lint(n=this.getAbsoluteIndex()){{const{previousSibling:r,bold:s,closing:l}=this,a=(r==null?void 0:r.type)==="text"?r.data:void 0,d=[],o=new fe(this,n),u=["lonely-apos","bold-header"],{lintConfig:c}=I,{computeEditInfo:m}=c,f=[void 0,"word"].map(S=>c.getSeverity(u[0],S)),y=c.getSeverity(u[1]);if(a!=null&&a.endsWith("'")){const S=f[(l.bold||l.italic)&&/[a-z\d]'$/iu.test(a)?1:0];if(S){const $=Y(this,o,u[0],I.msg("lonely","'"),S),{startLine:_,startCol:T}=$,[,{length:g}]=/(?:^|[^'])('+)$/u.exec(a),h=n-g,x={...$,startIndex:h,endIndex:n,endLine:_,startCol:T-g,endCol:T};m&&(x.suggestions=[Pt(h,"'",g),ee(x)]),d.push(x)}}if(y&&s&&this.isInside("heading-title")){const S=Y(this,o,u[1],"bold-in-header",y);m&&(S.suggestions=[ee(S)]),d.push(S)}return d}}json(n,r=this.getAbsoluteIndex()){{const s=super.json(void 0,r);return Object.assign(s,{bold:this.bold,italic:this.italic}),s}}},e=new WeakMap,t)}}),eu={};oe(eu,{parseQuotes:()=>xr});var xr,tu=N({"parser/quotes.ts"(){"use strict";Td(),xr=(e,t,i,n)=>{var f;const r=e.split(/('{2,})/u),{length:s}=r;if(s===1)return e;let l=0,a=0,d,o,u;for(let y=1;y<s;y+=2){const S=r[y].length;switch(S){case 2:a++;break;case 4:r[y-1]+="'",r[y]="'''";case 3:if(l++,d!==void 0)break;r[y-1].endsWith(" ")?o===void 0&&u===void 0&&(u=y):r[y-1].slice(-2,-1)===" "?d=y:o!=null||(o=y);break;default:r[y-1]+="'".repeat(S-5),r[y]="'''''",a++,l++}}if(a%2===1&&l%2===1){const y=(f=d!=null?d:o)!=null?f:u;y!==void 0&&(r[y]="''",r[y-1]+="'")}let c=!1,m=!1;for(let y=1;y<s;y+=2){const S=r[y].length,$=S!==2,_=S!==3,T=new Zo(r[y],{bold:$&&!!c,italic:_&&!!m},t,i);$&&(c=!c&&T),_&&(m=!m&&T),r[y]=`\0${i.length-1}q`}return r.join("")}}}),iu={};oe(iu,{parseExternalLinks:()=>vr});var vr,su=N({"parser/externalLinks.ts"(){"use strict";ve(),$o(),hr(),vr=(e,t,i,n)=>{var r;return(r=t.regexExternalLinks)!=null||(t.regexExternalLinks=new RegExp(String.raw`\[((?:\0\d+[cn]\x7F)*(?:\0\d+f\x7F|(?:(?:${t.protocol}|//)${Ft}|\0\d+m\x7F)${Et}(?=[[\]<>"\t${Ye}]|\0\d)))([${Ye}]*(?![${Ye}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),e.replace(t.regexExternalLinks,(s,l,a,d)=>{const{length:o}=i,u=/&[lg]t;/u.exec(l);return u&&(a="",d=l.slice(u.index)+a+d,l=l.slice(0,u.index)),n?(new vi(l,"ext-link-url",t,i),`[\0${o}f${a}${d}]`):(new Ct(l,a,d,t,i),`\0${o}w`)})}}}),nu,Cd=N({"src/link/category.ts"(){"use strict";Qi(),ve(),nu=class extends Xe{get type(){return"category"}get sortkey(){{const{childNodes:[,e]}=this;return e&&gi(e.text())}}json(e,t=this.getAbsoluteIndex()){{const i=super.json(void 0,t),{sortkey:n}=this;return n&&(i.sortkey=n),i}}}}}),ru={};oe(ru,{parseLinks:()=>jn});var la,jn,Id=N({"parser/links.ts"(){"use strict";ve(),D(),tu(),su(),ko(),vo(),Cd(),la=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,jn=(e,t,i,n,r)=>{var d;(d=t.regexLinks)!=null||(t.regexLinks=new RegExp(String.raw`^\s*(?:${t.protocol}|//)`,"iu"));const s=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,l=e.split("[[");let a=l.shift();for(let o=0;o<l.length;o++){let u=!1,c,m,f,y;const S=l[o],$=s.exec(S);if($)[,c,m,f,y]=$,y.startsWith("]")&&(f!=null&&f.includes("["))&&(f+="]",y=y.slice(1));else{const p=la.exec(S);p&&(u=!0,[,c,m,f]=p)}if(c===void 0||t.regexLinks.test(c)||/\0\d+[exhbru]\x7F/u.test(c)){a+=`[[${S}`;continue}let _=Te(c).trim();const T=_.startsWith(":");if(T&&u){a+=`[[${S}`;continue}else!_&&f&&!f.includes(`
|
|
28
|
+
`)&&(_=Te(f).trim());const{ns:g,valid:h}=I.normalizeTitle(_,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0,page:n});if(h){if(u){if(g!==6){a+=`[[${S}`;continue}let p=!1;for(o++;o<l.length;o++){const k=l[o],v=k.split("]]");if(v.length>2){p=!0,f+=`[[${v[0]}]]${v[1]}`,y=v.slice(2).join("]]");break}else if(v.length===2)f+=`[[${v[0]}]]${v[1]}`;else{f+=`[[${k}`;break}}if(f=jn(f,t,i,n,r),!p){a+=`[[${c}${m}${f}`;continue}}}else{a+=`[[${S}`;continue}f&&(f=xr(f,t,i,r));let x=cr;T||(g===6?(f&&(f=vr(f,t,i,!0)),x=dr):g===14&&(x=nu)),f===void 0&&m&&(f=""),a+=`\0${i.length}l${y}`,new x(c,f,t,i,m)}return a}}}),lu={};oe(lu,{parseMagicLinks:()=>au});var Ys,Zs,en,tn,au,Nd=N({"parser/magicLinks.ts"(){"use strict";ve(),hr(),Ys=String.raw`[${Ye}\t]| |�*160;|�*a0;`,Zs=`(?:${Ys})+`,en=`(?:${Ys}|-)`,tn=String.raw`(?:RFC|PMID)${Zs}\d+\b|ISBN${Zs}(?:97[89]${en}?)?(?:\d${en}?){9}[\dx]\b`,au=(e,t,i)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${Ft}${Et})|${tn})`,"giu")}catch{t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${Ft}${Et})|${tn})`,"giu")}return e.replace(t.regexMagicLinks,(n,r,s)=>{let l=r?n.slice(r.length):n;if(s){let a="";const d=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(l);d&&(a=l.slice(d.index),l=l.slice(0,d.index));const o=l.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,u=o.exec(l);if(u){let c=1;u[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(l.slice(0,u.index))&&(c=2),a=l.slice(u.index+c)+a,l=l.slice(0,u.index+c)}return a.length>=s.length?n:(new vi(l,void 0,t,i),`${r}\0${i.length-1}w${a}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(l))return n;return new vi(l,"magic-link",t,i),`${r}\0${i.length-1}i`})}}}),ou,Ld=N({"util/html.ts"(){"use strict";ou=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((i,n)=>i!==e[n])}}),aa,uu,Fd=N({"src/nowiki/list.ts"(){"use strict";J(),D(),Do(),aa=new Set(["link","category","file"]),uu=class extends fr{get type(){return"list"}lint(e=this.getAbsoluteIndex()){var t;{const i="syntax-like",n=I.lintConfig.getSeverity(i,"redirect"),{innerText:r}=this;if(n&&r==="#"){let{nextSibling:s}=this;if((s==null?void 0:s.type)==="text"&&aa.has((t=s.nextSibling)==null?void 0:t.type)&&new RegExp(String.raw`^(?:${this.getAttribute("config").redirection.join("|")})\s*(?::\s*)?$`,"iu").test(`#${s.data}`)){const a=Y(s,{start:e+1},i,"redirect-like",n);return a.startIndex--,a.startCol--,a.endIndex+=2,a.endCol+=2,[a]}}return[]}}}}}),du={};oe(du,{parseList:()=>cu});var cu,Ed=N({"parser/list.ts"(){"use strict";Ld(),Fd(),Go(),cu=(e,t,i,n)=>{const r=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!r)return t.lastPrefix="",e;const[s,l,a,d]=r,o=a.replace(/;/gu,":"),u=ou(o,t.lastPrefix),c=((u>1?a.slice(u-1):a)+d).split(/(?=;)/u),m=c[0].startsWith(";");let f=c.length-(m?0:1);if(u>1){const A=a.slice(0,u-1);if(m){const C=A.split(/(?=;)/u);c.unshift(...C),f+=A.includes(";")?C.length:0}else c[0]=A+c[0]}t.lastPrefix=o;let y=l+c.map((A,C)=>`\0${n.length+C}d`).join("")+e.slice(s.length);for(const A of c)new uu(A,i,n);if(!f)return y;const{html:[S,,$]}=i,_=/:+|-\{|\0\d+[xq]\x7F/gu;let T=_,g=T.exec(y),h=0,x=!1,p=!1,k=0;const v=(A,C)=>(new mr(A,i,n),`${y.slice(0,C)}\0${n.length-1}d${y.slice(C+A.length)}`),w=A=>{A?h&&h--:h++};for(;g&&f;){const{0:A,index:C}=g;if(A==="-{"){if(!k){const{lastIndex:L}=T;T=/-\{|\}-/gu,T.lastIndex=L}k++}else if(A==="}-"){if(k--,!k){const{lastIndex:L}=T;T=_,T.lastIndex=L}}else if(A.endsWith("x")){const{name:L,closing:q,selfClosing:B}=n[Number(A.slice(1,-2))];(S.includes(L)||!B&&!$.includes(L))&&w(q)}else if(A.endsWith("q")){const{bold:L,italic:q}=n[Number(A.slice(1,-2))];L&&(w(x),x=!x),q&&(w(p),p=!p)}else if(h===0){if(A.length>=f)return v(A.slice(0,f),C);f-=A.length,T.lastIndex=C+4+String(n.length).length,y=v(A,C)}g=T.exec(y)}return y}}}),Fi,oa,sn,ua,ai,jd=N({"src/converterFlags.ts"(){"use strict";var e,t;J(),ye(),Vi(),Le(),D(),Q(),ft(),Fi=new Set(["A","T","R","D","-","H","N"]),oa=[yi(),Ce],ai=(t=class extends(ua=z){constructor(n,r,s=[]){super(void 0,r,s,{});R(this,e);this.safeAppend(n.map(l=>new Me(l,"converter-flag",r,s)))}get type(){return"converter-flags"}afterBuild(){F(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(b(this,e).filter(n=>/\{{3}[^{}]+\}{3}/u.test(n)))}getVariantFlags(){const n=new Set(this.getAttribute("config").variants);return new Set(b(this,e).filter(r=>n.has(r)))}isInvalidFlag(n,r,s,l){return typeof n=="object"&&(n=n.text().trim(),r=this.getVariantFlags(),s=this.getUnknownFlags(),l=new Set(b(this,e).filter(a=>Fi.has(a)))),!!n&&!r.has(n)&&!s.has(n)&&(r.size>0||!l.has(n))}lint(n=this.getAbsoluteIndex(),r){{const s=this.getVariantFlags(),l=this.getUnknownFlags(),a=new Set(b(this,e).filter($=>Fi.has($))),d=b(this,e).filter($=>!$).length,o=b(this,e).length-l.size-d,{lintConfig:u}=I,{computeEditInfo:c,fix:m}=u,f=super.lint(n,r);if(s.size===o||a.size===o)return f;const y="no-ignored",S=u.getSeverity(y,"conversionFlag");if(S){const $=new fe(this,n);for(let _=0;_<this.length;_++){const T=this.childNodes[_],g=T.text().trim();if(this.isInvalidFlag(g,s,l,a)){const h=V(T,$,y,"invalid-conversion-flag",S);(c||m)&&(s.size===0&&Fi.has(g.toUpperCase())?h.fix=Xn(h,g):c&&(h.suggestions=[ee(h,_&&-1)])),f.push(h)}}}return f}}print(){return super.print({sep:";"})}},e=new WeakMap,t),sn=ae(ua),ai=re(sn,0,"ConverterFlagsToken",oa,ai),ne(sn,1,ai)}}),Ei,da,nn,ca,dt,Rd=N({"src/converterRule.ts"(){"use strict";Ue(),Le(),D(),Q(),ft(),Ei=(e,t,i,n)=>{const r=new z(e,i,n);return r.type=`converter-rule-${t}`,r.setAttribute("stage",$e),r},da=[Ce],dt=class extends(ca=z){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,i=I.getConfig(),n=[]){super(void 0,i,n,{});const r=e.indexOf(":"),s=e.slice(0,r).indexOf("=>"),l=s===-1?e.slice(0,r):e.slice(s+2,r);t&&i.variants.includes(l.trim().toLowerCase())?(super.insertAt(new Me(l,"converter-rule-variant",i,n)),super.insertAt(Ei(e.slice(r+1),"to",i,n)),s!==-1&&super.insertAt(Ei(e.slice(0,s),"from",i,n),0)):super.insertAt(Ei(e,"to",i,n))}toString(e){const{childNodes:t,firstChild:i,lastChild:n}=this;return t.length===3?`${i.toString(e)}=>${t[1].toString(e)}:${n.toString(e)}`:super.toString(e,":")}text(){const{childNodes:e,firstChild:t,lastChild:i}=this;return e.length===3?`${t.text()}=>${e[1].text()}:${i.text()}`:super.text(":")}getGaps(e){return e===0&&this.length===3?2:1}print(){{const{childNodes:e}=this;if(e.length===3){const[t,i,n]=e;return`<span class="wpb-converter-rule">${t.print()}=>${i.print()}:${n.print()}</span>`}return super.print({sep:":"})}}json(e,t=this.getAbsoluteIndex()){{const i=super.json(void 0,t);return i.variant=this.variant,i}}},nn=ae(ca),dt=re(nn,0,"ConverterRuleToken",da,dt),ne(nn,1,dt)}}),ha,rn,ga,oi,Pd=N({"src/converter.ts"(){"use strict";ve(),it(),Le(),Q(),jd(),Rd(),ha=[Ce,De("-{")],oi=class extends(ga=z){get type(){return"converter"}constructor(e,t,i,n=[]){super(void 0,i,n),this.insertAt(new ai(e,i,n));const[r]=t,s=r.includes(":"),l=new dt(r,s,i,n);(s?l.length===1:t.length===2&&!Te(t[1]).trim())?this.insertAt(new dt(t.join(";"),!1,i,n)):this.safeAppend([l,...t.slice(1).map(a=>new dt(a,!0,i,n))])}toString(e){const{childNodes:[t,...i]}=this;return`-{${t.toString(e)}${t.length>0?"|":""}${i.map(n=>n.toString(e)).join(";")}}-`}text(){const{childNodes:[e,...t]}=this;return`-{${e.text()}|${pt(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?"|":""}${Rt(t,{sep:";"})}}-</span>`}}},rn=ae(ga),oi=re(rn,0,"ConverterToken",ha,oi),ne(rn,1,oi)}}),hu={};oe(hu,{parseConverter:()=>gu});var gu,Od=N({"parser/converter.ts"(){"use strict";Pd(),gu=(e,t,i)=>{var d;(d=t.regexConverter)!=null||(t.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${t.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"iu"));const n=/-\{/gu,r=/-\{|\}-/gu,s=[];let l=n,a=l.exec(e);for(;a;){const{0:o,index:u}=a;if(o==="}-"){const c=s.pop(),{length:m}=i,f=e.slice(c.index+2,u),y=f.indexOf("|"),[S,$]=y===-1?[[],f]:[f.slice(0,y).split(";"),f.slice(y+1)],_=$.replace(/(&[#a-z\d]+);/giu,"$1"),T=_.split(t.regexConverter).map(g=>g.replace(/\x01/gu,";"));new oi(S,T,t,i),e=`${e.slice(0,c.index)}\0${m}v${e.slice(u+2)}`,s.length===0&&(l=n),l.lastIndex=c.index+3+String(m).length}else s.push(a),l=r,l.lastIndex=u+2;a=l.exec(e)}return e}}}),Hi={};oe(Hi,{Token:()=>z});var pa,z,Q=N({"src/index.ts"(){"use strict";var e,t,i,n,r,s,l,a,d,pu,fu,mu,xu,vu,bu,yu,wu,Su,Au,ku,$u,x;ve(),Ue(),J(),Ie(),D(),Ku(),Zu(),pa=["category","html-attr#id,ext-attr#id,table-attr#id"],z=(x=class extends Kt{constructor(v,w=I.getConfig(),A=[],C){super();R(this,d);R(this,e,"plain");R(this,t,0);R(this,i);R(this,n);R(this,r);R(this,s,!1);R(this,l);R(this,a);typeof v=="string"&&this.insertAt(v),F(this,i,w),F(this,n,A),A.push(this)}get type(){return b(this,e)}set type(v){F(this,e,v)}get pageName(){return b(this.getRootNode(),a)}set pageName(v){if(v){const w=this.normalizeTitle(v,0,{temporary:!0,page:""});F(this,a,w.valid?w.title:void 0)}else F(this,a,v===""?"":void 0)}parseOnce(v=b(this,t),w=!1,A){if(v<b(this,t)||this.length!==1||!this.isPlain())return this;if(b(this,t)>=$e)return this;switch(v){case 0:if(this.type==="root"){b(this,n).pop();const C=j(this,d,pu).call(this);w&&(w=!C)}F(this,r,w),j(this,d,fu).call(this,w);break;case 1:j(this,d,mu).call(this);break;case 2:j(this,d,xu).call(this);break;case 3:j(this,d,vu).call(this);break;case 4:j(this,d,bu).call(this);break;case 5:j(this,d,yu).call(this,A);break;case 6:j(this,d,wu).call(this,A);break;case 7:j(this,d,Su).call(this);break;case 8:j(this,d,Au).call(this);break;case 9:j(this,d,ku).call(this);break;case 10:j(this,d,$u).call(this)}if(this.type==="root")for(const C of b(this,n))C==null||C.parseOnce(v,w,A);return wr(this,t)._++,this}buildFromStr(v,w){const A=v.split(/[\0\x7F]/u).map((C,L)=>{if(L%2===0)return C&&new $n(C);if(isNaN(C.slice(-1)))return b(this,n)[Number(C.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${C}`)}).filter(C=>C!=="");return w===0?A.map(String).join(""):w===1?pt(A):A}build(){F(this,t,$e);const{length:v,firstChild:w}=this,A=w==null?void 0:w.toString();if(v===1&&w.type==="text"&&A.includes("\0")&&(bi(this,0,1,this.buildFromStr(A)),this.type==="root"))for(const C of b(this,n))C==null||C.build()}afterBuild(){if(this.type==="root")for(const v of b(this,n))v==null||v.afterBuild();F(this,s,!0)}parse(v=$e,w,A){for(v=Math.min(v,$e);b(this,t)<v;)this.parseOnce(b(this,t),w,A);return v&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===x}getAttribute(v){var w;switch(v){case"config":return b(this,i);case"include":return(w=b(this,r))!=null?w:!!b(this.getRootNode(),r);case"accum":return b(this,n);case"built":return b(this,s);case"stage":return b(this,t);case"invalid":return this.type==="table-inter"&&ci(this)===2;default:return super.getAttribute(v)}}setAttribute(v,w){switch(v){case"stage":b(this,t)===0&&this.type==="root"&&b(this,n).shift(),F(this,t,w);break;default:super.setAttribute(v,w)}}insertAt(v,w=this.length){const A=typeof v=="string"?new $n(v):v;super.insertAt(A,w);const{type:C}=A;return C==="root"&&(A.type="plain"),A}normalizeTitle(v,w=0,A){return I.normalizeTitle(v,w,this.getAttribute("include"),b(this,i),{page:this.pageName,...A})}inTableAttrs(){var v;return this.isInside("table-attrs")&&((v=this.closest("table-attrs,arg,parameter"))!=null&&v.is("table-attrs")?2:1)}inHtmlAttrs(){return this.isInside("html-attrs")?2:this.inTableAttrs()}lint(v=this.getAbsoluteIndex(),w){var A;{const{lintConfig:C}=I,{computeEditInfo:L,fix:q,ignoreDisables:B,configurationComment:O}=C;let W=super.lint(v,w);if(this.type==="root"){const E=new Map,P="no-duplicate",U=["category","id"].map(H=>C.getSeverity(P,H)),M=this.toString(),ie=pa.filter((H,X)=>U[X]).join();if(ie){for(const H of this.querySelectorAll(ie)){let X;if(H.is("category"))X=H.name;else{const Z=H.getValue();Z&&Z!==!0&&(X=`#${Z}`)}if(X){const Z=E.get(X);Z?Z.add(H):E.set(X,new Set([H]))}}for(const[H,X]of E)if(X.size>1&&!H.startsWith("#mw-customcollapsible-")){const Z=!H.startsWith("#"),ue=`duplicate-${Z?"category":"id"}`,de=U[Z?0:1];W.push(...[...X].map(ce=>{const le=Y(ce,{start:ce.getAbsoluteIndex()},P,ue,de);return L&&Z&&(le.suggestions=[ee(le)]),le}))}}if(!B){const H=new RegExp(String.raw`<!--\s*${O}-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->`,"gu"),X=[];let Z=H.exec(M);for(;Z;){const{1:ue,index:de}=Z,ce=(A=Z[2])==null?void 0:A.trim();X.push({line:this.posFromIndex(de).top+(ue==="disable-line"?0:1),from:ue==="disable"?H.lastIndex:void 0,to:ue==="enable"?H.lastIndex:void 0,rules:ce?new Set(ce.split(",").map(le=>le.trim())):void 0}),Z=H.exec(M)}W=W.filter(({rule:ue,startLine:de,startIndex:ce})=>{const le={pos:0};for(const{line:he,from:we,to:G,rules:K}of X){if(he>de+1)break;if(K&&!K.has(ue))continue;if(he===de&&we===void 0&&G===void 0)return!1;we<=ce&&we>le.pos?(le.pos=we,le.type="from"):G<=ce&&G>le.pos&&(le.pos=G,le.type="to")}return le.type!=="from"})}if(q&&W.some(({fix:H})=>H)){const H=W.map(({fix:ue})=>ue).filter(ue=>ue!==void 0).sort(({range:[ue,de]},{range:[ce,le]})=>de===le?ce-ue:le-de);let X=1/0,Z=M;for(const{range:[ue,de],text:ce}of H)de<=X&&(Z=Z.slice(0,ue)+ce+Z.slice(de),X=ue);Object.assign(W,{output:Z})}if(!L)for(const H of W)delete H.fix,delete H.suggestions}return W}}toString(v,w){return v?super.toString(!0,w):ht(b(this,l),()=>super.toString(!1,w),A=>{const C=this.getRootNode();C.type==="root"&&b(C,s)&&F(this,l,A)})}},e=new WeakMap,t=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakMap,s=new WeakMap,l=new WeakMap,a=new WeakMap,d=new WeakSet,pu=function(){const{parseRedirect:v}=(id(),se(Ya)),w=this.firstChild.toString(),A=v(w,b(this,i),b(this,n));return A&&this.setText(A),!!A},fu=function(v){const{parseCommentAndExt:w}=(Zi(),se(Bo));this.setText(w(this.firstChild.toString(),b(this,i),b(this,n),v))},mu=function(){const{parseBraces:v}=(ur(),se(co)),w=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,A=v(w,b(this,i),b(this,n));this.setText(this.type==="root"?A:A.slice(1))},xu=function(){if(b(this,i).excludes.includes("html"))return;const{parseHtml:v}=(yd(),se(qo));this.setText(v(this.firstChild.toString(),b(this,i),b(this,n)))},vu=function(){if(b(this,i).excludes.includes("table"))return;const{parseTable:v}=(Ad(),se(Vo));this.setText(v(this,b(this,i),b(this,n)))},bu=function(){if(b(this,i).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:v}=(_d(),se(Ko));this.setText(v(this,b(this,i),b(this,n)))},yu=function(v){const{parseLinks:w}=(Id(),se(ru));this.setText(w(this.firstChild.toString(),b(this,i),b(this,n),this.pageName,v))},wu=function(v){if(b(this,i).excludes.includes("quote"))return;const{parseQuotes:w}=(tu(),se(eu)),A=this.firstChild.toString().split(`
|
|
29
|
+
`);for(let C=0;C<A.length;C++)A[C]=w(A[C],b(this,i),b(this,n),v);this.setText(A.join(`
|
|
30
|
+
`))},Su=function(){if(b(this,i).excludes.includes("extLink"))return;const{parseExternalLinks:v}=(su(),se(iu));this.setText(v(this.firstChild.toString(),b(this,i),b(this,n)))},Au=function(){if(b(this,i).excludes.includes("magicLink"))return;const{parseMagicLinks:v}=(Nd(),se(lu));this.setText(v(this.firstChild.toString(),b(this,i),b(this,n)))},ku=function(){if(b(this,i).excludes.includes("list"))return;const{parseList:v}=(Ed(),se(du)),{firstChild:w,type:A,name:C}=this,L=w.toString().split(`
|
|
31
|
+
`),q={lastPrefix:""};let B=A==="root"||A==="ext-inner"&&C==="poem"?0:1;for(;B<L.length;B++)L[B]=v(L[B],q,b(this,i),b(this,n));this.setText(L.join(`
|
|
32
|
+
`))},$u=function(){if(b(this,i).variants.length>0){const{parseConverter:v}=(Od(),se(hu));this.setText(v(this.firstChild.toString(),b(this,i),b(this,n)))}},x)}}),pe,es,_u,Tu,bi,Cu,Ie=N({"util/debug.ts"(){"use strict";pe={running:!1,run(e,t){const{running:i}=this;this.running=!0;const n=t==null?void 0:t.internal;t&&(t.internal=!0);const r=()=>{this.running=i,t&&(t.internal=n)};try{const{Token:s}=(Q(),se(Hi)),l=e();return l instanceof s&&!l.getAttribute("built")&&l.afterBuild(),r(),l}catch(s){throw r(),s}},internal(e,t){const{internal:i}=t;t.internal=!0;const n=e();return t.internal=i,n},rev:0},es=e=>t=>t.type===e,_u=({type:e})=>e==="tr"||e==="table-syntax",Tu=e=>e==="redirect-target"||e==="link",bi=(e,t,i,n=[])=>{var l,a;let r=e.getChildNodes(),s;r.length===i?(s=r,r=n):s=Array.prototype.splice.apply(r,[t,i,...n]);for(let d=0;d<n.length;d++){const o=n[d];o.setAttribute("parentNode",e),o.setAttribute("nextSibling",r[t+d+1]),o.setAttribute("previousSibling",r[t+d-1])}return(l=r[t-1])==null||l.setAttribute("nextSibling",r[t]),(a=r[t+n.length])==null||a.setAttribute("previousSibling",r[t+n.length-1]),r===n&&e.setAttribute("childNodes",r),s},Cu=(e,t)=>{const i=e.toLowerCase(),[n,r]=t,s=Object.prototype.hasOwnProperty.call(r,e);return[i,s,s?r[e]:Object.prototype.hasOwnProperty.call(n,i)&&n[i]]}}}),yt,ln,ji,an,fa,on,ma,xa,Rn,Bd=N({"lib/lintConfig.ts"(){"use strict";var e,t;Gn(),yt=new Map([[0,!1],[1,"warning"],[2,"error"],[!1,!1],["off",!1],["warning","warning"],["error","error"]]),ln={"arg-in-ext":1,"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,"invalid-url":1,"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}],"syntax-like":[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,{both:2,selfClosing:2}],"unterminated-url":[1,{}],"url-encoding":[1,{}],"var-anchor":[1,{}],"void-ext":[2,{}]},Object.freeze(ln),ji={configurationComment:"lint",ignoreDisables:!1,fix:!0,computeEditInfo:!0},Object.freeze(ji),an=i=>yt.has(i),fa=i=>an(i)||Array.isArray(i)&&an(i[0])&&(i.length===1||typeof i[1]=="object"),on=(i,n,r)=>{if(hi.includes(n)){if(r===void 0)return!1;if(fa(r))return i[n]=r,!0}else throw new RangeError(`Unknown lint rule: ${n}`);throw new RangeError(`Invalid lint config for ${n}: ${JSON.stringify(r)}`)},ma=typeof structuredClone=="function"?structuredClone:(i=>JSON.parse(JSON.stringify(i))),xa=class{constructor(i){if(Object.assign(this,ma(ln)),!!i)for(const[n,r]of Object.entries(i))on(this,n,r)}getSeverity(i,n){var s,l;const r=this[i];return typeof r!="object"?yt.get(r):n&&(l=yt.get((s=r[1])==null?void 0:s[n]))!=null?l:yt.get(r[0])}},Rn=(t=class{constructor(i){R(this,e);if(Object.assign(this,ji),i&&!("rules"in i)&&Object.keys(i).some(n=>hi.includes(n)))this.rules=i;else{const{rules:n,...r}=i!=null?i:{};this.rules=n;for(const[s,l]of Object.entries(r))l!==void 0&&Object.prototype.hasOwnProperty.call(ji,s)&&(this[s]=l)}}get rules(){return b(this,e)}set rules(i){F(this,e,new Proxy(new xa(i),{set:on,deleteProperty(){return!1}}))}getSeverity(i,n){return b(this,e).getSeverity(i,n)}},e=new WeakMap,t)}}),un,Pn,qd=N({"lib/title.ts"(){"use strict";var e,t,i,n,r,s,Iu,a;et(),ve(),un=d=>{const[,{length:o},u]=/^((?:\.\.\/)*)([\s\S]*)/u.exec(d);return[o/3,u]},Pn=(a=class{constructor(d,o,u,{temporary:c,decode:m,selfLink:f,page:y}={}){R(this,s);R(this,e);R(this,t);R(this,i);R(this,n);R(this,r);Ee(this,"page");Ee(this,"valid");Ee(this,"encoded",!1);this.page=y;const S=d.trim(),$=S.startsWith("../");if(m&&d.includes("%"))try{const h=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(d);d=fi(d),this.encoded=h}catch{}if(d=gi(d).replace(/[_ ]+/gu," ").trim(),$||y&&S.startsWith("/"))F(this,n,0);else{let h=o;d.startsWith(":")&&(h=0,d=d.slice(1).trim());const x=d.split(":");if(x.length>1){const p=jt(x[0]),k=Object.prototype.hasOwnProperty.call(u.nsid,p)&&u.nsid[p];k&&(h=k,d=x.slice(1).join(":").trim())}F(this,n,h)}const _=d.indexOf("#");if(_!==-1){let h=d.slice(_).trim().slice(1);if(h.includes("%"))try{h=fi(h)}catch{}F(this,r,h.replace(/ /gu,"_")),d=d.slice(0,_).trim()}const[T,g]=$?un(d):[0,d];this.valid=!!(d||f&&this.ns===0&&b(this,r)!==void 0)&&gi(d)===d&&(T===0||y===void 0||y.split("/",T+1).length>T)&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(g),this.main=d,F(this,t,u.namespaces),F(this,i,u.articlePath||"/wiki/$1"),b(this,i).includes("$1")||F(this,i,b(this,i)+`${b(this,i).endsWith("/")?"":"/"}$1`),c||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return b(this,n)}get fragment(){return b(this,r)}get main(){return b(this,e)}set main(d){d=d.replace(/_/gu," ").trim(),F(this,e,d&&d[0].toUpperCase()+d.slice(1))}get prefix(){const d=b(this,t)[this.ns];return d+(d&&":")}get title(){return this.getRedirection()[1]}get extension(){const{main:d}=this,o=d.lastIndexOf(".");return o===-1?void 0:d.slice(o+1).toLowerCase()}getRedirection(){const{prefix:d}=this,o=d;return j(this,s,Iu).call(this,o)}setFragment(d){F(this,r,d)}getUrl(d){{typeof d=="string"&&(F(this,i,d),b(this,i).includes("$1")||F(this,i,b(this,i)+`${b(this,i).endsWith("/")?"":"/"}$1`));const{title:o,fragment:u}=this;return o?b(this,i).replace("$1",encodeURIComponent(o)+(u?`#${encodeURIComponent(u)}`:"")):u===void 0?"":`#${encodeURIComponent(u)}`}throw new Error("Title.getUrl method is only available in the LSP version!")}},e=new WeakMap,t=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakMap,s=new WeakSet,Iu=function(d){var u,c;let o=(d+this.main).replace(/ /gu,"_");if(o.startsWith("/"))o=((u=this.page)!=null?u:"")+o.replace(/(.)\/$/u,"$1");else if(o.startsWith("../")&&((c=this.page)!=null&&c.includes("/"))){const[m,f]=un(o),y=this.page.split("/");y.length>m&&(o=y.slice(0,-m).join("/")+(f&&"/")+f)}return[!1,o]},a)}}),Nu={};oe(Nu,{LanguageService:()=>Lu,tasks:()=>On});var On,va,ba,ya,wa,dn,Sa,Aa,ka,$a,cn,_a,hn,wt,gn,Qe,Ae,pn,fn,St,At,rt,Jt,mn,Ta,xn,Lu,Wd=N({"lib/lsp.ts"(){"use strict";var e,t,i,n,r,s,l,a,d,o,ui,Re,Bn,qn,Wn,Fu,Mn,$t,T;et(),Jo(),Gn(),to(),J(),ve(),Ie(),Ue(),D(),Q(),On=new WeakMap,va=new Set(["ref"]),ba=new Set(["ref","references"]),ya=new Set(["name","follow"]),wa=new Set(["group"]),dn=new Set(["arg-name","template-name","link-target","parameter-key"]),Sa=new Set(["ext","html","attr-key","image-parameter","heading-title","heading","magic-word-name",...dn]),Aa=new Set(["text","comment","noinclude","include"]),ka=["ext","html","table"].map(g=>`${g}-attr#style`).join(),$a=ct(g=>new RegExp(`^(?:${g}|//)`,"iu")),cn=({type:g,parentNode:h,length:x,firstChild:p},k)=>g==="attr-value"&&x===1&&p.type==="text"&&(!k||h.name==="style"),_a=g=>g.is("html-attr")||g.is("table-attr"),hn=g=>g.childNodes.every(({type:h})=>Aa.has(h)),wt=(g,h)=>{const{top:x,left:p}=g.posFromIndex(h);return{line:x,character:p}},gn=(g,h,x)=>({start:wt(g,h),end:wt(g,x)}),Qe=g=>{const{top:h,left:x,height:p,width:k}=g.getBoundingClientRect();return{start:{line:h,character:x},end:mi(h,x,p,k)}},Ae=(g,h,x,{line:p,character:k},v,w)=>[...new Set(g)].map(A=>{var L;const C=(L=w==null?void 0:w(A))==null?void 0:L.description;return{label:A,kind:h,textEdit:{range:{start:{line:p,character:k-x.length},end:{line:p,character:k}},newText:A+(v!=null?v:"")},...C&&{documentation:{kind:"markdown",value:C}}}}),pn=(g,h,{line:x,character:p})=>{const k=g.indexFromPos(x,p);return g.caretPositionFromIndex(k+Number(/\w/u.test(h.charAt(k))))},fn=(g,h,x)=>{const{type:p,parentNode:k={}}=g,{name:v,tag:w}=k;return p==="attr-value"&&h.has(w)&&x.has(v)?g.toString().trim():NaN},St=g=>fn(g,va,ya),At=g=>fn(g,ba,wa),rt=(g,h)=>{const x=g==null?void 0:g.getAttr(h);return x!==!0&&x||!1},Jt=g=>{const{type:h,name:x,parentNode:p}=g;switch(h){case"heading":return g.level;case"heading-title":return p.level;case"parameter-key":return`${p.parentNode.name}|${p.name}`;case"ext":case"html":case"image-parameter":return x;default:return p.name}},mn=(g,h,x=!1)=>({range:gn(g,...h.range),newText:h.text,title:`${x?"Fix":"Suggestion"}: ${h.desc}`,fix:x}),Ta=(g,h)=>{const{lintConfig:x}=I,{rules:p,fix:k,computeEditInfo:v}=x;if(x.fix=!0,x.computeEditInfo=!1,h){x.rules=void 0;for(const A of hi)x.rules[A]=A===h?p[A]:0}const{output:w}=g.lint();return x.fix=k,x.computeEditInfo=v,h&&(x.rules=p),w===void 0?[]:[{range:Qe(g),newText:w}]},xn=async(g,h,x,p=I.getConfig())=>{const k=typeof setImmediate=="function"?setImmediate:setTimeout,{running:v}=pe;pe.running=!0;const{internal:w}=I;I.internal=!0;const A=()=>{pe.running=v,I.internal=w},C=new z(di(g),p);C.type="root";let L=0;try{await new Promise(q=>{const B=()=>{h()===g?(L++,k(O,0)):q()},O=()=>{L===$e+1?(C.afterBuild(),q()):(C[L===$e?"build":"parseOnce"](L,x),B())};k(O,0)})}catch(q){throw A(),q}return A(),C},Lu=(T=class{constructor(g){R(this,o);R(this,e);R(this,t);R(this,i);R(this,n);R(this,r);R(this,s);R(this,l);R(this,a);R(this,d);Ee(this,"include",!0);Ee(this,"config");Ee(this,"data");On.set(g,this),Object.defineProperties(this,{config:{enumerable:!1},data:{enumerable:!1}})}destroy(){Object.setPrototypeOf(this,null)}async provideDocumentColors(g,h,x=!0){const p=await j(this,o,Re).call(this,h);return p.querySelectorAll("attr-value,parameter-value,arg-default").reverse().flatMap(k=>{const{type:v,childNodes:w}=k;return v!=="attr-value"&&!hn(k)?[]:w.filter(A=>A.type==="text").reverse().flatMap(A=>{const{data:C}=A,L=Ma(C,x).filter(([,,,B])=>B);if(L.length===0)return[];const q=A.getAbsoluteIndex();return L.map(([B,O,W])=>{const E=g(B);return E.length===4&&{color:{red:E[0]/255,green:E[1]/255,blue:E[2]/255,alpha:E[3]},range:gn(p,q+O,q+W)}}).filter(B=>B!==!1)})})}provideColorPresentations(g){const{color:{red:h,green:x,blue:p,alpha:k},range:v}=g,w=[h,x,p],A=k<1?`rgba(${w.map(C=>Math.round(C*255)).join()},${k})`:`#${w.map(Wa).join("")}`;return[{label:A,textEdit:{range:v,newText:A}}]}async provideCompletionItems(g,h){var Z,ue,de,ce,le,he,we;const{re:x,allTags:p,functions:k,switches:v,jaSwitches:w,protocols:A,params:C,tags:L,ext:q}=j(this,o,Fu).call(this),{line:B,character:O}=h,W=g.split(/\r?\n/u,B+1)[B],E=x.exec((Z=W==null?void 0:W.slice(0,O))!=null?Z:""),[,,P={},U={}]=this.config.doubleUnderscore;if((E==null?void 0:E[1])!==void 0){const G=E[1].startsWith("/");return Ae(p,"Class",E[1].slice(G?1:0),h,G&&!(W!=null&&W.slice(O).trim().startsWith(">"))?">":"")}else if(E!=null&&E[4]||E!=null&&E[5]&&w.length>0){const G=E[5]!==void 0;return Ae(G?w:v,"Constant",E[G?5:4],h,"",K=>{if(this.data)G||(K=K.slice(2,-2));else return;return K in P?K=P[K]:K in U&&(K=U[K]),j(this,o,Mn).call(this,K.toLowerCase())})}else if((E==null?void 0:E[6])!==void 0)return Ae(A,"Reference",E[6],h);const M=await j(this,o,Re).call(this,g);let ie;if(E!=null&&E[2]){ie=M.elementFromPoint(E.index+E[2].length-1,B);const G=(ue=E[3])!=null?ue:"";if(E[2]==="{{{")return Ae(M.querySelectorAll("arg").filter(te=>te.name&&te!==ie).map(({name:te})=>te),"Variable",G,h);const[K,be]=this.config.parserFunction,Se=W.charAt(O),Fe=G.startsWith(":"),Ge=Fe?G.slice(1).trimStart():G;if(E[2]==="[[")return Ae(M.querySelectorAll("link,file,category,redirect-target").filter(te=>te!==ie).map(({name:te})=>te),"Folder",Ge,h);let ke=k;return Se===":"?ke=k.filter(te=>!te.endsWith(":")):Se===":"&&(ke=k.filter(te=>te.endsWith(":")).map(te=>te.slice(0,-1))),[...Ae(ke,"Function",G,h,"",te=>{if(this.data)te in K?te=K[te]:te in be&&(te=be[te]);else return;return j(this,o,$t).call(this,te.toLowerCase())}),...G.startsWith("#")?[]:Ae(M.querySelectorAll("template").filter(te=>te!==ie).map(te=>{const{name:st}=te;if(Fe)return st;const{ns:qt}=te.getAttribute("title");return qt===0?`:${st}`:qt===10?st.slice(9):st}),"Folder",Ge,h)]}let H,X;if((E==null?void 0:E[8])===void 0&&(ie=M.elementFromPoint(O,B),{type:H,parentNode:X}=ie),(E==null?void 0:E[7])!==void 0||H==="image-parameter"){const G=M.indexFromPos(B,O),K=(ce=(de=E==null?void 0:E[7])==null?void 0:de.trimStart())!=null?ce:b(this,e).slice(ie.getAbsoluteIndex(),G).trimStart(),be=b(this,e)[G]==="=";return[...Ae(C,"Property",K,h).filter(({label:Se})=>!be||!/[= ]$/u.test(Se)),...Ae(M.querySelectorAll("image-parameter#width").filter(Se=>Se!==ie).map(Se=>Se.text()),"Unit",K,h)]}else if((E==null?void 0:E[8])!==void 0||H==="attr-key"){const G=(he=(le=E==null?void 0:E[8])==null?void 0:le.toLowerCase())!=null?he:X.tag,K=(we=E==null?void 0:E[10])!=null?we:ie.toString().slice(0,O-M.posFromIndex(ie.getAbsoluteIndex()).left);if(!L.has(G))return;const be=nr[G],Se=rr[G],Fe=Se&&Ae(Se,"Field",K,h);return q.includes(G)&&!be?Fe:[...Fe!=null?Fe:[],...G==="meta"||G==="link"?[]:Ae(sr,"Property",K,h),...be?Ae(be,"Property",K,h):[],...Ae(["data-"],"Variable",K,h),...Ae(["xmlns:"],"Interface",K,h)]}else if(H==="parameter-key"||H==="parameter-value"&&X.anon){const G=X.parentNode,{type:K,name:be}=G;if(K==="magic-word"&&be!=="invoke")return;const Se=b(this,e).slice(ie.getAbsoluteIndex(),M.indexFromPos(B,O)).trimStart(),{module:Fe,function:Ge}=G;return Se?Ae(M.querySelectorAll("parameter").filter(ke=>ke===X||ke.anon||ke.parentNode.type!==K||ke.parentNode.name!==be?!1:K==="template"?!0:ke.parentNode.module===Fe&&ke.parentNode.function===Ge).map(({name:ke})=>ke),"Variable",Se,h,H==="parameter-value"?"=":""):void 0}else if(cn(ie)&&_a(X)){const G=Yn(X.tag,X.name);if(G.length===0)return;const K=b(this,e).slice(ie.getAbsoluteIndex(),M.indexFromPos(B,O)).trimStart();return Ae(G,"Value",K,h)}}async provideDiagnostics(g,h=!0){const x=await j(this,o,Re).call(this,g),{lintConfig:p}=I,k=p.fix;p.fix=!1;const v=x.lint();return p.fix=k,[(h?v:v.filter(({severity:L})=>L==="error")).map(({startLine:L,startCol:q,endLine:B,endCol:O,severity:W,rule:E,message:P,fix:U,suggestions:M})=>({range:{start:{line:L,character:q},end:{line:B,character:O}},severity:W==="error"?1:2,source:"WikiLint",code:E,message:P,data:[...U?[mn(x,U,!0)]:[],...M?M.map(ie=>mn(x,ie)):[]]})),[],[]].flat(2)}resolveCodeAction(g){if(g.kind!=="source.fixAll")return g;const{rule:h}=g.data;return{...g,edit:{changes:{"":Ta(b(this,r),h)}}}}async provideFoldingRanges(g){const h=await j(this,o,Re).call(this,g),{length:x}=h.getLines(),p=[],k=new Array(6),v=h.querySelectorAll("heading-title,table,template,magic-word");for(const w of[...v].reverse())w.getRelativeIndex();for(const w of v){const{offsetHeight:A}=w;if(w.type==="heading-title"||A>2){const{top:C}=h.posFromIndex(w.getAbsoluteIndex());if(w.type==="heading-title"){const{level:L}=w.parentNode;for(let q=L-1;q<6;q++){const B=k[q];B!==void 0&&B<C-1&&p.push({startLine:B,endLine:C-1,kind:"region"}),k[q]=void 0}k[L-1]=C+A-1}else p.push({startLine:C,endLine:C+A-2,kind:"region"})}}for(const w of k)w!==void 0&&w<x-1&&p.push({startLine:w,endLine:x-1,kind:"region"});return p}async provideLinks(g){var v;(v=this.config)!=null||(this.config=I.getConfig());const{articlePath:h,protocol:x}=this.config,p=h==null?void 0:h.includes("//"),k=$a(x);return(await j(this,o,Re).call(this,g)).querySelectorAll(`magic-link,ext-link-url,free-ext-link,attr-value${p?",link-target,template-name,invoke-module,magic-word#filepath,magic-word#widget":""},image-parameter#link,image-parameter#manualthumb`).reverse().map(w=>{let A;w.is("magic-word")?({name:A}=w,w=w.childNodes[1].lastChild):w.is("image-parameter")&&({name:A}=w);const{type:C,parentNode:L,firstChild:q,lastChild:B,childNodes:O,length:W}=w,{tag:E}=L;if(A!=null||(A=L.name),!(C!=="attr-value"||A==="cite"&&["blockquote","del","ins","q"].includes(E)||A==="src"&&["templatestyles","img"].includes(E)||A==="templatename"&&E==="rss"||A==="file"&&E==="phonos")||!hn(w))return!1;let P=O.filter(U=>U.type==="text").map(({data:U})=>U).join("").trim();if(!P)return!1;try{if(w.is("magic-link")||w.is("ext-link-url")||w.is("free-ext-link"))P=w.getUrl(h);else if(C==="link-target"&&(L.is("link")||L.is("redirect-target")||L.is("category"))){if(/^(?:\.\.)?\//u.test(P))return!1;P=L.link.getUrl(h)}else if(C==="link-target"||C==="template-name")P=L.getAttribute("title").getUrl(h);else if(["invoke-module","parameter-value"].includes(C)||C==="attr-value"&&(A==="src"&&E==="templatestyles"||A==="templatename"&&E==="rss"||A==="file"&&E==="phonos")||C==="image-parameter"&&(A==="manualthumb"||!k.test(P))){if(!p||P.startsWith("/"))return!1;C==="image-parameter"&&A==="manualthumb"||C==="parameter-value"&&A==="filepath"||C==="attr-value"&&E==="phonos"?P=`File:${P}`:C==="parameter-value"?P=`Widget:${P}`:C==="invoke-module"&&(P=`Module:${P}`);const U=I.normalizeTitle(P,C==="attr-value"?10:0,!1,this.config,{temporary:!0});if(!U.valid)return!1;P=U.getUrl()}if(typeof P=="string"&&P.startsWith("//")&&(P=`https:${P}`),P=new URL(P).href,C==="image-parameter"){const U=q.getBoundingClientRect(),{top:M,left:ie,height:H,width:X}=W===1?U:B.getBoundingClientRect();return{range:{start:{line:U.top,character:U.left},end:mi(M,ie,H,X)},target:P}}return{range:Qe(w),target:P}}catch{return!1}}).filter(w=>w!==!1)}async provideReferences(g,h){const x=await j(this,o,Re).call(this,g),{offsetNode:p,offset:k}=pn(x,b(this,e),h),v=p.type==="text"?p.parentNode:p,w=k===0&&(v.is("ext-attr-dirty")||v.is("html-attr-dirty"))?v.parentNode.parentNode:v,{type:A}=w,C=St(w),L=At(w);if(!C&&!L&&!Sa.has(A))return;const q=Jt(w),B=x.querySelectorAll(A==="heading-title"?"heading":A).filter(O=>A==="attr-value"?St(O)===C||At(O)===L:Jt(O)===q).reverse().map(O=>({range:Qe(O.type==="parameter-key"?O.parentNode:O)}));return B.length===0?void 0:B}async provideDefinition(g,h){const x=await j(this,o,Re).call(this,g),p=x.elementFromPoint(h.character,h.line),k=p.is("ext")&&p.name==="ref"?p:p.closest("ext#ref"),v=rt(k,"name");if(!v)return;const w=rt(k,"group"),A=x.querySelectorAll("ext#ref").filter(C=>C.innerText&&rt(C,"name")===v&&rt(C,"group")===w).reverse().map(({lastChild:C})=>({range:Qe(C)}));return A.length===0?void 0:A}async resolveRenameLocation(g,h){const x=await j(this,o,Re).call(this,g),p=x.elementFromPoint(h.character,h.line),{type:k}=p,v=St(p),w=At(p);return!v&&!w&&(!dn.has(k)||k==="parameter-key"&&/^[1-9]\d*$/u.test(p.parentNode.name)||k==="link-target"&&!["link","redirect-target"].includes(p.parentNode.type))?void 0:Qe(p)}async provideRenameEdits(g,h,x){const p=await j(this,o,Re).call(this,g),k=p.elementFromPoint(h.character,h.line),{type:v}=k,w=St(k),A=w&&rt(k.parentNode.parentNode,"group"),C=At(k),L=Jt(k),q=p.querySelectorAll(v).filter(B=>{const{type:O}=B.parentNode;return v==="link-target"&&O!=="link"&&O!=="redirect-target"?!1:v==="attr-value"?At(B)===C||St(B)===w&&rt(B.parentNode.parentNode,"group")===A:Jt(B)===L});return q.length===0?void 0:{changes:{"":q.reverse().map(B=>({range:Qe(B),newText:x}))}}}async provideHover(g,h){if(!this.data)return;const x=await j(this,o,Re).call(this,g);let{offsetNode:p,offset:k}=pn(x,b(this,e),h);p.type==="text"&&(k+=p.getRelativeIndex(),p=p.parentNode);const{type:v,parentNode:w,length:A,name:C}=p;let L,q,B,O;if(p.is("double-underscore")&&k>0)L=j(this,o,Mn).call(this,p.name);else if(v==="magic-word-name")L=j(this,o,$t).call(this,w.name),q=p.text().trim(),B=w.getAttribute("colon");else if(p.is("magic-word")&&!p.modifier&&A===1&&(k>0||x.posFromIndex(p.getAbsoluteIndex()).left===h.character))L=j(this,o,$t).call(this,C),q=p.firstChild.text().trim(),B=p.getAttribute("colon");else if((p.is("magic-word")||p.is("template"))&&p.modifier&&k>=2&&p.getRelativeIndex(0)>k&&(q=p.modifier.trim().slice(0,-1),L=j(this,o,$t).call(this,q.toLowerCase()),B=":",L)){const W=p.getAbsoluteIndex();O={start:wt(x,W+2),end:wt(x,W+p.modifier.trimEnd().length+1)}}return L&&{contents:{kind:"markdown",value:(L.signatures?`${L.signatures.map(W=>`- **{{ ${q}${W.length===0?"**":`${B}** `}${W.map(({label:E,const:P})=>P?E:`*${E}*`).join(" **|** ")} **}}**`).join(`
|
|
33
33
|
`)}
|
|
34
34
|
|
|
35
|
-
`:"")+L.description},range:O!=null?O:Qe(
|
|
36
|
-
${
|
|
37
|
-
`)}${
|
|
38
|
-
`}${
|
|
39
|
-
`),h={start:{line:0,character:0},end:{line:
|
|
35
|
+
`:"")+L.description},range:O!=null?O:Qe(p)}}async provideSignatureHelp(g,h){if(!this.data)return;const{line:x,character:p}=h,k=g.split(/\r?\n/u,x+1)[x],{lastChild:v}=await j(this,o,qn).call(this,`${k.slice(0,p+/^[^{}<]*/u.exec(k.slice(p))[0].length)}}}`);if(!v.is("magic-word")||v.length===1)return;const{name:w,childNodes:A,firstChild:C}=v,L=j(this,o,$t).call(this,w);if(!(L!=null&&L.signatures))return;const q=A.length-1,B=L.signatures.filter(P=>{var U;return(P.length>=q||((U=P[P.length-1])==null?void 0:U.rest))&&P.every(({label:M,const:ie},H)=>{var Z;const X=ie&&H<q&&((Z=A[H+1])==null?void 0:Z.text().trim());return!X||M.toLowerCase().includes(X.toLowerCase())})});if(B.length===0)return;let O=-1;for(let P=v.getAbsoluteIndex()+v.getAttribute("padding");O<q&&(P+=A[O+1].toString().length+1,!(P>p));O++);const W=C.text().trim(),E=v.getAttribute("colon");return{signatures:B.map(P=>({label:`{{${W}${P.length===0?"":E}${P.map(({label:U})=>U).join("|")}}}`,parameters:P.map(({label:U,const:M})=>({label:U,...M?{documentation:"Predefined parameter"}:void 0})),...P.length<q?{activeParameter:Math.min(O,P.length-1)}:void 0})),activeParameter:O}}async provideInlayHints(g){const h=await j(this,o,Re).call(this,g);let x=[];for(const p of h.querySelectorAll("template,magic-word#invoke").reverse()){const{type:k,childNodes:v}=p;x=[...x,...v.slice(k==="template"?1:3).filter(({anon:w})=>w).reverse().map(w=>({position:wt(h,w.getAbsoluteIndex()),label:`${w.name}=`,kind:2}))]}return x}findStyleTokens(){return b(this,r).querySelectorAll(ka).filter(({lastChild:g})=>cn(g))}async provideRefactoringAction(g,h){let x,p;if(h){const{start:w,end:A}=h;if(w.line===A.line&&w.character===A.character)return[];x=g.split(/\r?\n/u,A.line+1),p=w.line===A.line?x[A.line].slice(w.character,A.character):`${x[w.line].slice(w.character)}
|
|
36
|
+
${x.slice(w.line+1,A.line).join(`
|
|
37
|
+
`)}${x.length===2?"":`
|
|
38
|
+
`}${x[A.line].slice(0,A.character)}`}else if(g)x=g.split(/\r?\n/u),p=x.join(`
|
|
39
|
+
`),h={start:{line:0,character:0},end:{line:x.length-1,character:x[x.length-1].length}};else return[];const k=await j(this,o,qn).call(this,p),{viewOnly:v}=I;return I.viewOnly=!1,pe.internal(()=>{k.escape()},I),I.viewOnly=v,[{title:"Escape with magic words",kind:"refactor.rewrite",edit:{changes:{"":[{range:h,newText:k.toString()}]}}}]}},e=new WeakMap,t=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakMap,s=new WeakMap,l=new WeakMap,a=new WeakMap,d=new WeakMap,o=new WeakSet,ui=function(){return b(this,l)===this.config&&b(this,a)===this.include},Re=async function(g){var h;return g=di(g),!b(this,i)&&j(this,o,ui).call(this)&&b(this,e)===g?b(this,r):(F(this,e,g),(h=b(this,i))!=null||F(this,i,j(this,o,Bn).call(this)),b(this,i))},Bn=async function(){var x;(x=this.config)!=null||(this.config=I.getConfig()),F(this,l,this.config),F(this,a,this.include);const g=b(this,e),h=await xn(g,()=>b(this,e),this.include,this.config);return j(this,o,ui).call(this)&&b(this,e)===g?(F(this,r,h),F(this,i,void 0),h):(F(this,i,j(this,o,Bn).call(this)),b(this,i))},qn=async function(g){var h;return g=di(g),!b(this,n)&&j(this,o,ui).call(this)&&b(this,t)===g?b(this,s):(F(this,t,g),(h=b(this,n))!=null||F(this,n,j(this,o,Wn).call(this)),b(this,n))},Wn=async function(){var x;(x=this.config)!=null||(this.config=I.getConfig()),F(this,l,this.config),F(this,a,this.include);const g=b(this,t),h=await xn(g,()=>b(this,t),this.include,this.config);return j(this,o,ui).call(this)&&b(this,t)===g?(F(this,s,h),F(this,n,void 0),h):(F(this,n,j(this,o,Wn).call(this)),b(this,n))},Fu=function(){var g;if(!b(this,d)||b(this,d)[1]!==this.config){(g=this.config)!=null||(this.config=I.getConfig());const{nsid:h,ext:x,html:p,parserFunction:[k,v,...w],doubleUnderscore:A,protocol:C,img:L}=this.config,q=new Set([x,p].flat(2)),B=new RegExp("(?:"+String.raw`<(\/?\w*)`+"|"+String.raw`(\{{2,4}|\[\[)\s*([^|{}<>[\]\s][^|{}<>[\]#]*)?`+"|"+String.raw`(_(?:_(?:(?!__|_{2})[\p{L}\p{N}_])*)?)`+"|"+String.raw`(_(?:_(?:(?!__|_{2})[\p{L}\p{N}_])*)?)`+"|"+String.raw`(?<!\[)\[([a-z:/]*)`+"|"+String.raw`\[\[\s*(?:${Object.entries(h).filter(([,W])=>W===6).map(([W])=>W).join("|")})\s*:[^[\]{}<>]+\|([^[\]{}<>|=]*)`+"|"+String.raw`<(\w+)(?:\s(?:[^<>{}|=\s]+(?:\s*=\s*(?:[^\s"']\S*|(["']).*?\9))?(?=\s))*)?\s(\w*)`+")$","iu"),O=A.slice(0,2).flat();F(this,d,[{re:B,ext:x,tags:q,allTags:[...q,"onlyinclude","includeonly","noinclude"],functions:[Object.keys(k),Object.keys(v),w].flat(2),switches:O.filter(ut).map(W=>`__${W}__`),jaSwitches:O.filter(W=>!ut(W)),protocols:C.split("|"),params:Object.keys(L).filter(W=>W.endsWith("$1")||!W.includes("$1")).map(W=>W.replace(/\$1$/u,""))},this.config])}return b(this,d)[0]},Mn=function(g){return this.data.behaviorSwitches.find(({aliases:h})=>h.includes(g))},$t=function(g){return this.data.parserFunctions.find(({aliases:h})=>h.some(x=>x.replace(/^#/u,"")===g))},T)}}),Eu={};oe(Eu,{default:()=>I});ju.exports=se(Eu);var Ri,vn,Ca,bn,kt,yn,Ia,I,D=N({"index.ts"(){Gn(),Ie(),Ue(),ve(),Bd(),qd(),Ri=!0,vn=new Rn,bn=(e,t,i)=>typeof e=="string"?[!!t,i,e]:[!!e,t,i],kt={config:Sn,get rules(){return hi},get i18n(){return{...Ba,...Ca}},set i18n(e){Ca=e},get lintConfig(){return vn},set lintConfig(e){vn=new Rn(e)},get viewOnly(){return Ri},set viewOnly(e){Ri&&!e&&pe.rev++,Ri=e},internal:!1,getConfig(e){const t=e!=null?e:this.config,{doubleUnderscore:i,ext:n,parserFunction:r,variable:s}=t;for(let l=0;l<2;l++)i.length>l+2&&i[l].length===0&&(i[l]=Object.keys(i[l+2]));return n.includes("translate")&&!s.includes("translationlanguage")&&(s.push("translationlanguage"),r[1].TRANSLATIONLANGUAGE="translationlanguage"),{...Sn,...t,excludes:[]}},msg(e,t=""){var i;return e&&((i=this.i18n[e])!=null?i:e).replace("$1",this.msg(t))},normalizeTitle(e,t=0,i,n=kt.getConfig(),r){let s;if(r!=null&&r.halfParsed)s=new Pn(e,t,n,r);else{const{Token:l}=(Q(),se(Hi));s=pe.run(()=>{const a=new l(e,n);a.type="root",a.pageName=r==null?void 0:r.page,a.parseOnce(0,i).parseOnce();const d=new Pn(a.firstChild.toString(),t,n,r);a.build();for(const o of["main","fragment"]){const u=d[o];if(u!=null&&u.includes("\0")){const c=a.buildFromStr(u,1);o==="main"?d.main=c:d.setFragment(c)}}return d},this)}return s},parse(e,t,i,n,r){e=di(e);let s,l,a,d;typeof t=="string"?(s=!!i,l=n,a=r,d=t):(s=!!t,l=i,a=n,d=r),l!=null||(l=$e),a!=null||(a=this.getConfig());let o;typeof l!="number"&&(o=Array.isArray(l)?l:[l],l=Math.max(...o.map(m=>Pa[m]||$e)));const{Token:u}=(Q(),se(Hi));return pe.run(()=>{const m=new u(e,a);return m.type="root",m.pageName=d,m.parse(l,s)})},parseWithRef(e,t,i,n=t.getAttribute("include")){return this.parse(e,n,i,t.getAttribute("config"),t.pageName)},createLanguageService(e={}){var t;{const{LanguageService:i,tasks:n}=(Wd(),se(Nu));return(t=n.get(e))!=null?t:new i(e)}},lint(e,t,i,n){{const[r,s,l]=bn(t,i,n);return pe.internal(()=>this.parse(e,r,void 0,s,l).lint(),this)}},print(e,t,i,n){{const[r,s,l]=bn(t,i,n);return pe.internal(()=>this.parse(e,r,void 0,s,l).print(),this)}}},yn={},Ia=new Set(["lintConfig","normalizeTitle","parse","createLanguageService"]);for(const e of Object.keys(kt))Ia.has(e)||(yn[e]={enumerable:!1});Object.defineProperties(kt,yn),Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:kt}),I=kt}});D()});Md();})();
|
|
40
40
|
//# sourceMappingURL=bundle-lsp.min.js.map
|