wikiparser-node 1.42.0 → 1.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -71,6 +71,28 @@ or
71
71
  npm i wikilint
72
72
  ```
73
73
 
74
+ #### Optional dependencies
75
+
76
+ You can install any of the following optional packages to enable advanced features:
77
+
78
+ | Package | Purpose |
79
+ | :-: | --- |
80
+ | `mathoid-texvcjs` | Diagnostics for `<math>` and `<chem>` extension tags |
81
+ | `stylelint` | Diagnostics for `style` attributes |
82
+ | `vscode-css-languageservice` | CSS language support for `style` attributes |
83
+ | `vscode-html-languageservice` | Language support for HTML tags |
84
+ | `vscode-json-languageservice` | JSON language support for `<templatedata>`, `<mapframe>`, `<maplink>` tags |
85
+ | `mediawiki-expr` | Evaluation of parser functions `#expr` and `#ifexpr` |
86
+ | `prismjs` + `prism-wiki` | Syntax highlighting of `<syntaxhighlight>` extension tags |
87
+
88
+ ```sh
89
+ # Full LanguageService features for `Parser.createLanguageService()`
90
+ npm i mathoid-texvcjs stylelint vscode-css-languageservice vscode-html-languageservice vscode-json-languageservice
91
+
92
+ # Full HTML conversion support for `Parser.toHtml()`
93
+ npm i mediawiki-expr prismjs prism-wiki
94
+ ```
95
+
74
96
  ### Browser
75
97
 
76
98
  You can download the code via CDN, for example:
@@ -142,7 +164,7 @@ The following limitations are documented for transparency.
142
164
  ### Parser
143
165
 
144
166
  1. Memory leaks may occur in rare cases.
145
- 1. Invalid page names with unicode characters are treated like valid ones ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#Render%20invalid%20page%20names%20as%20plain%20text%20(T53090))).
167
+ 1. Invalid page names with unicode characters are treated like valid ones ([Example](https://bhsd-harry.github.io/wikiparser-node/tests.html#Render%20invalid%20page%20names%20as%20plain%20text%20(T53090))).
146
168
  1. Preformatted text with a leading space is only processed by [`Token#toHtml`](https://github.com/bhsd-harry/wikiparser-node/wiki/Token-%28EN%29#tohtml).
147
169
  1. BCP 47 language codes are not supported in language conversion ([Example](https://bhsd-harry.github.io/wikiparser-node/tests.html#Explicit%20definition%20of%20language%20variant%20alternatives%20(BCP%2047%20codes))).
148
170
 
@@ -153,45 +175,46 @@ The following limitations are documented for transparency.
153
175
 
154
176
  #### Extension
155
177
 
156
- 1. Many extensions are not supported.
178
+ 1. Many [extensions](https://github.com/bhsd-harry/wikiparser-node/wiki/Extensions-%28EN%29#support) are not supported.
157
179
  1. [Sub-referencing](https://meta.wikimedia.org/wiki/WMDE_Technical_Wishes/Sub-referencing) is not supported.
158
180
 
159
181
  #### Transclusion
160
182
 
161
- 1. Some parser functions are not supported.
162
- 1. New lines in `{{localurl:}}` are not handled correctly ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#Basic%20%7B%7Blocalurle%3A%7D%7D%20test)).
183
+ 1. Some parser functions are not supported, notably [`#formatdate`](https://bhsd-harry.github.io/wikiparser-node/tests.html#formatdate%20parser%20function), [`#time`](https://bhsd-harry.github.io/wikiparser-node/tests.html#Input%20times%20are%20UTC%2C%20not%20local%20time) and [`#invoke`](https://bhsd-harry.github.io/wikiparser-node/tests.html#Scribunto%3A%20hello%20world).
184
+ 1. New lines in `{{localurl:}}` are not handled correctly ([Example](https://bhsd-harry.github.io/wikiparser-node/tests.html#Basic%20%7B%7Blocalurle%3A%7D%7D%20test)).
163
185
 
164
186
  #### Heading
165
187
 
166
- 1. RTL support in the table of contents (TOC) ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#span%20tags%20with%20directionality%20in%20TOC)).
188
+ 1. RTL support in the table of contents (TOC) ([Example](https://bhsd-harry.github.io/wikiparser-node/tests.html#span%20tags%20with%20directionality%20in%20TOC)).
167
189
 
168
190
  #### HTML tag
169
191
 
170
- 1. Style sanitization is sometimes different ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#CSS%20safety%20test%20(all%20browsers)%3A%20vertical%20tab%20(T57332%20%2F%20CVE-2013-4567))).
171
- 1. Table fostered content from `<table>` HTML tags ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#6.%20Encapsulate%20foster-parented%20transclusion%20content)).
192
+ 1. Style sanitization is sometimes different ([Example](https://bhsd-harry.github.io/wikiparser-node/tests.html#CSS%20safety%20test%20(all%20browsers)%3A%20vertical%20tab%20(T57332%20%2F%20CVE-2013-4567))).
193
+ 1. Table fostered content from `<table>` HTML tags ([Example](https://bhsd-harry.github.io/wikiparser-node/tests.html#6.%20Encapsulate%20foster-parented%20transclusion%20content)).
172
194
 
173
195
  #### Table
174
196
 
175
- 1. `<caption>` elements are wrapped in `<tbody>` elements ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#Trim%20whitespace%20in%20wikitext%20headings%2C%20list%20items%2C%20table%20captions%2C%20headings%2C%20and%20cells)).
176
- 1. Unclosed HTML tags in the table fostered content ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#Fuzz%20testing%3A%20Parser24)).
177
- 1. `<tr>` elements should not be fostered ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#Empty%20TR%20followed%20by%20a%20template-generated%20TR)).
197
+ 1. `<caption>` elements are wrapped in `<tbody>` elements ([Example](https://bhsd-harry.github.io/wikiparser-node/tests.html#Trim%20whitespace%20in%20wikitext%20headings%2C%20list%20items%2C%20table%20captions%2C%20headings%2C%20and%20cells)).
198
+ 1. Unclosed HTML tags in the table fostered content ([Example](https://bhsd-harry.github.io/wikiparser-node/tests.html#Fuzz%20testing%3A%20Parser24)).
199
+ 1. `<tr>` elements should not be fostered ([Example](https://bhsd-harry.github.io/wikiparser-node/tests.html#Empty%20TR%20followed%20by%20a%20template-generated%20TR)).
200
+ 1. Link text containing `!!` in a table header ([Example](https://bhsd-harry.github.io/wikiparser-node/tests.html#Exclamation%20points%20in%20wikilink%20content%20in%20table%20precedence)).
178
201
 
179
202
  #### Link
180
203
 
181
204
  1. Link trail is not supported ([Example](https://bhsd-harry.github.io/wikiparser-node/tests.html#1.%20Interaction%20of%20linktrail%20and%20template%20encapsulation)).
182
- 1. Block elements inside a link should break it into multiple links ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#%3Cpre%3E%20inside%20a%20link)).
205
+ 1. Block elements inside a link should break it into multiple links ([Example](https://bhsd-harry.github.io/wikiparser-node/tests.html#%3Cpre%3E%20inside%20a%20link)).
183
206
  1. Invalid or missing images (Examples [1](https://bhsd-harry.github.io/wikiparser-node/tests.html#Fuzz%20testing%3A%20image%20with%20bogus%20manual%20thumbnail), [2](https://bhsd-harry.github.io/wikiparser-node/tests.html#Gallery%20with%20line%20not%20in%20the%20file%20namespace)).
184
- 1. Link starting with `../` on a subpage ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#Parent%20directory%20in%20redirect)).
207
+ 1. Link starting with `../` on a subpage ([Example](https://bhsd-harry.github.io/wikiparser-node/tests.html#Parent%20directory%20in%20redirect)).
185
208
 
186
209
  #### External link
187
210
 
188
- 1. External images are not supported (Examples [1](http://bhsd-harry.github.io/wikiparser-node/tests.html#External%20image), [2](http://bhsd-harry.github.io/wikiparser-node/tests.html#External%20links%3A%20Clickable%20images)).
189
- 1. No percent-encoding in displayed free external links ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#Parsoid%3A%20pipe%20in%20transclusion%20parameter)).
211
+ 1. External images are not supported (Examples [1](https://bhsd-harry.github.io/wikiparser-node/tests.html#External%20image), [2](https://bhsd-harry.github.io/wikiparser-node/tests.html#External%20links%3A%20Clickable%20images)).
212
+ 1. No percent-encoding in displayed free external links ([Example](https://bhsd-harry.github.io/wikiparser-node/tests.html#Parsoid%3A%20pipe%20in%20transclusion%20parameter)).
190
213
 
191
214
  #### Block element
192
215
 
193
- 1. Incomplete `<p>` wrapping when there are block elements (e.g., [`<pre>`](http://bhsd-harry.github.io/wikiparser-node/tests.html#%3Cpre%3E%20inside%20a%20link), [`<div>`](http://bhsd-harry.github.io/wikiparser-node/tests.html#Templates%3A%20Scopes%20should%20not%20be%20expanded%20unnecessarily) or even [closing tags](http://bhsd-harry.github.io/wikiparser-node/tests.html#Non-word%20characters%20don't%20terminate%20tag%20names%20(T19663%2C%20T42670%2C%20T54022))).
194
- 1. Mixed lists ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#Mixed%20Lists%3A%20Test%204)).
216
+ 1. Incomplete `<p>` wrapping when there are block elements (e.g., [`<pre>`](https://bhsd-harry.github.io/wikiparser-node/tests.html#%3Cpre%3E%20inside%20a%20link), [`<div>`](https://bhsd-harry.github.io/wikiparser-node/tests.html#Templates%3A%20Scopes%20should%20not%20be%20expanded%20unnecessarily) or even [closing tags](https://bhsd-harry.github.io/wikiparser-node/tests.html#Non-word%20characters%20don't%20terminate%20tag%20names%20(T19663%2C%20T42670%2C%20T54022))).
217
+ 1. Mixed lists ([Example](https://bhsd-harry.github.io/wikiparser-node/tests.html#Mixed%20Lists%3A%20Test%204)).
195
218
 
196
219
  #### Language conversion
197
220
 
@@ -201,6 +224,6 @@ The following limitations are documented for transparency.
201
224
 
202
225
  #### Miscellaneous
203
226
 
204
- 1. Illegal HTML entities ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#Illegal%20character%20references%20(T106578%2C%20T113194))).
227
+ 1. Illegal HTML entities ([Example](https://bhsd-harry.github.io/wikiparser-node/tests.html#Illegal%20character%20references%20(T106578%2C%20T113194))).
205
228
 
206
229
  </details>
@@ -9,7 +9,7 @@
9
9
  `)}text(){return super.text(`
10
10
  `).replace(/\n\s*\n/gu,`
11
11
  `)}getGaps(){return 1}print(){}}});var Qn,La=w(()=>{"use strict";z();Oi();W();G();Qn=class extends L{get type(){return"param-line"}constructor(t,e,r,n,i){super(e,r,n,i),this.setAttribute("name",t)}lint(t=this.getAbsoluteIndex()){{let e="no-ignored",{lintConfig:r}=v,{name:n,childNodes:i}=this,s=r.getSeverity(e,n);if(!s)return[];let a=v.msg("invalid-parameter",n);if(i.some(({type:u})=>u==="ext"))return[F(this,{start:t},e,a,s)];let l=i.filter(({type:u})=>u!=="comment"&&u!=="include"&&u!=="noinclude"),g=n==="inputbox",p=g?l.findIndex(({type:u})=>u!=="text"):-1,d=l.slice(0,p===-1?void 0:p).map(String).join("").trim();if(d){g&&(d=d.toLowerCase());let u=d.indexOf("="),c=d.slice(0,u===-1?void 0:u).trim(),f=ka[n];if(u===-1?p===-1||!f.some(b=>b.startsWith(c)):!f.includes(c)){let b=F(this,{start:t},e,a,s);return r.computeEditInfo&&(b.suggestions=[O(b)]),[b]}}return super.lint(t,!1)}}}});var Na={};Z(Na,{ParamTagToken:()=>Zr});var Zr,Wi=w(()=>{"use strict";en();Jn();La();Zr=class extends mt{constructor(t,e,r,n,i=[],s){super(void 0,n,i,{}),r&&this.safeAppend(r.split(`
12
- `).map(a=>s?a:Pt(a,n,i,e)).map(a=>new Qn(t,a,n,i,{}))),i.splice(i.indexOf(this),1),i.push(this)}}});var $a,tn,rn,Di,Ui,Lp,Qe,zi=w(()=>{"use strict";je();z();Se();ae();be();W();G();dt();$a=[K];Qe=class extends(Lp=L){constructor(e,r,n,i=[]){super(void 0,n,i);S(this,rn);S(this,tn);C(this,tn,e);let s=new L(r[0],n,i);s.type="heading-title",s.setAttribute("stage",2);let a=new he(r[1],"heading-trail",n,i);this.append(s,a)}get type(){return"heading"}get level(){return m(this,tn)}toString(e){let r=I(this,rn,Di).call(this);return r+this.firstChild.toString(e)+r+this.lastChild.toString(e)}text(){let e=I(this,rn,Di).call(this);return e+this.firstChild.text()+e}getAttribute(e){return e==="invalid"?this.inHtmlAttrs()===2:e==="padding"?this.level:super.getAttribute(e)}getGaps(){return this.level}lint(e=this.getAbsoluteIndex(),r){{let n=super.lint(e,r),{firstChild:i,level:s}=this,a=i.toString(),l=a.startsWith("="),g=l||a.endsWith("="),p=new M(this,e),d=this.inHtmlAttrs(),u=["h1","unbalanced-header","format-leakage"],{lintConfig:c}=v,{computeEditInfo:f,fix:b}=c,x=u.map(k=>c.getSeverity(k,"apostrophe"));if(x[0]&&this.level===1){let k=j(i,p,u[0],"<h1>",x[0]);f&&!g&&(k.suggestions=[me(k,"h2",`=${a}=`)]),n.push(k)}if(x[1]&&g){let k=v.msg("unbalanced-in-section-header",'"="'),h=j(i,p,u[1],k,x[1]);if(!(!f||a==="="))if(l){let y=Co(a,/[^=]|$/u),T=s+y;h.suggestions=[{desc:`h${s}`,range:[h.startIndex,h.startIndex+y],text:""}],T<7&&h.suggestions.push({desc:`h${T}`,range:[h.endIndex,h.endIndex],text:"=".repeat(y)})}else{let y=/[^=](=+)$/u.exec(a)[1],T=s+y.length;h.suggestions=[{desc:`h${s}`,range:[h.endIndex-y.length,h.endIndex],text:""}],T<7&&h.suggestions.push({desc:`h${T}`,range:[h.startIndex,h.startIndex],text:y})}n.push(h)}if(d){let k="parsing-order",h=c.getSeverity(k,d===2?"heading":"templateInTable");h&&n.push(F(this,p,k,"header-in-html",h))}if(x[2]){let k=this.getRootNode().toString(),h=i.childNodes.filter(Xn("quote")),y=h.filter(({bold:A})=>A),T=h.filter(({italic:A})=>A);if(y.length%2){let A=j(y[y.length-1],oe(V({},p),{start:e+s,left:p.left+s}),u[2],v.msg("unbalanced-in-section-header","bold-apostrophes"),x[2]);if(f||b){let $=e+s+a.length,E=O(A);k.slice(A.endIndex,$).trim()?f&&(A.suggestions=[E,Le($,"'''")]):y.length===1&&T.length===0?A.fix=E:f&&(A.suggestions=[E])}n.push(A)}if(T.length%2){let A=j(T[T.length-1],{start:e+s},u[2],v.msg("unbalanced-in-section-header","italic-apostrophes"),x[2]);if(f||b){let $=e+s+a.length;k.slice(A.endIndex,$).trim()?f&&(A.suggestions=[Le($,"''")]):T.length===1&&y.length===0?A.fix=O(A):f&&(A.suggestions=[O(A)])}n.push(A)}}return n}}print(){}json(e,r,n=this.getAbsoluteIndex()){}};Ui=B(Lp),tn=new WeakMap,rn=new WeakSet,Di=function(){return"=".repeat(this.level)},Qe=P(Ui,0,"HeadingToken",$a,Qe),R(Ui,1,Qe)});var Np,Yn,Ia=w(()=>{"use strict";le();z();W();G();Np=new RegExp(`https?://${Ue}${De}$`,"iu"),Yn=class extends L{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){}constructor(t,e,r,n=[]){super(void 0,r,n);let i=new L(typeof t=="number"?void 0:t,r,n,{}),s=new L(e,r,n);i.type="parameter-key",i.setAttribute("stage",2),s.type="parameter-value",s.setAttribute("stage",2),this.append(i,s)}trimName(t,e=!0){let r=(typeof t=="string"?t:t.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",r),r}afterBuild(){if(!this.anon){let{parentNode:t,firstChild:e}=this,r=this.trimName(e);t&&t.getArgs(r,!1,!1).add(this)}super.afterBuild()}toString(t){return this.anon?this.lastChild.toString(t):super.toString(t,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(t=this.getAbsoluteIndex(),e){var r;{let n=super.lint(t,e),i="unescaped",{lintConfig:s}=v,a=s.getSeverity(i);if(a){let{firstChild:l}=this,g=(r=Np.exec(l.text()))==null?void 0:r[0];try{if(g&&new URL(g).search){let p=j(l,{start:t},i,"unescaped-query",a);p.startIndex=p.endIndex,p.startLine=p.endLine,p.startCol=p.endCol,p.endIndex++,p.endCol++,(s.computeEditInfo||s.fix)&&(p.fix=Ge(p.startIndex,"{{=}}")),n.push(p)}}catch(p){}}return n}}print(){}json(t,e,r=this.getAbsoluteIndex()){}}});var Fa,nn,Bt,fr,jt,sn,cr,Ot,Hi,Ra,Gi,$p,ht,Pa=w(()=>{"use strict";le();z();Se();ae();Jr();be();W();G();Ia();pt();dt();Fa=[K,ut()];ht=class extends($p=L){constructor(e,r,n,i=[]){var k,h;let s,a=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(e);a&&(s=Number(a[1]),e=e.replace(`\0${s}h`,i[s].toString().replace(/^\n/u,"")));super(void 0,n,i,{});S(this,Ot);ce(this,"modifier","");S(this,nn,"template");S(this,Bt,":");S(this,fr,!1);S(this,jt,new Map);S(this,sn,0);S(this,cr);let{parserFunction:l,variable:g,functionHook:p}=n,d=(k=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(e))==null?void 0:k[0];if(d)this.setAttribute("modifier",d),e=e.slice(d.length);else if(e.includes(":")){let[y,...T]=e.split(":"),[A]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((h=T[0])!=null?h:"");this.setModifier(`${y}:${A}`)&&(e=T.join(":").slice(A.length))}let u=e.search(/[::]/u),c=e[u]===":",f=u!==-1;if(f||r.length===0&&!m(this,fr)){let y=f?e.slice(0,u):e,T=f&&e.slice(u+1),A=re(y),$=f?A.slice(A.search(/\S/u))+(c?":":""):A.trim(),[,E,N]=Ba($,l),H=!("functionHook"in n)||p.includes(N),q=g.includes(N);if(f?N&&H:q){this.setAttribute("name",N),C(this,nn,"magic-word"),c&&C(this,Bt,":");let X=new he(y,"magic-word-name",n,i);if(super.insertAt(X),T!==!1&&r.unshift([T]),this.name==="invoke")for(let _=0;_<2;_++){let D=r.shift();if(!D)break;let U=new ue(D.join("="),`invoke-${_?"function":"module"}`,n,i);super.insertAt(U)}}}if(this.type==="template"){let y=re(e).trim();if(!this.normalizeTitle(y,10,{halfParsed:!0,temporary:!0}).valid)throw i.pop(),new SyntaxError("Invalid template name");let T=new ue(e,"template-name",n,i,{});super.insertAt(T)}typeof s=="number"&&(i[s]=void 0);let b=this.isTemplate(),x=1;for(let y=0;y<r.length;y++){let T=r[y];b||this.name==="switch"&&y>0||this.name==="tag"&&y>1||(T[0]=T.join("="),T.length=1),T.length===1&&(T.unshift(x),x++),this.insertAt(new Yn(...T,n,i))}this.seal("modifier")}get type(){return m(this,nn)}get module(){}get function(){}setModifier(e){let[,,r,n]=this.getAttribute("config").parserFunction,i=re(e).trim();if(e&&!i.endsWith(":"))return!1;let s=i.slice(0,-1).toLowerCase(),a=r.includes(s),l=n.includes(s);return(m(this,fr)?a:l||!e)||(ne.running||this.length>1)&&(a||l||!e)?(this.setAttribute("modifier",e),C(this,fr,a),!!e):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0)),super.afterBuild(),this.isTemplate()&&this.type==="template"&&(C(this,cr,I(this,Ot,Hi).call(this)),this.setAttribute("name",m(this,cr).title))}toString(e){let{childNodes:r,length:n,firstChild:i,modifier:s,type:a}=this;return`{{${s}${a==="magic-word"?i.toString(e)+(n===1?"":m(this,Bt))+r.slice(1).map(l=>l.toString(e)).join("|"):super.toString(e,"|")}}}`}text(){let{childNodes:e,length:r,firstChild:n,modifier:i,type:s,name:a}=this;return s==="magic-word"&&a==="vardefine"?"":`{{${i}${s==="magic-word"?n.text()+(r===1?"":m(this,Bt))+Ee(e.slice(1),"|"):super.text("|")}}}`}getAttribute(e){switch(e){case"padding":return this.modifier.length+2;case"title":return m(this,cr);case"colon":return m(this,Bt);default:return super.getAttribute(e)}}lint(e=this.getAbsoluteIndex(),r){{let n=super.lint(e,r);if(!this.isTemplate())return n;let{type:i,childNodes:s,length:a}=this,l=new M(this,e),{lintConfig:g}=v,{computeEditInfo:p}=g,d=i==="magic-word",u="no-ignored",c=g.getSeverity(u,"fragment");if(d&&!I(this,Ot,Hi).call(this).valid)u="invalid-invoke",c=g.getSeverity(u,"name"),c&&n.push(j(s[1],l,u,"illegal-module",c));else if(c){let f=s[d?1:0],b=f.childNodes.findIndex(k=>k.type==="text"&&jr(k.data).includes("#")),x=f.childNodes[b];if(x){let k=j(f,l,u,"useless-fragment",c);p&&(k.suggestions=[O(k,f.getRelativeIndex(b)+x.data.indexOf("#"))]),n.push(k)}}if(u="invalid-invoke",c=g.getSeverity(u,"function"),c&&d&&a===2)return n.push(F(this,l,u,"missing-function",c)),n;if(u="no-duplicate",c=g.getSeverity(u,"parameter"),c){let f=this.getDuplicatedArgs().filter(([,x])=>!x[0].querySelector("ext")),b="duplicate-parameter";for(let[,x]of f)Array.prototype.push.apply(n,x.map(k=>{let h=j(k,l,u,b,c);return p&&(h.suggestions=[O(h,-1)]),h}))}return n}}insertAt(e,r=this.length){return super.insertAt(e,r),e.anon?I(this,Ot,Ra).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getArgs(e,r,n=!0,i=!0){let s=String(e).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),a;return m(this,jt).has(s)?a=m(this,jt).get(s):(a=new Set,m(this,jt).set(s,a)),a}getDuplicatedArgs(){return[...m(this,jt)].filter(([,{size:e}])=>e>1).map(([e,r])=>[e,[...r]])}getPossibleValues(){let{type:e,name:r,childNodes:n}=this;if(e==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let i,s;switch(r){case"if":case"ifexist":case"ifexpr":case"iferror":i=2;break;case"ifeq":i=3;break;case"switch":{let a=n.slice(2),l=a[a.length-1];s=[...a.filter(({anon:g})=>!g),...l!=null&&l.anon?[l]:[]].map(({lastChild:g})=>g);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}s!=null||(s=n.slice(i,i+2).map(({lastChild:a})=>a));for(let a=0;a<s.length;){let{length:l,0:g}=s[a].childNodes.filter(p=>p.text().trim());if(l===0)s.splice(a,1);else if(l>1||!g.is("magic-word"))a++;else try{let p=g.getPossibleValues();Array.prototype.splice.apply(s,[a,1,...p]),a+=p.length}catch(p){a++}}return s}print(){}};Gi=B($p),nn=new WeakMap,Bt=new WeakMap,fr=new WeakMap,jt=new WeakMap,sn=new WeakMap,cr=new WeakMap,Ot=new WeakSet,Hi=function(){let e=this.type==="template";return this.normalizeTitle((e?"":"Module:")+re(this.childNodes[e?0:1].text()),10,V({temporary:!0},!e&&{page:""}))},Ra=function(e,r){C(this,sn,m(this,sn)+1);let n;n=m(this,sn)-1;let i=e,s=String(n+1);i.setAttribute("name",s),this.getArgs(s,!1,!1).add(i)},ht=P(Gi,0,"TranscludeToken",Fa,ht),R(Gi,1,ht)});var ja,Vi,Ip,qt,Oa=w(()=>{"use strict";lt();be();G();ja=[ve(),K];qt=class extends(Ip=L){get type(){return"hidden"}getAttribute(t){return t==="invalid"||super.getAttribute(t)}};Vi=B(Ip),qt=P(Vi,0,"HiddenToken",ja,qt),R(Vi,1,qt)});var qa,Ji,Fp,Ki,Rp,_t,_a=w(()=>{"use strict";le();z();ae();_e();Jr();be();W();G();pt();Oa();qa=[K,ge("{{{"),ut()];_t=class extends(Rp=L){constructor(e,r,n=[]){super(void 0,r,n,{});S(this,Ji);for(let i=0;i<e.length;i++){let s=e[i];if(i===0){let a=new ue(s,"arg-name",r,n,{});super.insertAt(a)}else if(i>1){let a=new qt(s,r,n);super.insertAt(a)}else{let a=new L(s,r,n);a.type="arg-default",a.setAttribute("stage",2),super.insertAt(a)}}}get type(){return"arg"}get default(){}toString(e){return`{{{${super.toString(e,"|")}}}}`}text(){return`{{{${Ee(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){super.afterBuild()}lint(e=this.getAbsoluteIndex(),r){{let[n,i,...s]=this.childNodes;n.setAttribute("aIndex",e+3);let a=n.lint(e+3,r);if(i){let f=e+4+n.toString().length;i.setAttribute("aIndex",f);let b=i.lint(f,r);b.length>0&&Array.prototype.push.apply(a,b)}let l=["no-ignored","no-arg"],{lintConfig:g}=v,{computeEditInfo:p}=g,d=new M(this,e),u=l.map(f=>g.getSeverity(f,"arg"));if(u[0]&&s.length>0&&Array.prototype.push.apply(a,s.map(f=>{let b=j(f,d,l[0],"invisible-triple-braces",u[0]);return b.startIndex--,b.startCol--,p&&(b.suggestions=[O(b),Ge(b.startIndex,"{{!}}")]),b})),u[1]&&!this.getAttribute("include")){let f=F(this,d,l[1],"unexpected-argument",u[1]);p&&i&&(f.suggestions=[me(f,"expand",i.text())]),a.push(f)}let c=this.closest("ext");if(c){let f="arg-in-ext",b=g.getSeverity(f,c.name);b&&a.push(F(this,d,f,"argument-in-ext",b))}return a}}print(){}json(e,r,n=this.getAbsoluteIndex()){}};Ki=B(Rp),Ji=new WeakSet,Fp=function(){},_t=P(Ki,0,"ArgToken",qa,_t),R(Ki,1,_t)});var Ha={};Z(Ha,{parseBraces:()=>on});var Pp,Ma,Qi,Wa,Ua,Da,Ga,za,on,Zn=w(()=>{"use strict";je();le();zi();Pa();_a();Pp={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},Ma=String.raw`\[(?!\[)`,Qi=String.raw`\n(?![=\0])`,Wa=String.raw`|\{{2,}`,Ua=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),Da=Be(o=>new RegExp(o,"gmu"));Ga=new RegExp(String.raw`\{\{((?:[^\n{}[]|${Ma}|${Qi})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${Qi})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${Ma}|${Qi})*\}-`,"gu");za=o=>{let t=ze(re(o));return Ua.has(t)?Ua.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},on=(o,t,e)=>{var f,b,x,k,h;let r=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,[,,,n]=t.parserFunction,i=[],s=[],a=(y,T,A,$)=>{T[T.length-1].push(ke(y.slice(A,$),s))},l;do l!==void 0&&(o=l),l=o.replace(Ga,(y,T,A)=>{if(T!==void 0||typeof A=="string")try{let{length:$}=e,E=(T!=null?T:A).split("|");return new ht(ke(E[0],s),E.slice(1).map(N=>{let H=N.indexOf("=");return(H===-1?[N]:[N.slice(0,H),N.slice(H+1)]).map(q=>ke(q,s))}),t,e),`\0${$}${za(E[0])}`}catch($){if(!($ instanceof SyntaxError)||$.message!=="Invalid template name")throw $}return s.push(ke(y,s)),`\0${s.length-1}`});while(l!==o);o=l;let g=o.lastIndexOf("}}")-o.length,p=g+o.length!==-1,d=Da(r+(p?Wa:"")),u=d.exec(o),c;for(;u||c!==void 0&&c<=o.length&&((b=(f=i[i.length-1])==null?void 0:f[0])!=null&&b.startsWith("="));){if(u!=null&&u[1]){let[,{length:D}]=u;u[0]=u[0].slice(D),u.index+=D}let{0:y,index:T}=u!=null?u:{0:`
12
+ `).map(a=>s?a:Pt(a,n,i,e)).map(a=>new Qn(t,a,n,i,{}))),i.splice(i.indexOf(this),1),i.push(this)}}});var $a,tn,rn,Di,Ui,Lp,Qe,zi=w(()=>{"use strict";je();z();Se();ae();be();W();G();dt();$a=[K];Qe=class extends(Lp=L){constructor(e,r,n,i=[]){super(void 0,n,i);S(this,rn);S(this,tn);C(this,tn,e);let s=new L(r[0],n,i);s.type="heading-title",s.setAttribute("stage",2);let a=new he(r[1],"heading-trail",n,i);this.append(s,a)}get type(){return"heading"}get level(){return m(this,tn)}toString(e){let r=I(this,rn,Di).call(this);return r+this.firstChild.toString(e)+r+this.lastChild.toString(e)}text(){let e=I(this,rn,Di).call(this);return e+this.firstChild.text()+e}getAttribute(e){return e==="invalid"?this.inHtmlAttrs()===2:e==="padding"?this.level:super.getAttribute(e)}getGaps(){return this.level}lint(e=this.getAbsoluteIndex(),r){{let n=super.lint(e,r),{firstChild:i,level:s}=this,a=i.toString(),l=a.startsWith("="),g=l||a.endsWith("="),p=new M(this,e),d=this.inHtmlAttrs(),u=["h1","unbalanced-header","format-leakage"],{lintConfig:c}=v,{computeEditInfo:f,fix:b}=c,x=u.map(k=>c.getSeverity(k,"apostrophe"));if(x[0]&&this.level===1){let k=j(i,p,u[0],"<h1>",x[0]);f&&!g&&(k.suggestions=[me(k,"h2",`=${a}=`)]),n.push(k)}if(x[1]&&g){let k=v.msg("unbalanced-in-section-header",'"="'),h=j(i,p,u[1],k,x[1]);if(!(!f||a==="="))if(l){let y=Co(a,/[^=]|$/u),T=s+y;h.suggestions=[{desc:`h${s}`,range:[h.startIndex,h.startIndex+y],text:""}],T<7&&h.suggestions.push({desc:`h${T}`,range:[h.endIndex,h.endIndex],text:"=".repeat(y)})}else{let y=/[^=](=+)$/u.exec(a)[1],T=s+y.length;h.suggestions=[{desc:`h${s}`,range:[h.endIndex-y.length,h.endIndex],text:""}],T<7&&h.suggestions.push({desc:`h${T}`,range:[h.startIndex,h.startIndex],text:y})}n.push(h)}if(d){let k="parsing-order",h=c.getSeverity(k,d===2?"heading":"templateInTable");h&&n.push(F(this,p,k,"header-in-html",h))}if(x[2]){let k=this.getRootNode().toString(),h=i.childNodes.filter(Xn("quote")),y=h.filter(({bold:A})=>A),T=h.filter(({italic:A})=>A);if(y.length%2){let A=j(y[y.length-1],oe(V({},p),{start:e+s,left:p.left+s}),u[2],v.msg("unbalanced-in-section-header","bold-apostrophes"),x[2]);if(f||b){let $=e+s+a.length,E=O(A);k.slice(A.endIndex,$).trim()?f&&(A.suggestions=[E,Le($,"'''")]):y.length===1&&T.length===0?A.fix=E:f&&(A.suggestions=[E])}n.push(A)}if(T.length%2){let A=j(T[T.length-1],{start:e+s},u[2],v.msg("unbalanced-in-section-header","italic-apostrophes"),x[2]);if(f||b){let $=e+s+a.length;k.slice(A.endIndex,$).trim()?f&&(A.suggestions=[Le($,"''")]):T.length===1&&y.length===0?A.fix=O(A):f&&(A.suggestions=[O(A)])}n.push(A)}}return n}}print(){}json(e,r,n=this.getAbsoluteIndex()){}};Ui=B(Lp),tn=new WeakMap,rn=new WeakSet,Di=function(){return"=".repeat(this.level)},Qe=P(Ui,0,"HeadingToken",$a,Qe),R(Ui,1,Qe)});var Np,Yn,Ia=w(()=>{"use strict";le();z();W();G();Np=new RegExp(`https?://${Ue}${De}$`,"iu"),Yn=class extends L{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){}constructor(t,e,r,n=[]){super(void 0,r,n);let i=new L(typeof t=="number"?void 0:t,r,n,{}),s=new L(e,r,n);i.type="parameter-key",i.setAttribute("stage",2),s.type="parameter-value",s.setAttribute("stage",2),this.append(i,s)}trimName(t,e=!0){let r=(typeof t=="string"?t:t.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",r),r}afterBuild(){if(!this.anon){let{parentNode:t,firstChild:e}=this,r=this.trimName(e);t&&t.getArgs(r,!1,!1).add(this)}super.afterBuild()}toString(t){return this.anon?this.lastChild.toString(t):super.toString(t,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(t=this.getAbsoluteIndex(),e){var r;{let n=super.lint(t,e),i="unescaped",{lintConfig:s}=v,a=s.getSeverity(i);if(a){let{firstChild:l}=this,g=(r=Np.exec(l.text()))==null?void 0:r[0];try{if(g&&new URL(g).search){let p=j(l,{start:t},i,"unescaped-query",a);p.startIndex=p.endIndex,p.startLine=p.endLine,p.startCol=p.endCol,p.endIndex++,p.endCol++,(s.computeEditInfo||s.fix)&&(p.fix=Ge(p.startIndex,"{{=}}")),n.push(p)}}catch(p){}}return n}}print(){}json(t,e,r=this.getAbsoluteIndex()){}}});var Fa,nn,Bt,fr,jt,sn,cr,Ot,Hi,Ra,Gi,$p,ht,Pa=w(()=>{"use strict";le();z();Se();ae();Jr();be();W();G();Ia();pt();dt();Fa=[K,ut()];ht=class extends($p=L){constructor(e,r,n,i=[]){var k,h;let s,a=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(e);a&&(s=Number(a[1]),e=e.replace(`\0${s}h`,i[s].toString().replace(/^\n/u,"")));super(void 0,n,i,{});S(this,Ot);ce(this,"modifier","");S(this,nn,"template");S(this,Bt,":");S(this,fr,!1);S(this,jt,new Map);S(this,sn,0);S(this,cr);let{parserFunction:l,variable:g,functionHook:p}=n,d=(k=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(e))==null?void 0:k[0];if(d)this.setAttribute("modifier",d),e=e.slice(d.length);else if(e.includes(":")){let[y,...T]=e.split(":"),[A]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((h=T[0])!=null?h:"");this.setModifier(`${y}:${A}`)&&(e=T.join(":").slice(A.length))}let u=e.search(/[::]/u),c=e[u]===":",f=u!==-1;if(f||r.length===0&&!m(this,fr)){let y=f?e.slice(0,u):e,T=f&&e.slice(u+1),A=re(y),$=f?A.slice(A.search(/\S/u))+(c?":":""):A.trim(),[,E,N]=Ba($,l),H=!("functionHook"in n)||p.includes(N),q=g.includes(N);if(f?N&&H:q){this.setAttribute("name",N),C(this,nn,"magic-word"),c&&C(this,Bt,":");let X=new he(y,"magic-word-name",n,i);if(super.insertAt(X),T!==!1&&r.unshift([T]),this.name==="invoke")for(let _=0;_<2;_++){let D=r.shift();if(!D)break;let U=new ue(D.join("="),`invoke-${_?"function":"module"}`,n,i);super.insertAt(U)}}}if(this.type==="template"){let y=re(e).trim();if(!this.normalizeTitle(y,10,{halfParsed:!0,temporary:!0}).valid)throw i.pop(),new SyntaxError("Invalid template name");let T=new ue(e,"template-name",n,i,{});super.insertAt(T)}typeof s=="number"&&(i[s]=void 0);let b=this.isTemplate(),x=1;for(let y=0;y<r.length;y++){let T=r[y];b||this.name==="switch"&&y>0||this.name==="tag"&&y>1||(T[0]=T.join("="),T.length=1),T.length===1&&(T.unshift(x),x++),this.insertAt(new Yn(...T,n,i))}this.seal("modifier")}get type(){return m(this,nn)}get module(){}get function(){}setModifier(e){let[,,r,n]=this.getAttribute("config").parserFunction,i=re(e).trim();if(e&&!i.endsWith(":"))return!1;let s=i.slice(0,-1).toLowerCase(),a=r.includes(s),l=n.includes(s);return(m(this,fr)?a:l||!e)||(ne.running||this.length>1)&&(a||l||!e)?(this.setAttribute("modifier",e),C(this,fr,a),!!e):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0)),super.afterBuild(),this.isTemplate()&&this.type==="template"&&(C(this,cr,I(this,Ot,Hi).call(this)),this.setAttribute("name",m(this,cr).title))}toString(e){let{childNodes:r,length:n,firstChild:i,modifier:s,type:a}=this;return`{{${s}${a==="magic-word"?i.toString(e)+(n===1?"":m(this,Bt))+r.slice(1).map(l=>l.toString(e)).join("|"):super.toString(e,"|")}}}`}text(){let{childNodes:e,length:r,firstChild:n,modifier:i,type:s,name:a}=this;return s==="magic-word"&&a==="vardefine"?"":`{{${i}${s==="magic-word"?n.text()+(r===1?"":m(this,Bt))+Ee(e.slice(1),"|"):super.text("|")}}}`}getAttribute(e){switch(e){case"padding":return this.modifier.length+2;case"title":return m(this,cr);case"colon":return m(this,Bt);default:return super.getAttribute(e)}}lint(e=this.getAbsoluteIndex(),r){{let n=super.lint(e,r);if(!this.isTemplate())return n;let{type:i,childNodes:s,length:a}=this,l=new M(this,e),{lintConfig:g}=v,{computeEditInfo:p}=g,d=i==="magic-word",u="no-ignored",c=g.getSeverity(u,"fragment");if(d&&!I(this,Ot,Hi).call(this).valid)u="invalid-invoke",c=g.getSeverity(u,"name"),c&&n.push(j(s[1],l,u,"illegal-module",c));else if(c){let f=s[d?1:0],b=f.childNodes.findIndex(k=>k.type==="text"&&jr(k.data).includes("#")),x=f.childNodes[b];if(x){let k=j(f,l,u,"useless-fragment",c);p&&(k.suggestions=[O(k,f.getRelativeIndex(b)+x.data.indexOf("#"))]),n.push(k)}}if(u="invalid-invoke",c=g.getSeverity(u,"function"),c&&d&&a===2)return n.push(F(this,l,u,"missing-function",c)),n;if(u="no-duplicate",c=g.getSeverity(u,"parameter"),c){let f=this.getDuplicatedArgs().filter(([,x])=>!x[0].querySelector("ext")),b="duplicate-parameter";for(let[,x]of f)Array.prototype.push.apply(n,x.map(k=>{let h=j(k,l,u,b,c);return p&&(h.suggestions=[O(h,-1)]),h}))}return n}}insertAt(e,r=this.length){return super.insertAt(e,r),e.anon?I(this,Ot,Ra).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getArgs(e,r,n=!0,i=!0){let s=String(e).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),a;return m(this,jt).has(s)?a=m(this,jt).get(s):(a=new Set,m(this,jt).set(s,a)),a}getDuplicatedArgs(){return[...m(this,jt)].filter(([,{size:e}])=>e>1).map(([e,r])=>[e,[...r]])}getPossibleValues(){let{type:e,name:r,childNodes:n,length:i}=this;if(e==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let s,a;switch(r){case"if":case"ifexist":case"ifexpr":s=2;break;case"ifeq":s=3;break;case"iferror":s=i>3?2:1;break;case"switch":{let l=n.slice(2),g=l[l.length-1];a=[...l.filter(({anon:p})=>!p),...g!=null&&g.anon?[g]:[]].map(({lastChild:p})=>p);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}a!=null||(a=n.slice(s,s+2).map(({lastChild:l})=>l));for(let l=0;l<a.length;){let{length:g,0:p}=a[l].childNodes.filter(d=>d.text().trim());if(g===0)a.splice(l,1);else if(g>1||!p.is("magic-word"))l++;else try{let d=p.getPossibleValues();Array.prototype.splice.apply(a,[l,1,...d]),l+=d.length}catch(d){l++}}return a}print(){}};Gi=B($p),nn=new WeakMap,Bt=new WeakMap,fr=new WeakMap,jt=new WeakMap,sn=new WeakMap,cr=new WeakMap,Ot=new WeakSet,Hi=function(){let e=this.type==="template";return this.normalizeTitle((e?"":"Module:")+re(this.childNodes[e?0:1].text()),10,V({temporary:!0},!e&&{page:""}))},Ra=function(e,r){C(this,sn,m(this,sn)+1);let n;n=m(this,sn)-1;let i=e,s=String(n+1);i.setAttribute("name",s),this.getArgs(s,!1,!1).add(i)},ht=P(Gi,0,"TranscludeToken",Fa,ht),R(Gi,1,ht)});var ja,Vi,Ip,qt,Oa=w(()=>{"use strict";lt();be();G();ja=[ve(),K];qt=class extends(Ip=L){get type(){return"hidden"}getAttribute(t){return t==="invalid"||super.getAttribute(t)}};Vi=B(Ip),qt=P(Vi,0,"HiddenToken",ja,qt),R(Vi,1,qt)});var qa,Ji,Fp,Ki,Rp,_t,_a=w(()=>{"use strict";le();z();ae();_e();Jr();be();W();G();pt();Oa();qa=[K,ge("{{{"),ut()];_t=class extends(Rp=L){constructor(e,r,n=[]){super(void 0,r,n,{});S(this,Ji);for(let i=0;i<e.length;i++){let s=e[i];if(i===0){let a=new ue(s,"arg-name",r,n,{});super.insertAt(a)}else if(i>1){let a=new qt(s,r,n);super.insertAt(a)}else{let a=new L(s,r,n);a.type="arg-default",a.setAttribute("stage",2),super.insertAt(a)}}}get type(){return"arg"}get default(){}toString(e){return`{{{${super.toString(e,"|")}}}}`}text(){return`{{{${Ee(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){super.afterBuild()}lint(e=this.getAbsoluteIndex(),r){{let[n,i,...s]=this.childNodes;n.setAttribute("aIndex",e+3);let a=n.lint(e+3,r);if(i){let f=e+4+n.toString().length;i.setAttribute("aIndex",f);let b=i.lint(f,r);b.length>0&&Array.prototype.push.apply(a,b)}let l=["no-ignored","no-arg"],{lintConfig:g}=v,{computeEditInfo:p}=g,d=new M(this,e),u=l.map(f=>g.getSeverity(f,"arg"));if(u[0]&&s.length>0&&Array.prototype.push.apply(a,s.map(f=>{let b=j(f,d,l[0],"invisible-triple-braces",u[0]);return b.startIndex--,b.startCol--,p&&(b.suggestions=[O(b),Ge(b.startIndex,"{{!}}")]),b})),u[1]&&!this.getAttribute("include")){let f=F(this,d,l[1],"unexpected-argument",u[1]);p&&i&&(f.suggestions=[me(f,"expand",i.text())]),a.push(f)}let c=this.closest("ext");if(c){let f="arg-in-ext",b=g.getSeverity(f,c.name);b&&a.push(F(this,d,f,"argument-in-ext",b))}return a}}print(){}json(e,r,n=this.getAbsoluteIndex()){}};Ki=B(Rp),Ji=new WeakSet,Fp=function(){},_t=P(Ki,0,"ArgToken",qa,_t),R(Ki,1,_t)});var Ha={};Z(Ha,{parseBraces:()=>on});var Pp,Ma,Qi,Wa,Ua,Da,Ga,za,on,Zn=w(()=>{"use strict";je();le();zi();Pa();_a();Pp={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},Ma=String.raw`\[(?!\[)`,Qi=String.raw`\n(?![=\0])`,Wa=String.raw`|\{{2,}`,Ua=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),Da=Be(o=>new RegExp(o,"gmu"));Ga=new RegExp(String.raw`\{\{((?:[^\n{}[]|${Ma}|${Qi})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${Qi})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${Ma}|${Qi})*\}-`,"gu");za=o=>{let t=ze(re(o));return Ua.has(t)?Ua.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},on=(o,t,e)=>{var f,b,x,k,h;let r=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,[,,,n]=t.parserFunction,i=[],s=[],a=(y,T,A,$)=>{T[T.length-1].push(ke(y.slice(A,$),s))},l;do l!==void 0&&(o=l),l=o.replace(Ga,(y,T,A)=>{if(T!==void 0||typeof A=="string")try{let{length:$}=e,E=(T!=null?T:A).split("|");return new ht(ke(E[0],s),E.slice(1).map(N=>{let H=N.indexOf("=");return(H===-1?[N]:[N.slice(0,H),N.slice(H+1)]).map(q=>ke(q,s))}),t,e),`\0${$}${za(E[0])}`}catch($){if(!($ instanceof SyntaxError)||$.message!=="Invalid template name")throw $}return s.push(ke(y,s)),`\0${s.length-1}`});while(l!==o);o=l;let g=o.lastIndexOf("}}")-o.length,p=g+o.length!==-1,d=Da(r+(p?Wa:"")),u=d.exec(o),c;for(;u||c!==void 0&&c<=o.length&&((b=(f=i[i.length-1])==null?void 0:f[0])!=null&&b.startsWith("="));){if(u!=null&&u[1]){let[,{length:D}]=u;u[0]=u[0].slice(D),u.index+=D}let{0:y,index:T}=u!=null?u:{0:`
13
13
  `,index:o.length},A=(x=i.pop())!=null?x:{},{0:$,index:E,parts:N,findEqual:H,pos:q}=A,X=y==="="&&H;if(y==="]]"||y==="}-")c=T+2;else if(y===`
14
14
  `){c=T+1;let{pos:D,findEqual:U}=(k=i[i.length-1])!=null?k:{};if(D===void 0||U||re(o.slice(D,E))!==""){let xe=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(o.slice(E,T));xe&&(xe[2]=ke(xe[2],s),xe[2].includes(`
15
15
  `)||(o=`${o.slice(0,E)}\0${e.length}h${o.slice(T)}`,c=E+4+String(e.length).length,new Qe(xe[1].length,xe.slice(2),t,e)))}}else if(y==="|"||X)c=T+1,a(o,N,q,T),y==="|"&&N.push([]),A.pos=c,A.findEqual=y==="|",i.push(A);else if(y.startsWith("}}")){let D=y.slice(0,Math.min($.length,3)),U=$.length-D.length,{length:xe}=e;c=T+D.length,a(o,N,q,T);let Yt=!1,bt="t";if(D.length===3){let Y=N.map(Ir=>Ir.join("=")),yt=Y.length>1&&re(Y[1]).trim();new _t(Y,t,e),yt&&yt.endsWith(":")&&n.includes(yt.slice(0,-1).toLowerCase())&&(bt="s")}else try{new ht(N[0][0],N.slice(1),t,e),bt=za(N[0][0])}catch(Y){if(!(Y instanceof SyntaxError&&Y.message==="Invalid template name"))throw Y;Yt=!0}Yt||(o=`${o.slice(0,E+U)}\0${xe}${bt}${o.slice(c)}`,c=E+U+3+String(xe).length,U>1?i.push({0:$.slice(0,U),index:E,pos:E+U,parts:[[]]}):U===1&&o[E-1]==="-"&&i.push({0:"-{",index:E-1,pos:E+1,parts:[[]]}))}else c=T+y.length,y.startsWith("{")&&(u.pos=c,u.parts=[[]]),i.push(..."0"in A?[A]:[],u);let _=i[i.length-1];if(p&&g+o.length<c)for(p=!1;(h=_==null?void 0:_[0])!=null&&h.startsWith("{");)i.pop(),_=i[i.length-1];d=Da(r+(p?Wa:"")+(_?`|${Pp[_[0][0]]}${_.findEqual?"|=":""}`:"")),d.lastIndex=c,u=d.exec(o)}return ke(o,s)}});var Va={};Z(Va,{InputboxToken:()=>Xi});var Xi,Ka=w(()=>{"use strict";en();Zn();Wi();Xi=class extends Zr{constructor(t,e,r,n,i=[]){let s=Symbol("InputboxToken"),a=n.excludes.includes("heading")?n:oe(V({},n),{excludes:[...n.excludes,"heading"]}),{length:l}=i;i.push(s),r&&(r=Pt(r,a,i,e)),r&&(r=on(r,a,i)),i.splice(l,1),super(t,e,r,a,i,{})}}});var ei={};Z(ei,{NestedToken:()=>Yi});var Bp,jp,an,mr,Yi,ti=w(()=>{"use strict";z();ae();en();Zn();W();G();Zi();wt();Bp=new Set(["comment","include","arg","template","magic-word"]),jp=[!1,!0].map(o=>{let t=o?"includeonly":"noinclude";return new RegExp(String.raw`^(?:<${t}(?:\s[^>]*)?/?>|</${t}\s*>)$`,"iu")}),Yi=class extends L{constructor(e,r,n,i,s=[]){if(typeof r=="boolean"){let a=Symbol("NestedToken"),{length:l}=s;s.push(a),e&&(e=Pt(e,i,s,r)),e&&(e=on(e,i,s)),s.splice(l,1)}else e&&(e=e.replace(r,(a,l,g,p,d)=>{let u=`\0${s.length+1}e`;return new Xe(l,g,p,d,i,!1,s),u}));e&&(e=e.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(a,l,g)=>(new pe(g,i,s),`${l}\0${s.length}n`)));super(e,i,s);S(this,an);S(this,mr);C(this,an,[...n]),C(this,mr,r)}get type(){return"ext-inner"}lint(e=this.getAbsoluteIndex(),r){{let n=super.lint(e,r),i="no-ignored",{lintConfig:s}=v,a=s.getSeverity(i,this.name);if(!a)return n;let l=new M(this,e),g=typeof m(this,mr)=="boolean"?jp[m(this,mr)?1:0]:/^<!--[\s\S]*-->$/u;return[...n,...this.childNodes.filter(p=>{let{type:d,name:u}=p;if(d==="ext")return!m(this,an).includes(u);if(Bp.has(d))return!1;let c=p.toString().trim();return c&&!g.test(c)}).map(p=>{let d=j(p,l,i,v.msg("invalid-content",this.name),a);return s.computeEditInfo&&(d.suggestions=[O(d),Bn(d,p.toString())]),d})]}}};an=new WeakMap,mr=new WeakMap});function es(o,t,e,r,n){t=re(t).trim();let i=t.replace(o==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(o){case"width":return!i&&!!t||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(i);case"link":{let s=r==="gallery-image";if(i){if(Op(e.protocol).test(i))return qp(e.protocol).test(i)?t:s;i.startsWith("[[")&&i.endsWith("]]")&&(i=i.slice(2,-2))}else return t;let a=v.normalizeTitle(i,0,!1,e,{halfParsed:n,decode:!0,selfLink:!0,page:""});return a.valid?a:s}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 Op,qp,_p,Mp,Ja,Ne,ri,Qa,ts,Wp,Mt,Xa=w(()=>{"use strict";je();le();z();qr();Se();be();W();G();Op=Be(o=>new RegExp(String.raw`^(?:${o}|//|\0\d+m\x7F)`,"iu")),qp=Be(o=>new RegExp(String.raw`^(?:(?:${o}|//)${Ue}|\0\d+m\x7F)${De}$`,"iu")),_p=Be(o=>new RegExp(String.raw`^(\s*(?!\s))${o.replace("$1","(.*)")}${o.endsWith("$1")?`(?=$|
@@ -2,7 +2,7 @@
2
2
  `,r:"\r",t:" "},zu=new Set([" "," ",`
3
3
  `,"\r"]),pn=o=>o===""?"end of input":o==='"'?`'"'`:JSON.stringify(o),Yo=o=>{let t,e,r,n,i=(b,T,x)=>{T===void 0?b.from=t-1:(b.from=T,b.to=x!=null?x:t-1)},s=(b,T,x)=>{let y={message:b,severity:"warning"};i(y,T,x),n.push(y)},a=(b,T,x)=>{let y={warnings:n,message:b,severity:"error"};throw i(y,T,x),y},l=b=>(b&&b!==e&&a(`Expected ${pn(b)} instead of ${pn(e)}`),e=r.charAt(t),t++,e),g=()=>{let b="",T=t-1;if(e==="-"&&(b="-",l()),e==="0")b+=e,l(),e>="0"&&e<="9"&&a("Bad number");else if(e>="1"&&e<="9")for(;e>="0"&&e<="9";)b+=e,l();else a("No number after minus sign");if(e!=="."&&e!=="e"&&e!=="E"){let y=Number(b);Number.isSafeInteger(y)||s("Not a safe integer",T);return}if(e===".")for(b+=".",l(),(e<"0"||e>"9")&&a("Unterminated fractional number");e>="0"&&e<="9";)b+=e,l();if(e==="e"||e==="E")for(b+=e,l(),(e==="-"||e==="+")&&(b+=e,l());e>="0"&&e<="9";)b+=e,l();let x=Number(b);Number.isFinite(x)||a("Bad number")},u=()=>{let b="";if(e==='"')for(;l();){if(e==='"')return l(),b;let T=t-1;if(e==="\\")if(l(),e==="u"){let x=0,y=0;for(;x<4;x++){let k=parseInt(l(),16);if(!isFinite(k))break;y=y*16+k}x<4&&a("Bad unicode escape",T),b+=String.fromCharCode(y)}else typeof Xo[e]=="string"?b+=Xo[e]:a("Bad escaped character",T,t);else e<" "?a("Bad control character",T,t):b+=e}else a(`Expected '"' instead of ${JSON.stringify(e)}`);return a("Unterminated string")},d=()=>{for(;e;){for(;e&&zu.has(e);)l();if(o&&e==="/"){let b=r.charAt(t);if(b==="/"){for(l(),l();e&&e!==`
4
4
  `&&e!=="\r";)l();continue}else if(b==="*"){for(l(),l();e&&!(e==="*"&&r.charAt(t)==="/");)l();e==="*"&&(l(),l());continue}}break}},p=()=>{switch(e){case"t":l(),l("r"),l("u"),l("e");return;case"f":l(),l("a"),l("l"),l("s"),l("e");return;case"n":l(),l("u"),l("l"),l("l");return;default:a(`Unexpected ${JSON.stringify(e)}`)}},f=()=>{if(l(),d(),e==="]"){l();return}else if(o&&e===","){l(),d(),l("]");return}let b;for(;e;){if(e==="]"){if(o){l();return}a("Trailing comma in array",b,b+1)}if(h(),d(),e==="]"){l();return}else e===","?(b=t-1,l(),d()):a(`Expected "," or "]" instead of ${pn(e)}`)}a("Unterminated array")},c=()=>{let b=new Set;if(l(),d(),e==="}"){l();return}else if(o&&e===","){l(),d(),l("}");return}let T;for(;e;){if(e==="}"){if(o){l();return}a("Trailing comma in object",T,T+1)}T=t;let x=u(),y=t-2;if(d(),l(":"),b.has(x)?s(`Duplicate key ${pn(x)}`,T,y):b.add(x),h(),d(),e==="}"){l();return}else e===","?(T=t-1,l(),d()):a(`Expected "," or "}" instead of ${pn(e)}`)}a(`Expected '"'`)},h=()=>{switch(d(),e){case"":return;case"{":return c();case"[":return f();case'"':return u();case"-":return g();default:return e>="0"&&e<="9"?g():p()}};return b=>{if(r=b,n=[],t=0,e=" ",h(),d(),e)a("Syntax error");else if(n.length>0)throw{warnings:n}}},Zo=Yo(),ea=Yo(!0)});function Be(o){let t=new Map,e=new WeakMap;return r=>{let n=typeof r=="string"?t:e;if(n.has(r)){let s=n.get(r);return s.lastIndex=0,s}let i=o(r);return n.set(r,i),i}}var zt,Gu,ra,Vu,na,ti,Yi,ia,Ku,sa,oa,aa,ri,We=L(()=>{"use strict";ta();zt=o=>decodeURIComponent(o.replace(/%(?![\da-f]{2})/giu,"%25")),Gu=o=>Math.round(o).toString(16).padStart(2,"0"),ra=o=>Gu(o*255),Vu=(()=>{let o=String.raw`#(?:[\da-f]{3,4}|(?:[\da-f]{2}){3,4})(?![\p{L}\p{N}_])`,t=String.raw`(?:\d*\.)?\d+%?`,e=String.raw`(?:\d*\.)?\d+(?:deg|grad|rad|turn)?`,r=String.raw`rgba?\(\s*(?:${String.raw`${Array.from({length:3},()=>t).join(String.raw`\s+`)}(?:\s*\/\s*${t})?`}|${String.raw`${Array.from({length:3},()=>t).join(String.raw`\s*,\s*`)}(?:\s*,\s*${t})?`})\s*\)`,n=String.raw`hsla?\(\s*(?:${String.raw`${e}\s+${t}\s+${t}(?:\s*\/\s*${t})?`}|${String.raw`${e}${String.raw`\s*,\s*(?:\d*\.)?\d+%`.repeat(2)}(?:\s*,\s*${t})?`})\s*\)`;return{full:new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${o}|${r}|${n})`,"giu"),rgb:new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${o}|${r})`,"giu")}})(),na=(o,t=!0)=>{let e=[],r=Vu[t?"full":"rgb"];r.lastIndex=0;let n=r.exec(o),i=0;for(;n;){let s=n.index+n[1].length;s>i&&e.push([o.slice(i,s),i,s,!1]),{lastIndex:i}=r,e.push([n[2],s,i,o[s-1]!=="&"||!/^#\d+$/u.test(n[2])]),n=r.exec(o)}return o.length>i&&e.push([o.slice(i),i,o.length,!1]),e};ti=o=>{let t=[],e=0;for(let r of o.split(`
5
- `)){let n=e+r.length;t.push([r,e,n]),e=n+1}return t},Yi=o=>o&&Number(o[1]),ia=(o,t)=>{var n;let e,r=i=>{e!=null||(e=ti(o));let s=e.findIndex(([,,a])=>i<=a)+1;return{line:s,column:i-e[s-1][1]+1}};for(let i of t){let{line:s,column:a,from:l,to:g}=i;l==null?s?(e!=null||(e=ti(o)),(n=i.column)!=null||(i.column=1),i.from=e[s-1][1]+(i.column-1)):(i.from=0,i.line=1,i.column=1):(!s||!a)&&Object.assign(i,r(l)),g!==void 0&&({line:i.endLine,column:i.endColumn}=r(g)),i.position=i.from}return t},Ku=(o,t)=>{if(t||o.trim())try{JSON.parse(o)}catch(e){let{message:r}=e,n=Yi(/\bline (\d+)/u.exec(r)),i=Yi(/\bcolumn (\d+)/u.exec(r)),s=Yi(/\bposition (\d+)/u.exec(r));return ia(o,[{message:r,line:n,column:i,from:s,severity:"error"}])}return[]},sa=(o,t)=>{try{t(o)}catch(e){if(!(e instanceof Error)){let{warnings:r,...n}=e;return n.message&&r.push(n),ia(o,r)}}return[]},oa=o=>{var e;if(!o.trim())return[];let t=sa(o,Zo);return((e=t[t.length-1])==null?void 0:e.severity)==="error"?t:[...t,...Ku(o)]},aa=o=>o.trim()?sa(o,ea):[],ri=(o,t=/\S|$/u)=>o.search(t)});var cn,Tr,fn,mn,Zi,U,pe=L(()=>{"use strict";U=class{constructor(t,e){w(this,mn);w(this,cn);w(this,Tr);w(this,fn);S(this,cn,t),S(this,Tr,e)}get start(){return m(this,Tr)}get top(){return C(this,mn,Zi).call(this).top}get left(){return C(this,mn,Zi).call(this).left}};cn=new WeakMap,Tr=new WeakMap,fn=new WeakMap,mn=new WeakSet,Zi=function(){var t;return(t=m(this,fn))!=null||S(this,fn,m(this,cn).getRootNode().posFromIndex(m(this,Tr))),m(this,fn)}});var Qu,Ju,kr,vr,la,q,P,ve,Ar,M,ni,je,ii,si,oi,At,st,ai,ze,li,G=L(()=>{"use strict";We();Ae();pe();D();Qu=new Set(["tr","td","th","caption"]),Ju=new Set(["Template:!!","Template:!-"]),kr=o=>{let t=o.childNodes.find(e=>e.text().trim());if(!t||t.type==="text"&&t.data.trim().startsWith("!")||t.is("magic-word")&&t.name==="!"||t.is("template")&&Ju.has(t.name)||t.is("html")&&Qu.has(t.name))return!1;if(t.is("arg"))return t.length>1&&kr(t.childNodes[1]);if(t.is("magic-word"))try{let e=t.getPossibleValues().map(kr);return e.includes(2)?2:e.includes(1)&&1}catch{}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?1:2},vr=(o,t,e,r)=>({line:o+e-1,character:(e===1?t:0)+r}),la=o=>(t,e,r,n,i="error")=>{let{start:s}=e,{top:a,left:l}=e instanceof U?e:new U(t,s),{offsetHeight:g,offsetWidth:u}=t,{startIndex:d,startLine:p,startCol:f}=o(t,s,a,l),{line:c,character:h}=vr(p,f,g,u);return{rule:r,message:v.msg(n),severity:i,startIndex:d,endIndex:d+t.toString().length,startLine:p,endLine:c,startCol:f,endCol:h}},q=la((o,t,e,r)=>{let n=o.getRelativeIndex(),{top:i,left:s}=o.parentNode.posFromIndex(n);return{startIndex:t+n,startLine:e+i,startCol:i?s:r+s}}),P=la((o,t,e,r)=>({startIndex:t,startLine:e,startCol:r})),ve=(o,t,e,r=0)=>({desc:v.msg(t),range:[o.startIndex+r,o.endIndex],text:e}),Ar=(o,t,e)=>({desc:v.msg(t),range:[o,o],text:e}),M=(o,t=0,e="")=>typeof o=="number"?{desc:v.msg("remove"),range:[o,o+t],text:e}:ve(o,"remove",e,t),ni=(o,t)=>ve(o,"decode",zt(t.text().replace(/%(?=21|3[ce]|5[bd]|7[b-d])/giu,"%25"))),je=(o,t,e=0)=>({desc:v.msg("close"),range:[o+e,o],text:t}),ii=o=>({desc:v.msg("open"),range:[o+1,o+2],text:""}),si=(o,t)=>ve(o,"comment",`<!--${t}-->`),oi=(o,t)=>ve(o,"uppercase",t.toUpperCase()),At=(o,t=0)=>({desc:v.msg("whitespace"),range:[o,o+t],text:" "}),st=(o,t,e=1)=>({desc:v.msg("escape"),range:[o,o+e],text:t.repeat(e)}),ai=(o,t)=>({desc:v.msg("escape"),range:[o,o+t.length],text:t.replace(/\|/gu,"&#124;")}),ze=(o,t,e,r)=>{if(o&&(r||v.viewOnly&&o[0]===Q.rev))return o[1];let n=t();return(r||v.viewOnly)&&e([Q.rev,n]),n},li=(o,t)=>o==="ol"&&t==="type"?["1","a","A","i","I"]:o==="th"&&t==="scope"?["row","col","rowgroup","colgroup"]:t==="dir"?["ltr","rtl","auto"]:t==="aria-hidden"?["true","false"]:[]});var ua=Qi((Wp,da)=>{da.exports=function(o,t,e,r,n){var i,s;if(r===void 0)r=0;else if(r=r|0,r<0||r>=o.length)throw new RangeError("invalid lower bound");if(n===void 0)n=o.length-1;else if(n=n|0,n<r||n>=o.length)throw new RangeError("invalid upper bound");for(;r<=n;)if(i=r+(n-r>>>1),s=+e(o[i],t,i,o),s<0)r=i+1;else if(s>0)n=i-1;else return i;return~r}});var ga,pa,ca=L(()=>{"use strict";ga=ju(ua()),pa=(o,t,e)=>{let r=(0,ga.default)(o,t,e);return r<0?~r:r}});var Sr,di=L(()=>{"use strict";G();Sr=(o=!0)=>t=>{let e=new WeakMap;return function(...r){return ze(e.get(this),()=>t.apply(this,r),n=>{e.set(this,n)},o)}}});var fa,ma=L(()=>{"use strict";fa=o=>{class t extends o{get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get offsetHeight(){return this.getDimension().height}get offsetWidth(){return this.getDimension().width}}return t}});var ha,ba,bn,wr,Cr,xn,ot,Lr,hn,Ge,es=L(()=>{"use strict";We();ca();G();Ae();di();ma();D();ba=[fa],ha=[Sr(!1)];Ge=class{constructor(){B(hn,5,this);ge(this,"childNodes",[]);w(this,bn);w(this,wr);w(this,Cr);w(this,xn);w(this,ot);w(this,Lr,{})}get parentNode(){return m(this,bn)}get nextSibling(){return m(this,wr)}get previousSibling(){return m(this,Cr)}getChildNodes(){let{childNodes:t}=this;return Object.isFrozen(t)?[...t]:t}getAttribute(t){return t==="padding"?0:this[t]}setAttribute(t,e){switch(t){case"parentNode":S(this,bn,e),e||(S(this,wr,void 0),S(this,Cr,void 0));break;case"nextSibling":S(this,wr,e);break;case"previousSibling":S(this,Cr,e);break;case"aIndex":v.viewOnly&&S(this,ot,[Q.rev,e]);break;default:this[t]=e}}getRootNode(){return ze(m(this,xn),()=>{var t,e;return(e=(t=this.parentNode)==null?void 0:t.getRootNode())!=null?e:this},t=>{let[,e]=t;e.type==="root"&&S(this,xn,t)})}indexFromPos(t,e){{if(t<0||e<0)return;let r=this.getLines();if(t>=r.length)return;let[,n,i]=r[t],s=n+e;return s>i?void 0:s}}posFromIndex(t){{let{length:e}=String(this);if(t+=t<0?e:0,t>=0&&t<=e){let r=this.getLines(),n=pa(r,t,([,,i],s)=>i-s);return{top:n,left:t-r[n][1]}}return}}getDimension(){{let t=this.getLines(),e=t[t.length-1];return{height:t.length,width:e[2]-e[1]}}}getGaps(t){return 0}getRelativeIndex(t){if(t===void 0){let{parentNode:e}=this;return e?e.getRelativeIndex(e.childNodes.indexOf(this)):0}return ze(m(this,Lr)[t],()=>{var s;let{childNodes:e}=this,r=((s=m(this,ot))==null?void 0:s[0])===Q.rev&&m(this,ot)[1],n=t+(t<0?e.length:0),i=this.getAttribute("padding");for(let a=0;a<n;a++)v.viewOnly&&(m(this,Lr)[a]=[Q.rev,i],r!==!1&&S(e[a],ot,[Q.rev,r+i])),i+=e[a].toString().length+this.getGaps(a);return i},e=>{m(this,Lr)[t]=e})}getAbsoluteIndex(){return ze(m(this,ot),()=>{let{parentNode:t}=this;return t?t.getAbsoluteIndex()+this.getRelativeIndex():0},t=>{S(this,ot,t)})}getBoundingClientRect(){return{...this.getDimension(),...this.getRootNode().posFromIndex(this.getAbsoluteIndex())}}is(t){return this.type===t}getLines(){return ti(String(this))}seal(t,e){{if(v.internal)return;let r=!e&&!!this[t];r||Object.defineProperty(this,t,{enumerable:r,configurable:!0})}}lspError(t){throw new Error(`${t} method is only available in the LSP version!`)}};hn=O(null),bn=new WeakMap,wr=new WeakMap,Cr=new WeakMap,xn=new WeakMap,ot=new WeakMap,Lr=new WeakMap,j(hn,1,"getLines",ha,Ge),Ge=j(hn,0,"AstNode",ba,Ge),B(hn,1,Ge)});var Xu,xa,ya=L(()=>{"use strict";Xu=o=>{if(o.includes("#")){let t=o.indexOf("#"),e=o.slice(0,t),r=o.slice(t+1);return(n,i)=>(t===0||n===e)&&i===r}return t=>t===o},xa=(o,t,e)=>{if(o=o.trim(),!o)return(()=>!0);let r=o.split(",").map(n=>n.trim()).filter(n=>n!=="").map(Xu);return(({type:n,name:i})=>r.some(s=>s(n,i)))}});var Ta,ka=L(()=>{"use strict";ya();Ta=o=>{var e,ui;class t extends o{constructor(){super(...arguments);w(this,e)}closest(s){let a=C(this,e,ui).call(this,s),{parentNode:l}=this;for(;l;){if(a(l))return l;({parentNode:l}=l)}}getElementBy(s){{let a=[...this.childNodes].reverse();for(;a.length>0;){let l=a.pop(),{type:g,childNodes:u}=l;if(g!=="text"){if(s(l))return l;for(let d=u.length-1;d>=0;d--)a.push(u[d])}}return}}querySelector(s){return this.getElementBy(C(this,e,ui).call(this,s))}getElementsBy(s){{let a=[...this.childNodes].reverse(),l=[];for(;a.length>0;){let g=a.pop(),{type:u,childNodes:d}=g;if(u!=="text"){s(g)&&l.push(g);for(let p=d.length-1;p>=0;p--)a.push(d[p])}}return l}}querySelectorAll(s){return this.getElementsBy(C(this,e,ui).call(this,s))}escape(){for(let s of this.childNodes)s.escape()}}return e=new WeakSet,ui=function(s){return xa(s,this)},t}});var va,ts,Yu,Gt,Aa=L(()=>{"use strict";ae();Ae();es();ka();va=[Ta];Gt=class extends(Yu=Ge){get length(){return this.childNodes.length}text(t){return Pe(this.childNodes,t)}removeAt(t){return Vt(this,t,1)[0]}insertAt(t,e=this.length){return Vt(this,e,0,[t]),t}isInside(t){var e;return((e=this.closest(`${t},ext`))==null?void 0:e.type)===t}append(...t){this.safeAppend(t)}safeAppend(t){for(let e of t)this.insertAt(e)}safeReplaceChildren(t){for(let e=this.length-1;e>=0;e--)this.removeAt(e);this.safeAppend([...t])}setText(t,e=0){e+=e<0?this.length:0;let r=this.childNodes[e],{data:n}=r;return r.replaceData(t),n}toString(t,e=""){return this.childNodes.map(r=>r.toString(t)).join(e)}caretPositionFromIndex(t){{if(t===void 0)return;let{length:e}=this.toString();if(t>e||t<-e)return;t+=t<0?e:0;let r=this,n=0,i=0;for(;r.type!=="text";){let{childNodes:s}=r;n+=r.getAttribute("padding");for(let a=0;n<=t&&a<s.length;a++){let l=s[a],{nextSibling:g}=l,u=l.toString(),d=u.length;if(l.setAttribute("aIndex",n),n+=d,n>t||n===t&&d>0&&(!g||g.type==="text"||l.type!=="text"&&(u.trim()||!g.toString().trim()))){r=l,n-=d,i=n;break}n+=r.getGaps(a)}if(r.childNodes===s)return{offsetNode:r,offset:t-i}}return{offsetNode:r,offset:t-i}}this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(t){var e;{let r=(e=this.caretPositionFromIndex(t))==null?void 0:e.offsetNode;return(r==null?void 0:r.type)==="text"?r.parentNode:r}this.lspError("AstElement.elementFromIndex")}elementFromPoint(t,e){return this.elementFromIndex(this.indexFromPos(e,t))}lint(t=this.getAbsoluteIndex(),e){{let r=[];for(let n=0,i=t+this.getAttribute("padding");n<this.length;n++){let s=this.childNodes[n];s.setAttribute("aIndex",i);let a=s.lint(i,e);a.length>0&&Array.prototype.push.apply(r,a),i+=s.toString().length+this.getGaps(n)}return r}}print(t={}){{let e=t.class;return this.toString()?(e===""?"":`<span class="wpb-${e!=null?e:this.type}${this.getAttribute("invalid")?" wpb-invalid":""}">`)+it(this.childNodes,t)+(e===""?"":"</span>"):""}}json(t,e=1/0,r=this.getAbsoluteIndex()){{let n={...this,type:this.type,range:[r,r+this.toString().length],childNodes:[]};if(e>=1)for(let i=0,s=r+this.getAttribute("padding");i<this.length;i++){let a=this.childNodes[i],{length:l}=a.toString();a.setAttribute("aIndex",s),n.childNodes.push(a.type==="text"?{data:a.data,range:[s,s+l]}:a.json(void 0,e-1,s)),s+=l+this.getGaps(i)}return n}}};ts=O(Yu),Gt=j(ts,0,"AstElement",va,Gt),B(ts,1,Gt)});var St,yn=L(()=>{"use strict";St=(o=1)=>t=>{class e extends t{getGaps(){return o}}return e}});var Z,we=L(()=>{"use strict";Z=o=>{{class t extends o{escape(){}}return t}}});var Zu,gi,Sa=L(()=>{"use strict";ae();G();D();V();Zu=new RegExp(`https?://${tt}${rt}$`,"iu"),gi=class extends ${get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){{let{parentNode:t,name:e}=this;return!!(t!=null&&t.isTemplate())&&t.getArgs(e,!1,!1).size>1}}constructor(t,e,r,n=[]){super(void 0,r,n);let i=new $(typeof t=="number"?void 0:t,r,n,{}),s=new $(e,r,n);i.type="parameter-key",i.setAttribute("stage",2),s.type="parameter-value",s.setAttribute("stage",2),this.append(i,s)}trimName(t,e=!0){let r=(typeof t=="string"?t:t.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",r),r}afterBuild(){if(!this.anon){let{parentNode:t,firstChild:e}=this,r=this.trimName(e);t&&t.getArgs(r,!1,!1).add(this)}super.afterBuild()}toString(t){return this.anon?this.lastChild.toString(t):super.toString(t,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(t=this.getAbsoluteIndex(),e){var r;{let n=super.lint(t,e),i="unescaped",{lintConfig:s}=v,a=s.getSeverity(i);if(a){let{firstChild:l}=this,g=(r=Zu.exec(l.text()))==null?void 0:r[0];try{if(g&&new URL(g).search){let u=q(l,{start:t},i,"unescaped-query",a);u.startIndex=u.endIndex,u.startLine=u.endLine,u.startCol=u.endCol,u.endIndex++,u.endCol++,(s.computeEditInfo||s.fix)&&(u.fix=st(u.startIndex,"{{=}}")),n.push(u)}}catch{}}return n}}print(){return super.print({sep:this.anon?"":"="})}json(t,e,r=this.getAbsoluteIndex()){{let n=super.json(void 0,e,r);return Object.assign(n,{anon:this.anon},this.duplicated&&{duplicated:!0}),n}}}});var Er,ce,wt=L(()=>{"use strict";V();ce=class extends ${constructor(e,r,n,i,s){super(e,n,i,s);w(this,Er);S(this,Er,r)}get type(){return m(this,Er)}set type(e){S(this,Er,e)}getAttribute(e){var r;return e==="invalid"?this.type==="converter-flag"&&!!((r=this.parentNode)!=null&&r.isInvalidFlag(this)):super.getAttribute(e)}};Er=new WeakMap});var Tn,ye,Ct=L(()=>{"use strict";V();ye=class extends ${constructor(e,r,n,i,s){super(e,n,i,s);w(this,Tn);S(this,Tn,r)}get type(){return m(this,Tn)}lint(e=this.getAbsoluteIndex()){return super.lint(e,!1)}};Tn=new WeakMap});var La={};re(La,{TranscludeToken:()=>at});var wa,vn,Lt,$r,Kt,An,Nr,lt,kn,Ca,rs,eg,at,ns=L(()=>{"use strict";ae();G();Ae();pe();yn();we();D();V();Sa();wt();Ct();wa=[Z,St()];at=class extends(eg=$){constructor(e,r,n,i=[]){var T,x;let s,a=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(e);a&&(s=Number(a[1]),e=e.replace(`\0${s}h`,i[s].toString().replace(/^\n/u,"")));super(void 0,n,i,{});w(this,lt);ge(this,"modifier","");w(this,vn,"template");w(this,Lt,":");w(this,$r,!1);w(this,Kt,new Map);w(this,An,0);w(this,Nr);let{parserFunction:l,variable:g,functionHook:u}=n,d=(T=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(e))==null?void 0:T[0];if(d)this.setAttribute("modifier",d),e=e.slice(d.length);else if(e.includes(":")){let[y,...k]=e.split(":"),[A]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((x=k[0])!=null?x:"");this.setModifier(`${y}:${A}`)&&(e=k.join(":").slice(A.length))}let p=e.search(/[::]/u),f=e[p]===":",c=p!==-1;if(c||r.length===0&&!m(this,$r)){let y=c?e.slice(0,p):e,k=c&&e.slice(p+1),A=se(y),I=c?A.slice(A.search(/\S/u))+(f?":":""):A.trim(),[,E,N]=Ea(I,l),z=!("functionHook"in n)||u.includes(N),_=g.includes(N);if(c?N&&z:_){this.setAttribute("name",N),S(this,vn,"magic-word"),f&&S(this,Lt,":");let Y=new ye(y,"magic-word-name",n,i);if(super.insertAt(Y),k!==!1&&r.unshift([k]),this.name==="invoke")for(let W=0;W<2;W++){let F=r.shift();if(!F)break;let R=new ce(F.join("="),`invoke-${W?"function":"module"}`,n,i);super.insertAt(R)}}}if(this.type==="template"){let y=se(e).trim();if(!this.normalizeTitle(y,10,{halfParsed:!0,temporary:!0}).valid)throw i.pop(),new SyntaxError("Invalid template name");let k=new ce(e,"template-name",n,i,{});super.insertAt(k)}typeof s=="number"&&(i[s]=void 0);let h=this.isTemplate(),b=1;for(let y=0;y<r.length;y++){let k=r[y];h||this.name==="switch"&&y>0||this.name==="tag"&&y>1||(k[0]=k.join("="),k.length=1),k.length===1&&(k.unshift(b),b++),this.insertAt(new gi(...k,n,i))}this.seal("modifier")}get type(){return m(this,vn)}get module(){return this.type==="magic-word"&&this.name==="invoke"?C(this,lt,kn).call(this).title:void 0}get function(){var e;return this.type==="magic-word"&&this.name==="invoke"?(e=this.childNodes[2])==null?void 0:e.text().trim():void 0}setModifier(e){let[,,r,n]=this.getAttribute("config").parserFunction,i=se(e).trim();if(e&&!i.endsWith(":"))return!1;let s=i.slice(0,-1).toLowerCase(),a=r.includes(s),l=n.includes(s);return(m(this,$r)?a:l||!e)||(Q.running||this.length>1)&&(a||l||!e)?(this.setAttribute("modifier",e),S(this,$r,a),!!e):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0)),super.afterBuild(),this.isTemplate()&&this.type==="template"&&(S(this,Nr,C(this,lt,kn).call(this)),this.setAttribute("name",m(this,Nr).title))}toString(e){let{childNodes:r,length:n,firstChild:i,modifier:s,type:a}=this;return`{{${s}${a==="magic-word"?i.toString(e)+(n===1?"":m(this,Lt))+r.slice(1).map(l=>l.toString(e)).join("|"):super.toString(e,"|")}}}`}text(){let{childNodes:e,length:r,firstChild:n,modifier:i,type:s,name:a}=this;return s==="magic-word"&&a==="vardefine"?"":`{{${i}${s==="magic-word"?n.text()+(r===1?"":m(this,Lt))+Pe(e.slice(1),"|"):super.text("|")}}}`}getAttribute(e){switch(e){case"padding":return this.modifier.length+2;case"title":return m(this,Nr);case"colon":return m(this,Lt);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!C(this,lt,kn).call(this).valid);default:return super.getAttribute(e)}}lint(e=this.getAbsoluteIndex(),r){{let n=super.lint(e,r);if(!this.isTemplate())return n;let{type:i,childNodes:s,length:a}=this,l=new U(this,e),{lintConfig:g}=v,{computeEditInfo:u}=g,d=i==="magic-word",p="no-ignored",f=g.getSeverity(p,"fragment");if(d&&!C(this,lt,kn).call(this).valid)p="invalid-invoke",f=g.getSeverity(p,"name"),f&&n.push(q(s[1],l,p,"illegal-module",f));else if(f){let c=s[d?1:0],h=c.childNodes.findIndex(T=>T.type==="text"&&Ut(T.data).includes("#")),b=c.childNodes[h];if(b){let T=q(c,l,p,"useless-fragment",f);u&&(T.suggestions=[M(T,c.getRelativeIndex(h)+b.data.indexOf("#"))]),n.push(T)}}if(p="invalid-invoke",f=g.getSeverity(p,"function"),f&&d&&a===2)return n.push(P(this,l,p,"missing-function",f)),n;if(p="no-duplicate",f=g.getSeverity(p,"parameter"),f){let c=this.getDuplicatedArgs().filter(([,b])=>!b[0].querySelector("ext")),h="duplicate-parameter";for(let[,b]of c)Array.prototype.push.apply(n,b.map(T=>{let x=q(T,l,p,h,f);return u&&(x.suggestions=[M(x,-1)]),x}))}return n}}insertAt(e,r=this.length){return super.insertAt(e,r),e.anon?C(this,lt,Ca).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getArgs(e,r,n=!0,i=!0){let s=String(e).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),a;return m(this,Kt).has(s)?a=m(this,Kt).get(s):(a=new Set,m(this,Kt).set(s,a)),a}getDuplicatedArgs(){return[...m(this,Kt)].filter(([,{size:e}])=>e>1).map(([e,r])=>[e,[...r]])}getPossibleValues(){let{type:e,name:r,childNodes:n}=this;if(e==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let i,s;switch(r){case"if":case"ifexist":case"ifexpr":case"iferror":i=2;break;case"ifeq":i=3;break;case"switch":{let a=n.slice(2),l=a[a.length-1];s=[...a.filter(({anon:g})=>!g),...l!=null&&l.anon?[l]:[]].map(({lastChild:g})=>g);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}s!=null||(s=n.slice(i,i+2).map(({lastChild:a})=>a));for(let a=0;a<s.length;){let{length:l,0:g}=s[a].childNodes.filter(u=>u.text().trim());if(l===0)s.splice(a,1);else if(l>1||!g.is("magic-word"))a++;else try{let u=g.getPossibleValues();Array.prototype.splice.apply(s,[a,1,...u]),a+=u.length}catch{a++}}return s}print(){{let{childNodes:e,length:r,firstChild:n,modifier:i,type:s}=this;return`<span class="wpb-${s}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${s==="magic-word"?Ht(i)+n.print()+(r===1?"":m(this,Lt))+it(e.slice(1),{sep:"|"}):(i?`<span class="wpb-magic-word">${Ht(i)}</span>`:"")+it(e,{sep:"|"})}}}</span>`}}};rs=O(eg),vn=new WeakMap,Lt=new WeakMap,$r=new WeakMap,Kt=new WeakMap,An=new WeakMap,Nr=new WeakMap,lt=new WeakSet,kn=function(){let e=this.type==="template";return this.normalizeTitle((e?"":"Module:")+se(this.childNodes[e?0:1].text()),10,{temporary:!0,...!e&&{page:""}})},Ca=function(e,r){S(this,An,m(this,An)+1);let n;n=m(this,An)-1;let i=e,s=String(n+1);i.setAttribute("name",s),this.getArgs(s,!1,!1).add(i)},at=j(rs,0,"TranscludeToken",wa,at),B(rs,1,at)});var is,Na,tg,rg,ng,ig,$a,sg,wn,ss,os,Sn,Ia=L(()=>{"use strict";ae();G();Ae();D();es();is=String.raw`[${_e}\t]*`,Na=String.raw`<(?:/[^\S\n]*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|\n={2,}`,tg=new RegExp(String.raw`${Na}|\bhttps?[:/]/+|\b(?:rfc|pmid)(?=[-::]?${is}\d)|\bisbn(?=[-::]?${is}(?:\d(?:${is}|-)){6})`,"giu"),rg=new RegExp(Na,"giu"),ng=new Set(["attr-value","ext-link-text","link-text"]),ig={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},$a=new Set(["html","head","style","title","body","a","audio","img","video","embed","iframe","object","canvas","script","col","colgroup","tbody","tfoot","thead","button","input","label","option","select","textarea"]),sg=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch{return/\w/u}})(),os=class os extends Ge{constructor(e){super();w(this,wn);ge(this,"data","");this.data=e}get type(){return"text"}toString(e){var r;return e&&!((r=this.parentNode)!=null&&r.getAttribute("built"))?se(this.data):this.data}text(){return this.data}lint(e=this.getAbsoluteIndex(),r){var n,i,s;{if(r===!1)return[];let{data:a,parentNode:l,nextSibling:g,previousSibling:u}=this;if(!l)throw new Error("An isolated text node cannot be linted!");let{type:d,parentNode:p}=l;if(d==="attr-value"){let{name:W,tag:F}=p;if(F==="ref"&&(W==="name"||W==="follow")||W==="group"&&(F==="ref"||F==="references")||F==="choose"&&(W==="before"||W==="after"))return[]}if(r!=null||(r=l.isPlain()&&!ng.has(d)?tg:rg),a.search(r)===-1)return[];r.lastIndex=0;let f=[],c=g==null?void 0:g.type,h=g==null?void 0:g.name,b=u==null?void 0:u.type,T=this.getRootNode(),x=T.toString(),{ext:y,html:k,variants:A}=T.getAttribute("config"),{top:I,left:E}=T.posFromIndex(e),{lintConfig:N}=v,z=N.rules["tag-like"],_=z[1]?new Set(Object.keys(z[1]).filter(W=>W!=="invalid"&&W!=="disallowed")):new Set,Y=new Set(["onlyinclude","noinclude","includeonly",...y,...k[0],...k[1],...k[2],..._,...N.getSeverity("tag-like","disallowed")?$a:[]]);for(let W=r.exec(a);W;W=r.exec(a)){let{index:F,0:R}=W,[,ee,oe]=W,xe=R==="["&&d==="ext-link-text";if(oe&&oe!=="]"){let{length:ue}=oe;F+=ue,R=R.slice(ue)}else{if(R.startsWith("<")&&!Y.has(ee.toLowerCase())||xe&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(a.slice(F+1))||g!=null&&g.is("ext")&&h==="nowiki"&&((n=g.innerText)!=null&&n.includes("]"))))continue;R.startsWith(`
5
+ `)){let n=e+r.length;t.push([r,e,n]),e=n+1}return t},Yi=o=>o&&Number(o[1]),ia=(o,t)=>{var n;let e,r=i=>{e!=null||(e=ti(o));let s=e.findIndex(([,,a])=>i<=a)+1;return{line:s,column:i-e[s-1][1]+1}};for(let i of t){let{line:s,column:a,from:l,to:g}=i;l==null?s?(e!=null||(e=ti(o)),(n=i.column)!=null||(i.column=1),i.from=e[s-1][1]+(i.column-1)):(i.from=0,i.line=1,i.column=1):(!s||!a)&&Object.assign(i,r(l)),g!==void 0&&({line:i.endLine,column:i.endColumn}=r(g)),i.position=i.from}return t},Ku=(o,t)=>{if(t||o.trim())try{JSON.parse(o)}catch(e){let{message:r}=e,n=Yi(/\bline (\d+)/u.exec(r)),i=Yi(/\bcolumn (\d+)/u.exec(r)),s=Yi(/\bposition (\d+)/u.exec(r));return ia(o,[{message:r,line:n,column:i,from:s,severity:"error"}])}return[]},sa=(o,t)=>{try{t(o)}catch(e){if(!(e instanceof Error)){let{warnings:r,...n}=e;return n.message&&r.push(n),ia(o,r)}}return[]},oa=o=>{var e;if(!o.trim())return[];let t=sa(o,Zo);return((e=t[t.length-1])==null?void 0:e.severity)==="error"?t:[...t,...Ku(o)]},aa=o=>o.trim()?sa(o,ea):[],ri=(o,t=/\S|$/u)=>o.search(t)});var cn,Tr,fn,mn,Zi,U,pe=L(()=>{"use strict";U=class{constructor(t,e){w(this,mn);w(this,cn);w(this,Tr);w(this,fn);S(this,cn,t),S(this,Tr,e)}get start(){return m(this,Tr)}get top(){return C(this,mn,Zi).call(this).top}get left(){return C(this,mn,Zi).call(this).left}};cn=new WeakMap,Tr=new WeakMap,fn=new WeakMap,mn=new WeakSet,Zi=function(){var t;return(t=m(this,fn))!=null||S(this,fn,m(this,cn).getRootNode().posFromIndex(m(this,Tr))),m(this,fn)}});var Qu,Ju,kr,vr,la,q,P,ve,Ar,M,ni,je,ii,si,oi,At,st,ai,ze,li,G=L(()=>{"use strict";We();Ae();pe();D();Qu=new Set(["tr","td","th","caption"]),Ju=new Set(["Template:!!","Template:!-"]),kr=o=>{let t=o.childNodes.find(e=>e.text().trim());if(!t||t.type==="text"&&t.data.trim().startsWith("!")||t.is("magic-word")&&t.name==="!"||t.is("template")&&Ju.has(t.name)||t.is("html")&&Qu.has(t.name))return!1;if(t.is("arg"))return t.length>1&&kr(t.childNodes[1]);if(t.is("magic-word"))try{let e=t.getPossibleValues().map(kr);return e.includes(2)?2:e.includes(1)&&1}catch{}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?1:2},vr=(o,t,e,r)=>({line:o+e-1,character:(e===1?t:0)+r}),la=o=>(t,e,r,n,i="error")=>{let{start:s}=e,{top:a,left:l}=e instanceof U?e:new U(t,s),{offsetHeight:g,offsetWidth:u}=t,{startIndex:d,startLine:p,startCol:f}=o(t,s,a,l),{line:c,character:h}=vr(p,f,g,u);return{rule:r,message:v.msg(n),severity:i,startIndex:d,endIndex:d+t.toString().length,startLine:p,endLine:c,startCol:f,endCol:h}},q=la((o,t,e,r)=>{let n=o.getRelativeIndex(),{top:i,left:s}=o.parentNode.posFromIndex(n);return{startIndex:t+n,startLine:e+i,startCol:i?s:r+s}}),P=la((o,t,e,r)=>({startIndex:t,startLine:e,startCol:r})),ve=(o,t,e,r=0)=>({desc:v.msg(t),range:[o.startIndex+r,o.endIndex],text:e}),Ar=(o,t,e)=>({desc:v.msg(t),range:[o,o],text:e}),M=(o,t=0,e="")=>typeof o=="number"?{desc:v.msg("remove"),range:[o,o+t],text:e}:ve(o,"remove",e,t),ni=(o,t)=>ve(o,"decode",zt(t.text().replace(/%(?=21|3[ce]|5[bd]|7[b-d])/giu,"%25"))),je=(o,t,e=0)=>({desc:v.msg("close"),range:[o+e,o],text:t}),ii=o=>({desc:v.msg("open"),range:[o+1,o+2],text:""}),si=(o,t)=>ve(o,"comment",`<!--${t}-->`),oi=(o,t)=>ve(o,"uppercase",t.toUpperCase()),At=(o,t=0)=>({desc:v.msg("whitespace"),range:[o,o+t],text:" "}),st=(o,t,e=1)=>({desc:v.msg("escape"),range:[o,o+e],text:t.repeat(e)}),ai=(o,t)=>({desc:v.msg("escape"),range:[o,o+t.length],text:t.replace(/\|/gu,"&#124;")}),ze=(o,t,e,r)=>{if(o&&(r||v.viewOnly&&o[0]===Q.rev))return o[1];let n=t();return(r||v.viewOnly)&&e([Q.rev,n]),n},li=(o,t)=>o==="ol"&&t==="type"?["1","a","A","i","I"]:o==="th"&&t==="scope"?["row","col","rowgroup","colgroup"]:t==="dir"?["ltr","rtl","auto"]:t==="aria-hidden"?["true","false"]:[]});var ua=Qi((Wp,da)=>{da.exports=function(o,t,e,r,n){var i,s;if(r===void 0)r=0;else if(r=r|0,r<0||r>=o.length)throw new RangeError("invalid lower bound");if(n===void 0)n=o.length-1;else if(n=n|0,n<r||n>=o.length)throw new RangeError("invalid upper bound");for(;r<=n;)if(i=r+(n-r>>>1),s=+e(o[i],t,i,o),s<0)r=i+1;else if(s>0)n=i-1;else return i;return~r}});var ga,pa,ca=L(()=>{"use strict";ga=ju(ua()),pa=(o,t,e)=>{let r=(0,ga.default)(o,t,e);return r<0?~r:r}});var Sr,di=L(()=>{"use strict";G();Sr=(o=!0)=>t=>{let e=new WeakMap;return function(...r){return ze(e.get(this),()=>t.apply(this,r),n=>{e.set(this,n)},o)}}});var fa,ma=L(()=>{"use strict";fa=o=>{class t extends o{get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get offsetHeight(){return this.getDimension().height}get offsetWidth(){return this.getDimension().width}}return t}});var ha,ba,bn,wr,Cr,xn,ot,Lr,hn,Ge,es=L(()=>{"use strict";We();ca();G();Ae();di();ma();D();ba=[fa],ha=[Sr(!1)];Ge=class{constructor(){B(hn,5,this);ge(this,"childNodes",[]);w(this,bn);w(this,wr);w(this,Cr);w(this,xn);w(this,ot);w(this,Lr,{})}get parentNode(){return m(this,bn)}get nextSibling(){return m(this,wr)}get previousSibling(){return m(this,Cr)}getChildNodes(){let{childNodes:t}=this;return Object.isFrozen(t)?[...t]:t}getAttribute(t){return t==="padding"?0:this[t]}setAttribute(t,e){switch(t){case"parentNode":S(this,bn,e),e||(S(this,wr,void 0),S(this,Cr,void 0));break;case"nextSibling":S(this,wr,e);break;case"previousSibling":S(this,Cr,e);break;case"aIndex":v.viewOnly&&S(this,ot,[Q.rev,e]);break;default:this[t]=e}}getRootNode(){return ze(m(this,xn),()=>{var t,e;return(e=(t=this.parentNode)==null?void 0:t.getRootNode())!=null?e:this},t=>{let[,e]=t;e.type==="root"&&S(this,xn,t)})}indexFromPos(t,e){{if(t<0||e<0)return;let r=this.getLines();if(t>=r.length)return;let[,n,i]=r[t],s=n+e;return s>i?void 0:s}}posFromIndex(t){{let{length:e}=String(this);if(t+=t<0?e:0,t>=0&&t<=e){let r=this.getLines(),n=pa(r,t,([,,i],s)=>i-s);return{top:n,left:t-r[n][1]}}return}}getDimension(){{let t=this.getLines(),e=t[t.length-1];return{height:t.length,width:e[2]-e[1]}}}getGaps(t){return 0}getRelativeIndex(t){if(t===void 0){let{parentNode:e}=this;return e?e.getRelativeIndex(e.childNodes.indexOf(this)):0}return ze(m(this,Lr)[t],()=>{var s;let{childNodes:e}=this,r=((s=m(this,ot))==null?void 0:s[0])===Q.rev&&m(this,ot)[1],n=t+(t<0?e.length:0),i=this.getAttribute("padding");for(let a=0;a<n;a++)v.viewOnly&&(m(this,Lr)[a]=[Q.rev,i],r!==!1&&S(e[a],ot,[Q.rev,r+i])),i+=e[a].toString().length+this.getGaps(a);return i},e=>{m(this,Lr)[t]=e})}getAbsoluteIndex(){return ze(m(this,ot),()=>{let{parentNode:t}=this;return t?t.getAbsoluteIndex()+this.getRelativeIndex():0},t=>{S(this,ot,t)})}getBoundingClientRect(){return{...this.getDimension(),...this.getRootNode().posFromIndex(this.getAbsoluteIndex())}}is(t){return this.type===t}getLines(){return ti(String(this))}seal(t,e){{if(v.internal)return;let r=!e&&!!this[t];r||Object.defineProperty(this,t,{enumerable:r,configurable:!0})}}lspError(t){throw new Error(`${t} method is only available in the LSP version!`)}};hn=O(null),bn=new WeakMap,wr=new WeakMap,Cr=new WeakMap,xn=new WeakMap,ot=new WeakMap,Lr=new WeakMap,j(hn,1,"getLines",ha,Ge),Ge=j(hn,0,"AstNode",ba,Ge),B(hn,1,Ge)});var Xu,xa,ya=L(()=>{"use strict";Xu=o=>{if(o.includes("#")){let t=o.indexOf("#"),e=o.slice(0,t),r=o.slice(t+1);return(n,i)=>(t===0||n===e)&&i===r}return t=>t===o},xa=(o,t,e)=>{if(o=o.trim(),!o)return(()=>!0);let r=o.split(",").map(n=>n.trim()).filter(n=>n!=="").map(Xu);return(({type:n,name:i})=>r.some(s=>s(n,i)))}});var Ta,ka=L(()=>{"use strict";ya();Ta=o=>{var e,ui;class t extends o{constructor(){super(...arguments);w(this,e)}closest(s){let a=C(this,e,ui).call(this,s),{parentNode:l}=this;for(;l;){if(a(l))return l;({parentNode:l}=l)}}getElementBy(s){{let a=[...this.childNodes].reverse();for(;a.length>0;){let l=a.pop(),{type:g,childNodes:u}=l;if(g!=="text"){if(s(l))return l;for(let d=u.length-1;d>=0;d--)a.push(u[d])}}return}}querySelector(s){return this.getElementBy(C(this,e,ui).call(this,s))}getElementsBy(s){{let a=[...this.childNodes].reverse(),l=[];for(;a.length>0;){let g=a.pop(),{type:u,childNodes:d}=g;if(u!=="text"){s(g)&&l.push(g);for(let p=d.length-1;p>=0;p--)a.push(d[p])}}return l}}querySelectorAll(s){return this.getElementsBy(C(this,e,ui).call(this,s))}escape(){for(let s of this.childNodes)s.escape()}}return e=new WeakSet,ui=function(s){return xa(s,this)},t}});var va,ts,Yu,Gt,Aa=L(()=>{"use strict";ae();Ae();es();ka();va=[Ta];Gt=class extends(Yu=Ge){get length(){return this.childNodes.length}text(t){return Pe(this.childNodes,t)}removeAt(t){return Vt(this,t,1)[0]}insertAt(t,e=this.length){return Vt(this,e,0,[t]),t}isInside(t){var e;return((e=this.closest(`${t},ext`))==null?void 0:e.type)===t}append(...t){this.safeAppend(t)}safeAppend(t){for(let e of t)this.insertAt(e)}safeReplaceChildren(t){for(let e=this.length-1;e>=0;e--)this.removeAt(e);this.safeAppend([...t])}setText(t,e=0){e+=e<0?this.length:0;let r=this.childNodes[e],{data:n}=r;return r.replaceData(t),n}toString(t,e=""){return this.childNodes.map(r=>r.toString(t)).join(e)}caretPositionFromIndex(t){{if(t===void 0)return;let{length:e}=this.toString();if(t>e||t<-e)return;t+=t<0?e:0;let r=this,n=0,i=0;for(;r.type!=="text";){let{childNodes:s}=r;n+=r.getAttribute("padding");for(let a=0;n<=t&&a<s.length;a++){let l=s[a],{nextSibling:g}=l,u=l.toString(),d=u.length;if(l.setAttribute("aIndex",n),n+=d,n>t||n===t&&d>0&&(!g||g.type==="text"||l.type!=="text"&&(u.trim()||!g.toString().trim()))){r=l,n-=d,i=n;break}n+=r.getGaps(a)}if(r.childNodes===s)return{offsetNode:r,offset:t-i}}return{offsetNode:r,offset:t-i}}this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(t){var e;{let r=(e=this.caretPositionFromIndex(t))==null?void 0:e.offsetNode;return(r==null?void 0:r.type)==="text"?r.parentNode:r}this.lspError("AstElement.elementFromIndex")}elementFromPoint(t,e){return this.elementFromIndex(this.indexFromPos(e,t))}lint(t=this.getAbsoluteIndex(),e){{let r=[];for(let n=0,i=t+this.getAttribute("padding");n<this.length;n++){let s=this.childNodes[n];s.setAttribute("aIndex",i);let a=s.lint(i,e);a.length>0&&Array.prototype.push.apply(r,a),i+=s.toString().length+this.getGaps(n)}return r}}print(t={}){{let e=t.class;return this.toString()?(e===""?"":`<span class="wpb-${e!=null?e:this.type}${this.getAttribute("invalid")?" wpb-invalid":""}">`)+it(this.childNodes,t)+(e===""?"":"</span>"):""}}json(t,e=1/0,r=this.getAbsoluteIndex()){{let n={...this,type:this.type,range:[r,r+this.toString().length],childNodes:[]};if(e>=1)for(let i=0,s=r+this.getAttribute("padding");i<this.length;i++){let a=this.childNodes[i],{length:l}=a.toString();a.setAttribute("aIndex",s),n.childNodes.push(a.type==="text"?{data:a.data,range:[s,s+l]}:a.json(void 0,e-1,s)),s+=l+this.getGaps(i)}return n}}};ts=O(Yu),Gt=j(ts,0,"AstElement",va,Gt),B(ts,1,Gt)});var St,yn=L(()=>{"use strict";St=(o=1)=>t=>{class e extends t{getGaps(){return o}}return e}});var Z,we=L(()=>{"use strict";Z=o=>{{class t extends o{escape(){}}return t}}});var Zu,gi,Sa=L(()=>{"use strict";ae();G();D();V();Zu=new RegExp(`https?://${tt}${rt}$`,"iu"),gi=class extends ${get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){{let{parentNode:t,name:e}=this;return!!(t!=null&&t.isTemplate())&&t.getArgs(e,!1,!1).size>1}}constructor(t,e,r,n=[]){super(void 0,r,n);let i=new $(typeof t=="number"?void 0:t,r,n,{}),s=new $(e,r,n);i.type="parameter-key",i.setAttribute("stage",2),s.type="parameter-value",s.setAttribute("stage",2),this.append(i,s)}trimName(t,e=!0){let r=(typeof t=="string"?t:t.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",r),r}afterBuild(){if(!this.anon){let{parentNode:t,firstChild:e}=this,r=this.trimName(e);t&&t.getArgs(r,!1,!1).add(this)}super.afterBuild()}toString(t){return this.anon?this.lastChild.toString(t):super.toString(t,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(t=this.getAbsoluteIndex(),e){var r;{let n=super.lint(t,e),i="unescaped",{lintConfig:s}=v,a=s.getSeverity(i);if(a){let{firstChild:l}=this,g=(r=Zu.exec(l.text()))==null?void 0:r[0];try{if(g&&new URL(g).search){let u=q(l,{start:t},i,"unescaped-query",a);u.startIndex=u.endIndex,u.startLine=u.endLine,u.startCol=u.endCol,u.endIndex++,u.endCol++,(s.computeEditInfo||s.fix)&&(u.fix=st(u.startIndex,"{{=}}")),n.push(u)}}catch{}}return n}}print(){return super.print({sep:this.anon?"":"="})}json(t,e,r=this.getAbsoluteIndex()){{let n=super.json(void 0,e,r);return Object.assign(n,{anon:this.anon},this.duplicated&&{duplicated:!0}),n}}}});var Er,ce,wt=L(()=>{"use strict";V();ce=class extends ${constructor(e,r,n,i,s){super(e,n,i,s);w(this,Er);S(this,Er,r)}get type(){return m(this,Er)}set type(e){S(this,Er,e)}getAttribute(e){var r;return e==="invalid"?this.type==="converter-flag"&&!!((r=this.parentNode)!=null&&r.isInvalidFlag(this)):super.getAttribute(e)}};Er=new WeakMap});var Tn,ye,Ct=L(()=>{"use strict";V();ye=class extends ${constructor(e,r,n,i,s){super(e,n,i,s);w(this,Tn);S(this,Tn,r)}get type(){return m(this,Tn)}lint(e=this.getAbsoluteIndex()){return super.lint(e,!1)}};Tn=new WeakMap});var La={};re(La,{TranscludeToken:()=>at});var wa,vn,Lt,$r,Kt,An,Nr,lt,kn,Ca,rs,eg,at,ns=L(()=>{"use strict";ae();G();Ae();pe();yn();we();D();V();Sa();wt();Ct();wa=[Z,St()];at=class extends(eg=$){constructor(e,r,n,i=[]){var T,x;let s,a=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(e);a&&(s=Number(a[1]),e=e.replace(`\0${s}h`,i[s].toString().replace(/^\n/u,"")));super(void 0,n,i,{});w(this,lt);ge(this,"modifier","");w(this,vn,"template");w(this,Lt,":");w(this,$r,!1);w(this,Kt,new Map);w(this,An,0);w(this,Nr);let{parserFunction:l,variable:g,functionHook:u}=n,d=(T=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(e))==null?void 0:T[0];if(d)this.setAttribute("modifier",d),e=e.slice(d.length);else if(e.includes(":")){let[y,...k]=e.split(":"),[A]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((x=k[0])!=null?x:"");this.setModifier(`${y}:${A}`)&&(e=k.join(":").slice(A.length))}let p=e.search(/[::]/u),f=e[p]===":",c=p!==-1;if(c||r.length===0&&!m(this,$r)){let y=c?e.slice(0,p):e,k=c&&e.slice(p+1),A=se(y),I=c?A.slice(A.search(/\S/u))+(f?":":""):A.trim(),[,E,N]=Ea(I,l),z=!("functionHook"in n)||u.includes(N),_=g.includes(N);if(c?N&&z:_){this.setAttribute("name",N),S(this,vn,"magic-word"),f&&S(this,Lt,":");let Y=new ye(y,"magic-word-name",n,i);if(super.insertAt(Y),k!==!1&&r.unshift([k]),this.name==="invoke")for(let W=0;W<2;W++){let F=r.shift();if(!F)break;let R=new ce(F.join("="),`invoke-${W?"function":"module"}`,n,i);super.insertAt(R)}}}if(this.type==="template"){let y=se(e).trim();if(!this.normalizeTitle(y,10,{halfParsed:!0,temporary:!0}).valid)throw i.pop(),new SyntaxError("Invalid template name");let k=new ce(e,"template-name",n,i,{});super.insertAt(k)}typeof s=="number"&&(i[s]=void 0);let h=this.isTemplate(),b=1;for(let y=0;y<r.length;y++){let k=r[y];h||this.name==="switch"&&y>0||this.name==="tag"&&y>1||(k[0]=k.join("="),k.length=1),k.length===1&&(k.unshift(b),b++),this.insertAt(new gi(...k,n,i))}this.seal("modifier")}get type(){return m(this,vn)}get module(){return this.type==="magic-word"&&this.name==="invoke"?C(this,lt,kn).call(this).title:void 0}get function(){var e;return this.type==="magic-word"&&this.name==="invoke"?(e=this.childNodes[2])==null?void 0:e.text().trim():void 0}setModifier(e){let[,,r,n]=this.getAttribute("config").parserFunction,i=se(e).trim();if(e&&!i.endsWith(":"))return!1;let s=i.slice(0,-1).toLowerCase(),a=r.includes(s),l=n.includes(s);return(m(this,$r)?a:l||!e)||(Q.running||this.length>1)&&(a||l||!e)?(this.setAttribute("modifier",e),S(this,$r,a),!!e):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0)),super.afterBuild(),this.isTemplate()&&this.type==="template"&&(S(this,Nr,C(this,lt,kn).call(this)),this.setAttribute("name",m(this,Nr).title))}toString(e){let{childNodes:r,length:n,firstChild:i,modifier:s,type:a}=this;return`{{${s}${a==="magic-word"?i.toString(e)+(n===1?"":m(this,Lt))+r.slice(1).map(l=>l.toString(e)).join("|"):super.toString(e,"|")}}}`}text(){let{childNodes:e,length:r,firstChild:n,modifier:i,type:s,name:a}=this;return s==="magic-word"&&a==="vardefine"?"":`{{${i}${s==="magic-word"?n.text()+(r===1?"":m(this,Lt))+Pe(e.slice(1),"|"):super.text("|")}}}`}getAttribute(e){switch(e){case"padding":return this.modifier.length+2;case"title":return m(this,Nr);case"colon":return m(this,Lt);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!C(this,lt,kn).call(this).valid);default:return super.getAttribute(e)}}lint(e=this.getAbsoluteIndex(),r){{let n=super.lint(e,r);if(!this.isTemplate())return n;let{type:i,childNodes:s,length:a}=this,l=new U(this,e),{lintConfig:g}=v,{computeEditInfo:u}=g,d=i==="magic-word",p="no-ignored",f=g.getSeverity(p,"fragment");if(d&&!C(this,lt,kn).call(this).valid)p="invalid-invoke",f=g.getSeverity(p,"name"),f&&n.push(q(s[1],l,p,"illegal-module",f));else if(f){let c=s[d?1:0],h=c.childNodes.findIndex(T=>T.type==="text"&&Ut(T.data).includes("#")),b=c.childNodes[h];if(b){let T=q(c,l,p,"useless-fragment",f);u&&(T.suggestions=[M(T,c.getRelativeIndex(h)+b.data.indexOf("#"))]),n.push(T)}}if(p="invalid-invoke",f=g.getSeverity(p,"function"),f&&d&&a===2)return n.push(P(this,l,p,"missing-function",f)),n;if(p="no-duplicate",f=g.getSeverity(p,"parameter"),f){let c=this.getDuplicatedArgs().filter(([,b])=>!b[0].querySelector("ext")),h="duplicate-parameter";for(let[,b]of c)Array.prototype.push.apply(n,b.map(T=>{let x=q(T,l,p,h,f);return u&&(x.suggestions=[M(x,-1)]),x}))}return n}}insertAt(e,r=this.length){return super.insertAt(e,r),e.anon?C(this,lt,Ca).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getArgs(e,r,n=!0,i=!0){let s=String(e).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),a;return m(this,Kt).has(s)?a=m(this,Kt).get(s):(a=new Set,m(this,Kt).set(s,a)),a}getDuplicatedArgs(){return[...m(this,Kt)].filter(([,{size:e}])=>e>1).map(([e,r])=>[e,[...r]])}getPossibleValues(){let{type:e,name:r,childNodes:n,length:i}=this;if(e==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let s,a;switch(r){case"if":case"ifexist":case"ifexpr":s=2;break;case"ifeq":s=3;break;case"iferror":s=i>3?2:1;break;case"switch":{let l=n.slice(2),g=l[l.length-1];a=[...l.filter(({anon:u})=>!u),...g!=null&&g.anon?[g]:[]].map(({lastChild:u})=>u);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}a!=null||(a=n.slice(s,s+2).map(({lastChild:l})=>l));for(let l=0;l<a.length;){let{length:g,0:u}=a[l].childNodes.filter(d=>d.text().trim());if(g===0)a.splice(l,1);else if(g>1||!u.is("magic-word"))l++;else try{let d=u.getPossibleValues();Array.prototype.splice.apply(a,[l,1,...d]),l+=d.length}catch{l++}}return a}print(){{let{childNodes:e,length:r,firstChild:n,modifier:i,type:s}=this;return`<span class="wpb-${s}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${s==="magic-word"?Ht(i)+n.print()+(r===1?"":m(this,Lt))+it(e.slice(1),{sep:"|"}):(i?`<span class="wpb-magic-word">${Ht(i)}</span>`:"")+it(e,{sep:"|"})}}}</span>`}}};rs=O(eg),vn=new WeakMap,Lt=new WeakMap,$r=new WeakMap,Kt=new WeakMap,An=new WeakMap,Nr=new WeakMap,lt=new WeakSet,kn=function(){let e=this.type==="template";return this.normalizeTitle((e?"":"Module:")+se(this.childNodes[e?0:1].text()),10,{temporary:!0,...!e&&{page:""}})},Ca=function(e,r){S(this,An,m(this,An)+1);let n;n=m(this,An)-1;let i=e,s=String(n+1);i.setAttribute("name",s),this.getArgs(s,!1,!1).add(i)},at=j(rs,0,"TranscludeToken",wa,at),B(rs,1,at)});var is,Na,tg,rg,ng,ig,$a,sg,wn,ss,os,Sn,Ia=L(()=>{"use strict";ae();G();Ae();D();es();is=String.raw`[${_e}\t]*`,Na=String.raw`<(?:/[^\S\n]*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|\n={2,}`,tg=new RegExp(String.raw`${Na}|\bhttps?[:/]/+|\b(?:rfc|pmid)(?=[-::]?${is}\d)|\bisbn(?=[-::]?${is}(?:\d(?:${is}|-)){6})`,"giu"),rg=new RegExp(Na,"giu"),ng=new Set(["attr-value","ext-link-text","link-text"]),ig={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},$a=new Set(["html","head","style","title","body","a","audio","img","video","embed","iframe","object","canvas","script","col","colgroup","tbody","tfoot","thead","button","input","label","option","select","textarea"]),sg=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch{return/\w/u}})(),os=class os extends Ge{constructor(e){super();w(this,wn);ge(this,"data","");this.data=e}get type(){return"text"}toString(e){var r;return e&&!((r=this.parentNode)!=null&&r.getAttribute("built"))?se(this.data):this.data}text(){return this.data}lint(e=this.getAbsoluteIndex(),r){var n,i,s;{if(r===!1)return[];let{data:a,parentNode:l,nextSibling:g,previousSibling:u}=this;if(!l)throw new Error("An isolated text node cannot be linted!");let{type:d,parentNode:p}=l;if(d==="attr-value"){let{name:W,tag:F}=p;if(F==="ref"&&(W==="name"||W==="follow")||W==="group"&&(F==="ref"||F==="references")||F==="choose"&&(W==="before"||W==="after"))return[]}if(r!=null||(r=l.isPlain()&&!ng.has(d)?tg:rg),a.search(r)===-1)return[];r.lastIndex=0;let f=[],c=g==null?void 0:g.type,h=g==null?void 0:g.name,b=u==null?void 0:u.type,T=this.getRootNode(),x=T.toString(),{ext:y,html:k,variants:A}=T.getAttribute("config"),{top:I,left:E}=T.posFromIndex(e),{lintConfig:N}=v,z=N.rules["tag-like"],_=z[1]?new Set(Object.keys(z[1]).filter(W=>W!=="invalid"&&W!=="disallowed")):new Set,Y=new Set(["onlyinclude","noinclude","includeonly",...y,...k[0],...k[1],...k[2],..._,...N.getSeverity("tag-like","disallowed")?$a:[]]);for(let W=r.exec(a);W;W=r.exec(a)){let{index:F,0:R}=W,[,ee,oe]=W,xe=R==="["&&d==="ext-link-text";if(oe&&oe!=="]"){let{length:ue}=oe;F+=ue,R=R.slice(ue)}else{if(R.startsWith("<")&&!Y.has(ee.toLowerCase())||xe&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(a.slice(F+1))||g!=null&&g.is("ext")&&h==="nowiki"&&((n=g.innerText)!=null&&n.includes("]"))))continue;R.startsWith(`
6
6
  ==`)&&(F++,R=R.slice(1))}R=R.toLowerCase();let[J]=R,de=R==="rfc"||R==="pmid"||R==="isbn",K=J==="{",kt=J==="}",on=J==="[",Hi=J==="]",{length:vt}=R;Hi&&(F||vt>1)&&r.lastIndex--;let br=e+F,qt=br+vt,ke,He,Jn,Xn,Mt=x[qt],zi=x[br-1],Gi=K||on,Vi=R==="{"&&zi==="-"&&A.length>0,Ki=R==="}"&&Mt==="-"&&A.length>0,Fo=on&&c==="free-ext-link"&&!a.slice(F+1).trim()||Hi&&b==="free-ext-link"&&F===0;if(de)ke="lonely-http",R=R.toUpperCase(),He=N.getSeverity(ke,R);else if(J==="<"){ke="tag-like";let ue;/^<\/?\s/u.test(R)||!/[\s/>]/u.test(Mt!=null?Mt:"")?ue="invalid":_.has(ee)?ue=ee:$a.has(ee)&&!y.includes(ee)&&(ue="disallowed"),He=N.getSeverity(ke,ue)}else if(J==="=")ke="syntax-like",He=N.getSeverity(ke,"heading");else if(Vi||Ki)ke="lonely-bracket",He=N.getSeverity(ke,"converter"),Vi&&F>0?(R="-{",F--,br--,vt=2):Ki&&F<a.length-1&&(R="}-",qt++,vt=2);else if(Fo)ke="lonely-bracket",He=N.getSeverity(ke,"extLink");else if(Gi||kt||Hi)if(ke="lonely-bracket",vt>1||K&&Mt===J||kt&&zi===J)He=N.getSeverity(ke,"double");else{if(!xe){let ue=ig[J],Re=Gi?a.slice(F+1):a.slice(0,F);if(K&&((i=ue.exec(Re))==null?void 0:i[0])==="}"||kt&&((s=ue.exec(Re))==null?void 0:s[0])==="{")continue;if(!Re.includes(J)){let et=Gi?"nextSibling":"previousSibling",Me=this[et];for(;Me&&(Me.type!=="text"||!ue.test(Me.data));)Me=Me[et];if(Me&&ue.exec(Me.data)[0]!==J)continue}}He=N.getSeverity(ke,"single")}else ke="lonely-http",He=N.getSeverity(ke);if(!He)continue;let Ro=this.posFromIndex(F),{line:Po,character:Bo}=vr(I,E,Ro.top+1,Ro.left);if(J==="="){let ue=a.indexOf(`
7
7
  `,F),Re=g,et;if(ue===-1){let Me=0;for(;Re&&!(Re.type==="text"&&(Me=Re.data.indexOf(`
8
8
  `),Me!==-1));)Re=Re.nextSibling;if(!Re)continue;et=Re.data.slice(0,Me)}else et=a.slice(F+vt,ue);if(!/(?:^|[^=])=+\s*(?:\S\s*)?$/u.test(et))continue;ue===-1?(qt=Re.getAbsoluteIndex()+et.length,{top:Jn,left:Xn}=T.posFromIndex(qt)):(qt+=et.length,vt+=et.length)}let _t={rule:ke,message:v.msg(J==="="?"header-like":"lonely",de||J==="h"||Vi||Ki?R:J),severity:He,startIndex:br,endIndex:qt,startLine:Po,endLine:Jn!=null?Jn:Po,startCol:Bo,endCol:Xn!=null?Xn:Bo+vt};if(N.computeEditInfo)if(J==="<")_t.suggestions=[st(br,"&lt;")];else if(J==="h"&&d!=="link-text"&&sg.test(zi||""))_t.suggestions=[At(br)];else if(xe){let ue=l.getAbsoluteIndex()+l.toString().length;_t.suggestions=[st(ue,"&#93;")]}else if(R==="]"&&Fo){let ue=e-u.toString().length;_t.suggestions=[Ar(ue,"left-bracket","[")]}else de&&(_t.suggestions=[...W[0]===R?[]:[oi(_t,R)],...Mt===":"||Mt===":"?[At(qt,1)]:[]]);f.push(_t)}return f}}replaceData(e){C(this,wn,ss).call(this,e)}splitText(e){{let{parentNode:r,data:n}=this;if(!r)throw new Error("The text node to be split has no parent node!");let i=new os(n.slice(e));return Vt(r,r.childNodes.indexOf(this)+1,0,[i]),this.setAttribute("data",n.slice(0,e)),i}this.lspError("AstText.splitText")}escape(){{let{parentNode:e}=this;if(!e)throw new Error("The text node to be escaped has no parent node!");let{TranscludeToken:r}=(ns(),X(La)),n=e.getAttribute("config"),i=e.childNodes.indexOf(this)+1,s=g=>Math.max(this.data.lastIndexOf("=",g),this.data.lastIndexOf("|",g)),a=s(),l=()=>new r(this.data[a]==="="?"=":"!",[],n);for(;a>=0;a=s(a-1))a<this.data.length-1&&this.splitText(a+1),e.insertAt(Q.run(l),i),C(this,wn,ss).call(this,this.data.slice(0,a))}}print(){return Ht(this.data)}};wn=new WeakSet,ss=function(e){this.setAttribute("data",e)};Sn=os});var Ne,Et=L(()=>{"use strict";Ne=(o=!0,t=!0)=>e=>{class r extends e{text(){return""}lint(i){return o?[]:super.lint(i)}}return r}});var he,Ve=L(()=>{"use strict";he=({length:o})=>t=>{class e extends t{getAttribute(n){return n==="padding"?o:super.getAttribute(n)}}return e}});var Fa,Qt,De,Ke,pi,Ra,as,og,Ce,Ir=L(()=>{"use strict";G();Ae();pe();Ve();we();D();V();wt();Fa=[Z,he("[[")];Ce=class extends(og=$){constructor(e,r,n=v.getConfig(),i=[],s="|"){super(void 0,n,i,{});w(this,pi);w(this,Qt,!0);w(this,De);w(this,Ke);if(this.insertAt(new ce(e,"link-target",n,i)),r!==void 0){let a=new $(r,{...n,excludes:[...n.excludes,"list"]},i);a.type="link-text",a.setAttribute("stage",10),this.insertAt(a)}S(this,De,s)}get link(){return m(this,Ke)}get fragment(){return m(this,Ke).fragment}afterBuild(){S(this,Ke,this.getTitle()),m(this,De).includes("\0")&&S(this,De,this.buildFromStr(m(this,De),0)),C(this,pi,Ra).call(this),super.afterBuild()}setAttribute(e,r){e==="bracket"?S(this,Qt,r):e==="title"?S(this,Ke,r):super.setAttribute(e,r)}toString(e){let r=super.toString(e,m(this,De));return m(this,Qt)?`[[${r}]]`:r}text(){let e=super.text("|");return m(this,Qt)?`[[${e}]]`:e}getAttribute(e){return e==="title"?m(this,Ke):super.getAttribute(e)}getGaps(e){return e===0?m(this,De).length:1}lint(e=this.getAbsoluteIndex(),r){{let n=super.lint(e,r),{childNodes:[i,s],type:a}=this,{encoded:l,fragment:g}=m(this,Ke),{lintConfig:u}=v,{computeEditInfo:d,fix:p}=u,f=new U(this,e),c="unknown-page",h=u.getSeverity(c);if(h&&i.childNodes.some(({type:b})=>b==="template")&&n.push(q(i,f,c,"template-in-link",h)),c="url-encoding",h=u.getSeverity(c),h&&l){let b=q(i,f,c,"unnecessary-encoding",h);(d||p)&&(b.fix=ni(b,i)),n.push(b)}if(c="pipe-like",h=u.getSeverity(c,"link"),h&&(a==="link"||a==="category")){let b=s==null?void 0:s.childNodes.findIndex(x=>x.type==="text"&&x.data.includes("|")),T=s==null?void 0:s.childNodes[b];if(T){let x=q(s,f,c,"pipe-in-link",h);if(d){let y=x.startIndex+s.getRelativeIndex(b);x.suggestions=[ai(y,T.data)]}n.push(x)}}if(c="no-ignored",h=u.getSeverity(c,"fragment"),h&&g!==void 0&&!Pa(a)){let b=q(i,f,c,"useless-fragment",h);if(d||p){let T=i.childNodes.findIndex(y=>y.type==="text"&&y.data.includes("#")),x=i.childNodes[T];x&&(b.fix=M(b,i.getRelativeIndex(T)+x.data.indexOf("#")))}n.push(b)}return n}}getTitle(e,r){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:r,temporary:e,decode:!0,selfLink:!0})}print(){return super.print(m(this,Qt)?{pre:"[[",post:"]]",sep:m(this,De)}:{sep:m(this,De)})}json(e,r,n=this.getAbsoluteIndex()){{let i=super.json(void 0,r,n),{type:s,fragment:a}=this;return a!==void 0&&(s==="link"||s==="redirect-target")&&(i.fragment=a),i}}};as=O(og),Qt=new WeakMap,De=new WeakMap,Ke=new WeakMap,pi=new WeakSet,Ra=function(){this.type!=="ext-inner"&&this.setAttribute("name",m(this,Ke).title)},Ce=j(as,0,"LinkBaseToken",Fa,Ce),B(as,1,Ce)});var Ba,ls,ag,fe,$t=L(()=>{"use strict";we();V();Ba=[Z];fe=class extends(ag=$){get innerText(){return this.firstChild.data}constructor(t="",e,r){super(t,e,r)}};ls=O(ag),fe=j(ls,0,"NowikiBaseToken",Ba,fe),B(ls,1,fe)});var ja,ds,lg,me,Jt=L(()=>{"use strict";G();Et();D();$t();ja=[Ne(!1)];me=class extends(lg=fe){get type(){return"noinclude"}toString(t){return t?"":super.toString()}lint(t=this.getAbsoluteIndex()){{let{lintConfig:e}=v,r="no-ignored",n=e.getSeverity(r,"include");if(n){let{innerText:i}=this,s=/^<(includeonly|(?:no|only)include)\s+(?:[^\s>/]|\/(?!>))[^>]*>$/iu.exec(i);if(s){let a=P(this,{start:t},r,"useless-attribute",n),{computeEditInfo:l}=e,g=s[1].length+1,u=i.endsWith("/>")?2:1;return a.startIndex+=g,a.startCol+=g,a.endIndex-=u,a.endCol-=u,l&&(a.suggestions=[M(a)]),[a]}}return[]}}};ds=O(lg),me=j(ds,0,"NoincludeToken",ja,me),B(ds,1,me)});var ci,Oa=L(()=>{"use strict";G();D();Ir();Jt();ci=class extends Ce{get type(){return"redirect-target"}constructor(t,e,r,n){super(t,void 0,r,n),e!==void 0&&this.insertAt(new me(e,r,n))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,{halfParsed:!0,decode:!0,page:""})}lint(t=this.getAbsoluteIndex()){{let e=super.lint(t,!1),r="no-ignored",{lintConfig:n}=v,i=n.getSeverity(r,"redirect");if(i&&this.length===2){let s=q(this.lastChild,{start:t},r,"useless-link-text",i);s.startIndex--,s.startCol--,(n.computeEditInfo||n.fix)&&(s.fix=M(s)),e.push(s)}return e}}}});var qa,Nt,Fr,us,dg,Xt,Ma=L(()=>{"use strict";Et();we();V();Ct();Oa();qa=[Ne(!1,!1),Z];Xt=class extends(dg=$){constructor(e,r,n,i,s,a,l=[]){super(void 0,a,l);w(this,Nt);w(this,Fr);S(this,Nt,e),S(this,Fr,s),this.append(new ye(r,"redirect-syntax",a,l),new ci(n,i==null?void 0:i.slice(1),a,l))}get type(){return"redirect"}getAttribute(e){return e==="padding"?m(this,Nt).length:super.getAttribute(e)}toString(e){return m(this,Nt)+super.toString(e)+m(this,Fr)}lint(e=this.getAbsoluteIndex()){{let r=e+m(this,Nt).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",r),this.lastChild.lint(r)}}print(){return super.print({pre:m(this,Nt),post:m(this,Fr)})}};us=O(dg),Nt=new WeakMap,Fr=new WeakMap,Xt=j(us,0,"RedirectToken",qa,Xt),B(us,1,Xt)});var _a={};re(_a,{parseRedirect:()=>ug});var ug,Wa=L(()=>{"use strict";D();Ma();ug=(o,t,e)=>{var n;(n=t.regexRedirect)!=null||(t.regexRedirect=new RegExp(String.raw`^(\s*)((?:${t.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));let r=t.regexRedirect.exec(o);return r&&v.normalizeTitle(r[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,page:""}).valid?(o=`\0${e.length}o${o.slice(r[0].length)}`,new Xt(...r.slice(1),t,e),o):!1}});var Da,gs,gg,Yt,Ua=L(()=>{"use strict";Ve();we();V();Da=[Z,he("<onlyinclude>")];Yt=class extends(gg=$){get type(){return"onlyinclude"}toString(t){return`<onlyinclude>${super.toString(t)}</onlyinclude>`}isPlain(){return!0}print(){return super.print({pre:'<span class="wpb-ext">&lt;onlyinclude&gt;</span>',post:'<span class="wpb-ext">&lt;/onlyinclude&gt;</span>'})}};gs=O(gg),Yt=j(gs,0,"OnlyincludeToken",Da,Yt),B(gs,1,Yt)});var Ha,It,Qe,ps,pg,Ue,fi=L(()=>{"use strict";yn();we();V();Ha=[St(),Z];Ue=class extends(pg=$){constructor(e,r,n,i,s,a=[]){super(void 0,s);w(this,It);w(this,Qe);ge(this,"closed");this.setAttribute("name",e.toLowerCase()),S(this,It,[e,i||e]),this.closed=i!=="",S(this,Qe,i===void 0),this.append(r,n);let l=typeof r=="string"?-1:a.indexOf(r);a.splice(l===-1?1/0:l,0,this)}get innerText(){return m(this,Qe)?void 0:this.lastChild.text()}get selfClosing(){return m(this,Qe)}toString(e){let{firstChild:r,lastChild:n}=this,[i,s]=m(this,It);return m(this,Qe)?`<${i}${r.toString(e)}/>`:`<${i}${r.toString(e)}>${n.toString(e)}${this.closed?`</${s}>`:""}`}text(){let[e,r]=m(this,It);return m(this,Qe)?`<${e}${this.firstChild.text()}/>`:`<${e}${super.text(">")}${this.closed?`</${r}>`:""}`}getAttribute(e){return e==="padding"?m(this,It)[0].length+1:super.getAttribute(e)}print(){{let[e,r]=m(this,It);return super.print(m(this,Qe)?{pre:`&lt;${e}`,post:"/&gt;"}:{pre:`&lt;${e}`,sep:"&gt;",post:this.closed?`&lt;/${r}&gt;`:""})}}json(e,r,n=this.getAbsoluteIndex()){{let i=super.json(void 0,r,n);return i.selfClosing=m(this,Qe),i}}};ps=O(pg),It=new WeakMap,Qe=new WeakMap,Ue=j(ps,0,"TagPairToken",Ha,Ue),B(ps,1,Ue)});var za,cs,cg,Zt,Ga=L(()=>{"use strict";G();pe();Et();D();fi();za=[Ne(!1)];Zt=class extends(cg=Ue){get type(){return"include"}constructor(t,e="",r,n,i,s){super(t,e,r!=null?r:"",r===void 0||n!=null?n:"",i,s)}toString(t){return t?"":super.toString()}lint(t=this.getAbsoluteIndex()){{let e=[],{firstChild:r,closed:n,name:i}=this,s=new U(this,t),a=["no-ignored","unclosed-comment"],{lintConfig:l}=v,{computeEditInfo:g}=l,u=a.map(d=>l.getSeverity(d,"include"));if(u[0]&&r.data.trim()){let d=q(r,s,a[0],"useless-attribute",u[0]);g&&(d.suggestions=[M(d)]),e.push(d)}if(u[1]&&!n){let d=P(this,s,a[1],v.msg("unclosed",`<${i}>`),u[1]);g&&(d.suggestions=[je(d.endIndex,`</${i}>`)]),e.push(d)}return e}}};cs=O(cg),Zt=j(cs,0,"IncludeToken",za,Zt),B(cs,1,Zt)});var Rr,mi=L(()=>{"use strict";Rr=(o=0)=>t=>{var e,fs;{class n extends t{constructor(){super(...arguments);w(this,e)}hasAttr(a){return C(this,e,fs).call(this).hasAttr(a)}getAttr(a){return C(this,e,fs).call(this).getAttr(a)}}return e=new WeakSet,fs=function(){return this.childNodes[o]},n}}});var le,Va,Ka,hi,bs,hs,Qa,bi,Za,el,ms,Ja,Xa,Ya,er,xi,yi,Ti,tl,ki,vi=L(()=>{"use strict";le=new Set(["align"]),Va=new Set(["cite"]),Ka=new Set(["cite","datetime"]),hi=new Set(["width"]),bs=new Set(["bgcolor","align","valign"]),hs=new Set([...bs,"axis","height","nowrap","width"]),Qa=new Set([...hs,"abbr","headers","scope","rowspan","colspan"]),bi=new Set(["type"]),Za=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),el=new Set(["clear"]),ms=new Set(["id","qid","forcemathmode","type","display"]),Ja=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),Xa=new Set(["weight"]),Ya=new Set(["width","height","zoom","latitude","longitude","align","mapstyle","lang","alt","text"]),er=new Set,xi=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"]),yi={div:le,h1:le,h2:le,h3:le,h4:le,h5:le,h6:le,blockquote:Va,q:Va,p:le,br:el,pre:hi,ins:Ka,del:Ka,ul:bi,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...Za,"border"]),caption:le,tr:bs,td:Qa,th:Qa,font:new Set(["size","color","face"]),hr:hi,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:bi,poem:le,categorytree:le,combooption:le,img:new Set(["alt","src","width","height","loading","srcset"])},Ti={pre:new Set(["format"]),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:er,indicator:new Set(["name"]),langconvert:new Set(["from","to"]),ref:new Set(["group","name","follow","dir","details"]),references:new Set(["group","responsive"]),charinsert:new Set(["label"]),choose:new Set(["uncached","before","after"]),option:Xa,choicetemplate:Xa,imagemap:er,inputbox:er,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:er,poll:new Set(["id","show-results-before-voting"]),score:new Set(["line_width_inches","lang","override_midi","raw","note-language","override_audio","override_ogg","sound","vorbis"]),seo:new Set(["title","title_mode","title_separator","keywords","description","robots","google_bot","image","image_width","image_height","image_alt","type","site_name","locale","section","author","published_time","twitter_site"]),tab:new Set(["nested","name","index","class","block","inline","openname","closename","collapsed","dropdown","style","bgcolor","container","id","title"]),tabs:new Set(["plain","class","container","id","title","style"]),combobox:new Set(["placeholder","value","id","class","text","dropdown","style"]),math:new Set([...ms,"chem"]),chem:ms,ce:ms,hiero:er,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:Ja,syntaxhighlight:Ja,templatedata:er,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:er,mapframe:new Set([...Ya,"frameless"]),maplink:new Set([...Ya,"class"]),rss:new Set(["template","templatename","max","highlight","filter","filterout","reverse","date","item-max-length"]),"page-collection":new Set(["lang","name","description","end-date"])},tl={table:Za,td:new Set([...hs,"scope"]),th:hs,br:el,caption:le,div:le,hr:hi,h1:le,h2:le,h3:le,h4:le,h5:le,h6:le,li:bi,p:le,pre:hi,tr:bs,ul:bi},ki={dynamicpagelist:["category","notcategory","namespace","count","offset","imagewidth","imageheight","imagesperrow","mode","gallerycaption","galleryshowfilesize","galleryshowfilename","order","ordermethod","redirects","stablepages","qualitypages","suppresserrors","addfirstcategorydate","shownamespace","ignoresubpages","googlehack","nofollow"],inputbox:["preloadparams[]","type","width","preload","preloadtitle","page","editintro","useve","usedt","summary","nosummary","minor","break","default","placeholder","bgcolor","buttonlabel","searchbuttonlabel","fulltextbutton","namespaces","labeltext","hidden","id","inline","prefix","dir","searchengine","searchtype","searchfilter","tour","arialabel"]}});var fg,mg,hg,bg,Cn,Pr,be,Je,tr,rl,xs,Br,nl=L(()=>{"use strict";G();ae();vi();pe();D();V();wt();fg=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,mg=/(?:^|\s|\*\/)(?:java|vb)script(?:\W|$)/iu,hg=new Set(["ext","arg","magic-word","template"]),bg=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),Br=class extends ${constructor(e,r,n,i,s,a="",l,g=[]){let u=new ce(n,"attr-key",s,g),d;if(n==="title"||r==="img"&&n==="alt")d=new $(l,s,g,{}),d.type="attr-value",d.setAttribute("stage",10);else if(r==="gallery"&&n==="caption"||r==="ref"&&n==="details"||(r==="mapframe"||r==="maplink")&&n==="text"||r==="choose"&&(n==="before"||n==="after")){let p={...s,excludes:[...s.excludes,"heading","html","table","hr","list"]};d=new $(l,p,g,{}),d.type="attr-value",d.setAttribute("stage",1)}else d=new ce(l,"attr-value",s,g,{});super(void 0,s,g);w(this,tr);w(this,Cn);w(this,Pr);w(this,be);w(this,Je);S(this,Cn,e),this.append(u,d),S(this,be,a),S(this,Je,[...i]),S(this,Pr,r),this.setAttribute("name",nt(se(n)))}get type(){return m(this,Cn)}get tag(){return m(this,Pr)}get balanced(){return!m(this,be)||m(this,Je)[0]===m(this,Je)[1]}afterBuild(){m(this,be).includes("\0")&&S(this,be,this.buildFromStr(m(this,be),0)),this.parentNode&&S(this,Pr,this.parentNode.name),C(this,tr,rl).call(this),super.afterBuild()}toString(e){let[r="",n=""]=m(this,Je);return m(this,be)?super.toString(e,m(this,be)+r)+n:this.firstChild.toString(e)}text(){return m(this,be)?`${super.text(`${m(this,be).trim()}"`)}"`:this.firstChild.text()}getGaps(){var e,r;return m(this,be)?m(this,be).length+((r=(e=m(this,Je)[0])==null?void 0:e.length)!=null?r:0):0}lint(e=this.getAbsoluteIndex(),r){var n;{let i=super.lint(e,r),{balanced:s,firstChild:a,lastChild:l,name:g,tag:u}=this,d=new U(this,e),p=["unclosed-quote","obsolete-attr"],{lintConfig:f}=v,c=p.map(b=>f.getSeverity(b,g));if(c[0]&&!s){let b=q(l,d,p[0],"unclosed-quotes",c[0]);b.startIndex--,b.startCol--,f.computeEditInfo&&(b.suggestions=[je(b.endIndex,m(this,Je)[0])]),i.push(b)}let h=C(this,tr,xs).call(this,e,d);return h&&i.push(h),c[1]&&((n=tl[u])!=null&&n.has(g))&&i.push(q(a,d,p[1],"obsolete-attribute",c[1])),i}}getValue(){return m(this,be)?this.lastChild.text().replace(/[\t\r\n ]+/gu," ").trim():""}escape(){this.type!=="ext-attr"&&(S(this,be,"{{=}}"),this.lastChild.escape())}getAttribute(e){return e==="invalid"?!!C(this,tr,xs).call(this):super.getAttribute(e)}print(){{let[e="",r=""]=m(this,Je);return m(this,be)?super.print({sep:Ht(m(this,be))+e,post:r}):super.print()}}json(e,r,n=this.getAbsoluteIndex()){{let i=super.json(void 0,r,n);return i.tag=this.tag,i}}};Cn=new WeakMap,Pr=new WeakMap,be=new WeakMap,Je=new WeakMap,tr=new WeakSet,rl=function(){this.setAttribute("name",nt(this.firstChild.text()))},xs=function(e,r){let{firstChild:n,lastChild:i,type:s,name:a,tag:l,parentNode:g}=this,u=!i.childNodes.some(({type:x})=>hg.has(x)),d=this.getValue(),p=Ti[l],f=yi[l],{length:c}=this.toString(),h="illegal-attr",b,T;if({lintConfig:b}=v,{computeEditInfo:T}=b,!(p!=null&&p.has(a))&&!(f!=null&&f.has(a))&&(s==="ext-attr"?p||f:!/\{\{[^{]+\}\}/u.test(a))&&(s==="ext-attr"&&!f||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:_]*)$/u.test(a)&&(l==="meta"||l==="link"||!xi.has(a)))||(a==="itemtype"||a==="itemid"||a==="itemref")&&!(g!=null&&g.hasAttr("itemscope"))){if(e===void 0)return 2;{let x=b.getSeverity(h,"unknown");if(x){let y=q(n,r,h,"illegal-attribute-name",x);return T&&(y.suggestions=[M(e,c)]),y}}}else if(a==="style"&&fg.test(d)){if(e===void 0)return 1;{h="insecure-style";let x=b.getSeverity(h);return x&&q(i,r,h,"insecure-style",x)}}else if(a==="tabindex"&&d!=="0"){if(e===void 0)return 2;{let x=b.getSeverity(h,"tabindex");if(x){let y=q(i,r,h,"nonzero-tabindex",x);return T&&(y.suggestions=[M(e,c),ve(y,"0 tabindex","0")]),y}}}else if((/^xmlns:[\w:.-]+$/u.test(a)||bg.has(a))&&mg.test(d)||u&&(a==="href"||s==="ext-attr"&&l==="img"&&a==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(d)){if(e===void 0)return 2;{let x=b.getSeverity(h,"value");return x&&q(i,r,h,"illegal-attribute-value",x)}}else if(u&&s!=="ext-attr"){let x=li(l,a),y=d.toLowerCase();if(x.length>0&&x.every(k=>k!==y)){if(e===void 0)return 2;{let k=b.getSeverity(h,"value");return k&&q(i,r,h,"illegal-attribute-value",k)}}}return!1}});var sl,xg,yg,il,Ln,jr,Ai,Ft,Si=L(()=>{"use strict";G();ae();pe();D();V();wt();nl();sl=o=>o.slice(0,-1),xg=o=>`${sl(o)}-dirty`,yg=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch{return/[^\W_]/u}})(),il=new Map([["indicator",["name"]],["langconvert",["from","to"]],["mapframe",["width","height"]],["maplink",["width","height"]],["phonos",[["ipa","file","wikibase"]]],["section",[["begin","end"]]],["templatestyles",["src"]]]),Ft=class extends ${constructor(e,r,n,i,s=[]){super(void 0,i,s,{});w(this,jr);w(this,Ln);if(S(this,Ln,r),this.setAttribute("name",n),e){let a=/([^\s/](?:(?!\0\d+~\x7F)[^\s/=])*)(?:((?:\s(?:\s|\0\d+[cn]\x7F)*)?(?:=|\0\d+~\x7F)(?:\s|\0\d+[cn]\x7F)*)(?:(["'])([\s\S]*?)(\3|$)|(\S*)))?/gu,l="",g=a.exec(e),u=0,d=()=>{l&&(super.insertAt(new ce(l,xg(r),i,s)),l="")};for(;g;){let{index:p,0:f,1:c,2:h,3:b,4:T,5:x,6:y}=g;if(l+=e.slice(u,p),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(se(c).trim())){let k=T!=null?T:y,A=[b,x],I=new Br(sl(r),n,c,A,i,h,k,s);d(),super.insertAt(I)}else l+=f;({lastIndex:u}=a),g=a.exec(e)}l+=e.slice(u),d()}}get type(){return m(this,Ln)}afterBuild(){let{parentNode:e}=this;e!=null&&e.is("td")&&this.setAttribute("name",e.subtype),super.afterBuild()}getAttrTokens(e){return this.childNodes.filter(r=>r instanceof Br&&(!e||r.name===nt(e)))}hasAttr(e){return this.getAttrTokens(e).length>0}getAttrToken(e){{let r=this.getAttrTokens(e);return r[r.length-1]}}getAttr(e){var r;return(r=this.getAttrToken(e))==null?void 0:r.getValue()}lint(e=this.getAbsoluteIndex(),r){{let n=super.lint(e,r),{parentNode:i,childNodes:s,type:a,name:l}=this,g=new Map,u=new Set,d=new U(this,e),p=["no-ignored","required-attr","no-duplicate"],{lintConfig:f}=v,{computeEditInfo:c,fix:h}=f,b=["closingTag","invalidAttributes","nonWordAttributes"].map(x=>f.getSeverity(p[0],x));if(b[0]&&C(this,jr,Ai).call(this)){let x=P(this,d,p[0],"attributes-of-closing-tag",b[0]);if(c){let y=i.getAbsoluteIndex();x.suggestions=[M(x),ii(y)]}n.push(x)}for(let x of s)if(x instanceof Br){let{name:y}=x;g.has(y)?(u.add(y),g.get(y).push(x)):g.set(y,[x])}else{let y=x.text().trim(),k=b[yg.test(y)?1:2];if(y&&k){let A=q(x,d,p[0],"invalid-attribute",k);c&&(A.suggestions=[M(A,0," ")]),n.push(A)}}if(a==="ext-attrs"&&il.has(l)){let x=f.getSeverity(p[1],l);if(x)for(let y of il.get(l)){let k=typeof y=="string"?[y]:y;k.some(A=>this.getAttr(A))||n.push(P(this,d,p[1],v.msg("required-attribute",k.join("/")),x))}}let T=f.getSeverity(p[2],"attribute");if(T&&u.size>0)for(let x of u){let y=g.get(x).map(k=>[k,k.getValue()]);Array.prototype.push.apply(n,y.map(([k,A],I)=>{let E=q(k,d,p[2],v.msg("duplicate-attribute",x),T);if(c||h){let N=M(E);!A||y.slice(0,I).some(([,z])=>z===A)?E.fix=N:c&&(E.suggestions=[N])}return E}))}return n}}escape(){this.type!=="ext-attrs"&&super.escape()}getAttribute(e){return e==="invalid"?C(this,jr,Ai).call(this):super.getAttribute(e)}print(){return this.toString()?`<span class="wpb-${this.type}${C(this,jr,Ai).call(this)?" wpb-invalid":""}">${this.childNodes.map(e=>e.print(e instanceof ce?{class:e.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}};Ln=new WeakMap,jr=new WeakSet,Ai=function(){let{parentNode:e}=this;return(e==null?void 0:e.type)==="html"&&e.closing&&this.text().trim()!==""}});var ol={};re(ol,{PreToken:()=>ys});var ys,al=L(()=>{"use strict";V();Jt();ys=class extends ${get type(){return"ext-inner"}constructor(t,e,r=[]){if(t){let n=/<nowiki>/giu,i=/<\/nowiki>/giu,{length:s}=n.source,a=n.exec(t);a&&(i.lastIndex=a.index+s);let l=i.exec(t),g=0,u="";for(;a&&l;)new me(a[0],e,r,!0),new me(l[0],e,r,!0),u+=`${t.slice(g,a.index)}\0${r.length-1}n${t.slice(a.index+s,l.index)}\0${r.length}n`,g=l.index+s+1,n.lastIndex=g,a=n.exec(t),a&&(i.lastIndex=a.index+s),l=i.exec(t);t=u+t.slice(g)}super(t,e,r,{}),this.setAttribute("stage",10)}isPlain(){return!0}lint(t=this.getAbsoluteIndex()){return super.lint(t,/<\s*\/\s*(pre)\b/giu)}}});var Rt,wi=L(()=>{"use strict";V();Rt=class extends ${get type(){return"ext-inner"}toString(t){return super.toString(t,`
@@ -3,7 +3,7 @@
3
3
  `).replace(/\n\s*\n/gu,`
4
4
  `)}getGaps(){return 1}print(){return super.print({sep:`
5
5
  `})}}});var Qr,qs=x(()=>{"use strict";B();Qr=class extends v{get type(){return"param-line"}constructor(t,e,r,n,i){super(e,r,n,i),this.setAttribute("name",t)}lint(t=this.getAbsoluteIndex()){}}});var Os={};W(Os,{ParamTagToken:()=>mr});var mr,Bn=x(()=>{"use strict";hr();Kr();qs();mr=class extends Ve{constructor(t,e,r,n,i=[],o){super(void 0,n,i,{}),r&&this.safeAppend(r.split(`
6
- `).map(a=>o?a:gt(a,n,i,e)).map(a=>new Qr(t,a,n,i,{}))),i.splice(i.indexOf(this),1),i.push(this)}}});var _s,xr,Pt,Xr,Pn,wl,we,jn=x(()=>{"use strict";ne();B();Me();_s=[j];we=class extends(wl=v){constructor(e,r,n,i=[]){super(void 0,n,i);h(this,Pt);h(this,xr);b(this,xr,e);let o=new v(r[0],n,i);o.type="heading-title",o.setAttribute("stage",2);let a=new te(r[1],"heading-trail",n,i);this.append(o,a)}get type(){return"heading"}get level(){return g(this,xr)}toString(e){let r=$(this,Pt,Xr).call(this);return r+this.firstChild.toString(e)+r+this.lastChild.toString(e)}text(){let e=$(this,Pt,Xr).call(this);return e+this.firstChild.text()+e}getAttribute(e){return e==="invalid"?this.inHtmlAttrs()===2:e==="padding"?this.level:super.getAttribute(e)}getGaps(){return this.level}lint(e=this.getAbsoluteIndex(),r){}print(){{let e=$(this,Pt,Xr).call(this);return super.print({pre:e,sep:e})}}json(e,r,n=this.getAbsoluteIndex()){}};Pn=I(wl),xr=new WeakMap,Pt=new WeakSet,Xr=function(){return"=".repeat(this.level)},we=N(Pn,0,"HeadingToken",_s,we),E(Pn,1,we)});var Jr,Ms=x(()=>{"use strict";B();Jr=class extends v{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){}constructor(t,e,r,n=[]){super(void 0,r,n);let i=new v(typeof t=="number"?void 0:t,r,n,{}),o=new v(e,r,n);i.type="parameter-key",i.setAttribute("stage",2),o.type="parameter-value",o.setAttribute("stage",2),this.append(i,o)}trimName(t,e=!0){let r=(typeof t=="string"?t:t.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",r),r}afterBuild(){if(!this.anon){let{parentNode:t,firstChild:e}=this,r=this.trimName(e);t&&t.getArgs(r,!1,!1).add(this)}super.afterBuild()}toString(t){return this.anon?this.lastChild.toString(t):super.toString(t,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(t=this.getAbsoluteIndex(),e){}print(){return super.print({sep:this.anon?"":"="})}json(t,e,r=this.getAbsoluteIndex()){}}});var Ws,br,Ke,jt,qt,yr,Ot,ut,On,Us,qn,El,He,Ds=x(()=>{"use strict";J();Ce();gr();ne();B();Ms();We();Me();Ws=[j,De()];He=class extends(El=v){constructor(e,r,n,i=[]){var S,k;let o,a=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(e);a&&(o=Number(a[1]),e=e.replace(`\0${o}h`,i[o].toString().replace(/^\n/u,"")));super(void 0,n,i,{});h(this,ut);Z(this,"modifier","");h(this,br,"template");h(this,Ke,":");h(this,jt,!1);h(this,qt,new Map);h(this,yr,0);h(this,Ot);let{parserFunction:l,variable:p,functionHook:u}=n,d=(S=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(e))==null?void 0:S[0];if(d)this.setAttribute("modifier",d),e=e.slice(d.length);else if(e.includes(":")){let[y,...T]=e.split(":"),[w]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((k=T[0])!=null?k:"");this.setModifier(`${y}:${w}`)&&(e=T.join(":").slice(w.length))}let c=e.search(/[::]/u),f=e[c]===":",m=c!==-1;if(m||r.length===0&&!g(this,jt)){let y=m?e.slice(0,c):e,T=m&&e.slice(c+1),w=z(y),F=m?w.slice(w.search(/\S/u))+(f?":":""):w.trim(),[,L,R]=zs(F,l),G=!("functionHook"in n)||u.includes(R),P=p.includes(R);if(m?R&&G:P){this.setAttribute("name",R),b(this,br,"magic-word"),f&&b(this,Ke,":");let V=new te(y,"magic-word-name",n,i);if(super.insertAt(V),T!==!1&&r.unshift([T]),this.name==="invoke")for(let _=0;_<2;_++){let X=r.shift();if(!X)break;let ae=new H(X.join("="),`invoke-${_?"function":"module"}`,n,i);super.insertAt(ae)}}}if(this.type==="template"){let y=z(e).trim();if(!this.normalizeTitle(y,10,{halfParsed:!0,temporary:!0}).valid)throw i.pop(),new SyntaxError("Invalid template name");let T=new H(e,"template-name",n,i,{});super.insertAt(T)}typeof o=="number"&&(i[o]=void 0);let A=this.isTemplate(),C=1;for(let y=0;y<r.length;y++){let T=r[y];A||this.name==="switch"&&y>0||this.name==="tag"&&y>1||(T[0]=T.join("="),T.length=1),T.length===1&&(T.unshift(C),C++),this.insertAt(new Jr(...T,n,i))}this.seal("modifier")}get type(){return g(this,br)}get module(){}get function(){}setModifier(e){let[,,r,n]=this.getAttribute("config").parserFunction,i=z(e).trim();if(e&&!i.endsWith(":"))return!1;let o=i.slice(0,-1).toLowerCase(),a=r.includes(o),l=n.includes(o);return(g(this,jt)?a:l||!e)||(ee.running||this.length>1)&&(a||l||!e)?(this.setAttribute("modifier",e),b(this,jt,a),!!e):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0)),super.afterBuild(),this.isTemplate()&&this.type==="template"&&(b(this,Ot,$(this,ut,On).call(this)),this.setAttribute("name",g(this,Ot).title))}toString(e){let{childNodes:r,length:n,firstChild:i,modifier:o,type:a}=this;return`{{${o}${a==="magic-word"?i.toString(e)+(n===1?"":g(this,Ke))+r.slice(1).map(l=>l.toString(e)).join("|"):super.toString(e,"|")}}}`}text(){let{childNodes:e,length:r,firstChild:n,modifier:i,type:o,name:a}=this;return o==="magic-word"&&a==="vardefine"?"":`{{${i}${o==="magic-word"?n.text()+(r===1?"":g(this,Ke))+ge(e.slice(1),"|"):super.text("|")}}}`}getAttribute(e){switch(e){case"padding":return this.modifier.length+2;case"title":return g(this,Ot);case"colon":return g(this,Ke);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!$(this,ut,On).call(this).valid);default:return super.getAttribute(e)}}lint(e=this.getAbsoluteIndex(),r){}insertAt(e,r=this.length){return super.insertAt(e,r),e.anon?$(this,ut,Us).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getArgs(e,r,n=!0,i=!0){let o=String(e).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),a;return g(this,qt).has(o)?a=g(this,qt).get(o):(a=new Set,g(this,qt).set(o,a)),a}getDuplicatedArgs(){}getPossibleValues(){let{type:e,name:r,childNodes:n}=this;if(e==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let i,o;switch(r){case"if":case"ifexist":case"ifexpr":case"iferror":i=2;break;case"ifeq":i=3;break;case"switch":{let a=n.slice(2),l=a[a.length-1];o=[...a.filter(({anon:p})=>!p),...l!=null&&l.anon?[l]:[]].map(({lastChild:p})=>p);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}o!=null||(o=n.slice(i,i+2).map(({lastChild:a})=>a));for(let a=0;a<o.length;){let{length:l,0:p}=o[a].childNodes.filter(u=>u.text().trim());if(l===0)o.splice(a,1);else if(l>1||!p.is("magic-word"))a++;else try{let u=p.getPossibleValues();Array.prototype.splice.apply(o,[a,1,...u]),a+=u.length}catch{a++}}return o}print(){{let{childNodes:e,length:r,firstChild:n,modifier:i,type:o}=this;return`<span class="wpb-${o}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${o==="magic-word"?Ze(i)+n.print()+(r===1?"":g(this,Ke))+Ae(e.slice(1),{sep:"|"}):(i?`<span class="wpb-magic-word">${Ze(i)}</span>`:"")+Ae(e,{sep:"|"})}}}</span>`}}};qn=I(El),br=new WeakMap,Ke=new WeakMap,jt=new WeakMap,qt=new WeakMap,yr=new WeakMap,Ot=new WeakMap,ut=new WeakSet,On=function(){let e=this.type==="template";return this.normalizeTitle((e?"":"Module:")+z(this.childNodes[e?0:1].text()),10,{temporary:!0,...!e&&{page:""}})},Us=function(e,r){b(this,yr,g(this,yr)+1);let n;n=g(this,yr)-1;let i=e,o=String(n+1);i.setAttribute("name",o),this.getArgs(o,!1,!1).add(i)},He=N(qn,0,"TranscludeToken",Ws,He),E(qn,1,He)});var Gs,_n,Nl,pt,Vs=x(()=>{"use strict";_e();ne();B();Gs=[oe(),j];pt=class extends(Nl=v){get type(){return"hidden"}getAttribute(t){return t==="invalid"||super.getAttribute(t)}};_n=I(Nl),pt=N(_n,0,"HiddenToken",Gs,pt),E(_n,1,pt)});var Hs,Wn,Il,Mn,$l,ct,Ks=x(()=>{"use strict";J();Te();gr();ne();B();We();Vs();Hs=[j,Y("{{{"),De()];ct=class extends($l=v){constructor(e,r,n=[]){super(void 0,r,n,{});h(this,Wn);for(let i=0;i<e.length;i++){let o=e[i];if(i===0){let a=new H(o,"arg-name",r,n,{});super.insertAt(a)}else if(i>1){let a=new pt(o,r,n);super.insertAt(a)}else{let a=new v(o,r,n);a.type="arg-default",a.setAttribute("stage",2),super.insertAt(a)}}}get type(){return"arg"}get default(){}toString(e){return`{{{${super.toString(e,"|")}}}}`}text(){return`{{{${ge(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){super.afterBuild()}lint(e=this.getAbsoluteIndex(),r){}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(e,r,n=this.getAbsoluteIndex()){}};Mn=I($l),Wn=new WeakSet,Il=function(){},ct=N(Mn,0,"ArgToken",Hs,ct),E(Mn,1,ct)});var to={};W(to,{parseBraces:()=>Tr});var Ll,Qs,Un,Xs,Js,Ys,eo,Zs,Tr,Yr=x(()=>{"use strict";nr();J();jn();Ds();Ks();Ll={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},Qs=String.raw`\[(?!\[)`,Un=String.raw`\n(?![=\0])`,Xs=String.raw`|\{{2,}`,Js=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),Ys=je(s=>new RegExp(s,"gmu"));eo=new RegExp(String.raw`\{\{((?:[^\n{}[]|${Qs}|${Un})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${Un})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${Qs}|${Un})*\}-`,"gu");Zs=s=>{let t=ve(z(s));return Js.has(t)?Js.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},Tr=(s,t,e)=>{var m,A,C,S,k;let r=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,[,,,n]=t.parserFunction,i=[],o=[],a=(y,T,w,F)=>{T[T.length-1].push(se(y.slice(w,F),o))},l;do l!==void 0&&(s=l),l=s.replace(eo,(y,T,w)=>{if(T!==void 0||typeof w=="string")try{let{length:F}=e,L=(T!=null?T:w).split("|");return new He(se(L[0],o),L.slice(1).map(R=>{let G=R.indexOf("=");return(G===-1?[R]:[R.slice(0,G),R.slice(G+1)]).map(P=>se(P,o))}),t,e),`\0${F}${Zs(L[0])}`}catch(F){if(!(F instanceof SyntaxError)||F.message!=="Invalid template name")throw F}return o.push(se(y,o)),`\0${o.length-1}`});while(l!==s);s=l;let p=s.lastIndexOf("}}")-s.length,u=p+s.length!==-1,d=Ys(r+(u?Xs:"")),c=d.exec(s),f;for(;c||f!==void 0&&f<=s.length&&((A=(m=i[i.length-1])==null?void 0:m[0])!=null&&A.startsWith("="));){if(c!=null&&c[1]){let[,{length:X}]=c;c[0]=c[0].slice(X),c.index+=X}let{0:y,index:T}=c!=null?c:{0:`
6
+ `).map(a=>o?a:gt(a,n,i,e)).map(a=>new Qr(t,a,n,i,{}))),i.splice(i.indexOf(this),1),i.push(this)}}});var _s,xr,Pt,Xr,Pn,wl,we,jn=x(()=>{"use strict";ne();B();Me();_s=[j];we=class extends(wl=v){constructor(e,r,n,i=[]){super(void 0,n,i);h(this,Pt);h(this,xr);b(this,xr,e);let o=new v(r[0],n,i);o.type="heading-title",o.setAttribute("stage",2);let a=new te(r[1],"heading-trail",n,i);this.append(o,a)}get type(){return"heading"}get level(){return g(this,xr)}toString(e){let r=$(this,Pt,Xr).call(this);return r+this.firstChild.toString(e)+r+this.lastChild.toString(e)}text(){let e=$(this,Pt,Xr).call(this);return e+this.firstChild.text()+e}getAttribute(e){return e==="invalid"?this.inHtmlAttrs()===2:e==="padding"?this.level:super.getAttribute(e)}getGaps(){return this.level}lint(e=this.getAbsoluteIndex(),r){}print(){{let e=$(this,Pt,Xr).call(this);return super.print({pre:e,sep:e})}}json(e,r,n=this.getAbsoluteIndex()){}};Pn=I(wl),xr=new WeakMap,Pt=new WeakSet,Xr=function(){return"=".repeat(this.level)},we=N(Pn,0,"HeadingToken",_s,we),E(Pn,1,we)});var Jr,Ms=x(()=>{"use strict";B();Jr=class extends v{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){}constructor(t,e,r,n=[]){super(void 0,r,n);let i=new v(typeof t=="number"?void 0:t,r,n,{}),o=new v(e,r,n);i.type="parameter-key",i.setAttribute("stage",2),o.type="parameter-value",o.setAttribute("stage",2),this.append(i,o)}trimName(t,e=!0){let r=(typeof t=="string"?t:t.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",r),r}afterBuild(){if(!this.anon){let{parentNode:t,firstChild:e}=this,r=this.trimName(e);t&&t.getArgs(r,!1,!1).add(this)}super.afterBuild()}toString(t){return this.anon?this.lastChild.toString(t):super.toString(t,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(t=this.getAbsoluteIndex(),e){}print(){return super.print({sep:this.anon?"":"="})}json(t,e,r=this.getAbsoluteIndex()){}}});var Ws,br,Ke,jt,qt,yr,Ot,ut,On,Us,qn,El,He,Ds=x(()=>{"use strict";J();Ce();gr();ne();B();Ms();We();Me();Ws=[j,De()];He=class extends(El=v){constructor(e,r,n,i=[]){var S,k;let o,a=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(e);a&&(o=Number(a[1]),e=e.replace(`\0${o}h`,i[o].toString().replace(/^\n/u,"")));super(void 0,n,i,{});h(this,ut);Z(this,"modifier","");h(this,br,"template");h(this,Ke,":");h(this,jt,!1);h(this,qt,new Map);h(this,yr,0);h(this,Ot);let{parserFunction:l,variable:p,functionHook:u}=n,d=(S=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(e))==null?void 0:S[0];if(d)this.setAttribute("modifier",d),e=e.slice(d.length);else if(e.includes(":")){let[y,...T]=e.split(":"),[w]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((k=T[0])!=null?k:"");this.setModifier(`${y}:${w}`)&&(e=T.join(":").slice(w.length))}let c=e.search(/[::]/u),f=e[c]===":",m=c!==-1;if(m||r.length===0&&!g(this,jt)){let y=m?e.slice(0,c):e,T=m&&e.slice(c+1),w=z(y),F=m?w.slice(w.search(/\S/u))+(f?":":""):w.trim(),[,L,R]=zs(F,l),G=!("functionHook"in n)||u.includes(R),P=p.includes(R);if(m?R&&G:P){this.setAttribute("name",R),b(this,br,"magic-word"),f&&b(this,Ke,":");let V=new te(y,"magic-word-name",n,i);if(super.insertAt(V),T!==!1&&r.unshift([T]),this.name==="invoke")for(let _=0;_<2;_++){let X=r.shift();if(!X)break;let ae=new H(X.join("="),`invoke-${_?"function":"module"}`,n,i);super.insertAt(ae)}}}if(this.type==="template"){let y=z(e).trim();if(!this.normalizeTitle(y,10,{halfParsed:!0,temporary:!0}).valid)throw i.pop(),new SyntaxError("Invalid template name");let T=new H(e,"template-name",n,i,{});super.insertAt(T)}typeof o=="number"&&(i[o]=void 0);let A=this.isTemplate(),C=1;for(let y=0;y<r.length;y++){let T=r[y];A||this.name==="switch"&&y>0||this.name==="tag"&&y>1||(T[0]=T.join("="),T.length=1),T.length===1&&(T.unshift(C),C++),this.insertAt(new Jr(...T,n,i))}this.seal("modifier")}get type(){return g(this,br)}get module(){}get function(){}setModifier(e){let[,,r,n]=this.getAttribute("config").parserFunction,i=z(e).trim();if(e&&!i.endsWith(":"))return!1;let o=i.slice(0,-1).toLowerCase(),a=r.includes(o),l=n.includes(o);return(g(this,jt)?a:l||!e)||(ee.running||this.length>1)&&(a||l||!e)?(this.setAttribute("modifier",e),b(this,jt,a),!!e):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0)),super.afterBuild(),this.isTemplate()&&this.type==="template"&&(b(this,Ot,$(this,ut,On).call(this)),this.setAttribute("name",g(this,Ot).title))}toString(e){let{childNodes:r,length:n,firstChild:i,modifier:o,type:a}=this;return`{{${o}${a==="magic-word"?i.toString(e)+(n===1?"":g(this,Ke))+r.slice(1).map(l=>l.toString(e)).join("|"):super.toString(e,"|")}}}`}text(){let{childNodes:e,length:r,firstChild:n,modifier:i,type:o,name:a}=this;return o==="magic-word"&&a==="vardefine"?"":`{{${i}${o==="magic-word"?n.text()+(r===1?"":g(this,Ke))+ge(e.slice(1),"|"):super.text("|")}}}`}getAttribute(e){switch(e){case"padding":return this.modifier.length+2;case"title":return g(this,Ot);case"colon":return g(this,Ke);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!$(this,ut,On).call(this).valid);default:return super.getAttribute(e)}}lint(e=this.getAbsoluteIndex(),r){}insertAt(e,r=this.length){return super.insertAt(e,r),e.anon?$(this,ut,Us).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getArgs(e,r,n=!0,i=!0){let o=String(e).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),a;return g(this,qt).has(o)?a=g(this,qt).get(o):(a=new Set,g(this,qt).set(o,a)),a}getDuplicatedArgs(){}getPossibleValues(){let{type:e,name:r,childNodes:n,length:i}=this;if(e==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let o,a;switch(r){case"if":case"ifexist":case"ifexpr":o=2;break;case"ifeq":o=3;break;case"iferror":o=i>3?2:1;break;case"switch":{let l=n.slice(2),p=l[l.length-1];a=[...l.filter(({anon:u})=>!u),...p!=null&&p.anon?[p]:[]].map(({lastChild:u})=>u);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}a!=null||(a=n.slice(o,o+2).map(({lastChild:l})=>l));for(let l=0;l<a.length;){let{length:p,0:u}=a[l].childNodes.filter(d=>d.text().trim());if(p===0)a.splice(l,1);else if(p>1||!u.is("magic-word"))l++;else try{let d=u.getPossibleValues();Array.prototype.splice.apply(a,[l,1,...d]),l+=d.length}catch{l++}}return a}print(){{let{childNodes:e,length:r,firstChild:n,modifier:i,type:o}=this;return`<span class="wpb-${o}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${o==="magic-word"?Ze(i)+n.print()+(r===1?"":g(this,Ke))+Ae(e.slice(1),{sep:"|"}):(i?`<span class="wpb-magic-word">${Ze(i)}</span>`:"")+Ae(e,{sep:"|"})}}}</span>`}}};qn=I(El),br=new WeakMap,Ke=new WeakMap,jt=new WeakMap,qt=new WeakMap,yr=new WeakMap,Ot=new WeakMap,ut=new WeakSet,On=function(){let e=this.type==="template";return this.normalizeTitle((e?"":"Module:")+z(this.childNodes[e?0:1].text()),10,{temporary:!0,...!e&&{page:""}})},Us=function(e,r){b(this,yr,g(this,yr)+1);let n;n=g(this,yr)-1;let i=e,o=String(n+1);i.setAttribute("name",o),this.getArgs(o,!1,!1).add(i)},He=N(qn,0,"TranscludeToken",Ws,He),E(qn,1,He)});var Gs,_n,Nl,pt,Vs=x(()=>{"use strict";_e();ne();B();Gs=[oe(),j];pt=class extends(Nl=v){get type(){return"hidden"}getAttribute(t){return t==="invalid"||super.getAttribute(t)}};_n=I(Nl),pt=N(_n,0,"HiddenToken",Gs,pt),E(_n,1,pt)});var Hs,Wn,Il,Mn,$l,ct,Ks=x(()=>{"use strict";J();Te();gr();ne();B();We();Vs();Hs=[j,Y("{{{"),De()];ct=class extends($l=v){constructor(e,r,n=[]){super(void 0,r,n,{});h(this,Wn);for(let i=0;i<e.length;i++){let o=e[i];if(i===0){let a=new H(o,"arg-name",r,n,{});super.insertAt(a)}else if(i>1){let a=new pt(o,r,n);super.insertAt(a)}else{let a=new v(o,r,n);a.type="arg-default",a.setAttribute("stage",2),super.insertAt(a)}}}get type(){return"arg"}get default(){}toString(e){return`{{{${super.toString(e,"|")}}}}`}text(){return`{{{${ge(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){super.afterBuild()}lint(e=this.getAbsoluteIndex(),r){}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(e,r,n=this.getAbsoluteIndex()){}};Mn=I($l),Wn=new WeakSet,Il=function(){},ct=N(Mn,0,"ArgToken",Hs,ct),E(Mn,1,ct)});var to={};W(to,{parseBraces:()=>Tr});var Ll,Qs,Un,Xs,Js,Ys,eo,Zs,Tr,Yr=x(()=>{"use strict";nr();J();jn();Ds();Ks();Ll={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},Qs=String.raw`\[(?!\[)`,Un=String.raw`\n(?![=\0])`,Xs=String.raw`|\{{2,}`,Js=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),Ys=je(s=>new RegExp(s,"gmu"));eo=new RegExp(String.raw`\{\{((?:[^\n{}[]|${Qs}|${Un})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${Un})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${Qs}|${Un})*\}-`,"gu");Zs=s=>{let t=ve(z(s));return Js.has(t)?Js.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},Tr=(s,t,e)=>{var m,A,C,S,k;let r=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,[,,,n]=t.parserFunction,i=[],o=[],a=(y,T,w,F)=>{T[T.length-1].push(se(y.slice(w,F),o))},l;do l!==void 0&&(s=l),l=s.replace(eo,(y,T,w)=>{if(T!==void 0||typeof w=="string")try{let{length:F}=e,L=(T!=null?T:w).split("|");return new He(se(L[0],o),L.slice(1).map(R=>{let G=R.indexOf("=");return(G===-1?[R]:[R.slice(0,G),R.slice(G+1)]).map(P=>se(P,o))}),t,e),`\0${F}${Zs(L[0])}`}catch(F){if(!(F instanceof SyntaxError)||F.message!=="Invalid template name")throw F}return o.push(se(y,o)),`\0${o.length-1}`});while(l!==s);s=l;let p=s.lastIndexOf("}}")-s.length,u=p+s.length!==-1,d=Ys(r+(u?Xs:"")),c=d.exec(s),f;for(;c||f!==void 0&&f<=s.length&&((A=(m=i[i.length-1])==null?void 0:m[0])!=null&&A.startsWith("="));){if(c!=null&&c[1]){let[,{length:X}]=c;c[0]=c[0].slice(X),c.index+=X}let{0:y,index:T}=c!=null?c:{0:`
7
7
  `,index:s.length},w=(C=i.pop())!=null?C:{},{0:F,index:L,parts:R,findEqual:G,pos:P}=w,V=y==="="&&G;if(y==="]]"||y==="}-")f=T+2;else if(y===`
8
8
  `){f=T+1;let{pos:X,findEqual:ae}=(S=i[i.length-1])!=null?S:{};if(X===void 0||ae||z(s.slice(X,L))!==""){let xe=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(s.slice(L,T));xe&&(xe[2]=se(xe[2],o),xe[2].includes(`
9
9
  `)||(s=`${s.slice(0,L)}\0${e.length}h${s.slice(T)}`,f=L+4+String(e.length).length,new we(xe[1].length,xe.slice(2),t,e)))}}else if(y==="|"||V)f=T+1,a(s,R,P,T),y==="|"&&R.push([]),w.pos=f,w.findEqual=y==="|",i.push(w);else if(y.startsWith("}}")){let X=y.slice(0,Math.min(F.length,3)),ae=F.length-X.length,{length:xe}=e;f=T+X.length,a(s,R,P,T);let hn=!1,Pr="t";if(X.length===3){let Pe=R.map(Ri=>Ri.join("=")),jr=Pe.length>1&&z(Pe[1]).trim();new ct(Pe,t,e),jr&&jr.endsWith(":")&&n.includes(jr.slice(0,-1).toLowerCase())&&(Pr="s")}else try{new He(R[0][0],R.slice(1),t,e),Pr=Zs(R[0][0])}catch(Pe){if(!(Pe instanceof SyntaxError&&Pe.message==="Invalid template name"))throw Pe;hn=!0}hn||(s=`${s.slice(0,L+ae)}\0${xe}${Pr}${s.slice(f)}`,f=L+ae+3+String(xe).length,ae>1?i.push({0:F.slice(0,ae),index:L,pos:L+ae,parts:[[]]}):ae===1&&s[L-1]==="-"&&i.push({0:"-{",index:L-1,pos:L+1,parts:[[]]}))}else f=T+y.length,y.startsWith("{")&&(c.pos=f,c.parts=[[]]),i.push(..."0"in w?[w]:[],c);let _=i[i.length-1];if(u&&p+s.length<f)for(u=!1;(k=_==null?void 0:_[0])!=null&&k.startsWith("{");)i.pop(),_=i[i.length-1];d=Ys(r+(u?Xs:"")+(_?`|${Ll[_[0][0]]}${_.findEqual?"|=":""}`:"")),d.lastIndex=f,c=d.exec(s)}return se(s,o)}});var ro={};W(ro,{InputboxToken:()=>Dn});var Dn,no=x(()=>{"use strict";hr();Yr();Bn();Dn=class extends mr{constructor(t,e,r,n,i=[]){let o=Symbol("InputboxToken"),a=n.excludes.includes("heading")?n:{...n,excludes:[...n.excludes,"heading"]},{length:l}=i;i.push(o),r&&(r=gt(r,a,i,e)),r&&(r=Tr(r,a,i)),i.splice(l,1),super(t,e,r,a,i,{})}}});var tn={};W(tn,{NestedToken:()=>zn});var Zr,en,zn,rn=x(()=>{"use strict";hr();Yr();B();Gn();nt();zn=class extends v{constructor(e,r,n,i,o=[]){if(typeof r=="boolean"){let a=Symbol("NestedToken"),{length:l}=o;o.push(a),e&&(e=gt(e,i,o,r)),e&&(e=Tr(e,i,o)),o.splice(l,1)}else e&&(e=e.replace(r,(a,l,p,u,d)=>{let c=`\0${o.length+1}e`;return new Ee(l,p,u,d,i,!1,o),c}));e&&(e=e.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(a,l,p)=>(new Q(p,i,o),`${l}\0${o.length}n`)));super(e,i,o);h(this,Zr);h(this,en);b(this,Zr,[...n]),b(this,en,r)}get type(){return"ext-inner"}lint(e=this.getAbsoluteIndex(),r){}};Zr=new WeakMap,en=new WeakMap});function Pl(s,t,e,r,n){t=z(t).trim();let i=t.replace(s==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(s){case"width":return!i&&!!t||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(i);case"link":{let o=r==="gallery-image";if(i){if(Fl(e.protocol).test(i))return Rl(e.protocol).test(i)?t:o;i.startsWith("[[")&&i.endsWith("]]")&&(i=i.slice(2,-2))}else return t;let a=M.normalizeTitle(i,0,!1,e,{halfParsed:n,decode:!0,selfLink:!0,page:""});return a.valid?a:o}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 Fl,Rl,Bl,io,ce,Hn,jl,Vn,ql,ft,so=x(()=>{"use strict";nr();J();Tn();ne();ue();B();Fl=je(s=>new RegExp(String.raw`^(?:${s}|//|\0\d+m\x7F)`,"iu")),Rl=je(s=>new RegExp(String.raw`^(?:(?:${s}|//)${Je}|\0\d+m\x7F)${Ye}$`,"iu")),Bl=je(s=>new RegExp(String.raw`^(\s*(?!\s))${s.replace("$1","(.*)")}${s.endsWith("$1")?`(?=$|
@@ -31,8 +31,7 @@ attribute_1.AttributeToken.prototype.setValue =
31
31
  if (value.includes('"') && value.includes(`'`)) {
32
32
  throw new RangeError('Attribute values cannot contain single and double quotes simultaneously!');
33
33
  }
34
- const { childNodes } = index_1.default.parseWithRef(value, this, attribute_1.stages[type] + 1);
35
- lastChild.safeReplaceChildren(childNodes);
34
+ lastChild.safeReplaceChildren(index_1.default.parseWithRef(value, lastChild, attribute_1.stages[type] + 1).childNodes);
36
35
  this.setAttribute('equal', this.isInside('parameter') ? '{{=}}' : '=');
37
36
  if (value.includes('"')) {
38
37
  this.setAttribute('quotes', [`'`, `'`]);
@@ -47,13 +46,12 @@ attribute_1.AttributeToken.prototype.setValue =
47
46
  attribute_1.AttributeToken.prototype.rename =
48
47
  /** @implements */
49
48
  function (key) {
50
- const { type, name, tag, firstChild } = this;
49
+ const { type, name, firstChild, lastChild } = this;
51
50
  /* c8 ignore next 3 */
52
- if (name === 'title' || name === 'alt' && tag === 'img') {
51
+ if (!(lastChild instanceof atom_1.AtomToken)) {
53
52
  throw new Error(`${name} attribute cannot be renamed!`);
54
53
  }
55
- const { childNodes } = index_1.default.parseWithRef(key, this, attribute_1.stages[type] + 1);
56
- firstChild.safeReplaceChildren(childNodes);
54
+ firstChild.safeReplaceChildren(index_1.default.parseWithRef(key, this, attribute_1.stages[type] + 1).childNodes);
57
55
  };
58
56
  attribute_1.AttributeToken.prototype.css =
59
57
  /** @implements */
@@ -15,8 +15,9 @@ const atom_1 = require("../src/atom");
15
15
  base_1.LinkBaseToken.prototype.setTarget =
16
16
  /** @implements */
17
17
  function (link) {
18
- const { childNodes } = index_1.default.parseWithRef(link, this, 2), token = debug_1.Shadow.run(() => new atom_1.AtomToken(undefined, 'link-target', this.getAttribute('config'), [], { 'Stage-2': ':', '!ExtToken': '', '!HeadingToken': '' }));
19
- token.concat(childNodes); // eslint-disable-line unicorn/prefer-spread
18
+ const token = debug_1.Shadow.run(() => new atom_1.AtomToken(undefined, 'link-target', this.getAttribute('config'), [], { 'Stage-2': ':', '!ExtToken': '', '!HeadingToken': '' }));
19
+ // eslint-disable-next-line unicorn/prefer-spread
20
+ token.concat(index_1.default.parseWithRef(link, this, 2).childNodes);
20
21
  this.firstChild.safeReplaceWith(token);
21
22
  };
22
23
  base_1.LinkBaseToken.prototype.setFragment =