wikiparser-node 1.29.2 → 1.31.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 +8 -4
- package/bundle/bundle-es8.min.js +29 -26
- package/bundle/bundle-lsp.min.js +34 -31
- package/bundle/bundle.min.js +22 -22
- package/dist/addon/magicWords.js +642 -40
- package/dist/addon/token.js +99 -111
- package/dist/addon/transclude.js +2 -2
- package/dist/base.d.mts +4 -3
- package/dist/base.d.ts +4 -3
- package/dist/base.js +3 -0
- package/dist/base.mjs +3 -0
- package/dist/bin/config.js +1 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +47 -15
- package/dist/internal.d.ts +2 -1
- package/dist/lib/attributes.js +0 -1
- package/dist/lib/document.js +2 -2
- package/dist/lib/element.d.ts +1 -1
- package/dist/lib/element.js +9 -7
- package/dist/lib/lintConfig.js +12 -1
- package/dist/lib/lsp.d.ts +0 -1
- package/dist/lib/lsp.js +2 -5
- package/dist/lib/node.js +7 -9
- package/dist/lib/redirectMap.js +1 -1
- package/dist/lib/text.js +68 -22
- package/dist/lib/title.js +1 -1
- package/dist/mixin/attributesParent.d.ts +0 -1
- package/dist/mixin/attributesParent.js +2 -4
- package/dist/mixin/elementLike.js +2 -4
- package/dist/mixin/fixed.js +0 -2
- package/dist/mixin/gapped.js +0 -2
- package/dist/mixin/hidden.js +1 -3
- package/dist/mixin/noEscape.js +1 -3
- package/dist/mixin/nodeLike.js +2 -4
- package/dist/mixin/padded.js +5 -9
- package/dist/mixin/singleLine.js +0 -2
- package/dist/mixin/sol.js +0 -2
- package/dist/mixin/syntax.js +0 -2
- package/dist/parser/commentAndExt.js +1 -1
- package/dist/parser/hrAndDoubleUnderscore.js +11 -9
- package/dist/parser/quotes.js +20 -8
- package/dist/parser/table.js +1 -2
- package/dist/src/arg.js +10 -5
- package/dist/src/atom.js +2 -0
- package/dist/src/attribute.js +12 -12
- package/dist/src/attributes.js +6 -5
- package/dist/src/commented.js +0 -1
- package/dist/src/converterFlags.js +1 -1
- package/dist/src/converterRule.js +1 -2
- package/dist/src/extLink.js +2 -2
- package/dist/src/heading.d.ts +8 -0
- package/dist/src/heading.js +25 -2
- package/dist/src/imageParameter.js +6 -7
- package/dist/src/index.d.ts +0 -2
- package/dist/src/index.js +5 -9
- package/dist/src/link/base.js +13 -6
- package/dist/src/link/category.d.ts +1 -1
- package/dist/src/link/category.js +5 -3
- package/dist/src/link/file.js +9 -9
- package/dist/src/link/galleryImage.d.ts +0 -2
- package/dist/src/link/galleryImage.js +2 -4
- package/dist/src/link/index.js +4 -4
- package/dist/src/link/redirectTarget.js +1 -1
- package/dist/src/magicLink.js +3 -3
- package/dist/src/multiLine/gallery.js +5 -5
- package/dist/src/multiLine/imagemap.js +1 -1
- package/dist/src/multiLine/paramTag.js +1 -1
- package/dist/src/nested.js +1 -1
- package/dist/src/nowiki/comment.js +1 -1
- package/dist/src/nowiki/dd.d.ts +3 -0
- package/dist/src/nowiki/doubleUnderscore.d.ts +3 -0
- package/dist/src/nowiki/hr.d.ts +3 -0
- package/dist/src/nowiki/index.js +3 -3
- package/dist/src/nowiki/list.d.ts +5 -0
- package/dist/src/nowiki/list.js +32 -0
- package/dist/src/nowiki/listBase.js +2 -2
- package/dist/src/nowiki/noinclude.d.ts +2 -1
- package/dist/src/nowiki/noinclude.js +26 -1
- package/dist/src/nowiki/quote.d.ts +21 -0
- package/dist/src/nowiki/quote.js +61 -4
- package/dist/src/paramLine.js +2 -0
- package/dist/src/parameter.js +3 -3
- package/dist/src/pre.js +1 -1
- package/dist/src/redirect.js +1 -1
- package/dist/src/syntax.js +1 -1
- package/dist/src/table/base.js +2 -3
- package/dist/src/table/index.d.ts +1 -5
- package/dist/src/table/index.js +8 -10
- package/dist/src/table/td.js +11 -12
- package/dist/src/table/trBase.js +2 -4
- package/dist/src/tag/html.js +4 -5
- package/dist/src/tag/index.js +9 -8
- package/dist/src/tagPair/ext.js +7 -6
- package/dist/src/tagPair/include.js +1 -1
- package/dist/src/tagPair/translate.d.ts +1 -0
- package/dist/src/tagPair/translate.js +8 -1
- package/dist/src/transclude.d.ts +6 -6
- package/dist/src/transclude.js +25 -18
- package/dist/util/constants.js +4 -2
- package/dist/util/html.js +11 -5
- package/dist/util/string.js +22 -10
- package/extensions/dist/base.js +3 -3
- package/extensions/editor.css +1 -1
- package/i18n/en.json +3 -0
- package/i18n/zh-hans.json +3 -0
- package/i18n/zh-hant.json +3 -0
- package/package.json +34 -29
package/bundle/bundle-lsp.min.js
CHANGED
|
@@ -1,37 +1,40 @@
|
|
|
1
|
-
"use strict";(()=>{var Su=Object.defineProperty;var hr=e=>{throw TypeError(e)};var Au=(e,t,s)=>t in e?Su(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var ku=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ne=(e,t,s)=>Au(e,typeof t!="symbol"?t+"":t,s),Ks=(e,t,s)=>t.has(e)||hr("Cannot "+s);var b=(e,t,s)=>(Ks(e,t,"read from private field"),s?s.call(e):t.get(e)),R=(e,t,s)=>t.has(e)?hr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),E=(e,t,s,i)=>(Ks(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),j=(e,t,s)=>(Ks(e,t,"access private method"),s);var gr=(e,t,s,i)=>({set _(r){E(e,t,r,s)},get _(){return b(e,t,i)}});var Cd=ku((Nd,wu)=>{var ba=Object.create,dt=Object.defineProperty,ya=Object.getOwnPropertyDescriptor,jn=Object.getOwnPropertyNames,$u=Object.getPrototypeOf,_u=Object.prototype.hasOwnProperty,wa=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),jt=e=>{throw TypeError(e)},Sa=(e,t,s)=>t in e?dt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,pr=(e,t)=>dt(e,"name",{value:t,configurable:!0}),I=(e,t)=>function(){return e&&(t=(0,e[jn(e)[0]])(e=0)),t},Rn=(e,t)=>function(){return t||(0,e[jn(e)[0]])((t={exports:{}}).exports,t),t.exports},le=(e,t)=>{for(var s in t)dt(e,s,{get:t[s],enumerable:!0})},Aa=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of jn(t))!_u.call(e,r)&&r!==s&&dt(e,r,{get:()=>t[r],enumerable:!(i=ya(t,r))||i.enumerable});return e},Tu=(e,t,s)=>(s=e!=null?ba($u(e)):{},Aa(t||!e||!e.__esModule?dt(s,"default",{value:e,enumerable:!0}):s,e)),se=e=>Aa(dt({},"__esModule",{value:!0}),e),ae=e=>{var t;return[,,,ba((t=e==null?void 0:e[wa("metadata")])!=null?t:null)]},ka=["class","method","getter","setter","accessor","field","value","get","set"],Gt=e=>e!==void 0&&typeof e!="function"?jt("Function expected"):e,Cu=(e,t,s,i,r)=>({kind:ka[e],name:t,metadata:i,addInitializer:n=>s._?jt("Already initialized"):r.push(Gt(n||null))}),Pn=(e,t)=>Sa(t,wa("metadata"),e[3]),ne=(e,t,s,i)=>{for(var r=0,n=e[t>>1],l=n&&n.length;r<l;r++)t&1?n[r].call(s):i=n[r].call(s,i);return i},re=(e,t,s,i,r,n)=>{var l,o,u,a,d,c=t&7,f=!!(t&8),g=!!(t&16),y=c>3?e.length+1:c?f?1:2:0,$=ka[c+5],k=c>3&&(e[y-1]=[]),_=e[y]||(e[y]=[]),T=c&&(!g&&!f&&(r=r.prototype),c<5&&(c>3||!g)&&ya(c<4?r:{get[s](){return fe(this,n)},set[s](h){return Te(this,n,h)}},s));c?g&&c<4&&pr(n,(c>2?"set ":c>1?"get ":"")+s):pr(r,s);for(var p=i.length-1;p>=0;p--)a=Cu(c,s,u={},e[3],_),c&&(a.static=f,a.private=g,d=a.access={has:g?h=>Nu(r,h):h=>s in h},c^3&&(d.get=g?h=>(c^1?fe:pn)(h,r,c^4?n:T.get):h=>h[s]),c>2&&(d.set=g?(h,m)=>Te(h,r,m,c^4?n:T.set):(h,m)=>h[s]=m)),o=(0,i[p])(c?c<4?g?n:T[$]:c>4?void 0:{get:T.get,set:T.set}:r,a),u._=1,c^4||o===void 0?Gt(o)&&(c>4?k.unshift(o):c?g?n=o:T[$]=o:r=o):typeof o!="object"||o===null?jt("Object expected"):(Gt(l=o.get)&&(T.get=l),Gt(l=o.set)&&(T.set=l),Gt(l=o.init)&&k.unshift(l));return c||Pn(e,r),T&&dt(r,s,T),g?c^4?n:T:r},Iu=(e,t,s)=>Sa(e,typeof t!="symbol"?t+"":t,s),On=(e,t,s)=>t.has(e)||jt("Cannot "+s),Nu=(e,t)=>Object(t)!==t?jt('Cannot use the "in" operator on this value'):e.has(t),fe=(e,t,s)=>(On(e,t,"read from private field"),s?s.call(e):t.get(e)),Ge=(e,t,s)=>t.has(e)?jt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),Te=(e,t,s,i)=>(On(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),pn=(e,t,s)=>(On(e,t,"access private method"),s),Lu=(e,t,s,i)=>({set _(r){Te(e,t,r,s)},get _(){return fe(e,t,i)}}),$a,as,Bn=I({"base.ts"(){"use strict";$a=(()=>{const e={redirect:1,onlyinclude:1,noinclude:1,include:1,comment:1,ext:1,arg:2,"magic-word":2,template:2,heading:2,html:3,table:4,hr:5,"double-underscore":5,link:6,category:6,file:6,quote:7,"ext-link":8,"free-ext-link":9,"magic-link":9,list:10,dd:10,converter:11,"list-range":11};return Object.setPrototypeOf(e,null),e})(),as=(()=>{const e=["bold-header","format-leakage","fostered-content","h1","illegal-attr","insecure-style","invalid-gallery","invalid-imagemap","invalid-invoke","invalid-isbn","invalid-url","lonely-apos","lonely-bracket","lonely-http","nested-link","no-arg","no-duplicate","no-ignored","obsolete-attr","obsolete-tag","parsing-order","pipe-like","table-layout","tag-like","unbalanced-header","unclosed-comment","unclosed-quote","unclosed-table","unescaped","unknown-page","unmatched-tag","unterminated-url","url-encoding","var-anchor","void-ext"];return Object.freeze(e),e})()}});function Ee(e,t,s){return s===1?e.replace(/\0(\d+)g\x7F/gu,(i,r)=>Ee(String(t[r]),t,2)):s===2?e.replace(/\0(\d+)n\x7F/gu,(i,r)=>String(t[r])):e.replace(/\0(\d+)\x7F/gu,(i,r)=>t[r])}var Je,Ys,It,Nt,Lt,xt,os,Ce,ct,fr,mr,us,_a,xr,vr,ds,Ft,me=I({"util/string.ts"(){"use strict";Je=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Ys=String.raw`[^[\]<>"\0-\x1F\x7F${Je}\uFFFD]`,It=String.raw`(?:\[[\da-f:.]+\]|${Ys})`,Nt=String.raw`(?:${Ys}|\0\d+[cn!~]\x7F)*`,Lt=e=>e.trim().toLowerCase(),xt=(e,t)=>s=>s.replace(e,t),os=xt(/[\0\x7F]|\r$/gmu,""),Ce=xt(/\0\d+[cn]\x7F/gu,""),ct=(e,t="")=>e.map(s=>typeof s=="string"?s:s.text()).join(t),fr={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},mr=xt(/&(?:#(\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)):fr[s.toLowerCase()]),us=e=>mr(e),_a=xt(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),xr={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},vr=e=>xt(e,t=>`&${xr[t]};`),ds=vr(/[&<>]/gu),Ft=(e,t={})=>{const{pre:s="",post:i="",sep:r=""}=t;return s+e.map(n=>n.print()).join(r)+i}}}),Fu=Rn({"i18n/en.json"(e,t){t.exports={"attributes-of-closing-tag":"attributes of a closing tag","bold-apostrophes":"bold apostrophes","bold-in-header":"bold text in a section header",close:null,"closing-and-self-closing":"tag that is both closing and self-closing",comment:null,"conflicting-image-parameter":"conflicting image $1 parameter","content-outside-table":"content to be moved outside the table",decode:null,delink:null,"duplicate-attribute":"duplicate $1 attribute","duplicate-category":"duplicate category","duplicate-id":"duplicate HTML id","duplicate-image-parameter":"duplicate image $1 parameter","duplicate-parameter":"duplicate template parameter",encode:null,escape:null,expand:null,"ext-in-html":"extension tag in HTML tag attributes",frame:null,"full-width-punctuation":"full-width punctuation","header-in-html":"section header in HTML tag attributes","horizontal-alignment":null,"html-in-table":"HTML tag in table attributes","illegal-attribute-name":"invalid attribute name","illegal-attribute-value":"invalid attribute value","illegal-module":"invalid Scribunto module name","imagemap-without-image":"<imagemap> without an image","in-url":"$1 in URL","inconsistent-table":"inconsistent table layout","insecure-style":"insecure style","invalid-attribute":"element containing an invalid attribute name","invalid-content":"invalid content in <$1>","invalid-conversion-flag":"invalid conversion flag","invalid-gallery":"invalid gallery image","invalid-image-parameter":"invalid image parameter","invalid-imagemap-link":"invalid link in <imagemap>","invalid-isbn":"invalid ISBN","invalid-parameter":"invalid parameter of <$1>","invalid-self-closing":"invalid self-closing tag","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',"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}}}),Eu=Rn({"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,Ta,fn,Me=I({"util/constants.ts"(){"use strict";ke=11,Ta=Fu(),fn=Eu()}});function ot(e){const t=new Map,s=new WeakMap;return i=>{const r=typeof i=="string"?t:s;if(r.has(i)){const l=r.get(i);return l.lastIndex=0,l}const n=e(i);return r.set(i,n),n}}var cs,Ca,br,Ia,Ke=I({"../common/dist/index.mjs"(){"use strict";cs=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25")),Ca=e=>Math.round(e*255).toString(16).padStart(2,"0"),br=(()=>{const e=String.raw`#(?:[\da-f]{3,4}|(?:[\da-f]{2}){3,4})(?![\p{L}\p{N}_])`,t=String.raw`(?:\d*\.)?\d+%?`,s=String.raw`(?:\d*\.)?\d+(?:deg|grad|rad|turn)?`,i=String.raw`rgba?\(\s*(?:${String.raw`${new Array(3).fill(t).join(String.raw`\s+`)}(?:\s*\/\s*${t})?`}|${String.raw`${new Array(3).fill(t).join(String.raw`\s*,\s*`)}(?:\s*,\s*${t})?`})\s*\)`,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}|${i}|${r})`,"giu"),rgb:new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${e}|${i})`,"giu")}})(),Ia=(e,t=!0)=>{const s=[],i=br[t?"full":"rgb"];i.lastIndex=0;let r=i.exec(e),n=0;for(;r;){const l=r.index+r[1].length;l>n&&s.push([e.slice(n,l),n,l,!1]),{lastIndex:n}=i,s.push([r[2],l,n,e[l-1]!=="&"||!/^#\d+$/u.test(r[2])]),r=i.exec(e)}return e.length>n&&s.push([e.slice(n),n,e.length,!1]),s}}}),ge,ve=I({"lib/rect.ts"(){"use strict";var e,t,s,i,mn,n;ge=(n=class{constructor(l,o){R(this,i);R(this,e);R(this,t);R(this,s);E(this,e,l),E(this,t,o)}get start(){return b(this,t)}get top(){return j(this,i,mn).call(this).top}get left(){return j(this,i,mn).call(this).left}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakSet,mn=function(){var l;return(l=b(this,s))!=null||E(this,s,b(this,e).getRootNode().posFromIndex(b(this,t))),b(this,s)},n)}}),yr,wr,rs,hs,Zs,Q,Z,Oe,Ws,ee,qn,Xe,Wn,Un,Mn,gs,Et,zn,ut,Hn,Y=I({"util/lint.ts"(){"use strict";Ke(),Re(),ve(),G(),yr=new Set(["tr","td","th","caption"]),wr=new Set(["Template:!!","Template:!-"]),rs=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")&&wr.has(t.name)||t.is("html")&&yr.has(t.name))return!1;if(t.is("arg"))return t.length>1&&rs(t.childNodes[1]);if(t.is("magic-word"))try{const s=t.getPossibleValues().map(rs);return s.includes(2)?2:s.includes(1)&&1}catch{}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?1:2},hs=(e,t,s,i)=>({line:e+s-1,character:(s===1?t:0)+i}),Zs=e=>(t,s,i,r,n="error")=>{const{start:l}=s,{top:o,left:u}=s instanceof ge?s:new ge(t,l),{offsetHeight:a,offsetWidth:d}=t,{startIndex:c,startLine:f,startCol:g}=e(t,l,o,u),{line:y,character:$}=hs(f,g,a,d);return{rule:i,message:N.msg(r),severity:n,startIndex:c,endIndex:c+t.toString().length,startLine:f,endLine:y,startCol:g,endCol:$}},Q=Zs((e,t,s,i)=>{const r=e.getRelativeIndex(),{top:n,left:l}=e.parentNode.posFromIndex(r);return{startIndex:t+r,startLine:s+n,startCol:n?l:i+l}}),Z=Zs((e,t,s,i)=>({startIndex:t,startLine:s,startCol:i})),Oe=(e,t,s,i=0)=>({desc:N.msg(t),range:[e.startIndex+i,e.endIndex],text:s}),Ws=(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}:Oe(e,"remove",s,t),qn=(e,t)=>Oe(e,"decode",cs(t.text().replace(/%(?=21|3[ce]|5[bd]|7[b-d])/giu,"%25"))),Xe=(e,t,s=0)=>({desc:N.msg("close"),range:[e+s,e],text:t}),Wn=e=>({desc:N.msg("open"),range:[e+1,e+2],text:""}),Un=(e,t)=>Oe(e,"comment",`<!--${t}-->`),Mn=(e,t)=>Oe(e,"uppercase",t.toUpperCase()),gs=(e,t=0)=>({desc:N.msg("whitespace"),range:[e,e+t],text:" "}),Et=(e,t,s=1)=>({desc:N.msg("escape"),range:[e,e+s],text:t.repeat(s)}),zn=(e,t)=>({desc:N.msg("escape"),range:[e,e+t.length],text:t.replace(/\|/gu,"|")}),ut=(e,t,s,i)=>{if(e&&(i||N.viewOnly&&e[0]===be.rev))return e[1];const r=t();return(i||N.viewOnly)&&s([be.rev,r]),r},Hn=(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"]:[]}}),Sr,Dn,Na=I({"parser/selector.ts"(){"use strict";Sr=e=>{if(e.includes("#")){const t=e.indexOf("#"),s=e.slice(0,t),i=e.slice(t+1);return(r,n)=>(t===0||r===s)&&n===i}return e?t=>t===e:()=>!0},Dn=(e,t,s)=>{const i=e.split(",").map(r=>Sr(r.trim()));return(({type:r,name:n})=>i.some(l=>l(r,n)))}}}),ju=Rn({"../node_modules/binary-search/index.js"(e,t){t.exports=function(s,i,r,n,l){var o,u;if(n===void 0)n=0;else if(n=n|0,n<0||n>=s.length)throw new RangeError("invalid lower bound");if(l===void 0)l=s.length-1;else if(l=l|0,l<n||l>=s.length)throw new RangeError("invalid upper bound");for(;n<=l;)if(o=n+(l-n>>>1),u=+r(s[o],i,o,s),u<0)n=o+1;else if(u>0)l=o-1;else return o;return~n}}}),Ar,La,Ru=I({"util/search.ts"(){"use strict";Ar=Tu(ju()),La=(e,t,s)=>{const i=(0,Ar.default)(e,t,s);return i<0?~i:i}}}),Us,Gn=I({"mixin/cached.ts"(){"use strict";Y(),Us=(e=!0)=>t=>{const s=new WeakMap;return function(...i){return ut(s.get(this),()=>t.apply(this,i),r=>{s.set(this,r)},e)}}}}),Fa,Pu=I({"mixin/nodeLike.ts"(){"use strict";Fa=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}}}),kr,$r,vs,Pt,Ot,bs,Bt,qt,Wt,nt,Ea=I({"lib/node.ts"(){"use strict";Ru(),Y(),Re(),Gn(),Pu(),G(),$r=[Fa],kr=[Us(!1)],nt=class{constructor(){ne(Wt,5,this),Iu(this,"childNodes",[]),Ge(this,vs),Ge(this,Pt),Ge(this,Ot),Ge(this,bs),Ge(this,Bt),Ge(this,qt,{})}get parentNode(){return fe(this,vs)}get nextSibling(){return fe(this,Pt)}get previousSibling(){return fe(this,Ot)}getChildNodes(){const{childNodes:e}=this;return Object.isFrozen(e)?[...e]:e}getAttribute(e){return e==="padding"?0:this[e]}setAttribute(e,t){switch(e){case"parentNode":Te(this,vs,t),t||(Te(this,Pt,void 0),Te(this,Ot,void 0));break;case"nextSibling":Te(this,Pt,t);break;case"previousSibling":Te(this,Ot,t);break;case"aIndex":N.viewOnly&&Te(this,Bt,[be.rev,t]);break;default:this[e]=t}}getRootNode(){return ut(fe(this,bs),()=>{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,bs,e)})}indexFromPos(e,t){{if(e<0||t<0)return;const s=this.getLines();if(e>=s.length)return;const[,i,r]=s[e],n=i+t;return n>r?void 0:n}this.lspError("AstNode.indexFromPos")}posFromIndex(e){{const{length:t}=String(this);if(e+=e<0?t:0,e>=0&&e<=t){const s=this.getLines(),i=La(s,e,([,,r],n)=>r-n);return{top:i,left:e-s[i][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 ut(fe(this,qt)[e],()=>{const{childNodes:t}=this,s=e+(e<0?t.length:0);let i=this.getAttribute("padding");for(let r=0;r<s;r++)N.viewOnly&&(fe(this,qt)[r]=[be.rev,i]),i+=t[r].toString().length+this.getGaps(r);return i},t=>{fe(this,qt)[e]=t})}getAbsoluteIndex(){return ut(fe(this,Bt),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{Te(this,Bt,e)})}getBoundingClientRect(){return{...this.getDimension(),...this.getRootNode().posFromIndex(this.getAbsoluteIndex())}}is(e){return this.type===e}getLines(){{const e=[];let t=0;for(const s of String(this).split(`
|
|
2
|
-
`)){const i=t+s.length;e.push([s,t,i]),t=i+1}return e}}seal(e,t){const s=!t&&!!this[e];Object.defineProperty(this,e,{enumerable:s,configurable:!0})}lspError(e){throw new Error(`${e} method is only available in the LSP version!`)}},Wt=ae(null),vs=new WeakMap,Pt=new WeakMap,Ot=new WeakMap,bs=new WeakMap,Bt=new WeakMap,qt=new WeakMap,re(Wt,1,"getLines",kr,nt),nt=re(Wt,0,"AstNode",$r,nt),ne(Wt,1,nt)}}),ja,Ou=I({"mixin/elementLike.ts"(){"use strict";Na(),ja=e=>{var t,xn;{class i extends e{constructor(){super(...arguments);R(this,t)}getElementBy(l){const o=[...this.childNodes].reverse();for(;o.length>0;){const u=o.pop(),{type:a,childNodes:d}=u;if(a!=="text"){if(l(u))return u;for(let c=d.length-1;c>=0;c--)o.push(d[c])}}}querySelector(l){return this.getElementBy(j(this,t,xn).call(this,l))}getElementsBy(l){const o=[...this.childNodes].reverse(),u=[];for(;o.length>0;){const a=o.pop(),{type:d,childNodes:c}=a;if(d!=="text"){l(a)&&u.push(a);for(let f=c.length-1;f>=0;f--)o.push(c[f])}}return u}querySelectorAll(l){return this.getElementsBy(j(this,t,xn).call(this,l))}escape(){for(const l of this.childNodes)l.escape()}}return t=new WeakSet,xn=function(l){return Dn(l,this)},i}}}}),_r,ei,Tr,Vt,Bu=I({"lib/element.ts"(){"use strict";me(),Re(),Na(),Ea(),Ou(),_r=[ja],Vt=class extends(Tr=nt){get length(){return this.childNodes.length}text(e){return ct(this.childNodes,e)}normalize(){const e=this.getChildNodes(),t=s=>{var i,r;e.splice(s,1),(i=e[s-1])==null||i.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:i,data:r}=e[s];i!=="text"||e.length===1||this.getGaps(s-(s&&1))||r===""&&t(s)}this.setAttribute("childNodes",e)}removeAt(e){return fs(this,e,1)[0]}insertAt(e,t=this.length){return fs(this,t,0,[e]),e}closest(e){const t=Dn(e,this);let{parentNode:s}=this;for(;s;){if(t(s))return s;({parentNode:s}=s)}}append(...e){this.safeAppend(e)}safeAppend(e){for(const t of e)this.insertAt(t)}safeReplaceChildren(e){for(let t=this.length-1;t>=0;t--)this.removeAt(t);this.safeAppend(e)}setText(e,t=0){t+=t<0?this.length:0;const s=this.childNodes[t],{data:i}=s;return s.replaceData(e),i}toString(e,t=""){return this.childNodes.map(s=>s.toString(e)).join(t)}caretPositionFromIndex(e){{if(e===void 0)return;const{length:t}=this.toString();if(e>t||e<-t)return;e+=e<0?t:0;let s=this,i=0,r=0;for(;s.type!=="text";){const{childNodes:n}=s;i+=s.getAttribute("padding");for(let l=0;i<=e&&l<n.length;l++){const o=n[l],{nextSibling:u}=o,a=o.toString(),d=a.length;if(o.setAttribute("aIndex",i),i+=d,i>e||i===e&&d>0&&(!u||u.type==="text"||o.type!=="text"&&(a.trim()||!u.toString().trim()))){s=o,i-=d,r=i;break}i+=s.getGaps(l)}if(s.childNodes===n)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 i=0,r=e+this.getAttribute("padding");i<this.length;i++){const n=this.childNodes[i];n.setAttribute("aIndex",r);const l=n.lint(r,t);l.length>0&&Array.prototype.push.apply(s,l),r+=n.toString().length+this.getGaps(i)}return s}}print(e={}){const t=e.class;return this.toString()?(t===""?"":`<span class="wpb-${t!=null?t:this.type}${this.getAttribute("invalid")?" wpb-invalid":""}">`)+Ft(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){{const s={...this,type:this.type,range:[t,t+this.toString().length],childNodes:[]};for(let i=0,r=t+this.getAttribute("padding");i<this.length;i++){const n=this.childNodes[i],{length:l}=n.toString();n.setAttribute("aIndex",r),s.childNodes.push(n.type==="text"?{data:n.data,range:[r,r+l]}:n.json(void 0,r)),r+=l+this.getGaps(i)}return s}}},ei=ae(Tr),Vt=re(ei,0,"AstElement",_r,Vt),ne(ei,1,Vt)}}),ms,Ms=I({"mixin/gapped.ts"(){"use strict";ms=(e=1)=>t=>{class s extends t{getGaps(){return e}}return s}}}),We,ze=I({"mixin/noEscape.ts"(){"use strict";We=e=>{{class t extends e{escape(){}}return t}}}}),Cr,Ra,qu=I({"src/parameter.ts"(){"use strict";me(),Y(),G(),J(),Cr=new RegExp(`https?://${It}${Nt}$`,"iu"),Ra=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,i=[]){super(void 0,s,i);const r=new z(typeof e=="number"?void 0:e,s,i,{}),n=new z(t,s,i);r.type="parameter-key",r.setAttribute("stage",2),n.type="parameter-value",n.setAttribute("stage",2),this.append(r,n)}trimName(e,t=!0){const s=(typeof e=="string"?e:e.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",s),s}afterBuild(){if(!this.anon){const{parentNode:e,firstChild:t}=this,s=this.trimName(t);e&&e.getArgs(s,!1,!1).add(this)}super.afterBuild()}toString(e){return this.anon?this.lastChild.toString(e):super.toString(e,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(e=this.getAbsoluteIndex(),t){var s;{const i=super.lint(e,t),r="unescaped",{lintConfig:n}=N,l=n.getSeverity(r);if(l){const{firstChild:o}=this,u=(s=Cr.exec(o.text()))==null?void 0:s[0];try{if(u&&new URL(u).search){const a=Q(o,{start:e},r,"unescaped-query",l);a.startIndex=a.endIndex,a.startLine=a.endLine,a.startCol=a.endCol,a.endIndex++,a.endCol++,(n.computeEditInfo||n.fix)&&(a.fix=Et(a.startIndex,"{{=}}")),i.push(a)}}catch{}}return i}}print(){return super.print({sep:this.anon?"":"="})}json(e,t=this.getAbsoluteIndex()){{const s=super.json(void 0,t);return Object.assign(s,{anon:this.anon},this.duplicated&&{duplicated:!0}),s}}}}}),qe,ht=I({"src/atom.ts"(){"use strict";var e,t;J(),qe=(t=class extends z{constructor(i,r,n,l,o){super(i,n,l,o);R(this,e);E(this,e,r)}get type(){return b(this,e)}set type(i){E(this,e,i)}getAttribute(i){var r;return i==="invalid"?this.type==="converter-flag"&&!!((r=this.parentNode)!=null&&r.isInvalidFlag(this)):super.getAttribute(i)}},e=new WeakMap,t)}}),Ue,gt=I({"src/syntax.ts"(){"use strict";var e,t;J(),Ue=(t=class extends z{constructor(i,r,n,l,o){super(i,n,l,o);R(this,e);E(this,e,r)}get type(){return b(this,e)}lint(i=this.getAbsoluteIndex()){return super.lint(i,!1)}},e=new WeakMap,t)}}),Pa={};le(Pa,{TranscludeToken:()=>rt});var Ir,ti,Nr,rt,Oa=I({"src/transclude.ts"(){"use strict";var e,t,s,i,r,n,Qt,Ba,u;me(),Y(),Re(),ve(),Ms(),ze(),G(),J(),qu(),ht(),gt(),Ir=[We,ms()],rt=(u=class extends(Nr=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,n);Ne(this,"modifier","");R(this,e,"template");R(this,t,":");R(this,s,!1);R(this,i,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 Ue(L,"magic-word-name",f,g);if(super.insertAt(H),B!==!1&&c.unshift([B]),this.name==="invoke")for(let V=0;V<2;V++){const X=c.shift();if(!X)break;const oe=new qe(X.join("="),`invoke-${V?"function":"module"}`,f,g);super.insertAt(oe)}}}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 qe(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 Ra(...B,f,g))}this.seal("modifier")}get type(){return b(this,e)}get module(){return this.type==="magic-word"&&this.name==="invoke"?j(this,n,Qt).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)||(be.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,n,Qt).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))+ct(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,n,Qt).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 ge(this,d),{lintConfig:_}=N,{computeEditInfo:T}=_,p=g==="magic-word";let h="no-ignored",m=_.getSeverity(h,"fragment");if(p&&!j(this,n,Qt).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"&&us(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,n,Ba).call(this,d):d.name&&this.getArgs(d.name,!1,!1).add(d),d}getAllArgs(){return this.childNodes.filter(Js("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,i).has(g)?y=b(this,i).get(g):(y=new Set(this.getAllArgs().filter(({name:$})=>g===$)),b(this,i).set(g,y)),y}getDuplicatedArgs(){return[...b(this,i)].filter(([,{size:d}])=>d>1).map(([d,c])=>[d,[...c]])}getPossibleValues(){const{type:d,name:c,childNodes:f}=this;if(d==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let 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"?ds(g)+f.print()+(c===1?"":b(this,t))+Ft(d.slice(1),{sep:"|"}):(g?`<span class="wpb-magic-word">${ds(g)}</span>`:"")+Ft(d,{sep:"|"})}}}</span>`}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakSet,Qt=function(){const d=this.type==="template";return this.normalizeTitle((d?"":"Module:")+this.childNodes[d?0:1].text(),10,{temporary:!0,...!d&&{page:""}})},Ba=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),ti=ae(Nr),rt=re(ti,0,"TranscludeToken",Ir,rt),ne(ti,1,rt)}}),ys,si,ii,Lr,Fr,Er,jr,ni,Rr,vn,Wu=I({"lib/text.ts"(){"use strict";var e,bn,s;me(),Y(),Re(),G(),Ea(),ys=String.raw`[${Je}\t]*`,si=String.raw`[^\S\n]*`,ii=String.raw`<${si}(?:/${si})?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+`,Lr=new RegExp(String.raw`${ii}|https?[:/]/+|(?:rfc|pmid)(?=[-::]?${ys}\d)|isbn(?=[-::]?${ys}(?:\d(?:${ys}|-)){6})`,"giu"),Fr=new RegExp(ii,"giu"),Er=new Set(["attr-value","ext-link-text","link-text"]),jr={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},ni=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"]),Rr=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch{return/\w/u}})(),vn=(s=class extends nt{constructor(n){super();R(this,e);Ne(this,"data","");this.data=n}get type(){return"text"}toString(n){var l;return n&&!((l=this.parentNode)!=null&&l.getAttribute("built"))?Ce(this.data):this.data}text(){return this.data}lint(n=this.getAbsoluteIndex(),l){var o,u,a;{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()&&!Er.has(y)?Lr:Fr),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(n),{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")?ni:[]]);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:xe}=F;P+=xe,U=U.slice(xe)}U=U.toLowerCase();const[M]=U,ie=M==="r"||M==="p"||M==="i",H=M==="{",V=M==="}",X=M==="[",oe=M==="]";let{length:de}=U;if(M==="<"&&!q.has(W.toLowerCase())||X&&y==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(d.slice(P+1))||f!=null&&f.is("ext")&&T==="nowiki"&&((o=f.innerText)!=null&&o.includes("]"))))continue;oe&&(P||de>1)&&l.lastIndex--;let ce=n+P,ue=ce+de,pe,ye;const D=m[ue],K=m[ce-1],Ae=H||X,we=H&&K==="-"&&v.length>0,Ie=V&&D==="-"&&v.length>0,et=X&&_==="free-ext-link"&&!d.slice(P+1).trim()||oe&&p==="free-ext-link"&&!d.slice(0,P).includes("]");if(ie)pe="lonely-http",U=U.toUpperCase(),ye=C.getSeverity(pe,U);else if(M==="<"){pe="tag-like";let xe;/^<\/?\s/u.test(U)||!/[\s/>]/u.test(D!=null?D:"")?xe="invalid":B.has(W)?xe=W:ni.has(W)&&!x.includes(W)&&(xe="disallowed"),ye=C.getSeverity(pe,xe)}else if(we||Ie)pe="lonely-bracket",ye=C.getSeverity(pe,"converter"),we&&P>0?(U="-{",P--,ce--,de=2):Ie&&P<d.length-1&&(U="}-",ue++,de=2);else if(et)pe="lonely-bracket",ye=C.getSeverity(pe,"extLink");else if(Ae||V||oe)if(pe="lonely-bracket",de>1||H&&D===M||V&&K===M)ye=C.getSeverity(pe,"double");else{if(!X||y!=="ext-link-text"){const xe=jr[M],Xs=Ae?d.slice(P+1):d.slice(0,P);if(H&&((u=xe.exec(Xs))==null?void 0:u[0])==="}"||V&&((a=xe.exec(Xs))==null?void 0:a[0])==="{")continue;if(!Xs.includes(M)){const cr=Ae?"nextSibling":"previousSibling";let tt=this[cr];for(;tt&&(tt.type!=="text"||!xe.test(tt.data));)tt=tt[cr];if(tt&&xe.exec(tt.data)[0]!==M)continue}}ye=C.getSeverity(pe,"single")}else pe="lonely-http",ye=C.getSeverity(pe);if(!ye)continue;const _e=this.posFromIndex(P),{line:mt,character:te}=hs(w,A,_e.top+1,_e.left),Le={rule:pe,message:N.msg("lonely",ie||M==="h"||we||Ie?U:M),severity:ye,startIndex:ce,endIndex:ue,startLine:mt,endLine:mt,startCol:te,endCol:te+de};if(C.computeEditInfo)if(M==="<")Le.suggestions=[Et(ce,"<")];else if(M==="h"&&y!=="link-text"&&Rr.test(K||""))Le.suggestions=[gs(ce)];else if(X&&y==="ext-link-text"){const xe=c.getAbsoluteIndex()+c.toString().length;Le.suggestions=[Et(xe,"]")]}else if(oe&&et){const xe=n-g.toString().length;Le.suggestions=[Ws(xe,"left-bracket","[")]}else ie&&(Le.suggestions=[...O[0]===U?[]:[Mn(Le,U)],...D===":"||D===":"?[gs(ue,1)]:[]]);k.push(Le)}return k}}replaceData(n){j(this,e,bn).call(this,n)}splitText(n){{const{parentNode:l,data:o}=this;if(!l)throw new Error("The text node to be split has no parent node!");const u=new s(o.slice(n));return fs(l,l.childNodes.indexOf(this)+1,0,[u]),this.setAttribute("data",o.slice(0,n)),u}this.lspError("AstText.splitText")}escape(){{const{parentNode:n}=this;if(!n)throw new Error("The text node to be escaped has no parent node!");const{TranscludeToken:l}=(Oa(),se(Pa)),o=n.getAttribute("config"),u=n.childNodes.indexOf(this)+1,a=f=>Math.max(this.data.lastIndexOf("=",f),this.data.lastIndexOf("|",f));let d=a();const c=(()=>new l(this.data[d]==="="?"=":"!",[],o));for(;d>=0;d=a(d-1))d<this.data.length-1&&this.splitText(d+1),n.insertAt(be.run(c),u),j(this,e,bn).call(this,this.data.slice(0,d))}}print(){return ds(this.data)}},e=new WeakSet,bn=function(n){this.setAttribute("data",n)},s)}}),Ye,pt=I({"mixin/hidden.ts"(){"use strict";Ye=(e=!0,t=!0)=>s=>{class i extends s{text(){return""}lint(n){return e?[]:super.lint(n)}}return i}}}),He,Ze=I({"mixin/padded.ts"(){"use strict";He=({length:e})=>t=>{class s extends t{getAttribute(r){return r==="padding"?e:super.getAttribute(r)}}return s}}}),Pr,Or,ri,Br,Ve,zs=I({"src/link/base.ts"(){"use strict";var e,t,s,i;Y(),Me(),ve(),Ze(),ze(),G(),J(),ht(),Pr=r=>r==="redirect-target"||r==="link",Or=[We,He("[[")],Ve=(i=class extends(Br=z){constructor(n,l,o,u=[],a="|"){super(void 0,o,u,{});R(this,e,!0);R(this,t);R(this,s);if(this.insertAt(new qe(n,"link-target",o,u,{})),l!==void 0){const d=new z(l,o,u,{});d.type="link-text",d.setAttribute("stage",ke-1),this.insertAt(d)}E(this,t,a)}get link(){return b(this,s)}get fragment(){return b(this,s).fragment}afterBuild(){E(this,s,this.getTitle()),b(this,t).includes("\0")&&E(this,t,this.buildFromStr(b(this,t),0)),this.setAttribute("name",b(this,s).title),super.afterBuild()}setAttribute(n,l){n==="bracket"?E(this,e,l):n==="title"?E(this,s,l):super.setAttribute(n,l)}toString(n){const l=super.toString(n,b(this,t));return b(this,e)?`[[${l}]]`:l}text(){const n=super.text("|");return b(this,e)?`[[${n}]]`:n}getAttribute(n){return n==="title"?b(this,s):super.getAttribute(n)}getGaps(n){return n===0?b(this,t).length:1}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),{childNodes:[u,a],type:d}=this,{encoded:c,fragment:f}=b(this,s),{lintConfig:g}=N,{computeEditInfo:y,fix:$}=g,k=new ge(this,n);let _="unknown-page",T=g.getSeverity(_);if(T&&u.childNodes.some(({type:p})=>p==="template")&&o.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=qn(p,u)),o.push(p)}if(_="pipe-like",T=g.getSeverity(_,"link"),T&&(d==="link"||d==="category")){const p=a==null?void 0:a.childNodes.findIndex(m=>m.type==="text"&&m.data.includes("|")),h=a==null?void 0:a.childNodes[p];if(h){const m=Q(a,k,_,"pipe-in-link",T);if(y){const x=m.startIndex+a.getRelativeIndex(p);m.suggestions=[zn(x,h.data)]}o.push(m)}}if(_="no-ignored",T=g.getSeverity(_,"fragment"),T&&f!==void 0&&!Pr(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("#")))}o.push(p)}return o}}getTitle(n,l){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:l,temporary:n,decode:!0,selfLink:!0})}print(){return super.print(b(this,e)?{pre:"[[",post:"]]",sep:b(this,t)}:{sep:b(this,t)})}json(n,l=this.getAbsoluteIndex()){{const o=super.json(void 0,l),{type:u,fragment:a}=this;return a!==void 0&&(u==="link"||u==="redirect-target")&&(o.fragment=a),o}}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i),ri=ae(Br),Ve=re(ri,0,"LinkBaseToken",Or,Ve),ne(ri,1,Ve)}}),qr,li,Wr,Be,ft=I({"src/nowiki/base.ts"(){"use strict";ze(),J(),qr=[We],Be=class extends(Wr=z){get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}},li=ae(Wr),Be=re(li,0,"NowikiBaseToken",qr,Be),ne(li,1,Be)}}),Ur,ai,Mr,je,Rt=I({"src/nowiki/noinclude.ts"(){"use strict";pt(),ft(),Ur=[Ye()],je=class extends(Mr=Be){get type(){return"noinclude"}toString(e){return e?"":super.toString()}},ai=ae(Mr),je=re(ai,0,"NoincludeToken",Ur,je),ne(ai,1,je)}}),qa,Uu=I({"src/link/redirectTarget.ts"(){"use strict";Y(),G(),zs(),Rt(),qa=class extends Ve{get type(){return"redirect-target"}constructor(e,t,s,i){super(e,void 0,s,i),t!==void 0&&this.insertAt(new je(t,s,i))}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:i}=N,r=i.getSeverity(s,"redirect");if(r&&this.length===2){const n=Q(this.lastChild,{start:e},s,"useless-link-text",r);n.startIndex--,n.startCol--,(i.computeEditInfo||i.fix)&&(n.fix=ee(n)),t.push(n)}return t}}}}}),zr,oi,Hr,Jt,Mu=I({"src/redirect.ts"(){"use strict";var e,t,s;pt(),ze(),J(),gt(),Uu(),zr=[Ye(!1,!1),We],Jt=(s=class extends(Hr=z){constructor(r,n,l,o,u,a,d=[]){super(void 0,a,d);R(this,e);R(this,t);E(this,e,r),E(this,t,u),this.append(new Ue(n,"redirect-syntax",a,d),new qa(l,o==null?void 0:o.slice(1),a,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 n=r+b(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",n),this.lastChild.lint(n)}}print(){return super.print({pre:b(this,e),post:b(this,t)})}},e=new WeakMap,t=new WeakMap,s),oi=ae(Hr),Jt=re(oi,0,"RedirectToken",zr,Jt),ne(oi,1,Jt)}}),Wa={};le(Wa,{parseRedirect:()=>Ua});var Ua,zu=I({"parser/redirect.ts"(){"use strict";G(),Mu(),Ua=(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 i=t.regexRedirect.exec(e);return i&&N.normalizeTitle(i[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,page:""}).valid?(e=`\0${s.length}o${e.slice(i[0].length)}`,new Jt(...i.slice(1),t,s),e):!1}}}),Dr,ui,Gr,Xt,Hu=I({"src/onlyinclude.ts"(){"use strict";Ze(),ze(),J(),Dr=[We,He("<onlyinclude>")],Xt=class extends(Gr=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>'})}},ui=ae(Gr),Xt=re(ui,0,"OnlyincludeToken",Dr,Xt),ne(ui,1,Xt)}}),Vr,di,Qr,lt,Vn=I({"src/tagPair/index.ts"(){"use strict";var e,t;Ms(),ze(),J(),Vr=[ms(),We],lt=(t=class extends(Qr=z){constructor(i,r,n,l,o,u=[]){super(void 0,o);R(this,e);Ne(this,"closed");Ne(this,"selfClosing");this.setAttribute("name",i.toLowerCase()),E(this,e,[i,l||i]),this.closed=l!=="",this.selfClosing=l===void 0,this.append(r,n);const a=typeof r=="string"?-1:u.indexOf(r);u.splice(a===-1?1/0:a,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(i){const{selfClosing:r,firstChild:n,lastChild:l}=this,[o,u]=b(this,e);return r?`<${o}${n.toString(i)}/>`:`<${o}${n.toString(i)}>${l.toString(i)}${this.closed?`</${u}>`:""}`}text(){const[i,r]=b(this,e);return this.selfClosing?`<${i}${this.firstChild.text()}/>`:`<${i}${super.text(">")}${this.closed?`</${r}>`:""}`}getAttribute(i){return i==="padding"?b(this,e)[0].length+1:super.getAttribute(i)}print(){const[i,r]=b(this,e);return super.print(this.selfClosing?{pre:`<${i}`,post:"/>"}:{pre:`<${i}`,sep:">",post:this.closed?`</${r}>`:""})}},e=new WeakMap,t),di=ae(Qr),lt=re(di,0,"TagPairToken",Vr,lt),ne(di,1,lt)}}),Qn,Ma=I({"src/tag/index.ts"(){"use strict";var e,t,s,i;Y(),Re(),G(),J(),Qn=(i=class extends z{constructor(n,l,o,u,a){super(void 0,u,a);R(this,e);R(this,t);R(this,s);this.insertAt(l),E(this,e,o),E(this,t,n)}get closing(){return b(this,e)}toString(n){return`<${b(this,e)?"/":""}${b(this,t)}${super.toString(n)}${this.selfClosing?"/":""}>`}text(n=""){const{closing:l}=this;return`<${l&&!n?"/":""}${b(this,t)}${l?"":super.text()}${n}>`}getAttribute(n){return n==="padding"?b(this,t).length+(b(this,e)?2:1):super.getAttribute(n)}findMatchingTag(){return ut(b(this,s),()=>{const{type:n,name:l,parentNode:o,closing:u,selfClosing:a}=this;let d=!1,c=!1;if(n==="html"){const{html:[,_,T]}=this.getAttribute("config");d=T.includes(l),c=_.includes(l)}if(d||c&&a)return this;if(!o)return;const{childNodes:f}=o,g=f.indexOf(this),y=u?f.slice(0,g).reverse():f.slice(g+1),$=[this],{rev:k}=be;for(const _ of y)if(!(!_.is(n)||n==="html"&&(_.name!==l||c&&_.selfClosing)))if(b(_,e)===u){if(n==="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])},n=>{E(this,s,n),n[1]&&n[1]!==this&&E(n[1],s,[be.rev,this])})}print(){return super.print({pre:`<${b(this,e)?"/":""}${b(this,t)}`,post:`${this.selfClosing?"/":""}>`})}json(n,l=this.getAbsoluteIndex()){{const o=super.json(void 0,l);return o.closing=b(this,e),o}}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i)}}),Jr,ci,Xr,Qe,Du=I({"src/tag/tvar.ts"(){"use strict";pt(),Ma(),gt(),Jr=[Ye()],Qe=class extends(Xr=Qn){get type(){return"tvar"}constructor(e,t,s,i,r){const n=new Ue(t,"tvar-name",i,r);super(e,n,s,i,r)}},ci=ae(Xr),Qe=re(ci,0,"TvarToken",Jr,Qe),ne(ci,1,Qe)}}),za,Gu=I({"src/tagPair/translate.ts"(){"use strict";var e,Ha,s;J(),Vn(),gt(),Du(),za=(s=class extends lt{constructor(r,n,l,o=[]){const u=new Ue(r,"translate-attr",l,o);n=n==null?void 0:n.replace(/<tvar(\|[^>]+)>([\s\S]*?)<\/>/gu,(d,c,f)=>(new Qe("tvar",c,!1,l,o),new Qe("","",!0,l,o),`\0${o.length-2}n${f}\0${o.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 Qe(c,f,!1,l,o),new Qe($,k,!0,l,o),`\0${o.length-2}n${y}\0${o.length}n`));const a=new z(n,l,o);a.type="translate-inner";super("translate",u,a,"translate",l,o);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,Ha).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,Ha=function(){return this.firstChild.toString()===" nowrap"},s)}}),Kr,hi,Yr,Kt,Vu=I({"src/tagPair/include.ts"(){"use strict";Y(),ve(),pt(),G(),Vn(),Kr=[Ye(!1)],Kt=class extends(Yr=lt){get type(){return"include"}constructor(e,t="",s,i,r,n){super(e,t,s!=null?s:"",s===void 0||i!=null?i:"",r,n)}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){{const t=[],{firstChild:s,closed:i,name:r}=this,n=new ge(this,e),l=["no-ignored","unclosed-comment"],{lintConfig:o}=N,{computeEditInfo:u}=o,a=l.map(d=>o.getSeverity(d,"include"));if(a[0]&&s.data.trim()){const d=Q(s,n,l[0],"useless-attribute",a[0]);u&&(d.suggestions=[ee(d)]),t.push(d)}if(a[1]&&!i){const d=Z(this,n,l[1],N.msg("unclosed",`<${r}>`),a[1]);u&&(d.suggestions=[Xe(d.endIndex,`</${r}>`)]),t.push(d)}return t}}},hi=ae(Yr),Kt=re(hi,0,"IncludeToken",Kr,Kt),ne(hi,1,Kt)}}),Hs,Jn=I({"mixin/attributesParent.ts"(){"use strict";Hs=(e=0)=>t=>{var s,yn;{class r extends t{constructor(){super(...arguments);R(this,s)}hasAttr(o){return j(this,s,yn).call(this).hasAttr(o)}getAttr(o){return j(this,s,yn).call(this).getAttr(o)}}return s=new WeakSet,yn=function(){return this.childNodes[e]},r}}}}),he,gi,pi,Ut,ws,fi,Mt,mi,xi,vi,Ss,bi,yi,wi,Pe,Xn,Kn,Yn,Da,Ga=I({"util/sharable.ts"(){"use strict";he=new Set(["align"]),gi=new Set(["cite"]),pi=new Set(["cite","datetime"]),Ut=new Set(["width"]),ws=new Set(["axis","align","bgcolor","height","width","valign"]),fi=new Set([...ws,"abbr","headers","scope","rowspan","colspan"]),Mt=new Set(["type"]),mi=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),xi=new Set(["clear"]),vi=new Set(["bgcolor","align","valign"]),Ss=new Set(["qid","forcemathmode","type","display"]),bi=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),yi=new Set(["weight"]),wi=new Set(["width","height","zoom","latitude","longitude","align","mapstyle","lang","alt","text"]),Pe=new Set,Xn=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"]),Kn={div:he,h1:he,h2:he,h3:he,h4:he,h5:he,h6:he,blockquote:gi,q:gi,p:he,br:xi,pre:Ut,ins:pi,del:pi,ul:Mt,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...mi,"border"]),caption:he,tr:vi,td:fi,th:fi,font:new Set(["size","color","face"]),hr:Ut,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Mt,poem:he,categorytree:he,combooption:he,math:Pe,chem:Pe,ce:Pe,img:new Set(["alt","src","width","height","loading","srcset"])},Yn={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:Pe,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:yi,choicetemplate:yi,imagemap:Pe,inputbox:Pe,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:Pe,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([...Ss,"chem"]),chem:Ss,ce:Ss,hiero:Pe,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:bi,syntaxhighlight:bi,templatedata:Pe,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:Pe,mapframe:new Set([...wi,"frameless"]),maplink:new Set([...wi,"class"]),rss:new Set(["template","templatename","max","highlight","filter","filterout","reverse","date","item-max-length"]),"page-collection":new Set(["lang","name","description","end-date"])},Da={table:mi,td:new Set([...ws,"scope"]),th:ws,br:xi,caption:he,div:he,hr:Ut,h1:he,h2:he,h3:he,h4:he,h5:he,h6:he,li:Mt,p:he,pre:Ut,tr:vi,ul:Mt}}}),Zr,el,tl,sl,Ls,Qu=I({"src/attribute.ts"(){"use strict";var e,t,s,i,r,Va,wn,o;Y(),me(),Me(),Ga(),ve(),G(),J(),ht(),Zr=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,el=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,tl=new Set(["ext","arg","magic-word","template"]),sl=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),Ls=(o=class extends z{constructor(a,d,c,f="",g,y=[],$=N.getConfig(),k=[]){const _=new qe(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 qe(g,"attr-value",$,k,{});super(void 0,$,k);R(this,r);R(this,e);R(this,t);R(this,s);R(this,i);E(this,e,a),this.append(_,T),E(this,s,f),E(this,i,[...y]),E(this,t,d),this.setAttribute("name",Lt(Ce(c)))}get type(){return b(this,e)}get tag(){return b(this,t)}get balanced(){return!b(this,s)||b(this,i)[0]===b(this,i)[1]}afterBuild(){b(this,s).includes("\0")&&E(this,s,this.buildFromStr(b(this,s),0)),this.parentNode&&E(this,t,this.parentNode.name),j(this,r,Va).call(this),super.afterBuild()}toString(a){const[d="",c=""]=b(this,i);return b(this,s)?super.toString(a,b(this,s)+d)+c:this.firstChild.toString(a)}text(){return b(this,s)?`${super.text(`${b(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var a,d;return b(this,s)?b(this,s).length+((d=(a=b(this,i)[0])==null?void 0:a.length)!=null?d:0):0}lint(a=this.getAbsoluteIndex(),d){var c;{const f=super.lint(a,d),{balanced:g,firstChild:y,lastChild:$,name:k,tag:_}=this,T=new ge(this,a),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=[Xe(S.endIndex,b(this,i)[0])]),f.push(S)}const x=j(this,r,wn).call(this,a,T);return x&&f.push(x),m[1]&&((c=Da[_])!=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(a){return a==="invalid"?j(this,r,wn).call(this):super.getAttribute(a)}print(){const[a="",d=""]=b(this,i);return b(this,s)?super.print({sep:ds(b(this,s))+a,post:d}):super.print()}json(a,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,i=new WeakMap,r=new WeakSet,Va=function(){this.setAttribute("name",Lt(this.firstChild.text()))},wn=function(a,d){const{firstChild:c,lastChild:f,type:g,name:y,tag:$,parentNode:k}=this,_=!f.childNodes.some(({type:w})=>tl.has(w)),T=this.getValue(),p=Yn[$],h=Kn[$],{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"||!Xn.has(y)))||(y==="itemtype"||y==="itemid"||y==="itemref")&&!(k!=null&&k.hasAttr("itemscope"))){if(a===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(a,m)]),A}}}else if(y==="style"&&typeof T=="string"&&Zr.test(T)){if(a===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(a===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(a,m),Oe(A,"0 tabindex","0")]),A}}}else if(typeof T=="string"&&((/^xmlns:[\w:.-]+$/u.test(y)||sl.has(y))&&el.test(T)||_&&(y==="href"||$==="img"&&y==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(T))){if(a===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=Hn($,y),A=String(T).toLowerCase();if(w.length>0&&w.every(C=>C!==A)){if(a===void 0)return!0;{const C=S.getSeverity(x,"value");return C&&Q(f,d,x,"illegal-attribute-value",C)}}}return!1},o)}}),Si,il,nl,Ds,Zn=I({"src/attributes.ts"(){"use strict";var e,t,Fs,i;Y(),me(),ve(),G(),J(),ht(),Qu(),Si=r=>r.slice(0,-1),il=r=>`${Si(r)}-dirty`,nl=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch{return/[^\W_]/u}})(),Ds=(i=class extends z{constructor(n,l,o,u,a=[]){super(void 0,u,a,{});R(this,t);R(this,e);if(E(this,e,l),this.setAttribute("name",o),n){const d=/([^\s/](?:(?!\0\d+~\x7F)[^\s/=])*)(?:((?:\s(?:\s|\0\d+[cn]\x7F)*)?(?:=|\0\d+~\x7F)(?:\s|\0\d+[cn]\x7F)*)(?:(["'])([\s\S]*?)(\3|$)|(\S*)))?/gu;let c="",f=d.exec(n),g=0;const y=(()=>{c&&(super.insertAt(new qe(c,il(l),u,a,{})),c="")});for(;f;){const{index:$,0:k,1:_,2:T,3:p,4:h,5:m,6:x}=f;if(c+=n.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 Ls(Si(l),o,_,T,S,v,u,a);y(),super.insertAt(w)}else c+=k;({lastIndex:g}=d),f=d.exec(n)}c+=n.slice(g),y()}}get type(){return b(this,e)}afterBuild(){const{parentNode:n}=this;n!=null&&n.is("td")&&this.setAttribute("name",n.subtype),super.afterBuild()}getAttrTokens(n){return this.childNodes.filter(l=>l instanceof Ls&&(!n||l.name===Lt(n)))}hasAttr(n){return this.getAttrTokens(n).length>0}getAttrToken(n){{const l=this.getAttrTokens(n);return l[l.length-1]}}getAttr(n){var l;return(l=this.getAttrToken(n))==null?void 0:l.getValue()}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),{parentNode:u,childNodes:a}=this,d=new Map,c=new Set,f=new ge(this,n),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,Fs).call(this)){const p=Z(this,f,g[0],"attributes-of-closing-tag",_[0]);if($){const h=u.getAbsoluteIndex();p.suggestions=[ee(p),Wn(h)]}o.push(p)}for(const p of a)if(p instanceof Ls){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=_[nl.test(h)?1:2];if(h&&m){const x=Q(p,f,g[0],"invalid-attribute",m);$&&(x.suggestions=[ee(x,0," ")]),o.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(o,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 o}}getAttribute(n){return n==="invalid"?j(this,t,Fs).call(this):super.getAttribute(n)}print(){return this.toString()?`<span class="wpb-${this.type}${j(this,t,Fs).call(this)?" wpb-invalid":""}">${this.childNodes.map(n=>n.print(n instanceof qe?{class:n.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,Fs=function(){const{parentNode:n}=this;return(n==null?void 0:n.type)==="html"&&n.closing&&this.text().trim()!==""},i)}}),Qa={};le(Qa,{PreToken:()=>Ja});var Ja,Ju=I({"src/pre.ts"(){"use strict";Me(),J(),Rt(),Ja=class extends z{get type(){return"ext-inner"}constructor(e,t,s=[]){if(e){const i=/<nowiki>/giu,r=/<\/nowiki>/giu,{length:n}=i.source;let l=i.exec(e);l&&(r.lastIndex=l.index+n);let o=r.exec(e),u=0,a="";for(;l&&o;)new je(l[0],t,s,!0),new je(o[0],t,s,!0),a+=`${e.slice(u,l.index)}\0${s.length-1}n${e.slice(l.index+n,o.index)}\0${s.length}n`,u=o.index+n+1,i.lastIndex=u,l=i.exec(e),l&&(r.lastIndex=l.index+n),o=r.exec(e);e=a+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)}}}}),Gs,er=I({"src/multiLine/index.ts"(){"use strict";J(),Gs=class extends z{get type(){return"ext-inner"}toString(e){return super.toString(e,`
|
|
1
|
+
"use strict";(()=>{var Fu=Object.defineProperty;var xr=e=>{throw TypeError(e)};var Eu=(e,t,i)=>t in e?Fu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var ju=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Fe=(e,t,i)=>Eu(e,typeof t!="symbol"?t+"":t,i),ts=(e,t,i)=>t.has(e)||xr("Cannot "+i);var b=(e,t,i)=>(ts(e,t,"read from private field"),i?i.call(e):t.get(e)),P=(e,t,i)=>t.has(e)?xr("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 vr=(e,t,i,n)=>({set _(r){F(e,t,r,i)},get _(){return b(e,t,n)}});var Bd=ju((Wd,Lu)=>{var Na=Object.create,pt=Object.defineProperty,La=Object.getOwnPropertyDescriptor,Wn=Object.getOwnPropertyNames,Ru=Object.getPrototypeOf,Pu=Object.prototype.hasOwnProperty,Fa=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Bt=e=>{throw TypeError(e)},Ea=(e,t,i)=>t in e?pt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,br=(e,t)=>pt(e,"name",{value:t,configurable:!0}),I=(e,t)=>function(){return e&&(t=(0,e[Wn(e)[0]])(e=0)),t},Un=(e,t)=>function(){return t||(0,e[Wn(e)[0]])((t={exports:{}}).exports,t),t.exports},oe=(e,t)=>{for(var i in t)pt(e,i,{get:t[i],enumerable:!0})},ja=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Wn(t))!Pu.call(e,r)&&r!==i&&pt(e,r,{get:()=>t[r],enumerable:!(n=La(t,r))||n.enumerable});return e},Ou=(e,t,i)=>(i=e!=null?Na(Ru(e)):{},ja(t||!e||!e.__esModule?pt(i,"default",{value:e,enumerable:!0}):i,e)),ie=e=>ja(pt({},"__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"],Kt=e=>e!==void 0&&typeof e!="function"?Bt("Function expected"):e,Bu=(e,t,i,n,r)=>({kind:Ra[e],name:t,metadata:n,addInitializer:s=>i._?Bt("Already initialized"):r.push(Kt(s||null))}),Mn=(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,o,u,a,d,c=t&7,m=!!(t&8),f=!!(t&16),y=c>3?e.length+1:c?m?1:2:0,S=Ra[c+5],k=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 Ce(this,s,h)}},i));c?f&&c<4&&br(s,(c>2?"set ":c>1?"get ":"")+i):br(r,i);for(var g=n.length-1;g>=0;g--)a=Bu(c,i,u={},e[3],_),c&&(a.static=m,a.private=f,d=a.access={has:f?h=>Wu(r,h):h=>i in h},c^3&&(d.get=f?h=>(c^1?xe:bn)(h,r,c^4?s:T.get):h=>h[i]),c>2&&(d.set=f?(h,x)=>Ce(h,r,x,c^4?s:T.set):(h,x)=>h[i]=x)),o=(0,n[g])(c?c<4?f?s:T[S]:c>4?void 0:{get:T.get,set:T.set}:r,a),u._=1,c^4||o===void 0?Kt(o)&&(c>4?k.unshift(o):c?f?s=o:T[S]=o:r=o):typeof o!="object"||o===null?Bt("Object expected"):(Kt(l=o.get)&&(T.get=l),Kt(l=o.set)&&(T.set=l),Kt(l=o.init)&&k.unshift(l));return c||Mn(e,r),T&&pt(r,i,T),f?c^4?s:T:r},qu=(e,t,i)=>Ea(e,typeof t!="symbol"?t+"":t,i),zn=(e,t,i)=>t.has(e)||Bt("Cannot "+i),Wu=(e,t)=>Object(t)!==t?Bt('Cannot use the "in" operator on this value'):e.has(t),xe=(e,t,i)=>(zn(e,t,"read from private field"),i?i.call(e):t.get(e)),Je=(e,t,i)=>t.has(e)?Bt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,i),Ce=(e,t,i,n)=>(zn(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i),bn=(e,t,i)=>(zn(e,t,"access private method"),i),Uu=(e,t,i,n)=>({set _(r){Ce(e,t,r,i)},get _(){return xe(e,t,n)}}),Pa,gi,Hn=I({"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})(),gi=(()=>{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 Re(e,t,i){return i===1?e.replace(/\0(\d+)g\x7F/gu,(n,r)=>Re(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,Et,jt,Rt,wt,pi,Ie,ft,yr,wr,fi,Oa,Sr,Ar,mi,Pt,ve=I({"util/string.ts"(){"use strict";Ye=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,is=String.raw`[^[\]<>"\0-\x1F\x7F${Ye}\uFFFD]`,Et=String.raw`(?:\[[\da-f:.]+\]|${is})`,jt=String.raw`(?:${is}|\0\d+[cn!~]\x7F)*`,Rt=e=>e.trim().toLowerCase(),wt=(e,t)=>i=>i.replace(e,t),pi=wt(/[\0\x7F]|\r$/gmu,""),Ie=wt(/\0\d+[cn]\x7F/gu,""),ft=(e,t="")=>e.map(i=>typeof i=="string"?i:i.text()).join(t),yr={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},wr=wt(/&(?:#(\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)):yr[i.toLowerCase()]),fi=e=>wr(e),Oa=wt(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),Sr={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},Ar=(e=/[&<>"{}[\]|]/gu)=>wt(e,t=>`&${Sr[t]};`),mi=Ar(/[&<>]/gu),Pt=(e,t={})=>{const{pre:i="",post:n="",sep:r=""}=t;return i+e.map(s=>s.print()).join(r)+n}}}),Mu=Un({"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}}}),zu=Un({"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,Ba,yn,De=I({"util/constants.ts"(){"use strict";ke=11,Ba=Mu(),yn=zu()}});function ht(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 xi,qa,kr,Wa,et=I({"../common/dist/index.mjs"(){"use strict";xi=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25")),qa=e=>Math.round(e*255).toString(16).padStart(2,"0"),kr=(()=>{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")}})(),Wa=(e,t=!0)=>{const i=[],n=kr[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}}}),pe,be=I({"lib/rect.ts"(){"use strict";var e,t,i,n,wn,s;pe=(s=class{constructor(l,o){P(this,n);P(this,e);P(this,t);P(this,i);F(this,e,l),F(this,t,o)}get start(){return b(this,t)}get top(){return j(this,n,wn).call(this).top}get left(){return j(this,n,wn).call(this).left}},e=new WeakMap,t=new WeakMap,i=new WeakMap,n=new WeakSet,wn=function(){var l;return(l=b(this,i))!=null||F(this,i,b(this,e).getRootNode().posFromIndex(b(this,t))),b(this,i)},s)}}),$r,_r,ci,vi,ss,Q,Y,We,Di,ee,Dn,Ze,Gn,Vn,Qn,bi,Ot,Jn,gt,Xn,X=I({"util/lint.ts"(){"use strict";et(),Oe(),be(),D(),$r=new Set(["tr","td","th","caption"]),_r=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")&&_r.has(t.name)||t.is("html")&&$r.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},vi=(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:o,left:u}=i instanceof pe?i:new pe(t,l),{offsetHeight:a,offsetWidth:d}=t,{startIndex:c,startLine:m,startCol:f}=e(t,l,o,u),{line:y,character:S}=vi(m,f,a,d);return{rule:n,message:N.msg(r),severity:s,startIndex:c,endIndex:c+t.toString().length,startLine:m,endLine:y,startCol:f,endCol:S}},Q=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})),We=(e,t,i,n=0)=>({desc:N.msg(t),range:[e.startIndex+n,e.endIndex],text:i}),Di=(e,t,i)=>({desc:N.msg(t),range:[e,e],text:i}),ee=(e,t=0,i="")=>typeof e=="number"?{desc:N.msg("remove"),range:[e,e+t],text:i}:We(e,"remove",i,t),Dn=(e,t)=>We(e,"decode",xi(t.text().replace(/%(?=21|3[ce]|5[bd]|7[b-d])/giu,"%25"))),Ze=(e,t,i=0)=>({desc:N.msg("close"),range:[e+i,e],text:t}),Gn=e=>({desc:N.msg("open"),range:[e+1,e+2],text:""}),Vn=(e,t)=>We(e,"comment",`<!--${t}-->`),Qn=(e,t)=>We(e,"uppercase",t.toUpperCase()),bi=(e,t=0)=>({desc:N.msg("whitespace"),range:[e,e+t],text:" "}),Ot=(e,t,i=1)=>({desc:N.msg("escape"),range:[e,e+i],text:t.repeat(i)}),Jn=(e,t)=>({desc:N.msg("escape"),range:[e,e+t.length],text:t.replace(/\|/gu,"|")}),gt=(e,t,i,n)=>{if(e&&(n||N.viewOnly&&e[0]===we.rev))return e[1];const r=t();return(n||N.viewOnly)&&i([we.rev,r]),r},Xn=(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"]:[]}}),Tr,Kn,Ua=I({"parser/selector.ts"(){"use strict";Tr=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 e?t=>t===e:()=>!0},Kn=(e,t,i)=>{const n=e.split(",").map(r=>Tr(r.trim()));return(({type:r,name:s})=>n.some(l=>l(r,s)))}}}),Hu=Un({"../node_modules/binary-search/index.js"(e,t){t.exports=function(i,n,r,s,l){var o,u;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(o=s+(l-s>>>1),u=+r(i[o],n,o,i),u<0)s=o+1;else if(u>0)l=o-1;else return o;return~s}}}),Cr,Ma,Du=I({"util/search.ts"(){"use strict";Cr=Ou(Hu()),Ma=(e,t,i)=>{const n=(0,Cr.default)(e,t,i);return n<0?~n:n}}}),Gi,Yn=I({"mixin/cached.ts"(){"use strict";X(),Gi=(e=!0)=>t=>{const i=new WeakMap;return function(...n){return gt(i.get(this),()=>t.apply(this,n),r=>{i.set(this,r)},e)}}}}),za,Gu=I({"mixin/nodeLike.ts"(){"use strict";za=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}}}),Ir,Nr,ki,Ut,Mt,$i,zt,Ht,Dt,at,Ha=I({"lib/node.ts"(){"use strict";Du(),X(),Oe(),Yn(),Gu(),D(),Nr=[za],Ir=[Gi(!1)],at=class{constructor(){ne(Dt,5,this),qu(this,"childNodes",[]),Je(this,ki),Je(this,Ut),Je(this,Mt),Je(this,$i),Je(this,zt),Je(this,Ht,{})}get parentNode(){return xe(this,ki)}get nextSibling(){return xe(this,Ut)}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":Ce(this,ki,t),t||(Ce(this,Ut,void 0),Ce(this,Mt,void 0));break;case"nextSibling":Ce(this,Ut,t);break;case"previousSibling":Ce(this,Mt,t);break;case"aIndex":N.viewOnly&&Ce(this,zt,[we.rev,t]);break;default:this[e]=t}}getRootNode(){return gt(xe(this,$i),()=>{var e,t;return(t=(e=this.parentNode)==null?void 0:e.getRootNode())!=null?t:this},e=>{const[,t]=e;t.type==="root"&&Ce(this,$i,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=Ma(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 gt(xe(this,Ht)[e],()=>{const{childNodes:t}=this,i=e+(e<0?t.length:0);let n=this.getAttribute("padding");for(let r=0;r<i;r++)N.viewOnly&&(xe(this,Ht)[r]=[we.rev,n]),n+=t[r].toString().length+this.getGaps(r);return n},t=>{xe(this,Ht)[e]=t})}getAbsoluteIndex(){return gt(xe(this,zt),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{Ce(this,zt,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){const i=!t&&!!this[e];Object.defineProperty(this,e,{enumerable:i,configurable:!0})}lspError(e){throw new Error(`${e} method is only available in the LSP version!`)}},Dt=ae(null),ki=new WeakMap,Ut=new WeakMap,Mt=new WeakMap,$i=new WeakMap,zt=new WeakMap,Ht=new WeakMap,re(Dt,1,"getLines",Ir,at),at=re(Dt,0,"AstNode",Nr,at),ne(Dt,1,at)}}),Da,Vu=I({"mixin/elementLike.ts"(){"use strict";Ua(),Da=e=>{var t,Sn;{class n extends e{constructor(){super(...arguments);P(this,t)}getElementBy(l){const o=[...this.childNodes].reverse();for(;o.length>0;){const u=o.pop(),{type:a,childNodes:d}=u;if(a!=="text"){if(l(u))return u;for(let c=d.length-1;c>=0;c--)o.push(d[c])}}}querySelector(l){return this.getElementBy(j(this,t,Sn).call(this,l))}getElementsBy(l){const o=[...this.childNodes].reverse(),u=[];for(;o.length>0;){const a=o.pop(),{type:d,childNodes:c}=a;if(d!=="text"){l(a)&&u.push(a);for(let m=c.length-1;m>=0;m--)o.push(c[m])}}return u}querySelectorAll(l){return this.getElementsBy(j(this,t,Sn).call(this,l))}escape(){for(const l of this.childNodes)l.escape()}}return t=new WeakSet,Sn=function(l){return Kn(l,this)},n}}}}),Lr,ns,Fr,Yt,Qu=I({"lib/element.ts"(){"use strict";ve(),Oe(),Ua(),Ha(),Vu(),Lr=[Da],Yt=class extends(Fr=at){get length(){return this.childNodes.length}text(e){return ft(this.childNodes,e)}normalize(){const e=this.getChildNodes(),t=i=>{var n,r;e.splice(i,1),(n=e[i-1])==null||n.setAttribute("nextSibling",e[i]),(r=e[i])==null||r.setAttribute("previousSibling",e[i-1])};for(let i=e.length-1;i>=0;i--){const{type:n,data:r}=e[i];n!=="text"||e.length===1||this.getGaps(i-(i&&1))||r===""&&t(i)}this.setAttribute("childNodes",e)}removeAt(e){return wi(this,e,1)[0]}insertAt(e,t=this.length){return wi(this,t,0,[e]),e}closest(e){const t=Kn(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 o=s[l],{nextSibling:u}=o,a=o.toString(),d=a.length;if(o.setAttribute("aIndex",n),n+=d,n>e||n===e&&d>0&&(!u||u.type==="text"||o.type!=="text"&&(a.trim()||!u.toString().trim()))){i=o,n-=d,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":""}">`)+Pt(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(Fr),Yt=re(ns,0,"AstElement",Lr,Yt),ne(ns,1,Yt)}}),Si,Vi=I({"mixin/gapped.ts"(){"use strict";Si=(e=1)=>t=>{class i extends t{getGaps(){return e}}return i}}}),Te,Ne=I({"mixin/noEscape.ts"(){"use strict";Te=e=>{{class t extends e{escape(){}}return t}}}}),Er,Ga,Ju=I({"src/parameter.ts"(){"use strict";ve(),X(),D(),J(),Er=new RegExp(`https?://${Et}${jt}$`,"iu"),Ga=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}=N,l=s.getSeverity(r);if(l){const{firstChild:o}=this,u=(i=Er.exec(o.text()))==null?void 0:i[0];try{if(u&&new URL(u).search){const a=Q(o,{start:e},r,"unescaped-query",l);a.startIndex=a.endIndex,a.startLine=a.endLine,a.startCol=a.endCol,a.endIndex++,a.endCol++,(s.computeEditInfo||s.fix)&&(a.fix=Ot(a.startIndex,"{{=}}")),n.push(a)}}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,mt=I({"src/atom.ts"(){"use strict";var e,t;J(),Me=(t=class extends z{constructor(n,r,s,l,o){super(n,s,l,o);P(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,xt=I({"src/syntax.ts"(){"use strict";var e,t;J(),He=(t=class extends z{constructor(n,r,s,l,o){super(n,s,l,o);P(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)}}),Va={};oe(Va,{TranscludeToken:()=>ot,getCanonicalName:()=>An});var An,jr,rs,Rr,ot,Qa=I({"src/transclude.ts"(){"use strict";var e,t,i,n,r,s,Zt,Ja,u;ve(),X(),Oe(),be(),Vi(),Ne(),D(),J(),Ju(),mt(),xt(),An=(a,d)=>{const c=a.toLowerCase(),[m,f]=d,y=Array.isArray(f),S=y?f.includes(a):Object.prototype.hasOwnProperty.call(f,a);return[c,y,S,!y&&S?f[a]:Object.prototype.hasOwnProperty.call(m,c)&&m[c]]},jr=[Te,Si()],ot=(u=class extends(Rr=z){constructor(d,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(d);S&&(y=Number(S[1]),d=d.replace(`\0${y}h`,f[y].toString().replace(/^\n/u,"")));super(void 0,m,f,{});P(this,s);Fe(this,"modifier","");P(this,e,"template");P(this,t,":");P(this,i,!1);P(this,n,new Map);P(this,r);const{parserFunction:k,variable:_,functionHook:T}=m,g=(w=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(d))==null?void 0:w[0];if(g)this.setAttribute("modifier",g),d=d.slice(g.length);else if(d.includes(":")){const[C,...L]=d.split(":"),[q]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((A=L[0])!=null?A:"");this.setModifier(`${C}:${q}`)&&(d=L.join(":").slice(q.length))}const h=d.search(/[::]/u),x=d[h]===":",p=h!==-1;if(p||c.length===0&&!b(this,i)){const C=p?d.slice(0,h):d,L=p&&d.slice(h+1),q=Ie(C),B=p?q.slice(q.search(/\S/u))+(x?":":""):q.trim(),[O,W,E,R]=An(B,k),U=W&&E||!("functionHook"in m)||T.includes(R),M=W&&E||_.includes(R);if(p?R&&U:M){this.setAttribute("name",R||O.replace(/^#|:$/u,"")),F(this,e,"magic-word"),x&&F(this,t,":");const se=new He(C,"magic-word-name",m,f);if(super.insertAt(se),L!==!1&&c.unshift([L]),this.name==="invoke")for(let H=0;H<2;H++){const V=c.shift();if(!V)break;const Z=new Me(V.join("="),`invoke-${H?"function":"module"}`,m,f);super.insertAt(Z)}}}if(this.type==="template"){const C=Ie(d).trim();if(!this.normalizeTitle(C,10,{halfParsed:!0,temporary:!0}).valid)throw f.pop(),new SyntaxError("Invalid template name");const L=new Me(d,"template-name",m,f,{});super.insertAt(L)}typeof y=="number"&&(f[y]=void 0);const $=this.isTemplate();let v=1;for(let C=0;C<c.length;C++){const L=c[C];$||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 Ga(...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,Zt).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,m]}=this.getAttribute("config"),f=Ie(d).trim();if(d&&!f.endsWith(":"))return!1;const y=f.slice(0,-1).toLowerCase(),S=c.includes(y),k=m.includes(y);return(b(this,i)?S:k||!d)||(we.running||this.length>1)&&(S||k||!d)?(this.setAttribute("modifier",d),F(this,i,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"&&(F(this,r,j(this,s,Zt).call(this)),this.setAttribute("name",b(this,r).title))}toString(d){const{childNodes:c,length:m,firstChild:f,modifier:y,type:S}=this;return`{{${y}${S==="magic-word"?f.toString(d)+(m===1?"":b(this,t))+c.slice(1).map(k=>k.toString(d)).join("|"):super.toString(d,"|")}}}`}text(){const{childNodes:d,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))+ft(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,s,Zt).call(this).valid);default:return super.getAttribute(d)}}lint(d=this.getAbsoluteIndex(),c){{const m=super.lint(d,c);if(!this.isTemplate())return m;const{type:f,childNodes:y,length:S}=this,k=new pe(this,d),{lintConfig:_}=N,{computeEditInfo:T}=_,g=f==="magic-word";let h="no-ignored",x=_.getSeverity(h,"fragment");if(g&&!j(this,s,Zt).call(this).valid)h="invalid-invoke",x=_.getSeverity(h,"name"),x&&m.push(Q(y[1],k,h,"illegal-module",x));else if(x){const p=y[g?1:0],$=p.childNodes.findIndex(w=>w.type==="text"&&fi(w.data).includes("#")),v=p.childNodes[$];if(v){const w=Q(p,k,h,"useless-fragment",x);T&&(w.suggestions=[ee(w,p.getRelativeIndex($)+v.data.indexOf("#"))]),m.push(w)}}if(h="invalid-invoke",x=_.getSeverity(h,"function"),x&&g&&S===2)return m.push(Y(this,k,h,"missing-function",x)),m;if(h="no-duplicate",x=_.getSeverity(h,"parameter"),x){const p=this.getDuplicatedArgs().filter(([,v])=>!v[0].querySelector("ext")),$="duplicate-parameter";for(const[,v]of p)Array.prototype.push.apply(m,v.map(w=>{const A=Q(w,k,h,$,x);return T&&(A.suggestions=[ee(A,-1)]),A}))}return m}}insertAt(d,c=this.length){return super.insertAt(d,c),d.anon?j(this,s,Ja).call(this,d):d.name&&this.getArgs(d.name,!1,!1).add(d),d}getAllArgs(){return this.childNodes.filter(es("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:d})=>d)}getArgs(d,c,m=!0){const f=String(d).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:d}])=>d>1).map(([d,c])=>[d,[...c]])}getPossibleValues(){const{type:d,name:c,childNodes:m}=this;if(d==="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),k=S[S.length-1];y=[...S.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=m.slice(f,f+2).map(({lastChild:S})=>S));for(let S=0;S<y.length;){const{length:k,0:_}=y[S].childNodes.filter(T=>T.text().trim());if(k===0)y.splice(S,1);else if(k>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:d,length:c,firstChild:m,modifier:f,type:y}=this;return`<span class="wpb-${y}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${y==="magic-word"?mi(f)+m.print()+(c===1?"":b(this,t))+Pt(d.slice(1),{sep:"|"}):(f?`<span class="wpb-magic-word">${mi(f)}</span>`:"")+Pt(d,{sep:"|"})}}}</span>`}},e=new WeakMap,t=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakMap,s=new WeakSet,Zt=function(){const d=this.type==="template";return this.normalizeTitle((d?"":"Module:")+this.childNodes[d?0:1].text(),10,{temporary:!0,...!d&&{page:""}})},Ja=function(d){const c=this.getAnonArgs(),m=typeof d!="number";for(let f=m?c.indexOf(d):d-1;f<c.length;f++){const y=c[f],{name:S}=y,k=String(f+1);(S!==k||y===d)&&(y.setAttribute("name",k),this.getArgs(k,!1,!1).add(y))}},u),rs=ae(Rr),ot=re(rs,0,"TranscludeToken",jr,ot),ne(rs,1,ot)}}),_i,ls,Pr,Or,Br,qr,as,Wr,kn,Xu=I({"lib/text.ts"(){"use strict";var e,$n,i;ve(),X(),Oe(),D(),Ha(),_i=String.raw`[${Ye}\t]*`,ls=String.raw`<(?:/[^\S\n]*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|\n={2,}`,Pr=new RegExp(String.raw`${ls}|https?[:/]/+|(?:rfc|pmid)(?=[-::]?${_i}\d)|isbn(?=[-::]?${_i}(?:\d(?:${_i}|-)){6})`,"giu"),Or=new RegExp(ls,"giu"),Br=new Set(["attr-value","ext-link-text","link-text"]),qr={"[":/[[\]]/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"]),Wr=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch{return/\w/u}})(),kn=(i=class extends at{constructor(s){super();P(this,e);Fe(this,"data","");this.data=s}get type(){return"text"}toString(s){var l;return s&&!((l=this.parentNode)!=null&&l.getAttribute("built"))?Ie(this.data):this.data}text(){return this.data}lint(s=this.getAbsoluteIndex(),l){var o,u,a;{if(l===!1)return[];const{data:d,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()&&!Br.has(y)?Pr:Or),d.search(l)===-1)return[];l.lastIndex=0;const k=[],_=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:$,variants:v}=h.getAttribute("config"),{top:w,left:A}=h.posFromIndex(s),{lintConfig:C}=N,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,...$[0],...$[1],...$[2],...q,...C.getSeverity("tag-like","disallowed")?as:[]]);for(let O=l.exec(d);O;O=l.exec(d)){const[,W,E]=O;let{index:R,0:U}=O;if(E&&E!=="]"){const{length:me}=E;R+=me,U=U.slice(me)}else U.startsWith(`
|
|
3
|
+
==`)&&(R++,U=U.slice(1));U=U.toLowerCase();const[M]=U,se=M==="r"||M==="p"||M==="i",H=M==="{",V=M==="}",Z=M==="[",de=M==="]";let{length:ue}=U;if(M==="<"&&!B.has(W.toLowerCase())||Z&&y==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(d.slice(R+1))||m!=null&&m.is("ext")&&T==="nowiki"&&((o=m.innerText)!=null&&o.includes("]"))))continue;de&&(R||ue>1)&&l.lastIndex--;let ce=s+R,le=ce+ue,he,ye,G,K;const fe=x[le],Se=x[ce-1],Le=H||Z,Ve=H&&Se==="-"&&v.length>0,$e=V&&fe==="-"&&v.length>0,yt=Z&&_==="free-ext-link"&&!d.slice(R+1).trim()||de&&g==="free-ext-link"&&!d.slice(0,R).includes("]");if(se)he="lonely-http",U=U.toUpperCase(),ye=C.getSeverity(he,U);else if(M==="<"){he="tag-like";let me;/^<\/?\s/u.test(U)||!/[\s/>]/u.test(fe!=null?fe:"")?me="invalid":q.has(W)?me=W:as.has(W)&&!p.includes(W)&&(me="disallowed"),ye=C.getSeverity(he,me)}else if(M==="=")he="syntax-like",ye=C.getSeverity(he,"heading");else if(Ve||$e)he="lonely-bracket",ye=C.getSeverity(he,"converter"),Ve&&R>0?(U="-{",R--,ce--,ue=2):$e&&R<d.length-1&&(U="}-",le++,ue=2);else if(yt)he="lonely-bracket",ye=C.getSeverity(he,"extLink");else if(Le||V||de)if(he="lonely-bracket",ue>1||H&&fe===M||V&&Se===M)ye=C.getSeverity(he,"double");else{if(!Z||y!=="ext-link-text"){const me=qr[M],Ee=Le?d.slice(R+1):d.slice(0,R);if(H&&((u=me.exec(Ee))==null?void 0:u[0])==="}"||V&&((a=me.exec(Ee))==null?void 0:a[0])==="{")continue;if(!Ee.includes(M)){const ze=Le?"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}}ye=C.getSeverity(he,"single")}else he="lonely-http",ye=C.getSeverity(he);if(!ye)continue;const te=this.posFromIndex(R),{line:st,character:Wt}=vi(w,A,te.top+1,te.left);if(M==="="){const me=d.indexOf(`
|
|
4
|
+
`,R);let Ee=m,ze;if(me===-1){let Be=0;for(;Ee&&!(Ee.type==="text"&&(Be=Ee.data.indexOf(`
|
|
5
|
+
`),Be!==-1));)Ee=Ee.nextSibling;if(!Ee)continue;ze=Ee.data.slice(0,Be)}else ze=d.slice(R+ue,me);if(!/(?:^|[^=])=+\s*(?:\S\s*)?$/u.test(ze))continue;me===-1?(le=Ee.getAbsoluteIndex()+ze.length,{top:G,left:K}=h.posFromIndex(le)):(le+=ze.length,ue+=ze.length)}const nt={rule:he,message:N.msg(M==="="?"header-like":"lonely",se||M==="h"||Ve||$e?U:M),severity:ye,startIndex:ce,endIndex:le,startLine:st,endLine:G!=null?G:st,startCol:Wt,endCol:K!=null?K:Wt+ue};if(C.computeEditInfo)if(M==="<")nt.suggestions=[Ot(ce,"<")];else if(M==="h"&&y!=="link-text"&&Wr.test(Se||""))nt.suggestions=[bi(ce)];else if(Z&&y==="ext-link-text"){const me=c.getAbsoluteIndex()+c.toString().length;nt.suggestions=[Ot(me,"]")]}else if(de&&yt){const me=s-f.toString().length;nt.suggestions=[Di(me,"left-bracket","[")]}else se&&(nt.suggestions=[...O[0]===U?[]:[Qn(nt,U)],...fe===":"||fe===":"?[bi(le,1)]:[]]);k.push(nt)}return k}}replaceData(s){j(this,e,$n).call(this,s)}splitText(s){{const{parentNode:l,data:o}=this;if(!l)throw new Error("The text node to be split has no parent node!");const u=new i(o.slice(s));return wi(l,l.childNodes.indexOf(this)+1,0,[u]),this.setAttribute("data",o.slice(0,s)),u}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}=(Qa(),ie(Va)),o=s.getAttribute("config"),u=s.childNodes.indexOf(this)+1,a=m=>Math.max(this.data.lastIndexOf("=",m),this.data.lastIndexOf("|",m));let d=a();const c=(()=>new l(this.data[d]==="="?"=":"!",[],o));for(;d>=0;d=a(d-1))d<this.data.length-1&&this.splitText(d+1),s.insertAt(we.run(c),u),j(this,e,$n).call(this,this.data.slice(0,d))}}print(){return mi(this.data)}},e=new WeakSet,$n=function(s){this.setAttribute("data",s)},i)}}),tt,vt=I({"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}}}),Ge,it=I({"mixin/padded.ts"(){"use strict";Ge=({length:e})=>t=>{class i extends t{getAttribute(r){return r==="padding"?e:super.getAttribute(r)}}return i}}}),Ur,Mr,os,zr,Xe,Qi=I({"src/link/base.ts"(){"use strict";var e,t,i,n;X(),De(),be(),it(),Ne(),D(),J(),mt(),Ur=r=>r==="redirect-target"||r==="link",Mr=[Te,Ge("[[")],Xe=(n=class extends(zr=z){constructor(s,l,o,u=[],a="|"){super(void 0,o,u,{});P(this,e,!0);P(this,t);P(this,i);if(this.insertAt(new Me(s,"link-target",o,u,{})),l!==void 0){const d=new z(l,o,u,{});d.type="link-text",d.setAttribute("stage",ke-1),this.insertAt(d)}F(this,t,a)}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 o=super.lint(s,l),{childNodes:[u,a],type:d}=this,{encoded:c,fragment:m}=b(this,i),{lintConfig:f}=N,{computeEditInfo:y,fix:S}=f,k=new pe(this,s);let _="unknown-page",T=f.getSeverity(_);if(T&&u.childNodes.some(({type:g})=>g==="template")&&o.push(Q(u,k,_,"template-in-link",T)),_="url-encoding",T=f.getSeverity(_),T&&c){const g=Q(u,k,_,"unnecessary-encoding",T);(y||S)&&(g.fix=Dn(g,u)),o.push(g)}if(_="pipe-like",T=f.getSeverity(_,"link"),T&&(d==="link"||d==="category")){const g=a==null?void 0:a.childNodes.findIndex(x=>x.type==="text"&&x.data.includes("|")),h=a==null?void 0:a.childNodes[g];if(h){const x=Q(a,k,_,"pipe-in-link",T);if(y){const p=x.startIndex+a.getRelativeIndex(g);x.suggestions=[Jn(p,h.data)]}o.push(x)}}if(_="no-ignored",T=f.getSeverity(_,"fragment"),T&&m!==void 0&&!Ur(d)){const g=Q(u,k,_,"useless-fragment",T);if(y||S){const h=u.childNodes.findIndex(p=>p.type==="text"&&p.data.includes("#")),x=u.childNodes[h];x&&(g.fix=ee(g,u.getRelativeIndex(h)+x.data.indexOf("#")))}o.push(g)}return o}}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 o=super.json(void 0,l),{type:u,fragment:a}=this;return a!==void 0&&(u==="link"||u==="redirect-target")&&(o.fragment=a),o}}},e=new WeakMap,t=new WeakMap,i=new WeakMap,n),os=ae(zr),Xe=re(os,0,"LinkBaseToken",Mr,Xe),ne(os,1,Xe)}}),Hr,us,Dr,Ue,bt=I({"src/nowiki/base.ts"(){"use strict";Ne(),J(),Hr=[Te],Ue=class extends(Dr=z){get innerText(){return this.firstChild.data}constructor(e="",t,i){super(e,t,i)}},us=ae(Dr),Ue=re(us,0,"NowikiBaseToken",Hr,Ue),ne(us,1,Ue)}}),Gr,ds,Vr,Pe,qt=I({"src/nowiki/noinclude.ts"(){"use strict";X(),vt(),D(),bt(),Gr=[tt(!1)],Pe=class extends(Vr=Ue){get type(){return"noinclude"}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){{const{lintConfig:t}=N,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:o}=t,u=s[1].length+1,a=r.endsWith("/>")?2:1;return l.startIndex+=u,l.startCol+=u,l.endIndex-=a,l.endCol-=a,o&&(l.suggestions=[ee(l)]),[l]}}return[]}}},ds=ae(Vr),Pe=re(ds,0,"NoincludeToken",Gr,Pe),ne(ds,1,Pe)}}),Xa,Ku=I({"src/link/redirectTarget.ts"(){"use strict";X(),D(),Qi(),qt(),Xa=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 Pe(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}=N,r=n.getSeverity(i,"redirect");if(r&&this.length===2){const s=Q(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}}}}}),Qr,cs,Jr,ei,Yu=I({"src/redirect.ts"(){"use strict";var e,t,i;vt(),Ne(),J(),xt(),Ku(),Qr=[tt(!1,!1),Te],ei=(i=class extends(Jr=z){constructor(r,s,l,o,u,a,d=[]){super(void 0,a,d);P(this,e);P(this,t);F(this,e,r),F(this,t,u),this.append(new He(s,"redirect-syntax",a,d),new Xa(l,o==null?void 0:o.slice(1),a,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 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(Jr),ei=re(cs,0,"RedirectToken",Qr,ei),ne(cs,1,ei)}}),Ka={};oe(Ka,{parseRedirect:()=>Ya});var Ya,Zu=I({"parser/redirect.ts"(){"use strict";D(),Yu(),Ya=(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&&N.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 ei(...n.slice(1),t,i),e):!1}}}),Xr,hs,Kr,ti,ed=I({"src/onlyinclude.ts"(){"use strict";it(),Ne(),J(),Xr=[Te,Ge("<onlyinclude>")],ti=class extends(Kr=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(Kr),ti=re(hs,0,"OnlyincludeToken",Xr,ti),ne(hs,1,ti)}}),Yr,gs,Zr,ut,Zn=I({"src/tagPair/index.ts"(){"use strict";var e,t;Vi(),Ne(),J(),Yr=[Si(),Te],ut=(t=class extends(Zr=z){constructor(n,r,s,l,o,u=[]){super(void 0,o);P(this,e);Fe(this,"closed");Fe(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 a=typeof r=="string"?-1:u.indexOf(r);u.splice(a===-1?1/0:a,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(n){const{selfClosing:r,firstChild:s,lastChild:l}=this,[o,u]=b(this,e);return r?`<${o}${s.toString(n)}/>`:`<${o}${s.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),gs=ae(Zr),ut=re(gs,0,"TagPairToken",Yr,ut),ne(gs,1,ut)}}),er,Za=I({"src/tag/index.ts"(){"use strict";var e,t,i,n;X(),Oe(),J(),D(),er=(n=class extends z{constructor(s,l,o,u,a){super(void 0,u,a);P(this,e);P(this,t);P(this,i);this.insertAt(l),F(this,e,o),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 gt(b(this,i),()=>{const{type:s,name:l,parentNode:o,closing:u,selfClosing:a}=this;let d=!1,c=!1;if(s==="html"){const{html:[,_,T]}=this.getAttribute("config");d=T.includes(l),c=_.includes(l)}if(d||c&&a)return this;if(!o)return;const{childNodes:m}=o,f=m.indexOf(this),y=u?m.slice(0,f).reverse():m.slice(f+1),S=[this],{rev:k}=we;for(const _ of y)if(!(!_.is(s)||s==="html"&&(_.name!==l||c&&_.selfClosing)))if(b(_,e)===u){if(s==="tvar")return;S.push(_)}else{const T=S.pop();if(T===this)return _;N.viewOnly&&(F(T,i,[k,_]),F(_,i,[k,T]))}if(N.viewOnly)for(const _ of S)F(_,i,[k,void 0])},s=>{F(this,i,s),s[1]&&s[1]!==this&&F(s[1],i,[we.rev,this])})}print(){return super.print({pre:`<${b(this,e)?"/":""}${b(this,t)}`,post:`${this.selfClosing?"/":""}>`})}json(s,l=this.getAbsoluteIndex()){{const o=super.json(void 0,l);return o.closing=b(this,e),o}}},e=new WeakMap,t=new WeakMap,i=new WeakMap,n)}}),el,ps,tl,Ke,td=I({"src/tag/tvar.ts"(){"use strict";vt(),Ne(),Za(),xt(),el=[tt(),Te],Ke=class extends(tl=er){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)}},ps=ae(tl),Ke=re(ps,0,"TvarToken",el,Ke),ne(ps,1,Ke)}}),eo,id=I({"src/tagPair/translate.ts"(){"use strict";var e,to,i;J(),Zn(),xt(),td(),eo=(i=class extends ut{constructor(r,s,l,o=[]){const u=new He(r,"translate-attr",l,o);s=s==null?void 0:s.replace(/<tvar(\|[^>]+)>([\s\S]*?)<\/>/gu,(d,c,m)=>(new Ke("tvar",c,!1,l,o),new Ke("","",!0,l,o),`\0${o.length-2}n${m}\0${o.length}n`)).replace(/<(tvar)(\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\3|[^"'\s>]+))?\s*)>([\s\S]*?)<\/(tvar)(\s*)>/giu,(d,c,m,f,y,S,k)=>(new Ke(c,m,!1,l,o),new Ke(S,k,!0,l,o),`\0${o.length-2}n${y}\0${o.length}n`));const a=new z(s,l,o);a.type="translate-inner";super("translate",u,a,"translate",l,o);P(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,to).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,to=function(){return this.firstChild.toString()===" nowrap"},i)}}),il,fs,sl,ii,sd=I({"src/tagPair/include.ts"(){"use strict";X(),be(),vt(),D(),Zn(),il=[tt(!1)],ii=class extends(sl=ut){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 pe(this,e),l=["no-ignored","unclosed-comment"],{lintConfig:o}=N,{computeEditInfo:u}=o,a=l.map(d=>o.getSeverity(d,"include"));if(a[0]&&i.data.trim()){const d=Q(i,s,l[0],"useless-attribute",a[0]);u&&(d.suggestions=[ee(d)]),t.push(d)}if(a[1]&&!n){const d=Y(this,s,l[1],N.msg("unclosed",`<${r}>`),a[1]);u&&(d.suggestions=[Ze(d.endIndex,`</${r}>`)]),t.push(d)}return t}}},fs=ae(sl),ii=re(fs,0,"IncludeToken",il,ii),ne(fs,1,ii)}}),Ji,tr=I({"mixin/attributesParent.ts"(){"use strict";Ji=(e=0)=>t=>{var i,_n;{class r extends t{constructor(){super(...arguments);P(this,i)}hasAttr(o){return j(this,i,_n).call(this).hasAttr(o)}getAttr(o){return j(this,i,_n).call(this).getAttr(o)}}return i=new WeakSet,_n=function(){return this.childNodes[e]},r}}}}),ge,ms,xs,Gt,Ti,vs,Vt,bs,ys,ws,Ci,Ss,As,ks,qe,ir,sr,nr,io,so=I({"util/sharable.ts"(){"use strict";ge=new Set(["align"]),ms=new Set(["cite"]),xs=new Set(["cite","datetime"]),Gt=new Set(["width"]),Ti=new Set(["axis","align","bgcolor","height","width","valign"]),vs=new Set([...Ti,"abbr","headers","scope","rowspan","colspan"]),Vt=new Set(["type"]),bs=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),ys=new Set(["clear"]),ws=new Set(["bgcolor","align","valign"]),Ci=new Set(["qid","forcemathmode","type","display"]),Ss=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),As=new Set(["weight"]),ks=new Set(["width","height","zoom","latitude","longitude","align","mapstyle","lang","alt","text"]),qe=new Set,ir=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"]),sr={div:ge,h1:ge,h2:ge,h3:ge,h4:ge,h5:ge,h6:ge,blockquote:ms,q:ms,p:ge,br:ys,pre:Gt,ins:xs,del:xs,ul:Vt,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...bs,"border"]),caption:ge,tr:ws,td:vs,th:vs,font:new Set(["size","color","face"]),hr:Gt,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Vt,poem:ge,categorytree:ge,combooption:ge,math:qe,chem:qe,ce:qe,img:new Set(["alt","src","width","height","loading","srcset"])},nr={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:qe,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:As,choicetemplate:As,imagemap:qe,inputbox:qe,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:qe,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([...Ci,"chem"]),chem:Ci,ce:Ci,hiero:qe,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:Ss,syntaxhighlight:Ss,templatedata:qe,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:qe,mapframe:new Set([...ks,"frameless"]),maplink:new Set([...ks,"class"]),rss:new Set(["template","templatename","max","highlight","filter","filterout","reverse","date","item-max-length"]),"page-collection":new Set(["lang","name","description","end-date"])},io={table:bs,td:new Set([...Ti,"scope"]),th:Ti,br:ys,caption:ge,div:ge,hr:Gt,h1:ge,h2:ge,h3:ge,h4:ge,h5:ge,h6:ge,li:Vt,p:ge,pre:Gt,tr:ws,ul:Vt}}}),nl,rl,ll,al,Oi,nd=I({"src/attribute.ts"(){"use strict";var e,t,i,n,r,no,Tn,o;X(),ve(),De(),so(),be(),D(),J(),mt(),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"]),Oi=(o=class extends z{constructor(a,d,c,m="",f,y=[],S=N.getConfig(),k=[]){const _=new Me(c,"attr-key",S,k);let T;if(c==="title"||d==="img"&&c==="alt")T=new z(f,S,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 g={...S,excludes:[...S.excludes,"heading","html","table","hr","list"]};T=new z(f,g,k,{}),T.type="attr-value",T.setAttribute("stage",1)}else T=new Me(f,"attr-value",S,k,{});super(void 0,S,k);P(this,r);P(this,e);P(this,t);P(this,i);P(this,n);F(this,e,a),this.append(_,T),F(this,i,m),F(this,n,[...y]),F(this,t,d),this.setAttribute("name",Rt(Ie(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,no).call(this),super.afterBuild()}toString(a){const[d="",c=""]=b(this,n);return b(this,i)?super.toString(a,b(this,i)+d)+c:this.firstChild.toString(a)}text(){return b(this,i)?`${super.text(`${b(this,i).trim()}"`)}"`:this.firstChild.text()}getGaps(){var a,d;return b(this,i)?b(this,i).length+((d=(a=b(this,n)[0])==null?void 0:a.length)!=null?d:0):0}lint(a=this.getAbsoluteIndex(),d){var c;{const m=super.lint(a,d),{balanced:f,firstChild:y,lastChild:S,name:k,tag:_}=this,T=new pe(this,a),g=["unclosed-quote","obsolete-attr"],{lintConfig:h}=N,x=g.map($=>h.getSeverity($,k));if(x[0]&&!f){const $=Q(S,T,g[0],"unclosed-quotes",x[0]);$.startIndex--,$.startCol--,h.computeEditInfo&&($.suggestions=[Ze($.endIndex,b(this,n)[0])]),m.push($)}const p=j(this,r,Tn).call(this,a,T);return p&&m.push(p),x[1]&&((c=io[_])!=null&&c.has(k))&&m.push(Q(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(a){return a==="invalid"?j(this,r,Tn).call(this):super.getAttribute(a)}print(){const[a="",d=""]=b(this,n);return b(this,i)?super.print({sep:mi(b(this,i))+a,post:d}):super.print()}json(a,d=this.getAbsoluteIndex()){{const c=super.json(void 0,d);return c.tag=this.tag,c}}},e=new WeakMap,t=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakSet,no=function(){this.setAttribute("name",Rt(this.firstChild.text()))},Tn=function(a,d){const{firstChild:c,lastChild:m,type:f,name:y,tag:S,parentNode:k}=this,_=!m.childNodes.some(({type:w})=>ll.has(w)),T=this.getValue(),g=nr[S],h=sr[S],{length:x}=this.toString();let p="illegal-attr",$,v;if({lintConfig:$}=N,{computeEditInfo:v}=$,!(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"||!ir.has(y)))||(y==="itemtype"||y==="itemid"||y==="itemref")&&!(k!=null&&k.hasAttr("itemscope"))){if(a===void 0)return!0;{const w=$.getSeverity(p,"unknown");if(w){const A=Q(c,d,p,"illegal-attribute-name",w);return v&&(A.suggestions=[ee(a,x)]),A}}}else if(y==="style"&&typeof T=="string"&&nl.test(T)){if(a===void 0)return!0;{p="insecure-style";const w=$.getSeverity(p);return w&&Q(m,d,p,"insecure-style",w)}}else if(y==="tabindex"&&typeof T=="string"&&T!=="0"){if(a===void 0)return!0;{const w=$.getSeverity(p,"tabindex");if(w){const A=Q(m,d,p,"nonzero-tabindex",w);return v&&(A.suggestions=[ee(a,x),We(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(a===void 0)return!0;{const w=$.getSeverity(p,"value");return w&&Q(m,d,p,"illegal-attribute-value",w)}}else if(_&&f!=="ext-attr"){const w=Xn(S,y),A=String(T).toLowerCase();if(w.length>0&&w.every(C=>C!==A)){if(a===void 0)return!0;{const C=$.getSeverity(p,"value");return C&&Q(m,d,p,"illegal-attribute-value",C)}}}return!1},o)}}),$s,ol,ul,Xi,rr=I({"src/attributes.ts"(){"use strict";var e,t,Bi,n;X(),ve(),be(),D(),J(),mt(),nd(),$s=r=>r.slice(0,-1),ol=r=>`${$s(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,o,u,a=[]){super(void 0,u,a,{});P(this,t);P(this,e);if(F(this,e,l),this.setAttribute("name",o),s){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="",m=d.exec(s),f=0;const y=(()=>{c&&(super.insertAt(new Me(c,ol(l),u,a,{})),c="")});for(;m;){const{index:S,0:k,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(Ie(_).trim())){const $=h!=null?h:p,v=[g,x],w=new Oi($s(l),o,_,T,$,v,u,a);y(),super.insertAt(w)}else c+=k;({lastIndex:f}=d),m=d.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 Oi&&(!s||l.name===Rt(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 o=super.lint(s,l),{parentNode:u,childNodes:a}=this,d=new Map,c=new Set,m=new pe(this,s),f=["no-ignored","no-duplicate"],{lintConfig:y}=N,{computeEditInfo:S,fix:k}=y,_=["closingTag","invalidAttributes","nonWordAttributes"].map(g=>y.getSeverity(f[0],g));if(_[0]&&j(this,t,Bi).call(this)){const g=Y(this,m,f[0],"attributes-of-closing-tag",_[0]);if(S){const h=u.getAbsoluteIndex();g.suggestions=[ee(g),Gn(h)]}o.push(g)}for(const g of a)if(g instanceof Oi){const{name:h}=g;d.has(h)?(c.add(h),d.get(h).push(g)):d.set(h,[g])}else{const h=g.text().trim(),x=_[ul.test(h)?1:2];if(h&&x){const p=Q(g,m,f[0],"invalid-attribute",x);S&&(p.suggestions=[ee(p,0," ")]),o.push(p)}}const T=y.getSeverity(f[1],"attribute");if(T&&c.size>0)for(const g of c){const h=d.get(g).map(x=>{const p=x.getValue();return[x,p===!0?"":p]});Array.prototype.push.apply(o,h.map(([x,p],$)=>{const v=Q(x,m,f[1],N.msg("duplicate-attribute",g),T);if(S||k){const w=ee(v);!p||h.slice(0,$).some(([,A])=>A===p)?v.fix=w:S&&(v.suggestions=[w])}return v}))}return o}}escape(){this.type!=="ext-attrs"&&super.escape()}getAttribute(s){return s==="invalid"?j(this,t,Bi).call(this):super.getAttribute(s)}print(){return this.toString()?`<span class="wpb-${this.type}${j(this,t,Bi).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,Bi=function(){const{parentNode:s}=this;return(s==null?void 0:s.type)==="html"&&s.closing&&this.text().trim()!==""},n)}}),ro={};oe(ro,{PreToken:()=>lo});var lo,rd=I({"src/pre.ts"(){"use strict";De(),J(),qt(),lo=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 o=r.exec(e),u=0,a="";for(;l&&o;)new Pe(l[0],t,i,!0),new Pe(o[0],t,i,!0),a+=`${e.slice(u,l.index)}\0${i.length-1}n${e.slice(l.index+s,o.index)}\0${i.length}n`,u=o.index+s+1,n.lastIndex=u,l=n.exec(e),l&&(r.lastIndex=l.index+s),o=r.exec(e);e=a+e.slice(u)}super(e,t,i,{}),this.setAttribute("stage",ke-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),Ki,lr=I({"src/multiLine/index.ts"(){"use strict";J(),Ki=class extends z{get type(){return"ext-inner"}toString(e){return super.toString(e,`
|
|
3
6
|
`)}text(){return super.text(`
|
|
4
7
|
`).replace(/\n\s*\n/gu,`
|
|
5
8
|
`)}getGaps(){return 1}print(){return super.print({sep:`
|
|
6
|
-
`})}}}}),
|
|
7
|
-
`).map(
|
|
8
|
-
`,index:e.length},
|
|
9
|
-
`){
|
|
10
|
-
`)||(e=`${e.slice(0
|
|
11
|
-
)`:""}(\s*)$`,"u")),
|
|
12
|
-
`))!=null?u:[]){const d=/^([^|]+)(?:\|(.*))?/u.exec(a);if(!d){super.insertAt(a.trim()?new
|
|
13
|
-
`),r=new Set(t.protocol.split("|"));let n=!0,l=!1;for(const o of i){const u=o.trim();if(!(l||!u||u.startsWith("#"))){if(n){const a=o.indexOf("|"),d=a===-1?o:o.slice(0,a),{valid:c,ns:f}=this.normalizeTitle(d,0,{halfParsed:!0,temporary:!0,page:""});if(c&&f===6){const g=new kt("imagemap",d,a===-1?void 0:o.slice(a+1),t,s);super.insertAt(g),n=!1;continue}else l=!0}else if(o.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(o);continue}else if(o.includes("[")){const a=o.indexOf("["),d=o.slice(a),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 $n(o.slice(0,a),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 $n(o.slice(0,a),f.slice(1),d.slice(d.indexOf("]")+1),t,s));continue}}}}super.insertAt(new Bs(o,t,s))}}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new ge(this,e),{childNodes:r,image:n}=this,l="invalid-imagemap",{lintConfig:o}=N,u=o.getSeverity(l,n?"link":"image");return u&&(n?Array.prototype.push.apply(s,r.filter(a=>{const d=a.toString().trim();return a.is("noinclude")&&d&&!d.startsWith("#")}).map(a=>{const d=Q(a,i,l,"invalid-imagemap-link",u);return o.computeEditInfo&&(d.suggestions=[ee(d,-1),Oe(d,"comment","# ")]),d})):s.push(Z(this,i,l,"imagemap-without-image",u))),s}}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}}}}),Cl,Bi,Il,_t,yo=I({"src/nowiki/comment.ts"(){"use strict";Y(),pt(),Ze(),G(),ft(),Cl=[Ye(!1),He("<!--")],_t=class extends(Il=Be){constructor(t,s,i,r){super(t,i,r);Ne(this,"closed");this.closed=s}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){{if(this.closed)return[];const s="unclosed-comment",{lintConfig:i}=N,r=i.getSeverity(s);if(!r)return[];const n=Z(this,{start:t},s,"unclosed-comment",r);return i.computeEditInfo&&(n.suggestions=[Xe(n.endIndex,"-->")]),[n]}}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}},Bi=ae(Il),_t=re(Bi,0,"CommentToken",Cl,_t),ne(Bi,1,_t)}}),wo={};le(wo,{CommentedToken:()=>So});var So,nd=I({"src/commented.ts"(){"use strict";J(),yo(),So=class extends z{get type(){return"ext-inner"}constructor(e,t,s=[]){if(super(void 0,t,s,{AstText:":",CommentToken:":"}),e){let i=e.indexOf("<!--"),r=i!==-1&&e.indexOf("-->",i+4),n=0;for(;r!==!1&&r!==-1;)i>n&&this.insertAt(e.slice(n,i)),this.insertAt(new _t(e.slice(i+4,r),!0,t,s)),n=r+3,i=e.indexOf("<!--",n),r=i!==-1&&e.indexOf("-->",i+4);n<e.length&&this.insertAt(e.slice(n))}}lint(e=this.getAbsoluteIndex()){return super.lint(e,new RegExp(String.raw`<\s*(?:\/\s*)?(${this.name})\b`,"giu"))}}}}),Ao={};le(Ao,{NowikiToken:()=>ko});var Nl,Ll,ko,rd=I({"src/nowiki/index.ts"(){"use strict";var e,_n,s;Ke(),Y(),G(),ft(),Nl=ot(i=>new RegExp(String.raw`<\s*(?:/\s*)${i==="nowiki"?"":"?"}(${i})\b`,"giu")),Ll=new Set(["languages","section","templatestyles"]),ko=(s=class extends Be{constructor(){super(...arguments);R(this,e)}get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex()){{const{name:n}=this,{lintConfig:l}=N;let o="void-ext",u=l.getSeverity(o,n);if(u&&j(this,e,_n).call(this)){const d=Z(this,{start:r},o,N.msg("nothing-in",n),u);return l.computeEditInfo&&(d.suggestions=[ee(d)]),[d]}return super.lint(r,Nl(n))}}getAttribute(r){return r==="invalid"?j(this,e,_n).call(this):super.getAttribute(r)}},e=new WeakSet,_n=function(){const{name:r,firstChild:{data:n}}=this;return Ll.has(r)&&!!n},s)}}),Fl,qi,El,Tt,$o=I({"src/tagPair/ext.ts"(){"use strict";Y(),ve(),G(),Jn(),J(),Vn(),Zn(),Fl=[Hs()],Tt=class extends(El=lt){get type(){return"ext"}constructor(e,t,s,i,r=N.getConfig(),n=!1,l=[]){const o=e.toLowerCase(),u=new Ds(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",o,r,l),a={...r,ext:r.ext.filter(c=>c!==o),excludes:[...r.excludes],inExt:!0};let d;switch(o){case"tab":a.ext=a.ext.filter(c=>c!=="tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":o==="poem"&&a.excludes.push("heading"),d=new z(s,a,l);break;case"pre":{const{PreToken:c}=(Ju(),se(Qa));d=new c(s,a,l);break}case"dynamicpagelist":{const{ParamTagToken:c}=(Ya(),se(Ka));d=new c(n,s,a,l);break}case"inputbox":{const{InputboxToken:c}=(Zu(),se(so));d=new c(n,s,a,l);break}case"references":{const{NestedToken:c}=(Li(),se(js));a.excludes.push("heading"),d=new c(s,n,["ref"],a,l);break}case"choose":{const{NestedToken:c}=(Li(),se(js));d=new c(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],a,l);break}case"combobox":{const{NestedToken:c}=(Li(),se(js));d=new c(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],a,l);break}case"gallery":{const{GalleryToken:c}=(td(),se(go));d=new c(s,a,l);break}case"imagemap":{const{ImagemapToken:c}=(id(),se(vo));d=new c(s,a,l);break}case"hiero":{const{CommentedToken:c}=(nd(),se(wo));d=new c(s,a,l);break}default:{const{NowikiToken:c}=(rd(),se(Ao));d=new c(s,a,l)}}d.setAttribute("name",o),d.type==="plain"&&(d.type="ext-inner"),super(e,u,d,i,r,l),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),{lintConfig:i}=N,r=new ge(this,e);if(this.name!=="nowiki"){const n=this.inHtmlAttrs(),l="parsing-order",o=n&&i.getSeverity(l,n===2?"ext":"templateInTable");o&&s.push(Z(this,r,l,"ext-in-html",o))}if(this.name==="ref"){let n="var-anchor",l=i.getSeverity(n,"ref");l&&this.closest("heading-title")&&s.push(Z(this,r,n,"variable-anchor",l)),n="nested-link",l=i.getSeverity(n,"ref"),l&&this.closest("link,ext-link-text")&&s.push(Z(this,r,n,"ref-in-link",l))}return s}}},qi=ae(El),Tt=re(qi,0,"ExtToken",Fl,Tt),ne(qi,1,Tt)}}),_o={};le(_o,{parseCommentAndExt:()=>xs});var Wi,jl,ks,Rl,Ui,xs,Qs=I({"parser/commentAndExt.ts"(){"use strict";Ke(),me(),Hu(),Rt(),Gu(),Vu(),$o(),yo(),Wi="<onlyinclude>",jl="</onlyinclude>",{length:ks}=Wi,Rl=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",s=e?"noinclude":"includeonly";return ot(i=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${i})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(${"\\1"}\s*)>)|<(${s})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${s}\s*)>|$))`,"giu"))}),Ui=e=>{const t=e.indexOf(Wi);return{i:t,j:e.indexOf(jl,t+ks)}},xs=(e,t,s,i)=>{if(i){let{i:u,j:a}=Ui(e);if(u!==-1&&a!==-1){let d="";const c=f=>{new je(f,t,s),d+=`\0${s.length-1}n`};for(;u!==-1&&a!==-1;){const f=`\0${s.length}e`;new Xt(e.slice(u+ks,a),t,s),u>0&&c(e.slice(0,u)),d+=f,e=e.slice(a+ks+1),{i:u,j:a}=Ui(e)}return e&&c(e),d}}const{ext:r}=t;let n=r,l=t;if(r.includes("translate")){n=r.filter(a=>a!=="translate"&&a!=="tvar"),l={...t,ext:n};const u=[];e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,a=>(u.push(a),`\0${u.length-1}`)).replace(/<translate( nowrap)?>([\s\S]*?)<\/translate>/gu,(a,d,c)=>{const f=s.length;return new za(d,c&&Ee(c,u),l,s),`\0${f}g`}),e=Ee(e,u)}const o=Rl[i?1:0](n.join("|"));return o.lastIndex=0,o.test(e)?e.replace(o,(u,a,d,c,f,g,y,$,k)=>{const _=s.length;let T="n";if(a)T="e",new Tt(a,d,c,f,l,g,s);else if(u.startsWith("<!--")){T="c";const p=u.endsWith("-->");new _t(Ee(u,s,1).slice(4,p?-3:void 0),p,t,s)}else g?new Kt(g,y&&Ee(y,s,1),$&&Ee($,s,1),k,t,s):new je(u,t,s,!0);return`\0${_}${T}`}):e}}}),Pl,Ol,Bl,ql,Mi,Wl,es,ld=I({"src/tag/html.ts"(){"use strict";var e,t;Y(),ve(),Jn(),G(),Ma(),Pl=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),Ol=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"]),Bl=new Set(["strike","big","center","font","tt"]),ql=[Hs()],es=(t=class extends(Wl=Qn){constructor(i,r,n,l,o,u){super(i,r,n,o,u);R(this,e);this.setAttribute("name",i.toLowerCase()),E(this,e,l)}get type(){return"html"}get selfClosing(){return b(this,e)}text(){const{closing:i,selfClosing:r,name:n}=this,{html:[,,l]}=this.getAttribute("config");return l.includes(n)?i&&n!=="br"?"":super.text("/"):super.text(r&&!i?"/":"")}lint(i=this.getAbsoluteIndex(),r){var n;{const l=super.lint(i,r),{name:o,parentNode:u,closing:a,selfClosing:d}=this,c=new ge(this,i),{lintConfig:f}=N,{computeEditInfo:g,fix:y}=f,$=this.inTableAttrs();let k="h1",_=f.getSeverity(k,"html");if(_&&o==="h1"&&!a){const S=Z(this,c,k,"<h1>",_);g&&(S.suggestions=[{desc:"h2",range:[i+2,i+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,o),_&&Bl.has(o)&&l.push(Z(this,c,k,"obsolete-tag",_)),k="bold-header",_=f.getSeverity(k,o),_&&(o==="b"||o==="strong")&&((n=this.closest("heading-title,ext"))==null?void 0:n.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(o),m=T.includes(o),x=!h&&!m;if(k="unmatched-tag",a&&(d||h)||d&&x){if(_=f.getSeverity(k,a?"both":"selfClosing"),_){const S=Z(this,c,k,a?"closing-and-self-closing":"invalid-self-closing",_);if(g||y){const v=Wn(i),w={desc:N.msg("no-self-closing"),range:[S.endIndex-2,S.endIndex-1],text:""};m?g&&(S.suggestions=[v,w]):a?S.fix=h?v:w:g&&(S.suggestions=[w,Xe(S.endIndex,`></${o}>`,-2)])}l.push(S)}}else if(!this.findMatchingTag()){const S=Z(this,c,k,a?"unmatched-closing":"unclosed-tag"),v=this.closest("magic-word");if(v&&Pl.has(v.name))_=f.getSeverity(k,"conditional");else if(a)_=f.getSeverity(k,"closing"),S.suggestions=[ee(S)];else{_=f.getSeverity(k,"opening");const w=u==null?void 0:u.childNodes;Ol.has(o)&&(w!=null&&w.slice(0,w.indexOf(this)).some(A=>A.is("html")&&A.name===o&&!A.findMatchingTag())&&(S.suggestions=[Xe(i+1,"/")]),this.closest("heading-title")&&(S.rule="format-leakage",_=f.getSeverity("format-leakage",o)))}_&&(S.severity=_,l.push(S))}return l}}getAttribute(i){return i==="invalid"?this.inTableAttrs()===2:super.getAttribute(i)}json(i,r=this.getAbsoluteIndex()){{const n=super.json(void 0,r);return n.selfClosing=b(this,e),n}}},e=new WeakMap,t),Mi=ae(Wl),es=re(Mi,0,"HtmlToken",ql,es),ne(Mi,1,es)}}),To={};le(To,{parseHtml:()=>Co});var Ul,Co,ad=I({"parser/html.ts"(){"use strict";Zn(),ld(),Ul=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,Co=(e,t,s)=>{var l;const{html:i}=t;(l=t.htmlElements)!=null||(t.htmlElements=new Set([...i[0],...i[1],...i[2]]));const r=e.split("<");let n=r.shift();for(const o of r){const u=Ul.exec(o),a=u==null?void 0:u[2],d=a==null?void 0:a.toLowerCase();if(!u||!t.htmlElements.has(d)){n+=`<${o}`;continue}const[,c,,f="",g,y]=u,{length:$}=s,k=new Ds(f,"html-attrs",d,t,s),_=k.hasAttr("itemprop");if(d==="meta"&&!(_&&k.hasAttr("content"))||d==="link"&&!(_&&k.hasAttr("href"))){n+=`<${o}`,s.length=$;continue}n+=`\0${s.length}x${y}`,new es(a,k,c==="/",g==="/>",t,s)}return n}}}),Ml,zl,zi,Hl,Ct,Io=I({"src/table/base.ts"(){"use strict";Jn(),G(),J(),gt(),Zn(),Ml=e=>{const t=e.childNodes.map(i=>i.type==="text"?i.data.replace(/\|\|/gu,"{{!!}}").replace(/\|/gu,"{{!}}"):i.toString()).join(""),{childNodes:s}=N.parseWithRef(t,e,2);e.safeReplaceChildren(s)},zl=[Hs(1)],Ct=class extends(Hl=z){constructor(e,t,s,i,r,n=[],l){super(void 0,r,n,l),this.append(new Ue(t,"table-syntax",r,n),new Ds(i,"table-attrs",s,r,n))}escape(){for(const e of this.childNodes)e instanceof Ue?Ml(e):e.escape()}},zi=ae(Hl),Ct=re(zi,0,"TableBaseToken",zl,Ct),ne(zi,1,Ct)}}),Dl,Hi,$e,$s,zt,Ht,qs,No=I({"src/table/td.ts"(){"use strict";Y(),ve(),Gn(),G(),J(),Io(),qs=class extends(Hi=Ct,Dl=[Us(!1)],Hi){constructor(e,t,s,i=[]){var o;let r=/\||\0\d+!\x7F/u.exec(t!=null?t:""),n=r?t.slice(0,r.index):"";/\[\[|-\{/u.test(n)&&(r=null,n=""),super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",n,s,i),ne($s,5,this),Ge(this,zt),Ge(this,$e,""),r&&([Lu(this,$e)._]=r);const l=new z(t==null?void 0:t.slice(((o=r==null?void 0:r.index)!=null?o:NaN)+fe(this,$e).length),s,i);l.type="td-inner",l.setAttribute("stage",4),this.insertAt(l)}get type(){return"td"}get rowspan(){return this.getAttr("rowspan")}get colspan(){return this.getAttr("colspan")}get subtype(){return pn(this,zt,Ht).call(this).subtype}afterBuild(){fe(this,$e).includes("\0")&&Te(this,$e,this.buildFromStr(fe(this,$e),0)),super.afterBuild()}toString(e){const{childNodes:[t,s,i]}=this;return t.toString(e)+s.toString(e)+fe(this,$e)+i.toString(e)}text(){const{childNodes:[e,t,s]}=this;return e.text()+t.text()+fe(this,$e)+s.text()}getGaps(e){return e===1?fe(this,$e).length:0}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new ge(this,e+this.getRelativeIndex(this.length-1)),r="pipe-like",{lintConfig:n}=N,{computeEditInfo:l,fix:o}=n,u=["td","double"].map(a=>n.getSeverity(r,a));for(const a of this.lastChild.childNodes)if(a.type==="text"){const{data:d}=a;if(d.includes("|")){const c=d.includes("||"),f=u[c?1:0];if(f){const g=Q(a,i,r,"pipe-in-table",f);if(l||o)if(c){const y={caption:"|+",td:"|",th:"!"}[this.subtype];g.fix=Oe(g,"newline",d.replace(/\|\|/gu,`
|
|
14
|
-
${y}`))}else l&&(
|
|
15
|
-
`)}getAttr(e){{const t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}}escape(){super.escape(),this.childNodes[1].toString()&&(
|
|
16
|
-
|}`,t){
|
|
17
|
-
`);let o=t==="root"||t==="parameter-value"||t==="ext-inner"&&
|
|
18
|
-
${l.shift()}`,u;const a=(d,c)=>{if(!c){o+=d;return}const{lastChild:
|
|
19
|
-
${c}${
|
|
20
|
-
${d}`;continue}const y=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(
|
|
21
|
-
${d}`,u),
|
|
22
|
-
${c}${
|
|
23
|
-
${c}${k}`,T,
|
|
24
|
-
${c}${_}`;const
|
|
25
|
-
`)&&(_=Ce(g).trim());const{ns:p,valid:h}=N.normalizeTitle(_,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0,page:i});if(h){if(d){if(p!==6){o+=`[[${$}`;continue}let x=!1;for(a++;a<l.length;a++){const S=l[a],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=Tn(g,t,s,i,r),!x){o+=`[[${c}${f}${g}`;continue}}}else{o+=`[[${$}`;continue}g&&(g=ur(g,t,s,r));let m=nr;T||(p===6?(g&&(g=dr(g,t,s,!0)),m=ir):p===14&&(m=Go)),g===void 0&&f&&(g=""),o+=`\0${s.length}l${y}`,new m(c,g,t,s,f)}return o}}}),Qo={};le(Qo,{parseMagicLinks:()=>Jo});var Qi,Ji,Xi,Ki,Jo,xd=I({"parser/magicLinks.ts"(){"use strict";me(),rr(),Qi=String.raw`[${Je}\t]| |�*160;|�*a0;`,Ji=`(?:${Qi})+`,Xi=`(?:${Qi}|-)`,Ki=String.raw`(?:RFC|PMID)${Ji}\d+\b|ISBN${Ji}(?:97[89]${Xi}?)?(?:\d${Xi}?){9}[\dx]\b`,Jo=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${It}${Nt})|${Ki})`,"giu")}catch{t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${It}${Nt})|${Ki})`,"giu")}return e.replace(t.regexMagicLinks,(i,r,n)=>{let l=r?i.slice(r.length):i;if(n){let o="";const u=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(l);u&&(o=l.slice(u.index),l=l.slice(0,u.index));const a=l.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,d=a.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),o=l.slice(d.index+c)+o,l=l.slice(0,d.index+c)}return o.length>=n.length?i:(new ps(l,void 0,t,s),`${r}\0${s.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(l))return i;return new ps(l,"magic-link",t,s),`${r}\0${s.length-1}i`})}}}),Xo,vd=I({"util/html.ts"(){"use strict";Xo=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,i)=>s!==e[i])}}),Ko,bd=I({"src/nowiki/list.ts"(){"use strict";Eo(),Ko=class extends ar{get type(){return"list"}}}}),Yo={};le(Yo,{parseList:()=>Zo});var Zo,yd=I({"parser/list.ts"(){"use strict";vd(),bd(),jo(),Zo=(e,t,s,i)=>{const r=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!r)return t.lastPrefix="",e;const[n,l,o,u]=r,a=o.replace(/;/gu,":"),d=Xo(a,t.lastPrefix),c=((d>1?o.slice(d-1):o)+u).split(/(?=;)/u),f=c[0].startsWith(";");let g=c.length-(f?0:1);if(d>1){const A=o.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=a;let y=l+c.map((A,C)=>`\0${i.length+C}d`).join("")+e.slice(n.length);for(const A of c)new Ko(A,s,i);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 or(A,s,i),`${y.slice(0,C)}\0${i.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}=i[Number(A.slice(1,-2))];($.includes(L)||!q&&!k.includes(L))&&w(B)}else if(A.endsWith("q")){const{bold:L,italic:B}=i[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(i.length).length,y=v(A,C)}p=T.exec(y)}return y}}}),Ts,ea,Yi,ta,ss,wd=I({"src/converterFlags.ts"(){"use strict";var e,t;Y(),ve(),Ms(),G(),J(),ht(),Ts=new Set(["A","T","R","D","-","H","N"]),ea=[ms()],ss=(t=class extends(ta=z){constructor(i,r,n=[]){super(void 0,r,n,{});R(this,e);this.safeAppend(i.map(l=>new qe(l,"converter-flag",r,n)))}get type(){return"converter-flags"}afterBuild(){E(this,e,this.childNodes.map(i=>i.text().trim())),super.afterBuild()}toString(i){return super.toString(i,";")}text(){return super.text(";")}getUnknownFlags(){return new Set(b(this,e).filter(i=>/\{{3}[^{}]+\}{3}/u.test(i)))}getVariantFlags(){const i=new Set(this.getAttribute("config").variants);return new Set(b(this,e).filter(r=>i.has(r)))}isInvalidFlag(i,r,n,l){return typeof i=="object"&&(i=i.text().trim(),r=this.getVariantFlags(),n=this.getUnknownFlags(),l=new Set(b(this,e).filter(o=>Ts.has(o)))),!!i&&!r.has(i)&&!n.has(i)&&(r.size>0||!l.has(i))}lint(i=this.getAbsoluteIndex(),r){{const n=this.getVariantFlags(),l=this.getUnknownFlags(),o=new Set(b(this,e).filter(k=>Ts.has(k))),u=b(this,e).filter(k=>!k).length,a=b(this,e).length-l.size-u,{lintConfig:d}=N,{computeEditInfo:c,fix:f}=d,g=super.lint(i,r);if(n.size===a||o.size===a)return g;const y="no-ignored",$=d.getSeverity(y,"conversionFlag");if($){const k=new ge(this,i);for(let _=0;_<this.length;_++){const T=this.childNodes[_],p=T.text().trim();if(this.isInvalidFlag(p,n,l,o)){const h=Q(T,k,y,"invalid-conversion-flag",$);(c||f)&&(n.size===0&&Ts.has(p.toUpperCase())?h.fix=Mn(h,p):c&&(h.suggestions=[ee(h,_&&-1)])),g.push(h)}}}return g}}print(){return super.print({sep:";"})}},e=new WeakMap,t),Yi=ae(ta),ss=re(Yi,0,"ConverterFlagsToken",ea,ss),ne(Yi,1,ss)}}),Cs,Ps,Sd=I({"src/converterRule.ts"(){"use strict";Me(),G(),J(),ht(),Cs=(e,t,s,i)=>{const r=new z(e,s,i);return r.type=`converter-rule-${t}`,r.setAttribute("stage",ke),r},Ps=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(),i=[]){super(void 0,s,i,{});const r=e.indexOf(":"),n=e.slice(0,r).indexOf("=>"),l=n===-1?e.slice(0,r):e.slice(n+2,r);t&&s.variants.includes(l.trim().toLowerCase())?(super.insertAt(new qe(l,"converter-rule-variant",s,i)),super.insertAt(Cs(e.slice(r+1),"to",s,i)),n!==-1&&super.insertAt(Cs(e.slice(0,n),"from",s,i),0)):super.insertAt(Cs(e,"to",s,i))}toString(e){const{childNodes:t,firstChild:s,lastChild:i}=this;return t.length===3?`${s.toString(e)}=>${t[1].toString(e)}:${i.toString(e)}`:super.toString(e,":")}text(){const{childNodes:e,firstChild:t,lastChild:s}=this;return e.length===3?`${t.text()}=>${e[1].text()}:${s.text()}`:super.text(":")}getGaps(e){return e===0&&this.length===3?2:1}print(){const{childNodes:e}=this;if(e.length===3){const[t,s,i]=e;return`<span class="wpb-converter-rule">${t.print()}=>${s.print()}:${i.print()}</span>`}return super.print({sep:":"})}json(e,t=this.getAbsoluteIndex()){{const s=super.json(void 0,t);return s.variant=this.variant,s}}}}}),sa,Zi,ia,is,Ad=I({"src/converter.ts"(){"use strict";me(),Ze(),ze(),J(),wd(),Sd(),sa=[We,He("-{")],is=class extends(ia=z){get type(){return"converter"}constructor(e,t,s,i=[]){super(void 0,s,i),this.insertAt(new ss(e,s,i));const[r]=t,n=r.includes(":"),l=new Ps(r,n,s,i);(n?l.length===1:t.length===2&&!Ce(t[1]).trim())?this.insertAt(new Ps(t.join(";"),!1,s,i)):this.safeAppend([l,...t.slice(1).map(o=>new Ps(o,!0,s,i))])}toString(e){const{childNodes:[t,...s]}=this;return`-{${t.toString(e)}${t.length>0?"|":""}${s.map(i=>i.toString(e)).join(";")}}-`}text(){const{childNodes:[e,...t]}=this;return`-{${e.text()}|${ct(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?"|":""}${Ft(t,{sep:";"})}}-</span>`}},Zi=ae(ia),is=re(Zi,0,"ConverterToken",sa,is),ne(Zi,1,is)}}),eu={};le(eu,{parseConverter:()=>tu});var tu,kd=I({"parser/converter.ts"(){"use strict";Ad(),tu=(e,t,s)=>{var u;(u=t.regexConverter)!=null||(t.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${t.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"iu"));const i=/-\{/gu,r=/-\{|\}-/gu,n=[];let l=i,o=l.exec(e);for(;o;){const{0:a,index:d}=o;if(a==="}-"){const c=n.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 is($,T,t,s),e=`${e.slice(0,c.index)}\0${f}v${e.slice(d+2)}`,n.length===0&&(l=i),l.lastIndex=c.index+3+String(f).length}else n.push(o),l=r,l.lastIndex=d+2;o=l.exec(e)}return e}}}),ls={};le(ls,{Token:()=>z});var na,z,J=I({"src/index.ts"(){"use strict";var e,t,s,i,r,n,l,o,u,su,iu,nu,ru,lu,au,ou,uu,du,cu,hu,gu,m;me(),Me(),Y(),Re(),G(),Bu(),Wu(),na=["category","html-attr#id,ext-attr#id,table-attr#id"],z=(m=class extends Vt{constructor(v,w=N.getConfig(),A=[],C){super();R(this,u);R(this,e,"plain");R(this,t,0);R(this,s);R(this,i);R(this,r);R(this,n,!1);R(this,l);R(this,o);typeof v=="string"&&this.insertAt(v),E(this,s,w),E(this,i,A),A.push(this)}get type(){return b(this,e)}set type(v){E(this,e,v)}get pageName(){return b(this.getRootNode(),o)}set pageName(v){if(v){const w=this.normalizeTitle(v,0,{temporary:!0,page:""});E(this,o,w.valid?w.title:void 0)}else E(this,o,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,i).pop();const C=j(this,u,su).call(this);w&&(w=!C)}E(this,r,w),j(this,u,iu).call(this,w);break;case 1:j(this,u,nu).call(this);break;case 2:j(this,u,ru).call(this);break;case 3:j(this,u,lu).call(this);break;case 4:j(this,u,au).call(this);break;case 5:j(this,u,ou).call(this,A);break;case 6:j(this,u,uu).call(this,A);break;case 7:j(this,u,du).call(this);break;case 8:j(this,u,cu).call(this);break;case 9:j(this,u,hu).call(this);break;case 10:j(this,u,gu).call(this)}if(this.type==="root")for(const C of b(this,i))C==null||C.parseOnce(v,w,A);return gr(this,t)._++,this}buildFromStr(v,w){const A=v.split(/[\0\x7F]/u).map((C,L)=>{if(L%2===0)return new vn(C);if(isNaN(C.slice(-1)))return b(this,i)[Number(C.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${C}`)});return w===0?A.map(String).join(""):w===1?ct(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")&&(fs(this,0,1,this.buildFromStr(A)),this.normalize(),this.type==="root"))for(const C of b(this,i))C==null||C.build()}afterBuild(){if(this.type==="root")for(const v of b(this,i))v==null||v.afterBuild();E(this,n,!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,i);case"built":return b(this,n);case"stage":return b(this,t);case"invalid":return this.type==="table-inter"&&rs(this)===2;default:return super.getAttribute(v)}}setAttribute(v,w){switch(v){case"stage":b(this,t)===0&&this.type==="root"&&b(this,i).shift(),E(this,t,w);break;default:super.setAttribute(v,w)}}insertAt(v,w=this.length){const A=typeof v=="string"?new vn(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=na.filter((H,V)=>U[V]).join();if(ie){for(const H of this.querySelectorAll(ie)){let V;if(H.is("category"))V=H.name;else{const X=H.getValue();X&&X!==!0&&(V=`#${X}`)}if(V){const X=F.get(V);X?X.add(H):F.set(V,new Set([H]))}}for(const[H,V]of F)if(V.size>1&&!H.startsWith("#mw-customcollapsible-")){const X=!H.startsWith("#"),oe=`duplicate-${X?"category":"id"}`,de=U[X?0:1];W.push(...[...V].map(ce=>{const ue=Z(ce,{start:ce.getAbsoluteIndex()},P,oe,de);return L&&X&&(ue.suggestions=[ee(ue)]),ue}))}}if(!q){const H=new RegExp(String.raw`<!--\s*${O}-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->`,"gu"),V=[];let X=H.exec(M);for(;X;){const{1:oe,index:de}=X,ce=(A=X[2])==null?void 0:A.trim();V.push({line:this.posFromIndex(de).top+(oe==="disable-line"?0:1),from:oe==="disable"?H.lastIndex:void 0,to:oe==="enable"?H.lastIndex:void 0,rules:ce?new Set(ce.split(",").map(ue=>ue.trim())):void 0}),X=H.exec(M)}W=W.filter(({rule:oe,startLine:de,startIndex:ce})=>{const ue={pos:0};for(const{line:pe,from:ye,to:D,rules:K}of V){if(pe>de+1)break;if(K&&!K.has(oe))continue;if(pe===de&&ye===void 0&&D===void 0)return!1;ye<=ce&&ye>ue.pos?(ue.pos=ye,ue.type="from"):D<=ce&&D>ue.pos&&(ue.pos=D,ue.type="to")}return ue.type!=="from"})}if(B&&W.some(({fix:H})=>H)){const H=W.map(({fix:oe})=>oe).filter(Boolean).sort(({range:[oe,de]},{range:[ce,ue]})=>de===ue?ce-oe:ue-de);let V=1/0,X=M;for(const{range:[oe,de],text:ce}of H)de<=V&&(X=X.slice(0,oe)+ce+X.slice(de),V=oe);Object.assign(W,{output:X})}if(!L)for(const H of W)delete H.fix,delete H.suggestions}return W}}toString(v,w){return v?super.toString(!0,w):ut(b(this,l),()=>super.toString(!1,w),A=>{const C=this.getRootNode();C.type==="root"&&b(C,n)&&E(this,l,A)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakMap,l=new WeakMap,o=new WeakMap,u=new WeakSet,su=function(){const{parseRedirect:v}=(zu(),se(Wa)),w=this.firstChild.toString(),A=v(w,b(this,s),b(this,i));return A&&this.setText(A),!!A},iu=function(v){const{parseCommentAndExt:w}=(Qs(),se(_o));this.setText(w(this.firstChild.toString(),b(this,s),b(this,i),v))},nu=function(){const{parseBraces:v}=(sr(),se(to)),w=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,A=v(w,b(this,s),b(this,i));this.setText(this.type==="root"?A:A.slice(1))},ru=function(){if(b(this,s).excludes.includes("html"))return;const{parseHtml:v}=(ad(),se(To));this.setText(v(this.firstChild.toString(),b(this,s),b(this,i)))},lu=function(){if(b(this,s).excludes.includes("table"))return;const{parseTable:v}=(dd(),se(Ro));this.setText(v(this,b(this,s),b(this,i)))},au=function(){if(b(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:v}=(gd(),se(qo));this.setText(v(this,b(this,s),b(this,i)))},ou=function(v){const{parseLinks:w}=(md(),se(Vo));this.setText(w(this.firstChild.toString(),b(this,s),b(this,i),this.pageName,v))},uu=function(v){if(b(this,s).excludes.includes("quote"))return;const{parseQuotes:w}=(zo(),se(Mo)),A=this.firstChild.toString().split(`
|
|
26
|
-
`);for(let C=0;C<A.length;C++)A[C]=w(A[C],b(this,
|
|
27
|
-
`))},
|
|
28
|
-
`),
|
|
29
|
-
`))},gu=function(){if(b(this,s).variants.length>0){const{parseConverter:v}=(kd(),se(eu));this.setText(v(this.firstChild.toString(),b(this,s),b(this,i)))}},m)}}),be,Js,fs,Re=I({"util/debug.ts"(){"use strict";be={running:!1,run(e){const{running:t}=this;this.running=!0;try{const{Token:s}=(J(),se(ls)),i=e();return i instanceof s&&!i.getAttribute("built")&&i.afterBuild(),this.running=t,i}catch(s){throw this.running=t,s}},rev:0},Js=e=>t=>t.type===e,fs=(e,t,s,i=[])=>{var l,o;let r=e.getChildNodes(),n;r.length===s?(n=r,r=i):n=Array.prototype.splice.apply(r,[t,s,...i]);for(let u=0;u<i.length;u++){const a=i[u];a.setAttribute("parentNode",e),a.setAttribute("nextSibling",r[t+u+1]),a.setAttribute("previousSibling",r[t+u-1])}return(l=r[t-1])==null||l.setAttribute("nextSibling",r[t]),(o=r[t+i.length])==null||o.setAttribute("previousSibling",r[t+i.length-1]),r===i&&e.setAttribute("childNodes",r),n}}}),vt,en,Is,tn,ra,sn,la,Cn,$d=I({"lib/lintConfig.ts"(){"use strict";var e,t;Bn(),vt=new Map([[0,!1],[1,"warning"],[2,"error"],[!1,!1],["off",!1],["warning","warning"],["error","error"]]),en={"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}],"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(en),Is={configurationComment:"lint",ignoreDisables:!1,fix:!0,computeEditInfo:!0},Object.freeze(Is),tn=s=>vt.has(s),ra=s=>tn(s)||Array.isArray(s)&&tn(s[0])&&(s.length===1||typeof s[1]=="object"),sn=(s,i,r)=>{if(as.includes(i)){if(r===void 0)return!1;if(ra(r))return s[i]=r,!0}else throw new RangeError(`Unknown lint rule: ${i}`);throw new RangeError(`Invalid lint config for ${i}: ${JSON.stringify(r)}`)},la=class{constructor(s){if(Object.assign(this,JSON.parse(JSON.stringify(en))),!!s)for(const[i,r]of Object.entries(s))sn(this,i,r)}getSeverity(s,i){var n,l;const r=this[s];return typeof r!="object"?vt.get(r):i&&(l=vt.get((n=r[1])==null?void 0:n[i]))!=null?l:vt.get(r[0])}},Cn=(t=class{constructor(s){R(this,e);if(Object.assign(this,Is),s&&!("rules"in s)&&Object.keys(s).some(i=>as.includes(i)))this.rules=s;else{const{rules:i,...r}=s!=null?s:{};this.rules=i;for(const[n,l]of Object.entries(r))l!==void 0&&Object.prototype.hasOwnProperty.call(Is,n)&&(this[n]=l)}}get rules(){return b(this,e)}set rules(s){E(this,e,new Proxy(new la(s),{set:sn,deleteProperty(){return!1}}))}getSeverity(s,i){return b(this,e).getSeverity(s,i)}},e=new WeakMap,t)}}),pu={};le(pu,{Title:()=>fu});var nn,fu,_d=I({"lib/title.ts"(){"use strict";var e,t,s,i,r,n,mu,o;Ke(),me(),nn=u=>{const[,{length:a},d]=/^((?:\.\.\/)*)([\s\S]*)/u.exec(u);return[a/3,d]},fu=(o=class{constructor(u,a,d,{temporary:c,decode:f,selfLink:g,page:y}={}){R(this,n);R(this,e);R(this,t);R(this,s);R(this,i);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=cs(u),this.encoded=h}catch{}if(u=us(u).replace(/[_ ]+/gu," ").trim(),k||y&&$.startsWith("/"))E(this,i,0);else{let h=a;u.startsWith(":")&&(h=0,u=u.slice(1).trim());const m=u.split(":");if(m.length>1){const x=Lt(m[0]),S=Object.prototype.hasOwnProperty.call(d.nsid,x)&&d.nsid[x];S&&(h=S,u=m.slice(1).join(":").trim())}E(this,i,h)}const _=u.indexOf("#");if(_!==-1){let h=u.slice(_).trim().slice(1);if(h.includes("%"))try{h=cs(h)}catch{}E(this,r,h.replace(/ /gu,"_")),u=u.slice(0,_).trim()}const[T,p]=k?nn(u):[0,u];this.valid=!!(u||g&&this.ns===0&&b(this,r)!==void 0)&&us(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,i)}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,a=u.lastIndexOf(".");return a===-1?void 0:u.slice(a+1).toLowerCase()}getRedirection(){const{prefix:u}=this,a=u;return j(this,n,mu).call(this,a)}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:a,fragment:d}=this;return a?b(this,s).replace("$1",encodeURIComponent(a)+(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,i=new WeakMap,r=new WeakMap,n=new WeakSet,mu=function(u){var d,c;let a=(u+this.main).replace(/ /gu,"_");if(a.startsWith("/"))a=((d=this.page)!=null?d:"")+a.replace(/(.)\/$/u,"$1");else if(a.startsWith("../")&&((c=this.page)!=null&&c.includes("/"))){const[f,g]=nn(a),y=this.page.split("/");y.length>f&&(a=y.slice(0,-f).join("/")+(g&&"/")+g)}return[!1,a]},o)}}),xu={};le(xu,{LanguageService:()=>vu,tasks:()=>In});var In,aa,oa,ua,da,rn,ca,ha,ga,pa,ln,fa,an,bt,on,De,Se,un,dn,yt,wt,st,Dt,cn,ma,vu,Td=I({"lib/lsp.ts"(){"use strict";var e,t,s,i,r,n,l,o,u,a,ns,Fe,Nn,Ln,Fn,bu,En,St,T;Ke(),Oo(),Bn(),Ga(),Y(),me(),G(),In=new WeakMap,aa=new Set(["ref"]),oa=new Set(["ref","references"]),ua=new Set(["name","follow"]),da=new Set(["group"]),rn=new Set(["arg-name","template-name","link-target","parameter-key"]),ca=new Set(["ext","html","attr-key","image-parameter","heading-title","heading","magic-word-name",...rn]),ha=new Set(["text","comment","noinclude","include"]),ga=["ext","html","table"].map(p=>`${p}-attr#style`).join(),pa=ot(p=>new RegExp(`^(?:${p}|//)`,"iu")),ln=({type:p,parentNode:h,length:m,firstChild:x},S)=>p==="attr-value"&&m===1&&x.type==="text"&&(!S||h.name==="style"),fa=p=>p.is("html-attr")||p.is("table-attr"),an=p=>p.childNodes.every(({type:h})=>ha.has(h)),bt=(p,h)=>{const{top:m,left:x}=p.posFromIndex(h);return{line:m,character:x}},on=(p,h,m)=>({start:bt(p,h),end:bt(p,m)}),De=p=>{const{top:h,left:m,height:x,width:S}=p.getBoundingClientRect();return{start:{line:h,character:m},end:hs(h,m,x,S)}},Se=(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}}}}),un=(p,h,{line:m,character:x})=>{const S=p.indexFromPos(m,x);return p.caretPositionFromIndex(S+Number(/\w/u.test(h.charAt(S))))},dn=(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},yt=p=>dn(p,aa,ua),wt=p=>dn(p,oa,da),st=(p,h)=>{const m=p==null?void 0:p.getAttr(h);return m!==!0&&m||!1},Dt=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}},cn=(p,h,m=!1)=>({range:on(p,...h.range),newText:h.text,title:`${m?"Fix":"Suggestion"}: ${h.desc}`,fix:m}),ma=(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 as)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:De(p),newText:w}]},vu=(T=class{constructor(p){R(this,a);R(this,e);R(this,t);R(this,s);R(this,i);R(this,r);R(this,n);R(this,l);R(this,o);R(this,u);Ne(this,"include",!0);Ne(this,"config");Ne(this,"data");In.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,a,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"&&!an(S)?[]:w.filter(A=>A.type==="text").reverse().flatMap(A=>{const{data:C}=A,L=Ia(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:on(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(Ca).join("")}`;return[{label:A,textEdit:{range:v,newText:A}}]}async provideCompletionItems(p,h){var X,oe,de,ce,ue,pe,ye;const{re:m,allTags:x,functions:S,switches:v,jaSwitches:w,protocols:A,params:C,tags:L,ext:B}=j(this,a,bu).call(this),{line:q,character:O}=h,W=p.split(/\r?\n/u,q+1)[q],F=m.exec((X=W==null?void 0:W.slice(0,O))!=null?X:""),[,,P={},U={}]=this.config.doubleUnderscore;if((F==null?void 0:F[1])!==void 0){const D=F[1].startsWith("/");return Se(x,"Class",F[1].slice(D?1:0),h,D&&!(W!=null&&W.slice(O).trim().startsWith(">"))?">":"")}else if(F!=null&&F[4]||F!=null&&F[5]&&w.length>0){const D=F[5]!==void 0;return Se(D?w:v,"Constant",F[D?5:4],h,"",K=>{if(this.data)D||(K=K.slice(2,-2));else return;return K in P?K=P[K]:K in U&&(K=U[K]),j(this,a,En).call(this,K.toLowerCase())})}else if((F==null?void 0:F[6])!==void 0)return Se(A,"Reference",F[6],h);const M=await j(this,a,Fe).call(this,p);let ie;if(F!=null&&F[2]){ie=M.elementFromPoint(F.index+F[2].length-1,q);const D=(oe=F[3])!=null?oe:"";if(F[2]==="{{{")return Se(M.querySelectorAll("arg").filter(te=>te.name&&te!==ie).map(({name:te})=>te),"Variable",D,h);const[K,Ae]=this.config.parserFunction,we=Array.isArray(Ae),Ie=W.charAt(O),et=D.startsWith(":"),_e=et?D.slice(1).trimStart():D;if(F[2]==="[[")return Se(M.querySelectorAll("link,file,category,redirect-target").filter(te=>te!==ie).map(({name:te})=>te),"Folder",_e,h);let mt=S;return Ie===":"?mt=S.filter(te=>!te.endsWith(":")):Ie===":"&&(mt=S.filter(te=>te.endsWith(":")).map(te=>te.slice(0,-1))),[...Se(mt,"Function",D,h,"",te=>{if(this.data)te in K?te=K[te]:!we&&te in Ae&&(te=Ae[te]);else return;return j(this,a,St).call(this,te.toLowerCase())}),...D.startsWith("#")?[]:Se(M.querySelectorAll("template").filter(te=>te!==ie).map(te=>{const{name:Le}=te;if(et)return Le;const{ns:xe}=te.getAttribute("title");return xe===0?`:${Le}`:xe===10?Le.slice(9):Le}),"Folder",_e,h)]}let H,V;if((F==null?void 0:F[8])===void 0&&(ie=M.elementFromPoint(O,q),{type:H,parentNode:V}=ie),(F==null?void 0:F[7])!==void 0||H==="image-parameter"){const D=M.indexFromPos(q,O),K=(ce=(de=F==null?void 0:F[7])==null?void 0:de.trimStart())!=null?ce:b(this,e).slice(ie.getAbsoluteIndex(),D).trimStart(),Ae=b(this,e)[D]==="=";return[...Se(C,"Property",K,h).filter(({label:we})=>!Ae||!/[= ]$/u.test(we)),...Se(M.querySelectorAll("image-parameter#width").filter(we=>we!==ie).map(we=>we.text()),"Unit",K,h)]}else if((F==null?void 0:F[8])!==void 0||H==="attr-key"){const D=(pe=(ue=F==null?void 0:F[8])==null?void 0:ue.toLowerCase())!=null?pe:V.tag,K=(ye=F==null?void 0:F[10])!=null?ye:ie.toString().slice(0,O-M.posFromIndex(ie.getAbsoluteIndex()).left);if(!L.has(D))return;const Ae=Kn[D],we=Yn[D],Ie=we&&Se(we,"Field",K,h);return B.includes(D)&&!Ae?Ie:[...Ie!=null?Ie:[],...D==="meta"||D==="link"?[]:Se(Xn,"Property",K,h),...Ae?Se(Ae,"Property",K,h):[],...Se(["data-"],"Variable",K,h),...Se(["xmlns:"],"Interface",K,h)]}else if(H==="parameter-key"||H==="parameter-value"&&V.anon){const D=V.parentNode,{type:K,name:Ae}=D;if(K==="magic-word"&&Ae!=="invoke")return;const we=b(this,e).slice(ie.getAbsoluteIndex(),M.indexFromPos(q,O)).trimStart(),{module:Ie,function:et}=D;return we?Se(M.querySelectorAll("parameter").filter(_e=>_e===V||_e.anon||_e.parentNode.type!==K||_e.parentNode.name!==Ae?!1:K==="template"?!0:_e.parentNode.module===Ie&&_e.parentNode.function===et).map(({name:_e})=>_e),"Variable",we,h,H==="parameter-value"?"=":""):void 0}else if(ln(ie)&&fa(V)){const D=Hn(V.tag,V.name);if(D.length===0)return;const K=b(this,e).slice(ie.getAbsoluteIndex(),M.indexFromPos(q,O)).trimStart();return Se(D,"Value",K,h)}}async provideDiagnostics(p,h=!0){const m=await j(this,a,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?[cn(m,U,!0)]:[],...M?M.map(ie=>cn(m,ie)):[]]})),[],[]].flat(2)}resolveCodeAction(p){if(p.kind!=="source.fixAll")return p;const{rule:h}=p.data;return{...p,edit:{changes:{"":ma(b(this,r),h)}}}}async provideFoldingRanges(p){const h=await j(this,a,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=pa(m);return(await j(this,a,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")||!an(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:V}=W===1?U:q.getBoundingClientRect();return{range:{start:{line:U.top,character:U.left},end:hs(M,ie,H,V)},target:P}}return{range:De(w),target:P}}catch{return!1}}).filter(Boolean)}async provideReferences(p,h){const m=await j(this,a,Fe).call(this,p),{offsetNode:x,offset:S}=un(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=yt(w),L=wt(w);if(!C&&!L&&!ca.has(A))return;const B=Dt(w),q=m.querySelectorAll(A==="heading-title"?"heading":A).filter(O=>A==="attr-value"?yt(O)===C||wt(O)===L:Dt(O)===B).reverse().map(O=>({range:De(O.type==="parameter-key"?O.parentNode:O)}));return q.length===0?void 0:q}async provideDefinition(p,h){const m=await j(this,a,Fe).call(this,p),x=m.elementFromPoint(h.character,h.line),S=x.is("ext")&&x.name==="ref"?x:x.closest("ext#ref"),v=st(S,"name");if(!v)return;const w=st(S,"group"),A=m.querySelectorAll("ext#ref").filter(C=>C.innerText&&st(C,"name")===v&&st(C,"group")===w).reverse().map(({lastChild:C})=>({range:De(C)}));return A.length===0?void 0:A}async resolveRenameLocation(p,h){const m=await j(this,a,Fe).call(this,p),x=m.elementFromPoint(h.character,h.line),{type:S}=x,v=yt(x),w=wt(x);return!v&&!w&&(!rn.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:De(x)}async provideRenameEdits(p,h,m){const x=await j(this,a,Fe).call(this,p),S=x.elementFromPoint(h.character,h.line),{type:v}=S,w=yt(S),A=w&&st(S.parentNode.parentNode,"group"),C=wt(S),L=Dt(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"?wt(q)===C||yt(q)===w&&st(q.parentNode.parentNode,"group")===A:Dt(q)===L});return B.length===0?void 0:{changes:{"":B.reverse().map(q=>({range:De(q),newText:m}))}}}async provideHover(p,h){if(!this.data)return;const m=await j(this,a,Fe).call(this,p);let{offsetNode:x,offset:S}=un(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,a,En).call(this,x.name);else if(v==="magic-word-name")L=j(this,a,St).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,a,St).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,a,St).call(this,B.toLowerCase()),q=":",L)){const W=x.getAbsoluteIndex();O={start:bt(m,W+2),end:bt(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
|
+
`})}}}}),ao,ld=I({"src/paramLine.ts"(){"use strict";J(),ao=class extends z{get type(){return"param-line"}}}}),oo={};oe(oo,{ParamTagToken:()=>ar});var ar,uo=I({"src/multiLine/paramTag.ts"(){"use strict";X(),be(),Zi(),D(),lr(),ld(),ar=class extends Ki{constructor(e,t,i=N.getConfig(),n=[],r){super(void 0,i,n,{}),t&&this.safeAppend(t.split(`
|
|
10
|
+
`).map(s=>r?s:Ai(s,i,n,e)).map(s=>new ao(s,i,n,{}))),n.splice(n.indexOf(this),1),n.push(this)}lint(e=this.getAbsoluteIndex()){{const t="no-ignored",{lintConfig:i}=N,n=i.getSeverity(t,this.name);if(!n)return[];const r=new pe(this,e),s=N.msg("invalid-parameter",this.name),l=[];for(const o of this.childNodes){o.setAttribute("aIndex",e);const u=o.childNodes.filter(({type:a})=>a!=="comment"&&a!=="include"&&a!=="noinclude");if(u.some(({type:a})=>a==="ext"))l.push(Q(o,r,t,s,n));else{const a=u.findIndex(({type:c})=>c!=="text"),d=u.slice(0,a===-1?void 0:a).map(String).join("");if(d&&!(a===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(d)){const c=Q(o,r,t,s,n);i.computeEditInfo&&(c.suggestions=[ee(c)]),l.push(c)}else{const c=o.lint(e,!1);c.length>0&&Array.prototype.push.apply(l,c)}}e+=o.toString().length+1}return l}}}}}),dl,_s,cl,Tt,co=I({"src/heading.ts"(){"use strict";var e,t,qi,n;X(),Oe(),be(),Ne(),D(),J(),xt(),dl=[Te],Tt=(n=class extends(cl=z){constructor(s,l,o,u=[]){super(void 0,o,u);P(this,t);P(this,e);F(this,e,s);const a=new z(l[0],o,u);a.type="heading-title",a.setAttribute("stage",2);const d=new He(l[1],"heading-trail",o,u);this.append(a,d)}get type(){return"heading"}get level(){return b(this,e)}toString(s){const l=j(this,t,qi).call(this);return l+this.firstChild.toString(s)+l+this.lastChild.toString(s)}text(){const s=j(this,t,qi).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 o=super.lint(s,l),{firstChild:u,level:a}=this,d=u.toString(),c=d.startsWith("="),m=c||d.endsWith("="),f=new pe(this,s),y=this.inHtmlAttrs(),S=["h1","unbalanced-header","format-leakage"],{lintConfig:k}=N,{computeEditInfo:_,fix:T}=k,g=S.map(h=>k.getSeverity(h,"apostrophe"));if(g[0]&&this.level===1){const h=Q(u,f,S[0],"<h1>",g[0]);_&&!m&&(h.suggestions=[We(h,"h2",`=${d}=`)]),o.push(h)}if(g[1]&&m){const h=N.msg("unbalanced-in-section-header",'"="'),x=Q(u,f,S[1],h,g[1]);if(!(!_||d==="="))if(c){const[p]=/^=+/u.exec(d),$=a+p.length;x.suggestions=[{desc:`h${a}`,range:[x.startIndex,x.startIndex+p.length],text:""}],$<7&&x.suggestions.push({desc:`h${$}`,range:[x.endIndex,x.endIndex],text:p})}else{const p=/[^=](=+)$/u.exec(d)[1],$=a+p.length;x.suggestions=[{desc:`h${a}`,range:[x.endIndex-p.length,x.endIndex],text:""}],$<7&&x.suggestions.push({desc:`h${$}`,range:[x.startIndex,x.startIndex],text:p})}o.push(x)}if(y){const h="parsing-order",x=k.getSeverity(h,y===2?"heading":"templateInTable");x&&o.push(Y(this,f,h,"header-in-html",x))}if(g[2]){const h=this.getRootNode().toString(),x=u.childNodes.filter(es("quote")),p=x.filter(({bold:v})=>v),$=x.filter(({italic:v})=>v);if(p.length%2){const v=Q(p[p.length-1],{...f,start:s+a,left:f.left+a},S[2],N.msg("unbalanced-in-section-header","bold-apostrophes"),g[2]);if(_||T){const w=s+a+d.length,A=ee(v);h.slice(v.endIndex,w).trim()?_&&(v.suggestions=[A,Ze(w,"'''")]):p.length===1&&$.length===0?v.fix=A:_&&(v.suggestions=[A])}o.push(v)}if($.length%2){const v=Q($[$.length-1],{start:s+a},S[2],N.msg("unbalanced-in-section-header","italic-apostrophes"),g[2]);if(_||T){const w=s+a+d.length;h.slice(v.endIndex,w).trim()?_&&(v.suggestions=[Ze(w,"''")]):$.length===1&&p.length===0?v.fix=ee(v):_&&(v.suggestions=[ee(v)])}o.push(v)}}return o}}print(){const s=j(this,t,qi).call(this);return super.print({pre:s,sep:s})}json(s,l=this.getAbsoluteIndex()){{const o=super.json(void 0,l);return o.level=this.level,o}}},e=new WeakMap,t=new WeakSet,qi=function(){return"=".repeat(this.level)},n),_s=ae(cl),Tt=re(_s,0,"HeadingToken",dl,Tt),ne(_s,1,Tt)}}),hl,Ts,gl,si,ad=I({"src/hidden.ts"(){"use strict";vt(),Ne(),J(),hl=[tt(),Te],si=class extends(gl=z){get type(){return"hidden"}getAttribute(e){return e==="invalid"||super.getAttribute(e)}},Ts=ae(gl),si=re(Ts,0,"HiddenToken",hl,si),ne(Ts,1,si)}}),pl,Cs,fl,ni,od=I({"src/arg.ts"(){"use strict";var e,ho,i;ve(),X(),be(),it(),Vi(),Ne(),D(),J(),mt(),ad(),pl=[Te,Ge("{{{"),Si()],ni=(i=class extends(fl=z){constructor(r,s,l=[]){super(void 0,s,l,{});P(this,e);for(let o=0;o<r.length;o++){const u=r[o];if(o===0){const a=new Me(u,"arg-name",s,l,{});super.insertAt(a)}else if(o>1){const a=new si(u,s,l);super.insertAt(a)}else{const a=new z(u,s,l);a.type="arg-default",a.setAttribute("stage",2),super.insertAt(a)}}}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`{{{${ft(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){j(this,e,ho).call(this),super.afterBuild()}lint(r=this.getAbsoluteIndex(),s){{const{childNodes:[l,o,...u]}=this;l.setAttribute("aIndex",r+3);const a=l.lint(r+3,s);if(o){const k=r+4+l.toString().length;o.setAttribute("aIndex",k);const _=o.lint(k,s);_.length>0&&Array.prototype.push.apply(a,_)}const d=["no-ignored","no-arg"],{lintConfig:c}=N,{computeEditInfo:m}=c,f=new pe(this,r),y=d.map(k=>c.getSeverity(k,"arg"));if(y[0]&&u.length>0&&Array.prototype.push.apply(a,u.map(k=>{const _=Q(k,f,d[0],"invisible-triple-braces",y[0]);return _.startIndex--,_.startCol--,m&&(_.suggestions=[ee(_),Ot(_.startIndex,"{{!}}")]),_})),y[1]&&!this.getAttribute("include")){const k=Y(this,f,d[1],"unexpected-argument",y[1]);m&&o&&(k.suggestions=[We(k,"expand",o.text())]),a.push(k)}const S=this.closest("ext");if(S){const k="arg-in-ext",_=c.getSeverity(k,S.name);_&&a.push(Y(this,f,k,"argument-in-ext",_))}return a}}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,ho=function(){this.setAttribute("name",this.firstChild.text().trim())},i),Cs=ae(fl),ni=re(Cs,0,"ArgToken",pl,ni),ne(Cs,1,ni)}}),go={};oe(go,{parseBraces:()=>Yi});var ml,Is,Ii,Ns,Ls,Fs,xl,Es,Yi,or=I({"parser/braces.ts"(){"use strict";et(),ve(),co(),Qa(),od(),ml={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},Is=String.raw`\[(?!\[)`,Ii=String.raw`\n(?![=\0])`,Ns=String.raw`|\{{2,}`,Ls=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),Fs=ht(e=>new RegExp(e,"gmu")),xl=new RegExp(String.raw`\{\{((?:[^\n{}[]|${Is}|${Ii})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${Ii})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${Is}|${Ii})*\}-`,"gu"),Es=e=>{const t=Rt(Ie(e));return Ls.has(t)?Ls.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},Yi=(e,t,i)=>{var y,S,k,_,T;const n=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,r]}=t,s=[],l=[],o=(g,h,x,p)=>{h[h.length-1].push(Re(g.slice(x,p),l))};let u;do u!==void 0&&(e=u),u=e.replace(xl,(g,h,x)=>{if(h!==void 0||typeof x=="string")try{const{length:p}=i,$=(h!=null?h:x).split("|");return new ot(Re($[0],l),$.slice(1).map(v=>{const w=v.indexOf("=");return(w===-1?[v]:[v.slice(0,w),v.slice(w+1)]).map(A=>Re(A,l))}),t,i),`\0${p}${Es($[0])}`}catch(p){if(!(p instanceof SyntaxError)||p.message!=="Invalid template name")throw p}return l.push(Re(g,l)),`\0${l.length-1}`});while(u!==e);e=u;const a=e.lastIndexOf("}}")-e.length;let d=a+e.length!==-1,c=Fs(n+(d?Ns:"")),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=(k=s.pop())!=null?k:{},{0:p,index:$,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||Ie(e.slice(q,$))!==""){const O=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(e.slice($,h));O&&(O[2]=Re(O[2],l),O[2].includes(`
|
|
13
|
+
`)||(e=`${e.slice(0,$)}\0${i.length}h${e.slice(h)}`,f=$+4+String(i.length).length,new Tt(O[1].length,O.slice(2),t,i)))}}else if(g==="|"||C)f=h+1,o(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,o(e,v,A,h);let W=!1,E="t";if(q.length===3){const R=v.map(M=>M.join("=")),U=R.length>1&&Ie(R[1]).trim();new ni(R,t,i),U&&U.endsWith(":")&&r.includes(U.slice(0,-1).toLowerCase())&&(E="s")}else try{new ot(v[0][0],v.slice(1),t,i),E=Es(v[0][0])}catch(R){if(R instanceof SyntaxError&&R.message==="Invalid template name")W=!0;else throw R}W||(e=`${e.slice(0,$+B)}\0${O}${E}${e.slice(f)}`,f=$+B+3+String(O).length,B>1?s.push({0:p.slice(0,B),index:$,pos:$+B,parts:[[]]}):B===1&&e[$-1]==="-"&&s.push({0:"-{",index:$-1,pos:$+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(d&&a+e.length<f)for(d=!1;(T=L==null?void 0:L[0])!=null&&T.startsWith("{");)s.pop(),L=s[s.length-1];c=Fs(n+(d?Ns:"")+(L?`|${ml[L[0][0]]}${L.findEqual?"|=":""}`:"")),c.lastIndex=f,m=c.exec(e)}return Re(e,l)}}}),po={};oe(po,{InputboxToken:()=>fo});var fo,ud=I({"src/multiLine/inputbox.ts"(){"use strict";Zi(),or(),D(),uo(),fo=class extends ar{constructor(e,t,i=N.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=Ai(t,s,n,e)),t&&(t=Yi(t,s,n)),n.splice(l,1),super(e,t,s,n,{})}}}}),Wi={};oe(Wi,{NestedToken:()=>mo});var vl,bl,mo,js=I({"src/nested.ts"(){"use strict";var e,t,i;X(),be(),Zi(),or(),D(),J(),Ro(),qt(),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")}),mo=(i=class extends z{constructor(r,s,l,o,u=[]){if(typeof s=="boolean"){const a=Symbol("NestedToken"),{length:d}=u;u.push(a),r&&(r=Ai(r,o,u,s)),r&&(r=Yi(r,o,u)),u.splice(d,1)}else r&&(r=r.replace(s,(a,d,c,m,f)=>{const y=`\0${u.length+1}e`;return new Lt(d,c,m,f,o,!1,u),y}));r&&(r=r.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(a,d,c)=>(new Pe(c,o,u),`${d}\0${u.length}n`)));super(r,o,u);P(this,e);P(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),o="no-ignored",{lintConfig:u}=N,a=u.getSeverity(o,this.name);if(!a)return l;const d=new pe(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=Q(m,d,o,N.msg("invalid-content",this.name),a);return u.computeEditInfo&&(f.suggestions=[ee(f),Vn(f,m.toString())]),f})]}}},e=new WeakMap,t=new WeakMap,i)}});function yl(e,t,i,n,r){t=Ie(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":{if(s){if(xo(i.protocol).test(s))return vo(i.protocol).test(s)&&t;s.startsWith("[[")&&s.endsWith("]]")&&(s=s.slice(2,-2))}else return t;const l=N.normalizeTitle(s,0,!1,i,{halfParsed:n,decode:!0,selfLink:!0,page:""});return l.valid&&l}case"lang":return(r==="svg"||r==="svgz")&&!/[^a-z\d-]/u.test(s);case"alt":case"class":case"manualthumb":return!0;case"page":return(r==="djvu"||r==="djv"||r==="pdf")&&Number(s)>0;default:return!!s&&!isNaN(s)}}var xo,vo,wl,Sl,Mi,Al,kl,Rs,$l,ri,dd=I({"src/imageParameter.ts"(){"use strict";var e,t,bo,r;et(),ve(),X(),De(),Oe(),Ne(),D(),J(),xo=ht(s=>new RegExp(String.raw`^(?:${s}|//|\0\d+m\x7F)`,"iu")),vo=ht(s=>new RegExp(String.raw`^(?:(?:${s}|//)${Et}|\0\d+m\x7F)${jt}$`,"iu")),wl=ht(s=>new RegExp(String.raw`^(\s*(?!\s))${s.replace("$1","(.*)")}${s.endsWith("$1")?`(?=$|
|
|
14
|
+
)`:""}(\s*)$`,"u")),Sl=new Set(["alt","link","lang","page","caption"]),Mi=new Set(["tiff","tif","png","gif","jpg","jpeg","webp","xcf","pdf","svg","djvu"]),Al=s=>{if(s)s.startsWith("//")&&(s=`https:${s}`);else return s;return new URL(s).href},kl=[Te],ri=(r=class extends($l=z){constructor(l,o,u,a){var s=(...n)=>(super(...n),P(this,t),P(this,e,""),this);let d;const c=Object.entries(u.img).map(([f,y])=>[f,y,wl(f)]),m=c.find(([,f,y])=>(d=y.exec(l),d&&(d.length!==4||yl(f,d[2],u,!0,o)!==!1)));if(m&&d){d.length===3?(s(void 0,u,a),F(this,e,l)):(s(d[2],u,a,{}),F(this,e,d[1]+m[0]+d[3])),this.setAttribute("name",m[1]),m[1]==="alt"&&this.setAttribute("stage",ke-1);return}s(l,u.excludes.includes("list")?u:{...u,excludes:[...u.excludes,"list"]},a),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 we.run(()=>{const o=new z(l,this.getAttribute("config"));return o.parseOnce(0,this.getAttribute("include")).parseOnce(),/^\0\d+m\x7F/u.test(o.firstChild.toString())?l:yl("link",l,this.getAttribute("config"))})}}afterBuild(){var l;(l=this.parentNode)!=null&&l.is("gallery-image")&&!Sl.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(),o){{const u=super.lint(l,o),{lintConfig:a}=N,{computeEditInfo:d,fix:c}=a,{link:m,name:f}=this,y=f==="width"&&this.getValue();if(f==="invalid"||y&&y.endsWith("px")){const S="invalid-gallery",k=a.getSeverity(S,"parameter");if(k){const _=Y(this,{start:l},S,"invalid-image-parameter",k);(d||c)&&(_.fix=y?ee(_,0,y):ee(_,-1)),u.push(_)}}else if(f==="link"){if(typeof m=="string"){const S="invalid-url",k=a.getSeverity(S);if(k&&!this.querySelector("magic-word"))try{Al(m)}catch{u.push(Y(this,{start:l},S,"invalid-url",k))}}else if(m.encoded){const S="url-encoding",k=a.getSeverity(S,"file");if(k){const _=Y(this,{start:l},S,"unnecessary-encoding",k);(d||c)&&(_.fix=Dn(_,this)),u.push(_)}}}else if(f==="manualthumb"){const S="invalid-gallery",k=a.getSeverity(S,"thumb");if(k&&!this.querySelector("arg,magic-word,template")){const{valid:_,ns:T,extension:g}=this.thumb;(!_||T!==6||!Mi.has(g))&&u.push(Y(this,{start:l},S,"invalid-thumb",k))}}return u}}getValue(){return this.name==="invalid"?this.text():j(this,t,bo).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">${Pt(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}},e=new WeakMap,t=new WeakSet,bo=function(){return b(this,e)&&!b(this,e).includes("$1")},r),Rs=ae($l),ri=re(Rs,0,"ImageParameterToken",kl,ri),ne(Rs,1,ri)}}),Ps,_l,Tl,Os,Bs,Cl,qs,ur,yo=I({"src/link/file.ts"(){"use strict";X(),be(),D(),Qi(),dd(),Ps=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),_l=new Set(["arg"]),Tl=new Set(["template","magic-word"]),Os=new Set(["left","right","center","none"]),Bs=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),Cl=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:o}=n;l!=="|"?r+=l==="-{"?1:-1:r===0&&(i.push(e.slice(s,o)),{lastIndex:s}=t),n=t.exec(e)}return i.push(e.slice(s)),i},qs=(e,t)=>e.filter(({childNodes:i})=>!i.some(n=>n.text().trim()&&t.has(n.type))),ur=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(Cl(t).map(l=>new ri(l,s,i,n)))}lint(e=this.getAbsoluteIndex(),t){var i;{const n=super.lint(e,t),r=qs(this.getAllArgs(),_l),s=[...new Set(r.map(({name:p})=>p))],l=s.filter(p=>Ps.has(p)),o=s.filter(p=>Os.has(p)),u=s.filter(p=>Bs.has(p)),[a]=l,d=a==="framed"||a==="manualthumb",c=new pe(this,e),{lintConfig:m}=N,{computeEditInfo:f,fix:y}=m,{ns:S,extension:k}=this.getAttribute("title"),{firstChild:_}=this;let T="nested-link",g=m.getSeverity(T,"file");if(g&&Mi.has(k)&&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 $=this.getArg("link");if($){const v=e+$.getRelativeIndex();p.fix={desc:N.msg("delink"),range:[v,v+$.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&&!k&&!_.querySelector("arg,magic-word,template")&&n.push(Y(this,c,T,"missing-extension",g)),g=m.getSeverity(T,"parameter"),g&&d)for(const p of r.filter(({name:$})=>$==="width")){const $=Q(p,c,T,"invalid-image-parameter",g);(f||y)&&($.fix=ee($,-1)),n.push($)}if(r.length===s.length&&l.length<2&&o.length<2&&u.length<2)return n;T="no-duplicate";const h=["unknownImageParameter","imageParameter"].map(p=>m.getSeverity(T,p)),x=(p,$,v,w=!0)=>p.map(A=>{if(g=h[Number(typeof w=="function"?w(A):w)],!g)return!1;const C=Q(A,c,T,N.msg(`${$}-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"&&d)continue;const $=p==="caption";let v=r.filter(({name:w})=>w===p);if($&&(v=[...v.slice(0,-1).filter(w=>w.text()),...v.slice(-1)]),v.length>1){let w=!$||!k||Mi.has(k);if($&&w){const A=qs(v,Tl);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})=>Ps.has(p)),"conflicting","frame")),o.length>1&&Array.prototype.push.apply(n,x(r.filter(({name:p})=>Os.has(p)),"conflicting","horizontal-alignment")),u.length>1&&Array.prototype.push.apply(n,x(r.filter(({name:p})=>Bs.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}}}}}),Il,Ws,Nl,Ct,wo=I({"src/link/galleryImage.ts"(){"use strict";var e,Cn,i;X(),De(),it(),D(),J(),yo(),Il=[Ge("")],Ct=(i=class extends(Nl=ur){constructor(r,s,l,o,u=[]){let a;if(l!==void 0){const{length:d}=u;a=new z(l,o,u);for(let c=0;c<ke-1;c++)a.parseOnce();u.splice(d,1)}super(s,a==null?void 0:a.firstChild.toString(),o,u);P(this,e);Fe(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),o="invalid-gallery",{lintConfig:u}=N,a=u.getSeverity(o,"image");if(a&&j(this,e,Cn).call(this)){const d=Y(this,{start:r},o,"invalid-gallery",a);u.computeEditInfo&&(d.suggestions=[Di(r,"prefix","File:")]),l.push(d)}return l}}getAttribute(r){return r==="invalid"?j(this,e,Cn).call(this):super.getAttribute(r)}},e=new WeakSet,Cn=function(){const{ns:r}=this.getAttribute("title");return r!==6},i),Ws=ae(Nl),Ct=re(Ws,0,"GalleryImageToken",Il,Ct),ne(Ws,1,Ct)}}),zi,So=I({"src/nowiki/commentLine.ts"(){"use strict";qt(),zi=class extends Pe{}}}),Ao={};oe(Ao,{GalleryToken:()=>ko});var ko,cd=I({"src/multiLine/gallery.ts"(){"use strict";var e,$o,In,n;X(),D(),lr(),wo(),So(),ko=(n=class extends Ki{constructor(s,l,o=[]){var u;super(void 0,l,o,{});P(this,e);for(const a of(u=s==null?void 0:s.split(`
|
|
15
|
+
`))!=null?u:[]){const d=/^([^|]+)(?:\|(.*))?/u.exec(a);if(!d){super.insertAt(a.trim()?new zi(a,l,o):a);continue}const[,c,m]=d;j(this,e,$o).call(this,c)?super.insertAt(new Ct("gallery",c,m,l,o)):super.insertAt(new zi(a,l,o))}}get widths(){return j(this,e,In).call(this,"widths")}get heights(){return j(this,e,In).call(this,"heights")}lint(s=this.getAbsoluteIndex(),l){{const{top:o,left:u}=this.getRootNode().posFromIndex(s),a=[],d="no-ignored",{lintConfig:c}=N,m=["Image","NoImage","Comment"].map(f=>c.getSeverity(d,`gallery${f}`));for(let f=0;f<this.length;f++){const y=this.childNodes[f],S=y.toString(),{length:k}=S,_=S.trim(),{type:T}=y,g=o+f,h=f?0:u;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:d,message:N.msg("invalid-content","gallery"),severity:x,startIndex:s,endIndex:p,startLine:g,endLine:g,startCol:h,endCol:h+k};c.computeEditInfo&&($.suggestions=[ee($),Vn($,S)]),a.push($)}}else if(T!=="noinclude"&&T!=="text"){const x=y.lint(s,l);x.length>0&&Array.prototype.push.apply(a,x)}s+=k+1}return a}}json(s,l=this.getAbsoluteIndex()){{const o=super.json(void 0,l);return Object.assign(o,{widths:this.widths,heights:this.heights}),o}}},e=new WeakSet,$o=function(s){return this.normalizeTitle(s,6,{halfParsed:!0,temporary:!0,decode:!0,page:""}).valid},In=function(s){var l,o;{const u=(l=this.parentNode)==null?void 0:l.getAttr(s),a=typeof u=="string"&&((o=/^(\d+)\s*(?:px)?$/u.exec(u))==null?void 0:o[1]);return a&&Number(a)||120}},n)}}),dr,_o=I({"src/link/index.ts"(){"use strict";et(),X(),D(),Qi(),dr=class extends Xe{get type(){return"link"}get innerText(){return this.length>1?this.lastChild.text():xi(this.firstChild.text().replace(/^\s*:?/u,""))}lint(e=this.getAbsoluteIndex(),t){{const i=super.lint(e,t),n="nested-link",{lintConfig:r}=N,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=We(l,"delink",this.innerText)),i.push(l)}return i}}}}}),Ll,Fl,yi,cr=I({"src/magicLink.ts"(){"use strict";var e,t,Nn,n;X(),ve(),be(),D(),J(),Ll=String.raw`(?:[${Ye}\t]| |�*160;|&#[xX]0*[aA]0;)`,Fl=new RegExp(`${Ll}+`,"gu"),yi=(n=class extends z{constructor(s,l="free-ext-link",o=N.getConfig(),u){super(s,o,u,{});P(this,t);P(this,e);F(this,e,l)}get type(){return b(this,e)}get innerText(){const s=new Map([["!","|"],["=","="]]);let l=ft(this.childNodes.map(o=>{const{type:u}=o,a=String(o.name);return u==="magic-word"&&s.has(a)?s.get(a):o}));return this.type==="magic-link"&&(l=l.replace(Fl," ")),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 o=super.lint(s,l),u=new pe(this,s),{lintConfig:a}=N,{type:d,childNodes:c}=this;if(d==="magic-link"){const S="invalid-isbn",k=a.getSeverity(S);return k&&j(this,t,Nn).call(this)&&o.push(Y(this,u,S,"invalid-isbn",k)),o}let m="invalid-url",f=a.getSeverity(m);if(f&&!this.querySelector("magic-word"))try{this.getUrl()}catch{o.push(Y(this,u,m,"invalid-url",f))}const y=d==="ext-link-url";if(m="unterminated-url",f=a.getSeverity(m,y?"pipe":"punctuation"),f){const S=y?/\|/u:/[,;。:!?()]+/u,k=c.find(_=>_.type==="text"&&S.test(_.data));if(k){const{data:_}=k,T=Q(k,u,m,N.msg("in-url",y?'"|"':"full-width-punctuation"),f);if(a.computeEditInfo){const{index:g,0:h}=S.exec(_),x=T.startIndex+g;T.suggestions=y?[bi(x,1)]:[bi(x),{desc:N.msg("encode"),range:[x,x+h.length],text:encodeURI(h)}]}o.push(T)}}return o}}getUrl(s){{const{type:l}=this;let{link:o}=this;if(l==="magic-link"){if(o.startsWith("ISBN"))return this.normalizeTitle(`BookSources/${o.slice(5)}`,-1,{temporary:!0}).getUrl(s);o=o.startsWith("RFC")?`https://datatracker.ietf.org/doc/html/rfc${o.slice(4)}`:`https://pubmed.ncbi.nlm.nih.gov/${o.slice(5)}`}else o.startsWith("//")&&(o=`https:${o}`);return new URL(o)}this.lspError("MagicLinkToken.getUrl")}getAttribute(s){return s==="invalid"?j(this,t,Nn).call(this):super.getAttribute(s)}},e=new WeakMap,t=new WeakSet,Nn=function(){if(this.type==="magic-link"){const{link:s}=this;if(s.startsWith("ISBN")){const l=[...s.slice(5)].map(o=>o==="X"?10:Number(o));return l.length===10?l.reduce((o,u,a)=>o+u*(10-a),0)%11!==0:l.length===13&&(l[12]===10||l.reduce((o,u,a)=>o+u*(a%2?3:1),0)%10!==0)}}return!1},n)}}),El,Us,jl,It,To=I({"src/extLink.ts"(){"use strict";var e,t;De(),X(),it(),D(),J(),cr(),El=[Ge("[")],It=(t=class extends(jl=z){constructor(n,r="",s="",l,o=[]){super(void 0,l,o,{});P(this,e);const u=n&&/^\0\d+f\x7F$/u.test(n)?o[Number(n.slice(1,-2))]:new yi(n,"ext-link-url",l,o);if(this.insertAt(u),F(this,e,r),s){const a=new z(s,l,o,{});a.type="ext-link-text",a.setAttribute("stage",ke-1),this.insertAt(a)}}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",o=N.lintConfig.getSeverity(l,"extLink");return o&&this.length===1&&this.isInside("heading-title")&&s.push(Y(this,{start:n},l,"variable-anchor",o)),s}}print(){return super.print(this.length===1?{pre:"[",post:`${b(this,e)}]`}:{pre:"[",sep:b(this,e),post:"]"})}},e=new WeakMap,t),Us=ae(jl),It=re(Us,0,"ExtLinkToken",El,It),ne(Us,1,It)}}),Ln,hd=I({"src/imagemapLink.ts"(){"use strict";J(),qt(),_o(),To(),Ln=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 dr(...t,n,r):new It(...t,n,r),new Pe(i,n,r))}}}}),Co={};oe(Co,{ImagemapToken:()=>Io});var Io,gd=I({"src/multiLine/imagemap.ts"(){"use strict";X(),Oe(),be(),D(),lr(),So(),wo(),hd(),Io=class extends Ki{get image(){return this.childNodes.find(es("imagemap-image"))}constructor(e,t=N.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 o of n){const u=o.trim();if(!(l||!u||u.startsWith("#"))){if(s){const a=o.indexOf("|"),d=a===-1?o:o.slice(0,a),{valid:c,ns:m}=this.normalizeTitle(d,0,{halfParsed:!0,temporary:!0,page:""});if(c&&m===6){const f=new Ct("imagemap",d,a===-1?void 0:o.slice(a+1),t,i);super.insertAt(f),s=!1;continue}else l=!0}else if(o.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(o);continue}else if(o.includes("[")){const a=o.indexOf("["),d=o.slice(a),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 Ln(o.slice(0,a),c.slice(1),d.slice(d.indexOf("]]")+2),t,i));continue}}else if(d.startsWith("[//")||r.has(d.slice(1,d.indexOf(":")+1))||r.has(d.slice(1,d.indexOf("//")+2))){const m=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(d);if(m){super.insertAt(new Ln(o.slice(0,a),m.slice(1),d.slice(d.indexOf("]")+1),t,i));continue}}}}super.insertAt(new zi(o,t,i))}}lint(e=this.getAbsoluteIndex(),t){{const i=super.lint(e,t),n=new pe(this,e),{childNodes:r,image:s}=this,l="invalid-imagemap",{lintConfig:o}=N,u=o.getSeverity(l,s?"link":"image");return u&&(s?Array.prototype.push.apply(i,r.filter(a=>{const d=a.toString().trim();return a.is("noinclude")&&d&&!d.startsWith("#")}).map(a=>{const d=Q(a,n,l,"invalid-imagemap-link",u);return o.computeEditInfo&&(d.suggestions=[ee(d,-1),We(d,"comment","# ")]),d})):i.push(Y(this,n,l,"imagemap-without-image",u))),i}}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}}}}),Rl,Ms,Pl,Nt,No=I({"src/nowiki/comment.ts"(){"use strict";X(),vt(),it(),D(),bt(),Rl=[tt(!1),Ge("<!--")],Nt=class extends(Pl=Ue){constructor(t,i,n,r){super(t,n,r);Fe(this,"closed");this.closed=i}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){{if(this.closed)return[];const i="unclosed-comment",{lintConfig:n}=N,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(Pl),Nt=re(Ms,0,"CommentToken",Rl,Nt),ne(Ms,1,Nt)}}),Lo={};oe(Lo,{CommentedToken:()=>Fo});var Fo,pd=I({"src/commented.ts"(){"use strict";J(),No(),Fo=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 Nt(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"))}}}}),Eo={};oe(Eo,{NowikiToken:()=>jo});var Ol,Bl,jo,fd=I({"src/nowiki/index.ts"(){"use strict";var e,Fn,i;et(),X(),D(),bt(),Ol=ht(n=>new RegExp(String.raw`<\s*(?:/\s*)${n==="nowiki"?"":"?"}(${n})\b`,"giu")),Bl=new Set(["languages","section","templatestyles"]),jo=(i=class extends Ue{constructor(){super(...arguments);P(this,e)}get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex()){{const{name:s}=this,{lintConfig:l}=N;let o="void-ext",u=l.getSeverity(o,s);if(u&&j(this,e,Fn).call(this)){const d=Y(this,{start:r},o,N.msg("nothing-in",s),u);return l.computeEditInfo&&(d.suggestions=[ee(d)]),[d]}return super.lint(r,Ol(s))}}getAttribute(r){return r==="invalid"?j(this,e,Fn).call(this):super.getAttribute(r)}},e=new WeakSet,Fn=function(){const{name:r,firstChild:{data:s}}=this;return Bl.has(r)&&!!s},i)}}),ql,zs,Wl,Lt,Ro=I({"src/tagPair/ext.ts"(){"use strict";X(),be(),D(),tr(),J(),Zn(),rr(),ql=[Ji()],Lt=class extends(Wl=ut){get type(){return"ext"}constructor(e,t,i,n,r=N.getConfig(),s=!1,l=[]){const o=e.toLowerCase(),u=new Xi(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",o,r,l),a={...r,ext:r.ext.filter(c=>c!==o),excludes:[...r.excludes],inExt:!0};let d;switch(o){case"tab":a.ext=a.ext.filter(c=>c!=="tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":o==="poem"&&a.excludes.push("heading"),d=new z(i,a,l);break;case"pre":{const{PreToken:c}=(rd(),ie(ro));d=new c(i,a,l);break}case"dynamicpagelist":{const{ParamTagToken:c}=(uo(),ie(oo));d=new c(s,i,a,l);break}case"inputbox":{const{InputboxToken:c}=(ud(),ie(po));d=new c(s,i,a,l);break}case"references":{const{NestedToken:c}=(js(),ie(Wi));a.excludes.push("heading"),d=new c(i,s,["ref"],a,l);break}case"choose":{const{NestedToken:c}=(js(),ie(Wi));d=new c(i,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],a,l);break}case"combobox":{const{NestedToken:c}=(js(),ie(Wi));d=new c(i,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],a,l);break}case"gallery":{const{GalleryToken:c}=(cd(),ie(Ao));d=new c(i,a,l);break}case"imagemap":{const{ImagemapToken:c}=(gd(),ie(Co));d=new c(i,a,l);break}case"hiero":{const{CommentedToken:c}=(pd(),ie(Lo));d=new c(i,a,l);break}default:{const{NowikiToken:c}=(fd(),ie(Eo));d=new c(i,a,l)}}d.setAttribute("name",o),d.type==="plain"&&(d.type="ext-inner"),super(e,u,d,n,r,l),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){{const i=super.lint(e,t),{lintConfig:n}=N,r=new pe(this,e);if(this.name!=="nowiki"){const s=this.inHtmlAttrs(),l="parsing-order",o=s&&n.getSeverity(l,s===2?"ext":"templateInTable");o&&i.push(Y(this,r,l,"ext-in-html",o))}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}}},zs=ae(Wl),Lt=re(zs,0,"ExtToken",ql,Lt),ne(zs,1,Lt)}}),Po={};oe(Po,{parseCommentAndExt:()=>Ai});var Hs,Ul,Ni,Ml,Ds,Ai,Zi=I({"parser/commentAndExt.ts"(){"use strict";et(),ve(),ed(),qt(),id(),sd(),Ro(),No(),Hs="<onlyinclude>",Ul="</onlyinclude>",{length:Ni}=Hs,Ml=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",i=e?"noinclude":"includeonly";return ht(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+Ni)}},Ai=(e,t,i,n)=>{if(n){let{i:u,j:a}=Ds(e);if(u!==-1&&a!==-1){let d="";const c=m=>{new Pe(m,t,i),d+=`\0${i.length-1}n`};for(;u!==-1&&a!==-1;){const m=`\0${i.length}g`;new ti(e.slice(u+Ni,a),t,i),u>0&&c(e.slice(0,u)),d+=m,e=e.slice(a+Ni+1),{i:u,j:a}=Ds(e)}return e&&c(e),d}}const{ext:r}=t;let s=r,l=t;if(r.includes("translate")){s=r.filter(a=>a!=="translate"&&a!=="tvar"),l={...t,ext:s};const u=[];e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,a=>(u.push(a),`\0${u.length-1}`)).replace(/<translate( nowrap)?>([\s\S]*?)<\/translate>/gu,(a,d,c)=>{const m=i.length;return new eo(d,c&&Re(c,u),l,i),`\0${m}g`}),e=Re(e,u)}const o=Ml[n?1:0](s.join("|"));return o.lastIndex=0,o.test(e)?e.replace(o,(u,a,d,c,m,f,y,S,k)=>{const _=i.length;let T="n";if(a)T="e",new Lt(a,d,c,m,l,f,i);else if(u.startsWith("<!--")){T="c";const g=u.endsWith("-->");new Nt(Re(u,i,1).slice(4,g?-3:void 0),g,t,i)}else f?new ii(f,y&&Re(y,i,1),S&&Re(S,i,1),k,t,i):new Pe(u,t,i,!0);return`\0${_}${T}`}):e}}}),zl,Hl,Dl,Gl,Gs,Vl,li,md=I({"src/tag/html.ts"(){"use strict";var e,t;X(),be(),tr(),D(),Za(),zl=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),Hl=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"]),Dl=new Set(["strike","big","center","font","tt"]),Gl=[Ji()],li=(t=class extends(Vl=er){constructor(n,r,s,l,o,u){super(n,r,s,o,u);P(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:o,closing:u,selfClosing:a}=this,d=new pe(this,n),{lintConfig:c}=N,{computeEditInfo:m,fix:f}=c,y=this.inTableAttrs();let S="h1",k=c.getSeverity(S,"html");if(k&&l==="h1"&&!u){const p=Y(this,d,S,"<h1>",k);m&&(p.suggestions=[{desc:"h2",range:[n+2,n+3],text:"2"}]),s.push(p)}if(S="parsing-order",k=y&&c.getSeverity(S,y===2?"html":"templateInTable"),k){const p=Y(this,d,S,"html-in-table",k);m&&y===2&&(p.suggestions=[ee(p)]),s.push(p)}if(S="obsolete-tag",k=c.getSeverity(S,l),k&&Dl.has(l)&&s.push(Y(this,d,S,"obsolete-tag",k)),S="bold-header",k=c.getSeverity(S,l),k&&(l==="b"||l==="strong")&&this.isInside("heading-title")){const p=Y(this,d,S,"bold-in-header",k);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",u&&(a||g)||a&&x){if(k=c.getSeverity(S,u?"both":"selfClosing"),k){const p=Y(this,d,S,u?"closing-and-self-closing":"invalid-self-closing",k);if(m||f){const $=Gn(n),v={desc:N.msg("no-self-closing"),range:[p.endIndex-2,p.endIndex-1],text:""};h?m&&(p.suggestions=[$,v]):u?p.fix=g?$:v:m&&(p.suggestions=[v,Ze(p.endIndex,`></${l}>`,-2)])}s.push(p)}}else if(!this.findMatchingTag()){const p=Y(this,d,S,u?"unmatched-closing":"unclosed-tag"),$=this.closest("magic-word");if($&&zl.has($.name))k=c.getSeverity(S,"conditional");else if(u)k=c.getSeverity(S,"closing"),p.suggestions=[ee(p)];else{k=c.getSeverity(S,"opening");const v=o==null?void 0:o.childNodes;Hl.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",k=c.getSeverity("format-leakage",l)))}k&&(p.severity=k,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(Vl),li=re(Gs,0,"HtmlToken",Gl,li),ne(Gs,1,li)}}),Oo={};oe(Oo,{parseHtml:()=>Bo});var Ql,Bo,xd=I({"parser/html.ts"(){"use strict";rr(),md(),Ql=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,Bo=(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 o of r){const u=Ql.exec(o),a=u==null?void 0:u[2],d=a==null?void 0:a.toLowerCase();if(!u||!t.htmlElements.has(d)){s+=`<${o}`;continue}const[,c,,m="",f,y]=u,{length:S}=i,k=new Xi(m,"html-attrs",d,t,i),_=k.hasAttr("itemprop");if(d==="meta"&&!(_&&k.hasAttr("content"))||d==="link"&&!(_&&k.hasAttr("href"))){s+=`<${o}`,i.length=S;continue}s+=`\0${i.length}x${y}`,new li(a,k,c==="/",f==="/>",t,i)}return s}}}),Jl,Xl,Vs,Kl,Ft,qo=I({"src/table/base.ts"(){"use strict";tr(),D(),J(),xt(),rr(),Jl=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}=N.parseWithRef(t,e,2);e.safeReplaceChildren(i)},Xl=[Ji(1)],Ft=class extends(Kl=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?Jl(e):e.escape()}},Vs=ae(Kl),Ft=re(Vs,0,"TableBaseToken",Xl,Ft),ne(Vs,1,Ft)}}),Yl,Qs,_e,Li,Qt,Jt,Hi,Wo=I({"src/table/td.ts"(){"use strict";X(),be(),Yn(),D(),J(),qo(),Hi=class extends(Qs=Ft,Yl=[Gi(!1)],Qs){constructor(e,t,i,n=[]){var o;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(Li,5,this),Je(this,Qt),Je(this,_e,""),r&&([Uu(this,_e)._]=r);const l=new z(t==null?void 0:t.slice(((o=r==null?void 0:r.index)!=null?o: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 bn(this,Qt,Jt).call(this).subtype}afterBuild(){xe(this,_e).includes("\0")&&Ce(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 pe(this,e+this.getRelativeIndex(this.length-1)),r="pipe-like",{lintConfig:s}=N,{computeEditInfo:l,fix:o}=s,u=["td","double"].map(a=>s.getSeverity(r,a));for(const a of this.lastChild.childNodes)if(a.type==="text"){const{data:d}=a;if(d.includes("|")){const c=d.includes("||"),m=u[c?1:0];if(m){const f=Q(a,n,r,"pipe-in-table",m);if(l||o)if(c){const y={caption:"|+",td:"|",th:"!"}[this.subtype];f.fix=We(f,"newline",d.replace(/\|\|/gu,`
|
|
17
|
+
${y}`))}else l&&(f.suggestions=[Jn(f.startIndex,d)]);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)||Ce(this,_e,"{{!}}")),xe(this,_e)==="|"&&Ce(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}}},Li=ae(Qs),_e=new WeakMap,Qt=new WeakSet,Jt=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{...bn(e=r,Qt,Jt).call(e)}},Jt=re(Li,17,"#getSyntax",Yl,Qt,Jt),Mn(Li,Hi)}}),hr,Uo=I({"src/table/trBase.ts"(){"use strict";X(),D(),qo(),Wo(),hr=class extends Ft{lint(e=this.getAbsoluteIndex(),t){{const i=super.lint(e,t),n=this.childNodes.find(({type:o})=>o==="table-inter");if(!n)return i;const r=ci(n),s="fostered-content",l=r&&N.lintConfig.getSeverity(s,r===2?void 0:"transclusion");if(l){const o=Q(n,{start:e},s,"content-outside-table",l);o.startIndex++,o.startLine++,o.startCol=0,i.push(o)}return i}}getRowCount(){return Number(this.childNodes.some(e=>e instanceof Hi&&e.isIndependent()&&!e.firstChild.text().endsWith("+")))}}}}),Zl,ea,ta,ia,Js,Fi,Ui,vd=I({"src/table/index.ts"(){"use strict";X(),Oe(),be(),Yn(),D(),Uo(),xt(),Zl=(e,t)=>new Array(e).fill(void 0).map((i,n)=>t(n)),ea=({type:e})=>e==="tr"||e==="table-syntax",ta=class extends Array{},Ui=class extends(Js=hr,ia=[Gi(!1)],Js){constructor(e,t,i,n){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,"table",t,i,n,{}),ne(Fi,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 pe(this,e),r=["unclosed-table","table-layout"],s=r.map(l=>N.lintConfig.getSeverity(l));if(s[0]&&!this.closed&&i.push(Q(this.firstChild,n,r[0],"unclosed-table",s[0])),s[1]){const l=this.getLayout(),{length:o}=l;if(o>1){let u=1,a=1/0,d=0;for(;d<o;d++){const c=l[d],m=c.length;if(m<u)break;m<a&&(a=m);const f=c.indexOf(c[m-1])+1;if(f>a)break;f>u&&(u=f)}if(d<o){const c=this.getNthRow(d),m=Q(c,n,r[1],"inconsistent-table",s[1]);m.startIndex++,m.startLine++,m.startCol=0,i.push(m)}}}return i}}close(e=`
|
|
19
|
+
|}`,t){we.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(Zl(i,()=>[]));for(let r=0;r<n.length;r++){const s=n[r];let l=0,o=0,u;for(const a of t[r].childNodes.slice(2))if(a.is("td")){if(a.isIndependent()&&(u=a.subtype!=="caption"),u){const d={row:r,column:l},{rowspan:c,colspan:m}=a;for(l++;s[o];)o++;for(let f=r;f<Math.min(r+c,i);f++)for(let y=o;y<o+m;y++)n[f][y]=d;o+=m}}else if(ea(a))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}}},Fi=ae(Js),re(Fi,1,"getLayout",ia,Ui),Mn(Fi,Ui)}}),Mo,bd=I({"src/table/tr.ts"(){"use strict";Uo(),Mo=class extends hr{get type(){return"tr"}constructor(e,t,i,n){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,e,"tr",t,i,n)}}}}),gr,zo=I({"src/nowiki/listBase.ts"(){"use strict";bt(),gr=class extends Ue{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}}}}}),pr,Ho=I({"src/nowiki/dd.ts"(){"use strict";zo(),pr=class extends gr{get type(){return"dd"}}}}),Do={};oe(Do,{parseTable:()=>Go});var sa,Xs,Go,yd=I({"parser/table.ts"(){"use strict";J(),vd(),bd(),Wo(),Ho(),sa=e=>e.lastChild.constructor!==z,Xs=(e,t)=>e.is("td")?t.pop():e,Go=({firstChild:{data:e},type:t,name:i},n,r)=>{const s=[],l=e.split(`
|
|
20
|
+
`);let o=t==="root"||t==="parameter-value"||t==="ext-inner"&&i==="poem"?"":`
|
|
21
|
+
${l.shift()}`,u;const a=(d,c)=>{if(!c){o+=d;return}const{lastChild:m}=c;if(sa(c)){const f=new z(d,n,r);f.type="table-inter",f.setAttribute("stage",3),c.insertAt(f)}else m.setText(m.toString()+d)};for(const d of l){u=s.pop();const[c]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(d),m=d.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(;u&&!u.is("td");)u=s.pop();const[,g,h,x,p]=f;g&&new pr(g,n,r),a(`
|
|
22
|
+
${c}${g&&`\0${r.length-1}d`}${h}\0${r.length}b`,u),s.push(...u?[u]:[],new Ui(x,p,n,r));continue}else if(!u){o+=`
|
|
23
|
+
${d}`;continue}const y=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(m);if(!y){a(`
|
|
24
|
+
${d}`,u),s.push(u);continue}const[,S,k,_,T]=y;if(S){for(;!u.is("table");)u=s.pop();u.close(`
|
|
25
|
+
${c}${S}`,!0),a(T,s[s.length-1])}else if(k){u=Xs(u,s),u.is("tr")&&(u=s.pop());const g=new Mo(`
|
|
26
|
+
${c}${k}`,T,n,r);s.push(u,g),u.insertAt(g)}else{u=Xs(u,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 $=v=>{const w=new Hi(p,T.slice(x,h==null?void 0:h.index),n,r);return v.insertAt(w),w};for(;h;)$(u),{lastIndex:x}=g,[p]=h,h=g.exec(T);s.push(u,$(u))}}return o.slice(1)}}}),dt,Vo=I({"../cm-util/dist/index.mjs"(){"use strict";dt=e=>!/^_{2}.+_{2}$/u.test(e)}}),Qo,wd=I({"src/nowiki/hr.ts"(){"use strict";bt(),Qo=class extends Ue{get type(){return"hr"}}}}),na,Ks,ra,ai,Sd=I({"src/nowiki/doubleUnderscore.ts"(){"use strict";var e,t;vt(),it(),bt(),na=[tt(),Ge("__")],ai=(t=class extends(ra=Ue){constructor(n,r,s,l,o){var c,m;super(n,l,o);P(this,e);const u=n.toLowerCase(),{doubleUnderscore:[,,a,d]}=l;this.setAttribute("name",(m=r?(c=d==null?void 0:d[n])==null?void 0:c.toLowerCase():a==null?void 0:a[u])!=null?m:u),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),ai=re(Ks,0,"DoubleUnderscoreToken",na,ai),ne(Ks,1,ai)}}),Jo={};oe(Jo,{parseHrAndDoubleUnderscore:()=>Xo});var Xo,Ad=I({"parser/hrAndDoubleUnderscore.ts"(){"use strict";Vo(),wd(),Sd(),co(),Xo=({firstChild:{data:e},type:t,name:i},n,r)=>{var a,d,c;const{doubleUnderscore:[s,l,o]}=n,u=[...s,...l];return(a=n.insensitiveDoubleUnderscore)!=null||(n.insensitiveDoubleUnderscore=new Set(s.filter(dt))),(d=n.sensitiveDoubleUnderscore)!=null||(n.sensitiveDoubleUnderscore=new Set(l.filter(dt))),(c=n.regexHrAndDoubleUnderscore)!=null||(n.regexHrAndDoubleUnderscore=new RegExp(String.raw`^((?:\0\d+[cno]\x7F)*)(-{4,})|__(${u.filter(dt).join("|")})__|_{2}(${u.filter(m=>!dt(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,k)=>{var x;if(y)return new Qo(y,n,r),`${f}\0${r.length-1}r`;const _=S!=null?S:k,T=n.sensitiveDoubleUnderscore.has(_),g=_.toLowerCase(),h=n.insensitiveDoubleUnderscore.has(g);return T||h?(new ai(_,T,!!k,n,r),`\0${r.length-1}${h&&((x=o==null?void 0:o[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,k)=>{const _=`${f}\0${r.length}h`;return new Tt(y.length,[S,k],n,r),_})),t==="root"||t==="ext-inner"&&i==="poem"?e:e.slice(1)}}}),Ko,kd=I({"src/nowiki/quote.ts"(){"use strict";var e,t;X(),be(),D(),bt(),Ko=(t=class extends Ue{constructor(n,r,s,l){super(n,s,l);P(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,o=(r==null?void 0:r.type)==="text"?r.data:void 0,u=[],a=new pe(this,n),d=["lonely-apos","bold-header"],{lintConfig:c}=N,{computeEditInfo:m}=c,f=[void 0,"word"].map(S=>c.getSeverity(d[0],S)),y=c.getSeverity(d[1]);if(o!=null&&o.endsWith("'")){const S=f[(l.bold||l.italic)&&/[a-z\d]'$/iu.test(o)?1:0];if(S){const k=Y(this,a,d[0],N.msg("lonely","'"),S),{startLine:_,startCol:T}=k,[,{length:g}]=/(?:^|[^'])('+)$/u.exec(o),h=n-g,x={...k,startIndex:h,endIndex:n,endLine:_,startCol:T-g,endCol:T};m&&(x.suggestions=[Ot(h,"'",g),ee(x)]),u.push(x)}}if(y&&s&&this.isInside("heading-title")){const S=Y(this,a,d[1],"bold-in-header",y);m&&(S.suggestions=[ee(S)]),u.push(S)}return u}}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)}}),Yo={};oe(Yo,{parseQuotes:()=>fr});var fr,Zo=I({"parser/quotes.ts"(){"use strict";kd(),fr=(e,t,i,n)=>{var f;const r=e.split(/('{2,})/u),{length:s}=r;if(s===1)return e;let l=0,o=0,u,a,d;for(let y=1;y<s;y+=2){const S=r[y].length;switch(S){case 2:o++;break;case 4:r[y-1]+="'",r[y]="'''";case 3:if(l++,u!==void 0)break;r[y-1].endsWith(" ")?a===void 0&&d===void 0&&(d=y):r[y-1].slice(-2,-1)===" "?u=y:a!=null||(a=y);break;default:r[y-1]+="'".repeat(S-5),r[y]="'''''",o++,l++}}if(o%2===1&&l%2===1){const y=(f=u!=null?u:a)!=null?f:d;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,k=S!==2,_=S!==3,T=new Ko(r[y],{bold:k&&!!c,italic:_&&!!m},t,i);k&&(c=!c&&T),_&&(m=!m&&T),r[y]=`\0${i.length-1}q`}return r.join("")}}}),eu={};oe(eu,{parseExternalLinks:()=>mr});var mr,tu=I({"parser/externalLinks.ts"(){"use strict";ve(),To(),cr(),mr=(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}|//)${Et}|\0\d+m\x7F)${jt}(?=[[\]<>"\t${Ye}]|\0\d)))([${Ye}]*(?![${Ye}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),e.replace(t.regexExternalLinks,(s,l,o,u)=>{const{length:a}=i,d=/&[lg]t;/u.exec(l);return d&&(o="",u=l.slice(d.index)+o+u,l=l.slice(0,d.index)),n?(new yi(l,"ext-link-url",t,i),`[\0${a}f${o}${u}]`):(new It(l,o,u,t,i),`\0${a}w`)})}}}),iu,$d=I({"src/link/category.ts"(){"use strict";Qi(),ve(),iu=class extends Xe{get type(){return"category"}get sortkey(){{const{childNodes:[,e]}=this;return e&&fi(e.text())}}json(e,t=this.getAbsoluteIndex()){{const i=super.json(void 0,t),{sortkey:n}=this;return n&&(i.sortkey=n),i}}}}}),su={};oe(su,{parseLinks:()=>En});var la,En,_d=I({"parser/links.ts"(){"use strict";ve(),D(),Zo(),tu(),_o(),yo(),$d(),la=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,En=(e,t,i,n,r)=>{var u;(u=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 o=l.shift();for(let a=0;a<l.length;a++){let d=!1,c,m,f,y;const S=l[a],k=s.exec(S);if(k)[,c,m,f,y]=k,y.startsWith("]")&&(f!=null&&f.includes("["))&&(f+="]",y=y.slice(1));else{const p=la.exec(S);p&&(d=!0,[,c,m,f]=p)}if(c===void 0||t.regexLinks.test(c)||/\0\d+[exhbru]\x7F/u.test(c)){o+=`[[${S}`;continue}let _=Ie(c).trim();const T=_.startsWith(":");if(T&&d){o+=`[[${S}`;continue}else!_&&f&&!f.includes(`
|
|
28
|
+
`)&&(_=Ie(f).trim());const{ns:g,valid:h}=N.normalizeTitle(_,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0,page:n});if(h){if(d){if(g!==6){o+=`[[${S}`;continue}let p=!1;for(a++;a<l.length;a++){const $=l[a],v=$.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+=`[[${$}`;break}}if(f=En(f,t,i,n,r),!p){o+=`[[${c}${m}${f}`;continue}}}else{o+=`[[${S}`;continue}f&&(f=fr(f,t,i,r));let x=dr;T||(g===6?(f&&(f=mr(f,t,i,!0)),x=ur):g===14&&(x=iu)),f===void 0&&m&&(f=""),o+=`\0${i.length}l${y}`,new x(c,f,t,i,m)}return o}}}),nu={};oe(nu,{parseMagicLinks:()=>ru});var Ys,Zs,en,tn,ru,Td=I({"parser/magicLinks.ts"(){"use strict";ve(),cr(),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`,ru=(e,t,i)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${Et}${jt})|${tn})`,"giu")}catch{t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${Et}${jt})|${tn})`,"giu")}return e.replace(t.regexMagicLinks,(n,r,s)=>{let l=r?n.slice(r.length):n;if(s){let o="";const u=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(l);u&&(o=l.slice(u.index),l=l.slice(0,u.index));const a=l.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,d=a.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),o=l.slice(d.index+c)+o,l=l.slice(0,d.index+c)}return o.length>=s.length?n:(new yi(l,void 0,t,i),`${r}\0${i.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(l))return n;return new yi(l,"magic-link",t,i),`${r}\0${i.length-1}i`})}}}),lu,Cd=I({"util/html.ts"(){"use strict";lu=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((i,n)=>i!==e[n])}}),aa,au,Id=I({"src/nowiki/list.ts"(){"use strict";X(),D(),zo(),aa=new Set(["link","category","file"]),au=class extends gr{get type(){return"list"}lint(e=this.getAbsoluteIndex()){var t;{const i="syntax-like",n=N.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 o=Y(s,{start:e+1},i,"redirect-like",n);return o.startIndex--,o.startCol--,o.endIndex+=2,o.endCol+=2,[o]}}return[]}}}}}),ou={};oe(ou,{parseList:()=>uu});var uu,Nd=I({"parser/list.ts"(){"use strict";Cd(),Id(),Ho(),uu=(e,t,i,n)=>{const r=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!r)return t.lastPrefix="",e;const[s,l,o,u]=r,a=o.replace(/;/gu,":"),d=lu(a,t.lastPrefix),c=((d>1?o.slice(d-1):o)+u).split(/(?=;)/u),m=c[0].startsWith(";");let f=c.length-(m?0:1);if(d>1){const A=o.slice(0,d-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=a;let y=l+c.map((A,C)=>`\0${n.length+C}d`).join("")+e.slice(s.length);for(const A of c)new au(A,i,n);if(!f)return y;const{html:[S,,k]}=i,_=/:+|-\{|\0\d+[xq]\x7F/gu;let T=_,g=T.exec(y),h=0,x=!1,p=!1,$=0;const v=(A,C)=>(new pr(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(!$){const{lastIndex:L}=T;T=/-\{|\}-/gu,T.lastIndex=L}$++}else if(A==="}-"){if($--,!$){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&&!k.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}}}),Ei,oa,sn,ua,oi,Ld=I({"src/converterFlags.ts"(){"use strict";var e,t;X(),be(),Vi(),Ne(),D(),J(),mt(),Ei=new Set(["A","T","R","D","-","H","N"]),oa=[Si(),Te],oi=(t=class extends(ua=z){constructor(n,r,s=[]){super(void 0,r,s,{});P(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(o=>Ei.has(o)))),!!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(),o=new Set(b(this,e).filter(k=>Ei.has(k))),u=b(this,e).filter(k=>!k).length,a=b(this,e).length-l.size-u,{lintConfig:d}=N,{computeEditInfo:c,fix:m}=d,f=super.lint(n,r);if(s.size===a||o.size===a)return f;const y="no-ignored",S=d.getSeverity(y,"conversionFlag");if(S){const k=new pe(this,n);for(let _=0;_<this.length;_++){const T=this.childNodes[_],g=T.text().trim();if(this.isInvalidFlag(g,s,l,o)){const h=Q(T,k,y,"invalid-conversion-flag",S);(c||m)&&(s.size===0&&Ei.has(g.toUpperCase())?h.fix=Qn(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),oi=re(sn,0,"ConverterFlagsToken",oa,oi),ne(sn,1,oi)}}),ji,da,nn,ca,ct,Fd=I({"src/converterRule.ts"(){"use strict";De(),Ne(),D(),J(),mt(),ji=(e,t,i,n)=>{const r=new z(e,i,n);return r.type=`converter-rule-${t}`,r.setAttribute("stage",ke),r},da=[Te],ct=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=N.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(ji(e.slice(r+1),"to",i,n)),s!==-1&&super.insertAt(ji(e.slice(0,s),"from",i,n),0)):super.insertAt(ji(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),ct=re(nn,0,"ConverterRuleToken",da,ct),ne(nn,1,ct)}}),ha,rn,ga,ui,Ed=I({"src/converter.ts"(){"use strict";ve(),it(),Ne(),J(),Ld(),Fd(),ha=[Te,Ge("-{")],ui=class extends(ga=z){get type(){return"converter"}constructor(e,t,i,n=[]){super(void 0,i,n),this.insertAt(new oi(e,i,n));const[r]=t,s=r.includes(":"),l=new ct(r,s,i,n);(s?l.length===1:t.length===2&&!Ie(t[1]).trim())?this.insertAt(new ct(t.join(";"),!1,i,n)):this.safeAppend([l,...t.slice(1).map(o=>new ct(o,!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()}|${ft(t,";")}}-`}getGaps(e){return e||this.firstChild.length>0?1:0}print(){const{childNodes:[e,...t]}=this;return`<span class="wpb-converter">-{${e.print()}${e.length>0?"|":""}${Pt(t,{sep:";"})}}-</span>`}},rn=ae(ga),ui=re(rn,0,"ConverterToken",ha,ui),ne(rn,1,ui)}}),du={};oe(du,{parseConverter:()=>cu});var cu,jd=I({"parser/converter.ts"(){"use strict";Ed(),cu=(e,t,i)=>{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,s=[];let l=n,o=l.exec(e);for(;o;){const{0:a,index:d}=o;if(a==="}-"){const c=s.pop(),{length:m}=i,f=e.slice(c.index+2,d),y=f.indexOf("|"),[S,k]=y===-1?[[],f]:[f.slice(0,y).split(";"),f.slice(y+1)],_=k.replace(/(&[#a-z\d]+);/giu,"$1"),T=_.split(t.regexConverter).map(g=>g.replace(/\x01/gu,";"));new ui(S,T,t,i),e=`${e.slice(0,c.index)}\0${m}v${e.slice(d+2)}`,s.length===0&&(l=n),l.lastIndex=c.index+3+String(m).length}else s.push(o),l=r,l.lastIndex=d+2;o=l.exec(e)}return e}}}),hi={};oe(hi,{Token:()=>z});var pa,z,J=I({"src/index.ts"(){"use strict";var e,t,i,n,r,s,l,o,u,hu,gu,pu,fu,mu,xu,vu,bu,yu,wu,Su,Au,x;ve(),De(),X(),Oe(),D(),Qu(),Xu(),pa=["category","html-attr#id,ext-attr#id,table-attr#id"],z=(x=class extends Yt{constructor(v,w=N.getConfig(),A=[],C){super();P(this,u);P(this,e,"plain");P(this,t,0);P(this,i);P(this,n);P(this,r);P(this,s,!1);P(this,l);P(this,o);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(),o)}set pageName(v){if(v){const w=this.normalizeTitle(v,0,{temporary:!0,page:""});F(this,o,w.valid?w.title:void 0)}else F(this,o,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,hu).call(this);w&&(w=!C)}F(this,r,w),j(this,u,gu).call(this,w);break;case 1:j(this,u,pu).call(this);break;case 2:j(this,u,fu).call(this);break;case 3:j(this,u,mu).call(this);break;case 4:j(this,u,xu).call(this);break;case 5:j(this,u,vu).call(this,A);break;case 6:j(this,u,bu).call(this,A);break;case 7:j(this,u,yu).call(this);break;case 8:j(this,u,wu).call(this);break;case 9:j(this,u,Su).call(this);break;case 10:j(this,u,Au).call(this)}if(this.type==="root")for(const C of b(this,n))C==null||C.parseOnce(v,w,A);return vr(this,t)._++,this}buildFromStr(v,w){const A=v.split(/[\0\x7F]/u).map((C,L)=>{if(L%2===0)return new kn(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?ft(A):A}build(){F(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")&&(wi(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();F(this,s,!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===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 kn(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,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}=N,{computeEditInfo:L,fix:q,ignoreDisables:B,configurationComment:O}=C;let W=super.lint(v,w);if(this.type==="root"){const E=new Map,R="no-duplicate",U=["category","id"].map(H=>C.getSeverity(R,H)),M=this.toString(),se=pa.filter((H,V)=>U[V]).join();if(se){for(const H of this.querySelectorAll(se)){let V;if(H.is("category"))V=H.name;else{const Z=H.getValue();Z&&Z!==!0&&(V=`#${Z}`)}if(V){const Z=E.get(V);Z?Z.add(H):E.set(V,new Set([H]))}}for(const[H,V]of E)if(V.size>1&&!H.startsWith("#mw-customcollapsible-")){const Z=!H.startsWith("#"),de=`duplicate-${Z?"category":"id"}`,ue=U[Z?0:1];W.push(...[...V].map(ce=>{const le=Y(ce,{start:ce.getAbsoluteIndex()},R,de,ue);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"),V=[];let Z=H.exec(M);for(;Z;){const{1:de,index:ue}=Z,ce=(A=Z[2])==null?void 0:A.trim();V.push({line:this.posFromIndex(ue).top+(de==="disable-line"?0:1),from:de==="disable"?H.lastIndex:void 0,to:de==="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:de,startLine:ue,startIndex:ce})=>{const le={pos:0};for(const{line:he,from:ye,to:G,rules:K}of V){if(he>ue+1)break;if(K&&!K.has(de))continue;if(he===ue&&ye===void 0&&G===void 0)return!1;ye<=ce&&ye>le.pos?(le.pos=ye,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:de})=>de).filter(Boolean).sort(({range:[de,ue]},{range:[ce,le]})=>ue===le?ce-de:le-ue);let V=1/0,Z=M;for(const{range:[de,ue],text:ce}of H)ue<=V&&(Z=Z.slice(0,de)+ce+Z.slice(ue),V=de);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):gt(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,o=new WeakMap,u=new WeakSet,hu=function(){const{parseRedirect:v}=(Zu(),ie(Ka)),w=this.firstChild.toString(),A=v(w,b(this,i),b(this,n));return A&&this.setText(A),!!A},gu=function(v){const{parseCommentAndExt:w}=(Zi(),ie(Po));this.setText(w(this.firstChild.toString(),b(this,i),b(this,n),v))},pu=function(){const{parseBraces:v}=(or(),ie(go)),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))},fu=function(){if(b(this,i).excludes.includes("html"))return;const{parseHtml:v}=(xd(),ie(Oo));this.setText(v(this.firstChild.toString(),b(this,i),b(this,n)))},mu=function(){if(b(this,i).excludes.includes("table"))return;const{parseTable:v}=(yd(),ie(Do));this.setText(v(this,b(this,i),b(this,n)))},xu=function(){if(b(this,i).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:v}=(Ad(),ie(Jo));this.setText(v(this,b(this,i),b(this,n)))},vu=function(v){const{parseLinks:w}=(_d(),ie(su));this.setText(w(this.firstChild.toString(),b(this,i),b(this,n),this.pageName,v))},bu=function(v){if(b(this,i).excludes.includes("quote"))return;const{parseQuotes:w}=(Zo(),ie(Yo)),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
|
+
`))},yu=function(){if(b(this,i).excludes.includes("extLink"))return;const{parseExternalLinks:v}=(tu(),ie(eu));this.setText(v(this.firstChild.toString(),b(this,i),b(this,n)))},wu=function(){if(b(this,i).excludes.includes("magicLink"))return;const{parseMagicLinks:v}=(Td(),ie(nu));this.setText(v(this.firstChild.toString(),b(this,i),b(this,n)))},Su=function(){if(b(this,i).excludes.includes("list"))return;const{parseList:v}=(Nd(),ie(ou)),{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
|
+
`))},Au=function(){if(b(this,i).variants.length>0){const{parseConverter:v}=(jd(),ie(du));this.setText(v(this.firstChild.toString(),b(this,i),b(this,n)))}},x)}}),we,es,wi,Oe=I({"util/debug.ts"(){"use strict";we={running:!1,run(e){const{running:t}=this;this.running=!0;try{const{Token:i}=(J(),ie(hi)),n=e();return n instanceof i&&!n.getAttribute("built")&&n.afterBuild(),this.running=t,n}catch(i){throw this.running=t,i}},rev:0},es=e=>t=>t.type===e,wi=(e,t,i,n=[])=>{var l,o;let r=e.getChildNodes(),s;r.length===i?(s=r,r=n):s=Array.prototype.splice.apply(r,[t,i,...n]);for(let u=0;u<n.length;u++){const a=n[u];a.setAttribute("parentNode",e),a.setAttribute("nextSibling",r[t+u+1]),a.setAttribute("previousSibling",r[t+u-1])}return(l=r[t-1])==null||l.setAttribute("nextSibling",r[t]),(o=r[t+n.length])==null||o.setAttribute("previousSibling",r[t+n.length-1]),r===n&&e.setAttribute("childNodes",r),s}}}),St,ln,Ri,an,fa,on,ma,xa,jn,Rd=I({"lib/lintConfig.ts"(){"use strict";var e,t;Hn(),St=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),Ri={configurationComment:"lint",ignoreDisables:!1,fix:!0,computeEditInfo:!0},Object.freeze(Ri),an=i=>St.has(i),fa=i=>an(i)||Array.isArray(i)&&an(i[0])&&(i.length===1||typeof i[1]=="object"),on=(i,n,r)=>{if(gi.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"?St.get(r):n&&(l=St.get((s=r[1])==null?void 0:s[n]))!=null?l:St.get(r[0])}},jn=(t=class{constructor(i){P(this,e);if(Object.assign(this,Ri),i&&!("rules"in i)&&Object.keys(i).some(n=>gi.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(Ri,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)}}),ku={};oe(ku,{Title:()=>$u});var un,$u,Pd=I({"lib/title.ts"(){"use strict";var e,t,i,n,r,s,_u,o;et(),ve(),un=u=>{const[,{length:a},d]=/^((?:\.\.\/)*)([\s\S]*)/u.exec(u);return[a/3,d]},$u=(o=class{constructor(u,a,d,{temporary:c,decode:m,selfLink:f,page:y}={}){P(this,s);P(this,e);P(this,t);P(this,i);P(this,n);P(this,r);Fe(this,"page");Fe(this,"valid");Fe(this,"encoded",!1);this.page=y;const S=u.trim(),k=S.startsWith("../");if(m&&u.includes("%"))try{const h=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(u);u=xi(u),this.encoded=h}catch{}if(u=fi(u).replace(/[_ ]+/gu," ").trim(),k||y&&S.startsWith("/"))F(this,n,0);else{let h=a;u.startsWith(":")&&(h=0,u=u.slice(1).trim());const x=u.split(":");if(x.length>1){const p=Rt(x[0]),$=Object.prototype.hasOwnProperty.call(d.nsid,p)&&d.nsid[p];$&&(h=$,u=x.slice(1).join(":").trim())}F(this,n,h)}const _=u.indexOf("#");if(_!==-1){let h=u.slice(_).trim().slice(1);if(h.includes("%"))try{h=xi(h)}catch{}F(this,r,h.replace(/ /gu,"_")),u=u.slice(0,_).trim()}const[T,g]=k?un(u):[0,u];this.valid=!!(u||f&&this.ns===0&&b(this,r)!==void 0)&&fi(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(g),this.main=u,F(this,t,d.namespaces),F(this,i,d.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(u){u=u.replace(/_/gu," ").trim(),F(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,a=u.lastIndexOf(".");return a===-1?void 0:u.slice(a+1).toLowerCase()}getRedirection(){const{prefix:u}=this,a=u;return j(this,s,_u).call(this,a)}setFragment(u){F(this,r,u)}getUrl(u){{typeof u=="string"&&(F(this,i,u),b(this,i).includes("$1")||F(this,i,b(this,i)+`${b(this,i).endsWith("/")?"":"/"}$1`));const{title:a,fragment:d}=this;return a?b(this,i).replace("$1",encodeURIComponent(a)+(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,i=new WeakMap,n=new WeakMap,r=new WeakMap,s=new WeakSet,_u=function(u){var d,c;let a=(u+this.main).replace(/ /gu,"_");if(a.startsWith("/"))a=((d=this.page)!=null?d:"")+a.replace(/(.)\/$/u,"$1");else if(a.startsWith("../")&&((c=this.page)!=null&&c.includes("/"))){const[m,f]=un(a),y=this.page.split("/");y.length>m&&(a=y.slice(0,-m).join("/")+(f&&"/")+f)}return[!1,a]},o)}}),Tu={};oe(Tu,{LanguageService:()=>Cu,tasks:()=>Rn});var Rn,va,ba,ya,wa,dn,Sa,Aa,ka,$a,cn,_a,hn,At,gn,Qe,Ae,pn,fn,kt,$t,rt,Xt,mn,Ta,Cu,Od=I({"lib/lsp.ts"(){"use strict";var e,t,i,n,r,s,l,o,u,a,di,je,Pn,On,Bn,Iu,qn,_t,T;et(),Vo(),Hn(),so(),X(),ve(),D(),Rn=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=ht(g=>new RegExp(`^(?:${g}|//)`,"iu")),cn=({type:g,parentNode:h,length:x,firstChild:p},$)=>g==="attr-value"&&x===1&&p.type==="text"&&(!$||h.name==="style"),_a=g=>g.is("html-attr")||g.is("table-attr"),hn=g=>g.childNodes.every(({type:h})=>Aa.has(h)),At=(g,h)=>{const{top:x,left:p}=g.posFromIndex(h);return{line:x,character:p}},gn=(g,h,x)=>({start:At(g,h),end:At(g,x)}),Qe=g=>{const{top:h,left:x,height:p,width:$}=g.getBoundingClientRect();return{start:{line:h,character:x},end:vi(h,x,p,$)}},Ae=(g,h,x,{line:p,character:$},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:$-x.length},end:{line:p,character:$}},newText:A+(v!=null?v:"")},...C&&{documentation:{kind:"markdown",value:C}}}}),pn=(g,h,{line:x,character:p})=>{const $=g.indexFromPos(x,p);return g.caretPositionFromIndex($+Number(/\w/u.test(h.charAt($))))},fn=(g,h,x)=>{const{type:p,parentNode:$={}}=g,{name:v,tag:w}=$;return p==="attr-value"&&h.has(w)&&x.has(v)?g.toString().trim():NaN},kt=g=>fn(g,va,ya),$t=g=>fn(g,ba,wa),rt=(g,h)=>{const x=g==null?void 0:g.getAttr(h);return x!==!0&&x||!1},Xt=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}=N,{rules:p,fix:$,computeEditInfo:v}=x;if(x.fix=!0,x.computeEditInfo=!1,h){x.rules=void 0;for(const A of gi)x.rules[A]=A===h?p[A]:0}const{output:w}=g.lint();return x.fix=$,x.computeEditInfo=v,h&&(x.rules=p),w===void 0?[]:[{range:Qe(g),newText:w}]},Cu=(T=class{constructor(g){P(this,a);P(this,e);P(this,t);P(this,i);P(this,n);P(this,r);P(this,s);P(this,l);P(this,o);P(this,u);Fe(this,"include",!0);Fe(this,"config");Fe(this,"data");Rn.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,a,je).call(this,h);return p.querySelectorAll("attr-value,parameter-value,arg-default").reverse().flatMap($=>{const{type:v,childNodes:w}=$;return v!=="attr-value"&&!hn($)?[]:w.filter(A=>A.type==="text").reverse().flatMap(A=>{const{data:C}=A,L=Wa(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(Boolean)})})}provideColorPresentations(g){const{color:{red:h,green:x,blue:p,alpha:$},range:v}=g,w=[h,x,p],A=$<1?`rgba(${w.map(C=>Math.round(C*255)).join()},${$})`:`#${w.map(qa).join("")}`;return[{label:A,textEdit:{range:v,newText:A}}]}async provideCompletionItems(g,h){var Z,de,ue,ce,le,he,ye;const{re:x,allTags:p,functions:$,switches:v,jaSwitches:w,protocols:A,params:C,tags:L,ext:q}=j(this,a,Iu).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:""),[,,R={},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 R?K=R[K]:K in U&&(K=U[K]),j(this,a,qn).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,a,je).call(this,g);let se;if(E!=null&&E[2]){se=M.elementFromPoint(E.index+E[2].length-1,B);const G=(de=E[3])!=null?de:"";if(E[2]==="{{{")return Ae(M.querySelectorAll("arg").filter(te=>te.name&&te!==se).map(({name:te})=>te),"Variable",G,h);const[K,fe]=this.config.parserFunction,Se=Array.isArray(fe),Le=W.charAt(O),Ve=G.startsWith(":"),$e=Ve?G.slice(1).trimStart():G;if(E[2]==="[[")return Ae(M.querySelectorAll("link,file,category,redirect-target").filter(te=>te!==se).map(({name:te})=>te),"Folder",$e,h);let yt=$;return Le===":"?yt=$.filter(te=>!te.endsWith(":")):Le===":"&&(yt=$.filter(te=>te.endsWith(":")).map(te=>te.slice(0,-1))),[...Ae(yt,"Function",G,h,"",te=>{if(this.data)te in K?te=K[te]:!Se&&te in fe&&(te=fe[te]);else return;return j(this,a,_t).call(this,te.toLowerCase())}),...G.startsWith("#")?[]:Ae(M.querySelectorAll("template").filter(te=>te!==se).map(te=>{const{name:st}=te;if(Ve)return st;const{ns:Wt}=te.getAttribute("title");return Wt===0?`:${st}`:Wt===10?st.slice(9):st}),"Folder",$e,h)]}let H,V;if((E==null?void 0:E[8])===void 0&&(se=M.elementFromPoint(O,B),{type:H,parentNode:V}=se),(E==null?void 0:E[7])!==void 0||H==="image-parameter"){const G=M.indexFromPos(B,O),K=(ce=(ue=E==null?void 0:E[7])==null?void 0:ue.trimStart())!=null?ce:b(this,e).slice(se.getAbsoluteIndex(),G).trimStart(),fe=b(this,e)[G]==="=";return[...Ae(C,"Property",K,h).filter(({label:Se})=>!fe||!/[= ]$/u.test(Se)),...Ae(M.querySelectorAll("image-parameter#width").filter(Se=>Se!==se).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:V.tag,K=(ye=E==null?void 0:E[10])!=null?ye:se.toString().slice(0,O-M.posFromIndex(se.getAbsoluteIndex()).left);if(!L.has(G))return;const fe=sr[G],Se=nr[G],Le=Se&&Ae(Se,"Field",K,h);return q.includes(G)&&!fe?Le:[...Le!=null?Le:[],...G==="meta"||G==="link"?[]:Ae(ir,"Property",K,h),...fe?Ae(fe,"Property",K,h):[],...Ae(["data-"],"Variable",K,h),...Ae(["xmlns:"],"Interface",K,h)]}else if(H==="parameter-key"||H==="parameter-value"&&V.anon){const G=V.parentNode,{type:K,name:fe}=G;if(K==="magic-word"&&fe!=="invoke")return;const Se=b(this,e).slice(se.getAbsoluteIndex(),M.indexFromPos(B,O)).trimStart(),{module:Le,function:Ve}=G;return Se?Ae(M.querySelectorAll("parameter").filter($e=>$e===V||$e.anon||$e.parentNode.type!==K||$e.parentNode.name!==fe?!1:K==="template"?!0:$e.parentNode.module===Le&&$e.parentNode.function===Ve).map(({name:$e})=>$e),"Variable",Se,h,H==="parameter-value"?"=":""):void 0}else if(cn(se)&&_a(V)){const G=Xn(V.tag,V.name);if(G.length===0)return;const K=b(this,e).slice(se.getAbsoluteIndex(),M.indexFromPos(B,O)).trimStart();return Ae(G,"Value",K,h)}}async provideDiagnostics(g,h=!0){const x=await j(this,a,je).call(this,g),{lintConfig:p}=N,$=p.fix;p.fix=!1;const v=x.lint();return p.fix=$,[(h?v:v.filter(({severity:L})=>L==="error")).map(({startLine:L,startCol:q,endLine:B,endCol:O,severity:W,rule:E,message:R,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:R,data:[...U?[mn(x,U,!0)]:[],...M?M.map(se=>mn(x,se)):[]]})),[],[]].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,a,je).call(this,g),{length:x}=h.getLines(),p=[],$=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=$[q];B!==void 0&&B<C-1&&p.push({startLine:B,endLine:C-1,kind:"region"}),$[q]=void 0}$[L-1]=C+A-1}else p.push({startLine:C,endLine:C+A-2,kind:"region"})}}for(const w of $)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=N.getConfig());const{articlePath:h,protocol:x}=this.config,p=h==null?void 0:h.includes("//"),$=$a(x);return(await j(this,a,je).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 R=O.filter(U=>U.type==="text").map(({data:U})=>U).join("").trim();if(!R)return!1;try{if(w.is("magic-link")||w.is("ext-link-url")||w.is("free-ext-link"))R=w.getUrl(h);else if(C==="link-target"&&(L.is("link")||L.is("redirect-target")||L.is("category"))){if(/^(?:\.\.)?\//u.test(R))return!1;R=L.link.getUrl(h)}else if(C==="link-target"||C==="template-name")R=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"||!$.test(R))){if(!p||R.startsWith("/"))return!1;C==="image-parameter"&&A==="manualthumb"||C==="parameter-value"&&A==="filepath"||C==="attr-value"&&E==="phonos"?R=`File:${R}`:C==="parameter-value"?R=`Widget:${R}`:C==="invoke-module"&&(R=`Module:${R}`);const U=N.normalizeTitle(R,C==="attr-value"?10:0,!1,this.config,{temporary:!0});if(!U.valid)return!1;R=U.getUrl()}if(typeof R=="string"&&R.startsWith("//")&&(R=`https:${R}`),R=new URL(R).href,C==="image-parameter"){const U=q.getBoundingClientRect(),{top:M,left:se,height:H,width:V}=W===1?U:B.getBoundingClientRect();return{range:{start:{line:U.top,character:U.left},end:vi(M,se,H,V)},target:R}}return{range:Qe(w),target:R}}catch{return!1}}).filter(Boolean)}async provideReferences(g,h){const x=await j(this,a,je).call(this,g),{offsetNode:p,offset:$}=pn(x,b(this,e),h),v=p.type==="text"?p.parentNode:p,w=$===0&&(v.is("ext-attr-dirty")||v.is("html-attr-dirty"))?v.parentNode.parentNode:v,{type:A}=w,C=kt(w),L=$t(w);if(!C&&!L&&!Sa.has(A))return;const q=Xt(w),B=x.querySelectorAll(A==="heading-title"?"heading":A).filter(O=>A==="attr-value"?kt(O)===C||$t(O)===L:Xt(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,a,je).call(this,g),p=x.elementFromPoint(h.character,h.line),$=p.is("ext")&&p.name==="ref"?p:p.closest("ext#ref"),v=rt($,"name");if(!v)return;const w=rt($,"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,a,je).call(this,g),p=x.elementFromPoint(h.character,h.line),{type:$}=p,v=kt(p),w=$t(p);return!v&&!w&&(!dn.has($)||$==="parameter-key"&&/^[1-9]\d*$/u.test(p.parentNode.name)||$==="link-target"&&!["link","redirect-target"].includes(p.parentNode.type))?void 0:Qe(p)}async provideRenameEdits(g,h,x){const p=await j(this,a,je).call(this,g),$=p.elementFromPoint(h.character,h.line),{type:v}=$,w=kt($),A=w&&rt($.parentNode.parentNode,"group"),C=$t($),L=Xt($),q=p.querySelectorAll(v).filter(B=>{const{type:O}=B.parentNode;return v==="link-target"&&O!=="link"&&O!=="redirect-target"?!1:v==="attr-value"?$t(B)===C||kt(B)===w&&rt(B.parentNode.parentNode,"group")===A:Xt(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,a,je).call(this,g);let{offsetNode:p,offset:$}=pn(x,b(this,e),h);p.type==="text"&&($+=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")&&$>0)L=j(this,a,qn).call(this,p.name);else if(v==="magic-word-name")L=j(this,a,_t).call(this,w.name),q=p.text().trim(),B=w.getAttribute("colon");else if(p.is("magic-word")&&!p.modifier&&A===1&&($>0||x.posFromIndex(p.getAbsoluteIndex()).left===h.character))L=j(this,a,_t).call(this,C),q=p.firstChild.text().trim(),B=p.getAttribute("colon");else if((p.is("magic-word")||p.is("template"))&&p.modifier&&$>=2&&p.getRelativeIndex(0)>$&&(q=p.modifier.trim().slice(0,-1),L=j(this,a,_t).call(this,q.toLowerCase()),B=":",L)){const W=p.getAbsoluteIndex();O={start:At(x,W+2),end:At(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:R})=>R?E:`*${E}*`).join(" **|** ")} **}}**`).join(`
|
|
30
33
|
`)}
|
|
31
34
|
|
|
32
|
-
`:"")+L.description},range:O!=null?O:
|
|
33
|
-
${
|
|
34
|
-
`)}${
|
|
35
|
-
`}${
|
|
36
|
-
`),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,$=g.split(/\r?\n/u,x+1)[x],{lastChild:v}=await j(this,a,On).call(this,`${$.slice(0,p+/^[^{}<]*/u.exec($.slice(p))[0].length)}}}`);if(!v.is("magic-word")||v.length===1)return;const{name:w,childNodes:A,firstChild:C}=v,L=j(this,a,_t).call(this,w);if(!(L!=null&&L.signatures))return;const q=A.length-1,B=L.signatures.filter(R=>{var U;return(R.length>=q||((U=R[R.length-1])==null?void 0:U.rest))&&R.every(({label:M,const:se},H)=>{var Z;const V=se&&H<q&&((Z=A[H+1])==null?void 0:Z.text().trim());return!V||M.toLowerCase().includes(V.toLowerCase())})});if(B.length===0)return;let O=-1;for(let R=v.getAbsoluteIndex()+v.getAttribute("padding");O<q&&(R+=A[O+1].toString().length+1,!(R>p));O++);const W=C.text().trim(),E=v.getAttribute("colon");return{signatures:B.map(R=>({label:`{{${W}${R.length===0?"":E}${R.map(({label:U})=>U).join("|")}}}`,parameters:R.map(({label:U,const:M})=>({label:U,...M?{documentation:"Predefined parameter"}:void 0})),...R.length<q?{activeParameter:Math.min(O,R.length-1)}:void 0})),activeParameter:O}}async provideInlayHints(g){const h=await j(this,a,je).call(this,g);let x=[];for(const p of h.querySelectorAll("template,magic-word#invoke").reverse()){const{type:$,childNodes:v}=p;x=[...x,...v.slice($==="template"?1:3).filter(({anon:w})=>w).reverse().map(w=>({position:At(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 $=await j(this,a,On).call(this,p),{viewOnly:v}=N;return N.viewOnly=!1,$.escape(),N.viewOnly=v,[{title:"Escape with magic words",kind:"refactor.rewrite",edit:{changes:{"":[{range:h,newText:$.toString()}]}}}]}},e=new WeakMap,t=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakMap,s=new WeakMap,l=new WeakMap,o=new WeakMap,u=new WeakMap,a=new WeakSet,di=function(){return b(this,l)===this.config&&b(this,o)===this.include},je=async function(g){var h;return g=pi(g),!b(this,i)&&j(this,a,di).call(this)&&b(this,e)===g?b(this,r):(F(this,e,g),(h=b(this,i))!=null||F(this,i,j(this,a,Pn).call(this)),b(this,i))},Pn=async function(){var x;(x=this.config)!=null||(this.config=N.getConfig()),F(this,l,this.config),F(this,o,this.include);const g=b(this,e),h=await N.partialParse(g,()=>b(this,e),this.include,this.config);return j(this,a,di).call(this)&&b(this,e)===g?(F(this,r,h),F(this,i,void 0),h):(F(this,i,j(this,a,Pn).call(this)),b(this,i))},On=async function(g){var h;return g=pi(g),!b(this,n)&&j(this,a,di).call(this)&&b(this,t)===g?b(this,s):(F(this,t,g),(h=b(this,n))!=null||F(this,n,j(this,a,Bn).call(this)),b(this,n))},Bn=async function(){var x;(x=this.config)!=null||(this.config=N.getConfig()),F(this,l,this.config),F(this,o,this.include);const g=b(this,t),h=await N.partialParse(g,()=>b(this,t),this.include,this.config);return j(this,a,di).call(this)&&b(this,t)===g?(F(this,s,h),F(this,n,void 0),h):(F(this,n,j(this,a,Bn).call(this)),b(this,n))},Iu=function(){var g;if(!b(this,u)||b(this,u)[1]!==this.config){(g=this.config)!=null||(this.config=N.getConfig());const{nsid:h,ext:x,html:p,parserFunction:[$,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,u,[{re:B,ext:x,tags:q,allTags:[...q,"onlyinclude","includeonly","noinclude"],functions:[Object.keys($),Array.isArray(v)?v:Object.keys(v),w].flat(2),switches:O.filter(dt).map(W=>`__${W}__`),jaSwitches:O.filter(W=>!dt(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,u)[0]},qn=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)}}),Nu={};oe(Nu,{default:()=>N});Lu.exports=ie(Nu);var Pi,xn,Ca,lt,vn,Ia,N,D=I({"index.ts"(){Hn(),Oe(),De(),ve(),Rd(),Pi=!0,xn=new jn,lt={config:yn,get rules(){return gi},get i18n(){return{...Ba,...Ca}},set i18n(e){Ca=e},get lintConfig(){return xn},set lintConfig(e){xn=new jn(e)},get viewOnly(){return Pi},set viewOnly(e){Pi&&!e&&we.rev++,Pi=e},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"),Array.isArray(r[1])?r[1].push("TRANSLATIONLANGUAGE"):r[1].TRANSLATIONLANGUAGE="translationlanguage"),{...yn,...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=lt.getConfig(),r){const{Title:s}=(Pd(),ie(ku));let l;if(r!=null&&r.halfParsed)l=new s(e,t,n,r);else{const{Token:o}=(J(),ie(hi));l=we.run(()=>{const u=new o(e,n);u.type="root",u.pageName=r==null?void 0:r.page,u.parseOnce(0,i).parseOnce();const a=new s(u.firstChild.toString(),t,n,r);u.build();for(const d of["main","fragment"]){const c=a[d];if(c!=null&&c.includes("\0")){const m=u.buildFromStr(c,1);d==="main"?a.main=m:a.setFragment(m)}}return a})}return l},parse(e,t,i,n,r){e=pi(e);let s,l,o,u;typeof t=="string"?(s=!!i,l=n,o=r,u=t):(s=!!t,l=i,o=n,u=r),l!=null||(l=ke),o!=null||(o=this.getConfig());let a;typeof l!="number"&&(a=Array.isArray(l)?l:[l],l=Math.max(...a.map(m=>Pa[m]||ke)));const{Token:d}=(J(),ie(hi));return we.run(()=>{const m=new d(e,o);return m.type="root",m.pageName=u,m.parse(l,s)})},parseWithRef(e,t,i,n=t.getAttribute("include")){return this.parse(e,n,i,t.getAttribute("config"),t.pageName)},async partialParse(e,t,i,n=lt.getConfig()){{const{Token:r}=(J(),ie(hi)),s=typeof setImmediate=="function"?setImmediate:setTimeout,{running:l}=we;we.running=!0;const o=new r(pi(e),n);o.type="root";let u=0;try{await new Promise(a=>{const d=()=>{t()===e?(u++,s(c,0)):a()},c=()=>{u===ke+1?(o.afterBuild(),a()):(o[u===ke?"build":"parseOnce"](u,i),d())};s(c,0)})}catch(a){throw we.running=l,a}return we.running=l,o}},createLanguageService(e={}){var t;{const i=(Od(),ie(Tu)),{LanguageService:n,tasks:r}=i;return(t=r.get(e))!=null?t:new n(e)}throw new Error("Parser.createLanguageService method is only available in the LSP version!")}},vn={},Ia=new Set(["lintConfig","normalizeTitle","parse","createLanguageService"]);for(const e of Object.keys(lt))Ia.has(e)||(vn[e]={enumerable:!1});Object.defineProperties(lt,vn),Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:lt}),N=lt}});D()});Bd();})();
|
|
37
40
|
//# sourceMappingURL=bundle-lsp.min.js.map
|