wikiparser-node 1.21.2 → 1.21.3
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 +3 -5
- package/bundle/bundle-es8.min.js +25 -25
- package/bundle/bundle-lsp.min.js +26 -26
- package/bundle/bundle.min.js +25 -25
- package/dist/base.d.mts +6 -1
- package/dist/base.d.ts +6 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +10 -1
- package/dist/lib/element.js +2 -1
- package/dist/lib/lintConfig.d.ts +13 -0
- package/dist/lib/lintConfig.js +161 -0
- package/dist/lib/lsp.js +6 -4
- package/dist/lib/node.js +646 -606
- package/dist/lib/text.js +4 -0
- package/dist/mixin/attributesParent.d.ts +6 -6
- package/dist/mixin/attributesParent.js +4 -4
- package/dist/mixin/cached.d.ts +5 -0
- package/dist/mixin/cached.js +22 -0
- package/dist/mixin/clone.d.ts +5 -0
- package/dist/mixin/clone.js +23 -0
- package/dist/mixin/hidden.js +68 -18
- package/dist/mixin/sol.js +1 -1
- package/dist/parser/commentAndExt.js +1 -1
- package/dist/parser/html.js +3 -3
- package/dist/parser/table.js +2 -2
- package/dist/src/arg.js +13 -7
- package/dist/src/atom.js +76 -31
- package/dist/src/attribute.js +49 -21
- package/dist/src/attributes.d.ts +7 -7
- package/dist/src/attributes.js +415 -366
- package/dist/src/commented.js +81 -35
- package/dist/src/converter.js +13 -7
- package/dist/src/converterFlags.js +33 -22
- package/dist/src/converterRule.js +263 -216
- package/dist/src/extLink.js +21 -16
- package/dist/src/gallery.js +18 -8
- package/dist/src/heading.js +66 -57
- package/dist/src/hidden.js +14 -9
- package/dist/src/html.js +28 -9
- package/dist/src/imageParameter.js +13 -6
- package/dist/src/imagemap.js +32 -25
- package/dist/src/index.js +53 -44
- package/dist/src/link/base.js +13 -8
- package/dist/src/link/file.js +401 -354
- package/dist/src/link/galleryImage.js +9 -5
- package/dist/src/link/index.js +7 -3
- package/dist/src/link/redirectTarget.js +7 -3
- package/dist/src/magicLink.js +23 -14
- package/dist/src/nested.js +122 -74
- package/dist/src/nowiki/base.js +5 -2
- package/dist/src/nowiki/comment.js +5 -1
- package/dist/src/nowiki/index.js +3 -3
- package/dist/src/nowiki/quote.js +13 -8
- package/dist/src/onlyinclude.js +17 -9
- package/dist/src/paramTag/index.js +21 -14
- package/dist/src/parameter.js +26 -20
- package/dist/src/pre.js +91 -45
- package/dist/src/syntax.js +14 -10
- package/dist/src/table/index.js +550 -503
- package/dist/src/table/td.js +65 -58
- package/dist/src/table/trBase.js +179 -129
- package/dist/src/tagPair/ext.js +32 -20
- package/dist/src/tagPair/include.js +5 -5
- package/dist/src/tagPair/translate.js +150 -103
- package/dist/src/transclude.js +13 -8
- package/dist/util/html.js +46 -41
- package/dist/util/lint.js +4 -4
- package/dist/util/string.js +13 -7
- package/extensions/dist/base.js +2 -2
- package/package.json +15 -15
package/bundle/bundle-lsp.min.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
"use strict";(()=>{var wl=Object.create;var Gt=Object.defineProperty;var Ns=Object.getOwnPropertyDescriptor;var Sl=Object.getOwnPropertyNames;var Cl=Object.prototype.hasOwnProperty;var Is=(a,n)=>(n=Symbol[a])?n:Symbol.for("Symbol."+a),Vt=a=>{throw TypeError(a)};var Ls=(a,n,e)=>n in a?Gt(a,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[n]=e;var $s=(a,n)=>Gt(a,"name",{value:n,configurable:!0});var w=(a,n)=>()=>(a&&(n=a(a=0)),n);var $l=(a,n)=>()=>(n||a((n={exports:{}}).exports,n),n.exports),ne=(a,n)=>{for(var e in n)Gt(a,e,{get:n[e],enumerable:!0})},Nl=(a,n,e,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of Sl(n))!Cl.call(a,r)&&r!==e&&Gt(a,r,{get:()=>n[r],enumerable:!(t=Ns(n,r))||t.enumerable});return a};var Q=a=>Nl(Gt({},"__esModule",{value:!0}),a);var q=a=>{var n;return[,,,wl((n=a==null?void 0:a[Is("metadata")])!=null?n:null)]},Es=["class","method","getter","setter","accessor","field","value","get","set"],qr=a=>a!==void 0&&typeof a!="function"?Vt("Function expected"):a,Il=(a,n,e,t,r)=>({kind:Es[a],name:n,metadata:t,addInitializer:i=>e._?Vt("Already initialized"):r.push(qr(i||null))}),Ll=(a,n)=>Ls(n,Is("metadata"),a[3]),O=(a,n,e,t)=>{for(var r=0,i=a[n>>1],s=i&&i.length;r<s;r++)n&1?i[r].call(e):t=i[r].call(e,t);return t},_=(a,n,e,t,r,i)=>{var s,o,l,g,p,d=n&7,u=!!(n&8),h=!!(n&16),m=d>3?a.length+1:d?u?1:2:0,x=Es[d+5],f=d>3&&(a[m-1]=[]),b=a[m]||(a[m]=[]),k=d&&(!h&&!u&&(r=r.prototype),d<5&&(d>3||!h)&&Ns(d<4?r:{get[e](){return c(this,i)},set[e](A){return y(this,i,A)}},e));d?h&&d<4&&$s(i,(d>2?"set ":d>1?"get ":"")+e):$s(r,e);for(var C=t.length-1;C>=0;C--)g=Il(d,e,l={},a[3],b),d&&(g.static=u,g.private=h,p=g.access={has:h?A=>El(r,A):A=>e in A},d^3&&(p.get=h?A=>(d^1?c:v)(A,r,d^4?i:k.get):A=>A[e]),d>2&&(p.set=h?(A,I)=>y(A,r,I,d^4?i:k.set):(A,I)=>A[e]=I)),o=(0,t[C])(d?d<4?h?i:k[x]:d>4?void 0:{get:k.get,set:k.set}:r,g),l._=1,d^4||o===void 0?qr(o)&&(d>4?f.unshift(o):d?h?i=o:k[x]=o:r=o):typeof o!="object"||o===null?Vt("Object expected"):(qr(s=o.get)&&(k.get=s),qr(s=o.set)&&(k.set=s),qr(s=o.init)&&f.unshift(s));return d||Ll(a,r),k&&Gt(r,e,k),h?d^4?i:k:r},le=(a,n,e)=>Ls(a,typeof n!="symbol"?n+"":n,e),si=(a,n,e)=>n.has(a)||Vt("Cannot "+e),El=(a,n)=>Object(n)!==n?Vt('Cannot use the "in" operator on this value'):a.has(n),c=(a,n,e)=>(si(a,n,"read from private field"),e?e.call(a):n.get(a)),T=(a,n,e)=>n.has(a)?Vt("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(a):n.set(a,e),y=(a,n,e,t)=>(si(a,n,"write to private field"),t?t.call(a,e):n.set(a,e),e),v=(a,n,e)=>(si(a,n,"access private method"),e);var An=(a,n,e,t)=>({set _(r){y(a,n,r,e)},get _(){return c(a,n,t)}});var Fs,Ps,Rs=w(()=>{"use strict";Fs=(()=>{let a={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(a,null),a})(),Ps=(()=>{let a=["bold-header","format-leakage","fostered-content","h1","illegal-attr","insecure-style","invalid-gallery","invalid-imagemap","invalid-invoke","invalid-isbn","lonely-apos","lonely-bracket","lonely-http","nested-link","no-arg","no-duplicate","no-ignored","obsolete-attr","obsolete-tag","parsing-order","pipe-like","table-layout","tag-like","unbalanced-header","unclosed-comment","unclosed-quote","unclosed-table","unescaped","unknown-page","unmatched-tag","unterminated-url","url-encoding","var-anchor","void-ext"];return Object.freeze(a),a})()});function Ce(a){return n=>{let e=new(typeof n=="string"?Map:WeakMap);if(e.has(n)){let r=e.get(n);return r.lastIndex=0,r}let t=a(n);return e.set(n,t),t}}var ot,Or,Fl,js,kt=w(()=>{"use strict";ot=a=>decodeURIComponent(a.replace(/%(?![\da-f]{2})/giu,"%25")),Or=a=>Math.round(a*255).toString(16).padStart(2,"0"),Fl=(()=>{let a=String.raw`#(?:[\da-f]{3,4}|(?:[\da-f]{2}){3,4})(?![\p{L}\p{N}_])`,n=String.raw`(?:\d*\.)?\d+%?`,e=String.raw`(?:\d*\.)?\d+(?:deg|grad|rad|turn)?`,t=String.raw`rgba?\(\s*(?:${String.raw`${new Array(3).fill(n).join(String.raw`\s+`)}(?:\s*\/\s*${n})?`}|${String.raw`${new Array(3).fill(n).join(String.raw`\s*,\s*`)}(?:\s*,\s*${n})?`})\s*\)`,r=String.raw`hsla?\(\s*(?:${String.raw`${e}\s+${n}\s+${n}(?:\s*\/\s*${n})?`}|${String.raw`${e}${String.raw`\s*,\s*(?:\d*\.)?\d+%`.repeat(2)}(?:\s*,\s*${n})?`})\s*\)`;return{full:new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${a}|${t}|${r})`,"giu"),rgb:new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${a}|${t})`,"giu")}})(),js=(a,n=!0)=>{let e=[],t=Fl[n?"full":"rgb"];t.lastIndex=0;let r=t.exec(a),i=0;for(;r;){let s=r.index+r[1].length;s>i&&e.push([a.slice(i,s),i,s,!1]),{lastIndex:i}=t,e.push([r[2],s,i,a[s-1]!=="&"||!/^#\d+$/u.test(r[2])]),r=t.exec(a)}return a.length>i&&e.push([a.slice(i),i,a.length,!1]),e}});var Fe,Bs,We,Ue,ze,Be,vt,Qt,ge,dg,$e,Pl,Rl,At,qs,gg,jl,Bl,wt,Ge,se=w(()=>{"use strict";kt();Fe=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Bs=String.raw`[^[\]<>"\0-\x1F\x7F${Fe}\uFFFD]`,We=String.raw`(?:\[[\da-f:.]+\]|${Bs})`,Ue=String.raw`(?:${Bs}|\0\d+[cn!~]\x7F)*`,ze=a=>a.trim().toLowerCase(),Be=(a,n)=>a.replace(/\0(\d+)\x7F/gu,(e,t)=>n[t]),vt=(a,n)=>e=>e.replace(a,n),Qt=vt(/[\0\x7F]|\r$/gmu,""),ge=vt(/\0\d+[cn]\x7F/gu,""),dg=vt(/[\\{}()|.?*+^$[\]]/gu,String.raw`\$&`),$e=(a,n="")=>a.map(e=>typeof e=="string"?e:e.text()).join(n),Pl={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},Rl=vt(/&(?:#(\d+|[Xx][\da-fA-F]+)|([lg]t|[LG]T|[lr]brac[ke]|nbsp|amp|AMP|quot|QUOT));/gu,(a,n,e)=>n?String.fromCodePoint(+((/^x/iu.test(n)?"0":"")+n)):Pl[e.toLowerCase()]),At=a=>Rl(a),qs=vt(/&#(\d+|x[\da-f]+);/giu,(a,n)=>String.fromCodePoint(+((/^x/iu.test(n)?"0":"")+n))),gg=vt(/\n/gu,String.raw`\n`),jl={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},Bl=a=>vt(a,n=>`&${jl[n]};`),wt=Bl(/[&<>]/gu),Ge=(a,n={})=>{let{pre:e="",post:t="",sep:r=""}=n;return e+a.map(i=>i.print()).join(r)+t}});var Os=$l((cg,ql)=>{ql.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","#urlencode":"urlencode","#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","#cscore":"cscore","#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","#chart":"chart"},{"!":"!","=":"=","#FORMAL":"formal","#bcp47":"bcp47","#dir":"dir","#interwikilink":"interwikilink","#interlanguagelink":"interlanguagelink","#timef":"timef","#timefl":"timefl"},["msg","raw"],["subst","safesubst"]],doubleUnderscore:[[],[]],protocol:"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|matrix:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|worldwind://|xmpp:",interwiki:[],img:{},redirection:["#redirect"],variants:[]}});var oi,_s=w(()=>{"use strict";oi=Os()});var _r,Xt,Dr,Mr,ai,B,de=w(()=>{"use strict";B=class{constructor(n,e){T(this,Mr);T(this,_r);T(this,Xt);T(this,Dr);y(this,_r,n),y(this,Xt,e)}get start(){return c(this,Xt)}get top(){return v(this,Mr,ai).call(this).top}get left(){return v(this,Mr,ai).call(this).left}};_r=new WeakMap,Xt=new WeakMap,Dr=new WeakMap,Mr=new WeakSet,ai=function(){var n;return(n=c(this,Dr))!=null||y(this,Dr,c(this,_r).getRootNode().posFromIndex(c(this,Xt))),c(this,Dr)}});var Ol,_l,Kt,Jt,Ds,L,R,Pe,wn,G=w(()=>{"use strict";he();de();K();Ol=new Set(["tr","td","th","caption"]),_l=new Set(["Template:!!","Template:!-"]),Kt=a=>{let n=a.childNodes.find(e=>e.text().trim());if(!n||n.type==="text"&&n.data.trim().startsWith("!")||n.is("magic-word")&&n.name==="!"||n.is("template")&&_l.has(n.name)||n.is("html")&&Ol.has(n.name))return!1;if(n.is("arg"))return n.length>1&&Kt(n.childNodes[1]);if(n.is("magic-word"))try{let e=n.getPossibleValues().map(Kt);return e.includes("error")?"error":e.includes("warning")&&"warning"}catch{}return n.is("template")||n.is("magic-word")&&n.name==="invoke"?"warning":"error"},Jt=(a,n,e,t)=>({line:a+e-1,character:(e===1?n:0)+t}),Ds=a=>(n,e,t,r,i="error")=>{let{start:s}=e,{top:o,left:l}=e instanceof B?e:new B(n,s),{offsetHeight:g,offsetWidth:p}=n,{startIndex:d,startLine:u,startCol:h}=a(n,s,o,l),{line:m,character:x}=Jt(u,h,g,p);return{rule:t,message:$.msg(r),severity:i,startIndex:d,endIndex:d+n.toString().length,startLine:u,endLine:m,startCol:h,endCol:x}},L=Ds((a,n,e,t)=>{let r=a.getRelativeIndex(),{top:i,left:s}=a.parentNode.posFromIndex(r);return{startIndex:n+r,startLine:e+i,startCol:i?s:t+s}}),R=Ds((a,n,e,t)=>({startIndex:n,startLine:e,startCol:t})),Pe=(a,n,e)=>{if(a&&$.viewOnly&&a[0]===oe.rev)return a[1];let t=n();return $.viewOnly&&e([oe.rev,t]),t},wn=(a,n)=>a==="ol"&&n==="type"?["1","a","A","i","I"]:a==="th"&&n==="scope"?["row","col","rowgroup","colgroup"]:n==="dir"?["ltr","rtl","auto"]:n==="aria-hidden"?["true","false"]:[]});var Dl,Sn,Ms=w(()=>{"use strict";Dl=(a,n,e)=>{if(a.includes("#")){let[t,...r]=a.split("#");return(!t||t===n)&&r.every(i=>i===e)}return!a||a===n},Sn=(a,n,e)=>({type:t,name:r})=>a.split(",").some(i=>Dl(i.trim(),t,r))});var Hr,Yt,Zt,Wr,Ur,er,tr,rr,Cn,nr,li=w(()=>{"use strict";G();he();K();nr=class{constructor(){T(this,rr);le(this,"childNodes",[]);T(this,Hr);T(this,Yt);T(this,Zt);T(this,Wr);T(this,Ur);T(this,er);T(this,tr,{})}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get parentNode(){return c(this,Hr)}get nextSibling(){return c(this,Yt)}get previousSibling(){return c(this,Zt)}get offsetHeight(){return v(this,rr,Cn).call(this).height}get offsetWidth(){return v(this,rr,Cn).call(this).width}getChildNodes(){let{childNodes:n}=this;return Object.isFrozen(n)?[...n]:n}getAttribute(n){return n==="padding"?0:this[n]}setAttribute(n,e){switch(n){case"parentNode":y(this,Hr,e),e||(y(this,Yt,void 0),y(this,Zt,void 0));break;case"nextSibling":y(this,Yt,e);break;case"previousSibling":y(this,Zt,e);break;case"aIndex":$.viewOnly&&y(this,er,[oe.rev,e]);break;default:this[n]=e}}getRootNode(){return Pe(c(this,Ur),()=>{var n,e;return(e=(n=this.parentNode)==null?void 0:n.getRootNode())!=null?e:this},n=>{let[,e]=n;e.type==="root"&&y(this,Ur,n)})}indexFromPos(n,e){{if(n<0||e<0)return;let t=this.getLines();if(n>=t.length)return;let[,r,i]=t[n],s=r+e;return s>i?void 0:s}this.lspError("AstNode.indexFromPos")}posFromIndex(n){let{length:e}=String(this);if(n+=n<0?e:0,n>=0&&n<=e){let t=this.getLines(),r=t.findIndex(([,,i])=>n<=i);return{top:r,left:n-t[r][1]}}}getGaps(n){return 0}getRelativeIndex(n){if(n===void 0){let{parentNode:e}=this;return e?e.getRelativeIndex(e.childNodes.indexOf(this)):0}return Pe(c(this,tr)[n],()=>{let{childNodes:e}=this,t=n+(n<0?e.length:0),r=this.getAttribute("padding");for(let i=0;i<t;i++)$.viewOnly&&(c(this,tr)[i]=[oe.rev,r]),r+=e[i].toString().length+this.getGaps(i);return r},e=>{c(this,tr)[n]=e})}getAbsoluteIndex(){return Pe(c(this,er),()=>{let{parentNode:n}=this;return n?n.getAbsoluteIndex()+this.getRelativeIndex():0},n=>{y(this,er,n)})}getBoundingClientRect(){return{...v(this,rr,Cn).call(this),...this.getRootNode().posFromIndex(this.getAbsoluteIndex())}}is(n){return this.type===n}getLines(){return Pe(c(this,Wr),()=>{let n=[],e=0;for(let t of String(this).split(`
|
|
2
|
-
`)){let r=e+t.length;n.push([t,e,r]),e=r+1}return n},n=>{y(this,Wr,n)})}seal(n,e){Object.defineProperty(this,n,{enumerable:!e&&!!this[n],configurable:!0})}lspError(n){throw new Error(`${n} method is only available in the LSP version!`)}};Hr=new WeakMap,Yt=new WeakMap,Zt=new WeakMap,Wr=new WeakMap,Ur=new WeakMap,er=new WeakMap,tr=new WeakMap,rr=new WeakSet,Cn=function(){let n=this.getLines(),e=n[n.length-1];return{height:n.length,width:e[2]-e[1]}}});var at,di,gi,$n,Hs=w(()=>{"use strict";se();he();Ms();li();$n=class extends nr{constructor(){super(...arguments);T(this,at)}get length(){return this.childNodes.length}text(e){return $e(this.childNodes,e)}normalize(){let e=this.getChildNodes(),t=r=>{var i,s;e.splice(r,1),(i=e[r-1])==null||i.setAttribute("nextSibling",e[r]),(s=e[r])==null||s.setAttribute("previousSibling",e[r-1])};for(let r=e.length-1;r>=0;r--){let{type:i,data:s}=e[r];i!=="text"||e.length===1||this.getGaps(r-(r&&1))||s===""&&t(r)}this.setAttribute("childNodes",e)}removeAt(e){return zr(this,e,1)[0]}insertAt(e,t=this.length){return zr(this,t,0,[e]),e}closest(e){let t=Sn(e,this),{parentNode:r}=this;for(;r;){if(t(r))return r;({parentNode:r}=r)}}querySelector(e){let t=Sn(e,this);return v(this,at,di).call(this,t)}querySelectorAll(e){let t=Sn(e,this);return v(this,at,gi).call(this,t)}append(...e){this.safeAppend(e)}safeAppend(e){for(let t of e)this.insertAt(t)}replaceChildren(...e){this.safeReplaceChildren(e)}safeReplaceChildren(e){for(let t=this.length-1;t>=0;t--)this.removeAt(t);this.safeAppend(e)}setText(e,t=0){t+=t<0?this.length:0;let r=this.childNodes[t],{data:i}=r;return r.replaceData(e),i}toString(e,t=""){return this.childNodes.map(r=>r.toString(e)).join(t)}caretPositionFromIndex(e){{if(e===void 0)return;let{length:t}=this.toString();if(e>t||e<-t)return;e+=e<0?t:0;let r=this,i=0,s=0;for(;r.type!=="text";){let{childNodes:o}=r;i+=r.getAttribute("padding");for(let l=0;i<=e&&l<o.length;l++){let g=o[l],{nextSibling:p}=g,d=g.toString(),u=d.length;if(g.setAttribute("aIndex",i),i+=u,i>e||i===e&&u>0&&(!p||p.type==="text"||g.type!=="text"&&(d.trim()||!p.toString().trim()))){r=g,i-=u,s=i;break}i+=r.getGaps(l)}if(r.childNodes===o)return{offsetNode:r,offset:e-s}}return{offsetNode:r,offset:e-s}}this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(e){var t;{let r=(t=this.caretPositionFromIndex(e))==null?void 0:t.offsetNode;return(r==null?void 0:r.type)==="text"?r.parentNode:r}this.lspError("AstElement.elementFromIndex")}elementFromPoint(e,t){return this.elementFromIndex(this.indexFromPos(t,e))}lint(e=this.getAbsoluteIndex(),t){let r=[];for(let i=0,s=e+this.getAttribute("padding");i<this.length;i++){let o=this.childNodes[i];o.setAttribute("aIndex",s);let l=o.lint(s,t);l.length>0&&r.push(...l),s+=o.toString().length+this.getGaps(i)}return r}print(e={}){let t=e.class;return this.toString()?(t===""?"":`<span class="wpb-${t!=null?t:this.type}${this.getAttribute("invalid")?" wpb-invalid":""}">`)+Ge(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){let r={...this,type:this.type,range:[t,t+this.toString().length],childNodes:[]};for(let i=0,s=t+this.getAttribute("padding");i<this.length;i++){let o=this.childNodes[i],{length:l}=o.toString();o.setAttribute("aIndex",s),r.childNodes.push(o.type==="text"?{data:o.data,range:[s,s+l]}:o.json(void 0,s)),s+=l+this.getGaps(i)}return r}};at=new WeakSet,di=function(e){var t;for(let r of this.childNodes){if(r.type==="text")continue;if(e(r))return r;let i=v(t=r,at,di).call(t,e);if(i)return i}},gi=function(e){var r;let t=[];for(let i of this.childNodes)i.type!=="text"&&(e(i)&&t.push(i),t=[...t,...v(r=i,at,gi).call(r,e)]);return t}});var ui,Us,Ml,Hl,Wl,Ul,zl,Ws,pi,Nn,zs,Gr,Gs=w(()=>{"use strict";se();G();K();li();ui=String.raw`[${Fe}\t]*`,Us=String.raw`<\s*(?:/\s*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${ui}\d)|isbn(?=[-::]?${ui}(?:\d(?:${ui}|-)){6})`,Ml=new RegExp(String.raw`${Us}|https?[:/]/+`,"giu"),Hl=new RegExp(Us,"giu"),Wl=new Set(["attr-value","ext-link-text","link-text"]),Ul={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},zl={"<":"tag-like","[":"lonely-bracket","{":"lonely-bracket","]":"lonely-bracket","}":"lonely-bracket",h:"lonely-http",r:"lonely-http",p:"lonely-http",i:"lonely-http"},Ws=new Set(["html","head","style","title","body","a","audio","img","video","embed","iframe","object","canvas","script","col","colgroup","tbody","tfoot","thead","button","input","label","option","select","textarea"]);try{pi=new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch{pi=/\w/u}Gr=class extends nr{constructor(e){super();T(this,Nn);le(this,"data","");this.data=e}get type(){return"text"}toString(e){var t;return e&&!((t=this.parentNode)!=null&&t.getAttribute("built"))?ge(this.data):this.data}text(){return this.data}lint(e=this.getAbsoluteIndex(),t){var X,re,W;if(t===!1)return[];let{data:r,parentNode:i,nextSibling:s,previousSibling:o}=this;if(!i)throw new Error("An isolated text node cannot be linted!");let{type:l,name:g,parentNode:p}=i,d=!1;if(l==="attr-value"){let{type:V,name:N,tag:j}=p;if(V!=="ext-attr")d=!0;else if(j==="ref"&&(N==="name"||N==="extends"||N==="follow")||N==="group"&&(j==="ref"||j==="references")||j==="choose"&&(N==="before"||N==="after"))return[]}if(t!=null||(t=l==="free-ext-link"||l==="ext-link-url"||l==="ext-link-text"||l==="image-parameter"&&g==="link"||d?Hl:Ml),r.search(t)===-1)return[];t.lastIndex=0;let u=[],h=s==null?void 0:s.type,m=s==null?void 0:s.name,x=o==null?void 0:o.type,f=this.getRootNode(),b=f.toString(),{ext:k,html:C,variants:A}=f.getAttribute("config"),{top:I,left:P}=f.posFromIndex(e),z=new Set(["onlyinclude","noinclude","includeonly",...k,...C[0],...C[1],...C[2],...Ws]);for(let V=t.exec(r);V;V=t.exec(r)){let[,N,j]=V,{index:M,0:E}=V;if(j&&j!=="]"){let{length:ve}=j;M+=ve,E=E.slice(ve)}E=E.toLowerCase();let[F]=E,ce=F==="r"||F==="p"||F==="i",{length:Y}=E;if(F==="<"&&!z.has(N.toLowerCase())||F==="["&&l==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(r.slice(M+1))||s!=null&&s.is("ext")&&m==="nowiki"&&((X=s.innerText)!=null&&X.includes("]")))||ce&&(!i.isPlain()||Wl.has(l)))continue;F==="]"&&(M||Y>1)&&t.lastIndex--;let ue=e+M,U=ue+Y,ke=b[U],bt=b[ue-1],Tt=Y>1&&!(F==="<"&&(/^<\s/u.test(E)||!/[\s/>]/u.test(ke!=null?ke:"")||Ws.has(N))||d&&(F==="["||F==="]")||ce&&l==="parameter-value"||/^(?:rfc|pmid|isbn)$/iu.test(E))||F==="{"&&(ke===F||bt==="-"&&A.length>0)||F==="}"&&(bt===F||ke==="-"&&A.length>0)||F==="["&&(l==="ext-link-text"||h==="free-ext-link"&&!r.slice(M+1).trim())||F==="]"&&x==="free-ext-link"&&!r.slice(0,M).includes("]")?"error":"warning",ni=F==="{"||F==="[";if(Tt==="warning"&&(ni||(F==="]"||F==="}"))){let ve=Ul[F],ii=ni?r.slice(M+1):r.slice(0,M);if(F==="{"&&((re=ve.exec(ii))==null?void 0:re[0])==="}"||F==="}"&&((W=ve.exec(ii))==null?void 0:W[0])==="{")continue;if(!ii.includes(F)){let Cs=ni?"nextSibling":"previousSibling",yt=this[Cs];for(;yt&&(yt.type!=="text"||!ve.test(yt.data));)yt=yt[Cs];if(yt&&ve.exec(yt.data)[0]!==F)continue}}ce?E=E.toUpperCase():E==="{"&&bt==="-"&&Tt==="error"?(Tt="warning",M>0&&(E="-{",M--,ue--,Y=2)):E==="}"&&ke==="-"&&Tt==="error"&&(Tt="warning",M<r.length-1&&(E="}-",U++,Y=2));let As=this.posFromIndex(M),{line:ws,character:Ss}=Jt(I,P,As.top+1,As.left),zt={rule:zl[F],message:$.msg('lonely "$1"',ce||F==="h"||E==="-{"||E==="}-"?E:F),severity:Tt,startIndex:ue,endIndex:U,startLine:ws,endLine:ws,startCol:Ss,endCol:Ss+Y};if(F==="<")zt.suggestions=[{desc:"escape",range:[ue,ue+1],text:"<"}];else if(F==="h"&&l!=="link-text"&&pi.test(bt||""))zt.suggestions=[{desc:"whitespace",range:[ue,ue],text:" "}];else if(F==="["&&l==="ext-link-text"){let ve=i.getAbsoluteIndex()+i.toString().length;zt.suggestions=[{desc:"escape",range:[ve,ve+1],text:"]"}]}else if(F==="]"&&x==="free-ext-link"&&Tt==="error"){let ve=e-o.toString().length;zt.suggestions=[{desc:"left bracket",range:[ve,ve],text:"["}]}else ce&&(zt.suggestions=[...V[0]===E?[]:[{desc:"uppercase",range:[ue,U],text:E}],...ke===":"||ke===":"?[{desc:"whitespace",range:[U,U+1],text:" "}]:[]]);u.push(zt)}return u}replaceData(e){v(this,Nn,zs).call(this,e)}print(){return wt(this.data)}};Nn=new WeakSet,zs=function(e){this.setAttribute("data",e)}});var Ne,St=w(()=>{"use strict";he();Ne=(a=!0,n=!0)=>e=>{class t extends e{text(){return""}lint(i){return a?[]:super.lint(i)}}return qe(t,e),t}});var Vr,be,Ct=w(()=>{"use strict";D();be=class extends S{constructor(e,t,r,i,s){super(e,r,i,s);T(this,Vr);y(this,Vr,t)}get type(){return c(this,Vr)}lint(e=this.getAbsoluteIndex()){return super.lint(e,!1)}};Vr=new WeakMap});var me,Ve=w(()=>{"use strict";he();me=({length:a})=>n=>{class e extends n{getAttribute(r){return r==="padding"?a:super.getAttribute(r)}}return qe(e,n),e}});var ir,te,Qe=w(()=>{"use strict";D();te=class extends S{constructor(e,t,r,i,s){super(e,r,i,s);T(this,ir);y(this,ir,t)}get type(){return c(this,ir)}set type(e){y(this,ir,e)}getAttribute(e){var t;return e==="invalid"?this.type==="converter-flag"&&!!((t=this.parentNode)!=null&&t.isInvalidFlag(this)):super.getAttribute(e)}};ir=new WeakMap});var Gl,Vs,$t,Re,Oe,ci,Vl,Ae,Qr=w(()=>{"use strict";G();se();de();Ve();D();Qe();Gl=a=>a==="redirect-target"||a==="link";Vs=[me("[[")];Ae=class extends(Vl=S){constructor(e,t,r,i=[],s="|"){super(void 0,r,i,{});T(this,$t,!0);T(this,Re);T(this,Oe);if(this.insertAt(new te(e,"link-target",r,i,{})),t!==void 0){let o=new S(t,r,i,{});o.type="link-text",o.setAttribute("stage",10),this.insertAt(o)}y(this,Re,s)}get link(){return c(this,Oe)}get fragment(){return c(this,Oe).fragment}afterBuild(){y(this,Oe,this.getTitle()),c(this,Re).includes("\0")&&y(this,Re,this.buildFromStr(c(this,Re),0)),this.setAttribute("name",c(this,Oe).title),super.afterBuild()}setAttribute(e,t){e==="bracket"?y(this,$t,t):e==="title"?y(this,Oe,t):super.setAttribute(e,t)}toString(e){let t=super.toString(e,c(this,Re));return c(this,$t)?`[[${t}]]`:t}text(){let e=super.text("|");return c(this,$t)?`[[${e}]]`:e}getAttribute(e){return e==="title"?c(this,Oe):super.getAttribute(e)}getGaps(e){return e===0?c(this,Re).length:1}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{childNodes:[i,s],type:o}=this,{encoded:l,fragment:g}=c(this,Oe),p=new B(this,e);if(i.childNodes.some(({type:d})=>d==="template")&&r.push(L(i,p,"unknown-page","template in an internal link target","warning")),l){let d=L(i,p,"url-encoding","unnecessary URL encoding in an internal link","warning");d.fix={desc:"decode",range:[d.startIndex,d.endIndex],text:ot(i.text())},r.push(d)}if(o==="link"||o==="category"){let d=s==null?void 0:s.childNodes.findIndex(h=>h.type==="text"&&h.data.includes("|")),u=s==null?void 0:s.childNodes[d];if(u){let h=L(s,p,"pipe-like",'additional "|" in the link text',"warning"),m=h.startIndex+s.getRelativeIndex(d);h.suggestions=[{desc:"escape",range:[m,m+u.data.length],text:u.data.replace(/\|/gu,"|")}],r.push(h)}}if(g!==void 0&&!Gl(o)){let d=L(i,p,"no-ignored","useless fragment","warning"),u=i.childNodes.findIndex(m=>m.type==="text"&&m.data.includes("#")),h=i.childNodes[u];h&&(d.fix={desc:"remove",range:[d.startIndex+i.getRelativeIndex(u)+h.data.indexOf("#"),d.endIndex],text:""}),r.push(d)}return r}getTitle(e,t){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:t,temporary:e,decode:!0,selfLink:!0})}print(){return super.print(c(this,$t)?{pre:"[[",post:"]]",sep:c(this,Re)}:{sep:c(this,Re)})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t),{type:i,fragment:s}=this;return s!==void 0&&(i==="link"||i==="redirect-target")&&(r.fragment=s),r}};ci=q(Vl),$t=new WeakMap,Re=new WeakMap,Oe=new WeakMap,Ae=_(ci,0,"LinkBaseToken",Vs,Ae),O(ci,1,Ae)});var fe,lt=w(()=>{"use strict";D();fe=class extends S{get innerText(){return this.firstChild.data}constructor(n="",e,t){super(n,e,t)}}});var Qs,hi,Ql,J,Xe=w(()=>{"use strict";St();lt();Qs=[Ne()];J=class extends(Ql=fe){get type(){return"noinclude"}toString(n){return n?"":super.toString()}};hi=q(Ql),J=_(hi,0,"NoincludeToken",Qs,J),O(hi,1,J)});var In,Xs=w(()=>{"use strict";G();Qr();Xe();In=class extends Ae{get type(){return"redirect-target"}constructor(n,e,t,r){super(n,void 0,t,r),e!==void 0&&this.insertAt(new J(e,t,r))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,{halfParsed:!0,decode:!0})}lint(n=this.getAbsoluteIndex()){let e=super.lint(n,!1);if(this.length===2){let t=L(this.lastChild,{start:n},"no-ignored","useless link text","warning");t.startIndex--,t.startCol--,t.fix={desc:"remove",range:[t.startIndex,t.endIndex],text:""},e.push(t)}return e}}});var Ks,dt,sr,mi,Xl,Nt,Js=w(()=>{"use strict";St();D();Ct();Xs();Ks=[Ne(!1,!1)];Nt=class extends(Xl=S){constructor(e,t,r,i,s,o,l=[]){super(void 0,o,l);T(this,dt);T(this,sr);y(this,dt,e),y(this,sr,s),this.append(new be(t,"redirect-syntax",o,l),new In(r,i==null?void 0:i.slice(1),o,l))}get type(){return"redirect"}getAttribute(e){return e==="padding"?c(this,dt).length:super.getAttribute(e)}toString(e){return c(this,dt)+super.toString(e)+c(this,sr)}lint(e=this.getAbsoluteIndex()){let t=e+c(this,dt).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",t),this.lastChild.lint(t)}print(){return super.print({pre:c(this,dt),post:c(this,sr)})}};mi=q(Xl),dt=new WeakMap,sr=new WeakMap,Nt=_(mi,0,"RedirectToken",Ks,Nt),O(mi,1,Nt)});var Ys={};ne(Ys,{parseRedirect:()=>Kl});var Kl,Zs=w(()=>{"use strict";K();Js();Kl=(a,n,e)=>{var r;(r=n.regexRedirect)!=null||(n.regexRedirect=new RegExp(String.raw`^(\s*)((?:${n.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));let t=n.regexRedirect.exec(a);return t&&$.normalizeTitle(t[3],0,!1,n,{halfParsed:!0,temporary:!0,decode:!0}).valid?(a=`\0${e.length}o${a.slice(t[0].length)}`,new Nt(...t.slice(1),n,e),a):!1}});var eo,fi,Jl,It,to=w(()=>{"use strict";Ve();D();eo=[me("<onlyinclude>")];It=class extends(Jl=S){get type(){return"onlyinclude"}toString(n){return`<onlyinclude>${super.toString(n)}</onlyinclude>`}isPlain(){return!0}print(){return super.print({pre:'<span class="wpb-ext"><onlyinclude></span>',post:'<span class="wpb-ext"></onlyinclude></span>'})}};fi=q(Jl),It=_(fi,0,"OnlyincludeToken",eo,It),O(fi,1,It)});var gt,Xr=w(()=>{"use strict";he();gt=(a=1)=>n=>{class e extends n{getGaps(){return a}}return qe(e,n),e}});var ro,ut,xi,Yl,je,Ln=w(()=>{"use strict";Xr();D();ro=[gt()];je=class extends(Yl=S){constructor(e,t,r,i,s,o=[]){super(void 0,s);T(this,ut);le(this,"closed");le(this,"selfClosing");this.setAttribute("name",e.toLowerCase()),y(this,ut,[e,i||e]),this.closed=i!=="",this.selfClosing=i===void 0,this.append(t,r);let l=typeof t=="string"?-1:o.indexOf(t);o.splice(l===-1?1/0:l,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(e){let{selfClosing:t,firstChild:r,lastChild:i}=this,[s,o]=c(this,ut);return t?`<${s}${r.toString(e)}/>`:`<${s}${r.toString(e)}>${i.toString(e)}${this.closed?`</${o}>`:""}`}text(){let[e,t]=c(this,ut);return this.selfClosing?`<${e}${this.firstChild.text()}/>`:`<${e}${super.text(">")}${this.closed?`</${t}>`:""}`}getAttribute(e){return e==="padding"?c(this,ut)[0].length+1:super.getAttribute(e)}print(){let[e,t]=c(this,ut);return super.print(this.selfClosing?{pre:`<${e}`,post:"/>"}:{pre:`<${e}`,sep:">",post:this.closed?`</${t}>`:""})}};xi=q(Yl),ut=new WeakMap,je=_(xi,0,"TagPairToken",ro,je),O(xi,1,je)});var Fn,no,En,io=w(()=>{"use strict";D();Ln();Ct();Xe();En=class extends je{constructor(e,t,r,i=[]){let s=new be(e,"translate-attr",r,i);t=t==null?void 0:t.replace(/(<tvar\|[^>]+>)([\s\S]*?)(<\/>)/gu,(l,g,p,d)=>(new J(g,r,i),new J(d,r,i),`\0${i.length-1}n${p}\0${i.length}n`)).replace(/(<tvar\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\2|[^"'\s>]+))?\s*>)([\s\S]*?)(<\/tvar\s*>)/giu,(l,g,p,d,u)=>(new J(g,r,i),new J(u,r,i),`\0${i.length-1}n${d}\0${i.length}n`));let o=new S(t,r,i);o.type="translate-inner";super("translate",s,o,"translate",r,i);T(this,Fn);this.seal("closed",!0),this.seal("selfClosing",!0)}get type(){return"translate"}toString(e){return e?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){return`<span class="wpb-ext"><translate${v(this,Fn,no).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>`}};Fn=new WeakSet,no=function(){return this.firstChild.toString()===" nowrap"}});var so,bi,Zl,Lt,oo=w(()=>{"use strict";G();de();St();K();Ln();so=[Ne(!1)];Lt=class extends(Zl=je){get type(){return"include"}constructor(n,e="",t,r,i,s){super(n,e,t!=null?t:"",t===void 0||r!=null?r:"",i,s)}toString(n){return n?"":super.toString()}lint(n=this.getAbsoluteIndex()){let e=[],{firstChild:t,closed:r,name:i}=this,s=new B(this,n);if(t.data.trim()){let o=L(t,s,"no-ignored","useless attribute","warning");o.suggestions=[{desc:"remove",range:[o.startIndex,o.endIndex],text:""}],e.push(o)}if(!r){let o=R(this,s,"unclosed-comment",$.msg("unclosed $1",`<${i}>`));o.suggestions=[{desc:"close",range:[o.endIndex,o.endIndex],text:`</${i}>`}],e.push(o)}return e}};bi=q(Zl),Lt=_(bi,0,"IncludeToken",so,Lt),O(bi,1,Lt)});var or,Pn=w(()=>{"use strict";he();or=(a=0)=>n=>{var t,ao;class e extends n{constructor(){super(...arguments);T(this,t)}getAttr(o){return v(this,t,ao).call(this).getAttr(o)}}return t=new WeakSet,ao=function(){return this.childNodes[a]},qe(e,n),e}});var ae,lo,go,Rn,yi,uo,ar,co,ho,mo,Ti,po,_e,jn,Bn,qn,fo,ki=w(()=>{"use strict";ae=new Set(["align"]),lo=new Set(["cite"]),go=new Set(["cite","datetime"]),Rn=new Set(["width"]),yi=new Set(["axis","align","bgcolor","height","width","valign"]),uo=new Set([...yi,"abbr","headers","scope","rowspan","colspan"]),ar=new Set(["type"]),co=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),ho=new Set(["clear"]),mo=new Set(["bgcolor","align","valign"]),Ti=new Set(["qid","forcemathmode","type","display"]),po=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),_e=new Set,jn=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"]),Bn={div:ae,h1:ae,h2:ae,h3:ae,h4:ae,h5:ae,h6:ae,blockquote:lo,q:lo,p:ae,br:ho,pre:Rn,ins:go,del:go,ul:ar,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...co,"border"]),caption:ae,tr:mo,td:uo,th:uo,img:new Set(["alt","src","width","height","srcset"]),font:new Set(["size","color","face"]),hr:Rn,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:ar,poem:ae,categorytree:ae,combooption:ae,math:_e,chem:_e,ce:_e},qn={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:_e,indicator:new Set(["name"]),langconvert:new Set(["from","to"]),ref:new Set(["group","name","extends","follow","dir"]),references:new Set(["group","responsive"]),charinsert:new Set(["label"]),choose:new Set(["uncached","before","after"]),option:new Set(["weight"]),imagemap:_e,inputbox:_e,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:_e,poll:new Set(["id","show-results-before-voting"]),sm2:ar,flashmp3:ar,score:new Set(["line_width_inches","lang","override_midi","raw","note-language","override_audio","override_ogg","sound","vorbis"]),seo:new Set(["title","title_mode","title_separator","keywords","description","robots","google_bot","image","image_width","image_height","image_alt","type","site_name","locale","section","author","published_time","twitter_site"]),tab:new Set(["nested","name","index","class","block","inline","openname","closename","collapsed","dropdown","style","bgcolor","container","id","title"]),tabs:new Set(["plain","class","container","id","title","style"]),combobox:new Set(["placeholder","value","id","class","text","dropdown","style"]),math:new Set([...Ti,"chem"]),chem:Ti,ce:Ti,hiero:_e,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:po,syntaxhighlight:po,templatedata:_e,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:_e},fo={table:co,td:new Set([...yi,"scope"]),th:yi,br:ho,caption:ae,div:ae,hr:Rn,h1:ae,h2:ae,h3:ae,h4:ae,h5:ae,h6:ae,li:ar,p:ae,pre:Rn,tr:mo,ul:ar}});var ed,td,Kr,lr,pe,De,Jr,vi,dr,xo=w(()=>{"use strict";G();se();ki();de();K();D();Qe();ed=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,td=new Set(["ext","arg","magic-word","template"]),dr=class extends S{constructor(e,t,r,i="",s,o=[],l=$.getConfig(),g=[]){let p=new te(r,"attr-key",l,g),d;if(r==="title"||t==="img"&&r==="alt")d=new S(s,l,g,{}),d.type="attr-value",d.setAttribute("stage",10);else if(t==="gallery"&&r==="caption"||t==="choose"&&(r==="before"||r==="after")){let u={...l,excludes:[...l.excludes,"heading","html","table","hr","list"]};d=new S(s,u,g,{}),d.type="attr-value",d.setAttribute("stage",1)}else d=new te(s,"attr-value",l,g,{});super(void 0,l,g);T(this,Jr);T(this,Kr);T(this,lr);T(this,pe);T(this,De);y(this,Kr,e),this.append(p,d),y(this,pe,i),y(this,De,[...o]),y(this,lr,t),this.setAttribute("name",ze(ge(r)))}get type(){return c(this,Kr)}get tag(){return c(this,lr)}get balanced(){return!c(this,pe)||c(this,De)[0]===c(this,De)[1]}afterBuild(){c(this,pe).includes("\0")&&y(this,pe,this.buildFromStr(c(this,pe),0)),this.parentNode&&y(this,lr,this.parentNode.name),this.setAttribute("name",ze(this.firstChild.text())),super.afterBuild()}toString(e){let[t="",r=""]=c(this,De);return c(this,pe)?super.toString(e,c(this,pe)+t)+r:this.firstChild.toString(e)}text(){return c(this,pe)?`${super.text(`${c(this,pe).trim()}"`)}"`:this.firstChild.text()}getGaps(){var e,t;return c(this,pe)?c(this,pe).length+((t=(e=c(this,De)[0])==null?void 0:e.length)!=null?t:0):0}lint(e=this.getAbsoluteIndex(),t){var u;let r=super.lint(e,t),{balanced:i,firstChild:s,lastChild:o,name:l,tag:g}=this,p=new B(this,e);if(!i){let h=L(o,p,"unclosed-quote",$.msg("unclosed $1","quotes"),"warning");h.startIndex--,h.startCol--,h.suggestions=[{desc:"close",range:[h.endIndex,h.endIndex],text:c(this,De)[0]}],r.push(h)}let d=v(this,Jr,vi).call(this,e,p);return d&&r.push(d),(u=fo[g])!=null&&u.has(l)&&r.push(L(s,p,"obsolete-attr","obsolete attribute","warning")),r}getValue(){return c(this,pe)?this.lastChild.text().trim():this.type==="ext-attr"||""}getAttribute(e){return e==="invalid"?v(this,Jr,vi).call(this):super.getAttribute(e)}print(){let[e="",t=""]=c(this,De);return c(this,pe)?super.print({sep:wt(c(this,pe))+e,post:t}):super.print()}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return r.tag=this.tag,r}};Kr=new WeakMap,lr=new WeakMap,pe=new WeakMap,De=new WeakMap,Jr=new WeakSet,vi=function(e,t){let{firstChild:r,lastChild:i,type:s,name:o,tag:l}=this,g=this.getValue(),p=qn[l],d=Bn[l],{length:u}=this.toString();if(!(p!=null&&p.has(o))&&!(d!=null&&d.has(o))&&(s==="ext-attr"?p||d:!/\{\{[^{]+\}\}/u.test(o))&&(s==="ext-attr"&&!d||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(o)&&(l==="meta"||l==="link"||!jn.has(o)))){if(e===void 0)return!0;let h=L(r,t,"illegal-attr","illegal attribute name");return h.suggestions=[{desc:"remove",range:[e,e+u],text:""}],h}else{if(o==="style"&&typeof g=="string"&&ed.test(g))return e===void 0?!0:L(i,t,"insecure-style","insecure style");if(o==="tabindex"&&typeof g=="string"&&g!=="0"){if(e===void 0)return!0;let h=L(i,t,"illegal-attr","nonzero tabindex");return h.suggestions=[{desc:"remove",range:[e,e+u],text:""},{desc:"0 tabindex",range:[h.startIndex,h.endIndex],text:"0"}],h}else if(s!=="ext-attr"&&!i.childNodes.some(({type:h})=>td.has(h))){let h=wn(l,o),m=String(g).toLowerCase();if(h.length>0&&h.every(x=>x!==m))return e===void 0?!0:L(i,t,"illegal-attr","illegal attribute value","warning")}}return!1}});var bo,rd,Ai,Yr,gr,On,pt,_n=w(()=>{"use strict";G();se();de();K();D();Qe();xo();bo=a=>a.slice(0,-1),rd=a=>`${bo(a)}-dirty`;try{Ai=new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch{Ai=/[^\W_]/u}pt=class extends S{constructor(e,t,r,i,s=[]){super(void 0,i,s,{});T(this,gr);T(this,Yr);if(y(this,Yr,t),this.setAttribute("name",r),e){let o=/([^\s/](?:(?!\0\d+~\x7F)[^\s/=])*)(?:((?:\s(?:\s|\0\d+[cn]\x7F)*)?(?:=|\0\d+~\x7F)(?:\s|\0\d+[cn]\x7F)*)(?:(["'])([\s\S]*?)(\3|$)|(\S*)))?/gu,l="",g=o.exec(e),p=0,d=()=>{l&&(super.insertAt(new te(l,rd(t),i,s,{})),l="")};for(;g;){let{index:u,0:h,1:m,2:x,3:f,4:b,5:k,6:C}=g;if(l+=e.slice(p,u),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(ge(m).trim())){let A=b!=null?b:C,I=[f,k],P=new dr(bo(t),r,m,x,A,I,i,s);d(),super.insertAt(P)}else l+=h;({lastIndex:p}=o),g=o.exec(e)}l+=e.slice(p),d()}}get type(){return c(this,Yr)}afterBuild(){let{parentNode:e}=this;e!=null&&e.is("td")&&this.setAttribute("name",e.subtype),super.afterBuild()}getAttrTokens(e){return this.childNodes.filter(t=>t instanceof dr&&(!e||t.name===ze(e)))}getAttrToken(e){let t=this.getAttrTokens(e);return t[t.length-1]}getAttr(e){var t;return(t=this.getAttrToken(e))==null?void 0:t.getValue()}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{parentNode:i,childNodes:s}=this,o=new Map,l=new Set,g=new B(this,e);if(v(this,gr,On).call(this)){let p=R(this,g,"no-ignored","attributes of a closing tag"),d=i.getAbsoluteIndex();p.suggestions=[{desc:"remove",range:[e,p.endIndex],text:""},{desc:"open",range:[d+1,d+2],text:""}],r.push(p)}for(let p of s)if(p instanceof dr){let{name:d}=p;o.has(d)?(l.add(d),o.get(d).push(p)):o.set(d,[p])}else{let d=p.text().trim();if(d){let u=L(p,g,"no-ignored","containing invalid attribute",Ai.test(d)?"error":"warning");u.suggestions=[{desc:"remove",range:[u.startIndex,u.endIndex],text:" "}],r.push(u)}}if(l.size>0)for(let p of l){let d=o.get(p).map(u=>{let h=u.getValue();return[u,h===!0?"":h]});r.push(...d.map(([u,h],m)=>{let x=L(u,g,"no-duplicate",$.msg("duplicated $1 attribute",p)),f={desc:"remove",range:[x.startIndex,x.endIndex],text:""};return!h||d.slice(0,m).some(([,b])=>b===h)?x.fix=f:x.suggestions=[f],x}))}return r}getAttribute(e){return e==="invalid"?v(this,gr,On).call(this):super.getAttribute(e)}print(){return this.toString()?`<span class="wpb-${this.type}${v(this,gr,On).call(this)?" wpb-invalid":""}">${this.childNodes.map(e=>e.print(e instanceof te?{class:e.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}};Yr=new WeakMap,gr=new WeakSet,On=function(){let{parentNode:e}=this;return(e==null?void 0:e.type)==="html"&&e.closing&&this.text().trim()!==""}});var To={};ne(To,{PreToken:()=>wi});var wi,yo=w(()=>{"use strict";D();Xe();wi=class extends S{get type(){return"ext-inner"}constructor(n,e,t=[]){if(n){let r=/<nowiki>/giu,i=/<\/nowiki>/giu,{length:s}=r.source,o=r.exec(n);o&&(i.lastIndex=o.index+s);let l=i.exec(n),g=0,p="";for(;o&&l;)new J(o[0],e,t),new J(l[0],e,t),p+=`${n.slice(g,o.index)}\0${t.length-1}n${n.slice(o.index+s,l.index)}\0${t.length}n`,g=l.index+s+1,r.lastIndex=g,o=r.exec(n),o&&(i.lastIndex=o.index+s),l=i.exec(n);n=p+n.slice(g)}super(n,e,t,{}),this.setAttribute("stage",10)}isPlain(){return!0}lint(n=this.getAbsoluteIndex()){return super.lint(n,/<\s*\/\s*(pre)\b/giu)}}});var ur,Dn=w(()=>{"use strict";he();ur=a=>{class n extends a{toString(t){return super.toString(t,`
|
|
1
|
+
"use strict";(()=>{var kl=Object.defineProperty;var Pn=e=>{throw TypeError(e)};var _l=(e,t,s)=>t in e?kl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var Tl=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ae=(e,t,s)=>_l(e,typeof t!="symbol"?t+"":t,s),Ps=(e,t,s)=>t.has(e)||Pn("Cannot "+s);var f=(e,t,s)=>(Ps(e,t,"read from private field"),s?s.call(e):t.get(e)),q=(e,t,s)=>t.has(e)?Pn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),j=(e,t,s,n)=>(Ps(e,t,"write to private field"),n?n.call(e,s):t.set(e,s),s),P=(e,t,s)=>(Ps(e,t,"access private method"),s);var En=(e,t,s,n)=>({set _(a){j(e,t,a,s)},get _(){return f(e,t,n)}});var Td=Tl((Cd,$l)=>{var Il=Object.create,pt=Object.defineProperty,La=Object.getOwnPropertyDescriptor,hn=Object.getOwnPropertyNames,Cl=Object.prototype.hasOwnProperty,ja=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),ft=e=>{throw TypeError(e)},Ra=(e,t,s)=>t in e?pt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,On=(e,t)=>pt(e,"name",{value:t,configurable:!0}),C=(e,t)=>function(){return e&&(t=(0,e[hn(e)[0]])(e=0)),t},Nl=(e,t)=>function(){return t||(0,e[hn(e)[0]])((t={exports:{}}).exports,t),t.exports},ie=(e,t)=>{for(var s in t)pt(e,s,{get:t[s],enumerable:!0})},Fl=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of hn(t))!Cl.call(e,a)&&a!==s&&pt(e,a,{get:()=>t[a],enumerable:!(n=La(t,a))||n.enumerable});return e},Y=e=>Fl(pt({},"__esModule",{value:!0}),e),oe=e=>{var t;return[,,,Il((t=e==null?void 0:e[ja("metadata")])!=null?t:null)]},Pa=["class","method","getter","setter","accessor","field","value","get","set"],Lt=e=>e!==void 0&&typeof e!="function"?ft("Function expected"):e,Ll=(e,t,s,n,a)=>({kind:Pa[e],name:t,metadata:n,addInitializer:r=>s._?ft("Already initialized"):a.push(Lt(r||null))}),cn=(e,t)=>Ra(t,ja("metadata"),e[3]),le=(e,t,s,n)=>{for(var a=0,r=e[t>>1],i=r&&r.length;a<i;a++)t&1?r[a].call(s):n=r[a].call(s,n);return n},de=(e,t,s,n,a,r)=>{var i,o,l,d,h,c=t&7,x=!!(t&8),g=!!(t&16),u=c>3?e.length+1:c?x?1:2:0,y=Pa[c+5],k=c>3&&(e[u-1]=[]),$=e[u]||(e[u]=[]),T=c&&(!g&&!x&&(a=a.prototype),c<5&&(c>3||!g)&&La(c<4?a:{get[s](){return ge(this,r)},set[s](p){return ke(this,r,p)}},s));c?g&&c<4&&On(r,(c>2?"set ":c>1?"get ":"")+s):On(a,s);for(var m=n.length-1;m>=0;m--)d=Ll(c,s,l={},e[3],$),c&&(d.static=x,d.private=g,h=d.access={has:g?p=>Rl(a,p):p=>s in p},c^3&&(h.get=g?p=>(c^1?ge:dt)(p,a,c^4?r:T.get):p=>p[s]),c>2&&(h.set=g?(p,b)=>ke(p,a,b,c^4?r:T.set):(p,b)=>p[s]=b)),o=(0,n[m])(c?c<4?g?r:T[y]:c>4?void 0:{get:T.get,set:T.set}:a,d),l._=1,c^4||o===void 0?Lt(o)&&(c>4?k.unshift(o):c?g?r=o:T[y]=o:a=o):typeof o!="object"||o===null?ft("Object expected"):(Lt(i=o.get)&&(T.get=i),Lt(i=o.set)&&(T.set=i),Lt(i=o.init)&&k.unshift(i));return c||cn(e,a),T&&pt(a,s,T),g?c^4?r:T:a},jl=(e,t,s)=>Ra(e,typeof t!="symbol"?t+"":t,s),un=(e,t,s)=>t.has(e)||ft("Cannot "+s),Rl=(e,t)=>Object(t)!==t?ft('Cannot use the "in" operator on this value'):e.has(t),ge=(e,t,s)=>(un(e,t,"read from private field"),s?s.call(e):t.get(e)),Fe=(e,t,s)=>t.has(e)?ft("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),ke=(e,t,s,n)=>(un(e,t,"write to private field"),n?n.call(e,s):t.set(e,s),s),dt=(e,t,s)=>(un(e,t,"access private method"),s),Pl=(e,t,s,n)=>({set _(a){ke(e,t,a,s)},get _(){return ge(e,t,n)}}),Ea,gn,Oa=C({"base.ts"(){"use strict";Ea=(()=>{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})(),gn=(()=>{const e=["bold-header","format-leakage","fostered-content","h1","illegal-attr","insecure-style","invalid-gallery","invalid-imagemap","invalid-invoke","invalid-isbn","lonely-apos","lonely-bracket","lonely-http","nested-link","no-arg","no-duplicate","no-ignored","obsolete-attr","obsolete-tag","parsing-order","pipe-like","table-layout","tag-like","unbalanced-header","unclosed-comment","unclosed-quote","unclosed-table","unescaped","unknown-page","unmatched-tag","unterminated-url","url-encoding","var-anchor","void-ext"];return Object.freeze(e),e})()}});function Ge(e){const t=new Map,s=new WeakMap;return n=>{const a=typeof n=="string"?t:s;if(a.has(n)){const i=a.get(n);return i.lastIndex=0,i}const r=e(n);return a.set(n,r),r}}var Jt,qa,qn,Ba,Wa,xt=C({"../code-standard/dist/index.mjs"(){"use strict";Jt=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25")),qa=e=>Math.round(e*255).toString(16).padStart(2,"0"),qn=(()=>{const e=String.raw`#(?:[\da-f]{3,4}|(?:[\da-f]{2}){3,4})(?![\p{L}\p{N}_])`,t=String.raw`(?:\d*\.)?\d+%?`,s=String.raw`(?:\d*\.)?\d+(?:deg|grad|rad|turn)?`,n=String.raw`rgba?\(\s*(?:${String.raw`${new Array(3).fill(t).join(String.raw`\s+`)}(?:\s*\/\s*${t})?`}|${String.raw`${new Array(3).fill(t).join(String.raw`\s*,\s*`)}(?:\s*,\s*${t})?`})\s*\)`,a=String.raw`hsla?\(\s*(?:${String.raw`${s}\s+${t}\s+${t}(?:\s*\/\s*${t})?`}|${String.raw`${s}${String.raw`\s*,\s*(?:\d*\.)?\d+%`.repeat(2)}(?:\s*,\s*${t})?`})\s*\)`;return{full:new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${e}|${n}|${a})`,"giu"),rgb:new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${e}|${n})`,"giu")}})(),Ba=(e,t=!0)=>{const s=[],n=qn[t?"full":"rgb"];n.lastIndex=0;let a=n.exec(e),r=0;for(;a;){const i=a.index+a[1].length;i>r&&s.push([e.slice(r,i),r,i,!1]),{lastIndex:r}=n,s.push([a[2],i,r,e[i-1]!=="&"||!/^#\d+$/u.test(a[2])]),a=n.exec(e)}return e.length>r&&s.push([e.slice(r),r,e.length,!1]),s},Wa=Ge}}),Ee,Es,ht,ct,ut,Le,Ye,Xt,_e,Ve,Bn,Wn,Kt,Ua,Un,Mn,Yt,gt,ce=C({"util/string.ts"(){"use strict";xt(),Ee=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Es=String.raw`[^[\]<>"\0-\x1F\x7F${Ee}\uFFFD]`,ht=String.raw`(?:\[[\da-f:.]+\]|${Es})`,ct=String.raw`(?:${Es}|\0\d+[cn!~]\x7F)*`,ut=e=>e.trim().toLowerCase(),Le=(e,t)=>e.replace(/\0(\d+)\x7F/gu,(s,n)=>t[n]),Ye=(e,t)=>s=>s.replace(e,t),Xt=Ye(/[\0\x7F]|\r$/gmu,""),_e=Ye(/\0\d+[cn]\x7F/gu,""),Ve=(e,t="")=>e.map(s=>typeof s=="string"?s:s.text()).join(t),Bn={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},Wn=Ye(/&(?:#(\d+|[Xx][\da-fA-F]+)|([lg]t|[LG]T|[lr]brac[ke]|nbsp|amp|AMP|quot|QUOT));/gu,(e,t,s)=>t?String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t)):Bn[s.toLowerCase()]),Kt=e=>Wn(e),Ua=Ye(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),Un={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},Mn=e=>Ye(e,t=>`&${Un[t]};`),Yt=Mn(/[&<>]/gu),gt=(e,t={})=>{const{pre:s="",post:n="",sep:a=""}=t;return s+e.map(r=>r.print()).join(a)+n}}}),El=Nl({"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","#urlencode":"urlencode","#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","#cscore":"cscore","#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","#chart":"chart"},{"!":"!","=":"=","#FORMAL":"formal","#bcp47":"bcp47","#dir":"dir","#interwikilink":"interwikilink","#interlanguagelink":"interlanguagelink","#timef":"timef","#timefl":"timefl"},["msg","raw"],["subst","safesubst"]],doubleUnderscore:[[],[]],protocol:"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|matrix:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|worldwind://|xmpp:",interwiki:[],img:{},redirection:["#redirect"],variants:[]}}}),we,Gr,Qe=C({"util/constants.ts"(){"use strict";we=11,Gr=El()}}),he,ue=C({"lib/rect.ts"(){"use strict";var e,t,s,n,Dr,r;he=(r=class{constructor(i,o){q(this,n);q(this,e);q(this,t);q(this,s);j(this,e,i),j(this,t,o)}get start(){return f(this,t)}get top(){return P(this,n,Dr).call(this).top}get left(){return P(this,n,Dr).call(this).left}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n=new WeakSet,Dr=function(){var i;return(i=f(this,s))!=null||j(this,s,f(this,e).getRootNode().posFromIndex(f(this,t))),f(this,s)},r)}}),zn,Hn,Dt,Zt,Os,Q,Z,De,pn,X=C({"util/lint.ts"(){"use strict";be(),ue(),J(),zn=new Set(["tr","td","th","caption"]),Hn=new Set(["Template:!!","Template:!-"]),Dt=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")&&Hn.has(t.name)||t.is("html")&&zn.has(t.name))return!1;if(t.is("arg"))return t.length>1&&Dt(t.childNodes[1]);if(t.is("magic-word"))try{const s=t.getPossibleValues().map(Dt);return s.includes("error")?"error":s.includes("warning")&&"warning"}catch{}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?"warning":"error"},Zt=(e,t,s,n)=>({line:e+s-1,character:(s===1?t:0)+n}),Os=e=>(t,s,n,a,r="error")=>{const{start:i}=s,{top:o,left:l}=s instanceof he?s:new he(t,i),{offsetHeight:d,offsetWidth:h}=t,{startIndex:c,startLine:x,startCol:g}=e(t,i,o,l),{line:u,character:y}=Zt(x,g,d,h);return{rule:n,message:W.msg(a),severity:r,startIndex:c,endIndex:c+t.toString().length,startLine:x,endLine:u,startCol:g,endCol:y}},Q=Os((e,t,s,n)=>{const a=e.getRelativeIndex(),{top:r,left:i}=e.parentNode.posFromIndex(a);return{startIndex:t+a,startLine:s+r,startCol:r?i:n+i}}),Z=Os((e,t,s,n)=>({startIndex:t,startLine:s,startCol:n})),De=(e,t,s,n)=>{if(e&&(n||W.viewOnly&&e[0]===me.rev))return e[1];const a=t();return(n||W.viewOnly)&&s([me.rev,a]),a},pn=(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"]:[]}}),Gn,xs,Ol=C({"parser/selector.ts"(){"use strict";Gn=(e,t,s)=>{if(e.includes("#")){const[n,...a]=e.split("#");return(!n||n===t)&&a.every(r=>r===s)}return!e||e===t},xs=(e,t,s)=>({type:n,name:a})=>e.split(",").some(r=>Gn(r.trim(),n,a))}}),fn,Ma=C({"mixin/cached.ts"(){"use strict";X(),fn=(e=!0)=>t=>{const s=new WeakMap;return function(...n){return De(s.get(this),()=>t.apply(this,n),a=>{s.set(this,a)},e)}}}}),Dn,ns,St,At,is,$t,kt,_t,as,os,Vt,za=C({"lib/node.ts"(){"use strict";X(),be(),Ma(),J(),Dn=[fn(!1)],Vt=class{constructor(){le(os,5,this),Fe(this,_t),jl(this,"childNodes",[]),Fe(this,ns),Fe(this,St),Fe(this,At),Fe(this,is),Fe(this,$t),Fe(this,kt,{})}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get parentNode(){return ge(this,ns)}get nextSibling(){return ge(this,St)}get previousSibling(){return ge(this,At)}get offsetHeight(){return dt(this,_t,as).call(this).height}get offsetWidth(){return dt(this,_t,as).call(this).width}getChildNodes(){const{childNodes:e}=this;return Object.isFrozen(e)?[...e]:e}getAttribute(e){return e==="padding"?0:this[e]}setAttribute(e,t){switch(e){case"parentNode":ke(this,ns,t),t||(ke(this,St,void 0),ke(this,At,void 0));break;case"nextSibling":ke(this,St,t);break;case"previousSibling":ke(this,At,t);break;case"aIndex":W.viewOnly&&ke(this,$t,[me.rev,t]);break;default:this[e]=t}}getRootNode(){return De(ge(this,is),()=>{var e,t;return(t=(e=this.parentNode)==null?void 0:e.getRootNode())!=null?t:this},e=>{const[,t]=e;t.type==="root"&&ke(this,is,e)})}indexFromPos(e,t){{if(e<0||t<0)return;const s=this.getLines();if(e>=s.length)return;const[,n,a]=s[e],r=n+t;return r>a?void 0:r}this.lspError("AstNode.indexFromPos")}posFromIndex(e){const{length:t}=String(this);if(e+=e<0?t:0,e>=0&&e<=t){const s=this.getLines(),n=s.findIndex(([,,a])=>e<=a);return{top:n,left:e-s[n][1]}}}getGaps(e){return 0}getRelativeIndex(e){if(e===void 0){const{parentNode:t}=this;return t?t.getRelativeIndex(t.childNodes.indexOf(this)):0}return De(ge(this,kt)[e],()=>{const{childNodes:t}=this,s=e+(e<0?t.length:0);let n=this.getAttribute("padding");for(let a=0;a<s;a++)W.viewOnly&&(ge(this,kt)[a]=[me.rev,n]),n+=t[a].toString().length+this.getGaps(a);return n},t=>{ge(this,kt)[e]=t})}getAbsoluteIndex(){return De(ge(this,$t),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{ke(this,$t,e)})}getBoundingClientRect(){return{...dt(this,_t,as).call(this),...this.getRootNode().posFromIndex(this.getAbsoluteIndex())}}is(e){return this.type===e}getLines(){const e=[];let t=0;for(const s of String(this).split(`
|
|
2
|
+
`)){const n=t+s.length;e.push([s,t,n]),t=n+1}return e}seal(e,t){Object.defineProperty(this,e,{enumerable:!t&&!!this[e],configurable:!0})}lspError(e){throw new Error(`${e} method is only available in the LSP version!`)}},os=oe(null),ns=new WeakMap,St=new WeakMap,At=new WeakMap,is=new WeakMap,$t=new WeakMap,kt=new WeakMap,_t=new WeakSet,as=function(){const e=this.getLines(),t=e[e.length-1];return{height:e.length,width:t[2]-t[1]}},de(os,1,"getLines",Dn,Vt),cn(os,Vt)}}),Ha,ql=C({"lib/element.ts"(){"use strict";var e,Vr,Qr,n;ce(),be(),Ol(),za(),Ha=(n=class extends Vt{constructor(){super(...arguments);q(this,e)}get length(){return this.childNodes.length}text(r){return Ve(this.childNodes,r)}normalize(){const r=this.getChildNodes(),i=o=>{var l,d;r.splice(o,1),(l=r[o-1])==null||l.setAttribute("nextSibling",r[o]),(d=r[o])==null||d.setAttribute("previousSibling",r[o-1])};for(let o=r.length-1;o>=0;o--){const{type:l,data:d}=r[o];l!=="text"||r.length===1||this.getGaps(o-(o&&1))||d===""&&i(o)}this.setAttribute("childNodes",r)}removeAt(r){return $s(this,r,1)[0]}insertAt(r,i=this.length){return $s(this,i,0,[r]),r}closest(r){const i=xs(r,this);let{parentNode:o}=this;for(;o;){if(i(o))return o;({parentNode:o}=o)}}querySelector(r){const i=xs(r,this);return P(this,e,Vr).call(this,i)}querySelectorAll(r){const i=xs(r,this);return P(this,e,Qr).call(this,i)}append(...r){this.safeAppend(r)}safeAppend(r){for(const i of r)this.insertAt(i)}replaceChildren(...r){this.safeReplaceChildren(r)}safeReplaceChildren(r){for(let i=this.length-1;i>=0;i--)this.removeAt(i);this.safeAppend(r)}setText(r,i=0){i+=i<0?this.length:0;const o=this.childNodes[i],{data:l}=o;return o.replaceData(r),l}toString(r,i=""){return this.childNodes.map(o=>o.toString(r)).join(i)}caretPositionFromIndex(r){{if(r===void 0)return;const{length:i}=this.toString();if(r>i||r<-i)return;r+=r<0?i:0;let o=this,l=0,d=0;for(;o.type!=="text";){const{childNodes:h}=o;l+=o.getAttribute("padding");for(let c=0;l<=r&&c<h.length;c++){const x=h[c],{nextSibling:g}=x,u=x.toString(),y=u.length;if(x.setAttribute("aIndex",l),l+=y,l>r||l===r&&y>0&&(!g||g.type==="text"||x.type!=="text"&&(u.trim()||!g.toString().trim()))){o=x,l-=y,d=l;break}l+=o.getGaps(c)}if(o.childNodes===h)return{offsetNode:o,offset:r-d}}return{offsetNode:o,offset:r-d}}this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(r){var i;{const o=(i=this.caretPositionFromIndex(r))==null?void 0:i.offsetNode;return(o==null?void 0:o.type)==="text"?o.parentNode:o}this.lspError("AstElement.elementFromIndex")}elementFromPoint(r,i){return this.elementFromIndex(this.indexFromPos(i,r))}lint(r=this.getAbsoluteIndex(),i){const o=[];for(let l=0,d=r+this.getAttribute("padding");l<this.length;l++){const h=this.childNodes[l];h.setAttribute("aIndex",d);const c=h.lint(d,i);c.length>0&&o.push(...c),d+=h.toString().length+this.getGaps(l)}return o}print(r={}){const i=r.class;return this.toString()?(i===""?"":`<span class="wpb-${i!=null?i:this.type}${this.getAttribute("invalid")?" wpb-invalid":""}">`)+gt(this.childNodes,r)+(i===""?"":"</span>"):""}json(r,i=this.getAbsoluteIndex()){const o={...this,type:this.type,range:[i,i+this.toString().length],childNodes:[]};for(let l=0,d=i+this.getAttribute("padding");l<this.length;l++){const h=this.childNodes[l],{length:c}=h.toString();h.setAttribute("aIndex",d),o.childNodes.push(h.type==="text"?{data:h.data,range:[d,d+c]}:h.json(void 0,d)),d+=c+this.getGaps(l)}return o}},e=new WeakSet,Vr=function(r){var i;for(const o of this.childNodes){if(o.type==="text")continue;if(r(o))return o;const l=P(i=o,e,Vr).call(i,r);if(l)return l}},Qr=function(r){var o;let i=[];for(const l of this.childNodes)l.type!=="text"&&(r(l)&&i.push(l),i=[...i,...P(o=l,e,Qr).call(o,r)]);return i},n)}}),ls,qs,Vn,Qn,Jn,Xn,Kn,Bs,Ws,Jr,Bl=C({"lib/text.ts"(){"use strict";var e,Ga,s;ce(),X(),J(),za(),ls=String.raw`[${Ee}\t]*`,qs=String.raw`<\s*(?:/\s*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${ls}\d)|isbn(?=[-::]?${ls}(?:\d(?:${ls}|-)){6})`,Vn=new RegExp(String.raw`${qs}|https?[:/]/+`,"giu"),Qn=new RegExp(qs,"giu"),Jn=new Set(["attr-value","ext-link-text","link-text"]),Xn={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},Kn={"<":"tag-like","[":"lonely-bracket","{":"lonely-bracket","]":"lonely-bracket","}":"lonely-bracket",h:"lonely-http",r:"lonely-http",p:"lonely-http",i:"lonely-http"},Bs=new Set(["html","head","style","title","body","a","audio","img","video","embed","iframe","object","canvas","script","col","colgroup","tbody","tfoot","thead","button","input","label","option","select","textarea"]);try{Ws=new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch{Ws=/\w/u}Jr=(s=class extends Vt{constructor(a){super();q(this,e);Ae(this,"data","");this.data=a}get type(){return"text"}toString(a){var r;return a&&!((r=this.parentNode)!=null&&r.getAttribute("built"))?_e(this.data):this.data}text(){return this.data}lint(a=this.getAbsoluteIndex(),r){var _,E,F;if(r===!1)return[];const{data:i,parentNode:o,nextSibling:l,previousSibling:d}=this;if(!o)throw new Error("An isolated text node cannot be linted!");const{type:h,name:c,parentNode:x}=o;let g=!1;if(h==="attr-value"){const{type:N,name:O,tag:R}=x;if(N!=="ext-attr")g=!0;else if(R==="ref"&&(O==="name"||O==="extends"||O==="follow")||O==="group"&&(R==="ref"||R==="references")||R==="choose"&&(O==="before"||O==="after"))return[]}if(r!=null||(r=h==="free-ext-link"||h==="ext-link-url"||h==="ext-link-text"||h==="image-parameter"&&c==="link"||g?Qn:Vn),i.search(r)===-1)return[];r.lastIndex=0;const u=[],y=l==null?void 0:l.type,k=l==null?void 0:l.name,$=d==null?void 0:d.type,T=this.getRootNode(),m=T.toString(),{ext:p,html:b,variants:w}=T.getAttribute("config"),{top:v,left:A}=T.posFromIndex(a),S=new Set(["onlyinclude","noinclude","includeonly",...p,...b[0],...b[1],...b[2],...Bs]);for(let N=r.exec(i);N;N=r.exec(i)){const[,O,R]=N;let{index:L,0:U}=N;if(R&&R!=="]"){const{length:te}=R;L+=te,U=U.slice(te)}U=U.toLowerCase();const[I]=U,B=I==="r"||I==="p"||I==="i";let{length:M}=U;if(I==="<"&&!S.has(O.toLowerCase())||I==="["&&h==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(i.slice(L+1))||l!=null&&l.is("ext")&&k==="nowiki"&&((_=l.innerText)!=null&&_.includes("]")))||B&&(!o.isPlain()||Jn.has(h)))continue;I==="]"&&(L||M>1)&&r.lastIndex--;let H=a+L,G=H+M;const K=m[G],se=m[H-1];let re=M>1&&!(I==="<"&&(/^<\s/u.test(U)||!/[\s/>]/u.test(K!=null?K:"")||Bs.has(O))||g&&(I==="["||I==="]")||B&&h==="parameter-value"||/^(?:rfc|pmid|isbn)$/iu.test(U))||I==="{"&&(K===I||se==="-"&&w.length>0)||I==="}"&&(se===I||K==="-"&&w.length>0)||I==="["&&(h==="ext-link-text"||y==="free-ext-link"&&!i.slice(L+1).trim())||I==="]"&&$==="free-ext-link"&&!i.slice(0,L).includes("]")?"error":"warning";const Ne=I==="{"||I==="[";if(re==="warning"&&(Ne||(I==="]"||I==="}"))){const te=Xn[I],fe=Ne?i.slice(L+1):i.slice(0,L);if(I==="{"&&((E=te.exec(fe))==null?void 0:E[0])==="}"||I==="}"&&((F=te.exec(fe))==null?void 0:F[0])==="{")continue;if(!fe.includes(I)){const ye=Ne?"nextSibling":"previousSibling";let Se=this[ye];for(;Se&&(Se.type!=="text"||!te.test(Se.data));)Se=Se[ye];if(Se&&te.exec(Se.data)[0]!==I)continue}}B?U=U.toUpperCase():U==="{"&&se==="-"&&re==="error"?(re="warning",L>0&&(U="-{",L--,H--,M=2)):U==="}"&&K==="-"&&re==="error"&&(re="warning",L<i.length-1&&(U="}-",G++,M=2));const wt=this.posFromIndex(L),{line:yt,character:D}=Zt(v,A,wt.top+1,wt.left),ne={rule:Kn[I],message:W.msg('lonely "$1"',B||I==="h"||U==="-{"||U==="}-"?U:I),severity:re,startIndex:H,endIndex:G,startLine:yt,endLine:yt,startCol:D,endCol:D+M};if(I==="<")ne.suggestions=[{desc:"escape",range:[H,H+1],text:"<"}];else if(I==="h"&&h!=="link-text"&&Ws.test(se||""))ne.suggestions=[{desc:"whitespace",range:[H,H],text:" "}];else if(I==="["&&h==="ext-link-text"){const te=o.getAbsoluteIndex()+o.toString().length;ne.suggestions=[{desc:"escape",range:[te,te+1],text:"]"}]}else if(I==="]"&&$==="free-ext-link"&&re==="error"){const te=a-d.toString().length;ne.suggestions=[{desc:"left bracket",range:[te,te],text:"["}]}else B&&(ne.suggestions=[...N[0]===U?[]:[{desc:"uppercase",range:[H,G],text:U}],...K===":"||K===":"?[{desc:"whitespace",range:[G,G+1],text:" "}]:[]]);u.push(ne)}return u}replaceData(a){P(this,e,Ga).call(this,a)}print(){return Yt(this.data)}},e=new WeakSet,Ga=function(a){this.setAttribute("data",a)},s)}}),Je,mt=C({"mixin/hidden.ts"(){"use strict";be(),Je=(e=!0,t=!0)=>s=>{class n extends s{text(){return""}lint(r){return e?[]:super.lint(r)}}return bt(n,s),n}}}),Xe,vt=C({"src/syntax.ts"(){"use strict";var e,t;V(),Xe=(t=class extends z{constructor(n,a,r,i,o){super(n,r,i,o);q(this,e);j(this,e,a)}get type(){return f(this,e)}lint(n=this.getAbsoluteIndex()){return super.lint(n,!1)}},e=new WeakMap,t)}}),je,Oe=C({"mixin/padded.ts"(){"use strict";be(),je=({length:e})=>t=>{class s extends t{getAttribute(a){return a==="padding"?e:super.getAttribute(a)}}return bt(s,t),s}}}),ve,qe=C({"src/atom.ts"(){"use strict";var e,t;V(),ve=(t=class extends z{constructor(n,a,r,i,o){super(n,r,i,o);q(this,e);j(this,e,a)}get type(){return f(this,e)}set type(n){j(this,e,n)}getAttribute(n){var a;return n==="invalid"?this.type==="converter-flag"&&!!((a=this.parentNode)!=null&&a.isInvalidFlag(this)):super.getAttribute(n)}},e=new WeakMap,t)}}),Yn,Zn,Us,ei,Pe,ks=C({"src/link/base.ts"(){"use strict";var e,t,s,n;X(),Qe(),ce(),ue(),Oe(),V(),qe(),Yn=a=>a==="redirect-target"||a==="link",Zn=[je("[[")],Pe=(n=class extends(ei=z){constructor(r,i,o,l=[],d="|"){super(void 0,o,l,{});q(this,e,!0);q(this,t);q(this,s);if(this.insertAt(new ve(r,"link-target",o,l,{})),i!==void 0){const h=new z(i,o,l,{});h.type="link-text",h.setAttribute("stage",we-1),this.insertAt(h)}j(this,t,d)}get link(){return f(this,s)}get fragment(){return f(this,s).fragment}afterBuild(){j(this,s,this.getTitle()),f(this,t).includes("\0")&&j(this,t,this.buildFromStr(f(this,t),0)),this.setAttribute("name",f(this,s).title),super.afterBuild()}setAttribute(r,i){r==="bracket"?j(this,e,i):r==="title"?j(this,s,i):super.setAttribute(r,i)}toString(r){const i=super.toString(r,f(this,t));return f(this,e)?`[[${i}]]`:i}text(){const r=super.text("|");return f(this,e)?`[[${r}]]`:r}getAttribute(r){return r==="title"?f(this,s):super.getAttribute(r)}getGaps(r){return r===0?f(this,t).length:1}lint(r=this.getAbsoluteIndex(),i){const o=super.lint(r,i),{childNodes:[l,d],type:h}=this,{encoded:c,fragment:x}=f(this,s),g=new he(this,r);if(l.childNodes.some(({type:u})=>u==="template")&&o.push(Q(l,g,"unknown-page","template in an internal link target","warning")),c){const u=Q(l,g,"url-encoding","unnecessary URL encoding in an internal link","warning");u.fix={desc:"decode",range:[u.startIndex,u.endIndex],text:Jt(l.text())},o.push(u)}if(h==="link"||h==="category"){const u=d==null?void 0:d.childNodes.findIndex(k=>k.type==="text"&&k.data.includes("|")),y=d==null?void 0:d.childNodes[u];if(y){const k=Q(d,g,"pipe-like",'additional "|" in the link text',"warning"),$=k.startIndex+d.getRelativeIndex(u);k.suggestions=[{desc:"escape",range:[$,$+y.data.length],text:y.data.replace(/\|/gu,"|")}],o.push(k)}}if(x!==void 0&&!Yn(h)){const u=Q(l,g,"no-ignored","useless fragment","warning"),y=l.childNodes.findIndex($=>$.type==="text"&&$.data.includes("#")),k=l.childNodes[y];k&&(u.fix={desc:"remove",range:[u.startIndex+l.getRelativeIndex(y)+k.data.indexOf("#"),u.endIndex],text:""}),o.push(u)}return o}getTitle(r,i){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:i,temporary:r,decode:!0,selfLink:!0})}print(){return super.print(f(this,e)?{pre:"[[",post:"]]",sep:f(this,t)}:{sep:f(this,t)})}json(r,i=this.getAbsoluteIndex()){const o=super.json(void 0,i),{type:l,fragment:d}=this;return d!==void 0&&(l==="link"||l==="redirect-target")&&(o.fragment=d),o}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n),Us=oe(ei),Pe=de(Us,0,"LinkBaseToken",Zn,Pe),le(Us,1,Pe)}}),Be,Ke=C({"src/nowiki/base.ts"(){"use strict";V(),Be=class extends z{get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}}}}),ti,Ms,si,pe,We=C({"src/nowiki/noinclude.ts"(){"use strict";mt(),Ke(),ti=[Je()],pe=class extends(si=Be){get type(){return"noinclude"}toString(e){return e?"":super.toString()}},Ms=oe(si),pe=de(Ms,0,"NoincludeToken",ti,pe),le(Ms,1,pe)}}),Da,Wl=C({"src/link/redirectTarget.ts"(){"use strict";X(),J(),ks(),We(),Da=class extends Pe{get type(){return"redirect-target"}constructor(e,t,s,n){super(e,void 0,s,n),t!==void 0&&this.insertAt(new pe(t,s,n))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,{halfParsed:!0,decode:!0})}lint(e=this.getAbsoluteIndex()){const t=super.lint(e,!1),s="no-ignored",n=W.lintConfig.getSeverity(s,"redirect");if(n&&this.length===2){const a=Q(this.lastChild,{start:e},s,"useless link text",n);a.startIndex--,a.startCol--,a.fix={desc:"remove",range:[a.startIndex,a.endIndex],text:""},t.push(a)}return t}}}}),ri,zs,ni,jt,Ul=C({"src/redirect.ts"(){"use strict";var e,t,s;mt(),V(),vt(),Wl(),ri=[Je(!1,!1)],jt=(s=class extends(ni=z){constructor(a,r,i,o,l,d,h=[]){super(void 0,d,h);q(this,e);q(this,t);j(this,e,a),j(this,t,l),this.append(new Xe(r,"redirect-syntax",d,h),new Da(i,o==null?void 0:o.slice(1),d,h))}get type(){return"redirect"}getAttribute(a){return a==="padding"?f(this,e).length:super.getAttribute(a)}toString(a){return f(this,e)+super.toString(a)+f(this,t)}lint(a=this.getAbsoluteIndex()){const r=a+f(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",r),this.lastChild.lint(r)}print(){return super.print({pre:f(this,e),post:f(this,t)})}},e=new WeakMap,t=new WeakMap,s),zs=oe(ni),jt=de(zs,0,"RedirectToken",ri,jt),le(zs,1,jt)}}),Va={};ie(Va,{parseRedirect:()=>Qa});var Qa,Ml=C({"parser/redirect.ts"(){"use strict";J(),Ul(),Qa=(e,t,s)=>{var a;(a=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&&W.normalizeTitle(n[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0}).valid?(e=`\0${s.length}o${e.slice(n[0].length)}`,new jt(...n.slice(1),t,s),e):!1}}}),ii,Hs,ai,Rt,zl=C({"src/onlyinclude.ts"(){"use strict";Oe(),V(),ii=[je("<onlyinclude>")],Rt=class extends(ai=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=oe(ai),Rt=de(Hs,0,"OnlyincludeToken",ii,Rt),le(Hs,1,Rt)}}),ts,_s=C({"mixin/gapped.ts"(){"use strict";be(),ts=(e=1)=>t=>{class s extends t{getGaps(){return e}}return bt(s,t),s}}}),oi,Gs,li,He,xn=C({"src/tagPair/index.ts"(){"use strict";var e,t;_s(),V(),oi=[ts()],He=(t=class extends(li=z){constructor(n,a,r,i,o,l=[]){super(void 0,o);q(this,e);Ae(this,"closed");Ae(this,"selfClosing");this.setAttribute("name",n.toLowerCase()),j(this,e,[n,i||n]),this.closed=i!=="",this.selfClosing=i===void 0,this.append(a,r);const d=typeof a=="string"?-1:l.indexOf(a);l.splice(d===-1?1/0:d,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(n){const{selfClosing:a,firstChild:r,lastChild:i}=this,[o,l]=f(this,e);return a?`<${o}${r.toString(n)}/>`:`<${o}${r.toString(n)}>${i.toString(n)}${this.closed?`</${l}>`:""}`}text(){const[n,a]=f(this,e);return this.selfClosing?`<${n}${this.firstChild.text()}/>`:`<${n}${super.text(">")}${this.closed?`</${a}>`:""}`}getAttribute(n){return n==="padding"?f(this,e)[0].length+1:super.getAttribute(n)}print(){const[n,a]=f(this,e);return super.print(this.selfClosing?{pre:`<${n}`,post:"/>"}:{pre:`<${n}`,sep:">",post:this.closed?`</${a}>`:""})}},e=new WeakMap,t),Gs=oe(li),He=de(Gs,0,"TagPairToken",oi,He),le(Gs,1,He)}}),Ja,Hl=C({"src/tagPair/translate.ts"(){"use strict";var e,Xa,s;V(),xn(),vt(),We(),Ja=(s=class extends He{constructor(a,r,i,o=[]){const l=new Xe(a,"translate-attr",i,o);r=r==null?void 0:r.replace(/(<tvar\|[^>]+>)([\s\S]*?)(<\/>)/gu,(h,c,x,g)=>(new pe(c,i,o),new pe(g,i,o),`\0${o.length-1}n${x}\0${o.length}n`)).replace(/(<tvar\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\2|[^"'\s>]+))?\s*>)([\s\S]*?)(<\/tvar\s*>)/giu,(h,c,x,g,u)=>(new pe(c,i,o),new pe(u,i,o),`\0${o.length-1}n${g}\0${o.length}n`));const d=new z(r,i,o);d.type="translate-inner";super("translate",l,d,"translate",i,o);q(this,e);this.seal("closed",!0),this.seal("selfClosing",!0)}get type(){return"translate"}toString(a){return a?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){return`<span class="wpb-ext"><translate${P(this,e,Xa).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,Xa=function(){return this.firstChild.toString()===" nowrap"},s)}}),di,Ds,hi,Pt,Gl=C({"src/tagPair/include.ts"(){"use strict";X(),ue(),mt(),J(),xn(),di=[Je(!1)],Pt=class extends(hi=He){get type(){return"include"}constructor(e,t="",s,n,a,r){super(e,t,s!=null?s:"",s===void 0||n!=null?n:"",a,r)}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){const t=[],{firstChild:s,closed:n,name:a}=this,r=new he(this,e),i=["no-ignored","unclosed-comment"],o=i.map(l=>W.lintConfig.getSeverity(l,"include"));if(o[0]&&s.data.trim()){const l=Q(s,r,i[0],"useless attribute",o[0]);l.suggestions=[{desc:"remove",range:[l.startIndex,l.endIndex],text:""}],t.push(l)}if(o[1]&&!n){const l=Z(this,r,i[1],W.msg("unclosed $1",`<${a}>`),o[1]);l.suggestions=[{desc:"close",range:[l.endIndex,l.endIndex],text:`</${a}>`}],t.push(l)}return t}},Ds=oe(hi),Pt=de(Ds,0,"IncludeToken",di,Pt),le(Ds,1,Pt)}}),Ts,mn=C({"mixin/attributesParent.ts"(){"use strict";be(),Ts=(e=0)=>t=>{var n,Xr;class s extends t{constructor(){super(...arguments);q(this,n)}hasAttr(o){return P(this,n,Xr).call(this).hasAttr(o)}getAttr(o){return P(this,n,Xr).call(this).getAttr(o)}}return n=new WeakSet,Xr=function(){return this.childNodes[e]},bt(s,t),s}}}),ae,Vs,Qs,Tt,ds,Js,Ue,Xs,Ks,Ys,hs,Zs,Ie,vn,bn,wn,Ka,Ya=C({"util/sharable.ts"(){"use strict";ae=new Set(["align"]),Vs=new Set(["cite"]),Qs=new Set(["cite","datetime"]),Tt=new Set(["width"]),ds=new Set(["axis","align","bgcolor","height","width","valign"]),Js=new Set([...ds,"abbr","headers","scope","rowspan","colspan"]),Ue=new Set(["type"]),Xs=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),Ks=new Set(["clear"]),Ys=new Set(["bgcolor","align","valign"]),hs=new Set(["qid","forcemathmode","type","display"]),Zs=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),Ie=new Set,vn=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"]),bn={div:ae,h1:ae,h2:ae,h3:ae,h4:ae,h5:ae,h6:ae,blockquote:Vs,q:Vs,p:ae,br:Ks,pre:Tt,ins:Qs,del:Qs,ul:Ue,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...Xs,"border"]),caption:ae,tr:Ys,td:Js,th:Js,img:new Set(["alt","src","width","height","srcset"]),font:new Set(["size","color","face"]),hr:Tt,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Ue,poem:ae,categorytree:ae,combooption:ae,math:Ie,chem:Ie,ce:Ie},wn={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:Ie,indicator:new Set(["name"]),langconvert:new Set(["from","to"]),ref:new Set(["group","name","extends","follow","dir"]),references:new Set(["group","responsive"]),charinsert:new Set(["label"]),choose:new Set(["uncached","before","after"]),option:new Set(["weight"]),imagemap:Ie,inputbox:Ie,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:Ie,poll:new Set(["id","show-results-before-voting"]),sm2:Ue,flashmp3:Ue,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([...hs,"chem"]),chem:hs,ce:hs,hiero:Ie,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:Zs,syntaxhighlight:Zs,templatedata:Ie,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:Ie},Ka={table:Xs,td:new Set([...ds,"scope"]),th:ds,br:Ks,caption:ae,div:ae,hr:Tt,h1:ae,h2:ae,h3:ae,h4:ae,h5:ae,h6:ae,li:Ue,p:ae,pre:Tt,tr:Ys,ul:Ue}}}),ci,ui,gi,pi,ms,Dl=C({"src/attribute.ts"(){"use strict";var e,t,s,n,a,Kr,i;X(),ce(),Qe(),Ya(),ue(),J(),V(),qe(),ci=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,ui=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,gi=new Set(["ext","arg","magic-word","template"]),pi=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),ms=(i=class extends z{constructor(l,d,h,c="",x,g=[],u=W.getConfig(),y=[]){const k=new ve(h,"attr-key",u,y);let $;if(h==="title"||d==="img"&&h==="alt")$=new z(x,u,y,{}),$.type="attr-value",$.setAttribute("stage",we-1);else if(d==="gallery"&&h==="caption"||d==="choose"&&(h==="before"||h==="after")){const T={...u,excludes:[...u.excludes,"heading","html","table","hr","list"]};$=new z(x,T,y,{}),$.type="attr-value",$.setAttribute("stage",1)}else $=new ve(x,"attr-value",u,y,{});super(void 0,u,y);q(this,a);q(this,e);q(this,t);q(this,s);q(this,n);j(this,e,l),this.append(k,$),j(this,s,c),j(this,n,[...g]),j(this,t,d),this.setAttribute("name",ut(_e(h)))}get type(){return f(this,e)}get tag(){return f(this,t)}get balanced(){return!f(this,s)||f(this,n)[0]===f(this,n)[1]}afterBuild(){f(this,s).includes("\0")&&j(this,s,this.buildFromStr(f(this,s),0)),this.parentNode&&j(this,t,this.parentNode.name),this.setAttribute("name",ut(this.firstChild.text())),super.afterBuild()}toString(l){const[d="",h=""]=f(this,n);return f(this,s)?super.toString(l,f(this,s)+d)+h:this.firstChild.toString(l)}text(){return f(this,s)?`${super.text(`${f(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var l,d;return f(this,s)?f(this,s).length+((d=(l=f(this,n)[0])==null?void 0:l.length)!=null?d:0):0}lint(l=this.getAbsoluteIndex(),d){var T;const h=super.lint(l,d),{balanced:c,firstChild:x,lastChild:g,name:u,tag:y}=this,k=new he(this,l);if(!c){const m=Q(g,k,"unclosed-quote",W.msg("unclosed $1","quotes"),"warning");m.startIndex--,m.startCol--,m.suggestions=[{desc:"close",range:[m.endIndex,m.endIndex],text:f(this,n)[0]}],h.push(m)}const $=P(this,a,Kr).call(this,l,k);return $&&h.push($),(T=Ka[y])!=null&&T.has(u)&&h.push(Q(x,k,"obsolete-attr","obsolete attribute","warning")),h}getValue(){return f(this,s)?this.lastChild.text().trim():this.type==="ext-attr"||""}getAttribute(l){return l==="invalid"?P(this,a,Kr).call(this):super.getAttribute(l)}print(){const[l="",d=""]=f(this,n);return f(this,s)?super.print({sep:Yt(f(this,s))+l,post:d}):super.print()}json(l,d=this.getAbsoluteIndex()){const h=super.json(void 0,d);return h.tag=this.tag,h}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n=new WeakMap,a=new WeakSet,Kr=function(l,d){const{firstChild:h,lastChild:c,type:x,name:g,tag:u,parentNode:y}=this,k=!c.childNodes.some(({type:b})=>gi.has(b)),$=this.getValue(),T=wn[u],m=bn[u],{length:p}=this.toString();if(!(T!=null&&T.has(g))&&!(m!=null&&m.has(g))&&(x==="ext-attr"?T||m:!/\{\{[^{]+\}\}/u.test(g))&&(x==="ext-attr"&&!m||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(g)&&(u==="meta"||u==="link"||!vn.has(g)))||(g==="itemtype"||g==="itemid"||g==="itemref")&&!(y!=null&&y.hasAttr("itemscope"))){if(l===void 0)return!0;const b=Q(h,d,"illegal-attr","illegal attribute name");return b.suggestions=[{desc:"remove",range:[l,l+p],text:""}],b}else{if(g==="style"&&typeof $=="string"&&ci.test($))return l===void 0?!0:Q(c,d,"insecure-style","insecure style");if(g==="tabindex"&&typeof $=="string"&&$!=="0"){if(l===void 0)return!0;const b=Q(c,d,"illegal-attr","nonzero tabindex");return b.suggestions=[{desc:"remove",range:[l,l+p],text:""},{desc:"0 tabindex",range:[b.startIndex,b.endIndex],text:"0"}],b}else if(k&&x!=="ext-attr"){const b=pn(u,g),w=String($).toLowerCase();if(b.length>0&&b.every(v=>v!==w))return l===void 0?!0:Q(c,d,"illegal-attr","illegal attribute value","warning")}else if(typeof $=="string"&&((/^xmlns:[\w:.-]+$/u.test(g)||pi.has(g))&&ui.test($)||k&&(g==="href"||g==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test($)))return l===void 0?!0:Q(c,d,"illegal-attr","illegal attribute value")}return!1},i)}}),er,fi,tr,Is,yn=C({"src/attributes.ts"(){"use strict";var e,t,vs,n;X(),ce(),ue(),J(),V(),qe(),Dl(),er=a=>a.slice(0,-1),fi=a=>`${er(a)}-dirty`;try{tr=new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch{tr=/[^\W_]/u}Is=(n=class extends z{constructor(r,i,o,l,d=[]){super(void 0,l,d,{});q(this,t);q(this,e);if(j(this,e,i),this.setAttribute("name",o),r){const h=/([^\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="",x=h.exec(r),g=0;const u=()=>{c&&(super.insertAt(new ve(c,fi(i),l,d,{})),c="")};for(;x;){const{index:y,0:k,1:$,2:T,3:m,4:p,5:b,6:w}=x;if(c+=r.slice(g,y),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(_e($).trim())){const v=p!=null?p:w,A=[m,b],S=new ms(er(i),o,$,T,v,A,l,d);u(),super.insertAt(S)}else c+=k;({lastIndex:g}=h),x=h.exec(r)}c+=r.slice(g),u()}}get type(){return f(this,e)}afterBuild(){const{parentNode:r}=this;r!=null&&r.is("td")&&this.setAttribute("name",r.subtype),super.afterBuild()}getAttrTokens(r){return this.childNodes.filter(i=>i instanceof ms&&(!r||i.name===ut(r)))}hasAttr(r){return this.getAttrTokens(r).length>0}getAttrToken(r){const i=this.getAttrTokens(r);return i[i.length-1]}getAttr(r){var i;return(i=this.getAttrToken(r))==null?void 0:i.getValue()}lint(r=this.getAbsoluteIndex(),i){const o=super.lint(r,i),{parentNode:l,childNodes:d}=this,h=new Map,c=new Set,x=new he(this,r);if(P(this,t,vs).call(this)){const g=Z(this,x,"no-ignored","attributes of a closing tag"),u=l.getAbsoluteIndex();g.suggestions=[{desc:"remove",range:[r,g.endIndex],text:""},{desc:"open",range:[u+1,u+2],text:""}],o.push(g)}for(const g of d)if(g instanceof ms){const{name:u}=g;h.has(u)?(c.add(u),h.get(u).push(g)):h.set(u,[g])}else{const u=g.text().trim();if(u){const y=Q(g,x,"no-ignored","containing invalid attribute",tr.test(u)?"error":"warning");y.suggestions=[{desc:"remove",range:[y.startIndex,y.endIndex],text:" "}],o.push(y)}}if(c.size>0)for(const g of c){const u=h.get(g).map(y=>{const k=y.getValue();return[y,k===!0?"":k]});o.push(...u.map(([y,k],$)=>{const T=Q(y,x,"no-duplicate",W.msg("duplicated $1 attribute",g)),m={desc:"remove",range:[T.startIndex,T.endIndex],text:""};return!k||u.slice(0,$).some(([,p])=>p===k)?T.fix=m:T.suggestions=[m],T}))}return o}getAttribute(r){return r==="invalid"?P(this,t,vs).call(this):super.getAttribute(r)}print(){return this.toString()?`<span class="wpb-${this.type}${P(this,t,vs).call(this)?" wpb-invalid":""}">${this.childNodes.map(r=>r.print(r instanceof ve?{class:r.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,vs=function(){const{parentNode:r}=this;return(r==null?void 0:r.type)==="html"&&r.closing&&this.text().trim()!==""},n)}}),Za={};ie(Za,{PreToken:()=>eo});var eo,Vl=C({"src/pre.ts"(){"use strict";Qe(),V(),We(),eo=class extends z{get type(){return"ext-inner"}constructor(e,t,s=[]){if(e){const n=/<nowiki>/giu,a=/<\/nowiki>/giu,{length:r}=n.source;let i=n.exec(e);i&&(a.lastIndex=i.index+r);let o=a.exec(e),l=0,d="";for(;i&&o;)new pe(i[0],t,s),new pe(o[0],t,s),d+=`${e.slice(l,i.index)}\0${s.length-1}n${e.slice(i.index+r,o.index)}\0${s.length}n`,l=o.index+r+1,n.lastIndex=l,i=n.exec(e),i&&(a.lastIndex=i.index+r),o=a.exec(e);e=d+e.slice(l)}super(e,t,s,{}),this.setAttribute("stage",we-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),Cs,Sn=C({"mixin/multiLine.ts"(){"use strict";be(),Cs=e=>{class t extends e{toString(n){return super.toString(n,`
|
|
3
3
|
`)}text(){return super.text(`
|
|
4
4
|
`).replace(/\n\s*\n/gu,`
|
|
5
5
|
`)}getGaps(){return 1}print(){return super.print({sep:`
|
|
6
|
-
`})}}return
|
|
7
|
-
`).map(o=>i?o:Et(o,t,r,n)).map(o=>new s(o,"param-line",t,r,{})))}r.splice(r.indexOf(this),1),r.push(this)}lint(n=this.getAbsoluteIndex()){let e=new B(this,n),t=$.msg("invalid parameter of <$1>",this.name),r=[];for(let i of this.childNodes){i.setAttribute("aIndex",n);let s=i.childNodes.filter(({type:o})=>o!=="comment"&&o!=="include"&&o!=="noinclude");if(s.some(({type:o})=>o==="ext"))r.push(L(i,e,"no-ignored",t));else{let o=s.findIndex(({type:g})=>g!=="text"),l=s.slice(0,o===-1?void 0:o).map(String).join("");if(l&&!(o===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(l)){let g=L(i,e,"no-ignored",t);g.suggestions=[{desc:"remove",range:[g.startIndex,g.endIndex],text:""}],r.push(g)}else{let g=i.lint(n,!1);g.length>0&&r.push(...g)}}n+=i.toString().length+1}return r}};Si=q(nd),ct=_(Si,0,"ParamTagToken",ko,ct),O(Si,1,ct)});var en,pr,Mn,cr,$i=w(()=>{"use strict";G();he();de();K();D();Ct();cr=class extends S{constructor(e,t,r,i=[]){super(void 0,r,i);T(this,pr);T(this,en);y(this,en,e);let s=new S(t[0],r,i);s.type="heading-title",s.setAttribute("stage",2);let o=new be(t[1],"heading-trail",r,i);this.append(s,o)}get type(){return"heading"}get level(){return c(this,en)}toString(e){let t=v(this,pr,Mn).call(this);return t+this.firstChild.toString(e)+t+this.lastChild.toString(e)}text(){let e=v(this,pr,Mn).call(this);return e+this.firstChild.text()+e}getAttribute(e){return e==="invalid"?this.inHtmlAttrs()==="error":e==="padding"?this.level:super.getAttribute(e)}getGaps(){return this.level}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{firstChild:i,level:s}=this,o=i.toString(),l=o.startsWith("="),g=l||o.endsWith("="),p=i.childNodes.filter(hr("quote")),d=p.filter(({bold:f})=>f),u=p.filter(({italic:f})=>f),h=new B(this,e),m=this.inHtmlAttrs();if(this.level===1){let f=L(i,h,"h1","<h1>");g||(f.suggestions=[{desc:"h2",range:[f.startIndex,f.endIndex],text:`=${o}=`}]),r.push(f)}if(g){let f=L(i,h,"unbalanced-header",$.msg("unbalanced $1 in a section header",'"="'));if(o!=="=")if(l){let[b]=/^=+/u.exec(o),k=s+b.length;f.suggestions=[{desc:`h${s}`,range:[f.startIndex,f.startIndex+b.length],text:""}],k<7&&f.suggestions.push({desc:`h${k}`,range:[f.endIndex,f.endIndex],text:b})}else{let b=/[^=](=+)$/u.exec(o)[1],k=s+b.length;f.suggestions=[{desc:`h${s}`,range:[f.endIndex-b.length,f.endIndex],text:""}],k<7&&f.suggestions.push({desc:`h${k}`,range:[f.startIndex,f.startIndex],text:b})}r.push(f)}m&&r.push(R(this,h,"parsing-order","section header in HTML tag attributes",m));let x=this.getRootNode().toString();if(d.length%2){let f=L(d[d.length-1],{...h,start:e+s,left:h.left+s},"format-leakage",$.msg("unbalanced $1 in a section header","bold apostrophes")),b=e+s+o.length;x.slice(f.endIndex,b).trim()?f.suggestions=[{desc:"close",range:[b,b],text:"'''"}]:f.fix={desc:"remove",range:[f.startIndex,f.endIndex],text:""},r.push(f)}if(u.length%2){let f=L(u[u.length-1],{start:e+s},"format-leakage",$.msg("unbalanced $1 in a section header","italic apostrophes")),b=e+s+o.length;x.slice(f.endIndex,b).trim()?f.suggestions=[{desc:"close",range:[b,b],text:"''"}]:f.fix={desc:"remove",range:[f.startIndex,f.endIndex],text:""},r.push(f)}return r}print(){let e=v(this,pr,Mn).call(this);return super.print({pre:e,sep:e})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return r.level=this.level,r}};en=new WeakMap,pr=new WeakSet,Mn=function(){return"=".repeat(this.level)}});var id,Hn,Ao=w(()=>{"use strict";se();G();D();id=new RegExp(`https?://${We}${Ue}$`,"iu"),Hn=class extends S{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){var n;try{return!!((n=this.parentNode)!=null&&n.getDuplicatedArgs().some(([e])=>e===this.name))}catch{return!1}}constructor(n,e,t,r=[]){super(void 0,t,r);let i=new S(typeof n=="number"?void 0:n,t,r,{}),s=new S(e,t,r);i.type="parameter-key",i.setAttribute("stage",2),s.type="parameter-value",s.setAttribute("stage",2),this.append(i,s)}trimName(n,e=!0){let t=(typeof n=="string"?n:n.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",t),t}afterBuild(){if(!this.anon){let{parentNode:n,firstChild:e}=this,t=this.trimName(e);n&&n.getArgs(t,!1,!1).add(this)}super.afterBuild()}toString(n){return this.anon?this.lastChild.toString(n):super.toString(n,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(n=this.getAbsoluteIndex(),e){var s;let t=super.lint(n,e),{firstChild:r}=this,i=(s=id.exec(r.text()))==null?void 0:s[0];if(i&&new URL(i).search){let o=L(r,{start:n},"unescaped","unescaped query string in an anonymous parameter");o.startIndex=o.endIndex,o.startLine=o.endLine,o.startCol=o.endCol,o.endIndex++,o.endCol++,o.fix={desc:"escape",range:[o.startIndex,o.endIndex],text:"{{=}}"},t.push(o)}return t}print(){return super.print({sep:this.anon?"":"="})}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e);return Object.assign(t,{anon:this.anon},this.duplicated&&{duplicated:!0}),t}}});var wo,rn,mt,Ft,Pt,mr,Ke,tn,So,Ni,sd,ht,Co=w(()=>{"use strict";se();G();he();de();Xr();D();Ao();Qe();Ct();wo=[gt()];ht=class extends(sd=S){constructor(e,t,r,i=[]){var k,C;let s,o=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(e);o&&(s=Number(o[1]),e=e.replace(`\0${s}h`,i[s].toString().replace(/^\n/u,"")));super(void 0,r,i,{});T(this,Ke);le(this,"modifier","");T(this,rn,"template");T(this,mt,":");T(this,Ft,!1);T(this,Pt,new Map);T(this,mr);let{parserFunction:[l,g],variable:p,functionHook:d}=r,u=(k=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(e))==null?void 0:k[0];if(u)this.setAttribute("modifier",u),e=e.slice(u.length);else if(e.includes(":")){let[A,...I]=e.split(":"),[P]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((C=I[0])!=null?C:"");this.setModifier(`${A}:${P}`)&&(e=I.join(":").slice(P.length))}let h=e.search(/[::]/u),m=e[h]===":",x=h!==-1;if(x||t.length===0&&!c(this,Ft)){let A=x?e.slice(0,h):e,I=x&&e.slice(h+1),P=ge(A),z=x?P.slice(P.search(/\S/u))+(m?":":""):P.trim(),X=z.toLowerCase(),re=Array.isArray(g),W=re?g.includes(z):Object.prototype.hasOwnProperty.call(g,z),V=!re&&W?g[z]:Object.prototype.hasOwnProperty.call(l,X)&&l[X],N=re&&W||!("functionHook"in r)||d.includes(V),j=re&&W||p.includes(V);if(x?V&&N:j){this.setAttribute("name",V||X.replace(/^#|:$/u,"")),y(this,rn,"magic-word"),m&&y(this,mt,":");let M=new be(A,"magic-word-name",r,i);if(super.insertAt(M),I!==!1&&t.unshift([I]),this.name==="invoke")for(let E=0;E<2;E++){let F=t.shift();if(!F)break;let ce=new te(F.join("="),`invoke-${E?"function":"module"}`,r,i);super.insertAt(ce)}}}if(this.type==="template"){let A=ge(e).trim();if(!this.normalizeTitle(A,10,{halfParsed:!0,temporary:!0}).valid)throw i.pop(),new SyntaxError("Invalid template name");let I=new te(e,"template-name",r,i,{});super.insertAt(I)}typeof s=="number"&&(i[s]=void 0);let f=this.isTemplate(),b=1;for(let A=0;A<t.length;A++){let I=t[A];f||this.name==="switch"&&A>0||this.name==="tag"&&A>1||(I[0]=I.join("="),I.length=1),I.length===1&&(I.unshift(b),b++),this.insertAt(new Hn(...I,r,i))}this.seal("modifier")}get type(){return c(this,rn)}get module(){return this.type==="magic-word"&&this.name==="invoke"?v(this,Ke,tn).call(this).title:void 0}get function(){var e;return this.type==="magic-word"&&this.name==="invoke"?(e=this.childNodes[2])==null?void 0:e.text().trim():void 0}setModifier(e){let{parserFunction:[,,t,r]}=this.getAttribute("config"),i=ge(e).trim();if(e&&!i.endsWith(":"))return!1;let s=i.slice(0,-1).toLowerCase(),o=t.includes(s),l=r.includes(s);return c(this,Ft)&&o||!c(this,Ft)&&(l||!e)||(oe.running||this.length>1)&&(o||l||!e)?(this.setAttribute("modifier",e),y(this,Ft,o),!!e):!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"&&(y(this,mr,v(this,Ke,tn).call(this)),this.setAttribute("name",c(this,mr).title))}toString(e){return`{{${this.modifier}${this.type==="magic-word"?this.firstChild.toString(e)+(this.length===1?"":c(this,mt))+this.childNodes.slice(1).map(t=>t.toString(e)).join("|"):super.toString(e,"|")}}}`}text(){let{childNodes:e,length:t,firstChild:r,modifier:i,type:s,name:o}=this;return s==="magic-word"&&o==="vardefine"?"":`{{${i}${s==="magic-word"?r.text()+(t===1?"":c(this,mt))+$e(e.slice(1),"|"):super.text("|")}}}`}getAttribute(e){switch(e){case"padding":return this.modifier.length+2;case"title":return c(this,mr);case"colon":return c(this,mt);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!v(this,Ke,tn).call(this).valid);default:return super.getAttribute(e)}}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t);if(!this.isTemplate())return r;let{type:i,childNodes:s,length:o}=this,l=new B(this,e),g=i==="magic-word";if(g&&!v(this,Ke,tn).call(this).valid)r.push(L(s[1],l,"invalid-invoke","illegal module name"));else{let d=s[g?1:0],u=d.childNodes.findIndex(m=>m.type==="text"&&At(m.data).includes("#")),h=d.childNodes[u];if(h){let m=L(d,l,"no-ignored","useless fragment","warning");m.fix={desc:"remove",range:[m.startIndex+d.getRelativeIndex(u)+h.data.indexOf("#"),m.endIndex],text:""},r.push(m)}}if(g&&o===2)return r.push(R(this,l,"invalid-invoke","missing module function")),r;let p=this.getDuplicatedArgs().filter(([,d])=>!d[0].querySelector("ext"));if(p.length>0)for(let[,d]of p)r.push(...d.map(u=>{let h=L(u,l,"no-duplicate","duplicated parameter");return h.suggestions=[{desc:"remove",range:[h.startIndex-1,h.endIndex],text:""}],h}));return r}insertAt(e,t=this.length){return super.insertAt(e,t),e.anon?v(this,Ke,So).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getAllArgs(){return this.childNodes.filter(hr("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:e})=>e)}getArgs(e,t,r=!0){let i=String(e).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),s;return c(this,Pt).has(i)?s=c(this,Pt).get(i):(s=new Set(this.getAllArgs().filter(({name:o})=>i===o)),c(this,Pt).set(i,s)),s}getDuplicatedArgs(){return[...c(this,Pt)].filter(([,{size:e}])=>e>1).map(([e,t])=>[e,[...t]])}getPossibleValues(){let{type:e,name:t,childNodes:r}=this;if(e==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let i,s;switch(t){case"if":case"ifexist":case"ifexpr":case"iferror":i=2;break;case"ifeq":i=3;break;case"switch":{let o=r.slice(2),l=o[o.length-1];s=[...o.filter(({anon:g})=>!g),...l!=null&&l.anon?[l]:[]].map(({lastChild:g})=>g);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}s!=null||(s=r.slice(i,i+2).map(({lastChild:o})=>o));for(let o=0;o<s.length;){let{length:l,0:g}=s[o].childNodes.filter(p=>p.text().trim());if(l===0)s.splice(o,1);else if(l>1||g.type!=="magic-word")o++;else try{let p=g.getPossibleValues();s.splice(o,1,...p),o+=p.length}catch{o++}}return s}print(){let{childNodes:e,length:t,firstChild:r,modifier:i,type:s}=this;return`<span class="wpb-${s}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${s==="magic-word"?wt(i)+r.print()+(t===1?"":c(this,mt))+Ge(e.slice(1),{sep:"|"}):(i?`<span class="wpb-magic-word">${wt(i)}</span>`:"")+Ge(e,{sep:"|"})}}}</span>`}};Ni=q(sd),rn=new WeakMap,mt=new WeakMap,Ft=new WeakMap,Pt=new WeakMap,mr=new WeakMap,Ke=new WeakSet,tn=function(){let e=this.type==="template";return this.normalizeTitle(this.childNodes[e?0:1].text(),e?10:828,{temporary:!0})},So=function(e){let t=this.getAnonArgs(),r=typeof e!="number";for(let i=r?t.indexOf(e):e-1;i<t.length;i++){let s=t[i],{name:o}=s,l=String(i+1);(o!==l||s===e)&&(s.setAttribute("name",l),this.getArgs(l,!1,!1).add(s))}},ht=_(Ni,0,"TranscludeToken",wo,ht),O(Ni,1,ht)});var $o,Ii,od,Rt,No=w(()=>{"use strict";St();D();$o=[Ne()];Rt=class extends(od=S){get type(){return"hidden"}getAttribute(n){return n==="invalid"||super.getAttribute(n)}};Ii=q(od),Rt=_(Ii,0,"HiddenToken",$o,Rt),O(Ii,1,Rt)});var Io,Wn,Lo,Li,ad,jt,Eo=w(()=>{"use strict";se();G();de();Ve();Xr();D();Qe();No();Io=[me("{{{"),gt()];jt=class extends(ad=S){constructor(e,t,r=[]){super(void 0,t,r,{});T(this,Wn);for(let i=0;i<e.length;i++){let s=e[i];if(i===0){let o=new te(s,"arg-name",t,r,{});super.insertAt(o)}else if(i>1){let o=new Rt(s,t,r);super.insertAt(o)}else{let o=new S(s,t,r);o.type="arg-default",o.setAttribute("stage",2),super.insertAt(o)}}}get type(){return"arg"}get default(){var e,t;return(t=(e=this.childNodes[1])==null?void 0:e.text())!=null?t:!1}toString(e){return`{{{${super.toString(e,"|")}}}}`}text(){return`{{{${$e(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){v(this,Wn,Lo).call(this),super.afterBuild()}lint(e=this.getAbsoluteIndex(),t){let{childNodes:[r,i,...s]}=this;r.setAttribute("aIndex",e+3);let o=r.lint(e+3,t);if(i){let l=e+4+r.toString().length;i.setAttribute("aIndex",l);let g=i.lint(l,t);g.length>0&&o.push(...g)}if(s.length>0){let l=new B(this,e);o.push(...s.map(g=>{let p=L(g,l,"no-ignored","invisible content inside triple braces");return p.startIndex--,p.startCol--,p.suggestions=[{desc:"remove",range:[p.startIndex,p.endIndex],text:""},{desc:"escape",range:[p.startIndex,p.startIndex+1],text:"{{!}}"}],p}))}if(!this.getAttribute("include")){let l=R(this,{start:e},"no-arg","unexpected template argument","warning");i&&(l.suggestions=[{desc:"expand",range:[e,l.endIndex],text:i.text()}]),o.push(l)}return o}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return r.default=this.default,r}};Li=q(ad),Wn=new WeakSet,Lo=function(){this.setAttribute("name",this.firstChild.text().trim())},jt=_(Li,0,"ArgToken",Io,jt),O(Li,1,jt)});var Oo={};ne(Oo,{parseBraces:()=>nn});var ld,Fo,Ei,Po,Ro,jo,qo,Bo,nn,Un=w(()=>{"use strict";kt();se();$i();Co();Eo();ld={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},Fo=String.raw`\[(?!\[)`,Ei=String.raw`\n(?![=\0])`,Po=String.raw`|\{{2,}`,Ro=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),jo=Ce(a=>new RegExp(a,"gmu"));qo=new RegExp(String.raw`\{\{((?:[^\n{}[]|${Fo}|${Ei})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${Ei})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${Fo}|${Ei})*\}-`,"gu");Bo=a=>{let n=ze(ge(a));return Ro.has(n)?Ro.get(n):/^(?:filepath|(?:full|canonical)urle?):./u.test(n)?"m":/^#vardefine:./u.test(n)?"n":"t"},nn=(a,n,e)=>{var m,x,f,b,k;let t=String.raw`${n.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,r]}=n,i=[],s=[],o=(C,A,I,P)=>{A[A.length-1].push(Be(C.slice(I,P),s))},l;do l!==void 0&&(a=l),l=a.replace(qo,(C,A,I)=>{if(A!==void 0||typeof I=="string")try{let{length:P}=e,z=(A!=null?A:I).split("|");return new ht(Be(z[0],s),z.slice(1).map(X=>{let re=X.indexOf("=");return(re===-1?[X]:[X.slice(0,re),X.slice(re+1)]).map(W=>Be(W,s))}),n,e),`\0${P}${Bo(z[0])}`}catch(P){if(!(P instanceof SyntaxError)||P.message!=="Invalid template name")throw P}return s.push(Be(C,s)),`\0${s.length-1}`});while(l!==a);a=l;let g=a.lastIndexOf("}}")-a.length,p=g+a.length!==-1,d=jo(t+(p?Po:"")),u=d.exec(a),h;for(;u||h!==void 0&&h<=a.length&&((x=(m=i[i.length-1])==null?void 0:m[0])!=null&&x.startsWith("="));){if(u!=null&&u[1]){let[,{length:j}]=u;u[0]=u[0].slice(j),u.index+=j}let{0:C,index:A}=u!=null?u:{0:`
|
|
8
|
-
`,index:
|
|
9
|
-
`){
|
|
10
|
-
`)||(
|
|
11
|
-
)`:""}(\s*)$`,"u")),
|
|
12
|
-
`))!=null?
|
|
13
|
-
`),i=new Set(e.protocol.split("|")),s=J,o=!0,l=!1;for(let g of r){let p=g.trim();if(!(l||!p||p.startsWith("#"))){if(o){let d=g.indexOf("|"),u=d===-1?g:g.slice(0,d),{valid:h,ns:m}=this.normalizeTitle(u,0,{halfParsed:!0,temporary:!0});if(h&&m===6){let x=new Ye("imagemap",u,d===-1?void 0:g.slice(d+1),e,t);super.insertAt(x),o=!1;continue}else l=!0}else if(g.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(g);continue}else if(g.includes("[")){let d=g.indexOf("["),u=g.slice(d),h=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(u);if(h){if(this.normalizeTitle(h[1],0,{halfParsed:!0,temporary:!0,selfLink:!0}).valid){super.insertAt(new dn(g.slice(0,d),h.slice(1),u.slice(u.indexOf("]]")+2),e,t));continue}}else if(u.startsWith("[//")||i.has(u.slice(1,u.indexOf(":")+1))||i.has(u.slice(1,u.indexOf("//")+2))){let m=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(u);if(m){super.insertAt(new dn(g.slice(0,d),m.slice(1),u.slice(u.indexOf("]")+1),e,t));continue}}}}super.insertAt(new s(g,e,t))}}lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e),r=new B(this,n);return this.image?t.push(...this.childNodes.filter(i=>{let s=i.toString().trim();return i.is("noinclude")&&s&&!s.startsWith("#")}).map(i=>{let s=L(i,r,"invalid-imagemap","invalid link in <imagemap>");return s.suggestions=[{desc:"remove",range:[s.startIndex-1,s.endIndex],text:""},{desc:"comment",range:[s.startIndex,s.startIndex],text:"# "}],s})):t.push(R(this,r,"invalid-imagemap","<imagemap> without an image")),t}getAttribute(n){return n==="invalid"?!this.image:super.getAttribute(n)}};zi=q(wd),yr=_(zi,0,"ImagemapToken",ta,yr),O(zi,1,yr)});var ia,Gi,Sd,rt,Vi=w(()=>{"use strict";G();St();Ve();K();lt();ia=[Ne(!1),me("<!--")];rt=class extends(Sd=fe){constructor(e,t,r,i){super(e,r,i);le(this,"closed");this.closed=t}get type(){return"comment"}lint(e=this.getAbsoluteIndex()){if(this.closed)return[];let t=R(this,{start:e},"unclosed-comment",$.msg("unclosed $1","HTML comment"));return t.suggestions=[{desc:"close",range:[t.endIndex,t.endIndex],text:"-->"}],[t]}toString(e){return e?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}};Gi=q(Sd),rt=_(Gi,0,"CommentToken",ia,rt),O(Gi,1,rt)});var sa={};ne(sa,{CommentedToken:()=>Qi});var Qi,oa=w(()=>{"use strict";D();Vi();Qi=class extends S{get type(){return"ext-inner"}constructor(n,e,t=[]){if(super(void 0,e,t,{AstText:":",CommentToken:":"}),n){let r=n.indexOf("<!--"),i=r!==-1&&n.indexOf("-->",r+4),s=0;for(;i!==!1&&i!==-1;)r>s&&this.insertAt(n.slice(s,r)),this.insertAt(new rt(n.slice(r+4,i),!0,e,t)),s=i+3,r=n.indexOf("<!--",s),i=r!==-1&&n.indexOf("-->",r+4);s<n.length&&this.insertAt(n.slice(s))}}lint(n=this.getAbsoluteIndex()){return super.lint(n,/<\s*(?:\/\s*)?(hiero)\b/giu)}}});var aa={};ne(aa,{NowikiToken:()=>Xi});var Cd,$d,gn,Ki,Xi,la=w(()=>{"use strict";kt();G();K();lt();Cd=Ce(a=>new RegExp(String.raw`<\s*(?:/\s*)${a==="nowiki"?"":"?"}(${a})\b`,"giu")),$d=new Set(["templatestyles","section","languages"]),Xi=class extends fe{constructor(){super(...arguments);T(this,gn)}get type(){return"ext-inner"}lint(e=this.getAbsoluteIndex()){let{name:t}=this;if(v(this,gn,Ki).call(this)){let r=R(this,{start:e},"void-ext",$.msg("nothing should be in <$1>",t));return r.fix={desc:"empty",range:[e,r.endIndex],text:""},[r]}return super.lint(e,Cd(t))}getAttribute(e){return e==="invalid"?v(this,gn,Ki).call(this):super.getAttribute(e)}};gn=new WeakSet,Ki=function(){let{name:e,firstChild:{data:t}}=this;return $d.has(e)&&!!t}});var da,Ji,Nd,Je,Ri=w(()=>{"use strict";G();de();K();Pn();D();Ln();_n();da=[or()];Je=class extends(Nd=je){get type(){return"ext"}constructor(n,e,t,r,i=$.getConfig(),s=!1,o=[]){let l=n.toLowerCase(),g=new pt(!e||/^\s/u.test(e)?e:` ${e}`,"ext-attrs",l,i,o),p={...i,ext:i.ext.filter(u=>u!==l),excludes:[...i.excludes]},d;switch(p.inExt=!0,l){case"tab":p.ext=p.ext.filter(u=>u!=="tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":l==="poem"&&p.excludes.push("heading"),d=new S(t,p,o);break;case"pre":{let{PreToken:u}=(yo(),Q(To));d=new u(t,p,o);break}case"dynamicpagelist":{let{ParamTagToken:u}=(Ci(),Q(vo));d=new u(s,t,p,o);break}case"inputbox":{let{InputboxToken:u}=(Do(),Q(_o));d=new u(s,t,p,o);break}case"references":{let{NestedToken:u}=(Gn(),Q(zn));p.excludes.push("heading"),d=new u(t,s,["ref"],p,o);break}case"choose":{let{NestedToken:u}=(Gn(),Q(zn));d=new u(t,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],p,o);break}case"combobox":{let{NestedToken:u}=(Gn(),Q(zn));d=new u(t,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],p,o);break}case"gallery":{let{GalleryToken:u}=(Yo(),Q(Jo));d=new u(t,p,o);break}case"imagemap":{let{ImagemapToken:u}=(na(),Q(ra));d=new u(t,p,o);break}case"hiero":{let{CommentedToken:u}=(oa(),Q(sa));d=new u(t,p,o);break}default:{let{NowikiToken:u}=(la(),Q(aa));d=new u(t,p,o)}}d.setAttribute("name",l),d.type==="plain"&&(d.type="ext-inner"),super(n,g,d,r,i,o),this.seal("closed",!0)}lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e),r=new B(this,n);if(this.name!=="nowiki"){let i=this.inHtmlAttrs();i&&t.push(R(this,r,"parsing-order","extension tag in HTML tag attributes",i))}return this.name==="ref"&&this.closest("heading-title")&&t.push(R(this,r,"var-anchor","variable anchor in a section header")),t}};Ji=q(Nd),Je=_(Ji,0,"ExtToken",da,Je),O(Ji,1,Je)});var pa={};ne(pa,{parseCommentAndExt:()=>Et});var ua,Id,Yi,Ld,ga,Et,Zr=w(()=>{"use strict";kt();se();to();Xe();io();oo();Ri();Vi();ua="<onlyinclude>",Id="</onlyinclude>",{length:Yi}=ua,Ld=[!1,!0].map(a=>{let n=a?"includeonly":"(?:no|only)include",e=a?"noinclude":"includeonly";return Ce(t=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${n}(?:\s[^>]*)?/?>|</${n}\s*>|<(${t.join("|")})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(\1\s*)>)|<(${e})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${e}\s*)>|$))`,"giu"))}),ga=a=>{let n=a.indexOf(ua);return{i:n,j:a.indexOf(Id,n+Yi)}},Et=(a,n,e,t)=>{if(t){let{i:o,j:l}=ga(a);if(o!==-1&&l!==-1){let g="",p=d=>{new J(d,n,e),g+=`\0${e.length-1}n`};for(;o!==-1&&l!==-1;){let d=`\0${e.length}e`;new It(a.slice(o+Yi,l),n,e),o>0&&p(a.slice(0,o)),g+=d,a=a.slice(l+Yi+1),{i:o,j:l}=ga(a)}return a&&p(a),g}}let{ext:r}=n,i=r.filter(o=>o!=="translate"&&o!=="tvar"),s={...n,ext:i};if(r.includes("translate")){let o=[];a=a.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,l=>(o.push(l),`\0${o.length-1}`)).replace(/<translate( nowrap)?>([\s\S]+?)?<\/translate>/gu,(l,g,p)=>{let d=e.length;return new En(g,p&&Be(p,o),s,e),`\0${d}g`}),a=Be(a,o)}return a.replace(Ld[t?1:0](i),(o,l,g,p,d,u,h,m,x)=>{let f=e.length,b="n";if(l)b="e",new Je(l,g,p,d,s,u,e);else if(o.startsWith("<!--")){b="c";let k=o.endsWith("-->");new rt(o.slice(4,k?-3:void 0),k,n,e)}else u?new Lt(u,h,m,x,n,e):new J(o,n,e);return`\0${f}${b}`})}});var Ed,Fd,Pd,ca,kr,Me,ft,nt,Zi,Rd,qt,ha=w(()=>{"use strict";G();he();de();Pn();D();K();Ed=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),Fd=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"]),Pd=new Set(["strike","big","center","font","tt"]);ca=[or()];qt=class extends(Rd=S){constructor(e,t,r,i,s,o){super(void 0,s,o);T(this,kr);T(this,Me);T(this,ft);T(this,nt);this.insertAt(t),this.setAttribute("name",e.toLowerCase()),y(this,kr,r),y(this,Me,i),y(this,ft,e)}get type(){return"html"}get selfClosing(){return c(this,Me)}get closing(){return c(this,kr)}toString(e){return`<${this.closing?"/":""}${c(this,ft)}${super.toString(e)}${c(this,Me)?"/":""}>`}text(){let{closing:e}=this,t=c(this,ft)+(e?"":super.text());return`<${e?"/":""}${t}${c(this,Me)?"/":""}>`}getAttribute(e){return e==="invalid"?this.inTableAttrs()==="error":e==="padding"?c(this,ft).length+(this.closing?2:1):super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{name:i,parentNode:s,closing:o,selfClosing:l}=this,g=new B(this,e),p=this.inTableAttrs();if(i==="h1"&&!o){let f=R(this,g,"h1","<h1>");f.suggestions=[{desc:"h2",range:[e+2,e+3],text:"2"}],r.push(f)}if(p){let f=R(this,g,"parsing-order","HTML tag in table attributes",p);p==="error"&&(f.fix={desc:"remove",range:[e,f.endIndex],text:""}),r.push(f)}Pd.has(i)&&r.push(R(this,g,"obsolete-tag","obsolete HTML tag","warning")),(i==="b"||i==="strong")&&this.closest("heading-title")&&r.push(R(this,g,"bold-header","bold in section header","warning"));let{html:[,d,u]}=this.getAttribute("config"),h=u.includes(i),m=d.includes(i);if(o&&(l||h)||l&&(!h&&!m)){let f=R(this,g,"unmatched-tag",o?"tag that is both closing and self-closing":"invalid self-closing tag"),b={desc:"open",range:[e+1,e+2],text:""},k={desc:"no self-closing",range:[f.endIndex-2,f.endIndex-1],text:""};m?f.suggestions=[b,k]:o?f.fix=h?b:k:f.suggestions=[k,{desc:"close",range:[f.endIndex-2,f.endIndex],text:`></${i}>`}],r.push(f)}else if(!this.findMatchingTag()){let f=R(this,g,"unmatched-tag",o?"unmatched closing tag":"unclosed tag");if(o){let b=this.closest("magic-word");b&&Ed.has(b.name)?f.severity="warning":f.suggestions=[{desc:"remove",range:[e,f.endIndex],text:""}]}else{let b=s==null?void 0:s.childNodes;Fd.has(i)&&(b!=null&&b.slice(0,b.indexOf(this)).some(({type:k,name:C})=>k==="html"&&C===i))?f.suggestions=[{desc:"close",range:[e+1,e+1],text:"/"}]:this.closest("heading-title")||(f.severity="warning")}r.push(f)}return r}findMatchingTag(){return Pe(c(this,nt),()=>{let{name:e,parentNode:t,closing:r,selfClosing:i}=this,{html:[,s,o]}=this.getAttribute("config"),l=o.includes(e),g=s.includes(e);if(l||g&&i)return this;if(!t)return;let{childNodes:p}=t,d=p.indexOf(this),u=r?p.slice(0,d).reverse():p.slice(d+1),h=[this],{rev:m}=oe;for(let x of u)if(!(!x.is("html")||x.name!==e||g&&c(x,Me)))if(c(x,kr)===r)h.push(x);else{let f=h.pop();if(f===this)return x;$.viewOnly&&(y(f,nt,[m,x]),y(x,nt,[m,f]))}if($.viewOnly)for(let x of h)y(x,nt,[m,void 0])},e=>{y(this,nt,e),e[1]&&e[1]!==this&&y(e[1],nt,[oe.rev,this])})}print(){return super.print({pre:`<${this.closing?"/":""}${c(this,ft)}`,post:`${c(this,Me)?"/":""}>`})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return Object.assign(r,{closing:this.closing,selfClosing:c(this,Me)}),r}};Zi=q(Rd),kr=new WeakMap,Me=new WeakMap,ft=new WeakMap,nt=new WeakMap,qt=_(Zi,0,"HtmlToken",ca,qt),O(Zi,1,qt)});var ma={};ne(ma,{parseHtml:()=>Bd});var jd,Bd,fa=w(()=>{"use strict";_n();ha();jd=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,Bd=(a,n,e)=>{var s;let{html:t}=n;(s=n.htmlElements)!=null||(n.htmlElements=new Set([...t[0],...t[1],...t[2]]));let r=a.split("<"),i=r.shift();for(let o of r){let l=jd.exec(o),g=l==null?void 0:l[2],p=g==null?void 0:g.toLowerCase();if(!l||!n.htmlElements.has(p)){i+=`<${o}`;continue}let[,d,,u="",h,m]=l,{length:x}=e,f=new pt(u,"html-attrs",p,n,e),b=f.getAttr("itemprop");if(p==="meta"&&(b===void 0||f.getAttr("content")===void 0)||p==="link"&&(b===void 0||f.getAttr("href")===void 0)){i+=`<${o}`,e.length=x;continue}i+=`\0${e.length}x${m}`,new qt(g,f,d==="/",h==="/>",n,e)}return i}});var vr,es=w(()=>{"use strict";Pn();D();Ct();_n();vr=class extends or(1)(S){constructor(n,e,t,r,i,s=[],o){super(void 0,i,s,o),this.append(new be(e,"table-syntax",i,s),new pt(r,"table-attrs",t,i,s))}}});var Ie,un,pn,ts,Ar,rs=w(()=>{"use strict";G();de();D();es();Ar=class extends vr{constructor(e,t,r,i=[]){var g;let s=/\||\0\d+!\x7F/u.exec(t!=null?t:""),o=s?t.slice(0,s.index):"";/\[\[|-\{/u.test(o)&&(s=null,o="");super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",o,r,i);T(this,pn);T(this,Ie,"");T(this,un);s&&([An(this,Ie)._]=s);let l=new S(t==null?void 0:t.slice(((g=s==null?void 0:s.index)!=null?g:NaN)+c(this,Ie).length),r,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 v(this,pn,ts).call(this).subtype}afterBuild(){c(this,Ie).includes("\0")&&y(this,Ie,this.buildFromStr(c(this,Ie),0)),super.afterBuild()}toString(e){let{childNodes:[t,r,i]}=this;return t.toString(e)+r.toString(e)+c(this,Ie)+i.toString(e)}text(){let{childNodes:[e,t,r]}=this;return e.text()+t.text()+c(this,Ie)+r.text()}getGaps(e){return e===1?c(this,Ie).length:0}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),i=new B(this,e+this.getRelativeIndex(this.length-1));for(let s of this.lastChild.childNodes)if(s.type==="text"){let{data:o}=s;if(o.includes("|")){let l=o.includes("||"),g=L(s,i,"pipe-like",'additional "|" in a table cell',l?"error":"warning");if(l){let p={caption:"|+",td:"|",th:"!"}[this.subtype];g.fix={desc:"newline",range:[g.startIndex,g.endIndex],text:o.replace(/\|\|/gu,`
|
|
14
|
-
${
|
|
15
|
-
`)}getAttr(e){
|
|
16
|
-
|}`,
|
|
17
|
-
`)
|
|
18
|
-
${
|
|
19
|
-
${
|
|
20
|
-
${
|
|
21
|
-
${
|
|
22
|
-
${
|
|
23
|
-
${
|
|
24
|
-
${d}${b}`,z=X=>{let re=new Ar(P,k.slice(I,A==null?void 0:A.index),t,r);return X.insertAt(re),re};for(;A;)z(l),{lastIndex:I}=C,[P]=A,A=C.exec(k);i.push(l,z(l))}}return o.slice(1)}});var Yn,va=w(()=>{"use strict";lt();Yn=class extends fe{get type(){return"hr"}}});var Aa,as,Md,Ot,wa=w(()=>{"use strict";St();Ve();lt();Aa=[Ne(),me("__")];Ot=class extends(Md=fe){get type(){return"double-underscore"}constructor(n,e,t,r){var l,g;super(n,t,r);let i=n.toLowerCase(),{doubleUnderscore:[,,s,o]}=t;this.setAttribute("name",(g=e?(l=o==null?void 0:o[n])==null?void 0:l.toLowerCase():s==null?void 0:s[i])!=null?g:i)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}};as=q(Md),Ot=_(as,0,"DoubleUnderscoreToken",Aa,Ot),O(as,1,Ot)});var Sa={};ne(Sa,{parseHrAndDoubleUnderscore:()=>Hd});var Hd,Ca=w(()=>{"use strict";va();wa();$i();Hd=({firstChild:{data:a},type:n,name:e},t,r)=>{var l,g,p;let{doubleUnderscore:[i,s,o]}=t;return(l=t.insensitiveDoubleUnderscore)!=null||(t.insensitiveDoubleUnderscore=new Set(i)),(g=t.sensitiveDoubleUnderscore)!=null||(t.sensitiveDoubleUnderscore=new Set(s)),(p=t.regexHrAndDoubleUnderscore)!=null||(t.regexHrAndDoubleUnderscore=new RegExp(`__(${[...i,...s].join("|")})__`,"giu")),n!=="root"&&(n!=="ext-inner"||e!=="poem")&&(a=`\0${a}`),a=a.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(d,u,h)=>(new Yn(h,t,r),`${u}\0${r.length-1}r`)).replace(t.regexHrAndDoubleUnderscore,(d,u)=>{var f;let h=t.sensitiveDoubleUnderscore.has(u),m=u.toLowerCase(),x=t.insensitiveDoubleUnderscore.has(m);return h||x?(new Ot(u,h,t,r),`\0${r.length-1}${x&&((f=o==null?void 0:o[m])!=null?f:m)==="toc"?"u":"n"}`):d}).replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(d,u,h,m,x)=>{let f=`${u}\0${r.length}h`;return new cr(h.length,[m,x],t,r),f}),n==="root"||n==="ext-inner"&&e==="poem"?a:a.slice(1)}});var $r,Zn,$a=w(()=>{"use strict";G();de();K();lt();Zn=class extends fe{constructor(e,t,r,i){super(e,r,i);T(this,$r);y(this,$r,t)}get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}get closing(){return{...this.bold?{bold:c(this,$r).bold}:void 0,...this.italic?{italic:c(this,$r).italic}:void 0}}text(){let{parentNode:e,innerText:t}=this;return e!=null&&e.is("image-parameter")&&e.name!=="caption"?"":t}lint(e=this.getAbsoluteIndex()){let{previousSibling:t,nextSibling:r,bold:i,closing:s}=this,o=(t==null?void 0:t.type)==="text"?t.data:void 0,l=(r==null?void 0:r.type)==="text"?r.data:void 0,g=$.msg('lonely "$1"',"'"),p=[],d=new B(this,e),u=(h,m,x)=>[{desc:"escape",range:[h,m],text:"'".repeat(x)},{desc:"remove",range:[h,m],text:""}];if(o!=null&&o.endsWith("'")){let h=R(this,d,"lonely-apos",g,(s.bold||s.italic)&&(/[a-z\d]'$/iu.test(o)||l&&/^[a-z\d]/iu.test(l))?"warning":"error"),{startIndex:m,startLine:x,startCol:f}=h,[,{length:b}]=/(?:^|[^'])('+)$/u.exec(o),k=e-b;p.push({...h,startIndex:k,endIndex:m,endLine:x,startCol:f-b,endCol:f,suggestions:u(k,m,b)})}if(l!=null&&l.startsWith("'")){let h=R(this,d,"lonely-apos",g),{endIndex:m,endLine:x,endCol:f}=h,[{length:b}]=/^'+/u.exec(l),k=m+b;p.push({...h,startIndex:m,endIndex:k,startLine:x,startCol:f,endCol:f+b,suggestions:u(m,k,b)})}if(i&&this.closest("heading-title")){let h=R(this,d,"bold-header","bold in section header","warning");h.suggestions=[{desc:"remove",range:[e,e+3],text:""}],p.push(h)}return p}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return Object.assign(r,{bold:this.bold,italic:this.italic}),r}};$r=new WeakMap});var Na={};ne(Na,{parseQuotes:()=>ls});var ls,ds=w(()=>{"use strict";$a();ls=(a,n,e,t)=>{var h;let r=a.split(/('{2,})/u),{length:i}=r;if(i===1)return a;let s=0,o=0,l,g,p;for(let m=1;m<i;m+=2){let x=r[m].length;switch(x){case 2:o++;break;case 4:r[m-1]+="'",r[m]="'''";case 3:if(s++,l!==void 0)break;r[m-1].endsWith(" ")?g===void 0&&p===void 0&&(p=m):r[m-1].slice(-2,-1)===" "?l=m:g!=null||(g=m);break;default:r[m-1]+="'".repeat(x-5),r[m]="'''''",o++,s++}}if(o%2===1&&s%2===1){let m=(h=l!=null?l:g)!=null?h:p;m!==void 0&&(r[m]="''",r[m-1]+="'")}let d=!0,u=!0;for(let m=1;m<i;m+=2){let x=r[m].length,f=x!==2,b=x!==3;f&&(d=!d),b&&(u=!u),new Zn(r[m],{bold:f&&d,italic:b&&u},n,e),r[m]=`\0${e.length-1}q`}return r.join("")}});var Ia={};ne(Ia,{parseExternalLinks:()=>gs});var gs,us=w(()=>{"use strict";se();Ui();Xn();gs=(a,n,e,t)=>{var r;return(r=n.regexExternalLinks)!=null||(n.regexExternalLinks=new RegExp(String.raw`\[(\0\d+f\x7F|(?:(?:${n.protocol}|//)${We}|\0\d+m\x7F)${Ue}(?=[[\]<>"\t${Fe}]|\0\d))([${Fe}]*(?![${Fe}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),a.replace(n.regexExternalLinks,(i,s,o,l)=>{let{length:g}=e,p=/&[lg]t;/u.exec(s);return p&&(o="",l=s.slice(p.index)+o+l,s=s.slice(0,p.index)),t?(new Ze(s,"ext-link-url",n,e),`[\0${g}f${o}${l}]`):(new tt(s,o,l,n,e),`\0${g}w`)})}});var ei,La=w(()=>{"use strict";se();Qr();ei=class extends Ae{get type(){return"category"}get sortkey(){let{childNodes:[,n]}=this;return n&&At(n.text())}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e),{sortkey:r}=this;return r&&(t.sortkey=r),t}}});var Fa={};ne(Fa,{parseLinks:()=>Ea});var Wd,Ea,Pa=w(()=>{"use strict";K();ds();us();Mi();ji();La();Wd=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,Ea=(a,n,e,t)=>{var o;(o=n.regexLinks)!=null||(n.regexLinks=new RegExp(String.raw`^\s*(?:${n.protocol}|//)`,"iu"));let r=n.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]]))?\]\]([\s\S]*)$/u:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]])?)?\]\]([\s\S]*)$/u,i=a.split("[["),s=i.shift();for(let l=0;l<i.length;l++){let g=!1,p,d,u,h,m=i[l],x=r.exec(m);if(x)[,p,d,u,h]=x,h.startsWith("]")&&(u!=null&&u.includes("["))&&(u+="]",h=h.slice(1));else{let A=Wd.exec(m);A&&(g=!0,[,p,d,u]=A)}if(p===void 0||n.regexLinks.test(p)||/\0\d+[exhbru]\x7F/u.test(p)){s+=`[[${m}`;continue}let f=p.trim().startsWith(":");if(f&&g){s+=`[[${m}`;continue}let{ns:b,valid:k}=$.normalizeTitle(p,0,!1,n,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0});if(k){if(g){if(b!==6){s+=`[[${m}`;continue}let A=!1;for(l++;l<i.length;l++){let I=i[l],P=I.split("]]");if(P.length>2){A=!0,u+=`[[${P[0]}]]${P[1]}`,h=P.slice(2).join("]]");break}else if(P.length===2)u+=`[[${P[0]}]]${P[1]}`;else{u+=`[[${I}`;break}}if(u=Ea(u,n,e,t),!A){s+=`[[${p}${d}${u}`;continue}}}else{s+=`[[${m}`;continue}u&&(u=ls(u,n,e,t));let C=Tr;f||(b===6?(u&&(u=gs(u,n,e,!0)),C=xr):b===14&&(C=ei)),u===void 0&&d&&(u=""),s+=`\0${e.length}l${h}`,new C(p,u,n,e,d)}return s}});var Oa={};ne(Oa,{parseMagicLinks:()=>Ud});var qa,Ra,ja,Ba,Ud,_a=w(()=>{"use strict";se();Xn();qa=String.raw`[${Fe}\t]| |�*160;|�*a0;`,Ra=`(?:${qa})+`,ja=`(?:${qa}|-)`,Ba=String.raw`(?:RFC|PMID)${Ra}\d+\b|ISBN${Ra}(?:97[89]${ja}?)?(?:\d${ja}?){9}[\dx]\b`,Ud=(a,n,e)=>{if(!n.regexMagicLinks)try{n.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${n.protocol})(${We}${Ue})|${Ba})`,"giu")}catch{n.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${n.protocol})(${We}${Ue})|${Ba})`,"giu")}return a.replace(n.regexMagicLinks,(t,r,i)=>{let s=r?t.slice(r.length):t;if(i){let o="",l=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(s);l&&(o=s.slice(l.index),s=s.slice(0,l.index));let g=s.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,p=g.exec(s);if(p){let d=1;p[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(s.slice(0,p.index))&&(d=2),o=s.slice(p.index+d)+o,s=s.slice(0,p.index+d)}return o.length>=i.length?t:(new Ze(s,void 0,n,e),`${r}\0${e.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(s))return t;return new Ze(s,"magic-link",n,e),`${r}\0${e.length-1}i`})}});var Da,Ma=w(()=>{"use strict";Da=(a,n)=>a.startsWith(n)?n.length:[...n].findIndex((e,t)=>e!==a[t])});var ti,Ha=w(()=>{"use strict";ss();ti=class extends Sr{get type(){return"list"}}});var Wa={};ne(Wa,{parseList:()=>zd});var zd,Ua=w(()=>{"use strict";Ma();Ha();os();zd=(a,n,e,t)=>{let r=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(a);if(!r)return n.lastPrefix="",a;let[i,s,o,l]=r,g=o.replace(/;/gu,":"),p=Da(g,n.lastPrefix),d=((p>1?o.slice(p-1):o)+l).split(/(?=;)/u),u=d[0].startsWith(";"),h=d.length-(u?0:1);if(p>1){let W=o.slice(0,p-1);if(u){let V=W.split(/(?=;)/u);d.unshift(...V),h+=W.includes(";")?V.length:0}else d[0]=W+d[0]}n.lastPrefix=g;let m=s+d.map((W,V)=>`\0${t.length+V}d`).join("")+a.slice(i.length);for(let W of d)new ti(W,e,t);if(!h)return m;let{html:[x,,f]}=e,b=/:+|-\{|\0\d+[xq]\x7F/gu,k=b,C=k.exec(m),A=0,I=!1,P=!1,z=0,X=(W,V)=>(new Cr(W,e,t),`${m.slice(0,V)}\0${t.length-1}d${m.slice(V+W.length)}`),re=W=>{W?A&&A--:A++};for(;C&&h;){let{0:W,index:V}=C;if(W==="-{"){if(!z){let{lastIndex:N}=k;k=/-\{|\}-/gu,k.lastIndex=N}z++}else if(W==="}-"){if(z--,!z){let{lastIndex:N}=k;k=b,k.lastIndex=N}}else if(W.endsWith("x")){let{name:N,closing:j,selfClosing:M}=t[Number(W.slice(1,-2))];(x.includes(N)||!M&&!f.includes(N))&&re(j)}else if(W.endsWith("q")){let{bold:N,italic:j}=t[Number(W.slice(1,-2))];N&&(re(I),I=!I),j&&(re(P),P=!P)}else if(A===0){if(W.length>=h)return X(W.slice(0,h),V);h-=W.length,k.lastIndex=V+4+String(t.length).length,m=X(W,V)}C=k.exec(m)}return m}});var ps,za,He,cs,Gd,_t,Ga=w(()=>{"use strict";G();de();Xr();D();Qe();ps=new Set(["A","T","R","D","-","H","N"]);za=[gt()];_t=class extends(Gd=S){constructor(e,t,r=[]){super(void 0,t,r,{});T(this,He);this.safeAppend(e.map(i=>new te(i,"converter-flag",t,r)))}get type(){return"converter-flags"}afterBuild(){y(this,He,this.childNodes.map(e=>e.text().trim())),super.afterBuild()}toString(e){return super.toString(e,";")}text(){return super.text(";")}getUnknownFlags(){return new Set(c(this,He).filter(e=>/\{{3}[^{}]+\}{3}/u.test(e)))}getVariantFlags(){let e=new Set(this.getAttribute("config").variants);return new Set(c(this,He).filter(t=>e.has(t)))}isInvalidFlag(e,t,r,i){return typeof e=="object"&&(e=e.text().trim(),t=this.getVariantFlags(),r=this.getUnknownFlags(),i=new Set(c(this,He).filter(s=>ps.has(s)))),!!e&&!t.has(e)&&!r.has(e)&&(t.size>0||!i.has(e))}lint(e=this.getAbsoluteIndex(),t){let r=this.getVariantFlags(),i=this.getUnknownFlags(),s=new Set(c(this,He).filter(d=>ps.has(d))),o=c(this,He).filter(d=>!d).length,l=c(this,He).length-i.size-o,g=super.lint(e,t);if(r.size===l||s.size===l)return g;let p=new B(this,e);for(let d=0;d<this.length;d++){let u=this.childNodes[d],h=u.text().trim();if(this.isInvalidFlag(h,r,i,s)){let m=L(u,p,"no-ignored","invalid conversion flag");r.size===0&&ps.has(h.toUpperCase())?m.fix={desc:"uppercase",range:[m.startIndex,m.endIndex],text:h.toUpperCase()}:m.suggestions=[{desc:"remove",range:[m.startIndex-(d&&1),m.endIndex],text:""}],g.push(m)}}return g}print(){return super.print({sep:";"})}};cs=q(Gd),He=new WeakMap,_t=_(cs,0,"ConverterFlagsToken",za,_t),O(cs,1,_t)});var Nr,Va=w(()=>{"use strict";K();D();Qe();Nr=class extends S{get type(){return"converter-rule"}get variant(){var n,e;return(e=(n=this.childNodes[this.length-2])==null?void 0:n.text().trim())!=null?e:""}constructor(n,e=!0,t=$.getConfig(),r=[]){super(void 0,t,r);let i=n.indexOf(":"),s=n.slice(0,i).indexOf("=>"),o=s===-1?n.slice(0,i):n.slice(s+2,i);e&&t.variants.includes(o.trim())?(super.insertAt(new te(o,"converter-rule-variant",t,r)),super.insertAt(new te(n.slice(i+1),"converter-rule-to",t,r)),s!==-1&&super.insertAt(new te(n.slice(0,s),"converter-rule-from",t,r),0)):super.insertAt(new te(n,"converter-rule-to",t,r))}toString(n){let{childNodes:e,firstChild:t,lastChild:r}=this;return e.length===3?`${t.toString(n)}=>${e[1].toString(n)}:${r.toString(n)}`:super.toString(n,":")}text(){let{childNodes:n,firstChild:e,lastChild:t}=this;return n.length===3?`${e.text()}=>${n[1].text()}:${t.text()}`:super.text(":")}getGaps(n){return n===0&&this.length===3?2:1}print(){let{childNodes:n}=this;if(n.length===3){let[e,t,r]=n;return`<span class="wpb-converter-rule">${e.print()}=>${t.print()}:${r.print()}</span>`}return super.print({sep:":"})}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e);return t.variant=this.variant,t}}});var Qa,hs,Vd,Dt,Xa=w(()=>{"use strict";se();Ve();D();Ga();Va();Qa=[me("-{")];Dt=class extends(Vd=S){get type(){return"converter"}constructor(n,e,t,r=[]){super(void 0,t,r),this.insertAt(new _t(n,t,r));let[i]=e,s=i.includes(":"),o=new Nr(i,s,t,r);s&&o.length===1||!s&&e.length===2&&!ge(e[1]).trim()?this.insertAt(new Nr(e.join(";"),!1,t,r)):this.append(o,...e.slice(1).map(l=>new Nr(l,!0,t,r)))}toString(n){let{childNodes:[e,...t]}=this;return`-{${e.toString(n)}${e.length>0?"|":""}${t.map(r=>r.toString(n)).join(";")}}-`}text(){let{childNodes:[n,...e]}=this;return`-{${n.text()}|${$e(e,";")}}-`}getGaps(n){return n||this.firstChild.length>0?1:0}print(){let{childNodes:[n,...e]}=this;return`<span class="wpb-converter">-{${n.print()}${n.length>0?"|":""}${Ge(e,{sep:";"})}}-</span>`}};hs=q(Vd),Dt=_(hs,0,"ConverterToken",Qa,Dt),O(hs,1,Dt)});var Ka={};ne(Ka,{parseConverter:()=>Qd});var Qd,Ja=w(()=>{"use strict";Xa();Qd=(a,n,e)=>{var l;(l=n.regexConverter)!=null||(n.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${n.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"u"));let t=/-\{/gu,r=/-\{|\}-/gu,i=[],s=t,o=s.exec(a);for(;o;){let{0:g,index:p}=o;if(g==="}-"){let d=i.pop(),{length:u}=e,h=a.slice(d.index+2,p),m=h.indexOf("|"),[x,f]=m===-1?[[],h]:[h.slice(0,m).split(";"),h.slice(m+1)],b=f.replace(/(&[#a-z\d]+);/giu,"$1"),k=b.split(n.regexConverter).map(C=>C.replace(/\x01/gu,";"));new Dt(x,k,n,e),a=`${a.slice(0,d.index)}\0${u}v${a.slice(p+2)}`,i.length===0&&(s=t),s.lastIndex=d.index+3+String(u).length}else i.push(o),s=r,s.lastIndex=p+2;o=s.exec(a)}return a}});var mn={};ne(mn,{Token:()=>S});var cn,Se,Z,ie,Mt,Ir,hn,ee,Ya,Za,el,tl,rl,nl,il,sl,ol,al,ll,dl,ms,S,D=w(()=>{"use strict";se();G();he();K();Hs();Gs();ms=class ms extends $n{constructor(e,t=$.getConfig(),r=[],i){super();T(this,ee);T(this,cn,"plain");T(this,Se,0);T(this,Z);T(this,ie);T(this,Mt);T(this,Ir,!1);T(this,hn);typeof e=="string"&&this.insertAt(e),y(this,Z,t),y(this,ie,r),r.push(this)}get type(){return c(this,cn)}set type(e){y(this,cn,e)}parseOnce(e=c(this,Se),t=!1,r){if(e<c(this,Se)||this.length===0||!this.isPlain())return this;if(c(this,Se)>=11)return this;switch(e){case 0:if(this.type==="root"){c(this,ie).pop();let i=v(this,ee,Ya).call(this);t&&(t=!i)}y(this,Mt,t),v(this,ee,Za).call(this,t);break;case 1:v(this,ee,el).call(this);break;case 2:v(this,ee,tl).call(this);break;case 3:v(this,ee,rl).call(this);break;case 4:v(this,ee,nl).call(this);break;case 5:v(this,ee,il).call(this,r);break;case 6:v(this,ee,sl).call(this,r);break;case 7:v(this,ee,ol).call(this);break;case 8:v(this,ee,al).call(this);break;case 9:v(this,ee,ll).call(this);break;case 10:v(this,ee,dl).call(this)}if(this.type==="root")for(let i of c(this,ie))i==null||i.parseOnce(e,t,r);return An(this,Se)._++,this}buildFromStr(e,t){let r=e.split(/[\0\x7F]/u).map((i,s)=>{if(s%2===0)return new Gr(i);if(isNaN(i.slice(-1)))return c(this,ie)[Number(i.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${i}`)});return t===0?r.map(String).join(""):t===1?$e(r):r}build(){y(this,Se,11);let{length:e,firstChild:t}=this,r=t==null?void 0:t.toString();if(e===1&&t.type==="text"&&r.includes("\0")&&(zr(this,0,1,this.buildFromStr(r)),this.normalize(),this.type==="root"))for(let i of c(this,ie))i==null||i.build()}afterBuild(){if(this.type==="root")for(let e of c(this,ie))e==null||e.afterBuild();y(this,Ir,!0)}parse(e=11,t,r){for(e=Math.min(e,11);c(this,Se)<e;)this.parseOnce(c(this,Se),t,r);return e&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===ms}getAttribute(e){var t;switch(e){case"config":return c(this,Z);case"include":return(t=c(this,Mt))!=null?t:!!c(this.getRootNode(),Mt);case"accum":return c(this,ie);case"built":return c(this,Ir);case"stage":return c(this,Se);case"invalid":return this.type==="table-inter"&&Kt(this)==="error";default:return super.getAttribute(e)}}setAttribute(e,t){switch(e){case"stage":c(this,Se)===0&&this.type==="root"&&c(this,ie).shift(),y(this,Se,t);break;default:super.setAttribute(e,t)}}insertAt(e,t=this.length){let r=typeof e=="string"?new Gr(e):e;super.insertAt(r,t);let{type:i}=r;return i==="root"&&(r.type="plain"),r}normalizeTitle(e,t=0,r){return $.normalizeTitle(e,t,c(this,Mt),c(this,Z),r)}inTableAttrs(){var e,t;return((e=this.closest("table-attrs,ext"))==null?void 0:e.type)==="table-attrs"&&((t=this.closest("table-attrs,arg,magic-word,template"))!=null&&t.is("table-attrs")?"error":"warning")}inHtmlAttrs(){var e;return(e=this.closest("html-attrs,ext"))!=null&&e.is("html-attrs")?"error":this.inTableAttrs()}lint(e=this.getAbsoluteIndex(),t){var i;let r=super.lint(e,t);if(this.type==="root"){let s=new Map,o="category,html-attr#id,ext-attr#id,table-attr#id";for(let u of this.querySelectorAll(o)){let h;if(u.is("category"))h=u.name;else{let m=u.getValue();m&&m!==!0&&(h=`#${m}`)}if(h){let m=s.get(h);m?m.add(u):s.set(h,new Set([u]))}}for(let[u,h]of s)if(h.size>1&&!u.startsWith("#mw-customcollapsible-")){let m=!u.startsWith("#"),x=`duplicated ${m?"category":"id"}`,f=m?"error":"warning";r.push(...[...h].map(b=>{let k=R(b,{start:b.getAbsoluteIndex()},"no-duplicate",x,f);return m&&(k.suggestions=[{desc:"remove",range:[k.startIndex,k.endIndex],text:""}]),k}))}let l=/<!--\s*lint-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->/gu,g=this.toString(),p=[],d=l.exec(g);for(;d;){let{1:u,index:h}=d,m=(i=d[2])==null?void 0:i.trim();p.push({line:this.posFromIndex(h).top+(u==="disable-line"?0:1),from:u==="disable"?l.lastIndex:void 0,to:u==="enable"?l.lastIndex:void 0,rules:m?new Set(m.split(",").map(x=>x.trim())):void 0}),d=l.exec(g)}if(r=r.filter(({rule:u,startLine:h,startIndex:m})=>{let x={pos:0};for(let{line:f,from:b,to:k,rules:C}of p){if(f>h+1)break;if(C&&!C.has(u))continue;if(f===h&&b===void 0&&k===void 0)return!1;b<=m&&b>x.pos?(x.pos=b,x.type="from"):k<=m&&k>x.pos&&(x.pos=k,x.type="to")}return x.type!=="from"}),r.some(({fix:u})=>u)){let u=r.map(({fix:x})=>x).filter(Boolean).sort(({range:[x,f]},{range:[b,k]})=>f===k?b-x:k-f),h=1/0,m=g;for(let{range:[x,f],text:b}of u)f<=h&&(m=m.slice(0,x)+b+m.slice(f),h=x);Object.assign(r,{output:m})}}return r}toString(e,t){return e?super.toString(!0,t):Pe(c(this,hn),()=>super.toString(!1,t),r=>{let i=this.getRootNode();i.type==="root"&&c(i,Ir)&&y(this,hn,r)})}};cn=new WeakMap,Se=new WeakMap,Z=new WeakMap,ie=new WeakMap,Mt=new WeakMap,Ir=new WeakMap,hn=new WeakMap,ee=new WeakSet,Ya=function(){let{parseRedirect:e}=(Zs(),Q(Ys)),t=this.firstChild.toString(),r=e(t,c(this,Z),c(this,ie));return r&&this.setText(r),!!r},Za=function(e){let{parseCommentAndExt:t}=(Zr(),Q(pa));this.setText(t(this.firstChild.toString(),c(this,Z),c(this,ie),e))},el=function(){let{parseBraces:e}=(Un(),Q(Oo)),t=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,r=e(t,c(this,Z),c(this,ie));this.setText(this.type==="root"?r:r.slice(1))},tl=function(){if(c(this,Z).excludes.includes("html"))return;let{parseHtml:e}=(fa(),Q(ma));this.setText(e(this.firstChild.toString(),c(this,Z),c(this,ie)))},rl=function(){if(c(this,Z).excludes.includes("table"))return;let{parseTable:e}=(ka(),Q(ya));this.setText(e(this,c(this,Z),c(this,ie)))},nl=function(){if(c(this,Z).excludes.includes("hr"))return;let{parseHrAndDoubleUnderscore:e}=(Ca(),Q(Sa));this.setText(e(this,c(this,Z),c(this,ie)))},il=function(e){let{parseLinks:t}=(Pa(),Q(Fa));this.setText(t(this.firstChild.toString(),c(this,Z),c(this,ie),e))},sl=function(e){if(c(this,Z).excludes.includes("quote"))return;let{parseQuotes:t}=(ds(),Q(Na)),r=this.firstChild.toString().split(`
|
|
25
|
-
`);for(let
|
|
26
|
-
`))},
|
|
27
|
-
`),
|
|
28
|
-
`))},dl=function(){if(c(this,Z).variants.length>0){let{parseConverter:e}=(Ja(),Q(Ka));this.setText(e(this.firstChild.toString(),c(this,Z),c(this,ie)))}};S=ms});var oe,hr,zr,qe,he=w(()=>{"use strict";oe={running:!1,run(a){let{running:n}=this;this.running=!0;try{let{Token:e}=(D(),Q(mn)),t=a();return t instanceof e&&!t.getAttribute("built")&&t.afterBuild(),this.running=n,t}catch(e){throw this.running=n,e}},rev:0},hr=a=>n=>n.type===a,zr=(a,n,e,t=[])=>{var s,o;let r=a.getChildNodes(),i;r.length===e?(i=r,r=t):i=r.splice(n,e,...t);for(let l=0;l<t.length;l++){let g=t[l];g.setAttribute("parentNode",a),g.setAttribute("nextSibling",r[n+l+1]),g.setAttribute("previousSibling",r[n+l-1])}return(s=r[n-1])==null||s.setAttribute("nextSibling",r[n]),(o=r[n+t.length])==null||o.setAttribute("previousSibling",r[n+t.length-1]),r===t&&a.setAttribute("childNodes",r),i},qe=(a,n)=>{Object.defineProperty(a,"name",{value:n.name})}});var gl={};ne(gl,{Title:()=>fs});var fn,xn,Le,Lr,Ht,fs,ul=w(()=>{"use strict";se();fs=class{constructor(n,e,t,{temporary:r,decode:i,selfLink:s}={}){T(this,fn);T(this,xn);T(this,Le);T(this,Lr);T(this,Ht);le(this,"valid");le(this,"encoded",!1);let o=n.trim().startsWith("../");if(i&&n.includes("%"))try{let g=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(n);n=ot(n),this.encoded=g}catch{}if(n=At(n).replace(/[_ ]+/gu," ").trim(),o)y(this,Lr,0);else{let g=e;n.startsWith(":")&&(g=0,n=n.slice(1).trim());let p=n.split(":");if(p.length>1){let d=ze(p[0]),u=Object.prototype.hasOwnProperty.call(t.nsid,d)&&t.nsid[d];u&&(g=u,n=p.slice(1).join(":").trim())}y(this,Lr,g)}let l=n.indexOf("#");if(l!==-1){let g=n.slice(l).trim().slice(1);if(g.includes("%"))try{g=ot(g)}catch{}y(this,Ht,g.replace(/ /gu,"_")),n=n.slice(0,l).trim()}this.valid=!!(n||s&&this.ns===0&&c(this,Ht)!==void 0)&&At(n)===n&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(o?/^(?:\.\.\/)+(.*)/u.exec(n)[1]:n),this.main=n,y(this,xn,t.namespaces),y(this,Le,t.articlePath||"/wiki/$1"),c(this,Le).includes("$1")||y(this,Le,c(this,Le)+`${c(this,Le).endsWith("/")?"":"/"}$1`),r||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return c(this,Lr)}get fragment(){return c(this,Ht)}get main(){return c(this,fn)}set main(n){n=n.replace(/_/gu," ").trim(),y(this,fn,n&&n[0].toUpperCase()+n.slice(1))}get prefix(){let n=c(this,xn)[this.ns];return n+(n&&":")}get title(){return this.getRedirection()[1]}get extension(){let{main:n}=this,e=n.lastIndexOf(".");return e===-1?void 0:n.slice(e+1).toLowerCase()}getRedirection(){return[!1,(this.prefix+this.main).replace(/ /gu,"_")]}setFragment(n){y(this,Ht,n)}getUrl(n){{typeof n=="string"&&(y(this,Le,n),c(this,Le).includes("$1")||y(this,Le,c(this,Le)+`${c(this,Le).endsWith("/")?"":"/"}$1`));let{title:e,fragment:t}=this;return e?c(this,Le).replace("$1",encodeURIComponent(e)+(t?`#${encodeURIComponent(t)}`:"")):t===void 0?"":`#${encodeURIComponent(t)}`}throw new Error("Title.getUrl method is only available in the LSP version!")}};fn=new WeakMap,xn=new WeakMap,Le=new WeakMap,Lr=new WeakMap,Ht=new WeakMap});var kl={};ne(kl,{LanguageService:()=>bs,isAttr:()=>xs,tasks:()=>ml});var ml,Xd,Kd,Jd,Yd,fl,Zd,eg,tg,rg,xs,ng,pl,kn,xl,Er,xe,cl,bl,bn,Tn,Fr,ri,hl,ye,xt,it,st,Rr,vn,jr,Br,Wt,H,yn,Ee,Ts,Tl,ys,yl,ks,Pr,bs,vl=w(()=>{"use strict";kt();ki();G();se();K();ml=new WeakMap,Xd=new Set(["ref"]),Kd=new Set(["ref","references"]),Jd=new Set(["name","extends","follow"]),Yd=new Set(["group"]),fl=new Set(["arg-name","template-name","link-target","parameter-key"]),Zd=new Set(["ext","html","attr-key","image-parameter","heading-title","heading","magic-word-name",...fl]),eg=new Set(["text","comment","noinclude","include"]),tg=["ext","html","table"].map(a=>`${a}-attr#style`).join(),rg=Ce(a=>new RegExp(`^(?:${a}|//)`,"iu")),xs=({type:a,parentNode:n,length:e,firstChild:t},r)=>a==="attr-value"&&e===1&&t.type==="text"&&(!r||n.name==="style"),ng=a=>a.is("html-attr")||a.is("table-attr"),pl=a=>a.childNodes.every(({type:n})=>eg.has(n)),kn=(a,n)=>{let{top:e,left:t}=a.posFromIndex(n);return{line:e,character:t}},xl=(a,n,e)=>({start:kn(a,n),end:kn(a,e)}),Er=a=>{let{top:n,left:e,height:t,width:r}=a.getBoundingClientRect();return{start:{line:n,character:e},end:Jt(n,e,t,r)}},xe=(a,n,e,{line:t,character:r},i,s)=>[...new Set(a)].map(o=>{var g;let l=(g=s==null?void 0:s(o))==null?void 0:g.description;return{label:o,kind:n,textEdit:{range:{start:{line:t,character:r-e.length},end:{line:t,character:r}},newText:o+(i!=null?i:"")},...l&&{documentation:{kind:"markdown",value:l}}}}),cl=(a,n,{line:e,character:t})=>{let r=a.indexFromPos(e,t);return a.caretPositionFromIndex(r+Number(/\w/u.test(n.charAt(r))))},bl=(a,n,e)=>{let{type:t,parentNode:r={}}=a,{name:i,tag:s}=r;return t==="attr-value"&&n.has(s)&&e.has(i)?a.toString().trim():NaN},bn=a=>bl(a,Xd,Jd),Tn=a=>bl(a,Kd,Yd),Fr=(a,n)=>{let e=a==null?void 0:a.getAttr(n);return e!==!0&&e||!1},ri=a=>{let{type:n,name:e,parentNode:t}=a;switch(n){case"heading":return a.level;case"heading-title":return t.level;case"parameter-key":return`${t.parentNode.name}|${t.name}`;case"ext":case"html":case"image-parameter":return e;default:return t.name}},hl=(a,n,e=!1)=>({range:xl(a,...n.range),newText:n.text,title:`${e?"Fix":"Suggestion"}: ${n.desc}`,fix:e}),bs=class{constructor(n){T(this,H);T(this,ye);T(this,xt);T(this,it);T(this,st);T(this,Rr);T(this,vn);T(this,jr);T(this,Br);T(this,Wt);le(this,"include",!0);le(this,"config");le(this,"data");ml.set(n,this),Object.defineProperties(this,{config:{enumerable:!1},data:{enumerable:!1}})}destroy(){Object.setPrototypeOf(this,null)}async provideDocumentColors(n,e,t=!0){let r=await v(this,H,Ee).call(this,e);return r.querySelectorAll("attr-value,parameter-value,arg-default").reverse().flatMap(i=>{let{type:s,childNodes:o}=i;return s!=="attr-value"&&!pl(i)?[]:o.filter(l=>l.type==="text").reverse().flatMap(l=>{let{data:g}=l,p=js(g,t).filter(([,,,u])=>u);if(p.length===0)return[];let d=l.getAbsoluteIndex();return p.map(([u,h,m])=>{let x=n(u);return x.length===4&&{color:{red:x[0]/255,green:x[1]/255,blue:x[2]/255,alpha:x[3]},range:xl(r,d+h,d+m)}}).filter(Boolean)})})}provideColorPresentations(n){let{color:{red:e,green:t,blue:r,alpha:i},range:s}=n,o=`#${Or(e)}${Or(t)}${Or(r)}${i<1?Or(i):""}`;return[{label:o,textEdit:{range:s,newText:o}}]}async provideCompletionItems(n,e){var I,P,z,X,re,W,V;let{re:t,allTags:r,functions:i,switches:s,protocols:o,params:l,tags:g,ext:p}=v(this,H,yl).call(this),{line:d,character:u}=e,h=n.split(/\r?\n/u,d+1)[d],m=t.exec((I=h==null?void 0:h.slice(0,u))!=null?I:""),[,,x={},f={}]=this.config.doubleUnderscore;if((m==null?void 0:m[1])!==void 0){let N=m[1].startsWith("/");return xe(r,"Class",m[1].slice(N?1:0),e,N&&!(h!=null&&h.slice(u).trim().startsWith(">"))?">":"")}else{if(m!=null&&m[4])return xe(s,"Constant",m[4],e,"",N=>{if(this.data)return N=N.slice(2,-2),N in x?N=x[N]:N in f&&(N=f[N]),v(this,H,ks).call(this,N.toLowerCase())});if((m==null?void 0:m[5])!==void 0)return xe(o,"Reference",m[5],e)}let b=await v(this,H,Ee).call(this,n),k;if(m!=null&&m[2]){k=b.elementFromPoint(m.index+m[2].length-1,d);let N=(P=m[3])!=null?P:"";if(m[2]==="{{{")return xe(b.querySelectorAll("arg").filter(U=>U.name&&U!==k).map(({name:U})=>U),"Variable",N,e);let[j,M]=this.config.parserFunction,E=Array.isArray(M),F=h.charAt(u),ce=N.startsWith(":"),Y=ce?N.slice(1).trimStart():N;if(m[2]==="[[")return xe(b.querySelectorAll("link,file,category,redirect-target").filter(U=>U!==k).map(({name:U})=>U),"Folder",Y,e);let ue=i;return F===":"?ue=i.filter(U=>!U.endsWith(":")):F===":"&&(ue=i.filter(U=>U.endsWith(":")).map(U=>U.slice(0,-1))),[...xe(ue,"Function",N,e,"",U=>{if(this.data)U in j?U=j[U]:!E&&U in M&&(U=M[U]);else return;return v(this,H,Pr).call(this,U.toLowerCase())}),...N.startsWith("#")?[]:xe(b.querySelectorAll("template").filter(U=>U!==k).map(U=>{let{name:ke}=U;if(ce)return ke;let{ns:bt}=U.getAttribute("title");return bt===0?`:${ke}`:bt===10?ke.slice(9):ke}),"Folder",Y,e)]}let C,A;if((m==null?void 0:m[7])===void 0&&(k=b.elementFromPoint(u,d),{type:C,parentNode:A}=k),(m==null?void 0:m[6])!==void 0||C==="image-parameter"){let N=b.indexFromPos(d,u),j=(X=(z=m==null?void 0:m[6])==null?void 0:z.trimStart())!=null?X:c(this,ye).slice(k.getAbsoluteIndex(),N).trimStart(),M=c(this,ye)[N]==="=";return[...xe(l,"Property",j,e).filter(({label:E})=>!M||!/[= ]$/u.test(E)),...xe(b.querySelectorAll("image-parameter#width").filter(E=>E!==k).map(E=>E.text()),"Unit",j,e)]}else if((m==null?void 0:m[7])!==void 0||C==="attr-key"){let N=(W=(re=m==null?void 0:m[7])==null?void 0:re.toLowerCase())!=null?W:A.tag,j=(V=m==null?void 0:m[9])!=null?V:k.toString().slice(0,u-b.posFromIndex(k.getAbsoluteIndex()).left);if(!g.has(N))return;let M=Bn[N],E=qn[N],F=E&&xe(E,"Field",j,e);return p.includes(N)&&!M?F:[...F!=null?F:[],...N==="meta"||N==="link"?[]:xe(jn,"Property",j,e),...M?xe(M,"Property",j,e):[],...xe(["data-"],"Variable",j,e),...xe(["xmlns:"],"Interface",j,e)]}else if(C==="parameter-key"||C==="parameter-value"&&A.anon){let N=A.parentNode,{type:j,name:M}=N;if(j==="magic-word"&&M!=="invoke")return;let E=c(this,ye).slice(k.getAbsoluteIndex(),b.indexFromPos(d,u)).trimStart(),{module:F,function:ce}=N;return E?xe(b.querySelectorAll("parameter").filter(Y=>Y===A||Y.anon||Y.parentNode.type!==j||Y.parentNode.name!==M?!1:j==="template"?!0:Y.parentNode.module===F&&Y.parentNode.function===ce).map(({name:Y})=>Y),"Variable",E,e,C==="parameter-value"?"=":""):void 0}else if(xs(k)&&ng(A)){let N=wn(A.tag,A.name);if(N.length===0)return;let j=c(this,ye).slice(k.getAbsoluteIndex(),b.indexFromPos(d,u)).trimStart();return xe(N,"Value",j,e)}}async provideDiagnostics(n,e=!0){let t=await v(this,H,Ee).call(this,n),r=t.lint();return[(e?r:r.filter(({severity:l})=>l==="error")).map(({startLine:l,startCol:g,endLine:p,endCol:d,severity:u,rule:h,message:m,fix:x,suggestions:f})=>({range:{start:{line:l,character:g},end:{line:p,character:d}},severity:u==="error"?1:2,source:"WikiLint",code:h,message:m,data:[...x?[hl(t,x,!0)]:[],...f?f.map(b=>hl(t,b)):[]]})),[],[]].flat(2)}async provideFoldingRanges(n){let e=await v(this,H,Ee).call(this,n),{length:t}=e.getLines(),r=[],i=new Array(6),s=e.querySelectorAll("heading-title,table,template,magic-word");for(let o of[...s].reverse())o.getRelativeIndex();for(let o of s){let{offsetHeight:l}=o;if(o.type==="heading-title"||l>2){let{top:g}=e.posFromIndex(o.getAbsoluteIndex());if(o.type==="heading-title"){let{level:p}=o.parentNode;for(let d=p-1;d<6;d++){let u=i[d];u!==void 0&&u<g-1&&r.push({startLine:u,endLine:g-1,kind:"region"}),i[d]=void 0}i[p-1]=g+l-1}else r.push({startLine:g,endLine:g+l-2,kind:"region"})}}for(let o of i)o!==void 0&&o<t-1&&r.push({startLine:o,endLine:t-1,kind:"region"});return r}async provideLinks(n){var s;(s=this.config)!=null||(this.config=$.getConfig());let{articlePath:e,protocol:t}=this.config,r=e==null?void 0:e.includes("//"),i=rg(t);return(await v(this,H,Ee).call(this,n)).querySelectorAll(`magic-link,ext-link-url,free-ext-link,attr-value,image-parameter#link${r?",link-target,template-name,invoke-module,magic-word#filepath,magic-word#widget":""}`).reverse().map(o=>{let l;o.is("magic-word")&&({name:l}=o,o=o.childNodes[1].lastChild);let{type:g,parentNode:p,firstChild:d,lastChild:u,childNodes:h,length:m}=o,{tag:x}=p;if(l!=null||(l=p.name),!(g!=="attr-value"||l==="src"&&["templatestyles","img"].includes(x)||l==="cite"&&["blockquote","del","ins","q"].includes(x))||!pl(o))return!1;let f=h.filter(b=>b.type==="text").map(({data:b})=>b).join("").trim();if(!f)return!1;try{if(o.is("magic-link")||o.is("ext-link-url")||o.is("free-ext-link"))f=o.getUrl(e);else if(g==="link-target"&&(p.is("link")||p.is("redirect-target")||p.is("category"))){if(f.startsWith("/"))return!1;f=p.link.getUrl(e)}else if(g==="template-name")f=p.getAttribute("title").getUrl(e);else if(["link-target","invoke-module","parameter-value"].includes(g)||g==="attr-value"&&l==="src"&&x==="templatestyles"||g==="image-parameter"&&!i.test(f)){if(!r||f.startsWith("/"))return!1;let b=0;switch(g){case"attr-value":b=10;break;case"invoke-module":b=828;break;case"parameter-value":b=l==="filepath"?6:274}let k=$.normalizeTitle(f,b,!1,this.config,{temporary:!0});if(!k.valid)return!1;f=k.getUrl()}if(typeof f=="string"&&f.startsWith("//")&&(f=`https:${f}`),f=new URL(f).href,g==="image-parameter"){let b=d.getBoundingClientRect(),{top:k,left:C,height:A,width:I}=m===1?b:u.getBoundingClientRect();return{range:{start:{line:b.top,character:b.left},end:Jt(k,C,A,I)},target:f}}return{range:Er(o),target:f}}catch{return!1}}).filter(Boolean)}async provideReferences(n,e){let t=await v(this,H,Ee).call(this,n),{offsetNode:r,offset:i}=cl(t,c(this,ye),e),s=r.type==="text"?r.parentNode:r,o=i===0&&(s.type==="ext-attr-dirty"||s.type==="html-attr-dirty")?s.parentNode.parentNode:s,{type:l}=o,g=bn(o),p=Tn(o);if(!g&&!p&&!Zd.has(l))return;let d=ri(o),u=t.querySelectorAll(l==="heading-title"?"heading":l).filter(h=>l==="attr-value"?bn(h)===g||Tn(h)===p:ri(h)===d).reverse().map(h=>({range:Er(h.type==="parameter-key"?h.parentNode:h)}));return u.length===0?void 0:u}async provideDefinition(n,e){let t=await v(this,H,Ee).call(this,n),r=t.elementFromPoint(e.character,e.line),i=r.is("ext")&&r.name==="ref"?r:r.closest("ext#ref"),s=Fr(i,"name");if(!s)return;let o=Fr(i,"group"),l=t.querySelectorAll("ext#ref").filter(g=>g.innerText&&Fr(g,"name")===s&&Fr(g,"group")===o).reverse().map(({lastChild:g})=>({range:Er(g)}));return l.length===0?void 0:l}async resolveRenameLocation(n,e){let t=await v(this,H,Ee).call(this,n),r=t.elementFromPoint(e.character,e.line),{type:i}=r,s=bn(r),o=Tn(r);return!s&&!o&&(!fl.has(i)||i==="parameter-key"&&/^[1-9]\d*$/u.test(r.parentNode.name)||i==="link-target"&&!["link","redirect-target"].includes(r.parentNode.type))?void 0:Er(r)}async provideRenameEdits(n,e,t){let r=await v(this,H,Ee).call(this,n),i=r.elementFromPoint(e.character,e.line),{type:s}=i,o=bn(i),l=o&&Fr(i.parentNode.parentNode,"group"),g=Tn(i),p=ri(i),d=r.querySelectorAll(s).filter(u=>{let{type:h}=u.parentNode;return s==="link-target"&&h!=="link"&&h!=="redirect-target"?!1:s==="attr-value"?Tn(u)===g||bn(u)===o&&Fr(u.parentNode.parentNode,"group")===l:ri(u)===p});return d.length===0?void 0:{changes:{"":d.reverse().map(u=>({range:Er(u),newText:t}))}}}async provideHover(n,e){if(!this.data)return;let t=await v(this,H,Ee).call(this,n),{offsetNode:r,offset:i}=cl(t,c(this,ye),e);r.type==="text"&&(i+=r.getRelativeIndex(),r=r.parentNode);let{type:s,parentNode:o,length:l,name:g}=r,p,d,u,h;if(r.is("double-underscore")&&i>0)p=v(this,H,ks).call(this,r.name);else if(s==="magic-word-name")p=v(this,H,Pr).call(this,o.name),d=r.text().trim(),u=o.getAttribute("colon");else if(r.is("magic-word")&&!r.modifier&&l===1&&(i>0||t.posFromIndex(r.getAbsoluteIndex()).left===e.character))p=v(this,H,Pr).call(this,g),d=r.firstChild.text().trim(),u=r.getAttribute("colon");else if((r.is("magic-word")||r.is("template"))&&r.modifier&&i>=2&&r.getRelativeIndex(0)>i&&(d=r.modifier.trim().slice(0,-1),p=v(this,H,Pr).call(this,d.toLowerCase()),u=":",p)){let m=r.getAbsoluteIndex();h={start:kn(t,m+2),end:kn(t,m+r.modifier.trimEnd().length+1)}}return p&&{contents:{kind:"markdown",value:(p.signatures?`${p.signatures.map(m=>`- **{{ ${d}${m.length===0?"**":`${u}** `}${m.map(({label:x,const:f})=>f?x:`*${x}*`).join(" **|** ")} **}}**`).join(`
|
|
6
|
+
`})}}return bt(t,e),t}}}),to={};ie(to,{ParamTagToken:()=>rt});var xi,sr,mi,rt,so=C({"src/paramTag/index.ts"(){"use strict";X(),ue(),Fs(),Sn(),J(),V(),qe(),xi=[Cs],rt=class extends(mi=z){get type(){return"ext-inner"}constructor(e,t,s=W.getConfig(),n=[],a){if(super(void 0,s,n,{}),t){const r=ve;this.append(...t.split(`
|
|
7
|
+
`).map(i=>a?i:ss(i,s,n,e)).map(i=>new r(i,"param-line",s,n,{})))}n.splice(n.indexOf(this),1),n.push(this)}lint(e=this.getAbsoluteIndex()){const t="no-ignored",s=W.lintConfig.getSeverity(t,this.name);if(!s)return[];const n=new he(this,e),a=W.msg("invalid parameter of <$1>",this.name),r=[];for(const i of this.childNodes){i.setAttribute("aIndex",e);const o=i.childNodes.filter(({type:l})=>l!=="comment"&&l!=="include"&&l!=="noinclude");if(o.some(({type:l})=>l==="ext"))r.push(Q(i,n,t,a,s));else{const l=o.findIndex(({type:h})=>h!=="text"),d=o.slice(0,l===-1?void 0:l).map(String).join("");if(d&&!(l===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(d)){const h=Q(i,n,t,a,s);h.suggestions=[{desc:"remove",range:[h.startIndex,h.endIndex],text:""}],r.push(h)}else{const h=i.lint(e,!1);h.length>0&&r.push(...h)}}e+=i.toString().length+1}return r}},sr=oe(mi),rt=de(sr,0,"ParamTagToken",xi,rt),le(sr,1,rt)}}),An,ro=C({"src/heading.ts"(){"use strict";var e,t,bs,n;X(),be(),ue(),J(),V(),vt(),An=(n=class extends z{constructor(r,i,o,l=[]){super(void 0,o,l);q(this,t);q(this,e);j(this,e,r);const d=new z(i[0],o,l);d.type="heading-title",d.setAttribute("stage",2);const h=new Xe(i[1],"heading-trail",o,l);this.append(d,h)}get type(){return"heading"}get level(){return f(this,e)}toString(r){const i=P(this,t,bs).call(this);return i+this.firstChild.toString(r)+i+this.lastChild.toString(r)}text(){const r=P(this,t,bs).call(this);return r+this.firstChild.text()+r}getAttribute(r){return r==="invalid"?this.inHtmlAttrs()==="error":r==="padding"?this.level:super.getAttribute(r)}getGaps(){return this.level}lint(r=this.getAbsoluteIndex(),i){const o=super.lint(r,i),{firstChild:l,level:d}=this,h=l.toString(),c=h.startsWith("="),x=c||h.endsWith("="),g=l.childNodes.filter(Ls("quote")),u=g.filter(({bold:p})=>p),y=g.filter(({italic:p})=>p),k=new he(this,r),$=this.inHtmlAttrs();if(this.level===1){const p="h1",b=W.lintConfig.getSeverity(p);if(b){const w=Q(l,k,p,"<h1>",b);x||(w.suggestions=[{desc:"h2",range:[w.startIndex,w.endIndex],text:`=${h}=`}]),o.push(w)}}if(x){const p="unbalanced-header",b=W.lintConfig.getSeverity(p);if(b){const w=W.msg("unbalanced $1 in a section header",'"="'),v=Q(l,k,p,w,b);if(h!=="=")if(c){const[A]=/^=+/u.exec(h),S=d+A.length;v.suggestions=[{desc:`h${d}`,range:[v.startIndex,v.startIndex+A.length],text:""}],S<7&&v.suggestions.push({desc:`h${S}`,range:[v.endIndex,v.endIndex],text:A})}else{const A=/[^=](=+)$/u.exec(h)[1],S=d+A.length;v.suggestions=[{desc:`h${d}`,range:[v.endIndex-A.length,v.endIndex],text:""}],S<7&&v.suggestions.push({desc:`h${S}`,range:[v.startIndex,v.startIndex],text:A})}o.push(v)}}$&&o.push(Z(this,k,"parsing-order","section header in HTML tag attributes",$));const T="format-leakage",m=W.lintConfig.getSeverity(T,"apostrophe");if(m){const p=this.getRootNode().toString();if(u.length%2){const b=Q(u[u.length-1],{...k,start:r+d,left:k.left+d},T,W.msg("unbalanced $1 in a section header","bold apostrophes"),m),w=r+d+h.length;p.slice(b.endIndex,w).trim()?b.suggestions=[{desc:"close",range:[w,w],text:"'''"}]:b.fix={desc:"remove",range:[b.startIndex,b.endIndex],text:""},o.push(b)}if(y.length%2){const b=Q(y[y.length-1],{start:r+d},T,W.msg("unbalanced $1 in a section header","italic apostrophes"),m),w=r+d+h.length;p.slice(b.endIndex,w).trim()?b.suggestions=[{desc:"close",range:[w,w],text:"''"}]:b.fix={desc:"remove",range:[b.startIndex,b.endIndex],text:""},o.push(b)}}return o}print(){const r=P(this,t,bs).call(this);return super.print({pre:r,sep:r})}json(r,i=this.getAbsoluteIndex()){const o=super.json(void 0,i);return o.level=this.level,o}},e=new WeakMap,t=new WeakSet,bs=function(){return"=".repeat(this.level)},n)}}),vi,no,Ql=C({"src/parameter.ts"(){"use strict";ce(),X(),J(),V(),vi=new RegExp(`https?://${ht}${ct}$`,"iu"),no=class extends z{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){var e;try{return!!((e=this.parentNode)!=null&&e.getDuplicatedArgs().some(([t])=>t===this.name))}catch{return!1}}constructor(e,t,s,n=[]){super(void 0,s,n);const a=new z(typeof e=="number"?void 0:e,s,n,{}),r=new z(t,s,n);a.type="parameter-key",a.setAttribute("stage",2),r.type="parameter-value",r.setAttribute("stage",2),this.append(a,r)}trimName(e,t=!0){const s=(typeof e=="string"?e:e.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",s),s}afterBuild(){if(!this.anon){const{parentNode:e,firstChild:t}=this,s=this.trimName(t);e&&e.getArgs(s,!1,!1).add(this)}super.afterBuild()}toString(e){return this.anon?this.lastChild.toString(e):super.toString(e,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(e=this.getAbsoluteIndex(),t){var r;const s=super.lint(e,t),n="unescaped",a=W.lintConfig.getSeverity(n);if(a){const{firstChild:i}=this,o=(r=vi.exec(i.text()))==null?void 0:r[0];try{if(o&&new URL(o).search){const l="unescaped query string in an anonymous parameter",d=Q(i,{start:e},n,l,a);d.startIndex=d.endIndex,d.startLine=d.endLine,d.startCol=d.endCol,d.endIndex++,d.endCol++,d.fix={desc:"escape",range:[d.startIndex,d.endIndex],text:"{{=}}"},s.push(d)}}catch{}}return s}print(){return super.print({sep:this.anon?"":"="})}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t);return Object.assign(s,{anon:this.anon},this.duplicated&&{duplicated:!0}),s}}}}),bi,rr,wi,nt,Jl=C({"src/transclude.ts"(){"use strict";var e,t,s,n,a,r,Et,io,l;ce(),X(),be(),ue(),_s(),V(),Ql(),qe(),vt(),bi=[ts()],nt=(l=class extends(wi=z){constructor(h,c,x,g=[]){var _,E;let u;const y=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(h);y&&(u=Number(y[1]),h=h.replace(`\0${u}h`,g[u].toString().replace(/^\n/u,"")));super(void 0,x,g,{});q(this,r);Ae(this,"modifier","");q(this,e,"template");q(this,t,":");q(this,s,!1);q(this,n,new Map);q(this,a);const{parserFunction:[k,$],variable:T,functionHook:m}=x,p=(_=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(h))==null?void 0:_[0];if(p)this.setAttribute("modifier",p),h=h.slice(p.length);else if(h.includes(":")){const[F,...N]=h.split(":"),[O]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((E=N[0])!=null?E:"");this.setModifier(`${F}:${O}`)&&(h=N.join(":").slice(O.length))}const b=h.search(/[::]/u),w=h[b]===":",v=b!==-1;if(v||c.length===0&&!f(this,s)){const F=v?h.slice(0,b):h,N=v&&h.slice(b+1),O=_e(F),R=v?O.slice(O.search(/\S/u))+(w?":":""):O.trim(),L=R.toLowerCase(),U=Array.isArray($),I=U?$.includes(R):Object.prototype.hasOwnProperty.call($,R),B=!U&&I?$[R]:Object.prototype.hasOwnProperty.call(k,L)&&k[L],M=U&&I||!("functionHook"in x)||m.includes(B),H=U&&I||T.includes(B);if(v?B&&M:H){this.setAttribute("name",B||L.replace(/^#|:$/u,"")),j(this,e,"magic-word"),w&&j(this,t,":");const G=new Xe(F,"magic-word-name",x,g);if(super.insertAt(G),N!==!1&&c.unshift([N]),this.name==="invoke")for(let K=0;K<2;K++){const se=c.shift();if(!se)break;const re=new ve(se.join("="),`invoke-${K?"function":"module"}`,x,g);super.insertAt(re)}}}if(this.type==="template"){const F=_e(h).trim();if(!this.normalizeTitle(F,10,{halfParsed:!0,temporary:!0}).valid)throw g.pop(),new SyntaxError("Invalid template name");const N=new ve(h,"template-name",x,g,{});super.insertAt(N)}typeof u=="number"&&(g[u]=void 0);const A=this.isTemplate();let S=1;for(let F=0;F<c.length;F++){const N=c[F];A||this.name==="switch"&&F>0||this.name==="tag"&&F>1||(N[0]=N.join("="),N.length=1),N.length===1&&(N.unshift(S),S++),this.insertAt(new no(...N,x,g))}this.seal("modifier")}get type(){return f(this,e)}get module(){return this.type==="magic-word"&&this.name==="invoke"?P(this,r,Et).call(this).title:void 0}get function(){var h;return this.type==="magic-word"&&this.name==="invoke"?(h=this.childNodes[2])==null?void 0:h.text().trim():void 0}setModifier(h){const{parserFunction:[,,c,x]}=this.getAttribute("config"),g=_e(h).trim();if(h&&!g.endsWith(":"))return!1;const u=g.slice(0,-1).toLowerCase(),y=c.includes(u),k=x.includes(u);return f(this,s)&&y||!f(this,s)&&(k||!h)||(me.running||this.length>1)&&(y||k||!h)?(this.setAttribute("modifier",h),j(this,s,y),!!h):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0)),super.afterBuild(),this.isTemplate()&&this.type==="template"&&(j(this,a,P(this,r,Et).call(this)),this.setAttribute("name",f(this,a).title))}toString(h){return`{{${this.modifier}${this.type==="magic-word"?this.firstChild.toString(h)+(this.length===1?"":f(this,t))+this.childNodes.slice(1).map(c=>c.toString(h)).join("|"):super.toString(h,"|")}}}`}text(){const{childNodes:h,length:c,firstChild:x,modifier:g,type:u,name:y}=this;return u==="magic-word"&&y==="vardefine"?"":`{{${g}${u==="magic-word"?x.text()+(c===1?"":f(this,t))+Ve(h.slice(1),"|"):super.text("|")}}}`}getAttribute(h){switch(h){case"padding":return this.modifier.length+2;case"title":return f(this,a);case"colon":return f(this,t);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!P(this,r,Et).call(this).valid);default:return super.getAttribute(h)}}lint(h=this.getAbsoluteIndex(),c){const x=super.lint(h,c);if(!this.isTemplate())return x;const{type:g,childNodes:u,length:y}=this,k=new he(this,h),$=g==="magic-word";if($&&!P(this,r,Et).call(this).valid)x.push(Q(u[1],k,"invalid-invoke","illegal module name"));else{const m=u[$?1:0],p=m.childNodes.findIndex(w=>w.type==="text"&&Kt(w.data).includes("#")),b=m.childNodes[p];if(b){const w=Q(m,k,"no-ignored","useless fragment","warning");w.fix={desc:"remove",range:[w.startIndex+m.getRelativeIndex(p)+b.data.indexOf("#"),w.endIndex],text:""},x.push(w)}}if($&&y===2)return x.push(Z(this,k,"invalid-invoke","missing module function")),x;const T=this.getDuplicatedArgs().filter(([,m])=>!m[0].querySelector("ext"));if(T.length>0)for(const[,m]of T)x.push(...m.map(p=>{const b=Q(p,k,"no-duplicate","duplicated parameter");return b.suggestions=[{desc:"remove",range:[b.startIndex-1,b.endIndex],text:""}],b}));return x}insertAt(h,c=this.length){return super.insertAt(h,c),h.anon?P(this,r,io).call(this,h):h.name&&this.getArgs(h.name,!1,!1).add(h),h}getAllArgs(){return this.childNodes.filter(Ls("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:h})=>h)}getArgs(h,c,x=!0){const g=String(h).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");let u;return f(this,n).has(g)?u=f(this,n).get(g):(u=new Set(this.getAllArgs().filter(({name:y})=>g===y)),f(this,n).set(g,u)),u}getDuplicatedArgs(){return[...f(this,n)].filter(([,{size:h}])=>h>1).map(([h,c])=>[h,[...c]])}getPossibleValues(){const{type:h,name:c,childNodes:x}=this;if(h==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let g,u;switch(c){case"if":case"ifexist":case"ifexpr":case"iferror":g=2;break;case"ifeq":g=3;break;case"switch":{const y=x.slice(2),k=y[y.length-1];u=[...y.filter(({anon:$})=>!$),...k!=null&&k.anon?[k]:[]].map(({lastChild:$})=>$);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}u!=null||(u=x.slice(g,g+2).map(({lastChild:y})=>y));for(let y=0;y<u.length;){const{length:k,0:$}=u[y].childNodes.filter(T=>T.text().trim());if(k===0)u.splice(y,1);else if(k>1||$.type!=="magic-word")y++;else try{const T=$.getPossibleValues();u.splice(y,1,...T),y+=T.length}catch{y++}}return u}print(){const{childNodes:h,length:c,firstChild:x,modifier:g,type:u}=this;return`<span class="wpb-${u}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${u==="magic-word"?Yt(g)+x.print()+(c===1?"":f(this,t))+gt(h.slice(1),{sep:"|"}):(g?`<span class="wpb-magic-word">${Yt(g)}</span>`:"")+gt(h,{sep:"|"})}}}</span>`}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n=new WeakMap,a=new WeakMap,r=new WeakSet,Et=function(){const h=this.type==="template";return this.normalizeTitle(this.childNodes[h?0:1].text(),h?10:828,{temporary:!0})},io=function(h){const c=this.getAnonArgs(),x=typeof h!="number";for(let g=x?c.indexOf(h):h-1;g<c.length;g++){const u=c[g],{name:y}=u,k=String(g+1);(y!==k||u===h)&&(u.setAttribute("name",k),this.getArgs(k,!1,!1).add(u))}},l),rr=oe(wi),nt=de(rr,0,"TranscludeToken",bi,nt),le(rr,1,nt)}}),yi,nr,Si,Ot,Xl=C({"src/hidden.ts"(){"use strict";mt(),V(),yi=[Je()],Ot=class extends(Si=z){get type(){return"hidden"}getAttribute(e){return e==="invalid"||super.getAttribute(e)}},nr=oe(Si),Ot=de(nr,0,"HiddenToken",yi,Ot),le(nr,1,Ot)}}),Ai,ir,$i,qt,Kl=C({"src/arg.ts"(){"use strict";var e,ao,s;ce(),X(),ue(),Oe(),_s(),V(),qe(),Xl(),Ai=[je("{{{"),ts()],qt=(s=class extends($i=z){constructor(a,r,i=[]){super(void 0,r,i,{});q(this,e);for(let o=0;o<a.length;o++){const l=a[o];if(o===0){const d=new ve(l,"arg-name",r,i,{});super.insertAt(d)}else if(o>1){const d=new Ot(l,r,i);super.insertAt(d)}else{const d=new z(l,r,i);d.type="arg-default",d.setAttribute("stage",2),super.insertAt(d)}}}get type(){return"arg"}get default(){var a,r;return(r=(a=this.childNodes[1])==null?void 0:a.text())!=null?r:!1}toString(a){return`{{{${super.toString(a,"|")}}}}`}text(){return`{{{${Ve(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){P(this,e,ao).call(this),super.afterBuild()}lint(a=this.getAbsoluteIndex(),r){const{childNodes:[i,o,...l]}=this;i.setAttribute("aIndex",a+3);const d=i.lint(a+3,r);if(o){const h=a+4+i.toString().length;o.setAttribute("aIndex",h);const c=o.lint(h,r);c.length>0&&d.push(...c)}if(l.length>0){const h=new he(this,a);d.push(...l.map(c=>{const x=Q(c,h,"no-ignored","invisible content inside triple braces");return x.startIndex--,x.startCol--,x.suggestions=[{desc:"remove",range:[x.startIndex,x.endIndex],text:""},{desc:"escape",range:[x.startIndex,x.startIndex+1],text:"{{!}}"}],x}))}if(!this.getAttribute("include")){const h=Z(this,{start:a},"no-arg","unexpected template argument","warning");o&&(h.suggestions=[{desc:"expand",range:[a,h.endIndex],text:o.text()}]),d.push(h)}return d}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(a,r=this.getAbsoluteIndex()){const i=super.json(void 0,r);return i.default=this.default,i}},e=new WeakSet,ao=function(){this.setAttribute("name",this.firstChild.text().trim())},s),ir=oe($i),qt=de(ir,0,"ArgToken",Ai,qt),le(ir,1,qt)}}),oo={};ie(oo,{parseBraces:()=>Ns});var ki,ar,cs,or,lr,dr,_i,hr,Ns,$n=C({"parser/braces.ts"(){"use strict";xt(),ce(),ro(),Jl(),Kl(),ki={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},ar=String.raw`\[(?!\[)`,cs=String.raw`\n(?![=\0])`,or=String.raw`|\{{2,}`,lr=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),dr=Ge(e=>new RegExp(e,"gmu")),_i=new RegExp(String.raw`\{\{((?:[^\n{}[]|${ar}|${cs})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${cs})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${ar}|${cs})*\}-`,"gu"),hr=e=>{const t=ut(_e(e));return lr.has(t)?lr.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},Ns=(e,t,s)=>{var u,y,k,$,T;const n=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,a]}=t,r=[],i=[],o=(m,p,b,w)=>{p[p.length-1].push(Le(m.slice(b,w),i))};let l;do l!==void 0&&(e=l),l=e.replace(_i,(m,p,b)=>{if(p!==void 0||typeof b=="string")try{const{length:w}=s,v=(p!=null?p:b).split("|");return new nt(Le(v[0],i),v.slice(1).map(A=>{const S=A.indexOf("=");return(S===-1?[A]:[A.slice(0,S),A.slice(S+1)]).map(_=>Le(_,i))}),t,s),`\0${w}${hr(v[0])}`}catch(w){if(!(w instanceof SyntaxError)||w.message!=="Invalid template name")throw w}return i.push(Le(m,i)),`\0${i.length-1}`});while(l!==e);e=l;const d=e.lastIndexOf("}}")-e.length;let h=d+e.length!==-1,c=dr(n+(h?or:"")),x=c.exec(e),g;for(;x||g!==void 0&&g<=e.length&&((y=(u=r[r.length-1])==null?void 0:u[0])!=null&&y.startsWith("="));){if(x!=null&&x[1]){const[,{length:N}]=x;x[0]=x[0].slice(N),x.index+=N}const{0:m,index:p}=x!=null?x:{0:`
|
|
8
|
+
`,index:e.length},b=(k=r.pop())!=null?k:{},{0:w,index:v,parts:A,findEqual:S,pos:_}=b,E=m==="="&&S;if(m==="]]"||m==="}-")g=p+2;else if(m===`
|
|
9
|
+
`){g=p+1;const{pos:N,findEqual:O}=($=r[r.length-1])!=null?$:{};if(N===void 0||O||_e(e.slice(N,v))!==""){const R=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(e.slice(v,p));R&&(R[2]=Le(R[2],i),R[2].includes(`
|
|
10
|
+
`)||(e=`${e.slice(0,v)}\0${s.length}h${e.slice(p)}`,g=v+4+String(s.length).length,new An(R[1].length,R.slice(2),t,s)))}}else if(m==="|"||E)g=p+1,o(e,A,_,p),m==="|"&&A.push([]),b.pos=g,b.findEqual=m==="|",r.push(b);else if(m.startsWith("}}")){const N=m.slice(0,Math.min(w.length,3)),O=w.length-N.length,{length:R}=s;g=p+N.length,o(e,A,_,p);let L=!1,U="t";if(N.length===3){const I=A.map(M=>M.join("=")),B=I.length>1&&_e(I[1]).trim();new qt(I,t,s),B&&B.endsWith(":")&&a.includes(B.slice(0,-1).toLowerCase())&&(U="s")}else try{new nt(A[0][0],A.slice(1),t,s),U=hr(A[0][0])}catch(I){if(I instanceof SyntaxError&&I.message==="Invalid template name")L=!0;else throw I}L||(e=`${e.slice(0,v+O)}\0${R}${U}${e.slice(g)}`,g=v+O+3+String(R).length,O>1?r.push({0:w.slice(0,O),index:v,pos:v+O,parts:[[]]}):O===1&&e[v-1]==="-"&&r.push({0:"-{",index:v-1,pos:v+1,parts:[[]]}))}else g=p+m.length,m.startsWith("{")&&(x.pos=g,x.parts=[[]]),r.push(..."0"in b?[b]:[],x);let F=r[r.length-1];if(h&&d+e.length<g)for(h=!1;(T=F==null?void 0:F[0])!=null&&T.startsWith("{");)r.pop(),F=r[r.length-1];c=dr(n+(h?or:"")+(F?`|${ki[F[0][0]]}${F.findEqual?"|=":""}`:"")),c.lastIndex=g,x=c.exec(e)}return Le(e,i)}}}),lo={};ie(lo,{InputboxToken:()=>ho});var ho,Yl=C({"src/paramTag/inputbox.ts"(){"use strict";Fs(),$n(),J(),so(),ho=class extends rt{constructor(e,t,s=W.getConfig(),n=[]){const a=Symbol("InputboxToken"),r=s.excludes.includes("heading")?s:{...s,excludes:[...s.excludes,"heading"]},{length:i}=n;n.push(a),t&&(t=ss(t,r,n,e)),t&&(t=Ns(t,r,n)),n.splice(i,1),super(e,t,r,n,{})}}}}),ws={};ie(ws,{NestedToken:()=>co});var Ti,Ii,co,cr=C({"src/nested.ts"(){"use strict";var e,t,s;X(),ue(),Fs(),$n(),J(),V(),Io(),We(),Ti=new Set(["comment","include","arg","template","magic-word"]),Ii=[!1,!0].map(n=>{const a=n?"includeonly":"noinclude";return new RegExp(String.raw`^(?:<${a}(?:\s[^>]*)?/?>|</${a}\s*>)$`,"iu")}),co=(s=class extends z{constructor(a,r,i,o,l=[]){if(typeof r=="boolean"){const d=Symbol("InputboxToken"),{length:h}=l;l.push(d),a&&(a=ss(a,o,l,r)),a&&(a=Ns(a,o,l)),l.splice(h,1)}else a&&(a=a.replace(r,(d,h,c,x,g)=>{const u=`\0${l.length+1}e`;return new lt(h,c,x,g,o,!1,l),u}));a&&(a=a.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(d,h,c)=>(new pe(c,o,l),`${h}\0${l.length}n`)));super(a,o,l);q(this,e);q(this,t);j(this,e,[...i]),j(this,t,r)}get type(){return"ext-inner"}lint(a=this.getAbsoluteIndex(),r){const i=super.lint(a,r),o="no-ignored",l=W.lintConfig.getSeverity(o,this.name);if(!l)return i;const d=new he(this,a),h=typeof f(this,t)=="boolean"?Ii[f(this,t)?1:0]:/^<!--[\s\S]*-->$/u;return[...i,...this.childNodes.filter(c=>{const{type:x,name:g}=c;if(x==="ext")return!f(this,e).includes(g);if(Ti.has(x))return!1;const u=c.toString().trim();return u&&!h.test(u)}).map(c=>{const x=Q(c,d,o,W.msg("invalid content in <$1>",this.name),l);return x.suggestions=[{desc:"remove",range:[x.startIndex,x.endIndex],text:""},{desc:"comment",range:[x.startIndex,x.endIndex],text:`<!--${c.toString()}-->`}],x})]}},e=new WeakMap,t=new WeakMap,s)}});function Ci(e,t,s,n,a){t=_e(t).trim();let r=t.replace(e==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(e){case"width":return!r&&!!t||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(r);case"link":{if(r){if(uo(s.protocol).test(r))return go(s.protocol).test(r)&&t;r.startsWith("[[")&&r.endsWith("]]")&&(r=r.slice(2,-2))}else return t;const i=W.normalizeTitle(r,0,!1,s,{halfParsed:n,decode:!0,selfLink:!0});return i.valid&&i}case"lang":return(a==="svg"||a==="svgz")&&!/[^a-z\d-]/u.test(r);case"alt":case"class":case"manualthumb":return!0;case"page":return(a==="djvu"||a==="djv"||a==="pdf")&&Number(r)>0;default:return!!r&&!isNaN(r)}}var uo,go,Ni,Fi,po,Zl=C({"src/imageParameter.ts"(){"use strict";var e,t,fo,a;xt(),ce(),X(),J(),V(),uo=Ge(r=>new RegExp(String.raw`^(?:${r}|//|\0\d+m\x7F)`,"iu")),go=Ge(r=>new RegExp(String.raw`^(?:(?:${r}|//)${ht}|\0\d+m\x7F)${ct}$`,"iu")),Ni=Ge(r=>new RegExp(String.raw`^(\s*(?!\s))${r.replace("$1","(.*)")}${r.endsWith("$1")?`(?=$|
|
|
11
|
+
)`:""}(\s*)$`,"u")),Fi=new Set(["alt","link","lang","page","caption"]),po=(a=class extends z{constructor(i,o,l,d){var r=(...n)=>(super(...n),q(this,t),q(this,e,""),this);let h;const c=Object.entries(l.img).map(([g,u])=>[g,u,Ni(g)]),x=c.find(([,g,u])=>(h=u.exec(i),h&&(h.length!==4||Ci(g,h[2],l,!0,o)!==!1)));if(x&&h){h.length===3?(r(void 0,l,d),j(this,e,i)):(r(h[2],l,d,{}),j(this,e,h[1]+x[0]+h[3])),this.setAttribute("name",x[1]);return}r(i,l.excludes.includes("list")?l:{...l,excludes:[...l.excludes,"list"]},d),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get type(){return"image-parameter"}get link(){return this.name==="link"?Ci("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var i;(i=this.parentNode)!=null&&i.is("gallery-image")&&!Fi.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(i){return f(this,e)?f(this,e).replace("$1",super.toString(i)):super.toString(i)}text(){return f(this,e)?f(this,e).replace("$1",super.text()).trim():super.text().trim()}isPlain(){return this.name==="caption"}getAttribute(i){return i==="invalid"?this.name==="invalid":i==="padding"?Math.max(0,f(this,e).indexOf("$1")):super.getAttribute(i)}lint(i=this.getAbsoluteIndex(),o){const l=super.lint(i,o),{link:d,name:h}=this;if(h==="invalid"){const c="invalid-gallery",x=W.lintConfig.getSeverity(c,"parameter");if(x){const g=Z(this,{start:i},c,"invalid image parameter",x);g.fix={desc:"remove",range:[i-1,g.endIndex],text:""},l.push(g)}}else if(typeof d=="object"&&d.encoded){const c="url-encoding",x=W.lintConfig.getSeverity(c,"file");if(x){const g=Z(this,{start:i},c,"unnecessary URL encoding in an internal link",x);g.suggestions=[{desc:"decode",range:[i,g.endIndex],text:Jt(this.text())}],l.push(g)}}return l}getValue(){return this.name==="invalid"?this.text():P(this,t,fo).call(this)||super.text()}print(){return f(this,e)?`<span class="wpb-image-parameter${this.name==="invalid"?" wpb-invalid":""}">${f(this,e).replace("$1",`<span class="wpb-image-caption">${gt(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}},e=new WeakMap,t=new WeakSet,fo=function(){return f(this,e)&&!f(this,e).includes("$1")},a)}}),ur,Li,ji,gr,pr,Ri,Pi,fr,kn,xo=C({"src/link/file.ts"(){"use strict";X(),ue(),J(),ks(),Zl(),ur=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),Li=new Set(["arg"]),ji=new Set(["template","magic-word"]),gr=new Set(["left","right","center","none"]),pr=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),Ri=new Set(["tiff","tif","png","gif","jpg","jpeg","webp","xcf","pdf","svg","djvu"]),Pi=e=>{if(e===void 0)return[];const t=/-\{|\}-|\|/gu,s=[];let n=t.exec(e),a=0,r=0;for(;n;){const{0:i,index:o}=n;i!=="|"?a+=i==="-{"?1:-1:a===0&&(s.push(e.slice(r,o)),{lastIndex:r}=t),n=t.exec(e)}return s.push(e.slice(r)),s},fr=(e,t)=>e.filter(({childNodes:s})=>{const n=s.filter(a=>a.text().trim());return n.length!==1||!t.has(n[0].type)}),kn=class extends Pe{get type(){return"file"}get extension(){return this.getAttribute("title").extension}constructor(e,t,s,n=[],a="|"){super(e,void 0,s,n,a);const{extension:r}=this.getTitle(!0,!0);this.safeAppend(Pi(t).map(i=>new po(i,r,s,n)))}lint(e=this.getAbsoluteIndex(),t){var g;const s=super.lint(e,t),n=fr(this.getAllArgs(),Li),a=[...new Set(n.map(({name:u})=>u))],r=a.filter(u=>ur.has(u)),i=a.filter(u=>gr.has(u)),o=a.filter(u=>pr.has(u)),[l]=r,d=l==="framed"||l==="manualthumb",h=new he(this,e);if(this.closest("ext-link-text")&&((g=this.getValue("link"))==null?void 0:g.trim())!==""&&s.push(Z(this,h,"nested-link","internal link in an external link")),d)for(const u of n.filter(({name:y})=>y==="width")){const y=Q(u,h,"invalid-gallery","invalid image parameter");y.fix={desc:"remove",range:[y.startIndex-1,y.endIndex],text:""},s.push(y)}if(n.length===a.length&&r.length<2&&i.length<2&&o.length<2)return s;const c=(u,y,k=!0)=>$=>{const T=typeof k=="function"?k($):k,m=Q($,h,"no-duplicate",W.msg(`${u} image $1 parameter`,y),T?"error":"warning");return m.suggestions=[{desc:"remove",range:[m.startIndex-1,m.endIndex],text:""}],m},{extension:x}=this;for(const u of a){if(u==="invalid"||u==="width"&&d)continue;const y=u==="caption";let k=n.filter(({name:$})=>$===u);if(y&&(k=[...k.slice(0,-1).filter($=>$.text()),...k.slice(-1)]),k.length>1){let $=!y||!x||Ri.has(x);if(y&&$){const T=fr(k,ji);$=T.length>1&&(m=>T.includes(m))}s.push(...k.map(c("duplicated",u,$)))}}return r.length>1&&s.push(...n.filter(({name:u})=>ur.has(u)).map(c("conflicting","frame"))),i.length>1&&s.push(...n.filter(({name:u})=>gr.has(u)).map(c("conflicting","horizontal-alignment"))),o.length>1&&s.push(...n.filter(({name:u})=>pr.has(u)).map(c("conflicting","vertical-alignment"))),s}getAllArgs(){return this.childNodes.slice(1)}getArgs(e){return this.getAllArgs().filter(({name:t})=>e===t)}getArg(e){const t=this.getArgs(e);return t[e==="manualthumb"?0:t.length-1]}getValue(e){var t;return(t=this.getArg(e))==null?void 0:t.getValue()}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t),{extension:n}=this;return n&&(s.extension=n),s}}}}),Ei,xr,Oi,it,mo=C({"src/link/galleryImage.ts"(){"use strict";var e,Yr,s;X(),Qe(),Oe(),J(),V(),xo(),Ei=[je("")],it=(s=class extends(Oi=kn){constructor(a,r,i,o,l=[]){let d;if(i!==void 0){const{length:h}=l;d=new z(i,o,l);for(let c=1;c<we;c++)d.parseOnce();l.splice(h,1)}super(r,d==null?void 0:d.toString(),o,l);q(this,e);Ae(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=`${a}-image`,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(a){const r=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),r?0:6,{halfParsed:!0,temporary:a,decode:!r})}lint(a=this.getAbsoluteIndex(),r){const i=super.lint(a,r),o="invalid-gallery",l=W.lintConfig.getSeverity(o,"image");if(l&&P(this,e,Yr).call(this)){const d=Z(this,{start:a},o,"invalid gallery image",l);d.suggestions=[{desc:"prefix",range:[a,a],text:"File:"}],i.push(d)}return i}getAttribute(a){return a==="invalid"?P(this,e,Yr).call(this):super.getAttribute(a)}},e=new WeakSet,Yr=function(){const{ns:a}=this.getAttribute("title");return a!==6},s),xr=oe(Oi),it=de(xr,0,"GalleryImageToken",Ei,it),le(xr,1,it)}}),vo={};ie(vo,{GalleryToken:()=>Bt});var qi,mr,Bi,Bt,ed=C({"src/gallery.ts"(){"use strict";var e,bo,Zr,n;Sn(),J(),V(),mo(),We(),qi=[Cs],Bt=(n=class extends(Bi=z){constructor(r,i,o=[]){var l;super(void 0,i,o,{});q(this,e);for(const d of(l=r==null?void 0:r.split(`
|
|
12
|
+
`))!=null?l:[]){const h=/^([^|]+)(?:\|(.*))?/u.exec(d);if(!h){super.insertAt(d.trim()?new pe(d,i,o):d);continue}const[,c,x]=h;P(this,e,bo).call(this,c)?super.insertAt(new it("gallery",c,x,i,o)):super.insertAt(new pe(d,i,o))}}get type(){return"ext-inner"}get widths(){return P(this,e,Zr).call(this,"widths")}get heights(){return P(this,e,Zr).call(this,"heights")}lint(r=this.getAbsoluteIndex(),i){const{top:o,left:l}=this.getRootNode().posFromIndex(r),d=[];for(let h=0;h<this.length;h++){const c=this.childNodes[h],x=c.toString(),{length:g}=x,u=x.trim(),{type:y}=c,k=o+h,$=h?0:l;if(c.setAttribute("aIndex",r),y==="noinclude"&&u&&!/^<!--.*-->$/u.test(u)){const T=r+g;d.push({rule:"no-ignored",message:W.msg("invalid content in <$1>","gallery"),severity:u.endsWith("-->")||/^(?:\||<!--)/u.test(u)?"warning":"error",startIndex:r,endIndex:T,startLine:k,endLine:k,startCol:$,endCol:$+g,suggestions:[{desc:"remove",range:[r,T],text:""},{desc:"comment",range:[r,T],text:`<!--${x}-->`}]})}else if(y!=="noinclude"&&y!=="text"){const T=c.lint(r,i);T.length>0&&d.push(...T)}r+=g+1}return d}json(r,i=this.getAbsoluteIndex()){const o=super.json(void 0,i);return Object.assign(o,{widths:this.widths,heights:this.heights}),o}},e=new WeakSet,bo=function(r){return this.normalizeTitle(r,6,{halfParsed:!0,temporary:!0,decode:!0}).valid},Zr=function(r){var l,d;const i=(l=this.parentNode)==null?void 0:l.getAttr(r),o=typeof i=="string"&&((d=/^(\d+)\s*(?:px)?$/u.exec(i))==null?void 0:d[1]);return o&&Number(o)||120},n),mr=oe(Bi),Bt=de(mr,0,"GalleryToken",qi,Bt),le(mr,1,Bt)}}),_n,wo=C({"src/link/index.ts"(){"use strict";X(),J(),ks(),_n=class extends Pe{get type(){return"link"}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),n="nested-link",a=W.lintConfig.getSeverity(n);return a&&this.closest("ext-link-text")&&s.push(Z(this,{start:e},n,"internal link in an external link",a)),s}}}}),Wi,Ui,es,Tn=C({"src/magicLink.ts"(){"use strict";var e,t,en,n;X(),ce(),ue(),J(),V(),Wi=String.raw`(?:[${Ee}\t]| |�*160;|&#[xX]0*[aA]0;)`,Ui=new RegExp(`${Wi}+`,"gu"),es=(n=class extends z{constructor(r,i="free-ext-link",o=W.getConfig(),l){super(r,o,l,{});q(this,t);q(this,e);j(this,e,i)}get type(){return f(this,e)}get innerText(){const r=new Map([["!","|"],["=","="]]);let i=Ve(this.childNodes.map(o=>{const{type:l}=o,d=String(o.name);return l==="magic-word"&&r.has(d)?r.get(d):o}));return this.type==="magic-link"&&(i=i.replace(Ui," ")),i}get link(){const{innerText:r}=this;return this.type==="magic-link"?r.startsWith("ISBN")?`ISBN ${r.slice(5).replace(/[- ]/gu,"").replace(/x$/u,"X")}`:r:Ua(r).replace(/\n/gu,"%0A")}lint(r=this.getAbsoluteIndex(),i){const o=super.lint(r,i),l=new he(this,r),{type:d,childNodes:h}=this;if(d==="magic-link")return P(this,t,en).call(this)&&o.push(Z(this,l,"invalid-isbn","invalid ISBN")),o;const c=d==="ext-link-url",x=c?/\|/u:/[,;。:!?()]+/u,g=h.find(u=>u.type==="text"&&x.test(u.data));if(g){const{data:u}=g,y=Q(g,l,"unterminated-url",W.msg("$1 in URL",c?'"|"':"full-width punctuation"),"warning"),{index:k,0:$}=x.exec(u),T=y.startIndex+k;y.suggestions=c?[{desc:"whitespace",range:[T,T+1],text:" "}]:[{desc:"whitespace",range:[T,T],text:" "},{desc:"escape",range:[T,T+$.length],text:encodeURI($)}],o.push(y)}return o}getUrl(r){{const{type:i}=this;let{link:o}=this;if(i==="magic-link"){if(o.startsWith("ISBN"))return this.normalizeTitle(`BookSources/${o.slice(5)}`,-1,{temporary:!0}).getUrl(r);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(r){return r==="invalid"?P(this,t,en).call(this):super.getAttribute(r)}},e=new WeakMap,t=new WeakSet,en=function(){if(this.type==="magic-link"){const{link:r}=this;if(r.startsWith("ISBN")){const i=[...r.slice(5)].map(o=>o==="X"?10:Number(o));return i.length===10?i.reduce((o,l,d)=>o+l*(10-d),0)%11!==0:i.length===13&&(i[12]===10||i.reduce((o,l,d)=>o+l*(d%2?3:1),0)%10!==0)}}return!1},n)}}),Mi,vr,zi,at,yo=C({"src/extLink.ts"(){"use strict";var e,t;Qe(),X(),Oe(),J(),V(),Tn(),Mi=[je("[")],at=(t=class extends(zi=z){constructor(n,a="",r="",i,o=[]){super(void 0,i,o,{});q(this,e);const l=n&&/^\0\d+f\x7F$/u.test(n)?o[Number(n.slice(1,-2))]:new es(n,"ext-link-url",i,o);if(this.insertAt(l),j(this,e,a),r){const d=new z(r,i,o,{});d.type="ext-link-text",d.setAttribute("stage",we-1),this.insertAt(d)}}get type(){return"ext-link"}toString(n){return this.length===1?`[${super.toString(n)}${f(this,e)}]`:`[${super.toString(n,f(this,e))}]`}text(){return`[${super.text(" ")}]`}getGaps(){return f(this,e).length}lint(n=this.getAbsoluteIndex(),a){const r=super.lint(n,a),i="var-anchor",o=W.lintConfig.getSeverity(i,"extLink");return o&&this.length===1&&this.closest("heading-title")&&r.push(Z(this,{start:n},i,"variable anchor in a section header",o)),r}print(){return super.print(this.length===1?{pre:"[",post:`${f(this,e)}]`}:{pre:"[",sep:f(this,e),post:"]"})}},e=new WeakMap,t),vr=oe(zi),at=de(vr,0,"ExtLinkToken",Mi,at),le(vr,1,at)}}),tn,td=C({"src/imagemapLink.ts"(){"use strict";V(),We(),wo(),yo(),tn=class extends z{get type(){return"imagemap-link"}constructor(e,t,s,n,a=[]){super(void 0,n,a),this.append(e,t.length===2?new _n(...t,n,a):new at(...t,n,a),new pe(s,n,a))}}}}),So={};ie(So,{ImagemapToken:()=>Wt});var Hi,br,Gi,Wt,sd=C({"src/imagemap.ts"(){"use strict";X(),be(),ue(),Sn(),J(),V(),We(),mo(),td(),Hi=[Cs],Wt=class extends(Gi=z){get type(){return"ext-inner"}get image(){return this.childNodes.find(Ls("imagemap-image"))}constructor(e,t=W.getConfig(),s=[]){if(super(void 0,t,s,{}),!e)return;const n=e.split(`
|
|
13
|
+
`),a=new Set(t.protocol.split("|")),r=pe;let i=!0,o=!1;for(const l of n){const d=l.trim();if(!(o||!d||d.startsWith("#"))){if(i){const h=l.indexOf("|"),c=h===-1?l:l.slice(0,h),{valid:x,ns:g}=this.normalizeTitle(c,0,{halfParsed:!0,temporary:!0});if(x&&g===6){const u=new it("imagemap",c,h===-1?void 0:l.slice(h+1),t,s);super.insertAt(u),i=!1;continue}else o=!0}else if(l.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(l);continue}else if(l.includes("[")){const h=l.indexOf("["),c=l.slice(h),x=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(c);if(x){if(this.normalizeTitle(x[1],0,{halfParsed:!0,temporary:!0,selfLink:!0}).valid){super.insertAt(new tn(l.slice(0,h),x.slice(1),c.slice(c.indexOf("]]")+2),t,s));continue}}else if(c.startsWith("[//")||a.has(c.slice(1,c.indexOf(":")+1))||a.has(c.slice(1,c.indexOf("//")+2))){const g=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(c);if(g){super.insertAt(new tn(l.slice(0,h),g.slice(1),c.slice(c.indexOf("]")+1),t,s));continue}}}}super.insertAt(new r(l,t,s))}}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),n=new he(this,e),{childNodes:a,image:r}=this,i="invalid-imagemap",o=W.lintConfig.getSeverity(i,r?"link":"image");return o&&(r?s.push(...a.filter(l=>{const d=l.toString().trim();return l.is("noinclude")&&d&&!d.startsWith("#")}).map(l=>{const d=Q(l,n,i,"invalid link in <imagemap>",o);return d.suggestions=[{desc:"remove",range:[d.startIndex-1,d.endIndex],text:""},{desc:"comment",range:[d.startIndex,d.startIndex],text:"# "}],d})):s.push(Z(this,n,i,"<imagemap> without an image",o))),s}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}},br=oe(Gi),Wt=de(br,0,"ImagemapToken",Hi,Wt),le(br,1,Wt)}}),Di,wr,Vi,ot,Ao=C({"src/nowiki/comment.ts"(){"use strict";X(),mt(),Oe(),J(),Ke(),Di=[Je(!1),je("<!--")],ot=class extends(Vi=Be){constructor(t,s,n,a){super(t,n,a);Ae(this,"closed");this.closed=s}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){if(this.closed)return[];const s="unclosed-comment",n=W.lintConfig.getSeverity(s);if(!n)return[];const a=Z(this,{start:t},s,W.msg("unclosed $1","HTML comment"),n);return a.suggestions=[{desc:"close",range:[a.endIndex,a.endIndex],text:"-->"}],[a]}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}},wr=oe(Vi),ot=de(wr,0,"CommentToken",Di,ot),le(wr,1,ot)}}),$o={};ie($o,{CommentedToken:()=>ko});var ko,rd=C({"src/commented.ts"(){"use strict";V(),Ao(),ko=class extends z{get type(){return"ext-inner"}constructor(e,t,s=[]){if(super(void 0,t,s,{AstText:":",CommentToken:":"}),e){let n=e.indexOf("<!--"),a=n!==-1&&e.indexOf("-->",n+4),r=0;for(;a!==!1&&a!==-1;)n>r&&this.insertAt(e.slice(r,n)),this.insertAt(new ot(e.slice(n+4,a),!0,t,s)),r=a+3,n=e.indexOf("<!--",r),a=n!==-1&&e.indexOf("-->",n+4);r<e.length&&this.insertAt(e.slice(r))}}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*(?:\/\s*)?(hiero)\b/giu)}}}}),_o={};ie(_o,{NowikiToken:()=>To});var Qi,Ji,To,nd=C({"src/nowiki/index.ts"(){"use strict";var e,sn,s;xt(),X(),J(),Ke(),Qi=Ge(n=>new RegExp(String.raw`<\s*(?:/\s*)${n==="nowiki"?"":"?"}(${n})\b`,"giu")),Ji=new Set(["templatestyles","section","languages"]),To=(s=class extends Be{constructor(){super(...arguments);q(this,e)}get type(){return"ext-inner"}lint(a=this.getAbsoluteIndex()){const{name:r}=this,i="void-ext",o=W.lintConfig.getSeverity(i,r);if(o&&P(this,e,sn).call(this)){const l=Z(this,{start:a},i,W.msg("nothing should be in <$1>",r),o);return l.fix={desc:"empty",range:[a,l.endIndex],text:""},[l]}return super.lint(a,Qi(r))}getAttribute(a){return a==="invalid"?P(this,e,sn).call(this):super.getAttribute(a)}},e=new WeakSet,sn=function(){const{name:a,firstChild:{data:r}}=this;return Ji.has(a)&&!!r},s)}}),Xi,yr,Ki,lt,Io=C({"src/tagPair/ext.ts"(){"use strict";X(),ue(),J(),mn(),V(),xn(),yn(),Xi=[Ts()],lt=class extends(Ki=He){get type(){return"ext"}constructor(e,t,s,n,a=W.getConfig(),r=!1,i=[]){const o=e.toLowerCase(),l=new Is(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",o,a,i),d={...a,ext:a.ext.filter(c=>c!==o),excludes:[...a.excludes]};let h;switch(d.inExt=!0,o){case"tab":d.ext=d.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"&&d.excludes.push("heading"),h=new z(s,d,i);break;case"pre":{const{PreToken:c}=(Vl(),Y(Za));h=new c(s,d,i);break}case"dynamicpagelist":{const{ParamTagToken:c}=(so(),Y(to));h=new c(r,s,d,i);break}case"inputbox":{const{InputboxToken:c}=(Yl(),Y(lo));h=new c(r,s,d,i);break}case"references":{const{NestedToken:c}=(cr(),Y(ws));d.excludes.push("heading"),h=new c(s,r,["ref"],d,i);break}case"choose":{const{NestedToken:c}=(cr(),Y(ws));h=new c(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],d,i);break}case"combobox":{const{NestedToken:c}=(cr(),Y(ws));h=new c(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],d,i);break}case"gallery":{const{GalleryToken:c}=(ed(),Y(vo));h=new c(s,d,i);break}case"imagemap":{const{ImagemapToken:c}=(sd(),Y(So));h=new c(s,d,i);break}case"hiero":{const{CommentedToken:c}=(rd(),Y($o));h=new c(s,d,i);break}default:{const{NowikiToken:c}=(nd(),Y(_o));h=new c(s,d,i)}}h.setAttribute("name",o),h.type==="plain"&&(h.type="ext-inner"),super(e,l,h,n,a,i),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),n=new he(this,e);if(this.name!=="nowiki"){const i=this.inHtmlAttrs();i&&s.push(Z(this,n,"parsing-order","extension tag in HTML tag attributes",i))}const a="var-anchor",r=W.lintConfig.getSeverity(a,"ref");return r&&this.name==="ref"&&this.closest("heading-title")&&s.push(Z(this,n,a,"variable anchor in a section header",r)),s}},yr=oe(Ki),lt=de(yr,0,"ExtToken",Xi,lt),le(yr,1,lt)}}),Co={};ie(Co,{parseCommentAndExt:()=>ss});var Sr,Yi,us,Zi,Ar,ss,Fs=C({"parser/commentAndExt.ts"(){"use strict";xt(),ce(),zl(),We(),Hl(),Gl(),Io(),Ao(),Sr="<onlyinclude>",Yi="</onlyinclude>",{length:us}=Sr,Zi=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",s=e?"noinclude":"includeonly";return Wa(n=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${n.join("|")})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(\1\s*)>)|<(${s})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${s}\s*)>|$))`,"giu"))}),Ar=e=>{const t=e.indexOf(Sr);return{i:t,j:e.indexOf(Yi,t+us)}},ss=(e,t,s,n)=>{if(n){let{i:o,j:l}=Ar(e);if(o!==-1&&l!==-1){let d="";const h=c=>{new pe(c,t,s),d+=`\0${s.length-1}n`};for(;o!==-1&&l!==-1;){const c=`\0${s.length}e`;new Rt(e.slice(o+us,l),t,s),o>0&&h(e.slice(0,o)),d+=c,e=e.slice(l+us+1),{i:o,j:l}=Ar(e)}return e&&h(e),d}}const{ext:a}=t,r=a.filter(o=>o!=="translate"&&o!=="tvar"),i={...t,ext:r};if(a.includes("translate")){const o=[];e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,l=>(o.push(l),`\0${o.length-1}`)).replace(/<translate( nowrap)?>([\s\S]+?)?<\/translate>/gu,(l,d,h)=>{const c=s.length;return new Ja(d,h&&Le(h,o),i,s),`\0${c}g`}),e=Le(e,o)}return e.replace(Zi[n?1:0](r),(o,l,d,h,c,x,g,u,y)=>{const k=s.length;let $="n";if(l)$="e",new lt(l,d,h,c,i,x,s);else if(o.startsWith("<!--")){$="c";const T=o.endsWith("-->");new ot(o.slice(4,T?-3:void 0),T,t,s)}else x?new Pt(x,g,u,y,t,s):new pe(o,t,s);return`\0${k}${$}`})}}}),ea,ta,sa,ra,$r,na,Ut,id=C({"src/html.ts"(){"use strict";var e,t,s,n,a;X(),be(),ue(),mn(),V(),J(),ea=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),ta=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"]),sa=new Set(["strike","big","center","font","tt"]),ra=[Ts()],Ut=(a=class extends(na=z){constructor(i,o,l,d,h,c){super(void 0,h,c);q(this,e);q(this,t);q(this,s);q(this,n);this.insertAt(o),this.setAttribute("name",i.toLowerCase()),j(this,e,l),j(this,t,d),j(this,s,i)}get type(){return"html"}get selfClosing(){return f(this,t)}get closing(){return f(this,e)}toString(i){return`<${this.closing?"/":""}${f(this,s)}${super.toString(i)}${f(this,t)?"/":""}>`}text(){const{closing:i}=this,o=f(this,s)+(i?"":super.text());return`<${i?"/":""}${o}${f(this,t)?"/":""}>`}getAttribute(i){return i==="invalid"?this.inTableAttrs()==="error":i==="padding"?f(this,s).length+(this.closing?2:1):super.getAttribute(i)}lint(i=this.getAbsoluteIndex(),o){const l=super.lint(i,o),{name:d,parentNode:h,closing:c,selfClosing:x}=this,g=new he(this,i),u=this.inTableAttrs();if(d==="h1"&&!c){const p=Z(this,g,"h1","<h1>");p.suggestions=[{desc:"h2",range:[i+2,i+3],text:"2"}],l.push(p)}if(u){const p=Z(this,g,"parsing-order","HTML tag in table attributes",u);u==="error"&&(p.fix={desc:"remove",range:[i,p.endIndex],text:""}),l.push(p)}sa.has(d)&&l.push(Z(this,g,"obsolete-tag","obsolete HTML tag","warning")),(d==="b"||d==="strong")&&this.closest("heading-title")&&l.push(Z(this,g,"bold-header","bold in section header","warning"));const{html:[,y,k]}=this.getAttribute("config"),$=k.includes(d),T=y.includes(d);if(c&&(x||$)||x&&(!$&&!T)){const p=Z(this,g,"unmatched-tag",c?"tag that is both closing and self-closing":"invalid self-closing tag"),b={desc:"open",range:[i+1,i+2],text:""},w={desc:"no self-closing",range:[p.endIndex-2,p.endIndex-1],text:""};T?p.suggestions=[b,w]:c?p.fix=$?b:w:p.suggestions=[w,{desc:"close",range:[p.endIndex-2,p.endIndex],text:`></${d}>`}],l.push(p)}else if(!this.findMatchingTag()){const p=Z(this,g,"unmatched-tag",c?"unmatched closing tag":"unclosed tag");if(c){const b=this.closest("magic-word");b&&ea.has(b.name)?p.severity="warning":p.suggestions=[{desc:"remove",range:[i,p.endIndex],text:""}]}else{const b=h==null?void 0:h.childNodes;ta.has(d)&&(b!=null&&b.slice(0,b.indexOf(this)).some(({type:w,name:v})=>w==="html"&&v===d))?p.suggestions=[{desc:"close",range:[i+1,i+1],text:"/"}]:this.closest("heading-title")||(p.severity="warning")}l.push(p)}return l}findMatchingTag(){return De(f(this,n),()=>{const{name:i,parentNode:o,closing:l,selfClosing:d}=this,{html:[,h,c]}=this.getAttribute("config"),x=c.includes(i),g=h.includes(i);if(x||g&&d)return this;if(!o)return;const{childNodes:u}=o,y=u.indexOf(this),k=l?u.slice(0,y).reverse():u.slice(y+1),$=[this],{rev:T}=me;for(const m of k)if(!(!m.is("html")||m.name!==i||g&&f(m,t)))if(f(m,e)===l)$.push(m);else{const p=$.pop();if(p===this)return m;W.viewOnly&&(j(p,n,[T,m]),j(m,n,[T,p]))}if(W.viewOnly)for(const m of $)j(m,n,[T,void 0])},i=>{j(this,n,i),i[1]&&i[1]!==this&&j(i[1],n,[me.rev,this])})}print(){return super.print({pre:`<${this.closing?"/":""}${f(this,s)}`,post:`${f(this,t)?"/":""}>`})}json(i,o=this.getAbsoluteIndex()){const l=super.json(void 0,o);return Object.assign(l,{closing:this.closing,selfClosing:f(this,t)}),l}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n=new WeakMap,a),$r=oe(na),Ut=de($r,0,"HtmlToken",ra,Ut),le($r,1,Ut)}}),No={};ie(No,{parseHtml:()=>Fo});var ia,Fo,ad=C({"parser/html.ts"(){"use strict";yn(),id(),ia=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,Fo=(e,t,s)=>{var i;const{html:n}=t;(i=t.htmlElements)!=null||(t.htmlElements=new Set([...n[0],...n[1],...n[2]]));const a=e.split("<");let r=a.shift();for(const o of a){const l=ia.exec(o),d=l==null?void 0:l[2],h=d==null?void 0:d.toLowerCase();if(!l||!t.htmlElements.has(h)){r+=`<${o}`;continue}const[,c,,x="",g,u]=l,{length:y}=s,k=new Is(x,"html-attrs",h,t,s),$=k.hasAttr("itemprop");if(h==="meta"&&!($&&k.hasAttr("content"))||h==="link"&&!($&&k.hasAttr("href"))){r+=`<${o}`,s.length=y;continue}r+=`\0${s.length}x${u}`,new Ut(d,k,c==="/",g==="/>",t,s)}return r}}}),In,Lo=C({"src/table/base.ts"(){"use strict";mn(),V(),vt(),yn(),In=class extends Ts(1)(z){constructor(e,t,s,n,a,r=[],i){super(void 0,a,r,i),this.append(new Xe(t,"table-syntax",a,r),new Is(n,"table-attrs",s,a,r))}}}}),aa,kr,Ce,gs,It,Ct,As,jo=C({"src/table/td.ts"(){"use strict";X(),ue(),Ma(),V(),Lo(),As=class extends(kr=In,aa=[fn(!1)],kr){constructor(e,t,s,n=[]){var o;let a=/\||\0\d+!\x7F/u.exec(t!=null?t:""),r=a?t.slice(0,a.index):"";/\[\[|-\{/u.test(r)&&(a=null,r=""),super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",r,s,n),le(gs,5,this),Fe(this,It),Fe(this,Ce,""),a&&([Pl(this,Ce)._]=a);const i=new z(t==null?void 0:t.slice(((o=a==null?void 0:a.index)!=null?o:NaN)+ge(this,Ce).length),s,n);i.type="td-inner",i.setAttribute("stage",4),this.insertAt(i)}get type(){return"td"}get rowspan(){return this.getAttr("rowspan")}get colspan(){return this.getAttr("colspan")}get subtype(){return dt(this,It,Ct).call(this).subtype}afterBuild(){ge(this,Ce).includes("\0")&&ke(this,Ce,this.buildFromStr(ge(this,Ce),0)),super.afterBuild()}toString(e){const{childNodes:[t,s,n]}=this;return t.toString(e)+s.toString(e)+ge(this,Ce)+n.toString(e)}text(){const{childNodes:[e,t,s]}=this;return e.text()+t.text()+ge(this,Ce)+s.text()}getGaps(e){return e===1?ge(this,Ce).length:0}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),n=new he(this,e+this.getRelativeIndex(this.length-1));for(const a of this.lastChild.childNodes)if(a.type==="text"){const{data:r}=a;if(r.includes("|")){const i=r.includes("||"),o=Q(a,n,"pipe-like",'additional "|" in a table cell',i?"error":"warning");if(i){const l={caption:"|+",td:"|",th:"!"}[this.subtype];o.fix={desc:"newline",range:[o.startIndex,o.endIndex],text:r.replace(/\|\|/gu,`
|
|
14
|
+
${l}`)}}else o.suggestions=[{desc:"escape",range:[o.startIndex,o.endIndex],text:r.replace(/\|/gu,"|")}];s.push(o)}}return s}isIndependent(){return this.firstChild.text().startsWith(`
|
|
15
|
+
`)}getAttr(e){const t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}print(){const{childNodes:[e,t,s]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${ge(this,Ce)}${s.print()}</span>`}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t),{rowspan:n,colspan:a}=this;return Object.assign(s,{subtype:this.subtype},n!==1&&{rowspan:n},a!==1&&{colspan:a}),s}},gs=oe(kr),Ce=new WeakMap,It=new WeakSet,Ct=function(){var e;const t=this.firstChild.text(),s=t.slice(-1);let n="td";if(s==="!"?n="th":s==="+"&&(n="caption"),this.isIndependent())return{subtype:n};const{previousSibling:a}=this,r={...dt(e=a,It,Ct).call(e)};return r},Ct=de(gs,17,"#getSyntax",aa,It,Ct),cn(gs,As)}}),Cn,Ro=C({"src/table/trBase.ts"(){"use strict";X(),Lo(),jo(),Cn=class extends In{lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),n=this.childNodes.find(({type:i})=>i==="table-inter");if(!n)return s;const a=Dt(n);if(!a)return s;const r=Q(n,{start:e},"fostered-content","content to be moved out from the table",a);return r.startIndex++,r.startLine++,r.startCol=0,s.push(r),s}getRowCount(){return Number(this.childNodes.some(e=>e instanceof As&&e.isIndependent()&&!e.firstChild.text().endsWith("+")))}}}}),oa,la,da,Po,od=C({"src/table/index.ts"(){"use strict";X(),be(),ue(),J(),Ro(),vt(),oa=(e,t)=>new Array(e).fill(void 0).map((s,n)=>t(n)),la=({type:e})=>e==="tr"||e==="table-syntax",da=class extends Array{},Po=class extends Cn{get type(){return"table"}get closed(){return this.lastChild.is("table-syntax")}constructor(e,t,s,n){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,"table",t,s,n,{})}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),n=new he(this,e);this.closed||s.push(Q(this.firstChild,n,"unclosed-table",W.msg("unclosed $1","table")));const a=this.getLayout(),{length:r}=a;if(r>1){let i=1,o=1/0,l=0;for(;l<r;l++){const d=a[l],h=d.length;if(h<i)break;h<o&&(o=h);const c=d.indexOf(d[h-1])+1;if(c>o)break;c>i&&(i=c)}if(l<r){const d=Q(this.getNthRow(l),n,"table-layout","inconsistent table layout","warning");d.startIndex++,d.startLine++,d.startCol=0,s.push(d)}}return s}close(e=`
|
|
16
|
+
|}`,t){const s=this.getAttribute("config"),n=this.getAttribute("accum"),a=[e];me.run(()=>{const r=new Xe(void 0,"table-syntax",s,n);super.insertAt(r)}),this.lastChild.safeReplaceChildren(a)}getLayout(e){const t=this.getAllRows(),{length:s}=t,n=da.from(oa(s,()=>[]));for(let a=0;a<n.length;a++){const r=n[a];let i=0,o=0,l;for(const d of t[a].childNodes.slice(2))if(d.is("td")){if(d.isIndependent()&&(l=d.subtype!=="caption"),l){const h={row:a,column:i},{rowspan:c,colspan:x}=d;for(i++;r[o];)o++;for(let g=a;g<Math.min(a+c,s);g++)for(let u=o;u<o+x;u++)n[g][u]=h;o+=x}}else if(la(d))break}return n}getAllRows(){return[...super.getRowCount()?[this]:[],...this.childNodes.slice(1).filter(e=>e.is("tr")&&e.getRowCount()>0)]}getNthRow(e,t,s){const n=super.getRowCount();if(e===0&&n)return this;n&&e--;for(const a of this.childNodes.slice(2)){const{type:r}=a;if(r==="tr"&&a.getRowCount()&&(e--,e<0))return a}}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t);return s.closed=this.closed,s}}}}),Eo,ld=C({"src/table/tr.ts"(){"use strict";Ro(),Eo=class extends Cn{get type(){return"tr"}constructor(e,t,s,n){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,e,"tr",t,s,n)}}}}),Nn,Oo=C({"src/nowiki/listBase.ts"(){"use strict";Ke(),Nn=class extends Be{get indent(){return this.innerText.split(":").length-1}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t),{indent:n}=this;return n&&(s.indent=n),s}}}}),Fn,qo=C({"src/nowiki/dd.ts"(){"use strict";Oo(),Fn=class extends Nn{get type(){return"dd"}}}}),Bo={};ie(Bo,{parseTable:()=>Wo});var ha,_r,Wo,dd=C({"parser/table.ts"(){"use strict";V(),od(),ld(),jo(),qo(),ha=e=>e.lastChild.constructor!==z,_r=(e,t)=>e.is("td")?t.pop():e,Wo=({firstChild:{data:e},type:t,name:s},n,a)=>{const r=[],i=e.split(`
|
|
17
|
+
`);let o=t==="root"||t==="parameter-value"||t==="ext-inner"&&s==="poem"?"":`
|
|
18
|
+
${i.shift()}`,l;const d=(h,c)=>{if(!c){o+=h;return}const{lastChild:x}=c;if(ha(c)){const g=new z(h,n,a);g.type="table-inter",g.setAttribute("stage",3),c.insertAt(g)}else x.setText(x.toString()+h)};for(const h of i){l=r.pop();const[c]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(h),x=h.slice(c.length),g=/^(:*)((?:\s|\0\d+[cn]\x7F)*)(\{\||\{(?:\0\d+[cn]\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(x);if(g){for(;l&&!l.is("td");)l=r.pop();const[,m,p,b,w]=g;m&&new Fn(m,n,a),d(`
|
|
19
|
+
${c}${m&&`\0${a.length-1}d`}${p}\0${a.length}b`,l),r.push(...l?[l]:[],new Po(b,w,n,a));continue}else if(!l){o+=`
|
|
20
|
+
${h}`;continue}const u=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(x);if(!u){d(`
|
|
21
|
+
${h}`,l),r.push(l);continue}const[,y,k,$,T]=u;if(y){for(;!l.is("table");)l=r.pop();l.close(`
|
|
22
|
+
${c}${y}`,!0),d(T,r[r.length-1])}else if(k){l=_r(l,r),l.is("tr")&&(l=r.pop());const m=new Eo(`
|
|
23
|
+
${c}${k}`,T,n,a);r.push(l,m),l.insertAt(m)}else{l=_r(l,r);const m=$==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu;let p=m.exec(T),b=0,w=`
|
|
24
|
+
${c}${$}`;const v=A=>{const S=new As(w,T.slice(b,p==null?void 0:p.index),n,a);return A.insertAt(S),S};for(;p;)v(l),{lastIndex:b}=m,[w]=p,p=m.exec(T);r.push(l,v(l))}}return o.slice(1)}}}),Uo,hd=C({"src/nowiki/hr.ts"(){"use strict";Ke(),Uo=class extends Be{get type(){return"hr"}}}}),ca,Tr,ua,Mt,cd=C({"src/nowiki/doubleUnderscore.ts"(){"use strict";mt(),Oe(),Ke(),ca=[Je(),je("__")],Mt=class extends(ua=Be){get type(){return"double-underscore"}constructor(e,t,s,n){var o,l;super(e,s,n);const a=e.toLowerCase(),{doubleUnderscore:[,,r,i]}=s;this.setAttribute("name",(l=t?(o=i==null?void 0:i[e])==null?void 0:o.toLowerCase():r==null?void 0:r[a])!=null?l:a)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}},Tr=oe(ua),Mt=de(Tr,0,"DoubleUnderscoreToken",ca,Mt),le(Tr,1,Mt)}}),Mo={};ie(Mo,{parseHrAndDoubleUnderscore:()=>zo});var zo,ud=C({"parser/hrAndDoubleUnderscore.ts"(){"use strict";hd(),cd(),ro(),zo=({firstChild:{data:e},type:t,name:s},n,a)=>{var l,d,h;const{doubleUnderscore:[r,i,o]}=n;return(l=n.insensitiveDoubleUnderscore)!=null||(n.insensitiveDoubleUnderscore=new Set(r)),(d=n.sensitiveDoubleUnderscore)!=null||(n.sensitiveDoubleUnderscore=new Set(i)),(h=n.regexHrAndDoubleUnderscore)!=null||(n.regexHrAndDoubleUnderscore=new RegExp(`__(${[...r,...i].join("|")})__`,"giu")),t!=="root"&&(t!=="ext-inner"||s!=="poem")&&(e=`\0${e}`),e=e.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(c,x,g)=>(new Uo(g,n,a),`${x}\0${a.length-1}r`)).replace(n.regexHrAndDoubleUnderscore,(c,x)=>{var k;const g=n.sensitiveDoubleUnderscore.has(x),u=x.toLowerCase(),y=n.insensitiveDoubleUnderscore.has(u);return g||y?(new Mt(x,g,n,a),`\0${a.length-1}${y&&((k=o==null?void 0:o[u])!=null?k:u)==="toc"?"u":"n"}`):c}).replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(c,x,g,u,y)=>{const k=`${x}\0${a.length}h`;return new An(g.length,[u,y],n,a),k}),t==="root"||t==="ext-inner"&&s==="poem"?e:e.slice(1)}}}),Ho,gd=C({"src/nowiki/quote.ts"(){"use strict";var e,t;X(),ue(),J(),Ke(),Ho=(t=class extends Be{constructor(n,a,r,i){super(n,r,i);q(this,e);j(this,e,a)}get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}get closing(){return{...this.bold?{bold:f(this,e).bold}:void 0,...this.italic?{italic:f(this,e).italic}:void 0}}text(){const{parentNode:n,innerText:a}=this;return n!=null&&n.is("image-parameter")&&n.name!=="caption"?"":a}lint(n=this.getAbsoluteIndex()){const{previousSibling:a,nextSibling:r,bold:i,closing:o}=this,l=(a==null?void 0:a.type)==="text"?a.data:void 0,d=(r==null?void 0:r.type)==="text"?r.data:void 0,h=W.msg('lonely "$1"',"'"),c=[],x=new he(this,n),g=(u,y,k)=>[{desc:"escape",range:[u,y],text:"'".repeat(k)},{desc:"remove",range:[u,y],text:""}];if(l!=null&&l.endsWith("'")){const u=Z(this,x,"lonely-apos",h,(o.bold||o.italic)&&(/[a-z\d]'$/iu.test(l)||d&&/^[a-z\d]/iu.test(d))?"warning":"error"),{startIndex:y,startLine:k,startCol:$}=u,[,{length:T}]=/(?:^|[^'])('+)$/u.exec(l),m=n-T;c.push({...u,startIndex:m,endIndex:y,endLine:k,startCol:$-T,endCol:$,suggestions:g(m,y,T)})}if(d!=null&&d.startsWith("'")){const u=Z(this,x,"lonely-apos",h),{endIndex:y,endLine:k,endCol:$}=u,[{length:T}]=/^'+/u.exec(d),m=y+T;c.push({...u,startIndex:y,endIndex:m,startLine:k,startCol:$,endCol:$+T,suggestions:g(y,m,T)})}if(i&&this.closest("heading-title")){const u=Z(this,x,"bold-header","bold in section header","warning");u.suggestions=[{desc:"remove",range:[n,n+3],text:""}],c.push(u)}return c}json(n,a=this.getAbsoluteIndex()){const r=super.json(void 0,a);return Object.assign(r,{bold:this.bold,italic:this.italic}),r}},e=new WeakMap,t)}}),Go={};ie(Go,{parseQuotes:()=>Ln});var Ln,Do=C({"parser/quotes.ts"(){"use strict";gd(),Ln=(e,t,s,n)=>{var g;const a=e.split(/('{2,})/u),{length:r}=a;if(r===1)return e;let i=0,o=0,l,d,h;for(let u=1;u<r;u+=2){const y=a[u].length;switch(y){case 2:o++;break;case 4:a[u-1]+="'",a[u]="'''";case 3:if(i++,l!==void 0)break;a[u-1].endsWith(" ")?d===void 0&&h===void 0&&(h=u):a[u-1].slice(-2,-1)===" "?l=u:d!=null||(d=u);break;default:a[u-1]+="'".repeat(y-5),a[u]="'''''",o++,i++}}if(o%2===1&&i%2===1){const u=(g=l!=null?l:d)!=null?g:h;u!==void 0&&(a[u]="''",a[u-1]+="'")}let c=!0,x=!0;for(let u=1;u<r;u+=2){const y=a[u].length,k=y!==2,$=y!==3;k&&(c=!c),$&&(x=!x),new Ho(a[u],{bold:k&&c,italic:$&&x},t,s),a[u]=`\0${s.length-1}q`}return a.join("")}}}),Vo={};ie(Vo,{parseExternalLinks:()=>jn});var jn,Qo=C({"parser/externalLinks.ts"(){"use strict";ce(),yo(),Tn(),jn=(e,t,s,n)=>{var a;return(a=t.regexExternalLinks)!=null||(t.regexExternalLinks=new RegExp(String.raw`\[(\0\d+f\x7F|(?:(?:${t.protocol}|//)${ht}|\0\d+m\x7F)${ct}(?=[[\]<>"\t${Ee}]|\0\d))([${Ee}]*(?![${Ee}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),e.replace(t.regexExternalLinks,(r,i,o,l)=>{const{length:d}=s,h=/&[lg]t;/u.exec(i);return h&&(o="",l=i.slice(h.index)+o+l,i=i.slice(0,h.index)),n?(new es(i,"ext-link-url",t,s),`[\0${d}f${o}${l}]`):(new at(i,o,l,t,s),`\0${d}w`)})}}}),Jo,pd=C({"src/link/category.ts"(){"use strict";ce(),ks(),Jo=class extends Pe{get type(){return"category"}get sortkey(){const{childNodes:[,e]}=this;return e&&Kt(e.text())}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t),{sortkey:n}=this;return n&&(s.sortkey=n),s}}}}),Xo={};ie(Xo,{parseLinks:()=>rn});var ga,rn,fd=C({"parser/links.ts"(){"use strict";J(),Do(),Qo(),wo(),xo(),pd(),ga=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,rn=(e,t,s,n)=>{var o;(o=t.regexLinks)!=null||(t.regexLinks=new RegExp(String.raw`^\s*(?:${t.protocol}|//)`,"iu"));const a=t.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]]))?\]\]([\s\S]*)$/u:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]])?)?\]\]([\s\S]*)$/u,r=e.split("[[");let i=r.shift();for(let l=0;l<r.length;l++){let d=!1,h,c,x,g;const u=r[l],y=a.exec(u);if(y)[,h,c,x,g]=y,g.startsWith("]")&&(x!=null&&x.includes("["))&&(x+="]",g=g.slice(1));else{const p=ga.exec(u);p&&(d=!0,[,h,c,x]=p)}if(h===void 0||t.regexLinks.test(h)||/\0\d+[exhbru]\x7F/u.test(h)){i+=`[[${u}`;continue}const k=h.trim().startsWith(":");if(k&&d){i+=`[[${u}`;continue}const{ns:$,valid:T}=W.normalizeTitle(h,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0});if(T){if(d){if($!==6){i+=`[[${u}`;continue}let p=!1;for(l++;l<r.length;l++){const b=r[l],w=b.split("]]");if(w.length>2){p=!0,x+=`[[${w[0]}]]${w[1]}`,g=w.slice(2).join("]]");break}else if(w.length===2)x+=`[[${w[0]}]]${w[1]}`;else{x+=`[[${b}`;break}}if(x=rn(x,t,s,n),!p){i+=`[[${h}${c}${x}`;continue}}}else{i+=`[[${u}`;continue}x&&(x=Ln(x,t,s,n));let m=_n;k||($===6?(x&&(x=jn(x,t,s,!0)),m=kn):$===14&&(m=Jo)),x===void 0&&c&&(x=""),i+=`\0${s.length}l${g}`,new m(h,x,t,s,c)}return i}}}),Ko={};ie(Ko,{parseMagicLinks:()=>Yo});var Ir,Cr,Nr,Fr,Yo,xd=C({"parser/magicLinks.ts"(){"use strict";ce(),Tn(),Ir=String.raw`[${Ee}\t]| |�*160;|�*a0;`,Cr=`(?:${Ir})+`,Nr=`(?:${Ir}|-)`,Fr=String.raw`(?:RFC|PMID)${Cr}\d+\b|ISBN${Cr}(?:97[89]${Nr}?)?(?:\d${Nr}?){9}[\dx]\b`,Yo=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${ht}${ct})|${Fr})`,"giu")}catch{t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${ht}${ct})|${Fr})`,"giu")}return e.replace(t.regexMagicLinks,(n,a,r)=>{let i=a?n.slice(a.length):n;if(r){let o="";const l=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(i);l&&(o=i.slice(l.index),i=i.slice(0,l.index));const d=i.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,h=d.exec(i);if(h){let c=1;h[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(i.slice(0,h.index))&&(c=2),o=i.slice(h.index+c)+o,i=i.slice(0,h.index+c)}return o.length>=r.length?n:(new es(i,void 0,t,s),`${a}\0${s.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(i))return n;return new es(i,"magic-link",t,s),`${a}\0${s.length-1}i`})}}}),Zo,md=C({"util/html.ts"(){"use strict";Zo=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,n)=>s!==e[n])}}),el,vd=C({"src/nowiki/list.ts"(){"use strict";Oo(),el=class extends Nn{get type(){return"list"}}}}),tl={};ie(tl,{parseList:()=>sl});var sl,bd=C({"parser/list.ts"(){"use strict";md(),vd(),qo(),sl=(e,t,s,n)=>{const a=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!a)return t.lastPrefix="",e;const[r,i,o,l]=a,d=o.replace(/;/gu,":"),h=Zo(d,t.lastPrefix),c=((h>1?o.slice(h-1):o)+l).split(/(?=;)/u),x=c[0].startsWith(";");let g=c.length-(x?0:1);if(h>1){const _=o.slice(0,h-1);if(x){const E=_.split(/(?=;)/u);c.unshift(...E),g+=_.includes(";")?E.length:0}else c[0]=_+c[0]}t.lastPrefix=d;let u=i+c.map((_,E)=>`\0${n.length+E}d`).join("")+e.slice(r.length);for(const _ of c)new el(_,s,n);if(!g)return u;const{html:[y,,k]}=s,$=/:+|-\{|\0\d+[xq]\x7F/gu;let T=$,m=T.exec(u),p=0,b=!1,w=!1,v=0;const A=(_,E)=>(new Fn(_,s,n),`${u.slice(0,E)}\0${n.length-1}d${u.slice(E+_.length)}`),S=_=>{_?p&&p--:p++};for(;m&&g;){const{0:_,index:E}=m;if(_==="-{"){if(!v){const{lastIndex:F}=T;T=/-\{|\}-/gu,T.lastIndex=F}v++}else if(_==="}-"){if(v--,!v){const{lastIndex:F}=T;T=$,T.lastIndex=F}}else if(_.endsWith("x")){const{name:F,closing:N,selfClosing:O}=n[Number(_.slice(1,-2))];(y.includes(F)||!O&&!k.includes(F))&&S(N)}else if(_.endsWith("q")){const{bold:F,italic:N}=n[Number(_.slice(1,-2))];F&&(S(b),b=!b),N&&(S(w),w=!w)}else if(p===0){if(_.length>=g)return A(_.slice(0,g),E);g-=_.length,T.lastIndex=E+4+String(n.length).length,u=A(_,E)}m=T.exec(u)}return u}}}),ps,pa,Lr,fa,zt,wd=C({"src/converterFlags.ts"(){"use strict";var e,t;X(),ue(),_s(),J(),V(),qe(),ps=new Set(["A","T","R","D","-","H","N"]),pa=[ts()],zt=(t=class extends(fa=z){constructor(n,a,r=[]){super(void 0,a,r,{});q(this,e);this.safeAppend(n.map(i=>new ve(i,"converter-flag",a,r)))}get type(){return"converter-flags"}afterBuild(){j(this,e,this.childNodes.map(n=>n.text().trim())),super.afterBuild()}toString(n){return super.toString(n,";")}text(){return super.text(";")}getUnknownFlags(){return new Set(f(this,e).filter(n=>/\{{3}[^{}]+\}{3}/u.test(n)))}getVariantFlags(){const n=new Set(this.getAttribute("config").variants);return new Set(f(this,e).filter(a=>n.has(a)))}isInvalidFlag(n,a,r,i){return typeof n=="object"&&(n=n.text().trim(),a=this.getVariantFlags(),r=this.getUnknownFlags(),i=new Set(f(this,e).filter(o=>ps.has(o)))),!!n&&!a.has(n)&&!r.has(n)&&(a.size>0||!i.has(n))}lint(n=this.getAbsoluteIndex(),a){const r=this.getVariantFlags(),i=this.getUnknownFlags(),o=new Set(f(this,e).filter(g=>ps.has(g))),l=f(this,e).filter(g=>!g).length,d=f(this,e).length-i.size-l,h=super.lint(n,a);if(r.size===d||o.size===d)return h;const c="no-ignored",x=W.lintConfig.getSeverity(c,"conversionFlag");if(x){const g=new he(this,n);for(let u=0;u<this.length;u++){const y=this.childNodes[u],k=y.text().trim();if(this.isInvalidFlag(k,r,i,o)){const $=Q(y,g,c,"invalid conversion flag",x);r.size===0&&ps.has(k.toUpperCase())?$.fix={desc:"uppercase",range:[$.startIndex,$.endIndex],text:k.toUpperCase()}:$.suggestions=[{desc:"remove",range:[$.startIndex-(u&&1),$.endIndex],text:""}],h.push($)}}}return h}print(){return super.print({sep:";"})}},e=new WeakMap,t),Lr=oe(fa),zt=de(Lr,0,"ConverterFlagsToken",pa,zt),le(Lr,1,zt)}}),ys,yd=C({"src/converterRule.ts"(){"use strict";J(),V(),qe(),ys=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())!=null?t:""}constructor(e,t=!0,s=W.getConfig(),n=[]){super(void 0,s,n);const a=e.indexOf(":"),r=e.slice(0,a).indexOf("=>"),i=r===-1?e.slice(0,a):e.slice(r+2,a);t&&s.variants.includes(i.trim())?(super.insertAt(new ve(i,"converter-rule-variant",s,n)),super.insertAt(new ve(e.slice(a+1),"converter-rule-to",s,n)),r!==-1&&super.insertAt(new ve(e.slice(0,r),"converter-rule-from",s,n),0)):super.insertAt(new ve(e,"converter-rule-to",s,n))}toString(e){const{childNodes:t,firstChild:s,lastChild:n}=this;return t.length===3?`${s.toString(e)}=>${t[1].toString(e)}:${n.toString(e)}`:super.toString(e,":")}text(){const{childNodes:e,firstChild:t,lastChild:s}=this;return e.length===3?`${t.text()}=>${e[1].text()}:${s.text()}`:super.text(":")}getGaps(e){return e===0&&this.length===3?2:1}print(){const{childNodes:e}=this;if(e.length===3){const[t,s,n]=e;return`<span class="wpb-converter-rule">${t.print()}=>${s.print()}:${n.print()}</span>`}return super.print({sep:":"})}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t);return s.variant=this.variant,s}}}}),xa,jr,ma,Ht,Sd=C({"src/converter.ts"(){"use strict";ce(),Oe(),V(),wd(),yd(),xa=[je("-{")],Ht=class extends(ma=z){get type(){return"converter"}constructor(e,t,s,n=[]){super(void 0,s,n),this.insertAt(new zt(e,s,n));const[a]=t,r=a.includes(":"),i=new ys(a,r,s,n);r&&i.length===1||!r&&t.length===2&&!_e(t[1]).trim()?this.insertAt(new ys(t.join(";"),!1,s,n)):this.append(i,...t.slice(1).map(o=>new ys(o,!0,s,n)))}toString(e){const{childNodes:[t,...s]}=this;return`-{${t.toString(e)}${t.length>0?"|":""}${s.map(n=>n.toString(e)).join(";")}}-`}text(){const{childNodes:[e,...t]}=this;return`-{${e.text()}|${Ve(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?"|":""}${gt(t,{sep:";"})}}-</span>`}},jr=oe(ma),Ht=de(jr,0,"ConverterToken",xa,Ht),le(jr,1,Ht)}}),rl={};ie(rl,{parseConverter:()=>nl});var nl,Ad=C({"parser/converter.ts"(){"use strict";Sd(),nl=(e,t,s)=>{var l;(l=t.regexConverter)!=null||(t.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${t.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"u"));const n=/-\{/gu,a=/-\{|\}-/gu,r=[];let i=n,o=i.exec(e);for(;o;){const{0:d,index:h}=o;if(d==="}-"){const c=r.pop(),{length:x}=s,g=e.slice(c.index+2,h),u=g.indexOf("|"),[y,k]=u===-1?[[],g]:[g.slice(0,u).split(";"),g.slice(u+1)],$=k.replace(/(&[#a-z\d]+);/giu,"$1"),T=$.split(t.regexConverter).map(m=>m.replace(/\x01/gu,";"));new Ht(y,T,t,s),e=`${e.slice(0,c.index)}\0${x}v${e.slice(h+2)}`,r.length===0&&(i=n),i.lastIndex=c.index+3+String(x).length}else r.push(o),i=a,i.lastIndex=h+2;o=i.exec(e)}return e}}}),Qt={};ie(Qt,{Token:()=>z});var va,z,V=C({"src/index.ts"(){"use strict";var e,t,s,n,a,r,i,o,il,al,ol,ll,dl,hl,cl,ul,gl,pl,fl,xl,p;ce(),Qe(),X(),be(),J(),ql(),Bl(),va=["category","html-attr#id,ext-attr#id,table-attr#id"],z=(p=class extends Ha{constructor(v,A=W.getConfig(),S=[],_){super();q(this,o);q(this,e,"plain");q(this,t,0);q(this,s);q(this,n);q(this,a);q(this,r,!1);q(this,i);typeof v=="string"&&this.insertAt(v),j(this,s,A),j(this,n,S),S.push(this)}get type(){return f(this,e)}set type(v){j(this,e,v)}parseOnce(v=f(this,t),A=!1,S){if(v<f(this,t)||this.length===0||!this.isPlain())return this;if(f(this,t)>=we)return this;switch(v){case 0:if(this.type==="root"){f(this,n).pop();const _=P(this,o,il).call(this);A&&(A=!_)}j(this,a,A),P(this,o,al).call(this,A);break;case 1:P(this,o,ol).call(this);break;case 2:P(this,o,ll).call(this);break;case 3:P(this,o,dl).call(this);break;case 4:P(this,o,hl).call(this);break;case 5:P(this,o,cl).call(this,S);break;case 6:P(this,o,ul).call(this,S);break;case 7:P(this,o,gl).call(this);break;case 8:P(this,o,pl).call(this);break;case 9:P(this,o,fl).call(this);break;case 10:P(this,o,xl).call(this)}if(this.type==="root")for(const _ of f(this,n))_==null||_.parseOnce(v,A,S);return En(this,t)._++,this}buildFromStr(v,A){const S=v.split(/[\0\x7F]/u).map((_,E)=>{if(E%2===0)return new Jr(_);if(isNaN(_.slice(-1)))return f(this,n)[Number(_.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${_}`)});return A===0?S.map(String).join(""):A===1?Ve(S):S}build(){j(this,t,we);const{length:v,firstChild:A}=this,S=A==null?void 0:A.toString();if(v===1&&A.type==="text"&&S.includes("\0")&&($s(this,0,1,this.buildFromStr(S)),this.normalize(),this.type==="root"))for(const _ of f(this,n))_==null||_.build()}afterBuild(){if(this.type==="root")for(const v of f(this,n))v==null||v.afterBuild();j(this,r,!0)}parse(v=we,A,S){for(v=Math.min(v,we);f(this,t)<v;)this.parseOnce(f(this,t),A,S);return v&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===p}getAttribute(v){var A;switch(v){case"config":return f(this,s);case"include":return(A=f(this,a))!=null?A:!!f(this.getRootNode(),a);case"accum":return f(this,n);case"built":return f(this,r);case"stage":return f(this,t);case"invalid":return this.type==="table-inter"&&Dt(this)==="error";default:return super.getAttribute(v)}}setAttribute(v,A){switch(v){case"stage":f(this,t)===0&&this.type==="root"&&f(this,n).shift(),j(this,t,A);break;default:super.setAttribute(v,A)}}insertAt(v,A=this.length){const S=typeof v=="string"?new Jr(v):v;super.insertAt(S,A);const{type:_}=S;return _==="root"&&(S.type="plain"),S}normalizeTitle(v,A=0,S){return W.normalizeTitle(v,A,f(this,a),f(this,s),S)}inTableAttrs(){var v,A;return((v=this.closest("table-attrs,ext"))==null?void 0:v.type)==="table-attrs"&&((A=this.closest("table-attrs,arg,magic-word,template"))!=null&&A.is("table-attrs")?"error":"warning")}inHtmlAttrs(){var v;return(v=this.closest("html-attrs,ext"))!=null&&v.is("html-attrs")?"error":this.inTableAttrs()}lint(v=this.getAbsoluteIndex(),A){var _;let S=super.lint(v,A);if(this.type==="root"){const E=new Map,F="no-duplicate",N=["category","id"].map(B=>W.lintConfig.getSeverity(F,B)),O=va.filter((B,M)=>N[M]).join();if(O){for(const B of this.querySelectorAll(O)){let M;if(B.is("category"))M=B.name;else{const H=B.getValue();H&&H!==!0&&(M=`#${H}`)}if(M){const H=E.get(M);H?H.add(B):E.set(M,new Set([B]))}}for(const[B,M]of E)if(M.size>1&&!B.startsWith("#mw-customcollapsible-")){const H=!B.startsWith("#"),G=`duplicated ${H?"category":"id"}`,K=N[H?0:1];S.push(...[...M].map(se=>{const re=Z(se,{start:se.getAbsoluteIndex()},F,G,K);return H&&(re.suggestions=[{desc:"remove",range:[re.startIndex,re.endIndex],text:""}]),re}))}}const R=/<!--\s*lint-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->/gu,L=this.toString(),U=[];let I=R.exec(L);for(;I;){const{1:B,index:M}=I,H=(_=I[2])==null?void 0:_.trim();U.push({line:this.posFromIndex(M).top+(B==="disable-line"?0:1),from:B==="disable"?R.lastIndex:void 0,to:B==="enable"?R.lastIndex:void 0,rules:H?new Set(H.split(",").map(G=>G.trim())):void 0}),I=R.exec(L)}if(S=S.filter(({rule:B,startLine:M,startIndex:H})=>{const G={pos:0};for(const{line:K,from:se,to:re,rules:Ne}of U){if(K>M+1)break;if(Ne&&!Ne.has(B))continue;if(K===M&&se===void 0&&re===void 0)return!1;se<=H&&se>G.pos?(G.pos=se,G.type="from"):re<=H&&re>G.pos&&(G.pos=re,G.type="to")}return G.type!=="from"}),S.some(({fix:B})=>B)){const B=S.map(({fix:G})=>G).filter(Boolean).sort(({range:[G,K]},{range:[se,re]})=>K===re?se-G:re-K);let M=1/0,H=L;for(const{range:[G,K],text:se}of B)K<=M&&(H=H.slice(0,G)+se+H.slice(K),M=G);Object.assign(S,{output:H})}}return S}toString(v,A){return v?super.toString(!0,A):De(f(this,i),()=>super.toString(!1,A),S=>{const _=this.getRootNode();_.type==="root"&&f(_,r)&&j(this,i,S)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n=new WeakMap,a=new WeakMap,r=new WeakMap,i=new WeakMap,o=new WeakSet,il=function(){const{parseRedirect:v}=(Ml(),Y(Va)),A=this.firstChild.toString(),S=v(A,f(this,s),f(this,n));return S&&this.setText(S),!!S},al=function(v){const{parseCommentAndExt:A}=(Fs(),Y(Co));this.setText(A(this.firstChild.toString(),f(this,s),f(this,n),v))},ol=function(){const{parseBraces:v}=($n(),Y(oo)),A=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,S=v(A,f(this,s),f(this,n));this.setText(this.type==="root"?S:S.slice(1))},ll=function(){if(f(this,s).excludes.includes("html"))return;const{parseHtml:v}=(ad(),Y(No));this.setText(v(this.firstChild.toString(),f(this,s),f(this,n)))},dl=function(){if(f(this,s).excludes.includes("table"))return;const{parseTable:v}=(dd(),Y(Bo));this.setText(v(this,f(this,s),f(this,n)))},hl=function(){if(f(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:v}=(ud(),Y(Mo));this.setText(v(this,f(this,s),f(this,n)))},cl=function(v){const{parseLinks:A}=(fd(),Y(Xo));this.setText(A(this.firstChild.toString(),f(this,s),f(this,n),v))},ul=function(v){if(f(this,s).excludes.includes("quote"))return;const{parseQuotes:A}=(Do(),Y(Go)),S=this.firstChild.toString().split(`
|
|
25
|
+
`);for(let _=0;_<S.length;_++)S[_]=A(S[_],f(this,s),f(this,n),v);this.setText(S.join(`
|
|
26
|
+
`))},gl=function(){if(f(this,s).excludes.includes("extLink"))return;const{parseExternalLinks:v}=(Qo(),Y(Vo));this.setText(v(this.firstChild.toString(),f(this,s),f(this,n)))},pl=function(){if(f(this,s).excludes.includes("magicLink"))return;const{parseMagicLinks:v}=(xd(),Y(Ko));this.setText(v(this.firstChild.toString(),f(this,s),f(this,n)))},fl=function(){if(f(this,s).excludes.includes("list"))return;const{parseList:v}=(bd(),Y(tl)),{firstChild:A,type:S,name:_}=this,E=A.toString().split(`
|
|
27
|
+
`),F={lastPrefix:""};let N=S==="root"||S==="ext-inner"&&_==="poem"?0:1;for(;N<E.length;N++)E[N]=v(E[N],F,f(this,s),f(this,n));this.setText(E.join(`
|
|
28
|
+
`))},xl=function(){if(f(this,s).variants.length>0){const{parseConverter:v}=(Ad(),Y(rl));this.setText(v(this.firstChild.toString(),f(this,s),f(this,n)))}},p)}}),me,Ls,$s,bt,be=C({"util/debug.ts"(){"use strict";me={running:!1,run(e){const{running:t}=this;this.running=!0;try{const{Token:s}=(V(),Y(Qt)),n=e();return n instanceof s&&!n.getAttribute("built")&&n.afterBuild(),this.running=t,n}catch(s){throw this.running=t,s}},rev:0},Ls=e=>t=>t.type===e,$s=(e,t,s,n=[])=>{var i,o;let a=e.getChildNodes(),r;a.length===s?(r=a,a=n):r=a.splice(t,s,...n);for(let l=0;l<n.length;l++){const d=n[l];d.setAttribute("parentNode",e),d.setAttribute("nextSibling",a[t+l+1]),d.setAttribute("previousSibling",a[t+l-1])}return(i=a[t-1])==null||i.setAttribute("nextSibling",a[t]),(o=a[t+n.length])==null||o.setAttribute("previousSibling",a[t+n.length-1]),a===n&&e.setAttribute("childNodes",a),r},bt=(e,t)=>{Object.defineProperty(e,"name",{value:t.name})}}}),ba,Nt,Rr,Pr,wa,Er,ya,nn,$d=C({"lib/lintConfig.ts"(){"use strict";Oa(),ba=new Set([0,1,2]),Nt=new Map([[0,!1],[1,"warning"],[2,"error"]]),Rr={"format-leakage":[2,{}],h1:[1,{}],"invalid-gallery":[2,{}],"invalid-imagemap":[2,{}],"nested-link":[2,{}],"no-duplicate":[2,{id:1}],"no-ignored":[2,{include:1,redirect:1}],"unbalanced-header":2,"unclosed-comment":[1,{}],unescaped:2,"url-encoding":[1,{}],"var-anchor":[1,{}],"void-ext":[2,{}]},Object.freeze(Rr),Pr=e=>typeof e=="number"&&ba.has(e),wa=e=>Pr(e)||Array.isArray(e)&&e.length===2&&Pr(e[0])&&e[1]&&typeof e[1]=="object",Er=(e,t,s)=>{if(gn.includes(t)){if(wa(s))return e[t]=s,!0}else throw new RangeError(`Unknown lint rule: ${t}`);throw new RangeError(`Invalid lint config for ${t}: ${JSON.stringify(s)}`)},ya=class{constructor(e){if(Object.assign(this,JSON.parse(JSON.stringify(Rr))),!!e)for(const[t,s]of Object.entries(e))Er(this,t,s)}getSeverity(e,t){var n;const s=this[e];return typeof s=="number"?Nt.get(s):t&&(n=Nt.get(s[1][t]))!=null?n:Nt.get(s[0])}},nn=e=>new Proxy(new ya(e),{set:Er})}}),ml={};ie(ml,{Title:()=>vl});var vl,kd=C({"lib/title.ts"(){"use strict";var e,t,s,n,a,r;ce(),vl=(r=class{constructor(i,o,l,{temporary:d,decode:h,selfLink:c}={}){q(this,e);q(this,t);q(this,s);q(this,n);q(this,a);Ae(this,"valid");Ae(this,"encoded",!1);const x=i.trim().startsWith("../");if(h&&i.includes("%"))try{const u=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(i);i=Jt(i),this.encoded=u}catch{}if(i=Kt(i).replace(/[_ ]+/gu," ").trim(),x)j(this,n,0);else{let u=o;i.startsWith(":")&&(u=0,i=i.slice(1).trim());const y=i.split(":");if(y.length>1){const k=ut(y[0]),$=Object.prototype.hasOwnProperty.call(l.nsid,k)&&l.nsid[k];$&&(u=$,i=y.slice(1).join(":").trim())}j(this,n,u)}const g=i.indexOf("#");if(g!==-1){let u=i.slice(g).trim().slice(1);if(u.includes("%"))try{u=Jt(u)}catch{}j(this,a,u.replace(/ /gu,"_")),i=i.slice(0,g).trim()}this.valid=!!(i||c&&this.ns===0&&f(this,a)!==void 0)&&Kt(i)===i&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(x?/^(?:\.\.\/)+(.*)/u.exec(i)[1]:i),this.main=i,j(this,t,l.namespaces),j(this,s,l.articlePath||"/wiki/$1"),f(this,s).includes("$1")||j(this,s,f(this,s)+`${f(this,s).endsWith("/")?"":"/"}$1`),d||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return f(this,n)}get fragment(){return f(this,a)}get main(){return f(this,e)}set main(i){i=i.replace(/_/gu," ").trim(),j(this,e,i&&i[0].toUpperCase()+i.slice(1))}get prefix(){const i=f(this,t)[this.ns];return i+(i&&":")}get title(){return this.getRedirection()[1]}get extension(){const{main:i}=this,o=i.lastIndexOf(".");return o===-1?void 0:i.slice(o+1).toLowerCase()}getRedirection(){return[!1,(this.prefix+this.main).replace(/ /gu,"_")]}setFragment(i){j(this,a,i)}getUrl(i){{typeof i=="string"&&(j(this,s,i),f(this,s).includes("$1")||j(this,s,f(this,s)+`${f(this,s).endsWith("/")?"":"/"}$1`));const{title:o,fragment:l}=this;return o?f(this,s).replace("$1",encodeURIComponent(o)+(l?`#${encodeURIComponent(l)}`:"")):l===void 0?"":`#${encodeURIComponent(l)}`}throw new Error("Title.getUrl method is only available in the LSP version!")}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n=new WeakMap,a=new WeakMap,r)}}),bl={};ie(bl,{LanguageService:()=>wl,isAttr:()=>Ss,tasks:()=>an});var an,Sa,Aa,$a,ka,Or,_a,Ta,Ia,Ca,Ss,Na,qr,Ze,Br,Me,xe,Wr,Ur,et,tt,ze,Ft,Mr,wl,_d=C({"lib/lsp.ts"(){"use strict";var e,t,s,n,a,r,i,o,l,d,Gt,$e,on,yl,ln,Sl,dn,st,T;xt(),Ya(),X(),ce(),J(),an=new WeakMap,Sa=new Set(["ref"]),Aa=new Set(["ref","references"]),$a=new Set(["name","extends","follow"]),ka=new Set(["group"]),Or=new Set(["arg-name","template-name","link-target","parameter-key"]),_a=new Set(["ext","html","attr-key","image-parameter","heading-title","heading","magic-word-name",...Or]),Ta=new Set(["text","comment","noinclude","include"]),Ia=["ext","html","table"].map(m=>`${m}-attr#style`).join(),Ca=Ge(m=>new RegExp(`^(?:${m}|//)`,"iu")),Ss=({type:m,parentNode:p,length:b,firstChild:w},v)=>m==="attr-value"&&b===1&&w.type==="text"&&(!v||p.name==="style"),Na=m=>m.is("html-attr")||m.is("table-attr"),qr=m=>m.childNodes.every(({type:p})=>Ta.has(p)),Ze=(m,p)=>{const{top:b,left:w}=m.posFromIndex(p);return{line:b,character:w}},Br=(m,p,b)=>({start:Ze(m,p),end:Ze(m,b)}),Me=m=>{const{top:p,left:b,height:w,width:v}=m.getBoundingClientRect();return{start:{line:p,character:b},end:Zt(p,b,w,v)}},xe=(m,p,b,{line:w,character:v},A,S)=>[...new Set(m)].map(_=>{var F;const E=(F=S==null?void 0:S(_))==null?void 0:F.description;return{label:_,kind:p,textEdit:{range:{start:{line:w,character:v-b.length},end:{line:w,character:v}},newText:_+(A!=null?A:"")},...E&&{documentation:{kind:"markdown",value:E}}}}),Wr=(m,p,{line:b,character:w})=>{const v=m.indexFromPos(b,w);return m.caretPositionFromIndex(v+Number(/\w/u.test(p.charAt(v))))},Ur=(m,p,b)=>{const{type:w,parentNode:v={}}=m,{name:A,tag:S}=v;return w==="attr-value"&&p.has(S)&&b.has(A)?m.toString().trim():NaN},et=m=>Ur(m,Sa,$a),tt=m=>Ur(m,Aa,ka),ze=(m,p)=>{const b=m==null?void 0:m.getAttr(p);return b!==!0&&b||!1},Ft=m=>{const{type:p,name:b,parentNode:w}=m;switch(p){case"heading":return m.level;case"heading-title":return w.level;case"parameter-key":return`${w.parentNode.name}|${w.name}`;case"ext":case"html":case"image-parameter":return b;default:return w.name}},Mr=(m,p,b=!1)=>({range:Br(m,...p.range),newText:p.text,title:`${b?"Fix":"Suggestion"}: ${p.desc}`,fix:b}),wl=(T=class{constructor(m){q(this,d);q(this,e);q(this,t);q(this,s);q(this,n);q(this,a);q(this,r);q(this,i);q(this,o);q(this,l);Ae(this,"include",!0);Ae(this,"config");Ae(this,"data");an.set(m,this),Object.defineProperties(this,{config:{enumerable:!1},data:{enumerable:!1}})}destroy(){Object.setPrototypeOf(this,null)}async provideDocumentColors(m,p,b=!0){const w=await P(this,d,$e).call(this,p);return w.querySelectorAll("attr-value,parameter-value,arg-default").reverse().flatMap(v=>{const{type:A,childNodes:S}=v;return A!=="attr-value"&&!qr(v)?[]:S.filter(_=>_.type==="text").reverse().flatMap(_=>{const{data:E}=_,F=Ba(E,b).filter(([,,,O])=>O);if(F.length===0)return[];const N=_.getAbsoluteIndex();return F.map(([O,R,L])=>{const U=m(O);return U.length===4&&{color:{red:U[0]/255,green:U[1]/255,blue:U[2]/255,alpha:U[3]},range:Br(w,N+R,N+L)}}).filter(Boolean)})})}provideColorPresentations(m){const{color:{red:p,green:b,blue:w,alpha:v},range:A}=m,S=[p,b,w],_=v<1?`rgba(${S.map(E=>Math.round(E*255)).join()},${v})`:`#${S.map(qa).join("")}`;return[{label:_,textEdit:{range:A,newText:_}}]}async provideCompletionItems(m,p){var K,se,re,Ne,js,wt,yt;const{re:b,allTags:w,functions:v,switches:A,protocols:S,params:_,tags:E,ext:F}=P(this,d,Sl).call(this),{line:N,character:O}=p,R=m.split(/\r?\n/u,N+1)[N],L=b.exec((K=R==null?void 0:R.slice(0,O))!=null?K:""),[,,U={},I={}]=this.config.doubleUnderscore;if((L==null?void 0:L[1])!==void 0){const D=L[1].startsWith("/");return xe(w,"Class",L[1].slice(D?1:0),p,D&&!(R!=null&&R.slice(O).trim().startsWith(">"))?">":"")}else{if(L!=null&&L[4])return xe(A,"Constant",L[4],p,"",D=>{if(this.data)return D=D.slice(2,-2),D in U?D=U[D]:D in I&&(D=I[D]),P(this,d,dn).call(this,D.toLowerCase())});if((L==null?void 0:L[5])!==void 0)return xe(S,"Reference",L[5],p)}const B=await P(this,d,$e).call(this,m);let M;if(L!=null&&L[2]){M=B.elementFromPoint(L.index+L[2].length-1,N);const D=(se=L[3])!=null?se:"";if(L[2]==="{{{")return xe(B.querySelectorAll("arg").filter(ee=>ee.name&&ee!==M).map(({name:ee})=>ee),"Variable",D,p);const[ne,te]=this.config.parserFunction,fe=Array.isArray(te),ye=R.charAt(O),Se=D.startsWith(":"),Te=Se?D.slice(1).trimStart():D;if(L[2]==="[[")return xe(B.querySelectorAll("link,file,category,redirect-target").filter(ee=>ee!==M).map(({name:ee})=>ee),"Folder",Te,p);let Rs=v;return ye===":"?Rs=v.filter(ee=>!ee.endsWith(":")):ye===":"&&(Rs=v.filter(ee=>ee.endsWith(":")).map(ee=>ee.slice(0,-1))),[...xe(Rs,"Function",D,p,"",ee=>{if(this.data)ee in ne?ee=ne[ee]:!fe&&ee in te&&(ee=te[ee]);else return;return P(this,d,st).call(this,ee.toLowerCase())}),...D.startsWith("#")?[]:xe(B.querySelectorAll("template").filter(ee=>ee!==M).map(ee=>{const{name:rs}=ee;if(Se)return rs;const{ns:Rn}=ee.getAttribute("title");return Rn===0?`:${rs}`:Rn===10?rs.slice(9):rs}),"Folder",Te,p)]}let H,G;if((L==null?void 0:L[7])===void 0&&(M=B.elementFromPoint(O,N),{type:H,parentNode:G}=M),(L==null?void 0:L[6])!==void 0||H==="image-parameter"){const D=B.indexFromPos(N,O),ne=(Ne=(re=L==null?void 0:L[6])==null?void 0:re.trimStart())!=null?Ne:f(this,e).slice(M.getAbsoluteIndex(),D).trimStart(),te=f(this,e)[D]==="=";return[...xe(_,"Property",ne,p).filter(({label:fe})=>!te||!/[= ]$/u.test(fe)),...xe(B.querySelectorAll("image-parameter#width").filter(fe=>fe!==M).map(fe=>fe.text()),"Unit",ne,p)]}else if((L==null?void 0:L[7])!==void 0||H==="attr-key"){const D=(wt=(js=L==null?void 0:L[7])==null?void 0:js.toLowerCase())!=null?wt:G.tag,ne=(yt=L==null?void 0:L[9])!=null?yt:M.toString().slice(0,O-B.posFromIndex(M.getAbsoluteIndex()).left);if(!E.has(D))return;const te=bn[D],fe=wn[D],ye=fe&&xe(fe,"Field",ne,p);return F.includes(D)&&!te?ye:[...ye!=null?ye:[],...D==="meta"||D==="link"?[]:xe(vn,"Property",ne,p),...te?xe(te,"Property",ne,p):[],...xe(["data-"],"Variable",ne,p),...xe(["xmlns:"],"Interface",ne,p)]}else if(H==="parameter-key"||H==="parameter-value"&&G.anon){const D=G.parentNode,{type:ne,name:te}=D;if(ne==="magic-word"&&te!=="invoke")return;const fe=f(this,e).slice(M.getAbsoluteIndex(),B.indexFromPos(N,O)).trimStart(),{module:ye,function:Se}=D;return fe?xe(B.querySelectorAll("parameter").filter(Te=>Te===G||Te.anon||Te.parentNode.type!==ne||Te.parentNode.name!==te?!1:ne==="template"?!0:Te.parentNode.module===ye&&Te.parentNode.function===Se).map(({name:Te})=>Te),"Variable",fe,p,H==="parameter-value"?"=":""):void 0}else if(Ss(M)&&Na(G)){const D=pn(G.tag,G.name);if(D.length===0)return;const ne=f(this,e).slice(M.getAbsoluteIndex(),B.indexFromPos(N,O)).trimStart();return xe(D,"Value",ne,p)}}async provideDiagnostics(m,p=!0){const b=await P(this,d,$e).call(this,m),w=b.lint();return[(p?w:w.filter(({severity:_})=>_==="error")).map(({startLine:_,startCol:E,endLine:F,endCol:N,severity:O,rule:R,message:L,fix:U,suggestions:I})=>({range:{start:{line:_,character:E},end:{line:F,character:N}},severity:O==="error"?1:2,source:"WikiLint",code:R,message:L,data:[...U?[Mr(b,U,!0)]:[],...I?I.map(B=>Mr(b,B)):[]]})),[],[]].flat(2)}async provideFoldingRanges(m){const p=await P(this,d,$e).call(this,m),{length:b}=p.getLines(),w=[],v=new Array(6),A=p.querySelectorAll("heading-title,table,template,magic-word");for(const S of[...A].reverse())S.getRelativeIndex();for(const S of A){const{offsetHeight:_}=S;if(S.type==="heading-title"||_>2){const{top:E}=p.posFromIndex(S.getAbsoluteIndex());if(S.type==="heading-title"){const{level:F}=S.parentNode;for(let N=F-1;N<6;N++){const O=v[N];O!==void 0&&O<E-1&&w.push({startLine:O,endLine:E-1,kind:"region"}),v[N]=void 0}v[F-1]=E+_-1}else w.push({startLine:E,endLine:E+_-2,kind:"region"})}}for(const S of v)S!==void 0&&S<b-1&&w.push({startLine:S,endLine:b-1,kind:"region"});return w}async provideLinks(m){var A;(A=this.config)!=null||(this.config=W.getConfig());const{articlePath:p,protocol:b}=this.config,w=p==null?void 0:p.includes("//"),v=Ca(b);return(await P(this,d,$e).call(this,m)).querySelectorAll(`magic-link,ext-link-url,free-ext-link,attr-value,image-parameter#link${w?",link-target,template-name,invoke-module,magic-word#filepath,magic-word#widget":""}`).reverse().map(S=>{let _;S.is("magic-word")&&({name:_}=S,S=S.childNodes[1].lastChild);const{type:E,parentNode:F,firstChild:N,lastChild:O,childNodes:R,length:L}=S,{tag:U}=F;if(_!=null||(_=F.name),!(E!=="attr-value"||_==="src"&&["templatestyles","img"].includes(U)||_==="cite"&&["blockquote","del","ins","q"].includes(U))||!qr(S))return!1;let I=R.filter(B=>B.type==="text").map(({data:B})=>B).join("").trim();if(!I)return!1;try{if(S.is("magic-link")||S.is("ext-link-url")||S.is("free-ext-link"))I=S.getUrl(p);else if(E==="link-target"&&(F.is("link")||F.is("redirect-target")||F.is("category"))){if(I.startsWith("/"))return!1;I=F.link.getUrl(p)}else if(E==="template-name")I=F.getAttribute("title").getUrl(p);else if(["link-target","invoke-module","parameter-value"].includes(E)||E==="attr-value"&&_==="src"&&U==="templatestyles"||E==="image-parameter"&&!v.test(I)){if(!w||I.startsWith("/"))return!1;let B=0;switch(E){case"attr-value":B=10;break;case"invoke-module":B=828;break;case"parameter-value":B=_==="filepath"?6:274}const M=W.normalizeTitle(I,B,!1,this.config,{temporary:!0});if(!M.valid)return!1;I=M.getUrl()}if(typeof I=="string"&&I.startsWith("//")&&(I=`https:${I}`),I=new URL(I).href,E==="image-parameter"){const B=N.getBoundingClientRect(),{top:M,left:H,height:G,width:K}=L===1?B:O.getBoundingClientRect();return{range:{start:{line:B.top,character:B.left},end:Zt(M,H,G,K)},target:I}}return{range:Me(S),target:I}}catch{return!1}}).filter(Boolean)}async provideReferences(m,p){const b=await P(this,d,$e).call(this,m),{offsetNode:w,offset:v}=Wr(b,f(this,e),p),A=w.type==="text"?w.parentNode:w,S=v===0&&(A.type==="ext-attr-dirty"||A.type==="html-attr-dirty")?A.parentNode.parentNode:A,{type:_}=S,E=et(S),F=tt(S);if(!E&&!F&&!_a.has(_))return;const N=Ft(S),O=b.querySelectorAll(_==="heading-title"?"heading":_).filter(R=>_==="attr-value"?et(R)===E||tt(R)===F:Ft(R)===N).reverse().map(R=>({range:Me(R.type==="parameter-key"?R.parentNode:R)}));return O.length===0?void 0:O}async provideDefinition(m,p){const b=await P(this,d,$e).call(this,m),w=b.elementFromPoint(p.character,p.line),v=w.is("ext")&&w.name==="ref"?w:w.closest("ext#ref"),A=ze(v,"name");if(!A)return;const S=ze(v,"group"),_=b.querySelectorAll("ext#ref").filter(E=>E.innerText&&ze(E,"name")===A&&ze(E,"group")===S).reverse().map(({lastChild:E})=>({range:Me(E)}));return _.length===0?void 0:_}async resolveRenameLocation(m,p){const b=await P(this,d,$e).call(this,m),w=b.elementFromPoint(p.character,p.line),{type:v}=w,A=et(w),S=tt(w);return!A&&!S&&(!Or.has(v)||v==="parameter-key"&&/^[1-9]\d*$/u.test(w.parentNode.name)||v==="link-target"&&!["link","redirect-target"].includes(w.parentNode.type))?void 0:Me(w)}async provideRenameEdits(m,p,b){const w=await P(this,d,$e).call(this,m),v=w.elementFromPoint(p.character,p.line),{type:A}=v,S=et(v),_=S&&ze(v.parentNode.parentNode,"group"),E=tt(v),F=Ft(v),N=w.querySelectorAll(A).filter(O=>{const{type:R}=O.parentNode;return A==="link-target"&&R!=="link"&&R!=="redirect-target"?!1:A==="attr-value"?tt(O)===E||et(O)===S&&ze(O.parentNode.parentNode,"group")===_:Ft(O)===F});return N.length===0?void 0:{changes:{"":N.reverse().map(O=>({range:Me(O),newText:b}))}}}async provideHover(m,p){if(!this.data)return;const b=await P(this,d,$e).call(this,m);let{offsetNode:w,offset:v}=Wr(b,f(this,e),p);w.type==="text"&&(v+=w.getRelativeIndex(),w=w.parentNode);const{type:A,parentNode:S,length:_,name:E}=w;let F,N,O,R;if(w.is("double-underscore")&&v>0)F=P(this,d,dn).call(this,w.name);else if(A==="magic-word-name")F=P(this,d,st).call(this,S.name),N=w.text().trim(),O=S.getAttribute("colon");else if(w.is("magic-word")&&!w.modifier&&_===1&&(v>0||b.posFromIndex(w.getAbsoluteIndex()).left===p.character))F=P(this,d,st).call(this,E),N=w.firstChild.text().trim(),O=w.getAttribute("colon");else if((w.is("magic-word")||w.is("template"))&&w.modifier&&v>=2&&w.getRelativeIndex(0)>v&&(N=w.modifier.trim().slice(0,-1),F=P(this,d,st).call(this,N.toLowerCase()),O=":",F)){const L=w.getAbsoluteIndex();R={start:Ze(b,L+2),end:Ze(b,L+w.modifier.trimEnd().length+1)}}return F&&{contents:{kind:"markdown",value:(F.signatures?`${F.signatures.map(L=>`- **{{ ${N}${L.length===0?"**":`${O}** `}${L.map(({label:U,const:I})=>I?U:`*${U}*`).join(" **|** ")} **}}**`).join(`
|
|
29
29
|
`)}
|
|
30
30
|
|
|
31
|
-
`:"")+
|
|
31
|
+
`:"")+F.description},range:R!=null?R:Me(w)}}async provideSignatureHelp(m,p){if(!this.data)return;const{line:b,character:w}=p,v=m.split(/\r?\n/u,b+1)[b],{lastChild:A}=await P(this,d,yl).call(this,`${v.slice(0,w+/^[^{}<]*/u.exec(v.slice(w))[0].length)}}}`);if(!A.is("magic-word")||A.length===1)return;const{name:S,childNodes:_,firstChild:E}=A,F=P(this,d,st).call(this,S);if(!(F!=null&&F.signatures))return;const N=_.length-1,O=F.signatures.filter(I=>{var B;return(I.length>=N||((B=I[I.length-1])==null?void 0:B.rest))&&I.every(({label:M,const:H},G)=>{var se;const K=H&&G<N&&((se=_[G+1])==null?void 0:se.text().trim());return!K||M.toLowerCase().includes(K.toLowerCase())})});if(O.length===0)return;let R=-1;for(let I=A.getAbsoluteIndex()+A.getAttribute("padding");R<N&&(I+=_[R+1].toString().length+1,!(I>w));R++);const L=E.text().trim(),U=A.getAttribute("colon");return{signatures:O.map(I=>({label:`{{${L}${I.length===0?"":U}${I.map(({label:B})=>B).join("|")}}}`,parameters:I.map(({label:B,const:M})=>({label:B,...M?{documentation:"Predefined parameter"}:void 0})),...I.length<N?{activeParameter:Math.min(R,I.length-1)}:void 0})),activeParameter:R}}async provideInlayHints(m){const p=await P(this,d,$e).call(this,m);let b=[];for(const w of p.querySelectorAll("template,magic-word#invoke").reverse()){const{type:v,childNodes:A}=w;b=[...b,...A.slice(v==="template"?1:3).filter(({anon:S})=>S).reverse().map(S=>({position:Ze(p,S.getAbsoluteIndex()),label:`${S.name}=`,kind:2}))]}return b}findStyleTokens(){return f(this,a).querySelectorAll(Ia).filter(({lastChild:m})=>Ss(m))}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n=new WeakMap,a=new WeakMap,r=new WeakMap,i=new WeakMap,o=new WeakMap,l=new WeakMap,d=new WeakSet,Gt=function(){return f(this,i)===this.config&&f(this,o)===this.include},$e=async function(m){var p;return m=Xt(m),!f(this,s)&&P(this,d,Gt).call(this)&&f(this,e)===m?f(this,a):(j(this,e,m),(p=f(this,s))!=null||j(this,s,P(this,d,on).call(this)),f(this,s))},on=async function(){var b;(b=this.config)!=null||(this.config=W.getConfig()),j(this,i,this.config),j(this,o,this.include);const m=f(this,e),p=await W.partialParse(m,()=>f(this,e),this.include,this.config);return P(this,d,Gt).call(this)&&f(this,e)===m?(j(this,a,p),j(this,s,void 0),p):(j(this,s,P(this,d,on).call(this)),f(this,s))},yl=async function(m){var p;return m=Xt(m),!f(this,n)&&P(this,d,Gt).call(this)&&f(this,t)===m?f(this,r):(j(this,t,m),(p=f(this,n))!=null||j(this,n,P(this,d,ln).call(this)),f(this,n))},ln=async function(){var b;(b=this.config)!=null||(this.config=W.getConfig()),j(this,i,this.config),j(this,o,this.include);const m=f(this,t),p=await W.partialParse(m,()=>f(this,t),this.include,this.config);return P(this,d,Gt).call(this)&&f(this,t)===m?(j(this,r,p),j(this,n,void 0),p):(j(this,n,P(this,d,ln).call(this)),f(this,n))},Sl=function(){var m;if(!f(this,l)||f(this,l)[1]!==this.config){(m=this.config)!=null||(this.config=W.getConfig());const{nsid:p,ext:b,html:w,parserFunction:[v,A,...S],doubleUnderscore:_,protocol:E,img:F}=this.config,N=new Set([b,w].flat(2)),O=new RegExp("(?:"+String.raw`<(\/?\w*)`+"|"+String.raw`(\{{2,4}|\[\[)\s*([^|{}<>[\]\s][^|{}<>[\]#]*)?`+"|"+String.raw`(__(?:(?!__)[\p{L}\p{N}_])*)`+"|"+String.raw`(?<!\[)\[([a-z:/]*)`+"|"+String.raw`\[\[\s*(?:${Object.entries(p).filter(([,R])=>R===6).map(([R])=>R).join("|")})\s*:[^[\]{}<>]+\|([^[\]{}<>|=]*)`+"|"+String.raw`<(\w+)(?:\s(?:[^<>{}|=\s]+(?:\s*=\s*(?:[^\s"']\S*|(["']).*?\8))?(?=\s))*)?\s(\w*)`+")$","iu");j(this,l,[{re:O,ext:b,tags:N,allTags:[...N,"onlyinclude","includeonly","noinclude"],functions:[Object.keys(v),Array.isArray(A)?A:Object.keys(A),S].flat(2),switches:_.slice(0,2).flat().map(R=>`__${R}__`),protocols:E.split("|"),params:Object.keys(F).filter(R=>R.endsWith("$1")||!R.includes("$1")).map(R=>R.replace(/\$1$/u,""))},this.config])}return f(this,l)[0]},dn=function(m){return this.data.behaviorSwitches.find(({aliases:p})=>p.includes(m))},st=function(m){return this.data.parserFunctions.find(({aliases:p})=>p.some(b=>b.replace(/^#/u,"")===m))},T)}}),Al={};ie(Al,{default:()=>W});$l.exports=Y(Al);var fs,zr,Re,Hr,Fa,W,J=C({"index.ts"(){Oa(),be(),Qe(),ce(),$d(),fs=!0,zr=nn(),Re={config:Gr,i18n:void 0,rules:gn,get lintConfig(){return zr},set lintConfig(e){zr=nn(e)},get viewOnly(){return fs},set viewOnly(e){fs&&!e&&me.rev++,fs=e},getConfig(e){const t=e!=null?e:this.config,{doubleUnderscore:s,ext:n,parserFunction:a,variable:r}=t;for(let i=0;i<2;i++)s.length>i+2&&s[i].length===0&&(s[i]=Object.keys(s[i+2]));return n.includes("translate")&&!r.includes("translationlanguage")&&(r.push("translationlanguage"),Array.isArray(a[1])?a[1].push("TRANSLATIONLANGUAGE"):a[1].TRANSLATIONLANGUAGE="translationlanguage"),{...Gr,...t,excludes:[]}},msg(e,t=""){var s,n;return e&&((n=(s=this.i18n)==null?void 0:s[e])!=null?n:e).replace("$1",this.msg(t))},normalizeTitle(e,t=0,s,n=Re.getConfig(),a){const{Title:r}=(kd(),Y(ml));let i;if(a!=null&&a.halfParsed)i=new r(e,t,n,a);else{const{Token:o}=(V(),Y(Qt));i=me.run(()=>{const l=new o(e,n);l.type="root",l.parseOnce(0,s).parseOnce();const d=new r(l.toString(),t,n,a);for(const h of["main","fragment"]){const c=d[h];if(c!=null&&c.includes("\0")){const x=l.buildFromStr(c,1);h==="main"?d.main=x:d.setFragment(x)}}return d})}return i},parse(e,t,s=we,n=Re.getConfig()){e=Xt(e);let a;typeof s!="number"&&(a=Array.isArray(s)?s:[s],s=Math.max(...a.map(o=>Ea[o]||we)));const{Token:r}=(V(),Y(Qt));return me.run(()=>{const o=new r(e,n);return o.type="root",o.parse(s,t)})},async partialParse(e,t,s,n=Re.getConfig()){{const{Token:a}=(V(),Y(Qt)),r=typeof setImmediate=="function"?setImmediate:setTimeout,{running:i}=me;me.running=!0;const o=new a(Xt(e),n);o.type="root";let l=0;try{await new Promise(d=>{const h=()=>{t()===e?(l++,r(c,0)):d()},c=()=>{l===we+1?(o.afterBuild(),d()):(o[l===we?"build":"parseOnce"](l,s),h())};r(c,0)})}catch(d){throw me.running=i,d}return me.running=i,o}},createLanguageService(e={}){var t;{const s=(_d(),Y(bl)),{LanguageService:n,tasks:a}=s;return(t=a.get(e))!=null?t:new n(e)}throw new Error("Parser.createLanguageService method is only available in the LSP version!")}},Hr={},Fa=new Set(["normalizeTitle","parse","createLanguageService"]);for(const e in Re)Fa.has(e)||(Hr[e]={enumerable:!1});Object.defineProperties(Re,Hr),Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:Re}),W=Re}});J()});Td();})();
|
|
32
32
|
//# sourceMappingURL=bundle-lsp.min.js.map
|