wikiparser-node 1.16.4 → 1.16.5
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 +1 -1
- package/bundle/bundle.es7.js +27 -27
- package/bundle/bundle.lsp.js +30 -30
- package/bundle/bundle.min.js +29 -29
- package/dist/addon/table.js +7 -4
- package/dist/addon/token.js +13 -7
- package/dist/addon/transclude.js +7 -5
- package/dist/base.d.mts +99 -30
- package/dist/base.d.ts +99 -30
- package/dist/index.d.ts +10 -4
- package/dist/index.js +59 -14
- package/dist/lib/attributes.js +2 -2
- package/dist/lib/element.d.ts +96 -42
- package/dist/lib/element.js +97 -45
- package/dist/lib/lsp.d.ts +64 -35
- package/dist/lib/lsp.js +99 -71
- package/dist/lib/node.d.ts +122 -53
- package/dist/lib/node.js +172 -75
- package/dist/lib/range.d.ts +83 -31
- package/dist/lib/range.js +83 -31
- package/dist/lib/ranges.d.ts +1 -1
- package/dist/lib/ranges.js +3 -2
- package/dist/lib/text.d.ts +40 -14
- package/dist/lib/text.js +47 -19
- package/dist/lib/title.d.ts +50 -16
- package/dist/lib/title.js +77 -36
- package/dist/mixin/attributesParent.d.ts +37 -21
- package/dist/mixin/attributesParent.js +0 -2
- package/dist/mixin/flagsParent.d.ts +38 -12
- package/dist/mixin/hidden.d.ts +0 -2
- package/dist/mixin/hidden.js +0 -2
- package/dist/mixin/magicLinkParent.d.ts +11 -5
- package/dist/mixin/singleLine.d.ts +0 -2
- package/dist/mixin/singleLine.js +3 -3
- package/dist/mixin/sol.d.ts +0 -2
- package/dist/mixin/sol.js +2 -3
- package/dist/mixin/syntax.d.ts +0 -2
- package/dist/mixin/syntax.js +0 -2
- package/dist/parser/braces.js +4 -2
- package/dist/parser/links.js +13 -7
- package/dist/parser/list.js +3 -1
- package/dist/parser/quotes.js +22 -2
- package/dist/parser/redirect.js +4 -1
- package/dist/src/arg.d.ts +19 -9
- package/dist/src/arg.js +34 -15
- package/dist/src/atom.d.ts +5 -1
- package/dist/src/atom.js +5 -1
- package/dist/src/attribute.d.ts +26 -8
- package/dist/src/attribute.js +30 -11
- package/dist/src/attributes.d.ts +50 -22
- package/dist/src/attributes.js +54 -26
- package/dist/src/converter.d.ts +4 -2
- package/dist/src/converter.js +12 -9
- package/dist/src/converterFlags.d.ts +45 -15
- package/dist/src/converterFlags.js +45 -15
- package/dist/src/converterRule.d.ts +30 -11
- package/dist/src/converterRule.js +46 -16
- package/dist/src/extLink.d.ts +6 -2
- package/dist/src/extLink.js +14 -11
- package/dist/src/gallery.d.ts +13 -9
- package/dist/src/gallery.js +35 -21
- package/dist/src/heading.d.ts +13 -7
- package/dist/src/heading.js +21 -11
- package/dist/src/hidden.d.ts +5 -1
- package/dist/src/hidden.js +7 -3
- package/dist/src/html.d.ts +11 -5
- package/dist/src/html.js +16 -7
- package/dist/src/imageParameter.d.ts +23 -11
- package/dist/src/imageParameter.js +22 -10
- package/dist/src/imagemap.d.ts +4 -4
- package/dist/src/imagemap.js +9 -5
- package/dist/src/imagemapLink.d.ts +3 -1
- package/dist/src/imagemapLink.js +3 -1
- package/dist/src/index.d.ts +65 -20
- package/dist/src/index.js +111 -39
- package/dist/src/link/base.d.ts +14 -6
- package/dist/src/link/base.js +40 -17
- package/dist/src/link/category.d.ts +7 -2
- package/dist/src/link/category.js +20 -4
- package/dist/src/link/file.d.ts +71 -23
- package/dist/src/link/file.js +100 -36
- package/dist/src/link/galleryImage.d.ts +8 -4
- package/dist/src/link/galleryImage.js +15 -8
- package/dist/src/link/index.d.ts +12 -4
- package/dist/src/link/index.js +15 -5
- package/dist/src/link/redirectTarget.d.ts +3 -2
- package/dist/src/link/redirectTarget.js +5 -3
- package/dist/src/magicLink.d.ts +24 -11
- package/dist/src/magicLink.js +36 -19
- package/dist/src/nested.d.ts +5 -3
- package/dist/src/nested.js +9 -6
- package/dist/src/nowiki/base.d.ts +4 -2
- package/dist/src/nowiki/base.js +6 -5
- package/dist/src/nowiki/comment.d.ts +6 -2
- package/dist/src/nowiki/comment.js +8 -3
- package/dist/src/nowiki/dd.d.ts +0 -3
- package/dist/src/nowiki/dd.js +0 -8
- package/dist/src/nowiki/doubleUnderscore.d.ts +5 -1
- package/dist/src/nowiki/doubleUnderscore.js +5 -1
- package/dist/src/nowiki/index.d.ts +5 -1
- package/dist/src/nowiki/index.js +5 -1
- package/dist/src/nowiki/list.d.ts +5 -1
- package/dist/src/nowiki/list.js +5 -1
- package/dist/src/nowiki/listBase.d.ts +15 -5
- package/dist/src/nowiki/listBase.js +40 -9
- package/dist/src/nowiki/noinclude.d.ts +5 -1
- package/dist/src/nowiki/noinclude.js +5 -1
- package/dist/src/nowiki/quote.d.ts +15 -8
- package/dist/src/nowiki/quote.js +32 -12
- package/dist/src/onlyinclude.d.ts +4 -2
- package/dist/src/onlyinclude.js +4 -2
- package/dist/src/paramTag/index.d.ts +1 -1
- package/dist/src/paramTag/index.js +1 -1
- package/dist/src/parameter.d.ts +24 -12
- package/dist/src/parameter.js +45 -27
- package/dist/src/pre.d.ts +1 -1
- package/dist/src/pre.js +1 -1
- package/dist/src/redirect.d.ts +2 -0
- package/dist/src/redirect.js +2 -0
- package/dist/src/syntax.d.ts +5 -1
- package/dist/src/syntax.js +5 -1
- package/dist/src/table/base.d.ts +5 -1
- package/dist/src/table/base.js +10 -3
- package/dist/src/table/index.d.ts +134 -66
- package/dist/src/table/index.js +149 -81
- package/dist/src/table/td.d.ts +18 -10
- package/dist/src/table/td.js +23 -15
- package/dist/src/table/tr.d.ts +13 -3
- package/dist/src/table/tr.js +14 -6
- package/dist/src/table/trBase.d.ts +28 -12
- package/dist/src/table/trBase.js +28 -18
- package/dist/src/tagPair/ext.d.ts +3 -1
- package/dist/src/tagPair/ext.js +10 -8
- package/dist/src/tagPair/include.d.ts +8 -2
- package/dist/src/tagPair/include.js +8 -2
- package/dist/src/tagPair/index.d.ts +6 -2
- package/dist/src/tagPair/index.js +6 -2
- package/dist/src/transclude.d.ts +102 -33
- package/dist/src/transclude.js +114 -42
- package/dist/util/debug.js +2 -7
- package/dist/util/html.js +1 -18
- package/dist/util/string.js +7 -1
- package/extensions/dist/base.js +25 -8
- package/extensions/dist/codejar.js +2 -1
- package/extensions/dist/lsp.js +5 -10
- package/extensions/es7/base.js +25 -8
- package/extensions/ui.css +1 -162
- package/i18n/zh-hans.json +1 -1
- package/i18n/zh-hant.json +1 -1
- package/package.json +3 -3
package/bundle/bundle.lsp.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
"use strict";(()=>{var Zo=Object.create;var xt=Object.defineProperty;var Li=Object.getOwnPropertyDescriptor;var ea=Object.getOwnPropertyNames;var ta=Object.prototype.hasOwnProperty;var Fi=(a,r)=>(r=Symbol[a])?r:Symbol.for("Symbol."+a),bt=a=>{throw TypeError(a)};var Pi=(a,r,e)=>r in a?xt(a,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[r]=e;var Ei=(a,r)=>xt(a,"name",{value:r,configurable:!0});var A=(a,r)=>()=>(a&&(r=a(a=0)),r);var ra=(a,r)=>()=>(r||a((r={exports:{}}).exports,r),r.exports),ie=(a,r)=>{for(var e in r)xt(a,e,{get:r[e],enumerable:!0})},na=(a,r,e,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of ea(r))!ta.call(a,n)&&n!==e&&xt(a,n,{get:()=>r[n],enumerable:!(t=Li(r,n))||t.enumerable});return a};var Z=a=>na(xt({},"__esModule",{value:!0}),a);var se=a=>{var r;return[,,,Zo((r=a==null?void 0:a[Fi("metadata")])!=null?r:null)]},Ri=["class","method","getter","setter","accessor","field","value","get","set"],sr=a=>a!==void 0&&typeof a!="function"?bt("Function expected"):a,ia=(a,r,e,t,n)=>({kind:Ri[a],name:r,metadata:t,addInitializer:i=>e._?bt("Already initialized"):n.push(sr(i||null))}),sa=(a,r)=>Pi(r,Fi("metadata"),a[3]),oe=(a,r,e,t)=>{for(var n=0,i=a[r>>1],s=i&&i.length;n<s;n++)r&1?i[n].call(e):t=i[n].call(e,t);return t},ae=(a,r,e,t,n,i)=>{var s,o,l,u,g,d=r&7,p=!!(r&8),m=!!(r&16),h=d>3?a.length+1:d?p?1:2:0,f=Ri[d+5],x=d>3&&(a[h-1]=[]),y=a[h]||(a[h]=[]),v=d&&(!m&&!p&&(n=n.prototype),d<5&&(d>3||!m)&&Li(d<4?n:{get[e](){return c(this,i)},set[e](L){return k(this,i,L)}},e));d?m&&d<4&&Ei(i,(d>2?"set ":d>1?"get ":"")+e):Ei(n,e);for(var C=t.length-1;C>=0;C--)u=ia(d,e,l={},a[3],y),d&&(u.static=p,u.private=m,g=u.access={has:m?L=>oa(n,L):L=>e in L},d^3&&(g.get=m?L=>(d^1?c:S)(L,n,d^4?i:v.get):L=>L[e]),d>2&&(g.set=m?(L,I)=>k(L,n,I,d^4?i:v.set):(L,I)=>L[e]=I)),o=(0,t[C])(d?d<4?m?i:v[f]:d>4?void 0:{get:v.get,set:v.set}:n,u),l._=1,d^4||o===void 0?sr(o)&&(d>4?x.unshift(o):d?m?i=o:v[f]=o:n=o):typeof o!="object"||o===null?bt("Object expected"):(sr(s=o.get)&&(v.get=s),sr(s=o.set)&&(v.set=s),sr(s=o.init)&&x.unshift(s));return d||sa(a,n),v&&xt(n,e,v),m?d^4?i:v:n},te=(a,r,e)=>Pi(a,typeof r!="symbol"?r+"":r,e),Pn=(a,r,e)=>r.has(a)||bt("Cannot "+e),oa=(a,r)=>Object(r)!==r?bt('Cannot use the "in" operator on this value'):a.has(r),c=(a,r,e)=>(Pn(a,r,"read from private field"),e?e.call(a):r.get(a)),b=(a,r,e)=>r.has(a)?bt("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(a):r.set(a,e),k=(a,r,e,t)=>(Pn(a,r,"write to private field"),t?t.call(a,e):r.set(a,e),e),S=(a,r,e)=>(Pn(a,r,"access private method"),e);var Mr=(a,r,e,t)=>({set _(n){k(a,r,n,e)},get _(){return c(a,r,t)}});var Bi,ji,qi=A(()=>{"use strict";Bi=(()=>{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};return Object.setPrototypeOf(a,null),a})(),ji=(()=>{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})()});var Ge,or,Oi,Rn=A(()=>{"use strict";Ge=a=>decodeURIComponent(a.replace(/%(?![\da-f]{2})/giu,"%25")),or=a=>Math.round(a*255).toString(16).padStart(2,"0"),Oi=(a,r=!0)=>{let e=String.raw`#(?:[\da-f]{3,4}|(?:[\da-f]{2}){3,4})(?![\p{L}\d_])`,t=String.raw`(?:\d*\.)?\d+%?`,n=String.raw`(?:\d*\.)?\d+(?:deg|grad|rad|turn)?`,i=String.raw`rgba?\(\s*(?:${String.raw`${new Array(3).fill(t).join(String.raw`\s+`)}(?:\s*\/\s*${t})?`}|${String.raw`${new Array(3).fill(t).join(String.raw`\s*,\s*`)}(?:\s*,\s*${t})?`})\s*\)`,s=String.raw`hsla?\(\s*(?:${String.raw`${n}\s+${t}\s+${t}(?:\s*\/\s*${t})?`}|${String.raw`${n}${String.raw`\s*,\s*(?:\d*\.)?\d+%`.repeat(2)}(?:\s*,\s*${t})?`})\s*\)`,o=new RegExp(String.raw`(^|[^\p{L}\d_])(${e}|${i}|${s})`,"giu"),l=new RegExp(String.raw`(^|[^\p{L}\d_])(${e}|${i})`,"giu"),u=[],g=r?o:l;g.lastIndex=0;let d=g.exec(a),p=0;for(;d;){let m=d.index+d[1].length;m>p&&u.push([a.slice(p,m),p,m,!1]),{lastIndex:p}=g,u.push([d[2],m,p,a.charAt(m-1)!=="&"||!/^#\d+$/u.test(d[2])]),d=g.exec(a)}return a.length>p&&u.push([a.slice(p),p,a.length,!1]),u}});var we,_i,Fe,Pe,rt,Wr,le,Mi,fe,aa,la,ar,Wi,Di,da,ga,Tt,Re,J=A(()=>{"use strict";Rn();we=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,_i=String.raw`[^[\]<>"\0-\x1F\x7F${we}\uFFFD]`,Fe=String.raw`(?:\[[\da-f:.]+\]|${_i})`,Pe=String.raw`(?:${_i}|\0\d+[cn!~]\x7F)*`,rt=(a,r)=>e=>e.replace(a,r),Wr=rt(/[\0\x7F]|\r$/gmu,""),le=rt(/\0\d+[cn]\x7F/gu,""),Mi=rt(/[\\{}()|.?*+^$[\]]/gu,String.raw`\$&`),fe=(a,r="")=>a.map(e=>typeof e=="string"?e:e.text()).join(r),aa={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},la=rt(/&(?:#(\d+|[Xx][\da-fA-F]+)|([lg]t|[LG]T|[lr]brac[ke]|nbsp|amp|AMP|quot|QUOT));/gu,(a,r,e)=>r?String.fromCodePoint(+((/^x/iu.test(r)?"0":"")+r)):aa[e.toLowerCase()]),ar=a=>la(a),Wi=rt(/&#(\d+|x[\da-f]+);/giu,(a,r)=>String.fromCodePoint(+((/^x/iu.test(r)?"0":"")+r))),Di=rt(/\n/gu,String.raw`\n`),da={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},ga=a=>rt(a,r=>`&${da[r]};`),Tt=ga(/[&<>]/gu),Re=(a,r={})=>{let{pre:e="",post:t="",sep:n=""}=r;return e+a.map(i=>i.print()).join(n)+t}});var Ui=ra((hl,ua)=>{ua.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},variable:["!","=","pageid","articlepath","server","servername","scriptpath","stylepath"],parserFunction:[{"#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","#replace":"replace","#explode":"explode","#tab":"tab","#seo":"seo","#babel":"babel","#commaseparatedlist":"commaseparatedlist","#coordinates":"coordinates","#lst":"lst","#lsth":"lsth","#lstx":"lstx","#assessment":"assessment","#mentor":"mentor","#property":"property","#target":"target","#section":"section","#section-x":"section-x","#section-h":"section-h","#statements":"statements"},{"!":"!","=":"=","#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 Bn,Hi=A(()=>{"use strict";Bn=Ui()});var lr,yt,dr,gr,jn,R,ee=A(()=>{"use strict";R=class{constructor(r,e){b(this,gr);b(this,lr);b(this,yt);b(this,dr);k(this,lr,r),k(this,yt,e)}get start(){return c(this,yt)}get top(){return S(this,gr,jn).call(this).top}get left(){return S(this,gr,jn).call(this).left}};lr=new WeakMap,yt=new WeakMap,dr=new WeakMap,gr=new WeakSet,jn=function(){var r;return(r=c(this,dr))!=null||k(this,dr,c(this,lr).getRootNode().posFromIndex(c(this,yt))),c(this,dr)}});var kt,Gi,$,F,Be,D=A(()=>{"use strict";Ce();ee();B();kt=(a,r,e,t)=>({line:a+e-1,character:(e===1?r:0)+t}),Gi=a=>(r,e,t,n,i="error")=>{let{start:s}=e,{top:o,left:l}=e instanceof R?e:new R(r,s),{offsetHeight:u,offsetWidth:g}=r,{startIndex:d,startLine:p,startCol:m}=a(r,s,o,l),{line:h,character:f}=kt(p,m,u,g);return{rule:t,message:T.msg(n),severity:i,startIndex:d,endIndex:d+r.toString().length,startLine:p,endLine:h,startCol:m,endCol:f}},$=Gi((a,r,e,t)=>{let n=a.getRelativeIndex(),{top:i,left:s}=a.parentNode.posFromIndex(n);return{startIndex:r+n,startLine:e+i,startCol:i?s:t+s}}),F=Gi((a,r,e,t)=>({startIndex:r,startLine:e,startCol:t})),Be=(a,r,e)=>{if(a)return a[1];let t=r();return e([Se.rev,t]),t}});var pa,Dr,zi=A(()=>{"use strict";pa=(a,r,e)=>{let[t,...n]=a.split("#");return(!t||t===r)&&n.every(i=>i===e)},Dr=(a,r,e)=>({type:t,name:n})=>a.split(",").some(i=>pa(i.trim(),t,n))});var ur,vt,At,pr,cr,mr,wt,St,Ur,Ct,qn=A(()=>{"use strict";D();Ce();Ct=class{constructor(){b(this,St);te(this,"childNodes",[]);b(this,ur);b(this,vt);b(this,At);b(this,pr);b(this,cr);b(this,mr);b(this,wt,{})}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get parentNode(){return c(this,ur)}get nextSibling(){return c(this,vt)}get previousSibling(){return c(this,At)}get offsetHeight(){return S(this,St,Ur).call(this).height}get offsetWidth(){return S(this,St,Ur).call(this).width}getAttribute(r){return r==="padding"?0:this[r]}setAttribute(r,e){switch(r){case"parentNode":k(this,ur,e),e||(k(this,vt,void 0),k(this,At,void 0));break;case"nextSibling":k(this,vt,e);break;case"previousSibling":k(this,At,e);break;default:this[r]=e}}getRootNode(){return Be(c(this,cr),()=>{var r,e;return(e=(r=this.parentNode)==null?void 0:r.getRootNode())!=null?e:this},r=>{let[,e]=r;e.type==="root"&&e.getAttribute("built")&&k(this,cr,r)})}indexFromPos(r,e){if(r<0||e<0)return;let t=this.getLines();if(r>=t.length)return;let[,n,i]=t[r],s=n+e;return s>i?void 0:s}posFromIndex(r){let{length:e}=String(this);if(r+=r<0?e:0,r>=0&&r<=e){let t=this.getLines(),n=t.findIndex(([,,i])=>r<=i);return{top:n,left:r-t[n][1]}}}getGaps(r){return 0}getRelativeIndex(r){if(r===void 0){let{parentNode:e}=this;return e?e.getRelativeIndex(e.childNodes.indexOf(this)):0}return Be(c(this,wt)[r],()=>{let{childNodes:e}=this,t=r+(r<0?e.length:0),n=this.getAttribute("padding");for(let i=0;i<t;i++)c(this,wt)[i]=[Se.rev,n],n+=e[i].toString().length+this.getGaps(i);return n},e=>{c(this,wt)[r]=e})}getAbsoluteIndex(){return Be(c(this,mr),()=>{let{parentNode:r}=this;return r?r.getAbsoluteIndex()+this.getRelativeIndex():0},r=>{k(this,mr,r)})}getBoundingClientRect(){return{...S(this,St,Ur).call(this),...this.getRootNode().posFromIndex(this.getAbsoluteIndex())}}seal(r,e){Object.defineProperty(this,r,{enumerable:!e&&!!this[r],configurable:!0})}is(r){return this.type===r}getLines(){return Be(c(this,pr),()=>{let r=[],e=0;for(let t of String(this).split(`
|
|
2
|
-
`)){let n=e+t.length;r.push([t,e,n]),e=n+1}return r},r=>{k(this,pr,r)})}};ur=new WeakMap,vt=new WeakMap,At=new WeakMap,pr=new WeakMap,cr=new WeakMap,mr=new WeakMap,wt=new WeakMap,St=new WeakSet,Ur=function(){let r=this.getLines(),e=r[r.length-1];return{height:r.length,width:e[2]-e[1]}}});var ze,On,_n,Hr,Vi=A(()=>{"use strict";J();Ce();zi();qn();Hr=class extends Ct{constructor(){super(...arguments);b(this,ze)}get length(){return this.childNodes.length}text(e){return fe(this.childNodes,e)}normalize(){let e=[...this.childNodes],t=n=>{var i,s;e.splice(n,1),(i=e[n-1])==null||i.setAttribute("nextSibling",e[n]),(s=e[n])==null||s.setAttribute("previousSibling",e[n-1])};for(let n=e.length-1;n>=0;n--){let{type:i,data:s}=e[n];i!=="text"||e.length===1||this.getGaps(n-(n&&1))||s===""&&t(n)}this.setAttribute("childNodes",e)}removeAt(e){return Mn(this,e,1)[0]}insertAt(e,t=this.length){return Mn(this,t,0,[e]),e}closest(e){let t=Dr(e,this),{parentNode:n}=this;for(;n;){if(t(n))return n;({parentNode:n}=n)}}querySelector(e){let t=Dr(e,this);return S(this,ze,On).call(this,t)}querySelectorAll(e){let t=Dr(e,this);return S(this,ze,_n).call(this,t)}append(...e){for(let t of e)this.insertAt(t)}replaceChildren(...e){for(let t=this.length-1;t>=0;t--)this.removeAt(t);this.append(...e)}setText(e,t=0){t+=t<0?this.length:0;let n=this.childNodes[t],{data:i}=n;return n.replaceData(e),i}toString(e,t=""){return this.childNodes.map(n=>n.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 n=this,i=0,s=0;for(;n.type!=="text";){let{childNodes:o}=n;i+=n.getAttribute("padding");for(let l=0;i<=e&&l<o.length;l++){let u=o[l],{nextSibling:g}=u,d=u.toString(),p=d.length;if(i+=p,i>e||i===e&&p>0&&(!g||g.type==="text"||u.type!=="text"&&(d.trim()||!g.toString().trim()))){n=u,i-=p,s=i;break}i+=n.getGaps(l)}if(n.childNodes===o)return{offsetNode:n,offset:e-s}}return{offsetNode:n,offset:e-s}}}elementFromIndex(e){var t;{let n=(t=this.caretPositionFromIndex(e))==null?void 0:t.offsetNode;return(n==null?void 0:n.type)==="text"?n.parentNode:n}}elementFromPoint(e,t){return this.elementFromIndex(this.indexFromPos(t,e))}lint(e=this.getAbsoluteIndex(),t){let n=[];for(let i=0,s=e+this.getAttribute("padding");i<this.length;i++){let o=this.childNodes[i];n.push(...o.lint(s,t)),s+=o.toString().length+this.getGaps(i)}return n}print(e={}){let t=e.class;return this.toString()?(t===""?"":`<span class="wpb-${t!=null?t:this.type}">`)+Re(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){let n={...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();n.childNodes.push(o.type==="text"?{data:o.data,range:[s,s+l]}:o.json(void 0,s)),s+=l+this.getGaps(i)}return n}};ze=new WeakSet,On=function(e){var t;for(let n of this.childNodes){if(n.type==="text")continue;if(e(n))return n;let i=S(t=n,ze,On).call(t,e);if(i)return i}},_n=function(e){var n;let t=[];for(let i of this.childNodes)i.type!=="text"&&(e(i)&&t.push(i),t.push(...S(n=i,ze,_n).call(n,e)));return t}});var Wn,Xi,ca,ma,ha,fa,xa,ba,Dn,Gr,Qi,hr,Ki=A(()=>{"use strict";J();D();B();qn();Wn=String.raw`[${we}\t]*`,Xi=String.raw`<\s*(?:/\s*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${Wn}\d)|isbn(?=[-::]?${Wn}(?:\d(?:${Wn}|-)){6})`,ca=new RegExp(String.raw`${Xi}|https?[:/]/+`,"giu"),ma=new RegExp(Xi,"giu"),ha=new Set(["attr-value","ext-link-text","link-text"]),fa={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},xa={"<":"tag-like","[":"lonely-bracket","{":"lonely-bracket","]":"lonely-bracket","}":"lonely-bracket",h:"lonely-http",r:"lonely-http",p:"lonely-http",i:"lonely-http"},ba=["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{Dn=new RegExp(String.raw`[\p{L}\d_]`,"u")}catch(a){Dn=/\w/u}hr=class extends Ct{constructor(e){super();b(this,Gr);te(this,"data","");Object.defineProperties(this,{childNodes:{enumerable:!1,configurable:!1},data:{value:e}})}get type(){return"text"}toString(e){var t;return e&&!((t=this.parentNode)!=null&&t.getAttribute("built"))?le(this.data):this.data}text(){return this.data}lint(e=this.getAbsoluteIndex(),t){var H,_,X;if(t===!1)return[];let{data:n,parentNode:i,nextSibling:s,previousSibling:o}=this;if(!i)throw new Error("An isolated text node cannot be linted!");let{type:l,name:u,parentNode:g}=i,d=!1;if(l==="attr-value"){let{type:N,name:M,tag:W}=g;if(N!=="ext-attr")d=!0;else if(W==="choose"&&(M==="before"||M==="after"))return[]}if(t!=null||(t=l==="free-ext-link"||l==="ext-link-url"||l==="ext-link-text"||l==="image-parameter"&&u==="link"||d?ma:ca),n.search(t)===-1)return[];t.lastIndex=0;let p=[],m=s==null?void 0:s.type,h=s==null?void 0:s.name,f=o==null?void 0:o.type,x=this.getRootNode(),y=x.toString(),{ext:v,html:C}=x.getAttribute("config"),{top:L,left:I}=x.posFromIndex(e),U=new Set(["onlyinclude","noinclude","includeonly",...v,...C[0],...C[1],...C[2],...ba]);for(let N=t.exec(n);N;N=t.exec(n)){let[,M,W]=N,{index:E}=N,q=N[0].toLowerCase();if(W&&W!=="]"){let{length:pe}=W;E+=pe,q=q.slice(pe)}let{0:P,length:me}=q,re=P==="r"||P==="p"||P==="i";if(P==="<"&&!U.has(M.toLowerCase())||P==="["&&l==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(n.slice(E+1))||s!=null&&s.is("ext")&&h==="nowiki"&&((H=s.innerText)!=null&&H.includes("]")))||re&&(!i.getAttribute("plain")||ha.has(l)))continue;P==="]"&&(E||me>1)&&t.lastIndex--;let he=e+E,et=he+me,He=y[et],_r=y[he-1],En=me>1&&!(P==="<"&&!/[\s/>]/u.test(He!=null?He:"")||d&&(P==="["||P==="]")||re&&l==="parameter-value")||P==="{"&&(He===P||_r==="-")||P==="}"&&(_r===P||He==="-")||P==="["&&(He===P||l==="ext-link-text"||m==="free-ext-link"&&!n.slice(E+1).trim())||P==="]"&&(_r===P||f==="free-ext-link"&&!n.slice(0,E).includes("]"))?"error":"warning",Ln=P==="{"||P==="[";if(En==="warning"&&(Ln||(P==="]"||P==="}"))){let pe=fa[P],Fn=Ln?n.slice(E+1):n.slice(0,E);if(P==="{"&&((_=pe.exec(Fn))==null?void 0:_[0])==="}"||P==="}"&&((X=pe.exec(Fn))==null?void 0:X[0])==="{")continue;if(!Fn.includes(P)){let Ii=Ln?"nextSibling":"previousSibling",tt=this[Ii];for(;tt&&(tt.type!=="text"||!pe.test(tt.data));)tt=tt[Ii];if(tt&&pe.exec(tt.data)[0]!==P)continue}}re&&(q=q.toUpperCase());let Ci=this.posFromIndex(E),{line:$i,character:Ni}=kt(L,I,Ci.top+1,Ci.left),ft={rule:xa[P],message:T.msg('lonely "$1"',re||P==="h"?q:P),severity:En,startIndex:he,endIndex:et,startLine:$i,endLine:$i,startCol:Ni,endCol:Ni+me};if(P==="<")ft.suggestions=[{desc:"escape",range:[he,he+1],text:"<"}];else if(P==="h"&&l!=="link-text"&&Dn.test(_r||""))ft.suggestions=[{desc:"whitespace",range:[he,he],text:" "}];else if(P==="["&&l==="ext-link-text"){let pe=i.getAbsoluteIndex()+i.toString().length;ft.suggestions=[{desc:"escape",range:[pe,pe+1],text:"]"}]}else if(P==="]"&&f==="free-ext-link"&&En==="error"){let pe=e-o.toString().length;ft.fix={range:[pe,pe],text:"[",desc:"left bracket"}}else re&&(ft.suggestions=[...N[0]===q?[]:[{desc:"uppercase",range:[he,et],text:q}],...He===":"||He==="\uFF1A"?[{desc:"whitespace",range:[et,et+1],text:" "}]:[]]);p.push(ft)}return p}replaceData(e){S(this,Gr,Qi).call(this,e)}print(){return Tt(this.data)}};Gr=new WeakSet,Qi=function(e){this.setAttribute("data",e)}});var xe,nt=A(()=>{"use strict";Ce();xe=(a=!0,r=!0)=>(e,t)=>{class n extends e{text(){return""}lint(s){return a?[]:super.lint(s)}}return zr(n,e),n}});var fr,be,$t=A(()=>{"use strict";O();be=class extends w{constructor(e,t,n,i,s,o){super(e,i,s,o);b(this,fr);k(this,fr,n)}get type(){return c(this,fr)}lint(e=this.getAbsoluteIndex()){return super.lint(e,!1)}};fr=new WeakMap});var Nt,V,je=A(()=>{"use strict";O();V=class extends w{constructor(e,t,n,i,s){super(e,n,i,s);b(this,Nt);k(this,Nt,t)}get type(){return c(this,Nt)}set type(e){k(this,Nt,e)}};Nt=new WeakMap});var Ta,it,$e,qe,Ie,xr=A(()=>{"use strict";D();J();ee();B();O();je();Ta=a=>a==="redirect-target"||a==="link",Ie=class extends w{constructor(e,t,n=T.getConfig(),i=[],s="|"){super(void 0,n,i,{});b(this,it,!0);b(this,$e);b(this,qe);if(this.insertAt(new V(e,"link-target",n,i,{})),t!==void 0){let o=new w(t,n,i,{});o.type="link-text",o.setAttribute("stage",10),this.insertAt(o)}k(this,$e,s)}get link(){return c(this,qe)}afterBuild(){k(this,qe,this.getTitle()),c(this,$e).includes("\0")&&k(this,$e,this.buildFromStr(c(this,$e),0)),this.setAttribute("name",c(this,qe).title),super.afterBuild()}setAttribute(e,t){e==="bracket"?k(this,it,t):e==="title"?k(this,qe,t):super.setAttribute(e,t)}toString(e){let t=super.toString(e,c(this,$e));return c(this,it)?`[[${t}]]`:t}text(){let e=super.text("|");return c(this,it)?`[[${e}]]`:e}getAttribute(e){return e==="title"?c(this,qe):e==="padding"?2:super.getAttribute(e)}getGaps(e){return e===0?c(this,$e).length:1}lint(e=this.getAbsoluteIndex(),t){let n=super.lint(e,t),{childNodes:[i,s],type:o}=this,{encoded:l,fragment:u}=c(this,qe),g=new R(this,e);if(i.childNodes.some(({type:d})=>d==="template")&&n.push($(i,g,"unknown-page","template in an internal link target","warning")),l){let d=$(i,g,"url-encoding","unnecessary URL encoding in an internal link");d.suggestions=[{desc:"decode",range:[d.startIndex,d.endIndex],text:Ge(i.text())}],n.push(d)}if(o==="link"||o==="category"){let d=s==null?void 0:s.childNodes.findIndex(m=>m.type==="text"&&m.data.includes("|")),p=s==null?void 0:s.childNodes[d];if(p){let m=$(s,g,"pipe-like",'additional "|" in the link text',"warning"),h=m.startIndex+s.getRelativeIndex(d);m.suggestions=[{desc:"escape",range:[h,h+p.data.length],text:p.data.replace(/\|/gu,"|")}],n.push(m)}}if(u!==void 0&&!Ta(o)){let d=$(i,g,"no-ignored","useless fragment"),p=i.childNodes.findIndex(h=>h.type==="text"&&h.data.includes("#")),m=i.childNodes[p];m&&(d.fix={range:[d.startIndex+i.getRelativeIndex(p)+m.data.indexOf("#"),d.endIndex],text:"",desc:"remove"}),n.push(d)}return n}getTitle(e){return this.normalizeTitle(this.firstChild.toString(!0),0,e,!0,!0)}print(){return super.print(c(this,it)?{pre:"[[",post:"]]",sep:c(this,$e)}:{sep:c(this,$e)})}};it=new WeakMap,$e=new WeakMap,qe=new WeakMap});var de,Ve=A(()=>{"use strict";O();de=class extends w{get innerText(){return this.firstChild.data}constructor(r="",e,t){super(r,e,t)}}});var Ji,Un,ya,K,Xe=A(()=>{"use strict";nt();Ve();Ji=[xe()];K=class extends(ya=de){get type(){return"noinclude"}toString(r){return r?"":super.toString()}};Un=se(ya),K=ae(Un,0,"NoincludeToken",Ji,K),oe(Un,1,K)});var Vr,Yi=A(()=>{"use strict";D();xr();Xe();Vr=class extends Ie{get type(){return"redirect-target"}constructor(r,e,t,n){super(r,void 0,t,n),e!==void 0&&this.insertAt(new K(e,t,n))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,!0,!0)}lint(r=this.getAbsoluteIndex()){let e=super.lint(r,!1);if(this.length===2){let t=$(this.lastChild,{start:r},"no-ignored","useless link text");t.startIndex--,t.startCol--,t.fix={range:[t.startIndex,t.endIndex],text:"",desc:"remove"},e.push(t)}return e}}});var Zi,Qe,It,Hn,ka,st,es=A(()=>{"use strict";nt();B();O();$t();Yi();Zi=[xe(!1,!1)];st=class extends(ka=w){constructor(e,t,n,i,s,o=T.getConfig(),l=[]){super(void 0,o,l);b(this,Qe);b(this,It);k(this,Qe,e),k(this,It,s);let u=new RegExp(String.raw`^(?:${o.redirection.join("|")})\s*(?::\s*)?$`,"iu");this.append(new be(t,u,"redirect-syntax",o,l,{}),new Vr(n,i==null?void 0:i.slice(1),o,l))}get type(){return"redirect"}getAttribute(e){return e==="padding"?c(this,Qe).length:super.getAttribute(e)}toString(e){return c(this,Qe)+super.toString(e)+c(this,It)}lint(e=this.getAbsoluteIndex()){return this.lastChild.lint(e+c(this,Qe).length+this.firstChild.toString().length)}print(){return super.print({pre:c(this,Qe),post:c(this,It)})}};Hn=se(ka),Qe=new WeakMap,It=new WeakMap,st=ae(Hn,0,"RedirectToken",Zi,st),oe(Hn,1,st)});var ts={};ie(ts,{parseRedirect:()=>va});var va,rs=A(()=>{"use strict";B();es();va=(a,r,e)=>{var n;(n=r.regexRedirect)!=null||(r.regexRedirect=new RegExp(String.raw`^(\s*)((?:${r.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));let t=r.regexRedirect.exec(a);return t&&T.normalizeTitle(t[3],0,!1,r,!0,!0).valid?(a=`\0${e.length}o\x7F${a.slice(t[0].length)}`,new st(...t.slice(1),r,e),a):!1}});var Xr,ns=A(()=>{"use strict";O();Xr=class extends w{get type(){return"onlyinclude"}toString(r){return`<onlyinclude>${super.toString(r)}</onlyinclude>`}getAttribute(r){return r==="padding"?13:r==="plain"||super.getAttribute(r)}print(){return super.print({pre:'<span class="wpb-ext"><onlyinclude></span>',post:'<span class="wpb-ext"></onlyinclude></span>'})}}});var Ke,Et,Gn=A(()=>{"use strict";O();Et=class extends w{constructor(e,t,n,i,s,o=[]){super(void 0,s);b(this,Ke);te(this,"closed");te(this,"selfClosing");this.setAttribute("name",e.toLowerCase()),k(this,Ke,[e,i||e]),this.closed=i!=="",this.selfClosing=i===void 0,this.append(t,n);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:n,lastChild:i}=this,[s,o]=c(this,Ke);return t?`<${s}${n.toString(e)}/>`:`<${s}${n.toString(e)}>${i.toString(e)}${this.closed?`</${o}>`:""}`}text(){let[e,t]=c(this,Ke);return this.selfClosing?`<${e}${this.firstChild.text()}/>`:`<${e}${super.text(">")}${this.closed?`</${t}>`:""}`}getAttribute(e){return e==="padding"?c(this,Ke)[0].length+1:super.getAttribute(e)}getGaps(){return 1}print(){let[e,t]=c(this,Ke);return super.print(this.selfClosing?{pre:`<${e}`,post:"/>"}:{pre:`<${e}`,sep:">",post:this.closed?`</${t}>`:""})}};Ke=new WeakMap});var is,zn,Aa,ot,ss=A(()=>{"use strict";D();ee();nt();B();Gn();is=[xe(!1)];ot=class extends(Aa=Et){get type(){return"include"}constructor(r,e="",t,n,i,s){super(r,e,t!=null?t:"",t===void 0||n!=null?n:"",i,s)}toString(r){return r?"":super.toString()}lint(r=this.getAbsoluteIndex()){let e=[],{firstChild:t,closed:n,name:i}=this,s=new R(this,r);if(t.data.trim()){let o=$(t,s,"no-ignored","useless attribute","warning");o.suggestions=[{desc:"remove",range:[o.startIndex,o.endIndex],text:""}],e.push(o)}if(!n){let o=F(this,s,"unclosed-comment",T.msg("unclosed $1",`<${i}>`));o.suggestions=[{desc:"close",range:[o.endIndex,o.endIndex],text:`</${i}>`}],e.push(o)}return e}};zn=se(Aa),ot=ae(zn,0,"IncludeToken",is,ot),oe(zn,1,ot)});var Lt,Qr=A(()=>{"use strict";Ce();Lt=(a=0)=>(r,e)=>{var n,os;class t extends r{constructor(){super(...arguments);b(this,n)}getAttr(l){return c(this,n,os).getAttr(l)}}return n=new WeakSet,os=function(){return this.childNodes[a]},zr(t,r),t}});var Y,as,ls,Jr,Vn,ds,Ft,gs,us,ps,Kr,Yr,Zr,en,cs,Xn=A(()=>{"use strict";Y=new Set(["align"]),as=new Set(["cite"]),ls=new Set(["cite","datetime"]),Jr=new Set(["width"]),Vn=new Set(["axis","align","bgcolor","height","width","valign"]),ds=new Set([...Vn,"abbr","headers","scope","rowspan","colspan"]),Ft=new Set(["type"]),gs=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),us=new Set(["clear"]),ps=new Set(["bgcolor","align","valign"]),Kr=new Set,Yr=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"]),Zr={div:Y,h1:Y,h2:Y,h3:Y,h4:Y,h5:Y,h6:Y,blockquote:as,q:as,p:Y,br:us,pre:Jr,ins:ls,del:ls,ul:Ft,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...gs,"border"]),caption:Y,tr:ps,td:ds,th:ds,img:new Set(["alt","src","width","height","srcset"]),font:new Set(["size","color","face"]),hr:Jr,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Ft,poem:Y,categorytree:Y,combooption:Y},en={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:Kr,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:Kr,inputbox:Kr,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:Kr,poll:new Set(["id","show-results-before-voting"]),sm2:Ft,flashmp3:Ft,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"])},cs={table:gs,td:new Set([...Vn,"scope"]),th:Vn,br:us,caption:Y,div:Y,hr:Jr,h1:Y,h2:Y,h3:Y,h4:Y,h5:Y,h6:Y,li:Ft,p:Y,pre:Jr,tr:ps,ul:Ft}});var wa,br,Pt,ne,Ee,Rt,ms=A(()=>{"use strict";D();J();Xn();ee();B();O();je();wa=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,Rt=class extends w{constructor(e,t,n,i="",s,o=[],l=T.getConfig(),u=[]){let g=new V(n,"attr-key",l,u),d;if(n==="title"||t==="img"&&n==="alt")d=new w(s,l,u,{}),d.type="attr-value",d.setAttribute("stage",10);else if(t==="gallery"&&n==="caption"||t==="choose"&&(n==="before"||n==="after")){let p={...l,excludes:[...l.excludes,"heading","html","table","hr","list"]};d=new w(s,p,u,{}),d.type="attr-value",d.setAttribute("stage",1)}else d=new V(s,"attr-value",l,u,{});super(void 0,l,u);b(this,br);b(this,Pt);b(this,ne);b(this,Ee);k(this,br,e),this.append(g,d),k(this,ne,i),k(this,Ee,[...o]),k(this,Pt,t),this.setAttribute("name",le(n).trim().toLowerCase())}get type(){return c(this,br)}get tag(){return c(this,Pt)}get balanced(){return!c(this,ne)||c(this,Ee)[0]===c(this,Ee)[1]}afterBuild(){c(this,ne).includes("\0")&&k(this,ne,this.buildFromStr(c(this,ne),0)),this.parentNode&&k(this,Pt,this.parentNode.name),this.setAttribute("name",this.firstChild.toString(!0).trim().toLowerCase()),super.afterBuild()}toString(e){let[t="",n=""]=c(this,Ee);return c(this,ne)?super.toString(e,c(this,ne)+t)+n:this.firstChild.toString(e)}text(){return c(this,ne)?`${super.text(`${c(this,ne).trim()}"`)}"`:this.firstChild.text()}getGaps(){var e,t;return c(this,ne)?c(this,ne).length+((t=(e=c(this,Ee)[0])==null?void 0:e.length)!=null?t:0):0}lint(e=this.getAbsoluteIndex(),t){var x;let n=super.lint(e,t),{balanced:i,firstChild:s,lastChild:o,type:l,name:u,tag:g}=this,d=this.getValue(),p=new R(this,e);if(!i){let y=$(o,p,"unclosed-quote",T.msg("unclosed $1","quotes"),"warning");y.startIndex--,y.startCol--,y.suggestions=[{range:[y.endIndex,y.endIndex],text:c(this,Ee)[0],desc:"close"}],n.push(y)}let m=en[g],h=Zr[g],{length:f}=this.toString();if(!(m!=null&&m.has(u))&&!(h!=null&&h.has(u))&&(l==="ext-attr"?m||h:!/\{\{[^{]+\}\}/u.test(u))&&(l==="ext-attr"&&!h||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(u)&&(g==="meta"||g==="link"||!Yr.has(u)))){let y=$(s,p,"illegal-attr","illegal attribute name");y.suggestions=[{desc:"remove",range:[e,e+f],text:""}],n.push(y)}else if((x=cs[g])!=null&&x.has(u))n.push($(s,p,"obsolete-attr","obsolete attribute","warning"));else if(u==="style"&&typeof d=="string"&&wa.test(d))n.push($(o,p,"insecure-style","insecure style"));else if(u==="tabindex"&&typeof d=="string"&&d!=="0"){let y=$(o,p,"illegal-attr","nonzero tabindex");y.suggestions=[{desc:"remove",range:[e,e+f],text:""},{desc:"0 tabindex",range:[y.startIndex,y.endIndex],text:"0"}],n.push(y)}return n}getValue(){return c(this,ne)?this.lastChild.text().trim():this.type==="ext-attr"||""}print(){let[e="",t=""]=c(this,Ee);return c(this,ne)?super.print({sep:Tt(c(this,ne))+e,post:t}):super.print()}};br=new WeakMap,Pt=new WeakMap,ne=new WeakMap,Ee=new WeakMap});var hs,Sa,Qn,Tr,Je,tn=A(()=>{"use strict";D();J();ee();B();O();je();ms();hs=a=>a.slice(0,-1),Sa=a=>`${hs(a)}-dirty`;try{Qn=new RegExp(String.raw`[\p{L}\d]`,"u")}catch(a){Qn=/[^\W_]/u}Je=class extends w{constructor(e,t,n,i=T.getConfig(),s=[]){super(void 0,i,s,{});b(this,Tr);if(k(this,Tr,t),this.setAttribute("name",n),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="",u=o.exec(e),g=0,d=()=>{l&&(super.insertAt(new V(l,Sa(t),i,s,{})),l="")};for(;u;){let{index:p,0:m,1:h,2:f,3:x,4:y,5:v,6:C}=u;if(l+=e.slice(g,p),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(le(h).trim())){let L=y!=null?y:C,I=[x,v],U=new Rt(hs(t),n,h,f,L,I,i,s);d(),super.insertAt(U)}else l+=m;({lastIndex:g}=o),u=o.exec(e)}l+=e.slice(g),d()}}get type(){return c(this,Tr)}afterBuild(){let{parentNode:e}=this;(e==null?void 0:e.type)==="td"&&e.subtype==="caption"&&this.setAttribute("name","caption"),super.afterBuild()}getAttrTokens(e){return this.childNodes.filter(t=>t instanceof Rt&&(!e||t.name===e.toLowerCase().trim()))}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 n=super.lint(e,t),{parentNode:i,childNodes:s}=this,o=new Map,l=new Set,u=new R(this,e);if((i==null?void 0:i.type)==="html"&&i.closing&&this.text().trim()){let g=F(this,u,"no-ignored","attributes of a closing tag"),d=i.getAbsoluteIndex();g.suggestions=[{desc:"remove",range:[e,g.endIndex],text:""},{desc:"open",range:[d+1,d+2],text:""}],n.push(g)}for(let g of s)if(g instanceof Rt){let{name:d}=g;o.has(d)?(l.add(d),o.get(d).push(g)):o.set(d,[g])}else{let d=g.text().trim();if(d){let p=$(g,u,"no-ignored","containing invalid attribute",Qn.test(d)?"error":"warning");p.suggestions=[{desc:"remove",range:[p.startIndex,p.endIndex],text:" "}],n.push(p)}}if(l.size>0)for(let g of l){let d=o.get(g).map(p=>{let m=p.getValue();return[p,m===!0?"":m]});n.push(...d.map(([p,m],h)=>{let f=$(p,u,"no-duplicate",T.msg("duplicated $1 attribute",g)),x={desc:"remove",range:[f.startIndex,f.endIndex],text:""};return!m||d.slice(0,h).some(([,y])=>y===m)?f.fix=x:f.suggestions=[x],f}))}return n}print(){return this.toString()?`<span class="wpb-${this.type}">${this.childNodes.map(e=>e.print(e instanceof V?{class:e.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}};Tr=new WeakMap});var rn,fs=A(()=>{"use strict";B();O();Xe();rn=class extends w{get type(){return"ext-inner"}constructor(r,e=T.getConfig(),t=[]){if(r){let n=/<nowiki>/giu,i=/<\/nowiki>/giu,{length:s}=n.source,o=n.exec(r);o&&(i.lastIndex=o.index+s);let l=i.exec(r),u=0,g="";for(;o&&l;)new K(o[0],e,t),new K(l[0],e,t),g+=`${r.slice(u,o.index)}\0${t.length-1}n\x7F${r.slice(o.index+s,l.index)}\0${t.length}n\x7F`,u=l.index+s+1,n.lastIndex=u,o=n.exec(r),o&&(i.lastIndex=o.index+s),l=i.exec(r);r=g+r.slice(u)}super(r,e,t,{}),this.setAttribute("stage",10)}getAttribute(r){return r==="plain"||super.getAttribute(r)}lint(r=this.getAbsoluteIndex()){return super.lint(r,/<\s*\/\s*(pre)\b/giu)}}});var Bt,Kn=A(()=>{"use strict";D();ee();yr();B();O();je();Bt=class extends w{get type(){return"ext-inner"}constructor(r,e,t=T.getConfig(),n=[],i){if(super(void 0,t,n,{}),e){let s=V;this.append(...e.split(`
|
|
3
|
-
`).map(o=>i?o:at(o,t,n
|
|
1
|
+
"use strict";(()=>{var ea=Object.create;var Tt=Object.defineProperty;var Fi=Object.getOwnPropertyDescriptor;var ta=Object.getOwnPropertyNames;var ra=Object.prototype.hasOwnProperty;var Pi=(a,n)=>(n=Symbol[a])?n:Symbol.for("Symbol."+a),yt=a=>{throw TypeError(a)};var Ri=(a,n,e)=>n in a?Tt(a,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[n]=e;var Li=(a,n)=>Tt(a,"name",{value:n,configurable:!0});var S=(a,n)=>()=>(a&&(n=a(a=0)),n);var na=(a,n)=>()=>(n||a((n={exports:{}}).exports,n),n.exports),se=(a,n)=>{for(var e in n)Tt(a,e,{get:n[e],enumerable:!0})},ia=(a,n,e,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of ta(n))!ra.call(a,r)&&r!==e&&Tt(a,r,{get:()=>n[r],enumerable:!(t=Fi(n,r))||t.enumerable});return a};var J=a=>ia(Tt({},"__esModule",{value:!0}),a);var oe=a=>{var n;return[,,,ea((n=a==null?void 0:a[Pi("metadata")])!=null?n:null)]},ji=["class","method","getter","setter","accessor","field","value","get","set"],lr=a=>a!==void 0&&typeof a!="function"?yt("Function expected"):a,sa=(a,n,e,t,r)=>({kind:ji[a],name:n,metadata:t,addInitializer:i=>e._?yt("Already initialized"):r.push(lr(i||null))}),oa=(a,n)=>Ri(n,Pi("metadata"),a[3]),ae=(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},le=(a,n,e,t,r,i)=>{var s,o,l,d,g,u=n&7,p=!!(n&8),h=!!(n&16),m=u>3?a.length+1:u?p?1:2:0,f=ji[u+5],x=u>3&&(a[m-1]=[]),k=a[m]||(a[m]=[]),A=u&&(!h&&!p&&(r=r.prototype),u<5&&(u>3||!h)&&Fi(u<4?r:{get[e](){return c(this,i)},set[e](N){return b(this,i,N)}},e));u?h&&u<4&&Li(i,(u>2?"set ":u>1?"get ":"")+e):Li(r,e);for(var C=t.length-1;C>=0;C--)d=sa(u,e,l={},a[3],k),u&&(d.static=p,d.private=h,g=d.access={has:h?N=>aa(r,N):N=>e in N},u^3&&(g.get=h?N=>(u^1?c:v)(N,r,u^4?i:A.get):N=>N[e]),u>2&&(g.set=h?(N,E)=>b(N,r,E,u^4?i:A.set):(N,E)=>N[e]=E)),o=(0,t[C])(u?u<4?h?i:A[f]:u>4?void 0:{get:A.get,set:A.set}:r,d),l._=1,u^4||o===void 0?lr(o)&&(u>4?x.unshift(o):u?h?i=o:A[f]=o:r=o):typeof o!="object"||o===null?yt("Object expected"):(lr(s=o.get)&&(A.get=s),lr(s=o.set)&&(A.set=s),lr(s=o.init)&&x.unshift(s));return u||oa(a,r),A&&Tt(r,e,A),h?u^4?i:A:r},ne=(a,n,e)=>Ri(a,typeof n!="symbol"?n+"":n,e),Pn=(a,n,e)=>n.has(a)||yt("Cannot "+e),aa=(a,n)=>Object(n)!==n?yt('Cannot use the "in" operator on this value'):a.has(n),c=(a,n,e)=>(Pn(a,n,"read from private field"),e?e.call(a):n.get(a)),T=(a,n,e)=>n.has(a)?yt("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(a):n.set(a,e),b=(a,n,e,t)=>(Pn(a,n,"write to private field"),t?t.call(a,e):n.set(a,e),e),v=(a,n,e)=>(Pn(a,n,"access private method"),e);var Ur=(a,n,e,t)=>({set _(r){b(a,n,r,e)},get _(){return c(a,n,t)}});var Bi,qi,_i=S(()=>{"use strict";Bi=(()=>{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};return Object.setPrototypeOf(a,null),a})(),qi=(()=>{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})()});var He,dr,la,Oi,Rn=S(()=>{"use strict";He=a=>decodeURIComponent(a.replace(/%(?![\da-f]{2})/giu,"%25")),dr=a=>Math.round(a*255).toString(16).padStart(2,"0"),la=(()=>{let a=String.raw`#(?:[\da-f]{3,4}|(?:[\da-f]{2}){3,4})(?![\p{L}\d_])`,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}\d_])(${a}|${t}|${r})`,"giu"),rgb:new RegExp(String.raw`(^|[^\p{L}\d_])(${a}|${t})`,"giu")}})(),Oi=(a,n=!0)=>{let e=[],t=la[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.charAt(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 Ce,Mi,Pe,Re,tt,gr,de,Di,be,da,ga,rt,Wi,Ui,ua,pa,kt,je,Q=S(()=>{"use strict";Rn();Ce=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Mi=String.raw`[^[\]<>"\0-\x1F\x7F${Ce}\uFFFD]`,Pe=String.raw`(?:\[[\da-f:.]+\]|${Mi})`,Re=String.raw`(?:${Mi}|\0\d+[cn!~]\x7F)*`,tt=(a,n)=>e=>e.replace(a,n),gr=tt(/[\0\x7F]|\r$/gmu,""),de=tt(/\0\d+[cn]\x7F/gu,""),Di=tt(/[\\{}()|.?*+^$[\]]/gu,String.raw`\$&`),be=(a,n="")=>a.map(e=>typeof e=="string"?e:e.text()).join(n),da={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},ga=tt(/&(?:#(\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)):da[e.toLowerCase()]),rt=a=>ga(a),Wi=tt(/&#(\d+|x[\da-f]+);/giu,(a,n)=>String.fromCodePoint(+((/^x/iu.test(n)?"0":"")+n))),Ui=tt(/\n/gu,String.raw`\n`),ua={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},pa=a=>tt(a,n=>`&${ua[n]};`),kt=pa(/[&<>]/gu),je=(a,n={})=>{let{pre:e="",post:t="",sep:r=""}=n;return e+a.map(i=>i.print()).join(r)+t}});var Hi=na((xl,ca)=>{ca.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},variable:["!","=","pageid","articlepath","server","servername","scriptpath","stylepath"],parserFunction:[{"#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","#replace":"replace","#explode":"explode","#tab":"tab","#seo":"seo","#babel":"babel","#commaseparatedlist":"commaseparatedlist","#coordinates":"coordinates","#lst":"lst","#lsth":"lsth","#lstx":"lstx","#assessment":"assessment","#mentor":"mentor","#property":"property","#target":"target","#section":"section","#section-x":"section-x","#section-h":"section-h","#statements":"statements"},{"!":"!","=":"=","#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 jn,zi=S(()=>{"use strict";jn=Hi()});var ur,vt,pr,cr,Bn,R,ee=S(()=>{"use strict";R=class{constructor(n,e){T(this,cr);T(this,ur);T(this,vt);T(this,pr);b(this,ur,n),b(this,vt,e)}get start(){return c(this,vt)}get top(){return v(this,cr,Bn).call(this).top}get left(){return v(this,cr,Bn).call(this).left}};ur=new WeakMap,vt=new WeakMap,pr=new WeakMap,cr=new WeakSet,Bn=function(){var n;return(n=c(this,pr))!=null||b(this,pr,c(this,ur).getRootNode().posFromIndex(c(this,vt))),c(this,pr)}});var At,Gi,$,L,Be,W=S(()=>{"use strict";$e();ee();j();At=(a,n,e,t)=>({line:a+e-1,character:(e===1?n:0)+t}),Gi=a=>(n,e,t,r,i="error")=>{let{start:s}=e,{top:o,left:l}=e instanceof R?e:new R(n,s),{offsetHeight:d,offsetWidth:g}=n,{startIndex:u,startLine:p,startCol:h}=a(n,s,o,l),{line:m,character:f}=At(p,h,d,g);return{rule:t,message:y.msg(r),severity:i,startIndex:u,endIndex:u+n.toString().length,startLine:p,endLine:m,startCol:h,endCol:f}},$=Gi((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}}),L=Gi((a,n,e,t)=>({startIndex:n,startLine:e,startCol:t})),Be=(a,n,e)=>{if(a)return a[1];let t=n();return e([ue.rev,t]),t}});var ma,Hr,Vi=S(()=>{"use strict";ma=(a,n,e)=>{let[t,...r]=a.split("#");return(!t||t===n)&&r.every(i=>i===e)},Hr=(a,n,e)=>({type:t,name:r})=>a.split(",").some(i=>ma(i.trim(),t,r))});var mr,St,wt,hr,fr,Ct,$t,Nt,zr,It,qn=S(()=>{"use strict";W();$e();It=class{constructor(){T(this,Nt);ne(this,"childNodes",[]);T(this,mr);T(this,St);T(this,wt);T(this,hr);T(this,fr);T(this,Ct);T(this,$t,{})}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get parentNode(){return c(this,mr)}get nextSibling(){return c(this,St)}get previousSibling(){return c(this,wt)}get offsetHeight(){return v(this,Nt,zr).call(this).height}get offsetWidth(){return v(this,Nt,zr).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":b(this,mr,e),e||(b(this,St,void 0),b(this,wt,void 0));break;case"nextSibling":b(this,St,e);break;case"previousSibling":b(this,wt,e);break;case"aIndex":b(this,Ct,[ue.rev,e]);break;default:this[n]=e}}getRootNode(){return Be(c(this,fr),()=>{var n,e;return(e=(n=this.parentNode)==null?void 0:n.getRootNode())!=null?e:this},n=>{let[,e]=n;e.type==="root"&&b(this,fr,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}}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 Be(c(this,$t)[n],()=>{let{childNodes:e}=this,t=n+(n<0?e.length:0),r=this.getAttribute("padding");for(let i=0;i<t;i++)c(this,$t)[i]=[ue.rev,r],r+=e[i].toString().length+this.getGaps(i);return r},e=>{c(this,$t)[n]=e})}getAbsoluteIndex(){return Be(c(this,Ct),()=>{let{parentNode:n}=this;return n?n.getAbsoluteIndex()+this.getRelativeIndex():0},n=>{b(this,Ct,n)})}getBoundingClientRect(){return{...v(this,Nt,zr).call(this),...this.getRootNode().posFromIndex(this.getAbsoluteIndex())}}seal(n,e){Object.defineProperty(this,n,{enumerable:!e&&!!this[n],configurable:!0})}is(n){return this.type===n}getLines(){return Be(c(this,hr),()=>{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=>{b(this,hr,n)})}};mr=new WeakMap,St=new WeakMap,wt=new WeakMap,hr=new WeakMap,fr=new WeakMap,Ct=new WeakMap,$t=new WeakMap,Nt=new WeakSet,zr=function(){let n=this.getLines(),e=n[n.length-1];return{height:n.length,width:e[2]-e[1]}}});var ze,_n,On,Gr,Xi=S(()=>{"use strict";Q();$e();Vi();qn();Gr=class extends It{constructor(){super(...arguments);T(this,ze)}get length(){return this.childNodes.length}text(e){return be(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 Mn(this,e,1)[0]}insertAt(e,t=this.length){return Mn(this,t,0,[e]),e}closest(e){let t=Hr(e,this),{parentNode:r}=this;for(;r;){if(t(r))return r;({parentNode:r}=r)}}querySelector(e){let t=Hr(e,this);return v(this,ze,_n).call(this,t)}querySelectorAll(e){let t=Hr(e,this);return v(this,ze,On).call(this,t)}append(...e){for(let t of e)this.insertAt(t)}replaceChildren(...e){for(let t=this.length-1;t>=0;t--)this.removeAt(t);this.append(...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 d=o[l],{nextSibling:g}=d,u=d.toString(),p=u.length;if(i+=p,i>e||i===e&&p>0&&(!g||g.type==="text"||d.type!=="text"&&(u.trim()||!g.toString().trim()))){r=d,i-=p,s=i;break}i+=r.getGaps(l)}if(r.childNodes===o)return{offsetNode:r,offset:e-s}}return{offsetNode:r,offset:e-s}}}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}}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),r.push(...o.lint(s,t)),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}">`)+je(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}};ze=new WeakSet,_n=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,ze,_n).call(t,e);if(i)return i}},On=function(e){var r;let t=[];for(let i of this.childNodes)i.type!=="text"&&(e(i)&&t.push(i),t.push(...v(r=i,ze,On).call(r,e)));return t}});var Dn,Qi,ha,fa,xa,ba,Ta,ya,Wn,Vr,Ki,xr,Ji=S(()=>{"use strict";Q();W();j();qn();Dn=String.raw`[${Ce}\t]*`,Qi=String.raw`<\s*(?:/\s*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${Dn}\d)|isbn(?=[-::]?${Dn}(?:\d(?:${Dn}|-)){6})`,ha=new RegExp(String.raw`${Qi}|https?[:/]/+`,"giu"),fa=new RegExp(Qi,"giu"),xa=new Set(["attr-value","ext-link-text","link-text"]),ba={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},Ta={"<":"tag-like","[":"lonely-bracket","{":"lonely-bracket","]":"lonely-bracket","}":"lonely-bracket",h:"lonely-http",r:"lonely-http",p:"lonely-http",i:"lonely-http"},ya=["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{Wn=new RegExp(String.raw`[\p{L}\d_]`,"u")}catch(a){Wn=/\w/u}xr=class extends It{constructor(e){super();T(this,Vr);ne(this,"data","");Object.defineProperties(this,{childNodes:{enumerable:!1,configurable:!1},data:{value:e}})}get type(){return"text"}toString(e){var t;return e&&!((t=this.parentNode)!=null&&t.getAttribute("built"))?de(this.data):this.data}text(){return this.data}lint(e=this.getAbsoluteIndex(),t){var te,_,V;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:d,parentNode:g}=i,u=!1;if(l==="attr-value"){let{type:F,name:O,tag:D}=g;if(F!=="ext-attr")u=!0;else if(D==="choose"&&(O==="before"||O==="after"))return[]}if(t!=null||(t=l==="free-ext-link"||l==="ext-link-url"||l==="ext-link-text"||l==="image-parameter"&&d==="link"||u?fa:ha),r.search(t)===-1)return[];t.lastIndex=0;let p=[],h=s==null?void 0:s.type,m=s==null?void 0:s.name,f=o==null?void 0:o.type,x=this.getRootNode(),k=x.toString(),{ext:A,html:C}=x.getAttribute("config"),{top:N,left:E}=x.posFromIndex(e),M=new Set(["onlyinclude","noinclude","includeonly",...A,...C[0],...C[1],...C[2],...ya]);for(let F=t.exec(r);F;F=t.exec(r)){let[,O,D]=F,{index:I}=F,U=F[0].toLowerCase();if(D&&D!=="]"){let{length:he}=D;I+=he,U=U.slice(he)}let{0:P,length:re}=U,Z=P==="r"||P==="p"||P==="i";if(P==="<"&&!M.has(O.toLowerCase())||P==="["&&l==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(r.slice(I+1))||s!=null&&s.is("ext")&&m==="nowiki"&&((te=s.innerText)!=null&&te.includes("]")))||Z&&(!i.getAttribute("plain")||xa.has(l)))continue;P==="]"&&(I||re>1)&&t.lastIndex--;let ce=e+I,Ze=ce+re,Ue=k[Ze],Wr=k[ce-1],En=re>1&&!(P==="<"&&!/[\s/>]/u.test(Ue!=null?Ue:"")||u&&(P==="["||P==="]")||Z&&l==="parameter-value")||P==="{"&&(Ue===P||Wr==="-")||P==="}"&&(Wr===P||Ue==="-")||P==="["&&(Ue===P||l==="ext-link-text"||h==="free-ext-link"&&!r.slice(I+1).trim())||P==="]"&&(Wr===P||f==="free-ext-link"&&!r.slice(0,I).includes("]"))?"error":"warning",Ln=P==="{"||P==="[";if(En==="warning"&&(Ln||(P==="]"||P==="}"))){let he=ba[P],Fn=Ln?r.slice(I+1):r.slice(0,I);if(P==="{"&&((_=he.exec(Fn))==null?void 0:_[0])==="}"||P==="}"&&((V=he.exec(Fn))==null?void 0:V[0])==="{")continue;if(!Fn.includes(P)){let Ei=Ln?"nextSibling":"previousSibling",et=this[Ei];for(;et&&(et.type!=="text"||!he.test(et.data));)et=et[Ei];if(et&&he.exec(et.data)[0]!==P)continue}}Z&&(U=U.toUpperCase());let $i=this.posFromIndex(I),{line:Ni,character:Ii}=At(N,E,$i.top+1,$i.left),bt={rule:Ta[P],message:y.msg('lonely "$1"',Z||P==="h"?U:P),severity:En,startIndex:ce,endIndex:Ze,startLine:Ni,endLine:Ni,startCol:Ii,endCol:Ii+re};if(P==="<")bt.suggestions=[{desc:"escape",range:[ce,ce+1],text:"<"}];else if(P==="h"&&l!=="link-text"&&Wn.test(Wr||""))bt.suggestions=[{desc:"whitespace",range:[ce,ce],text:" "}];else if(P==="["&&l==="ext-link-text"){let he=i.getAbsoluteIndex()+i.toString().length;bt.suggestions=[{desc:"escape",range:[he,he+1],text:"]"}]}else if(P==="]"&&f==="free-ext-link"&&En==="error"){let he=e-o.toString().length;bt.fix={range:[he,he],text:"[",desc:"left bracket"}}else Z&&(bt.suggestions=[...F[0]===U?[]:[{desc:"uppercase",range:[ce,Ze],text:U}],...Ue===":"||Ue==="\uFF1A"?[{desc:"whitespace",range:[Ze,Ze+1],text:" "}]:[]]);p.push(bt)}return p}replaceData(e){v(this,Vr,Ki).call(this,e)}print(){return kt(this.data)}};Vr=new WeakSet,Ki=function(e){this.setAttribute("data",e)}});var Te,nt=S(()=>{"use strict";$e();Te=(a=!0,n=!0)=>(e,t)=>{class r extends e{text(){return""}lint(s){return a?[]:super.lint(s)}}return Xr(r,e),r}});var br,ye,Et=S(()=>{"use strict";B();ye=class extends w{constructor(e,t,r,i,s,o){super(e,i,s,o);T(this,br);b(this,br,r)}get type(){return c(this,br)}lint(e=this.getAbsoluteIndex()){return super.lint(e,!1)}};br=new WeakMap});var Lt,G,qe=S(()=>{"use strict";B();G=class extends w{constructor(e,t,r,i,s){super(e,r,i,s);T(this,Lt);b(this,Lt,t)}get type(){return c(this,Lt)}set type(e){b(this,Lt,e)}};Lt=new WeakMap});var ka,it,Ne,Ee,Le,Tr=S(()=>{"use strict";W();Q();ee();j();B();qe();ka=a=>a==="redirect-target"||a==="link",Le=class extends w{constructor(e,t,r=y.getConfig(),i=[],s="|"){super(void 0,r,i,{});T(this,it,!0);T(this,Ne);T(this,Ee);if(this.insertAt(new G(e,"link-target",r,i,{})),t!==void 0){let o=new w(t,r,i,{});o.type="link-text",o.setAttribute("stage",10),this.insertAt(o)}b(this,Ne,s)}get link(){return c(this,Ee)}get fragment(){return c(this,Ee).fragment}afterBuild(){b(this,Ee,this.getTitle()),c(this,Ne).includes("\0")&&b(this,Ne,this.buildFromStr(c(this,Ne),0)),this.setAttribute("name",c(this,Ee).title),super.afterBuild()}setAttribute(e,t){e==="bracket"?b(this,it,t):e==="title"?b(this,Ee,t):super.setAttribute(e,t)}toString(e){let t=super.toString(e,c(this,Ne));return c(this,it)?`[[${t}]]`:t}text(){let e=super.text("|");return c(this,it)?`[[${e}]]`:e}getAttribute(e){return e==="title"?c(this,Ee):e==="padding"?2:super.getAttribute(e)}getGaps(e){return e===0?c(this,Ne).length:1}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{childNodes:[i,s],type:o}=this,{encoded:l,fragment:d}=c(this,Ee),g=new R(this,e);if(i.childNodes.some(({type:u})=>u==="template")&&r.push($(i,g,"unknown-page","template in an internal link target","warning")),l){let u=$(i,g,"url-encoding","unnecessary URL encoding in an internal link");u.suggestions=[{desc:"decode",range:[u.startIndex,u.endIndex],text:He(i.text())}],r.push(u)}if(o==="link"||o==="category"){let u=s==null?void 0:s.childNodes.findIndex(h=>h.type==="text"&&h.data.includes("|")),p=s==null?void 0:s.childNodes[u];if(p){let h=$(s,g,"pipe-like",'additional "|" in the link text',"warning"),m=h.startIndex+s.getRelativeIndex(u);h.suggestions=[{desc:"escape",range:[m,m+p.data.length],text:p.data.replace(/\|/gu,"|")}],r.push(h)}}if(d!==void 0&&!ka(o)){let u=$(i,g,"no-ignored","useless fragment"),p=i.childNodes.findIndex(m=>m.type==="text"&&m.data.includes("#")),h=i.childNodes[p];h&&(u.fix={range:[u.startIndex+i.getRelativeIndex(p)+h.data.indexOf("#"),u.endIndex],text:"",desc:"remove"}),r.push(u)}return r}getTitle(e,t){return this.normalizeTitle(this.firstChild.toString(!0),0,e,t,!0,!0)}print(){return super.print(c(this,it)?{pre:"[[",post:"]]",sep:c(this,Ne)}:{sep:c(this,Ne)})}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}};it=new WeakMap,Ne=new WeakMap,Ee=new WeakMap});var ge,Ge=S(()=>{"use strict";B();ge=class extends w{get innerText(){return this.firstChild.data}constructor(n="",e,t){super(n,e,t)}}});var Yi,Un,va,K,Ve=S(()=>{"use strict";nt();Ge();Yi=[Te()];K=class extends(va=ge){get type(){return"noinclude"}toString(n){return n?"":super.toString()}};Un=oe(va),K=le(Un,0,"NoincludeToken",Yi,K),ae(Un,1,K)});var Qr,Zi=S(()=>{"use strict";W();Tr();Ve();Qr=class extends Le{get type(){return"redirect-target"}constructor(n,e,t,r){super(n,void 0,t,r),e!==void 0&&this.insertAt(new K(e,t,r))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,!1,!0,!0)}lint(n=this.getAbsoluteIndex()){let e=super.lint(n,!1);if(this.length===2){let t=$(this.lastChild,{start:n},"no-ignored","useless link text");t.startIndex--,t.startCol--,t.fix={range:[t.startIndex,t.endIndex],text:"",desc:"remove"},e.push(t)}return e}}});var es,Xe,Ft,Hn,Aa,st,ts=S(()=>{"use strict";nt();j();B();Et();Zi();es=[Te(!1,!1)];st=class extends(Aa=w){constructor(e,t,r,i,s,o=y.getConfig(),l=[]){super(void 0,o,l);T(this,Xe);T(this,Ft);b(this,Xe,e),b(this,Ft,s);let d=new RegExp(String.raw`^(?:${o.redirection.join("|")})\s*(?::\s*)?$`,"iu");this.append(new ye(t,d,"redirect-syntax",o,l,{}),new Qr(r,i==null?void 0:i.slice(1),o,l))}get type(){return"redirect"}getAttribute(e){return e==="padding"?c(this,Xe).length:super.getAttribute(e)}toString(e){return c(this,Xe)+super.toString(e)+c(this,Ft)}lint(e=this.getAbsoluteIndex()){return this.lastChild.lint(e+c(this,Xe).length+this.firstChild.toString().length)}print(){return super.print({pre:c(this,Xe),post:c(this,Ft)})}};Hn=oe(Aa),Xe=new WeakMap,Ft=new WeakMap,st=le(Hn,0,"RedirectToken",es,st),ae(Hn,1,st)});var rs={};se(rs,{parseRedirect:()=>Sa});var Sa,ns=S(()=>{"use strict";j();ts();Sa=(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&&y.normalizeTitle(t[3],0,!1,n,!0,!0,!0).valid?(a=`\0${e.length}o\x7F${a.slice(t[0].length)}`,new st(...t.slice(1),n,e),a):!1}});var Kr,is=S(()=>{"use strict";B();Kr=class extends w{get type(){return"onlyinclude"}toString(n){return`<onlyinclude>${super.toString(n)}</onlyinclude>`}getAttribute(n){return n==="padding"?13:n==="plain"||super.getAttribute(n)}print(){return super.print({pre:'<span class="wpb-ext"><onlyinclude></span>',post:'<span class="wpb-ext"></onlyinclude></span>'})}}});var Qe,Pt,zn=S(()=>{"use strict";B();Pt=class extends w{constructor(e,t,r,i,s,o=[]){super(void 0,s);T(this,Qe);ne(this,"closed");ne(this,"selfClosing");this.setAttribute("name",e.toLowerCase()),b(this,Qe,[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,Qe);return t?`<${s}${r.toString(e)}/>`:`<${s}${r.toString(e)}>${i.toString(e)}${this.closed?`</${o}>`:""}`}text(){let[e,t]=c(this,Qe);return this.selfClosing?`<${e}${this.firstChild.text()}/>`:`<${e}${super.text(">")}${this.closed?`</${t}>`:""}`}getAttribute(e){return e==="padding"?c(this,Qe)[0].length+1:super.getAttribute(e)}getGaps(){return 1}print(){let[e,t]=c(this,Qe);return super.print(this.selfClosing?{pre:`<${e}`,post:"/>"}:{pre:`<${e}`,sep:">",post:this.closed?`</${t}>`:""})}};Qe=new WeakMap});var ss,Gn,wa,ot,os=S(()=>{"use strict";W();ee();nt();j();zn();ss=[Te(!1)];ot=class extends(wa=Pt){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 R(this,n);if(t.data.trim()){let o=$(t,s,"no-ignored","useless attribute","warning");o.suggestions=[{desc:"remove",range:[o.startIndex,o.endIndex],text:""}],e.push(o)}if(!r){let o=L(this,s,"unclosed-comment",y.msg("unclosed $1",`<${i}>`));o.suggestions=[{desc:"close",range:[o.endIndex,o.endIndex],text:`</${i}>`}],e.push(o)}return e}};Gn=oe(wa),ot=le(Gn,0,"IncludeToken",ss,ot),ae(Gn,1,ot)});var Rt,Jr=S(()=>{"use strict";$e();Rt=(a=0)=>(n,e)=>{var r,as;class t extends n{constructor(){super(...arguments);T(this,r)}getAttr(l){return v(this,r,as).call(this).getAttr(l)}}return r=new WeakSet,as=function(){return this.childNodes[a]},Xr(t,n),t}});var Y,ls,ds,Zr,Vn,gs,jt,us,ps,cs,Yr,en,tn,rn,ms,Xn=S(()=>{"use strict";Y=new Set(["align"]),ls=new Set(["cite"]),ds=new Set(["cite","datetime"]),Zr=new Set(["width"]),Vn=new Set(["axis","align","bgcolor","height","width","valign"]),gs=new Set([...Vn,"abbr","headers","scope","rowspan","colspan"]),jt=new Set(["type"]),us=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),ps=new Set(["clear"]),cs=new Set(["bgcolor","align","valign"]),Yr=new Set,en=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"]),tn={div:Y,h1:Y,h2:Y,h3:Y,h4:Y,h5:Y,h6:Y,blockquote:ls,q:ls,p:Y,br:ps,pre:Zr,ins:ds,del:ds,ul:jt,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...us,"border"]),caption:Y,tr:cs,td:gs,th:gs,img:new Set(["alt","src","width","height","srcset"]),font:new Set(["size","color","face"]),hr:Zr,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:jt,poem:Y,categorytree:Y,combooption:Y},rn={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:Yr,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:Yr,inputbox:Yr,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:Yr,poll:new Set(["id","show-results-before-voting"]),sm2:jt,flashmp3:jt,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"])},ms={table:us,td:new Set([...Vn,"scope"]),th:Vn,br:ps,caption:Y,div:Y,hr:Zr,h1:Y,h2:Y,h3:Y,h4:Y,h5:Y,h6:Y,li:jt,p:Y,pre:Zr,tr:cs,ul:jt}});var Ca,yr,Bt,ie,Fe,qt,hs=S(()=>{"use strict";W();Q();Xn();ee();j();B();qe();Ca=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,qt=class extends w{constructor(e,t,r,i="",s,o=[],l=y.getConfig(),d=[]){let g=new G(r,"attr-key",l,d),u;if(r==="title"||t==="img"&&r==="alt")u=new w(s,l,d,{}),u.type="attr-value",u.setAttribute("stage",10);else if(t==="gallery"&&r==="caption"||t==="choose"&&(r==="before"||r==="after")){let p={...l,excludes:[...l.excludes,"heading","html","table","hr","list"]};u=new w(s,p,d,{}),u.type="attr-value",u.setAttribute("stage",1)}else u=new G(s,"attr-value",l,d,{});super(void 0,l,d);T(this,yr);T(this,Bt);T(this,ie);T(this,Fe);b(this,yr,e),this.append(g,u),b(this,ie,i),b(this,Fe,[...o]),b(this,Bt,t),this.setAttribute("name",de(r).trim().toLowerCase())}get type(){return c(this,yr)}get tag(){return c(this,Bt)}get balanced(){return!c(this,ie)||c(this,Fe)[0]===c(this,Fe)[1]}afterBuild(){c(this,ie).includes("\0")&&b(this,ie,this.buildFromStr(c(this,ie),0)),this.parentNode&&b(this,Bt,this.parentNode.name),this.setAttribute("name",this.firstChild.toString(!0).trim().toLowerCase()),super.afterBuild()}toString(e){let[t="",r=""]=c(this,Fe);return c(this,ie)?super.toString(e,c(this,ie)+t)+r:this.firstChild.toString(e)}text(){return c(this,ie)?`${super.text(`${c(this,ie).trim()}"`)}"`:this.firstChild.text()}getGaps(){var e,t;return c(this,ie)?c(this,ie).length+((t=(e=c(this,Fe)[0])==null?void 0:e.length)!=null?t:0):0}lint(e=this.getAbsoluteIndex(),t){var x;let r=super.lint(e,t),{balanced:i,firstChild:s,lastChild:o,type:l,name:d,tag:g}=this,u=this.getValue(),p=new R(this,e);if(!i){let k=$(o,p,"unclosed-quote",y.msg("unclosed $1","quotes"),"warning");k.startIndex--,k.startCol--,k.suggestions=[{range:[k.endIndex,k.endIndex],text:c(this,Fe)[0],desc:"close"}],r.push(k)}let h=rn[g],m=tn[g],{length:f}=this.toString();if(!(h!=null&&h.has(d))&&!(m!=null&&m.has(d))&&(l==="ext-attr"?h||m:!/\{\{[^{]+\}\}/u.test(d))&&(l==="ext-attr"&&!m||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(d)&&(g==="meta"||g==="link"||!en.has(d)))){let k=$(s,p,"illegal-attr","illegal attribute name");k.suggestions=[{desc:"remove",range:[e,e+f],text:""}],r.push(k)}else if((x=ms[g])!=null&&x.has(d))r.push($(s,p,"obsolete-attr","obsolete attribute","warning"));else if(d==="style"&&typeof u=="string"&&Ca.test(u))r.push($(o,p,"insecure-style","insecure style"));else if(d==="tabindex"&&typeof u=="string"&&u!=="0"){let k=$(o,p,"illegal-attr","nonzero tabindex");k.suggestions=[{desc:"remove",range:[e,e+f],text:""},{desc:"0 tabindex",range:[k.startIndex,k.endIndex],text:"0"}],r.push(k)}return r}getValue(){return c(this,ie)?this.lastChild.text().trim():this.type==="ext-attr"||""}print(){let[e="",t=""]=c(this,Fe);return c(this,ie)?super.print({sep:kt(c(this,ie))+e,post:t}):super.print()}};yr=new WeakMap,Bt=new WeakMap,ie=new WeakMap,Fe=new WeakMap});var fs,$a,Qn,kr,Ke,nn=S(()=>{"use strict";W();Q();ee();j();B();qe();hs();fs=a=>a.slice(0,-1),$a=a=>`${fs(a)}-dirty`;try{Qn=new RegExp(String.raw`[\p{L}\d]`,"u")}catch(a){Qn=/[^\W_]/u}Ke=class extends w{constructor(e,t,r,i=y.getConfig(),s=[]){super(void 0,i,s,{});T(this,kr);if(b(this,kr,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="",d=o.exec(e),g=0,u=()=>{l&&(super.insertAt(new G(l,$a(t),i,s,{})),l="")};for(;d;){let{index:p,0:h,1:m,2:f,3:x,4:k,5:A,6:C}=d;if(l+=e.slice(g,p),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(de(m).trim())){let N=k!=null?k:C,E=[x,A],M=new qt(fs(t),r,m,f,N,E,i,s);u(),super.insertAt(M)}else l+=h;({lastIndex:g}=o),d=o.exec(e)}l+=e.slice(g),u()}}get type(){return c(this,kr)}afterBuild(){let{parentNode:e}=this;(e==null?void 0:e.type)==="td"&&e.subtype==="caption"&&this.setAttribute("name","caption"),super.afterBuild()}getAttrTokens(e){return this.childNodes.filter(t=>t instanceof qt&&(!e||t.name===e.toLowerCase().trim()))}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,d=new R(this,e);if((i==null?void 0:i.type)==="html"&&i.closing&&this.text().trim()){let g=L(this,d,"no-ignored","attributes of a closing tag"),u=i.getAbsoluteIndex();g.suggestions=[{desc:"remove",range:[e,g.endIndex],text:""},{desc:"open",range:[u+1,u+2],text:""}],r.push(g)}for(let g of s)if(g instanceof qt){let{name:u}=g;o.has(u)?(l.add(u),o.get(u).push(g)):o.set(u,[g])}else{let u=g.text().trim();if(u){let p=$(g,d,"no-ignored","containing invalid attribute",Qn.test(u)?"error":"warning");p.suggestions=[{desc:"remove",range:[p.startIndex,p.endIndex],text:" "}],r.push(p)}}if(l.size>0)for(let g of l){let u=o.get(g).map(p=>{let h=p.getValue();return[p,h===!0?"":h]});r.push(...u.map(([p,h],m)=>{let f=$(p,d,"no-duplicate",y.msg("duplicated $1 attribute",g)),x={desc:"remove",range:[f.startIndex,f.endIndex],text:""};return!h||u.slice(0,m).some(([,k])=>k===h)?f.fix=x:f.suggestions=[x],f}))}return r}print(){return this.toString()?`<span class="wpb-${this.type}">${this.childNodes.map(e=>e.print(e instanceof G?{class:e.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}};kr=new WeakMap});var sn,xs=S(()=>{"use strict";j();B();Ve();sn=class extends w{get type(){return"ext-inner"}constructor(n,e=y.getConfig(),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),d=0,g="";for(;o&&l;)new K(o[0],e,t),new K(l[0],e,t),g+=`${n.slice(d,o.index)}\0${t.length-1}n\x7F${n.slice(o.index+s,l.index)}\0${t.length}n\x7F`,d=l.index+s+1,r.lastIndex=d,o=r.exec(n),o&&(i.lastIndex=o.index+s),l=i.exec(n);n=g+n.slice(d)}super(n,e,t,{}),this.setAttribute("stage",10)}getAttribute(n){return n==="plain"||super.getAttribute(n)}lint(n=this.getAbsoluteIndex()){return super.lint(n,/<\s*\/\s*(pre)\b/giu)}}});var _t,Kn=S(()=>{"use strict";W();ee();vr();j();B();qe();_t=class extends w{get type(){return"ext-inner"}constructor(n,e,t=y.getConfig(),r=[],i){if(super(void 0,t,r,{}),e){let s=G;this.append(...e.split(`
|
|
3
|
+
`).map(o=>i?o:at(o,t,r,n)).map(o=>new s(o,"param-line",t,r,{})))}r.splice(r.indexOf(this),1),r.push(this)}toString(n){return super.toString(n,`
|
|
4
4
|
`)}text(){return super.text(`
|
|
5
|
-
`)}getGaps(){return 1}lint(
|
|
6
|
-
`})}}});var kr,jt,nn,qt,Jn=A(()=>{"use strict";D();Ce();ee();B();O();$t();qt=class extends w{constructor(e,t,n=T.getConfig(),i=[]){super(void 0,n,i);b(this,jt);b(this,kr);k(this,kr,e);let s=new w(t[0],n,i);s.type="heading-title",s.setAttribute("stage",2);let o=new be(t[1],/^\s*$/u,"heading-trail",n,i,{});this.append(s,o)}get type(){return"heading"}get level(){return c(this,kr)}toString(e){let t=c(this,jt,nn);return t+this.firstChild.toString(e)+t+this.lastChild.toString(e)}text(){let e=c(this,jt,nn);return e+this.firstChild.text()+e}getAttribute(e){return e==="padding"?this.level:super.getAttribute(e)}getGaps(){return this.level}lint(e=this.getAbsoluteIndex(),t){let n=super.lint(e,t),{firstChild:i,level:s}=this,o=i.toString(),l=o.startsWith("="),u=l||o.endsWith("="),g=i.childNodes.filter(Ot("quote")),d=g.filter(({bold:f})=>f),p=g.filter(({italic:f})=>f),m=new R(this,e);if(this.level===1){let f=$(i,m,"h1","<h1>");u||(f.suggestions=[{desc:"h2",range:[f.startIndex,f.endIndex],text:`=${o}=`}]),n.push(f)}if(u){let f=$(i,m,"unbalanced-header",T.msg("unbalanced $1 in a section header",'"="'));if(o!=="=")if(l){let[x]=/^=+/u.exec(o);f.suggestions=[{desc:`h${s}`,range:[f.startIndex,f.startIndex+x.length],text:""},{desc:`h${s+x.length}`,range:[f.endIndex,f.endIndex],text:x}]}else{let x=/[^=](=+)$/u.exec(o)[1];f.suggestions=[{desc:`h${s}`,range:[f.endIndex-x.length,f.endIndex],text:""},{desc:`h${s+x.length}`,range:[f.startIndex,f.startIndex],text:x}]}n.push(f)}this.closest("html-attrs,table-attrs")&&n.push(F(this,m,"parsing-order","section header in a HTML tag"));let h=this.getRootNode().toString();if(d.length%2){let f=$(d[d.length-1],{...m,start:e+s,left:m.left+s},"format-leakage",T.msg("unbalanced $1 in a section header","bold apostrophes")),x=e+s+o.length;h.slice(f.endIndex,x).trim()?f.suggestions=[{desc:"close",range:[x,x],text:"'''"}]:f.fix={desc:"remove",range:[f.startIndex,f.endIndex],text:""},n.push(f)}if(p.length%2){let f=$(p[p.length-1],{start:e+s},"format-leakage",T.msg("unbalanced $1 in a section header","italic apostrophes")),x=e+s+o.length;f.fix=h.slice(f.endIndex,x).trim()?{desc:"close",range:[x,x],text:"''"}:{desc:"remove",range:[f.startIndex,f.endIndex],text:""},n.push(f)}return n}print(){let e=c(this,jt,nn);return super.print({pre:e,sep:e})}json(){let e=super.json();return e.level=this.level,e}};kr=new WeakMap,jt=new WeakSet,nn=function(){return"=".repeat(this.level)}});var Ca,sn,xs=A(()=>{"use strict";J();D();B();O();Ca=new RegExp(`https?://${Fe}${Pe}$`,"iu"),sn=class extends w{get type(){return"parameter"}get anon(){return this.firstChild.length===0}constructor(r,e,t=T.getConfig(),n=[]){super(void 0,t,n);let i=new w(typeof r=="number"?void 0:r,t,n,{}),s=new w(e,t,n);i.type="parameter-key",i.setAttribute("stage",2),s.type="parameter-value",s.setAttribute("stage",2),this.append(i,s)}trimName(r,e=!0){let t=(typeof r=="string"?r:r.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:r,firstChild:e}=this,t=this.trimName(e);r&&r.getArgs(t,!1,!1).add(this)}super.afterBuild()}toString(r){return this.anon?this.lastChild.toString(r):super.toString(r,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(r=this.getAbsoluteIndex(),e){var s;let t=super.lint(r,e),{firstChild:n}=this,i=(s=Ca.exec(n.text()))==null?void 0:s[0];if(i&&new URL(i).search){let o=$(n,{start:r},"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={range:[o.startIndex,o.endIndex],text:"{{=}}",desc:"escape"},t.push(o)}return t}print(){return super.print({sep:this.anon?"":"="})}json(){let r=super.json();return r.anon=this.anon,r}}});var Ar,lt,dt,_t,Ye,on,bs,vr,Ts=A(()=>{"use strict";J();D();Ce();ee();B();O();xs();je();$t();vr=class extends w{constructor(e,t,n=T.getConfig(),i=[]){var f,x;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\x7F`,i[s].toString().replace(/^\n/u,"")));super(void 0,n,i,{});b(this,Ye);te(this,"modifier","");b(this,Ar,"template");b(this,lt,!1);b(this,dt,new Map);b(this,_t);let{parserFunction:[l,u],variable:g}=n,d=(f=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(e))==null?void 0:f[0];if(d)this.setAttribute("modifier",d),e=e.slice(d.length);else if(e.includes(":")){let[y,...v]=e.split(":"),[C]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((x=v[0])!=null?x:"");this.setModifier(`${y}:${C}`)&&(e=v.join(":").slice(C.length))}let p=e.includes(":");if(p||t.length===0&&!c(this,lt)){let y=e.indexOf(":"),v=y===-1?e:e.slice(0,y),C=y===-1?void 0:e.slice(y+1),L=le(v),I=L[C===void 0?"trim":"trimStart"](),U=I.toLowerCase(),H=Array.isArray(u),_=H?u.includes(I):Object.prototype.hasOwnProperty.call(u,I),X=!H&&_?u[I]:Object.prototype.hasOwnProperty.call(l,U)&&l[U];if(H&&_||g.includes(X)||p&&X){this.setAttribute("name",X||U.replace(/^#/u,"")),k(this,Ar,"magic-word");let M=new RegExp(String.raw`^\s*${I}\s*$`,_?"u":"iu"),W=new be(v,M,"magic-word-name",n,i,{});if(super.insertAt(W),C!==void 0&&t.unshift([C]),this.name==="invoke")for(let E=0;E<2;E++){let q=t.shift();if(!q)break;let P=new V(q.join("="),`invoke-${E?"function":"module"}`,n,i);super.insertAt(P)}}}if(this.type==="template"){let y=le(e).trim();if(!this.normalizeTitle(y,10,!0).valid)throw i.pop(),new SyntaxError("Invalid template name");let v=new V(e,"template-name",n,i,{});super.insertAt(v)}typeof s=="number"&&(i[s]=void 0);let m=this.isTemplate(),h=1;for(let[y,v]of t.entries())m||this.name==="switch"&&y>0||this.name==="tag"&&y>1||(v[0]=v.join("="),v.length=1),v.length===1&&(v.unshift(h),h++),this.insertAt(new sn(...v,n,i));this.seal("modifier")}get type(){return c(this,Ar)}setModifier(e){let{parserFunction:[,,t,n]}=this.getAttribute("config"),i=le(e).trim();if(e&&!i.endsWith(":"))return!1;let s=i.slice(0,-1).toLowerCase(),o=t.includes(s),l=n.includes(s);return c(this,lt)&&o||!c(this,lt)&&(l||e==="")||(Se.running||this.length>1)&&(o||l||e==="")?(this.setAttribute("modifier",e),k(this,lt,o),!!e):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}getModule(){var e;if(this.type!=="magic-word"||this.name!=="invoke")throw new Error("TranscludeToken.getModule method is only for modules!");return[S(this,Ye,on).call(this).title,(e=this.childNodes[2])==null?void 0:e.toString(!0).trim()]}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0)),super.afterBuild(),this.isTemplate()&&this.type==="template"&&(k(this,_t,S(this,Ye,on).call(this)),this.setAttribute("name",c(this,_t).title))}toString(e){return`{{${this.modifier}${this.type==="magic-word"?this.firstChild.toString(e)+(this.length===1?"":":")+this.childNodes.slice(1).map(t=>t.toString(e)).join("|"):super.toString(e,"|")}}}`}text(){let{childNodes:e,length:t,firstChild:n,modifier:i,type:s,name:o}=this;return s==="magic-word"&&o==="vardefine"?"":`{{${i}${s==="magic-word"?n.text()+(t===1?"":":")+fe(e.slice(1),"|"):super.text("|")}}}`}getAttribute(e){switch(e){case"padding":return this.modifier.length+2;case"title":return c(this,_t);default:return super.getAttribute(e)}}getGaps(){return 1}lint(e=this.getAbsoluteIndex(),t){let n=super.lint(e,t);if(!this.isTemplate())return n;let{type:i,childNodes:s,length:o}=this,l=new R(this,e),u=i==="magic-word";if(u&&!S(this,Ye,on).call(this).valid)n.push($(s[1],l,"invalid-invoke","illegal module name"));else{let d=s[u?1:0],p=d.childNodes.findIndex(h=>h.type==="text"&&ar(h.data).includes("#")),m=d.childNodes[p];if(m){let h=$(d,l,"no-ignored","useless fragment");h.fix={range:[h.startIndex+d.getRelativeIndex(p)+m.data.indexOf("#"),h.endIndex],text:"",desc:"remove"},n.push(h)}}if(u&&o===2)return n.push(F(this,l,"invalid-invoke","missing module function")),n;let g=this.getDuplicatedArgs().filter(([,d])=>!d[0].querySelector("ext"));if(g.length>0)for(let[,d]of g)n.push(...d.map(p=>{let m=$(p,l,"no-duplicate","duplicated parameter");return m.suggestions=[{desc:"remove",range:[m.startIndex-1,m.endIndex],text:""}],m}));return n}insertAt(e,t=this.length){return super.insertAt(e,t),e.anon?S(this,Ye,bs).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getAllArgs(){return this.childNodes.filter(Ot("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:e})=>e)}getArgs(e,t,n=!0){let i=String(e).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),s;return c(this,dt).has(i)?s=c(this,dt).get(i):(s=new Set(this.getAllArgs().filter(({name:o})=>i===o)),c(this,dt).set(i,s)),s}getDuplicatedArgs(){return[...c(this,dt)].filter(([,{size:e}])=>e>1).map(([e,t])=>[e,[...t]])}getPossibleValues(){let{type:e,name:t,childNodes:n}=this;if(e==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let i;switch(t){case"if":case"ifexist":case"ifexpr":case"iferror":i=2;break;case"ifeq":i=3;break;default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}let s=n.slice(i,i+2).map(({childNodes:[,o]})=>o);for(let o=0;o<s.length;){let{length:l,0:u}=s[o].childNodes.filter(g=>g.text().trim());if(l===0)s.splice(o,1);else if(l>1||u.type!=="magic-word")o++;else try{let g=u.getPossibleValues();s.splice(o,1,...g),o+=g.length}catch(g){o++}}return s}print(){let{childNodes:e,length:t,firstChild:n,modifier:i,type:s}=this;return`<span class="wpb-${s}">{{${Tt(i)}${s==="magic-word"?n.print()+(t===1?"":":")+Re(e.slice(1),{sep:"|"}):Re(e,{sep:"|"})}}}</span>`}};Ar=new WeakMap,lt=new WeakMap,dt=new WeakMap,_t=new WeakMap,Ye=new WeakSet,on=function(){let e=this.type==="template",t=this.childNodes[e?0:1];return this.normalizeTitle(t.toString(!0),e?10:828)},bs=function(e){let t=this.getAnonArgs(),n=typeof e!="number";for(let i=n?t.indexOf(e):e-1;i<t.length;i++){let s=t[i],{name:o}=s,l=String(i+1);o!==l&&(s.setAttribute("name",l),this.getArgs(l,!1,!1).add(s))}}});var ys,Yn,$a,gt,ks=A(()=>{"use strict";nt();O();ys=[xe()];gt=class extends($a=w){get type(){return"hidden"}};Yn=se($a),gt=ae(Yn,0,"HiddenToken",ys,gt),oe(Yn,1,gt)});var ln,vs,an,As=A(()=>{"use strict";J();D();ee();B();O();je();ks();an=class extends w{constructor(e,t=T.getConfig(),n=[]){super(void 0,t,n,{});b(this,ln);for(let[i,s]of e.entries())if(i===0){let o=new V(s,"arg-name",t,n,{});super.insertAt(o)}else if(i>1){let o=new gt(s,t,n);super.insertAt(o)}else{let o=new w(s,t,n);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`{{{${fe(this.childNodes.slice(0,2),"|")}}}}`}getAttribute(e){return e==="padding"?3:super.getAttribute(e)}getGaps(){return 1}afterBuild(){S(this,ln,vs).call(this),super.afterBuild()}lint(e=this.getAbsoluteIndex(),t){let{childNodes:[n,i,...s]}=this;if(!this.getAttribute("include")){let l=F(this,{start:e},"no-arg","unexpected template argument");return i&&(l.suggestions=[{range:[e,l.endIndex],text:i.text(),desc:"expand"}]),[l]}let o=n.lint(e+3,t);if(i&&o.push(...i.lint(e+4+n.toString().length,t)),s.length>0){let l=new R(this,e);o.push(...s.map(u=>{let g=$(u,l,"no-ignored","invisible content inside triple braces");return g.startIndex--,g.startCol--,g.suggestions=[{desc:"remove",range:[g.startIndex,g.endIndex],text:""},{desc:"escape",range:[g.startIndex,g.startIndex+1],text:"{{!}}"}],g}))}return o}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}};ln=new WeakSet,vs=function(){this.setAttribute("name",this.firstChild.toString(!0).trim())}});var Ss={};ie(Ss,{parseBraces:()=>wr});var Na,ws,Zn,Ia,wr,dn=A(()=>{"use strict";J();Jn();Ts();As();Na={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},ws=String.raw`|\{{2,}`,Zn=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),Ia=/\{\{\s*([^\s\0<>[\]{}|_#&%:.]+)\s*\}\}(?!\})/gu,wr=(a,r,e)=>{var d,p,m,h,f,x;let t=String.raw`${(d=r.excludes)!=null&&d.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,n]}=r,i=[];a=a.replace(Ia,(y,v)=>{var C;return new vr(y.slice(2,-2),[],r,e),`\0${e.length-2}${(C=Zn.get(v.toLowerCase()))!=null?C:"t"}\x7F`});let s=a.lastIndexOf("}}")-a.length,o=s+a.length!==-1,l=new RegExp(t+(o?ws:""),"gmu"),u=l.exec(a),g;for(;u||g!==void 0&&g<=a.length&&((m=(p=i[i.length-1])==null?void 0:p[0])!=null&&m.startsWith("="));){if(u!=null&&u[1]){let[,{length:W}]=u;u[0]=u[0].slice(W),u.index+=W}let{0:y,index:v}=u!=null?u:{0:`
|
|
7
|
-
`,index:a.length},C=(
|
|
8
|
-
`){g=
|
|
9
|
-
)`:""}(\s*)$`,"u");return[g,
|
|
10
|
-
`))!=null?i:[]){let o=/^([^|]+)(?:\|(.*))?/u.exec(s);if(!o){super.insertAt(s.trim()?new K(s,t,
|
|
5
|
+
`)}getGaps(){return 1}lint(n=this.getAbsoluteIndex()){let e=new R(this,n),t=y.msg("invalid parameter of <$1>",this.name),r=[];for(let i of this.childNodes){let s=i.childNodes.filter(({type:o})=>o!=="comment"&&o!=="include"&&o!=="noinclude");if(s.some(({type:o})=>o==="ext"))r.push($(i,e,"no-ignored",t));else{let o=s.findIndex(({type:d})=>d!=="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 d=$(i,e,"no-ignored",t);d.suggestions=[{desc:"remove",range:[d.startIndex,d.endIndex],text:""}],r.push(d)}else r.push(...i.lint(n,!1))}n+=i.toString().length+1}return r}print(){return super.print({sep:`
|
|
6
|
+
`})}}});var Ar,Ot,on,Mt,Jn=S(()=>{"use strict";W();$e();ee();j();B();Et();Mt=class extends w{constructor(e,t,r=y.getConfig(),i=[]){super(void 0,r,i);T(this,Ot);T(this,Ar);b(this,Ar,e);let s=new w(t[0],r,i);s.type="heading-title",s.setAttribute("stage",2);let o=new ye(t[1],/^\s*$/u,"heading-trail",r,i,{});this.append(s,o)}get type(){return"heading"}get level(){return c(this,Ar)}toString(e){let t=v(this,Ot,on).call(this);return t+this.firstChild.toString(e)+t+this.lastChild.toString(e)}text(){let e=v(this,Ot,on).call(this);return e+this.firstChild.text()+e}getAttribute(e){return 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("="),d=l||o.endsWith("="),g=i.childNodes.filter(Dt("quote")),u=g.filter(({bold:f})=>f),p=g.filter(({italic:f})=>f),h=new R(this,e);if(this.level===1){let f=$(i,h,"h1","<h1>");d||(f.suggestions=[{desc:"h2",range:[f.startIndex,f.endIndex],text:`=${o}=`}]),r.push(f)}if(d){let f=$(i,h,"unbalanced-header",y.msg("unbalanced $1 in a section header",'"="'));if(o!=="=")if(l){let[x]=/^=+/u.exec(o);f.suggestions=[{desc:`h${s}`,range:[f.startIndex,f.startIndex+x.length],text:""},{desc:`h${s+x.length}`,range:[f.endIndex,f.endIndex],text:x}]}else{let x=/[^=](=+)$/u.exec(o)[1];f.suggestions=[{desc:`h${s}`,range:[f.endIndex-x.length,f.endIndex],text:""},{desc:`h${s+x.length}`,range:[f.startIndex,f.startIndex],text:x}]}r.push(f)}this.closest("html-attrs,table-attrs")&&r.push(L(this,h,"parsing-order","section header in an HTML tag"));let m=this.getRootNode().toString();if(u.length%2){let f=$(u[u.length-1],{...h,start:e+s,left:h.left+s},"format-leakage",y.msg("unbalanced $1 in a section header","bold apostrophes")),x=e+s+o.length;m.slice(f.endIndex,x).trim()?f.suggestions=[{desc:"close",range:[x,x],text:"'''"}]:f.fix={desc:"remove",range:[f.startIndex,f.endIndex],text:""},r.push(f)}if(p.length%2){let f=$(p[p.length-1],{start:e+s},"format-leakage",y.msg("unbalanced $1 in a section header","italic apostrophes")),x=e+s+o.length;f.fix=m.slice(f.endIndex,x).trim()?{desc:"close",range:[x,x],text:"''"}:{desc:"remove",range:[f.startIndex,f.endIndex],text:""},r.push(f)}return r}print(){let e=v(this,Ot,on).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}};Ar=new WeakMap,Ot=new WeakSet,on=function(){return"=".repeat(this.level)}});var Na,an,bs=S(()=>{"use strict";Q();W();j();B();Na=new RegExp(`https?://${Pe}${Re}$`,"iu"),an=class extends w{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(e){return!1}}constructor(n,e,t=y.getConfig(),r=[]){super(void 0,t,r);let i=new w(typeof n=="number"?void 0:n,t,r,{}),s=new w(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=Na.exec(r.text()))==null?void 0:s[0];if(i&&new URL(i).search){let o=$(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={range:[o.startIndex,o.endIndex],text:"{{=}}",desc:"escape"},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,duplicated:this.duplicated}),t}}});var wr,lt,dt,Wt,Je,ln,Ts,Sr,ys=S(()=>{"use strict";Q();W();$e();ee();j();B();bs();qe();Et();Sr=class extends w{constructor(e,t,r=y.getConfig(),i=[]){var f,x;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\x7F`,i[s].toString().replace(/^\n/u,"")));super(void 0,r,i,{});T(this,Je);ne(this,"modifier","");T(this,wr,"template");T(this,lt,!1);T(this,dt,new Map);T(this,Wt);let{parserFunction:[l,d],variable:g}=r,u=(f=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(e))==null?void 0:f[0];if(u)this.setAttribute("modifier",u),e=e.slice(u.length);else if(e.includes(":")){let[k,...A]=e.split(":"),[C]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((x=A[0])!=null?x:"");this.setModifier(`${k}:${C}`)&&(e=A.join(":").slice(C.length))}let p=e.includes(":");if(p||t.length===0&&!c(this,lt)){let k=e.indexOf(":"),A=k===-1?e:e.slice(0,k),C=k===-1?void 0:e.slice(k+1),N=de(A),E=N[C===void 0?"trim":"trimStart"](),M=E.toLowerCase(),te=Array.isArray(d),_=te?d.includes(E):Object.prototype.hasOwnProperty.call(d,E),V=!te&&_?d[E]:Object.prototype.hasOwnProperty.call(l,M)&&l[M];if(te&&_||g.includes(V)||p&&V){this.setAttribute("name",V||M.replace(/^#/u,"")),b(this,wr,"magic-word");let O=new RegExp(String.raw`^\s*${E}\s*$`,_?"u":"iu"),D=new ye(A,O,"magic-word-name",r,i,{});if(super.insertAt(D),C!==void 0&&t.unshift([C]),this.name==="invoke")for(let I=0;I<2;I++){let U=t.shift();if(!U)break;let P=new G(U.join("="),`invoke-${I?"function":"module"}`,r,i);super.insertAt(P)}}}if(this.type==="template"){let k=de(e).trim();if(!this.normalizeTitle(k,10,!0,!0).valid)throw i.pop(),new SyntaxError("Invalid template name");let A=new G(e,"template-name",r,i,{});super.insertAt(A)}typeof s=="number"&&(i[s]=void 0);let h=this.isTemplate(),m=1;for(let[k,A]of t.entries())h||this.name==="switch"&&k>0||this.name==="tag"&&k>1||(A[0]=A.join("="),A.length=1),A.length===1&&(A.unshift(m),m++),this.insertAt(new an(...A,r,i));this.seal("modifier")}get type(){return c(this,wr)}setModifier(e){let{parserFunction:[,,t,r]}=this.getAttribute("config"),i=de(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,lt)&&o||!c(this,lt)&&(l||e==="")||(ue.running||this.length>1)&&(o||l||e==="")?(this.setAttribute("modifier",e),b(this,lt,o),!!e):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}getModule(){var e;if(this.type!=="magic-word"||this.name!=="invoke")throw new Error("TranscludeToken.getModule method is only for modules!");return[v(this,Je,ln).call(this).title,(e=this.childNodes[2])==null?void 0:e.toString(!0).trim()]}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0)),super.afterBuild(),this.isTemplate()&&this.type==="template"&&(b(this,Wt,v(this,Je,ln).call(this)),this.setAttribute("name",c(this,Wt).title))}toString(e){return`{{${this.modifier}${this.type==="magic-word"?this.firstChild.toString(e)+(this.length===1?"":":")+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?"":":")+be(e.slice(1),"|"):super.text("|")}}}`}getAttribute(e){switch(e){case"padding":return this.modifier.length+2;case"title":return c(this,Wt);default:return super.getAttribute(e)}}getGaps(){return 1}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 R(this,e),d=i==="magic-word";if(d&&!v(this,Je,ln).call(this).valid)r.push($(s[1],l,"invalid-invoke","illegal module name"));else{let u=s[d?1:0],p=u.childNodes.findIndex(m=>m.type==="text"&&rt(m.data).includes("#")),h=u.childNodes[p];if(h){let m=$(u,l,"no-ignored","useless fragment");m.fix={range:[m.startIndex+u.getRelativeIndex(p)+h.data.indexOf("#"),m.endIndex],text:"",desc:"remove"},r.push(m)}}if(d&&o===2)return r.push(L(this,l,"invalid-invoke","missing module function")),r;let g=this.getDuplicatedArgs().filter(([,u])=>!u[0].querySelector("ext"));if(g.length>0)for(let[,u]of g)r.push(...u.map(p=>{let h=$(p,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,Je,Ts).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getAllArgs(){return this.childNodes.filter(Dt("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,dt).has(i)?s=c(this,dt).get(i):(s=new Set(this.getAllArgs().filter(({name:o})=>i===o)),c(this,dt).set(i,s)),s}getDuplicatedArgs(){return[...c(this,dt)].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;switch(t){case"if":case"ifexist":case"ifexpr":case"iferror":i=2;break;case"ifeq":i=3;break;default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}let s=r.slice(i,i+2).map(({childNodes:[,o]})=>o);for(let o=0;o<s.length;){let{length:l,0:d}=s[o].childNodes.filter(g=>g.text().trim());if(l===0)s.splice(o,1);else if(l>1||d.type!=="magic-word")o++;else try{let g=d.getPossibleValues();s.splice(o,1,...g),o+=g.length}catch(g){o++}}return s}print(){let{childNodes:e,length:t,firstChild:r,modifier:i,type:s}=this;return`<span class="wpb-${s}">{{${kt(i)}${s==="magic-word"?r.print()+(t===1?"":":")+je(e.slice(1),{sep:"|"}):je(e,{sep:"|"})}}}</span>`}};wr=new WeakMap,lt=new WeakMap,dt=new WeakMap,Wt=new WeakMap,Je=new WeakSet,ln=function(){let e=this.type==="template";return this.normalizeTitle(this.childNodes[e?0:1].toString(!0),e?10:828,!0)},Ts=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.setAttribute("name",l),this.getArgs(l,!1,!1).add(s))}}});var ks,Yn,Ia,gt,vs=S(()=>{"use strict";nt();B();ks=[Te()];gt=class extends(Ia=w){get type(){return"hidden"}};Yn=oe(Ia),gt=le(Yn,0,"HiddenToken",ks,gt),ae(Yn,1,gt)});var gn,As,dn,Ss=S(()=>{"use strict";Q();W();ee();j();B();qe();vs();dn=class extends w{constructor(e,t=y.getConfig(),r=[]){super(void 0,t,r,{});T(this,gn);for(let[i,s]of e.entries())if(i===0){let o=new G(s,"arg-name",t,r,{});super.insertAt(o)}else if(i>1){let o=new gt(s,t,r);super.insertAt(o)}else{let o=new w(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`{{{${be(this.childNodes.slice(0,2),"|")}}}}`}getAttribute(e){return e==="padding"?3:super.getAttribute(e)}getGaps(){return 1}afterBuild(){v(this,gn,As).call(this),super.afterBuild()}lint(e=this.getAbsoluteIndex(),t){let{childNodes:[r,i,...s]}=this;if(!this.getAttribute("include")){let l=L(this,{start:e},"no-arg","unexpected template argument");return i&&(l.suggestions=[{range:[e,l.endIndex],text:i.text(),desc:"expand"}]),[l]}let o=r.lint(e+3,t);if(i&&o.push(...i.lint(e+4+r.toString().length,t)),s.length>0){let l=new R(this,e);o.push(...s.map(d=>{let g=$(d,l,"no-ignored","invisible content inside triple braces");return g.startIndex--,g.startCol--,g.suggestions=[{desc:"remove",range:[g.startIndex,g.endIndex],text:""},{desc:"escape",range:[g.startIndex,g.startIndex+1],text:"{{!}}"}],g}))}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}};gn=new WeakSet,As=function(){this.setAttribute("name",this.firstChild.toString(!0).trim())}});var Cs={};se(Cs,{parseBraces:()=>Cr});var Ea,ws,Zn,La,Cr,un=S(()=>{"use strict";Q();Jn();ys();Ss();Ea={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},ws=String.raw`|\{{2,}`,Zn=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),La=/\{\{\s*([^\s\0<>[\]{}|_#&%:.]+)\s*\}\}(?!\})/gu,Cr=(a,n,e)=>{var u,p,h,m,f,x;let t=String.raw`${(u=n.excludes)!=null&&u.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,r]}=n,i=[];a=a.replace(La,(k,A)=>{var C;return new Sr(k.slice(2,-2),[],n,e),`\0${e.length-2}${(C=Zn.get(A.toLowerCase()))!=null?C:"t"}\x7F`});let s=a.lastIndexOf("}}")-a.length,o=s+a.length!==-1,l=new RegExp(t+(o?ws:""),"gmu"),d=l.exec(a),g;for(;d||g!==void 0&&g<=a.length&&((h=(p=i[i.length-1])==null?void 0:p[0])!=null&&h.startsWith("="));){if(d!=null&&d[1]){let[,{length:D}]=d;d[0]=d[0].slice(D),d.index+=D}let{0:k,index:A}=d!=null?d:{0:`
|
|
7
|
+
`,index:a.length},C=(m=i.pop())!=null?m:{},{0:N,index:E,parts:M,findEqual:te,pos:_}=C,V=k==="="&&te,F=D=>{M[M.length-1].push(D.slice(_,A))};if(k==="]]"||k==="}-")g=A+2;else if(k===`
|
|
8
|
+
`){g=A+1;let{pos:D,findEqual:I}=(f=i[i.length-1])!=null?f:{};if(D===void 0||I||de(a.slice(D,E))!==""){let U=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(a.slice(E,A));U&&(a=`${a.slice(0,E)}\0${e.length}h\x7F${a.slice(A)}`,g=E+4+String(e.length).length,new Mt(U[1].length,U.slice(2),n,e))}}else if(k==="|"||V)g=A+1,F(a),k==="|"&&M.push([]),C.pos=g,C.findEqual=k==="|",i.push(C);else if(k.startsWith("}}")){let D=k.slice(0,Math.min(N.length,3)),I=N.length-D.length,{length:U}=e;g=A+D.length,F(a);let P=!1,re="t";if(D.length===3){let Z=M.map(Ze=>Ze.join("=")),ce=Z.length>1&&de(Z[1]).trim();new dn(Z,n,e),ce&&ce.endsWith(":")&&r.includes(ce.slice(0,-1).toLowerCase())&&(re="s")}else try{new Sr(M[0][0],M.slice(1),n,e);let Z=de(M[0][0]).trim();Zn.has(Z.toLowerCase())?re=Zn.get(Z.toLowerCase()):/^(?:filepath|(?:full|canonical)urle?):./iu.test(Z)?re="m":/^#vardefine:./iu.test(Z)&&(re="n")}catch(Z){if(Z instanceof SyntaxError&&Z.message==="Invalid template name")P=!0;else throw Z}P||(a=`${a.slice(0,E+I)}\0${U}${re}\x7F${a.slice(g)}`,g=E+I+3+String(U).length,I>1?i.push({0:N.slice(0,I),index:E,pos:E+I,parts:[[]]}):I===1&&a[E-1]==="-"&&i.push({0:"-{",index:E-1,pos:E+1,parts:[[]]}))}else g=A+k.length,k.startsWith("{")&&(d.pos=g,d.parts=[[]]),i.push(..."0"in C?[C]:[],d);let O=i[i.length-1];if(o&&s+a.length<g)for(o=!1;(x=O==null?void 0:O[0])!=null&&x.startsWith("{");)i.pop(),O=i[i.length-1];l=new RegExp(t+(o?ws:"")+(O?`|${Ea[O[0][0]]}${O.findEqual?"|=":""}`:""),"gmu"),l.lastIndex=g,d=l.exec(a)}return a}});var pn,$s=S(()=>{"use strict";vr();un();j();Kn();pn=class extends _t{constructor(n,e,t=y.getConfig(),r=[]){let i=Symbol("InputboxToken"),{length:s}=r;r.push(i),e&&(e=at(e,t,r,n)),e&&(e=Cr(e,t,r)),r.splice(s,1),super(n,e,t,r,{})}}});function Ns(a,n,e,t,r){n=n.trim();let i=n.replace(a==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(a){case"width":return!i&&!!n||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(i);case"link":{if(!i)return n;let s=new RegExp(String.raw`^(?:${e.protocol}|//|\0\d+m\x7F)`,"iu"),o=new RegExp(String.raw`^(?:(?:${e.protocol}|//)${Pe}|\0\d+m\x7F)${Re}$`,"iu");if(s.test(i))return o.test(i)&&n;i.startsWith("[[")&&i.endsWith("]]")&&(i=i.slice(2,-2));let l=y.normalizeTitle(i,0,!1,e,!1,t,!0,!0);return l.valid&&l}case"lang":return(r==="svg"||r==="svgz")&&!/[^a-z\d-]/u.test(i);case"alt":case"class":case"manualthumb":return!0;case"page":return(r==="djvu"||r==="djv"||r==="pdf")&&Number(i)>0;default:return!!i&&!isNaN(i)}}var Fa,me,mn,Is,cn,Es=S(()=>{"use strict";Q();W();j();B();Fa=new Set(["alt","link","lang","page","caption"]);cn=class extends w{constructor(e,t,r=y.getConfig(),i){var n=(...uu)=>(super(...uu),T(this,mn),T(this,me,""),this);var d;let s,o=Object.entries(r.img).map(([g,u])=>{let p=new RegExp(String.raw`^(\s*(?!\s))${g.replace("$1","(.*)")}${g.endsWith("$1")?`(?=$|
|
|
9
|
+
)`:""}(\s*)$`,"u");return[g,u,p]}),l=o.find(([,g,u])=>(s=u.exec(e),s&&(s.length!==4||Ns(g,s[2],r,!0,t)!==!1)));if(l&&s){s.length===3?(n(void 0,r,i),b(this,me,e)):(n(s[2],r,i,{}),b(this,me,s[1]+l[0]+s[3])),this.setAttribute("name",l[1]);return}n(e,{...r,excludes:[...(d=r.excludes)!=null?d:[],"list"]},i),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get type(){return"image-parameter"}get link(){return this.name==="link"?Ns("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var e;((e=this.parentNode)==null?void 0:e.type)==="gallery-image"&&!Fa.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(e){return c(this,me)?c(this,me).replace("$1",super.toString(e)):super.toString(e)}text(){return c(this,me)?c(this,me).replace("$1",super.text()).trim():super.text().trim()}getAttribute(e){return e==="plain"?this.name==="caption":e==="padding"?Math.max(0,c(this,me).indexOf("$1")):super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{link:i,name:s}=this;if(s==="invalid"){let o=L(this,{start:e},"invalid-gallery","invalid image parameter");o.fix={range:[e-1,o.endIndex],text:"",desc:"remove"},r.push(o)}else if(typeof i=="object"&&i.encoded){let o=L(this,{start:e},"url-encoding","unnecessary URL encoding in an internal link");o.suggestions=[{desc:"decode",range:[e,o.endIndex],text:He(this.text())}],r.push(o)}return r}getValue(){return this.name==="invalid"?this.text():v(this,mn,Is).call(this)||super.text()}print(){return c(this,me)?`<span class="wpb-image-parameter">${c(this,me).replace("$1",`<span class="wpb-image-caption">${je(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}};me=new WeakMap,mn=new WeakSet,Is=function(){return c(this,me)&&!c(this,me).includes("$1")}});var Ls,Fs,Ps,Pa,Ut,ei=S(()=>{"use strict";Q();W();ee();j();Tr();Es();Ls=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),Fs=new Set(["left","right","center","none"]),Ps=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),Pa=(a,n,e,t)=>{if(t===void 0)return[];let r=new RegExp(`${[a,n,e].map(Di).join("|")}`,"gu"),i=[],s=r.exec(t),o=0,l=0;for(;s;){let{0:d,index:g}=s;d!==e?o+=d===a?1:-1:o===0&&(i.push(t.slice(l,g)),{lastIndex:l}=r),s=r.exec(t)}return i.push(t.slice(l)),i},Ut=class extends Le{get type(){return"file"}get extension(){return this.getAttribute("title").extension}constructor(n,e,t=y.getConfig(),r=[],i="|"){super(n,void 0,t,r,i);let{extension:s}=this.getTitle(!0,!0);this.append(...Pa("-{","}-","|",e).map(o=>new cn(o,s,t,r)))}lint(n=this.getAbsoluteIndex(),e){var h;let t=super.lint(n,e),r=this.getAllArgs().filter(({childNodes:m})=>{let f=m.filter(x=>x.text().trim());return f.length!==1||f[0].type!=="arg"}),i=[...new Set(r.map(({name:m})=>m))],s=i.filter(m=>Ls.has(m)),o=i.filter(m=>Fs.has(m)),l=i.filter(m=>Ps.has(m)),[d]=s,g=d==="framed"||d==="manualthumb",u=new R(this,n);if(this.closest("ext-link-text")&&((h=this.getValue("link"))==null?void 0:h.trim())!==""&&t.push(L(this,u,"nested-link","internal link in an external link")),g)for(let m of r.filter(({name:f})=>f==="width")){let f=$(m,u,"invalid-gallery","invalid image parameter");f.fix={range:[f.startIndex-1,f.endIndex],text:"",desc:"remove"},t.push(f)}if(r.length===i.length&&s.length<2&&o.length<2&&l.length<2)return t;let p=(m,f)=>x=>{let k=$(x,u,"no-duplicate",y.msg(`${m} image $1 parameter`,f));return k.suggestions=[{desc:"remove",range:[k.startIndex-1,k.endIndex],text:""}],k};for(let m of i){if(m==="invalid"||m==="width"&&g)continue;let f=r.filter(({name:x})=>x===m);m==="caption"&&(f=[...f.slice(0,-1).filter(x=>x.text()),...f.slice(-1)]),f.length>1&&t.push(...f.map(p("duplicated",m)))}return s.length>1&&t.push(...r.filter(({name:m})=>Ls.has(m)).map(p("conflicting","frame"))),o.length>1&&t.push(...r.filter(({name:m})=>Fs.has(m)).map(p("conflicting","horizontal-alignment"))),l.length>1&&t.push(...r.filter(({name:m})=>Ps.has(m)).map(p("conflicting","vertical-alignment"))),t}getAllArgs(){return this.childNodes.slice(1)}getArgs(n){return this.getAllArgs().filter(({name:e})=>n===e)}getArg(n){let e=this.getArgs(n);return e[n==="manualthumb"?0:e.length-1]}getValue(n){var e;return(e=this.getArg(n))==null?void 0:e.getValue()}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e),{extension:r}=this;return r&&(t.extension=r),t}}});var Ht,ti=S(()=>{"use strict";W();j();B();ei();Ht=class extends Ut{constructor(e,t,r,i=y.getConfig(),s=[]){let o;if(r!==void 0){let{length:l}=s;o=new w(r,i,s);for(let d=1;d<11;d++)o.parseOnce();s.splice(l,1)}super(t,o==null?void 0:o.toString(),i,s);ne(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=`${e}-image`,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(e){let t=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),t?0:6,e,!0,!t)}getAttribute(e){return e==="padding"?0:super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{ns:i}=this.getAttribute("title");if(i!==6){let s=L(this,{start:e},"invalid-gallery","invalid gallery image");s.suggestions=[{desc:"prefix",range:[e,e],text:"File:"}],r.push(s)}return r}}});var ut,Rs,ri,hn,js=S(()=>{"use strict";j();B();ti();Ve();hn=class extends w{constructor(e,t=y.getConfig(),r=[]){var i;super(void 0,t,r,{});T(this,ut);for(let s of(i=e==null?void 0:e.split(`
|
|
10
|
+
`))!=null?i:[]){let o=/^([^|]+)(?:\|(.*))?/u.exec(s);if(!o){super.insertAt(s.trim()?new K(s,t,r):s);continue}let[,l,d]=o;v(this,ut,Rs).call(this,l)?super.insertAt(new Ht("gallery",l,d,t,r)):super.insertAt(new K(s,t,r))}}get type(){return"ext-inner"}get widths(){return v(this,ut,ri).call(this,"widths")}get heights(){return v(this,ut,ri).call(this,"heights")}toString(e){return super.toString(e,`
|
|
11
11
|
`)}text(){return super.text(`
|
|
12
12
|
`).replace(/\n\s*\n/gu,`
|
|
13
|
-
`)}getGaps(){return 1}lint(e=this.getAbsoluteIndex(),t){let{top:
|
|
14
|
-
`})}};
|
|
15
|
-
`),i=new Set(e.protocol.split("|")),s=K,o=!0,l=!1;for(let
|
|
13
|
+
`)}getGaps(){return 1}lint(e=this.getAbsoluteIndex(),t){let{top:r,left:i}=this.getRootNode().posFromIndex(e),s=[];for(let[o,l]of this.childNodes.entries()){let d=l.toString(),{length:g}=d,u=d.trim(),{type:p}=l,h=r+o,m=o?0:i;if(p==="noinclude"&&u&&!/^<!--.*-->$/u.test(u)){let f=e+g;s.push({rule:"no-ignored",message:y.msg("invalid content in <$1>","gallery"),severity:u.startsWith("|")?"warning":"error",startIndex:e,endIndex:f,startLine:h,endLine:h,startCol:m,endCol:m+g,suggestions:[{desc:"remove",range:[e,f],text:""},{desc:"comment",range:[e,f],text:`<!--${d}-->`}]})}else p!=="noinclude"&&p!=="text"&&s.push(...l.lint(e,t));e+=g+1}return s}print(){return super.print({sep:`
|
|
14
|
+
`})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return Object.assign(r,{widths:this.widths,heights:this.heights}),r}};ut=new WeakSet,Rs=function(e){return this.normalizeTitle(e,6,!0,!0,!0).valid},ri=function(e){var i,s;let t=(i=this.parentNode)==null?void 0:i.getAttr(e),r=typeof t=="string"&&((s=/^(\d+)\s*(?:px)?$/u.exec(t))==null?void 0:s[1]);return r&&Number(r)||120}});var zt,ni=S(()=>{"use strict";W();Tr();zt=class extends Le{get type(){return"link"}lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e);return this.closest("ext-link-text")&&t.push(L(this,{start:n},"nested-link","internal link in an external link")),t}}});var Ra,ja,$r,_e,fn=S(()=>{"use strict";W();Q();ee();j();B();Ra=String.raw`(?:[${Ce}\t]| |�*160;|&#[xX]0*[aA]0;)`,ja=new RegExp(`${Ra}+`,"gu"),_e=class extends w{constructor(e,t="free-ext-link",r=y.getConfig(),i){super(e,r,i,{});T(this,$r);b(this,$r,t)}get type(){return c(this,$r)}get innerText(){let e=new Map([["!","|"],["=","="]]),t=be(this.childNodes.map(r=>{let{type:i}=r,s=String(r.name);return i==="magic-word"&&e.has(s)?e.get(s):r}));return this.type==="magic-link"&&(t=t.replace(ja," ")),t}get link(){let{innerText:e}=this;return this.type==="magic-link"?e.startsWith("ISBN")?`ISBN ${e.slice(5).replace(/[- ]/gu,"").replace(/x$/u,"X")}`:e:Wi(e)}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),i=new R(this,e),{type:s,childNodes:o}=this;if(s==="magic-link"){let{link:u}=this;if(u.startsWith("ISBN")){let p=[...u.slice(5)].map(h=>h==="X"?10:Number(h));(p.length===10&&p.reduce((h,m,f)=>h+m*(10-f),0)%11||p.length===13&&(p[12]===10||p.reduce((h,m,f)=>h+m*(f%2?3:1),0)%10))&&r.push(L(this,i,"invalid-isbn","invalid ISBN"))}return r}let l=s==="ext-link-url",d=l?/\|/u:/[,;。:!?()]+/u,g=o.find(u=>u.type==="text"&&d.test(u.data));if(g){let{data:u}=g,p=$(g,i,"unterminated-url",y.msg("$1 in URL",l?'"|"':"full-width punctuation"),"warning"),{index:h,0:m}=d.exec(u),f=p.startIndex+h;p.suggestions=l?[{desc:"whitespace",range:[f,f+1],text:" "}]:[{desc:"whitespace",range:[f,f],text:" "},{desc:"escape",range:[f,f+m.length],text:encodeURI(m)}],r.push(p)}return r}getUrl(e){{let{type:t}=this,{link:r}=this;if(t==="magic-link"){if(r.startsWith("ISBN"))return this.normalizeTitle(`BookSources/${r.slice(5)}`,-1,!0).getUrl(e);r=r.startsWith("RFC")?`https://tools.ietf.org/html/rfc${r.slice(4)}`:`https://pubmed.ncbi.nlm.nih.gov/${r.slice(5)}`}else r.startsWith("//")&&(r=`https:${r}`);return new URL(r)}}};$r=new WeakMap});var Oe,Gt,ii=S(()=>{"use strict";W();j();B();fn();Gt=class extends w{constructor(e,t="",r="",i=y.getConfig(),s=[]){super(void 0,i,s,{});T(this,Oe);let o=e&&/^\0\d+f\x7F$/u.test(e)?s[Number(e.slice(1,-2))]:new _e(e,"ext-link-url",i,s);if(this.insertAt(o),b(this,Oe,t),r){let l=new w(r,i,s,{});l.type="ext-link-text",l.setAttribute("stage",10),this.insertAt(l)}}get type(){return"ext-link"}toString(e){return this.length===1?`[${super.toString(e)}${c(this,Oe)}]`:`[${super.toString(e,c(this,Oe))}]`}text(){return`[${super.text(" ")}]`}getAttribute(e){return e==="padding"?1:super.getAttribute(e)}getGaps(){return c(this,Oe).length}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t);return this.length===1&&this.closest("heading-title")&&r.push(L(this,{start:e},"var-anchor","variable anchor in a section header")),r}print(){return super.print(this.length===1?{pre:"[",post:`${c(this,Oe)}]`}:{pre:"[",sep:c(this,Oe),post:"]"})}};Oe=new WeakMap});var Nr,Bs=S(()=>{"use strict";j();B();Ve();ni();ii();Nr=class extends w{get type(){return"imagemap-link"}constructor(n,e,t,r=y.getConfig(),i=[]){super(void 0,r,i),this.append(n,e.length===2?new zt(...e,r,i):new Gt(...e,r,i),new K(t,r,i))}}});var xn,qs=S(()=>{"use strict";W();$e();ee();j();B();Ve();ti();Bs();xn=class extends w{get type(){return"ext-inner"}get image(){return this.childNodes.find(Dt("imagemap-image"))}constructor(n,e=y.getConfig(),t=[]){if(super(void 0,e,t,{}),!n)return;let r=n.split(`
|
|
15
|
+
`),i=new Set(e.protocol.split("|")),s=K,o=!0,l=!1;for(let d of r){let g=d.trim();if(!(l||!g||g.startsWith("#"))){if(o){let u=d.indexOf("|"),p=u===-1?d:d.slice(0,u),{valid:h,ns:m}=this.normalizeTitle(p,0,!0,!0);if(h&&m===6){let f=new Ht("imagemap",p,u===-1?void 0:d.slice(u+1),e,t);super.insertAt(f),o=!1;continue}else l=!0}else if(d.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(d);continue}else if(d.includes("[")){let u=d.indexOf("["),p=d.slice(u),h=/^\[\[([^|]+)(?:\|([^\]]+))?\]\][\w\s]*$/u.exec(p);if(h){if(this.normalizeTitle(h[1],0,!0,!0,!1,!0).valid){super.insertAt(new Nr(d.slice(0,u),h.slice(1),p.slice(p.indexOf("]]")+2),e,t));continue}}else if(i.has(p.slice(1,p.indexOf(":")+1))||i.has(p.slice(1,p.indexOf("//")+2))){let m=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(p);if(m){super.insertAt(new Nr(d.slice(0,u),m.slice(1),p.slice(p.indexOf("]")+1),e,t));continue}}}}super.insertAt(new s(d,e,t))}}toString(n){return super.toString(n,`
|
|
16
16
|
`)}text(){return super.text(`
|
|
17
17
|
`).replace(/\n{2,}/gu,`
|
|
18
|
-
`)}getGaps(){return 1}lint(
|
|
19
|
-
`})}}});var xn,qs=A(()=>{"use strict";D();B();Ve();xn=class extends de{get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex()){let{name:e,firstChild:{data:t}}=this;if((e==="templatestyles"||e==="section")&&t){let i=F(this,{start:r},"void-ext",T.msg("nothing should be in <$1>",e));return i.fix={range:[r,i.endIndex],text:"",desc:"empty"},[i]}let n=new RegExp(String.raw`<\s*(?:/\s*)${e==="nowiki"?"":"?"}(${e})\b`,"giu");return super.lint(r,n)}}});var bn={};ie(bn,{NestedToken:()=>ii});var Ra,$r,Ht,ii,Tn=A(()=>{"use strict";D();ee();yr();dn();B();O();si();Xe();Ra=new Set(["comment","include","arg","template","magic-word"]),ii=class extends w{constructor(e,t,n,i=T.getConfig(),s=[]){if(typeof t=="boolean"){let o=Symbol("InputboxToken"),{length:l}=s;s.push(o),e&&(e=at(e,i,s,t)),e&&(e=wr(e,i,s)),s.splice(l,1)}else e&&(e=e.replace(t,(o,l,u,g,d)=>{let p=`\0${s.length+1}e\x7F`;return new Me(l,u,g,d,i,!1,s),p}));e&&(e=e.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(o,l,u)=>(new K(u,i,s),`${l}\0${s.length}n\x7F`)));super(e,i,s);b(this,$r);b(this,Ht);k(this,$r,[...n]),k(this,Ht,t)}get type(){return"ext-inner"}lint(e=this.getAbsoluteIndex(),t){let n=new R(this,e),i=c(this,Ht)?"includeonly":"noinclude",s=typeof c(this,Ht)=="boolean"?new RegExp(String.raw`^(?:<${i}(?:\s[^>]*)?/?>|</${i}\s*>)$`,"iu"):/^<!--[\s\S]*-->$/u;return[...super.lint(e,t),...this.childNodes.filter(o=>{if(o.type==="ext")return!c(this,$r).includes(o.name);if(Ra.has(o.type))return!1;let l=o.toString().trim();return l&&!s.test(l)}).map(o=>{let l=$(o,n,"no-ignored",T.msg("invalid content in <$1>",this.name));return l.suggestions=[{desc:"remove",range:[l.startIndex,l.endIndex],text:""},{desc:"comment",range:[l.startIndex,l.endIndex],text:`<!--${o.toString()}-->`}],l})]}};$r=new WeakMap,Ht=new WeakMap});var Os,_s,oi,Ba,Me,si=A(()=>{"use strict";D();ee();B();Qr();O();Gn();tn();fs();Kn();Cs();Rs();js();qs();Os=(a,r)=>{let e=new Set(a);return e.delete(r),[...e]};_s=[Lt()];Me=class extends(Ba=Et){get type(){return"ext"}constructor(r,e,t,n,i=T.getConfig(),s=!1,o=[]){var p;let l=r.toLowerCase(),u=new Je(!e||/^\s/u.test(e)?e:` ${e}`,"ext-attrs",l,i,o),g={...i,ext:Os(i.ext,l),excludes:[...(p=i.excludes)!=null?p:[]]},d;switch(g.inExt=!0,l){case"tab":g.ext=Os(g.ext,"tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":l==="poem"&&g.excludes.push("heading"),d=new w(t,g,o);break;case"pre":d=new rn(t,g,o);break;case"dynamicpagelist":d=new Bt(s,t,g,o);break;case"inputbox":g.excludes.push("heading"),d=new gn(s,t,g,o);break;case"references":{let{NestedToken:m}=(Tn(),Z(bn));g.excludes.push("heading"),d=new m(t,s,["ref"],g,o);break}case"choose":{let{NestedToken:m}=(Tn(),Z(bn));d=new m(t,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],g,o);break}case"combobox":{let{NestedToken:m}=(Tn(),Z(bn));d=new m(t,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],g,o);break}case"gallery":d=new cn(t,g,o);break;case"imagemap":d=new fn(t,g,o);break;default:d=new xn(t,g,o)}d.setAttribute("name",l),d.type==="plain"&&(d.type="ext-inner"),super(r,u,d,n,i,o),this.seal("closed",!0)}lint(r=this.getAbsoluteIndex(),e){let t=super.lint(r,e),n=new R(this,r);return this.name!=="nowiki"&&this.closest("html-attrs,table-attrs")&&t.push(F(this,n,"parsing-order","extension tag in HTML tag attributes")),this.name==="ref"&&this.closest("heading-title")&&t.push(F(this,n,"var-anchor","variable anchor in a section header")),t}};oi=se(Ba),Me=ae(oi,0,"ExtToken",_s,Me),oe(oi,1,Me)});var Ms,ai,ja,ut,Ws=A(()=>{"use strict";D();nt();B();Ve();Ms=[xe(!1)];ut=class extends(ja=de){constructor(e,t,n,i){super(e,n,i);te(this,"closed");this.closed=t}get type(){return"comment"}getAttribute(e){return e==="padding"?4:super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){if(this.closed)return[];let t=F(this,{start:e},"unclosed-comment",T.msg("unclosed $1","HTML comment"));return t.suggestions=[{range:[t.endIndex,t.endIndex],text:"-->",desc:"close"}],[t]}toString(e){return e?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}};ai=se(ja),ut=ae(ai,0,"CommentToken",Ms,ut),oe(ai,1,ut)});var Hs={};ie(Hs,{parseCommentAndExt:()=>at});var Us,qa,li,Ds,at,yr=A(()=>{"use strict";ns();Xe();ss();si();Ws();Us="<onlyinclude>",qa="</onlyinclude>",{length:li}=Us,Ds=a=>{let r=a.indexOf(Us);return{i:r,j:a.indexOf(qa,r+li)}},at=(a,r,e,t)=>{if(t){let{i:l,j:u}=Ds(a);if(l!==-1&&u!==-1){let g="",d=p=>{new K(p,r,e),g+=`\0${e.length-1}n\x7F`};for(;l!==-1&&u!==-1;){let p=`\0${e.length}e\x7F`;new Xr(a.slice(l+li,u),r,e),l>0&&d(a.slice(0,l)),g+=p,a=a.slice(u+li+1),{i:l,j:u}=Ds(a)}return a&&d(a),g}}let n=r.ext.join("|"),i=t?"includeonly":"(?:no|only)include",s=t?"noinclude":"includeonly",o=new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${i}(?:\s[^>]*)?/?>|</${i}\s*>|<(${n})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(\1\s*)>)|<(${s})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${s}\s*)>|$))`,"giu");return a.replace(o,(l,u,g,d,p,m,h,f,x)=>{let y=e.length,v="n";if(u)v="e",new Me(u,g,d,p,r,m,e);else if(l.startsWith("<!--")){v="c";let C=l.endsWith("-->");new ut(l.slice(4,C?-3:void 0),C,r,e)}else m?new ot(m,h,f,x,r,e):new K(l,r,e);return`\0${y}${v}\x7F`})}});var Oa,_a,Ma,Gs,Gt,Te,Ze,di,Wa,pt,zs=A(()=>{"use strict";D();J();ee();Qr();O();Oa=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),_a=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"]),Ma=new Set(["strike","big","center","font","tt"]);Gs=[Lt()];pt=class extends(Wa=w){constructor(e,t,n,i,s,o){super(void 0,s,o);b(this,Gt);b(this,Te);b(this,Ze);this.insertAt(t),this.setAttribute("name",e.toLowerCase()),k(this,Gt,n),k(this,Te,i),k(this,Ze,e)}get type(){return"html"}get selfClosing(){return c(this,Te)}get closing(){return c(this,Gt)}toString(e){return`<${this.closing?"/":""}${c(this,Ze)}${super.toString(e)}${c(this,Te)?"/":""}>`}text(){let{closing:e}=this,t=c(this,Ze)+(e?"":super.text());return`<${e?"/":""}${t}${c(this,Te)?"/":""}>`}getAttribute(e){return e==="padding"?c(this,Ze).length+(this.closing?2:1):super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){var s;let n=super.lint(e,t),i=new R(this,e);if(this.name==="h1"&&!this.closing){let o=F(this,i,"h1","<h1>");o.suggestions=[{desc:"h2",range:[e+2,e+3],text:"2"}],n.push(o)}if(this.closest("table-attrs")){let o=F(this,i,"parsing-order","HTML tag in table attributes");o.fix={desc:"remove",range:[e,o.endIndex],text:""},n.push(o)}try{this.findMatchingTag()}catch(o){if(o instanceof SyntaxError){let{message:l}=o,u=l.split(":",1)[0].toLowerCase(),g=F(this,i,"unmatched-tag",u),d={desc:"no self-closing",range:[g.endIndex-2,g.endIndex-1],text:""};switch(u){case"unclosed tag":{let p=(s=this.parentNode)==null?void 0:s.childNodes;_a.has(this.name)&&(p!=null&&p.slice(0,p.indexOf(this)).some(({type:m,name:h})=>m==="html"&&h===this.name))?g.suggestions=[{desc:"close",range:[e+1,e+1],text:"/"}]:this.closest("heading-title")||(g.severity="warning");break}case"unmatched closing tag":{let p=this.closest("magic-word");p&&Oa.has(p.name)?g.severity="warning":g.suggestions=[{desc:"remove",range:[e,g.endIndex],text:""}];break}case"tag that is both closing and self-closing":{let{html:[p,,m]}=this.getAttribute("config"),h={desc:"open",range:[e+1,e+2],text:""};m.includes(this.name)?g.fix=h:p.includes(this.name)?g.fix=d:g.suggestions=[h,d];break}case"invalid self-closing tag":g.suggestions=[d,{desc:"close",range:[g.endIndex-2,g.endIndex],text:`></${this.name}>`}]}n.push(g)}}return Ma.has(this.name)&&n.push(F(this,i,"obsolete-tag","obsolete HTML tag","warning")),(this.name==="b"||this.name==="strong")&&this.closest("heading-title")&&n.push(F(this,i,"bold-header","bold in section header","warning")),n}findMatchingTag(){let{html:[e,t,n]}=this.getAttribute("config"),{name:i,parentNode:s,closing:o}=this,l=Di(this.toString());if(o&&(c(this,Te)||n.includes(i)))throw new SyntaxError(`Tag that is both closing and self-closing: ${l}`);if(n.includes(i)||c(this,Te)&&t.includes(i))return this;if(c(this,Te)&&e.includes(i))throw new SyntaxError(`Invalid self-closing tag: ${l}`);if(!s)return;let{childNodes:u}=s,g=u.indexOf(this),d=o?u.slice(0,g).reverse():u.slice(g+1),p=o?-1:1;for(let m of d)if(!(!m.is("html")||m.name!==i)&&(c(m,Gt)?p--:p++,p===0))return m;throw new SyntaxError(`${o?"Unmatched closing":"Unclosed"} tag: ${l}`)}print(){return super.print({pre:`<${this.closing?"/":""}${c(this,Ze)}`,post:`${c(this,Te)?"/":""}>`})}json(){let e=super.json();return Object.assign(e,{closing:this.closing,selfClosing:c(this,Te)}),e}};di=se(Wa),Gt=new WeakMap,Te=new WeakMap,Ze=new WeakMap,pt=ae(di,0,"HtmlToken",Gs,pt),oe(di,1,pt)});var Vs={};ie(Vs,{parseHtml:()=>Ua});var Da,Ua,Xs=A(()=>{"use strict";tn();zs();Da=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,Ua=(a,r,e)=>{var s;let{html:t}=r;(s=r.htmlElements)!=null||(r.htmlElements=new Set([...t[0],...t[1],...t[2]]));let n=a.split("<"),i=n.shift();for(let o of n){let l=Da.exec(o),u=l==null?void 0:l[2],g=u==null?void 0:u.toLowerCase();if(!l||!r.htmlElements.has(g)){i+=`<${o}`;continue}let[,d,,p="",m,h]=l,{length:f}=e,x=new Je(p,"html-attrs",g,r,e),y=x.getAttr("itemprop");if(g==="meta"&&(y===void 0||x.getAttr("content")===void 0)||g==="link"&&(y===void 0||x.getAttr("href")===void 0)){i+=`<${o}`,e.length=f;continue}i+=`\0${e.length}x\x7F${h}`,new pt(u,x,d==="/",m==="/>",r,e)}return i}});var zt,gi=A(()=>{"use strict";Qr();B();O();$t();tn();zt=class extends Lt(1)(w){constructor(r,e,t,n,i=T.getConfig(),s=[],o){super(void 0,i,s,o),this.append(new be(e,r,"table-syntax",i,s,{}),new Je(n,"table-attrs",t,i,s))}}});var ye,Nr,Ir,ui,ct,pi=A(()=>{"use strict";D();ee();B();O();gi();ct=class extends zt{constructor(e,t,n=T.getConfig(),i=[]){var u;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,n,i);b(this,Ir);b(this,ye,"");b(this,Nr);s&&([Mr(this,ye)._]=s);let l=new w(t==null?void 0:t.slice(((u=s==null?void 0:s.index)!=null?u:NaN)+c(this,ye).length),n,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 S(this,Ir,ui).call(this).subtype}afterBuild(){c(this,ye).includes("\0")&&k(this,ye,this.buildFromStr(c(this,ye),0)),super.afterBuild()}toString(e){let{childNodes:[t,n,i]}=this;return t.toString(e)+n.toString(e)+c(this,ye)+i.toString(e)}text(){let{childNodes:[e,t,n]}=this;return e.text()+t.text()+c(this,ye)+n.text()}getGaps(e){return e===1?c(this,ye).length:0}lint(e=this.getAbsoluteIndex(),t){let n=super.lint(e,t),i=new R(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("||"),u=$(s,i,"pipe-like",'additional "|" in a table cell',l?"error":"warning");if(l){let g={caption:"|+",td:"|",th:"!"}[this.subtype];u.fix={range:[u.startIndex,u.endIndex],text:o.replace(/\|\|/gu,`
|
|
20
|
-
${g}`),desc:"newline"}}else
|
|
21
|
-
`)}getAttr(e){let t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}print(){let{childNodes:[e,t,
|
|
22
|
-
|}`,e){let t=this.getAttribute("config"),
|
|
23
|
-
`),o=
|
|
24
|
-
${s.shift()}`,l,
|
|
25
|
-
${
|
|
26
|
-
${g}`;continue}let
|
|
27
|
-
${g}`,l),i.push(l);continue}let[,f,x,
|
|
28
|
-
${
|
|
29
|
-
${
|
|
30
|
-
${d}${y}`,H=_=>{let X=new ct(U,v.slice(I,L==null?void 0:L.index),t,n);return _.insertAt(X),X};for(;L;)H(l),{lastIndex:I}=C,[U]=L,L=C.exec(v);i.push(l,H(l))}}return o.slice(1)}});var vn,eo=A(()=>{"use strict";Ve();vn=class extends de{get type(){return"hr"}}});var to,xi,Qa,mt,ro=A(()=>{"use strict";nt();B();Ve();to=[xe()];mt=class extends(Qa=de){get type(){return"double-underscore"}constructor(r,e,t=T.getConfig(),n){super(r,t,n)}getAttribute(r){return r==="padding"?2:super.getAttribute(r)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}};xi=se(Qa),mt=ae(xi,0,"DoubleUnderscoreToken",to,mt),oe(xi,1,mt)});var no={};ie(no,{parseHrAndDoubleUnderscore:()=>Ka});var Ka,io=A(()=>{"use strict";eo();ro();Jn();Ka=({firstChild:{data:a},type:r,name:e},t,n)=>{var l,u,g;let{doubleUnderscore:[i,s,o]}=t;return(l=t.insensitiveDoubleUnderscore)!=null||(t.insensitiveDoubleUnderscore=new Set(i)),(u=t.sensitiveDoubleUnderscore)!=null||(t.sensitiveDoubleUnderscore=new Set(s)),(g=t.regexHrAndDoubleUnderscore)!=null||(t.regexHrAndDoubleUnderscore=new RegExp(`__(${[...i,...s].join("|")})__`,"giu")),r!=="root"&&(r!=="ext-inner"||e!=="poem")&&(a=`\0${a}`),a=a.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(d,p,m)=>(new vn(m,t,n),`${p}\0${n.length-1}r\x7F`)).replace(t.regexHrAndDoubleUnderscore,(d,p)=>{var x;let m=t.sensitiveDoubleUnderscore.has(p),h=p.toLowerCase(),f=t.insensitiveDoubleUnderscore.has(h);return m||f?(new mt(p,m,t,n),`\0${n.length-1}${f&&((x=o==null?void 0:o[h])!=null?x:h)==="toc"?"u":"n"}\x7F`):d}).replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(d,p,m,h,f)=>{let x=`${p}\0${n.length}h\x7F`;return new qt(m.length,[h,f],t,n),x}),r==="root"||r==="ext-inner"&&e==="poem"?a:a.slice(1)}});var An,so=A(()=>{"use strict";D();ee();B();Ve();An=class extends de{get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}text(){let{parentNode:r,innerText:e}=this;return(r==null?void 0:r.type)==="image-parameter"&&r.name!=="caption"?"":e}lint(r=this.getAbsoluteIndex()){let{previousSibling:e,nextSibling:t,bold:n}=this,i=T.msg('lonely "$1"',"'"),s=[],o=new R(this,r),l=(u,g,d)=>[{desc:"escape",range:[u,g],text:"'".repeat(d)},{desc:"remove",range:[u,g],text:""}];if((e==null?void 0:e.type)==="text"&&e.data.endsWith("'")){let u=F(this,o,"lonely-apos",i),{startIndex:g,startLine:d,startCol:p}=u,[,{length:m}]=/(?:^|[^'])('+)$/u.exec(e.data),h=r-m;s.push({...u,startIndex:h,endIndex:g,endLine:d,startCol:p-m,endCol:p,suggestions:l(h,g,m)})}if((t==null?void 0:t.type)==="text"&&t.data.startsWith("'")){let u=F(this,o,"lonely-apos",i),{endIndex:g,endLine:d,endCol:p}=u,[{length:m}]=/^'+/u.exec(t.data),h=g+m;s.push({...u,startIndex:g,endIndex:h,startLine:d,startCol:p,endCol:p+m,suggestions:l(g,h,m)})}if(n&&this.closest("heading-title")){let u=F(this,o,"bold-header","bold in section header","warning");u.suggestions=[{desc:"remove",range:[r,r+3],text:""}],s.push(u)}return s}json(){let r=super.json();return Object.assign(r,{bold:this.bold,italic:this.italic}),r}}});var oo={};ie(oo,{parseQuotes:()=>bi});var bi,Ti=A(()=>{"use strict";so();bi=(a,r,e)=>{var g;let t=a.split(/('{2,})/u),{length:n}=t;if(n===1)return a;let i=0,s=0,o,l,u;for(let d=1;d<n;d+=2){let p=t[d].length;switch(p){case 2:s++;break;case 4:t[d-1]+="'",t[d]="'''";case 3:if(i++,o!==void 0)break;t[d-1].endsWith(" ")?l===void 0&&u===void 0&&(u=d):t[d-1].slice(-2,-1)===" "?o=d:l!=null||(l=d);break;default:t[d-1]+="'".repeat(p-5),t[d]="'''''",s++,i++}}if(s%2===1&&i%2===1){let d=(g=o!=null?o:l)!=null?g:u;d!==void 0&&(t[d]="''",t[d-1]+="'")}for(let d=1;d<n;d+=2)new An(t[d],r,e),t[d]=`\0${e.length-1}q\x7F`;return t.join("")}});var ao={};ie(ao,{parseExternalLinks:()=>yi});var yi,ki=A(()=>{"use strict";J();ni();hn();yi=(a,r,e,t)=>{var n;return(n=r.regexExternalLinks)!=null||(r.regexExternalLinks=new RegExp(String.raw`\[(\0\d+f\x7F|(?:(?:${r.protocol}|//)${Fe}|\0\d+m\x7F)${Pe}(?=[[\]<>"\t${we}]|\0\d))([${we}]*(?![${we}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),a.replace(r.regexExternalLinks,(i,s,o,l)=>{let{length:u}=e,g=/&[lg]t;/u.exec(s);return g&&(o="",l=s.slice(g.index)+o+l,s=s.slice(0,g.index)),t?(new Oe(s,"ext-link-url",r,e),`[\0${u}f\x7F${o}${l}]`):(new Ut(s,o,l,r,e),`\0${u}w\x7F`)})}});var wn,lo=A(()=>{"use strict";xr();wn=class extends Ie{get type(){return"category"}}});var uo={};ie(uo,{parseLinks:()=>go});var Ja,go,po=A(()=>{"use strict";B();Ti();ki();ri();ei();lo();Ja=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,go=(a,r,e)=>{var s;(s=r.regexLinks)!=null||(r.regexLinks=new RegExp(String.raw`^\s*(?:${r.protocol}|//)`,"iu"));let t=r.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]]))?\]\]([\s\S]*)$/u:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]])?)?\]\]([\s\S]*)$/u,n=a.split("[["),i=n.shift();for(let o=0;o<n.length;o++){let l=!1,u,g,d,p,m=n[o],h=t.exec(m);if(h)[,u,g,d,p]=h,p.startsWith("]")&&(d!=null&&d.includes("["))&&(d+="]",p=p.slice(1));else{let I=Ja.exec(m);I&&(l=!0,[,u,g,d]=I)}if(u===void 0||r.regexLinks.test(u)||/\0\d+[exhbru]\x7F/u.test(u)){i+=`[[${m}`;continue}let f=u.trim().startsWith(":");if(f&&l){i+=`[[${m}`;continue}let x=T.normalizeTitle(u,0,!1,r,!0,!0,!0),{ns:y,valid:v,interwiki:C}=x;if(v){if(l){if(C||y!==6){i+=`[[${m}`;continue}let I=!1;for(o++;o<n.length;o++){let U=n[o],H=U.split("]]");if(H.length>2){I=!0,d+=`[[${H[0]}]]${H[1]}`,p=H.slice(2).join("]]");break}else if(H.length===2)d+=`[[${H[0]}]]${H[1]}`;else{d+=`[[${U}`;break}}if(d=go(d,r,e),!I){i+=`[[${u}${g}${d}`;continue}}}else{i+=`[[${m}`;continue}d&&(d=bi(d,r,e));let L=Dt;f||(!C&&y===6?(d&&(d=yi(d,r,e,!0)),L=Mt):!C&&y===14&&(L=wn)),d===void 0&&g&&(d=""),i+=`\0${e.length}l\x7F${p}`,new L(u,d,r,e,g)}return i}});var xo={};ie(xo,{parseMagicLinks:()=>Ya});var fo,co,mo,ho,Ya,bo=A(()=>{"use strict";J();hn();fo=String.raw`[${we}\t]| |�*160;|�*a0;`,co=`(?:${fo})+`,mo=`(?:${fo}|-)`,ho=String.raw`(?:RFC|PMID)${co}\d+\b|ISBN${co}(?:97[89]${mo}?)?(?:\d${mo}?){9}[\dx]\b`,Ya=(a,r,e)=>{if(!r.regexMagicLinks)try{r.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\d_])(?:(?:${r.protocol})(${Fe}${Pe})|${ho})`,"giu")}catch(t){r.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${r.protocol})(${Fe}${Pe})|${ho})`,"giu")}return a.replace(r.regexMagicLinks,(t,n,i)=>{let s=n?t.slice(n.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 u=s.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,g=u.exec(s);if(g){let d=1;g[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(s.slice(0,g.index))&&(d=2),o=s.slice(g.index+d)+o,s=s.slice(0,g.index+d)}return o.length>=i.length?t:(new Oe(s,void 0,r,e),`${n}\0${e.length-1}w\x7F${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(s))return t;return new Oe(s,"magic-link",r,e),`${n}\0${e.length-1}i\x7F`})}});var To,yo=A(()=>{"use strict";To=(a,r)=>a.startsWith(r)?r.length:[...r].findIndex((e,t)=>e!==a[t])});var Sn,ko=A(()=>{"use strict";hi();Sn=class extends Xt{get type(){return"list"}}});var vo={};ie(vo,{parseList:()=>Za});var Za,Ao=A(()=>{"use strict";yo();ko();fi();Za=(a,r,e,t)=>{let n=/^((?:\0\d+[cno]\x7F)*)([;:*#]+\s*)/u.exec(a);if(!n)return r.lastPrefix="",a;let[i,s,o]=n,l=o.replace(/;/gu,":"),u=To(l,r.lastPrefix),g=(u>1?o.slice(u-1):o).split(/(?=;)/u),d=g[0].startsWith(";"),p=g.length-(d?0:1);if(u>1){let _=o.slice(0,u-1);d?g.unshift(_):g[0]=_+g[0]}r.lastPrefix=l;let m=s+g.map((_,X)=>`\0${t.length+X}d\x7F`).join("")+a.slice(i.length);for(let _ of g)new Sn(_,e,t);if(!p)return m;let{html:[h]}=e,f=/:+|-\{|\0\d+[xq]\x7F/gu,x=f,y=x.exec(m),v=0,C=!1,L=!1,I=0,U=(_,X)=>(new Qt(_,e,t),`${m.slice(0,X)}\0${t.length-1}d\x7F${m.slice(X+_.length)}`),H=_=>{_?v&&v--:v++};for(;y&&p;){let{0:_,index:X}=y;if(_==="-{"){if(!I){let{lastIndex:N}=x;x=/-\{|\}-/gu,x.lastIndex=N}I++}else if(_==="}-"){if(I--,!I){let{lastIndex:N}=x;x=f,x.lastIndex=N}}else if(_.endsWith("x\x7F")){let{name:N,closing:M,selfClosing:W}=t[Number(_.slice(1,-2))];(!W||h.includes(N))&&H(M)}else if(_.endsWith("q\x7F")){let{bold:N,italic:M}=t[Number(_.slice(1,-2))];N&&(H(C),C=!C),M&&(H(L),L=!L)}else if(v===0){if(_.length>=p)return U(_.slice(0,p),X);p-=_.length,x.lastIndex=X+4+String(t.length).length,m=U(_,X)}y=x.exec(m)}return m}});var wo,We,Cn,So=A(()=>{"use strict";D();ee();B();O();je();wo=new Set(["A","T","R","D","-","H","N"]),Cn=class extends w{constructor(e,t=T.getConfig(),n=[]){super(void 0,t,n,{});b(this,We);this.append(...e.map(i=>new V(i,"converter-flag",t,n)))}get type(){return"converter-flags"}afterBuild(){k(this,We,this.childNodes.map(e=>e.text().trim())),super.afterBuild()}toString(e){return super.toString(e,";")}text(){return super.text(";")}getGaps(){return 1}getUnknownFlags(){return new Set(c(this,We).filter(e=>/\{{3}[^{}]+\}{3}/u.test(e)))}getVariantFlags(){let e=new Set(this.getAttribute("config").variants);return new Set(c(this,We).filter(t=>e.has(t)))}lint(e=this.getAbsoluteIndex(),t){let n=this.getVariantFlags(),i=this.getUnknownFlags(),s=new Set(c(this,We).filter(d=>wo.has(d))),o=c(this,We).filter(d=>!d).length,l=c(this,We).length-i.size-o,u=super.lint(e,t);if(n.size===l||s.size===l)return u;let g=new R(this,e);for(let[d,p]of this.childNodes.entries()){let m=p.text().trim();if(m&&!n.has(m)&&!i.has(m)&&(n.size>0||!s.has(m))){let h=$(p,g,"no-ignored","invalid conversion flag");n.size===0&&wo.has(m.toUpperCase())?h.fix={range:[h.startIndex,h.endIndex],text:m.toUpperCase(),desc:"uppercase"}:h.suggestions=[{desc:"remove",range:[h.startIndex-(d&&1),h.endIndex],text:""}],u.push(h)}}return u}print(){return super.print({sep:";"})}};We=new WeakMap});var Kt,Co=A(()=>{"use strict";B();O();je();Kt=class extends w{get type(){return"converter-rule"}constructor(r,e=!0,t=T.getConfig(),n=[]){super(void 0,t,n);let i=r.indexOf(":"),s=r.slice(0,i).indexOf("=>"),o=s===-1?r.slice(0,i):r.slice(s+2,i);e&&t.variants.includes(o.trim())?(super.insertAt(new V(o,"converter-rule-variant",t,n)),super.insertAt(new V(r.slice(i+1),"converter-rule-to",t,n)),s!==-1&&super.insertAt(new V(r.slice(0,s),"converter-rule-from",t,n),0)):super.insertAt(new V(r,"converter-rule-to",t,n))}toString(r){let{childNodes:e,firstChild:t,lastChild:n}=this;return e.length===3?`${t.toString(r)}=>${e[1].toString(r)}:${n.toString(r)}`:super.toString(r,":")}text(){let{childNodes:r,firstChild:e,lastChild:t}=this;return r.length===3?`${e.text()}=>${r[1].text()}:${t.text()}`:super.text(":")}getGaps(r){return r===0&&this.length===3?2:1}print(){let{childNodes:r}=this;if(r.length===3){let[e,t,n]=r;return`<span class="wpb-converter-rule">${e.print()}=>${t.print()}:${n.print()}</span>`}return super.print({sep:":"})}}});var $n,$o=A(()=>{"use strict";J();B();O();So();Co();$n=class extends w{get type(){return"converter"}constructor(r,e,t=T.getConfig(),n=[]){super(void 0,t,n),this.append(new Cn(r,t,n));let[i]=e,s=i.includes(":"),o=new Kt(i,s,t,n);s&&o.length===1||!s&&e.length===2&&!le(e[1]).trim()?this.insertAt(new Kt(e.join(";"),!1,t,n)):this.append(o,...e.slice(1).map(l=>new Kt(l,!0,t,n)))}toString(r){let{childNodes:[e,...t]}=this;return`-{${e.toString(r)}${e.length>0?"|":""}${t.map(n=>n.toString(r)).join(";")}}-`}text(){let{childNodes:[r,...e]}=this;return`-{${r.text()}|${fe(e,";")}}-`}getAttribute(r){return r==="padding"?2:super.getAttribute(r)}getGaps(r){return r||this.firstChild.length>0?1:0}print(){let{childNodes:[r,...e]}=this;return`<span class="wpb-converter">-{${r.print()}${r.length>0?"|":""}${Re(e,{sep:";"})}}-</span>`}}});var No={};ie(No,{parseConverter:()=>el});var el,Io=A(()=>{"use strict";$o();el=(a,r,e)=>{var l;(l=r.regexConverter)!=null||(r.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${r.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"u"));let t=/-\{/gu,n=/-\{|\}-/gu,i=[],s=t,o=s.exec(a);for(;o;){let{0:u,index:g}=o;if(u==="}-"){let d=i.pop(),{length:p}=e,m=a.slice(d.index+2,g),h=m.indexOf("|"),[f,x]=h===-1?[[],m]:[m.slice(0,h).split(";"),m.slice(h+1)],y=x.replace(/(&[#a-z\d]+);/giu,"$1"),v=y.split(r.regexConverter).map(C=>C.replace(/\x01/gu,";"));new $n(f,v,r,e),a=`${a.slice(0,d.index)}\0${p}v\x7F${a.slice(g+2)}`,i.length===0&&(s=t),s.lastIndex=d.index+3+String(p).length}else i.push(o),s=n,s.lastIndex=g+2;o=s.exec(a)}return a}});var Nn={};ie(Nn,{Token:()=>w});var Er,ke,G,Q,ht,Jt,Lr,z,Eo,Lo,Fo,Po,Ro,Bo,jo,qo,Oo,_o,Mo,Wo,vi,w,O=A(()=>{"use strict";J();D();B();Vi();Ki();vi=class vi extends Hr{constructor(e,t=T.getConfig(),n=[],i){super();b(this,z);b(this,Er,"plain");b(this,ke,0);b(this,G);b(this,Q);b(this,ht);b(this,Jt,!1);b(this,Lr);typeof e=="string"&&this.insertAt(e),k(this,G,t),k(this,Q,n),n.push(this)}get type(){return c(this,Er)}set type(e){k(this,Er,e)}parseOnce(e=c(this,ke),t=!1){if(e<c(this,ke)||this.length===0||!this.getAttribute("plain"))return this;if(c(this,ke)>=11)return this;switch(e){case 0:if(this.type==="root"){c(this,Q).pop();let n=S(this,z,Eo).call(this);t&&(t=!n)}k(this,ht,t),S(this,z,Lo).call(this,t);break;case 1:S(this,z,Fo).call(this);break;case 2:S(this,z,Po).call(this);break;case 3:S(this,z,Ro).call(this);break;case 4:S(this,z,Bo).call(this);break;case 5:S(this,z,jo).call(this);break;case 6:S(this,z,qo).call(this);break;case 7:S(this,z,Oo).call(this);break;case 8:S(this,z,_o).call(this);break;case 9:S(this,z,Mo).call(this);break;case 10:S(this,z,Wo).call(this)}if(this.type==="root")for(let n of c(this,Q))n==null||n.parseOnce(e,t);return Mr(this,ke)._++,this}buildFromStr(e,t){let n=e.split(/[\0\x7F]/u).map((i,s)=>{if(s%2===0)return new hr(i);if(isNaN(i.slice(-1)))return c(this,Q)[Number(i.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${i}`)});return t===0?n.map(String).join(""):t===1?fe(n):n}build(){k(this,ke,11);let{length:e,firstChild:t}=this,n=t==null?void 0:t.toString();if(e===1&&t.type==="text"&&n.includes("\0")&&(this.replaceChildren(...this.buildFromStr(n)),this.normalize(),this.type==="root"))for(let i of c(this,Q))i==null||i.build()}afterBuild(){if(this.type==="root")for(let e of c(this,Q))e==null||e.afterBuild();k(this,Jt,!0)}parse(e=11,t){for(e=Math.min(e,11);c(this,ke)<e;)this.parseOnce(c(this,ke),t);return e&&(this.build(),this.afterBuild()),this}getAttribute(e){var t;switch(e){case"plain":return this.constructor===vi;case"config":return c(this,G);case"include":return(t=c(this,ht))!=null?t:!!c(this.getRootNode(),ht);case"accum":return c(this,Q);case"built":return c(this,Jt);default:return super.getAttribute(e)}}setAttribute(e,t){switch(e){case"stage":c(this,ke)===0&&this.type==="root"&&c(this,Q).shift(),k(this,ke,t);break;default:super.setAttribute(e,t)}}insertAt(e,t=this.length){let n=typeof e=="string"?new hr(e):e;return super.insertAt(n,t),n.type==="root"&&(n.type="plain"),n}normalizeTitle(e,t=0,n,i,s){return T.normalizeTitle(e,t,c(this,ht),c(this,G),n,i,s)}lint(e=this.getAbsoluteIndex(),t){var i;let n=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 p of this.querySelectorAll(o)){let m;if(p.type==="category")m=p.name;else{let h=p.getValue();h&&h!==!0&&(m=`#${h}`)}if(m){let h=s.get(m);h?h.add(p):s.set(m,new Set([p]))}}for(let[p,m]of s)if(m.size>1&&!p.startsWith("#mw-customcollapsible-")){let h=!p.startsWith("#"),f=`duplicated ${h?"category":"id"}`,x=h?"error":"warning";n.push(...[...m].map(y=>{let v=F(y,{start:y.getAbsoluteIndex()},"no-duplicate",f,x);return h&&(v.suggestions=[{desc:"remove",range:[v.startIndex,v.endIndex],text:""}]),v}))}let l=/<!--\s*lint-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->/gu,u=this.toString(),g=[],d=l.exec(u);for(;d;){let{1:p,index:m}=d,h=(i=d[2])==null?void 0:i.trim();g.push({line:this.posFromIndex(m).top+(p==="disable-line"?0:1),from:p==="disable"?l.lastIndex:void 0,to:p==="enable"?l.lastIndex:void 0,rules:h?new Set(h.split(",").map(f=>f.trim())):void 0}),d=l.exec(u)}n=n.filter(({rule:p,startLine:m,startIndex:h})=>{let f={pos:0};for(let{line:x,from:y,to:v,rules:C}of g){if(x>m+1)break;if(C&&!C.has(p))continue;if(x===m&&y===void 0&&v===void 0)return!1;y<=h&&y>f.pos?(f.pos=y,f.type="from"):v<=h&&v>f.pos&&(f.pos=v,f.type="to")}return f.type!=="from"})}return n}toString(e,t){return e?super.toString(!0,t):Be(c(this,Lr),()=>super.toString(!1,t),n=>{let i=this.getRootNode();i.type==="root"&&c(i,Jt)&&k(this,Lr,n)})}};Er=new WeakMap,ke=new WeakMap,G=new WeakMap,Q=new WeakMap,ht=new WeakMap,Jt=new WeakMap,Lr=new WeakMap,z=new WeakSet,Eo=function(){let{parseRedirect:e}=(rs(),Z(ts)),t=this.firstChild.toString(),n=e(t,c(this,G),c(this,Q));return n&&this.setText(n),!!n},Lo=function(e){let{parseCommentAndExt:t}=(yr(),Z(Hs));this.setText(t(this.firstChild.toString(),c(this,G),c(this,Q),e))},Fo=function(){let{parseBraces:e}=(dn(),Z(Ss)),t=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,n=e(t,c(this,G),c(this,Q));this.setText(this.type==="root"?n:n.slice(1))},Po=function(){var t;if((t=c(this,G).excludes)!=null&&t.includes("html"))return;let{parseHtml:e}=(Xs(),Z(Vs));this.setText(e(this.firstChild.toString(),c(this,G),c(this,Q)))},Ro=function(){var t;if((t=c(this,G).excludes)!=null&&t.includes("table"))return;let{parseTable:e}=(Zs(),Z(Ys));this.setText(e(this,c(this,G),c(this,Q)))},Bo=function(){var t;if((t=c(this,G).excludes)!=null&&t.includes("hr"))return;let{parseHrAndDoubleUnderscore:e}=(io(),Z(no));this.setText(e(this,c(this,G),c(this,Q)))},jo=function(){let{parseLinks:e}=(po(),Z(uo));this.setText(e(this.firstChild.toString(),c(this,G),c(this,Q)))},qo=function(){var n;if((n=c(this,G).excludes)!=null&&n.includes("quote"))return;let{parseQuotes:e}=(Ti(),Z(oo)),t=this.firstChild.toString().split(`
|
|
31
|
-
`);for(let
|
|
32
|
-
`))},Oo=function(){var t;if((t=c(this,
|
|
33
|
-
`),
|
|
34
|
-
`))},Wo=function(){if(c(this,G).variants.length>0){let{parseConverter:e}=(Io(),Z(No));this.setText(e(this.firstChild.toString(),c(this,G),c(this,Q)))}};w=vi});var Se,Ot,Mn,zr,Ce=A(()=>{"use strict";Se={running:!1,run(a){let{running:r}=this;this.running=!0;try{let{Token:e}=(O(),Z(Nn)),t=a();return t instanceof e&&!t.getAttribute("built")&&t.afterBuild(),this.running=r,t}catch(e){throw this.running=r,e}},rev:0},Ot=a=>r=>r.type===a,Mn=(a,r,e,t=[])=>{var o,l;let{childNodes:n}=a,i=Object.isFrozen(n)?[...n]:n,s=i.splice(r,e,...t);for(let u=0;u<t.length;u++){let g=t[u];g.setAttribute("parentNode",a),g.setAttribute("nextSibling",i[r+u+1]),g.setAttribute("previousSibling",i[r+u-1])}return(o=i[r-1])==null||o.setAttribute("nextSibling",i[r]),(l=i[r+t.length])==null||l.setAttribute("previousSibling",i[r+t.length-1]),s},zr=(a,r)=>{Object.defineProperty(a,"name",{value:r.name})}});var Do={};ie(Do,{Title:()=>Ai});var Fr,Pr,ve,Yt,De,Ai,Uo=A(()=>{"use strict";J();Ai=class{constructor(r,e,t,n,i){b(this,Fr);b(this,Pr);b(this,ve);b(this,Yt);b(this,De);te(this,"interwiki","");te(this,"valid");te(this,"encoded",!1);let s=r.trim().startsWith("../");if(n&&r.includes("%"))try{let l=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(r);r=Ge(r),this.encoded=l}catch(l){}if(r=ar(r).replace(/[_ ]+/gu," ").trim(),s)k(this,Yt,0);else{let l=e;r.startsWith(":")&&(l=0,r=r.slice(1).trim());let u=r.split(":");if(u.length>1){let g=u[0].trim().toLowerCase(),d=Object.prototype.hasOwnProperty.call(t.nsid,g)&&t.nsid[g];d&&(l=d,r=u.slice(1).join(":").trim())}k(this,Yt,l)}let o=r.indexOf("#");if(o!==-1){let l=r.slice(o).trim().slice(1);if(l.includes("%"))try{l=Ge(l)}catch(u){}k(this,De,l.replace(/ /gu,"_")),r=r.slice(0,o).trim()}this.valid=!!(r||this.interwiki||i&&this.ns===0&&c(this,De)!==void 0)&&ar(r)===r&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(s?/^(?:\.\.\/)+(.*)/u.exec(r)[1]:r),this.main=r,Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}}),k(this,Pr,t.namespaces),k(this,ve,t.articlePath||"/wiki/$1"),c(this,ve).includes("$1")||k(this,ve,c(this,ve)+`${c(this,ve).endsWith("/")?"":"/"}$1`)}get ns(){return c(this,Yt)}get fragment(){return c(this,De)}get main(){return c(this,Fr)}set main(r){r=r.replace(/_/gu," ").trim(),k(this,Fr,r&&r[0].toUpperCase()+r.slice(1))}get prefix(){let r=c(this,Pr)[this.ns];return r+(r&&":")}get title(){return this.getRedirection()[1]}get extension(){let{main:r}=this,e=r.lastIndexOf(".");return e===-1?void 0:r.slice(e+1).toLowerCase()}toString(r){return(r?this.title.replace(/_/gu," "):this.title)+(c(this,De)===void 0?"":`#${c(this,De)}`)}getRedirection(){return[!1,(this.interwiki+(this.interwiki&&":")+this.prefix+this.main).replace(/ /gu,"_")]}setFragment(r){k(this,De,r)}getUrl(r){{typeof r=="string"&&(k(this,ve,r||"/wiki/$1"),c(this,ve).includes("$1")||k(this,ve,c(this,ve)+`${c(this,ve).endsWith("/")?"":"/"}$1`));let{title:e,fragment:t}=this;return e?c(this,ve).replace("$1",encodeURIComponent(e)+(t===void 0?"":`#${encodeURIComponent(t)}`)):t===void 0?"":`#${encodeURIComponent(t)}`}}};Fr=new WeakMap,Pr=new WeakMap,ve=new WeakMap,Yt=new WeakMap,De=new WeakMap});var Ko={};ie(Ko,{LanguageService:()=>wi,tasks:()=>zo});var zo,tl,rl,nl,il,Vo,sl,ol,Ho,qr,al,Zt,ge,Go,Xo,Rr,Br,er,In,Le,Ue,Or,tr,rr,nr,j,ce,Si,Ae,Qo,jr,wi,Jo=A(()=>{"use strict";Rn();Xn();D();J();B();zo=new WeakMap,tl=new Set(["ref"]),rl=new Set(["ref","references"]),nl=new Set(["name","extends","follow"]),il=new Set(["group"]),Vo=new Set(["arg-name","template-name","magic-word-name","link-target","parameter-key"]),sl=new Set(["ext","html","attr-key","image-parameter","heading-title","heading",...Vo]),ol=new Set(["text","comment","noinclude","include"]),Ho=a=>a.every(({type:r})=>ol.has(r)),qr=(a,r)=>{let{top:e,left:t}=a.posFromIndex(r);return{line:e,character:t}},al=(a,r,e)=>({start:qr(a,r),end:qr(a,e)}),Zt=a=>{let{top:r,left:e,height:t,width:n}=a.getBoundingClientRect();return{start:{line:r,character:e},end:kt(r,e,t,n)}},ge=(a,r,e,{line:t,character:n},i)=>[...new Set(a)].map(s=>({label:s,kind:r,textEdit:{range:{start:{line:t,character:n-e.length},end:{line:t,character:n}},newText:s+(i!=null?i:"")}})),Go=(a,{line:r,character:e})=>{let t=a.indexFromPos(r,e);return a.caretPositionFromIndex(t+Number(/\w/u.test(a.toString().charAt(t))))},Xo=(a,r,e)=>{let{type:t,parentNode:n={}}=a,{name:i,tag:s}=n;return t==="attr-value"&&r.has(s)&&e.has(i)?a.toString().trim():NaN},Rr=a=>Xo(a,tl,nl),Br=a=>Xo(a,rl,il),er=(a,r)=>{let e=a==null?void 0:a.getAttr(r);return e!==!0&&e||!1},In=a=>{let{type:r,name:e,parentNode:t}=a;switch(r){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}},wi=class{constructor(r){b(this,j);b(this,Le);b(this,Ue);b(this,Or);b(this,tr);b(this,rr);b(this,nr);te(this,"data");zo.set(r,this)}destroy(){Object.setPrototypeOf(this,null)}async provideDocumentColors(r,e,t=!0){S(this,j,Ae).call(this);let n=await S(this,j,ce).call(this,e);return n.querySelectorAll("attr-value,parameter-value,arg-default").flatMap(({type:i,childNodes:s})=>i!=="attr-value"&&!Ho(s)?[]:s.filter(o=>o.type==="text").reverse().flatMap(o=>{let l=Oi(o.data,t).filter(([,,,g])=>g);if(l.length===0)return[];let u=o.getAbsoluteIndex();return l.map(([g,d,p])=>{let m=r(g);return m.length===4&&{color:{red:m[0]/255,green:m[1]/255,blue:m[2]/255,alpha:m[3]},range:al(n,u+d,u+p)}}).filter(Boolean)}))}provideColorPresentations({color:{red:r,green:e,blue:t,alpha:n},range:i}){let s=`#${or(r)}${or(e)}${or(t)}${n<1?or(n):""}`;return[{label:s,textEdit:{range:i,newText:s}}]}async provideCompletionItems(r,e){var C,L,I,U,H,_,X;S(this,j,Ae).call(this);let{re:t,allTags:n,functions:i,switches:s,protocols:o,params:l,tags:u,ext:g}=S(this,j,Qo).call(this),{line:d,character:p}=e,m=r.split(/\r?\n/u,d+1)[d],h=t.exec((C=m==null?void 0:m.slice(0,p))!=null?C:"");if((h==null?void 0:h[1])!==void 0){let N=h[1].startsWith("/");return ge(n,"Class",h[1].slice(N?1:0),e,N&&!(m!=null&&m.slice(p).trim().startsWith(">"))?">":"")}else{if(h!=null&&h[4])return ge(s,"Constant",h[4],e);if((h==null?void 0:h[5])!==void 0)return ge(o,"Reference",h[5],e)}let f=await S(this,j,ce).call(this,r),x;if(h!=null&&h[2]){x=f.elementFromPoint(h.index+h[2].length-1,d);let N=(L=h[3])!=null?L:"";if(h[2]==="{{{")return ge(f.querySelectorAll("arg").filter(E=>E.name&&E!==x).map(({name:E})=>E),"Variable",N,e);let M=N.startsWith(":"),W=M?N.slice(1).trimStart():N;return h[2]==="[["?ge(f.querySelectorAll("link,file,category,redirect-target").filter(E=>E!==x).map(({name:E})=>E),"Folder",W,e):[...ge(i,"Function",N,e),...N.startsWith("#")?[]:ge(f.querySelectorAll("template").filter(E=>E!==x).map(E=>{let{name:q}=E;if(M)return q;let{ns:P}=E.getAttribute("title");return P===0?`:${q}`:P===10?q.slice(9):q}),"Folder",W,e)]}let y,v;if((h==null?void 0:h[7])===void 0&&(x=f.elementFromPoint(p,d),{type:y,parentNode:v}=x),(h==null?void 0:h[6])!==void 0||y==="image-parameter"){let N=f.indexFromPos(d,p),M=(U=(I=h==null?void 0:h[6])==null?void 0:I.trimStart())!=null?U:c(this,Le).slice(x.getAbsoluteIndex(),N).trimStart(),W=c(this,Le).charAt(N)==="=";return[...ge(l,"Property",M,e).filter(({label:E})=>!W||!/[= ]$/u.test(E)),...ge(f.querySelectorAll("image-parameter#width").filter(E=>E!==x).map(E=>E.text()),"Unit",M,e)]}else if((h==null?void 0:h[7])!==void 0||y==="attr-key"){let N=(_=(H=h==null?void 0:h[7])==null?void 0:H.toLowerCase())!=null?_:v.tag,M=(X=h==null?void 0:h[9])!=null?X:x.toString();if(!u.has(N))return;let W=Zr[N],E=en[N],q=E&&ge(E,"Field",M,e);return g.includes(N)&&!W?q:[...q!=null?q:[],...N==="meta"||N==="link"?[]:ge(Yr,"Property",M,e),...W?ge(W,"Property",M,e):[],...ge(["data-"],"Variable",M,e),...ge(["xmlns:"],"Interface",M,e)]}else if(y==="parameter-key"||y==="parameter-value"&&v.anon){let N=v.parentNode;if(N.type==="magic-word"&&N.name!=="invoke")return;let M=x.toString().trimStart(),[W,E]=N.type==="magic-word"?N.getModule():[];return M?ge(f.querySelectorAll("parameter").filter(q=>{if(q===v||q.anon||q.parentNode.type!==N.type||q.parentNode.name!==N.name)return!1;if(N.type==="template")return!0;let[P,me]=q.parentNode.getModule();return P===W&&me===E}).map(({name:q})=>q),"Variable",M,e,y==="parameter-value"?"=":""):void 0}}async provideDiagnostics(r,e=!0){S(this,j,Ae).call(this);let t=await S(this,j,ce).call(this,r),n=t.lint();return(e?n:n.filter(({severity:i})=>i==="error")).map(({startLine:i,startCol:s,endLine:o,endCol:l,severity:u,rule:g,message:d,fix:p,suggestions:m})=>({range:{start:{line:i,character:s},end:{line:o,character:l}},severity:u==="error"?1:2,source:"WikiLint",code:g,message:d}))}async provideFoldingRanges(r){S(this,j,Ae).call(this);let e=await S(this,j,ce).call(this,r),{length:t}=e.getLines(),n=[],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{top:l,height:u}=o.getBoundingClientRect();if(o.type==="heading-title"){let{level:g}=o.parentNode;for(let d=g-1;d<6;d++){let p=i[d];p!==void 0&&p<l-1&&n.push({startLine:p,endLine:l-1,kind:"region"}),i[d]=void 0}i[g-1]=l+u-1}else u>2&&n.push({startLine:l,endLine:l+u-2,kind:"region"})}for(let o of i)o!==void 0&&o<t-1&&n.push({startLine:o,endLine:t-1,kind:"region"});return n}async provideLinks(r){S(this,j,Ae).call(this);let{articlePath:e,protocol:t}=T.getConfig(),n=e==null?void 0:e.includes("//"),i=new RegExp(`^(?:${t}|//)`,"iu");return(await S(this,j,ce).call(this,r)).querySelectorAll(`magic-link,ext-link-url,free-ext-link,attr-value,image-parameter#link${n?",link-target,template-name,invoke-module":""}`).reverse().map(s=>{let{type:o,parentNode:l,firstChild:u,lastChild:g,childNodes:d}=s,{name:p,tag:m}=l;if(!(o!=="attr-value"||p==="src"&&["templatestyles","img"].includes(m)||p==="cite"&&["blockquote","del","ins","q"].includes(m))||!Ho(d))return!1;let h=d.filter(f=>f.type==="text").map(({data:f})=>f).join("").trim();if(!h)return!1;try{if(s.is("magic-link")||s.is("ext-link-url")||s.is("free-ext-link"))h=s.getUrl(e);else if(o==="link-target"&&(l.is("link")||l.is("redirect-target")||l.is("category"))){if(h.startsWith("/"))return!1;h=l.link.getUrl(e)}else if(o==="template-name")h=l.getAttribute("title").getUrl(e);else if(["link-target","invoke-module"].includes(o)||o==="attr-value"&&p==="src"&&m==="templatestyles"||o==="image-parameter"&&!i.test(h)){if(!n||h.startsWith("/"))return!1;let f=0;o==="attr-value"?f=10:o==="invoke-module"&&(f=828);let x=T.normalizeTitle(h,f);if(!x.valid)return!1;h=x.getUrl()}if(typeof h=="string"&&h.startsWith("//")&&(h=`https:${h}`),h=new URL(h).href,o==="image-parameter"){let{top:f,left:x,height:y,width:v}=g.getBoundingClientRect(),C=u.getBoundingClientRect();return{range:{start:{line:C.top,character:C.left},end:kt(f,x,y,v)},target:h}}return{range:Zt(s),target:h}}catch(f){return!1}}).filter(Boolean)}async provideReferences(r,e){S(this,j,Ae).call(this);let t=await S(this,j,ce).call(this,r),{offsetNode:n,offset:i}=Go(t,e),s=n.type==="text"?n.parentNode:n,o=i===0&&(s.type==="ext-attr-dirty"||s.type==="html-attr-dirty")?s.parentNode.parentNode:s,{type:l}=o,u=Rr(o),g=Br(o);if(!u&&!g&&!sl.has(l))return;let d=In(o),p=t.querySelectorAll(l==="heading-title"?"heading":l).filter(m=>l==="attr-value"?Rr(m)===u||Br(m)===g:In(m)===d).map(m=>({range:Zt(m.type==="parameter-key"?m.parentNode:m)}));return p.length===0?void 0:p}async provideDefinition(r,{line:e,character:t}){S(this,j,Ae).call(this);let n=await S(this,j,ce).call(this,r),i=n.elementFromPoint(t,e),s=i.is("ext")&&i.name==="ref"?i:i.closest("ext#ref"),o=er(s,"name");if(!o)return;let l=er(s,"group"),u=n.querySelectorAll("ext#ref").filter(g=>g.innerText&&er(g,"name")===o&&er(g,"group")===l).map(({lastChild:g})=>({range:Zt(g)}));return u.length===0?void 0:u}async resolveRenameLocation(r,{line:e,character:t}){S(this,j,Ae).call(this);let n=await S(this,j,ce).call(this,r),i=n.elementFromPoint(t,e),{type:s}=i,o=Rr(i),l=Br(i);return!o&&!l&&(!Vo.has(s)||s==="parameter-key"&&/^[1-9]\d*$/u.test(i.parentNode.name)||s==="link-target"&&!["link","redirect-target"].includes(i.parentNode.type))?void 0:Zt(i)}async provideRenameEdits(r,{line:e,character:t},n){S(this,j,Ae).call(this);let i=await S(this,j,ce).call(this,r),s=i.elementFromPoint(t,e),{type:o}=s,l=Rr(s),u=l&&er(s.parentNode.parentNode,"group"),g=Br(s),d=In(s),p=i.querySelectorAll(o).filter(m=>{let{type:h}=m.parentNode;return o==="link-target"&&h!=="link"&&h!=="redirect-target"?!1:o==="attr-value"?Br(m)===g||Rr(m)===l&&er(m.parentNode.parentNode,"group")===u:In(m)===d});return p.length===0?void 0:{changes:{"":p.map(m=>({range:Zt(m),newText:n}))}}}async provideHover(r,e){if(!this.data)return;S(this,j,Ae).call(this);let t=await S(this,j,ce).call(this,r),{offsetNode:n,offset:i}=Go(t,e),s=n.type==="text"?n.parentNode:n,{type:o,parentNode:l,length:u,name:g}=s,d,p,m;if(s.is("double-underscore")){if(i===0&&s.getBoundingClientRect().left>e.character)return;d=this.data.behaviorSwitches.find(({aliases:h})=>h.includes(s.innerText.toLowerCase()))}else if(o==="magic-word-name")d=S(this,j,jr).call(this,l.name),p=s.toString(!0).trim();else if(s.is("magic-word")&&u===1&&!s.modifier)d=S(this,j,jr).call(this,g),p=s.firstChild.toString(!0).trim();else if((s.is("magic-word")||s.is("template"))&&s.modifier&&i>=2&&s.getRelativeIndex(0)>i&&(p=s.modifier.trim().slice(0,-1),d=S(this,j,jr).call(this,p.toLowerCase()),d)){let h=s.getAbsoluteIndex();m={start:qr(t,h+2),end:qr(t,h+s.modifier.trimEnd().length+1)}}return d&&{contents:{kind:"markdown",value:(d.signatures?`${d.signatures.map(h=>`- **{{ ${p}${h.length===0?"**":":** "}${h.map(({label:f,const:x})=>x?f:`*${f}*`).join(" **|** ")} **}}**`).join(`
|
|
18
|
+
`)}getGaps(){return 1}lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e),r=new R(this,n);return this.image?t.push(...this.childNodes.filter(i=>{let s=i.toString().trim();return i.type==="noinclude"&&s&&!s.startsWith("#")}).map(i=>{let s=$(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(L(this,r,"invalid-imagemap","<imagemap> without an image")),t}print(){return super.print({sep:`
|
|
19
|
+
`})}}});var bn,_s=S(()=>{"use strict";W();j();Ge();bn=class extends ge{get type(){return"ext-inner"}lint(n=this.getAbsoluteIndex()){let{name:e,firstChild:{data:t}}=this;if((e==="templatestyles"||e==="section")&&t){let i=L(this,{start:n},"void-ext",y.msg("nothing should be in <$1>",e));return i.fix={range:[n,i.endIndex],text:"",desc:"empty"},[i]}let r=new RegExp(String.raw`<\s*(?:/\s*)${e==="nowiki"?"":"?"}(${e})\b`,"giu");return super.lint(n,r)}}});var Tn={};se(Tn,{NestedToken:()=>si});var Ba,Ir,Vt,si,yn=S(()=>{"use strict";W();ee();vr();un();j();B();oi();Ve();Ba=new Set(["comment","include","arg","template","magic-word"]),si=class extends w{constructor(e,t,r,i=y.getConfig(),s=[]){if(typeof t=="boolean"){let o=Symbol("InputboxToken"),{length:l}=s;s.push(o),e&&(e=at(e,i,s,t)),e&&(e=Cr(e,i,s)),s.splice(l,1)}else e&&(e=e.replace(t,(o,l,d,g,u)=>{let p=`\0${s.length+1}e\x7F`;return new Me(l,d,g,u,i,!1,s),p}));e&&(e=e.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(o,l,d)=>(new K(d,i,s),`${l}\0${s.length}n\x7F`)));super(e,i,s);T(this,Ir);T(this,Vt);b(this,Ir,[...r]),b(this,Vt,t)}get type(){return"ext-inner"}lint(e=this.getAbsoluteIndex(),t){let r=new R(this,e),i=c(this,Vt)?"includeonly":"noinclude",s=typeof c(this,Vt)=="boolean"?new RegExp(String.raw`^(?:<${i}(?:\s[^>]*)?/?>|</${i}\s*>)$`,"iu"):/^<!--[\s\S]*-->$/u;return[...super.lint(e,t),...this.childNodes.filter(o=>{let{type:l,name:d}=o;if(l==="ext")return!c(this,Ir).includes(d);if(Ba.has(l))return!1;let g=o.toString().trim();return g&&!s.test(g)}).map(o=>{let l=$(o,r,"no-ignored",y.msg("invalid content in <$1>",this.name));return l.suggestions=[{desc:"remove",range:[l.startIndex,l.endIndex],text:""},{desc:"comment",range:[l.startIndex,l.endIndex],text:`<!--${o.toString()}-->`}],l})]}};Ir=new WeakMap,Vt=new WeakMap});var Os,Ms,ai,qa,Me,oi=S(()=>{"use strict";W();ee();j();Jr();B();zn();nn();xs();Kn();$s();js();qs();_s();Os=(a,n)=>{let e=new Set(a);return e.delete(n),[...e]};Ms=[Rt()];Me=class extends(qa=Pt){get type(){return"ext"}constructor(n,e,t,r,i=y.getConfig(),s=!1,o=[]){var p;let l=n.toLowerCase(),d=new Ke(!e||/^\s/u.test(e)?e:` ${e}`,"ext-attrs",l,i,o),g={...i,ext:Os(i.ext,l),excludes:[...(p=i.excludes)!=null?p:[]]},u;switch(g.inExt=!0,l){case"tab":g.ext=Os(g.ext,"tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":l==="poem"&&g.excludes.push("heading"),u=new w(t,g,o);break;case"pre":u=new sn(t,g,o);break;case"dynamicpagelist":u=new _t(s,t,g,o);break;case"inputbox":g.excludes.push("heading"),u=new pn(s,t,g,o);break;case"references":{let{NestedToken:h}=(yn(),J(Tn));g.excludes.push("heading"),u=new h(t,s,["ref"],g,o);break}case"choose":{let{NestedToken:h}=(yn(),J(Tn));u=new h(t,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],g,o);break}case"combobox":{let{NestedToken:h}=(yn(),J(Tn));u=new h(t,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],g,o);break}case"gallery":u=new hn(t,g,o);break;case"imagemap":u=new xn(t,g,o);break;default:u=new bn(t,g,o)}u.setAttribute("name",l),u.type==="plain"&&(u.type="ext-inner"),super(n,d,u,r,i,o),this.seal("closed",!0)}lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e),r=new R(this,n);return this.name!=="nowiki"&&this.closest("html-attrs,table-attrs")&&t.push(L(this,r,"parsing-order","extension tag in HTML tag attributes")),this.name==="ref"&&this.closest("heading-title")&&t.push(L(this,r,"var-anchor","variable anchor in a section header")),t}};ai=oe(qa),Me=le(ai,0,"ExtToken",Ms,Me),ae(ai,1,Me)});var Ds,li,_a,pt,Ws=S(()=>{"use strict";W();nt();j();Ge();Ds=[Te(!1)];pt=class extends(_a=ge){constructor(e,t,r,i){super(e,r,i);ne(this,"closed");this.closed=t}get type(){return"comment"}getAttribute(e){return e==="padding"?4:super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){if(this.closed)return[];let t=L(this,{start:e},"unclosed-comment",y.msg("unclosed $1","HTML comment"));return t.suggestions=[{range:[t.endIndex,t.endIndex],text:"-->",desc:"close"}],[t]}toString(e){return e?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}};li=oe(_a),pt=le(li,0,"CommentToken",Ds,pt),ae(li,1,pt)});var zs={};se(zs,{parseCommentAndExt:()=>at});var Hs,Oa,di,Us,at,vr=S(()=>{"use strict";is();Ve();os();oi();Ws();Hs="<onlyinclude>",Oa="</onlyinclude>",{length:di}=Hs,Us=a=>{let n=a.indexOf(Hs);return{i:n,j:a.indexOf(Oa,n+di)}},at=(a,n,e,t)=>{if(t){let{i:l,j:d}=Us(a);if(l!==-1&&d!==-1){let g="",u=p=>{new K(p,n,e),g+=`\0${e.length-1}n\x7F`};for(;l!==-1&&d!==-1;){let p=`\0${e.length}e\x7F`;new Kr(a.slice(l+di,d),n,e),l>0&&u(a.slice(0,l)),g+=p,a=a.slice(d+di+1),{i:l,j:d}=Us(a)}return a&&u(a),g}}let r=n.ext.join("|"),i=t?"includeonly":"(?:no|only)include",s=t?"noinclude":"includeonly",o=new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${i}(?:\s[^>]*)?/?>|</${i}\s*>|<(${r})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(\1\s*)>)|<(${s})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${s}\s*)>|$))`,"giu");return a.replace(o,(l,d,g,u,p,h,m,f,x)=>{let k=e.length,A="n";if(d)A="e",new Me(d,g,u,p,n,h,e);else if(l.startsWith("<!--")){A="c";let C=l.endsWith("-->");new pt(l.slice(4,C?-3:void 0),C,n,e)}else h?new ot(h,m,f,x,n,e):new K(l,n,e);return`\0${k}${A}\x7F`})}});var Ma,Da,Wa,Gs,Xt,ke,Ye,gi,Ua,ct,Vs=S(()=>{"use strict";W();Q();ee();Jr();B();Ma=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),Da=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"]),Wa=new Set(["strike","big","center","font","tt"]);Gs=[Rt()];ct=class extends(Ua=w){constructor(e,t,r,i,s,o){super(void 0,s,o);T(this,Xt);T(this,ke);T(this,Ye);this.insertAt(t),this.setAttribute("name",e.toLowerCase()),b(this,Xt,r),b(this,ke,i),b(this,Ye,e)}get type(){return"html"}get selfClosing(){return c(this,ke)}get closing(){return c(this,Xt)}toString(e){return`<${this.closing?"/":""}${c(this,Ye)}${super.toString(e)}${c(this,ke)?"/":""}>`}text(){let{closing:e}=this,t=c(this,Ye)+(e?"":super.text());return`<${e?"/":""}${t}${c(this,ke)?"/":""}>`}getAttribute(e){return e==="padding"?c(this,Ye).length+(this.closing?2:1):super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){var s;let r=super.lint(e,t),i=new R(this,e);if(this.name==="h1"&&!this.closing){let o=L(this,i,"h1","<h1>");o.suggestions=[{desc:"h2",range:[e+2,e+3],text:"2"}],r.push(o)}if(this.closest("table-attrs")){let o=L(this,i,"parsing-order","HTML tag in table attributes");o.fix={desc:"remove",range:[e,o.endIndex],text:""},r.push(o)}try{this.findMatchingTag()}catch(o){if(o instanceof SyntaxError){let{message:l}=o,d=l.split(":",1)[0].toLowerCase(),g=L(this,i,"unmatched-tag",d),u={desc:"no self-closing",range:[g.endIndex-2,g.endIndex-1],text:""};switch(d){case"unclosed tag":{let p=(s=this.parentNode)==null?void 0:s.childNodes;Da.has(this.name)&&(p!=null&&p.slice(0,p.indexOf(this)).some(({type:h,name:m})=>h==="html"&&m===this.name))?g.suggestions=[{desc:"close",range:[e+1,e+1],text:"/"}]:this.closest("heading-title")||(g.severity="warning");break}case"unmatched closing tag":{let p=this.closest("magic-word");p&&Ma.has(p.name)?g.severity="warning":g.suggestions=[{desc:"remove",range:[e,g.endIndex],text:""}];break}case"tag that is both closing and self-closing":{let{html:[p,,h]}=this.getAttribute("config"),m={desc:"open",range:[e+1,e+2],text:""};h.includes(this.name)?g.fix=m:p.includes(this.name)?g.fix=u:g.suggestions=[m,u];break}case"invalid self-closing tag":g.suggestions=[u,{desc:"close",range:[g.endIndex-2,g.endIndex],text:`></${this.name}>`}]}r.push(g)}}return Wa.has(this.name)&&r.push(L(this,i,"obsolete-tag","obsolete HTML tag","warning")),(this.name==="b"||this.name==="strong")&&this.closest("heading-title")&&r.push(L(this,i,"bold-header","bold in section header","warning")),r}findMatchingTag(){let{html:[e,t,r]}=this.getAttribute("config"),{name:i,parentNode:s,closing:o}=this,l=Ui(this.toString());if(o&&(c(this,ke)||r.includes(i)))throw new SyntaxError(`Tag that is both closing and self-closing: ${l}`);if(r.includes(i)||c(this,ke)&&t.includes(i))return this;if(c(this,ke)&&e.includes(i))throw new SyntaxError(`Invalid self-closing tag: ${l}`);if(!s)return;let{childNodes:d}=s,g=d.indexOf(this),u=o?d.slice(0,g).reverse():d.slice(g+1),p=o?-1:1;for(let h of u)if(!(!h.is("html")||h.name!==i)&&(c(h,Xt)?p--:p++,p===0))return h;throw new SyntaxError(`${o?"Unmatched closing":"Unclosed"} tag: ${l}`)}print(){return super.print({pre:`<${this.closing?"/":""}${c(this,Ye)}`,post:`${c(this,ke)?"/":""}>`})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return Object.assign(r,{closing:this.closing,selfClosing:c(this,ke)}),r}};gi=oe(Ua),Xt=new WeakMap,ke=new WeakMap,Ye=new WeakMap,ct=le(gi,0,"HtmlToken",Gs,ct),ae(gi,1,ct)});var Xs={};se(Xs,{parseHtml:()=>za});var Ha,za,Qs=S(()=>{"use strict";nn();Vs();Ha=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,za=(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=Ha.exec(o),d=l==null?void 0:l[2],g=d==null?void 0:d.toLowerCase();if(!l||!n.htmlElements.has(g)){i+=`<${o}`;continue}let[,u,,p="",h,m]=l,{length:f}=e,x=new Ke(p,"html-attrs",g,n,e),k=x.getAttr("itemprop");if(g==="meta"&&(k===void 0||x.getAttr("content")===void 0)||g==="link"&&(k===void 0||x.getAttr("href")===void 0)){i+=`<${o}`,e.length=f;continue}i+=`\0${e.length}x\x7F${m}`,new ct(d,x,u==="/",h==="/>",n,e)}return i}});var Qt,ui=S(()=>{"use strict";Jr();j();B();Et();nn();Qt=class extends Rt(1)(w){constructor(n,e,t,r,i=y.getConfig(),s=[],o){super(void 0,i,s,o),this.append(new ye(e,n,"table-syntax",i,s,{}),new Ke(r,"table-attrs",t,i,s))}}});var ve,Er,Lr,pi,Kt,ci=S(()=>{"use strict";W();ee();j();B();ui();Kt=class extends Qt{constructor(e,t,r=y.getConfig(),i=[]){var d;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,Lr);T(this,ve,"");T(this,Er);s&&([Ur(this,ve)._]=s);let l=new w(t==null?void 0:t.slice(((d=s==null?void 0:s.index)!=null?d:NaN)+c(this,ve).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,Lr,pi).call(this).subtype}afterBuild(){c(this,ve).includes("\0")&&b(this,ve,this.buildFromStr(c(this,ve),0)),super.afterBuild()}toString(e){let{childNodes:[t,r,i]}=this;return t.toString(e)+r.toString(e)+c(this,ve)+i.toString(e)}text(){let{childNodes:[e,t,r]}=this;return e.text()+t.text()+c(this,ve)+r.text()}getGaps(e){return e===1?c(this,ve).length:0}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),i=new R(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("||"),d=$(s,i,"pipe-like",'additional "|" in a table cell',l?"error":"warning");if(l){let g={caption:"|+",td:"|",th:"!"}[this.subtype];d.fix={range:[d.startIndex,d.endIndex],text:o.replace(/\|\|/gu,`
|
|
20
|
+
${g}`),desc:"newline"}}else d.suggestions=[{desc:"escape",range:[d.startIndex,d.endIndex],text:o.replace(/\|/gu,"|")}];r.push(d)}}return r}isIndependent(){return this.firstChild.text().startsWith(`
|
|
21
|
+
`)}getAttr(e){let t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}print(){let{childNodes:[e,t,r]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${c(this,ve)}${r.print()}</span>`}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return Object.assign(r,{subtype:this.subtype,rowspan:this.rowspan,colspan:this.colspan}),r}};ve=new WeakMap,Er=new WeakMap,Lr=new WeakSet,pi=function(){return Be(c(this,Er),()=>{var o;let e=this.firstChild.text(),t=e.slice(-1),r="td";if(t==="!"?r="th":t==="+"&&(r="caption"),this.isIndependent())return{subtype:r};let{previousSibling:i}=this;return{...v(o=i,Lr,pi).call(o)}},e=>{b(this,Er,e)})}});var Jt,mi=S(()=>{"use strict";W();ui();ci();Jt=class extends Qt{lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e),r=this.childNodes.find(({type:l})=>l==="table-inter");if(!r)return t;let i=r.childNodes.find(l=>l.text().trim()),s=/^\s*(?:!|\{\{\s*![!-]?\s*\}\})/u;if(!i||s.test(i.toString())||i.is("arg")&&s.test(i.default||""))return t;if(i.is("magic-word"))try{if(i.getPossibleValues().every(l=>s.test(l.text())))return t}catch(l){}let o=$(r,{start:n},"fostered-content","content to be moved out from the table");return o.severity=i.type==="template"?"warning":"error",o.startIndex++,o.startLine++,o.startCol=0,t.push(o),t}getRowCount(){return Number(this.childNodes.some(n=>n instanceof Kt&&n.isIndependent()&&!n.firstChild.text().endsWith("+")))}}});var Ga,Va,Xa,hi,kn,Ks=S(()=>{"use strict";W();$e();ee();j();mi();Et();Ga=/^\n[^\S\n]*(?:\|\}|\{\{\s*!\s*\}\}\}|\{\{\s*!\)\s*\}\})$/u,Va=(a,n)=>new Array(a).fill(void 0).map((e,t)=>n(t)),Xa=({type:a})=>a==="tr"||a==="table-syntax",hi=class extends Array{},kn=class extends Jt{get type(){return"table"}get closed(){return this.lastChild.type==="table-syntax"}constructor(n,e,t,r){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,n,"table",e,t,r,{})}lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e),r=new R(this,n);this.closed||t.push($(this.firstChild,r,"unclosed-table",y.msg("unclosed $1","table")));let i=this.getLayout(),{length:s}=i;if(s>1){let o=1,l=1/0,d=0;for(;d<s;d++){let g=i[d],u=g.length;if(u<o)break;u<l&&(l=u);let p=g.indexOf(g[u-1])+1;if(p>l)break;p>o&&(o=p)}if(d<s){let g=$(this.getNthRow(d),r,"table-layout","inconsistent table layout","warning");g.startIndex++,g.startLine++,g.startCol=0,t.push(g)}}return t}close(n=`
|
|
22
|
+
|}`,e){let t=this.getAttribute("config"),r=this.getAttribute("accum"),i=e?[n]:y.parse(n,this.getAttribute("include"),2,t).childNodes;ue.run(()=>{let s=new ye(void 0,Ga,"table-syntax",t,r);super.insertAt(s)}),this.lastChild.replaceChildren(...i)}getLayout(n){let e=this.getAllRows(),{length:t}=e,r=new hi(...Va(t,()=>[]));for(let[i,s]of r.entries()){let o=0,l=0,d;for(let g of e[i].childNodes.slice(2))if(g.type==="td"){if(g.isIndependent()&&(d=g.subtype!=="caption"),d){let u={row:i,column:o},{rowspan:p,colspan:h}=g;for(o++;s[l];)l++;for(let m=i;m<Math.min(i+p,t);m++)for(let f=l;f<l+h;f++)r[m][f]=u;l+=h}}else if(Xa(g))break}return r}getAllRows(){return[...super.getRowCount()?[this]:[],...this.childNodes.slice(1).filter(n=>n.type==="tr"&&n.getRowCount()>0)]}getNthRow(n,e,t){let r=super.getRowCount();if(n===0&&r)return this;r&&n--;for(let i of this.childNodes.slice(2)){let{type:s}=i;if(s==="tr"&&i.getRowCount()&&(n--,n<0))return i}}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e);return t.closed=this.closed,t}}});var vn,Js=S(()=>{"use strict";mi();vn=class extends Jt{get type(){return"tr"}constructor(n,e,t,r){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,n,"tr",e,t,r)}}});var Yt,fi=S(()=>{"use strict";Ge();Yt=class extends ge{get indent(){return this.innerText.split(":").length-1}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e),{indent:r}=this;return r&&(t.indent=r),t}}});var Zt,xi=S(()=>{"use strict";fi();Zt=class extends Yt{get type(){return"dd"}}});var Zs={};se(Zs,{parseTable:()=>Ka});var Qa,Ys,Ka,eo=S(()=>{"use strict";B();Ks();Js();ci();xi();Qa=a=>a.lastChild.constructor!==w,Ys=(a,n)=>a.type==="td"?n.pop():a,Ka=({firstChild:{data:a},type:n,name:e},t,r)=>{let i=[],s=a.split(`
|
|
23
|
+
`),o=n==="root"||n==="parameter-value"||n==="ext-inner"&&e==="poem"?"":`
|
|
24
|
+
${s.shift()}`,l,d=(g,u)=>{if(!u){o+=g;return}let{lastChild:p}=u;if(Qa(u)){let h=new w(g,t,r);h.type="table-inter",h.setAttribute("stage",3),u.insertAt(h)}else p.setText(p.toString()+g)};for(let g of s){l=i.pop();let[u]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(g),p=g.slice(u.length),h=/^(:*)((?:\s|\0\d+[cn]\x7F)*)(\{\||\{(?:\0\d+[cn]\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(p);if(h){for(;l&&l.type!=="td";)l=i.pop();let[,C,N,E,M]=h;C&&new Zt(C,t,r),d(`
|
|
25
|
+
${u}${C&&`\0${r.length-1}d\x7F`}${N}\0${r.length}b\x7F`,l),i.push(...l?[l]:[],new kn(E,M,t,r));continue}else if(!l){o+=`
|
|
26
|
+
${g}`;continue}let m=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(p);if(!m){d(`
|
|
27
|
+
${g}`,l),i.push(l);continue}let[,f,x,k,A]=m;if(f){for(;l.type!=="table";)l=i.pop();l.close(`
|
|
28
|
+
${u}${f}`,!0),d(A,i[i.length-1])}else if(x){l=Ys(l,i),l.type==="tr"&&(l=i.pop());let C=new vn(`
|
|
29
|
+
${u}${x}`,A,t,r);i.push(l,C),l.insertAt(C)}else{l=Ys(l,i);let C=k==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu,N=C.exec(A),E=0,M=`
|
|
30
|
+
${u}${k}`,te=_=>{let V=new Kt(M,A.slice(E,N==null?void 0:N.index),t,r);return _.insertAt(V),V};for(;N;)te(l),{lastIndex:E}=C,[M]=N,N=C.exec(A);i.push(l,te(l))}}return o.slice(1)}});var An,to=S(()=>{"use strict";Ge();An=class extends ge{get type(){return"hr"}}});var ro,bi,Ja,mt,no=S(()=>{"use strict";nt();j();Ge();ro=[Te()];mt=class extends(Ja=ge){get type(){return"double-underscore"}constructor(n,e,t=y.getConfig(),r){super(n,t,r)}getAttribute(n){return n==="padding"?2:super.getAttribute(n)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}};bi=oe(Ja),mt=le(bi,0,"DoubleUnderscoreToken",ro,mt),ae(bi,1,mt)});var io={};se(io,{parseHrAndDoubleUnderscore:()=>Ya});var Ya,so=S(()=>{"use strict";to();no();Jn();Ya=({firstChild:{data:a},type:n,name:e},t,r)=>{var l,d,g;let{doubleUnderscore:[i,s,o]}=t;return(l=t.insensitiveDoubleUnderscore)!=null||(t.insensitiveDoubleUnderscore=new Set(i)),(d=t.sensitiveDoubleUnderscore)!=null||(t.sensitiveDoubleUnderscore=new Set(s)),(g=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,(u,p,h)=>(new An(h,t,r),`${p}\0${r.length-1}r\x7F`)).replace(t.regexHrAndDoubleUnderscore,(u,p)=>{var x;let h=t.sensitiveDoubleUnderscore.has(p),m=p.toLowerCase(),f=t.insensitiveDoubleUnderscore.has(m);return h||f?(new mt(p,h,t,r),`\0${r.length-1}${f&&((x=o==null?void 0:o[m])!=null?x:m)==="toc"?"u":"n"}\x7F`):u}).replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(u,p,h,m,f)=>{let x=`${p}\0${r.length}h\x7F`;return new Mt(h.length,[m,f],t,r),x}),n==="root"||n==="ext-inner"&&e==="poem"?a:a.slice(1)}});var Sn,oo=S(()=>{"use strict";W();ee();j();Ge();Sn=class extends ge{get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}text(){let{parentNode:n,innerText:e}=this;return(n==null?void 0:n.type)==="image-parameter"&&n.name!=="caption"?"":e}lint(n=this.getAbsoluteIndex()){let{previousSibling:e,nextSibling:t,bold:r}=this,i=y.msg('lonely "$1"',"'"),s=[],o=new R(this,n),l=(d,g,u)=>[{desc:"escape",range:[d,g],text:"'".repeat(u)},{desc:"remove",range:[d,g],text:""}];if((e==null?void 0:e.type)==="text"&&e.data.endsWith("'")){let d=L(this,o,"lonely-apos",i),{startIndex:g,startLine:u,startCol:p}=d,[,{length:h}]=/(?:^|[^'])('+)$/u.exec(e.data),m=n-h;s.push({...d,startIndex:m,endIndex:g,endLine:u,startCol:p-h,endCol:p,suggestions:l(m,g,h)})}if((t==null?void 0:t.type)==="text"&&t.data.startsWith("'")){let d=L(this,o,"lonely-apos",i),{endIndex:g,endLine:u,endCol:p}=d,[{length:h}]=/^'+/u.exec(t.data),m=g+h;s.push({...d,startIndex:g,endIndex:m,startLine:u,startCol:p,endCol:p+h,suggestions:l(g,m,h)})}if(r&&this.closest("heading-title")){let d=L(this,o,"bold-header","bold in section header","warning");d.suggestions=[{desc:"remove",range:[n,n+3],text:""}],s.push(d)}return s}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e);return Object.assign(t,{bold:this.bold,italic:this.italic}),t}}});var ao={};se(ao,{parseQuotes:()=>Ti});var Ti,yi=S(()=>{"use strict";oo();Ti=(a,n,e,t)=>{var u;let r=a.split(/('{2,})/u),{length:i}=r;if(i===1)return a;let s=0,o=0,l,d,g;for(let p=1;p<i;p+=2){let h=r[p].length;switch(h){case 2:o++;break;case 4:r[p-1]+="'",r[p]="'''";case 3:if(s++,l!==void 0)break;r[p-1].endsWith(" ")?d===void 0&&g===void 0&&(g=p):r[p-1].slice(-2,-1)===" "?l=p:d!=null||(d=p);break;default:r[p-1]+="'".repeat(h-5),r[p]="'''''",o++,s++}}if(o%2===1&&s%2===1){let p=(u=l!=null?l:d)!=null?u:g;p!==void 0&&(r[p]="''",r[p-1]+="'")}for(let p=1;p<i;p+=2)new Sn(r[p],n,e),r[p]=`\0${e.length-1}q\x7F`;return r.join("")}});var lo={};se(lo,{parseExternalLinks:()=>ki});var ki,vi=S(()=>{"use strict";Q();ii();fn();ki=(a,n,e,t)=>{var r;return(r=n.regexExternalLinks)!=null||(n.regexExternalLinks=new RegExp(String.raw`\[(\0\d+f\x7F|(?:(?:${n.protocol}|//)${Pe}|\0\d+m\x7F)${Re}(?=[[\]<>"\t${Ce}]|\0\d))([${Ce}]*(?![${Ce}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),a.replace(n.regexExternalLinks,(i,s,o,l)=>{let{length:d}=e,g=/&[lg]t;/u.exec(s);return g&&(o="",l=s.slice(g.index)+o+l,s=s.slice(0,g.index)),t?(new _e(s,"ext-link-url",n,e),`[\0${d}f\x7F${o}${l}]`):(new Gt(s,o,l,n,e),`\0${d}w\x7F`)})}});var wn,go=S(()=>{"use strict";Q();Tr();wn=class extends Le{get type(){return"category"}get sortkey(){let{childNodes:[,n]}=this;return n&&rt(n.text())}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e),{sortkey:r}=this;return r&&(t.sortkey=r),t}}});var po={};se(po,{parseLinks:()=>uo});var Za,uo,co=S(()=>{"use strict";j();yi();vi();ni();ei();go();Za=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,uo=(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 d=!1,g,u,p,h,m=i[l],f=r.exec(m);if(f)[,g,u,p,h]=f,h.startsWith("]")&&(p!=null&&p.includes("["))&&(p+="]",h=h.slice(1));else{let N=Za.exec(m);N&&(d=!0,[,g,u,p]=N)}if(g===void 0||n.regexLinks.test(g)||/\0\d+[exhbru]\x7F/u.test(g)){s+=`[[${m}`;continue}let x=g.trim().startsWith(":");if(x&&d){s+=`[[${m}`;continue}let{ns:k,valid:A}=y.normalizeTitle(g,0,!1,n,!0,!0,!0,!0);if(A){if(d){if(k!==6){s+=`[[${m}`;continue}let N=!1;for(l++;l<i.length;l++){let E=i[l],M=E.split("]]");if(M.length>2){N=!0,p+=`[[${M[0]}]]${M[1]}`,h=M.slice(2).join("]]");break}else if(M.length===2)p+=`[[${M[0]}]]${M[1]}`;else{p+=`[[${E}`;break}}if(p=uo(p,n,e,t),!N){s+=`[[${g}${u}${p}`;continue}}}else{s+=`[[${m}`;continue}p&&(p=Ti(p,n,e,t));let C=zt;x||(k===6?(p&&(p=ki(p,n,e,!0)),C=Ut):k===14&&(C=wn)),p===void 0&&u&&(p=""),s+=`\0${e.length}l\x7F${h}`,new C(g,p,n,e,u)}return s}});var bo={};se(bo,{parseMagicLinks:()=>el});var xo,mo,ho,fo,el,To=S(()=>{"use strict";Q();fn();xo=String.raw`[${Ce}\t]| |�*160;|�*a0;`,mo=`(?:${xo})+`,ho=`(?:${xo}|-)`,fo=String.raw`(?:RFC|PMID)${mo}\d+\b|ISBN${mo}(?:97[89]${ho}?)?(?:\d${ho}?){9}[\dx]\b`,el=(a,n,e)=>{if(!n.regexMagicLinks)try{n.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\d_])(?:(?:${n.protocol})(${Pe}${Re})|${fo})`,"giu")}catch(t){n.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${n.protocol})(${Pe}${Re})|${fo})`,"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 d=s.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,g=d.exec(s);if(g){let u=1;g[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(s.slice(0,g.index))&&(u=2),o=s.slice(g.index+u)+o,s=s.slice(0,g.index+u)}return o.length>=i.length?t:(new _e(s,void 0,n,e),`${r}\0${e.length-1}w\x7F${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(s))return t;return new _e(s,"magic-link",n,e),`${r}\0${e.length-1}i\x7F`})}});var yo,ko=S(()=>{"use strict";yo=(a,n)=>a.startsWith(n)?n.length:[...n].findIndex((e,t)=>e!==a[t])});var Cn,vo=S(()=>{"use strict";fi();Cn=class extends Yt{get type(){return"list"}}});var Ao={};se(Ao,{parseList:()=>tl});var tl,So=S(()=>{"use strict";ko();vo();xi();tl=(a,n,e,t)=>{let r=/^((?:\0\d+[cno]\x7F)*)([;:*#]+\s*)/u.exec(a);if(!r)return n.lastPrefix="",a;let[i,s,o]=r,l=o.replace(/;/gu,":"),d=yo(l,n.lastPrefix),g=(d>1?o.slice(d-1):o).split(/(?=;)/u),u=g[0].startsWith(";"),p=g.length-(u?0:1);if(d>1){let _=o.slice(0,d-1);u?g.unshift(_):g[0]=_+g[0]}n.lastPrefix=l;let h=s+g.map((_,V)=>`\0${t.length+V}d\x7F`).join("")+a.slice(i.length);for(let _ of g)new Cn(_,e,t);if(!p)return h;let{html:[m]}=e,f=/:+|-\{|\0\d+[xq]\x7F/gu,x=f,k=x.exec(h),A=0,C=!1,N=!1,E=0,M=(_,V)=>(new Zt(_,e,t),`${h.slice(0,V)}\0${t.length-1}d\x7F${h.slice(V+_.length)}`),te=_=>{_?A&&A--:A++};for(;k&&p;){let{0:_,index:V}=k;if(_==="-{"){if(!E){let{lastIndex:F}=x;x=/-\{|\}-/gu,x.lastIndex=F}E++}else if(_==="}-"){if(E--,!E){let{lastIndex:F}=x;x=f,x.lastIndex=F}}else if(_.endsWith("x\x7F")){let{name:F,closing:O,selfClosing:D}=t[Number(_.slice(1,-2))];(!D||m.includes(F))&&te(O)}else if(_.endsWith("q\x7F")){let{bold:F,italic:O}=t[Number(_.slice(1,-2))];F&&(te(C),C=!C),O&&(te(N),N=!N)}else if(A===0){if(_.length>=p)return M(_.slice(0,p),V);p-=_.length,x.lastIndex=V+4+String(t.length).length,h=M(_,V)}k=x.exec(h)}return h}});var wo,De,$n,Co=S(()=>{"use strict";W();ee();j();B();qe();wo=new Set(["A","T","R","D","-","H","N"]),$n=class extends w{constructor(e,t=y.getConfig(),r=[]){super(void 0,t,r,{});T(this,De);this.append(...e.map(i=>new G(i,"converter-flag",t,r)))}get type(){return"converter-flags"}afterBuild(){b(this,De,this.childNodes.map(e=>e.text().trim())),super.afterBuild()}toString(e){return super.toString(e,";")}text(){return super.text(";")}getGaps(){return 1}getUnknownFlags(){return new Set(c(this,De).filter(e=>/\{{3}[^{}]+\}{3}/u.test(e)))}getVariantFlags(){let e=new Set(this.getAttribute("config").variants);return new Set(c(this,De).filter(t=>e.has(t)))}lint(e=this.getAbsoluteIndex(),t){let r=this.getVariantFlags(),i=this.getUnknownFlags(),s=new Set(c(this,De).filter(u=>wo.has(u))),o=c(this,De).filter(u=>!u).length,l=c(this,De).length-i.size-o,d=super.lint(e,t);if(r.size===l||s.size===l)return d;let g=new R(this,e);for(let[u,p]of this.childNodes.entries()){let h=p.text().trim();if(h&&!r.has(h)&&!i.has(h)&&(r.size>0||!s.has(h))){let m=$(p,g,"no-ignored","invalid conversion flag");r.size===0&&wo.has(h.toUpperCase())?m.fix={range:[m.startIndex,m.endIndex],text:h.toUpperCase(),desc:"uppercase"}:m.suggestions=[{desc:"remove",range:[m.startIndex-(u&&1),m.endIndex],text:""}],d.push(m)}}return d}print(){return super.print({sep:";"})}};De=new WeakMap});var er,$o=S(()=>{"use strict";j();B();qe();er=class extends w{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=y.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 G(o,"converter-rule-variant",t,r)),super.insertAt(new G(n.slice(i+1),"converter-rule-to",t,r)),s!==-1&&super.insertAt(new G(n.slice(0,s),"converter-rule-from",t,r),0)):super.insertAt(new G(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 Nn,No=S(()=>{"use strict";Q();j();B();Co();$o();Nn=class extends w{get type(){return"converter"}constructor(n,e,t=y.getConfig(),r=[]){super(void 0,t,r),this.append(new $n(n,t,r));let[i]=e,s=i.includes(":"),o=new er(i,s,t,r);s&&o.length===1||!s&&e.length===2&&!de(e[1]).trim()?this.insertAt(new er(e.join(";"),!1,t,r)):this.append(o,...e.slice(1).map(l=>new er(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()}|${be(e,";")}}-`}getAttribute(n){return n==="padding"?2:super.getAttribute(n)}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?"|":""}${je(e,{sep:";"})}}-</span>`}}});var Io={};se(Io,{parseConverter:()=>rl});var rl,Eo=S(()=>{"use strict";No();rl=(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:d,index:g}=o;if(d==="}-"){let u=i.pop(),{length:p}=e,h=a.slice(u.index+2,g),m=h.indexOf("|"),[f,x]=m===-1?[[],h]:[h.slice(0,m).split(";"),h.slice(m+1)],k=x.replace(/(&[#a-z\d]+);/giu,"$1"),A=k.split(n.regexConverter).map(C=>C.replace(/\x01/gu,";"));new Nn(f,A,n,e),a=`${a.slice(0,u.index)}\0${p}v\x7F${a.slice(g+2)}`,i.length===0&&(s=t),s.lastIndex=u.index+3+String(p).length}else i.push(o),s=r,s.lastIndex=g+2;o=s.exec(a)}return a}});var Rr={};se(Rr,{Token:()=>w});var Fr,Ae,H,X,ht,tr,Pr,z,Lo,Fo,Po,Ro,jo,Bo,qo,_o,Oo,Mo,Do,Wo,Ai,w,B=S(()=>{"use strict";Q();W();j();Xi();Ji();Ai=class Ai extends Gr{constructor(e,t=y.getConfig(),r=[],i){super();T(this,z);T(this,Fr,"plain");T(this,Ae,0);T(this,H);T(this,X);T(this,ht);T(this,tr,!1);T(this,Pr);typeof e=="string"&&this.insertAt(e),b(this,H,t),b(this,X,r),r.push(this)}get type(){return c(this,Fr)}set type(e){b(this,Fr,e)}parseOnce(e=c(this,Ae),t=!1,r){if(e<c(this,Ae)||this.length===0||!this.getAttribute("plain"))return this;if(c(this,Ae)>=11)return this;switch(e){case 0:if(this.type==="root"){c(this,X).pop();let i=v(this,z,Lo).call(this);t&&(t=!i)}b(this,ht,t),v(this,z,Fo).call(this,t);break;case 1:v(this,z,Po).call(this);break;case 2:v(this,z,Ro).call(this);break;case 3:v(this,z,jo).call(this);break;case 4:v(this,z,Bo).call(this);break;case 5:v(this,z,qo).call(this,r);break;case 6:v(this,z,_o).call(this,r);break;case 7:v(this,z,Oo).call(this);break;case 8:v(this,z,Mo).call(this);break;case 9:v(this,z,Do).call(this);break;case 10:v(this,z,Wo).call(this)}if(this.type==="root")for(let i of c(this,X))i==null||i.parseOnce(e,t,r);return Ur(this,Ae)._++,this}buildFromStr(e,t){let r=e.split(/[\0\x7F]/u).map((i,s)=>{if(s%2===0)return new xr(i);if(isNaN(i.slice(-1)))return c(this,X)[Number(i.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${i}`)});return t===0?r.map(String).join(""):t===1?be(r):r}build(){b(this,Ae,11);let{length:e,firstChild:t}=this,r=t==null?void 0:t.toString();if(e===1&&t.type==="text"&&r.includes("\0")&&(this.replaceChildren(...this.buildFromStr(r)),this.normalize(),this.type==="root"))for(let i of c(this,X))i==null||i.build()}afterBuild(){if(this.type==="root")for(let e of c(this,X))e==null||e.afterBuild();b(this,tr,!0)}parse(e=11,t,r){for(e=Math.min(e,11);c(this,Ae)<e;)this.parseOnce(c(this,Ae),t,r);return e&&(this.build(),this.afterBuild()),this}getAttribute(e){var t;switch(e){case"plain":return this.constructor===Ai;case"config":return c(this,H);case"include":return(t=c(this,ht))!=null?t:!!c(this.getRootNode(),ht);case"accum":return c(this,X);case"built":return c(this,tr);default:return super.getAttribute(e)}}setAttribute(e,t){switch(e){case"stage":c(this,Ae)===0&&this.type==="root"&&c(this,X).shift(),b(this,Ae,t);break;default:super.setAttribute(e,t)}}insertAt(e,t=this.length){let r=typeof e=="string"?new xr(e):e;super.insertAt(r,t);let{type:i}=r;return i==="root"&&(r.type="plain"),r}normalizeTitle(e,t=0,r,i,s,o){return y.normalizeTitle(e,t,c(this,ht),c(this,H),r,i,s,o)}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 p of this.querySelectorAll(o)){let h;if(p.type==="category")h=p.name;else{let m=p.getValue();m&&m!==!0&&(h=`#${m}`)}if(h){let m=s.get(h);m?m.add(p):s.set(h,new Set([p]))}}for(let[p,h]of s)if(h.size>1&&!p.startsWith("#mw-customcollapsible-")){let m=!p.startsWith("#"),f=`duplicated ${m?"category":"id"}`,x=m?"error":"warning";r.push(...[...h].map(k=>{let A=L(k,{start:k.getAbsoluteIndex()},"no-duplicate",f,x);return m&&(A.suggestions=[{desc:"remove",range:[A.startIndex,A.endIndex],text:""}]),A}))}let l=/<!--\s*lint-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->/gu,d=this.toString(),g=[],u=l.exec(d);for(;u;){let{1:p,index:h}=u,m=(i=u[2])==null?void 0:i.trim();g.push({line:this.posFromIndex(h).top+(p==="disable-line"?0:1),from:p==="disable"?l.lastIndex:void 0,to:p==="enable"?l.lastIndex:void 0,rules:m?new Set(m.split(",").map(f=>f.trim())):void 0}),u=l.exec(d)}r=r.filter(({rule:p,startLine:h,startIndex:m})=>{let f={pos:0};for(let{line:x,from:k,to:A,rules:C}of g){if(x>h+1)break;if(C&&!C.has(p))continue;if(x===h&&k===void 0&&A===void 0)return!1;k<=m&&k>f.pos?(f.pos=k,f.type="from"):A<=m&&A>f.pos&&(f.pos=A,f.type="to")}return f.type!=="from"})}return r}toString(e,t){return e?super.toString(!0,t):Be(c(this,Pr),()=>super.toString(!1,t),r=>{let i=this.getRootNode();i.type==="root"&&c(i,tr)&&b(this,Pr,r)})}};Fr=new WeakMap,Ae=new WeakMap,H=new WeakMap,X=new WeakMap,ht=new WeakMap,tr=new WeakMap,Pr=new WeakMap,z=new WeakSet,Lo=function(){let{parseRedirect:e}=(ns(),J(rs)),t=this.firstChild.toString(),r=e(t,c(this,H),c(this,X));return r&&this.setText(r),!!r},Fo=function(e){let{parseCommentAndExt:t}=(vr(),J(zs));this.setText(t(this.firstChild.toString(),c(this,H),c(this,X),e))},Po=function(){let{parseBraces:e}=(un(),J(Cs)),t=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,r=e(t,c(this,H),c(this,X));this.setText(this.type==="root"?r:r.slice(1))},Ro=function(){var t;if((t=c(this,H).excludes)!=null&&t.includes("html"))return;let{parseHtml:e}=(Qs(),J(Xs));this.setText(e(this.firstChild.toString(),c(this,H),c(this,X)))},jo=function(){var t;if((t=c(this,H).excludes)!=null&&t.includes("table"))return;let{parseTable:e}=(eo(),J(Zs));this.setText(e(this,c(this,H),c(this,X)))},Bo=function(){var t;if((t=c(this,H).excludes)!=null&&t.includes("hr"))return;let{parseHrAndDoubleUnderscore:e}=(so(),J(io));this.setText(e(this,c(this,H),c(this,X)))},qo=function(e){let{parseLinks:t}=(co(),J(po));this.setText(t(this.firstChild.toString(),c(this,H),c(this,X),e))},_o=function(e){var i;if((i=c(this,H).excludes)!=null&&i.includes("quote"))return;let{parseQuotes:t}=(yi(),J(ao)),r=this.firstChild.toString().split(`
|
|
31
|
+
`);for(let s=0;s<r.length;s++)r[s]=t(r[s],c(this,H),c(this,X),e);this.setText(r.join(`
|
|
32
|
+
`))},Oo=function(){var t;if((t=c(this,H).excludes)!=null&&t.includes("extLink"))return;let{parseExternalLinks:e}=(vi(),J(lo));this.setText(e(this.firstChild.toString(),c(this,H),c(this,X)))},Mo=function(){var t;if((t=c(this,H).excludes)!=null&&t.includes("magicLink"))return;let{parseMagicLinks:e}=(To(),J(bo));this.setText(e(this.firstChild.toString(),c(this,H),c(this,X)))},Do=function(){var d;if((d=c(this,H).excludes)!=null&&d.includes("list"))return;let{parseList:e}=(So(),J(Ao)),{firstChild:t,type:r,name:i}=this,s=t.toString().split(`
|
|
33
|
+
`),o={lastPrefix:""},l=r==="root"||r==="ext-inner"&&i==="poem"?0:1;for(;l<s.length;l++)s[l]=e(s[l],o,c(this,H),c(this,X));this.setText(s.join(`
|
|
34
|
+
`))},Wo=function(){if(c(this,H).variants.length>0){let{parseConverter:e}=(Eo(),J(Io));this.setText(e(this.firstChild.toString(),c(this,H),c(this,X)))}};w=Ai});var ue,Dt,Mn,Xr,$e=S(()=>{"use strict";ue={running:!1,run(a){let{running:n}=this;this.running=!0;try{let{Token:e}=(B(),J(Rr)),t=a();return t instanceof e&&!t.getAttribute("built")&&t.afterBuild(),this.running=n,t}catch(e){throw this.running=n,e}},rev:0},Dt=a=>n=>n.type===a,Mn=(a,n,e,t=[])=>{var s,o;let r=a.getChildNodes(),i=r.splice(n,e,...t);for(let l=0;l<t.length;l++){let d=t[l];d.setAttribute("parentNode",a),d.setAttribute("nextSibling",r[n+l+1]),d.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]),i},Xr=(a,n)=>{Object.defineProperty(a,"name",{value:n.name})}});var Uo={};se(Uo,{Title:()=>Si});var jr,Br,Se,rr,ft,Si,Ho=S(()=>{"use strict";Q();Si=class{constructor(n,e,t,r,i,s){T(this,jr);T(this,Br);T(this,Se);T(this,rr);T(this,ft);ne(this,"valid");ne(this,"encoded",!1);let o=n.trim().startsWith("../");if(i&&n.includes("%"))try{let d=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(n);n=He(n),this.encoded=d}catch(d){}if(n=rt(n).replace(/[_ ]+/gu," ").trim(),o)b(this,rr,0);else{let d=e;n.startsWith(":")&&(d=0,n=n.slice(1).trim());let g=n.split(":");if(g.length>1){let u=g[0].trim().toLowerCase(),p=Object.prototype.hasOwnProperty.call(t.nsid,u)&&t.nsid[u];p&&(d=p,n=g.slice(1).join(":").trim())}b(this,rr,d)}let l=n.indexOf("#");if(l!==-1){let d=n.slice(l).trim().slice(1);if(d.includes("%"))try{d=He(d)}catch(g){}b(this,ft,d.replace(/ /gu,"_")),n=n.slice(0,l).trim()}this.valid=!!(n||s&&this.ns===0&&c(this,ft)!==void 0)&&rt(n)===n&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(o?/^(?:\.\.\/)+(.*)/u.exec(n)[1]:n),this.main=n,b(this,Br,t.namespaces),b(this,Se,t.articlePath||"/wiki/$1"),c(this,Se).includes("$1")||b(this,Se,c(this,Se)+`${c(this,Se).endsWith("/")?"":"/"}$1`),r||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return c(this,rr)}get fragment(){return c(this,ft)}get main(){return c(this,jr)}set main(n){n=n.replace(/_/gu," ").trim(),b(this,jr,n&&n[0].toUpperCase()+n.slice(1))}get prefix(){let n=c(this,Br)[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){b(this,ft,n)}getUrl(n){{typeof n=="string"&&(b(this,Se,n||"/wiki/$1"),c(this,Se).includes("$1")||b(this,Se,c(this,Se)+`${c(this,Se).endsWith("/")?"":"/"}$1`));let{title:e,fragment:t}=this;return e?c(this,Se).replace("$1",encodeURIComponent(e)+(t===void 0?"":`#${encodeURIComponent(t)}`)):t===void 0?"":`#${encodeURIComponent(t)}`}}};jr=new WeakMap,Br=new WeakMap,Se=new WeakMap,rr=new WeakMap,ft=new WeakMap});var Jo={};se(Jo,{LanguageService:()=>wi,tasks:()=>Vo});var Vo,nl,il,sl,ol,Xo,al,ll,zo,Mr,dl,nr,pe,Go,Qo,qr,_r,ir,In,Ie,We,Dr,sr,or,ar,q,xe,Ci,we,Ko,Or,wi,Yo=S(()=>{"use strict";Rn();Xn();W();Q();j();Vo=new WeakMap,nl=new Set(["ref"]),il=new Set(["ref","references"]),sl=new Set(["name","extends","follow"]),ol=new Set(["group"]),Xo=new Set(["arg-name","template-name","magic-word-name","link-target","parameter-key"]),al=new Set(["ext","html","attr-key","image-parameter","heading-title","heading",...Xo]),ll=new Set(["text","comment","noinclude","include"]),zo=a=>a.every(({type:n})=>ll.has(n)),Mr=(a,n)=>{let{top:e,left:t}=a.posFromIndex(n);return{line:e,character:t}},dl=(a,n,e)=>({start:Mr(a,n),end:Mr(a,e)}),nr=a=>{let{top:n,left:e,height:t,width:r}=a.getBoundingClientRect();return{start:{line:n,character:e},end:At(n,e,t,r)}},pe=(a,n,e,{line:t,character:r},i)=>[...new Set(a)].map(s=>({label:s,kind:n,textEdit:{range:{start:{line:t,character:r-e.length},end:{line:t,character:r}},newText:s+(i!=null?i:"")}})),Go=(a,{line:n,character:e})=>{let t=a.indexFromPos(n,e);return a.caretPositionFromIndex(t+Number(/\w/u.test(a.toString().charAt(t))))},Qo=(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},qr=a=>Qo(a,nl,sl),_r=a=>Qo(a,il,ol),ir=(a,n)=>{let e=a==null?void 0:a.getAttr(n);return e!==!0&&e||!1},In=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}},wi=class{constructor(n){T(this,q);T(this,Ie);T(this,We);T(this,Dr);T(this,sr);T(this,or);T(this,ar);ne(this,"data");Vo.set(n,this)}destroy(){Object.setPrototypeOf(this,null)}async provideDocumentColors(n,e,t=!0){v(this,q,we).call(this);let r=await v(this,q,xe).call(this,e);return r.querySelectorAll("attr-value,parameter-value,arg-default").flatMap(({type:i,childNodes:s})=>i!=="attr-value"&&!zo(s)?[]:s.filter(o=>o.type==="text").reverse().flatMap(o=>{let l=Oi(o.data,t).filter(([,,,g])=>g);if(l.length===0)return[];let d=o.getAbsoluteIndex();return l.map(([g,u,p])=>{let h=n(g);return h.length===4&&{color:{red:h[0]/255,green:h[1]/255,blue:h[2]/255,alpha:h[3]},range:dl(r,d+u,d+p)}}).filter(Boolean)}))}provideColorPresentations(n){let{color:{red:e,green:t,blue:r,alpha:i},range:s}=n,o=`#${dr(e)}${dr(t)}${dr(r)}${i<1?dr(i):""}`;return[{label:o,textEdit:{range:s,newText:o}}]}async provideCompletionItems(n,e){var C,N,E,M,te,_,V;v(this,q,we).call(this);let{re:t,allTags:r,functions:i,switches:s,protocols:o,params:l,tags:d,ext:g}=v(this,q,Ko).call(this),{line:u,character:p}=e,h=n.split(/\r?\n/u,u+1)[u],m=t.exec((C=h==null?void 0:h.slice(0,p))!=null?C:"");if((m==null?void 0:m[1])!==void 0){let F=m[1].startsWith("/");return pe(r,"Class",m[1].slice(F?1:0),e,F&&!(h!=null&&h.slice(p).trim().startsWith(">"))?">":"")}else{if(m!=null&&m[4])return pe(s,"Constant",m[4],e);if((m==null?void 0:m[5])!==void 0)return pe(o,"Reference",m[5],e)}let f=await v(this,q,xe).call(this,n),x;if(m!=null&&m[2]){x=f.elementFromPoint(m.index+m[2].length-1,u);let F=(N=m[3])!=null?N:"";if(m[2]==="{{{")return pe(f.querySelectorAll("arg").filter(I=>I.name&&I!==x).map(({name:I})=>I),"Variable",F,e);let O=F.startsWith(":"),D=O?F.slice(1).trimStart():F;return m[2]==="[["?pe(f.querySelectorAll("link,file,category,redirect-target").filter(I=>I!==x).map(({name:I})=>I),"Folder",D,e):[...pe(i,"Function",F,e),...F.startsWith("#")?[]:pe(f.querySelectorAll("template").filter(I=>I!==x).map(I=>{let{name:U}=I;if(O)return U;let{ns:P}=I.getAttribute("title");return P===0?`:${U}`:P===10?U.slice(9):U}),"Folder",D,e)]}let k,A;if((m==null?void 0:m[7])===void 0&&(x=f.elementFromPoint(p,u),{type:k,parentNode:A}=x),(m==null?void 0:m[6])!==void 0||k==="image-parameter"){let F=f.indexFromPos(u,p),O=(M=(E=m==null?void 0:m[6])==null?void 0:E.trimStart())!=null?M:c(this,Ie).slice(x.getAbsoluteIndex(),F).trimStart(),D=c(this,Ie).charAt(F)==="=";return[...pe(l,"Property",O,e).filter(({label:I})=>!D||!/[= ]$/u.test(I)),...pe(f.querySelectorAll("image-parameter#width").filter(I=>I!==x).map(I=>I.text()),"Unit",O,e)]}else if((m==null?void 0:m[7])!==void 0||k==="attr-key"){let F=(_=(te=m==null?void 0:m[7])==null?void 0:te.toLowerCase())!=null?_:A.tag,O=(V=m==null?void 0:m[9])!=null?V:x.toString();if(!d.has(F))return;let D=tn[F],I=rn[F],U=I&&pe(I,"Field",O,e);return g.includes(F)&&!D?U:[...U!=null?U:[],...F==="meta"||F==="link"?[]:pe(en,"Property",O,e),...D?pe(D,"Property",O,e):[],...pe(["data-"],"Variable",O,e),...pe(["xmlns:"],"Interface",O,e)]}else if(k==="parameter-key"||k==="parameter-value"&&A.anon){let F=A.parentNode,{type:O,name:D}=F;if(O==="magic-word"&&D!=="invoke")return;let I=x.toString().trimStart(),[U,P]=O==="magic-word"?F.getModule():[];return I?pe(f.querySelectorAll("parameter").filter(re=>{if(re===A||re.anon||re.parentNode.type!==O||re.parentNode.name!==D)return!1;if(O==="template")return!0;let[Z,ce]=re.parentNode.getModule();return Z===U&&ce===P}).map(({name:re})=>re),"Variable",I,e,k==="parameter-value"?"=":""):void 0}}async provideDiagnostics(n,e=!0){v(this,q,we).call(this);let t=await v(this,q,xe).call(this,n),r=t.lint();return(e?r:r.filter(({severity:i})=>i==="error")).map(({startLine:i,startCol:s,endLine:o,endCol:l,severity:d,rule:g,message:u,fix:p,suggestions:h})=>({range:{start:{line:i,character:s},end:{line:o,character:l}},severity:d==="error"?1:2,source:"WikiLint",code:g,message:u}))}async provideFoldingRanges(n){v(this,q,we).call(this);let e=await v(this,q,xe).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{top:l,height:d}=o.getBoundingClientRect();if(o.type==="heading-title"){let{level:g}=o.parentNode;for(let u=g-1;u<6;u++){let p=i[u];p!==void 0&&p<l-1&&r.push({startLine:p,endLine:l-1,kind:"region"}),i[u]=void 0}i[g-1]=l+d-1}else d>2&&r.push({startLine:l,endLine:l+d-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){v(this,q,we).call(this);let{articlePath:e,protocol:t}=y.getConfig(),r=e==null?void 0:e.includes("//"),i=new RegExp(`^(?:${t}|//)`,"iu");return(await v(this,q,xe).call(this,n)).querySelectorAll(`magic-link,ext-link-url,free-ext-link,attr-value,image-parameter#link${r?",link-target,template-name,invoke-module":""}`).reverse().map(s=>{let{type:o,parentNode:l,firstChild:d,lastChild:g,childNodes:u}=s,{name:p,tag:h}=l;if(!(o!=="attr-value"||p==="src"&&["templatestyles","img"].includes(h)||p==="cite"&&["blockquote","del","ins","q"].includes(h))||!zo(u))return!1;let m=u.filter(f=>f.type==="text").map(({data:f})=>f).join("").trim();if(!m)return!1;try{if(s.is("magic-link")||s.is("ext-link-url")||s.is("free-ext-link"))m=s.getUrl(e);else if(o==="link-target"&&(l.is("link")||l.is("redirect-target")||l.is("category"))){if(m.startsWith("/"))return!1;m=l.link.getUrl(e)}else if(o==="template-name")m=l.getAttribute("title").getUrl(e);else if(["link-target","invoke-module"].includes(o)||o==="attr-value"&&p==="src"&&h==="templatestyles"||o==="image-parameter"&&!i.test(m)){if(!r||m.startsWith("/"))return!1;let f=0;o==="attr-value"?f=10:o==="invoke-module"&&(f=828);let x=y.normalizeTitle(m,f,!1,void 0,!0);if(!x.valid)return!1;m=x.getUrl()}if(typeof m=="string"&&m.startsWith("//")&&(m=`https:${m}`),m=new URL(m).href,o==="image-parameter"){let{top:f,left:x,height:k,width:A}=g.getBoundingClientRect(),C=d.getBoundingClientRect();return{range:{start:{line:C.top,character:C.left},end:At(f,x,k,A)},target:m}}return{range:nr(s),target:m}}catch(f){return!1}}).filter(Boolean)}async provideReferences(n,e){v(this,q,we).call(this);let t=await v(this,q,xe).call(this,n),{offsetNode:r,offset:i}=Go(t,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,d=qr(o),g=_r(o);if(!d&&!g&&!al.has(l))return;let u=In(o),p=t.querySelectorAll(l==="heading-title"?"heading":l).filter(h=>l==="attr-value"?qr(h)===d||_r(h)===g:In(h)===u).map(h=>({range:nr(h.type==="parameter-key"?h.parentNode:h)}));return p.length===0?void 0:p}async provideDefinition(n,e){v(this,q,we).call(this);let t=await v(this,q,xe).call(this,n),r=t.elementFromPoint(e.character,e.line),i=r.is("ext")&&r.name==="ref"?r:r.closest("ext#ref"),s=ir(i,"name");if(!s)return;let o=ir(i,"group"),l=t.querySelectorAll("ext#ref").filter(d=>d.innerText&&ir(d,"name")===s&&ir(d,"group")===o).map(({lastChild:d})=>({range:nr(d)}));return l.length===0?void 0:l}async resolveRenameLocation(n,e){v(this,q,we).call(this);let t=await v(this,q,xe).call(this,n),r=t.elementFromPoint(e.character,e.line),{type:i}=r,s=qr(r),o=_r(r);return!s&&!o&&(!Xo.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:nr(r)}async provideRenameEdits(n,e,t){v(this,q,we).call(this);let r=await v(this,q,xe).call(this,n),i=r.elementFromPoint(e.character,e.line),{type:s}=i,o=qr(i),l=o&&ir(i.parentNode.parentNode,"group"),d=_r(i),g=In(i),u=r.querySelectorAll(s).filter(p=>{let{type:h}=p.parentNode;return s==="link-target"&&h!=="link"&&h!=="redirect-target"?!1:s==="attr-value"?_r(p)===d||qr(p)===o&&ir(p.parentNode.parentNode,"group")===l:In(p)===g});return u.length===0?void 0:{changes:{"":u.map(p=>({range:nr(p),newText:t}))}}}async provideHover(n,e){if(!this.data)return;v(this,q,we).call(this);let t=await v(this,q,xe).call(this,n),{offsetNode:r,offset:i}=Go(t,e),s=r.type==="text"?r.parentNode:r,{type:o,parentNode:l,length:d,name:g}=s,u,p,h;if(s.is("double-underscore")&&i>0)u=this.data.behaviorSwitches.find(({aliases:m})=>m.includes(s.innerText.toLowerCase()));else if(o==="magic-word-name")u=v(this,q,Or).call(this,l.name),p=s.toString(!0).trim();else if(s.is("magic-word")&&!s.modifier&&d===1&&(i>0||s.getBoundingClientRect().left===e.character))u=v(this,q,Or).call(this,g),p=s.firstChild.toString(!0).trim();else if((s.is("magic-word")||s.is("template"))&&s.modifier&&i>=2&&s.getRelativeIndex(0)>i&&(p=s.modifier.trim().slice(0,-1),u=v(this,q,Or).call(this,p.toLowerCase()),u)){let m=s.getAbsoluteIndex();h={start:Mr(t,m+2),end:Mr(t,m+s.modifier.trimEnd().length+1)}}return u&&{contents:{kind:"markdown",value:(u.signatures?`${u.signatures.map(m=>`- **{{ ${p}${m.length===0?"**":":** "}${m.map(({label:f,const:x})=>x?f:`*${f}*`).join(" **|** ")} **}}**`).join(`
|
|
35
35
|
`)}
|
|
36
36
|
|
|
37
|
-
`:"")+
|
|
37
|
+
`:"")+u.description},range:h!=null?h:nr(s)}}async provideSignatureHelp(n,e){if(this.data){if(c(this,Ie)!==void 0&&!c(this,ar))throw new Error("This is a regular language server!")}else return;b(this,ar,!0);let{line:t,character:r}=e,i=n.split(/\r?\n/u,t+1)[t],{lastChild:s}=await v(this,q,xe).call(this,`${i.slice(0,r+/^[^{}<]*/u.exec(i.slice(r))[0].length)}}}`);if(!s.is("magic-word")||s.length===1)return;let{name:o,childNodes:l,firstChild:d}=s,g=v(this,q,Or).call(this,o);if(!(g!=null&&g.signatures))return;let u=l.length-1,p=g.signatures.filter(f=>{var x;return(f.length>=u||((x=f[f.length-1])==null?void 0:x.rest))&&f.every(({label:k,const:A},C)=>{var E;let N=A&&C<u&&((E=l[C+1])==null?void 0:E.toString(!0).trim());return!N||k.toLowerCase().includes(N.toLowerCase())})});if(p.length===0)return;let h=-1;for(let f=s.getAbsoluteIndex()+s.getAttribute("padding");h<u&&(f+=l[h+1].toString().length+1,!(f>r));h++);let m=d.toString(!0).trim();return{signatures:p.map(f=>({label:`{{${m}${f.length===0?"":":"}${f.map(({label:x})=>x).join("|")}}}`,parameters:f.map(({label:x,const:k})=>({label:x,...k?{documentation:"Predefined parameter"}:void 0})),...f.length<u?{activeParameter:Math.min(h,f.length-1)}:void 0})),activeParameter:h}}async provideInlayHints(n){v(this,q,we).call(this);let e=[],t=await v(this,q,xe).call(this,n);for(let r of t.querySelectorAll("template,magic-word#invoke")){let{type:i,childNodes:s}=r;e.push(...s.slice(i==="template"?1:3).filter(({anon:o})=>o).reverse().map(o=>({position:Mr(t,o.getAbsoluteIndex()),label:`${o.name}=`,kind:2})))}return e}};Ie=new WeakMap,We=new WeakMap,Dr=new WeakMap,sr=new WeakMap,or=new WeakMap,ar=new WeakMap,q=new WeakSet,xe=async function(n){var e;return n=gr(n),c(this,Ie)===n&&c(this,sr)===y.config&&!c(this,We)?c(this,Dr):(b(this,Ie,n),(e=c(this,We))!=null||b(this,We,v(this,q,Ci).call(this)),c(this,We))},Ci=async function(){let n=y.getConfig();b(this,sr,y.config);let e=c(this,Ie),t=await y.partialParse(e,()=>c(this,Ie),!0,n);return c(this,Ie)===e&&c(this,sr)===y.config?(b(this,Dr,t),b(this,We,void 0),t):(b(this,We,v(this,q,Ci).call(this)),c(this,We))},we=function(){if(c(this,ar))throw new Error("This is a signature language server!")},Ko=function(){if(!c(this,or)){let{nsid:n,ext:e,html:t,parserFunction:[r,i,...s],doubleUnderscore:o,protocol:l,img:d}=y.getConfig(),g=new Set([e,t].flat(2)),u=new RegExp("(?:"+String.raw`<(\/?\w*)`+"|"+String.raw`(\{{2,4}|\[\[)\s*([^|{}<>[\]\s][^|{}<>[\]#]*)?`+"|"+String.raw`(__(?:(?!__)[\p{L}\d_])*)`+"|"+String.raw`(?<!\[)\[([a-z:/]*)`+"|"+String.raw`\[\[\s*(?:${Object.entries(n).filter(([,p])=>p===6).map(([p])=>p).join("|")})\s*:[^[\]{}<>]+\|([^[\]{}<>|=]*)`+"|"+String.raw`<(\w+)(?:\s(?:[^<>{}|=\s]+(?:\s*=\s*(?:[^\s"']\S*|(["']).*?\8))?(?=\s))*)?\s(\w*)`+")$","iu");b(this,or,{re:u,ext:e,tags:g,allTags:[...g,"onlyinclude","includeonly","noinclude"],functions:[Object.keys(r),Array.isArray(i)?i:Object.keys(i),s].flat(2),switches:o.slice(0,2).flat().map(p=>`__${p}__`),protocols:l.split("|"),params:Object.keys(d).filter(p=>p.endsWith("$1")||!p.includes("$1")).map(p=>p.replace(/\$1$/u,""))})}return c(this,or)},Or=function(n){return this.data.parserFunctions.find(({aliases:e})=>e.some(t=>t.replace(/^#/u,"")===n))}});var xt,Zo,gl,y,j=S(()=>{_i();$e();zi();Q();xt={config:jn,i18n:void 0,rules:qi,getConfig(){let{doubleUnderscore:a}=this.config;for(let n=0;n<2;n++)a.length>n+2&&a[n].length===0&&(a[n]=Object.keys(a[n+2]));return{...jn,...this.config,excludes:[]}},msg(a,n=""){var e,t;return a&&((t=(e=this.i18n)==null?void 0:e[a])!=null?t:a).replace("$1",this.msg(n))},normalizeTitle(a,n=0,e,t=xt.getConfig(),r=!1,i,s=!1,o=!1){let{Title:l}=(Ho(),J(Uo)),d;if(i)d=new l(a,n,t,r,s,o);else{let{Token:g}=(B(),J(Rr));d=ue.run(()=>{let u=new g(a,t);u.type="root",u.parseOnce(0,e).parseOnce();let p=new l(u.toString(),n,t,r,s,o);for(let h of["main","fragment"]){let m=p[h];if(m!=null&&m.includes("\0")){let f=u.buildFromStr(m,1);h==="main"?p.main=f:p.setFragment(f)}}return p})}return d},parse(a,n,e=11,t=xt.getConfig()){if(a=gr(a),typeof e!="number"){let s=Array.isArray(e)?e:[e];e=Math.max(...s.map(o=>Bi[o]||11))}let{Token:r}=(B(),J(Rr));return ue.run(()=>{let s=new r(a,t);return s.type="root",s.parse(e,n)})},async partialParse(a,n,e,t=xt.getConfig()){let{Token:r}=(B(),J(Rr)),i=typeof setImmediate=="function"?setImmediate:setTimeout,{running:s}=ue;ue.running=!0;let o=new r(gr(a),t);o.type="root";let l=0;return await new Promise(d=>{let g=()=>{n()===a?(l++,i(u,0)):d()},u=()=>{l===12?(o.afterBuild(),d()):(o[l===11?"build":"parseOnce"](l,e),g())};i(u,0)}),ue.running=s,o},createLanguageService(a){var n;{let e=(Yo(),J(Jo)),{LanguageService:t,tasks:r}=e;return(n=r.get(a))!=null?n:new t(a)}}},Zo={},gl=new Set(["normalizeTitle","parse","createLanguageService"]);for(let a in xt)gl.has(a)||(Zo[a]={enumerable:!1});Object.defineProperties(xt,Zo);Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:xt});y=xt});j();})();
|
|
38
38
|
//# sourceMappingURL=bundle.lsp.js.map
|